MLKitTextRecognitionCommon फ़्रेमवर्क रेफ़रंस के बारे में जानकारी
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
TextRecognizer
class TextRecognizer : NSObject
टेक्स्ट आइडेंटिफ़ायर, जो किसी इमेज में मौजूद टेक्स्ट की पहचान करता है.
-
दिए गए विकल्पों के साथ टेक्स्ट आइडेंटिफ़ायर दिखाता है.
अलग-अलग भाषा में कई TextRecognizer
इंस्टेंस का एक साथ इस्तेमाल
विकल्पों का सुझाव नहीं दिया जाता, क्योंकि इससे परफ़ॉर्मेंस में गिरावट आ सकती है.
एलान
Swift
class func textRecognizer(options: MLKCommonTextRecognizerOptions) -> Self
पैरामीटर
options
|
टेक्स्ट आइडेंटिफ़ायर को कॉन्फ़िगर करने के विकल्प.
|
रिटर्न वैल्यू
दिए गए विकल्पों के साथ कॉन्फ़िगर किया गया टेक्स्ट आइडेंटिफ़ायर.
-
टेक्स्ट की पहचान करने के लिए, दी गई इमेज को प्रोसेस करता है.
पैरामीटर
image
|
प्रोसेस करने के लिए इमेज.
|
completion
|
टेक्स्ट की पहचान पूरी हो जाने पर, मुख्य सूची में वापस कॉल करने के लिए हैंडलर.
|
-
दी गई इमेज में टेक्स्ट की पहचान करने वाला नतीजा दिखाता है या कोई गड़बड़ी होने पर nil
दिखाता है. टेक्स्ट
पहचान को कॉल करने वाले थ्रेड पर सिंक्रोनस रूप से किया जाता है.
हमारा सुझाव है कि यूज़र इंटरफ़ेस (यूआई) को ब्लॉक होने से बचाने के लिए, इस तरीके को मुख्य थ्रेड से बाहर रखें. बतौर
नतीजे के तौर पर, अगर इस तरीके को मुख्य थ्रेड पर कॉल किया जाता है, तो NSException
दिखता है.
पैरामीटर
image
|
|
error
|
नतीजे पाने में कोई गड़बड़ी होने पर, गड़बड़ी का एक वैकल्पिक पैरामीटर अपने-आप भर जाता है.
|
रिटर्न वैल्यू
टेक्स्ट की पहचान करने का नतीजा, दी गई इमेज में दिखता है. इसके अलावा, कोई गड़बड़ी होने पर nil
.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया."],[[["\u003cp\u003e\u003ccode\u003eTextRecognizer\u003c/code\u003e identifies and extracts text within images.\u003c/p\u003e\n"],["\u003cp\u003eIt offers both synchronous and asynchronous processing options.\u003c/p\u003e\n"],["\u003cp\u003eConcurrent use with varying language settings may impact performance.\u003c/p\u003e\n"],["\u003cp\u003eDirect use on the main thread is discouraged due to potential UI blocking.\u003c/p\u003e\n"]]],["The `TextRecognizer` class recognizes text in images. It can be initialized with specific options via `textRecognizer(options:)`. The `process(_:)` method performs text recognition on an image asynchronously, while `results(in:)` performs it synchronously, returning the recognized text or `nil` if an error occurs. Concurrent usage of multiple `TextRecognizer` instances with different language options may reduce performance. `results(in:)` should not be called on the main thread.\n"],null,["# MLKitTextRecognitionCommon Framework Reference\n\nTextRecognizer\n==============\n\n class TextRecognizer : NSObject\n\nA text recognizer that recognizes text in an image.\n- `\n ``\n ``\n `\n\n ### [textRecognizer(options:)](#/c:objc(cs)MLKTextRecognizer(cm)textRecognizerWithOptions:)\n\n `\n ` \n Returns a text recognizer with the given options.\n\n Concurrent usage of multiple `TextRecognizer` instances with different language\n options is not recommended, since it may lead to performance degradation. \n\n #### Declaration\n\n Swift \n\n class func textRecognizer(options: MLKCommonTextRecognizerOptions) -\u003e Self\n\n #### Parameters\n\n |-----------------|----------------------------------------------|\n | ` `*options*` ` | Options for configuring the text recognizer. |\n\n #### Return Value\n\n An text recognizer configured with the given options.\n- `\n ``\n ``\n `\n\n ### [process(_:)](#/c:objc(cs)MLKTextRecognizer(im)processImage:completion:)\n\n `\n ` \n Processes the given image for text recognition. \n\n #### Declaration\n\n Swift \n\n func process(_ image: ../Protocols.html#/c:objc(pl)MLKCompatibleImage) async throws -\u003e MLKText\n\n #### Parameters\n\n |--------------------|-------------------------------------------------------------------------|\n | ` `*image*` ` | The image to process. |\n | ` `*completion*` ` | Handler to call back on the main queue when text recognition completes. |\n\n- `\n ``\n ``\n `\n\n ### [results(in:)](#/c:objc(cs)MLKTextRecognizer(im)resultsInImage:error:)\n\n `\n ` \n Returns text recognition result in the given image or `nil` if there was an error. The text\n recognition is performed synchronously on the calling thread.\n\n It is advised to call this method off the main thread to avoid blocking the UI. As a\n result, an `NSException` is raised if this method is called on the main thread. \n\n #### Declaration\n\n Swift \n\n func results(in image: ../Protocols.html#/c:objc(pl)MLKCompatibleImage) throws -\u003e MLKText\n\n #### Parameters\n\n |---------------|-------------------------------------------------------------------------------|\n | ` `*image*` ` | The image to get results in. |\n | ` `*error*` ` | An optional error parameter populated when there is an error getting results. |\n\n #### Return Value\n\n Text recognition result in the given image or `nil` if there was an error."]]