Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

What would be the most robust way to identify/classify colors?

Hello all,

 

I'm new to both to Machine Vision and the LabVIEW Machine Vision Toolkit (although I’ve tinkering with it daily for the past 3 weeks). The first challenge I've set myself to involves color: I want to identify the color of the object that’s under the camera in a robust way using LabVIEW. I know, it is an enourmous problem.

 

Before working with “the real deal”, I’m trying the color-related VIs that LabVIEW has to offer with "pure-color" '.png' files. I know that it is a vast and complex field, where things that seem very simple are greatly complex.

 

So far, I’ve kind of discarded some ‘possible solutions’ for my problem, such as:

 

  • ColorLearn/Color spectrum: Low, Medium or High – all configurations end up incorrectly identifying a color (Ex: correctly identifies basic colors but mistakes an orange one for red);
  • color histograms: although I’m not discarding using histograms per se, I’ve found that small changes on either RGB or HSL planes drastically change the colors and I couldn’t find a pattern for identifying them (and ranges) by their histograms;
  • Pixel Value: it works for pure colored images, but not for camera taken pictures.

My last hope was to train a color classification file with a great number of color images (pure RGB-generated by according to a RAL spreadsheet), but no matter the Engine Options, the results are abysmal (both on the Color Classification Training Interface and by training on the block diagram [and that dammed feature vector…]).

 

What would be the most effective approach to robustly identify colors using LabVIEW?

 

At first, I hope to robustly identify basic colors. Then, I hope to be able to identify correctly colors like RAL 2000, 2005 and 3001.

 

I know that my problem is more related to Machine Vision concepts than to LabVIEW, but this community is great and I not only want to be a part of it but want to start contributing to it: maybe some answers here could answer questions of other shy users.

 

I'm planning to attend to the LabVIEW Machine Vision Course that we'll have here in Brazil at the end of September and I'm finishing the LabVIEW Core 1 Self-Pacing course (and hoping to start Core 2 by the end of the week).

 

Thank you in advance.

 

Vinicius.

Download All
0 Kudos
Message 1 of 3
(2,864 Views)
 


Also, you can see a LabVIEW example called "Color Classification", which is shipped with Vision Development Module and found inside Example Finder (LabVIEW > Help menu > Find Examples...).
Therefore, if you have LabVIEW and Vision Development Module installed, you can see/use the example code. There are others useful examples.

 

You can see more information on this page: What's New in the NI Vision Development Module
The topic "New Color Classification Functionality" shows the "Color Classification Training Interface", what is very similar with the "Color Classification.vi" example.

 

Maybe, these stuff can help you to start developing your application.

0 Kudos
Message 2 of 3
(2,797 Views)

Thanks for the answer, DanWilfer!

 

I had read the page you linked on your reply before (albeit not as carefully on the first time). The suggestion of not using samples of a pure color may be a game-changer (I sure hope so).

 

I am currently basing my tests on the "Color Classification" example you suggested.

For training my classifier, I've generated some images of RAL-based RGB colors with “some sprinkles” of other RALS of the "same color". For example, I’m generating, pixel by pixel, a RAL 1012 199-180-070 yellow but with pixels of RAL 1013-1018, as the image attached on this reply.

 

The trained classifier is still messing up badly some classifications, but I’ll continue trying to make it work.

 

I'll update my post as soon as I get some positive results

 

0 Kudos
Message 3 of 3
(2,770 Views)