Example #1
0
        private void Start()
        {
            var allocationResult = CVPixelBuffer.TryCreate(fromTexture: _imageToClassify, result: out _cvPixelBuffer);

            if (allocationResult == CVReturn.Success)
            {
                _vision.EvaluateBuffer(_cvPixelBuffer.GetNativePtr(), ImageDataType.CoreVideoPixelBuffer);
            }
            else
            {
                Debug.LogError("Could not allocate CVPixelBuffer (" + allocationResult + ")");
            }
        }