Problem of 2 images with different scale and orientation

1 view (last 30 days)
Hi,
I have two images of the same object, in one image the object is erect and in the other image the object is bent. each image has a number of polygons. I have the centers of those polygons ( I have attached the images). I want to:
1. Measure the lengths of the sides of the corresponiding polygons in both imges and compare them
2. know the distance between the center of each polygon in the first image and their corresponding polygons in the second image.
I have two problems:
  1. The scale of the images are different
  2. The positions of the centers of each corresponding polygons are at different position with respect to the frame of the image.
how can I fix these problems?
Thanks for your help!

Answers (1)

Image Analyst
Image Analyst on 9 May 2019
You will need to spatially calibrate your images to real world units. See my attached demo for an example that you can adapt. You will need some known distance in your image, like a scale, or else know the total field of view.
To get the length of the sides of each shape you'll need to find the distance from the centroids to the boundary and then use findpeaks() to find the "corners". See attached shape recognition demo and adapt it.
To do your #2 you'll have to rescale one of the images to match the other and then translate it so that some part is in a known position, like the bottom most one has its centroids aligned, or the centroids of the whole backbone-like thing are aligned. Or you could just find centroids of all of them and find an deltax and deltay such that the average distance is minimized (easier than it sounds). Those are a few of the possible ways to find displacements, and I'm sure you or others could think up more ways.

Community Treasure Hunt

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

Start Hunting!