Table of contents

ImageProcessor

The ImageProcessor class is a utility class that provides functionality for processing.

Definition

Namespace: Dynamsoft.Utility.Maui

Assembly: Dynamsoft.Utility.Maui

class ImageProcessor

Methods

Method Description
CropImage Crops an image based on the provided rectangle or quadrilateral.
CropAndDeskewImage(imageData,quadrilateral,dstWidth,dstHeight,padding) Crops and deskew an image based on the provided quadrilateral and additional information.
CropAndDeskewImage(imageData,quadrilateral) Crops and deskew an image based on the provided quadrilateral.
AdjustBrightness Adjusts the brightness of an image.
AdjustContrast Adjusts the contrast of an image.
FilterImage Applies a filter to an image.
ConvertToGray Converts an image to grayscale.
ConvertToGray Converts an image to grayscale with the specified RGB value.
ConvertToBinaryGlobal Converts an image to binary using threshold binarization mode.
ConvertToBinaryGlobal Converts an image to binary using threshold binarization mode with the specified threshold.
ConvertToBinaryLocal Converts an image to binary using local-block binarization mode.
ConvertToBinaryLocal Converts an image to binary using local-block binarization mode with the specified block size and compensation.

CropImage(rect)

Crops an image based on the provided rectangle.

ImageData? CropImage(ImageData imageData, DMRect rect);

Parameters

[in] imageData: The ImageData to crop.

[in] rect: The DMRect specifying the region to crop.

Return Value

The cropped ImageData.

CropAndDeskewImage(imageData,quadrilateral,dstWidth,dstHeight,padding,errorCode)

Crops and deskews an image based on the provided quadrilateral and additional information.

partial ImageData? CropAndDeskewImage(ImageData imageData, Quadrilateral quadrilateral, int dstWidth, int dstHeight, int padding);

Parameters

[in] imageData: The ImageData to crop.

[in] quadrilateral: The Quadrilateral specifying the region to crop.

[in] dstWidth: The width of the destination image.

[in] dstHeight: The height of the destination image.

[in] padding: The padding value to be added to the destination image.

CropAndDeskewImage(imageData,quadrilateral)

Crops and deskews an image based on the provided quadrilateral. The arguments dstWidth, dstHeight, and padding are set to 0.

partial ImageData? CropAndDeskewImage(ImageData imageData, Quadrilateral quadrilateral);

Parameters

[in] imageData: The ImageData to crop.

[in] quadrilateral: The Quadrilateral specifying the region to crop.

AdjustBrightness

Adjusts the brightness of an image.

ImageData? AdjustBrightness(ImageData imageData, int brightness);

Parameters

[in] imageData: The ImageData to adjust.

[in] brightness: The amount to adjust the brightness by.

Return Value

The brightness-adjusted ImageData.

AdjustContrast

Adjusts the contrast of an image.

ImageData? AdjustContrast(ImageData imageData, int contrast);

Parameters

[in] imageData: The ImageData to adjust.

[in] contrast: The amount to adjust the contrast by.

Return Value

The contrast-adjusted ImageData.

FilterImage

Applies a filter to an image.

ImageData? FilterImage(ImageData imageData, EnumFilterType type);

Parameters

[in] imageData: The ImageData to filter.

[in] type: The EnumFilterType specifying the filter type.

Return Value

The filtered ImageData.

ConvertToGray

Converts a colour image to a grayscale image.

ImageData? ConvertToGray(ImageData imageData);

Parameters

[in] imageData: The ImageData to convert.

Return Value

The grayscale ImageData.

ConvertToGray(rgb)

Converts a colour image to a grayscale image with the specified RGB value.

ImageData? ConvertToGray(ImageData imageData, float r, float g, float b);

Parameters

[in] imageData: The ImageData to convert.

[in] r: The red component weight.

[in] g: The green component weight.

[in] b: The blue component weight.

Return Value

The grayscale ImageData.

ConvertToBinaryGlobal

Converts an image to binary using threshold binarization mode.

ImageData? ConvertToBinaryGlobal(ImageData imageData);

Parameters

[in] imageData: The ImageData to convert.

Return Value

The binary ImageData.

ConvertToBinaryGlobal(threshold,invert)

Converts an image to binary using threshold binarization mode with the specified threshold.

ImageData? ConvertToBinaryGlobal(ImageData imageData, int threshold, bool invert);

Parameters

[in] imageData: The ImageData to convert.

[in] threshold: The threshold value.

[in] invert: A flag indicating whether to invert the binary image.

Return Value

The binary ImageData.

ConvertToBinaryLocal

Converts an image to binary using local-block binarization mode.

ImageData? ConvertToBinaryLocal(ImageData imageData);

Parameters

[in] imageData: The ImageData to convert.

Return Value

The binary ImageData.

ConvertToBinaryLocal(blockSize,compensation,invert)

Converts an image to binary using local-block binarization mode with the specified block size and compensation.

ImageData? ConvertToBinaryLocal(ImageData imageData, int blockSize, int compensation, bool invert);

Parameters

[in] imageData: The ImageData to convert.

[in] blockSize: The size of the block.

[in] compensation: The compensation value.

[in] invert: A flag indicating whether to invert the binary image.

Return Value

The binary ImageData.

This page is compatible for:

Is this page helpful?

YesYes NoNo

In this article: