comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: KMean Clustering of RGB Images
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: KMean Clustering of RGB Images [message #53895] Wed, 09 May 2007 07:43 Go to previous message
Mort Canty is currently offline  Mort Canty
Messages: 134
Registered: March 2003
Senior Member
helaha@gmx.net schrieb:

> Hello Mort,
> yes, the order should not play any role, but nevertheless the
> clustering of an RGB image, implemented with the example code above
> showed a dependency and that's my problem. I can't imagine why the
> CLUSTER_WTS Algorithm is sensitive to the sequence order.
> The clustering results are very stable and I think really identical,
> if the algorithm is started several times without changing the data
> sequence. Changing the data sequence leads to a very distinct and yet
> again very stable clustering result. But why is there this dependency
> on data sequence?
>
> Many thanks,
> Helmut
>

Yes, I get the same effect. I had difficulty following your code so I
reduced it to essentials (I hope):

PRO Cluster_KMean_Image
ImageName = DIALOG_PICKFILE()
CD, FILE_DIRNAME(ImageName)
READ_JPEG, ImageName, RGBImage
Info = SIZE(RGBImage)
ImageSizeX = Info[2]
ImageSizeY = Info[3]
PixelN = ImageSizeX*ImageSizeY
; optional
; RGBImage = TRANSPOSE(RGBImage, [0, 2, 1])
print, CLUST_WTS(REFORM(RGBImage, 3, PixelN), $
N_CLUSTERS = 2, N_ITERATIONS = 20)

END

It just prints out the cluster means. On a small JPEG image they are
nicely reproducible. But they should also be the same whether the
TRANSPOSE function is called or not. And as you say, they aren't. I
hesitate to think that there is a bug in CLUSTER_WTS, but just now I
don't see an alternative explanation.

- Mort
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Place a colorbar under each plot whose position is determined by !p.multi
Next Topic: Re: Place a colorbar under each plot whose position is determined by !p.multi

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 04:34:40 PDT 2025

Total time taken to generate the page: 2.23741 seconds