8#ifndef OCEAN_CV_DETECTOR_BULLSEYES_MONOBULLSEYEDETECTOR_H
9#define OCEAN_CV_DETECTOR_BULLSEYES_MONOBULLSEYEDETECTOR_H
167 template <
bool tFindBlackPixel>
168 static
bool findNextUpperPixel(const
Frame& yFrame, const
unsigned int x, const
unsigned int y, const
unsigned int maximalRows, const
unsigned int threshold,
unsigned int& rows);
181 template <
bool tFindBlackPixel>
182 static
bool findNextLowerPixel(const
Frame& yFrame, const
unsigned int x, const
unsigned int y, const
unsigned int maximalRows, const
unsigned int threshold,
unsigned int& rows);
197 static
unsigned int determineThreshold(const uint8_t* yPosition, const
unsigned int segmentSize1, const
unsigned int segmentSize2, const
unsigned int segmentSize3, const
unsigned int segmentSize4, const
unsigned int segmentSize5);
214 static
bool checkBullseyeInColumn(const
Frame& yFrame, const
unsigned int xCenter, const
unsigned int yCenter, const
unsigned int threshold, const
unsigned int blackRingSegmentMin, const
unsigned int blackRingSegmentMax, const
unsigned int whiteRingSegmentMin, const
unsigned int whiteRingSegmentMax, const
unsigned int dotSegmentMin, const
unsigned int dotSegmentMax);
228 static
bool checkBullseyeInNeighborhood(const
Frame& yFrame, const
unsigned int xCenter, const
unsigned int yCenter, const
unsigned int threshold, const
float whiteRingRadius, const
float blackRingRadius, const
float whiteBorderRadius);
This class implements the abstract base class for all AnyCamera objects.
Definition AnyCamera.h:130
This class holds the most important parameters for the detector.
Definition MonoBullseyeDetector.h:46
bool useAdaptiveRowSpacing_
Determines whether adaptive row spacing is used (true) or every row is scanned (false) during bullsey...
Definition MonoBullseyeDetector.h:101
bool isValid() const noexcept
Returns whether the parameters are valid.
Parameters()=default
Creates a new valid parameter object.
unsigned int framePyramidLayers_
The number of layers for the frame pyramid, with range [1, infinity)
Definition MonoBullseyeDetector.h:98
unsigned int framePyramidLayers() const noexcept
Returns the number of layers for the frame pyramid.
bool useAdaptiveRowSpacing() const noexcept
Returns whether adaptive row spacing is enabled during bullseye detection.
unsigned int framePyramidPixelThreshold() const noexcept
Returns the pixel threshold for frame pyramid creation.
unsigned int framePyramidPixelThreshold_
The pixel threshold for frame pyramid creation, with range [0, infinity)
Definition MonoBullseyeDetector.h:95
static Parameters defaultParameters() noexcept
Returns the default parameters for the detector.
void setUseAdaptiveRowSpacing(bool useAdaptiveRowSpacing) noexcept
Sets whether adaptive row spacing should be used during bullseye detection.
Implementation of a monocular detector for the bullseye pattern.
Definition MonoBullseyeDetector.h:39
static bool isTransitionToBlack(const uint8_t *pixel, TransitionHistory &history)
Checks whether the given pixel is a transition-to-black pixel (whether the direct left neighbor is a ...
static bool isTransitionToWhite(const uint8_t *pixel, TransitionHistory &history)
Checks whether the given pixel is a transition-to-white pixel (whether the direct left neighbor is a ...
static bool checkBullseyeInNeighborhood(const Frame &yFrame, const unsigned int xCenter, const unsigned int yCenter, const unsigned int threshold, const float whiteRingRadius, const float blackRingRadius, const float whiteBorderRadius)
Checks whether the direct neighborhood contains a bullseye at a specified location.
static void detectBullseyesSubset(const AnyCamera *camera, const Frame *yFrame, Bullseyes *bullseyes, Lock *multiThreadLock, const bool useAdaptiveRowSpacing, const unsigned int firstRow, const unsigned int numberRows)
Detects bullseyes in a subset of a given 8-bit grayscale image.
static bool findNextLowerPixel(const Frame &yFrame, const unsigned int x, const unsigned int y, const unsigned int maximalRows, const unsigned int threshold, unsigned int &rows)
Finds either the next black or the next white pixel towards positive y direction (downwards in an ima...
static constexpr int deltaThreshold_
The intensity threshold between two successive pixels to count as a transition from black to white (o...
Definition MonoBullseyeDetector.h:244
static bool detectBullseyes(const AnyCamera &camera, const Frame &yFrame, Bullseyes &bullseyes, const Parameters ¶meters=Parameters::defaultParameters(), Worker *worker=nullptr)
Detects bullseyes in a given 8-bit grayscale image.
static bool findNextUpperPixel(const Frame &yFrame, const unsigned int x, const unsigned int y, const unsigned int maximalRows, const unsigned int threshold, unsigned int &rows)
Finds either the next black or the next white pixel towards negative y direction (upwards in an image...
static bool checkBullseyeInColumn(const Frame &yFrame, const unsigned int xCenter, const unsigned int yCenter, const unsigned int threshold, const unsigned int blackRingSegmentMin, const unsigned int blackRingSegmentMax, const unsigned int whiteRingSegmentMin, const unsigned int whiteRingSegmentMax, const unsigned int dotSegmentMin, const unsigned int dotSegmentMax)
Checks whether a column contains a bullseye at a specified location.
static void detectBullseyesInRow(const AnyCamera &camera, const Frame &yFrame, const unsigned int y, Bullseyes &bullseyes)
Detects bullseyes in a row of a grayscale image.
static unsigned int determineThreshold(const uint8_t *yPosition, const unsigned int segmentSize1, const unsigned int segmentSize2, const unsigned int segmentSize3, const unsigned int segmentSize4, const unsigned int segmentSize5)
Determines the gray threshold separating bright pixels from dark pixels.
static bool determineAccurateBullseyeLocation(const Frame &yFrame, const unsigned int xBullseye, const unsigned int yBullseye, const unsigned int threshold, Vector2 &location)
Determines the sub-pixel location of the center dot of a known bullseye.
This class implements a simple history for previous pixel transitions (a sliding window of pixel tran...
Definition TransitionHistory.h:30
This class implements Ocean's image class.
Definition Frame.h:1808
This class implements a recursive lock object.
Definition Lock.h:31
This class implements a worker able to distribute function calls over different threads.
Definition Worker.h:33
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