Skip to content

Commit fd34389

Browse files
committed
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
2 parents 74455ea + 7292df6 commit fd34389

File tree

3 files changed

+60
-55
lines changed

3 files changed

+60
-55
lines changed

modules/ovis/src/ovis.cpp

+19-3
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,11 @@ class WindowSceneImpl : public WindowScene
319319
{
320320
camman.reset(new OgreBites::CameraMan(camNode));
321321
camman->setStyle(OgreBites::CS_ORBIT);
322-
camNode->setFixedYawAxis(true, Vector3::NEGATIVE_UNIT_Y);
322+
#if OGRE_VERSION >= ((1 << 16) | (11 << 8) | 5)
323+
camman->setFixedYaw(false);
324+
#else
325+
camNode->setFixedYawAxis(true, Vector3::NEGATIVE_UNIT_Y); // OpenCV +Y in Ogre CS
326+
#endif
323327
}
324328

325329
if (!app->sceneMgr)
@@ -344,10 +348,18 @@ class WindowSceneImpl : public WindowScene
344348
{
345349
if (flags & SCENE_SEPERATE)
346350
{
351+
TextureManager& texMgr = TextureManager::getSingleton();
352+
347353
MaterialManager::getSingleton().remove(bgplane->getMaterial());
348354
bgplane.release();
349-
String texName = sceneMgr->getName() + "_Background";
350-
TextureManager::getSingleton().remove(texName, RESOURCEGROUP_NAME);
355+
String texName = "_"+sceneMgr->getName() + "_DefaultBackground";
356+
texMgr.remove(texName, RESOURCEGROUP_NAME);
357+
358+
texName = sceneMgr->getName() + "_Background";
359+
if(texMgr.resourceExists(texName, RESOURCEGROUP_NAME))
360+
{
361+
texMgr.remove(texName, RESOURCEGROUP_NAME);
362+
}
351363
}
352364

353365
if(_app->sceneMgr == sceneMgr && (flags & SCENE_SEPERATE))
@@ -694,6 +706,10 @@ class WindowSceneImpl : public WindowScene
694706

695707
void fixCameraYawAxis(bool useFixed, InputArray _up) CV_OVERRIDE
696708
{
709+
#if OGRE_VERSION >= ((1 << 16) | (11 << 8) | 5)
710+
if(camman) camman->setFixedYaw(useFixed);
711+
#endif
712+
697713
Vector3 up = Vector3::NEGATIVE_UNIT_Y;
698714
if (!_up.empty())
699715
{

modules/tracking/include/opencv2/tracking.hpp

+12-35
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
//
4040
//M*/
4141

42-
#ifndef __OPENCV_TRACKING_LENLEN_HPP__
43-
#define __OPENCV_TRACKING_LENLEN_HPP__
42+
#ifndef __OPENCV_TRACKING_HPP__
43+
#define __OPENCV_TRACKING_HPP__
4444

4545
#include "opencv2/core/cvdef.h"
4646

@@ -49,12 +49,12 @@
4949
Long-term optical tracking API
5050
------------------------------
5151
52-
Long-term optical tracking is one of most important issue for many computer vision applications in
52+
Long-term optical tracking is an important issue for many computer vision applications in
5353
real world scenario. The development in this area is very fragmented and this API is an unique
5454
interface useful for plug several algorithms and compare them. This work is partially based on
5555
@cite AAM and @cite AMVOT .
5656
57-
This algorithms start from a bounding box of the target and with their internal representation they
57+
These algorithms start from a bounding box of the target and with their internal representation they
5858
avoid the drift during the tracking. These long-term trackers are able to evaluate online the
5959
quality of the location of the target in the new frame, without ground truth.
6060
@@ -69,23 +69,16 @@ the TrackerModel is the statistical model.
6969
7070
A recent benchmark between these algorithms can be found in @cite OOT
7171
72-
To see how API works, try tracker demo:
73-
<https://github.com/lenlen/opencv/blob/tracking_api/samples/cpp/tracker.cpp>
74-
75-
Creating Own Tracker
72+
Creating Your Own %Tracker
7673
--------------------
7774
78-
If you want create a new tracker, here's what you have to do. First, decide on the name of the class
75+
If you want to create a new tracker, here's what you have to do. First, decide on the name of the class
7976
for the tracker (to meet the existing style, we suggest something with prefix "tracker", e.g.
80-
trackerMIL, trackerBoosting) -- we shall refer to this choice as to "classname" in subsequent. Also,
81-
you should decide upon the name of the tracker, is it will be known to user (the current style
82-
suggests using all capitals, say MIL or BOOSTING) --we'll call it a "name".
77+
trackerMIL, trackerBoosting) -- we shall refer to this choice as to "classname" in subsequent.
8378
84-
- Declare your tracker in include/opencv2/tracking/tracker.hpp. Your tracker should inherit from
79+
- Declare your tracker in modules/tracking/include/opencv2/tracking/tracker.hpp. Your tracker should inherit from
8580
Tracker (please, see the example below). You should declare the specialized Param structure,
86-
where you probably will want to put the data, needed to initialize your tracker. Also don't
87-
forget to put the BOILERPLATE_CODE(name,classname) macro inside the class declaration. That
88-
macro will generate static createTracker() function, which we'll talk about later. You should
81+
where you probably will want to put the data, needed to initialize your tracker. You should
8982
get something similar to :
9083
@code
9184
class CV_EXPORTS_W TrackerMIL : public Tracker
@@ -109,20 +102,10 @@ suggests using all capitals, say MIL or BOOSTING) --we'll call it a "name".
109102
@endcode
110103
of course, you can also add any additional methods of your choice. It should be pointed out,
111104
however, that it is not expected to have a constructor declared, as creation should be done via
112-
the corresponding createTracker() method.
113-
- In src/tracker.cpp file add BOILERPLATE_CODE(name,classname) line to the body of
114-
Tracker::create() method you will find there, like :
115-
@code
116-
Ptr<Tracker> Tracker::create( const String& trackerType )
117-
{
118-
BOILERPLATE_CODE("BOOSTING",TrackerBoosting);
119-
BOILERPLATE_CODE("MIL",TrackerMIL);
120-
return Ptr<Tracker>();
121-
}
122-
@endcode
105+
the corresponding create() method.
123106
- Finally, you should implement the function with signature :
124107
@code
125-
Ptr<classname> classname::createTracker(const classname::Params &parameters){
108+
Ptr<classname> classname::create(const classname::Params &parameters){
126109
...
127110
}
128111
@endcode
@@ -292,16 +275,10 @@ Example of creating specialized TrackerTargetState TrackerMILTargetState : :
292275
293276
};
294277
@endcode
295-
### Try it
296-
297-
To try your tracker you can use the demo at
298-
<https://github.com/lenlen/opencv/blob/tracking_api/samples/cpp/tracker.cpp>.
299-
300-
The first argument is the name of the tracker and the second is a video source.
301278
302279
*/
303280

304281
#include <opencv2/tracking/tracker.hpp>
305282
#include <opencv2/tracking/tldDataset.hpp>
306283

307-
#endif //__OPENCV_TRACKING_LENLEN
284+
#endif //__OPENCV_TRACKING_HPP__

modules/tracking/include/opencv2/tracking/tracker.hpp

+29-17
Original file line numberDiff line numberDiff line change
@@ -1091,8 +1091,9 @@ class CV_EXPORTS_W TrackerMIL : public Tracker
10911091
virtual ~TrackerMIL() CV_OVERRIDE {}
10921092
};
10931093

1094-
/** @brief This is a real-time object tracking based on a novel on-line version of the AdaBoost algorithm.
1094+
/** @brief the Boosting tracker
10951095
1096+
This is a real-time object tracking based on a novel on-line version of the AdaBoost algorithm.
10961097
The classifier uses the surrounding background as negative examples in update step to avoid the
10971098
drifting problem. The implementation is based on @cite OLB .
10981099
*/
@@ -1128,7 +1129,7 @@ class CV_EXPORTS_W TrackerBoosting : public Tracker
11281129
virtual ~TrackerBoosting() CV_OVERRIDE {}
11291130
};
11301131

1131-
/** @brief Median Flow tracker implementation.
1132+
/** @brief the Median Flow tracker
11321133
11331134
Implementation of a paper @cite MedianFlow .
11341135
@@ -1167,15 +1168,17 @@ class CV_EXPORTS_W TrackerMedianFlow : public Tracker
11671168
virtual ~TrackerMedianFlow() CV_OVERRIDE {}
11681169
};
11691170

1170-
/** @brief TLD is a novel tracking framework that explicitly decomposes the long-term tracking task into
1171+
/** @brief the TLD (Tracking, learning and detection) tracker
1172+
1173+
TLD is a novel tracking framework that explicitly decomposes the long-term tracking task into
11711174
tracking, learning and detection.
11721175
11731176
The tracker follows the object from frame to frame. The detector localizes all appearances that
11741177
have been observed so far and corrects the tracker if necessary. The learning estimates detector's
11751178
errors and updates it to avoid these errors in the future. The implementation is based on @cite TLD .
11761179
11771180
The Median Flow algorithm (see cv::TrackerMedianFlow) was chosen as a tracking component in this
1178-
implementation, following authors. Tracker is supposed to be able to handle rapid motions, partial
1181+
implementation, following authors. The tracker is supposed to be able to handle rapid motions, partial
11791182
occlusions, object absence etc.
11801183
*/
11811184
class CV_EXPORTS_W TrackerTLD : public Tracker
@@ -1198,7 +1201,9 @@ class CV_EXPORTS_W TrackerTLD : public Tracker
11981201
virtual ~TrackerTLD() CV_OVERRIDE {}
11991202
};
12001203

1201-
/** @brief KCF is a novel tracking framework that utilizes properties of circulant matrix to enhance the processing speed.
1204+
/** @brief the KCF (Kernelized Correlation Filter) tracker
1205+
1206+
* KCF is a novel tracking framework that utilizes properties of circulant matrix to enhance the processing speed.
12021207
* This tracking method is an implementation of @cite KCF_ECCV which is extended to KCF with color-names features (@cite KCF_CN).
12031208
* The original paper of KCF is available at <http://www.robots.ox.ac.uk/~joao/publications/henriques_tpami2015.pdf>
12041209
* as well as the matlab implementation. For more information about KCF with color-names features, please refer to
@@ -1264,7 +1269,9 @@ class CV_EXPORTS_W TrackerKCF : public Tracker
12641269
virtual ~TrackerKCF() CV_OVERRIDE {}
12651270
};
12661271

1267-
/** @brief GOTURN (@cite GOTURN) is kind of trackers based on Convolutional Neural Networks (CNN). While taking all advantages of CNN trackers,
1272+
/** @brief the GOTURN (Generic Object Tracking Using Regression Networks) tracker
1273+
1274+
* GOTURN (@cite GOTURN) is kind of trackers based on Convolutional Neural Networks (CNN). While taking all advantages of CNN trackers,
12681275
* GOTURN is much faster due to offline training without online fine-tuning nature.
12691276
* GOTURN tracker addresses the problem of single target tracking: given a bounding box label of an object in the first frame of the video,
12701277
* we track that object through the rest of the video. NOTE: Current method of GOTURN does not handle occlusions; however, it is fairly
@@ -1297,9 +1304,10 @@ class CV_EXPORTS_W TrackerGOTURN : public Tracker
12971304
virtual ~TrackerGOTURN() CV_OVERRIDE {}
12981305
};
12991306

1300-
/** @brief the MOSSE tracker
1301-
note, that this tracker works with grayscale images, if passed bgr ones, they will get converted internally.
1302-
@cite MOSSE Visual Object Tracking using Adaptive Correlation Filters
1307+
/** @brief the MOSSE (Minimum Output Sum of Squared %Error) tracker
1308+
1309+
The implementation is based on @cite MOSSE Visual Object Tracking using Adaptive Correlation Filters
1310+
@note this tracker works with grayscale images, if passed bgr ones, they will get converted internally.
13031311
*/
13041312

13051313
class CV_EXPORTS_W TrackerMOSSE : public Tracker
@@ -1315,7 +1323,8 @@ class CV_EXPORTS_W TrackerMOSSE : public Tracker
13151323

13161324
/************************************ MultiTracker Class ---By Laksono Kurnianggoro---) ************************************/
13171325
/** @brief This class is used to track multiple objects using the specified tracker algorithm.
1318-
* The MultiTracker is naive implementation of multiple object tracking.
1326+
1327+
* The %MultiTracker is naive implementation of multiple object tracking.
13191328
* It process the tracked objects independently without any optimization accross the tracked objects.
13201329
*/
13211330
class CV_EXPORTS_W MultiTracker : public Algorithm
@@ -1431,15 +1440,17 @@ class CV_EXPORTS MultiTracker_Alt
14311440
std::vector<Scalar> colors;
14321441
};
14331442

1434-
/** @brief Multi Object Tracker for TLD. TLD is a novel tracking framework that explicitly decomposes
1443+
/** @brief Multi Object %Tracker for TLD.
1444+
1445+
TLD is a novel tracking framework that explicitly decomposes
14351446
the long-term tracking task into tracking, learning and detection.
14361447
14371448
The tracker follows the object from frame to frame. The detector localizes all appearances that
14381449
have been observed so far and corrects the tracker if necessary. The learning estimates detector's
14391450
errors and updates it to avoid these errors in the future. The implementation is based on @cite TLD .
14401451
14411452
The Median Flow algorithm (see cv::TrackerMedianFlow) was chosen as a tracking component in this
1442-
implementation, following authors. Tracker is supposed to be able to handle rapid motions, partial
1453+
implementation, following authors. The tracker is supposed to be able to handle rapid motions, partial
14431454
occlusions, object absence etc.
14441455
14451456
@sa Tracker, MultiTracker, TrackerTLD
@@ -1460,10 +1471,10 @@ class CV_EXPORTS MultiTrackerTLD : public MultiTracker_Alt
14601471
bool update_opt(InputArray image);
14611472
};
14621473

1463-
//! @}
1464-
14651474
/*********************************** CSRT ************************************/
1466-
/** @brief Discriminative Correlation Filter Tracker with Channel and Spatial Reliability
1475+
/** @brief the CSRT tracker
1476+
1477+
The implementation is based on @cite Lukezic_IJCV2018 Discriminative Correlation Filter with Channel and Spatial Reliability
14671478
*/
14681479
class CV_EXPORTS_W TrackerCSRT : public Tracker
14691480
{
@@ -1476,12 +1487,12 @@ class CV_EXPORTS_W TrackerCSRT : public Tracker
14761487
Params();
14771488

14781489
/**
1479-
* \brief Read parameters from file
1490+
* \brief Read parameters from a file
14801491
*/
14811492
void read(const FileNode& /*fn*/);
14821493

14831494
/**
1484-
* \brief Write parameters from file
1495+
* \brief Write parameters to a file
14851496
*/
14861497
void write(cv::FileStorage& fs) const;
14871498

@@ -1529,6 +1540,7 @@ class CV_EXPORTS_W TrackerCSRT : public Tracker
15291540
virtual ~TrackerCSRT() CV_OVERRIDE {}
15301541
};
15311542

1543+
//! @}
15321544
} /* namespace cv */
15331545

15341546
#endif

0 commit comments

Comments
 (0)