Focus and Infinity: wide and zoom - General Help and Assistance on using CHDK stable releases - CHDK Forum

Focus and Infinity: wide and zoom

  • 9 Replies
  • 5192 Views
*

Offline dvip

  • ****
  • 451
Focus and Infinity: wide and zoom
« on: 13 / March / 2012, 12:31:29 »
Advertisements
This works in wide (A590IS 101b):

print("Focus to infinity")
set_focus(65535)
sleep(1000)
shoot()

But if I zoom and do that, it won't focus correctly.
Any way to make it work in zoom mode.


Re: Focus and Infinity: wide and zoom
« Reply #1 on: 13 / March / 2012, 14:37:36 »

Any way to make it work in zoom mode.

What happens if you add a half-press and delay before set_focus ?

*

Offline dvip

  • ****
  • 451
Re: Focus and Infinity: wide and zoom
« Reply #2 on: 13 / March / 2012, 19:38:24 »
I tried this, Microfunguy, and it works when I first turn the camera on:

print("Infinity")
press("shoot_half")
sleep(2000)
set_focus(65535)
sleep(2000)
shoot()

Now after I use the camera and focus someplace else and run the script again it won't focus, all blur as if it switched to macro mode.

I turn the camera off, then on, and run it again and it works.

I am just trying to shoot with focus set at infinity when at wide or full zoom.


Re: Focus and Infinity: wide and zoom
« Reply #3 on: 13 / March / 2012, 20:20:19 »
I have not studied the CHDK code but the focus override is probably applied during half-press.
I don't know if 'shoot' includes a half press.

Whatever, insert a half-press and delay in your code AFTER setting focus.
Remove the previous half-press.

*

Offline dvip

  • ****
  • 451
Re: Focus and Infinity: wide and zoom
« Reply #4 on: 13 / March / 2012, 21:05:58 »
The latest variation but no luck:

  print("Infinity")
  set_focus(65535)
  sleep(2000)
  press("shoot_half")
  sleep(2000)
  shoot()

And when I switch to manual focus to check where it is at, it's a 20 inches :( not infinity.


Re: Focus and Infinity: wide and zoom
« Reply #5 on: 13 / March / 2012, 21:11:21 »
According to the CHDK code the A590 can override focus when the camera is NOT in manual focus mode.

Nevertheless, try that last script with camera in manual focus mode.

*

Offline srsa_4c

  • ******
  • 4451
Re: Focus and Infinity: wide and zoom
« Reply #6 on: 13 / March / 2012, 21:23:26 »
@dvip
I think you either need to use shoot() alone or do the whole shooting action with keypresses and releases.
press("shoot_half")
press("shoot_full")
release("shoot_full")
release("shoot_half")
with the appropriate delays between them. See shoot.lua in the standard CHDK distribution.
For set_focus() try -1 as argument.

edit:
If your camera supports that, you may try to do set_aflock(1) before set_focus(). MF mode consumes a bit more energy :) at least on my camera(s).
« Last Edit: 13 / March / 2012, 21:32:38 by srsa_4c »

*

Offline dvip

  • ****
  • 451
Re: Focus and Infinity: wide and zoom
« Reply #7 on: 13 / March / 2012, 21:26:59 »
@Microfunguy,
Yes, when in manual focus mode it does work.
I just don't see why set_focus(65535) won't override focus to infinity when not in manual focus mode at full zoom.

@srsa_4c,
I'll experiment with that.


Re: Focus and Infinity: wide and zoom
« Reply #8 on: 14 / March / 2012, 07:09:54 »
Incidentally, to have 'infinity' in focus you do not need to focus at 65535.

At wide angle, if you focus to a few metres infinity will be in focus.
At maximum optical telephoto, some tens of metres will be ok.

Try 30000 or 40000.

Re: Focus and Infinity: wide and zoom
« Reply #9 on: 19 / June / 2013, 16:28:42 »
@Microfunguy
I have tried to implement the code that you suggested before and I have the following implementation, but I still get feedback that the focus changes.  I need to have constant focus at infinity.

Code: [Select]
set_prop 6 4
 sleep 20
 a = get_prop 6
 print "Focus mode =" a
  print "Infinity"
  set_focus 65535
  sleep 2000
  press "shoot_half"
  sleep 2000
  shoot
f = get_focus
print "Focus =" f
sleep 2000

I also tried to directly set the mode to infinity (set_prop 6 3), but that did not work either.  Can you assist?  I am using an A810.

Francois

 

Related Topics


SimplePortal © 2008-2014, SimplePortal