Fixed a crash when the image width/height parameters of the camera are modified while the camera is running.
git-svn-id: http://find-object.googlecode.com/svn/trunk/find_object@58 620bd6b2-0a58-f614-fd9a-1bd335dccda9
This commit is contained in:
parent
658cd6ebcb
commit
49d11d9212
@ -52,9 +52,10 @@ void Camera::takeImage()
|
||||
Settings::getCamera_imageHeight().toInt() != img->height)
|
||||
{
|
||||
// declare a destination IplImage object with correct size, depth and channels
|
||||
cv::Mat imgMat(cvSize(Settings::getCamera_imageWidth().toInt(), Settings::getCamera_imageHeight().toInt()),
|
||||
img->depth,
|
||||
img->nChannels );
|
||||
cv::Mat headerImg = img;
|
||||
cv::Mat imgMat(Settings::getCamera_imageHeight().toInt(),
|
||||
Settings::getCamera_imageWidth().toInt(),
|
||||
headerImg.type());
|
||||
|
||||
//use cvResize to resize source to a destination image (linear interpolation)
|
||||
IplImage resampledImg = imgMat;
|
||||
|
||||
@ -78,7 +78,7 @@ MainWindow::MainWindow(Camera * camera, QWidget * parent) :
|
||||
connect(ui_->actionLoad_objects, SIGNAL(triggered()), this, SLOT(loadObjects()));
|
||||
connect(ui_->actionAbout, SIGNAL(triggered()), aboutDialog_ , SLOT(exec()));
|
||||
|
||||
QTimer::singleShot(1000, this, SLOT(startProcessing()));
|
||||
QTimer::singleShot(10, this, SLOT(startProcessing()));
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user