nim_duilib/examples/contour/blob/BlobDetector.h
2025-03-16 16:42:44 +08:00

46 lines
1.0 KiB
C++

#ifndef BLOBDETECTOR_H
#define BLOBDETECTOR_H
#include <vector>
#include <functional>
#include "opencv2/core/core_c.h"
#include <opencv2/opencv.hpp>
#include "blob.h"
#include "BlobOperators.h"
#include "ComponentLabeling.h"
#include "BlobGroup.h"
class BlobDetector
{
public:
BlobDetector();
BlobDetector(IplImage* source, IplImage* mask = NULL, int numThreads = 1);
BlobDetector(cv::Mat& source, const cv::Mat& mask = cv::Mat(), int numThreads = 1);
BlobDetector(const BlobDetector& source);
BlobDetector& operator=(const BlobDetector& source);
BlobDetector(BlobDetector&& source) noexcept;
BlobDetector& operator=(BlobDetector&& source) noexcept;
//! Destructor
virtual ~BlobDetector();
//! Function to detect blobs in a new image
const BlobGroup& detect(cv::Mat& source, const cv::Mat& mask = cv::Mat(), int numThreads = 1);
const BlobGroup& getBlobGroup();
private:
CompLabelerGroup m_compLabeler;
BlobGroup m_blobGroup;
};
#endif // BLOBDETECTOR_H