Which matlab function can be used to compare spatial distribution grids?

2 views (last 30 days)
Hi,
I have two spatial distributions in a grid, so lets say a 40 x 70 matrix: each grid has the same dimensions e.g. 0.250 m on 0.5 m. I want to compare the grids and find the best overlay, one grid is a result of simulation, the other one is the real measurement.For eavluating the match I can use the mean squared difference or the mean relative difference, this is not the main issue.
One slow way to do this could be to perform all possible translation and rotations of one grid and compare it each time to the other grid. This probably could work but does not seems efficient
One function of matlab that seems interesting is cp2tform but I see that it is only applied to images, is this function suited or are there function that are more suited for this purpose, thanks for any suggestion,
regards,J

Answers (1)

Image Analyst
Image Analyst on 18 Dec 2012
I'm not sure why you're translating and rotating. Are the two images not registered (aligned)? If not, try imregister() in the Image Processing Toolbox. That's probably what I'd try first. It's more automatic than cd2tform. Alternatively you can try normxcorr2() to do normalized cross correlation but that works only for translation. I have a demo of normxcorr2 that I posted in Answers if you're interested. There are other methods if those don't work. For example, see how they find the jet in the image at the bottom of this page using the Hausdorff distance.
  1 Comment
Jürgen
Jürgen on 19 Dec 2012
Edited: Jürgen on 19 Dec 2012
Thanks for the answer, I look into the proposed solutions, a a remark: it are not really images but of course the grid data could be treated as an image, I would lose some precision when transforming my "analog" measurements. I uploaded the contourplots: http://imageshack.us/photo/my-images/16/tempdwy.jpg/

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!