06-26-2013 04:16 AM
Hi,
How to calculate color mask image using the dominant color of the input image?
Thank you
Solved! Go to Solution.
06-26-2013 05:35 AM - edited 06-26-2013 05:41 AM
hi,
please define "color mask", this expression sounds a little like a shampoo
might it be you meant color ramp or color gradient ?
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
06-26-2013 06:02 AM
here's a quick and dirty draft. the "color ramp array" contains all colors which occur in the input image
now, implement an algorithm to get the dominat colors from the color ramp array!
06-26-2013 07:07 AM
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.
06-26-2013 07:37 AM
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
06-26-2013 10:21 AM - edited 06-26-2013 10:30 AM
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:
Regards,
Alex
06-26-2013 10:51 AM
06-26-2013 11:31 AM
So, you use the "dominant color" as a threshold for segmentation.
06-26-2013 12:35 PM
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
06-26-2013 01:49 PM
that's an interesting project!
feel free to post your code when you'll have another question