Author Topic: Full-resolution silent pictures (silent.mo)  (Read 766172 times)

pulsar124

  • Member
  • ***
  • Posts: 120
Re: Full-resolution silent pictures
« Reply #825 on: February 20, 2016, 03:35:40 AM »
I modified my macro rail code to use half-press instead of full press, and did some testing. When camera exposure is set to 0.1s, half-press should be at least 0.8s long to reliably take a silent picture. And I can reliably take a long sequence (at least 100) silent pics if the interval between pics is 4s (MLV format). My camera is 50D, the card is Lexar Pro 1000x.

So up to now it seems like it might work with my focus stacking rail. The critical test will be (after a bit of soldering) to connect both camera and external flash to my rail, and to see if I can come up with a fixed delay (plus play with different exposures) for the flash to work reliably.

It is a good timing, as I just (finally) received the RMS-EOS adapter for my new microscope objective, which will give me 10:1 macro magnification.

pulsar124

  • Member
  • ***
  • Posts: 120
Re: Full-resolution silent pictures
« Reply #826 on: February 22, 2016, 03:08:41 AM »
I've spent half a day today trying to figure out shortest timings which would enable flash use with FRSP. I used my modified Arduino rail for that, with two circuits controlling separately camera's half-press and flash. As expected, flash worked reliably once you make exposure very long (say 5s), and trigger the flash half way through exposure. Then I tried to reduce exposure as much as possible, and arrived at the following timings which seem to work well on my 50D (using DNG format; my card is Lexar 1000x):

 Exposure: 0.8s;
1) t=0s: enable half-press;
2) t=0.9s: trigger flash
3) t=1s: release flash and half-press;
4) t=6s: go back to 1st step.

The 0.8s exposure happens somewhere between steps (1) and (4). The exposure is long enough to absorb any variations in the delays between the half-press and the actual capture. It needs at least 6 seconds between shots for reliability, which is fine as this is a normal delay used in focus stacking to let the camera vibrations from the rail motions to settle down.

I ran a long test with the above timings - 283 shots (almost 30 minutes), and all the shots where perfectly exposed by the flash except for a single black shot. The timings will be different for different cameras, and likely different for different memory cards.

But I think overall this is a good news - it looks like the full resolution silent picture feature is totally usable for macro focus stacking photography, with and without a flash. One needs fairly long exposures for this to work reliably (0.8s for my 50D), which will require a fairly dark studio environment (extreme macro is done at effective apertures f/20 or smaller, which helps). Also I need to check if noise becomes a problem - in the past I saw quite a bit more noise with exposures of a few seconds, compared to exposures 1/100s or shorter.

I plan to release soon the new version of my Arduino macro rail software with the support for the FRSP feature. (It already works, just needs to be thoroughly tested.)

This was all done with DNG format. For some reason MLV didn't work for me - perhaps I just need to spend more time on that.

For some reason I cannot see DNG shots inside my camera (they are totally invisible) - can anyone tell me if I am doing something wrong here? These are the modules I loaded: mlv_play, mlv_rec, pic_view, silent. The ML is the nightly from a few days ago.

pulsar124

  • Member
  • ***
  • Posts: 120
Re: Full-resolution silent pictures
« Reply #827 on: February 22, 2016, 09:05:53 PM »
This is the picture I have about FRSP, which suggests the best way to trigger the flash. Please let me know if you find serious flaws with this picture.

FRSP + flash by First Last, on Flickr

Horizontal line is the time axis. Large red rectangular curve is the half-press button - zero when it is not pressed, at a high position when pressed. The duration of the press is dt_AF - it should be long enough for ML to interpret this as a silent picture (not as a command to switch to Live View). In my tests dt_AF=0.8s or more for Canon 50D.

I am assuming that the time from initiating a shot (the rise of the red curve) to the time when light capturing starts, simultaneously by all pixel rows, is variable, with sort of normal (Gaussian) probability distribution (the blue bell curve). dt_exp after the light gathering started, the very top pixel row stops gathering light (followed later by the rows below). dt_exp=top_row_exposure_time (measured to be ~1/30s for my 50D by people in this thread) + the camera exposure time, and should have a fixed (not variable) value. (Or perhaps it is the maximum of the two values, not their sum?) So the end of light capture will have the same bell shape as the blue line, just shifted to the right by dt_exp.

The top panel shows the situation when camera exposure is short (say 0.1s or less), resulting in the blue and green bell curves partially overlapping. Now you can see there is no perfect spot to trigger the flash; the best spot (thick black vertical line) is half-way between the bell curves, but even there there will be some shots (represented by the green filled area) where the light capture of the top row ended before the flash - resulting in some (or all) of the top rows being dark. For a similar fraction of shots (represented by solid blue area) flash goes off even before the capture started, which will always result in all rows being black.

So let's increase the camera exposure! (Bottom panel). Now the two bell curves are well separated, so one can choose such a time to trigger the flash (at a later time, compared to the top panel) when neither "capture ended before the flash" nor "flash goes off before the capture" problems ever happen. (Well, if the distributions are truly Gaussian - which I doubt - there still will be a very small chance of the either problem happening; but this will affect only a tiny fraction of all shots).

I think these plots (if they indeed capture the essence of what's going on) give a good idea regarding how to choose the three time delay parameters involved - dt_AF, dt_exp, and dt_flash.  In particular, camera exposure should be comparable or larger than the total width of either of the bell curves. (From my measurements, it is ~0.8s for 50D).  It is also obvious that dt_flash is a function of exposure - the larger the exposure is, the larger dt_flash becomes (it always tracks the half-way point between the two bell curves.)

I hope this will help other people interested in using a flash with FRSP, for macro focus stacking.

mothaibaphoto

  • Senior
  • ****
  • Posts: 393
  • pesky kid
Re: Full-resolution silent pictures
« Reply #828 on: February 23, 2016, 04:51:57 AM »
Great info, thanks. Regarding saving format - saving to DNG is slow and drains battery, as it involves some data manipulations while MLV simply dumps sensor output.
Yes, there is no in-camera dng viewer, you can try activate mlv_play module for MLV, but i'm not shure if it can render so big frames.
What exactly your problem with MLV?

pulsar124

  • Member
  • ***
  • Posts: 120
Re: Full-resolution silent pictures
« Reply #829 on: February 23, 2016, 03:23:02 PM »
I think I just didn't spend much time trying to find good timings for MLV. I tried to use the DNG optimal timings with MLV, and all but first frames were black, so some more tinkering is needed.

Too bad that I cannot see DNG files inside the camera. For extreme macro focus stacking (typically 300 shots or more for a single stacked photo) I need a solution where I can pause stacking if something goes wrong (e.g. flash gets overheated, or battery dies), check inside the camera how many recent shots are bad (black), and then rewind the corresponding number of frame positions on my rail, and restart stacking.

I don't really have experience with MLV format - will it allow me to see recent individual shots inside camera easily? If yes, how to do that?

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Full-resolution silent pictures
« Reply #830 on: February 23, 2016, 04:55:54 PM »
Do you have image review enabled in Canon menu?

I don't see why MLV would give different times - the saving process is done after the image was fully captured (no pipelining or parallel tricks).

pulsar124

  • Member
  • ***
  • Posts: 120
Re: Full-resolution silent pictures
« Reply #831 on: February 23, 2016, 04:59:57 PM »
^ Yes I do have image review enabled - is it a problem? I actually need it to see live if the shot I just made was properly exposed by the flash (when testing), and to see if my stacking is progressing well (when doing focus stacking).

I am puzzled myself about MLV not working with flash - I need to do more testing to figure out what's going on.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Full-resolution silent pictures
« Reply #832 on: February 23, 2016, 05:01:38 PM »
You need it enabled to see the previews. Do you get a preview when taking a silent picture manually?

pulsar124

  • Member
  • ***
  • Posts: 120
Re: Full-resolution silent pictures
« Reply #833 on: February 23, 2016, 05:04:37 PM »
Yes I do see preview. I only take silent pics manually (from my Arduino macro rail, via camera shutter  cable).

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Full-resolution silent pictures
« Reply #834 on: February 23, 2016, 05:08:06 PM »
Then... the issue is?

Quote
Too bad that I cannot see DNG files inside the camera.

mothaibaphoto

  • Senior
  • ****
  • Posts: 393
  • pesky kid
Re: Full-resolution silent pictures
« Reply #835 on: February 23, 2016, 05:12:12 PM »
I don't really have experience with MLV format - will it allow me to see recent individual shots inside camera easily? If yes, how to do that?
Interesting question, as i never tried to watch my recorded timelapses on camera - i simply have no reason for that, as it's usually to late to fix anything when it done :) I just take MKII wich i use for timelapses, shot some silent MLVs, activated mlv_play, press play... and nothing :( Then I activated file_man, opened folder (It's in Debug menu), choose "View" - and there it works :)

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Full-resolution silent pictures
« Reply #836 on: February 23, 2016, 05:19:10 PM »
You can view DNG files in the same way, with the pic_view module (just not as animation).

pulsar124

  • Member
  • ***
  • Posts: 120
Re: Full-resolution silent pictures
« Reply #837 on: February 23, 2016, 05:20:40 PM »
a1ex: I need to see a few last shots I took, not just the last one, and not just for a second. When a flash dies e.g., by the time I paused the rail could already 3-5 shots behind.

mothaibaphoto: The only modules I loaded were mlv_play, mlv_rec, pic_view, silent. So you are suggesting I also need to load file_man, and the look for the recent photos in the Debug/Folder section?

My other grip with MLV is that it seems to always adding new pics to the same MLV file, even after I leave LV and re-enable it, so it ends up merging totally unrelated focus stacking sequences. Is there a way to start new MLV file when I want?

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Full-resolution silent pictures
« Reply #838 on: February 23, 2016, 05:28:55 PM »
To start a new MLV file, turn off the intervalometer, then turn it back on.

Creating a new MLV file when exiting LiveView could be a nice enhancement.

pulsar124

  • Member
  • ***
  • Posts: 120
Re: Full-resolution silent pictures
« Reply #839 on: February 23, 2016, 05:30:56 PM »
But I don't use intervalometer! It is fully externally operated (from my macro rail). So it looks like I need to enable and then disable intervalometer to start a new MLV file?

Another question (sorry could find the answer in this thread): do silent pics get any long exposure noise reduction inside camera? I suspect noise will be the biggest issue, when comparing regular shots with a flash (exposure 1/160s) vs silent pics with a flash (exposure 0.8s).

mothaibaphoto

  • Senior
  • ****
  • Posts: 393
  • pesky kid
Re: Full-resolution silent pictures
« Reply #840 on: February 23, 2016, 05:50:54 PM »
Just pressed halfshutter twice and get one MLV file, but expected two, strange. mlv_play won't play it: "Error: GUID withing the file chunks mismatch!"
bugs... :(

pulsar124

  • Member
  • ***
  • Posts: 120
Re: Full-resolution silent pictures
« Reply #841 on: February 23, 2016, 05:52:36 PM »
I didn't have issues reading MLV files on a PC (I used Mystic soft), except for the fact that different focus stacks were merged in a single huge MLV file.

I think this post by g3gg0 is relevant:

http://www.magiclantern.fm/forum/index.php?topic=12523.msg138135#msg138135

In particular,

Quote
updated silent.mo with this stuff:
 - allow user to choose between DNG, Single-Frame-MLV and Multi-Frame-MLV (disable and re-enable "Silent Pic" from menu to start a new file in Multi-Frame-MLV mode)

So the way to start a new MLV file is to disable and re-enable "Silent Pic" from menu - I wonder if it is still the case?

Also, it is interesting that there used to be a Single-Frame-MLV option - I think that would work better for macro focus stacking. Any chance it could be resurrected?

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Full-resolution silent pictures
« Reply #842 on: February 23, 2016, 06:10:02 PM »
But I don't use intervalometer! It is fully externally operated (from my macro rail). So it looks like I need to enable and then disable intervalometer to start a new MLV file?

In this case, simply opening ML menu and closing it should do the trick. Look for "mlv_file_frame_number = 0" in silent.c and check the comments.

Quote
do silent pics get any long exposure noise reduction inside camera?

If you are referring to subtracting a dark frame taken at the same exposure settings (like Canon does), that will actually multiply the noise by 1.41x.

Instead of doing that, I'd recommend averaging at least 16 dark frames. If sensor heating up is an issue, you could take 16 frames at the beginning of the experiment, then 16 at the end, and interpolate between them.

Here's why I recommended 16 (and not 2 or 300): https://wiki.apertus.org/index.php/Black_Calibration#How_many_dark_frames.3F

Or, there is a very nice idea here: you could measure the hot pixels to estimate the dark current (so, you can just sit down, take a series of dark frames at different exposures after the timelapse, and then compute a dark frame fine-tuned for each particular image from your timelapse, using those hot pixels). I actually have a proof of concept code based on this idea here, but it needs some tweaking in order to make it compatible with Canon files.

DeafEyeJedi

  • Hero Member
  • *****
  • Posts: 3411
  • 5D3 | M1 | 7D | 70D | SL1 | M2 | 50D
Full-resolution silent pictures
« Reply #843 on: February 23, 2016, 06:10:10 PM »
Creating a new MLV file when exiting LiveView could be a nice enhancement.

+1
5D3.113 | 5D3.123 | EOSM.203 | 7D.203 | 70D.112 | 100D.101 | EOSM2.* | 50D.109

pulsar124

  • Member
  • ***
  • Posts: 120
Re: Full-resolution silent pictures
« Reply #844 on: February 23, 2016, 06:24:12 PM »
a1ex: Thanks, lots of useful info!

I was actually hoping that with the exposures I need for focus stacking + flash (~0.8s at ISO100) noise will not be an important issue. I will do some testing.

So here is a summary of pluses and minuses of FRSP + flash used for macro focus stacking:

+ Mechanical parts (shutter and mirror) are not wearing off (with 300+ shots per single macro photo this could be huge cost saving);
+ Much less vibrations (=sharper photos), especially for extreme macro stacking (10:1 and up), when camera movements are small (<10 um), so shutter and mirror movements become the dominant source of vibrations;
- Shots are noisier (to be tested how seriously)
- Frame rate is limited to one shot per 6s (on my 50D) - so not suitable for live insects
- Requires a dark studio (because of the 0.8s exposures; probably not so bad with typical extreme macro effective apertures f/20 or less and ISO 100)

pulsar124

  • Member
  • ***
  • Posts: 120
Re: Full-resolution silent pictures
« Reply #845 on: February 24, 2016, 09:36:55 PM »
I am happy to report here that after doing more testing of FRSP + flash (for macro focus stacking purposes) I got much better timings. Specifically, I managed to reduce the camera exposure from 0.8s down to 0.25s, with the same level of reliability (only one black frame out of 284 shots - similar to my previous best case scenario with 0.8s exposure). I actually did a few changes compared to my previous setup, not sure which of them was the main culprit for much better timings. In particular, I switched to MLV from DNG; I put to "Auto" long exposure noise reduction in my camera (it was "Always on"); and I significantly extended the shutter half-press time (from ~1s to ~2s). I am still using the same 1 shot every 6s frame rate. (Will try to reduce it in future tests.) By the way, I didn't realize that the timing of when you depress half-press also matters (before I assumed only the timing of engaging the half-press matters).

The new setup has the following sequence of events (camera: 50D; exposure: 1/4s; MLV format; Lexar 1000x card):

1) 0.0s: the half-press is enabled
2) 1.1s: external flash is triggered
3) 2.0s: the half-press is disengaged
4) 6.0s: going back to step (1)

A small caveat: the first shot is always black with the above settings, if you start from the Live View screen. There is a simple workaround for that: before starting focus stacking, briefly press the camera's half-shutter: the camera will take one shot (dark; one can use it later to fix hot pixels in your stack) and will exit LV (black screen). Now if you initiate focus stacking with the above timings, all the frames - including the first one - will be flash exposed.

Second important finding: this morning I made a number of dark frame shots at different exposures (from 1/160s to 0.8s), using both regular shutter and FRSP. When I processed them in the same fashion (using command line dcraw utility:  dcraw  -T -6 -W -b 500 file_name ; this command increases the brightness of dark shots by a factor of 500x, to make noise much more obvious), I didn't see a significant difference in the noise levels of all these shots, made both with shutter and FRSP.

Specifically, I wanted to compare the situation when I am doing focus stacking using shutter with 1/160s + external flash versus FRSP at 1/4s + flash. Be the judge: here are the two corresponding dark frames, brightened by the same factor (500x), and the noise seems to be pretty much at the same level in both cases:

Noise test: FRSP at 1/4s by First Last, on Flickr
Noise test: shutter at 1/160s by First Last, on Flickr

This alleviates the biggest concern I had with using FRSP + flash for focus stacking - the noise level (because of the longer exposure).

So now, with significantly shorter exposures (1/4s - meaning your studio doesn't have to be very dark) and the quality of the shots being the same or even better (same noise levels; mirror/shutter caused vibrations are eliminated), FRSP seems to be a great tool for macro focus stacking with an external flash - if you have the proper gadget (like my Fast Stacker) to trigger both camera and flash with specified time intervals, ans also to move the camera between shots. I will be releasing very soon the next public version of my rail's software (v1.14) which adds the FRSP support for Canon cameras.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Full-resolution silent pictures
« Reply #846 on: February 24, 2016, 10:05:39 PM »
Well, holding the shutter halfway a little more will simply delay the preview (and also the file saving process, which happens after that). It should not affect the capture timing.

It may be helpful to make a small change: to wait for half-shutter release before capturing the image (right before the call to FA_CaptureTestImage). This should give the minimal variation between your external signal (half-shutter release) and the actual capture time.

For even more precise timing, it's much harder, but doable: one needs to add a hook right into Canon's picture taking code, before initiating the exposure. But reducing the exposure below 0.25s is not going to improve the noise, so I don't think it's worth the trouble.

pulsar124

  • Member
  • ***
  • Posts: 120
Re: Full-resolution silent pictures
« Reply #847 on: February 24, 2016, 10:43:45 PM »
My speculation is that extending half-shutter separates well the two points in time when camera's cpu gets very busy: around the time when the capture takes place, and when the captured image gets processed and written to the card. Because they are well separated, there is enough of time for the cpu to "settle down" between the events, which is perhaps why timings become more predictable.

I agree that trying to make timings much better than 1/4s is probably not worth the efforts - no advantage in terms of noise, and in terms of how dark the studio should be (because FRSP cannot  have effective exposure shorter than ~0.14ms - capture time for 50D). I think it is already very good as is.

raphaeloo

  • New to the forum
  • *
  • Posts: 5
Re: Full-resolution silent pictures
« Reply #848 on: February 25, 2016, 08:22:56 PM »
Has anyone tried the new Burst mode? I've gos some nice results but I can't figure out how to increase the buffer from 15 frames to more. Would be nice to have some slow-motion footage done this way.

Even with Burst-End trigger i still get 15 frames.

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Full-resolution silent pictures
« Reply #849 on: February 27, 2016, 05:53:14 AM »
Well this is OT b/c there is no burst mode for FRSP, only simple silent pics, but: you can get a little more memory by using SRM job memory in addition to the shoot malloc. The memory suites work the same way and there's already code to allocate the shoot malloc suite, so it should be straight forward to add SRM.
Code: [Select]
hSuite = srm_malloc_suite(0);

Of course there's not much real difference between doing this and just shooting raw video.