Search code examples
imagematlabhomography

How to augument an image using homograph matrix in matlab


My problem is like this : I have an image of the checker board . Using ginput,i calculated the camera coordinates.I have the world coordinates given.So,from image's world coordinates and camera coordinates , i calculated the homography matrix . Now i would like to insert a new image into the image of checker board using the calculated homography. The image shouldn't look like its inserted.

Can someone help me on this ? I am doing this in Matlab.


Solution

  • Assuming we have rotation (R) and translation (t) matrices, following code segment can be used to transform a set of coordinates (assume x,y,z coordinates are stored in data).

    data = R * data;
    data = [data(1,:) + t(1); data(2,:) + t(2); data(3,:) + t(3)];
    

    Please provide us more details about your code and inputs if this is not clear.