pub struct HOGDescriptor { /* private fields */ }
Expand description

Implementations§

source§

impl HOGDescriptor

source

pub fn default() -> Result<HOGDescriptor>

Creates the HOG descriptor and detector with default parameters.

aqual to HOGDescriptor(Size(64,128), Size(16,16), Size(8,8), Size(8,8), 9 )

source

pub fn new( _win_size: Size, _block_size: Size, _block_stride: Size, _cell_size: Size, _nbins: i32, _deriv_aperture: i32, _win_sigma: f64, _histogram_norm_type: HOGDescriptor_HistogramNormType, _l2_hys_threshold: f64, _gamma_correction: bool, _nlevels: i32, _signed_gradient: bool ) -> Result<HOGDescriptor>

Creates the HOG descriptor and detector with default parameters.

aqual to HOGDescriptor(Size(64,128), Size(16,16), Size(8,8), Size(8,8), 9 )

Overloaded parameters
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.
C++ default parameters
  • _deriv_aperture: 1
  • _win_sigma: -1
  • _histogram_norm_type: HOGDescriptor::L2Hys
  • _l2_hys_threshold: 0.2
  • _gamma_correction: false
  • _nlevels: HOGDescriptor::DEFAULT_NLEVELS
  • _signed_gradient: false
source

pub fn new_def( _win_size: Size, _block_size: Size, _block_stride: Size, _cell_size: Size, _nbins: i32 ) -> Result<HOGDescriptor>

@overload

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

This alternative version of [new] function uses the following default values for its arguments:

  • _deriv_aperture: 1
  • _win_sigma: -1
  • _histogram_norm_type: HOGDescriptor::L2Hys
  • _l2_hys_threshold: 0.2
  • _gamma_correction: false
  • _nlevels: HOGDescriptor::DEFAULT_NLEVELS
  • _signed_gradient: false
source

pub fn new_from_file(filename: &str) -> Result<HOGDescriptor>

Creates the HOG descriptor and detector with default parameters.

aqual to HOGDescriptor(Size(64,128), Size(16,16), Size(8,8), Size(8,8), 9 )

Overloaded parameters

Creates the HOG descriptor and detector and loads HOGDescriptor parameters and coefficients for the linear SVM classifier from a file.

Parameters
  • filename: The file name containing HOGDescriptor properties and coefficients for the linear SVM classifier.
source

pub fn copy(d: &HOGDescriptor) -> Result<HOGDescriptor>

Creates the HOG descriptor and detector with default parameters.

aqual to HOGDescriptor(Size(64,128), Size(16,16), Size(8,8), Size(8,8), 9 )

Overloaded parameters
Parameters
  • d: the HOGDescriptor which cloned to create a new one.
source

pub fn get_default_people_detector() -> Result<Vector<f32>>

Returns coefficients of the classifier trained for people detection (for 64x128 windows).

source

pub fn get_daimler_people_detector() -> Result<Vector<f32>>

@example samples/tapi/hog.cpp / Returns coefficients of the classifier trained for people detection (for 48x96 windows).

Trait Implementations§

source§

impl Boxed for HOGDescriptor

source§

unsafe fn from_raw(ptr: *mut c_void) -> Self

Wrap the specified raw pointer Read more
source§

fn into_raw(self) -> *mut c_void

Return an the underlying raw pointer while consuming this wrapper. Read more
source§

fn as_raw(&self) -> *const c_void

Return the underlying raw pointer. Read more
source§

fn as_raw_mut(&mut self) -> *mut c_void

Return the underlying mutable raw pointer Read more
source§

impl Debug for HOGDescriptor

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for HOGDescriptor

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl HOGDescriptorTrait for HOGDescriptor

source§

fn as_raw_mut_HOGDescriptor(&mut self) -> *mut c_void

source§

fn set_win_size(&mut self, val: Size)

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

fn set_block_size(&mut self, val: Size)

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

fn set_block_stride(&mut self, val: Size)

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

fn set_cell_size(&mut self, val: Size)

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

fn set_nbins(&mut self, val: i32)

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

fn set_deriv_aperture(&mut self, val: i32)

not documented
source§

fn set_win_sigma(&mut self, val: f64)

Gaussian smoothing window parameter.
source§

fn set_histogram_norm_type(&mut self, val: HOGDescriptor_HistogramNormType)

histogramNormType
source§

fn set_l2_hys_threshold(&mut self, val: f64)

L2-Hys normalization method shrinkage.
source§

fn set_gamma_correction(&mut self, val: bool)

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

fn set_svm_detector_vec(&mut self, val: Vector<f32>)

coefficients for the linear SVM classifier.
source§

fn set_ocl_svm_detector(&mut self, val: UMat)

coefficients for the linear SVM classifier used when OpenCL is enabled
source§

fn set_free_coef(&mut self, val: f32)

not documented
source§

fn set_nlevels(&mut self, val: i32)

Maximum number of detection window increases. Default value is 64
source§

fn set_signed_gradient(&mut self, val: bool)

Indicates signed gradient will be used or not
source§

fn set_svm_detector(&mut self, svmdetector: &impl ToInputArray) -> Result<()>

@example samples/cpp/peopledetect.cpp / Sets coefficients for the linear SVM classifier. Read more
source§

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

Reads HOGDescriptor parameters and coefficients for the linear SVM classifier from a file node. Read more
source§

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

loads HOGDescriptor parameters and coefficients for the linear SVM classifier from a file Read more
source§

fn load_def(&mut self, filename: &str) -> Result<bool>

loads HOGDescriptor parameters and coefficients for the linear SVM classifier from a file Read more
source§

impl HOGDescriptorTraitConst for HOGDescriptor

source§

fn as_raw_HOGDescriptor(&self) -> *const c_void

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. Read more
source§

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

saves HOGDescriptor parameters and coefficients for the linear SVM classifier to a file Read more
source§

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

saves HOGDescriptor parameters and coefficients for the linear SVM classifier to a file Read more
source§

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

clones the HOGDescriptor Read more
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. Read more
source§

fn compute_def( &self, img: &impl ToInputArray, descriptors: &mut Vector<f32> ) -> Result<()>

@example samples/cpp/train_HOG.cpp / Computes HOG descriptors of given image. Read more
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. Read more
source§

fn detect_weights_def( &self, img: &impl ToInputArray, found_locations: &mut Vector<Point>, weights: &mut Vector<f64> ) -> Result<()>

Performs object detection without a multi-scale window. Read more
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. Read more
source§

fn detect_def( &self, img: &impl ToInputArray, found_locations: &mut Vector<Point> ) -> Result<()>

Performs object detection without a multi-scale window. Read more
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. Read more
source§

fn detect_multi_scale_weights_def( &self, img: &impl ToInputArray, found_locations: &mut Vector<Rect>, found_weights: &mut Vector<f64> ) -> Result<()>

Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles. Read more
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. Read more
source§

fn detect_multi_scale_def( &self, img: &impl ToInputArray, found_locations: &mut Vector<Rect> ) -> Result<()>

Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles. Read more
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. Read more
source§

fn compute_gradient_def( &self, img: &impl ToInputArray, grad: &mut impl ToInputOutputArray, angle_ofs: &mut impl ToInputOutputArray ) -> Result<()>

Computes gradients and quantized gradient orientations. Read more
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 Read more
source§

fn detect_roi_def( &self, img: &impl ToInputArray, locations: &Vector<Point>, found_locations: &mut Vector<Point>, confidences: &mut Vector<f64> ) -> Result<()>

evaluate specified ROI and return confidence value for each location Read more
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 Read more
source§

fn detect_multi_scale_roi_def( &self, img: &impl ToInputArray, found_locations: &mut Vector<Rect>, locations: &mut Vector<DetectionROI> ) -> Result<()>

evaluate specified ROI and return confidence value for each location in multiple scales Read more
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. Read more
source§

impl Send for HOGDescriptor

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.