This interface provide functionalities of basic and advanced image operations, such as resizing, rotation, arithmetic, blending, tiling, etc. More...
Public Member Functions | |
void | Add (ILImage *img1, ILImage *img2, ILImage *result) |
void | AddWeighted (ILImage *img1, ILImage *img2, double alpha, double beta, ILImage *result) |
void | Blend (ILImageList *imgList, LPVAggregation aggType, ILImage *result) |
void | Diff (ILImage *img1, ILImage *img2, ILImage *result) |
void | Divide (ILImage *img1, ILImage *img2, ILImage *result) |
void | Flip (ILImage *img, LPVFlipType flipType, ILImage *result) |
void | GainOffset (ILImage *img, ILImage *result, double gain, double offset) |
void | Invert (ILImage *img, ILImage *result) |
void | Log (ILImage *img, double base, ILImage *result) |
void | Max (ILImage *img1, ILImage *img2, ILImage *result) |
void | Min (ILImage *img1, ILImage *img2, ILImage *result) |
void | Multiply (ILImage *img1, ILImage *img2, ILImage *result) |
void | Pow (ILImage *img, double power, ILImage *result) |
LArray< double > | ProjectX (ILImage *img, LPVAggregation aggType) |
LArray< double > | ProjectY (ILImage *img, LPVAggregation aggType) |
void | Resize (ILImage *img, double zoomX, double zoomY, LPVInterpolationMethod interMethod, ILImage *result) |
void | ResizeTo (ILImage *img, int w, int h, LPVInterpolationMethod interMethod, ILImage *result) |
void | Rotate (ILImage *img, double angle, LPVInterpolationMethod interMethod, ILImage *result) |
void | ScaleRotate (ILImage *img, double angle, double zoomX, double zoomY, double pivotImgX, double pivotImgY, double pivotResultX, double pivotResultY, LPVInterpolationMethod interMethod, ILImage *result) |
void | Sub (ILImage *img1, ILImage *img2, ILImage *result) |
void | TileX (ILImageList *imgList, int columnCount, BOOL compactMode, ILImage *result) |
void | TileY (ILImageList *imgList, int rowCount, BOOL compactMode, ILImage *result) |
void | Transform (ILImage *img, ILTransform *tf, LPVInterpolationMethod interMethod, ILImage *result) |
Public Member Functions inherited from ILObject | |
ILObject * | Copy () |
LPVErrorCode | Load (LString filename) |
void | Reset () |
LPVErrorCode | Save (LString filename) |
BOOL | Valid () |
Properties | |
LColor | BGColor [get, set] |
The background color, used to fill the uncovered part in operation such as Rotate(), TileX(). By default, it's black. | |
double | ResultGain [get, set] |
Scale the final result of the operation with the gain value. It should be a non-zero value, by default, it's 1, aka no scale. | |
double | ResultOffset [get, set] |
The offset value added to the final result of the operation, after scaled by ResultGain. Default to 0, aka no offset. | |
This interface provide functionalities of basic and advanced image operations, such as resizing, rotation, arithmetic, blending, tiling, etc.
To use this interface, you should create a LImageOp object.
Add the two input images pixel by pixel, output a new result image, \( I' = I_{1} + I_{2} \) . The two input image should have the same size.
[in] | img1 | The first input image |
[in] | img2 | The second input image |
[out] | result | Return result image |
Add the two input images pixel by pixel, output a new result image, \( I' = I_{1} * alpha + I_{2} * beta \) . The two input image should have the same size.
[in] | img1 | The first input image |
[in] | img2 | The second input image |
[in] | alpha | The weight of the first input image |
[in] | beta | The weight of the second input image |
[out] | result | Return result image |
void Blend | ( | ILImageList * | imgList, |
LPVAggregation | aggType, | ||
ILImage * | result | ||
) |
Multi-frame image blending allows user to accumulate a number of acquired images of the same scene and generate one blending image. Different aggregation type may be used for different purposes.
Aggregation Type | Usage |
---|---|
Average | Reduce image noise, generate a reliable image where lighting can be erratic. |
Min | Reduce light areas, for example, the overexposed parts. |
Max | Reduce shadows |
Standard deviation | Lighter pixels indicate a higher degree of variation between images. |
Note: other aggregation types are not supported.
[in] | imgList | The input image list for blending. |
[in] | aggType | The aggregation method used for blending. |
[out] | result | Output the blending result. |
Calculate the difference of the two input images pixel by pixel, output a new result image, \( I' = abs(I_{1} - I_{2}) \) . The two input image should have the same size.
[in] | img1 | The first input image |
[in] | img2 | The second input image |
[out] | result | Return result image |
Divide the first input image by the second input image pixel by pixel, output a new result image, \( I' = I_{1} / I_{2} \) . The two input image should have the same size.
[in] | img1 | The first input image |
[in] | img2 | The second input image |
[out] | result | Return result image |
void Flip | ( | ILImage * | img, |
LPVFlipType | flipType, | ||
ILImage * | result | ||
) |
Flip an image horizontally or/and vertically.
If the pass-in result image object is empty, then we'll use the same size as the input. Otherwise, the original size is kept and the border pixels are filled with background color(default to black).
[in] | img | The input image |
[in] | flipType | The type of flip |
[out] | result | Return result image Otherwise, the original size is kept. |
Scale an image with the given gain value, then add the given offset value, \( I' = I * gain + offset \).
[in] | img | The input image |
[out] | result | Return result image |
[in] | gain | The gain value |
[in] | offset | The offset value |
Invert an image, \( I' = 255 - I \) for 8bit images, and \( I' = 65535 - I \) for 16bit images.
[in] | img | The input image |
[out] | result | Return result image |
Calculate the logarithm of the input image pixel by pixel, output a new result image, \( I' = \log_{base}{I} \) .
[in] | img | The input image |
[in] | base | The input base, should be a positive value |
[out] | result | Return result image |
Calculate the minimum of the two input images pixel by pixel, output a new result image, \( I' = \max (I_{1}, I_{2}) \) . The two input image should have the same size.
[in] | img1 | The first input image |
[in] | img2 | The second input image |
[out] | result | Return result image |
Calculate the maximum of the two input images pixel by pixel, output a new result image, \( I' = \min (I_{1}, I_{2}) \) . The two input image should have the same size.
[in] | img1 | The first input image |
[in] | img2 | The second input image |
[out] | result | Return result image |
Multiply the two input images pixel by pixel, output a new result image, \( I' = I_{1} \cdot I_{2} \) . The two input image should have the same size.
[in] | img1 | The first input image |
[in] | img2 | The second input image |
[out] | result | Return result image |
Calculate the power(exponentiation) of the input image pixel by pixel, output a new result image, \( I' = I^{power} \) .
[in] | img | The input image |
[in] | power | The input exponent or power |
[out] | result | Return result image |
LArray<double> ProjectX | ( | ILImage * | img, |
LPVAggregation | aggType | ||
) |
Projects an image horizontally, aggregating pixels on each row
[in] | img | The input image |
[in] | aggType | The aggregation method used for projection. |
result | Return the projection result vector, it's a list of double values. |
LArray<double> ProjectY | ( | ILImage * | img, |
LPVAggregation | aggType | ||
) |
Projects an image vertically, aggregating pixels on each column
[in] | img | The input image |
[in] | aggType | The aggregation method used for projection. |
result | Return the projection result vector, it's a list of double values. |
void Resize | ( | ILImage * | img, |
double | zoomX, | ||
double | zoomY, | ||
LPVInterpolationMethod | interMethod, | ||
ILImage * | result | ||
) |
Resize an image by the given scale factor, using the image center as the pivot point.
If the pass-in result image object is empty, then we'll use the same size as the input. Otherwise, the original size is kept and the border pixels are filled with background color(default to black).
[in] | img | The input image |
[in] | zoomX | Factor for zooming in or out in the x-coordinate direction. |
[in] | zoomY | Factor for zooming in or out in the y-coordinate direction. Setting to 0 means same zoom factor as zoomX, aka. isotropic scaling. |
[in] | interMethod | The interpolation method used in resizing |
[out] | result | Return result image |
void ResizeTo | ( | ILImage * | img, |
int | w, | ||
int | h, | ||
LPVInterpolationMethod | interMethod, | ||
ILImage * | result | ||
) |
Resize an image to the given new size.
If the pass-in result image object is empty, then we'll use the same size as the input. Otherwise, the original size is kept and the border pixels are filled with background color(default to black).
[in] | img | The input image |
[in] | w | The width of the new size |
[in] | h | The height of the new size |
[in] | interMethod | The interpolation method used in resizing |
[out] | result | Return result image |
void Rotate | ( | ILImage * | img, |
double | angle, | ||
LPVInterpolationMethod | interMethod, | ||
ILImage * | result | ||
) |
Rotate an image by the given degree clockwise, using the image center as the pivot point.
If the pass-in result image object is empty, then we'll use the same size as the input. Otherwise, the original size is kept and the border pixels are filled with background color(default to black).
[in] | img | The input image |
[in] | angle | The rotation angle |
[in] | interMethod | The interpolation method used in rotation |
[out] | result | Return result image |
void ScaleRotate | ( | ILImage * | img, |
double | angle, | ||
double | zoomX, | ||
double | zoomY, | ||
double | pivotImgX, | ||
double | pivotImgY, | ||
double | pivotResultX, | ||
double | pivotResultY, | ||
LPVInterpolationMethod | interMethod, | ||
ILImage * | result | ||
) |
Scale and rotate an image, using the user-defined pivot points.
If the pass-in result image object is empty, then we'll use the same size as the input. Otherwise, the original size is kept and the border pixels are filled with background color(default to black).
[in] | img | The input image |
[in] | angle | The clockwise rotation angle in degrees |
[in] | zoomX | Factor for zooming in or out in the x-coordinate direction. |
[in] | zoomY | Factor for zooming in or out in the y-coordinate direction. Setting to 0 means same zoom factor as zoomX, aka. isotropic scaling. |
[in] | pivotImgX | The x-coordinate of the pivot point on the input image. The pivot point is used as the center of the scale and rotation. |
[in] | pivotImgY | The y-coordinate of the pivot point on the input image. |
[in] | pivotResultX | The x-coordinate of the pivot point on the result image. It's the "same" pixel as the pivot point in the input image. |
[in] | pivotResultY | The y-coordinate of the pivot point on the result image. |
[in] | interMethod | The interpolation method used in resizing |
[out] | result | Return result image |
Subtract two input images pixel by pixel, output a new result image, \( I' = I_{1} - I_{2} \) . The two input image should have the same size.
[in] | img1 | The first input image |
[in] | img2 | The second input image |
[out] | result | Return result image |
void TileX | ( | ILImageList * | imgList, |
int | columnCount, | ||
BOOL | compactMode, | ||
ILImage * | result | ||
) |
Tile a list of images into a large image horizontally.
[in] | imgList | The input image list |
[in] | columnCount | The number of images in one row. Pass in 0 or negative value to tile into one line. If the total count of the inputs is not a multiple of the specified column count, the last row are filled with background color. |
[in] | compactMode | In compact mode(True), images of different sizes in a horizontal row are copied contiguously. Otherwise(False), result size is determined by the maximum width and height, and the smaller images are copied to the center of the respective tile. |
[out] | result | Output the result image. |
void TileY | ( | ILImageList * | imgList, |
int | rowCount, | ||
BOOL | compactMode, | ||
ILImage * | result | ||
) |
Tile a list of images into a large image vertically.
[in] | imgList | The input image list |
[in] | rowCount | The number of images in one column. Pass in 0 or negative value to tile into one line. If the total count of the inputs is not a multiple of the specified row count, the last column are filled with background color. |
[in] | compactMode | In compact mode(True), images of different sizes in a vertical column are copied contiguously. Otherwise(False), result size is determined by the maximum width and height, and the smaller images are copied to the center of the respective tile. |
[out] | result | Output the result image. |
void Transform | ( | ILImage * | img, |
ILTransform * | tf, | ||
LPVInterpolationMethod | interMethod, | ||
ILImage * | result | ||
) |
Transform the image via the given transformation and return a new image.
If the pass-in result image object is empty, then we'll use the same size as the input. Otherwise, the original size is kept and the border pixels are filled with background color(default to black).
[in] | img | The input image. |
[in] | tf | The transformation. |
[in] | interMethod | The interpolation method used in resizing |
[out] | result | Return result image. |