ProjectPoints2 fails for 3xN object points / 2xN image points (Bug #1550)


Added by Phil Osteen about 13 years ago. Updated almost 13 years ago.


Status:Done Start date:
Priority:Normal Due date:
Assignee:Ilya Lysenkov % Done:

0%

Category:calibration, 3d
Target version:2.4.0
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

I couldnt find this elsewhere, so apologies if it's already been fixed. Applies to Linux x64, Opencv 2.3.1, svn6514

In the API, ProjectPoints2 claims that object points can be 3xN or Nx3 (for one-channel), likewise image points can be 2xN or Nx2.

This python code, taken from https://code.ros.org/trac/opencv/browser/trunk/opencv/tests/python/test.py?rev=2296, succeeds in one case and fails in the other (commented lines).

 1import cv
 2intrinsic_mat = cv.CreateMat(3, 3, cv.CV_32FC1);
 3distortion_coeffs = cv.CreateMat(1, 4, cv.CV_32FC1);
 4
 5cv.SetZero(intrinsic_mat)
 6intrinsic_mat[0,2] = 320.0
 7intrinsic_mat[1,2] = 240.0
 8intrinsic_mat[0,0] = 320.0
 9intrinsic_mat[1,1] = 320.0
10intrinsic_mat[2,2] = 1.0
11cv.SetZero(distortion_coeffs)
12distortion_coeffs[0,0] = 1e-1
13
14fptypes = [cv.CV_32FC1, cv.CV_64FC1]
15for t0 in fptypes:
16   for t1 in fptypes:
17      for t2 in fptypes:
18         for t3 in fptypes:
19            rotation_vector = cv.CreateMat(1, 3, t0)
20            translation_vector = cv.CreateMat(1, 3, t1)
21            object_points = cv.CreateMat(7, 3, t2)
22            image_points = cv.CreateMat(7, 2, t3)
23#            object_points = cv.CreateMat(3, 7, t2) # Fails
24#            image_points = cv.CreateMat(2, 7, t3)
25            cv.ProjectPoints2(object_points, rotation_vector, translation_vector, intrinsic_mat, distortion_coeffs, image_points)
26

Associated revisions

Revision 6d1f4bfb
Added by Ilya Lysenkov almost 13 years ago

Added projectPoints() for 3xN objectPoints and 2xN imagePoints (#1550)

Revision e389111b
Added by Roman Donchenko over 11 years ago

Merge pull request #1550 from SpecLad:flann-uninit-master

History

Updated by Alexander Shishkov about 13 years ago

  • Description changed from I couldnt find this elsewhere, so apologies if it's already been fixed. A... to I couldnt find this elsewhere, so apologies if it's already been fixed. A... More

Updated by Alexander Shishkov almost 13 years ago

  • Priority changed from High to Normal
  • Target version deleted ()
  • Description changed from I couldnt find this elsewhere, so apologies if it's already been fixed. A... to I couldnt find this elsewhere, so apologies if it's already been fixed. A... More

Updated by Alexander Shishkov almost 13 years ago

  • Assignee deleted (Vadim Pisarevsky)

Updated by Ilya Lysenkov almost 13 years ago

  • Assignee set to Ilya Lysenkov

Updated by Ilya Lysenkov almost 13 years ago

Thank you for the report and the code. This bug is fixed in r7638.

  • Status changed from Open to Done

Updated by Alexander Shishkov almost 13 years ago

  • Target version set to 2.4.0

Also available in: Atom PDF