Re: correlation between images [message #66097 is a reply to message #65922] |
Fri, 03 April 2009 00:45   |
Wout De Nolf
Messages: 194 Registered: October 2008
|
Senior Member |
|
|
On Thu, 2 Apr 2009 13:56:56 -0700 (PDT), Brian Larsen
<balarsen@gmail.com> wrote:
> Run this as I think its pretty fun.
> Download this image:
> http://technabob.com/blog/wp-content/uploads/2008/03/apple_l ogo_rainbow_fruit.jpg
>
> then run the following code:
> ; .run image_registration
> read_jpeg, 'apple_logo_rainbow_fruit.jpg', img, /true
> tv, img[1, *, *]
> size = size(img, /dimen)
> cut_size = 50
> sub = img[*, 140:190, 300:350]
> ans = fltarr(size[1:2])
> FOR i = 0UL, size[1]-cut_size-1, 10 DO BEGIN
> FOR j = 0UL, size[2]-cut_size-1, 10 DO BEGIN
> ans[i, j] = c_correlate(sub, img[*, i:i+cut_size, j:j+cut_size],
> 0)
> tv, sub, i, j, /true
> tv, img[1,i:i+cut_size, j:j+cut_size], i, j
> ENDFOR
> ENDFOR
> ind=where(ans eq max(ans))
> wheretomulti, ans, ind, col, row
> tv, img[1, *, *]
> tv, sub, col, row, /true
> END
I like it :-). c_correlate starts making sense to me.
Nevertheless, c_correlate has essentially the same problem as
correlate doesn't it (i.e. the Anscombe problem).
|
|
|