Logical Margins

Horizontal and vertical logical margins. More...

Functions

int rapp_margin_horz_bin (uint8_t *restrict margin, const uint8_t *restrict src, int dim, int width, int height)
 Compute the horizontal logical margin.
int rapp_margin_vert_bin (uint8_t *restrict margin, const uint8_t *restrict src, int dim, int width, int height)
 Compute the vertical logical margin.

Detailed Description

Horizontal and vertical logical margins.

Computes the logical margins of a binary image. The margin is defined as the logical inclusive-OR between all pixels in the rows (vertical) or in the columns (horizontal). The result is a binary image that consist only of one row or one column. The main use case is to compute the vertical margin and divide the image into horizontal blocks containing non-zero pixels that can be processed efficiently, while skipping the parts in between.

All images must be aligned.

Next section: Segmentation and Labelling


Function Documentation

int rapp_margin_horz_bin ( uint8_t *restrict  margin,
const uint8_t *restrict  src,
int  dim,
int  width,
int  height 
)

Compute the horizontal logical margin.

Parameters:
[out] margin Margin pixel buffer with one row of at least width pixels.
[in] src Source pixel buffer.
dim Row dimension of the source buffer.
width Image width in pixels.
height Image height in pixels.
Returns:
A negative error code on error, zero otherwise.
int rapp_margin_vert_bin ( uint8_t *restrict  margin,
const uint8_t *restrict  src,
int  dim,
int  width,
int  height 
)

Compute the vertical logical margin.

The margin is stored as a 1xheight horizontal image in the margin buffer. Since this function may process pixels up to the nearest alignment boundary, the alignment padding must be explicitly cleared by the caller or the result may be invalid.

Parameters:
[out] margin Margin pixel buffer with one row of least height pixels.
[in] src Source pixel buffer.
dim Row dimension of the source buffer.
width Image width in pixels.
height Image height in pixels.
Returns:
A negative error code on error, zero otherwise.

Generated on 1 Jun 2016 for RAPP by  doxygen 1.6.1