PDA

View Full Version : Weird behavior of PixelFormat



padu
August 31, 2007, 21:11:27
I'm trying to access data in an imagebuffer. I had some success doing that by following the tutorials, but I'm finding some irregular behavior with the component. Here's what I am doing:

-drop an ICImagingControl on the form
-set the device property with my camera (DFx 21AF04) with video format UYVY and 15.00002 fps (that's the default)
-add a textbox to the form
-add a button to livestart it
-add a button with the following code


TIS.Imaging.ImageBuffer buffer = icImagingControl1.ImageActiveBuffer;

textBox1.Text =
"ImageBitsPerPixel = " + icImagingControl1.ImageBitsPerPixel + Environment.NewLine +
"VideoFormat = " + icImagingControl1.VideoFormat + Environment.NewLine +
"MemoryPixelFormat = " + icImagingControl1.MemoryPixelFormat + Environment.NewLine +
"MemoryCurrentGrabberColorFormat = " + icImagingControl1.MemoryCurrentGrabberColorformat + Environment.NewLine +
"buffer BitsPerPixel = " + buffer.BitsPerPixel;

When I run the application, livestart the video and click on the button above, I get the following text:

ImageBitsPerPixel = 24
VideoFormat = UYVY (640x480)
MemoryPixelFormat = Format24bppRgb
MemoryCurrentGrabberColorFormat = ICRGB24
buffer BitsPerPixel = 32

In another application, I have the grabber color format set for ICRGB24 as well, but the buffer bits per pixel is 16 (I saw a reference to UYVY inside the buffer component while debugging)...

Why and how do I synchronize the pixelformat of icImagingControl and ImageBuffer?

Thanks!

Sascha Schmidt
September 3, 2007, 14:26:09
Hallo,

This is a known bug, which will be fixed in the next update.

Simply write before .LiveStart():


icImagingControl1.MemoryCurrentGrabberColorformat = TIS.Imaging.ICImagingControlColorformats.ICRGB24;

Then the output will be correct and the pixelformats of the imagebuffers and icImagingcontrol are synchronized:

ImageBitsPerPixel = 24
VideoFormat = UYVY (768x576)
MemoryPixelFormat = Format24bppRgb
MemoryCurrentGrabberColorFormat = ICRGB24
buffer BitsPerPixel = 24