Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

The picture output is not recorded properly

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

0 Kudos
Message 1 of 5
(2,458 Views)

Could anyone help me please?

Thanks,

0 Kudos
Message 2 of 5
(2,426 Views)

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

Message 3 of 5
(2,418 Views)

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

 

0 Kudos
Message 4 of 5
(2,404 Views)

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

0 Kudos
Message 5 of 5
(2,395 Views)