Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

opencv triangulatePoints() giving NaN values

I'm trying to implement standard Structure from Motion code but the triangulatePoints is resulting in NaN values. I do the following steps -

  1. get ORB features for image 1 and image 2.
  2. Match the features.
  3. get essential matrix from the matched features and camera intrinsic info available, using findEssentialMat()
  4. using recoverPose() to get pose of camera 2. Camera 1 is assumed to be at the origin.
  5. get projection matrices for camera1 and camera2.
  6. use triangulatePoints() to get 3D points.

I have tried the Matlab triangulate() function as well with the projection matrices for camera1 and camera2 as well as matched points obtained above. In case of Matlab I get good results. But using opencv in C++ (Opencv 3.3) I get NaN values.