Ocean
PatternTracker.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_TRACKING_OFFLINE_PATTERN_TRACKER_H
9 #define META_OCEAN_TRACKING_OFFLINE_PATTERN_TRACKER_H
10 
14 
15 #include "ocean/cv/FramePyramid.h"
16 #include "ocean/cv/SubRegion.h"
17 
19 
21 
22 namespace Ocean
23 {
24 
25 namespace Tracking
26 {
27 
28 namespace Offline
29 {
30 
31 // Forward declaration.
32 class PatternTracker;
33 
34 /**
35  * Definition of a smart object reference holding a PatternTracker object.
36  * @see PatternTracker.
37  * @ingroup trackingoffline
38  */
40 
41 /**
42  * This class implements an offline tracker able to detect and track a previously known 2D pattern.
43  * The tracker does not provide real-time performance but creates tracking results with high accuracy.<br>
44  * The given video stream is passed through several times to increase the tracking quality.
45  * @see PatternTrackerRef.
46  * @ingroup trackingoffline
47  */
48 class OCEAN_TRACKING_OFFLINE_EXPORT PatternTracker :
49  virtual public FrameTracker,
50  virtual public PlaneTracker
51 {
52  protected:
53 
54  /**
55  * This class implements the base class for all tracking components providing a rough pose.
56  * The component does not apply frame pyramids but standard frames.<br>
57  */
59  {
60  protected:
61 
62  /**
63  * Creates a new rough tracking component.
64  * @param parent The parent tracker object that invokes this component
65  * @param pinholeCamera The pinhole camera profile that will be applied
66  */
67  RoughPoseBaseComponent(PatternTracker& parent, const PinholeCamera& pinholeCamera);
68 
69  /**
70  * Destructor
71  */
72  inline ~RoughPoseBaseComponent() override;
73 
74  protected:
75 
76  /// The parent tracker invoking this component.
78 
79  /// The camera profile that will be applied.
81 
82  /// The tracker determining the rough poses.
84 
85  /// The id of the pattern as received by the tracker.
86  unsigned int patternId_ = (unsigned int)(-1);
87  };
88 
89  /**
90  * This class implements a tracking component that determines a rough guess of the horizontal field of view of the camera.
91  * The component takes the first 'n' tracking frames and extracts 2D / 3D point correspondences.<br>
92  * The camera profile with minimal projection error defines the initial guess.<br>
93  */
95  {
96  public:
97 
98  /**
99  * Creates a new component object.
100  * @param parent The parent tracker object that invokes this component
101  * @param pinholeCamera The pinhole camera profile that will be applied
102  * @param resultingFovX Resulting horizontal field of view in radian
103  * @param frameNumber Number of frames that are used to guess the field of view, typically a few frame of about 10 are sufficient
104  */
105  RoughCameraFovComponent(PatternTracker& parent, const PinholeCamera& pinholeCamera, Scalar& resultingFovX, const unsigned int frameNumber);
106 
107  /**
108  * Destructor
109  */
110  inline ~RoughCameraFovComponent() override;
111 
112  protected:
113 
114  /**
115  * Applies one component step.
116  * @see TrackerComponent::onFrame().
117  */
118  IterationResult onFrame(const unsigned int previousIndex, const unsigned int currentIndex, const unsigned int iteration, const unsigned int maximalIterations) override;
119 
120  /**
121  * Component start event function.
122  * @see TrackerComponent::onStop().
123  */
124  bool onStop(const unsigned int lowerFrameIndex, const unsigned int initialFrameIndex, const unsigned int upperFrameIndex) override;
125 
126  protected:
127 
128  /// The resulting horizontal field of view.
130 
131  /// Number of frames that will be used to guess the field of view.
132  unsigned int frameNumber_ = 0u;
133 
134  /// The groups of image points that are extracted in the first frames.
136 
137  /// The groups of object points that are extracted in the first frames.
139 
140  /// The extracted camera poses.
142  };
143 
144  /**
145  * This class implements a tracking component that determines rough camera poses by application of 2D / 3D point correspondences.
146  * In each frame 2D image point and 3D object points correspondences are determined and a equivalent camera pose is determined.<br>
147  */
149  {
150  public:
151 
152  /**
153  * Creates a new tracking component object.
154  * @param parent The parent tracker object that invokes this component
155  * @param pinholeCamera The pinhole camera profile that will be applied
156  * @param resultingPoses The resulting rough poses that will be determined
157  */
158  RoughPoseComponent(PatternTracker& parent, const PinholeCamera& pinholeCamera, OfflinePoses& resultingPoses);
159 
160  /**
161  * Destructor
162  */
163  inline ~RoughPoseComponent() override;
164 
165  protected:
166 
167  /**
168  * Component start event function.
169  * @see TrackerComponent::onStart().
170  */
171  bool onStart(const unsigned int lowerFrameIndex, const unsigned int initialFrameIndex, const unsigned int upperFrameIndex) override;
172 
173  /**
174  * Applies one component step.
175  * @see TrackerComponent::onFrame().
176  */
177  IterationResult onFrame(const unsigned int previousIndex, const unsigned int currentIndex, const unsigned int iteration, const unsigned int maximalIterations) override;
178 
179  /**
180  * Component stop event function.
181  * @see TrackerComponent::onStop().
182  */
183  bool onStop(const unsigned int lowerFrameIndex, const unsigned int initialFrameIndex, const unsigned int upperFrameIndex) override;
184 
185  protected:
186 
187  /// The resulting rough poses that will be determined.
189 
190  /// The internal rough poses that will be determined.
192  };
193 
194  /**
195  * This class implements a tracking component that allows to determine an accurate pose and that further allows to optimized the camera parameters.
196  */
198  {
199  public:
200 
201  /**
202  * Creates a new fine tracking component.
203  * @param parent The parent tracker object that invokes this component
204  * @param pinholeCamera The pinhole camera profile that will be applied
205  * @param poses Already determined poses for the tracking sequence
206  * @param iterations Number of optimization iterations
207  * @param detectionBorder Border in the tracking pattern in which no feature points will be tracked
208  * @param horizontalBinSize Size of each horizontal bins (the bin widths) in pixel
209  * @param verticalBinSize Size of each vertical bins (the bin heights) in pixel
210  * @param optimizedPoses Resulting optimized poses
211  * @param optimizedCamera Optional resulting optimized camera
212  */
213  FineTrackingComponent(PatternTracker& parent, const PinholeCamera& pinholeCamera, const OfflinePoses& poses, const unsigned int iterations, const unsigned int detectionBorder, const unsigned int horizontalBinSize, const unsigned int verticalBinSize, OfflinePoses& optimizedPoses, PinholeCamera* optimizedCamera);
214 
215  /**
216  * Destructor
217  */
218  inline ~FineTrackingComponent() override;
219 
220  protected:
221 
222  /**
223  * Component start event function.
224  * @see TrackerComponent::onStart().
225  */
226  bool onStart(const unsigned int lowerFrameIndex, const unsigned int initialFrameIndex, const unsigned int upperFrameIndex) override;
227 
228  /**
229  * Applies one component step.
230  * @see TrackerComponent::onFrame().
231  */
232  IterationResult onFrame(const unsigned int previousIndex, const unsigned int currentIndex, const unsigned int iteration, const unsigned int maximalIterations) override;
233 
234  /**
235  * Component stop event function.
236  * @see TrackerComponent::onStop().
237  */
238  bool onStop(const unsigned int lowerFrameIndex, const unsigned int initialFrameIndex, const unsigned int upperFrameIndex) override;
239 
240  /**
241  * Optimizes a pose due to accurate 2D/3D point correspondences.
242  * @param pinholeCamera The pinhole camera profile to be applied
243  * @param pose Initial pose that will be optimized
244  * @param frame The frame that matches with the initial pose
245  * @param detectionBorder Border in the tracking pattern in which no feature points will be tracked
246  * @param horizontalBinSize Size of each horizontal bins (the bin widths) in pixel
247  * @param verticalBinSize Size of each vertical bins (the bin heights) in pixel
248  * @param imagePoints Resulting imagePoints that were used to improve the pose
249  * @param objectPoints Resulting objectPoints that ware used to improve the pose, each point corresponds to one image point
250  * @param optimizedPose Resulting optimized pose
251  * @param worker Optional worker object to distribute the computation
252  * @return True, if succeeded
253  */
254  bool optimizePose(const PinholeCamera& pinholeCamera, const HomogenousMatrix4& pose, const Frame& frame, const unsigned int detectionBorder, const unsigned int horizontalBinSize, const unsigned int verticalBinSize, ImagePoints& imagePoints, ObjectPoints& objectPoints, HomogenousMatrix4& optimizedPose, Worker* worker = nullptr);
255 
256  /**
257  * Optimizes a pose due to accurate 2D/3D point correspondences.
258  * @param pinholeCamera The pinhole camera profile to be applied
259  * @param pose Initial pose that will be optimized
260  * @param frame The frame that matches with the initial pose
261  * @param patternLayer Ideal pyramid layer of the tracking pattern best matching with the projected area of the visible patten in the frame
262  * @param detectionBorder Border in the tracking pattern in which no feature points will be tracked
263  * @param horizontalBinSize Size of each horizontal bins (the bin widths) in pixel
264  * @param verticalBinSize Size of each vertical bins (the bin heights) in pixel
265  * @param imagePoints Resulting imagePoints that were used to improve the pose
266  * @param objectPoints Resulting objectPoints that ware used to improve the pose, each point corresponds to one image point
267  * @param optimizedPose Resulting optimized pose
268  * @param worker Optional worker object to distribute the computation
269  * @return True, if succeeded
270  */
271  bool optimizePose(const PinholeCamera& pinholeCamera, const HomogenousMatrix4& pose, const Frame& frame, const Frame& patternLayer, const unsigned int detectionBorder, const unsigned int horizontalBinSize, const unsigned int verticalBinSize, ImagePoints& imagePoints, ObjectPoints& objectPoints, HomogenousMatrix4& optimizedPose, Worker* worker = nullptr);
272 
273  /**
274  * Optimizes the camera profile due to the determined 2D/3D point correspondences.
275  * @param pinholeCamera The initial pinhole camera profile to be used
276  * @param numberFrames Number of individual frames that will be used to optimized the camera profile
277  * @param iterations Number of improvement iterations
278  * @param lowerFrameIndex Index of the frame defining the lower (including) tracking boundary
279  * @param upperFrameIndex Index of the frame defining the upper (including) tracking boundary
280  * @param optimizedCamera Resulting optimized camera profile
281  * @return True, if succeeded
282  */
283  bool optimizeCamera(const PinholeCamera& pinholeCamera, const unsigned int numberFrames, const unsigned int iterations, const unsigned int lowerFrameIndex, const unsigned int upperFrameIndex, PinholeCamera& optimizedCamera);
284 
285  protected:
286 
287  /// The parent tracker invoking this component.
289 
290  /// The camera profile that will be applied.
292 
293  /// The frame pyramid of the pattern image.
295 
296  /// Already known poses for each frame.
298 
299  /// Number of optimization iterations that will applied in this component.
300  const unsigned int iterations_ = 0u;
301 
302  /// The border in the pattern frame in which no feature will be tracked, in pixel
303  const unsigned int detectionBorder_ = 0u;
304 
305  /// Size of each horizontal bins (the bin widths) in pixel
306  const unsigned int horizontalBinSize_ = 0u;
307 
308  /// Size of each vertical bins (the bin heights) in pixel
309  const unsigned int verticalBinSize_ = 0u;
310 
311  /// Resulting optimized poses for each frame.
313 
314  /// Optional resulting optimized camera profile.
315  PinholeCamera* optimizedCamera_ = nullptr;
316 
317  /// The set of image points that are used for pose determination, one set for each frame.
319 
320  /// The set of object points that are used for pose determination, one set for each frame.
322  };
323 
324  public:
325 
326  /**
327  * Creates a new pattern tracker object.
328  */
330 
331  /**
332  * Returns the current dimension of the tracking pattern.
333  * @return Current tracking pattern dimension
334  */
335  inline Vector2 patternDimension() const;
336 
337  /**
338  * Sets the tracking pattern that will be tracked in the video stream.
339  * @param frame The frame pattern
340  * @param dimension The dimension of the given pattern in meter
341  * @return True, if succeeded
342  */
343  bool setPattern(const Frame& frame, const Vector2& dimension);
344 
345  /**
346  * Sets a camera object that will be used by this tracker.
347  * @see OfflineTracker::setCamera().
348  */
349  bool setCamera(const PinholeCamera& pinholeCamera, const Scalar cameraPrecision, const bool optimizeCamera) override;
350 
351  protected:
352 
353  /**
354  * Frame tracker run function.
355  * @see OfflineFrameTracker::applyFrameTracking().
356  */
357  bool applyFrameTracking(const FrameType& frameType) override;
358 
359  /**
360  * Guesses the rough field of view of the camera.
361  * @param lowerFrameIndex Index of the frame defining the lower (including) tracking boundary
362  * @param initialFrameIndex Index of the frame at that the tracking process will start
363  * @param upperFrameIndex Index of the frame defining the upper (including) tracking boundary
364  * @param cameraFovDeterminationFrames Number of initial frames that are used to determine a rough approximation of the camera's field of view, 0 to avoid the determination
365  * @return True, if succeeded
366  */
367  bool determineRoughCameraFov(const unsigned int lowerFrameIndex, const unsigned int initialFrameIndex, const unsigned int upperFrameIndex, const unsigned int cameraFovDeterminationFrames = 10u);
368 
369  /**
370  * Determines the initial rough poses for the entire video stream.
371  * @param lowerFrameIndex Index of the frame defining the lower (including) tracking boundary
372  * @param initialFrameIndex Index of the frame at that the tracking process will start
373  * @param upperFrameIndex Index of the frame defining the upper (including) tracking boundary
374  * @return True, if succeeded
375  */
376  bool determineRoughPoses(const unsigned int lowerFrameIndex, const unsigned int initialFrameIndex, const unsigned int upperFrameIndex);
377 
378  /**
379  * Closes the tracking gaps (break-downs) for the provided video stream.
380  * @param lowerFrameIndex Index of the frame defining the lower (including) tracking boundary
381  * @param upperFrameIndex Index of the frame defining the upper (including) tracking boundary
382  * @param minimalCorrespondences Minimal number of correspondences that need to be exceeded so that a pose counts as valid (and not as gap)
383  * @return True, if succeeded
384  */
385  bool closeGaps(const unsigned int lowerFrameIndex, const unsigned int upperFrameIndex, const unsigned int minimalCorrespondences = 50u);
386 
387  /**
388  * Applies a fine adjustment of the camera poses.
389  * @param iterations Number of adjustment iterations for each frame
390  * @param detectionBorder Border in the tracking pattern in which no feature points will be tracked
391  * @param horizontalBinSize Size of each horizontal bins (the bin widths) in pixel
392  * @param verticalBinSize Size of each vertical bins (the bin heights) in pixel
393  * @param optimizeCamera True to apply a camera profile optimization after the fine tracking has been applied
394  * @param lowerFrameIndex Index of the frame defining the lower (including) tracking boundary
395  * @param initialFrameIndex Index of the frame at that the tracking process will start
396  * @param upperFrameIndex Index of the frame defining the upper (including) tracking boundary
397  */
398  bool fineAdjustment(const unsigned iterations, const unsigned int detectionBorder, const unsigned int horizontalBinSize, const unsigned int verticalBinSize, const bool optimizeCamera, const unsigned int lowerFrameIndex, const unsigned int initialFrameIndex, const unsigned int upperFrameIndex);
399 
400  /**
401  * Calculates the projection area of the defined 3D object pattern.
402  * @param pose The camera pose
403  * @param pinholeCamera The pinhole camera object
404  * @return Resulting projection area
405  */
406  Scalar projectedPatternArea(const HomogenousMatrix4& pose, const PinholeCamera& pinholeCamera) const;
407 
408  /**
409  * Returns projected 2D triangles that cover the area of the 3D tracking pattern.
410  * @param pose The camera pose
411  * @param pinholeCamera The pinhole camera object
412  * @return Set of 2D triangles
413  */
414  Triangles2 projectedPatternTriangles(const HomogenousMatrix4& pose, const PinholeCamera& pinholeCamera) const;
415 
416  /**
417  * Updates the pattern dimension of this tracker and invokes the corresponding state event(s).
418  * @param dimension The dimension of the given pattern in meter
419  * @return True, if succeeded
420  */
421  bool updatePatternDimension(const Vector2& dimension);
422 
423  protected:
424 
425  /// The frame pattern that is tracked during the video stream.
427 
428  /// Dimension of the frame pattern in meter.
429  Vector2 patternDimension_ = Vector2(0, 0);
430 
431  /// The four corners of the tracking pattern.
432  Vector3 patternCorners_[4];
433 };
434 
436 {
437  // Nothing else to do.
438 }
439 
441 {
442  // Nothing else to do.
443 }
444 
446 {
447  // Nothing else to do.
448 }
449 
451 {
452  // Nothing else to do.
453 }
454 
456 {
457  const ScopedLock scopedLock(lock_);
458 
459  const Vector2 dimension(patternDimension_);
460  return dimension;
461 }
462 
463 }
464 
465 }
466 
467 }
468 
469 #endif // META_OCEAN_TRACKING_OFFLINE_PATTERN_TRACKER_H
This class implements a frame pyramid.
Definition: FramePyramid.h:37
This class implements Ocean's image class.
Definition: Frame.h:1760
Definition of a frame type composed by the frame dimension, pixel format and pixel origin.
Definition: Frame.h:30
This class implements a scoped lock object for recursive lock objects.
Definition: Lock.h:135
This template class implements a smart object reference which is a specialization of an ObjectRef obj...
Definition: SmartObjectRef.h:90
This class implements the base class for all components of a frame tracker.
Definition: FrameTracker.h:155
IterationResult
Definition of individual results for the component iterations.
Definition: FrameTracker.h:62
This class implements the base class for all visual offline tracker using frames to provide the track...
Definition: FrameTracker.h:46
Lock lock_
Tracker lock object.
Definition: OfflineTracker.h:428
This class implements a tracking component that allows to determine an accurate pose and that further...
Definition: PatternTracker.h:198
bool optimizePose(const PinholeCamera &pinholeCamera, const HomogenousMatrix4 &pose, const Frame &frame, const Frame &patternLayer, const unsigned int detectionBorder, const unsigned int horizontalBinSize, const unsigned int verticalBinSize, ImagePoints &imagePoints, ObjectPoints &objectPoints, HomogenousMatrix4 &optimizedPose, Worker *worker=nullptr)
Optimizes a pose due to accurate 2D/3D point correspondences.
IterationResult onFrame(const unsigned int previousIndex, const unsigned int currentIndex, const unsigned int iteration, const unsigned int maximalIterations) override
Applies one component step.
const PinholeCamera camera_
The camera profile that will be applied.
Definition: PatternTracker.h:291
~FineTrackingComponent() override
Destructor.
Definition: PatternTracker.h:450
bool onStart(const unsigned int lowerFrameIndex, const unsigned int initialFrameIndex, const unsigned int upperFrameIndex) override
Component start event function.
bool onStop(const unsigned int lowerFrameIndex, const unsigned int initialFrameIndex, const unsigned int upperFrameIndex) override
Component stop event function.
OfflinePoses & optimizedPoses_
Resulting optimized poses for each frame.
Definition: PatternTracker.h:312
FineTrackingComponent(PatternTracker &parent, const PinholeCamera &pinholeCamera, const OfflinePoses &poses, const unsigned int iterations, const unsigned int detectionBorder, const unsigned int horizontalBinSize, const unsigned int verticalBinSize, OfflinePoses &optimizedPoses, PinholeCamera *optimizedCamera)
Creates a new fine tracking component.
ShiftVector< ImagePoints > imagePointsSet_
The set of image points that are used for pose determination, one set for each frame.
Definition: PatternTracker.h:318
CV::FramePyramid patternFramePyramid_
The frame pyramid of the pattern image.
Definition: PatternTracker.h:294
bool optimizePose(const PinholeCamera &pinholeCamera, const HomogenousMatrix4 &pose, const Frame &frame, const unsigned int detectionBorder, const unsigned int horizontalBinSize, const unsigned int verticalBinSize, ImagePoints &imagePoints, ObjectPoints &objectPoints, HomogenousMatrix4 &optimizedPose, Worker *worker=nullptr)
Optimizes a pose due to accurate 2D/3D point correspondences.
PatternTracker & parent_
The parent tracker invoking this component.
Definition: PatternTracker.h:288
ShiftVector< ObjectPoints > objectPointsSet_
The set of object points that are used for pose determination, one set for each frame.
Definition: PatternTracker.h:321
const OfflinePoses & poses_
Already known poses for each frame.
Definition: PatternTracker.h:297
bool optimizeCamera(const PinholeCamera &pinholeCamera, const unsigned int numberFrames, const unsigned int iterations, const unsigned int lowerFrameIndex, const unsigned int upperFrameIndex, PinholeCamera &optimizedCamera)
Optimizes the camera profile due to the determined 2D/3D point correspondences.
This class implements a tracking component that determines a rough guess of the horizontal field of v...
Definition: PatternTracker.h:95
RoughCameraFovComponent(PatternTracker &parent, const PinholeCamera &pinholeCamera, Scalar &resultingFovX, const unsigned int frameNumber)
Creates a new component object.
Scalar & resultingFovX_
The resulting horizontal field of view.
Definition: PatternTracker.h:129
bool onStop(const unsigned int lowerFrameIndex, const unsigned int initialFrameIndex, const unsigned int upperFrameIndex) override
Component start event function.
IterationResult onFrame(const unsigned int previousIndex, const unsigned int currentIndex, const unsigned int iteration, const unsigned int maximalIterations) override
Applies one component step.
Geometry::ObjectPointGroups objectPointGroups_
The groups of object points that are extracted in the first frames.
Definition: PatternTracker.h:138
HomogenousMatrices4 poses_
The extracted camera poses.
Definition: PatternTracker.h:141
~RoughCameraFovComponent() override
Destructor.
Definition: PatternTracker.h:440
Geometry::ImagePointGroups imagePointGroups_
The groups of image points that are extracted in the first frames.
Definition: PatternTracker.h:135
This class implements the base class for all tracking components providing a rough pose.
Definition: PatternTracker.h:59
const PinholeCamera camera_
The camera profile that will be applied.
Definition: PatternTracker.h:80
RoughPoseBaseComponent(PatternTracker &parent, const PinholeCamera &pinholeCamera)
Creates a new rough tracking component.
PatternTracker & parent_
The parent tracker invoking this component.
Definition: PatternTracker.h:77
Pattern::PatternTracker6DOF subTracker_
The tracker determining the rough poses.
Definition: PatternTracker.h:83
~RoughPoseBaseComponent() override
Destructor.
Definition: PatternTracker.h:435
This class implements a tracking component that determines rough camera poses by application of 2D / ...
Definition: PatternTracker.h:149
OfflinePoses & resultingPoses_
The resulting rough poses that will be determined.
Definition: PatternTracker.h:188
~RoughPoseComponent() override
Destructor.
Definition: PatternTracker.h:445
bool onStop(const unsigned int lowerFrameIndex, const unsigned int initialFrameIndex, const unsigned int upperFrameIndex) override
Component stop event function.
OfflinePoses poses_
The internal rough poses that will be determined.
Definition: PatternTracker.h:191
bool onStart(const unsigned int lowerFrameIndex, const unsigned int initialFrameIndex, const unsigned int upperFrameIndex) override
Component start event function.
IterationResult onFrame(const unsigned int previousIndex, const unsigned int currentIndex, const unsigned int iteration, const unsigned int maximalIterations) override
Applies one component step.
RoughPoseComponent(PatternTracker &parent, const PinholeCamera &pinholeCamera, OfflinePoses &resultingPoses)
Creates a new tracking component object.
This class implements an offline tracker able to detect and track a previously known 2D pattern.
Definition: PatternTracker.h:51
bool setCamera(const PinholeCamera &pinholeCamera, const Scalar cameraPrecision, const bool optimizeCamera) override
Sets a camera object that will be used by this tracker.
Triangles2 projectedPatternTriangles(const HomogenousMatrix4 &pose, const PinholeCamera &pinholeCamera) const
Returns projected 2D triangles that cover the area of the 3D tracking pattern.
bool applyFrameTracking(const FrameType &frameType) override
Frame tracker run function.
bool determineRoughCameraFov(const unsigned int lowerFrameIndex, const unsigned int initialFrameIndex, const unsigned int upperFrameIndex, const unsigned int cameraFovDeterminationFrames=10u)
Guesses the rough field of view of the camera.
Frame patternFrame_
The frame pattern that is tracked during the video stream.
Definition: PatternTracker.h:426
Scalar projectedPatternArea(const HomogenousMatrix4 &pose, const PinholeCamera &pinholeCamera) const
Calculates the projection area of the defined 3D object pattern.
Vector2 patternDimension_
Dimension of the frame pattern in meter.
Definition: PatternTracker.h:429
bool determineRoughPoses(const unsigned int lowerFrameIndex, const unsigned int initialFrameIndex, const unsigned int upperFrameIndex)
Determines the initial rough poses for the entire video stream.
bool setPattern(const Frame &frame, const Vector2 &dimension)
Sets the tracking pattern that will be tracked in the video stream.
bool fineAdjustment(const unsigned iterations, const unsigned int detectionBorder, const unsigned int horizontalBinSize, const unsigned int verticalBinSize, const bool optimizeCamera, const unsigned int lowerFrameIndex, const unsigned int initialFrameIndex, const unsigned int upperFrameIndex)
Applies a fine adjustment of the camera poses.
Vector2 patternDimension() const
Returns the current dimension of the tracking pattern.
Definition: PatternTracker.h:455
PatternTracker()
Creates a new pattern tracker object.
bool updatePatternDimension(const Vector2 &dimension)
Updates the pattern dimension of this tracker and invokes the corresponding state event(s).
bool closeGaps(const unsigned int lowerFrameIndex, const unsigned int upperFrameIndex, const unsigned int minimalCorrespondences=50u)
Closes the tracking gaps (break-downs) for the provided video stream.
This class implements the abstract base class for all plane trackers.
Definition: PlaneTracker.h:42
This class implements a 6DOF feature tracker for planar patterns.
Definition: tracking/pattern/PatternTracker6DOF.h:34
This class implements a worker able to distribute function calls over different threads.
Definition: Worker.h:33
std::vector< ObjectPoints > ObjectPointGroups
Definition of a vector holding object points, so we have groups of object points.
Definition: geometry/Geometry.h:135
std::vector< ImagePoints > ImagePointGroups
Definition of a vector holding image points, so we have groups of image points.
Definition: geometry/Geometry.h:141
float Scalar
Definition of a scalar type.
Definition: Math.h:128
std::vector< HomogenousMatrix4 > HomogenousMatrices4
Definition of a vector holding HomogenousMatrix4 objects.
Definition: HomogenousMatrix4.h:73
std::vector< Triangle2 > Triangles2
Definition of a vector holding 2D triangles.
Definition: Triangle2.h:57
VectorT2< Scalar > Vector2
Definition of a 2D vector.
Definition: Vector2.h:21
std::vector< ObjectPoint > ObjectPoints
Definition of a vector holding 3D object points.
Definition: Tracking.h:61
std::vector< ImagePoint > ImagePoints
Definition of a vector holding 2D image points.
Definition: Tracking.h:55
SmartObjectRef< PatternTracker, OfflineTracker > PatternTrackerRef
Definition of a smart object reference holding a PatternTracker object.
Definition: PatternTracker.h:32
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15