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:
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
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!