From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

calculate color mask

Solved!
Go to solution
Hi alexderjuengere,
Definitely .

Thank you
0 Kudos
Message 11 of 31
(1,433 Views)

Kudos would be nice Smiley Wink

0 Kudos
Message 12 of 31
(1,425 Views)

Hi alexderjuengere,

                               Can you please send me the labview.vi file for the segmentation(color mask file).

 

THank you

0 Kudos
Message 13 of 31
(1,410 Views)

Hi,

 

you can use the .png snippet via drag and drop!

 

http://www.ni.com/white-paper/9330/en/

0 Kudos
Message 14 of 31
(1,405 Views)

Hi alexderjuengere,

                              When using k-mean clustering to find the dominant color in an image,for example,if i had given classes as 5,in the array there will 5 colors as output,each time when i execute the code with the same input image file,the colors in the array changes.Do you have any any solution for this or any other method to find the dominant color?.

 

I have attached the image regarding the change in color in the arrax color while executing the same input image for various time.

 

Thank you

 

 

Download All
0 Kudos
Message 15 of 31
(1,389 Views)

hi madhubalan,

 

k-means in a nutshell:

 
1. Ask user how many
clusters (classes) they'd like.
(e.g.. k=5)
 
2. Randomly guess k
initial cluster center
locations
 
3. Each datapoint finds
out which Center it’s
closest to. --> classification!
 
4. Each Center finds
the centroid of the
points it owns...
 
5. ...and jumps there
 
6. ...repeat until

terminated

 

compare: http://www.autonlab.org/tutorials/kmeans11.pdf

 

one quick solution:

have you tried to reduce the number of classes? 

 

--------------

K-means is an unsupervised learning technique.

A k-means algorithm works best, if the initial cluster centers ("ground truth" would this be called in supervised learning techniques) are decently guessed by the algorithm or "teached-in" by the user.

I haven't installed this clustering toolkit on this machine, but I think this double-array constant was related to those initial cluster centers:

 

initial.png

 

If this constant is empty, there is an automated guess, I guess.

 

 

Regards,
Alex

 

0 Kudos
Message 16 of 31
(1,377 Views)

by the way, I prefer this machine learning toolkit, because it also got visualization in 2d (XY Graph) and 3d (3d picture controls)

0 Kudos
Message 17 of 31
(1,373 Views)

Do you have any any solution for this or any other method to find the dominant color?

 

 

 

The screw you want detect is evidently quite bright due to it's well-reflecting surface and the chosen illumination.

Total reflex ion causes rather white colors, so the 3 rgb values of those particular pixels will be rather on the right side of your brightness histogram graph.

 

Speaking of histogram graphs, you should do some exploratory data analyses on your input pictures: http://www.ni.com/white-paper/4158/en/

 

This will definitely help you to localize the range of your thresholds. Regarding to thresholds: I recommend to use more than one.

 

Segmentation is a tricky task with real world data.

 

 

Regards,
Alex

0 Kudos
Message 18 of 31
(1,357 Views)

Hi alex,

           I could not able to find any other method for dominant color determination.If you have any method ,then let me know it.

But ,if i use only class 1,then dominant color remains the same for many execution step for the given input image.

 

This the link for downloading the clustering tool.https://decibel.ni.com/content/docs/DOC-4063

 

I have attached a vi file for color mask,in this file,how to determine the percentage of dominant color present in the given input image.(i have attached a input image)

 

Thank you

0 Kudos
Message 19 of 31
(1,340 Views)

But ,if i use only class 1,then dominant color remains the same for many execution step for the given input image.

 

and does this give you the expected result/color? are you fine with this?

 

 

 

I have attached a vi file for color mask,in this file,how to determine the percentage of dominant color present in the given input image.(i have attached a input image)

 

now, this sounds to be trivial:

 

                                 number of dominant color pixel

dominant color in % = ---------------------------------------------

                                 total number of pixel

 

have you given a try to my previous post at:

http://forums.ni.com/t5/LabVIEW/calculate-color-mask/m-p/2472546#M756827

 

?

 

a will look into your example later this day

 

 

Regards,
Alex

0 Kudos
Message 20 of 31
(1,332 Views)