DryOS - some success - page 8 - DryOS Development - CHDK Forum

DryOS - some success

  • 220 Replies
  • 158919 Views
*

Offline DDMan

  • *
  • 12
  • A720 IS
Re: DryOS - some success
« Reply #70 on: 08 / January / 2008, 05:36:49 »
Advertisements
Great work, Dataghost!

I like your "boot screen"! ;-)

Keep up the good work. Many camera users will thank you!  :D
A720 IS Firmware 1.00c

*

Offline lukg

  • ***
  • 162
  • Eos 450D+18-55is+55-250is & Powershot S5is - 1.01a
Re: DryOS - some success
« Reply #71 on: 08 / January / 2008, 12:19:16 »
mmm i can't see the video...anyway, great works!!! I read this thread everyday...my italian S5 is happy to know this progress!
byeee

*

Offline jeff666

  • ****
  • 181
  • A720IS
Re: DryOS - some success
« Reply #72 on: 08 / January / 2008, 19:56:52 »
Quote from: ewavr
Somewhere there is a function, which uses the strings "CRAW BUF", "CRAW BUF SIZE" (in A710 @0xFFEBC23C, in A720 @0xFFDAB204). 
Edit: Maxtrix size should be 3336x2480 (0xD08*0x9B0, can be found @0xFFDA3720). 3336*2480*10/8=10341600(0x9DCCE0). This is new matrix type for dcraw converter.

Ok. I looked at the firmware and share your insights, still I don't get the data I expected. Is it possible that valid raw data is only available at a very special moment?

Right now I call the save-raw-hook in the function that draws the preview-image (the one that is shown right after shooting and which disappears after some seconds) at 0xFFC4CC94 (I call the hook before this command).

A few things on the jumptable.
First entry is loc_FFC4CBAC. This is #0, no information on this one.
#1 is called on shoot
#3 seems to be the default when not doing anything.
#4 is called to display the preview (which I hook to save the raw-portion of the memory)
#5 is called to display the detailed preview (after pressing DISP)

I also found out that darkframe-subtraction is done in sub_FFC794E0. Some other things must happen there, since the camera crashes when I skip this call to avoid NR.

Back to raw: After shooting is done, I call save-raw, a file gets written, it has a reasonable length (about 10mb) but it doesn't contain the expected contents. I tried to load the file in RawTherapee and FastStone Viewer - both failed, then I looked for a signature ("HEAPCCDR") but it didn't occur anywhere in the file.

I modified the raw-location to save exactly 10mb from 0x10000000 on to see if the signature occurs earlier in memory - without success.

If anybody is interested in investigating, here's the file: http://www.zshare.net/download/6323281977facf/
The image itself should be completely overexposed and have few spots that aren't maxed out.

Cheers.

*

Offline OmniGhost

  • *
  • 3
  • [S5 IS]
Re: DryOS - some success
« Reply #73 on: 08 / January / 2008, 21:39:58 »
Jaems


*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: DryOS - some success
« Reply #74 on: 09 / January / 2008, 02:28:41 »
Back to raw: After shooting is done, I call save-raw, a file gets written, it has a reasonable length (about 10mb) but it doesn't contain the expected contents. I tried to load the file in RawTherapee and FastStone Viewer - both failed, then I looked for a signature ("HEAPCCDR") but it didn't occur anywhere in the file.
As Ewavr said: "This is a new matrix type for dcraw converter." So, no program should understand your raw. You should add the new size to dcraw source, compile it and try to convert to jpeg.
And there is no signature in raw-file from CHDK. It contains just the data from the sensor, not more. The "HEAPCCDR" - is for native Canon CRW-file.
CHDK Developer.

*

Offline DataGhost

  • ****
  • 314
  • EOS 40D, S5IS
    • DataGhost.com
Re: DryOS - some success
« Reply #75 on: 09 / January / 2008, 11:54:48 »
Well, I shot a few RAW images from my S5 :) I've never really worked with RAW images before (let alone dcraw), so I don't know if I'm doing it right... but it seems like I only get 'good' output when I set the top margin to 15 px (it should be 16 px according to the offset relative to the generated .jpg file, but I don't get *ANY* green except for in overexposed areas in that case, my image will be purple and I lose quite a bit of information when I do manage to get the colors somewhat correct). Actually, I do not see a positioning difference between 15 and 16 but I do still see a difference between these and the 'reference'. This is possibly caused by the sharpening the camera applies, though. Judge for yourself, I'll try setting it to 17 in a bit :) Anyway, even then, it's very green (is that supposed to happen?). It can be fixed by telling dcraw where to find something white, else it's a bit hard to fix... but I just need minor modifications afterwards, so that's fine, I guess :) .

RAW image converted to jpeg, set the white balance to something sensible, NO noise reduction (notice the hot pixels, especially in the dark areas), no shapening, and I made it a bit brighter.
'Reference' jpg image made by the camera, auto white balance (it's way off) and quite dark.
Settings: ISO 80, 1.6", F8. I should have shot with a lower F-number, I guess.. but it's a bit hard to tell through a live hexdump :p

About the RAW conversion strangeness:
top_margin=15 No whitebalance, no postprocessing (wall color is really close though, better than in my processed image, but the screen should be #FFFFFF)
top_margin=16 No whitebalance, no postprocessing. I don't know what causes this but it's clearly unusable. Possibly a misalignment (starts at byte 2 instead of byte 0 or vice versa?) but I'd expect it to be correct for even offsets, not for odd ones..


Adding support in dcraw was straightforward, just search for 'S3 IS', copy that part and paste it right below there, changing the appropriate values, so you'll end up with the following code:
Quote
} else if (!strcmp(model,"PowerShot S5 IS")) {
    height = 2448;
    width  = 3264;
    raw_height = 2480;
    raw_width  = 3336;
    top_margin  = 15;
    left_margin = 24;
    load_raw = &CLASS canon_a5_load_raw;
I *think* these margin values are correct, but it's mostly trial-and-error.

Also, you'll need to add the filesize to the table (located elsewhere, search for "S3 IS" again) so the file can be identified
Quote
    { 10341600, "Canon",    "PowerShot S5 IS",0 },

This might cause a problem though, but it's just minor. The offsets, sizes and such appear to be exactly the same as in the A720, so the only problem this will cause is that A720 files are identified as S5IS files. This shouldn't really matter, though, as I expect both cameras to generate the same data.
The above mentioned problems could also be caused by the canon_a5_load_raw function, but as I said, I don't know too much about RAW photography and I especially don't know how to interpret the sensor data (yet), so this will have to do.

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: DryOS - some success
« Reply #76 on: 09 / January / 2008, 12:59:06 »
Good work!
Can you also upload RAW file (zipped)?

*

Offline DataGhost

  • ****
  • 314
  • EOS 40D, S5IS
    • DataGhost.com
Re: DryOS - some success
« Reply #77 on: 09 / January / 2008, 13:59:16 »
Oh yes, of course. That's what I forgot :) There you go. It didn't compress that well, but it at least shaves 3MB off.

Edit: my dcraw.c might be useful as well.
« Last Edit: 09 / January / 2008, 14:10:29 by DataGhost »


*

Offline jeff666

  • ****
  • 181
  • A720IS
Re: DryOS - some success
« Reply #78 on: 09 / January / 2008, 19:06:22 »
Quote
my dcraw.c might be useful as well.

Very good.

While you are on it, could you have a look at the NR-handling? I'm back at work and don't have much time anymore.

If we control NR, we should have a (mostly) complete port of trunk and can start to port the changes to a newer branch with more features.

Cheers.

*

Offline DDMan

  • *
  • 12
  • A720 IS
Re: DryOS - some success
« Reply #79 on: 09 / January / 2008, 19:10:08 »
Hi Jeff,
could you maybe upload your latest CHDK port for the A720, so people like me can test things like DataGhosts findings.
I'm very anxious to see the port and will help as much as I can. By the way I'm a software developer as well, so if time allows it I will dive into programming too. ;-)
Thank you in advance!

Cheers and greetz from Fellbach at night ;-)
A720 IS Firmware 1.00c

 

Related Topics