pub struct HogDescriptor { /* private fields */ }Expand description
Histogram of Oriented Gradients descriptor.
Computes a feature descriptor based on gradient orientation histograms localized to fine-spatial regions (cells), grouped into blocks for contrast normalization.
Implementations§
Source§impl HogDescriptor
impl HogDescriptor
Sourcepub fn new(cell_size: usize, block_size: usize, nbins: usize) -> Self
pub fn new(cell_size: usize, block_size: usize, nbins: usize) -> Self
Creates a new HOG descriptor.
cell_size: Size of each cell in pixels (e.g., 8).block_size: Number of cells per block (e.g., 2).nbins: Number of orientation bins (e.g., 9).
Sourcepub fn compute<B: Backend>(&self, image: &Image<B>) -> Result<Tensor<B, 1>>
pub fn compute<B: Backend>(&self, image: &Image<B>) -> Result<Tensor<B, 1>>
Computes the HOG descriptor for the given image.
The image is converted to grayscale, gradient magnitude and direction are computed, orientation histograms are built per cell, and blocks are L2-normalized. Returns a 1D tensor containing the concatenated block descriptors.
Auto Trait Implementations§
impl Freeze for HogDescriptor
impl RefUnwindSafe for HogDescriptor
impl Send for HogDescriptor
impl Sync for HogDescriptor
impl Unpin for HogDescriptor
impl UnsafeUnpin for HogDescriptor
impl UnwindSafe for HogDescriptor
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more