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

Home » Public Forums » archive » correlation of single pixels
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: correlation of single pixels [message #82029 is a reply to message #81971] Mon, 12 November 2012 10:40 Go to previous messageGo to previous message
Klemen is currently offline  Klemen
Messages: 80
Registered: July 2009
Member
Hi Max,

no x and y are in this case just the regression variables. See:
https://groups.google.com/forum/?fromgroups=#!topic/comp.lan g.idl-pvwave/F2E8cLePGsQ

Computing correlation using IDL function CORRELATE is ok, if you have to do it once. But here you have to do it within each area of interest a couple of times (considering set of possible offsets in x and y direction) so you have to use 4 FOR loops which will run slow!

Thus you should ask yourself first, how large is the data set you want to process. If you are sure that your offset are not larger than 2 pixels, then you might go for the slow version. That would be something like:

results_corr = make_array(...
results_offx = make_array(...
results_offy = make_array(...
FOR xall=xstart,xend do begin
FOR yall=ystart,yend do begin
search_area = data[xall-search_size:yall+search_size]
template = data[xall-template_size:yall+template_size]
FOR xoff=-search_size:search_size do begin
FOR yoff=-search_size:search_size do begin
data = (shift(search_area, xoff, yoff))[right indeice]
corr = correlate(data[*], template[*])
if corr gt results_corr[xall, yall] then begin
results_corr[xall, yall] = corr
results_offx[xall, yall] = xoff
results_offy[xall, yall] = yoff
endif
endfor
endfor
endfor
endfor
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Crashing ROI's
Next Topic: Re: Beginner: Oplot line t^(-5/3)

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

Current Time: Sat Oct 11 12:56:23 PDT 2025

Total time taken to generate the page: 0.56701 seconds