Please critique my script (using chdkptp)

  • 1 Replies
  • 338 Views
*

Offline rduz

  • *
  • 17
Please critique my script (using chdkptp)
« on: 05 / April / 2018, 11:12:00 »
Advertisements
Hi,

I'm in the process of building a book scanner and I'm using powershot elph 160 cameras and chdkptp to manage the process.  At the moment, I'm attempting to improve shooting speed.  To that end, I've purchased some better SD cards which have a higher transfer rate than the cards that I was using previously. 

Here is the log of my script, which prepares the camera and then takes 10 shots as quickly as it can.  The second column is the elapsed time in seconds:

Code: [Select]
09:50:19 | 0.90 | chdkptp.sh -e"connect -b=001 -d=019" -e'lua play_sound(0)'
09:50:19 | 0.95 | chdkptp.sh -e"connect -b=001 -d=019" -erec
09:50:20 | 0.88 | chdkptp.sh -e"connect -b=001 -d=019" -e'lua while(get_flash_mode()<2) do click("right") end'
09:50:22 | 1.39 | chdkptp.sh -e"connect -b=001 -d=019" -e'luar set_zoom(70)'
09:50:24 | 0.89 | chdkptp.sh -e"connect -b=001 -d=019" -e'luar set_mf(1) set_focus(1300)'
09:50:31 | 6.70 | chdkptp.sh -e"connect -b=001 -d=019" -e'shoot -u=96 -tv=320 -sv=50 -nd=out -raw=0 -dng=0'
09:50:38 | 6.70 | chdkptp.sh -e"connect -b=001 -d=019" -e'shoot -u=96 -tv=320 -sv=50 -nd=out -raw=0 -dng=0'
09:50:45 | 6.72 | chdkptp.sh -e"connect -b=001 -d=019" -e'shoot -u=96 -tv=320 -sv=50 -nd=out -raw=0 -dng=0'
09:50:52 | 6.78 | chdkptp.sh -e"connect -b=001 -d=019" -e'shoot -u=96 -tv=320 -sv=50 -nd=out -raw=0 -dng=0'
09:50:58 | 6.73 | chdkptp.sh -e"connect -b=001 -d=019" -e'shoot -u=96 -tv=320 -sv=50 -nd=out -raw=0 -dng=0'
09:51:05 | 6.76 | chdkptp.sh -e"connect -b=001 -d=019" -e'shoot -u=96 -tv=320 -sv=50 -nd=out -raw=0 -dng=0'
09:51:12 | 6.64 | chdkptp.sh -e"connect -b=001 -d=019" -e'shoot -u=96 -tv=320 -sv=50 -nd=out -raw=0 -dng=0'
09:51:18 | 6.68 | chdkptp.sh -e"connect -b=001 -d=019" -e'shoot -u=96 -tv=320 -sv=50 -nd=out -raw=0 -dng=0'
09:51:25 | 6.73 | chdkptp.sh -e"connect -b=001 -d=019" -e'shoot -u=96 -tv=320 -sv=50 -nd=out -raw=0 -dng=0'
09:51:32 | 6.72 | chdkptp.sh -e"connect -b=001 -d=019" -e'shoot -u=96 -tv=320 -sv=50 -nd=out -raw=0 -dng=0'

Notice that the shoot command is taking nearly seven seconds to complete.  What, if anything can I do to improve on that time?  I've read other forum messages indicating 4 seconds is do-able.  Are there settings that I should be changing to help improve the time?  Also, any obvious improvements that I should consider adding?  In particular, I know I need to do some more reading on the shoot parameters u, tv, sv and nd since I more or less pulled those from other forum posts or the air.

Thanks for helping me!


*

Offline reyalp

  • ******
  • 11546
Re: Please critique my script (using chdkptp)
« Reply #1 on: 05 / April / 2018, 12:58:23 »
Notice that the shoot command is taking nearly seven seconds to complete.  What, if anything can I do to improve on that time?
Assuming you can accept fixed exposure, focus and zoom (seems probably true for a bookscanner) the biggest thing you can do to improve shooting rate is to hold the camera in half press between shots, or using continuous mode and shooting hooks to control shot timing.

Using remoteshoot should also speed up the process overall, since the time to transfer over USB is similar to what is required to write to a fast SD card.

This requires a slight different approach than your current script, since you need to have a long running script on the camera that signal it each time you want to shoot, instead of invoking chdkptp each time.

The chdkptp rsint command is made for this kind of application. You set the exposure options etc once when you invoke the command (similar to shoot), and then every time you input 's' it shoots. See help rsint for details.

Alternatively, you could write you own camera side script which you start once and then send messages with invocations, like
Code: [Select]
chdkptp '-e"connect -b=001 -d=019" -e'putm shoot'
Quote
In particular, I know I need to do some more reading on the shoot parameters u, tv, sv and nd since I more or less pulled those from other forum posts or the air.
-u controls what units the other exposure related options are interpreted as. The default is conventional units, e.g. shutters speeds as 1/100, ISO as 100, 200 etc.

The ISO you probably want set to the minimum Canon UI value, like -svm=80 (svm and sv are similar, but svm lets you use the same values seen in the canon ui)

Shutter speed should be whatever gives you good exposure in your lighting. ND should probably out, unless you are shooting outside in bright sun, but probably doesn't need to be set manually.
Don't forget what the H stands for.

 

Related Topics