Skip to content

Commit 2d8a192

Browse files
committed
more retrocompatible changes
1 parent 6c8b115 commit 2d8a192

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

camwizardpage1.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,11 @@ void CamWizardPage1::on_compute_clicked()
240240
if (found)
241241
break;
242242
if ( i == 1){
243-
cv::SimpleBlobDetector detector;
243+
static Ptr<SimpleBlobDetector> detector = cv::SimpleBlobDetector::create();
244244

245245
// Detect blobs.
246246
std::vector<cv::KeyPoint> keypoints;
247-
detector.detect( dial, keypoints);
247+
detector->detect( dial, keypoints);
248248

249249
/*int horz = 1;
250250
int vert = 1;
@@ -329,13 +329,13 @@ void CamWizardPage1::on_compute_clicked()
329329
msg << "Grid of " << ui->columns->value() << " X " << ui->rows->value() << " not found. Press any key.";
330330
ui->Results->append("Pattern not found. Calibration failed.");
331331
// Set up the detector with default parameters.
332-
cv::SimpleBlobDetector detector;
332+
static Ptr<SimpleBlobDetector> detector = cv::SimpleBlobDetector::create();
333333

334334
cv::threshold(raw,view, 200, 255, cv::THRESH_BINARY);
335335

336336
// Detect blobs.
337337
std::vector<cv::KeyPoint> keypoints;
338-
detector.detect( view, keypoints);
338+
detector->detect( view, keypoints);
339339

340340
// Draw detected blobs as red circles.
341341
// DrawMatchesFlags::DRAW_RICH_KEYPOINTS flag ensures the size of the circle corresponds to the size of blob

dftarea.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <QLabel>
3131
#include <QShortcut>
3232
#include <opencv2/core/core_c.h>
33+
using namespace cv;
3334

3435

3536
cv::Mat makeMask(CircleOutline outside, CircleOutline center, cv::Mat data,

dftarea.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include <string>
2929
#include "psi_dlg.h"
3030
#include "psiphasedisplay.h"
31-
using namespace cv;
31+
3232
extern void showData(const std::string& txt, cv::Mat mat, bool useLog = false);
3333
extern QImage showMag(cv::Mat complexI, bool show = false, const char *title = "FFT", bool doLog = true, double gamma = 0);
3434
extern void shiftDFT(cv::Mat &magI);

0 commit comments

Comments
 (0)