05-09-2018 04:24 AM
Hello,
I attached a vi where I tried to record a picture with the webcam, save it , then apply some analysis to detect the particles and their numbers. The original picture is saved properly, but it disappear from the front panel at the end of the vi run.
The second picture remains black and is saved as a black picture ( The vision assistant works well though and the particles count is correctly recorded).
In summary, it is a problem of plotting and saving the pictures.
Thanks,
Zied
05-10-2018 06:28 AM
Could anyone help me please?
Thanks,
05-10-2018 11:38 AM
Hi ziedhosni,
Two things - the processed image is black because you are outputting a binary image that is displayed on an 8-bit greyscale display. The image only has 0 or 1 values, but the greyscale range is from 0-255 (black to white), which effectively displays your image as black and near black. You need to configure your image display to "binary" in order to properly see the image (right click on the disiplay >> palette >> binary).
The original image is also black because it shares an image buffer with the processed image, so it gets overwritten by the processed image when you finish executing the code. Because the processed image shows up as black, the original image display also shows up as black. You need to allocate two image buffers in order to see both the original and processed image.
Angela L.
National Instruments
05-11-2018 09:12 AM - edited 05-11-2018 09:17 AM
Hi,
Is it possible to tell me how to add an additional buffer for the second image.
I see from the toolbox only the low level IMAQ buffer but I am not sure how to use these nodes with vision aquisition node that I am using in my vi above. Should I wire an IMAQ create nodes with the error wire to the vision aquisition?
Thanks,
Zied
05-11-2018 01:11 PM
Zied,
You will need to use the IMAQ Create VI (http://zone.ni.com/reference/en-XX/help/370281AA-01/imaqvision/imaq_create/) to create a new image reference. You can then place your processed image into that new image reference.
I would suggest looking at this example where the original image is shown as well as the processed image: https://forums.ni.com/t5/Example-Programs/Extract-A-User-Selectable-Part-Of-An-Image-As-New-Image/ta...