Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to obtain correct homography values?

I have 2 images and trying to find homography. For this I use findHomography function. Below is the code

im_src = cv2.imread('img1.jpg') 
pts_src = np.array([[1174,457], [1226, 410], [1278, 363],[1331, 315]]) 

im_dst = cv2.imread('img2.jpg')
pts_dst = np.array([[1118, 677],[1167, 640],[1216, 603],[1266, 566]])

h, status = cv2.findHomography(pts_src, pts_dst)
print(h)

The problem is that gives negative values. My H is:

[[ 1.10477291e+00 1.07314763e-01 -4.94501089e+01] [ 6.79069481e-03 1.37522045e+00 -4.52332274e+02] [-4.34205991e-06 1.11550429e-04 1.00000000e+00]]

How can I obtain correct H values?

How to obtain correct homography values?

I have 2 images and trying to find homography. For this I use findHomography function. Below is the code

im_src = cv2.imread('img1.jpg') 
pts_src = np.array([[1174,457], [1226, 410], [1278, 363],[1331, 315]]) 

im_dst = cv2.imread('img2.jpg')
pts_dst = np.array([[1118, 677],[1167, 640],[1216, 603],[1266, 566]])

h, status = cv2.findHomography(pts_src, pts_dst)
print(h)

The problem is that gives negative values. My H is:

[[ 1.10477291e+00 1.07314763e-01 -4.94501089e+01] [ 6.79069481e-03 1.37522045e+00 -4.52332274e+02] [-4.34205991e-06 1.11550429e-04 1.00000000e+00]]

1.00000000e+00]]

I tried CV_RANSAC with different parameters, but it still gives negative values. How can I obtain correct H values?

How to obtain correct homography values?

I have 2 images and trying to find homography. For this I use findHomography function. Below is the code

im_src = cv2.imread('img1.jpg') 
pts_src = np.array([[1174,457], [1226, 410], [1278, 363],[1331, 315]]) 

im_dst = cv2.imread('img2.jpg')
pts_dst = np.array([[1118, 677],[1167, 640],[1216, 603],[1266, 566]])

h, status = cv2.findHomography(pts_src, pts_dst)
print(h)

The problem is that gives negative values. My H is:

[[ 1.10477291e+00 1.07314763e-01 -4.94501089e+01] [ 6.79069481e-03 1.37522045e+00 -4.52332274e+02] [-4.34205991e-06 1.11550429e-04 1.00000000e+00]]
I tried CV_RANSAC with different parameters, but it still gives negative values. values.
How So my question is how can I obtain correct H values?

How to obtain correct homography values?

I have 2 images and trying to find homography. For this I use findHomography function. Below is the code

im_src = cv2.imread('img1.jpg') 
pts_src = np.array([[1174,457], [1226, 410], [1278, 363],[1331, 315]]) 

im_dst = cv2.imread('img2.jpg')
pts_dst = np.array([[1118, 677],[1167, 640],[1216, 603],[1266, 566]])

h, status = cv2.findHomography(pts_src, pts_dst)
print(h)

The problem is that gives negative values. My H is:

[[ 1.10477291e+00 1.07314763e-01 -4.94501089e+01] [ 6.79069481e-03 1.37522045e+00 -4.52332274e+02] [-4.34205991e-06 1.11550429e-04 1.00000000e+00]]

I tried CV_RANSAC with different parameters, but it still gives negative values.
So my question is how can I obtain correct H values?