Questions tagged [cvpixelbuffer]

159 questions
2
votes
1 answer

Manipulating CVPixelBufferRef Height and Width

I am using GPUImage library function to manipulate height and width of CVPixelbuffer. I am recording a video in portrait and when the user rotates the device my screen adjusts itself to a landscape mode. I want landscape frame to be aspect fit in…
Leena
  • 2,678
  • 1
  • 30
  • 43
2
votes
1 answer

Limit of referenced CVPixelBuffer coming from the iOS camera

I have an app where I use to keep frames (CVPixelBuffer) coming from the iOS camera. I use the delegate method -(void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer (CMSampleBufferRef)sampleBuffer…
focs
  • 182
  • 2
  • 10
1
vote
0 answers

CVPixelBufferCreateWithIOSurface: Get pixels from IOSurfaceRef

I'm trying to create a CVPixelBufferRef from an IOSurfaceRef in order to be able to read its pixels values. The IOSurfaceRef is read from the Syphon (website and repo) framework's SyphonOpenGLClient. My code is inspired from the Simple Client…
Benoît Lahoz
  • 1,270
  • 1
  • 18
  • 43
1
vote
2 answers

Fit CVPixelBuffer into a square image with resizing and aspect ratio saving

I have an image that should be preprocessed before passing to CoreML to 640x640 square with resizing and saving aspect ratio (check the image). I found a lot of helpful links about resizing using vImageScale_*, but haven't found anything similar to…
Nikita Ermolenko
  • 2,139
  • 2
  • 19
  • 41
1
vote
0 answers

Xcode13: "Cannot convert value of type 'CVPixelBuffer' to expected argument type"

I'm a very novice coder, and I'm working on my first CoreML project, where I use an Image Classification model. I used some tutorials online, and I converted the uploaded image to a CV pixel buffer. This is my code: let model = classifier() …
1
vote
1 answer

Modifying CVPixelBuffer

I'm using the method below to add drawings to a pixel buffer, then append it to an AVAssetWriterInputPixelBufferAdaptor. It works on my Mac mini (macOS 12 beta 7), but the drawingHandler draws nothing on my MacBook (macOS 11.5.2). Is there anything…
scchn
  • 315
  • 3
  • 16
1
vote
0 answers

Flutter(Objective-C) Camera: processing and showing processed live-preview cvPixelBuffer doesn't work?

Im working on extending existing flutter cameraPlugin for IOS.. What do I basically need: catch live-preview frame. process it (in my case apply some openCV logic), return UIImage convert it into the CvPixelBuffer and return it to the…
1
vote
0 answers

Extract images of face and eyes using ARKit via the ARFrame's CVPixelBuffer?

I am currently tracking faces using ARKit. ARKit knows the world coordinates of the face and the user's eyes via leftEyeTransform and rightEyeTransform. I can get the live pixelbuffer via faceNode.transform = node.transform guard let…
DevDevDev
  • 5,107
  • 7
  • 55
  • 87
1
vote
0 answers

Converting MTLTexture to CVPixelBuffer, Error AGX: Texture read/write assertion failed: bytes_per_row >= used_bytes_per_row

I am getting an error from the graphics driver while converting the EnvironmentTexture(from ARKIT.AREnvironmentProbeAnchor) to CVPixelBuffer. The EnvironmentTexture is an IMTLTexture. I am using Xamarin.iOS. This is the code that I use to convert…
bonnie m
  • 11
  • 2
1
vote
4 answers

Reduce memory usage of AVAssetWriter

As the title says, I am having some trouble with AVAssetWriter and memory. Some notes about my environment/requirements: I am NOT using ARC, but if there is a way to simply use it and get it all working I'm all for it. My attempts have not made any…
jontelang
  • 589
  • 4
  • 17
1
vote
0 answers

What's the most efficient way from raw pixels to a PixelBuffer?

I'm receiving raw pixels of an image and successfully transforming them into a CGImage with the following function: func imageFromTexturePixels(raw: UnsafePointer, w: Int, h: Int) -> CGImage? { // 4 bytes(rgba channels) for each pixel …
Sergi Mansilla
  • 12,495
  • 10
  • 39
  • 48
1
vote
0 answers

iOS app getting crash when frequent draw CGContext using CGImage, which create from [UInt8] data

Right now i am developing one module in that module i need to create video from array CGImage and while doing that processing my application get crashed at some point , i am not able to figure out exact reason behind that crash. can anyone please…
1
vote
1 answer

How to run tflite model with ARKit session captured image?

I have a tflite model and I want to run model using ARKit session captured image. It's showing source pixel format is invalid. I was able to run tflite model using AVCapture session: // Not working with ARKit frame func session(_ session: ARSession,…
Nowfal E Salam
  • 181
  • 1
  • 4
1
vote
1 answer

Distorted video output from CGBitmapContext and CVPixelBuffer

I've been trying to debug (for days now) this code to produce a video from CGImages. The CGImages actually get created from CGBitMapContext's I draw into in the app code. I've simplified here to simply draw a diagonal yellow line and draw a number…
Alex Bollbach
  • 4,370
  • 9
  • 32
  • 80
1
vote
1 answer

Question regarding UIImage -> CVPixelBuffer -> UIImage conversion

I am working on a simple denoising POC in SwiftUI where I want to: Load an input image Apply a CoreML model (denoising) to the input image Display the output image I have something working based on dozens of source codes I found online. Based on…
Vincent Garcia
  • 635
  • 10
  • 19