pub struct GLCM { /* private fields */ }Implementations§
Source§impl GLCM
impl GLCM
Sourcepub fn new<T>(
pixels: &[T],
width: usize,
height: usize,
channel: usize,
channels: usize,
angle: f32,
distance: f32,
) -> GLCMwhere
T: ToPrimitive,
pub fn new<T>(
pixels: &[T],
width: usize,
height: usize,
channel: usize,
channels: usize,
angle: f32,
distance: f32,
) -> GLCMwhere
T: ToPrimitive,
Create a new normalized gray-level co-occurence matrix
§Arguments
pixels- A row-major raw pixel bufferwidth- Width of imageheight- Height of imagechannel- Which channel to compute the comatrixchannels- Number of channels in imageangle- Angle (in degrees) for computing neighbour co-occurencedistance- Number of pixels to neighbouring pixels
§Examples
use pineapple_core::cv::features::GLCM;
let buffer: Vec<f32> = vec![0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0];
let comatrix = GLCM::new(&buffer, 3, 3, 0, 1, 0.0, 1.0);Sourcepub fn new_from_object<T, Container>(
object: &PineappleViewBuffer<'_, T, Container>,
channel: usize,
angle: f32,
distance: f32,
) -> GLCM
pub fn new_from_object<T, Container>( object: &PineappleViewBuffer<'_, T, Container>, channel: usize, angle: f32, distance: f32, ) -> GLCM
Create a new normalized gray-level co-occurence matrix from aa PineappleObjectBuffer
§Arguments
object- A PineappleObjectBufferchannel- Which channel to compute the comatrixangle- Angle (in degrees) for computing neighbour co-occurencedistance- Number of pixels to neighbouring pixels
§Note
This is pretty redunant with the default constructor. We could possibly
just accept a Vec
pub fn rows(&self) -> usize
pub fn cols(&self) -> usize
pub fn iter(&self) -> impl Iterator<Item = (usize, usize, f32)> + '_
pub fn margin_sums(&self) -> (Vec<f32>, Vec<f32>)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GLCM
impl RefUnwindSafe for GLCM
impl Send for GLCM
impl Sync for GLCM
impl Unpin for GLCM
impl UnwindSafe for GLCM
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.