Skip to content

Commit 5e7dad4

Browse files
author
Dinar Ahmatnurov
committed
some fixes;
1 parent b450328 commit 5e7dad4

File tree

6 files changed

+32
-32
lines changed

6 files changed

+32
-32
lines changed

modules/latentsvm/include/opencv2/latentsvm/latentsvm.hpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@
4242
#ifndef __OPENCV_OBJDETECT_HPP__
4343
#define __OPENCV_OBJDETECT_HPP__
4444

45-
#include "opencv2/core/core.hpp"
45+
#include "opencv2/core.hpp"
46+
#include "opencv2/core/core_c.h"
4647

4748
#ifdef __cplusplus
4849
#include <map>
4950
#include <vector>
51+
#include <string>
5052
#endif
5153

5254
extern "C" {
@@ -114,8 +116,7 @@ typedef struct CvLatentSvmDetectorCaskade
114116
float score_threshold;
115117
float *pca;
116118
int pca_size;
117-
}
118-
CvLatentSvmDetectorCaskade;
119+
} CvLatentSvmDetectorCaskade;
119120

120121
// data type: STRUCT CvObjectDetection
121122
// structure contains the bounding box and confidence level for detected object
@@ -216,23 +217,23 @@ class CV_EXPORTS LatentSvmDetector
216217
};
217218

218219
LatentSvmDetector();
219-
LatentSvmDetector( const vector<string>& filenames, const vector<string>& classNames=vector<string>() );
220+
LatentSvmDetector( const std::vector<std::string>& filenames, const std::vector<std::string>& classNames=std::vector<std::string>() );
220221
virtual ~LatentSvmDetector();
221222

222223
virtual void clear();
223224
virtual bool empty() const;
224-
bool load( const vector<string>& filenames, const vector<string>& classNames=vector<string>() );
225+
bool load( const std::vector<std::string>& filenames, const std::vector<std::string>& classNames=std::vector<std::string>() );
225226

226227
virtual void detect( const Mat& image,
227-
vector<ObjectDetection>& objectDetections,
228+
std::vector<ObjectDetection>& objectDetections,
228229
float overlapThreshold=0.5f);
229230

230-
const vector<string>& getClassNames() const;
231+
const std::vector<std::string>& getClassNames() const;
231232
size_t getClassCount() const;
232233

233234
private:
234-
vector<CvLatentSvmDetectorCaskade*> detectors;
235-
vector<string> classNames;
235+
std::vector<CvLatentSvmDetectorCaskade*> detectors;
236+
std::vector<std::string> classNames;
236237
};
237238
}
238239
} // namespace cv

modules/latentsvm/perf/perf_precomp.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
#ifndef __OPENCV_PERF_PRECOMP_HPP__
1010
#define __OPENCV_PERF_PRECOMP_HPP__
1111

12-
#include "opencv2/ts/ts.hpp"
13-
#include "opencv2/objdetect/objdetect.hpp"
14-
#include "opencv2/highgui/highgui.hpp"
12+
#include "opencv2/ts.hpp"
13+
#include "opencv2/objdetect.hpp"
14+
#include "opencv2/highgui.hpp"
1515

1616
#ifdef GTEST_CREATE_SHARED_LIBRARY
1717
#error no modules except ts should have GTEST_CREATE_SHARED_LIBRARY defined

modules/latentsvm/samples/latentsvm_multidetect_caskad.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#include <iostream>
2-
#include "opencv2/ts/ts.hpp"
3-
#include "opencv2/latentsvm/latentsvm.hpp"
4-
#include "opencv2/highgui/highgui.hpp"
5-
#include "opencv2/imgproc/imgproc.hpp"
6-
#include "opencv2/contrib/contrib.hpp"
2+
#include "opencv2/ts.hpp"
3+
#include "opencv2/latentsvm.hpp"
4+
#include "opencv2/highgui.hpp"
5+
#include "opencv2/imgproc.hpp"
6+
#include "opencv2/contrib.hpp"
77

88
#ifdef WIN32
99
#include <io.h>

modules/latentsvm/src/lsvmc_latentsvmdetector.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ CvSeq* cvLatentSvmDetectObjectsCaskade(IplImage* image,
183183
{
184184
CvObjectDetection detection = {{0, 0, 0, 0}, 0};
185185
detection.score = scoreOut[i];
186-
CvRect bounding_box = {0, 0, 0, 0};
186+
CvRect bounding_box(0, 0, 0, 0);
187187
bounding_box.x = pointsOut[i].x;
188188
bounding_box.y = pointsOut[i].y;
189189
bounding_box.width = oppPointsOut[i].x - pointsOut[i].x;
@@ -214,7 +214,7 @@ LatentSvmDetector::ObjectDetection::ObjectDetection( const Rect& _rect, float _s
214214
LatentSvmDetector::LatentSvmDetector()
215215
{}
216216

217-
LatentSvmDetector::LatentSvmDetector( const vector<string>& filenames, const vector<string>& _classNames )
217+
LatentSvmDetector::LatentSvmDetector( const std::vector<std::string>& filenames, const std::vector<std::string>& _classNames )
218218
{
219219
load( filenames, _classNames );
220220
}
@@ -238,7 +238,7 @@ bool LatentSvmDetector::empty() const
238238
return detectors.empty();
239239
}
240240

241-
const vector<string>& LatentSvmDetector::getClassNames() const
241+
const std::vector<std::string>& LatentSvmDetector::getClassNames() const
242242
{
243243
return classNames;
244244
}
@@ -248,13 +248,13 @@ size_t LatentSvmDetector::getClassCount() const
248248
return classNames.size();
249249
}
250250

251-
string extractModelName( const string& filename )
251+
std::string extractModelName( const std::string& filename )
252252
{
253253
size_t startPos = filename.rfind('/');
254-
if( startPos == string::npos )
254+
if( startPos == std::string::npos )
255255
startPos = filename.rfind('\\');
256256

257-
if( startPos == string::npos )
257+
if( startPos == std::string::npos )
258258
startPos = 0;
259259
else
260260
startPos++;
@@ -266,15 +266,15 @@ string extractModelName( const string& filename )
266266
return filename.substr(startPos, substrLength);
267267
}
268268

269-
bool LatentSvmDetector::load( const vector<string>& filenames, const vector<string>& _classNames )
269+
bool LatentSvmDetector::load( const std::vector<std::string>& filenames, const std::vector<std::string>& _classNames )
270270
{
271271
clear();
272272

273273
CV_Assert( _classNames.empty() || _classNames.size() == filenames.size() );
274274

275275
for( size_t i = 0; i < filenames.size(); i++ )
276276
{
277-
const string filename = filenames[i];
277+
const std::string filename = filenames[i];
278278
if( filename.length() < 5 || filename.substr(filename.length()-4, 4) != ".xml" )
279279
continue;
280280

@@ -295,7 +295,7 @@ bool LatentSvmDetector::load( const vector<string>& filenames, const vector<stri
295295
}
296296

297297
void LatentSvmDetector::detect( const Mat& image,
298-
vector<ObjectDetection>& objectDetections,
298+
std::vector<ObjectDetection>& objectDetections,
299299
float overlapThreshold)
300300
{
301301
objectDetections.clear();

modules/latentsvm/src/precomp.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,13 @@
5252
#endif
5353

5454
#include "opencv2/latentsvm/latentsvm.hpp"
55-
#include "opencv2/imgproc/imgproc.hpp"
55+
#include "opencv2/imgproc.hpp"
5656
#include "opencv2/imgproc/imgproc_c.h"
5757
#include "opencv2/core/core_c.h"
58-
#include "opencv2/core/internal.hpp"
5958

6059
#include "opencv2/opencv_modules.hpp"
6160
#ifdef HAVE_OPENCV_HIGHGUI
62-
# include "opencv2/highgui/highgui.hpp"
61+
#include "opencv2/highgui/highgui_c.h"
6362
#endif
6463

6564
#ifdef HAVE_TEGRA_OPTIMIZATION

modules/latentsvm/test/test_precomp.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
#ifndef __OPENCV_TEST_PRECOMP_HPP__
1010
#define __OPENCV_TEST_PRECOMP_HPP__
1111

12-
#include "opencv2/ts/ts.hpp"
12+
#include "opencv2/ts.hpp"
1313
#include "opencv2/latentsvm/latentsvm.hpp"
14-
#include "opencv2/imgproc/imgproc.hpp"
15-
#include "opencv2/highgui/highgui.hpp"
14+
#include "opencv2/imgproc.hpp"
15+
#include "opencv2/highgui.hpp"
1616

1717
#endif

0 commit comments

Comments
 (0)