MLKitVision フレームワーク リファレンス
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
VisionImage
ビジョン検出に使用される画像バッファまたは画像バッファ。
-
宣言
Swift
var orientation: Int32 { get set }
-
指定された画像で VisionImage
オブジェクトを初期化します。
パラメータ
image
|
ビジョン検出で使用する画像。画像を回転させる必要があるため、
imageOrientation プロパティが .up に設定されている。UIImage には NULL 以外の CGImage を指定する必要があります。
プロパティです。
|
戻り値
指定された画像の VisionImage
インスタンス。
-
指定された画像バッファで VisionImage
オブジェクトを初期化します。パフォーマンスを向上させるために、
初期化する際は、このクラスのインスタンス存続と数を最小限に抑えることをおすすめします。
CMSampleBufferRef
。
宣言
Swift
init(buffer sampleBuffer: CMSampleBuffer)
パラメータ
sampleBuffer
|
ビジョン検出で使用する画像バッファ。バッファは、
(圧縮データではない)ピクセル バッファであり、ピクセル形式は次のいずれかである必要があります。
- kCVPixelFormatType_32BGRA
- kCVPixelFormatType_420YpCbCr8BiPlanarFullRange
- kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange
使い方: スマートフォンのカメラの動画出力では機能しますが、他のカメラでは動作しません。
CMSampleBufferRef の任意のソース。
|
戻り値
指定された画像バッファを持つ VisionImage
インスタンス。
-
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は 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。"],[[["`VisionImage` is an object used for vision detection tasks, accepting images or image buffers as input."],["It's crucial to set the `imageOrientation` property of input `UIImage` to `.up` before initialization to ensure proper orientation."],["When using `CMSampleBufferRef` for initialization, ensure it's a pixel buffer with a supported pixel format like `kCVPixelFormatType_32BGRA` for optimal performance."],["For `CMSampleBufferRef` inputs, compatibility is primarily with phone camera output, not arbitrary buffer sources."],["Direct initialization using `init()` is unavailable; utilize `init(image:)` or `init(buffer:)` instead."]]],["`VisionImage` is a class for vision detection using images or image buffers. It has a settable `orientation` property, defaulting to `.up`. It initializes with either an `image`, requiring a rotated image with an `.up` orientation and a non-NULL `CGImage`, or a `CMSampleBuffer` image buffer with specified pixel formats. When using `CMSampleBufferRef`, minimize instance lifespan. Direct initialization using `init()` is unavailable.\n"]]