1:st and 2:nd order moments for binary images. More...
Functions | |
int | rapp_moment_order1_bin (const uint8_t *buf, int dim, int width, int height, uint32_t mom[3]) |
First order binary image moments. | |
int | rapp_moment_order2_bin (const uint8_t *buf, int dim, int width, int height, uintmax_t mom[6]) |
First and second order binary image moments. |
1:st and 2:nd order moments for binary images.
All moments 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.
The performance of these functions is input-sensitive, with the best case occurring for images with all-zero pixels. The worst case is a dense, but not contiguous pattern, e.g. a checker board pattern. For actual performance figures, see the benchmark plots.
All images must be aligned.
Next section: Spatial Filtering
int rapp_moment_order1_bin | ( | const uint8_t * | buf, | |
int | dim, | |||
int | width, | |||
int | height, | |||
uint32_t | mom[3] | |||
) |
First order binary image moments.
The result is only valid if it is not greater than 232.
[in] | buf | Source pixel buffer. |
dim | Row dimension of the source buffer. | |
width | Image width in pixels. | |
height | Image height in pixels. | |
[out] | mom | Storage array for the moment output with at least 3 elements. It is filled in the following way:
|
int rapp_moment_order2_bin | ( | const uint8_t * | buf, | |
int | dim, | |||
int | width, | |||
int | height, | |||
uintmax_t | mom[6] | |||
) |
First and second order binary image moments.
The 1:st and 2:nd order moments are only valid if they are not greater than 232 and 28*sizeof(uintmax_t), respectively.
[in] | buf | Source pixel buffer. |
dim | Row dimension of the source buffer. | |
width | Image width in pixels. | |
height | Image height in pixels. | |
[out] | mom | Storage array for the moment output with at least 6 elements. It is filled in the following way:
|