MLKitSegmentation공통 프레임워크 참조
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
세그먼터
class Segmenter : NSObject
입력 이미지를 세분화하는 감지기입니다.
-
선언
Swift
class func segmenter(options: MLKCommonSegmenterOptions) -> Self
반환 값
특정 옵션으로 구성된 분류 기준입니다.
-
사용할 수 없습니다. 클래스 메서드를 사용합니다.
-
매개변수
image
|
|
completion
|
세분화 마스크 또는 오류를 사용하여 기본 스레드에서 콜백하는 핸들러입니다.
|
-
지정된 이미지의 세분화 마스크를 반환하거나 오류가 발생한 경우 nil
를 반환합니다. 세분화
호출 스레드에서 동기식으로 수행됩니다.
UI 차단을 방지하려면 기본 스레드 외부에서 이 메서드를 호출하는 것이 좋습니다.
결과에서 이 메서드가 기본 스레드에서 호출되면 NSException
이 발생합니다.
매개변수
image
|
|
error
|
결과를 가져오는 중에 오류가 발생하면 채워지는 선택적 오류 매개변수입니다.
|
반환 값
지정된 이미지의 세분화 마스크 또는 오류가 있는 경우 nil
입니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-10-15(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-10-15(UTC)"],[[["The `Segmenter` class performs segmentation on input images to identify different regions or objects."],["It provides methods for asynchronous and synchronous processing of images for segmentation."],["You can configure the segmenter using `MLKCommonSegmenterOptions` when initializing."],["Results are provided as an `MLKSegmentationMask` object which can be used to understand the identified segments."],["Direct instantiation with `init` is unavailable; use the provided class methods like `segmenter(options:)` instead."]]],["The `Segmenter` class performs image segmentation. It's initialized using `segmenter(options:)` with `MLKCommonSegmenterOptions`. Segmentation is achieved via `process(_:)`, which asynchronously processes an image and returns an `MLKSegmentationMask`. Alternatively, `results(in:)` synchronously returns the segmentation mask, but it must be called off the main thread to prevent UI blocking; it also takes an image as an input and return a `MLKSegmentationMask`. Direct initialization via `init` is unavailable.\n"]]