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
bool knowBoundingBox() const
float area
Area in pixels.
void setBoundingBox(cv::Size2f size)
Set the upright bounding box (from a size)
LedMeasurement(cv::Point2f location, float diam, cv::Size imgSize, float beaconArea=-1)
detail::size< coerce_list< Ts...>> size
Get the size of a list (number of elements.)
cv::Size imageSize
Size of the image the measurement came from.
cv::Size2f boundingBoxSize() const
float diameter
Blob diameter in pixels.
LedMeasurement(cv::KeyPoint const &kp, cv::Size imgSize, float beaconArea=-1)
float circularity
Blob circularity (as defined by OpenCV) - in [0,1].
void setBoundingBox(cv::Rect const &box)
Set the upright bounding box (from a Rect)
LedMeasurement(float x, float y, float diam, cv::Size imgSize, float beaconArea=-1)
Brightness brightness
"Brightness" - currently actually diameter.