opencv::cudaobjdetect

Struct CUDA_HOG

Source
pub struct CUDA_HOG { /* private fields */ }
Expand description

The class implements Histogram of Oriented Gradients (Dalal2005) object detector.

Note:

  • An example applying the HOG descriptor for people detection can be found at opencv_source_code/samples/cpp/peopledetect.cpp
  • A CUDA example applying the HOG descriptor for people detection can be found at opencv_source_code/samples/gpu/hog.cpp
  • (Python) An example applying the HOG descriptor for people detection can be found at opencv_source_code/samples/python/peopledetect.py

Implementations§

Source§

impl CUDA_HOG

Source

pub fn create( win_size: Size, block_size: Size, block_stride: Size, cell_size: Size, nbins: i32, ) -> Result<Ptr<CUDA_HOG>>

Creates the HOG descriptor and detector.

§Parameters
  • win_size: Detection window size. Align to block size and block stride.
  • block_size: Block size in pixels. Align to cell size. Only (16,16) is supported for now.
  • block_stride: Block stride. It must be a multiple of cell size.
  • cell_size: Cell size. Only (8, 8) is supported for now.
  • nbins: Number of bins. Only 9 bins per cell are supported for now.
§C++ default parameters
  • win_size: Size(64,128)
  • block_size: Size(16,16)
  • block_stride: Size(8,8)
  • cell_size: Size(8,8)
  • nbins: 9
Source

pub fn create_def() -> Result<Ptr<CUDA_HOG>>

Creates the HOG descriptor and detector.

§Parameters
  • win_size: Detection window size. Align to block size and block stride.
  • block_size: Block size in pixels. Align to cell size. Only (16,16) is supported for now.
  • block_stride: Block stride. It must be a multiple of cell size.
  • cell_size: Cell size. Only (8, 8) is supported for now.
  • nbins: Number of bins. Only 9 bins per cell are supported for now.
§Note

This alternative version of CUDA_HOG::create function uses the following default values for its arguments:

  • win_size: Size(64,128)
  • block_size: Size(16,16)
  • block_stride: Size(8,8)
  • cell_size: Size(8,8)
  • nbins: 9

Trait Implementations§

Source§

impl AlgorithmTrait for CUDA_HOG

Source§

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

Source§

fn clear(&mut self) -> Result<()>

Clears the algorithm state
Source§

fn read(&mut self, fn_: &impl FileNodeTraitConst) -> Result<()>

Reads algorithm parameters from a file storage
Source§

impl AlgorithmTraitConst for CUDA_HOG

Source§

fn as_raw_Algorithm(&self) -> *const c_void

Source§

fn write(&self, fs: &mut impl FileStorageTrait) -> Result<()>

Stores algorithm parameters in a file storage
Source§

fn write_1(&self, fs: &mut impl FileStorageTrait, name: &str) -> Result<()>

Stores algorithm parameters in a file storage Read more
Source§

fn write_with_name(&self, fs: &Ptr<FileStorage>, name: &str) -> Result<()>

@deprecated Read more
Source§

fn write_with_name_def(&self, fs: &Ptr<FileStorage>) -> Result<()>

👎Deprecated:

§Note

Deprecated: ## Note This alternative version of AlgorithmTraitConst::write_with_name function uses the following default values for its arguments: Read more
Source§

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

Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read
Source§

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

Saves the algorithm to a file. In order to make this method work, the derived class must implement Algorithm::write(FileStorage& fs).
Source§

fn get_default_name(&self) -> Result<String>

Returns the algorithm string identifier. This string is used as top level xml/yml node tag when the object is saved to a file or string.
Source§

impl Boxed for CUDA_HOG

Source§

unsafe fn from_raw(ptr: <CUDA_HOG as OpenCVFromExtern>::ExternReceive) -> Self

Wrap the specified raw pointer Read more
Source§

fn into_raw(self) -> <CUDA_HOG as OpenCVTypeExternContainer>::ExternSendMut

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

fn as_raw(&self) -> <CUDA_HOG as OpenCVTypeExternContainer>::ExternSend

Return the underlying raw pointer. Read more
Source§

fn as_raw_mut( &mut self, ) -> <CUDA_HOG as OpenCVTypeExternContainer>::ExternSendMut

Return the underlying mutable raw pointer Read more
Source§

impl CUDA_HOGTrait for CUDA_HOG

Source§

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

Source§

fn set_win_sigma(&mut self, win_sigma: f64) -> Result<()>

Gaussian smoothing window parameter.
Source§

fn set_l2_hys_threshold(&mut self, threshold_l2hys: f64) -> Result<()>

L2-Hys normalization method shrinkage.
Source§

fn set_gamma_correction(&mut self, gamma_correction: bool) -> Result<()>

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

fn set_num_levels(&mut self, nlevels: i32) -> Result<()>

Maximum number of detection window increases.
Source§

fn set_hit_threshold(&mut self, hit_threshold: f64) -> Result<()>

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.
Source§

fn set_win_stride(&mut self, win_stride: Size) -> Result<()>

Window stride. It must be a multiple of block stride.
Source§

fn set_scale_factor(&mut self, scale0: f64) -> Result<()>

Coefficient of the detection window increase.
Source§

fn set_group_threshold(&mut self, group_threshold: i32) -> Result<()>

Coefficient to regulate the similarity threshold. When detected, some objects can be covered by many rectangles. 0 means not to perform grouping. See groupRectangles.
Source§

fn set_descriptor_format( &mut self, descr_format: HOGDescriptor_DescriptorStorageFormat, ) -> Result<()>

Descriptor storage format: Read more
Source§

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

Sets coefficients for the linear SVM classifier.
Source§

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

Performs object detection without a multi-scale window. Read more
Source§

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

Performs object detection without a multi-scale window. Read more
Source§

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

Source§

fn detect_without_conf( &mut 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( &mut self, img: &impl ToInputArray, found_locations: &mut Vector<Rect>, confidences: &mut Vector<f64>, ) -> Result<()>

Performs object detection with a multi-scale window. Read more
Source§

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

Performs object detection with a multi-scale window. Read more
Source§

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

Source§

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

Performs object detection with a multi-scale window. Read more
Source§

fn compute( &mut self, img: &impl ToInputArray, descriptors: &mut impl ToOutputArray, stream: &mut impl StreamTrait, ) -> Result<()>

Returns block descriptors computed for the whole image. Read more
Source§

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

Returns block descriptors computed for the whole image. Read more
Source§

impl CUDA_HOGTraitConst for CUDA_HOG

Source§

fn as_raw_CUDA_HOG(&self) -> *const c_void

Source§

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

Source§

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

Source§

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

Source§

fn get_num_levels(&self) -> Result<i32>

Source§

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

Source§

fn get_win_stride(&self) -> Result<Size>

Source§

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

Source§

fn get_group_threshold(&self) -> Result<i32>

Source§

fn get_descriptor_format(&self) -> Result<HOGDescriptor_DescriptorStorageFormat>

Source§

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

Returns the number of coefficients required for the classification.
Source§

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

Returns the block histogram size.
Source§

fn get_default_people_detector(&self) -> Result<Mat>

Returns coefficients of the classifier trained for people detection.
Source§

impl Debug for CUDA_HOG

Source§

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

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

impl Drop for CUDA_HOG

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl From<CUDA_HOG> for Algorithm

Source§

fn from(s: CUDA_HOG) -> Self

Converts to this type from the input type.
Source§

impl Send for CUDA_HOG

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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<Mat> ModifyInplace for Mat
where Mat: Boxed,

Source§

unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res, ) -> Res

Helper function to call OpenCV functions that allow in-place modification of a Mat or another similar object. By passing a mutable reference to the Mat to this function your closure will get called with the read reference and a write references to the same Mat. This is unsafe in a general case as it leads to having non-exclusive mutable access to the internal data, but it can be useful for some performance sensitive operations. One example of an OpenCV function that allows such in-place modification is imgproc::threshold. Read more
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.