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
impl CUDA_HOG
Sourcepub fn create(
win_size: Size,
block_size: Size,
block_stride: Size,
cell_size: Size,
nbins: i32,
) -> Result<Ptr<CUDA_HOG>>
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
Sourcepub fn create_def() -> Result<Ptr<CUDA_HOG>>
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
impl AlgorithmTrait for CUDA_HOG
Source§impl AlgorithmTraitConst for CUDA_HOG
impl AlgorithmTraitConst for CUDA_HOG
fn as_raw_Algorithm(&self) -> *const c_void
Source§fn write(&self, fs: &mut impl FileStorageTrait) -> Result<()>
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<()>
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<()>
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<()>
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>
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<()>
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>
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
impl Boxed for CUDA_HOG
Source§unsafe fn from_raw(ptr: <CUDA_HOG as OpenCVFromExtern>::ExternReceive) -> Self
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
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
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
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
impl CUDA_HOGTrait for CUDA_HOG
fn as_raw_mut_CUDA_HOG(&mut self) -> *mut c_void
Source§fn set_win_sigma(&mut self, win_sigma: f64) -> Result<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
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<()>
fn detect_def( &mut self, img: &impl ToInputArray, found_locations: &mut Vector<Point>, ) -> Result<()>
Performs object detection without a multi-scale window. Read more
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<()>
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<()>
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<()>
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
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<()>
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<()>
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<()>
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
impl CUDA_HOGTraitConst for CUDA_HOG
fn as_raw_CUDA_HOG(&self) -> *const c_void
fn get_win_sigma(&self) -> Result<f64>
fn get_l2_hys_threshold(&self) -> Result<f64>
fn get_gamma_correction(&self) -> Result<bool>
fn get_num_levels(&self) -> Result<i32>
fn get_hit_threshold(&self) -> Result<f64>
fn get_win_stride(&self) -> Result<Size>
fn get_scale_factor(&self) -> Result<f64>
fn get_group_threshold(&self) -> Result<i32>
fn get_descriptor_format(&self) -> Result<HOGDescriptor_DescriptorStorageFormat>
Source§fn get_descriptor_size(&self) -> Result<size_t>
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>
fn get_block_histogram_size(&self) -> Result<size_t>
Returns the block histogram size.
Source§fn get_default_people_detector(&self) -> Result<Mat>
fn get_default_people_detector(&self) -> Result<Mat>
Returns coefficients of the classifier trained for people detection.
impl Send for CUDA_HOG
Auto Trait Implementations§
impl Freeze for CUDA_HOG
impl RefUnwindSafe for CUDA_HOG
impl !Sync for CUDA_HOG
impl Unpin for CUDA_HOG
impl UnwindSafe for CUDA_HOG
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
Source§unsafe fn modify_inplace<Res>(
&mut self,
f: impl FnOnce(&Mat, &mut Mat) -> Res,
) -> Res
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