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

Home » Public Forums » archive » Re: Speed Improvement
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: Speed Improvement [message #74583 is a reply to message #74582] Tue, 25 January 2011 04:59 Go to previous messageGo to previous message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On Jan 25, 4:24 am, Rony K Varghese <ronykvargh...@gmail.com> wrote:
> Dear All,
>
> How can i improve the speed of below IDL source through code
> optimizing..Now the performance is not satisfactory..
>
> ;Processing a picture
> for sCount = 0, 9 do begin
>         for sRow = UpperRow, LowerRow do begin
>             for sCol = sLeftCol, sRightCol do begin
>                 ; Check whether high pixels.
>                 if E_F_ATTNMAP_HIGH_PIXEL eq PixelArr[sCol, sRow] then
> begin
>                     sXCol = sCol
>                     sYRow = sRow
>                 endif
>                 ; from the center to the left
>                 for sIndex = 0, sHalfWid do begin
>                     if HIGH_PIXEL eq vTemp[sXCol - sIndex, sYRow] then
> begin
>                         PixelArr[sXCol - sIndex, sYRow] = HIGH_PIXEL
>                     endif else begin
>                         break ; break from for sIndex
>                     endelse
>                 endfor
>                 ; from the center to the right
>                 for sIndex = 0, sHalfWid do begin
>                     if HIGH_PIXEL eq vTemp[sXCol + sIndex, sYRow] then
> begin
>                         PixelArr[sXCol + sIndex, sYRow] = HIGH_PIXEL
>                     endif else begin
>                         break ; break from for sIndex
>                     endelse
>                 endfor
>                 ; from the center to  down
>                 for sIndex = 0, sHalfHght do begin
>                     if HIGH_PIXEL eq vTemp[sXCol, sYRow+ sIndex] then
> begin
>                         PixelArr[sXCol, sYRow+ sIndex] = HIGH_PIXEL
>                     endif else begin
>                         break ; break from for sIndex
>                     endelse
>                 endfor
>                 ; from the center to up
>                 for sIndex = 0, sHalfHght do begin
>                     if HIGH_PIXEL eq vTemp[sXCol, sYRow - sIndex] then
> begin
>                         PixelArr[sXCol, sYRow - sIndex] = HIGH_PIXEL
>                     endif else begin
>                         break ; break from for sIndex
>                     endelse
>                 endfor
>             endfor; end for sCol
>         endfor; end for sRow
>     endfor;end for sCount
>
> Thanks in advance..
> Rony

It might help if you could get a sketch of what this is supposed to
do.

-Jeremy.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Crashes in IDL 7.1 & 8.0, interactive + VM mode, linux and Mac OS X
Next Topic: Re: IDL books for beginners

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

Current Time: Wed Oct 08 13:38:52 PDT 2025

Total time taken to generate the page: 0.00400 seconds