Questions tagged [homography]

A homography is an invertible mapping from points in the the real projective plane to points in the real projective plane that maps straight lines to straight lines. This tag should be used for questions related to homography transformations (pure camera rotation, planar scenes, ...) in the computer vision field.

A homography is an invertible mapping h from the real projective plane to itself such that three points x1, x2and x3 lie on the same line if and only if h(x1), h(x2) and h(x3) do. Each homography is represented in homogeneous coordinates by a non-singular 3x3 matrix H such that for any point in the real projective plane represented by a vector x it is true that h(x) = Hx.

enter image description here

When applied to every pixel the new image is a warped version of the original image.

Source: wikipedia

451 questions
48
votes
7 answers

Computing camera pose with homography matrix based on 4 coplanar points

I have 4 coplanar points in a video (or image) representing a quad (not necessarily a square or rectangle) and I would like to be able to display a virtual cube on top of them where the corners of the cube stand exactly on the corners of the video…
JimN
  • 703
  • 1
  • 6
  • 8
33
votes
3 answers

What is the difference between the fundamental, essential and homography matrices?

I have two images that are taken from different positions. The 2nd camera is located to the right, up and backward with respect to 1st camera. So I think there is a perspective transformation between the two views and not just an affine transform…
31
votes
5 answers

findHomography, getPerspectiveTransform, & getAffineTransform

This question is on the OpenCV functions findHomography, getPerspectiveTransform & getAffineTransform What is the difference between findHomography and getPerspectiveTransform?. My understanding from the documentation is that…
tetradeca7tope
  • 401
  • 1
  • 5
  • 7
27
votes
1 answer

How can you tell if a homography matrix is acceptable or not?

When using OpenCV's findHomography function to estimate an homography between two sets of points, from different images, you will sometimes get a bad homography due to outliers within your input points, even if you use RANSAC or LMEDS. // opencv…
Rui Marques
  • 6,898
  • 3
  • 48
  • 82
26
votes
2 answers

How to check if obtained homography matrix is good?

This question was already asked, but I still don't get it. I obtain a homography matrix by calling cv::findHomography from a set of points. I need to check whether it's relevant or not.The proposed method is to calculate maximum reprojection error…
lizarisk
  • 6,692
  • 9
  • 42
  • 66
24
votes
3 answers

Detecting garbage homographies from findHomography in OpenCV?

I'm using findHomography on a list of points and sending the result to warpPerspective. The problem is that sometimes the result is complete garbage and the resulting image is represented by weird gray rectangles. How can I detect when…
MB.
  • 3,815
  • 8
  • 46
  • 71
19
votes
2 answers

Homography and Affine Transformation

Hi i am a beginner in computer vision and i wish to know what exactly is the difference between a homography and affine tranformation, if you want to find the translation between two images which one would you use and why?. From papers and…
18
votes
2 answers

OpenCV Homography, Transform a point, what is this code doing?

I'm working with a homography calculated by OpenCV. I currently use this homography to transform points using the function below. This function performs the task I require however I have no clue how it actually works. Can anyone explain, line by…
Jayson
  • 221
  • 1
  • 2
  • 6
15
votes
3 answers

Extract projective homography from two Kinect depth maps

Given two consecutive 3D point clouds 1 and 2 (not the whole cloud, say 100 points selected from the cloud with OpenCV's GoodFeaturesToMatch), obtained from a Kinect depthmap, I want to compute camera's homography from 1 to 2. I understand that this…
smirkingman
  • 5,807
  • 2
  • 32
  • 45
15
votes
2 answers

Warping an image using control points

I want to convert an image using control points according to this scheme extracted from here: A and B contains the coordinates of the source an target vertices. I am computing the transformation matrix as: A = [51 228; 51 127; 191 127; 191 228]; B…
Freeman
  • 5,246
  • 2
  • 41
  • 46
14
votes
6 answers

Calculating scale, rotation and translation from Homography matrix

I am trying to calculate scale, rotation and translation between two consecutive frames of a video. So basically I matched keypoints and then used opencv function findHomography() to calculate the homography matrix. homography =…
Lakshya Kejriwal
  • 1,190
  • 4
  • 15
  • 27
14
votes
1 answer

Calculate camera world position with OpenCV Python

I want to calculate my camera's position in world coordinates. This should be fairly easy, but I don't get the results I expect. I believe I've read everything on this topic, but my code isn't working. Here's what I do: I have a camera looking at an…
b_m
  • 1,393
  • 1
  • 16
  • 29
13
votes
1 answer

RANSAC Algorithm

Can anybody please show me how to use RANSAC algorithm to select common feature points in two images which have a certain portion of overlap? The problem came out from feature based image stitching.
view
  • 547
  • 2
  • 11
  • 16
12
votes
1 answer

Camera pose estimation from homography or with solvePnP() function

I'm trying to build static augmented reality scene over a photo with 4 defined correspondences between coplanar points on a plane and image. Here is a step by step flow: User adds an image using device's camera. Let's assume it contains a…
alexburtnik
  • 7,243
  • 4
  • 27
  • 63
12
votes
2 answers

HOW TO use Homography to transform pictures in OpenCV?

I've two pictures (A and B) slightly distorted one from the other, where there are translation, rotation and scale differences between them (for example, these pictures:) Ssoooooooo what I need is to apply a kind of transformation in pic B so it…
marcelosalloum
  • 3,172
  • 3
  • 29
  • 57
1
2 3
30 31