Struct opencv::objdetect::HOGDescriptor
source · [−]pub struct HOGDescriptor { /* private fields */ }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
Implementations
sourceimpl HOGDescriptor
impl HOGDescriptor
sourcepub fn default() -> Result<HOGDescriptor>
pub fn default() -> Result<HOGDescriptor>
Creates the HOG descriptor and detector with default params.
aqual to HOGDescriptor(Size(64,128), Size(16,16), Size(8,8), Size(8,8), 9 )
sourcepub 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>
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 params.
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
sourcepub fn new_from_file(filename: &str) -> Result<HOGDescriptor>
pub fn new_from_file(filename: &str) -> Result<HOGDescriptor>
Creates the HOG descriptor and detector with default params.
aqual to HOGDescriptor(Size(64,128), Size(16,16), Size(8,8), Size(8,8), 9 )
Overloaded parameters
Parameters
- filename: The file name containing HOGDescriptor properties and coefficients for the linear SVM classifier.
sourcepub fn copy(d: &HOGDescriptor) -> Result<HOGDescriptor>
pub fn copy(d: &HOGDescriptor) -> Result<HOGDescriptor>
Creates the HOG descriptor and detector with default params.
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.
sourcepub fn get_default_people_detector() -> Result<Vector<f32>>
pub fn get_default_people_detector() -> Result<Vector<f32>>
Returns coefficients of the classifier trained for people detection (for 64x128 windows).
sourcepub fn get_daimler_people_detector() -> Result<Vector<f32>>
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
sourceimpl Boxed for HOGDescriptor
impl Boxed for HOGDescriptor
sourceimpl Drop for HOGDescriptor
impl Drop for HOGDescriptor
sourceimpl HOGDescriptorTrait for HOGDescriptor
impl HOGDescriptorTrait for HOGDescriptor
fn as_raw_mut_HOGDescriptor(&mut self) -> *mut c_void
sourcefn set_win_size(&mut self, val: Size)
fn set_win_size(&mut self, val: Size)
Detection window size. Align to block size and block stride. Default value is Size(64,128).
sourcefn set_block_size(&mut self, val: Size)
fn set_block_size(&mut self, val: Size)
Block size in pixels. Align to cell size. Default value is Size(16,16).
sourcefn set_block_stride(&mut self, val: Size)
fn set_block_stride(&mut self, val: Size)
Block stride. It must be a multiple of cell size. Default value is Size(8,8).
sourcefn set_cell_size(&mut self, val: Size)
fn set_cell_size(&mut self, val: Size)
Cell size. Default value is Size(8,8).
sourcefn set_nbins(&mut self, val: i32)
fn set_nbins(&mut self, val: i32)
Number of bins used in the calculation of histogram of gradients. Default value is 9.
sourcefn set_deriv_aperture(&mut self, val: i32)
fn set_deriv_aperture(&mut self, val: i32)
not documented
sourcefn set_win_sigma(&mut self, val: f64)
fn set_win_sigma(&mut self, val: f64)
Gaussian smoothing window parameter.
sourcefn set_histogram_norm_type(&mut self, val: HOGDescriptor_HistogramNormType)
fn set_histogram_norm_type(&mut self, val: HOGDescriptor_HistogramNormType)
histogramNormType
sourcefn set_l2_hys_threshold(&mut self, val: f64)
fn set_l2_hys_threshold(&mut self, val: f64)
L2-Hys normalization method shrinkage.
sourcefn set_gamma_correction(&mut self, val: bool)
fn set_gamma_correction(&mut self, val: bool)
Flag to specify whether the gamma correction preprocessing is required or not.
sourcefn set_svm_detector_vec(&mut self, val: Vector<f32>)
fn set_svm_detector_vec(&mut self, val: Vector<f32>)
coefficients for the linear SVM classifier.
sourcefn set_ocl_svm_detector(&mut self, val: UMat)
fn set_ocl_svm_detector(&mut self, val: UMat)
coefficients for the linear SVM classifier used when OpenCL is enabled
sourcefn set_free_coef(&mut self, val: f32)
fn set_free_coef(&mut self, val: f32)
not documented
sourcefn set_nlevels(&mut self, val: i32)
fn set_nlevels(&mut self, val: i32)
Maximum number of detection window increases. Default value is 64
sourcefn set_signed_gradient(&mut self, val: bool)
fn set_signed_gradient(&mut self, val: bool)
Indicates signed gradient will be used or not
sourcefn set_svm_detector(&mut self, svmdetector: &dyn ToInputArray) -> Result<()>
fn set_svm_detector(&mut self, svmdetector: &dyn ToInputArray) -> Result<()>
@example samples/cpp/peopledetect.cpp / Sets coefficients for the linear SVM classifier. Read more
sourceimpl HOGDescriptorTraitConst for HOGDescriptor
impl HOGDescriptorTraitConst for HOGDescriptor
fn as_raw_HOGDescriptor(&self) -> *const c_void
sourcefn win_size(&self) -> Size
fn win_size(&self) -> Size
Detection window size. Align to block size and block stride. Default value is Size(64,128).
sourcefn block_size(&self) -> Size
fn block_size(&self) -> Size
Block size in pixels. Align to cell size. Default value is Size(16,16).
sourcefn 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).
sourcefn nbins(&self) -> i32
fn nbins(&self) -> i32
Number of bins used in the calculation of histogram of gradients. Default value is 9.
sourcefn deriv_aperture(&self) -> i32
fn deriv_aperture(&self) -> i32
not documented
sourcefn histogram_norm_type(&self) -> HOGDescriptor_HistogramNormType
fn histogram_norm_type(&self) -> HOGDescriptor_HistogramNormType
histogramNormType
sourcefn l2_hys_threshold(&self) -> f64
fn l2_hys_threshold(&self) -> f64
L2-Hys normalization method shrinkage.
sourcefn gamma_correction(&self) -> bool
fn gamma_correction(&self) -> bool
Flag to specify whether the gamma correction preprocessing is required or not.
sourcefn svm_detector(&self) -> Vector<f32>
fn svm_detector(&self) -> Vector<f32>
coefficients for the linear SVM classifier.
sourcefn ocl_svm_detector(&self) -> UMat
fn ocl_svm_detector(&self) -> UMat
coefficients for the linear SVM classifier used when OpenCL is enabled
sourcefn signed_gradient(&self) -> bool
fn signed_gradient(&self) -> bool
Indicates signed gradient will be used or not
sourcefn get_descriptor_size(&self) -> Result<size_t>
fn get_descriptor_size(&self) -> Result<size_t>
Returns the number of coefficients required for the classification.
sourcefn check_detector_size(&self) -> Result<bool>
fn check_detector_size(&self) -> Result<bool>
Checks if detector size equal to descriptor size.
sourcefn get_win_sigma(&self) -> Result<f64>
fn get_win_sigma(&self) -> Result<f64>
Returns winSigma value
sourcefn write(&self, fs: &mut FileStorage, objname: &str) -> Result<()>
fn write(&self, fs: &mut FileStorage, objname: &str) -> Result<()>
Stores HOGDescriptor parameters in a cv::FileStorage. Read more
sourcefn save(&self, filename: &str, objname: &str) -> Result<()>
fn save(&self, filename: &str, objname: &str) -> Result<()>
saves HOGDescriptor parameters and coefficients for the linear SVM classifier to a file Read more
sourcefn compute(
&self,
img: &dyn ToInputArray,
descriptors: &mut Vector<f32>,
win_stride: Size,
padding: Size,
locations: &Vector<Point>
) -> Result<()>
fn compute(
&self,
img: &dyn 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
sourcefn 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_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<()>
Performs object detection without a multi-scale window. Read more
sourcefn 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(
&self,
img: &dyn 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
sourcefn 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_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<()>
Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles. Read more
sourcefn 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 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<()>
Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles. Read more
sourcefn 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. Read more
sourcefn 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_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<()>
evaluate specified ROI and return confidence value for each location Read more
sourcefn 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 Read more
impl Send for HOGDescriptor
Auto Trait Implementations
impl RefUnwindSafe for HOGDescriptor
impl !Sync for HOGDescriptor
impl Unpin for HOGDescriptor
impl UnwindSafe for HOGDescriptor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more