MATLAB: How to change image shape in form of V

image filterMATLABperspective

Filters, such as fisheye filter can shape the image with fisheye distortion. Is there a filter in which the image can look squeezed from bottom and wide from top? Such as a V?

Best Answer

Use imwarp with a projective2d transform:
I = checkerboard(40);
transform = fitgeotrans([1, 1; size(I, 2), 1; 1, size(I, 1); size(I)], ...
[1, 1; size(I, 2), 1; 100, size(I, 1); size(I, 2)-100, size(I, 1)], ...
'projective');
imshowpair(I, imwarp(I, transform), 'montage')
Related Question