סימוכין ל-MLKitVision Framework
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
VisionImage
תמונה או מאגר נתונים זמני של תמונות המשמשים לזיהוי ראייה.
-
כיוון התצוגה של התמונה. ערך ברירת המחדל הוא .up
.
הצהרה
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
עם מאגר הנתונים הזמני של התמונות.
-
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 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"]]