Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Opening camera with specific format/mode?



Hi Alex,

Sorry for being late to the thread, but.

<shameless-plug>

My company produces a commercial IIDC driver that provides support for Bayer cameras. You can download it here:

   <http://www.ioxperts.com/products/industrial.html>

</shameless-plug>

At 7:50 PM -0500 10/24/05, Alex Majora wrote:
I have a couple of Firewire IIDC video cameras that I need to operate in format 7 mode 0 for full-res 12-bit YUV 411 video (otherwise they put out a low-res monochrome video stream). And, they use a Bayer filter array (not sure which one yet).

We don't have a specific API for setting the camera mode, but based on the requested image size and compression type, you can determine what mode the driver will use.


What is the modern QT approach to programmatically opening a camera in a specific format/mode? Is there any QT accommodation for Bayer? (I understand the standard sequence grabber paradigm, but don't know how to handle these things.)

Quicktime can support any data format, providing the proper constants have been defined. After several years of attempting to get Apple to define four character codes for the IIDC native types, we have defined our own. They are:


YUV formats:

 kIIDCYUV411Format = 'UYV1',   // uyyv yyuy yvyy (8 pixels)
 kIIDCYUV422Format = 'UYV2',   // uyvy uyvy uyvy (6 pixels)
 kIIDCYUV444Format = 'UYV4'    // uyvu yvuy vuyv (4 pixels)

 #define kIIDCYUV411CompressionTypeName  "IIDC YUV 4:1:1"
 #define kIIDCYUV422CompressionTypeName  "IIDC YUV 4:2:2"
 #define kIIDCYUV444CompressionTypeName  "IIDC YUV 4:4:4"

Grayscale formats:

 k8GrayCodecType  = 'b08g' // 8-bit direct gray (black = 0, white = 255)
 k12GrayCodecType = 'b12g'

 #define k8GrayCompressTypeName   "8-bit Gray"
 #define k12GrayCompressTypeName  "12-bit Gray"
 #define k16GrayCompressTypeName  "16-bit Gray"

Bayer formats:

 k8BayerRGBCodecType  = FOUR_CHAR_CODE('b08B'),
 k12BayerRGBCodecType = FOUR_CHAR_CODE('b12B'),
 k16BayerRGBCodecType = FOUR_CHAR_CODE('b16B'),

The Bayer format requires an ImageDescription extension:

 kBayerRGBImageDescriptionExtension  = FOUR_CHAR_CODE('Bayr')

Which is an OSType indicating the color order:

 kBayerRGGBPixelType = FOUR_CHAR_CODE('RGGB'),
 kBayerGBRGPixelType = FOUR_CHAR_CODE('GBRG'),
 kBayerGRBGPixelType = FOUR_CHAR_CODE('GRBG'),
 kBayerBGGRPixelType = FOUR_CHAR_CODE('BGGR')

NOTE: Since the IIDC specification cleverly (NOT!) specifies that cameras producing <16 bits/channel right-justify the data rather than left-justify as QuickTime does, we may need to add a 2nd ImageDescription to indicate so that the decode knows how many bits to shift the data to get full range on decode.

Other vendors are welcome to use these types -- we just got tired of waiting for Apple to bless constants and needed to ship something.

Note that while kIIDCYUV422Format has the same byte order as '2vuy', it is not the same format as the ranges are different -- IIDC cameras return full range data (y=[0..255], u,v=[-127..+127]) while '2vuy' is "video range" (y=[16..240], u,v=[16..236]), so that conversion from the IIDC types to '2vuy' is lossy.

The 12-bit Bayer and Grayscale types are the 12-bit types returned by Optronics cameras.

We provide transcoder components to convert the IIDC types to 'yuv2', which can be done losslessly and a simple Bayer<->RGB transcoder.

By allowing an application to request Bayer as a compression type, you can record a movie in raw Bayer to be decoded at playback.

The current Bayer codec is a simple 2x2/3x3, but because the format is documented, we are hoping that someone will develop a higher quality Codec using some of the publicly available algorithms.

I'm not sure what type of camera you're using, but if it's not directly supported, we can add it in relatively short order. (The problem w/supporting Industrial cameras is that we don't have infinite budget to buy test cameras -- and, unfortunately, every camera has it's own weirdnesses)

HTH,

-Steve

--
_________________________________________________________________________
Steve Sisak, CTO                                 email@hidden
IOXperts, Inc.                                     voice: +1 617 876-2572
87 Bristol St #3A                                    fax: +1 617 876-2337
Cambridge, MA 02139                               mobile: +1 617 388-6476
_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-api/email@hidden

This email sent to email@hidden
References: 
 >Opening camera with specific format/mode? (From: "Alex Majora" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.