Help with how to run a script please - General Help and Assistance on using CHDK stable releases - CHDK Forum

Help with how to run a script please

  • 8 Replies
  • 4594 Views
Help with how to run a script please
« on: 08 / March / 2016, 21:20:50 »
Advertisements
Sorry if this is in the wrong place, or the answers are here, or I'm being dense.
I'm trying to run a first script Focus_Bracketing with set_focus and get_focus
http://chdk.wikia.com/wiki/UBASIC/Scripts:_Focus_Bracketing_with_set_focus_and_get_focus

but I can't understand how to make it work.

I'm trying  focusrange.bas because it looks close to what I want to do.
Camera is A650. I've remmed out the G12-specific part. Camera is in MF and Av mode.

I'm a bit autistic so take things literally and have trouble guessing what things mean.
Could someone explain what do
Number of +steps and Number of -steps mean?

And how do I set Near and Far focus points?
I'm in MF but Left and Right don't work with the script running.

Thanks
« Last Edit: 08 / March / 2016, 21:31:11 by chrisr »

Re: Help with how to run a script please
« Reply #1 on: 08 / March / 2016, 23:09:46 »
Sorry if this is in the wrong place, or the answers are here, or I'm being dense.
No problem.  As long as you don't post the same question in multiple locations,  people here are pretty easy about what & where you do post.

Quote
I'm trying to run a first script Focus_Bracketing with set_focus and get_focus http://chdk.wikia.com/wiki/UBASIC/Scripts:_Focus_Bracketing_with_set_focus_and_get_focus
but I can't understand how to make it work
I assume from the rest of your post that you know how to start CHDK,  load a script, and get that script to run?

Quote
Could someone explain what do
Number of +steps
and
Number of -steps mean?
The mathematics use in the script is "sort of" explained in the associated wiki talk page for the script.

If I understand it correctly,  the +steps and -steps value are the number of image that will be taken at a calculated focus distance away for the current focal point.  In other words, the number of images at focus points closer to the camera and farther away from the camera respectively, where the total range is specified as the "Focus range in cm" input parameter.

Quote
And how do I set Near and Far focus points?
I'm not sure why you want to do that?   The script basically focusses for itself and then takes a set of images defined by the +step and -step value specified.

Note that this script is quite old and has some strange stuff. For example, in lines 46 and 47 it checks the near_limit and far_limit but does not do anything with the returned result. 

Perhaps we could start with a description of what you want to get done here and maybe find a better script?

Quote
I'm in MF but Left and Right don't work with the script running.
That's normal. When CHDK runs a script,  it disable all the camera buttons (unless the script uses them that is).
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Help with how to run a script please
« Reply #2 on: 09 / March / 2016, 05:33:15 »
Thanks WW. It's nice to get a such a quick & helpful response.
I think you helped me years ago when I managed to get something working on a camera whose lens I've broken off, but I've forgotten anyway. :'(
(Hence non-zero post count!)
I have misunderstood how this script is meant to work.

Yes I have the basic scripts running OK. It was much easier than last time, using the installation wizard.

Basically I just want to set focus to "close" going to  "far", the same as everyone else, but using calculated DOF steps instead of fixed measurements.

Simple and working is all I want at the moment.
Ends can be set as parameters in mm.
I understand I may have to experiment to determine the effective minimum focus number to use.

I can calculate the DOF if necessary.
I expect the lens will be sharpest about wide open, because of diffraction. (I do a lot of stacking, bugs etc,  with bigger cameras.)
If there would be out-of focus bands then I could switch to a smaller aperture, but that and other refinements can come later.

Rgds
Chris

Re: Help with how to run a script please
« Reply #3 on: 09 / March / 2016, 16:17:24 »
It "works", but scores a fail.
Nasty Out Of Focus bands:

Re: Help with how to run a script please
« Reply #4 on: 09 / March / 2016, 16:30:15 »
It "works", but scores a fail.
What happens if you shoot again but double the number of both positive and negative steps?
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Help with how to run a script please
« Reply #5 on: 09 / March / 2016, 16:58:23 »
They were pretty high anyway, both about 15. Focus depth was 30cm.

There are a few basic things I don't want though, that this script does:
it works from a get_focus, which isn't what I want
I don't understand how it works out the DOF but it seems to be too coarse - or wrongly implemented(?)
I don't want to enter the no of shots - just keep going until finished please!

I'm sure I found something before - different camera, and in 2012 so I can't remember anything.

Looking for another script...

Also -
A) is it possible to include data on the image, like the date can be shown, on some cameras? Would be great for testing.
B) Is there any reason whY I shouldn't use P mode? Then auto flash would work. I think it works..

Thanks
Chris
« Last Edit: 09 / March / 2016, 17:00:35 by chrisr »

Re: Help with how to run a script please
« Reply #6 on: 09 / March / 2016, 19:25:23 »
I'm sure I found something before - different camera, and in 2012 so I can't remember anything.   Looking for another script...
This is probably as good a list as exists : User Written Scripts : Focus & DOFStacking

This one looks interesting :  Meanwhile ... my Focus Stacking script

Otherwise,  here's a google search link targeted at this CHDK forum that will get you way too much stuff to look at : Google Focus Stacking


Quote
A) is it possible to include data on the image, like the date can be shown, on some cameras? Would be great for testing.
If I'm not mistaken, that would be technically possible to do by over-writing parts of the RAW buffer with the text information prior to it being converted to a JPEG. But I don't believe I've seen it done.

Quote
B) Is there any reason why I shouldn't use P mode? Then auto flash would work. I think it works..
Well,  P is the mode I usually recommend for people using my scripts.  It allows you to turn off most of the annoying automatic focus tracking features like face recognition, continuous focus, and safety autofocus.

If you are using the camera's built-in flash, you may need to slow down the time the script waits between shots to give the flash time to recharge.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Help with how to run a script please
« Reply #7 on: 09 / March / 2016, 20:35:35 »
Thanks
I'll have a go with
http://chdk.wikia.com/wiki/UBASIC/Scripts:_yet_another_DOF_stacker


The LUA route is another learning curve...  Not sure of benefit for now!

Chris

Re: Help with how to run a script please
« Reply #8 on: 09 / March / 2016, 20:41:54 »
I'll have a go with
http://chdk.wikia.com/wiki/UBASIC/Scripts:_yet_another_DOF_stacker
The LUA route is another learning curve...  Not sure of benefit for now!
Unless you plan to edit the script, there is no difference between running a Lua script and a uBASIC script.  Other than making sure the Lua script name ends in .lua  that is.

And even if you do try editing a Lua script,  you will likely find the use of multiple character variable names (rather than single letters) makes the script much easier to understand and edit.
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics


SimplePortal © 2008-2014, SimplePortal