looking for a way to do a simple non-linear image warp
5 次查看(过去 30 天)
显示 更早的评论
i want to distort an image in a particular way. i want a rectangular selection of an image to map to a trapezoid. the top and bottom of the trapezoid are horizontal, just like the rectangle. the sides are tilted outwards when going from bottom to top of the trapezoid. i know the exact matrix conversion i need. it is:
[x1,y1,1]'= T*[x,y,xy,1]'
where T is [1,-1,2,0; 0,1,0,0; 0,0,0,1]
there is a term in the x1 part of the equation that has an 'xy' in it. i.e., the product of x and y. i think affine and projective transforms cannot do this. (please correct me if i'm wrong). i looked at geofit but i could not figure out how to get it to do it either. yet, the transformation seems fairly simple. just stretch x depending on what y is.
can anyone suggest a way to do this image warp?
thanks! j
0 个评论
回答(1 个)
Walter Roberson
2016-10-31
If it is a matter of display then you could use pcolor() or you could use surf() or patch(), feeding in the image and the transformed coordinates. That is you would be using texture mapping with a grid of transformed coordinates.
If you need to produce a new image matrix of the transformed data, then I am not sure at the moment what the best way to proceed would be.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Point Cloud Processing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!