44 #ifndef OPENCV_OBJDETECT_HPP
45 #define OPENCV_OBJDETECT_HPP
47 #include "opencv2/core.hpp"
48 #include "opencv2/objdetect/aruco_detector.hpp"
49 #include "opencv2/objdetect/graphical_code_detector.hpp"
136 typedef struct CvHaarClassifierCascade CvHaarClassifierCascade;
183 int groupThreshold,
double eps = 0.2);
193 double detectThreshold = 0.0,
Size winDetSize =
Size(64, 128));
216 int minNeighbors,
int flags,
223 int minNeighbors,
int flags,
229 CV_OUT std::vector<
double>& levelWeights,
231 int minNeighbors,
int flags,
233 bool outputRejectLevels ) = 0;
235 virtual
bool isOldFormatCascade() const = 0;
236 virtual
Size getOriginalWindowSize() const = 0;
237 virtual
int getFeatureType() const = 0;
238 virtual
void* getOldCascade() = 0;
299 double scaleFactor = 1.1,
300 int minNeighbors = 3,
int flags = 0,
322 double scaleFactor=1.1,
348 double scaleFactor = 1.1,
349 int minNeighbors = 3,
int flags = 0,
352 bool outputRejectLevels =
false );
407 enum { DEFAULT_NLEVELS = 64
416 cellSize(8,8), nbins(9), derivAperture(1), winSigma(-1),
417 histogramNormType(
HOGDescriptor::L2Hys), L2HysThreshold(0.2), gammaCorrection(true),
418 free_coef(-1.f), nlevels(
HOGDescriptor::DEFAULT_NLEVELS), signedGradient(false)
436 Size _cellSize,
int _nbins,
int _derivAperture=1,
double _winSigma=-1,
438 double _L2HysThreshold=0.2,
bool _gammaCorrection=
false,
440 : winSize(_winSize),
blockSize(_blockSize), blockStride(_blockStride), cellSize(_cellSize),
441 nbins(_nbins), derivAperture(_derivAperture), winSigma(_winSigma),
442 histogramNormType(_histogramNormType), L2HysThreshold(_L2HysThreshold),
443 gammaCorrection(_gammaCorrection), free_coef(-1.f), nlevels(_nlevels), signedGradient(_signedGradient)
542 double hitThreshold = 0,
Size winStride =
Size(),
557 double hitThreshold = 0,
Size winStride =
Size(),
579 double groupThreshold = 2.0,
bool useMeanshiftGrouping =
false)
const;
596 double hitThreshold = 0,
Size winStride =
Size(),
598 double groupThreshold = 2.0,
bool useMeanshiftGrouping =
false)
const;
692 double hitThreshold = 0,
693 int groupThreshold = 0)
const;
717 MODE_ALPHANUMERIC = 2,
721 MODE_STRUCTURED_APPEND = 3
868 #include "opencv2/objdetect/detection_based_tracker.hpp"
869 #include "opencv2/objdetect/face.hpp"
870 #include "opencv2/objdetect/charuco_detector.hpp"
871 #include "opencv2/objdetect/barcode.hpp"
This is a base class for all more or less complex algorithms in OpenCV.
Definition: core.hpp:3197
Definition: objdetect.hpp:241
virtual void initializeMask(const Mat &)
Definition: objdetect.hpp:245
virtual ~MaskGenerator()
Definition: objdetect.hpp:243
virtual Mat generateMask(const Mat &src)=0
Definition: objdetect.hpp:208
virtual ~BaseCascadeClassifier()
virtual bool empty() const CV_OVERRIDE=0
Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read.
virtual Ptr< MaskGenerator > getMaskGenerator()=0
virtual void setMaskGenerator(const Ptr< MaskGenerator > &maskGenerator)=0
Cascade classifier class for object detection.
Definition: objdetect.hpp:258
Ptr< BaseCascadeClassifier > cc
Definition: objdetect.hpp:364
CV_WRAP int getFeatureType() const
CV_WRAP void detectMultiScale(InputArray image, CV_OUT std::vector< Rect > &objects, double scaleFactor=1.1, int minNeighbors=3, int flags=0, Size minSize=Size(), Size maxSize=Size())
Detects objects of different sizes in the input image. The detected objects are returned as a list of...
CV_WRAP bool empty() const
Checks whether the classifier has been loaded.
CV_WRAP bool isOldFormatCascade() const
CV_WRAP CascadeClassifier(const String &filename)
Loads a classifier from a file.
CV_WRAP_AS(detectMultiScale3) void detectMultiScale(InputArray image
CV_WRAP Size getOriginalWindowSize() const
CV_WRAP CascadeClassifier()
void setMaskGenerator(const Ptr< BaseCascadeClassifier::MaskGenerator > &maskGenerator)
CV_WRAP bool load(const String &filename)
Loads a classifier from a file.
CV_WRAP bool read(const FileNode &node)
Reads a classifier from a FileStorage node.
Ptr< BaseCascadeClassifier::MaskGenerator > getMaskGenerator()
CV_WRAP_AS(detectMultiScale2) void detectMultiScale(InputArray image
static CV_WRAP bool convert(const String &oldcascade, const String &newcascade)
File Storage Node class.
Definition: persistence.hpp:482
XML/YAML/JSON file storage class that encapsulates all the information necessary for writing or readi...
Definition: persistence.hpp:304
Definition: graphical_code_detector.hpp:14
n-dimensional dense array class
Definition: mat.hpp:812
Definition: objdetect.hpp:813
CV_WRAP QRCodeDetectorAruco(const QRCodeDetectorAruco::Params ¶ms)
QR code detector constructor for Aruco-based algorithm. See cv::QRCodeDetectorAruco::Params.
CV_WRAP const aruco::DetectorParameters & getArucoParameters() const
Aruco detector parameters are used to search for the finder patterns.
CV_WRAP QRCodeDetectorAruco()
CV_WRAP const QRCodeDetectorAruco::Params & getDetectorParameters() const
Detector parameters getter. See cv::QRCodeDetectorAruco::Params.
CV_WRAP void setArucoParameters(const aruco::DetectorParameters ¶ms)
Aruco detector parameters are used to search for the finder patterns.
CV_WRAP QRCodeDetectorAruco & setDetectorParameters(const QRCodeDetectorAruco::Params ¶ms)
Detector parameters setter. See cv::QRCodeDetectorAruco::Params.
Definition: objdetect.hpp:773
CV_WRAP QRCodeDetector & setEpsX(double epsX)
sets the epsilon used during the horizontal scan of QR code stop marker detection.
CV_WRAP std::string detectAndDecodeCurved(InputArray img, OutputArray points=noArray(), OutputArray straight_qrcode=noArray())
Both detects and decodes QR code on a curved surface.
CV_WRAP cv::String decodeCurved(InputArray img, InputArray points, OutputArray straight_qrcode=noArray())
Decodes QR code on a curved surface in image once it's found by the detect() method.
CV_WRAP QRCodeDetector & setUseAlignmentMarkers(bool useAlignmentMarkers)
use markers to improve the position of the corners of the QR code
CV_WRAP QRCodeDetector & setEpsY(double epsY)
sets the epsilon used during the vertical scan of QR code stop marker detection.
Definition: objdetect.hpp:708
static CV_WRAP Ptr< QRCodeEncoder > create(const QRCodeEncoder::Params ¶meters=QRCodeEncoder::Params())
Constructor.
ECIEncodings
Definition: objdetect.hpp:731
virtual CV_WRAP void encode(const String &encoded_info, OutputArray qrcode)=0
Generates QR code from input string.
EncodeMode
Definition: objdetect.hpp:714
virtual CV_WRAP void encodeStructuredAppend(const String &encoded_info, OutputArrayOfArrays qrcodes)=0
Generates QR code from input string in Structured Append mode. The encoded message is splitting over ...
CorrectionLevel
Definition: objdetect.hpp:724
Template class for 2D rectangles.
Definition: types.hpp:444
_Tp x
x coordinate of the top-left corner
Definition: types.hpp:480
_Tp y
y coordinate of the top-left corner
Definition: types.hpp:481
_Tp width
width of the rectangle
Definition: types.hpp:482
_Tp height
height of the rectangle
Definition: types.hpp:483
This class is used for grouping object candidates detected by Cascade Classifier, HOG etc.
Definition: objdetect.hpp:151
double eps
Definition: objdetect.hpp:162
SimilarRects(double _eps)
Definition: objdetect.hpp:153
bool operator()(const Rect &r1, const Rect &r2) const
Definition: objdetect.hpp:154
Template class for specifying the size of an image or rectangle.
Definition: types.hpp:335
This type is very similar to InputArray except that it is used for input/output and output function p...
Definition: mat.hpp:296
InputArrayOfArrays Size InputOutputArray InputOutputArray OutputArrayOfArrays OutputArrayOfArrays OutputArray OutputArray OutputArray int flags
Definition: calib3d.hpp:1617
std::string String
Definition: cvstd.hpp:151
Size2i Size
Definition: types.hpp:370
CV_EXPORTS InputOutputArray noArray()
CV__DEBUG_NS_END typedef const _InputArray & InputArray
Definition: mat.hpp:442
CvScalar scale
Definition: core_c.h:1088
const char const char ** filename
Definition: core_c.h:2630
softfloat abs(softfloat a)
Absolute value.
Definition: softfloat.hpp:444
#define CV_EXPORTS_W_SIMPLE
Definition: cvdef.h:473
#define CV_EXPORTS
Definition: cvdef.h:435
#define CV_IN_OUT
Definition: cvdef.h:477
#define CV_OVERRIDE
Definition: cvdef.h:792
#define CV_OUT
Definition: cvdef.h:478
#define CV_EXPORTS_W
Definition: cvdef.h:472
#define CV_PROP
Definition: cvdef.h:479
#define CV_PROP_RW
Definition: cvdef.h:480
#define CV_WRAP
Definition: cvdef.h:481
CvSize int int int CvPoint int delta
Definition: imgproc_c.h:1168
int CvMemStorage int double eps
Definition: imgproc_c.h:493
CV_EXPORTS OutputArray int double double InputArray OutputArray int blockSize
Definition: imgproc.hpp:2132
CV_EXPORTS Ptr< BaseCascadeClassifier::MaskGenerator > createFaceDetectionMaskGenerator()
@ CASCADE_DO_CANNY_PRUNING
Definition: objdetect.hpp:201
@ CASCADE_SCALE_IMAGE
Definition: objdetect.hpp:202
@ CASCADE_FIND_BIGGEST_OBJECT
Definition: objdetect.hpp:203
@ CASCADE_DO_ROUGH_SEARCH
Definition: objdetect.hpp:204
CV_EXPORTS void groupRectangles_meanshift(std::vector< Rect > &rectList, std::vector< double > &foundWeights, std::vector< double > &foundScales, double detectThreshold=0.0, Size winDetSize=Size(64, 128))
CV_EXPORTS void groupRectangles(std::vector< Rect > &rectList, int groupThreshold, double eps=0.2)
Groups the object candidate rectangles.
"black box" representation of the file storage associated with a file on disk.
Definition: calib3d.hpp:441
Definition: cvstd_wrapper.hpp:32
struct for detection region of interest (ROI)
Definition: objdetect.hpp:376
std::vector< double > confidences
vector that will contain confidence values for each location
Definition: objdetect.hpp:382
double scale
scale(size) of the bounding box
Definition: objdetect.hpp:378
std::vector< cv::Point > locations
set of requested locations to be evaluated
Definition: objdetect.hpp:380
Implementation of HOG (Histogram of Oriented Gradients) descriptor and object detector.
Definition: objdetect.hpp:403
CV_PROP Size winSize
Detection window size. Align to block size and block stride. Default value is Size(64,...
Definition: objdetect.hpp:621
CV_WRAP size_t getDescriptorSize() const
Returns the number of coefficients required for the classification.
virtual void detectMultiScale(InputArray img, CV_OUT std::vector< Rect > &foundLocations, double hitThreshold=0, Size winStride=Size(), Size padding=Size(), double scale=1.05, double groupThreshold=2.0, bool useMeanshiftGrouping=false) const
Detects objects of different sizes in the input image. The detected objects are returned as a list of...
DescriptorStorageFormat
Definition: objdetect.hpp:409
@ DESCR_FORMAT_COL_BY_COL
Definition: objdetect.hpp:409
CV_WRAP HOGDescriptor(const String &filename)
Definition: objdetect.hpp:451
CV_WRAP HOGDescriptor()
Creates the HOG descriptor and detector with default parameters.
Definition: objdetect.hpp:415
CV_PROP std::vector< float > svmDetector
coefficients for the linear SVM classifier.
Definition: objdetect.hpp:651
CV_WRAP bool checkDetectorSize() const
Checks if detector size equal to descriptor size.
static CV_WRAP std::vector< float > getDaimlerPeopleDetector()
Returns coefficients of the classifier trained for people detection (for 48x96 windows).
CV_PROP bool gammaCorrection
Flag to specify whether the gamma correction preprocessing is required or not.
Definition: objdetect.hpp:648
virtual bool read(FileNode &fn)
Reads HOGDescriptor parameters and coefficients for the linear SVM classifier from a file node.
virtual void write(FileStorage &fs, const String &objname) const
Stores HOGDescriptor parameters and coefficients for the linear SVM classifier in a file storage.
virtual CV_WRAP void compute(InputArray img, CV_OUT std::vector< float > &descriptors, Size winStride=Size(), Size padding=Size(), const std::vector< Point > &locations=std::vector< Point >()) const
Computes HOG descriptors of given image.
virtual CV_WRAP bool load(const String &filename, const String &objname=String())
loads HOGDescriptor parameters and coefficients for the linear SVM classifier from a file
UMat oclSvmDetector
coefficients for the linear SVM classifier used when OpenCL is enabled
Definition: objdetect.hpp:654
virtual CV_WRAP void save(const String &filename, const String &objname=String()) const
saves HOGDescriptor parameters and coefficients for the linear SVM classifier to a file
CV_PROP bool signedGradient
Indicates signed gradient will be used or not.
Definition: objdetect.hpp:663
CV_PROP int derivAperture
not documented
Definition: objdetect.hpp:636
CV_PROP int nlevels
Maximum number of detection window increases. Default value is 64.
Definition: objdetect.hpp:660
CV_PROP double L2HysThreshold
L2-Hys normalization method shrinkage.
Definition: objdetect.hpp:645
CV_WRAP HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride, Size _cellSize, int _nbins, int _derivAperture=1, double _winSigma=-1, HOGDescriptor::HistogramNormType _histogramNormType=HOGDescriptor::L2Hys, double _L2HysThreshold=0.2, bool _gammaCorrection=false, int _nlevels=HOGDescriptor::DEFAULT_NLEVELS, bool _signedGradient=false)
Definition: objdetect.hpp:435
float free_coef
not documented
Definition: objdetect.hpp:657
CV_PROP int nbins
Number of bins used in the calculation of histogram of gradients. Default value is 9.
Definition: objdetect.hpp:633
virtual ~HOGDescriptor()
Default destructor.
Definition: objdetect.hpp:466
virtual void detect(InputArray img, CV_OUT std::vector< Point > &foundLocations, double hitThreshold=0, Size winStride=Size(), Size padding=Size(), const std::vector< Point > &searchLocations=std::vector< Point >()) const
Performs object detection without a multi-scale window.
CV_PROP double winSigma
Gaussian smoothing window parameter.
Definition: objdetect.hpp:639
CV_PROP HOGDescriptor::HistogramNormType histogramNormType
histogramNormType
Definition: objdetect.hpp:642
virtual CV_WRAP void computeGradient(InputArray img, InputOutputArray grad, InputOutputArray angleOfs, Size paddingTL=Size(), Size paddingBR=Size()) const
Computes gradients and quantized gradient orientations.
HistogramNormType
Definition: objdetect.hpp:405
@ L2Hys
Default histogramNormType.
Definition: objdetect.hpp:405
virtual CV_WRAP void detect(InputArray img, CV_OUT std::vector< Point > &foundLocations, CV_OUT std::vector< double > &weights, double hitThreshold=0, Size winStride=Size(), Size padding=Size(), const std::vector< Point > &searchLocations=std::vector< Point >()) const
Performs object detection without a multi-scale window.
virtual void copyTo(HOGDescriptor &c) const
clones the HOGDescriptor
CV_PROP Size cellSize
Cell size. Default value is Size(8,8).
Definition: objdetect.hpp:630
HOGDescriptor(const HOGDescriptor &d)
Definition: objdetect.hpp:459
virtual void detectROI(InputArray img, const std::vector< cv::Point > &locations, CV_OUT std::vector< cv::Point > &foundLocations, CV_OUT std::vector< double > &confidences, double hitThreshold=0, cv::Size winStride=Size(), cv::Size padding=Size()) const
evaluate specified ROI and return confidence value for each location
CV_PROP Size blockSize
Block size in pixels. Align to cell size. Default value is Size(16,16).
Definition: objdetect.hpp:624
CV_WRAP double getWinSigma() const
Returns winSigma value.
CV_PROP Size blockStride
Block stride. It must be a multiple of cell size. Default value is Size(8,8).
Definition: objdetect.hpp:627
void groupRectangles(std::vector< cv::Rect > &rectList, std::vector< double > &weights, int groupThreshold, double eps) const
Groups the object candidate rectangles.
virtual void detectMultiScaleROI(InputArray img, CV_OUT std::vector< cv::Rect > &foundLocations, std::vector< DetectionROI > &locations, double hitThreshold=0, int groupThreshold=0) const
evaluate specified ROI and return confidence value for each location in multiple scales
@ DEFAULT_NLEVELS
Default nlevels value.
Definition: objdetect.hpp:407
virtual CV_WRAP void setSVMDetector(InputArray svmdetector)
Sets coefficients for the linear SVM classifier.
static CV_WRAP std::vector< float > getDefaultPeopleDetector()
Returns coefficients of the classifier trained for people detection (for 64x128 windows).
virtual CV_WRAP void detectMultiScale(InputArray img, CV_OUT std::vector< Rect > &foundLocations, CV_OUT std::vector< double > &foundWeights, double hitThreshold=0, Size winStride=Size(), Size padding=Size(), double scale=1.05, double groupThreshold=2.0, bool useMeanshiftGrouping=false) const
Detects objects of different sizes in the input image. The detected objects are returned as a list of...
Definition: cvstd_wrapper.hpp:74
Definition: objdetect.hpp:817
CV_PROP_RW float maxRotation
The maximum allowed relative rotation for finder patterns in the same QR code, default pi/12.
Definition: objdetect.hpp:824
CV_PROP_RW float maxPenalties
The maximum allowed percentage of penalty points out of total pins in timing pattern,...
Definition: objdetect.hpp:836
CV_PROP_RW float maxModuleSizeMismatch
The maximum allowed relative mismatch in module sizes for finder patterns in the same QR code,...
Definition: objdetect.hpp:827
CV_PROP_RW float maxTimingPatternMismatch
The maximum allowed module relative mismatch for timing pattern module, default 2....
Definition: objdetect.hpp:833
CV_PROP_RW float minModuleSizeInPyramid
The minimum allowed pixel size of a QR module in the smallest image in the image pyramid,...
Definition: objdetect.hpp:821
CV_PROP_RW float scaleTimingPatternScore
The algorithm find QR codes with almost minimum timing pattern score and minimum size,...
Definition: objdetect.hpp:846
CV_PROP_RW float maxColorsMismatch
The maximum allowed relative color mismatch in the timing pattern, default 0.2f.
Definition: objdetect.hpp:839
QR code encoder parameters.
Definition: objdetect.hpp:737
CV_PROP_RW CorrectionLevel correction_level
The optional level of error correction (by default - the lowest).
Definition: objdetect.hpp:744
CV_PROP_RW int version
The optional version of QR code (by default - maximum possible depending on the length of the string)...
Definition: objdetect.hpp:741
CV_PROP_RW EncodeMode mode
The optional encoding mode - Numeric, Alphanumeric, Byte, Kanji, ECI or Structured Append.
Definition: objdetect.hpp:747
CV_PROP_RW int structure_number
The optional number of QR codes to generate in Structured Append mode.
Definition: objdetect.hpp:750
struct DetectorParameters is used by ArucoDetector
Definition: aruco_detector.hpp:25