VideoCameraController for color image processing (Feature #2072)
Description
Extend VideoCameraController to support color image processing
History
Updated by Eduard Feicho over 12 years ago
charu hans wrote:
Extend VideoCameraController to support color image processing
I looked into it a bit for finding a way to display the color image after processing the grayscale plane without copying data. In theory, there should be no problem, as you can get the base address like:
void *baseAddress = CVPixelBufferGetBaseAddress(imageBuffer);
and then later something like:
CGContextRef context = CGBitmapContextCreate(baseAddress, width, height, 8, 4*width, colorSpace, kCGBitmapByteOrder32Little | kCGImageAlphaNoneSkipLast);
But it seems that you cannot create a Quartz Image with YUV colorspace. Basically, we would need like CGColorSpaceCreateDeviceYUV, but there's only
CGColorSpaceCreateDeviceRGB or CGColorSpaceCreateDeviceGray.
I am not sure if the combination "kCGBitmapByteOrder32Little | kCGImageAlphaNoneSkipLast" is correct, but I guess it always expects RGBA or ARGB or alike.
Thus, for the moment, we would need to manually convert YUV to RGB in the camera.
Updated by charu hans over 12 years ago
Added a support for Color Image Processing, Have a look here http://code.opencv.org/svn/gsoc2012/ios/trunk/RealtimeBallTracking/
Basically, this project track tennis ball in realtime. I have modified Eduard code to to color processing.
- Status changed from Open to Done
- % Done changed from 0 to 100