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 계열사의 등록 상표입니다.
최종 업데이트: 2024-08-22(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2024-08-22(UTC)"],[[["`TextRecognizer` identifies and extracts text within images."],["It offers both synchronous and asynchronous processing options."],["Concurrent use with varying language settings may impact performance."],["Direct use on the main thread is discouraged due to potential UI blocking."]]],["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"]]