25 #ifndef INCLUDED_LedMeasurement_h_GUID_FB847F67_347B_4C8E_AC9B_33179ED6B0E6 26 #define INCLUDED_LedMeasurement_h_GUID_FB847F67_347B_4C8E_AC9B_33179ED6B0E6 32 #include <opencv2/core/core.hpp> 33 #include <opencv2/features2d/features2d.hpp> 43 static float estimateArea(
float diameter) {
44 return static_cast<float>((diameter / 2) * (diameter / 2) * CV_PI);
53 float beaconArea = -1)
56 area(beaconArea <= 0 ? estimateArea(diameter) : beaconArea) {}
62 float beaconArea = -1)
70 float beaconArea = -1)
102 "knowBoundingBox() is false");
108 knowBoundingBox_ =
true;
114 knowBoundingBox_ =
true;
115 boundingBox_ = box.size();
121 knowBoundingBox_ == other.knowBoundingBox_ &&
122 (knowBoundingBox_ ? boundingBox_ == other.boundingBox_
133 bool knowBoundingBox_ =
false;
135 cv::Size2f boundingBox_;
138 typedef std::vector<LedMeasurement> LedMeasurementVec;
139 typedef LedMeasurementVec::iterator LedMeasurementVecIterator;
143 #endif // INCLUDED_LedMeasurement_h_GUID_FB847F67_347B_4C8E_AC9B_33179ED6B0E6 The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
float area
Area in pixels.
Definition: LedMeasurement.h:89
cv::Size2f boundingBoxSize() const
Dimensions of the upright bounding box.
Definition: LedMeasurement.h:100
void setBoundingBox(cv::Size2f size)
Set the upright bounding box (from a size)
Definition: LedMeasurement.h:107
LedMeasurement(cv::Point2f location, float diam, cv::Size imgSize, float beaconArea=-1)
Constructor for a measurement.
Definition: LedMeasurement.h:52
bool knowBoundingBox() const
Do we know an upright bounding box? (that is, is the next member valid?)
Definition: LedMeasurement.h:96
detail::size< coerce_list< Ts... >> size
Get the size of a list (number of elements.)
Definition: Size.h:56
cv::Point2f loc
Location in image space - should be undistorted when passed to the Led class.
Definition: LedMeasurement.h:77
cv::Size imageSize
Size of the image the measurement came from.
Definition: LedMeasurement.h:80
float diameter
Blob diameter in pixels.
Definition: LedMeasurement.h:86
Definition: LedMeasurement.h:41
LedMeasurement(cv::KeyPoint const &kp, cv::Size imgSize, float beaconArea=-1)
Constructor for a measurement from a KeyPoint and image size.
Definition: LedMeasurement.h:61
float circularity
Blob circularity (as defined by OpenCV) - in [0,1].
Definition: LedMeasurement.h:92
void setBoundingBox(cv::Rect const &box)
Set the upright bounding box (from a Rect)
Definition: LedMeasurement.h:113
LedMeasurement(float x, float y, float diam, cv::Size imgSize, float beaconArea=-1)
Constructor primarily used by replay for calibration/optimization purposes.
Definition: LedMeasurement.h:69
Brightness brightness
"Brightness" - currently actually diameter.
Definition: LedMeasurement.h:83