Ocean
Loading...
Searching...
No Matches
testdetector/TestPointTracking.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_TEST_TESTCV_TESTDETECTOR_TEST_POINT_TRACKING_H
9#define META_OCEAN_TEST_TESTCV_TESTDETECTOR_TEST_POINT_TRACKING_H
10
12
13#include "ocean/base/Frame.h"
14#include "ocean/base/Worker.h"
15
17#include "ocean/math/Vector2.h"
18
20
21namespace Ocean
22{
23
24namespace Test
25{
26
27namespace TestCV
28{
29
30namespace TestDetector
31{
32
33/**
34 * This class implements a point tracking test.
35 * @ingroup testcvdetector
36 */
37class OCEAN_TEST_CV_DETECTOR_EXPORT TestPointTracking
38{
39 public:
40
41 /**
42 * Tests entire point tracking functionality.
43 * @param frame Test frame to be used for point detection and tracking, with frame dimension [80, infinity)x[80, infinity), must be valid
44 * @param testDuration Number of seconds for each test, with range (0, infinity)
45 * @param worker The worker object
46 * @param selector The test selector to filter tests
47 * @return True, if succeeded
48 */
49 static bool test(const Frame& frame, const double testDuration, Worker& worker, const TestSelector& selector);
50
51 private:
52
53 /**
54 * Test point tracking based on Harris corner detection and point motion.
55 * @param frame Original frame to be used for feature detection
56 * @param channels The number of frame channels to be used for testing, with range [1, infinity)
57 * @param testDuration Number of seconds for each test, with range (0, infinity)
58 * @param worker The worker object
59 * @return True, if succeeded
60 */
61 static bool testMotion(const Frame& frame, const unsigned int channels, const double testDuration, Worker & worker);
62
63 /**
64 * Determines the accuracy of point correspondences based on the ground truth transformation.
65 * @param points0 The first set of image points, at least one
66 * @param points1 The second set of image points, one for each image point in the first set
67 * @param frame0_H_frame1 The transformation transforming points from the second frame to points int he first frame, must be valid
68 * @param maxDistance Maximal distance between the determined point and the correct ground truth point so that a correspondence counts as valid, in pixel, with range [0, infinity)
69 * @return The percentage of valid correspondences, with range [0, 1]
70 */
71 static double validateAccuracy(const Vectors2& points0, const Vectors2& points1, const SquareMatrix3& frame0_H_frame1, const Scalar maxDistance = Scalar(2));
72};
73
74}
75
76}
77
78}
79
80}
81
82#endif // META_OCEAN_TEST_TESTCV_TESTDETECTOR_TEST_POINT_TRACKING_H
This class implements Ocean's image class.
Definition Frame.h:1879
This class implements a point tracking test.
Definition testdetector/TestPointTracking.h:38
static double validateAccuracy(const Vectors2 &points0, const Vectors2 &points1, const SquareMatrix3 &frame0_H_frame1, const Scalar maxDistance=Scalar(2))
Determines the accuracy of point correspondences based on the ground truth transformation.
static bool test(const Frame &frame, const double testDuration, Worker &worker, const TestSelector &selector)
Tests entire point tracking functionality.
static bool testMotion(const Frame &frame, const unsigned int channels, const double testDuration, Worker &worker)
Test point tracking based on Harris corner detection and point motion.
This class implements a test selector that parses test function strings and determines which tests sh...
Definition TestSelector.h:51
This class implements a worker able to distribute function calls over different threads.
Definition Worker.h:33
std::vector< Vector2 > Vectors2
Definition of a vector holding Vector2 objects.
Definition Vector2.h:64
float Scalar
Definition of a scalar type.
Definition Math.h:129
The namespace covering the entire Ocean framework.
Definition Accessor.h:15