Similarity between two 2D-shapes

Hello,
After proceeding to a segmentation of 2 consecutive (in time) images, I obtain 2 BW images, whose white regions are forming some 2D-patches. I would like to determine the change of position of each patch between the first and second image, and then calculate its velocity, in many points of the patch if possible, since its shape is gonna change a little bit. So, I'd need an algorithm which is able to determine that a given patch in image 1 corresponds to a patch in image 2, by comparing the shape of the contour of the patch. A difficulty I have to take into account is that it is possible that patches are not complete, cut by the border of the image, and so patch size is gonna be increased/decreased between the 2 images.
I hope my description of the problem is clear enough, so that someone will able to help me.
Thanks,
Sylvain

4 Comments

Your description is reasonably clear, but without an example and some more boundary conditions it is difficult to say whether this is almost trivial, or almost impossible.
Sylvain Hauser
Sylvain Hauser on 25 Oct 2017
Edited: Sylvain Hauser on 25 Oct 2017
Thanks for your reply.
What do you mean with the "boundary conditions"?
For now, I just have one picture to show you, and not 2 consecutive ones, but you can easily imagine the second one as a replica of the first one, however with a slight translation and deformation of the patch (in white).
I hope that it will help you to understand the exact situation.
With boundary condition I mean things like if the shapes can be assumed to have a relative small movement from frame to frame. If so, you can use regionprops to find the center, and use that as the seed for the next frame. As to how you would measure velocity for different parts of the patches, I don't have any ideas yet.
I've already thought of this solution, but it won't work in the case when a patch is cut by the edge of the picture. However, I think that we can assume that the shapes have a small movement.

Sign in to comment.

Answers (1)

Scott Weidenkopf
Scott Weidenkopf on 30 Oct 2017
This sounds like a good use case for the Computer System Vision Toolbox, which includes a BlockMatcher object that should be exactly what you need. The link below directs to its documentation page:
https://www.mathworks.com/help/vision/ref/vision.blockmatcher-system-object.html#bse8yed-6
BlockMatcher objects estimate motion between two images or video frames, and it should function properly even if your blobs are different sizes in the two images due to being 'chopped' by the image boundary.

Asked:

on 19 Oct 2017

Answered:

on 30 Oct 2017

Community Treasure Hunt

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

Start Hunting!