Go to Post When a team is a team, anything is possible - Bharat Nain [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 22-01-2012, 21:15
malachias malachias is offline
Registered User
FRC #1311
 
Join Date: Jan 2012
Location: Kell High School, Marietta, GA
Posts: 9
malachias is on a distinguished road
NI Vision Functions Documentation and Use

I have yet to find any good documentation on the C language NIVision API. Does anyone know of such a document? I have looked at NI LabView documentation and have not found it that helpful.

Absent the above documentation, perhaps someone can provide some insight on how to use some of the IMAQ functions. At present I am following the general pattern laid out the vision white paper. The WPILIB API appears to force one to work with IMAQ functions, because the *Image classes don't expose enough of the IMAQ methods. I think using particle analysis alone would have me reinventing much of what is already in IMAQ.

The first step is to construct a preliminary mask from the luminance plane of an HSLImage obtained from the AxisCamera. I exclude low luminancity pixels from the image using imaqColorThreshold using a replace value of 255 (I am using the Image from the returned MonoImage). I can write the resulting image out and FTP the file back to my computer for inspection. This part works. Next I run a size filter to exclude small particles. I use imaqSizeFilter and that appears to work. Next I use imaqConvexHull. This is the point at which I am stuck. The source image is a U8 format where values are either 0 or 255. I have inspected the source image and it looks reasonable -- a thick outlined square with some imperfections. The resulting image is black. I have not inspected the resulting image in detail. Does the convex hull method expect 0's and 1's or does it change all the 255's to 1's creating an almost black image? Or am I doing something else wrong?

A final question -- when I get an underlying Image from an ImageBase object am I responsible for disposing of it? If so, how?
Reply With Quote
  #2   Spotlight this post!  
Unread 23-01-2012, 02:39
bob.wolff68's Avatar
bob.wolff68 bob.wolff68 is offline
Da' Mentor Man
FRC #1967
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2007
Location: United States
Posts: 157
bob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nice
Re: NI Vision Functions Documentation and Use

While I don't have answers for you, I am digging in the same hole... and for me, I'm looking at NOT using the raw imaq functions. I'm looking at using the AxixCamera::GetImage followed by using ColorImage::HSLThreshold() which will give back a BinaryImage object. This is where it gets a bit fuzzy. Either you have to take this and simply run the particle analysis and stay in C++ land, or you've gotta do a BinaryImage::GetImage() at this point and pass the resulting Image* to imaqConvexHull() as the src and out to a dest Image*. Then (I think) memcpy() the destination image BACK into the src Image memory location and ultimately "trick" the BinaryImage class by having given it a substitute image ... then run the ParticleAnalysis from there. I plan on trying it both ways. The complexHull would be GREAT to have as part of it so the scoring (per the white paper) would work. If we can't do that, then it'll be more of a matter of dropping all the small particles and just moving forward without the additional scoring.

Thanks,
bob
Reply With Quote
  #3   Spotlight this post!  
Unread 23-01-2012, 07:19
malachias malachias is offline
Registered User
FRC #1311
 
Join Date: Jan 2012
Location: Kell High School, Marietta, GA
Posts: 9
malachias is on a distinguished road
Re: NI Vision Functions Documentation and Use

I found the following document that explains a lot about how to use the functions available in the IMAQ library:
NI Vision Concepts Manual
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 12:35.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi