Detect blobs in image (specialized for dynamic obstacles in the costmap) More...
#include <blob_detector.h>
Classes | |
struct | Center |
Public Member Functions | |
BlobDetector (const cv::SimpleBlobDetector::Params ¶meters=cv::SimpleBlobDetector::Params()) | |
Default constructor which optionally accepts custom parameters. | |
virtual void | detect (const cv::Mat &image, std::vector< cv::KeyPoint > &keypoints, const cv::Mat &mask=cv::Mat()) |
Detects keypoints in an image and extracts contours. | |
const std::vector< std::vector < cv::Point > > & | getContours () |
Access contours extracted during detection stage. | |
void | updateParameters (const cv::SimpleBlobDetector::Params ¶meters) |
Update internal parameters. | |
Static Public Member Functions | |
static cv::Ptr< BlobDetector > | create (const BlobDetector::Params ¶ms) |
Create shared instance of the blob detector with given parameters. | |
Protected Member Functions | |
virtual void | findBlobs (const cv::Mat &image, const cv::Mat &binary_image, std::vector< Center > ¢ers, std::vector< std::vector< cv::Point >> &cur_contours) const |
Protected Attributes | |
std::vector< std::vector < cv::Point > > | contours_ |
Params | params_ |
Detect blobs in image (specialized for dynamic obstacles in the costmap)
This class is based on OpenCV's blob detector cv::SimpleBlobDetector. It has been modified and specialized for dynamic obstacle tracking in the costmap: -> The modified version also returns contours of the blob.
See http://docs.opencv.org/trunk/d0/d7a/classcv_1_1SimpleBlobDetector.html for the original class.
Definition at line 60 of file blob_detector.h.
BlobDetector::BlobDetector | ( | const cv::SimpleBlobDetector::Params & | parameters = cv::SimpleBlobDetector::Params() | ) |
Default constructor which optionally accepts custom parameters.
Definition at line 5 of file blob_detector.cpp.
cv::Ptr< BlobDetector > BlobDetector::create | ( | const BlobDetector::Params & | params | ) | [static] |
Create shared instance of the blob detector with given parameters.
Definition at line 7 of file blob_detector.cpp.
void BlobDetector::detect | ( | const cv::Mat & | image, |
std::vector< cv::KeyPoint > & | keypoints, | ||
const cv::Mat & | mask = cv::Mat() |
||
) | [virtual] |
Detects keypoints in an image and extracts contours.
In contrast to the original detect method, this extended version also extracts contours. Contours can be accessed by getContours() after invoking this method.
image | image |
keypoints | The detected keypoints. |
mask | Mask specifying where to look for keypoints (optional). It must be a 8-bit integer matrix with non-zero values in the region of interest. |
Definition at line 13 of file blob_detector.cpp.
void BlobDetector::findBlobs | ( | const cv::Mat & | image, |
const cv::Mat & | binary_image, | ||
std::vector< Center > & | centers, | ||
std::vector< std::vector< cv::Point >> & | cur_contours | ||
) | const [protected, virtual] |
Definition at line 93 of file blob_detector.cpp.
const std::vector<std::vector<cv::Point> >& BlobDetector::getContours | ( | ) | [inline] |
Access contours extracted during detection stage.
Definition at line 90 of file blob_detector.h.
void BlobDetector::updateParameters | ( | const cv::SimpleBlobDetector::Params & | parameters | ) |
Update internal parameters.
Definition at line 190 of file blob_detector.cpp.
std::vector<std::vector<cv::Point> > BlobDetector::contours_ [protected] |
Definition at line 106 of file blob_detector.h.
Params BlobDetector::params_ [protected] |
Definition at line 108 of file blob_detector.h.