Focus Shift Shooting - can we end the guesswork?

Started 2 months ago | Discussions thread
dpnikon New Member • Posts: 8
Re: Focus Shift Shooting - can we end the guesswork?
1
-- hide signature --

; AutoHotKey script to run NKRemote, select live view and take
; a series of photos with different focus settings so that these can
; be combined using CombineZM to give extended depth of field.
;
; Usage: focus the lens on the nearest object to be in focus and then
; run this script. The number of photos in the sequence is defined by
; the variable NumberOfImagesInSequence below and can be overridden in
; the command line e.g. focus_stacking.ahk 30
; After taking the pictures run CombineZM to combine them into a single
; image with extended DoF.
;
; NKRemote can be downloaded from
; http://www.breezesys.com
;
; AutoHotKey is free and can be downloaded from:
; http://www.autohotkey.com
;
; CombineZM is free and can be downloaded from:
; http://www.hadleyweb.pwp.blueyonder.co.uk/CZM/combinezm.htm
;
; This script comes with no warranty or support whatsoever and may
; be freely copied or modified as required.
;
; Written by Chris Breeze, www.breezesys.com
;-----------------------------------------------------------------------

MediumFocusSteps = 1 ; set this to 0 to focus in small steps
NumberOfImagesInSequence = 15

if %0% > 0 and %1% > 1
{
NumberOfImagesInSequence = %1%
}

; First check NKRemote is running and a camera is connected
IfWinExist, NKRemote
{
IfWinExist, NKRemote: Connected to
{
WinActivate, NKRemote
}
else
{
MsgBox, 48, Focus Stacking Script, NKRemote is not connected to a camera
ExitApp
}
}
else
{
MsgBox, 48, Focus Stacking Script, NKRemote is not running
ExitApp
}

; Turn on live view (this will fail if the camera doesn't support live view)
Sleep 1000
IfWinNotExist, Live View:
{
Send ^l
Sleep 2000
}
IfWinNotExist, Live View:
{
MsgBox, 48, Focus Stacking Script, Unable to select live view
ExitApp
}

; Take a series of pictures and adjust the focus after each shot
ImageCounter := 0
Loop, %NumberOfImagesInSequence%
{
ImageCounter := ImageCounter + 1
SplashTextOn, 200, 30, Focus Stack Progress , Image %ImageCounter% of %NumberOfImagesInSequence%

; Make sure NkRemote is still running.
IfWinExist, NKRemote
{
IfWinNotExist, NKRemote: Connected to
{
SplashTextOff
MsgBox, 48, Focus Stacking Script, No camera connected in loop!`n`n%ImageCounter% frames shot.
ExitApp
}
}
else
{
SplashTextOff
MsgBox, 48, Focus Stacking Script, NKRemote is not running.`n`n%ImageCounter% frames shot.
ExitApp
}
IfWinNotExist, Live View:
{
SplashTextOff
MsgBox, 48, Focus Stacking Script, Live View window is not open.`n`n %ImageCounter% frames shot.
ExitApp
}

; make sure live view window has input focus
WinActivate, Live View:
Sleep 250

SendInput {F8}

; give NKRemote time to take the picture, download and reactivate live view
Sleep 5000 ; increase this time by approximately 2500ms per image when auto-bracketing

if MediumFocusSteps > 0
{
; focus farther away in medium steps
SendInput ^{Right}
}
else
{
; focus farther away in small steps
SendInput {Right}
}
Sleep 250
}
SplashTextOff

Implanteer in Z7 ,,,?????

 dpnikon's gear list:dpnikon's gear list
Nikon D3S Nikon Z7
Post (hide subjects) Posted by
NCB
(unknown member)
Keyboard shortcuts:
FForum PPrevious NNext WNext unread UUpvote SSubscribe RReply QQuote BBookmark MMy threads
Color scheme? Blue / Yellow