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

Home » Public Forums » archive » Re: how many array elements with a certain value in a row
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: how many array elements with a certain value in a row [message #70275 is a reply to message #70273] Thu, 01 April 2010 06:17 Go to previous messageGo to previous message
ben.bighair is currently offline  ben.bighair
Messages: 221
Registered: April 2007
Senior Member
On Apr 1, 9:02 am, David Fanning <n...@dfanning.com> wrote:
> Jeremy Bailin writes:
>> Does anyone have a nice simple efficient solution to this problem (I
>> have a simple inefficient solution and a vague sketch in my mind of a
>> convoluted but probably efficient solution):
>
>> I have an image in which many pixels are saturated (=65535, they're
>> short unsigned). I want to treat each set of consecutive saturated
>> pixels in a row as a single unit and know how many saturated pixels in
>> a row there are. So I would like to have a list that contains (a) the
>> rightmost pixel of each set of consecutive saturated pixels, and (b)
>> how many saturated pixels there were in the set.
>
> I'm guessing you could probably work something out with
> LABEL_REGION. As for efficiency...

Hi,

That sounds right. I recall HISTOGRAM scans left to right along rows.
So a histogram of the labeled image coupled with the reverse indices
and a row look-up function to convert from index to row should provide
enough info.

Is this like a run-length-encoding you're looking for?

Cheers,Ben
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDL: problem on reading ncdf file with short type data
Next Topic: Re: Image error calculation

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

Current Time: Wed Oct 08 18:18:40 PDT 2025

Total time taken to generate the page: 0.00549 seconds