探索自主培训、应用场景、参考架构和代码示例,并了解有关如何使用和连接 Google Cloud 服务的示例。
培训
培训和教程
OCR 教程
您将了解如何在 Google Cloud Platform 上执行光学字符识别 (OCR)。本教程演示如何将图片文件上传到 Google Cloud Storage、使用 Google Cloud Vision API 从图片中提取文本、使用 Google Cloud Translation API 翻译文本以及将译文保存回 Cloud Storage。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-25。"],[],[],null,["# Cloud Vision API documentation\n==============================\n\n[Read product documentation](/vision/docs/features-list)\nCloud Vision API allows developers to easily integrate vision\ndetection features within applications, including image labeling, face and\nlandmark detection, optical character recognition (OCR), and tagging of\nexplicit content.\n| - Need a customized solution? Vertex AI lets you train an [AutoML model](/vertex-ai/docs/beginner/beginners-guide) or [custom model](/vertex-ai/docs/start/training-guide) for computer vision objectives like image classification and object detection.\n| - Building a mobile device app? Try [ML\n| Kit for Firebase](//firebase.google.com/docs/ml-kit/), which provides platform-specific Android and iOS SDKs for using Cloud Vision services, as well as on-device ML Vision APIs and on-device inference using custom ML models.\n[Get started for free](https://console.cloud.google.com/freetrial) \n\n#### Start your proof of concept with $300 in free credit\n\n- Get access to Gemini 2.0 Flash Thinking\n- Free monthly usage of popular products, including AI APIs and BigQuery\n- No automatic charges, no commitment \n[View free product offers](/free/docs/free-cloud-features#free-tier) \n\n#### Keep exploring with 20+ always-free products\n\n\nAccess 20+ free products for common use cases, including AI APIs, VMs, data warehouses,\nand more.\n\nDocumentation resources\n-----------------------\n\nFind quickstarts and guides, review key references, and get help with common issues. \nformat_list_numbered\n\n### Guides\n\n-\n\n [Set up the Vision API](/vision/docs/setup)\n\n-\n\n\n Quickstarts:\n [Quickstart: Detect labels in an image by using client libraries](/vision/docs/detect-labels-image-client-libraries)\n or\n [Quickstart: Detect labels in an image by using the Cloud Vision API](/vision/docs/detect-labels-image-api)\n\n\n-\n\n [Detect text in images](/vision/docs/ocr)\n\n-\n\n [Detect text in files (PDF/TIFF)](/vision/docs/pdf)\n\n-\n\n [Detect handwriting in images](/vision/docs/handwriting)\n\n-\n\n [Detect faces](/vision/docs/detecting-faces)\n\nfind_in_page\n\n### Reference\n\n-\n\n [gcloud vision command-line](/sdk/gcloud/reference/ml/vision)\n\n-\n\n [REST API](/vision/docs/reference/rest)\n\n-\n\n [RPC API](/vision/docs/reference/rpc)\n\ninfo\n\n### Resources\n\n-\n\n [Pricing](/vision/pricing)\n\n-\n\n [Quotas and limits](/vision/quotas)\n\n-\n\n [Release notes](/vision/docs/release-notes)\n\n-\n\n [Languages](/vision/docs/languages)\n\nRelated resources\n-----------------\n\nTraining and tutorials \nCode samples \nExplore self-paced training, use cases, reference architectures, and code samples with examples of how to use and connect Google Cloud services. Training \nTraining and tutorials\n\n### OCR tutorial\n\n\nLearn how to perform optical character recognition (OCR) on Google Cloud Platform. This tutorial demonstrates how to upload image files to Google Cloud Storage, extract text from the images using the Google Cloud Vision API, translate the text using the Google Cloud Translation API, and save your translations back to Cloud Storage.\n\n\n[Learn more](/functions/docs/tutorials/ocr) \nTraining \nTraining and tutorials\n\n### Create a simple Hello, World! function in the console\n\n\nQuickly deploy your first function without any local setup.\n\n\n[Learn more](https://console.cloud.google.com/functions/add) \nTraining \nTraining and tutorials\n\n### Big data and ML fundamentals\n\n\nThis one-day instructor-led class introduces participants to the big data and machine learning capabilities of Google Cloud. It provides a quick overview of Google Cloud and a deeper dive into the data processing capabilities.\n\n\n[Learn more](http://cloud.google.com/training/course/data-ml-fundamentals) \nTraining \nTraining and tutorials\n\n### Detect text in images by connecting Functions, Storage, Vision API, Pub/Sub, and the Translation API\n\n\nReact to Cloud Storage changes with a function that processes an image using the Vision API to extract text and then pass it to other services.\n\n\n[Learn more](/functions/docs/tutorials/ocr) \nTraining \nTraining and tutorials\n\n### Automated Classification of Data Uploaded to Cloud Storage with the DLP API and Cloud Functions\n\n\nAutomatically classify data uploaded to Cloud Storage using Pub/Sub, Cloud Functions, and the Data Loss Prevention API.\n\n\n[Learn more](https://codelabs.developers.google.com/codelabs/cloud-storage-dlp-functions/index.html) \nCode sample \nCode Samples\n\n### Annotating multiple images in a single request and storing output in Cloud Storage\n\n\nRun offline (asynchronous) detection services and annotation of a large batch of image files using any Vision feature type.\n\nJava Node.js Python Ruby\n\n\u003cbr /\u003e\n\n[Learn more](/vision/docs/batch) \nCode sample \nCode Samples\n\n### Setting a storage and processing location for OCR requests\n\n\nSet a specific region to store and process resources used for an Optical Character Recognition (OCR) request.\n\nC# Go Java Node.js PHP Python Ruby\n\n\u003cbr /\u003e\n\n[Learn more](/vision/docs/pdf#regionalization) \nCode sample \nCode Samples\n\n### Detecting and blurring offensive image content\n\n\nDemonstrates using the Google Cloud Vision API and ImageMagick to detect and blur offensive images that get uploaded to a Cloud Storage bucket.\n\nNode.js Python Go Java\n\n\u003cbr /\u003e\n\n[Learn more](/functions/docs/tutorials/imagemagick) \nCode sample \nCode Samples\n\n### Translating and speaking text from a photo with glossaries (Advanced)\n\n\nUse Vision API, Translation API, Text-to-Speech API to detect text in an image, personalize translations, and generate synthetic speech from the translated text.\n\nPython\n\n\u003cbr /\u003e\n\n[Learn more](/translate/docs/advanced/hybrid-glossaries-tutorial) \nCode sample \nCode Samples\n\n### Detect text in an image (OCR) and draw a border around the found text\n\n\nUse Vision API to identify text in an image, and then annotate an image based on the text that is detected.\n\nPython\n\n\u003cbr /\u003e\n\n[Learn more](/vision/docs/fulltext-annotations)\n\nRelated videos\n--------------\n\n### Try Cloud Vision API for yourself\n\nCreate an account to evaluate how our products perform in real-world scenarios. \nNew customers also get $300 in free credits to run, test, and deploy workloads. \n[Try Cloud Vision API free](https://console.cloud.google.com/freetrial)"]]