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_NLEVELS
Swift
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
_winSize
sets winSize with given value.
_blockSize
sets blockSize with given value.
_blockStride
sets blockStride with given value.
_cellSize
sets cellSize with given value.
_nbins
sets nbins with given value.
_derivAperture
sets derivAperture with given value.
_winSigma
sets winSigma with given value.
_histogramNormType
sets histogramNormType with given value.
_L2HysThreshold
sets L2HysThreshold with given value.
_gammaCorrection
sets gammaCorrection with given value.
_nlevels
sets nlevels with given value.
_signedGradient
sets 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
_winSize
sets winSize with given value.
_blockSize
sets blockSize with given value.
_blockStride
sets blockStride with given value.
_cellSize
sets cellSize with given value.
_nbins
sets nbins with given value.
_derivAperture
sets derivAperture with given value.
_winSigma
sets winSigma with given value.
_histogramNormType
sets histogramNormType with given value.
_L2HysThreshold
sets L2HysThreshold with given value.
_gammaCorrection
sets gammaCorrection with given value.
_nlevels
sets 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
_winSize
sets winSize with given value.
_blockSize
sets blockSize with given value.
_blockStride
sets blockStride with given value.
_cellSize
sets cellSize with given value.
_nbins
sets nbins with given value.
_derivAperture
sets derivAperture with given value.
_winSigma
sets winSigma with given value.
_histogramNormType
sets histogramNormType with given value.
_L2HysThreshold
sets L2HysThreshold with given value.
_gammaCorrection
sets 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
_winSize
sets winSize with given value.
_blockSize
sets blockSize with given value.
_blockStride
sets blockStride with given value.
_cellSize
sets cellSize with given value.
_nbins
sets nbins with given value.
_derivAperture
sets derivAperture with given value.
_winSigma
sets winSigma with given value.
_histogramNormType
sets histogramNormType with given value.
_L2HysThreshold
sets 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
_winSize
sets winSize with given value.
_blockSize
sets blockSize with given value.
_blockStride
sets blockStride with given value.
_cellSize
sets cellSize with given value.
_nbins
sets nbins with given value.
_derivAperture
sets derivAperture with given value.
_winSigma
sets winSigma with given value.
_histogramNormType
sets histogramNormType with given value.
-
Declaration
Parameters
_winSize
sets winSize with given value.
_blockSize
sets blockSize with given value.
_blockStride
sets blockStride with given value.
_cellSize
sets cellSize with given value.
_nbins
sets nbins with given value.
_derivAperture
sets derivAperture with given value.
_winSigma
sets winSigma with given value.
-
Declaration
Parameters
_winSize
sets winSize with given value.
_blockSize
sets blockSize with given value.
_blockStride
sets blockStride with given value.
_cellSize
sets cellSize with given value.
_nbins
sets nbins with given value.
_derivAperture
sets derivAperture with given value.
-
Declaration
Parameters
_winSize
sets winSize with given value.
_blockSize
sets blockSize with given value.
_blockStride
sets blockStride with given value.
_cellSize
sets cellSize with given value.
_nbins
sets nbins with given value.
-
Declaration
Objective-C
- (nonnull instancetype)initWithFilename:(nonnull NSString *)filename;
Swift
init(filename: String)
Parameters
filename
The 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) -> Bool
Parameters
filename
Path of the file to read.
objname
The 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) -> Bool
Parameters
filename
Path 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
img
Matrix of the type CV_8U containing an image where HOG features will be calculated.
descriptors
Matrix of the type CV_32F
winStride
Window stride. It must be a multiple of block stride.
padding
Padding
locations
Vector 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
img
Matrix of the type CV_8U containing an image where HOG features will be calculated.
descriptors
Matrix of the type CV_32F
winStride
Window stride. It must be a multiple of block stride.
padding
Padding
-
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
img
Matrix of the type CV_8U containing an image where HOG features will be calculated.
descriptors
Matrix of the type CV_32F
winStride
Window 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
img
Matrix of the type CV_8U containing an image where HOG features will be calculated.
descriptors
Matrix of the type CV_32F
-
Computes gradients and quantized gradient orientations.
Declaration
Parameters
img
Matrix contains the image to be computed
grad
Matrix of type CV_32FC2 contains computed gradients
angleOfs
Matrix of type CV_8UC2 contains quantized gradient orientations
paddingTL
Padding from top-left
paddingBR
Padding from bottom-right
-
Computes gradients and quantized gradient orientations.
Declaration
Parameters
img
Matrix contains the image to be computed
grad
Matrix of type CV_32FC2 contains computed gradients
angleOfs
Matrix of type CV_8UC2 contains quantized gradient orientations
paddingTL
Padding from top-left
-
Computes gradients and quantized gradient orientations.
Declaration
Parameters
img
Matrix contains the image to be computed
grad
Matrix of type CV_32FC2 contains computed gradients
angleOfs
Matrix 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
img
Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
foundLocations
Vector of point where each point contains left-top corner point of detected object boundaries.
weights
Vector that will contain confidence values for each detected object.
hitThreshold
Threshold 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.
winStride
Window stride. It must be a multiple of block stride.
padding
Padding
searchLocations
Vector 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
img
Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
foundLocations
Vector of point where each point contains left-top corner point of detected object boundaries.
weights
Vector that will contain confidence values for each detected object.
hitThreshold
Threshold 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.
winStride
Window stride. It must be a multiple of block stride.
padding
Padding
-
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
img
Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
foundLocations
Vector of point where each point contains left-top corner point of detected object boundaries.
weights
Vector that will contain confidence values for each detected object.
hitThreshold
Threshold 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.
winStride
Window 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
img
Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
foundLocations
Vector of point where each point contains left-top corner point of detected object boundaries.
weights
Vector that will contain confidence values for each detected object.
hitThreshold
Threshold 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
img
Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
foundLocations
Vector of point where each point contains left-top corner point of detected object boundaries.
weights
Vector 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
img
Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
foundLocations
Vector of rectangles where each rectangle contains the detected object.
foundWeights
Vector that will contain confidence values for each detected object.
hitThreshold
Threshold 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.
winStride
Window stride. It must be a multiple of block stride.
padding
Padding
scale
Coefficient of the detection window increase.
finalThreshold
Final threshold
useMeanshiftGrouping
indicates 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
img
Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
foundLocations
Vector of rectangles where each rectangle contains the detected object.
foundWeights
Vector that will contain confidence values for each detected object.
hitThreshold
Threshold 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.
winStride
Window stride. It must be a multiple of block stride.
padding
Padding
scale
Coefficient of the detection window increase.
finalThreshold
Final 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
img
Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
foundLocations
Vector of rectangles where each rectangle contains the detected object.
foundWeights
Vector that will contain confidence values for each detected object.
hitThreshold
Threshold 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.
winStride
Window stride. It must be a multiple of block stride.
padding
Padding
scale
Coefficient 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
img
Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
foundLocations
Vector of rectangles where each rectangle contains the detected object.
foundWeights
Vector that will contain confidence values for each detected object.
hitThreshold
Threshold 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.
winStride
Window stride. It must be a multiple of block stride.
padding
Padding
-
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
img
Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
foundLocations
Vector of rectangles where each rectangle contains the detected object.
foundWeights
Vector that will contain confidence values for each detected object.
hitThreshold
Threshold 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.
winStride
Window 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
img
Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
foundLocations
Vector of rectangles where each rectangle contains the detected object.
foundWeights
Vector that will contain confidence values for each detected object.
hitThreshold
Threshold 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
img
Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
foundLocations
Vector of rectangles where each rectangle contains the detected object.
foundWeights
Vector 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
filename
File name
objname
Object 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
filename
File name
-
Declaration
Objective-C
@property (readonly) int nbins
Swift
var nbins: Int32 { get }
-
Declaration
Objective-C
@property (readonly) int derivAperture
Swift
var derivAperture: Int32 { get }
-
Declaration
Objective-C
@property (readonly) double winSigma
Swift
var winSigma: Double { get }
-
Declaration
Objective-C
@property (readonly) HistogramNormType histogramNormType
Swift
var histogramNormType: HistogramNormType { get }
-
Declaration
Objective-C
@property (readonly) double L2HysThreshold
Swift
var l2HysThreshold: Double { get }
-
Declaration
Objective-C
@property (readonly) BOOL gammaCorrection
Swift
var gammaCorrection: Bool { get }
-
Declaration
Objective-C
@property (readonly) FloatVector* svmDetector
Swift
var svmDetector: FloatVector { get }
-
Declaration
Objective-C
@property (readonly) int nlevels
Swift
var nlevels: Int32 { get }
-
Declaration
Objective-C
@property (readonly) BOOL signedGradient
Swift
var signedGradient: Bool { get }