Object Detection  5.0
Image Processing Using Qt and Opencv
tst_imageprocessortest.cpp
1 #include <QString>
2 #include <QtTest>
3 #include "ImageProcessor/objectdetection.h"
4 #include "ImageProcessor/abstractimageprocessor.h"
5 #include "ImageProcessor/detectcircle.h"
6 #include <memory>
7 #include <QVariant>
8 class ImageProcessorTest : public QObject
9 {
10  Q_OBJECT
11 // TODO WRITE ImageProcessing Unit Testing
12 public:
14 
15 private Q_SLOTS:
16  void TestImageProcessor();
17  void TestImageProcessor_data();
18 };
19 
20 ImageProcessorTest::ImageProcessorTest()
21 {
22 
23 }
24 
25 void ImageProcessorTest::TestImageProcessor()
26 {
27  QFETCH(QString, ImgSrc);
28  QScopedPointer<AbstractImageProcessor> pro(new ImageProcessor::DetectCircle(this));
29  pro->setImg(cv::imread(ImgSrc.toStdString().data()));
30  QVERIFY2(!pro->getImg().empty(), "The Image Is Empty");
31 }
32 
33 void ImageProcessorTest::TestImageProcessor_data()
34 {
35  QTest::addColumn<QString>("ImgSrc");
36  QTest::newRow("data") << QString("E:\\1.png");
37 }
38 
39 QTEST_APPLESS_MAIN(ImageProcessorTest)
40 
41 #include "tst_imageprocessortest.moc"
this class is used To Detect circles in an image
Definition: detectcircle.h:12