Access Autofocus Parameters? - Script Writing - CHDK Forum

Access Autofocus Parameters?

  • 17 Replies
  • 5890 Views
*

Offline Davo

  • ***
  • 189
Access Autofocus Parameters?
« on: 11 / April / 2013, 09:52:00 »
Advertisements
I am looking to script an app that will display the focus state on the LCD. This will be very useful for astro and digiscoping work where you set AFL to infinity and then use the telescope focus knob to focus correctly.

I am guessing that the autofocus works by measuring the 'sharpness' of the live LCD scene. It will then adjust the lens until the sharpness value is maximised. Does anyone know how to access this sharpness value? I can then use this to display a focus meter on the LCD.

thanks in advance
Dave

*

Offline reyalp

  • ******
  • 14111
Re: Access Autofocus Parameters?
« Reply #1 on: 11 / April / 2013, 16:57:04 »
I don't think any way to access this kind of information is currently know. You could analyze the viewport buffer yourself, see the zebra, histogram, motion detection etc code in the CHDK source for examples.
Don't forget what the H stands for.

Re: Access Autofocus Parameters?
« Reply #2 on: 11 / April / 2013, 17:58:11 »
set AFL to infinity and then use the telescope focus knob to focus correctly.
If you can find a subject during the day that is sufficiently far away to be the same infinity focus as the stars, you could focus camera to infinity and simply lock the telescope focus knob

As far as digiscoping is concerned, the subject (such as birds) is normally moving in and out of focus.
The SDM approach is to bracket focus on the primary image, which you can typically locate 250mm away :-

http://stereo.jpn.org/eng/sdm/digi.htm

*

Offline Davo

  • ***
  • 189
Re: Access Autofocus Parameters?
« Reply #3 on: 12 / April / 2013, 05:56:05 »
Thanks folks. I already have a Windows focus meter that I can use on the CHDKPTP live view. I could port it to Lua and use the LCD buffer but it is a real CPU hog and would be a lot of work. It occurred to me that the camera must already have a similar routine built in - if only I could find it. I will keep digging.

There is an electric tower about 2km from home that I ofter use as a target. However, there is quite a difference in focus between that and the Moon on my astro scopes.

I am pretty well covered with my Windows version. The in-camera version would be really neat for grab and go scopes with no PC required.


Re: Access Autofocus Parameters?
« Reply #4 on: 12 / April / 2013, 06:08:26 »
So, how do photographers who do not have CHDK focus on the stars ?

*

Offline blackhole

  • *****
  • 942
  • A590IS 101b
    • Planetary astrophotography
Re: Access Autofocus Parameters?
« Reply #5 on: 12 / April / 2013, 06:51:36 »
So, how do photographers who do not have CHDK focus on the stars ?
Using Bahtinov mask is probably the best way or the simpler version called the Hartmann mask.
Everything else is questionable.

Re: Access Autofocus Parameters?
« Reply #6 on: 12 / April / 2013, 07:39:37 »
That is very interesting.
Is the image bright enough on a CHDK-supported camera ?

*

Offline blackhole

  • *****
  • 942
  • A590IS 101b
    • Planetary astrophotography
Re: Access Autofocus Parameters?
« Reply #7 on: 12 / April / 2013, 08:04:14 »
Basically the picture is bright enough, but the diameter of the telescope lens is very important. A bigger problem than the brightness of the image is the size of the diffraction, which is on the small diameter of the telescope lens very small.


Re: Access Autofocus Parameters?
« Reply #8 on: 12 / April / 2013, 09:05:47 »
Set the telescope focusing knob so that the primary image is  nearer than infinity.
Maybe you could visually focus at infinity and then move the focus knob a very precise, fixed distance clockwise or counter-clockwise.
Run a script that changes focus by one mm at at a time.
This has most effect with primary image at a few hundred mm, at greater distances the focusing stepper motor will not change position until the override focus changes by a large amount (metres).
Anyway, there will be some focus setting that gives sharpest results.
In future, repeat the visual focusing and then run a script to focus at optimal distance.

*

Offline Davo

  • ***
  • 189
Re: Access Autofocus Parameters?
« Reply #9 on: 13 / April / 2013, 07:32:20 »
I didn't explain myself very well. What I do is mount the camera to look thru the telescope eyepiece. I then connect via CHDKPTP, turn on LiveView and focus the camera at infinity. I then set my software focus meter to monitor the LiveView window while I adjust the telescope focus. My focus meter peaks at best focus and I then start recording videos. Stacking the videos produces highly detailed images. The attached sunspot image shows a detail from a raw video frame and the stack of 750 frames (30s of video).

As you can see the raw video is very blurry due to atmospherics and is impossible to focus accurately by eye. However, my focus meter peaks at maximum sharpness. My camera must have a similar 'meter' built in and I am trying to access it so I can focus accurately without using a computer.

btw, my A810 seems to be outperforming my astro cam that cost 6 times more  :D

Also attached is a panorama of the Sun at lower resolution.

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal