Struct visioncortex::SummedAreaTable
source · [−]Expand description
A data structure to efficiently compute summed pixel values over regions in an image (repeatedly).
Fields
sums: Vec<u32>
width: usize
height: usize
Implementations
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.
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
pub fn get_region_sum_top_left_bot_right(
&self,
top_left: PointI32,
bot_right: PointI32
) -> u32
Computes the sum of pixel values in the specified region in O(1) time.
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
pub fn get_region_mean_top_left_bot_right(
&self,
top_left: PointI32,
bot_right: PointI32
) -> f64
Computes the mean of pixel values in the specified region in O(1) time.