how to create a loop? [message #38482] |
Thu, 11 March 2004 07:09 |
Thomas Nehls
Messages: 24 Registered: March 2004
|
Junior Member |
|
|
Hi,
I want to create a loop, in which an array is filled pixel by pixel.
Like this a(n) = a(n-1) + C*d
I tried this
new = indgen(3,400,400)
runner= indgen(3,400,400)
FOR g= 0,255 DO BEGIN
grey = imageA[2,*,*] eq g ; so grey is my mask, containing the greylevel
FOR j=0,2 DO BEGIN
new[j,*,*] = runner[j,*,*] + imageB[j,*,*]*grey ; Image B contains
the colors I want to employ
new = runner
ENDFOR
ENDFOR
My questions: (i)is the runner appropriate to do what I want or are
there better ways to do this?
(ii) is the "+" the right way to fill the array pixel by pixel?
The results were not very exciting, I got a grey diagonal striped image...
Thank you very much
Tom
|
|
|