Landscape Focus Bracketing Script - page 5 - Completed and Working Scripts - CHDK Forum  

Landscape Focus Bracketing Script

  • 247 Replies
  • 48072 Views
Re: Landscape Focus Bracketing Script
« Reply #40 on: 24 / February / 2019, 03:07:38 »
Advertisements
Although I wrote this script for landscape/cityscape/xscape photography I thought I would test its stacking algorithm at the macro end. The test subject was a broken head of garlic in our kitchen.

I choose to use my G7X as this has a 50mm minimum focus, compared to a 200mm on my G1X. I also wanted to see how the script coped with a wide open aperture, ie F/1.8.

I used the Mac2X stacking option and focused on the far point of the head of garlic that I wished to see in focus.

I used diffraction aware overlap, although at F/1.8 there isn't a lot of diffraction.

The script refocused to 50mm and took 38 images.

After ingesting into Lightroom I selected 16 that covered the subject of interest. That is I could have placed the camera much closer to the head of garlic, but, of course, I wouldn't have been able to capture the entire scene.

[Note to self: look at adding an X2Y stacking option ;-)]

I did a round trip to Helicon Focus and tidied up the image in LR.

Shooting at F/1.8 was never going to create the sharpest of images, but overall I'm pleased with the robustness of the script.
« Last Edit: 24 / February / 2019, 05:30:50 by pigeonhill »

Re: Landscape Focus Bracketing Script
« Reply #41 on: 24 / February / 2019, 06:28:23 »
In the last post I suggested to myself to add a X2Y macro option.

I then realised I could achieve this really simply by implementing an additional focus backeting logic, ie current position (X) to y mm from X, ie X2DelX

I've thus updated the script and I'm beginning to convince myself there is not much more to add.

As an example, I just took this test image where I focused on the front of the garlic head and selected a delta of 30mm, to cover the bulb's depth. I shot at F/1.8 and the script took 19 images to cover the 30mm. I also used an overlap criterion of CoC/2 microns.

Re: Landscape Focus Bracketing Script
« Reply #42 on: 24 / February / 2019, 10:01:55 »
One more example to show the script's ability to capture detail and control DoF.

In this example I set the aperture to the camera's minimum plus two stops, ie F/3.5.

I also used the zero-noise exposure option, ie at +4Ev.

I told the script to capture enough brackets for 30mm beyond where I first focused, ie at the front of the bulb.
 
Because I was focus and exposure bracketing the script took 18 images, ie 9 for focus and two exposures at each focus station.

Over all I'm pretty pleased.
« Last Edit: 24 / February / 2019, 12:06:08 by pigeonhill »

*

Offline c_joerg

  • *****
  • 1248
Re: Landscape Focus Bracketing Script
« Reply #43 on: 26 / March / 2019, 06:41:31 »
Interesting script and great results ...
I have a question about the following code section.

Code: [Select]
if u == 1 or u == 2 then -- change focus to min focus
    set_focus((4*fl)/10)
    press("shoot_half")
    repeat
        x = get_focus()
        sleep(100) -- seems to work on G7X & G1X, may need changing on other cams
    until x == get_focus()
    release("shoot_half")
end

Why do you focus on
Code: [Select]
set_focus ((4 * fl) / 10) and not
Code: [Select]
set_focus (0) to get the min focus?
That seems to work with the G1x.

M100 100a, M3 121a, G9x II (1.00c), 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd


Re: Landscape Focus Bracketing Script
« Reply #44 on: 26 / March / 2019, 07:20:05 »
Regarding the use of 4*Fl.


I originally had (0) as you suggest and it works fine.


There is still a little confusion in my mind regarding where is zero for CHDK focus reporting, ie the sensor plane or at some position within the lens.


The 4*Fl is often reported as the min focus of a generic lens relative to the sensor.


Bottom line: I think 4*Fl or 0 will give the same result, ie the lens will focus at its minimum.


Cheers


Garry

*

Offline c_joerg

  • *****
  • 1248
Re: Landscape Focus Bracketing Script
« Reply #45 on: 26 / March / 2019, 13:01:09 »
There is still a little confusion in my mind regarding where is zero for CHDK focus reporting
I thought the values come from the Canon firmware ...
the sensor plane or at some position within the lens.
I find exactly the values that are synonymous in the manual. For the S110, that's 30mm (wide angle). I would say that's the distance from the front lens to the object.
The 4*Fl is often reported as the min focus of a generic lens relative to the sensor.
I haven’t checked my SX50hs yet, but the manual says 0!
M100 100a, M3 121a, G9x II (1.00c), 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd

Re: Landscape Focus Bracketing Script
« Reply #46 on: 26 / March / 2019, 13:18:39 »
If it says zero, then it can’t be the sensor.

As I say, using simple lens theory, ie ignoring the principal planes being separate,  the min focus to the sensor plane is 4*FL. My understanding is that min focus can be more than 4*FL, but not less, unless the lens design is exotic.

Bottom line: unless you are well towards the macro end, the simple theory is good enough...I believe.
« Last Edit: 26 / March / 2019, 13:20:27 by pigeonhill »

*

Offline c_joerg

  • *****
  • 1248
Re: Landscape Focus Bracketing Script
« Reply #47 on: 31 / March / 2019, 08:31:42 »
I've tried the script now. Have fun working with it.
At first, I wondered about the black images. But they really make sense for the post processing.

What you can improve in any case is the speed. You could definitely leave the camera in the press ("shoot_half ") and then only ever perform a press (" shoot_full_only ") and release (" shoot_full_only "). In that case you could run the script in AV mode as well because exposure not change.
I saw another script running in continuous mode. This can be done on a SX50 in burst mode with 6.8 JPG photos / sec.

I have not much experience in the stack. Can you tell me where the artifacts come from (second image)? I use Adobe CS6 for stacking.
M100 100a, M3 121a, G9x II (1.00c), 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd


Re: Landscape Focus Bracketing Script
« Reply #48 on: 31 / March / 2019, 09:03:37 »
@c_joerg

Thanks for the feedback.

Yes I did play around with making it work in all modes, ie other than M, but I’m an M shooter so I decided to satisfy myself first ;-)

The artefacts result from the fact that each image needs to be scaled before focus blending, as we are not using a cine lens.

Photoshop thus does what it thinks is best and masks each layer according.

Have you gone into each layer and corrected the blur? That is manually adjust the masks that PS creates for each layer.

BTW I use Helicon Focus, which allows you to choose different algorithms.

I also use Zerene Stacker. 

Cheers

Garry
« Last Edit: 31 / March / 2019, 15:34:12 by pigeonhill »

*

Offline c_joerg

  • *****
  • 1248
Re: Landscape Focus Bracketing Script
« Reply #49 on: 03 / April / 2019, 04:15:52 »
Yes I did play around with making it work in all modes, ie other than M, but I’m an M shooter so I decided to satisfy myself first ;-)

M is fine for me. But to use the script in the landscape, you definitely have to increase the speed. I don’t think it is complicated to use at least the half press mode.


Have you gone into each layer and corrected the blur? That is manually adjust the masks that PS creates for each layer.

Do you have any example (link) how to adjust the masks manually?

BTW I use Helicon Focus, which allows you to choose different algorithms.
I tried Helicon Focus with all 3 Methods. More or less, however, the problem also occurs here in the same place.


About the Overlap
CoC is none? And default is CoC/2?

From the distance in your log I calculate near and far with the DOF calculator (values attached).
From my experience in the past I could say, setting of focus is not accurate. For example if you write a script which changes the focus always from 1000mm and 10000mm, and then you investigate the pictures with same settings, you will see that the focus differs. That might be a problem with the overlap.


I have a little bit problems to understand which mode

Code: [Select]
X2Inf Mac2Inf Mac2X X2delX
Fits the following description

Quote
In macro mode, eg using Macro2X or X2DelX, the script will take as many images as required, ie without warning how many!

In order to cover various needs, the user can select from the following focusing scenarios:
From the current focus to the blur-defined Infinity
From the minimum focus to the current focus
From current focus to a specified number of mm beyond the current position
From the minimum focus to the blur-defined Infinity
M100 100a, M3 121a, G9x II (1.00c), 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd

 

Related Topics