repeat.. until loops [message #15937] |
Sat, 26 June 1999 00:00  |
Craig Aranjo
Messages: 3 Registered: June 1999
|
Junior Member |
|
|
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 #16107 is a reply to message #15937] |
Mon, 28 June 1999 00:00  |
Pavel Romashkin
Messages: 166 Registered: April 1999
|
Senior Member |
|
|
Hi Craig,
In the code you sent "i" is not defined. If it is not defined earlier, then
indexing and assigning will fail. Also, why not use WHERE function since
you leave the "repeat" loop anyway once you located the pixel you want?
Good luck,
Pavel
Craig Aranjo wrote:
> 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.
|
|
|