Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to detect different surfaces with different colors.

Solved!
Go to solution

How can I detect different surfaces which also are of different colors, using Vision Builder AI?The goal is to detect the different models of pieces and also prevent some of them from being assembled in an incorrect model. Any suggestion? Please see the attached ZIP file which contains some samples of the different pieces I'm trying to differentiate. 

 

Thanks in advance for you support.

Joemen

0 Kudos
Message 1 of 5
(2,166 Views)

On this question, you'll have to determine two things.

 

1. A feature on each surface that differentiates it from the others, and

2. A feature that is consistent between every sample of that surface.

 

The thing that jumps out at me is the "holes" in one of the sample images you shared. You can very easily threshold that image to a binary image, then count the number of particles with the "Detect objects" step. 

 

You will need to find a pattern that is consistent over every sample of the same material. To me, those patterns in the material look semi-random, so you're not going to be able to get any good pattern matching on them. The one thing I would suggest is using the Match Colors step, which will compare the RGB color content of a region of interest to a reference color spectrum that you can define, that's the best way to potentially tell colors apart. This will also be easier if you have brighter pictures, as it looks like these example pictures are a bit dark.

C. Weeks
Product Support Engineer
NI
0 Kudos
Message 2 of 5
(2,093 Views)

Hi Connor,

 

Thanks for your response.

 

If I use Match Colors step how can I define a reference color spectrum in VBAI? if you have some sample that would be great!, I'm still a novice using this software!. And also will try to improve the brightness of the pictures. 

 

Thanks in advance.

Joemen

0 Kudos
Message 3 of 5
(2,080 Views)
Solution
Accepted by topic author JOEMEN

It's super simple to create a reference color spectrum, all you need is a "template" image, and you can match against the colors in the template. It will show you a spectrum of the colors pulled out of the template image that it's trying to match against under the Template tab in the Match Colors step.

C. Weeks
Product Support Engineer
NI
0 Kudos
Message 4 of 5
(2,061 Views)

Hi Connor,

 

Let me try will let you know the results.

 

Thanks 

 

Joemen

0 Kudos
Message 5 of 5
(2,044 Views)