Setting focus from scripts or menus - page 8 - General Discussion and Assistance - CHDK Forum

Setting focus from scripts or menus

  • 601 Replies
  • 209344 Views
Advertisements
sx510, changing default values to:
#undef  CAM_CAN_SD_OVER_NOT_IN_MF
#define CAM_CAN_SD_OVER_IN_AF_LOCK        1
camera now passes 'set_aflock'
This is very interesting as it suggests that (at least for one camera), having Continuous AF enable or disabled does not affect the result.
Ported :   A1200    SD940   G10    Powershot N    G16

Ixus860_SD870 1.00C, (M mode)
 CHDKDE v1.2 and v1.3,
  SS.MFOn enabled & disabled
Thanks for this one - I think.    ???

I really don't know what to say about the results - it suggests that there is a difference between 1.2.0 and 1.3.0.

That does not seem right,  so it might be there is a timing issue similar to what srsa_4c found.   If I beef up the script with his changes, would you be willing to rerun the tests?
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline JohnW

  • *
  • 13
It starts to run the second test, the screen stops updating then the camera loses all power.
Strange that using set_aflock() will cause the second test to fail when it tried to set_focus but the first test passes.

Quote
If I enable the native LUA calls it fails the first test, and then stops in the same place on the second test.
That makes no sense at all.  Can you please post the mf_test.csv from both tests?

I can, but little point I think, both CSV's have no file size and no data contained within - presumably because the camera crashes and powers itself off?

I can, but little point I think, both CSV's have no file size and no data contained within - presumably because the camera crashes and powers itself off?
True.   Usually I open & close log files each time write to them in my scripts.  For some reason unknown,  I chose to not do that in this script - bad decision.   I'll add that to the update list.  Don't worry about it for now.

Meanwhile,  we've learned that with CHDK as it is today,  you need to enable Lua native calls, and put this
Code: [Select]
        call_event_proc("SS.Create")
        call_event_proc("SS.MFOn")
at the start of your script and this

Code: [Select]
        call_event_proc("SS.Create")
        call_event_proc("SS.MFOff")
at the end if you want to use the set_focus() function on the G15.

« Last Edit: 03 / January / 2014, 10:31:54 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline JohnW

  • *
  • 13
Well that's good to know, glad I've been of some help :)

In my limited imagination - my idea was to hack about the (your) MDFB2013 script, set the focus to infinity and then when it detects the initial burst of a firework take an exposure for x shutter time y after the detection, in the hope that can get repeatedly excellent firework photos.

Then maybe another bit which gets a longer background exposure so the scenery is editable into the scene too.

I'm only a beginner, so just a learning exercise for me, for now.

Hi,

next Test!
Camera: SX230HS 1.00c

Remove '#undef  CAM_CAN_SD_OVER_NOT_IN_MF'    causes the camera to crash.
Adding '#define CAM_CAN_SD_OVER_IN_AF_LOCK 1' causes now to passes 'set_aflock'.

By

Re: Setting focus from scripts or menus : new script version posted v2.3
« Reply #76 on: 03 / January / 2014, 11:35:40 »
I've updated the script with the things I learned from all of your feedback.   Probably not worth rerunning any test at this point but when the script gets added to the test suite for new ports it's a better script.

Changes include :

  • the log file now opens and close for each write so that test results prior to a crash are preserved
  • the focus ranges have been moved a bit so that each focus test point is unique.  The closest test range was eliminated to work properly with cameras like the G1X
  • the script now does a shoot_half and waits for focus lock before proceeding.  Times out after 2 seconds and reports a focus failure if necessary.  Covering the lens completely will trigger this.
  • the script now  checks that focus after shoot_half matchs focus after shoot_full. If you move the camera rapidly during shooting you can trigger this test to catch a focus change.
  • SS.MFOn is now enable by default.  This will cause issue with Lua Native calls if not enabled but I think its important to capture the results of this test too.

New script now attached to first post in this thread.

Update :  the master spreadsheet for all the test results can be found here :  http://bit.ly/1f0FGJ9


« Last Edit: 03 / January / 2014, 12:38:02 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

SX200is.

Complete failure with auto focus switched on even the native calls trigger. Perfect result with manual focus manually selected.


Re: Setting focus from scripts or menus : update to v2.4
« Reply #78 on: 03 / January / 2014, 12:39:31 »
It seems there is always just "one more thing".   Version 2.4 of the script will now report a "pass" if the reported focus is within 20% of the requested focus.  The previous pass criterion was 10%.

Link in the usual place.
« Last Edit: 03 / January / 2014, 12:54:36 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16


 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal