histogram,total=get_live_histo()returns a histogram of Y values from the viewport buffer (downsampled by HISTO_STEP_SIZE)histogram[Y value] = count, so it is zero based unlike a normal lua arraytotal is the total number of pixels, may vary depending on viewport size
nxp=get_exp_count()press("shoot_half")for i=1,10 do press("shoot_full_only") while(nxp==get_exp_count())do sleep(10) end release("shoot_full_only")-- sleep(1000) --would delay 1 second between shotsendrelease("shoot_half")
I tried so many different orders, combinations, placements of set_prop(6,4), set_prop(65, -1), set_aflock(1), set_focus(65535), click/press/release/etc in the script ... and I did not keep track ... so I need to start over. (Sympathy grab: I did about 50 SD card ejects, script updates, card inserts... and then realized I should have kept track instead of brute forcing and trying lots of things).
EDIT: so I guess my question is, how do I debug why the set props are not working. I've submitted a patch before to get the ring func button doing what it should... but this seems different.
--put this at the start of your programprops=require("propcase")pTV=props.TVpTV2=props.TV2pSV=props.SV -- real svpDELTA_SV=props.DELTA_SVprops=nil -- frees memory-- then to take a picture, try thispress("half_shoot)repeat sleep(50) until get_shooting()bv=get_bv96()--compute your tv and sv values, and still in half_shoot, do this: set_prop(pTV,tv) -- actual set_prop(pTV2,tv) -- EXIF data set_prop(pDELTA_SV,sv-get_prop(pSV)+get_prop(pDELTA_SV)) -- sets actual exposure set_prop(pSV,sv) -- sets EXIF data click("shoot_full") while(get_shooting())do sleep(50) end
Quote from: martinl on 25 / November / 2012, 00:06:43(Sympathy grab: I did about 50 SD card ejects, script updates, card inserts... and then realized I should have kept track instead of brute forcing and trying lots of things).Just a note, you can use the CHDK PTP interface http://chdk.wikia.com/wiki/PTP_Extension to upload scripts directly, or test script code interactively.
(Sympathy grab: I did about 50 SD card ejects, script updates, card inserts... and then realized I should have kept track instead of brute forcing and trying lots of things).
Thinking back to how I almost destroyed my SD940 doing my initial port and my small stack of SD card with broken "lock" switches from too many card insert/ejects, I realized it might be good to document how to use chdkptp with batch files for code & script development. So I started this User page - I'll move it into the wiki when its more complete.
With the ptpCamGui you can also upload all related CHDK files: scripts, single module files, diskboot.bin, ps.fi2/ps.fir or automatically extracted zip files from autobuild servers or local host. The GUI has a developer environment for Lua scripts. You can test scripts without upload to the camera.
The attached script attempts to go into manual focus mode with the above trick. If it works, it sets the focus based on a parameter, and does another half_shoot. If you're not in manual focus mode when you do set_focus(d), it doesn't work, or crashes the camera on my sx260.
After much experimenting, I figured out the solution for tV and sV
Started by barberofcivil
Started by diogoc
Started by Lebeau
RAW Shooting and Processing
Started by user972611
General Discussion and Assistance
Started by Andre-K
General Discussion and Assistance