Hi Vincenzo,

Besides getting an NSImage from the correct path in your app bundle, you'll 
have to get the pixel data.
An NSImage is an object that hides the raw pixel data from you, because of a 
display resolution independance purpose.

To access the pixel data, you have the choice between :
1. either getting an NSBimtmapImageRep
2. or creating a CGImage 
from your NSImage.
These 2 structures then have methods to copy their pixel data into a char or 
float array  (check the documentation of NSBitmapImageRep and Quartz Drawing, 
you may have to allocate inbetween a color space object).
It's fairly straightforward if you follow the documentation step by step.

An additional issue that you may have is that OpenCV expects BGR images instead 
of the usual RGB ordering. It seems a bit strange, but I didn't find any 
workaround (the cvCvtColor function does not modify the channel ordering 
property of teh IplImages).

Emmanuel_______________________________________________

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 arch...@mail-archive.com

Reply via email to