25 #ifndef INCLUDED_BlobExtractor_h_GUID_E11BAD60_5C84_4581_C859_6E1FEF0838F5 26 #define INCLUDED_BlobExtractor_h_GUID_E11BAD60_5C84_4581_C859_6E1FEF0838F5 33 #include <opencv2/core/core.hpp> 41 using ContourType = std::vector<cv::Point2i>;
42 using ContourList = std::vector<ContourType>;
63 BlobBasics getContourBasicDetails(ContourType
const &contour);
67 double getConvexity(ContourType
const &contour,
const double area);
71 cv::minMaxIdx(img, &minVal, &maxVal);
75 double lerp(
double alpha)
const {
76 return minVal + (maxVal - minVal) * alpha;
85 : minThreshold(
std::max(rangeInfo.lerp(p.minThresholdAlpha),
86 p.absoluteMinThreshold)),
87 maxThreshold(
std::max(rangeInfo.lerp(0.8),
88 p.absoluteMinThreshold)),
89 thresholdStep((maxThreshold - minThreshold) / p.thresholdSteps) {}
94 double minThreshold = 0;
95 double maxThreshold = 255;
96 double thresholdStep = 255;
102 operator()(cv::Mat
const &gray,
103 cv::SimpleBlobDetector::Params
const ¶ms);
104 ContourList binarizeAndGetSolidComponents(
int thresh);
107 void makeFloodFillMask(cv::Mat
const &gray);
108 void augmentPoint(cv::Point peakCenter,
const int loDiff = 2,
109 const int upDiff = 2);
111 cv::Mat floodFillMask_;
112 cv::Rect origBoundsInFloodFill_;
118 #endif // INCLUDED_BlobExtractor_h_GUID_E11BAD60_5C84_4581_C859_6E1FEF0838F5 Data structure with just a few bare facts about a contour.
Definition: BlobExtractor.h:55
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
Definition: TypeSafeIdHash.h:44
Definition: BlobExtractor.h:99
Definition: BlobExtractor.h:69
Definition: BlobExtractor.h:80
ImageThresholdInfo(ImageRangeInfo const &rangeInfo, BlobParams const &p)
lerp between min and max, but don't let really dim frames confuse us.
Definition: BlobExtractor.h:82
Data structure with a lot of info about a contour.
Definition: BlobExtractor.h:45
Blob detection configuration parameters.
Definition: BlobParams.h:40