Crop image to a rectangle area
1. imgCrop x:=0 y:=0 w:=100 h:=100;
2. imgCrop x=:10 y=:10 w:=50 h:=50 img:=mat(1) oimg:=mat(2);
Please refer to the page for additional option switches when accessing the x-function from script
Input
int
Specifies the X coordinate of the top-left corner of the rectangle area to be kept.
Specifies the Y coordinate of the top-left corner of the rectangle area to be kept.
Specifies the width (in pixels) of the rectangle area to be kept.
Specifies the height (in pixels) of the rectangle area to be kept.
Image
Specifies the image to be manipulated. The default input is the active image.
Output
Specifies the output image. By default, the output image is the same as the input image.
See the syntax here.
The imgCrop function crops the image to a specified rectangle area. You can use it to extract useful part and remove unneeded parts from the image.
In this example, we use the imgCrop function to cut an rectangle area that contains only one cell from the input image:
The computation uses L_TrimBitmap() function from LEADTOOLS Main API. Please refer to the LEADTOOLS Main API Help file, Version 14 and read the L_TrimBitmap topic.
LEADTOOLS Main API Help file, Version 14
imgTrim