fujifilm finepix s series - page 5 - Non-CANON cameras development - CHDK Forum supplierdeeply

fujifilm finepix s series

  • 113 Replies
  • 68615 Views
*

Offline apass

  • *
  • 10
Re: fujifilm finepix s series
« Reply #40 on: 12 / July / 2013, 17:27:03 »
Advertisements
I believe I cracked the DSCO format!!
As far as I can say, it seems the picture is organized as:

G0 R0 G1 R1 G2 R2
B0 G0 B1 G1 B2 G2
G3 R3 G4 R4 G5 R5
B3 G3 B4 G4 B5 G5

And they seem to be in raw format (4040x3030) - i.e. before color space correction / histogram / gamma adjustments.
And I believe the CCD12 raw format has the same mapping but with 12 bits per value, coded as little endian 2 bytes.
The final image has a resolution 2 times larger than what you get from these files, so maybe an interpolation is done to get the full picture.
Now it will be interesting to find out if the CFAI file contains some color calibration info in the header (as I saw that the file size is a bit larger than for a 4040x3030 image)

Re: fujifilm finepix s series
« Reply #41 on: 12 / July / 2013, 19:48:16 »
I believe I cracked the DSCO format!!
As far as I can say, it seems the picture is organized as:

G0 R0 G1 R1 G2 R2
B0 G0 B1 G1 B2 G2
G3 R3 G4 R4 G5 R5
B3 G3 B4 G4 B5 G5

And they seem to be in raw format (4040x3030) - i.e. before color space correction / histogram / gamma adjustments.
And I believe the CCD12 raw format has the same mapping but with 12 bits per value, coded as little endian 2 bytes.
The final image has a resolution 2 times larger than what you get from these files, so maybe an interpolation is done to get the full picture.
Now it will be interesting to find out if the CFAI file contains some color calibration info in the header (as I saw that the file size is a bit larger than for a 4040x3030 image)

The "interpolation" you mention is called demosaicing.  I don't mean to offend you, but it still appears that you're confused about how image sensors work, so I'll give a brief explanation.

An image sensor consists of a matrix of light-sensitive elements called photosites.  Individual photosites can only measure luminosity, not color.  In order to allow an image sensor to capture color images, the sensor is overlaid with a color filter array, such as the Bayer filter.  This filter allows light with only specific colors to reach each photosite.  Using the data generated from the light captured by each photosite, along with information about the color filter array, we can apply demosaicing and combine the individual colors captured by each photosite of the sensor into a full-color image.

Given the information you've discovered about the CCD12 format, the next thing to do is to write a program to convert that data into a 16-bit TIFF (or better yet, a 12-bit DNG file), so that it can be opened in a raw image processing program for further processing.

--DragonLord
« Last Edit: 12 / July / 2013, 20:03:56 by DragonLord »
Other online communities I'm in: Stack Exchange - Wikipedia - Pentax Forums

*

Offline apass

  • *
  • 10
Re: fujifilm finepix s series
« Reply #42 on: 13 / July / 2013, 01:55:25 »
No offence taken - I know about demosaicing and perfectly understand the process. The surprize (let's surprize) is that unlike displays, the stated camera resolution is the real sensor resolution! For a display having 800x480, when you get to the real TFT transisors on the display glass you'll seee 2400x480 pixels because each true color pixels consists of 3 distinct subpixels. This is what I expected also forthe image sensor - each final pixel to be formed from 4 subpixels corresponding to the 4 filters of the bayer pattern. Apparently this is not the case! And usual sources like wikipedia are not emphasizeing this enough / at all.

P.S. for spelling errors, blame the ebook reader.

*

Offline a1ex

  • *****
  • 671
  • ML dev
Re: fujifilm finepix s series
« Reply #43 on: 13 / July / 2013, 17:20:03 »
@DragonLord,

Image pitch is 8080, vertical resolution is 3030. Can you post a sample taken with lens cap on? It should be helpful in identifying the bit order.

edit: it's 16-bit GBRG, not 12-bit, and has a black bar at the bottom. Black level 132, white 4095.

It should look somewhat like this, right?



DNG

Now, homework for you: find out the color matrix (maybe from raw files from a similar fuji camera, or by doing the math so it looks like a jpeg). I took the one from 5D Mark II, which obviously is not quite right.
« Last Edit: 13 / July / 2013, 18:22:22 by a1ex »


Re: fujifilm finepix s series
« Reply #44 on: 13 / July / 2013, 19:07:58 »
@DragonLord,

Image pitch is 8080, vertical resolution is 3030. Can you post a sample taken with lens cap on? It should be helpful in identifying the bit order.

edit: it's 16-bit GBRG, not 12-bit, and has a black bar at the bottom. Black level 132, white 4095.

It should look somewhat like this, right?



DNG

Now, homework for you: find out the color matrix (maybe from raw files from a similar fuji camera, or by doing the math so it looks like a jpeg). I took the one from 5D Mark II, which obviously is not quite right.

Yes, this image looks correct—but the color saturation is very low.  The wall behind the dragon should be a bright yellow to orange.

Unfortunately, I don't have a JPEG copy of this image (the camera does not support simultaneous RAW+JPEG capture), and I don't have access to a X-Rite (GretagMacbeth) ColorChecker or similar color profiling equipment.

The attached PP3 sidecar file (for use with RawTherapee 4.0.11) is about as close as I can get to a correct color rendition.  Contrast and saturation (and especially saturation) had to be significantly increased to produce a reasonably vivid output.

Edit: PP3 adjusted to make the image slightly warmer (by 150 K).  The result is closer to the actual scene—the table is supposed to be off-white, with a tiny beige tint, not pure white.

Edit 2: The image shows lots of defective pixels when viewed at 100%.  The camera generates a dark frame with exposures longer than 2s, which is subtracted for JPEGs, but is stored in a separate "DSCB" file when in Take12BitCCDRawImage mode.

--DragonLord
« Last Edit: 14 / July / 2013, 01:13:48 by DragonLord »
Other online communities I'm in: Stack Exchange - Wikipedia - Pentax Forums

*

Offline apass

  • *
  • 10
Re: fujifilm finepix s series
« Reply #45 on: 15 / July / 2013, 07:33:54 »
Unfortunately, I don't have a JPEG copy of this image (the camera does not support simultaneous RAW+JPEG capture), and I don't have access to a X-Rite (GretagMacbeth) ColorChecker or similar color profiling equipment.
You can use as a reference the 8 bit DSCO image - as far as I've seen, after compensating for the number of bits, the 12 bit and 8 bit images look the same. So I guess you could extrapolate for the 12 bit color matrix from the 8 bit DSCO image.

A point / feature request for Alex - if you're building an application to convert the raw images - could you create a format configuration file where we can edit / create new formats? I mean - to make the application as universal as possible, not just for S1800. The format configuration should consist on something like:

// comments with double slash
file_size1(bytes), resolution_X1 x resolution_Y1, header1(bytes)
file_size2(bytes), resolution_X2 x resolution_Y2, header2(bytes)

file_sizen(bytes), resolution_Xn x resolution_Yn, headern(bytes)
n_bits // number of bits pe pixel
scale_x, scale_y
G, R // GL GH RL RH for more than 8 bits per pixel
B, G // BL BH GL GH

so, for instance, for the 8 bit DSCO from fuji S1800 the format configurationwould look like:
12241200, 4040x3030, 0 //12241200 bytes, 4040x3030 resolution, 0 bytes in header
8 //8 bits / pixel
1,1 // since there are only 8 bits per pixels, no scaling between file size and picture size is needed
G, R
B, G

for the 12 bit DSCO image the format would be:
24482400, 4040x3030, 0 //24482400 bytes, 4040x3030 resolution, 0 bytes in header
12 //12 bits / pixel
2,1 // since there are 12 bits / pixel we need to compensate the file size / image size
GL, GH, RL, RH // L and H letters order designate little / big endian
BL, BH, GL, GH

Valid entries for the CFA can by something like R, G, B, Y, Cb, Cr, 0 (if you'de like to skip the value - this is good when trying to crack the format) and the matrix size is not fixed.
So for YRGB file the matrix would loog like
1, 1.5 // so scale 1 on the horizontal, 1.5 on the vertical - i.e. 2 vertical pixels are constructed with 3 bytes
Y, Y
Cb, Cr
Y, Y

You could add in the format configuration file also the color conversion values after the CFA matrix.
A problem that I could see with the format is how to specify the CFA when the RAW format packs 2 pixels in 3 bytes for 12 bits / pixel.
An application that can be configured like this would be a real helper - you could use it basically to convert a variety of RAW files, from different cameras, not only from fuji S1800! You could use it also to try to hack the format!

Anyway - for my purposes I'll build one that saves PNGs (for 16 bit support) in matlab so I have easy access to interpolation algorithms and PNG support (it can be deployed as a standalone application, but not the happiest implementation).

Re: fujifilm finepix s series
« Reply #46 on: 17 / July / 2013, 15:04:03 »
Any progress? I'd really like to see some open source code here.

--DragonLord
Other online communities I'm in: Stack Exchange - Wikipedia - Pentax Forums

Re: fujifilm finepix s series
« Reply #47 on: 22 / July / 2013, 10:14:17 »
Bump: Is there any progress?
Other online communities I'm in: Stack Exchange - Wikipedia - Pentax Forums


Re: fujifilm finepix s series
« Reply #48 on: 24 / August / 2013, 10:51:15 »
Bump: Is there any progress?

Bump Bump
I trust in you

Re: fujifilm finepix s series
« Reply #49 on: 02 / September / 2013, 02:31:46 »
Any progress? Have a Fujifim s1600 and waiting for a FHDK. ;) :-X

 

Related Topics