HOGDescriptor
Objective-C
@interface HOGDescriptor : NSObject
Swift
class HOGDescriptor : NSObject
Implementation of HOG (Histogram of Oriented Gradients) descriptor and object detector.
the HOG descriptor algorithm introduced by Navneet Dalal and Bill Triggs CITE: Dalal2005 .
useful links:
https://hal.inria.fr/inria-00548512/document/
https://en.wikipedia.org/wiki/Histogram_of_oriented_gradients
https://software.intel.com/en-us/ipp-dev-reference-histogram-of-oriented-gradients-hog-descriptor
http://www.learnopencv.com/histogram-of-oriented-gradients
http://www.learnopencv.com/handwritten-digits-classification-an-opencv-c-python-tutorial
Member of Objdetect
-
Declaration
Objective-C
@property (class, readonly) int DEFAULT_NLEVELSSwift
class var DEFAULT_NLEVELS: Int32 { get }
-
-initWith_winSize:_blockSize: _blockStride: _cellSize: _nbins: _derivAperture: _winSigma: _histogramNormType: _L2HysThreshold: _gammaCorrection: _nlevels: _signedGradient: Declaration
Objective-C
- (nonnull instancetype)initWith_winSize:(nonnull Size2i *)_winSize _blockSize:(nonnull Size2i *)_blockSize _blockStride:(nonnull Size2i *)_blockStride _cellSize:(nonnull Size2i *)_cellSize _nbins:(int)_nbins _derivAperture:(int)_derivAperture _winSigma:(double)_winSigma _histogramNormType:(HistogramNormType)_histogramNormType _L2HysThreshold:(double)_L2HysThreshold _gammaCorrection:(BOOL)_gammaCorrection _nlevels:(int)_nlevels _signedGradient:(BOOL)_signedGradient;Swift
init(_winSize: Size2i, _blockSize: Size2i, _blockStride: Size2i, _cellSize: Size2i, _nbins: Int32, _derivAperture: Int32, _winSigma: Double, _histogramNormType: HistogramNormType, _L2HysThreshold: Double, _gammaCorrection: Bool, _nlevels: Int32, _signedGradient: Bool)Parameters
_winSizesets winSize with given value.
_blockSizesets blockSize with given value.
_blockStridesets blockStride with given value.
_cellSizesets cellSize with given value.
_nbinssets nbins with given value.
_derivAperturesets derivAperture with given value.
_winSigmasets winSigma with given value.
_histogramNormTypesets histogramNormType with given value.
_L2HysThresholdsets L2HysThreshold with given value.
_gammaCorrectionsets gammaCorrection with given value.
_nlevelssets nlevels with given value.
_signedGradientsets signedGradient with given value.
-
-initWith_winSize:_blockSize: _blockStride: _cellSize: _nbins: _derivAperture: _winSigma: _histogramNormType: _L2HysThreshold: _gammaCorrection: _nlevels: Declaration
Objective-C
- (nonnull instancetype)initWith_winSize:(nonnull Size2i *)_winSize _blockSize:(nonnull Size2i *)_blockSize _blockStride:(nonnull Size2i *)_blockStride _cellSize:(nonnull Size2i *)_cellSize _nbins:(int)_nbins _derivAperture:(int)_derivAperture _winSigma:(double)_winSigma _histogramNormType:(HistogramNormType)_histogramNormType _L2HysThreshold:(double)_L2HysThreshold _gammaCorrection:(BOOL)_gammaCorrection _nlevels:(int)_nlevels;Swift
init(_winSize: Size2i, _blockSize: Size2i, _blockStride: Size2i, _cellSize: Size2i, _nbins: Int32, _derivAperture: Int32, _winSigma: Double, _histogramNormType: HistogramNormType, _L2HysThreshold: Double, _gammaCorrection: Bool, _nlevels: Int32)Parameters
_winSizesets winSize with given value.
_blockSizesets blockSize with given value.
_blockStridesets blockStride with given value.
_cellSizesets cellSize with given value.
_nbinssets nbins with given value.
_derivAperturesets derivAperture with given value.
_winSigmasets winSigma with given value.
_histogramNormTypesets histogramNormType with given value.
_L2HysThresholdsets L2HysThreshold with given value.
_gammaCorrectionsets gammaCorrection with given value.
_nlevelssets nlevels with given value.
-
-initWith_winSize:_blockSize: _blockStride: _cellSize: _nbins: _derivAperture: _winSigma: _histogramNormType: _L2HysThreshold: _gammaCorrection: Declaration
Objective-C
- (nonnull instancetype)initWith_winSize:(nonnull Size2i *)_winSize _blockSize:(nonnull Size2i *)_blockSize _blockStride:(nonnull Size2i *)_blockStride _cellSize:(nonnull Size2i *)_cellSize _nbins:(int)_nbins _derivAperture:(int)_derivAperture _winSigma:(double)_winSigma _histogramNormType:(HistogramNormType)_histogramNormType _L2HysThreshold:(double)_L2HysThreshold _gammaCorrection:(BOOL)_gammaCorrection;Swift
init(_winSize: Size2i, _blockSize: Size2i, _blockStride: Size2i, _cellSize: Size2i, _nbins: Int32, _derivAperture: Int32, _winSigma: Double, _histogramNormType: HistogramNormType, _L2HysThreshold: Double, _gammaCorrection: Bool)Parameters
_winSizesets winSize with given value.
_blockSizesets blockSize with given value.
_blockStridesets blockStride with given value.
_cellSizesets cellSize with given value.
_nbinssets nbins with given value.
_derivAperturesets derivAperture with given value.
_winSigmasets winSigma with given value.
_histogramNormTypesets histogramNormType with given value.
_L2HysThresholdsets L2HysThreshold with given value.
_gammaCorrectionsets gammaCorrection with given value.
-
-initWith_winSize:_blockSize: _blockStride: _cellSize: _nbins: _derivAperture: _winSigma: _histogramNormType: _L2HysThreshold: Declaration
Objective-C
- (nonnull instancetype)initWith_winSize:(nonnull Size2i *)_winSize _blockSize:(nonnull Size2i *)_blockSize _blockStride:(nonnull Size2i *)_blockStride _cellSize:(nonnull Size2i *)_cellSize _nbins:(int)_nbins _derivAperture:(int)_derivAperture _winSigma:(double)_winSigma _histogramNormType:(HistogramNormType)_histogramNormType _L2HysThreshold:(double)_L2HysThreshold;Swift
init(_winSize: Size2i, _blockSize: Size2i, _blockStride: Size2i, _cellSize: Size2i, _nbins: Int32, _derivAperture: Int32, _winSigma: Double, _histogramNormType: HistogramNormType, _L2HysThreshold: Double)Parameters
_winSizesets winSize with given value.
_blockSizesets blockSize with given value.
_blockStridesets blockStride with given value.
_cellSizesets cellSize with given value.
_nbinssets nbins with given value.
_derivAperturesets derivAperture with given value.
_winSigmasets winSigma with given value.
_histogramNormTypesets histogramNormType with given value.
_L2HysThresholdsets L2HysThreshold with given value.
-
-initWith_winSize:_blockSize: _blockStride: _cellSize: _nbins: _derivAperture: _winSigma: _histogramNormType: Declaration
Objective-C
- (nonnull instancetype)initWith_winSize:(nonnull Size2i *)_winSize _blockSize:(nonnull Size2i *)_blockSize _blockStride:(nonnull Size2i *)_blockStride _cellSize:(nonnull Size2i *)_cellSize _nbins:(int)_nbins _derivAperture:(int)_derivAperture _winSigma:(double)_winSigma _histogramNormType:(HistogramNormType)_histogramNormType;Swift
init(_winSize: Size2i, _blockSize: Size2i, _blockStride: Size2i, _cellSize: Size2i, _nbins: Int32, _derivAperture: Int32, _winSigma: Double, _histogramNormType: HistogramNormType)Parameters
_winSizesets winSize with given value.
_blockSizesets blockSize with given value.
_blockStridesets blockStride with given value.
_cellSizesets cellSize with given value.
_nbinssets nbins with given value.
_derivAperturesets derivAperture with given value.
_winSigmasets winSigma with given value.
_histogramNormTypesets histogramNormType with given value.
-
Declaration
Parameters
_winSizesets winSize with given value.
_blockSizesets blockSize with given value.
_blockStridesets blockStride with given value.
_cellSizesets cellSize with given value.
_nbinssets nbins with given value.
_derivAperturesets derivAperture with given value.
_winSigmasets winSigma with given value.
-
Declaration
Parameters
_winSizesets winSize with given value.
_blockSizesets blockSize with given value.
_blockStridesets blockStride with given value.
_cellSizesets cellSize with given value.
_nbinssets nbins with given value.
_derivAperturesets derivAperture with given value.
-
Declaration
Parameters
_winSizesets winSize with given value.
_blockSizesets blockSize with given value.
_blockStridesets blockStride with given value.
_cellSizesets cellSize with given value.
_nbinssets nbins with given value.
-
Declaration
Objective-C
- (nonnull instancetype)initWithFilename:(nonnull NSString *)filename;Swift
init(filename: String)Parameters
filenameThe file name containing HOGDescriptor properties and coefficients for the linear SVM classifier.
-
Creates the HOG descriptor and detector with default params.
aqual to HOGDescriptor(Size(64,128), Size(16,16), Size(8,8), Size(8,8), 9 )Declaration
Objective-C
- (nonnull instancetype)init;Swift
init() -
Checks if detector size equal to descriptor size.
Declaration
Objective-C
- (BOOL)checkDetectorSize;Swift
func checkDetectorSize() -> Bool -
loads HOGDescriptor parameters and coefficients for the linear SVM classifier from a file.
Declaration
Objective-C
- (BOOL)load:(nonnull NSString *)filename objname:(nonnull NSString *)objname;Swift
func load(filename: String, objname: String) -> BoolParameters
filenamePath of the file to read.
objnameThe optional name of the node to read (if empty, the first top-level node will be used).
-
loads HOGDescriptor parameters and coefficients for the linear SVM classifier from a file.
Declaration
Objective-C
- (BOOL)load:(nonnull NSString *)filename;Swift
func load(filename: String) -> BoolParameters
filenamePath of the file to read.
-
Returns winSigma value
Declaration
Objective-C
- (double)getWinSigma;Swift
func getWinSigma() -> Double -
Returns the number of coefficients required for the classification.
Declaration
Objective-C
- (size_t)getDescriptorSize;Swift
func getDescriptorSize() -> Int -
Returns coefficients of the classifier trained for people detection (for 48x96 windows).
Declaration
Objective-C
+ (nonnull FloatVector *)getDaimlerPeopleDetector;Swift
class func getDaimlerPeopleDetector() -> FloatVector -
Returns coefficients of the classifier trained for people detection (for 64x128 windows).
Declaration
Objective-C
+ (nonnull FloatVector *)getDefaultPeopleDetector;Swift
class func getDefaultPeopleDetector() -> FloatVector -
Computes HOG descriptors of given image.
Declaration
Objective-C
- (void)compute:(nonnull Mat *)img descriptors:(nonnull FloatVector *)descriptors winStride:(nonnull Size2i *)winStride padding:(nonnull Size2i *)padding locations:(nonnull NSArray<Point2i *> *)locations;Swift
func compute(img: Mat, descriptors: FloatVector, winStride: Size2i, padding: Size2i, locations: [Point2i])Parameters
imgMatrix of the type CV_8U containing an image where HOG features will be calculated.
descriptorsMatrix of the type CV_32F
winStrideWindow stride. It must be a multiple of block stride.
paddingPadding
locationsVector of Point
-
Computes HOG descriptors of given image.
Declaration
Objective-C
- (void)compute:(nonnull Mat *)img descriptors:(nonnull FloatVector *)descriptors winStride:(nonnull Size2i *)winStride padding:(nonnull Size2i *)padding;Swift
func compute(img: Mat, descriptors: FloatVector, winStride: Size2i, padding: Size2i)Parameters
imgMatrix of the type CV_8U containing an image where HOG features will be calculated.
descriptorsMatrix of the type CV_32F
winStrideWindow stride. It must be a multiple of block stride.
paddingPadding
-
Computes HOG descriptors of given image.
Declaration
Objective-C
- (void)compute:(nonnull Mat *)img descriptors:(nonnull FloatVector *)descriptors winStride:(nonnull Size2i *)winStride;Swift
func compute(img: Mat, descriptors: FloatVector, winStride: Size2i)Parameters
imgMatrix of the type CV_8U containing an image where HOG features will be calculated.
descriptorsMatrix of the type CV_32F
winStrideWindow stride. It must be a multiple of block stride.
-
Computes HOG descriptors of given image.
Declaration
Objective-C
- (void)compute:(nonnull Mat *)img descriptors:(nonnull FloatVector *)descriptors;Swift
func compute(img: Mat, descriptors: FloatVector)Parameters
imgMatrix of the type CV_8U containing an image where HOG features will be calculated.
descriptorsMatrix of the type CV_32F
-
Computes gradients and quantized gradient orientations.
Declaration
Parameters
imgMatrix contains the image to be computed
gradMatrix of type CV_32FC2 contains computed gradients
angleOfsMatrix of type CV_8UC2 contains quantized gradient orientations
paddingTLPadding from top-left
paddingBRPadding from bottom-right
-
Computes gradients and quantized gradient orientations.
Declaration
Parameters
imgMatrix contains the image to be computed
gradMatrix of type CV_32FC2 contains computed gradients
angleOfsMatrix of type CV_8UC2 contains quantized gradient orientations
paddingTLPadding from top-left
-
Computes gradients and quantized gradient orientations.
Declaration
Parameters
imgMatrix contains the image to be computed
gradMatrix of type CV_32FC2 contains computed gradients
angleOfsMatrix of type CV_8UC2 contains quantized gradient orientations
-
Performs object detection without a multi-scale window.
Declaration
Objective-C
- (void)detect:(nonnull Mat *)img foundLocations:(nonnull NSMutableArray<Point2i *> *)foundLocations weights:(nonnull DoubleVector *)weights hitThreshold:(double)hitThreshold winStride:(nonnull Size2i *)winStride padding:(nonnull Size2i *)padding searchLocations:(nonnull NSArray<Point2i *> *)searchLocations;Swift
func detect(img: Mat, foundLocations: NSMutableArray, weights: DoubleVector, hitThreshold: Double, winStride: Size2i, padding: Size2i, searchLocations: [Point2i])Parameters
imgMatrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
foundLocationsVector of point where each point contains left-top corner point of detected object boundaries.
weightsVector that will contain confidence values for each detected object.
hitThresholdThreshold for the distance between features and SVM classifying plane. Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient). But if the free coefficient is omitted (which is allowed), you can specify it manually here.
winStrideWindow stride. It must be a multiple of block stride.
paddingPadding
searchLocationsVector of Point includes set of requested locations to be evaluated.
-
Performs object detection without a multi-scale window.
Declaration
Objective-C
- (void)detect:(nonnull Mat *)img foundLocations:(nonnull NSMutableArray<Point2i *> *)foundLocations weights:(nonnull DoubleVector *)weights hitThreshold:(double)hitThreshold winStride:(nonnull Size2i *)winStride padding:(nonnull Size2i *)padding;Swift
func detect(img: Mat, foundLocations: NSMutableArray, weights: DoubleVector, hitThreshold: Double, winStride: Size2i, padding: Size2i)Parameters
imgMatrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
foundLocationsVector of point where each point contains left-top corner point of detected object boundaries.
weightsVector that will contain confidence values for each detected object.
hitThresholdThreshold for the distance between features and SVM classifying plane. Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient). But if the free coefficient is omitted (which is allowed), you can specify it manually here.
winStrideWindow stride. It must be a multiple of block stride.
paddingPadding
-
Performs object detection without a multi-scale window.
Declaration
Objective-C
- (void)detect:(nonnull Mat *)img foundLocations:(nonnull NSMutableArray<Point2i *> *)foundLocations weights:(nonnull DoubleVector *)weights hitThreshold:(double)hitThreshold winStride:(nonnull Size2i *)winStride;Swift
func detect(img: Mat, foundLocations: NSMutableArray, weights: DoubleVector, hitThreshold: Double, winStride: Size2i)Parameters
imgMatrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
foundLocationsVector of point where each point contains left-top corner point of detected object boundaries.
weightsVector that will contain confidence values for each detected object.
hitThresholdThreshold for the distance between features and SVM classifying plane. Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient). But if the free coefficient is omitted (which is allowed), you can specify it manually here.
winStrideWindow stride. It must be a multiple of block stride.
-
Performs object detection without a multi-scale window.
Declaration
Objective-C
- (void)detect:(nonnull Mat *)img foundLocations:(nonnull NSMutableArray<Point2i *> *)foundLocations weights:(nonnull DoubleVector *)weights hitThreshold:(double)hitThreshold;Swift
func detect(img: Mat, foundLocations: NSMutableArray, weights: DoubleVector, hitThreshold: Double)Parameters
imgMatrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
foundLocationsVector of point where each point contains left-top corner point of detected object boundaries.
weightsVector that will contain confidence values for each detected object.
hitThresholdThreshold for the distance between features and SVM classifying plane. Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient). But if the free coefficient is omitted (which is allowed), you can specify it manually here.
-
Performs object detection without a multi-scale window.
Declaration
Objective-C
- (void)detect:(nonnull Mat *)img foundLocations:(nonnull NSMutableArray<Point2i *> *)foundLocations weights:(nonnull DoubleVector *)weights;Swift
func detect(img: Mat, foundLocations: NSMutableArray, weights: DoubleVector)Parameters
imgMatrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
foundLocationsVector of point where each point contains left-top corner point of detected object boundaries.
weightsVector that will contain confidence values for each detected object. Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient). But if the free coefficient is omitted (which is allowed), you can specify it manually here.
-
-detectMultiScale:foundLocations: foundWeights: hitThreshold: winStride: padding: scale: finalThreshold: useMeanshiftGrouping: Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.
Declaration
Objective-C
- (void)detectMultiScale:(nonnull Mat *)img foundLocations:(nonnull NSMutableArray<Rect2i *> *)foundLocations foundWeights:(nonnull DoubleVector *)foundWeights hitThreshold:(double)hitThreshold winStride:(nonnull Size2i *)winStride padding:(nonnull Size2i *)padding scale:(double)scale finalThreshold:(double)finalThreshold useMeanshiftGrouping:(BOOL)useMeanshiftGrouping;Swift
func detectMultiScale(img: Mat, foundLocations: NSMutableArray, foundWeights: DoubleVector, hitThreshold: Double, winStride: Size2i, padding: Size2i, scale: Double, finalThreshold: Double, useMeanshiftGrouping: Bool)Parameters
imgMatrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
foundLocationsVector of rectangles where each rectangle contains the detected object.
foundWeightsVector that will contain confidence values for each detected object.
hitThresholdThreshold for the distance between features and SVM classifying plane. Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient). But if the free coefficient is omitted (which is allowed), you can specify it manually here.
winStrideWindow stride. It must be a multiple of block stride.
paddingPadding
scaleCoefficient of the detection window increase.
finalThresholdFinal threshold
useMeanshiftGroupingindicates grouping algorithm
-
Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.
Declaration
Objective-C
- (void)detectMultiScale:(nonnull Mat *)img foundLocations:(nonnull NSMutableArray<Rect2i *> *)foundLocations foundWeights:(nonnull DoubleVector *)foundWeights hitThreshold:(double)hitThreshold winStride:(nonnull Size2i *)winStride padding:(nonnull Size2i *)padding scale:(double)scale finalThreshold:(double)finalThreshold;Swift
func detectMultiScale(img: Mat, foundLocations: NSMutableArray, foundWeights: DoubleVector, hitThreshold: Double, winStride: Size2i, padding: Size2i, scale: Double, finalThreshold: Double)Parameters
imgMatrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
foundLocationsVector of rectangles where each rectangle contains the detected object.
foundWeightsVector that will contain confidence values for each detected object.
hitThresholdThreshold for the distance between features and SVM classifying plane. Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient). But if the free coefficient is omitted (which is allowed), you can specify it manually here.
winStrideWindow stride. It must be a multiple of block stride.
paddingPadding
scaleCoefficient of the detection window increase.
finalThresholdFinal threshold
-
Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.
Declaration
Objective-C
- (void)detectMultiScale:(nonnull Mat *)img foundLocations:(nonnull NSMutableArray<Rect2i *> *)foundLocations foundWeights:(nonnull DoubleVector *)foundWeights hitThreshold:(double)hitThreshold winStride:(nonnull Size2i *)winStride padding:(nonnull Size2i *)padding scale:(double)scale;Swift
func detectMultiScale(img: Mat, foundLocations: NSMutableArray, foundWeights: DoubleVector, hitThreshold: Double, winStride: Size2i, padding: Size2i, scale: Double)Parameters
imgMatrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
foundLocationsVector of rectangles where each rectangle contains the detected object.
foundWeightsVector that will contain confidence values for each detected object.
hitThresholdThreshold for the distance between features and SVM classifying plane. Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient). But if the free coefficient is omitted (which is allowed), you can specify it manually here.
winStrideWindow stride. It must be a multiple of block stride.
paddingPadding
scaleCoefficient of the detection window increase.
-
Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.
Declaration
Objective-C
- (void)detectMultiScale:(nonnull Mat *)img foundLocations:(nonnull NSMutableArray<Rect2i *> *)foundLocations foundWeights:(nonnull DoubleVector *)foundWeights hitThreshold:(double)hitThreshold winStride:(nonnull Size2i *)winStride padding:(nonnull Size2i *)padding;Swift
func detectMultiScale(img: Mat, foundLocations: NSMutableArray, foundWeights: DoubleVector, hitThreshold: Double, winStride: Size2i, padding: Size2i)Parameters
imgMatrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
foundLocationsVector of rectangles where each rectangle contains the detected object.
foundWeightsVector that will contain confidence values for each detected object.
hitThresholdThreshold for the distance between features and SVM classifying plane. Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient). But if the free coefficient is omitted (which is allowed), you can specify it manually here.
winStrideWindow stride. It must be a multiple of block stride.
paddingPadding
-
Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.
Declaration
Objective-C
- (void)detectMultiScale:(nonnull Mat *)img foundLocations:(nonnull NSMutableArray<Rect2i *> *)foundLocations foundWeights:(nonnull DoubleVector *)foundWeights hitThreshold:(double)hitThreshold winStride:(nonnull Size2i *)winStride;Swift
func detectMultiScale(img: Mat, foundLocations: NSMutableArray, foundWeights: DoubleVector, hitThreshold: Double, winStride: Size2i)Parameters
imgMatrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
foundLocationsVector of rectangles where each rectangle contains the detected object.
foundWeightsVector that will contain confidence values for each detected object.
hitThresholdThreshold for the distance between features and SVM classifying plane. Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient). But if the free coefficient is omitted (which is allowed), you can specify it manually here.
winStrideWindow stride. It must be a multiple of block stride.
-
Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.
Declaration
Objective-C
- (void)detectMultiScale:(nonnull Mat *)img foundLocations:(nonnull NSMutableArray<Rect2i *> *)foundLocations foundWeights:(nonnull DoubleVector *)foundWeights hitThreshold:(double)hitThreshold;Swift
func detectMultiScale(img: Mat, foundLocations: NSMutableArray, foundWeights: DoubleVector, hitThreshold: Double)Parameters
imgMatrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
foundLocationsVector of rectangles where each rectangle contains the detected object.
foundWeightsVector that will contain confidence values for each detected object.
hitThresholdThreshold for the distance between features and SVM classifying plane. Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient). But if the free coefficient is omitted (which is allowed), you can specify it manually here.
-
Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.
Declaration
Objective-C
- (void)detectMultiScale:(nonnull Mat *)img foundLocations:(nonnull NSMutableArray<Rect2i *> *)foundLocations foundWeights:(nonnull DoubleVector *)foundWeights;Swift
func detectMultiScale(img: Mat, foundLocations: NSMutableArray, foundWeights: DoubleVector)Parameters
imgMatrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
foundLocationsVector of rectangles where each rectangle contains the detected object.
foundWeightsVector that will contain confidence values for each detected object. Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient). But if the free coefficient is omitted (which is allowed), you can specify it manually here.
-
saves HOGDescriptor parameters and coefficients for the linear SVM classifier to a file
Declaration
Objective-C
- (void)save:(nonnull NSString *)filename objname:(nonnull NSString *)objname;Swift
func save(filename: String, objname: String)Parameters
filenameFile name
objnameObject name
-
saves HOGDescriptor parameters and coefficients for the linear SVM classifier to a file
Declaration
Objective-C
- (void)save:(nonnull NSString *)filename;Swift
func save(filename: String)Parameters
filenameFile name
-
Declaration
Objective-C
@property (readonly) int nbinsSwift
var nbins: Int32 { get } -
Declaration
Objective-C
@property (readonly) int derivApertureSwift
var derivAperture: Int32 { get } -
Declaration
Objective-C
@property (readonly) double winSigmaSwift
var winSigma: Double { get } -
Declaration
Objective-C
@property (readonly) HistogramNormType histogramNormTypeSwift
var histogramNormType: HistogramNormType { get } -
Declaration
Objective-C
@property (readonly) double L2HysThresholdSwift
var l2HysThreshold: Double { get } -
Declaration
Objective-C
@property (readonly) BOOL gammaCorrectionSwift
var gammaCorrection: Bool { get } -
Declaration
Objective-C
@property (readonly) FloatVector* svmDetectorSwift
var svmDetector: FloatVector { get } -
Declaration
Objective-C
@property (readonly) int nlevelsSwift
var nlevels: Int32 { get } -
Declaration
Objective-C
@property (readonly) BOOL signedGradientSwift
var signedGradient: Bool { get }
View on GitHub
HOGDescriptor Class Reference