decomposeHomographyMat isn't working

asked 2019-03-13 03:20:44 -0600

viohh gravatar image

updated 2019-03-13 04:03:28 -0600

I used findHomography, then:

int solutions = decomposeHomographyMat (H, K, R, T, N);

But this doesn't work properly. Rotation matrix has only "-nan" values. Homography martix is ok. It has values like:

2.44486e-39, 0.0466184, 1.25152e+23

I've tried to use unit matrix instead of homography, but it also didn't work.

edit retag flag offensive close merge delete

Comments

1.25152e+23

definitely not ok. ;(

can you come up with a short, reproducable example (data / code) ?

berak gravatar imageberak ( 2019-03-13 04:01:28 -0600 )edit

So this is a problem of Homography matrix?

viohh gravatar imageviohh ( 2019-03-13 04:03:57 -0600 )edit

how did you obtain the homography ?

berak gravatar imageberak ( 2019-03-13 04:07:39 -0600 )edit
viohh gravatar imageviohh ( 2019-03-13 04:14:32 -0600 )edit

H = findHomography(features_prev, features_next, CV_LMEDS);

I used this, I also tried ransac, but result was the same.

viohh gravatar imageviohh ( 2019-03-13 04:15:53 -0600 )edit

please EDIT your question, and put your code there, not on an external pastebin

berak gravatar imageberak ( 2019-03-13 04:22:19 -0600 )edit
  • your camera matrix is shite (can't use identity here, look it up, ..)
  • you neither check keypoints, nor optflow for validity / outliers
  • opencv uses BGR, not RGB

so, shit in, shit out ....

berak gravatar imageberak ( 2019-03-13 04:26:25 -0600 )edit

Understandable

viohh gravatar imageviohh ( 2019-03-13 04:31:44 -0600 )edit