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

Home » Public Forums » archive » Re: Help with program speed (Recursive Merging Function)
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: Help with program speed (Recursive Merging Function) [message #61219 is a reply to message #61192] Tue, 08 July 2008 13:32 Go to previous message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
Hi,

one thing you could do is to keep track of who is neighbor of whom.
Build an array with one entry per "block", identify the neighbors
(likely the Moore neighborhood, for the first step). Then, when you want
to process block N, just look in the table who are the neighbors. Do
your computation and if you merge 2 block, add the neighbors of block2
to the neighbors of block1, remove block2 from the list of neighbors of
block1 and, eventually (not required), delete the entry corresponding to
block2.

By doing this, you will NOT compare every block with every other blocks!

*************

In the meanwhile, if you want to keep using your loops, move the calls to

p2 = n_elements(blk2)
LBP_C2 = LBP_OVER_C(blk2)
hist2 = HIST_2D(LBP_C2.LBP, LBP_C2.C, max1=255, max2=bins-1)

in the "if..." section. There is no need to compute that if your blocks
are not neighbors!

Jean
[Message index]
 
Read Message
Read Message
Previous Topic: Re: shap file problem
Next Topic: 32/64 bit sav

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

Current Time: Thu Oct 09 23:43:28 PDT 2025

Total time taken to generate the page: 1.11975 seconds