Exception thrown when call calibrationCamera2() with tvecs as M*1 3-channel matrix (Patch #1807)


Added by nianchen deng almost 13 years ago. Updated almost 13 years ago.


Status:Done Start date:2012-04-16
Priority:High Due date:
Assignee:Vadim Pisarevsky % Done:

0%

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

Description

When I call calibrationCamera2() with tvecs as M*1 3-channel matrix, I got an exception:

OpenCV Error: Assertion failed (src.size == dst.size && src.channels() == dst.channels()) in unknown function
file modules\core\src\convert.cpp, line 1193

I trace into the source code and find a bug:

1if( tvecs )
2{
3    src = cvMat( 3, 1, CV_64F, solver.param->data.db + NINTRINSIC + i*6 + 3 );
4    dst = cvMat( 3, 1, CV_MAT_TYPE(tvecs->type), tvecs->rows == 1 ?
5        tvecs->data.ptr + i*CV_ELEM_SIZE(tvecs->type) : tvecs->data.ptr + tvecs->step*i );
6    cvConvert( &src, &dst );
7}

It should be:

1if( tvecs )
2{
3    src = cvMat( 3, 1, CV_64F, solver.param->data.db + NINTRINSIC + i*6 + 3 );
4    dst = cvMat( 3, 1, CV_MAT_DEPTH(tvecs->type), tvecs->rows == 1 ?
5        tvecs->data.ptr + i*CV_ELEM_SIZE(tvecs->type) : tvecs->data.ptr + tvecs->step*i );
6    cvConvert( &src, &dst );
7}


Associated revisions

Revision 682f31a0
Added by Vadim Pisarevsky almost 13 years ago

fixed 3-channel output tvecs support in calibrateCamera (patch #1807)

Revision 4fd19604
Added by Roman Donchenko over 11 years ago

Merge pull request #1807 from KonstantinMatskevich:intel_bug

History

Updated by Andrey Kamaev almost 13 years ago

  • Tracker changed from Bug to Patch
  • Description changed from When I call calibrationCamera2() with tvecs as M*1 3-channel matrix, I got an... to When I call @calibrationCamera2()@ with tvecs as M*1 3-channel matrix, I got ... More

Updated by Vadim Pisarevsky almost 13 years ago

thanks! your patch has been applied in r8257

  • Status changed from Open to Done
  • Target version set to 2.4.0
  • Assignee set to Vadim Pisarevsky

Also available in: Atom PDF