From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Filtering Out Green Background From RGB 32-bit Image

Hello all,

 

I've been searching around and testing out the IMAQ ExtractSingeColorPlane and the IMAQ ColorThreshold. I've never done anything with extracting certain colors before, and I seem to run into errors when I try wiring my image source into these IMAQ blocks.

 

Anyway, I have a VI that opens up my webcam and continuously runs it in video mode (giving me a 32bit RGB image). The VI snaps an image of what the webcam sees and converts it to grayscale, then to a binary image. The problem I've run into is due to the threshold limits it picks up the green background that my objects sit on as well as the objects. I would like to know, if possible, how I could separate the green from the image entirely so that it does not affect my particle analysis? The furthest I've gotten is for the color threshold to spit out a grayscale image, but it doesn't change no matter how I alter the ranges for red, green, or blue.
Any assistance is greatly appreciated.

 

Thanks

0 Kudos
Message 1 of 11
(5,152 Views)

I'm not sure why you are getting errors but that I don't think that has anything to do with the question that you asked.

 

First, have a look at the following example in the Example Finder (switch to directory structure):

\Vision\2. Functions\Color\Color Threshold Example.vi

 

Then, can you create an example of what you are doing and post over here so we can look at the steps that you are taking.

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
Message 2 of 11
(5,134 Views)

Hey thank you for the reply!

 

I've been using this vi as a sort of guiding tool to try to understand exactly what I'm doing.

 

I've attached what I want to do (atleast I think that's what I want logically), but I can't seem to get it right.


I've used this same kind of logic for coverting to grayscale and thresholding to create a binary image, so I'm not sure how to do it with color thresholding.

 

Thanks for your help.

 

0 Kudos
Message 3 of 11
(5,126 Views)

Can you save it for 2012 and then upload?

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 4 of 11
(5,123 Views)

Err, how do I do that? Smiley Frustrated

 

Edit: Did this work?

0 Kudos
Message 5 of 11
(5,121 Views)

File -> Save for Previous Version..

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 6 of 11
(5,115 Views)

I guess the previous post upload was incorrect. Sorry >.<

0 Kudos
Message 7 of 11
(5,112 Views)

Ah this is not going to help me. Can you please save your image and send it to me so I can figure out how to achieve what you want to do.

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 8 of 11
(5,110 Views)

So, this is what I'm trying to do. I'm just not sure what's wrong with the logic.

 

 

0 Kudos
Message 9 of 11
(5,108 Views)

Oh sorry I was asking for the actual image that you acquired. I was able to successfully open your VI.

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 10 of 11
(5,105 Views)