After bounding natural images with textboxes (green), I want to apply a homography matrix (perspective correction) to project the green area to a rectangle.
Please refer to the link for the image mentioned above
How can I implement the code / call the code in
http://www.mathworks.com/matlabcentral/answers/26141-homography-matrix
Alternatively, any other possibilities of other suitable algorithms?
I can provide you with the coordinates of the bounding box, obtained with
img=imread('perspective.jpg');
imshow(img); ginput(4)
and the coordinates of the quadrangle is
ans =
23.1597 25.0459
22.0220 55.9541
164.2375 61.6427
165.3752 30.1657
You can compute the homography transformation between the two bounding boxes using the
fitgeotrans
function. You can then apply the resulting transformation to the image usingimwarp
.