Re: repeat.. until loops [message #15934] |
Sun, 27 June 1999 00:00 |
Craig Aranjo
Messages: 3 Registered: June 1999
|
Junior Member |
|
|
I solved it (finally!!).
For some reason it didn't like the assignment row_start = i
Why is IDL so fickle?
Craig Aranjo <aranjo@currantbun.com> wrote in message
news:377601ab.0@news1...
> Perhaps i didbn't explain this properly:
>
> half_col = col_max / 2
>
> I wanto to move radially inwards from left to right half way down the
binary
> image until i find a white pixel. Unfortuantely, the repeat...until loop
> does not terminate after it has found the white pixel... it continues
until
> it exceeds the row max value and propagtes an error. I would like it to
> return the value i of the white pixel.
>
> Any help with the code below
>
> Thanks
>
> Craig
>
>
> Craig Aranjo <aranjo@currantbun.com> wrote in message
> news:3774fe7b.0@news1...
>>
>> Why does this not work in IDL??
>>
>> repeat begin
>> if img(i, half_col) ge 245 then row_start = i $
>> else i = i + 1
>> endrep $
>> until img(i, half_col) ge 245
>>
>>
>> I am looking at a binary image for the first white pixel halfway down
the
>> image (moving inwards).
>> It always gives me an error that exceeds the maximum row valuie of the
>> image.
>>
>>
>> Any ideas.... I'm sure this is a really silly question.
>>
>>
>
>
|
|
|
Re: repeat.. until loops [message #15935 is a reply to message #15934] |
Sun, 27 June 1999 00:00  |
Craig Aranjo
Messages: 3 Registered: June 1999
|
Junior Member |
|
|
Perhaps i didbn't explain this properly:
half_col = col_max / 2
I wanto to move radially inwards from left to right half way down the binary
image until i find a white pixel. Unfortuantely, the repeat...until loop
does not terminate after it has found the white pixel... it continues until
it exceeds the row max value and propagtes an error. I would like it to
return the value i of the white pixel.
Any help with the code below
Thanks
Craig
Craig Aranjo <aranjo@currantbun.com> wrote in message
news:3774fe7b.0@news1...
>
> Why does this not work in IDL??
>
> repeat begin
> if img(i, half_col) ge 245 then row_start = i $
> else i = i + 1
> endrep $
> until img(i, half_col) ge 245
>
>
> I am looking at a binary image for the first white pixel halfway down the
> image (moving inwards).
> It always gives me an error that exceeds the maximum row valuie of the
> image.
>
>
> Any ideas.... I'm sure this is a really silly question.
>
>
|
|
|