Author Topic: Open DSLR raw file shows wrong pixel values  (Read 2975 times)

Offline CraigNZ

  • PixInsight Enthusiast
  • **
  • Posts: 94
Open DSLR raw file shows wrong pixel values
« on: 2015 July 08 23:47:54 »
I am using a Canon 60D and acquired some RAW images at ISO 800.
I set Format Explorer|DSLR_RAW to Pure Raw.

When I open a .cr2 file (canon raw) and use Process|Image|Statistics|14 bit setting it shows the mean as 528.6 and maximum as 3826.6

When I open the same image with AIP4WIN and again use RAW with no conversion I get mean as 2114.36 and maximum as 15307.

The AIP4WIN figures are correct.  These are the raw pixel values as verified by several other programs and makes sense because Canon has a bias of about 2000 on each pixel.  The max value is also correct because a saturated pixel will be just shy of 16383 the maximum value for a 14 bit camera.

So why is PI showing a completely different value?  I am guessing that it is applying several correction factors that appear in the cr2 file supplied by the camera rather than the real raw pixels.  I believe the fault is in DCRAW and maybe some setting not being set.  Maybe a Hint setting would fix this?

The reason I bring this up is because I took images at 30 sec, 60 sec and 300 sec and they all show the same detail after calibration, debayering and integration.  The statistics report shows the same values with a very slight difference.  That means there is no point in combining the images to expand the dynamic range because they are all the same.

I believe all the pre-processing of the raw images should be done with true raw pixel values so that down the stream we have the full dynamic range available using something like HDR.

Offline sharkmelley

  • PTeam Member
  • PixInsight Addict
  • ***
  • Posts: 241
    • Mark Shelley Astrophotography
Re: Open DSLR raw file shows wrong pixel values
« Reply #1 on: 2015 July 09 00:27:41 »
My experience with both 12 bit and 14 bit DSLR cameras is that if they are read as PureRaw and the stats are displayed as 16bit then I get exactly the pixel values I expect.

Mark
Takahashi Epsilon 180ED
H-alpha modified Sony A7S
http://www.markshelley.co.uk/Astronomy/

Offline CraigNZ

  • PixInsight Enthusiast
  • **
  • Posts: 94
Re: Open DSLR raw file shows wrong pixel values
« Reply #2 on: 2015 July 09 01:01:29 »
You are right .. I changed the setting from 14 bit to 16 bit and now the values look correct.  Though it is a 14 bit camera I guess because they are stored as 16 bit values the 14 bit setting was throwing off the calculation.  Thanks heaps for that.

Offline CraigNZ

  • PixInsight Enthusiast
  • **
  • Posts: 94
Re: Open DSLR raw file shows wrong pixel values
« Reply #3 on: 2015 July 09 01:05:19 »
I ran a quick test, using an image with 16 bit it showed max as 14787.  In 14 bit it showed 3696.  The difference of 2 bits is a divide by 4, so 14787 / 4 = 3696.  So setting the drop down box simply takes the pixel value and scales it by the number of bits selected.  That makes sense now.

astropixel

  • Guest
Re: Open DSLR raw file shows wrong pixel values
« Reply #4 on: 2015 July 09 02:47:39 »
These are the dcraw options with pure raw set in format explorer

Invoking: dcraw -4 -o 0 -D -t 0 -k 0 -H 1

from the dcraw man page

 -4     Linear 16-bit, same as -6 -W -g 1 1

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Open DSLR raw file shows wrong pixel values
« Reply #5 on: 2015 July 09 10:52:28 »
yes even though the A/D converters are 14-bit, the raw data is always 16 bits wide. ADU values should go from 0-16383.

rob