LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

calculate color mask

Solved!
Go to solution

Hi,

    How to calculate color mask image using the dominant color of the input image?

 

Thank you

0 Kudos
Message 1 of 31
(4,369 Views)

hi,

please define "color mask", this expression sounds a little like a shampoo Smiley Indifferent

 

might it be you meant color ramp or color gradient ?

 

Smiley Happy

 

EDIT: yep, regarding your other post at https://forums.ni.com/t5/Machine-Vision/Dominant-color-and-color-mask/m-p/2460752#M38960

 

, you're looking for a gradient

 

 

 

0 Kudos
Message 2 of 31
(4,351 Views)

here's a quick and dirty draft. the "color ramp array"  contains all colors which occur in the input image

 

 

2013-06-26_color ramp.png

 

 

now, implement an algorithm to get the dominat colors from the color ramp array!

 

 

 

 

0 Kudos
Message 3 of 31
(4,338 Views)

Hi alexderjuengere,

                           I am using the same techniques used in the pdf(attached) to calculate the color mask using dominant color.

In the above posted file your are using .png file as input,but i am using .bmp image file as an input image.so i used k-mean clustering to find the dominant color.   

0 Kudos
Message 4 of 31
(4,323 Views)

Hi alexderjuengere,

                            In the attached pdf(previous post).In fig.5(b),color mast image.Using the k-mean clustering i could able to find the dominant of the input image,but can you help in getting the same output as shown in fig.5(b).

 

i ahve attached the vi file to determine the dominant color.

 

Thank you

0 Kudos
Message 5 of 31
(4,317 Views)

In the above posted file your are using .png file as input,but i am using .bmp image file as an input image

on the same palette there's also a "read from bmp.vi" - you can change it directly with the "read from png.vi" that I used in the snippet.

 

In the attached pdf(previous post).In fig.5(b),color mast image.Using the k-mean clustering i could able to find the dominant of the input image,but can you help in getting the same output as shown in fig.5(b).

what's a "color mast image" supposed to be?

is a "color mast image" a binary image?

 

 

 

 

I don't have the Vision Toolkit, so please let's work with this:

2013-06-26_color ramp2.png

 

 

 2013-06-26_color ramp2 result.png

 

 

 

 

Regards,
Alex

0 Kudos
Message 6 of 31
(4,304 Views)
Hi alexderjuengere,
I think it is color mask image, they typed it wrongly as mast.The flow chart in the PDF says it as color mask image.
color mask image is a binary image.

From what I understood from that pdf about color mask image is after finding the dominant color from the input image,i.e top 80 percentage of the color histogram is considered as dominant color and then color mask is set 1, if the input image color is included in the dominant color

Thank you.
0 Kudos
Message 7 of 31
(4,298 Views)
Solution
Accepted by topic author Madhubalan

So, you use the "dominant color" as a threshold for segmentation.

 

2013-06-26_color ramp3.png

 

 

 

2013-06-26_result.PNG

Message 8 of 31
(4,289 Views)

Hi alexderjuengere,

                            Yes,dominant color is used.my task is similar to the task in that pdf,in that they will finally mark the printer as the target object,in my work i have to mark the screw as the target object.

 

I have attached the my input image.

 

Thank you

0 Kudos
Message 9 of 31
(4,278 Views)

that's an interesting project!

 

feel free to post your code when you'll have another question

0 Kudos
Message 10 of 31
(4,270 Views)