Is it possible to morph a polygonal ROI into the shape of a second polygon?
5 次查看(过去 30 天)
显示 更早的评论
Hi everybody,
I was wondering (because it would be extremely helpful to a piece of code I am writing) whether it is possible to specify a region of interest in an image, using impoly for instance, and then morph/reshape this ROI into a different shape? I imagine this working by using some form of image interpolation.
What I want to do is morph an angled rectangle into a vertical rectangle of the same size, I dont want to rotate the image (I have done this already) I want to morph the data in the image (i.e. stretch/squeeze it to fit the new polygon).
Any help with this problem would be appreciated. I know Matlab can do image interpolation and can resize images etc, I just can't find a way to reshape an image...
Thanks,
Rod.
0 个评论
回答(2 个)
Image Analyst
2014-11-7
Another way is to use activecontour(). Just pass in one as the starting region, one as the ending region, and pass in different number of iterations to get different "in between" regions. See my demo, attached, which creates images like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/176540/image.jpeg)
You can see the initial polygon in the lower left, the target polygon in the upper right, and an "in between" polygon in the lower middle. How closely the boundary "Hugs" the final polygon is determined by how many iterations you tell it to do.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Read, Write, and Modify Image 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!