Q: uniq value in an image? [message #11835] |
Fri, 29 May 1998 00:00  |
htsang
Messages: 14 Registered: September 1997
|
Junior Member |
|
|
I am using this to find the unique values in an image:
uniqPixelValue = data(uniq(data, sort(data)))
and the sorting part is taking a long time when the image is big.
Just wonder, if anyone out there has any bright idea to do this?
-- Herbert (htsang@mda.ca)
|
|
|
Re: Q: uniq value in an image? [message #11926 is a reply to message #11835] |
Sun, 31 May 1998 00:00  |
steinhh
Messages: 260 Registered: June 1994
|
Senior Member |
|
|
In article <MPG.fd92945577ce4819897bf@news.frii.com>
davidf@dfanning.com (David Fanning) writes:
David Fanning wrote:
> I I'm too tired tonight to test this, but how about something
> like this:
>
> unique_values = Where(Histogram(image) EQ 1)
> Print, (Histogram(image))[unique_values]
I think (?) Herbert Tsang wants "all distinct values" present in
his image, in that case it would mean:
min = min(image)
hist = histogram(image,min=min)
values = min + where(hist)
But of course, this only works if his image consists of integers
only. Floating point valued images would be a real mess to do
properly! If it does make sense to speak of discrete values
from a floating point image, then do convert your image to an
integer image in the first place.
Regards,
Stein Vidar
|
|
|