LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Deticting color picle in bmp

 

I would like to have a VI report all x,y pixels coordinates in a bitmap file that are red in color. Have been trying to "hack" this by using flatten, un-flatten image, but not getting any where fast.

0 Kudos
Message 1 of 6
(3,410 Views)
Have you tried to use Extract Single Color Plane from the IMAQ ACQ package? I believe you can extract all the red pixels from your bmp that way. I know I've done it for luminance on a 8 bit greyscale image, but the function's there for colour images.

Hope I steered you the right direction.

Regards,
Anderson
0 Kudos
Message 2 of 6
(3,402 Views)
You can split the 2D pixelmap array into three arrays based on color. Then the red pixels are the ones that are red and not green and not blue. I have attached a little example on how to do that. The output is a 2D array of booleans.
Message 3 of 6
(3,396 Views)

That's nissen6!

Now I just need it to write to a text file of only the x,y cordinates of those red pixcles.

i.e.

1      1

24     12

27    14

 

0 Kudos
Message 4 of 6
(3,368 Views)
Well I can wirte it to a spreadsheet, but I am unable to figure out how to write it to a text file with the above format. Could someone help me out here?
0 Kudos
Message 5 of 6
(3,360 Views)
I would suggest you take a look at the Write to Spreadsheet File VI. This VI will write to a text file using the specified delimiter. It might also help to take a look at the LabVIEW Example Finder. Specifically take a look in the Fundamentals >> File Input and Output folder in the Example Finder. Post back if these do not help!

Mike D.
0 Kudos
Message 6 of 6
(3,343 Views)