pub trait HOGDescriptorTraitConst {
Show 31 methods // Required method fn as_raw_HOGDescriptor(&self) -> *const c_void; // Provided methods 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: &impl ToInputArray, descriptors: &mut Vector<f32>, win_stride: Size, padding: Size, locations: &Vector<Point> ) -> Result<()> { ... } fn detect_weights( &self, img: &impl 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: &impl 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: &impl ToInputArray, found_locations: &mut Vector<Rect>, found_weights: &mut Vector<f64>, hit_threshold: f64, win_stride: Size, padding: Size, scale: f64, group_threshold: f64, use_meanshift_grouping: bool ) -> Result<()> { ... } fn detect_multi_scale( &self, img: &impl ToInputArray, found_locations: &mut Vector<Rect>, hit_threshold: f64, win_stride: Size, padding: Size, scale: f64, group_threshold: f64, use_meanshift_grouping: bool ) -> Result<()> { ... } fn compute_gradient( &self, img: &impl ToInputArray, grad: &mut impl ToInputOutputArray, angle_ofs: &mut impl ToInputOutputArray, padding_tl: Size, padding_br: Size ) -> Result<()> { ... } fn detect_roi( &self, img: &impl 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: &impl 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

Constant methods for crate::objdetect::HOGDescriptor

Required Methods§

Provided Methods§

source

fn win_size(&self) -> Size

Detection window size. Align to block size and block stride. Default value is Size(64,128).

source

fn block_size(&self) -> Size

Block size in pixels. Align to cell size. Default value is Size(16,16).

source

fn block_stride(&self) -> Size

Block stride. It must be a multiple of cell size. Default value is Size(8,8).

source

fn cell_size(&self) -> Size

Cell size. Default value is Size(8,8).

source

fn nbins(&self) -> i32

Number of bins used in the calculation of histogram of gradients. Default value is 9.

source

fn deriv_aperture(&self) -> i32

not documented

source

fn win_sigma(&self) -> f64

Gaussian smoothing window parameter.

source

fn histogram_norm_type(&self) -> HOGDescriptor_HistogramNormType

histogramNormType

source

fn l2_hys_threshold(&self) -> f64

L2-Hys normalization method shrinkage.

source

fn gamma_correction(&self) -> bool

Flag to specify whether the gamma correction preprocessing is required or not.

source

fn svm_detector(&self) -> Vector<f32>

coefficients for the linear SVM classifier.

source

fn ocl_svm_detector(&self) -> UMat

coefficients for the linear SVM classifier used when OpenCL is enabled

source

fn free_coef(&self) -> f32

not documented

source

fn nlevels(&self) -> i32

Maximum number of detection window increases. Default value is 64

source

fn signed_gradient(&self) -> bool

Indicates signed gradient will be used or not

source

fn get_descriptor_size(&self) -> Result<size_t>

Returns the number of coefficients required for the classification.

source

fn check_detector_size(&self) -> Result<bool>

Checks if detector size equal to descriptor size.

source

fn get_win_sigma(&self) -> Result<f64>

Returns winSigma value

source

fn write(&self, fs: &mut FileStorage, objname: &str) -> Result<()>

Stores HOGDescriptor parameters and coefficients for the linear SVM classifier in a file storage.

Parameters
  • fs: File storage
  • objname: Object name
source

fn save(&self, filename: &str, objname: &str) -> Result<()>

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()
source

fn copy_to(&self, c: &mut HOGDescriptor) -> Result<()>

clones the HOGDescriptor

Parameters
  • c: cloned HOGDescriptor
source

fn compute( &self, img: &impl ToInputArray, descriptors: &mut Vector<f32>, win_stride: Size, padding: Size, locations: &Vector<Point> ) -> 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()
source

fn detect_weights( &self, img: &impl ToInputArray, found_locations: &mut Vector<Point>, weights: &mut Vector<f64>, hit_threshold: f64, win_stride: Size, padding: Size, search_locations: &Vector<Point> ) -> Result<()>

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()
source

fn detect( &self, img: &impl ToInputArray, found_locations: &mut Vector<Point>, hit_threshold: f64, win_stride: Size, padding: Size, search_locations: &Vector<Point> ) -> Result<()>

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()
source

fn detect_multi_scale_weights( &self, img: &impl ToInputArray, found_locations: &mut Vector<Rect>, found_weights: &mut Vector<f64>, hit_threshold: f64, win_stride: Size, padding: Size, scale: f64, group_threshold: f64, use_meanshift_grouping: bool ) -> Result<()>

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.
  • groupThreshold: Coefficient to regulate the similarity threshold. When detected, some objects can be covered by many rectangles. 0 means not to perform grouping.
  • useMeanshiftGrouping: indicates grouping algorithm
C++ default parameters
  • hit_threshold: 0
  • win_stride: Size()
  • padding: Size()
  • scale: 1.05
  • group_threshold: 2.0
  • use_meanshift_grouping: false
source

fn detect_multi_scale( &self, img: &impl ToInputArray, found_locations: &mut Vector<Rect>, hit_threshold: f64, win_stride: Size, padding: Size, scale: f64, group_threshold: f64, use_meanshift_grouping: bool ) -> Result<()>

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.
  • groupThreshold: Coefficient to regulate the similarity threshold. When detected, some objects can be covered by many rectangles. 0 means not to perform grouping.
  • useMeanshiftGrouping: indicates grouping algorithm
C++ default parameters
  • hit_threshold: 0
  • win_stride: Size()
  • padding: Size()
  • scale: 1.05
  • group_threshold: 2.0
  • use_meanshift_grouping: false
source

fn compute_gradient( &self, img: &impl ToInputArray, grad: &mut impl ToInputOutputArray, angle_ofs: &mut impl 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()
source

fn detect_roi( &self, img: &impl ToInputArray, locations: &Vector<Point>, found_locations: &mut Vector<Point>, confidences: &mut Vector<f64>, hit_threshold: f64, win_stride: Size, padding: Size ) -> Result<()>

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()
source

fn detect_multi_scale_roi( &self, img: &impl 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
source

fn group_rectangles( &self, rect_list: &mut Vector<Rect>, weights: &mut Vector<f64>, group_threshold: i32, eps: f64 ) -> Result<()>

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.

Implementors§