No, you cannot specify numbers of color for mean-shift. But see my bash unix shell script, kmeans, at my link below. It can do that.aigo wrote: ↑2017-08-03T03:22:39-07:00 Hi again,
I understand what the windows size does now, sorry about that.
But, is it possible to specify the number of colors it can replace originals with (the number of colors in this case can be viewed as the number of clusters).
Say, for example I select 5 colors then when computing the mean of each window size, it selects the colour nearest to the mean (color) from my pre-specified color range (5 colors)?
If there is a function, that does this already. Kindly point me there.
Best,
Aigo!
Questions mean shift noise removal and color reduction
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Questions mean shift noise removal and color reduction
Re: New: mean shift noise removal and color reduction
Hi Fred, I tried using the script but I keep on getting a white image.. I only used -n in the process.
Kindly help.
Thanks.
Aigo!
Kindly help.
Thanks.
Aigo!
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: New: mean shift noise removal and color reduction
What is your IM version and platform? What was the command line you used? Did you follow the Pointers for use on my home page?
Re: New: mean shift noise removal and color reduction
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Questions mean shift noise removal and color reduction
It should be
bash kmeans.sh -n 20 faces.png faces_k10.png
Perhaps you can post your faces.png image to some free hosting service and put the URL here so I can test your image.
bash kmeans.sh -n 20 faces.png faces_k10.png
Perhaps you can post your faces.png image to some free hosting service and put the URL here so I can test your image.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Questions mean shift noise removal and color reduction
OK. I found your image on your other question. This is what I get.
Code: Select all
kmeans -n 10 -m 10 faces.png faces_kmeans_n10_m10.png
final colors:
count,hexcolor
94425,#ECF6FDFF
37772,#CDDEF3FF
34831,#D69D7BFF
23775,#B8C9DEFF
22432,#AE7658FF
19588,#744E3EFF
17833,#EAC1A7FF
16491,#312020FF
13564,#B3B6BDFF
7589,#8B98A1FF
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Questions mean shift noise removal and color reduction
Here is the mean-shift result
And then the mean shift result processed by kmeans.
Code: Select all
convert faces.png -mean-shift 51x51+10% faces_mean_shift.png
And then the mean shift result processed by kmeans.
Code: Select all
kmeans -n 10 -m 10 faces_mean_shift.png faces_mean_shift_kmeans_n10_m10.png
final colors:
count,hexcolor
91585,#EBF7FEFF
42985,#D89F7DFF
37150,#CDDFF5FF
26843,#B5CAE2FF
20687,#AB7356FF
19686,#704C3CFF
15108,#C4BBBBFF
14849,#2D1E1FFF
12282,#F2CCB0FF
7125,#899EAAFF
Re: Questions mean shift noise removal and color reduction
Thanks so much for this and the other examples.
But I still get the white image.
Could this be a platform problem?
Thanks!
Aigo.
Re: Questions mean shift noise removal and color reduction
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Questions mean shift noise removal and color reduction
The error message you get is because you did not put the path to my script(s) in your PATH environment variable. However, that does not cause the script to fail. But I find there is a problem running the script with IM 7. I am trying to track that down now.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Questions mean shift noise removal and color reduction
I have fixed one issue. But there is a bug in IM 7 with one function when the temp images are miff, that is causing the main problem of the white image. I will have to report it to the IM developers. In the mean time, if you want to run the script, download the newest version and globally replace .miff with .png, which seems to work for me on IM 7.0.6.5 Q16 Mac OSX Sierra
Re: Questions mean shift noise removal and color reduction
Yeah..I have done that and it works perfectly.
Thanks!
Thanks!
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Questions mean shift noise removal and color reduction
I have found a workaround for the IM 7 issue. So you can download the latest version and will not have to replace .miff with .png
Re: Questions mean shift noise removal and color reduction
Aah Nice..Thanks..
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Questions mean shift noise removal and color reduction
I get these results with an unpublished process module, based on http://people.csail.mit.edu/tieu/notebo ... amerly.pdf
k-means, without SD normalisation:
k-means, with SD normalisation*:
fuzzy k-means, without SDN:
k-harmonic, without SDN:
* SD normalisation is: before the process, multiply channels by ratio of standard deviations, to make SDs roughly equal in each channel. After the process, divide by the same numbers.
k-means, without SD normalisation:
k-means, with SD normalisation*:
fuzzy k-means, without SDN:
k-harmonic, without SDN:
* SD normalisation is: before the process, multiply channels by ratio of standard deviations, to make SDs roughly equal in each channel. After the process, divide by the same numbers.
snibgo's IM pages: im.snibgo.com