|
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?
|