Trait opencv::objdetect::prelude::HOGDescriptorTraitConst [−][src]
pub trait HOGDescriptorTraitConst {
Show 31 methods
fn as_raw_HOGDescriptor(&self) -> *const c_void;
fn win_size(&self) -> Size { ... }
fn block_size(&self) -> Size { ... }
fn block_stride(&self) -> Size { ... }
fn cell_size(&self) -> Size { ... }
fn nbins(&self) -> i32 { ... }
fn deriv_aperture(&self) -> i32 { ... }
fn win_sigma(&self) -> f64 { ... }
fn histogram_norm_type(&self) -> HOGDescriptor_HistogramNormType { ... }
fn l2_hys_threshold(&self) -> f64 { ... }
fn gamma_correction(&self) -> bool { ... }
fn svm_detector(&self) -> Vector<f32> { ... }
fn ocl_svm_detector(&self) -> UMat { ... }
fn free_coef(&self) -> f32 { ... }
fn nlevels(&self) -> i32 { ... }
fn signed_gradient(&self) -> bool { ... }
fn get_descriptor_size(&self) -> Result<size_t> { ... }
fn check_detector_size(&self) -> Result<bool> { ... }
fn get_win_sigma(&self) -> Result<f64> { ... }
fn write(&self, fs: &mut FileStorage, objname: &str) -> Result<()> { ... }
fn save(&self, filename: &str, objname: &str) -> Result<()> { ... }
fn copy_to(&self, c: &mut HOGDescriptor) -> Result<()> { ... }
fn compute(
&self,
img: &dyn ToInputArray,
descriptors: &mut Vector<f32>,
win_stride: Size,
padding: Size,
locations: &Vector<Point>
) -> Result<()> { ... }
fn detect_weights(
&self,
img: &dyn ToInputArray,
found_locations: &mut Vector<Point>,
weights: &mut Vector<f64>,
hit_threshold: f64,
win_stride: Size,
padding: Size,
search_locations: &Vector<Point>
) -> Result<()> { ... }
fn detect(
&self,
img: &dyn ToInputArray,
found_locations: &mut Vector<Point>,
hit_threshold: f64,
win_stride: Size,
padding: Size,
search_locations: &Vector<Point>
) -> Result<()> { ... }
fn detect_multi_scale_weights(
&self,
img: &dyn ToInputArray,
found_locations: &mut Vector<Rect>,
found_weights: &mut Vector<f64>,
hit_threshold: f64,
win_stride: Size,
padding: Size,
scale: f64,
final_threshold: f64,
use_meanshift_grouping: bool
) -> Result<()> { ... }
fn detect_multi_scale(
&self,
img: &dyn ToInputArray,
found_locations: &mut Vector<Rect>,
hit_threshold: f64,
win_stride: Size,
padding: Size,
scale: f64,
final_threshold: f64,
use_meanshift_grouping: bool
) -> Result<()> { ... }
fn compute_gradient(
&self,
img: &dyn ToInputArray,
grad: &mut dyn ToInputOutputArray,
angle_ofs: &mut dyn ToInputOutputArray,
padding_tl: Size,
padding_br: Size
) -> Result<()> { ... }
fn detect_roi(
&self,
img: &dyn ToInputArray,
locations: &Vector<Point>,
found_locations: &mut Vector<Point>,
confidences: &mut Vector<f64>,
hit_threshold: f64,
win_stride: Size,
padding: Size
) -> Result<()> { ... }
fn detect_multi_scale_roi(
&self,
img: &dyn ToInputArray,
found_locations: &mut Vector<Rect>,
locations: &mut Vector<DetectionROI>,
hit_threshold: f64,
group_threshold: i32
) -> Result<()> { ... }
fn group_rectangles(
&self,
rect_list: &mut Vector<Rect>,
weights: &mut Vector<f64>,
group_threshold: i32,
eps: f64
) -> Result<()> { ... }
}
Expand description
Implementation of HOG (Histogram of Oriented Gradients) descriptor and object detector.
the HOG descriptor algorithm introduced by Navneet Dalal and Bill Triggs 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
Required methods
fn as_raw_HOGDescriptor(&self) -> *const c_void
Provided methods
Detection window size. Align to block size and block stride. Default value is Size(64,128).
fn block_size(&self) -> Size
fn block_size(&self) -> Size
Block size in pixels. Align to cell size. Default value is Size(16,16).
fn block_stride(&self) -> Size
fn block_stride(&self) -> Size
Block stride. It must be a multiple of cell size. Default value is Size(8,8).
Number of bins used in the calculation of histogram of gradients. Default value is 9.
fn deriv_aperture(&self) -> i32
fn deriv_aperture(&self) -> i32
not documented
fn histogram_norm_type(&self) -> HOGDescriptor_HistogramNormType
fn histogram_norm_type(&self) -> HOGDescriptor_HistogramNormType
histogramNormType
fn l2_hys_threshold(&self) -> f64
fn l2_hys_threshold(&self) -> f64
L2-Hys normalization method shrinkage.
fn gamma_correction(&self) -> bool
fn gamma_correction(&self) -> bool
Flag to specify whether the gamma correction preprocessing is required or not.
fn svm_detector(&self) -> Vector<f32>
fn svm_detector(&self) -> Vector<f32>
coefficients for the linear SVM classifier.
fn ocl_svm_detector(&self) -> UMat
fn ocl_svm_detector(&self) -> UMat
coefficients for the linear SVM classifier used when OpenCL is enabled
fn signed_gradient(&self) -> bool
fn signed_gradient(&self) -> bool
Indicates signed gradient will be used or not
fn get_descriptor_size(&self) -> Result<size_t>
fn get_descriptor_size(&self) -> Result<size_t>
Returns the number of coefficients required for the classification.
fn check_detector_size(&self) -> Result<bool>
fn check_detector_size(&self) -> Result<bool>
Checks if detector size equal to descriptor size.
fn get_win_sigma(&self) -> Result<f64>
fn get_win_sigma(&self) -> Result<f64>
Returns winSigma value
Stores HOGDescriptor parameters in a cv::FileStorage.
Parameters
- fs: File storage
- objname: Object name
saves HOGDescriptor parameters and coefficients for the linear SVM classifier to a file
Parameters
- filename: File name
- objname: Object name
C++ default parameters
- objname: String()
fn copy_to(&self, c: &mut HOGDescriptor) -> Result<()>
fn copy_to(&self, c: &mut HOGDescriptor) -> Result<()>
@example samples/cpp/train_HOG.cpp / Computes HOG descriptors of given image.
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
C++ default parameters
- win_stride: Size()
- padding: Size()
- locations: std::vector
()
Performs object detection without a multi-scale window.
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.
C++ default parameters
- hit_threshold: 0
- win_stride: Size()
- padding: Size()
- search_locations: std::vector
()
Performs object detection without a multi-scale window.
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.
- 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 locations to search.
C++ default parameters
- hit_threshold: 0
- win_stride: Size()
- padding: Size()
- search_locations: std::vector
()
Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.
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
C++ default parameters
- hit_threshold: 0
- win_stride: Size()
- padding: Size()
- scale: 1.05
- final_threshold: 2.0
- use_meanshift_grouping: false
Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.
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.
- 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
C++ default parameters
- hit_threshold: 0
- win_stride: Size()
- padding: Size()
- scale: 1.05
- final_threshold: 2.0
- use_meanshift_grouping: false
fn compute_gradient(
&self,
img: &dyn ToInputArray,
grad: &mut dyn ToInputOutputArray,
angle_ofs: &mut dyn ToInputOutputArray,
padding_tl: Size,
padding_br: Size
) -> Result<()>
fn compute_gradient(
&self,
img: &dyn ToInputArray,
grad: &mut dyn ToInputOutputArray,
angle_ofs: &mut dyn ToInputOutputArray,
padding_tl: Size,
padding_br: Size
) -> Result<()>
Computes gradients and quantized gradient orientations.
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
C++ default parameters
- padding_tl: Size()
- padding_br: Size()
evaluate specified ROI and return confidence value for each location
Parameters
- img: Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
- locations: Vector of Point
- foundLocations: Vector of Point where each Point is detected object’s top-left point.
- confidences: confidences
- 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: winStride
- padding: padding
C++ default parameters
- hit_threshold: 0
- win_stride: Size()
- padding: Size()
fn detect_multi_scale_roi(
&self,
img: &dyn ToInputArray,
found_locations: &mut Vector<Rect>,
locations: &mut Vector<DetectionROI>,
hit_threshold: f64,
group_threshold: i32
) -> Result<()>
fn detect_multi_scale_roi(
&self,
img: &dyn ToInputArray,
found_locations: &mut Vector<Rect>,
locations: &mut Vector<DetectionROI>,
hit_threshold: f64,
group_threshold: i32
) -> Result<()>
evaluate specified ROI and return confidence value for each location in multiple scales
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.
- locations: Vector of DetectionROI
- 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.
- groupThreshold: Minimum possible number of rectangles minus 1. The threshold is used in a group of rectangles to retain it.
C++ default parameters
- hit_threshold: 0
- group_threshold: 0
Groups the object candidate rectangles.
Parameters
- rectList: Input/output vector of rectangles. Output vector includes retained and grouped rectangles. (The Python list is not modified in place.)
- weights: Input/output vector of weights of rectangles. Output vector includes weights of retained and grouped rectangles. (The Python list is not modified in place.)
- groupThreshold: Minimum possible number of rectangles minus 1. The threshold is used in a group of rectangles to retain it.
- eps: Relative difference between sides of the rectangles to merge them into a group.