public class HOGDescriptor extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_NLEVELS |
static int |
DESCR_FORMAT_COL_BY_COL |
static int |
DESCR_FORMAT_ROW_BY_ROW |
static int |
L2Hys |
protected long |
nativeObj |
Modifier | Constructor and Description |
---|---|
|
HOGDescriptor()
Creates the HOG descriptor and detector with default params.
|
protected |
HOGDescriptor(long addr) |
|
HOGDescriptor(Size _winSize,
Size _blockSize,
Size _blockStride,
Size _cellSize,
int _nbins) |
|
HOGDescriptor(Size _winSize,
Size _blockSize,
Size _blockStride,
Size _cellSize,
int _nbins,
int _derivAperture) |
|
HOGDescriptor(Size _winSize,
Size _blockSize,
Size _blockStride,
Size _cellSize,
int _nbins,
int _derivAperture,
double _winSigma) |
|
HOGDescriptor(Size _winSize,
Size _blockSize,
Size _blockStride,
Size _cellSize,
int _nbins,
int _derivAperture,
double _winSigma,
int _histogramNormType) |
|
HOGDescriptor(Size _winSize,
Size _blockSize,
Size _blockStride,
Size _cellSize,
int _nbins,
int _derivAperture,
double _winSigma,
int _histogramNormType,
double _L2HysThreshold) |
|
HOGDescriptor(Size _winSize,
Size _blockSize,
Size _blockStride,
Size _cellSize,
int _nbins,
int _derivAperture,
double _winSigma,
int _histogramNormType,
double _L2HysThreshold,
boolean _gammaCorrection) |
|
HOGDescriptor(Size _winSize,
Size _blockSize,
Size _blockStride,
Size _cellSize,
int _nbins,
int _derivAperture,
double _winSigma,
int _histogramNormType,
double _L2HysThreshold,
boolean _gammaCorrection,
int _nlevels) |
|
HOGDescriptor(Size _winSize,
Size _blockSize,
Size _blockStride,
Size _cellSize,
int _nbins,
int _derivAperture,
double _winSigma,
int _histogramNormType,
double _L2HysThreshold,
boolean _gammaCorrection,
int _nlevels,
boolean _signedGradient) |
|
HOGDescriptor(String filename) |
Modifier and Type | Method and Description |
---|---|
static HOGDescriptor |
__fromPtr__(long addr) |
boolean |
checkDetectorSize()
Checks if detector size equal to descriptor size.
|
void |
compute(Mat img,
MatOfFloat descriptors)
Computes HOG descriptors of given image.
|
void |
compute(Mat img,
MatOfFloat descriptors,
Size winStride)
Computes HOG descriptors of given image.
|
void |
compute(Mat img,
MatOfFloat descriptors,
Size winStride,
Size padding)
Computes HOG descriptors of given image.
|
void |
compute(Mat img,
MatOfFloat descriptors,
Size winStride,
Size padding,
MatOfPoint locations)
Computes HOG descriptors of given image.
|
void |
computeGradient(Mat img,
Mat grad,
Mat angleOfs)
Computes gradients and quantized gradient orientations.
|
void |
computeGradient(Mat img,
Mat grad,
Mat angleOfs,
Size paddingTL)
Computes gradients and quantized gradient orientations.
|
void |
computeGradient(Mat img,
Mat grad,
Mat angleOfs,
Size paddingTL,
Size paddingBR)
Computes gradients and quantized gradient orientations.
|
void |
detect(Mat img,
MatOfPoint foundLocations,
MatOfDouble weights)
Performs object detection without a multi-scale window.
|
void |
detect(Mat img,
MatOfPoint foundLocations,
MatOfDouble weights,
double hitThreshold)
Performs object detection without a multi-scale window.
|
void |
detect(Mat img,
MatOfPoint foundLocations,
MatOfDouble weights,
double hitThreshold,
Size winStride)
Performs object detection without a multi-scale window.
|
void |
detect(Mat img,
MatOfPoint foundLocations,
MatOfDouble weights,
double hitThreshold,
Size winStride,
Size padding)
Performs object detection without a multi-scale window.
|
void |
detect(Mat img,
MatOfPoint foundLocations,
MatOfDouble weights,
double hitThreshold,
Size winStride,
Size padding,
MatOfPoint searchLocations)
Performs object detection without a multi-scale window.
|
void |
detectMultiScale(Mat img,
MatOfRect foundLocations,
MatOfDouble foundWeights)
Detects objects of different sizes in the input image.
|
void |
detectMultiScale(Mat img,
MatOfRect foundLocations,
MatOfDouble foundWeights,
double hitThreshold)
Detects objects of different sizes in the input image.
|
void |
detectMultiScale(Mat img,
MatOfRect foundLocations,
MatOfDouble foundWeights,
double hitThreshold,
Size winStride)
Detects objects of different sizes in the input image.
|
void |
detectMultiScale(Mat img,
MatOfRect foundLocations,
MatOfDouble foundWeights,
double hitThreshold,
Size winStride,
Size padding)
Detects objects of different sizes in the input image.
|
void |
detectMultiScale(Mat img,
MatOfRect foundLocations,
MatOfDouble foundWeights,
double hitThreshold,
Size winStride,
Size padding,
double scale)
Detects objects of different sizes in the input image.
|
void |
detectMultiScale(Mat img,
MatOfRect foundLocations,
MatOfDouble foundWeights,
double hitThreshold,
Size winStride,
Size padding,
double scale,
double finalThreshold)
Detects objects of different sizes in the input image.
|
void |
detectMultiScale(Mat img,
MatOfRect foundLocations,
MatOfDouble foundWeights,
double hitThreshold,
Size winStride,
Size padding,
double scale,
double finalThreshold,
boolean useMeanshiftGrouping)
Detects objects of different sizes in the input image.
|
protected void |
finalize() |
Size |
get_blockSize() |
Size |
get_blockStride() |
Size |
get_cellSize() |
int |
get_derivAperture() |
boolean |
get_gammaCorrection() |
int |
get_histogramNormType() |
double |
get_L2HysThreshold() |
int |
get_nbins() |
int |
get_nlevels() |
boolean |
get_signedGradient() |
MatOfFloat |
get_svmDetector() |
double |
get_winSigma() |
Size |
get_winSize() |
static MatOfFloat |
getDaimlerPeopleDetector()
Returns coefficients of the classifier trained for people detection (for 48x96 windows).
|
static MatOfFloat |
getDefaultPeopleDetector()
Returns coefficients of the classifier trained for people detection (for 64x128 windows).
|
long |
getDescriptorSize()
Returns the number of coefficients required for the classification.
|
long |
getNativeObjAddr() |
double |
getWinSigma()
Returns winSigma value
|
boolean |
load(String filename)
loads HOGDescriptor parameters and coefficients for the linear SVM classifier from a file.
|
boolean |
load(String filename,
String objname)
loads HOGDescriptor parameters and coefficients for the linear SVM classifier from a file.
|
void |
save(String filename)
saves HOGDescriptor parameters and coefficients for the linear SVM classifier to a file
|
void |
save(String filename,
String objname)
saves HOGDescriptor parameters and coefficients for the linear SVM classifier to a file
|
void |
setSVMDetector(Mat svmdetector)
Sets coefficients for the linear SVM classifier.
|
protected final long nativeObj
public static final int DESCR_FORMAT_COL_BY_COL
public static final int DESCR_FORMAT_ROW_BY_ROW
public static final int L2Hys
public static final int DEFAULT_NLEVELS
protected HOGDescriptor(long addr)
public HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride, Size _cellSize, int _nbins, int _derivAperture, double _winSigma, int _histogramNormType, double _L2HysThreshold, boolean _gammaCorrection, int _nlevels, boolean _signedGradient)
_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.public HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride, Size _cellSize, int _nbins, int _derivAperture, double _winSigma, int _histogramNormType, double _L2HysThreshold, boolean _gammaCorrection, int _nlevels)
_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.public HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride, Size _cellSize, int _nbins, int _derivAperture, double _winSigma, int _histogramNormType, double _L2HysThreshold, boolean _gammaCorrection)
_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.public HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride, Size _cellSize, int _nbins, int _derivAperture, double _winSigma, int _histogramNormType, double _L2HysThreshold)
_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.public HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride, Size _cellSize, int _nbins, int _derivAperture, double _winSigma, int _histogramNormType)
_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.public HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride, Size _cellSize, int _nbins, int _derivAperture, double _winSigma)
_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.public HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride, Size _cellSize, int _nbins, int _derivAperture)
_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.public HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride, Size _cellSize, int _nbins)
_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.public HOGDescriptor(String filename)
filename
- The file name containing HOGDescriptor properties and coefficients for the linear SVM classifier.public HOGDescriptor()
public long getNativeObjAddr()
public static HOGDescriptor __fromPtr__(long addr)
public boolean checkDetectorSize()
public boolean load(String filename, String objname)
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).public boolean load(String filename)
filename
- Path of the file to read.public double getWinSigma()
public long getDescriptorSize()
public static MatOfFloat getDaimlerPeopleDetector()
public static MatOfFloat getDefaultPeopleDetector()
public void compute(Mat img, MatOfFloat descriptors, Size winStride, Size padding, MatOfPoint locations)
img
- Matrix of the type CV_8U containing an image where HOG features will be calculated.descriptors
- Matrix of the type CV_32FwinStride
- Window stride. It must be a multiple of block stride.padding
- Paddinglocations
- Vector of Pointpublic void compute(Mat img, MatOfFloat descriptors, Size winStride, Size padding)
img
- Matrix of the type CV_8U containing an image where HOG features will be calculated.descriptors
- Matrix of the type CV_32FwinStride
- Window stride. It must be a multiple of block stride.padding
- Paddingpublic void compute(Mat img, MatOfFloat descriptors, Size winStride)
img
- Matrix of the type CV_8U containing an image where HOG features will be calculated.descriptors
- Matrix of the type CV_32FwinStride
- Window stride. It must be a multiple of block stride.public void compute(Mat img, MatOfFloat descriptors)
img
- Matrix of the type CV_8U containing an image where HOG features will be calculated.descriptors
- Matrix of the type CV_32Fpublic void computeGradient(Mat img, Mat grad, Mat angleOfs, Size paddingTL, Size paddingBR)
img
- Matrix contains the image to be computedgrad
- Matrix of type CV_32FC2 contains computed gradientsangleOfs
- Matrix of type CV_8UC2 contains quantized gradient orientationspaddingTL
- Padding from top-leftpaddingBR
- Padding from bottom-rightpublic void computeGradient(Mat img, Mat grad, Mat angleOfs, Size paddingTL)
img
- Matrix contains the image to be computedgrad
- Matrix of type CV_32FC2 contains computed gradientsangleOfs
- Matrix of type CV_8UC2 contains quantized gradient orientationspaddingTL
- Padding from top-leftpublic void computeGradient(Mat img, Mat grad, Mat angleOfs)
img
- Matrix contains the image to be computedgrad
- Matrix of type CV_32FC2 contains computed gradientsangleOfs
- Matrix of type CV_8UC2 contains quantized gradient orientationspublic void detect(Mat img, MatOfPoint foundLocations, MatOfDouble weights, double hitThreshold, Size winStride, Size padding, MatOfPoint searchLocations)
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
- PaddingsearchLocations
- Vector of Point includes set of requested locations to be evaluated.public void detect(Mat img, MatOfPoint foundLocations, MatOfDouble weights, double hitThreshold, Size winStride, Size padding)
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
- Paddingpublic void detect(Mat img, MatOfPoint foundLocations, MatOfDouble weights, double hitThreshold, Size winStride)
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.public void detect(Mat img, MatOfPoint foundLocations, MatOfDouble weights, double hitThreshold)
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.public void detect(Mat img, MatOfPoint foundLocations, MatOfDouble weights)
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.public void detectMultiScale(Mat img, MatOfRect foundLocations, MatOfDouble foundWeights, double hitThreshold, Size winStride, Size padding, double scale, double finalThreshold, boolean useMeanshiftGrouping)
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
- Paddingscale
- Coefficient of the detection window increase.finalThreshold
- Final thresholduseMeanshiftGrouping
- indicates grouping algorithmpublic void detectMultiScale(Mat img, MatOfRect foundLocations, MatOfDouble foundWeights, double hitThreshold, Size winStride, Size padding, double scale, double finalThreshold)
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
- Paddingscale
- Coefficient of the detection window increase.finalThreshold
- Final thresholdpublic void detectMultiScale(Mat img, MatOfRect foundLocations, MatOfDouble foundWeights, double hitThreshold, Size winStride, Size padding, double scale)
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
- Paddingscale
- Coefficient of the detection window increase.public void detectMultiScale(Mat img, MatOfRect foundLocations, MatOfDouble foundWeights, double hitThreshold, Size winStride, Size padding)
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
- Paddingpublic void detectMultiScale(Mat img, MatOfRect foundLocations, MatOfDouble foundWeights, double hitThreshold, Size winStride)
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.public void detectMultiScale(Mat img, MatOfRect foundLocations, MatOfDouble foundWeights, double hitThreshold)
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.public void detectMultiScale(Mat img, MatOfRect foundLocations, MatOfDouble foundWeights)
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.public void save(String filename, String objname)
filename
- File nameobjname
- Object namepublic void save(String filename)
filename
- File namepublic void setSVMDetector(Mat svmdetector)
svmdetector
- coefficients for the linear SVM classifier.public Size get_winSize()
public Size get_blockSize()
public Size get_blockStride()
public Size get_cellSize()
public int get_nbins()
public int get_derivAperture()
public double get_winSigma()
public int get_histogramNormType()
public double get_L2HysThreshold()
public boolean get_gammaCorrection()
public MatOfFloat get_svmDetector()
public int get_nlevels()
public boolean get_signedGradient()
Copyright © 2020. All rights reserved.