Functions for cropping images.
More...
|
int | icv_rect (icv_image_t *img, size_t xorig, size_t yorig, size_t xnum, size_t ynum) |
|
int | icv_crop (icv_image_t *img, size_t ulx, size_t uly, size_t urx, size_t ury, size_t lrx, size_t lry, size_t llx, size_t lly, size_t ynum, size_t xnum) |
|
Functions for cropping images.
There are currently two types of cropping: rectangular and skewed.
◆ icv_rect()
This function crops an input image. Note : (0,0) corresponds to the Bottom Left of an Image.
- Parameters
-
img | Input image struct to be cropped. |
xorig | X-Coordinate of offset of image to be extracted from. |
yorig | Y-Coordinate of offset of image to be extracted from. |
xnum | Length of the output image to be extracted from input data in horizontal direction. |
ynum | Length of the output image to be extracted from input data in vertical direction. |
- Returns
- 0 on success.
◆ icv_crop()
int icv_crop |
( |
icv_image_t * |
img, |
|
|
size_t |
ulx, |
|
|
size_t |
uly, |
|
|
size_t |
urx, |
|
|
size_t |
ury, |
|
|
size_t |
lrx, |
|
|
size_t |
lry, |
|
|
size_t |
llx, |
|
|
size_t |
lly, |
|
|
size_t |
ynum, |
|
|
size_t |
xnum |
|
) |
| |
|
extern |
This function crops an input image.
This can do a skewed cropping, i.e. given any four points of quadrilateral in an image, map it to a rectangle of xnumXynum dimension.
* (ulx,uly) (urx,ury)
* __________________
* / |
* / |
* / |
* / |
* / |
* /______________________|
* (llx,lly) (lrx,lry)
*
- Returns
- 0 on success; on failure -1; and logs the error message.