Sum, Sum-of-Squares, Min and Max Statistics

Image sum, sum-of-squares, cross-sum, min and max statistics. More...

Functions

int32_t rapp_stat_sum_bin (const uint8_t *buf, int dim, int width, int height)
 Binary image sum.
int32_t rapp_stat_sum_u8 (const uint8_t *buf, int dim, int width, int height)
 8-bit pixel sum.
int rapp_stat_sum2_u8 (const uint8_t *buf, int dim, int width, int height, uintmax_t sum[2])
 8-bit pixel squared sum.
int rapp_stat_xsum_u8 (const uint8_t *restrict src1, int src1_dim, const uint8_t *restrict src2, int src2_dim, int width, int height, uintmax_t sum[5])
 8-bit pixel cross sum.
int rapp_stat_min_bin (const uint8_t *buf, int dim, int width, int height)
 Binary pixel min.
int rapp_stat_max_bin (const uint8_t *buf, int dim, int width, int height)
 Binary pixel max.
int rapp_stat_min_u8 (const uint8_t *buf, int dim, int width, int height)
 8-bit pixel min.
int rapp_stat_max_u8 (const uint8_t *buf, int dim, int width, int height)
 8-bit pixel max.

Detailed Description

Image sum, sum-of-squares, cross-sum, min and max statistics.

All measures are image-global. The functions may read data up to the nearest alignment boundary, so if those pixels are not properly cleared the output may be invalid.

All images must be aligned.

Next section: Moments


Function Documentation

int32_t rapp_stat_sum_bin ( const uint8_t *  buf,
int  dim,
int  width,
int  height 
)

Binary image sum.

Compute the sum of all pixels in a binary image. Image buffer and dimension must be aligned.

Parameters:
[in] buf Pixel buffer.
dim Row dimension in bytes of the pixel buffer.
width Image width in pixels.
height Image height in pixels.
Returns:
The sum of the pixels in the image, or a negative error code on error.
int32_t rapp_stat_sum_u8 ( const uint8_t *  buf,
int  dim,
int  width,
int  height 
)

8-bit pixel sum.

Compute the sum of all pixels in an 8-bit image. The result may be invalid if the image is larger than 28*(sizeof(int) - 1) pixels. Image buffer and dimension must be aligned.

Parameters:
[in] buf Image pixel buffer.
dim Row dimension in bytes of the pixel buffer.
width Image width in pixels.
height Image height in pixels.
Returns:
The sum of the pixels in the image, or a negative error code on error.
int rapp_stat_sum2_u8 ( const uint8_t *  buf,
int  dim,
int  width,
int  height,
uintmax_t  sum[2] 
)

8-bit pixel squared sum.

Compute the sum and the sum-of-squares of all pixels in an 8-bit image. The result may be invalid if the image is larger than 28*(sizeof(int) - 1) pixels. Image buffer and dimension must be aligned.

Parameters:
[in] buf The image pixel buffer.
dim The row dimension in bytes of the pixel buffer.
width The image width in pixels.
height The image height in pixels.
[out] sum The location where to store the sum and the sum-of-squares of the image.
Returns:
A negative error code on error, zero otherwise.
int rapp_stat_xsum_u8 ( const uint8_t *restrict  src1,
int  src1_dim,
const uint8_t *restrict  src2,
int  src2_dim,
int  width,
int  height,
uintmax_t  sum[5] 
)

8-bit pixel cross sum.

Compute the cross sums of two 8-bit images. The result may be invalid if the image is larger than 28*(sizeof(int) - 1) pixels. Image buffers and dimensions must be aligned.

Parameters:
[in] src1 First image pixel buffer.
src1_dim Row dimension in bytes of the first buffer.
[in] src2 Second image pixel buffer.
src2_dim Row dimension in bytes of the second buffer.
width Image width in pixels.
height Image height in pixels.
[out] sum Output sum storage array with at least five elements. It is filled in as follows:

  • sum[0] = sum(src1)
  • sum[1] = sum(src2)
  • sum[2] = sum(src1*src1)
  • sum[3] = sum(src2*src2)
  • sum[4] = sum(src1*src2)
Returns:
A negative error code on error, zero otherwise.
int rapp_stat_min_bin ( const uint8_t *  buf,
int  dim,
int  width,
int  height 
)

Binary pixel min.

Finds the minimum pixel value in a binary image. Image buffer and dimension must be aligned.

Parameters:
[in] buf Image pixel buffer.
dim Row dimension in bytes of the pixel buffer.
width Image width in pixels.
height Image height in pixels.
Returns:
The minimum pixel value in the image, or a negative error code on error.
int rapp_stat_max_bin ( const uint8_t *  buf,
int  dim,
int  width,
int  height 
)

Binary pixel max.

Finds the maximum pixel value in a binary image. Image buffer and dimension must be aligned.

Parameters:
[in] buf Image pixel buffer.
dim Row dimension in bytes of the pixel buffer.
width Image width in pixels.
height Image height in pixels.
Returns:
The maximum pixel value in the image, or a negative error code on error.
int rapp_stat_min_u8 ( const uint8_t *  buf,
int  dim,
int  width,
int  height 
)

8-bit pixel min.

Finds the minimum pixel value in an 8-bit image. Image buffer and dimension must be aligned.

Parameters:
[in] buf Image pixel buffer.
dim Row dimension in bytes of the pixel buffer.
width Image width in pixels.
height Image height in pixels.
Returns:
The minimum pixel value in the image, or a negative error code on error.
int rapp_stat_max_u8 ( const uint8_t *  buf,
int  dim,
int  width,
int  height 
)

8-bit pixel max.

Finds the maximum pixel value in an 8-bit image. Image buffer and dimension must be aligned.

Parameters:
[in] buf Image pixel buffer.
dim Row dimension in bytes of the pixel buffer.
width Image width in pixels.
height Image height in pixels.
Returns:
The maximum pixel value in the image, or a negative error code on error.

Generated on 1 Jun 2016 for RAPP by  doxygen 1.6.1