Crop mode recording (crop_rec.mo) (1:1, RAW/H.264, 25/30/50/60 fps)

Started by a1ex, April 01, 2016, 08:37:14 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DeafEyeJedi

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

markodarko

<I'm re-doing this post after more tests... Will update soon>

markodarko

Thank you to @dmilligan for pointing me to this thread from my own in-camera anamorphic request. I immediately downloaded the build to try it out!  :D

After doing some tests using with the 1x3 Binning mode, and whilst excellent(!), I think that the 3:1 compression (not sure if compression is the right word to use here. I mean the height:width ratio.) is perhaps a little too severe for critical shots but great for shots with less detail. Here are two stills to illustrate:

Here's a still from a video taken with the new 1:1 (3x) crop mode @ 1920x1080 (so great being able to see the framing properly in colour! Thank you!):



And here's a still taken from a video shot @ 1024x1290 in 1x3 Binning mode with the width resized to 3072 and the height cropped by 40 pixels to remove the top black line:



As you can see, the binned image is perfectly useable for non-detail shots and in those circumstances it would be fine (especially considering the lower data rate requirement of shooting at 1024x1290!), but as to be expected with a compression of 3:1 the image is noticeably softer than the native 1:1 image and no longer "looks" like RAW. More like H.264.

Because of this I'm wondering if it's possible to create a binning mode of 1x2 or even a binning mode of 1x1.5 or 1x1.33?

If that is technically possible I think that would greatly add to the functionality you've included here as for example we'd be able to record 1804x1152 @ 1x1.5 to give an aspect ratio of 2.35:1 @ 2707x1152 when stretched. I'd imagine that the image would not suffer too much with such a small squeeze.

Thanks again for your hard work.

Cheers,

Mark.

p.s.
Quote from: a1ex on April 03, 2016, 12:12:17 AM
- 1x3 binning: read all lines, bin every 3 columns (extremely squashed image)

Just as a matter of interest, is this correct with regards to the pixels that are thrown away or kept?


Column 1 - discard
Column 2 - discard
Column 3 - discard
Column 4 - keep
[repeat]

a1ex

The binning patterns are described here: http://www.magiclantern.fm/forum/index.php?topic=16516

and (although I didn't test it), I think they are used in these modified video modes as well.

Therefore, a single line from 1x3 binning would average (x-2,y), (x,y), (x+2,y) to create pixel at (x/3,y), assuming centered coordinates.

Something like this, but without the skipped lines:



markodarko

Quote from: a1ex on April 06, 2016, 07:07:46 AM
The binning patterns are described here: http://www.magiclantern.fm/forum/index.php?topic=16516

Ah. Makes sense now as we're not dealing with debayered pixels but the RGB "blobs" that make up the pixels, of course. Thanks, A1ex. I take it from the photo you attached that the non binned bits are the ones with the green rectangles around them?

Can I take it from the binning pattern post that one must have a pattern in 3s so that equal amounts of red and blue are removed?

a1ex

In that figure, the green rectangle surrounds 3 other green pixels - meaning, those 3 are averaged to create one binned pixel. Same for red and blue.

Indeed, the binning factor has to be 1 or 3 (on vertical direction, 5 also works, since Canon's 720p uses 5x3 binning on 5D3). Check the previous page to see why.

ItsMeLenny

Does this mean that (say on a camera like 550D) when recording in 1920x1080 it can record a a 1920x1080 image cropped to the middle of the sensor, or will it still be a 1728x1156 image (cropped to the middle of the sensor) upscaled to 1920x1080 (like regular)?


markodarko

Thanks for the clarification and information, A1ex.

Cheers,

Mark.

Frank7D

ItsMeLenny, I'm no expert, but 1:1 sounds like no upscaling.

a1ex

Quote from: ItsMeLenny on April 07, 2016, 07:16:33 AM
Does this mean that (say on a camera like 550D) when recording in 1920x1080 it can record a a 1920x1080 image cropped to the middle of the sensor, or will it still be a 1728x1156 image (cropped to the middle of the sensor) upscaled to 1920x1080 (like regular)?

Resolution is not changed, so... 1728 or whatever your camera already records. The image sampled from the sensor is 1:1 crop, but whatever Canon does to process this data (for display, H.264, HDMI out and so on), is left unchanged.

Tip: adtg_gui.mo from the ISO thread works on this codebase without requiring recompilation, so you can already try to figure out which registers have to be changed ;)

ItsMeLenny

Quote from: a1ex on April 07, 2016, 06:56:13 PM
Tip: adtg_gui.mo from the ISO thread works on this codebase without requiring recompilation, so you can already try to figure out which registers have to be changed ;)
I can't find that adtg_gui.mo, searched through a few posts and tried a few search queries and couldn't find it.
I haven't compiled ML in a while so I'll have to re-remember how to do that :P



ItsMeLenny

Looks like I need a "a custom ML build from the iso-research branch" anyway, so when I get round to it I'll compile ML and the module.

markodarko

Quote from: a1ex on April 06, 2016, 07:07:46 AM
The binning patterns are described here: http://www.magiclantern.fm/forum/index.php?topic=16516

Just a quick question if I may, A1ex... If I understand it correctly, does that mean that the "normal" (non-crop mode) recording in ML uses pixel binning but crop-mode recording does not as it's a 1:1 crop of the sensor? If that is indeed the case does that mean that the image quality is potentially better in crop mode?

Please feel free to slap me with a wet fish if I've misunderstood.

Thanks,

Mark.

a1ex

The image quality will differ in two ways:

Noise:
- 1:1 crop is more noisy (3x3 binning captures 9x as many photons)
- DR is similar because, on Canons, the averaging is done in hardware, before the read noise gets introduced; so the main difference will be in highlights.
- side note: a software 3x3 binning (after capturing a full-res image) would actually improve DR by about 1.5  stops.

Example from the above link (ISO 100, 1080p vs 5x crop):


ISO 1600:


On these graphs, X is log2(raw-black) and Y is log2(noise stdev).

Resolution:
- for 3x3 binning, the impulse response is a little different (because of averaging), compared to 1:1 crop
- for 1x3 binning and 3x1 skipping (on cameras other than 5D3), the response is a significantly more different

The 1:1 crop matches the assumptions used in current debayer algorithms (it's what you would get from a still photo raw). The pixel binning modes are close, but not identical. One can exploit this property to create (or modify existing) debayer algorithms optimized for pixel-binned raw images, but I'm not aware of anyone who attempted to do so. Didn't try to search too hard, though.

Licaon_Kter


markodarko

Quote from: a1ex on April 10, 2016, 11:57:46 AM
Noise:
- 1:1 crop is more noisy (3x3 binning captures 9x as many photons)
- DR is similar because, on Canons, the averaging is done in hardware, before the read noise gets introduced;

Thanks A1ex. Did a quick and dirty noise test here if you're interested. Those photos you attached don't seem to show up on my computer though.

So, if the 3x3 binning mode captures 9x as many photons, does that mean that for equal ISOs the 3x3 binning mode will have potentially 9x less noise than in 1:1 crop mode or is that being simplistic?

Cheers,

Mark.

Quentin

I was testing the new development with my new Rokinon 24mm f/1.4 that reached me lately I tried to justify the noisy results.
I trust ML wizards  :-*

a1ex

Quote from: markodarko on April 11, 2016, 12:13:12 AM
So, if the 3x3 binning mode captures 9x as many photons, does that mean that for equal ISOs the 3x3 binning mode will have potentially 9x less noise than in 1:1 crop mode or is that being simplistic?

Are you able to see the graphs from my post? I'm not sure I linked them properly from dropbox. They show exactly how much noise you have and how it changes with signal level.

For example, at ISO 1600:
- in highlights (13 EV, or about 0.7 EV below white) you have noise stdev about 2^5.7 units in 3x3 and 2^7.2 in 1:1, so about 3 times less noise in 3x3.
- in midtones (9 EV, or about 4.7 EV below white) you have noise about 2^3.9 in 3x3 and 2^5.2 in 1:1, so about 2.5 times less noise in 3x3.
- in shadows (3 EV, where signal gets close to noise, or SNR close to 1) you have 2^3 in 3x3 and 2^3.5 in 1:1, so about 1.4 times less noise in 3x3 binning mode, compared to 1:1 crop.

If the 3x3 binning would be done in software, from a full-resolution image (with no extra noise added afterwards), the noise would be 3 times less in the 3x3 binning mode, regardless of signal level.

markodarko

Quote from: a1ex on April 11, 2016, 08:26:07 AM
Are you able to see the graphs from my post?

I'm afraid not. :( They're just dead-image placeholders on my computer. Your textual explanation was enough though. Thank you again, A1ex.

Having thought long and hard about things I think I'm going to stick to recording 1920x803 in 3x3 binning mode instead of worrying about recording 2.5K in 1:1 crop mode like some idiotic megapixel junkie as from my non-scientific tests it seems that the quality of each pixel seems better in the 3x3 binning mode over the 1:1 crop mode - the result of which (now that you are educating me a little) I'm sure is more than likely down to the lower noise per pixel, but of course I could be completely wrong.

Cheers,

Mark.

a1ex

I've copied the files locally, to my dropbox, and linked them again - should be OK now.

hjfilmspeed

Wow this looks Sick!!! Something tells me this will hit the nightlys soon!

hjfilmspeed

What other testing needs to be done with this? Are there specific tests? Things we should try?

a1ex