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

Home » Public Forums » archive » Faster than looping?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Faster than looping? [message #16974] Thu, 26 August 1999 00:00
Richard Tyc is currently offline  Richard Tyc
Messages: 69
Registered: June 1999
Member
I am not that well versed yet on IDL subscript semantics but I am
learning!

Is there a faster way of doing the following for-loop code (it basically
looks for yellow in an RGB image and turns it white with intensity 254 .

img = bytarr(3,512,512)

for j=0,511 do begin
for k=0,511 do begin
if (img[0,j,k] eq 255 and img[1,j,k] eq 255 and img[2,j,k] eq 0)
then begin
img[0,j,k] = 254
img[1,j,k] = 254
img[2,j,k] = 254
endif
endfor
endfor


Thanks in advance

Rich
  • Attachment: richt.vcf
    (Size: 0.29KB, Downloaded 53 times)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Faster than looping?
Next Topic: Resetting data in IDLgrVolume object

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

Current Time: Sat Oct 11 07:03:47 PDT 2025

Total time taken to generate the page: 0.23940 seconds