0

How can I binarize the pixels in a CMSampleBuffer received from:

- (void)captureOutput:(AVCaptureOutput *)captureOutput
didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
       fromConnection:(AVCaptureConnection *)connection {}

I am writing an app to recognize whenever a QR finder mark appears and I would prefer to use one of apple's Core Image filters.

mrplants
  • 657
  • 2
  • 9
  • 20

1 Answers1

0

Here's what I'd try first. Get the image. Here's an SO answer with some highly voted code to do that.

Pick from any number of image libraries to threshold the image. Here's an SO answer with a link to one that uses OpenGL ES for GPU acceleration.

Community
  • 1
  • 1
danh
  • 62,181
  • 10
  • 95
  • 136
  • iamgeFromSampleBuffer isn't a method in iOS. Also, I read that getting a UIImage from a pixel buffer is a fairly expensive operation. I'm looking to binarize and analyze these pixels in realtime. Is this possible without converting it into a UIImage and going from there? – mrplants Mar 26 '13 at 02:38
  • yeah - my bad, I was pasting lazily from elsewhere. See my edit, replacing that with a link. – danh Mar 26 '13 at 05:33