Skip to content

Commit 5c1563b

Browse files
author
Dinar Ahmatnurov
committed
fixing build;
1 parent d2d8a5a commit 5c1563b

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

modules/latentsvm/perf/perf_cascadeclassifier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "perf_precomp.hpp"
2-
#include <opencv2/imgproc/imgproc.hpp>
2+
#include <opencv2/imgproc.hpp>
33

44
using namespace std;
55
using namespace cv;

modules/latentsvm/src/precomp.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,8 @@
5757
#include "opencv2/core/core_c.h"
5858

5959
#include "opencv2/opencv_modules.hpp"
60-
#ifdef HAVE_OPENCV_HIGHGUI
61-
#include "opencv2/highgui/highgui_c.h"
62-
#endif
60+
#include "opencv2/highgui/highgui_c.h"
61+
6362

6463
#ifdef HAVE_TEGRA_OPTIMIZATION
6564
#include "opencv2/objdetect/objdetect_tegra.hpp"

modules/latentsvm/test/test_latentsvmdetector_caskade.cpp

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include "test_precomp.hpp"
4444

4545
#include <string>
46+
#include "opencv2/highgui/highgui_c.h"
4647

4748
#ifdef HAVE_CVCONFIG_H
4849
#include "cvconfig.h"
@@ -76,8 +77,8 @@ bool CV_LatentSVMDetectorCaskadeTest::isEqual(CvRect r1, CvRect r2, int eps)
7677

7778
void CV_LatentSVMDetectorCaskadeTest::run( int /* start_from */)
7879
{
79-
string img_path = string(ts->get_data_path()) + "cat.png";
80-
string model_path = string(ts->get_data_path()) + "models_VOC2007_caskade/cat.xml";
80+
std::string img_path = std::string(ts->get_data_path()) + "cat.png";
81+
std::string model_path = std::string(ts->get_data_path()) + "models_VOC2007_caskade/cat.xml";
8182

8283
#ifdef HAVE_TBB
8384
int numThreads = 2;
@@ -140,7 +141,7 @@ class LatentSVMDetectorCaskadeTest : public cvtest::BaseTest
140141
void run(int);
141142
};
142143

143-
static void writeDetections( FileStorage& fs, const string& nodeName, const vector<lsvmc::LatentSvmDetector::ObjectDetection>& detections )
144+
static void writeDetections( FileStorage& fs, const std::string& nodeName, const std::vector<lsvmc::LatentSvmDetector::ObjectDetection>& detections )
144145
{
145146
fs << nodeName << "[";
146147
for( size_t i = 0; i < detections.size(); i++ )
@@ -152,8 +153,8 @@ static void writeDetections( FileStorage& fs, const string& nodeName, const vect
152153
fs << "]";
153154
}
154155

155-
static void readDetections( FileStorage fs, const string& nodeName,
156-
vector<lsvmc::LatentSvmDetector::ObjectDetection>& detections )
156+
static void readDetections( FileStorage fs, const std::string& nodeName,
157+
std::vector<lsvmc::LatentSvmDetector::ObjectDetection>& detections )
157158
{
158159
detections.clear();
159160

@@ -182,8 +183,8 @@ static inline bool isEqualCaskad( const lsvmc::LatentSvmDetector::ObjectDetectio
182183
}
183184

184185

185-
bool compareResults( const vector<lsvmc::LatentSvmDetector::ObjectDetection>& calc,
186-
const vector<lsvmc::LatentSvmDetector::ObjectDetection>& valid, int eps, float threshold)
186+
bool compareResults( const std::vector<lsvmc::LatentSvmDetector::ObjectDetection>& calc,
187+
const std::vector<lsvmc::LatentSvmDetector::ObjectDetection>& valid, int eps, float threshold)
187188
{
188189
if( calc.size() != valid.size() )
189190
return false;
@@ -205,13 +206,13 @@ bool compareResults( const vector<lsvmc::LatentSvmDetector::ObjectDetection>& ca
205206

206207
void LatentSVMDetectorCaskadeTest::run( int /* start_from */)
207208
{
208-
string img_path_cat = string(ts->get_data_path()) + "cat.png";
209-
string img_path_cars = string(ts->get_data_path()) + "cars.png";
209+
std::string img_path_cat = std::string(ts->get_data_path()) + "cat.png";
210+
std::string img_path_cars = std::string(ts->get_data_path()) + "cars.png";
210211

211-
string model_path_cat = string(ts->get_data_path()) + "models_VOC2007_caskade/cat.xml";
212-
string model_path_car = string(ts->get_data_path()) + "models_VOC2007_caskade/car.xml";
212+
std::string model_path_cat = std::string(ts->get_data_path()) + "models_VOC2007_caskade/cat.xml";
213+
std::string model_path_car = std::string(ts->get_data_path()) + "models_VOC2007_caskade/car.xml";
213214

214-
string true_res_path = string(ts->get_data_path()) + "results_caskad.xml";
215+
std::string true_res_path = std::string(ts->get_data_path()) + "results_caskad.xml";
215216

216217

217218
#ifdef HAVE_TBB
@@ -231,9 +232,9 @@ void LatentSVMDetectorCaskadeTest::run( int /* start_from */)
231232
// detector12 - to test case of two (several) classes 'cat' and car
232233

233234
// Load detectors
234-
lsvmc::LatentSvmDetector detector1( vector<string>(1,model_path_cat) );
235+
lsvmc::LatentSvmDetector detector1( std::vector<std::string>(1,model_path_cat) );
235236

236-
vector<string> models_pathes(2);
237+
std::vector<std::string> models_pathes(2);
237238
models_pathes[0] = model_path_cat;
238239
models_pathes[1] = model_path_car;
239240
lsvmc::LatentSvmDetector detector12( models_pathes );
@@ -246,7 +247,7 @@ void LatentSVMDetectorCaskadeTest::run( int /* start_from */)
246247

247248
// 1. Test method detect
248249
// Run detectors
249-
vector<lsvmc::LatentSvmDetector::ObjectDetection> detections1_cat, detections12_cat, detections12_cars;
250+
std::vector<lsvmc::LatentSvmDetector::ObjectDetection> detections1_cat, detections12_cat, detections12_cars;
250251
detector1.detect( image_cat, detections1_cat, 0.5);
251252
detector12.detect( image_cat, detections12_cat, 0.5);
252253
detector12.detect( image_cars, detections12_cars, 0.5);
@@ -255,7 +256,7 @@ void LatentSVMDetectorCaskadeTest::run( int /* start_from */)
255256
FileStorage fs( true_res_path, FileStorage::READ );
256257
if( fs.isOpened() )
257258
{
258-
vector<lsvmc::LatentSvmDetector::ObjectDetection> true_detections1_cat, true_detections12_cat, true_detections12_cars;
259+
std::vector<lsvmc::LatentSvmDetector::ObjectDetection> true_detections1_cat, true_detections12_cat, true_detections12_cars;
259260
readDetections( fs, "detections1_cat", true_detections1_cat );
260261
readDetections( fs, "detections12_cat", true_detections12_cat );
261262
readDetections( fs, "detections12_cars", true_detections12_cars );

0 commit comments

Comments
 (0)