Class GraphicProcessorControl
- Namespace
- CapCognition.Net.Core.Processing
- Assembly
- CapCognition.Net.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
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
DrawResults(RecognitionResult?, SKBitmap, ResultDrawingOptions[]?)
Draws the results on the given bitmap.
public void DrawResults(RecognitionResult? result, SKBitmap bitmap, RecognitionProcessorResult.ResultDrawingOptions[]? resultDrawingOptions)
Parameters
resultRecognitionResultbitmapSKBitmapresultDrawingOptionsResultDrawingOptions[]
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
TThe 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>)
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)
Parameters
captureWidthintImage capture width in pixels
captureHeightintImage capture height in pixels
optionsList<RecognitionOptions>List of recognition options
Returns
Exceptions
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
bitmapSKBitmapThe bitmap image to process.
resultDeliveryCbGraphicProcessorControl.ResultDeliveryCallbackThe callback to deliver the processing result.
useParallelProcessingboolIf true, parallel processing will be used.
disableBitmapDisposalboolIf true, the bitmap will not be disposed after processing.
Returns
RegisterRecognitionProcessor(Type, Func<ImageProcessor>)
public static void RegisterRecognitionProcessor(Type optionType, Func<ImageProcessor> processorFactory)
Parameters
optionTypeTypeprocessorFactoryFunc<ImageProcessor>
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
grabImageCBGraphicProcessorControl.ImageGrabCallbackresultDeliveryCBGraphicProcessorControl.ResultDeliveryCallback
Returns
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
grabImageCBGraphicProcessorControl.ImageGrabCallbackresultDeliveryCBGraphicProcessorControl.ResultDeliveryCallback
Returns
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 virtual 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.