Leaper Vision Toolkit
中文 / English 2.x
Public Member Functions | Properties
ILImageOp Interface Reference

This interface provide functionalities of basic and advanced image operations, such as resizing, rotation, arithmetic, blending, tiling, etc. More...

Inheritance diagram for ILImageOp:
ILObject LImageOp

Public Member Functions

void Add (ILImage *img1, ILImage *img2, ILImage *result)
 
void AddScalar (ILImage *img, double scalar, ILImage *result, double scalar2, double scalar3)
 
void AddWeighted (ILImage *img1, ILImage *img2, double alpha, double beta, ILImage *result)
 
void BitAnd (ILImage *img1, ILImage *img2, ILImage *result)
 
void BitAndScalar (ILImage *img, double scalar, ILImage *result, double scalar2, double scalar3)
 
void BitNot (ILImage *img1, ILImage *result)
 
void BitOr (ILImage *img1, ILImage *img2, ILImage *result)
 
void BitOrScalar (ILImage *img, double scalar, ILImage *result, double scalar2, double scalar3)
 
void BitXor (ILImage *img1, ILImage *img2, ILImage *result)
 
void BitXorScalar (ILImage *img, double scalar, ILImage *result, double scalar2, double scalar3)
 
void Blend (ILImageList *imgList, LPVAggregation aggType, ILImage *result)
 
void Diff (ILImage *img1, ILImage *img2, ILImage *result)
 
void DiffScalar (ILImage *img, double scalar, ILImage *result, double scalar2, double scalar3)
 
void Divide (ILImage *img1, ILImage *img2, ILImage *result)
 
void DivideScalar (ILImage *img, double scalar, ILImage *result, double scalar2, double scalar3)
 
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 MaxScalar (ILImage *img, double scalar, ILImage *result, double scalar2, double scalar3)
 
void Min (ILImage *img1, ILImage *img2, ILImage *result)
 
void MinScalar (ILImage *img, double scalar, ILImage *result, double scalar2, double scalar3)
 
void Multiply (ILImage *img1, ILImage *img2, ILImage *result)
 
void MultiplyScalar (ILImage *img, double scalar, ILImage *result, double scalar2, double scalar3)
 
void Normalize (ILImage *img, ILImage *resultImg, double fromMinValue, double fromMaxValue, double toMinValue, double toMaxValue, ILImage *belowMask, ILImage *aboveMask)
 
void NormalizeMeanStdDev (ILImage *img, ILImage *resultImg, double k1, double k2, double toMinValue, double toMaxValue, ILImage *belowMask, ILImage *aboveMask)
 
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 Split (ILImage *img, int xCount, int xStep, int xSpace, int yCount, int yStep, int ySpace, ILImageList *resultList, BOOL cyclicMode, BOOL sameSize)
 
void SplitX (ILImage *img, int count, int step, int space, ILImageList *resultList, BOOL cyclicMode, BOOL sameSize)
 
void SplitY (ILImage *img, int count, int step, int space, ILImageList *resultList, BOOL cyclicMode, BOOL sameSize)
 
void Sub (ILImage *img1, ILImage *img2, ILImage *result)
 
void SubScalar (ILImage *img, double scalar, ILImage *result, double scalar2, double scalar3)
 
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
ILObjectCopy ()
 
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.
 
- Properties inherited from ILObject
LString Name [get, set]
 Name of the object. By default, the object has no name.
In most cases, LPV classes don't make use of the names.
The name is drawn on canvas around the object if ILDrawable::SetDrawName() is enabled. More...
 

Detailed Description

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.

Example Code

Member Function Documentation

◆ Add()

void Add ( ILImage img1,
ILImage img2,
ILImage result 
)

Add the two input images pixel by pixel, output a new result image \( I' = I_{1} + I_{2} \) . \nThe two input image should have the same size and format.

Parameters
[in]img1The first input image
[in]img2The second input image
[out]resultReturn result image
See also
AddScalar()

◆ AddScalar()

void AddScalar ( ILImage img,
double  scalar,
ILImage result,
double  scalar2,
double  scalar3 
)

Add the input images and a scalar value pixel by pixel, output a new result image \( I' = I + s \) .

Parameters
[in]imgThe input image
[in]scalarThe input scalar
[out]resultReturn result image
[in]scalar2For a color image to specify the scalar value used for the 2nd channel
If both scalar2 and scalar3 is set to 0 (default), we'll use the value scalar for all 3 channels.
[in]scalar3For a color image to specify the scalar value used for the 3rd channel
See also
Add()
Since
2.8.0

◆ AddWeighted()

void AddWeighted ( ILImage img1,
ILImage img2,
double  alpha,
double  beta,
ILImage result 
)

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 and format.

Parameters
[in]img1The first input image
[in]img2The second input image
[in]alphaThe weight of the first input image
[in]betaThe weight of the second input image
[out]resultReturn result image

◆ BitAnd()

void BitAnd ( ILImage img1,
ILImage img2,
ILImage result 
)

Calculate the bit-wise conjunction of the two input images pixel by pixel, output a new result image \( I' = I_{1} \land I_{2} \) . \nThe two input image should have the same size and format.

Parameters
[in]img1The first input image
[in]img2The second input image
[out]resultReturn result image
See also
BitAndScalar()
Since
2.8.0

◆ BitAndScalar()

void BitAndScalar ( ILImage img,
double  scalar,
ILImage result,
double  scalar2,
double  scalar3 
)

Calculate the bit-wise conjunction of the input images and a scalar value pixel by pixel, output a new result image \( I' = I \land s \) .

Parameters
[in]imgThe input image
[in]scalarThe input scalar
[out]resultReturn result image
[in]scalar2For a color image to specify the scalar value used for the 2nd channel
If both scalar2 and scalar3 is set to 0 (default), we'll use the value scalar for all 3 channels.
[in]scalar3For a color image to specify the scalar value used for the 3rd channel
See also
BitAnd()
Since
2.8.0

◆ BitNot()

void BitNot ( ILImage img1,
ILImage result 
)

Calculate the bit-wise inversion of the input images pixel by pixel, output a new result image \( I' = \lnot I \) .

Parameters
[in]imgThe input image
[out]resultReturn result image
See also
Invert()
Since
2.8.0

◆ BitOr()

void BitOr ( ILImage img1,
ILImage img2,
ILImage result 
)

Calculate the bit-wise disjunction of the two input images pixel by pixel, output a new result image \( I' = I_{1} \lor I_{2} \) . \nThe two input image should have the same size and format.

Parameters
[in]img1The first input image
[in]img2The second input image
[out]resultReturn result image
See also
BitOrScalar()
Since
2.8.0

◆ BitOrScalar()

void BitOrScalar ( ILImage img,
double  scalar,
ILImage result,
double  scalar2,
double  scalar3 
)

Calculate the bit-wise disjunction of the input images and a scalar value pixel by pixel, output a new result image \( I' = I \lor s \) .

Parameters
[in]imgThe input image
[in]scalarThe input scalar
[out]resultReturn result image
[in]scalar2For a color image to specify the scalar value used for the 2nd channel
If both scalar2 and scalar3 is set to 0 (default), we'll use the value scalar for all 3 channels.
[in]scalar3For a color image to specify the scalar value used for the 3rd channel
See also
BitOr()
Since
2.8.0

◆ BitXor()

void BitXor ( ILImage img1,
ILImage img2,
ILImage result 
)

Calculate the bit-wise "exclusive or" operation of the two input images pixel by pixel, output a new result image \( I' = I_{1} \oplus I_{2} \) . \nThe two input image should have the same size and format.

Parameters
[in]img1The first input image
[in]img2The second input image
[out]resultReturn result image
See also
BitXorScalar()
Since
2.8.0

◆ BitXorScalar()

void BitXorScalar ( ILImage img,
double  scalar,
ILImage result,
double  scalar2,
double  scalar3 
)

Calculate the bit-wise "exclusive or" operation of the input images and a scalar value pixel by pixel, output a new result image \( I' = I \oplus s \) .

Parameters
[in]imgThe input image
[in]scalarThe input scalar
[out]resultReturn result image
[in]scalar2For a color image to specify the scalar value used for the 2nd channel
If both scalar2 and scalar3 is set to 0 (default), we'll use the value scalar for all 3 channels.
[in]scalar3For a color image to specify the scalar value used for the 3rd channel
See also
BitXor()
Since
2.8.0

◆ Blend()

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.

Parameters
[in]imgListThe input image list for blending.
[in]aggTypeThe aggregation method used for blending.
[out]resultOutput the blending result.
Example
ImageBlend.cpp/cs

◆ Diff()

void Diff ( ILImage img1,
ILImage img2,
ILImage result 
)

Calculate the difference of the two input images pixel by pixel, output a new result image \( I' = abs(I_{1} - I_{2}) \) . \nThe two input image should have the same size and format.

Parameters
[in]img1The first input image
[in]img2The second input image
[out]resultReturn result image
See also
DiffScalar(), Sub()

◆ DiffScalar()

void DiffScalar ( ILImage img,
double  scalar,
ILImage result,
double  scalar2,
double  scalar3 
)

Calculate the difference of the input images and a scalar value pixel by pixel, output a new result image \( I' = abs(I - s) \) .

Parameters
[in]imgThe input image
[in]scalarThe input scalar
[out]resultReturn result image
[in]scalar2For a color image to specify the scalar value used for the 2nd channel
If both scalar2 and scalar3 is set to 0 (default), we'll use the value scalar for all 3 channels.
[in]scalar3For a color image to specify the scalar value used for the 3rd channel
See also
Diff(), SubScalar()
Since
2.8.0

◆ Divide()

void Divide ( ILImage img1,
ILImage img2,
ILImage result 
)

Divide the first input image by the second input image pixel by pixel, output a new result image \( I' = I_{1} / I_{2} \) . \nThe two input image should have the same size and format.

Parameters
[in]img1The first input image
[in]img2The second input image
[out]resultReturn result image
See also
DivideScalar()

◆ DivideScalar()

void DivideScalar ( ILImage img,
double  scalar,
ILImage result,
double  scalar2,
double  scalar3 
)

Divide the input image by a scalar value pixel by pixel, output a new result image \( I' = I / s \) .

Parameters
[in]imgThe input image
[in]scalarThe input scalar
[out]resultReturn result image
[in]scalar2For a color image to specify the scalar value used for the 2nd channel
If both scalar2 and scalar3 is set to 0 (default), we'll use the value scalar for all 3 channels.
[in]scalar3For a color image to specify the scalar value used for the 3rd channel
See also
Divide()
Since
2.8.0

◆ Flip()

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).

Parameters
[in]imgThe input image
[in]flipTypeThe type of flip
[out]resultReturn result image Otherwise, the original size is kept.

◆ GainOffset()

void GainOffset ( ILImage img,
ILImage result,
double  gain,
double  offset 
)

Scale an image with the given gain value, then add the given offset value, \( I' = I * gain + offset \).

Parameters
[in]imgThe input image
[out]resultReturn result image
[in]gainThe gain value
[in]offsetThe offset value

◆ Invert()

void Invert ( ILImage img,
ILImage result 
)

Invert an image, \( I' = 255 - I \) for 8bit images, and \( I' = 65535 - I \) for 16bit images.

Parameters
[in]imgThe input image
[out]resultReturn result image
See also
BitNot()

◆ Log()

void Log ( ILImage img,
double  base,
ILImage result 
)

Calculate the logarithm of the input image pixel by pixel, output a new result image, \( I' = \log_{base}{I} \) .

Parameters
[in]imgThe input image
[in]baseThe input base, should be a positive value
[out]resultReturn result image

◆ Max()

void Max ( ILImage img1,
ILImage img2,
ILImage result 
)

Calculate the maximum of the two input images pixel by pixel, output a new result image \( I' = \max (I_{1}, I_{2}) \) . \nThe two input image should have the same size and format.

Parameters
[in]img1The first input image
[in]img2The second input image
[out]resultReturn result image
See also
MaxScalar(), Min()

◆ MaxScalar()

void MaxScalar ( ILImage img,
double  scalar,
ILImage result,
double  scalar2,
double  scalar3 
)

Calculate the maximum of the input images and a scalar value pixel by pixel, output a new result image \( I' = \max (I, s) \) .

Parameters
[in]imgThe input image
[in]scalarThe input scalar
[out]resultReturn result image
[in]scalar2For a color image to specify the scalar value used for the 2nd channel
If both scalar2 and scalar3 is set to 0 (default), we'll use the value scalar for all 3 channels.
[in]scalar3For a color image to specify the scalar value used for the 3rd channel
See also
Min(), Max(), MinScalar()
Since
2.8.0

◆ Min()

void Min ( ILImage img1,
ILImage img2,
ILImage result 
)

Calculate the minimum of the two input images pixel by pixel, output a new result image \( I' = \min (I_{1}, I_{2}) \) . \nThe two input image should have the same size and format.

Parameters
[in]img1The first input image
[in]img2The second input image
[out]resultReturn result image
See also
MinScalar(), Max()

◆ MinScalar()

void MinScalar ( ILImage img,
double  scalar,
ILImage result,
double  scalar2,
double  scalar3 
)

Calculate the minimum of the input images and a scalar value pixel by pixel, output a new result image \( I' = \min (I, s \))} .

Parameters
[in]imgThe input image
[in]scalarThe input scalar
[out]resultReturn result image
[in]scalar2For a color image to specify the scalar value used for the 2nd channel
If both scalar2 and scalar3 is set to 0 (default), we'll use the value scalar for all 3 channels.
[in]scalar3For a color image to specify the scalar value used for the 3rd channel
See also
Min(), Max(), MaxScalar()
Since
2.8.0

◆ Multiply()

void Multiply ( ILImage img1,
ILImage img2,
ILImage result 
)

Multiply the two input images pixel by pixel, output a new result image \( I' = I_{1} \cdot I_{2} \) . \nThe two input image should have the same size and format.

Parameters
[in]img1The first input image
[in]img2The second input image
[out]resultReturn result image
See also
MultiplyScalar()

◆ MultiplyScalar()

void MultiplyScalar ( ILImage img,
double  scalar,
ILImage result,
double  scalar2,
double  scalar3 
)

Multiply the input images and a scalar value pixel by pixel, output a new result image \( I' = I \cdot s \) .

Parameters
[in]imgThe input image
[in]scalarThe input scalar
[out]resultReturn result image
[in]scalar2For a color image to specify the scalar value used for the 2nd channel
If both scalar2 and scalar3 is set to 0 (default), we'll use the value scalar for all 3 channels.
[in]scalar3For a color image to specify the scalar value used for the 3rd channel
See also
Multiply()
Since
2.8.0

◆ Normalize()

void Normalize ( ILImage img,
ILImage resultImg,
double  fromMinValue,
double  fromMaxValue,
double  toMinValue,
double  toMaxValue,
ILImage belowMask,
ILImage aboveMask 
)

Normalize the given image, stretching the values between the given minimum and maximum value to the target range. The image depth is not changed, the output image has the same depth and channels as the input. For a multi-channel color image, it outputs a color image and each channel is normalized on its own.

Parameters
[in]imgThe input image
[in]fromMinValue,fromMaxValueThe specified value of interest. Pass in empty range (0, 0) to use the minimum / maximum of current image.
[in]toMinValue,toMaxValueThe target value range. Pass in empty range (0, 0) to use theoretical value range based on image depth, aka. 0 ~ 255 for 8bit images, 0 ~ 65536 for 16bit images.
[out]resultImgOutput the normalized image
[out]belowMask,aboveMask Output the mask for pixels out of range of interest. White pixels are those below fromMinValue or above fromMaxValue . You may then fill those pixels to black or target minimum / maximum values, or patch via FillHole(). It's optional, pass in null if unnecessary.
Since
2.11.0
See also
NormalizeMeanStdDev(), NormalizeTo8(), NormalizeTo16()

◆ NormalizeMeanStdDev()

void NormalizeMeanStdDev ( ILImage img,
ILImage resultImg,
double  k1,
double  k2,
double  toMinValue,
double  toMaxValue,
ILImage belowMask,
ILImage aboveMask 
)

Normalize the given image based on its current mean and standard derivation, stretching the range \( (Mean - k1 \times StdDev, Mean + k2 \times StdDev) \) to target range. The image depth is not changed, the output image has the same depth and channels as the input.

Parameters
[in]imgThe input image
[in]k1The factor revised to the lower bound formed by mean and standard derivation.
[in]k2The factor revised to the upper bound formed by mean and standard derivation. Pass in negative value to use same factor as k1 .
[in]toMinValue,toMaxValueThe target value range. Pass in empty range (0, 0) to use theoretical value range based on image depth, aka. 0 ~ 255 for 8bit images, 0 ~ 65536 for 16bit images.
[out]resultImgOutput the normalized image
[out]belowMask,aboveMask Output the mask for pixels out of range of interest. White pixels are those below fromMinValue or above fromMaxValue . You may then fill those pixels to black or target minimum / maximum values, or patch via FillHole(). It's optional, pass in null if unnecessary.
Since
2.11.0
See also
NormalizeMeanStdDev(), NormalizeTo8(), NormalizeTo16()

◆ Pow()

void Pow ( ILImage img,
double  power,
ILImage result 
)

Calculate the power(exponentiation) of the input image pixel by pixel, output a new result image, \( I' = I^{power} \) .

Parameters
[in]imgThe input image
[in]powerThe input exponent or power
[out]resultReturn result image

◆ ProjectX()

LArray<double> ProjectX ( ILImage img,
LPVAggregation  aggType 
)

Projects an image horizontally, aggregating pixels on each row

Parameters
[in]img The input image
[in]aggTypeThe aggregation method used for projection.
Return values
resultReturn the projection result vector, it's a list of double values.

◆ ProjectY()

LArray<double> ProjectY ( ILImage img,
LPVAggregation  aggType 
)

Projects an image vertically, aggregating pixels on each column

Parameters
[in]img The input image
[in]aggTypeThe aggregation method used for projection.
Return values
resultReturn the projection result vector, it's a list of double values.

◆ Resize()

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).

Parameters
[in]imgThe input image
[in]zoomXFactor for zooming in or out in the x-coordinate direction.
[in]zoomYFactor for zooming in or out in the y-coordinate direction. Setting to 0 means same zoom factor as zoomX, aka. isotropic scaling.
[in]interMethodThe interpolation method used in resizing
[out]resultReturn result image
See also
ResizeTo(), Rotate(), ScaleRotate(), Transform()

◆ ResizeTo()

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).

Parameters
[in]imgThe input image
[in]wThe width of the new size
[in]hThe height of the new size
[in]interMethodThe interpolation method used in resizing
[out]resultReturn result image
See also
Resize(), Rotate(), ScaleRotate(), Transform()

◆ Rotate()

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).

Parameters
[in]imgThe input image
[in]angleThe rotation angle
[in]interMethodThe interpolation method used in rotation
[out]resultReturn result image
See also
ScaleRotate()

◆ ScaleRotate()

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).

Parameters
[in]imgThe input image
[in]angleThe clockwise rotation angle in degrees
[in]zoomXFactor for zooming in or out in the x-coordinate direction.
[in]zoomYFactor for zooming in or out in the y-coordinate direction. Setting to 0 means same zoom factor as zoomX, aka. isotropic scaling.
[in]pivotImgXThe x-coordinate of the pivot point on the input image. The pivot point is used as the center of the scale and rotation.
[in]pivotImgYThe y-coordinate of the pivot point on the input image.
[in]pivotResultXThe x-coordinate of the pivot point on the result image. It's the "same" pixel as the pivot point in the input image.
[in]pivotResultYThe y-coordinate of the pivot point on the result image.
[in]interMethodThe interpolation method used in resizing
[out]resultReturn result image
See also
ResizeTo(), Rotate(), ScaleRotate(), Transform()

◆ Split()

void Split ( ILImage img,
int  xCount,
int  xStep,
int  xSpace,
int  yCount,
int  yStep,
int  ySpace,
ILImageList resultList,
BOOL  cyclicMode,
BOOL  sameSize 
)

Split a image into a grid of several images.

Parameters
[in]imgThe input image
[in]xCount,yCountSpecify the split count in column / row
[in]xStep,yStepThe column / row step for individual split. For non cyclical mode, this should be the width / height of the result images. While for cyclical mode, we collect those count column / row in each cycle to form the final results.
[in]xSpace,ySpaceThe space between split in column / row
[in]cyclicModeWhether to enable cyclical mode, which will cyclically repeat the splitting until the entire image is processed. Individual splitting results are merged together as the final results. By default, it's true.
[in]sameSizeWhether to make sure all result images have the same size. The undefined pixels are filled with background color.
[out]resultOutput the result images' collection row by row from top to bottom then from left to right.
Example
SplitImage.cpp/cs
See also
SplitX(), SplitY()
Since
2.10.0

◆ SplitX()

void SplitX ( ILImage img,
int  count,
int  step,
int  space,
ILImageList resultList,
BOOL  cyclicMode,
BOOL  sameSize 
)

Split a image horizontally into several images.

Parameters
[in]imgThe input image
[in]countSpecify the split count
[in]stepThe column step for individual split. For non cyclical mode, this should be the width of the result images. While for cyclical mode, we collect those count columns in each cycle to form the final results.
[in]spaceThe space between split
[in]cyclicModeWhether to enable cyclical mode, which will cyclically repeat the splitting until the entire image is processed. Individual splitting results are merged together as the final results. By default, it's true.
[in]sameSizeWhether to make sure all result images have the same size. The undefined pixels are filled with background color.
[out]resultOutput the result images' collection from left to right
Example
SplitImage.cpp/cs
See also
SplitY(), Split()
Since
2.10.0

◆ SplitY()

void SplitY ( ILImage img,
int  count,
int  step,
int  space,
ILImageList resultList,
BOOL  cyclicMode,
BOOL  sameSize 
)

Split a image vertically into several images.

Parameters
[in]imgThe input image
[in]countSpecify the split count
[in]stepThe row step for individual split. For non cyclical mode, this should be the height of the result images. While for cyclical mode, we collect those count rows in each cycle to form the final results.
[in]spaceThe space between split
[in]cyclicModeWhether to enable cyclical mode, which will cyclically repeat the splitting until the entire image is processed. Individual splitting results are merged together as the final results. By default, it's true.
[in]sameSizeWhether to make sure all result images have the same size. The undefined pixels are filled with background color.
[out]resultOutput the result images' collection from top to bottom
Example
SplitImage.cpp/cs
See also
SplitX(), Split()
Since
2.10.0

◆ Sub()

void Sub ( ILImage img1,
ILImage img2,
ILImage result 
)

Subtract two input images pixel by pixel, output a new result image \( I' = I_{1} - I_{2} \) . \nThe two input image should have the same size and format.

Parameters
[in]img1The first input image
[in]img2The second input image
[out]resultReturn result image
See also
SubScalar(), Diff()

◆ SubScalar()

void SubScalar ( ILImage img,
double  scalar,
ILImage result,
double  scalar2,
double  scalar3 
)

Subtract a scalar value from the input images pixel by pixel, output a new result image \( I' = I - s \) .

Parameters
[in]imgThe input image
[in]scalarThe input scalar
[out]resultReturn result image
[in]scalar2For a color image to specify the scalar value used for the 2nd channel
If both scalar2 and scalar3 is set to 0 (default), we'll use the value scalar for all 3 channels.
[in]scalar3For a color image to specify the scalar value used for the 3rd channel
See also
Sub(), DiffScalar()
Since
2.8.0

◆ TileX()

void TileX ( ILImageList imgList,
int  columnCount,
BOOL  compactMode,
ILImage result 
)

Tile a list of images into a large image horizontally.

Parameters
[in]imgListThe input image list
[in]columnCountThe 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]compactModeIn 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]resultOutput the result image.
Example
TileImage.cpp/cs
See also
TileY()

◆ TileY()

void TileY ( ILImageList imgList,
int  rowCount,
BOOL  compactMode,
ILImage result 
)

Tile a list of images into a large image vertically.

Parameters
[in]imgListThe input image list
[in]rowCountThe 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]compactModeIn 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]resultOutput the result image.
Example
TileImage.cpp/cs
See also
TileX()

◆ Transform()

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).

Parameters
[in]imgThe input image.
[in]tfThe transformation.
[in]interMethodThe interpolation method used in resizing
[out]resultReturn result image.
Example
LinearTransform.cpp/cs
See also
Resize(), ResizeTo(), Rotate(), ScaleRotate()