MLKitVision फ़्रेमवर्क रेफ़रंस
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
VisionImage
दृष्टि का पता लगाने के लिए इस्तेमाल की जाने वाली इमेज या इमेज बफ़र.
-
इमेज का डिसप्ले ओरिएंटेशन. डिफ़ॉल्ट वैल्यू .up
है.
एलान
Swift
var orientation: Int32 { get set }
-
दी गई इमेज के साथ VisionImage
ऑब्जेक्ट शुरू करता है.
पैरामीटर
image
|
दृष्टि का पता लगाने के लिए इस्तेमाल की जाने वाली इमेज. दी गई चित्र को घुमाना चाहिए, ताकि इसका
imageOrientation प्रॉपर्टी को .up पर सेट किया गया है. UIImage में CGImage शून्य होना चाहिए
प्रॉपर्टी.
|
रिटर्न वैल्यू
दी गई इमेज के साथ VisionImage
इंस्टेंस.
-
दिए गए इमेज बफ़र के साथ VisionImage
ऑब्जेक्ट शुरू करता है. परफ़ॉर्मेंस को बेहतर बनाने के लिए,
के साथ शुरू करते समय इस क्लास के जीवनकाल और इसकी संख्या को कम करने का सुझाव दिया जाता है
CMSampleBufferRef
.
एलान
Swift
init(buffer sampleBuffer: CMSampleBuffer)
पैरामीटर
sampleBuffer
|
दृष्टि का पता लगाने के लिए इमेज बफ़र. बफ़र इस पर आधारित होना चाहिए
पिक्सल बफ़र (कंप्रेस किया गया डेटा नहीं) है और पिक्सल का फ़ॉर्मैट इनमें से एक होना चाहिए:
- kCVPixelFormatType_32BGRA
- kCVPixelFormatType_420YpCbCr8BiPlanarFullRange
- kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange
इस्तेमाल: यह सुविधा फ़ोन के कैमरे के वीडियो आउटपुट के साथ काम करती है. हालांकि, यह किसी अन्य डिवाइस के साथ काम नहीं करती
CMSampleBufferRef के आर्बिट्रेरी सोर्स.
|
रिटर्न वैल्यू
दिए गए इमेज बफ़र के साथ VisionImage
इंस्टेंस.
-
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-25 (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"]],["आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया."],[[["\u003cp\u003e\u003ccode\u003eVisionImage\u003c/code\u003e is an object used for vision detection tasks, accepting images or image buffers as input.\u003c/p\u003e\n"],["\u003cp\u003eIt's crucial to set the \u003ccode\u003eimageOrientation\u003c/code\u003e property of input \u003ccode\u003eUIImage\u003c/code\u003e to \u003ccode\u003e.up\u003c/code\u003e before initialization to ensure proper orientation.\u003c/p\u003e\n"],["\u003cp\u003eWhen using \u003ccode\u003eCMSampleBufferRef\u003c/code\u003e for initialization, ensure it's a pixel buffer with a supported pixel format like \u003ccode\u003ekCVPixelFormatType_32BGRA\u003c/code\u003e for optimal performance.\u003c/p\u003e\n"],["\u003cp\u003eFor \u003ccode\u003eCMSampleBufferRef\u003c/code\u003e inputs, compatibility is primarily with phone camera output, not arbitrary buffer sources.\u003c/p\u003e\n"],["\u003cp\u003eDirect initialization using \u003ccode\u003einit()\u003c/code\u003e is unavailable; utilize \u003ccode\u003einit(image:)\u003c/code\u003e or \u003ccode\u003einit(buffer:)\u003c/code\u003e instead.\u003c/p\u003e\n"]]],["`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"],null,[]]