What do you want to do with you captured images ? Just display them or record them ?

If you just want to display it, you should use an NSOpenGLView and draw the CVBuffer or the CIImage directly. If this is for recording or processing the pixels (without CoreImage), you can try to generate a CVPixelBuffer (using the ARGB pixel format) instead of CVOpenGLTextureBuffer.

You can do this using QTPixelBufferContextCreate() instead of QTOpenGLTextureContextCreate() to create your drawing context. A CVPixelBuffer allow you to access directly to the bitmapData (without using CIImage and NSBitmapImageRep).

You can check the QTPixelBufferVCToCGImage sample code to see how to setup this kind of context.


Le 25 avr. 08 à 16:49, Raphael Sebbe a écrit :

Hi,
how do you "convert" CIImage to NSBitmapImageRep ?

Raphael

On Fri, Apr 25, 2008 at 4:34 PM, Nick Forge <[EMAIL PROTECTED]> wrote:

I am working on a Computer Vision project that uses real-time image
processing. I am grabbing frames using QTKit, then converting the resulting
CVImageBufferRef into a CIImage, and then converting that into an
NSBitmapImageRep. I know that my resulting NSBitmapImageRep is fine, since I am viewing it by sticking it in an NSImage and then popping that into an NSImageView (the QTKit Capture Preview has a 1/2 second lag time - which is unacceptable for this project). Everything works as it should, but when I go
to grab the raw pixel data from the NSBitmapImageRep like so:

unsigned char *bitmapData = [self bitmapData];

(btw it says "self" because this is from a category of NSBitmapImageRep)

The resulting array, bitmapData, is an array of zeroes! Every pixel sample in bitmapData is zero, yet I can draw the image and the image IS there.
What's going on? Any suggestions as to what I may be overlooking?

Thanks in advance,
Nick Forge
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/raphael.sebbe%40gmail.com

This email sent to [EMAIL PROTECTED]

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/devlists%40shadowlab.org

This email sent to [EMAIL PROTECTED]


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to