16 #if defined(OCEAN_QRCODES_QRCODEDEBUGELEMENTS_ENABLED)
68 inline bool isValid()
const;
133 code_T_camera_(code_T_camera),
134 finderPatterns_(std::move(finderPatterns))
141 return code_T_camera_.isValid() &&
147 (finderPatterns_[1].position() - finderPatterns_[0].position()).cross(finderPatterns_[0].position() - finderPatterns_[2].position()) >=
Scalar(0) &&
148 (finderPatterns_[2].position() - finderPatterns_[1].position()).cross(finderPatterns_[1].position() - finderPatterns_[0].position()) >=
Scalar(0) &&
149 (finderPatterns_[0].position() - finderPatterns_[2].position()).cross(finderPatterns_[2].position() - finderPatterns_[1].position()) >=
Scalar(0);
154 return code_T_camera_;
159 return finderPatterns_;
166 ocean_assert(
false &&
"Frame must be valid and an 8 bit grayscale image and the pixel origin must be the upper left corner");
178 ocean_assert(fovX >
Scalar(0));
186 *sharedAnyCamera = std::make_shared<AnyCameraPinhole>(std::move(anyCamera));
196 ocean_assert(
false &&
"Frame must be valid and an 8 bit grayscale image and the pixel origin must be the upper left corner");
This class implements the abstract base class for all AnyCamera objects.
Definition: AnyCamera.h:130
This class implements a specialized AnyCamera object wrapping the actual camera model.
Definition: AnyCamera.h:494
Definition of an observation of QR code in 2D.
Definition: QRCodeDetector2D.h:49
FinderPatternTriplet finderPatterns_
The finder patterns of the QR code, order: top-left, bottom-left, top-right.
Definition: QRCodeDetector2D.h:88
const FinderPatternTriplet & finderPatterns() const
Returns a pointer to the finder patterns.
Definition: QRCodeDetector2D.h:157
Observation()=default
Creates an invalid observation.
const HomogenousMatrix4 & code_T_camera() const
Returns the transformation that maps coordinates in the QR code grid to coordinates in the reference ...
Definition: QRCodeDetector2D.h:152
bool isValid() const
Returns if the observation is valid.
Definition: QRCodeDetector2D.h:139
This class implements a detector for QR Codes.
Definition: QRCodeDetector2D.h:42
std::vector< Observation > Observations
Definition of a vector of observations.
Definition: QRCodeDetector2D.h:92
static QRCodes detectQRCodes(const Frame &yFrame, Observations *observations=nullptr, Worker *worker=nullptr, SharedAnyCamera *anyCamera=nullptr)
Detects QR codes in an 8-bit grayscale image without lens distortion.
Definition: QRCodeDetector2D.h:162
static QRCodes detectQRCodes(const AnyCamera &anyCamera, const uint8_t *const yFrame, const unsigned int width, const unsigned int height, const unsigned int paddingElements, Observations *observations=nullptr, Worker *worker=nullptr)
Detects QR codes in an 8-bit grayscale image.
This class implements common functionality of QR code detectors but is not a stand-alone detector.
Definition: QRCodeDetector.h:33
static T fovY2X(const T fovY, const T aspectRatio)
Calculates the horizontal FOV from the vertical FOV and the aspect ratio of the camera image.
Definition: Camera.h:417
This class implements Ocean's image class.
Definition: Frame.h:1792
const T * constdata(const unsigned int planeIndex=0u) const
Returns a pointer to the read-only pixel data of a specific plane.
Definition: Frame.h:4168
bool isValid() const
Returns whether this frame is valid.
Definition: Frame.h:4448
unsigned int paddingElements(const unsigned int planeIndex=0u) const
Returns the optional number of padding elements at the end of each row for a specific plane.
Definition: Frame.h:4042
@ FORMAT_Y8
Pixel format for grayscale images with byte order Y and 8 bits per pixel.
Definition: Frame.h:594
unsigned int width() const
Returns the width of the frame format in pixel.
Definition: Frame.h:3143
PixelOrigin pixelOrigin() const
Returns the pixel origin of the frame.
Definition: Frame.h:3188
static bool arePixelFormatsCompatible(const PixelFormat pixelFormatA, const PixelFormat pixelFormatB)
Returns whether two given pixel formats are compatible.
PixelFormat pixelFormat() const
Returns the pixel format of the frame.
Definition: Frame.h:3153
@ ORIGIN_UPPER_LEFT
The first pixel lies in the upper left corner, the last pixel in the lower right corner.
Definition: Frame.h:1050
unsigned int height() const
Returns the height of the frame in pixel.
Definition: Frame.h:3148
static constexpr T deg2rad(const T deg)
Converts deg to rad.
Definition: Numeric.h:3232
static constexpr bool isNotEqualEps(const T value)
Returns whether a value is not smaller than or equal to a small epsilon.
Definition: Numeric.h:2237
This class implements a worker able to distribute function calls over different threads.
Definition: Worker.h:33
unsigned int sqrDistance(const char first, const char second)
Returns the square distance between two values.
Definition: base/Utilities.h:1089
std::array< FinderPattern, 3 > FinderPatternTriplet
Definition of a 3-tuple of finder patterns.
Definition: FinderPatternDetector.h:198
float Scalar
Definition of a scalar type.
Definition: Math.h:128
std::shared_ptr< AnyCamera > SharedAnyCamera
Definition of a shared pointer holding an AnyCamera object with Scalar precision.
Definition: AnyCamera.h:60
PinholeCameraT< Scalar > PinholeCamera
Definition of an pinhole camera object with Scalar precision.
Definition: PinholeCamera.h:32
HomogenousMatrixT4< Scalar > HomogenousMatrix4
Definition of the HomogenousMatrix4 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION flag eit...
Definition: HomogenousMatrix4.h:37
std::vector< QRCode > QRCodes
Definition of a vector of QR codes.
Definition: QRCode.h:25
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15