SX50 and focus stacking - Script Writing - CHDK Forum

SX50 and focus stacking

  • 7 Replies
  • 4884 Views
SX50 and focus stacking
« on: 24 / June / 2015, 19:15:14 »
Advertisements
Hi folks.
Thanks to the devs for this fun piece of software  :D
Does anyone have a script that they have had working on an SX50 for focus stacking ??
I've tried everything I can find and nothing works for me.
It could of course be operator error.
Ideally I would like something that could take 10 shots at half mm increments, quarter mm would be even better.
Quite possibly beyond the ability of the camera.
I saw a member from here Sky Altern ( sorry if I've misremembered your nic a bit wrong) on another forum had a working home brew script for the SX50.
The only script I can find from him I can't get to play.
Any thoughts would be appreciated  :)
Grahame

Re: SX50 and focus stacking
« Reply #1 on: 24 / June / 2015, 19:26:12 »
Did you look at any of these :  Focus & Depth of Field Stacking ?

They are all mostly kind of old by now and somewhat camera specific but this one (Technical Aspects of Stacking Macro Images) is still pretty good.

There is also this forum thread that is quite recent :  Meanwhile ... my Focus Stacking script  and this slightly older one DOF-based focus stack script NOT based on CHDK DOF calculations

Also, if you post a link to the scripts you actually tried, we might be able to help there too.
« Last Edit: 24 / June / 2015, 19:47:15 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: SX50 and focus stacking
« Reply #2 on: 24 / June / 2015, 20:24:23 »
waterwingz,
Thanks for the quick reply.
Yes I have tried all in the the first link and a few more besides.
I have a folder that has 10 scripts in it that I've tried.
But somehow I seem to have missed the
DOF-based focus stack script NOT based on CHDK DOF calculations
post, I sorta recognise the script but I'm sure I've never seen the script on page 2 by Leif Karlsson the person I got the user name a bit wrong (skrylten).
It's different to the one of his I have.
Will include your mods.
Thank You  :D
This may have solved my problem.
Getting a Moth stack from above from out of focus through to out of focus, delete the unneeded ones and stack.
Will have a play this afternoon.
Cheers.

Re: SX50 and focus stacking
« Reply #3 on: 25 / June / 2015, 07:38:39 »
Hmmm
I get
1:'='Expected
from the straight script from Leif.
I also managed to get
2:'<nExp>' expect
from inserting waterwingz 2 bits of code
Doing as it asked didn't do much.
Yes running in manual mode.
I seem to have broken CHDK from playing today, it now wont boot at start up, regardless of going back and redoing the make sd card bootable bit.
I've been playing with CHDK for a few years and sorta have a feel for it but don't understand lua.
All good fun will do a fresh reinstall tomorrow and see where I go from there.
If this piece of code runs on another similar cam it should run on mine.
I guess I'm the weak link .......
 :D

Re: SX50 and focus stacking
« Reply #4 on: 25 / June / 2015, 09:06:58 »
I get
1:'='Expected
from the straight script from Leif.
I also managed to get
2:'<nExp>' expect
What script are you trying to use?  Note that trying to run a script written in Lua without using a file extension of .lua will not work.  CHDK will try to execute it as if it was written in uBASIC.

Quote
from inserting waterwingz 2 bits of code. Doing as it asked didn't do much.
You lost me here.  What 2 bits of code ?

Quote
I seem to have broken CHDK from playing today, it now wont boot at start up, regardless of going back and redoing the make sd card bootable bit.
I'll need a lot more detail here.  Do you have the SD card lock switch still in the "locked" position?  Is the diskboot.bin file still in the root directory of your SD card?  What does it do now when the camera starts?
Ported :   A1200    SD940   G10    Powershot N    G16

Re: SX50 and focus stacking
« Reply #5 on: 25 / June / 2015, 19:37:24 »
Hi waterwingz
Sorry I wasn't clear
The script I tried is the one by  skrylten from your first post.
It's the one I have been looking for
Lets see if I can get the script here

Code: [Select]
rem Focus bracketing
rem s focus distance
rem f focal length
rem a fnumber
rem c circle of confusion
@title SX50 Focus bracketing by Leif Karlsson
@param p Max number of steps
@default p 300
@default c 5

sleep 2000

  for r=1 to p
   shoot
   get_focus s
   get_zoom f
   get_av n
   a=100*(s-f)/(f+n*c)
   b=100*2*s*f/(f*f+s*n*c-n*c*f)
   d=a*b/10000
   g=s+d/8
   set_focus g
   print g,d
   if g>50000 then r=p
   if d<0 then r=p
  next r

end

The 2 bits of your code were
Code: [Select]
set_mf 1
set_mf 0

Yes I do have it with a .lua extension.
Yes switch is in lock

Quote
What does it do now when the camera starts?
Strangely enough it won't load CHDK at start any more.
Have been and retried make the card bootable a couple of times.

Yes I was in M mode
and yes I have been playing around to see if I can get it to run.
I understand the H in the name  :D
Next mission, re install CHDK and start over.
All good fun
Thanks waterwingz for your attempts at help.... appreciated.

Re: SX50 and focus stacking
« Reply #6 on: 25 / June / 2015, 19:41:12 »
Yes I do have it with a .lua extension.
Well,  that's probably part of the problem.  The script you included is written in uBASIC rather than Lua.  Use .bas for the extension.

Quote
Next mission, re install CHDK and start over.
At this point,  that's probably a good idea. Low lever reformat the card and start over.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: SX50 and focus stacking
« Reply #7 on: 26 / June / 2015, 20:09:57 »
Quote
Well,  that's probably part of the problem.  The script you included is written in uBASIC rather than Lua.  Use .bas for the extension.
And that of course shows how much I know about lua and ubsaic   :(
Thank you.
Yesterday I only got as far as downloading the latest version of CHDK.
Today I hope to get to play
 :)

 

Related Topics


SimplePortal © 2008-2014, SimplePortal