Megvii OCR PHP SDK
require_once 'MegviiOCR.php';
use MegviiOCR\MegviiOCR;
$megviiOCR = new MegviiOCR('{YOUR_API_KEY}', '{YOUR_API_SECRET}');
// Detect by local file
$resp = $megviiOCR->execute('ocrvehiclelicense', ['image_file' => '{YOUR_IMAGE_FILE_PATH}']);
// Detect by url
// $resp = $megviiOCR->execute('ocrvehiclelicense', ['image_url' => '{IMAGE_URL}']);
If Detect success, return:
Array
(
[http_code] => 200
[request_url] => https://api.megvii.com/cardpp/v1/ocrvehiclelicense
[body] => {...} // JSON String
)
If fail:
Array
(
[http_code] => 404
[request_url] => https://api.megvii.com/cardpp/v1/ocrvehiclelicense1
[body] => {"error_message": "API_NOT_FOUND"} // JSON String
)