Car plate recognition settings
Contents
[
Hide
]
Aspose.OCR for Java allows for very flexible customization of vehicle license plate recognition accuracy, performance, and other settings by configuring the properties of the CarPlateRecognitionSettings
object.
These settings are specifically tailored for processing scanned or photographed vehicle license plates.
Setting | Type | Default value | Description |
---|---|---|---|
setAllowedCharacters |
Case-sensitive string of characters or one of the predefined character sets:
|
All characters from the selected recognition language. | The whitelist of characters Aspose.OCR engine will look for. |
setIgnoredCharacters |
Case-sensitive string of characters | All characters are recognized | A blacklist of characters that are ignored during recognition. |
setLanguage |
Recognition language | Extended Latin characters, including diacritics | Specify a language for recognition. |
setAutomaticColorInversion |
boolean | true |
Set the method parameter to true automatically detect white text on a dark/black background and use a special OCR algorithm to improve car license plate recognition accuracy. Call this method with the parameter set to “false” to explicitly disable inverted text detection to save resources. |
Applicable to
Example
The following code example shows how to fine-tune car plate recognition:
AsposeOCR api = new AsposeOCR();
// Add images to the recognition batch
OcrInput input = new OcrInput(InputType.SingleImage);
input.add(os.path.join(self.dataDir, "car1.png"));
input.add(os.path.join(self.dataDir, "car2.png"));
// Recognition settings
CarPlateRecognitionSettings recognitionSettings = new CarPlateRecognitionSettings();
recognitionSettings.setIgnoredCharacters("Ää");
// Recognize license plates
ArrayList<RecognitionResult> results = api.RecognizeCarPlate(input, recognitionSettings);
results.forEach((result) -> {
System.out.println(result.recognition_text);
});