Canon A590 IS RAW average merge goes awry (truncated?) - General Help and Assistance on using CHDK stable releases - CHDK Forum

Canon A590 IS RAW average merge goes awry (truncated?)

  • 11 Replies
  • 4851 Views
Canon A590 IS RAW average merge goes awry (truncated?)
« on: 02 / December / 2008, 11:07:24 »
Advertisements
When I join/merge RAW files with the average function, in order to create a raw image with less noise, the resulting file is smaller then the input RAW files (9.987.840 bytes, instead of 10.341.600, thus 350K smaller!). The merged files aren't recognized by either Rawtherapee nor DNG4PS (with whatever extension I tried).
It looks like the header or something is missing???

Cam: A590 IS 1.01B
Autobuild build 0.8.7, revision 613.
I tried to average 2, 4 and 10 raw images.

Is this a bug? And anyone any idea how to fix this?

Re: Canon A590 IS RAW average merge goes awry (truncated?)
« Reply #1 on: 02 / December / 2008, 11:28:15 »
Some additional info:
I made one raw picture, and merged it (in the cam) with itself (with a copy of itself that is). When I compare the input raw file with the merged one I saw that the last 353760 bytes are indeed missing in the merged raw (the rest of the file is identical). Is the header of the raw situated here at the end of the file?
What is teh best place to report this issue?

*

Offline fe50

  • ******
  • 3115
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Re: Canon A590 IS RAW average merge goes awry (truncated?)
« Reply #2 on: 02 / December / 2008, 15:29:07 »
...What is teh best place to report this issue?

Hi Stanislas,
you can also report it here: CHDK Bugtracker.

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: Canon A590 IS RAW average merge goes awry (truncated?)
« Reply #3 on: 04 / December / 2008, 04:15:06 »
Because comeone wrote in camera.h:

#elif defined (CAMERA_a590)
    #define CAM_RAW_ROWPIX              3264 //3336   // for new 8 MP
    #define CAM_RAW_ROWS                2448 //2490    // for new 8 MP

But 3264x2448 is JPEG size, not RAW size.


Re: Canon A590 IS RAW average merge goes awry (truncated?)
« Reply #4 on: 04 / December / 2008, 05:33:33 »
Aha, that solves the problem, except one thing:

If I calculate the RAW size from the sensor size:
3336x2490 (10bits/pixel) ==> = 10.383.300 bytes

BUT:
The size of the raws is 10.341.600, which is the same as:
3336x2480 (10bits) ==> 10.341.600 bytes

So it appears that the actual sensor size should be 3336x2480. The same as with the PowerShot S5 IS and A720. Maybe this confusion has led soemone to experiment and change the values to teh JPG valus of the sensor, as the 3336x2490 might not work?
By using the A720 parameters in DNG4PS-2, I get perfect results from raw files. Could this imply that the same as values the A720 can be used in the A590 section of camera.h? If so, the DNG option could become active?  I understand that the CAM_COLORMATRIX1  values might get some optimization for the A590?
What would you advice me to do? Download the trunk, change, cross-compile, test and report back?

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: Canon A590 IS RAW average merge goes awry (truncated?)
« Reply #5 on: 04 / December / 2008, 05:53:14 »
i checked in the new sizes now (into svn, autobuild will build soon).
please test if raw merge, sum & average works now (and update the bugtracker as well please).

since you seem to have some understanding of chdk in regards to the code, and also of raw and calibrating using dng-4ps, you can perhaps provide the needed data for camera.h to make dng work for a590.
the defines for a590 in camera.h seem to be a bit odd anyway, for example can you check if muting the mic really is possible on the a590?

Re: Canon A590 IS RAW average merge goes awry (truncated?)
« Reply #6 on: 04 / December / 2008, 07:19:11 »
I did some initial testing. I'll do some calibration work, and I'll soon update the values for that.
The cam does not mute during video zoom. I assumed that the CAM_CAN_MUTE_MICROPHONE is related to that, correct?

This is what I've tested and changed/added:

Code: [Select]
#define CAM_PROPSET                 2
#define CAM_DRYOS                   1

#define CAM_RAW_ROWPIX              3336   // for new 8 MP
#define CAM_RAW_ROWS                2480   // for new 8 MP

#define CAM_USE_ZOOM_FOR_MF         1      // Zoom lever can be used for manual focus adjustments

// cannot mute during video-zoom through CHDK, it can mute in general firmware settings (non CHDK)
#undef  CAM_CAN_MUTE_MICROPHONE            // Camera has no function to mute microphone

#define CAM_HAS_IRIS_DIAPHRAGM      1      // it has a 6 blade iris diaphragm
#undef  CAM_HAS_ND_FILTER

#define CAM_HAS_MANUAL_FOCUS        1      // Camera has manual focus mode

#define CAM_AF_SCAN_DURING_VIDEO_RECORD 1   // Camera adapts focus in video recording
#define CAM_EV_IN_VIDEO             1      // cam can change exposure in video mode
#define DNG_SUPPORT                 1
// pattern
// It has indeed Green Blue Red Green, so that makes 01 00 02 01
#define cam_CFAPattern 0x01000201 // Green  Blue  Red  Green
// color
// Needs some work on these values
#define CAM_COLORMATRIX1                               \
640019, 1000000, -220031, 1000000, -96241, 1000000,  \
-77419,  1000000, 639766,  1000000,  44009, 1000000,  \
17965,  1000000, 78396,   1000000, 231868, 1000000

#define cam_CalibrationIlluminant1 1 // Daylight
// cropping
#define CAM_JPEG_WIDTH  3264
#define CAM_JPEG_HEIGHT 2448
#define CAM_ACTIVE_AREA_X1 10
#define CAM_ACTIVE_AREA_Y1 8
#define CAM_ACTIVE_AREA_X2 3302
#define CAM_ACTIVE_AREA_Y2 2474

// camera name
#define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData


*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: Canon A590 IS RAW average merge goes awry (truncated?)
« Reply #7 on: 04 / December / 2008, 08:07:22 »
looks ok to me now. as soon as ur finished calibrating one of the devs can check it into svn.


Re: Canon A590 IS RAW average merge goes awry (truncated?)
« Reply #8 on: 04 / December / 2008, 10:25:17 »
The best matching colormatrix of the A590 IS that I could make with a freshly calibrated monitor, a carefully taken picture (daylight setting) and the DNG4PS tool. Results verified with dcraw and with PS CS3 (acr4.0).

#define CAM_COLORMATRIX1                               \
0.647380, 1000000, -0.169846, 1000000, -0.115337, 1000000, \
-0.011566, 1000000, 0.451223, 1000000, 0.013279, 1000000, \
0.062541, 1000000, 0.054140, 1000000, 0.161148, 1000000
« Last Edit: 04 / December / 2008, 10:31:33 by Stanislas »

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: Canon A590 IS RAW average merge goes awry (truncated?)
« Reply #9 on: 05 / December / 2008, 00:51:09 »
checked it into #617. please test and report back :)

 

Related Topics