RAW related functions for the scripts - page 3 - Feature Requests - CHDK Forum

RAW related functions for the scripts

  • 26 Replies
  • 13199 Views
*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: RAW related functions for the scripts
« Reply #20 on: 23 / November / 2008, 07:02:46 »
Advertisements
Actually... now that I think of it, if merge start/add/end are separate, one can't write a speed optimized script for averaged or summed timelapse.

I mean, someone might want to take 8 images 10 minutes apart and sum or average the resulting RAW files. The optimal way (in terms of time and required disk space) is to loop [shoot, merge RAW, delete RAW, sleep] and then end merge.

This could be fun for shooting moon at night, for instance, resulting in a summed image with 10 moons at different positions of its track.

*

Offline reyalp

  • ******
  • 14125
Re: RAW related functions for the scripts
« Reply #21 on: 23 / November / 2008, 21:30:32 »
Fudgey, good point. It's trivial to write a higher level lua wrapper if you want to do it all in one step, but not the reverse.
Don't forget what the H stands for.

Re: RAW related functions for the scripts
« Reply #22 on: 24 / November / 2008, 02:58:15 »
I agree. The more flexibility lua has the better!
The idea of a moon 'sum-timelapse' left me drooling :) When you add a startup timer (so you do not even have to be awake when the shooting starts), maybe regularly increasing and then decreasing exposure with the maximum exposure when the moon is at the highest you could really get a stunning photo in the morning with all the processing done in the camera!
You are trying to get a nice photo of a building in a very busy square/street but the people keep getting in the way? No problem! Average a 16 photos 10 seconds apart and no more people :)
So, when can we expect these new functions in the trunk, for all the people to enjoy?  :D

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: RAW related functions for the scripts
« Reply #23 on: 24 / November / 2008, 13:05:54 »
The idea of a moon 'sum-timelapse' left me drooling :) When you add a startup timer (so you do not even have to be awake when the shooting starts), maybe regularly increasing and then decreasing exposure with the maximum exposure when the moon is at the highest you could really get a stunning photo in the morning with all the processing done in the camera!
You are trying to get a nice photo of a building in a very busy square/street but the people keep getting in the way? No problem! Average a 16 photos 10 seconds apart and no more people :)

Well, both of these are really better processed out of camera using specialized software, but this in-camera script will be fun and easy to play with and gives an instant result so it's definitely worth doing... especially since nobody's forcing us to delete the raws and jpegs of individual frames... just make raw and jpeg deletion optional and the in-camera precessed version will function as a good preview and save time in deciding which series to process in greater detail.

*

Offline reyalp

  • ******
  • 14125
Re: RAW related functions for the scripts
« Reply #24 on: 26 / November / 2008, 22:53:58 »
Code: [Select]
dir = os.listdir("A/DCIM/100CANON", false)
raw = dir[table.getn(dir)]
Just a warning: I wouldn't rely on any particular order in the table returned by listdir. You also don't need to pass false, since a missing argument is implicitly nil.
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 14125
Re: RAW related functions for the scripts
« Reply #25 on: 27 / November / 2008, 02:13:12 »
Checking in. 594
set_raw_develop("filename") -- develop raw on next shot. If filename is nil (or omitted), any pending raw develop is canceled.
raw_merge_start(operation) -- operation is a number: 0=sum 1=average. Other=error.
raw_merge_add("filename") -- merge a file.
raw_merge_end() -- complete merge operation.

Notes
- Error checking is minimal. If you pass an invalid filename, things may silently fail. If you call raw_merge_add or raw_merge_end without calling start first, or call raw_merge_start multiple times without an intervening end, the results are undefined.
- The raw merge stuff runs in the same task as the script (the keyhook task), while raw operations from the menu run from the spytask. This appears to work, but it's a bit suspect.

I've attached the script I used to test this below. It performs the requested raw op on N files.
The user can specify what exposure number to start at, or use 0 to specify the most recent.
The script works counts down through the files until it find enough raws, so they don't need to be sequential.
It can optionally develop the resulting file.
The merged file will be named with the number of the last merged file, which will be the lowest number found.
Don't forget what the H stands for.

*

Offline whim

  • ******
  • 2046
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: RAW related functions for the scripts
« Reply #26 on: 27 / November / 2008, 04:01:04 »
Great work, guys !

About the (lack of) error checking: i suppose this means that if one or more of the CRW's to be merged
are actually DNG's the merge process will fail, right ?
Which makes implementing saving DNG's as .DNG (or anything but .CRW) all the more necessary ...

wim

 

Related Topics


SimplePortal © 2008-2014, SimplePortal