RAW format - RAW Shooting and Processing - CHDK Forum

RAW format

  • 0 Replies
  • 2394 Views
*

Offline littlejohn

  • *
  • 35
  • Ixus 860is
RAW format
« on: 02 / September / 2008, 11:41:48 »
Advertisements
Hi,

I'm trying to apply Gaussian smoothing filter on a CHDK RAW file.
The filter is pretty simple: each pixel is assigned to be the weighted average of its neighbors and itself.
But in my experiment the filtered image does not have a correct color.
The following is a basic routine to extract data from CHDK's RAW.
Code: [Select]
for (i=0, src=0; i<CAM_RAW_ROWPIX; i+=8, src+=10)
{
           row[i+0]=((0x3fc&(((unsigned short)rawrow[src+1])<<2)) | (rawrow[src+0] >> 6));
           row[i+1]=((0x3f0&(((unsigned short)rawrow[src+0])<<4)) | (rawrow[src+3] >> 4));
           row[i+2]=((0x3c0&(((unsigned short)rawrow[src+3])<<6)) | (rawrow[src+2] >> 2));
           row[i+3]=((0x300&(((unsigned short)rawrow[src+2])<<8)) | (rawrow[src+5]));
           row[i+4]=((0x3fc&(((unsigned short)rawrow[src+4])<<2)) | (rawrow[src+7] >> 6));
           row[i+5]=((0x3f0&(((unsigned short)rawrow[src+7])<<4)) | (rawrow[src+6] >> 4));
           row[i+6]=((0x3c0&(((unsigned short)rawrow[src+6])<<6)) | (rawrow[src+9] >> 2));
           row[i+7]=((0x300&(((unsigned short)rawrow[src+9])<<8)) | (rawrow[src+8]));
}
To my knowledge, each row[j] is between 0~1023 (10 bits long).
Can anyone tell me the format of this 10-bit data?
(I'm not sure if I was going the right way.)
Any help is appreciated, thanks!  :)

*Edit: I've got the sensor matrix from the forum, thanks! I'll try it again*
« Last Edit: 02 / September / 2008, 14:01:58 by littlejohn »

 

Related Topics