- Implemented `get_ocr_result` method in the `ocr_space` class to interact with the OCR Space API. - Added `process_ocr` method to `image_processor_t` for handling OCR logic. - Updated interfaces (`ocr_space_i` and `image_processor_i`) to support OCR functionality. - Introduced `moduleScannerRoute` with endpoints for testing and license plate recognition workflows. - Included data validation and exception handling for OCR processing.
19 lines
613 B
PHP
19 lines
613 B
PHP
<?php
|
|
|
|
namespace interfaces;
|
|
|
|
interface ocr_space_i extends universal_module_i
|
|
{
|
|
/**
|
|
* Get the OCR result from the OCR Space API.
|
|
* @param string $base64_image The base64 encoded image to be processed.
|
|
*/
|
|
public function get_ocr_result(string $base64_image): array;
|
|
/**
|
|
* Cache the OCR result. (for 24 hours)
|
|
* @param string $base64_image The base64 encoded image to be cached.
|
|
* @param array $result The OCR result to be cached.
|
|
* @return bool True if caching was successful, false otherwise.
|
|
* @throws \Exception If there is an error during caching.
|
|
*/
|
|
} |