Ocean
Loading...
Searching...
No Matches
cv/detector/bullseyes/Utilities.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_UTILITIES_H
9#define OCEAN_CV_DETECTOR_BULLSEYES_UTILITIES_H
10
12
14
15#include "ocean/base/Frame.h"
16
18
19namespace Ocean
20{
21
22namespace CV
23{
24
25namespace Detector
26{
27
28namespace Bullseyes
29{
30
31/**
32 * This class implements utility functions for the Bullseyes library.
33 * @ingroup cvdetectorbullseyes
34 */
35class OCEAN_CV_DETECTOR_BULLSEYES_EXPORT Utilities
36{
37 public:
38
39 /**
40 * Creates a bullseye image with a given diameter and quiet zone.
41 * @param diameter The diameter of the bullseye in pixels, with range [5, infinity) and must be a multiple of 5
42 * @param emptyBorder The width of an empty border around the bullseye (quiet zone), in pixels, with range [0, infinity)
43 * @param rgbFrame The resulting bullseye image
44 * @param foregroundColor Optional foreground color of the bullseye, nullptr to use the default color (black)
45 * @param backgroundColor Optional background color of the bullseye, nullptr to use the default color (white)
46 * @return True, if succeeded
47 */
48 static bool createBullseyeImage(const unsigned int diameter, const unsigned int emptyBorder, Frame& rgbFrame, const uint8_t* foregroundColor = nullptr, const uint8_t* backgroundColor = nullptr);
49
50 /**
51 * Draws the location of a bullseye into a given frame.
52 * @param frame The frame in which the bullseye will be painted, must be valid and have a pixel format RGB24 (or compatible)
53 * @param bullseye The bullseye to be painted, must be valid
54 * @param color Optional color to be used, one value for each frame channel, nullptr to use the default color (red)
55 */
56 static void drawBullseye(Frame& frame, const Bullseye& bullseye, const uint8_t* color = nullptr);
57
58 /**
59 * Draws the locations of multiple bullseyes into a given frame.
60 * @param frame The frame in which the bullseyes will be painted, must be valid and have a pixel format RGB24 (or compatible)
61 * @param bullseyes The bullseyes to be painted, must be valid
62 * @param numberBullseyes The number of bullseyes to be painted, with range [0, infinity)
63 * @param color Optional color to be used, one value for each frame channel, nullptr to use the default color (red)
64 */
65 static void drawBullseyes(Frame& frame, const Bullseye* bullseyes, const size_t numberBullseyes, const uint8_t* color = nullptr);
66
67 /**
68 * Draws an epipolar line into a given frame.
69 * @param rgbFrame The frame in which the epipolar line will be painted, must be valid and have a pixel format RGB24 (or compatible)
70 * @param epipolarLine The epipolar line to be painted, defined as a sequence of connected points
71 * @param color Optional color to be used, one value for each frame channel, nullptr to use the default color (green)
72 */
73 static void drawEpipolarLine(Ocean::Frame& rgbFrame, const Geometry::FisheyeEpipolarGeometry::EpipolarLine& epipolarLine, const uint8_t* color = nullptr);
74
75 /**
76 * Draws multiple epipolar lines into a given frame.
77 * @param rgbFrame The frame in which the epipolar lines will be painted, must be valid and have a pixel format RGB24 (or compatible)
78 * @param epipolarLines The epipolar lines to be painted, each defined as a sequence of connected points
79 * @param color Optional color to be used, one value for each frame channel, nullptr to use the default color (green)
80 */
81 static void drawEpipolarLines(Ocean::Frame& rgbFrame, const Geometry::FisheyeEpipolarGeometry::EpipolarLines& epipolarLines, const uint8_t* color = nullptr);
82};
83
84} // namespace Bullseyes
85
86} // namespace Detector
87
88} // namespace CV
89
90} // namespace Ocean
91
92#endif // OCEAN_CV_DETECTOR_BULLSEYES_UTILITIES_H
Definition of a bullseye composed of a location and a radius.
Definition Bullseye.h:32
This class implements utility functions for the Bullseyes library.
Definition cv/detector/bullseyes/Utilities.h:36
static void drawEpipolarLines(Ocean::Frame &rgbFrame, const Geometry::FisheyeEpipolarGeometry::EpipolarLines &epipolarLines, const uint8_t *color=nullptr)
Draws multiple epipolar lines into a given frame.
static bool createBullseyeImage(const unsigned int diameter, const unsigned int emptyBorder, Frame &rgbFrame, const uint8_t *foregroundColor=nullptr, const uint8_t *backgroundColor=nullptr)
Creates a bullseye image with a given diameter and quiet zone.
static void drawEpipolarLine(Ocean::Frame &rgbFrame, const Geometry::FisheyeEpipolarGeometry::EpipolarLine &epipolarLine, const uint8_t *color=nullptr)
Draws an epipolar line into a given frame.
static void drawBullseye(Frame &frame, const Bullseye &bullseye, const uint8_t *color=nullptr)
Draws the location of a bullseye into a given frame.
static void drawBullseyes(Frame &frame, const Bullseye *bullseyes, const size_t numberBullseyes, const uint8_t *color=nullptr)
Draws the locations of multiple bullseyes into a given frame.
This class implements Ocean's image class.
Definition Frame.h:1808
std::vector< Vector2 > EpipolarLine
Definition of an epipolar line as a vector of 2D points.
Definition FisheyeEpipolarGeometry.h:46
std::vector< EpipolarLine > EpipolarLines
Definition of a vector holding epipolar lines.
Definition FisheyeEpipolarGeometry.h:51
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