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

Setting focus from scripts or menus

  • 601 Replies
  • 201526 Views
Re: Setting focus from scripts or menus
« Reply #470 on: 28 / June / 2014, 20:52:25 »
Advertisements
Working with a member of the KAP forum (link posted above),  I've confirmed that the S100 has the same issue with set_focus() as the ixus125.

He has an S90 that works properly so I don't think there is any chance of user error here.

The S100 and IXUS125 were release about the same time from what I can tell.  This may be a sigfinder issue.


Update :  I took a detailed look at the iisassembly for the IXUS125 and the A1200.   They are identical down to at least two subroutine call depth.   The A1200 works,  the IXUS125 does not. Maybe something else needs to be enabled for the IXUS125 but it beats me what that could be.
« Last Edit: 29 / June / 2014, 11:28:24 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline srsa_4c

  • ******
  • 4451
Re: Setting focus from scripts or menus
« Reply #471 on: 30 / June / 2014, 16:32:38 »
Perhaps trying to call "MoveFocusLensToDistance" directly is worth a try:
http://chdk.setepontos.com/index.php?topic=9443.msg102557#msg102557
I'd do that in AF lock without any CHDK overrides. The eventproc should have immediate result, but a photo is likely necessary to confirm where the real focus is.

Re: Setting focus from scripts or menus
« Reply #472 on: 30 / June / 2014, 17:45:04 »
Perhaps trying to call "MoveFocusLensToDistance" directly is worth a try:
http://chdk.setepontos.com/index.php?topic=9443.msg102557#msg102557
I'd do that in AF lock without any CHDK overrides. The eventproc should have immediate result, but a photo is likely necessary to confirm where the real focus is.
Under that banner of GMTA,  I actually recoded my test script yesterday to try and use MoveFocusLensToDistance but didn't have any success.

I was pretty sure that I had the registration event wrong, having tried all of these (seperately) :

Code: [Select]
call_event_proc("Mecha.Create")
call_event_proc("MechaRegisterEventProcedure")
call_event_proc("RegisterShootSeqEvent")
call_event_proc("SS.Create")
with the same result (camera crashes in FocusLensController.c when it called call_event_proc("MoveFocusLensToDistance", dist) ).

Thanks for that link - I'll try again.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Setting focus from scripts or menus
« Reply #473 on: 30 / June / 2014, 20:40:17 »
Update :  ran a revised version of the focus.lua script on my A1200 using :

Code: [Select]
call_event_proc("FA.Create")
call_event_proc("InitializeAdjustmentFunction")
...
call_event_proc("MoveFocusLensToDistance", <distance>
Seems to work well when I examine the images (using a subject with lots of near, mid and far objects).  Tried it with the set_mf() and set_aflock() commands - works with both.  Doesn't work if one or the other is not engaged.

As a side note, unlike set_focus(), the exif info about Subject Distance does not appear to be updated when you do this.  The value is locked at whatever the last focus value used by the camera is.  But then set_focus() pokes a couple of propcases - I expect that might be what gets recorded in the exif. 

Also,  the focus value requested is typically only within about 10% of the focus value reported.  I think that's normal on cheap P&S cameras - they only change their focus setting in discrete steps.

Bear in mind that the A1200 works well with the original set_focus() based script too. I'll contact the IXUS125 and S100 testers and see what they can tell us.
Ported :   A1200    SD940   G10    Powershot N    G16


Re: Setting focus from scripts or menus
« Reply #474 on: 30 / June / 2014, 20:44:15 »
Ages ago they used to say: "Ubi maior minor cessat"
Back to the major then.   Here a version modified as described above :  https://app.box.com/s/j60qv9ftymn90d7wygxg

Does it behave any better?

update : note that you will need to select Enable Lua Native Calls [ * ] in the Miscellaneous menu
« Last Edit: 01 / July / 2014, 08:09:09 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Setting focus from scripts or menus
« Reply #475 on: 01 / July / 2014, 11:51:31 »
Does it behave any better?

update : note that you will need to select Enable Lua Native Calls [ * ] in the Miscellaneous menu
Lua Native Calls are constantly enabled on my ixus125 because i love to play with the videxp3 script ... when it doesn't crash.
Hope all these "Calls" will not burn the baby  :)

Back to new test:

- camera crashes/freezes if i frame a subject different from the first one of the series (farther/closer/brighter/darker). No matter which "lock via" settings.
- (camera on tripod/fixed subject) when "lock via" setted to none the focus point stays stuck on what camera locked at first shot of the series
- (camera on tripod/fixed subject) when "lock via" setted to MF or AFL the focus point grows in the damned macro range (like old test)
- randomly when "lock via" setted to MF pic#1 seems to be focused farther (for sure where the camera locked at start), but on pic#2 the focus point turns back and stays in the damned macro range

 :(
« Last Edit: 01 / July / 2014, 11:56:03 by fabri22 »

Re: Setting focus from scripts or menus
« Reply #476 on: 01 / July / 2014, 13:04:10 »
- camera crashes/freezes if i frame a subject different from the first one of the series (farther/closer/brighter/darker). No matter which "lock via" settings.
So if you move the camera at any point during the 12 shots the script takes you get a crash /freeze ?

Quote
- randomly when "lock via" setted to MF pic#1 seems to be focused farther (for sure where the camera locked at start), but on pic#2 the focus point turns back and stays in the damned macro range
AFL mode focuses on entry so I guess it makes sense it would act differently.

One additional thing we could try is to set the camera focus mode into landscape mode prior to running the script. You do that by pressing the "left" or tulip button and select the "twin peak" mountain icon. Give that a try?
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Setting focus from scripts or menus
« Reply #477 on: 01 / July / 2014, 14:44:28 »
So if you move the camera at any point during the 12 shots the script takes you get a crash /freeze ?
Test shots are 22. Running the right script? ???
Yes. At any consistent EV variation (+/- 2 3 stops) i get a crash.
There seems to be a sort of relationship among the AFL and AE (AEL ?) on the ixus125 ... to complicate the whole thing.

Quote
AFL mode focuses on entry so I guess it makes sense it would act differently.
I can confirm those findings. Pic#1 is always focused farther then others pics (when "lock via" setted to MF), but not to infinity
Quote
One additional thing we could try is to set the camera focus mode into landscape mode prior to running the script. You do that by pressing the "left" or tulip button and select the "twin peak" mountain icon. Give that a try?
No news in landscape mode (MF or AFL flagged).


Re: Setting focus from scripts or menus
« Reply #478 on: 07 / August / 2014, 18:35:45 »
It seems to me that i've found a "magic" number for the set_focus() command: 5836.
Still not sure if it sets focus to infinite on ixus 125 because now i can test only indoor (nighttime here).
At least focus seems to be forward than previous tests.
Quote
EDIT  ... :( sadly
A bit more testing with all room lights on and i can report that 5836 is not the real infinity value.
There is not any percepible difference in focus among the series. Focus stays locked at a short distance in all shots.
Working with a member of the KAP forum (link posted above),  I've confirmed that the S100 has the same issue with set_focus() as the ixus125.
Update :  I am no longer convinced this is a CHDK problem.   

I was able to get access to an S100 and run the focus.lua script from this thread.  It dutifully walked the focus out from about 1' to infinity over a sequence of 20 shots.  Everything I tried worked, even with different AF and IS settings.

So I contacted Dave Mitchell (zeno) who has both an S100 and an ixus127 (same camera as the ixus125). He ran the focus script today on both cameras and discovered the same thing.  Everything works exactly as expected.

Which leaves us with a mystery about the focus failure reports for the S100 and ixus125 ( two cameras only).  It seems like there is maybe something wrong mechanically with both? Or some Canon settings is somehow causing problems?  I've asked the S100 owners to use the Canon menu factory reset option and then rerun the script.  I did the same with the S100 I was using and it focussed exactly as requested.  I should hear back from him this weekend.

@fabri22 : meanwhile the script attached here will take a picture in Autofocus mode,  read back the subject distance,  switch to MF, set the focus to the subject distance from the previous shot, and shoot again.  It then releases the MF and takes a third shot in AF mode.   Try running that with different subject distances (near, mid, far) and see if all three pictures match each time ?

Ported :   A1200    SD940   G10    Powershot N    G16

Re: Setting focus from scripts or menus
« Reply #479 on: 08 / August / 2014, 10:07:39 »
In the short focus range (near subjects) all 3 pics are focused fine.
When it comes to mid (above 1-1,5 mt) and far subjects the 2° pic of series isn't focused like 1° and 3°. The blur (out of focus) is more visible on 2° pic with far subjects.

BTW I'm sorry to give you all this hassle with my camera. Surely its focus bug isn't CHDK related. Maybe an issue with my ixus ... that luckily doesn't occur out of CHDK.
So, let it be. I am more than satisfied with everything else i got from CHDK.
« Last Edit: 08 / August / 2014, 10:09:32 by fabri22 »

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal