Can focal length be determined in a script? - Script Writing - CHDK Forum

Can focal length be determined in a script?

  • 6 Replies
  • 5628 Views
Can focal length be determined in a script?
« on: 28 / June / 2009, 00:06:50 »
Advertisements
I searched both the uBASIC User Guide and these forums for 'focal length', but didn't turn up an answer to this question.

Is there some way in a script to determine the current focal length setting of the camera's (zoom) lens?

Thanks,
Daniel
Daniel
Gerroa, Australia

*

Offline reyalp

  • ******
  • 14126
Re: Can focal length be determined in a script?
« Reply #1 on: 28 / June / 2009, 01:01:35 »
You can read the current zoom setting from a propertycase http://chdk.wikia.com/wiki/Propertycase

This is the number of steps you are zoomed in, not the actual current focal length.

If you need actual focal length, you can work this out. In the CHDK source, see platform/<your camera>/main.c get_focal_length etc. Or you can get the value of each step from exif data.
Don't forget what the H stands for.

Re: Can focal length be determined in a script?
« Reply #2 on: 28 / June / 2009, 02:52:56 »
reyalp,

Thanks for that.  In the meantime I also found the 'get_zoom' uBASIC command, and tested this with a 'Zoom Stepping' script by Cythrelo.  This works fine for my A470, which has 7 zoom steps (0 - 6).  Though not the focal length I originally requested, I can, as you say, estimate the FL for each step, assuming they're equal FL steps between the lens's min and max zoom.  Even if not exactly linear, this should be plenty good enough for my purpose (estimating the 'view' angle, to automatically rotate a motorised panorama head by the appropriate amount to achieve the desired overlap).

Daniel
Daniel
Gerroa, Australia

Re: Can focal length be determined in a script?
« Reply #3 on: 28 / June / 2009, 05:01:24 »
this should be plenty good enough for my purpose (estimating the 'view' angle, to automatically rotate a motorised panorama head by the appropriate amount to achieve the desired overlap).

Daniel, that is quite a coincidence !
I am working with someone at this moment on such a project.
At present, you can display horizontal field-of-view at top of screen or you can have an onscreen display that shows horizontal and vertical fov's and number of images (with overlap) required to cover 360 degrees horizontal and 180 degrees vertical.

If you contact me directly with your firmware version I can send you a build to try.

We are now testing sending that information to a Picaxe by flashing the blue LED.


David

Re: Can focal length be determined in a script?
« Reply #4 on: 17 / July / 2009, 02:34:33 »
David,

Sorry for the late reply.   Unlike intelligent forums, this dumb one doesn't automatically enable 'notify' when you start or reply to a thread!

I'm using the a470-101b-0.9.8-778 build at the moment.  Your proposed additions would be most welcome, though I'm some time away from finding/building a suitable motorised turntable.
Daniel
Gerroa, Australia

Re: Can focal length be determined in a script?
« Reply #5 on: 17 / July / 2009, 04:57:44 »
Your proposed additions would be most welcome


The person who requested it for his Instructables article will be testing it today .. if he can get the sensor to stay securely attached to the camera body.


David

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Can focal length be determined in a script?
« Reply #6 on: 25 / July / 2009, 03:42:33 »
Unlike intelligent forums, this dumb one doesn't automatically enable 'notify' when you start or reply to a thread!
It does, but it may not be enabled by default. See "Notifications and Email" in your Profile.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal