MLKitSegmentationCommon Framework リファレンス
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
セグメンタ
class Segmenter : NSObject
入力画像のセグメンテーションを行う検出機能。
-
宣言
Swift
class func segmenter(options: MLKCommonSegmenterOptions) -> Self
戻り値
指定されたオプションで構成されたセグメンタ。
-
-
指定された画像をセグメンテーションのために処理します。
パラメータ
image
|
|
completion
|
セグメンテーション マスクまたはエラーを使用してメインスレッドでコールバックするハンドラ。
|
-
指定された画像のセグメンテーション マスクを返します。エラーが発生した場合は nil
を返します。セグメンテーション
呼び出し側のスレッドで同期的に実行されます。
UI をブロックしないよう、このメソッドはメインスレッドの外部で呼び出すことをおすすめします。その結果、このメソッドがメインスレッドで呼び出されると、NSException
がスローされます。
パラメータ
image
|
|
error
|
結果の取得中にエラーが発生した場合に入力されるオプションのエラー パラメータ。
|
戻り値
指定された画像のセグメンテーション マスク。エラーが発生した場合は nil
です。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は 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"]]