looking for a way to do a simple non-linear image warp
조회 수: 3 (최근 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!