// Focus length table in firmware @ FFFEA5CC#define NUM_FL 201 // 0 - 200, entries in firmwareextern int focus_len_table[NUM_FL];
local focused = false print("calculating infinity") infinity = 6*get_zoom()^2-(100*get_zoom())+5000 print("infinity = ",infinity) sleep(1000) print("focusing to infinity") set_focus(infinity) focused = true return focused
Hi,I am trying to accurately set focus to infinity in a script for my SX30. I keep crashing it or overshooting the zoom by guesstimating, and I am getting ranges from ~5000 max to around 126000 max depending on the zoom step. I already have the code to calculate focus, I just need the table so I can make a linear or polynomial fit to it. I saw in the main.c for my camera the following:Code: [Select]// Focus length table in firmware @ FFFEA5CC#define NUM_FL 201 // 0 - 200, entries in firmwareextern int focus_len_table[NUM_FL];Can I use CHDK-PT to see this? I got confused as to where it would be - primary.bin or one of the generated files. I am still very much learning. I couldn't even find the address in the primary.bin file, so I am a wee bit lost...Here's what I'm doing to focus (using an equation I derived from a table for G5 or something, which is very wrong for the SX30)Code: [Select] local focused = false print("calculating infinity") infinity = 6*get_zoom()^2-(100*get_zoom())+5000 print("infinity = ",infinity) sleep(1000) print("focusing to infinity") set_focus(infinity) focused = true return focusedThanks for any pointers
I am trying to accurately set focus to infinity in a script for my SX30.
Why not just focus at hyperfocal distance ?Everything from half that distance to infinity will be in focus.
Despite the name, focus_len_table contains the focal lengths for zooming not setting subject distance (focus).
set_focus(65535) will set infinity (provided you are in manual focus mode).
That will be even better I think (but the stuff I want to see is pretty much 100 to 5000 meters away). So how can I easily set focus to the hyperfocal distance? I still need the focal length table to calculate hyperfocal distance, yes? Looking at the equation now.. doesn't look too bad, but then I need to query aperture (with get_tv()?) to calculate F-value, and then I have to figure out how big my circle of confusion is somehow... (feels pretty close to infinite right now )
Anyway, I am confusedissimo, but making progress. I've attached the full script I am working on, if you're interested in taking a look.. Philmoz also replied to the zoom portion in the SX30 IS release thread here, but I don't know if either (or both) of these threads is the right place for script discussion...
Started by Pierrinator Firmware Dumping
Started by whim « 1 2 3 » General Help and Assistance on using CHDK stable releases
Started by Karmaschinken Script Writing
Started by paime Script Writing
Started by Mlapse « 1 2 3 4 5 » General Help and Assistance on using CHDK stable releases