Ocean
Loading...
Searching...
No Matches
TransitionHistory.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 OCEAN_CV_DETECTOR_BULLSEYES_TRANSITION_HISTORY_H
9#define OCEAN_CV_DETECTOR_BULLSEYES_TRANSITION_HISTORY_H
10
12
13namespace Ocean
14{
15
16namespace CV
17{
18
19namespace Detector
20{
21
22namespace Bullseyes
23{
24
25/**
26 * This class implements a simple history for previous pixel transitions (a sliding window of pixel transitions) that used for the bullseye detection.
27 * @ingroup cvdetectorbullseyes
28 */
29class OCEAN_CV_DETECTOR_BULLSEYES_EXPORT TransitionHistory
30{
31 public:
32
33 /**
34 * Creates a new history object.
35 */
36 TransitionHistory() = default;
37
38 /**
39 * Returns the history with window size 1.
40 * @return The previous delta
41 */
42 int history1();
43
44 /**
45 * Returns the history with window size 2.
46 * @return The sum of the previous two deltas
47 */
48 int history2();
49
50 /**
51 * Returns the history with window size 3.
52 * @return The sum of the previous three deltas
53 */
54 int history3();
55
56 /**
57 * Adds a new delta object as most recent history.
58 * Existing history objects will be moved by one pixel.
59 * @param newDelta The new delta object to be added
60 */
61 void push(const int newDelta);
62
63 /**
64 * Resets the history object.
65 */
66 void reset();
67
68 protected:
69
70 /// The previous delta.
71 int deltaMinus1 = 0;
72
73 /// The second previous delta.
74 int deltaMinus2 = 0;
75
76 /// The third previous delta.
77 int deltaMinus3 = 0;
78};
79
80} // namespace Bullseyes
81
82} // namespace Detector
83
84} // namespace CV
85
86} // namespace Ocean
87
88#endif // OCEAN_CV_DETECTOR_BULLSEYES_TRANSITION_HISTORY_H
This class implements a simple history for previous pixel transitions (a sliding window of pixel tran...
Definition TransitionHistory.h:30
int history1()
Returns the history with window size 1.
int history3()
Returns the history with window size 3.
void push(const int newDelta)
Adds a new delta object as most recent history.
void reset()
Resets the history object.
int history2()
Returns the history with window size 2.
TransitionHistory()=default
Creates a new history object.
std::vector< Bullseye > Bullseyes
Definition of a vector holding bullseyes.
Definition Bullseye.h:103
The namespace covering the entire Ocean framework.
Definition Accessor.h:15