Struct visioncortex::SummedAreaTable[][src]

pub struct SummedAreaTable {
    pub sums: Vec<u32>,
    pub width: usize,
    pub height: usize,
}

A data structure to efficiently compute summed pixel values over regions in an image (repeatedly).

Fields

sums: Vec<u32>width: usizeheight: usize

Implementations

impl SummedAreaTable[src]

pub fn from_color_image(image: &ColorImage) -> Self[src]

Creates an SAT of the same size of image, where each entry (x,y) is the sum of pixel values of the block of pixels with bottom right corner at (x,y) in image.

This construction takes 1 pass through the pixels in image.

pub fn get_bot_right_sum(&self, x: i32, y: i32) -> u32[src]

Returns the entry in the SAT.

If the input point is out of boundary, this function returns 0.

This is only to facilitate the implementation of other functions; avoid calling this function directly.

pub fn get_region_sum_top_left_bot_right(
    &self,
    top_left: PointI32,
    bot_right: PointI32
) -> u32
[src]

Computes the sum of pixel values in the specified region in O(1) time.

pub fn get_region_sum_x_y_w_h(
    &self,
    x: usize,
    y: usize,
    w: usize,
    h: usize
) -> u32
[src]

Computes the sum of pixel values in the specified region in O(1) time.

pub fn get_region_mean_top_left_bot_right(
    &self,
    top_left: PointI32,
    bot_right: PointI32
) -> f64
[src]

Computes the mean of pixel values in the specified region in O(1) time.

pub fn get_region_mean_x_y_w_h(
    &self,
    x: usize,
    y: usize,
    w: usize,
    h: usize
) -> f64
[src]

Computes the mean of pixel values in the specified region in O(1) time.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.