Magic Lantern Forum

Developing Magic Lantern => Feature Requests => Topic started by: DigitalVeil on January 05, 2015, 07:03:42 PM

Title: Video crop mode: adjust crop factor?
Post by: DigitalVeil on January 05, 2015, 07:03:42 PM
Currently, crop mode is just limited to "on" and "off" and the only option is 3x crop.  Would it be at all possible to set custom crop factors, like 1.5x, 2.5x, etc?  If possible, I feel this would be a useful feature.
Title: Re: Video crop mode: adjust crop factor?
Post by: dmilligan on January 05, 2015, 07:59:35 PM
No, it's because of the nature of the CFA (http://en.wikipedia.org/wiki/Color_filter_array).

You can either read every pixel (3x crop), or skip lines* and read every 3rd line (non-crop mode). You can't skip non-integer number of lines (obviously), and you can't skip every other line because you'd end up with either only red and green pixels (no blue data) or only blue and green pixels (no red data).

I suppose you could skip 1 of every 3 lines (read 2 lines, skip 1, read 2, skip 1 etc.). You'd have pixel data for every color, but you'd end up with a really strange bayer pattern, that you'd probably have to write your own custom demosaicing algorithm. This would also require extensive reverse engineering (we don't know how to implement custom readout schemes like this on CMOS or if it's even possible => my bet would be it's not even possible).

You could also theoretically skip differently horizontally vs. vertically (you could read every column, but only every third row). This might be useful for anamorphic lenses. But again, this would require custom readout mode which we don't know how to do, or if it's even possible.


*There is evidence that the 5D3 bins pixels instead of skipping them, but the limitation remains.
Title: Re: Video crop mode: adjust crop factor?
Post by: DigitalVeil on January 05, 2015, 08:32:23 PM
Thanks dmilligan.  I appreciate that you're willing to take the time and explain these things, it's a lot more helpful and educational than simply saying "no" with a snarky attitude like some other members of this forum will do from time to time.  I know that nobody "owes" an explanation to anybody, so it's nice having people who are willing to explain.

I was hoping that it would be possible to read every 2nd line instead of every 3rd line, but oh well! Marked impossible for now.
Title: Re: Video crop mode: adjust crop factor?
Post by: a1ex on January 05, 2015, 08:38:44 PM
I was hoping that it would be possible to read every 2nd line instead of every 3rd line, but oh well!

That's possible - take a look here: http://www.magiclantern.fm/forum/index.php?topic=10111.msg125694#msg125694
Title: Re: [IMPOSSIBLE]Video crop mode: adjust crop factor?
Post by: dmilligan on January 05, 2015, 08:56:45 PM
So it's possible, but not particularly useful for full color recording for the reasons I mentioned (I suppose you could do b&w with it perhaps)?
Title: Re: [IMPOSSIBLE]Video crop mode: adjust crop factor?
Post by: DigitalVeil on January 05, 2015, 10:31:41 PM
That's possible - take a look here: http://www.magiclantern.fm/forum/index.php?topic=10111.msg125694#msg125694

Gotcha.  Possible, but probably not practical for anything other than maybe black&white.
Title: Re: Video crop mode: adjust crop factor?
Post by: Greg on January 05, 2015, 11:45:35 PM
http://www.magiclantern.fm/forum/index.php?topic=10111.msg125426#msg125426

Possible, but the colors are crazy  ;D

(https://www.magiclantern.fm/forum/proxy.php?request=http%3A%2F%2Fs3.postimg.cc%2Fhel956xeb%2FVRAM1.png&hash=b344a369ac5b296f9f5f41194a659840)(https://www.magiclantern.fm/forum/proxy.php?request=http%3A%2F%2Fs3.postimg.cc%2F5y9sa1cwj%2FVRAM0.png&hash=ba9ab517ff93bb8d7b8bba8d5756a02c)(https://www.magiclantern.fm/forum/proxy.php?request=http%3A%2F%2Fs3.postimg.cc%2Ffk3cqc42b%2FVRAM2.png&hash=886994fff9760f86fae1995aeed69739)
(https://www.magiclantern.fm/forum/proxy.php?request=http%3A%2F%2Fs3.postimg.cc%2F6qcg98h3n%2FVRAM3.png&hash=80d4394056d7ffe9537ef2a64c04a9e5)(https://www.magiclantern.fm/forum/proxy.php?request=http%3A%2F%2Fs3.postimg.cc%2Fql3jsh2mr%2FVRAM4.png&hash=11be0f427d67fc24bad422e0950e3622)


This can be useful in 60FPS raw video

If 5D3 have 1920x672 1.61x
It may have 1920x672 1.0x
Title: Re: Video crop mode: adjust crop factor?
Post by: DigitalVeil on January 06, 2015, 12:57:17 AM
You can just color-grade the living crap out of it right?  :P
Title: Re: Video crop mode: adjust crop factor?
Post by: Greg on January 06, 2015, 05:10:27 AM
Processing ACR 2012 can recover the color when one channel is clipped.

To check if this works, just take a picture of a red or blue filter. Red or blue channel must be clipped.
If it's working, just create a converter.

But all this does not make sense. Currently we can not change the size of the raw buffer.
We can only change the aspect ratio - http://www.magiclantern.fm/forum/index.php?topic=10111.msg123909#msg123909

Later we encounter the problem of writing speed :P
My camera write only 20MB/s