{"id":948183,"date":"2024-12-27T00:01:23","date_gmt":"2024-12-26T16:01:23","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/948183.html"},"modified":"2024-12-27T00:01:25","modified_gmt":"2024-12-26T16:01:25","slug":"python%e5%a6%82%e4%bd%95%e8%b0%83%e7%94%a8ocrapi","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/948183.html","title":{"rendered":"python\u5982\u4f55\u8c03\u7528ocrapi"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25083646\/fbcf1711-4e70-4a33-ac2f-3c891cc59eeb.webp\" alt=\"python\u5982\u4f55\u8c03\u7528ocrapi\" \/><\/p>\n<p><p> <strong>Python\u8c03\u7528OCR API\u7684\u65b9\u5f0f\u5305\u62ec\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93\u3001\u53d1\u9001HTTP\u8bf7\u6c42\u3001\u89e3\u6790\u8fd4\u56de\u6570\u636e\u7b49\u3002\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93\u53ef\u4ee5\u7b80\u5316\u8c03\u7528\u8fc7\u7a0b\u3001\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\u3002\u901a\u8fc7HTTP\u8bf7\u6c42\uff0c\u53ef\u4ee5\u81ea\u5b9a\u4e49\u8bf7\u6c42\u53c2\u6570\u3001\u5904\u7406\u8fd4\u56de\u6570\u636e\u3002\u89e3\u6790\u8fd4\u56de\u6570\u636e\u65f6\uff0c\u9700\u8981\u6839\u636eAPI\u6587\u6863\u7406\u89e3\u6570\u636e\u7ed3\u6784\u3001\u63d0\u53d6\u6240\u9700\u4fe1\u606f\u3002\u4ee5\u4e0b\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Python\u8c03\u7528OCR API\u3002<\/strong><\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93\u8c03\u7528OCR API<\/p>\n<\/p>\n<p><p>Python\u751f\u6001\u4e2d\u6709\u8bb8\u591a\u7b2c\u4e09\u65b9\u5e93\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u66f4\u65b9\u4fbf\u5730\u8c03\u7528OCR API\uff0c\u4f8b\u5982<code>pytesseract<\/code>\u3001<code>google-cloud-vision<\/code>\u7b49\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u4f7f\u7528\u8fd9\u4e9b\u5e93\u7684\u8be6\u7ec6\u6b65\u9aa4\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>pytesseract<\/strong><\/li>\n<\/ol>\n<p><p><code>pytesseract<\/code>\u662fTesseract OCR\u5f15\u64ce\u7684Python\u5305\u88c5\u5668\uff0c\u9002\u7528\u4e8e\u672c\u5730OCR\u5904\u7406\u3002<\/p>\n<\/p>\n<ul>\n<li>\n<p>\u5b89\u88c5\uff1a\u9996\u5148\u9700\u8981\u5b89\u88c5Tesseract OCR\u5f15\u64ce\u548c<code>pytesseract<\/code>\u5e93\u3002\u5728Linux\u4e0a\uff0c\u53ef\u4ee5\u4f7f\u7528\u5305\u7ba1\u7406\u5668\u8fdb\u884c\u5b89\u88c5\uff1b\u5728Windows\u4e0a\uff0c\u53ef\u4ee5\u4e0b\u8f7dTesseract\u7684\u5b89\u88c5\u7a0b\u5e8f\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528\uff1a\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u4ee3\u7801\u8fdb\u884cOCR\u5904\u7406\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pytesseract<\/p>\n<p>from PIL import Image<\/p>\n<h2><strong>\u6253\u5f00\u56fe\u50cf\u6587\u4ef6<\/strong><\/h2>\n<p>image = Image.open(&#39;example.png&#39;)<\/p>\n<h2><strong>\u4f7f\u7528pytesseract\u8fdb\u884cOCR<\/strong><\/h2>\n<p>text = pytesseract.image_to_string(image)<\/p>\n<p>print(text)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u4f18\u70b9\u548c\u5c40\u9650\u6027\uff1a<code>pytesseract<\/code>\u7684\u4f18\u70b9\u662f\u65e0\u9700\u7f51\u7edc\u8bf7\u6c42\uff0c\u5904\u7406\u901f\u5ea6\u5feb\uff1b\u4f46\u5176\u8bc6\u522b\u6548\u679c\u4f9d\u8d56\u4e8e\u672c\u5730\u5f15\u64ce\u7684\u80fd\u529b\uff0c\u53ef\u80fd\u4e0d\u5982\u4e00\u4e9b\u4e91\u7aefOCR\u670d\u52a1\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<ol start=\"2\">\n<li><strong>Google Cloud Vision<\/strong><\/li>\n<\/ol>\n<p><p>Google Cloud Vision API\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u4e91\u7aefOCR\u670d\u52a1\uff0c\u652f\u6301\u591a\u79cd\u8bed\u8a00\u548c\u590d\u6742\u573a\u666f\u3002<\/p>\n<\/p>\n<ul>\n<li>\n<p>\u6ce8\u518c\u548c\u8bbe\u7f6e\uff1a\u9996\u5148\u9700\u8981\u5728Google Cloud Platform\u4e0a\u521b\u5efa\u9879\u76ee\uff0c\u5e76\u542f\u7528Vision API\u3002\u7136\u540e\uff0c\u751f\u6210\u670d\u52a1\u8d26\u53f7\u5bc6\u94a5\u6587\u4ef6\uff0c\u5e76\u5c06\u5176\u8def\u5f84\u8bbe\u7f6e\u4e3a\u73af\u5883\u53d8\u91cf<code>GOOGLE_APPLICATION_CREDENTIALS<\/code>\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u5b89\u88c5\u5e93\uff1a\u4f7f\u7528<code>pip<\/code>\u5b89\u88c5<code>google-cloud-vision<\/code>\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install google-cloud-vision<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528\uff1a\u4ee5\u4e0b\u662f\u8c03\u7528Google Cloud Vision API\u7684\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from google.cloud import vision<\/p>\n<p>import io<\/p>\n<h2><strong>\u521b\u5efa\u5ba2\u6237\u7aef<\/strong><\/h2>\n<p>client = vision.ImageAnnotatorClient()<\/p>\n<h2><strong>\u8bfb\u53d6\u56fe\u50cf\u6587\u4ef6<\/strong><\/h2>\n<p>with io.open(&#39;example.png&#39;, &#39;rb&#39;) as image_file:<\/p>\n<p>    content = image_file.read()<\/p>\n<h2><strong>\u6784\u9020\u56fe\u50cf\u5bf9\u8c61<\/strong><\/h2>\n<p>image = vision.Image(content=content)<\/p>\n<h2><strong>\u8c03\u7528OCR API<\/strong><\/h2>\n<p>response = client.text_detection(image=image)<\/p>\n<p>texts = response.text_annotations<\/p>\n<h2><strong>\u6253\u5370\u8bc6\u522b\u7ed3\u679c<\/strong><\/h2>\n<p>for text in texts:<\/p>\n<p>    print(text.description)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u4f18\u70b9\u548c\u5c40\u9650\u6027\uff1aGoogle Cloud Vision API\u7684\u4f18\u70b9\u662f\u8bc6\u522b\u7cbe\u5ea6\u9ad8\uff0c\u652f\u6301\u591a\u79cd\u8bed\u8a00\uff1b\u4f46\u9700\u8981\u7f51\u7edc\u8bf7\u6c42\uff0c\u53ef\u80fd\u6d89\u53ca\u8d39\u7528\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<p><p>\u4e8c\u3001\u901a\u8fc7HTTP\u8bf7\u6c42\u8c03\u7528OCR API<\/p>\n<\/p>\n<p><p>\u5982\u679cOCR\u670d\u52a1\u6ca1\u6709\u63d0\u4f9b\u4e13\u7528\u7684Python\u5e93\uff0c\u53ef\u4ee5\u901a\u8fc7\u53d1\u9001HTTP\u8bf7\u6c42\u6765\u8c03\u7528API\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u4f7f\u7528Python\u7684<code>requests<\/code>\u5e93\u8fdb\u884cAPI\u8c03\u7528\u7684\u6b65\u9aa4\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u9009\u62e9\u5408\u9002\u7684OCR\u670d\u52a1<\/strong><\/li>\n<\/ol>\n<p><p>\u5e02\u9762\u4e0a\u6709\u8bb8\u591aOCR\u670d\u52a1\u63d0\u4f9bHTTP API\u63a5\u53e3\uff0c\u5982\u767e\u5ea6OCR\u3001\u5fae\u8f6fAzure OCR\u3001OCR.Space\u7b49\u3002\u5728\u9009\u62e9\u670d\u52a1\u65f6\uff0c\u9700\u8981\u8003\u8651\u5176\u8bc6\u522b\u7cbe\u5ea6\u3001\u652f\u6301\u8bed\u8a00\u3001\u8d39\u7528\u7b49\u56e0\u7d20\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u6ce8\u518c\u5e76\u83b7\u53d6API\u5bc6\u94a5<\/strong><\/li>\n<\/ol>\n<p><p>\u65e0\u8bba\u9009\u62e9\u54ea\u79cd\u670d\u52a1\uff0c\u901a\u5e38\u90fd\u9700\u8981\u6ce8\u518c\u8d26\u53f7\u5e76\u83b7\u53d6API\u5bc6\u94a5\u3002\u8be5\u5bc6\u94a5\u7528\u4e8e\u9a8c\u8bc1\u8bf7\u6c42\u5e76\u4fdd\u969cAPI\u7684\u5b89\u5168\u6027\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u53d1\u9001HTTP\u8bf7\u6c42<\/strong><\/li>\n<\/ol>\n<p><p>\u4ee5OCR.Space\u4e3a\u4f8b\uff0c\u4ee5\u4e0b\u662f\u5982\u4f55\u901a\u8fc7HTTP\u8bf7\u6c42\u8c03\u7528OCR API\u7684\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import requests<\/p>\n<h2><strong>\u8bbe\u7f6eAPI\u7684URL\u548c\u53c2\u6570<\/strong><\/h2>\n<p>api_url = &#39;https:\/\/api.ocr.space\/parse\/image&#39;<\/p>\n<p>headers = {<\/p>\n<p>    &#39;apikey&#39;: &#39;\u4f60\u7684API\u5bc6\u94a5&#39;<\/p>\n<p>}<\/p>\n<p>files = {<\/p>\n<p>    &#39;file&#39;: (&#39;example.png&#39;, open(&#39;example.png&#39;, &#39;rb&#39;)),<\/p>\n<p>}<\/p>\n<h2><strong>\u53d1\u9001POST\u8bf7\u6c42<\/strong><\/h2>\n<p>response = requests.post(api_url, headers=headers, files=files)<\/p>\n<h2><strong>\u89e3\u6790\u8fd4\u56de\u7ed3\u679c<\/strong><\/h2>\n<p>result = response.json()<\/p>\n<p>text = result.get(&#39;ParsedResults&#39;)[0].get(&#39;ParsedText&#39;)<\/p>\n<p>print(text)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"4\">\n<li><strong>\u89e3\u6790\u8fd4\u56de\u6570\u636e<\/strong><\/li>\n<\/ol>\n<p><p>API\u8fd4\u56de\u7684\u6570\u636e\u901a\u5e38\u662fJSON\u683c\u5f0f\uff0c\u5305\u542b\u8bc6\u522b\u7684\u6587\u672c\u548c\u5176\u4ed6\u4fe1\u606f\u3002\u6839\u636eAPI\u6587\u6863\uff0c\u89e3\u6790\u6240\u9700\u7684\u4fe1\u606f\u5e76\u8fdb\u884c\u5904\u7406\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u89e3\u6790OCR API\u8fd4\u56de\u7684\u6570\u636e<\/p>\n<\/p>\n<p><p>OCR API\u8fd4\u56de\u7684\u6570\u636e\u7ed3\u6784\u901a\u5e38\u5305\u542b\u591a\u4e2a\u5b57\u6bb5\uff0c\u9700\u8981\u6839\u636e\u9700\u6c42\u63d0\u53d6\u548c\u5904\u7406\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u7406\u89e3\u6570\u636e\u7ed3\u6784<\/strong><\/li>\n<\/ol>\n<p><p>\u5728\u89e3\u6790\u8fd4\u56de\u6570\u636e\u4e4b\u524d\uff0c\u9700\u8981\u4ed4\u7ec6\u9605\u8bfbAPI\u6587\u6863\uff0c\u7406\u89e3\u8fd4\u56de\u6570\u636e\u7684\u7ed3\u6784\u3002\u4f8b\u5982\uff0cGoogle Cloud Vision API\u8fd4\u56de\u7684<code>text_annotations<\/code>\u5b57\u6bb5\u5305\u542b\u8bc6\u522b\u7684\u6587\u672c\u548c\u5176\u4f4d\u7f6e\u4fe1\u606f\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u63d0\u53d6\u6240\u9700\u4fe1\u606f<\/strong><\/li>\n<\/ol>\n<p><p>\u6839\u636e\u4e1a\u52a1\u9700\u6c42\uff0c\u4ece\u8fd4\u56de\u6570\u636e\u4e2d\u63d0\u53d6\u6240\u9700\u7684\u6587\u672c\u6216\u5176\u4ed6\u4fe1\u606f\u3002\u4f8b\u5982\uff0c\u63d0\u53d6\u8bc6\u522b\u7684\u6587\u672c\u3001\u4f4d\u7f6e\u4fe1\u606f\u3001\u7f6e\u4fe1\u5ea6\u7b49\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u5904\u7406\u548c\u5b58\u50a8<\/strong><\/li>\n<\/ol>\n<p><p>\u6839\u636e\u63d0\u53d6\u7684\u4fe1\u606f\u8fdb\u884c\u8fdb\u4e00\u6b65\u5904\u7406\uff0c\u5982\u6570\u636e\u6e05\u6d17\u3001\u683c\u5f0f\u8f6c\u6362\u3001\u5b58\u50a8\u5230\u6570\u636e\u5e93\u7b49\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001\u4f18\u5316OCR\u8bc6\u522b\u6548\u679c<\/p>\n<\/p>\n<p><p>\u4e3a\u4e86\u63d0\u9ad8OCR\u8bc6\u522b\u7684\u51c6\u786e\u6027\uff0c\u53ef\u4ee5\u91c7\u53d6\u4ee5\u4e0b\u63aa\u65bd\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u56fe\u50cf\u9884\u5904\u7406<\/strong><\/li>\n<\/ol>\n<p><p>\u5728OCR\u8bc6\u522b\u4e4b\u524d\uff0c\u5bf9\u56fe\u50cf\u8fdb\u884c\u9884\u5904\u7406\u53ef\u4ee5\u63d0\u9ad8\u8bc6\u522b\u6548\u679c\u3002\u4f8b\u5982\uff0c\u901a\u8fc7\u53bb\u566a\u3001\u4e8c\u503c\u5316\u3001\u65cb\u8f6c\u6821\u6b63\u7b49\u64cd\u4f5c\uff0c\u63d0\u9ad8\u56fe\u50cf\u7684\u6e05\u6670\u5ea6\u548c\u5bf9\u6bd4\u5ea6\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u9009\u62e9\u5408\u9002\u7684OCR\u670d\u52a1<\/strong><\/li>\n<\/ol>\n<p><p>\u4e0d\u540c\u7684OCR\u670d\u52a1\u5728\u8bc6\u522b\u6548\u679c\u548c\u652f\u6301\u7684\u8bed\u8a00\u4e0a\u53ef\u80fd\u6709\u6240\u4e0d\u540c\u3002\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u6700\u9002\u5408\u7684\u670d\u52a1\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u7ed3\u5408\u591a\u79cd\u6280\u672f<\/strong><\/li>\n<\/ol>\n<p><p>\u5728\u4e00\u4e9b\u590d\u6742\u573a\u666f\u4e0b\uff0c\u53ef\u4ee5\u7ed3\u5408\u591a\u79cd\u6280\u672f\u6765\u63d0\u9ad8\u8bc6\u522b\u6548\u679c\u3002\u4f8b\u5982\uff0c\u7ed3\u5408\u81ea\u7136\u8bed\u8a00\u5904\u7406\u6280\u672f\uff0c\u8fdb\u884c\u62fc\u5199\u6821\u6b63\u548c\u4e0a\u4e0b\u6587\u5206\u6790\u3002<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\u548c\u6280\u672f\u624b\u6bb5\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u4f7f\u7528Python\u8c03\u7528OCR API\uff0c\u5b9e\u73b0\u9ad8\u6548\u7684\u6587\u672c\u8bc6\u522b\u548c\u5904\u7406\u3002\u65e0\u8bba\u662f\u672c\u5730OCR\u5f15\u64ce\u8fd8\u662f\u4e91\u7aef\u670d\u52a1\uff0c\u9009\u62e9\u5408\u9002\u7684\u65b9\u6848\u5e76\u8fdb\u884c\u4f18\u5316\u90fd\u80fd\u663e\u8457\u63d0\u5347\u8bc6\u522b\u6548\u679c\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5b89\u88c5ocrapi\u5e93\uff1f<\/strong><br \/>\u8981\u5728Python\u4e2d\u4f7f\u7528ocrapi\uff0c\u60a8\u9700\u8981\u5148\u5b89\u88c5\u5b83\u3002\u53ef\u4ee5\u901a\u8fc7Python\u7684\u5305\u7ba1\u7406\u5de5\u5177pip\u6765\u5b8c\u6210\u5b89\u88c5\u3002\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a  <\/p>\n<pre><code class=\"language-bash\">pip install ocrapi\n<\/code><\/pre>\n<p>\u786e\u4fdd\u60a8\u7684Python\u73af\u5883\u5df2\u7ecf\u914d\u7f6e\u597d\uff0c\u5e76\u4e14pip\u5df2\u7ecf\u5b89\u88c5\u3002<\/p>\n<p><strong>ocrapi\u5e93\u7684\u4e3b\u8981\u529f\u80fd\u662f\u4ec0\u4e48\uff1f<\/strong><br \/>ocrapi\u5e93\u4e3b\u8981\u7528\u4e8e\u6587\u672c\u8bc6\u522b\u548c\u56fe\u50cf\u5904\u7406\u3002\u5b83\u80fd\u591f\u901a\u8fc7OCR\uff08\u5149\u5b66\u5b57\u7b26\u8bc6\u522b\uff09\u6280\u672f\uff0c\u4ece\u56fe\u50cf\u4e2d\u63d0\u53d6\u6587\u672c\u5185\u5bb9\u3002\u65e0\u8bba\u662f\u626b\u63cf\u7684\u6587\u6863\u3001\u7167\u7247\u4e2d\u7684\u6587\u5b57\uff0c\u8fd8\u662f\u5176\u4ed6\u5f62\u5f0f\u7684\u56fe\u50cf\uff0cocrapi\u90fd\u80fd\u6709\u6548\u5730\u8bc6\u522b\u5e76\u63d0\u53d6\u4fe1\u606f\uff0c\u65b9\u4fbf\u7528\u6237\u540e\u7eed\u7684\u6570\u636e\u5904\u7406\u548c\u5206\u6790\u3002<\/p>\n<p><strong>\u5982\u4f55\u4f7f\u7528ocrapi\u8fdb\u884c\u56fe\u50cf\u6587\u672c\u8bc6\u522b\uff1f<\/strong><br \/>\u4f7f\u7528ocrapi\u8fdb\u884c\u56fe\u50cf\u6587\u672c\u8bc6\u522b\u76f8\u5bf9\u7b80\u5355\u3002\u9996\u5148\uff0c\u60a8\u9700\u8981\u5bfc\u5165\u5e93\u5e76\u52a0\u8f7d\u5f85\u8bc6\u522b\u7684\u56fe\u50cf\u6587\u4ef6\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u57fa\u672c\u7684\u793a\u4f8b\u4ee3\u7801\uff1a  <\/p>\n<pre><code class=\"language-python\">import ocrapi\n\n# \u52a0\u8f7d\u56fe\u50cf\nimage_path = &#39;path\/to\/your\/image.jpg&#39;\ntext = ocrapi.recognize(image_path)\n\nprint(&quot;\u8bc6\u522b\u7684\u6587\u672c\u5185\u5bb9\u4e3a\uff1a&quot;, text)\n<\/code><\/pre>\n<p>\u786e\u4fdd\u60a8\u7684\u56fe\u50cf\u8def\u5f84\u662f\u6b63\u786e\u7684\uff0c\u5e76\u4e14\u56fe\u50cf\u8d28\u91cf\u826f\u597d\uff0c\u4ee5\u63d0\u9ad8\u8bc6\u522b\u51c6\u786e\u6027\u3002<\/p>\n<p><strong>ocrapi\u652f\u6301\u54ea\u4e9b\u56fe\u50cf\u683c\u5f0f\uff1f<\/strong><br \/>ocrapi\u901a\u5e38\u652f\u6301\u591a\u79cd\u5e38\u89c1\u7684\u56fe\u50cf\u683c\u5f0f\uff0c\u5982JPEG\u3001PNG\u3001BMP\u7b49\u3002\u4f7f\u7528\u65f6\uff0c\u8bf7\u786e\u4fdd\u6240\u5904\u7406\u7684\u56fe\u50cf\u683c\u5f0f\u662f\u88ab\u652f\u6301\u7684\uff0c\u4ee5\u4fbf\u83b7\u5f97\u6700\u4f73\u7684\u8bc6\u522b\u6548\u679c\u3002\u5bf9\u4e8e\u4e0d\u540c\u683c\u5f0f\u7684\u56fe\u50cf\uff0c\u8bc6\u522b\u6548\u679c\u53ef\u80fd\u4f1a\u6709\u6240\u4e0d\u540c\uff0c\u56e0\u6b64\u5728\u9009\u62e9\u56fe\u50cf\u65f6\u8981\u8003\u8651\u5230\u8fd9\u4e00\u70b9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u8c03\u7528OCR API\u7684\u65b9\u5f0f\u5305\u62ec\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93\u3001\u53d1\u9001HTTP\u8bf7\u6c42\u3001\u89e3\u6790\u8fd4\u56de\u6570\u636e\u7b49\u3002\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93\u53ef\u4ee5\u7b80\u5316\u8c03 [&hellip;]","protected":false},"author":3,"featured_media":948187,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/948183"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=948183"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/948183\/revisions"}],"predecessor-version":[{"id":948188,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/948183\/revisions\/948188"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/948187"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=948183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=948183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=948183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}