Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Separate image to Red, Green and Blue images and filter them

I am trying to separate an image taken in white light using NI Vision Builder into 3 separate images in Red, Blue and Green respectively. The separated images show interference of other colored regions also and so I want to filter them. When I tried the Threshold filter, the output is a binary image which means nothing but data loss. I need to filter the image without data loss i.e.  an 8 bit image in the end.

 

I tried to see the histogram and this shows the interference but, there is no option of a filer to apply with the histogram.

 

Attached here is the image I am trying to separate.

 

Please help.

 

0 Kudos
Message 1 of 15
(5,660 Views)

In the color image palette, use the VI for separating an image into three color planes.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 15
(5,646 Views)

Hi Bruce..

 

Thanks but, I do not see any color image pallette.

 

Sri

0 Kudos
Message 3 of 15
(5,645 Views)

I was thinking LabVIEW.  I know Vision Assistant has the option to separate color planes, but I don't know if you can do it in VBAI.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 15
(5,627 Views)

@BruceAmmons wrote:

I was thinking LabVIEW.  I know Vision Assistant has the option to separate color planes, but I don't know if you can do it in VBAI.

 

Bruce


 

You can do this with plain LabView using the picture and the array palette:

color-separation.png

 

 

 

 colorseparation3.PNG

 

 

But I guess, that wasn't the question.

 

 

@SriMaddy, you have quite a strange image format: PNG 32 bit alpha, Green, Red, Blue

 

The LabView Standard is alpha, Red, Green, Blue.

 

 

 Maybe that is why you have issues.

 

 

 

Regards,

Alex

 

 

 

0 Kudos
Message 5 of 15
(5,617 Views)

If you want to do this in Vision Builder AI, here's a Vision Builder AI 2012 inspection that shows how to get mono 8 images of the three separate color channels using image variables. Now you can do whatever greyscale processing you want on the individual planes by adding image processing steps after each Select Image step that gets the plane of interest.

 

Hope this helps,

Brad

0 Kudos
Message 6 of 15
(5,607 Views)

@Bruce

 

Actually the picture was TIFF 32-bit. But the post service here did not accept the file type. So I had to change the format and attached here.

 

@Bruce  and @Brad

I was able to extract the images just like this but as you can see, there is interference in the pictures i.e. one picture influencing the other. For example, the red picture that started from 109 and ends with 113.5(approx) and the green from 113 to 117(approx). But if we observe them, a small signature of the red can be seen in the background of green picture. This is what I want to eliminate and so am trying to get the right filters.

 

Sri

0 Kudos
Message 7 of 15
(5,588 Views)

@Brad

This is what I have simulated and got the binary images. Please take a look and suggest some filters if you can.

 

Thanks

Sri

0 Kudos
Message 8 of 15
(5,586 Views)

One difficulty is the white background.  When you look at the red color plane, the black areas are actually the parts that aren't red, and so forth.

 

I suspect you could multiply each color plane by a percentage factor, then add them up to get the color you want.  That may not work, though.

 

Another idea: Use a Hue image to see where the different colors are.  You should get fairly distinct areas for each color and each overlap.  You could threshold the hues that go with one color, then use that as a mask on the Intensity image to extract the grayscale values.

 

How is the original image created?  That might help us figure out a way to separate the colors.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 9 of 15
(5,581 Views)

Multiplying the images by factors and adding or subtracting them might work.  I think you would have to invert the images first, though, so you are working with the numbers instead of the background.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 10 of 15
(5,577 Views)