Good news everyone, I think I fixed the raw output.
So here is the diff:
diff --git a/platform/ixus500_elph520hs/platform_camera.h b/platform/ixus500_elph520hs/platform_camera.h
index 88a09c3..a40ab39 100644
--- a/platform/ixus500_elph520hs/platform_camera.h
+++ b/platform/ixus500_elph520hs/platform_camera.h
@@ -27,8 +27,8 @@
#define CAM_DRYOS_2_3_R39 1 // Defined for cameras with DryOS version R39 or higher
#define CAM_DRYOS_2_3_R47 1 // Defined for cameras with DryOS version R47 or higher
- #define CAM_RAW_ROWPIX 4704 // Found @0xff92def4 a810
- #define CAM_RAW_ROWS 3504 // Found @0xff92df00 a810
+ #define CAM_RAW_ROWPIX 3808 // Found @0xff160d0c
+ #define CAM_RAW_ROWS 2796 // Found @0xff160d14
#undef CAM_UNCACHED_BIT
#define CAM_UNCACHED_BIT 0x40000000 // Found @0xff832e74 a810
@@ -45,7 +45,7 @@
#undef CAM_SENSOR_BITS_PER_PIXEL
#define CAM_SENSOR_BITS_PER_PIXEL 12
- #define cam_CFAPattern 0x01000201 // [Green Blue Red Green]
+ #define cam_CFAPattern 0x02010100 // [Red Green Green Blue]
#define CAM_COLORMATRIX1 \
827547, 1000000, -290458, 1000000, -126086, 1000000, \
For the record, this is my build script:
#!/bin/sh
set -x
set -e
dump=PRIMARY.BIN
get_fi(){
xxd -l16 -u -plain -s$1 $dump
}
pushd chdk_trunk
git clean -fdx
mkdir -p bin CHDK/MODULES
popd
cat <<EOF > chdk_trunk/platform/fi2.inc
FI2KEY=$(get_fi 0xFF3CE0)
FI2IV =$(get_fi 0x629F2C)
EOF
pushd chdk_nafraf/
git clean -fdx
popd
cp $dump chdk_nafraf/platform/ixus500_elph520hs/
cp -r chdk_nafraf/loader/ixus500_elph520hs chdk_trunk/loader/
cp -r chdk_nafraf/platform/ixus500_elph520hs chdk_trunk/platform/
pushd chdk_trunk
make PLATFORM=ixus500_elph520hs PLATFORMSUB=101a OPT_FI2=1 firzipsubcomplete
popd
rm -rf img
unzip -d img chdk_trunk/bin/ixus500_elph520hs-101a-1.3.0-0-full.zip
(and then I sync img to the micro sd)
But a few comments:
- I'm using nafraf/chdk @ r753 and chdk/trunk @ r3765 because I was unable to rebase properly this code (way too much changes)
- The colormatrix is probably wrong, but I have no idea how to define it.
- The specifications states the following lens information: "4.0 - 48.0 mm (35 mm equivalent: 28 - 336 mm)", so I tried
#define CAM_DNG_LENS_INFO { 28,1, 336,1, 34,10, 56,10 }
instead of
#define CAM_DNG_LENS_INFO { 40,10, 480,10, 34,10, 56,10 }
but it seems darktable isn't able to correct the fisheye effect anyway.
- The preview in the DNG seems to be broken somehow (bottom slice shows garbage)
Anyway, here is what the raw looks like in darktable:
http://lucy.pkh.me/chdk-ixus500hs/CRW_4453.jpgAnd here is what the IXUS outputs:
http://lucy.pkh.me/chdk-ixus500hs/IMG_4453.JPGWe can observe a few things:
- There is a left black bar and a smaller top one. These black bars just looks like obstructed areas (raising the light shows noise)
- There is a very marked fisheye effect
- There is a lot more noise (expected I guess)
- The colors are definitely differents
I can probably upload more examples...