I need to write a MATLAB script which takes a photo, mark 4 points (which make a 4-pointed shape, for example with ginput
), and puts another image into that frame. This process might require all standard transformations: (shear, translate, scale or rotate), as the frame is not necessarily a rectangle (most probably a rectangle being shot from some angle).
I need help in finding and implementing the geometric transformation for the image to the frame.
Any suggestions? Thanks ahead
edit: to be more specific, I'm not sure how to calculate the transformation matrix after finding the relevant 4 points (x,y) coordinate matrix, which I find by using a function I created
function [framePoints] = manualMarkPoints(Image)
figure(2)
imshow(Image, [])
title('pick 4 points for the frame, then press ENTER')
[x, y] = ginput;
framePoints = [x y];