Table of Contents

Class LicensePlateDetectionRecognitionOptionBuilder

Namespace
CapCognition.Net.LicensePlateDetection.Common
Assembly
CapCognition.Net.LicensePlateDetection.dll
public class LicensePlateDetectionRecognitionOptionBuilder
Inheritance
LicensePlateDetectionRecognitionOptionBuilder
Inherited Members

Constructors

LicensePlateDetectionRecognitionOptionBuilder(RecognitionOptionBuilder, Action<LicensePlateDetectionRecognitionOptions>)

public LicensePlateDetectionRecognitionOptionBuilder(RecognitionOptionBuilder parent, Action<LicensePlateDetectionRecognitionOptions> onDone)

Parameters

parent RecognitionOptionBuilder
onDone Action<LicensePlateDetectionRecognitionOptions>

Methods

ConfigureOption(Action<LicensePlateDetectionRecognitionOptions>)

Gives the option to configure the LicensePlateDetectionRecognitionOption and directly calling methods on the option.

public LicensePlateDetectionRecognitionOptionBuilder ConfigureOption(Action<LicensePlateDetectionRecognitionOptions> configAction)

Parameters

configAction Action<LicensePlateDetectionRecognitionOptions>

Returns

LicensePlateDetectionRecognitionOptionBuilder

DeliverPlatePictureInResult(bool)

Set the true to include the plate picture in the result.

public LicensePlateDetectionRecognitionOptionBuilder DeliverPlatePictureInResult(bool value = true)

Parameters

value bool

Returns

LicensePlateDetectionRecognitionOptionBuilder

DoAutomaticDetectionOptimization(bool)

Set the true to do optimization of the processing methods when the models are loaded the first time. Only enable when using the models for multiple detections.

public LicensePlateDetectionRecognitionOptionBuilder DoAutomaticDetectionOptimization(bool value = true)

Parameters

value bool

Returns

LicensePlateDetectionRecognitionOptionBuilder

Done()

Call this when done configuring this option Note: This method has to be the last method called in the builder chain.

public RecognitionOptionBuilder Done()

Returns

RecognitionOptionBuilder

SetPlateModelQuality(QualityPlateModel)

Set the quality of the license plate model. Only use this when you want to override the default quality. Note: When passing a model by stream, the quality is ignored.

public LicensePlateDetectionRecognitionOptionBuilder SetPlateModelQuality(LicensePlateDetectionRecognitionOptions.QualityPlateModel quality)

Parameters

quality LicensePlateDetectionRecognitionOptions.QualityPlateModel

Returns

LicensePlateDetectionRecognitionOptionBuilder

SetRecognitionQuality(RecognitionQuality)

Sets the recognition quality for license plate detection. Note: When passing a model by stream, the quality is ignored.

public LicensePlateDetectionRecognitionOptionBuilder SetRecognitionQuality(LicensePlateDetectionRecognitionOptionBuilder.RecognitionQuality quality)

Parameters

quality LicensePlateDetectionRecognitionOptionBuilder.RecognitionQuality

The desired recognition quality level to be set. This parameter determines the accuracy and speed of the recognition process.

Returns

LicensePlateDetectionRecognitionOptionBuilder

The current instance of LicensePlateDetectionRecognitionOptionBuilder to allow for method chaining.

SetTextModelQuality(QualityTextModel)

Set the quality of the text model. Only use this when you want to override the default quality. Note: When passing a model by stream, the quality is ignored.

public LicensePlateDetectionRecognitionOptionBuilder SetTextModelQuality(LicensePlateDetectionRecognitionOptions.QualityTextModel quality)

Parameters

quality LicensePlateDetectionRecognitionOptions.QualityTextModel

Returns

LicensePlateDetectionRecognitionOptionBuilder

SetTextWideModelQuality(QualityTextWideModel)

Set the quality of the text model. Only use this when you want to override the default quality. Note: When passing a model by stream, the quality is ignored.

public LicensePlateDetectionRecognitionOptionBuilder SetTextWideModelQuality(LicensePlateDetectionRecognitionOptions.QualityTextWideModel quality)

Parameters

quality LicensePlateDetectionRecognitionOptions.QualityTextWideModel

Returns

LicensePlateDetectionRecognitionOptionBuilder

SetVehicleModelQuality(QualityVehicleModel)

Set the quality of the vehicle model. Only use this when you want to override the default quality. Note: When passing a model by stream, the quality is ignored.

public LicensePlateDetectionRecognitionOptionBuilder SetVehicleModelQuality(LicensePlateDetectionRecognitionOptions.QualityVehicleModel quality)

Parameters

quality LicensePlateDetectionRecognitionOptions.QualityVehicleModel

Returns

LicensePlateDetectionRecognitionOptionBuilder

UseCroppedImageForRecognition()

Use cropped image for recognition. The image will be cropped (stretched) to fill the recognition area. Depending on the image aspect ratio, the image might be stretched horizontally or vertically so only the center part is taken for the recognition.

-------------------
|                |
|................|
|                |
| Recognized     |
|                |
|                |
|................|
|                |
|                |
-------------------
public LicensePlateDetectionRecognitionOptionBuilder UseCroppedImageForRecognition()

Returns

LicensePlateDetectionRecognitionOptionBuilder

UseCudaProvider(bool)

Set the true to use the CUDA provider for the recognition. Note: Only enable when cuda toolkit (https://developer.nvidia.com/cuda-downloads) and CUDNN (https://developer.nvidia.com/cudnn) are installed. Only available for Windows and Linux. Under ARM64 or ARM32, the CUDA provider is not available.

public LicensePlateDetectionRecognitionOptionBuilder UseCudaProvider(bool value = true)

Parameters

value bool

Returns

LicensePlateDetectionRecognitionOptionBuilder

UseFittedImageForRecognition()

Use a fitted image for recognition. The image will be resized to fit the recognition area.

-------------------
| b.            . b|
| l.            . l|
| a. Recognized . a|
| c.            . c|
| k.            . k|
|  .            .  |
-------------------
public LicensePlateDetectionRecognitionOptionBuilder UseFittedImageForRecognition()

Returns

LicensePlateDetectionRecognitionOptionBuilder

UseLocalModelsForRecognitionMode(RecognitionModeType)

Automated mode for loading the models from the local file system by specifying the recognition mode. The models have to be stored in the local file system with the correct naming convention for this to work. Sets the recognition mode for license plate detection by specifying the local model streams to use.

public LoadedLocalModelStreams UseLocalModelsForRecognitionMode(LicensePlateDetectionRecognitionOptions.RecognitionModeType recognitionType)

Parameters

recognitionType LicensePlateDetectionRecognitionOptions.RecognitionModeType

Returns

LoadedLocalModelStreams

UseRecognitionModeCountryLicencePlateOnly(ModelStreamInfo?, ModelStreamInfo?, ModelStreamInfo?)

Manual mode for loading the models from the local file system by specifying the local model streams to use. This method is used when the models are loaded from the local file system but not with the correct naming convention or when the models are stored in different folders. Sets the recognition mode for license plate detection. First, it will try to detect the country license plate, then the license plate text.

public LicensePlateDetectionRecognitionOptionBuilder UseRecognitionModeCountryLicencePlateOnly(LicensePlateDetectionRecognitionOptions.ModelStreamInfo? plateModelStream = null, LicensePlateDetectionRecognitionOptions.ModelStreamInfo? textModelStream = null, LicensePlateDetectionRecognitionOptions.ModelStreamInfo? textWideModelStream = null)

Parameters

plateModelStream LicensePlateDetectionRecognitionOptions.ModelStreamInfo

If not set, the model is loaded from the internet based on the plate model quality

textModelStream LicensePlateDetectionRecognitionOptions.ModelStreamInfo

If not set, the model is loaded from the internet based on the text model quality

textWideModelStream LicensePlateDetectionRecognitionOptions.ModelStreamInfo

If not set, the model is loaded from the internet based on the text wide model quality

Returns

LicensePlateDetectionRecognitionOptionBuilder

UseRecognitionModeCountryLicencePlateThenVehicle(ModelStreamInfo?, ModelStreamInfo?, ModelStreamInfo?, ModelStreamInfo?)

Manual mode for loading the models from the local file system by specifying the local model streams to use. This method is used when the models are loaded from the local file system but not with the correct naming convention or when the models are stored in different folders. Sets the recognition mode for license plate detection. First, it will try to detect the country license plate, then the license plate text, and if possible the vehicle type surrounding the license plate. If no plate is detected, no result is returned.

public LicensePlateDetectionRecognitionOptionBuilder UseRecognitionModeCountryLicencePlateThenVehicle(LicensePlateDetectionRecognitionOptions.ModelStreamInfo? plateModelStream = null, LicensePlateDetectionRecognitionOptions.ModelStreamInfo? textModelStream = null, LicensePlateDetectionRecognitionOptions.ModelStreamInfo? vehicleModelStream = null, LicensePlateDetectionRecognitionOptions.ModelStreamInfo? textWideModelStream = null)

Parameters

plateModelStream LicensePlateDetectionRecognitionOptions.ModelStreamInfo

If not set, the model is loaded from the internet based on the plate model quality

textModelStream LicensePlateDetectionRecognitionOptions.ModelStreamInfo

If not set, the model is loaded from the internet based on the text model quality

vehicleModelStream LicensePlateDetectionRecognitionOptions.ModelStreamInfo

If not set, the model is loaded from the internet based on the vehicle model quality

textWideModelStream LicensePlateDetectionRecognitionOptions.ModelStreamInfo

If not set, the model is loaded from the internet based on the text wide model quality

Returns

LicensePlateDetectionRecognitionOptionBuilder

UseRecognitionModeNoCountryLicencePlateOnly(ModelStreamInfo?, ModelStreamInfo?, ModelStreamInfo?)

Manual mode for loading the models from the local file system by specifying the local model streams to use. This method is used when the models are loaded from the local file system but not with the correct naming convention or when the models are stored in different folders. Sets the recognition mode for license plate detection. First, it will try to detect the license plate, then the license plate text.

public LicensePlateDetectionRecognitionOptionBuilder UseRecognitionModeNoCountryLicencePlateOnly(LicensePlateDetectionRecognitionOptions.ModelStreamInfo? plateModelStream = null, LicensePlateDetectionRecognitionOptions.ModelStreamInfo? textModelStream = null, LicensePlateDetectionRecognitionOptions.ModelStreamInfo? textWideModelStream = null)

Parameters

plateModelStream LicensePlateDetectionRecognitionOptions.ModelStreamInfo

If not set, the model is loaded from the internet based on the plate model quality

textModelStream LicensePlateDetectionRecognitionOptions.ModelStreamInfo

If not set, the model is loaded from the internet based on the text model quality

textWideModelStream LicensePlateDetectionRecognitionOptions.ModelStreamInfo

If not set, the model is loaded from the internet based on the text wide model quality

Returns

LicensePlateDetectionRecognitionOptionBuilder

UseRecognitionModeNoCountryLicencePlateThenVehicle(ModelStreamInfo?, ModelStreamInfo?, ModelStreamInfo?, ModelStreamInfo?)

Manual mode for loading the models from the local file system by specifying the local model streams to use. This method is used when the models are loaded from the local file system but not with the correct naming convention or when the models are stored in different folders. Sets the recognition mode for license plate detection. First, it will try to detect the license plate, then the license plate text, and if possible the vehicle type surrounding the license plate. If no plate is detected, no result is returned.

public LicensePlateDetectionRecognitionOptionBuilder UseRecognitionModeNoCountryLicencePlateThenVehicle(LicensePlateDetectionRecognitionOptions.ModelStreamInfo? plateModelStream = null, LicensePlateDetectionRecognitionOptions.ModelStreamInfo? textModelStream = null, LicensePlateDetectionRecognitionOptions.ModelStreamInfo? vehicleModelStream = null, LicensePlateDetectionRecognitionOptions.ModelStreamInfo? textWideModelStream = null)

Parameters

plateModelStream LicensePlateDetectionRecognitionOptions.ModelStreamInfo

If not set, the model is loaded from the internet based on the plate model quality

textModelStream LicensePlateDetectionRecognitionOptions.ModelStreamInfo

If not set, the model is loaded from the internet based on the text model quality

vehicleModelStream LicensePlateDetectionRecognitionOptions.ModelStreamInfo

If not set, the model is loaded from the internet based on the vehicle model quality

textWideModelStream LicensePlateDetectionRecognitionOptions.ModelStreamInfo

If not set, the model is loaded from the internet based on the text wide model quality

Returns

LicensePlateDetectionRecognitionOptionBuilder

UseRecognitionModeVehicleOnly(ModelStreamInfo?)

Manual mode for loading the models from the local file system by specifying the local model streams to use. This method is used when the models are loaded from the local file system but not with the correct naming convention or when the models are stored in different folders. Sets the recognition mode for license plate detection. It only tries to detect the vehicle type.

public LicensePlateDetectionRecognitionOptionBuilder UseRecognitionModeVehicleOnly(LicensePlateDetectionRecognitionOptions.ModelStreamInfo? vehicleModelStream = null)

Parameters

vehicleModelStream LicensePlateDetectionRecognitionOptions.ModelStreamInfo

If not set, the model is loaded from the internet based on the vehicle model quality

Returns

LicensePlateDetectionRecognitionOptionBuilder

UseRecognitionModeVehicleThenCountryLicencePlate(ModelStreamInfo?, ModelStreamInfo?, ModelStreamInfo?, ModelStreamInfo?)

Manual mode for loading the models from the local file system by specifying the local model streams to use. This method is used when the models are loaded from the local file system but not with the correct naming convention or when the models are stored in different folders. Sets the recognition mode for license plate detection. First, it will try to detect the vehicle type, then the country license plate and the license plate text of the detected vehicle. If no vehicle is detected, no result is returned.

public LicensePlateDetectionRecognitionOptionBuilder UseRecognitionModeVehicleThenCountryLicencePlate(LicensePlateDetectionRecognitionOptions.ModelStreamInfo? plateModelStream = null, LicensePlateDetectionRecognitionOptions.ModelStreamInfo? textModelStream = null, LicensePlateDetectionRecognitionOptions.ModelStreamInfo? vehicleModelStream = null, LicensePlateDetectionRecognitionOptions.ModelStreamInfo? textWideModelStream = null)

Parameters

plateModelStream LicensePlateDetectionRecognitionOptions.ModelStreamInfo

If not set, the model is loaded from the internet based on the plate model quality

textModelStream LicensePlateDetectionRecognitionOptions.ModelStreamInfo

If not set, the model is loaded from the internet based on the text model quality

vehicleModelStream LicensePlateDetectionRecognitionOptions.ModelStreamInfo

If not set, the model is loaded from the internet based on the vehicle model quality

textWideModelStream LicensePlateDetectionRecognitionOptions.ModelStreamInfo

If not set, the model is loaded from the internet based on the text wide model quality

Returns

LicensePlateDetectionRecognitionOptionBuilder

UseRecognitionModeVehicleThenNoCountryLicencePlate(ModelStreamInfo?, ModelStreamInfo?, ModelStreamInfo?, ModelStreamInfo?)

Manual mode for loading the models from the local file system by specifying the local model streams to use. This method is used when the models are loaded from the local file system but not with the correct naming convention or when the models are stored in different folders. Sets the recognition mode for license plate detection. First, it will try to detect the vehicle type, then the license plate and the license plate text of the detected vehicle. If no vehicle is detected, no result is returned.

public LicensePlateDetectionRecognitionOptionBuilder UseRecognitionModeVehicleThenNoCountryLicencePlate(LicensePlateDetectionRecognitionOptions.ModelStreamInfo? plateModelStream = null, LicensePlateDetectionRecognitionOptions.ModelStreamInfo? textModelStream = null, LicensePlateDetectionRecognitionOptions.ModelStreamInfo? vehicleModelStream = null, LicensePlateDetectionRecognitionOptions.ModelStreamInfo? textWideModelStream = null)

Parameters

plateModelStream LicensePlateDetectionRecognitionOptions.ModelStreamInfo

If not set, the model is loaded from the internet based on the plate model quality

textModelStream LicensePlateDetectionRecognitionOptions.ModelStreamInfo

If not set, the model is loaded from the internet based on the text model quality

vehicleModelStream LicensePlateDetectionRecognitionOptions.ModelStreamInfo

If not set, the model is loaded from the internet based on the vehicle model quality

textWideModelStream LicensePlateDetectionRecognitionOptions.ModelStreamInfo

If not set, the model is loaded from the internet based on the text wide model quality

Returns

LicensePlateDetectionRecognitionOptionBuilder