Exception thrown when call calibrationCamera2() with tvecs as M*1 3-channel matrix (Patch #1807)
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
fixed 3-channel output tvecs support in calibrateCamera (patch #1807)
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