[][src]Trait opencv::objdetect::prelude::HOGDescriptorTrait

pub trait HOGDescriptorTrait {
    pub fn as_raw_HOGDescriptor(&self) -> *const c_void;
pub fn as_raw_mut_HOGDescriptor(&mut self) -> *mut c_void; pub fn win_size(&self) -> Size { ... }
pub fn set_win_size(&mut self, val: Size) { ... }
pub fn block_size(&self) -> Size { ... }
pub fn set_block_size(&mut self, val: Size) { ... }
pub fn block_stride(&self) -> Size { ... }
pub fn set_block_stride(&mut self, val: Size) { ... }
pub fn cell_size(&self) -> Size { ... }
pub fn set_cell_size(&mut self, val: Size) { ... }
pub fn nbins(&self) -> i32 { ... }
pub fn set_nbins(&mut self, val: i32) { ... }
pub fn deriv_aperture(&self) -> i32 { ... }
pub fn set_deriv_aperture(&mut self, val: i32) { ... }
pub fn win_sigma(&self) -> f64 { ... }
pub fn set_win_sigma(&mut self, val: f64) { ... }
pub fn histogram_norm_type(&self) -> HOGDescriptor_HistogramNormType { ... }
pub fn set_histogram_norm_type(
        &mut self,
        val: HOGDescriptor_HistogramNormType
    ) { ... }
pub fn l2_hys_threshold(&self) -> f64 { ... }
pub fn set_l2_hys_threshold(&mut self, val: f64) { ... }
pub fn gamma_correction(&self) -> bool { ... }
pub fn set_gamma_correction(&mut self, val: bool) { ... }
pub fn svm_detector(&mut self) -> Vector<f32> { ... }
pub fn set_svm_detector_vec(&mut self, val: Vector<f32>) { ... }
pub fn ocl_svm_detector(&mut self) -> UMat { ... }
pub fn set_ocl_svm_detector(&mut self, val: UMat) { ... }
pub fn free_coef(&self) -> f32 { ... }
pub fn set_free_coef(&mut self, val: f32) { ... }
pub fn nlevels(&self) -> i32 { ... }
pub fn set_nlevels(&mut self, val: i32) { ... }
pub fn signed_gradient(&self) -> bool { ... }
pub fn set_signed_gradient(&mut self, val: bool) { ... }
pub fn get_descriptor_size(&self) -> Result<size_t> { ... }
pub fn check_detector_size(&self) -> Result<bool> { ... }
pub fn get_win_sigma(&self) -> Result<f64> { ... }
pub fn set_svm_detector(
        &mut self,
        svmdetector: &dyn ToInputArray
    ) -> Result<()> { ... }
pub fn read(&mut self, fn_: &mut FileNode) -> Result<bool> { ... }
pub fn write(&self, fs: &mut FileStorage, objname: &str) -> Result<()> { ... }
pub fn load(&mut self, filename: &str, objname: &str) -> Result<bool> { ... }
pub fn save(&self, filename: &str, objname: &str) -> Result<()> { ... }
pub fn copy_to(&self, c: &mut HOGDescriptor) -> Result<()> { ... }
pub fn compute(
        &self,
        img: &dyn ToInputArray,
        descriptors: &mut Vector<f32>,
        win_stride: Size,
        padding: Size,
        locations: &Vector<Point>
    ) -> Result<()> { ... }
pub 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<()> { ... }
pub fn detect(
        &self,
        img: &dyn ToInputArray,
        found_locations: &mut Vector<Point>,
        hit_threshold: f64,
        win_stride: Size,
        padding: Size,
        search_locations: &Vector<Point>
    ) -> Result<()> { ... }
pub 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<()> { ... }
pub 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<()> { ... }
pub fn compute_gradient(
        &self,
        img: &dyn ToInputArray,
        grad: &mut dyn ToInputOutputArray,
        angle_ofs: &mut dyn ToInputOutputArray,
        padding_tl: Size,
        padding_br: Size
    ) -> Result<()> { ... }
pub 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<()> { ... }
pub 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<()> { ... }
pub fn group_rectangles(
        &self,
        rect_list: &mut Vector<Rect>,
        weights: &mut Vector<f64>,
        group_threshold: i32,
        eps: f64
    ) -> Result<()> { ... } }

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

Loading content...

Provided methods

pub fn win_size(&self) -> Size[src]

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

pub fn set_win_size(&mut self, val: Size)[src]

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

pub fn block_size(&self) -> Size[src]

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

pub fn set_block_size(&mut self, val: Size)[src]

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

pub fn block_stride(&self) -> Size[src]

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

pub fn set_block_stride(&mut self, val: Size)[src]

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

pub fn cell_size(&self) -> Size[src]

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

pub fn set_cell_size(&mut self, val: Size)[src]

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

pub fn nbins(&self) -> i32[src]

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

pub fn set_nbins(&mut self, val: i32)[src]

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

pub fn deriv_aperture(&self) -> i32[src]

not documented

pub fn set_deriv_aperture(&mut self, val: i32)[src]

not documented

pub fn win_sigma(&self) -> f64[src]

Gaussian smoothing window parameter.

pub fn set_win_sigma(&mut self, val: f64)[src]

Gaussian smoothing window parameter.

pub fn histogram_norm_type(&self) -> HOGDescriptor_HistogramNormType[src]

histogramNormType

pub fn set_histogram_norm_type(&mut self, val: HOGDescriptor_HistogramNormType)[src]

histogramNormType

pub fn l2_hys_threshold(&self) -> f64[src]

L2-Hys normalization method shrinkage.

pub fn set_l2_hys_threshold(&mut self, val: f64)[src]

L2-Hys normalization method shrinkage.

pub fn gamma_correction(&self) -> bool[src]

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

pub fn set_gamma_correction(&mut self, val: bool)[src]

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

pub fn svm_detector(&mut self) -> Vector<f32>[src]

coefficients for the linear SVM classifier.

pub fn set_svm_detector_vec(&mut self, val: Vector<f32>)[src]

coefficients for the linear SVM classifier.

pub fn ocl_svm_detector(&mut self) -> UMat[src]

coefficients for the linear SVM classifier used when OpenCL is enabled

pub fn set_ocl_svm_detector(&mut self, val: UMat)[src]

coefficients for the linear SVM classifier used when OpenCL is enabled

pub fn free_coef(&self) -> f32[src]

not documented

pub fn set_free_coef(&mut self, val: f32)[src]

not documented

pub fn nlevels(&self) -> i32[src]

Maximum number of detection window increases. Default value is 64

pub fn set_nlevels(&mut self, val: i32)[src]

Maximum number of detection window increases. Default value is 64

pub fn signed_gradient(&self) -> bool[src]

Indicates signed gradient will be used or not

pub fn set_signed_gradient(&mut self, val: bool)[src]

Indicates signed gradient will be used or not

pub fn get_descriptor_size(&self) -> Result<size_t>[src]

Returns the number of coefficients required for the classification.

pub fn check_detector_size(&self) -> Result<bool>[src]

Checks if detector size equal to descriptor size.

pub fn get_win_sigma(&self) -> Result<f64>[src]

Returns winSigma value

pub fn set_svm_detector(&mut self, svmdetector: &dyn ToInputArray) -> Result<()>[src]

@example samples/cpp/peopledetect.cpp / Sets coefficients for the linear SVM classifier.

Parameters

  • svmdetector: coefficients for the linear SVM classifier.

pub fn read(&mut self, fn_: &mut FileNode) -> Result<bool>[src]

Reads HOGDescriptor parameters from a cv::FileNode.

Parameters

  • fn: File node

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

Stores HOGDescriptor parameters in a cv::FileStorage.

Parameters

  • fs: File storage
  • objname: Object name

pub fn load(&mut self, filename: &str, objname: &str) -> Result<bool>[src]

loads HOGDescriptor parameters and coefficients for the linear SVM classifier from a file.

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).

C++ default parameters

  • objname: String()

pub fn save(&self, filename: &str, objname: &str) -> Result<()>[src]

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

pub fn copy_to(&self, c: &mut HOGDescriptor) -> Result<()>[src]

clones the HOGDescriptor

Parameters

  • c: cloned HOGDescriptor

pub fn compute(
    &self,
    img: &dyn ToInputArray,
    descriptors: &mut Vector<f32>,
    win_stride: Size,
    padding: Size,
    locations: &Vector<Point>
) -> Result<()>
[src]

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

pub 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<()>
[src]

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

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

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

pub 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<()>
[src]

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

pub 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<()>
[src]

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

pub fn compute_gradient(
    &self,
    img: &dyn ToInputArray,
    grad: &mut dyn ToInputOutputArray,
    angle_ofs: &mut dyn ToInputOutputArray,
    padding_tl: Size,
    padding_br: Size
) -> Result<()>
[src]

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

pub 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<()>
[src]

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

pub 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<()>
[src]

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

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

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.
Loading content...

Implementors

impl HOGDescriptorTrait for HOGDescriptor[src]

Loading content...