مرجع چارچوب MLKitVision
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
MLKVisionImage
یک بافر تصویر یا تصویر که برای تشخیص بینایی استفاده می شود.
جهت نمایش تصویر پیش فرض .up
است.
اعلامیه
هدف-C
@property (nonatomic) int orientation;
یک شی VisionImage
را با تصویر داده شده راه اندازی می کند.
اعلامیه
هدف-C
- (nonnull instancetype)initWithImage:(id)image;
پارامترها
image | تصویر برای استفاده در تشخیص بینایی تصویر داده شده باید چرخانده شود، بنابراین ویژگی imageOrientation آن روی .up تنظیم می شود. UIImage باید دارای ویژگی CGImage غیر NULL باشد. |
ارزش بازگشتی
یک نمونه VisionImage
با تصویر داده شده.
یک شی VisionImage
را با بافر تصویر داده شده راه اندازی می کند. برای بهبود عملکرد، توصیه می شود که طول عمر و تعداد نمونه های این کلاس را هنگام مقداردهی اولیه با یک CMSampleBufferRef
به حداقل برسانید.
اعلامیه
هدف-C
- (nonnull instancetype)initWithBuffer:(nonnull CMSampleBufferRef)sampleBuffer;
پارامترها
sampleBuffer | بافر تصویر برای استفاده در تشخیص بینایی بافر باید بر اساس یک بافر پیکسل (نه داده های فشرده) باشد، و قالب پیکسل باید یکی از موارد زیر باشد: - kCVPixelFormatType_32BGRA - kCVPixelFormatType_420YpCbCr8BiPlanarFullRange - kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange با این تمرین کار می کند قرار دادن دوربین گوشی، اما نه دیگر منابع دلخواه CMSampleBufferRef s. |
ارزش بازگشتی
یک نمونه VisionImage
با بافر تصویر داده شده.
اعلامیه
هدف-C
- (nonnull instancetype)init;
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2024-11-14 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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-11-14 بهوقت ساعت هماهنگ جهانی."],[[["`MLKVisionImage` is an object used for vision detection tasks, accepting either images or image buffers as input."],["It's crucial to set the `imageOrientation` property of input `UIImage` to `.up` and ensure it has a non-NULL `CGImage`."],["When using `CMSampleBufferRef`, the buffer must contain uncompressed pixel data in specific supported formats."],["For performance, minimize the creation and lifespan of `MLKVisionImage` instances, especially when initialized with `CMSampleBufferRef`."],["`MLKVisionImage` offers a property `orientation` to specify the display orientation of the image, defaulting to `.up`."]]],["`MLKVisionImage` is used for vision detection, handling images or image buffers. Key actions include initializing an object with `initWithImage:`, accepting an image where the `imageOrientation` property is set to `.up`, or initializing with `initWithBuffer:`, accepting a `CMSampleBufferRef`. The `orientation` property defines the display orientation, defaulting to `.up`. Initialization using `init` alone is unavailable. For buffer initialization, specific pixel formats are required for proper function, such as `kCVPixelFormatType_32BGRA`.\n"]]