We need a script to watch for motion (i.e. the book pages being flattened against the platen) then shoot images when the motion stops for a second or two (i.e. pages are in place).
--[[@title Book Scanner Motion Detect]]a=6 -- columns to split picture into b=6 -- rows to split picture into c=1 -- measure mode (Y,U,V R,G,B) U=0, Y=1, V=2, R=3, G=4, B=5d=1000 -- timeout (mSec) e=200 -- comparison interval (msec) - less than 100 will slow down other CHDK functionsf=5 -- threshold (difference in cell to trigger detection)g=1 -- draw grid (0=no, 1=yes) h=0 -- not used in LUA - in uBasic is the variable that gets loaded with the number of cells with motion detectedi=0 -- region masking mode: 0=no regions, 1=include, 2=excludej=0 -- first columnk=0 -- first rowl=0 -- last columnm=0 -- last rown=0 -- optional parameters (1=shoot immediate)o=2 -- pixel stepp=500 -- triggering delay (msec) repeat repeat zones = md_detect_motion( a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) until ( zones > 0 ) repeat zones = md_detect_motion( a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) until ( zones == 0 ) shoot() until ( false )
This would actually be a good idea for using the camera to take pictures of 8mm home movies. Once the film is advanced one frame, the camera would shoot.Now, if only to automate advancing the film frame by frame.
I wrote a script for this exact thing four years ago. Have a look at these:http://chdk.setepontos.com/index.php?topic=8303.0http://www.seanster.com/archdocoThe script has all timings set by parameters so with a little trial and error you can fine tune the timing for your particular setup. The various debug modes allow you to do that easily. I can help you with it just let me know.
Started by yvesson « 1 2 ... 8 9 » Creative Uses of CHDK
Started by lagios General Help and Assistance on using CHDK stable releases
Started by skrylten « 1 2 ... 7 8 » Script Writing
Started by waterwingz « 1 2 ... 12 13 » LUA Scripting
Started by thetechfirm Script Writing