mirror of
https://github.com/opencv/opencv.git
synced 2025-01-19 23:19:23 +08:00
Bug in calibration.cpp sample
This was crashing my code: for( size_t i = 1; i < imagePoints.size(); i++ ) objectPoints.push_back(objectPoints[0]); Changed by: objectPoints.resize(imagePoints.size(),objectPoints[0]); Plus clean up on Qt code
This commit is contained in:
parent
8ada1da08c
commit
3746c48451
@ -1583,70 +1583,6 @@ void CvWindow::displayPropertiesWin()
|
||||
global_control_panel->hide();
|
||||
}
|
||||
|
||||
/*
|
||||
void CvWindow::createActionsandShortcuts()
|
||||
{
|
||||
vect_QActions.resize(10);
|
||||
|
||||
//if the shortcuts are changed in window_QT.h, we need to update the tooltip manually
|
||||
vect_QActions[0] = new QAction(QIcon(":/left-icon"),"Panning left (CTRL+arrowLEFT)",this);
|
||||
vect_QActions[0]->setIconVisibleInMenu(true);
|
||||
vect_QActions[0]->setShortcut(shortcut_panning_left);
|
||||
QObject::connect( vect_QActions[0],SIGNAL(triggered()),myview, SLOT( siftWindowOnLeft() ));
|
||||
|
||||
vect_QActions[1] = new QAction(QIcon(":/right-icon"),"Panning right (CTRL+arrowRIGHT)",this);
|
||||
vect_QActions[1]->setIconVisibleInMenu(true);
|
||||
vect_QActions[1]->setShortcut(shortcut_panning_right);
|
||||
QObject::connect( vect_QActions[1],SIGNAL(triggered()),myview, SLOT( siftWindowOnRight() ));
|
||||
|
||||
vect_QActions[2] = new QAction(QIcon(":/up-icon"),"Panning up (CTRL+arrowUP)",this);
|
||||
vect_QActions[2]->setIconVisibleInMenu(true);
|
||||
vect_QActions[2]->setShortcut(shortcut_panning_up);
|
||||
QObject::connect( vect_QActions[2],SIGNAL(triggered()),myview, SLOT( siftWindowOnUp() ));
|
||||
|
||||
vect_QActions[3] = new QAction(QIcon(":/down-icon"),"Panning down (CTRL+arrowDOWN)",this);
|
||||
vect_QActions[3]->setIconVisibleInMenu(true);
|
||||
vect_QActions[3]->setShortcut(shortcut_panning_down);
|
||||
QObject::connect( vect_QActions[3],SIGNAL(triggered()),myview, SLOT( siftWindowOnDown() ));
|
||||
|
||||
vect_QActions[4] = new QAction(QIcon(":/zoom_x1-icon"),"Zoom x1 (CTRL+Z)",this);
|
||||
vect_QActions[4]->setIconVisibleInMenu(true);
|
||||
vect_QActions[4]->setShortcut(shortcut_zoom_normal);
|
||||
QObject::connect( vect_QActions[4],SIGNAL(triggered()),myview, SLOT( resetZoom() ));
|
||||
|
||||
vect_QActions[5] = new QAction(QIcon(":/imgRegion-icon"),tr("Zoom x%1 (see label) (CTRL+X)")
|
||||
.arg(threshold_zoom_img_region)
|
||||
,this);
|
||||
vect_QActions[5]->setIconVisibleInMenu(true);
|
||||
vect_QActions[5]->setShortcut(shortcut_zoom_imgRegion);
|
||||
QObject::connect( vect_QActions[5],SIGNAL(triggered()),myview, SLOT( imgRegion() ));
|
||||
|
||||
vect_QActions[6] = new QAction(QIcon(":/zoom_in-icon"),tr("Zoom in (CTRL++)"),this);
|
||||
vect_QActions[6]->setIconVisibleInMenu(true);
|
||||
vect_QActions[6]->setShortcut(shortcut_zoom_in);
|
||||
QObject::connect( vect_QActions[6],SIGNAL(triggered()),myview, SLOT( ZoomIn() ));
|
||||
|
||||
vect_QActions[7] = new QAction(QIcon(":/zoom_out-icon"),tr("Zoom out (CTRL+-)"),this);
|
||||
vect_QActions[7]->setIconVisibleInMenu(true);
|
||||
vect_QActions[7]->setShortcut(shortcut_zoom_out);
|
||||
QObject::connect( vect_QActions[7],SIGNAL(triggered()),myview, SLOT( ZoomOut() ));
|
||||
|
||||
vect_QActions[8] = new QAction(QIcon(":/save-icon"),tr("Save current image (CTRL+S)"),this);
|
||||
vect_QActions[8]->setIconVisibleInMenu(true);
|
||||
vect_QActions[8]->setShortcut(shortcut_save_img);
|
||||
QObject::connect( vect_QActions[8],SIGNAL(triggered()),myview, SLOT( saveView() ));
|
||||
|
||||
vect_QActions[9] = new QAction(QIcon(":/properties-icon"),tr("Display properties window (CTRL+P)"),this);
|
||||
vect_QActions[9]->setIconVisibleInMenu(true);
|
||||
vect_QActions[9]->setShortcut(shortcut_properties_win);
|
||||
|
||||
if (global_control_panel->myLayout->count() == 0)
|
||||
vect_QActions[9]->setDisabled(true);
|
||||
|
||||
QObject::connect( vect_QActions[9],SIGNAL(triggered()),this, SLOT( displayPropertiesWin() ));
|
||||
|
||||
}*/
|
||||
|
||||
void CvWindow::createActions()
|
||||
{
|
||||
vect_QActions.resize(10);
|
||||
|
@ -86,8 +86,8 @@ static bool runCalibration( vector<vector<Point2f> > imagePoints,
|
||||
|
||||
vector<vector<Point3f> > objectPoints(1);
|
||||
calcChessboardCorners(boardSize, squareSize, objectPoints[0]);
|
||||
for( size_t i = 1; i < imagePoints.size(); i++ )
|
||||
objectPoints.push_back(objectPoints[0]);
|
||||
|
||||
objectPoints.resize(imagePoints.size(),objectPoints[0]);
|
||||
|
||||
calibrateCamera(objectPoints, imagePoints, imageSize, cameraMatrix,
|
||||
distCoeffs, rvecs, tvecs, flags);
|
||||
|
Loading…
Reference in New Issue
Block a user