Table of Contents

Class GraphicProcessorControl

Namespace
CapCognition.Maui.Core.Shared
Assembly
CapCognition.Maui.Core.dll
public class GraphicProcessorControl : IDisposable
Inheritance
GraphicProcessorControl
Implements
Inherited Members

Properties

IsAtLeastOneProcessorFree

Checks if at least one processor is finished with processing and ready for getting a new image.

public bool IsAtLeastOneProcessorFree { get; }

Property Value

bool

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

GetOption<T>()

Retrieves the first option of the specified type from the collection of recognition options.

public T? GetOption<T>() where T : RecognitionOptions

Returns

T

An instance of type T if an option of that type exists; otherwise, null.

Type Parameters

T

The type of recognition option to retrieve. Must inherit from RecognitionOptions.

Remarks

Returns null if the options collection is not prepared or contains no options of the specified type.

PrepareImageProcessorsAsync(int, int, List<RecognitionOptions>, IGraphicOverlay?)

Prepares the image processors according to the given options.

Note: Do not use this method directly if you do not know exactly what you are doing. Use the Recognizer class to manage image processing and do advanced processing.

public Task<bool> PrepareImageProcessorsAsync(int captureWidth, int captureHeight, List<RecognitionOptions> options, IGraphicOverlay? overlay)

Parameters

captureWidth int

Image capture width in pixels

captureHeight int

Image capture height in pixels

options List<RecognitionOptions>

List of recognition options

overlay IGraphicOverlay

Graphic overlay to be used. null if not needed

Returns

Task<bool>

Exceptions

ArgumentException

ProcessImageAsync(SKBitmap, ResultDeliveryCallback, bool, bool)

Pushes the given image to the processors for processing.

Note: Do not use this method directly if you do not know exactly what you are doing. Use the Recognizer class to manage image processing and do advanced processing.

public Task ProcessImageAsync(SKBitmap bitmap, GraphicProcessorControl.ResultDeliveryCallback resultDeliveryCb, bool useParallelProcessing, bool disableBitmapDisposal = false)

Parameters

bitmap SKBitmap

The bitmap image to process.

resultDeliveryCb GraphicProcessorControl.ResultDeliveryCallback

The callback to deliver the processing result.

useParallelProcessing bool

If true, parallel processing will be used.

disableBitmapDisposal bool

If true, the bitmap will not be disposed after processing.

Returns

Task

RegisterRecognitionProcessor(Type, Func<IImageProcessor<IGraphicOverlay?>>)

public static void RegisterRecognitionProcessor(Type optionType, Func<IImageProcessor<IGraphicOverlay?>> processorFactory)

Parameters

optionType Type
processorFactory Func<IImageProcessor<IGraphicOverlay>>

StartContinuousParallelImageProcessing(ImageGrabCallback, ResultDeliveryCallback)

Starts continuous image processing in parallel. Every processor performs for itself in its own interval. An interval always consists of grabbing an image, processing it and delivering the result.

public bool StartContinuousParallelImageProcessing(GraphicProcessorControl.ImageGrabCallback grabImageCB, GraphicProcessorControl.ResultDeliveryCallback resultDeliveryCB)

Parameters

grabImageCB GraphicProcessorControl.ImageGrabCallback
resultDeliveryCB GraphicProcessorControl.ResultDeliveryCallback

Returns

bool

Remarks

This method enables parallel processing of images, allowing for high-throughput recognition scenarios. The method returns false if the underlying controller is not available.

 Note:
 Do not use this method directly if you do not know exactly what you are doing. Use the Recognizer class to manage image processing and do advanced processing.

StartContinuousSequentialImageProcessing(ImageGrabCallback, ResultDeliveryCallback)

Starts continuous, sequential image processing using the specified image grab and result delivery callbacks.

public bool StartContinuousSequentialImageProcessing(GraphicProcessorControl.ImageGrabCallback grabImageCB, GraphicProcessorControl.ResultDeliveryCallback resultDeliveryCB)

Parameters

grabImageCB GraphicProcessorControl.ImageGrabCallback
resultDeliveryCB GraphicProcessorControl.ResultDeliveryCallback

Returns

bool

Remarks

This method starts continuous image acquisition and processing in a sequential manner. The processors are invoked on each image frame sequentially before the results are delivered.

 Note:
 Do not use this method directly if you do not know exactly what you are doing. Use the Recognizer class to manage image processing and do advanced processing.

 Important:
 Try to block as little as possible within the provided callbacks to avoid performance degradation.

StopContinuousImageProcessing()

Stops the ongoing continuous image processing operation, if one is currently active.

Note: Do not use this method directly if you do not know exactly what you are doing. Use the Recognizer class to manage image processing and do advanced processing.

public bool StopContinuousImageProcessing()

Returns

bool

true if the continuous image processing was successfully stopped; otherwise, false.

Remarks

Call this method to halt continuous image processing that was previously started. If no processing is active, or if the controller is unavailable, the method returns false.

StopImageProcessors()

Stops all active image processors and releases associated resources.

Note: Do not use this method directly if you do not know exactly what you are doing. Use the Recognizer class to manage image processing and do advanced processing.

public void StopImageProcessors()

Remarks

Call this method to halt ongoing image processing operations and reset the processor state. After calling this method, image processors must be reconfigured before processing can resume.