Struct visioncortex::SummedAreaTable [−][src]
A data structure to efficiently compute summed pixel values over regions in an image (repeatedly).
Fields
sums: Vec<u32>
width: usize
height: 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]
&self,
top_left: PointI32,
bot_right: PointI32
) -> u32
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]
&self,
x: usize,
y: usize,
w: usize,
h: usize
) -> u32
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]
&self,
top_left: PointI32,
bot_right: PointI32
) -> f64
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]
&self,
x: usize,
y: usize,
w: usize,
h: usize
) -> f64
Computes the mean of pixel values in the specified region in O(1) time.
Auto Trait Implementations
impl RefUnwindSafe for SummedAreaTable
impl Send for SummedAreaTable
impl Sync for SummedAreaTable
impl Unpin for SummedAreaTable
impl UnwindSafe for SummedAreaTable
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,