BRL-CAD
|
Functions for cropping images. More...
Files | |
file | crop.h |
Functions | |
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.
int icv_rect | ( | icv_image_t * | img, |
size_t | xorig, | ||
size_t | yorig, | ||
size_t | xnum, | ||
size_t | ynum | ||
) |
This function crops an input image. Note : (0,0) corresponds to the Bottom Left of an Image.
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. |
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 | ||
) |
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) *