Example Program Drafts

Showing results for 
Search instead for 
Did you mean: 

Robust Color Recognition using IMAQ


Recently I got quite interested in LabVIEW's IMAQ add-on and using it to do various image processing. I decided to start simple and try color recognition first, however none of the examples I found seemed accurate or robust enough so I decided to give it a go myself. In the end my approach looked relatively resistant to errors and noise. I was able to detect red and blue colors successfully in images and ignore unwanted shades.




This example acquires data from a camera device connected to your machine. It then extracts two separate color planes from images grabbed (e.g. Blue and Red) and performs a Logical Diff (NAND) operation on them. This allows to extract only a very specific range of colors that we are interested in. Then a threshold is applied to the 8bit image and it is then cleared from unwanted particles. Once all this is done, the VI extracts remaining particle data and checks whether object of desired size is within camera's field of view. If object of interest is found, a red rectangle is drawn around it.

Steps to Implement or Execute Code

1) Download the vi

2) Make sure you have selected your camera input in the block diagram

3) Select what colour you want to acquire and other relevant settings on the front panel (can also be adjusted while running)
Hit run

5) Try tweaking the settings to improve color detection

6) Press the "Reset Default Settings" button on the front panel to reset controls to their default values (can be changed in the block diagram)


Labview 2013
Vision Development Module




Mark N
Applications Engineer
National Instruments UK & Ireland
Member Jake183

hello, i have been having a look at this VI and was wondering if I would be able to change the camera input to that of a Kinect? Would you know how to do such a thing?

Member wkdlr778

wow, thx!!!!! , um..i want multi dection in one colour matching,, what should i do??

Member shreya111

Its really amazing ! Can u pls post vi in LabVIEW 2012 version.

Member pearli

Sir, I'm really impressed about this robust color recognition.In my project I need to recognize red, green and blue color automatically from the image.Also i need to make it efficient. what should i do? should i use color learn and matching. Send me reply as fast as u could. Longing for ur reply. Thank you in advance.

Until now i've tried thisrGB RECOG.PNG

Member pearli

Sir, can you post the reply as early as possible.Please.

Member likantropka

Hi i don't know if somebody looks here but if does could somebody convert the file to the labview 14.0 ? Please i will be very thankful