Re: capture bufffer structure

From: Reto Aebersold <aeber1_at_hti.bfh.ch>
Date: Wed 13 Apr 2005 - 12:51:55 CEST
Message-ID: <425CF9CB.6080708@hti.bfh.ch>

Hi Damien,

Thanks a lot for your answer and IIDC spec.
I looked at the coriander sources and used it to grab some pictures. The
problem is, that coriander doesn't show the RGB modes supported by my
cam. It just uses YUV and converts even RGB data into YUV to draw it on
SDL. If I look at my capture buffer while capturing a pure red image
(and just print out some ints in hex from the capture buffer), I always
see something like this:

0x50B75079
0x4FB84E7A
0x4DB84E7C
0x50B84E7B
0x52B7527E

I think it this is something like '? R G B'. For the first line it could
be R:B7 G:50 B:79, but I don't know what the first byte shloud be? In
the IIDC spec it should be RGBR GBRG BRGB. But it is always the same
pattern in all ints.
Do you have any clue?

Thanks a lot!

aeby

Damien Douxchamps wrote:

>Hi aeby,
>
>On Mon, 2005-04-11 at 19:06 +0200, Reto Aebersold wrote:
>
>
>>Hi all,
>>
>>I try to make a simple DMA transfer. I'm able to setup the camera and
>>grab a frame, but I don't know how to read correctly the RGB pixel
>>values from the capture buffer. How is the buffer organized? If I try to
>>write the image to a ppm file, I see the captured picture 4 times and
>>with incorrect colors.
>>How should I write the data correctly to the file? Below the code to
>>store the image to a file and my DMA setup.
>>
>>
>
>You can look at the sources or coriander to see how it is handled. Since
>the specs might help too I have sent you a copy of the IIDC specs in a
>personal email.
>
>Damien
>
>
>
>>Thanks a lot,
>>aeby
>>
>>//DMA setup
>>int format = FORMAT_SVGA_NONCOMPRESSED_1;
>>int mode = MODE_800x600_RGB;
>>int frameRate = FRAMERATE_15;
>>dc1394_dma_setup_capture( raw1394Handle, cameraNodes[0], channel,
>>format, mode, speed, frameRate, 8, 1, device, &dc1394Camera );
>>
>>
>>// Write to file
>>fprintf(imagefile,"P6\n%u %u\n# %s\n255\n", dc1394Camera.frame_width,
>>dc1394Camera.frame_height, "Test image" );
>>for ( int i = 0; i < dc1394Camera.frame_height*dc1394Camera.frame_width;
>>i++) {
>> unsigned char val = dc1394Camera.capture_buffer[i] >> 16;
>> fwrite(&val, 1, 1, imagefile );
>> val = dc1394Camera.capture_buffer[i] >> 8;
>> fwrite(&val, 1, 1, imagefile );
>> val = dc1394Camera.capture_buffer[i];
>> fwrite(&val, 1, 1, imagefile );
>>}
>>
>>
>>-------------------------------------------------------
>>SF email is sponsored by - The IT Product Guide
>>Read honest & candid reviews on hundreds of IT Products from real users.
>>Discover which products truly live up to the hype. Start reading now.
>>http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
>>_______________________________________________
>>mailing list Linux1394-user@lists.sourceforge.net
>>https://lists.sourceforge.net/lists/listinfo/linux1394-user
>>
>>
>>

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
mailing list Linux1394-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux1394-user
Received on Wed Apr 13 12:53:51 2005

This archive was generated by hypermail 2.1.8 : Mon 02 May 2005 - 09:16:53 CEST