MLKitTextRecognitionCommon 프레임워크 참조
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
TextRecognizer
class TextRecognizer : NSObject
이미지 속 텍스트를 인식하는 텍스트 인식기입니다.
-
지정된 옵션과 함께 텍스트 인식기를 반환합니다.
서로 다른 언어로 여러 TextRecognizer
인스턴스를 동시에 사용
성능 저하를 일으킬 수 있으므로 사용하지 않는 것이 좋습니다.
선언
Swift
class func textRecognizer(options: MLKCommonTextRecognizerOptions) -> Self
반환 값
특정 옵션으로 구성된 텍스트 인식기입니다.
-
텍스트 인식을 위해 제공된 이미지를 처리합니다.
매개변수
image
|
|
completion
|
텍스트 인식이 완료되면 기본 큐에서 콜백하는 핸들러입니다.
|
-
제공된 이미지의 텍스트 인식 결과를 반환하거나 오류가 발생한 경우 nil
를 반환합니다. 텍스트
호출 스레드에서 동기식으로 수행됩니다.
UI 차단을 방지하려면 기본 스레드 외부에서 이 메서드를 호출하는 것이 좋습니다.
결과에서 이 메서드가 기본 스레드에서 호출되면 NSException
이 발생합니다.
매개변수
image
|
|
error
|
결과를 가져오는 중에 오류가 발생하면 채워지는 선택적 오류 매개변수입니다.
|
반환 값
제공된 이미지의 텍스트 인식 결과 또는 오류가 발생한 경우 nil
입니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 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."]]