CImageProcessor
The CImageProcessor
class is a utility class for applying advanced processing on images.
Definition
Namespace: dynamsoft::utility
Assembly: DynamsoftUtility
class CImageProcessor
Methods
Method | Description |
---|---|
AdjustBrightness |
Adjusts the brightness of the image. |
AdjustContrast |
Adjusts the contrast of the image. |
ConvertToBinaryGlobal |
Converts the grayscale image to binary image using a global threshold. |
ConvertToBinaryLocal |
Converts the grayscale image to binary image using local (adaptive) binarization. |
ConvertToGray |
Converts colour image to grayscale. |
CropImage |
Crops an image. |
FilterImage |
Applies a specified image filter to an input image and returns the filtered result. |
AdjustBrightness
Adjusts the brightness of the image.
CImageData* AdjustBrightness(const CImageData* pImageData, int brightness)
Parameters
[in] pImageData
A pointer to the image data to be processed.
[in] brightness
Brightness adjustment value (positive values increase brightness, negative values decrease brightness). The value range is [-100, 100]
Return value
Returns a pointer to a CImageData
object representing the processed image.
See Also
AdjustContrast
Adjusts the contrast of the image.
CImageData* AdjustContrast(const CImageData* pImageData, int contrast)
Parameters
[in] pImageData
A pointer to the image data to be processed.
[in] contrast
Contrast adjustment value (positive values enhance, negative values reduce contrast). The value range is [-100, 100]
Return value
Returns a pointer to a CImageData
object representing the processed image.
See Also
ConvertToBinaryGlobal
Converts the grayscale image to binary image using a global threshold.
CImageData* ConvertToBinaryGlobal(const CImageData* pImageData, int threshold = -1, bool invert = false)
Parameters
[in] pImageData
A pointer to the image data to be processed.
[in] threshold
Global threshold for binarization(default is -1, automatic calculate the threshold).
[in] invert
If true, invert the binary image (black becomes white and white becomes black).
Return value
Returns a pointer to a CImageData
object representing the processed image.
See Also
ConvertToBinaryLocal
Converts the grayscale image to binary image using local (adaptive) binarization.
CImageData* ConvertToBinaryLocal(const CImageData* pImageData, int blockSize = 0, int compensation = 0, bool invert = false)
Parameters
[in] pImageData
A pointer to the image data to be processed.
[in] blockSize
Size of the block for local binarization(default is 0).
[in] compensation
Adjustment value to modify the threshold (default is 0).
[in] invert
If true, invert the binary image (black becomes white and white becomes black).
Return value
Returns a pointer to a CImageData
object representing the processed image.
See Also
ConvertToGray
Converts colour image to grayscale.
CImageData* ConvertToGray(const CImageData* pImageData, float R = 0.3f, float G = 0.59f, float B = 0.11f)
Parameters
[in] pImageData
A pointer to the image data to be processed.
[in] R
Weight for red channel.
[in] G
Weight for green channel.
[in] B
Weight for blue channel.
Return value
Returns a pointer to a CImageData
object representing the processed image.
See Also
CropImage
Crops an image.
CImageData* CropImage(const CImageData* pImageData, const CRect& rect, int* pErrorCode = NULL)
CImageData* CropImage(const CImageData* pImageData, const CQuadrilateral& quad, int* pErrorCode = NULL)
Parameters
[in] pImageData
A pointer to the image data to be cropped.
[in] rect
The rectangle to be cropped.
[in] quads
The quadrilateral to be cropped.
[out] pErrorCode
The error code.
Return value
Returns a pointer to a CImageData
object representing the cropped image.
See Also
FilterImage
Applies a specified image filter to an input image and returns the filtered result.
CImageData* FilterImage(const CImageData* pImageData, FilterType filterType)
Parameters
[in] pImageData
A pointer to the image data to be processed.
[in] filterType
Specifies the type of filter to apply to the input image.
Return value
Returns a pointer to a CImageData
object representing the processed image.
See Also