Focus bracketing scripts sometimes stops at "shoot" command - page 5 - Script Writing - CHDK Forum

Focus bracketing scripts sometimes stops at "shoot" command

  • 76 Replies
  • 10046 Views
Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #40 on: 01 / January / 2013, 13:05:51 »
Advertisements
This one is really pushed to the limit with max optical and digital zoom (12 x 4)


That is not a good idea.
Stacking macro shots for extended depth-of-field is easy these days.
However, for the highest quality shots that means maximising resolution which depends on aperture, magnification and sensor pixel size.
In simple terms, at any particular aperture and magnification the smallest resolvable spot needs to cover two or three sensor pixels and no more, otherwise you are just producing a smaller field-of-view with no increased detail.


Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #41 on: 01 / January / 2013, 13:22:12 »
Thanks lapser.
Dead for sure. Its a female Hylemya vagans, about 6,5 mm in bodylength.

The script works well without flash, but I find it hard to get the correct colours indoors ( see the attached photo, which is done with "normal" lightbulbs).
It should work very well outdoors with a tripod, if the bug doesnt move.

I used the focus bracketing in CHDK menu, before, but the linear focus-steps between each photo doesn´t work well enough if you take many shots. You also have to change the steps depending on zoom, f, etc.
Thats the reason I did this script with get_dof. Now I have a universal(?) script that works automatically, with or without the Raynox, and for every zoom, f, and focus distance  :D

With Phils solution, the missing shots are not a problem any longer, because the script automatically takes a new shot at the same focus.

If you need testing of your solution, just let me know.

Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #42 on: 01 / January / 2013, 13:41:24 »
@Microfunguy

If I , for identification purpose, need a fullframe shot of the arista, should it be possible to get better detail if I zoomed out or changed the f ?

Another way to put it:
Does f3,2 always give better details when stacked, than less shots with f5,6 (Both covering the same "DOF" ) ?

Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #43 on: 01 / January / 2013, 17:24:09 »
First of all, the detail that can be resolved depends on the objective aperture.
For a perfect lens, the wider the aperture the finer the detail resolved and the smaller the depth of the field.
There are lenses that are perfect in the sense that the detail they can resolve is limited only by the Laws of the Nature, due to the wave nature of light.
Imagine water waves hitting a large obstacle such as a sea wall.
They will be reflected and from the reflections you can infer the shape of the wall.
Now, imagine them hitting a small rock, they will just go around it, no waves will be reflected, you would not even know that it is there.
The same with light .. as we go to higher and higher magnifications we can detect smaller detail but it becomes more and more fuzzy.

Camera lenses are not perfect lenses in that sense, they normally have to be stopped down slightly, or at least that was the situation with film-camera lenses.
For technical reasons, on small sensor cameras the apertures are already far smaller than the same numerical aperture on a film camera lens.
On my S95, f2.0 is equivalent to f9 on a film camera as far as depth-of-field is concerned.
Any reduction in aperture will result in loss of resolution.
Zooming reduces the effective aperture.

So, you have to decide if you are going to shoot at wide-angle or zoomed and then do tests at various magnifications.
Pick a subject with very fine detail, such as a memory chip with transparent window.
In your photo editor, zoom to see which details are just resolved.
You will see that above a certain magnification you are not resolving any more detail even though the magnification is greater.
Use that aperture and magnification for your stacks.


*

Offline lapser

  • *****
  • 1093
Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #44 on: 02 / January / 2013, 04:27:16 »
Would you mind doing one more test with the original shoot version? I modified shoot to hold the shutter button down until the camera starts shooting a picture, before letting it up. Theoretically, the new version should not hang or miss any shots.

You can also shoot at higher speed with this version, if you start with "half_shoot" pressed. The attached Lua test script demonstrates this. Press <set> after starting the script to move on to the high speed test.  It works with the flash on my camera. It may or may not work with set_focus, depending on the camera focus mode. I  think in manual focus, set_focus works in half_shoot, but I'm not sure.

I've posted more details about the changes here:

http://chdk.setepontos.com/index.php?topic=9172.msg95187#msg95187

Thanks again for your help in testing.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #45 on: 02 / January / 2013, 06:18:27 »
@Microfunguy
Thanks for the explanation. I will do some tests to see what works best for me.

@lapser
It did hang after 88 shots (with flash). Maybe longer intervals between the hangs, but not working until the end.
« Last Edit: 02 / January / 2013, 06:20:33 by skrylten »

*

Offline lapser

  • *****
  • 1093
Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #46 on: 02 / January / 2013, 10:20:58 »
@lapser
It did hang after 88 shots (with flash). Maybe longer intervals between the hangs, but not working until the end.
OK, thanks for testing it! Bugs that happen only occasionally are the worst.   Would you mind testing it again  in continuous drive (burst) mode?

The existing shoot(), including philmoz's version, leaves the shutter up most of the time, and does a quick UP-DOWN-UP cycle to take the shot. My theory is that the camera misses the brief down-click. Phil's change prevents the hang, but not the missed shots.

My version holds the shutter down from the start of SHOOT until the end of the shot. When you do another shoot() immediately after the last one, with no delay, you have a quick DOWN-UP-DOWN cycle.  It's possible that the shutter doesn't stay UP long enough for the camera to recognize it . So even if the shutter is down, it won't take the shot in single drive mode. But in continuous mode, if the shutter is down when the camera is ready for the shot, it takes the shot.

If I'm correct, it shouldn't ever hang or miss shots in continuous mode with my changes. Well, both versions wait for the flash to be ready, so if there's not enough battery left to charge it, that might hang either version. It would also probably shut down the camera. Have you had this happen?

Thanks again for your help in figuring this out.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #47 on: 02 / January / 2013, 11:42:30 »
@lapser
I installed your version on-top of the existing one. Is that correct ?
After physically pressing the button to get into continuous mode, I made two testruns.
Both stopped (after 38 and 49 shots).

I always use the poweradapter for the tests.

I did one test without flash with no problems (300 shots).

If I remember correct, I have only seen the script hang once, without flash (with a long TV ~2s), but I might be wrong (bad memory   :-[ )


*

Offline lapser

  • *****
  • 1093
Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #48 on: 02 / January / 2013, 13:16:25 »
@skrylten

Yes, it installs over the existing version, in the root directory, and over-writing anything already there.

It would be interesting to try putting the sleep calls back in before shoot and after shoot with the new version. Also, if you can try the Lua test script with flash (no set_focus), and see if that hangs, that would help too.  Another idea is to put the camera in manual focus mode before starting the script.

I'll scratch my head for awhile and see if I can figure out what's happening. Thanks again for all the testing.

EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

*

Offline lapser

  • *****
  • 1093
Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #49 on: 04 / January / 2013, 02:28:00 »
@skrylten
I'll scratch my head for awhile and see if I can figure out what's happening. Thanks again for all the testing.
My head is now well scratched, and I think philmoz's change is probably the way to go about it for now. The failures are probably related to the extra time it takes to focus and charge the flash, as well as the timing of the shoot button press.

The only improvement to Phil's idea I can think of is to try another shot if the first one fails, before returning from shoot(). Have you ever had 2 failures in a row with Phil's version of CHDK? If it works, you could eliminate the return value Phil added to shoot(). It would be much better to take the shot, even if you have to try twice, than return without doing anything, or require extra script code to handle such a rare occurrence.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

 

Related Topics