LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a black and white matrix based on an image taken from camera

I been working on a project in which we need to take a picture from a camera, then create a 20*10 matrix in which the only colors it can be filled with are black and white. The filling of the colors depends on how clear or dark is that part of the picture. The problem is that i can't find a way to do so. The things that i've tried are changing the image from color to 8-bit grayscale, but everything after that has never worked. I don't have any more ideas. All help is well received.

 

 

0 Kudos
Message 1 of 7
(3,635 Views)

Try image binarization and Context menu -> Palette -> Binary of the Image display.ctl

If you have vision, you do not need image to picture transformation.

If you do not have vision, use manual binarization (as you have tried)

Colors in Flatten pixmap.vi act as follows: for pixel value P it takes P-th element in Colors array and draws pixel with that color 

Binarization in attachement does not change data, only the visual display in picture (and in saved file).

 

If you picture is 20 by 10, for front panel display it may be better to use Intensity graph with Color Table property the same as Colors array

0 Kudos
Message 2 of 7
(3,620 Views)

Thanks, could you send me the .VI file to see how it works please.

0 Kudos
Message 3 of 7
(3,618 Views)

It seems, you have LV 2011, you can drag my PNG to your block diagram from windows explorer,

If not, write LV version, I'll convert

0 Kudos
Message 4 of 7
(3,615 Views)

Yes i got LV 2011 but i can't load your png into my block diagram. I already did the upper part but i cant find the way to put the binarization part. 

0 Kudos
Message 5 of 7
(3,603 Views)

Sorry. Im done with the binarization and it works great. I just want then change the image to a matrix array.

0 Kudos
Message 6 of 7
(3,600 Views)

The VI with two types of binarization. Strange, that snippet does not work.

 

> I just want then change the image to a matrix array.

Have not you done that in your vi? It is Imaq image to array

Message 7 of 7
(3,583 Views)