Magic Lantern Forum

Developing Magic Lantern => Feature Requests => Topic started by: sparedog on February 17, 2013, 12:49:39 AM

Title: [DONE] Peripheral Illumination Correction for non canon lenses
Post by: sparedog on February 17, 2013, 12:49:39 AM
I own some non canon zoom lenses, like the Tamron 24-70mm, and would like to use Peripheral Illumination Correction during video.

This cant be replicated in post production, because during video the aperture and focal distance is lost.

But we have the information available in programs like photoshop and lightroom. So is it possible to hack one of the Canon lens Peripheral Illumination Correction profiles I wont ever use, replace its contents with the details for the Tamron 24-70mm, and load that into the camera?



Title: Re: Peripheral Illumination Correction for non canon lenses
Post by: Marsu42 on February 17, 2013, 10:18:53 PM
Quote from: sparedog on February 17, 2013, 12:49:39 AM
So is it possible to hack one of the Canon lens Peripheral Illumination Correction profiles I wont ever use, replace its contents with the details for the Tamron 24-70mm, and load that into the camera?

As I'm going to buy the Tamron 24-70 I'd be interested in this, too, but I have to mention that the Tamron has quite another, stronger vignetting profile than any Canon I can think of and also another CA profile (for digic5 6d/5d3) - so I doubt if simply applying another profile would be really helpful. The real trick would be to upload a custom profile (through eos utility) for 3rd party lenses, but I imagine Canon went to some lengths to prevent that.
Title: Re: Peripheral Illumination Correction for non canon lenses
Post by: sparedog on February 18, 2013, 01:02:17 AM
Quote from: Marsu42 on February 17, 2013, 10:18:53 PM
As I'm going to buy the Tamron 24-70 I'd be interested in this, too, but I have to mention that the Tamron has quite another, stronger vignetting profile than any Canon I can think of and also another CA profile (for digic5 6d/5d3) - so I doubt if simply applying another profile would be really helpful. The real trick would be to upload a custom profile (through eos utility) for 3rd party lenses, but I imagine Canon went to some lengths to prevent that.

yes, that is kinda what I mean, to upload a custom profile, but to contain it in a Canon wrapper, so that the EOS Utility has no problems passing it to the camera.
Title: Re: Peripheral Illumination Correction for non canon lenses
Post by: sparedog on March 07, 2013, 12:30:30 AM
Is this at all possible? I used to play around with res edit and change properties within files. Could this be done with the eos utily, open one of the canon lenses and type in the figures i want it adjust by?

Or am I flogging a dead horse?
Title: Re: Peripheral Illumination Correction for non canon lenses
Post by: g3gg0 on March 07, 2013, 11:40:39 AM
we are currently investigating this question.
Title: Re: Peripheral Illumination Correction for non canon lenses
Post by: Rush on March 08, 2013, 12:12:07 AM
I have Canon 17-55/2.8 lens with 600D and still can't turn on this feature. What I need to do to enable it with canon lens?
Title: Re: Peripheral Illumination Correction for non canon lenses
Post by: 1% on March 08, 2013, 12:13:38 AM
Canon menu -> 1st box. Peripheral ilumin. correct

You can upload more profiles with eos utility.
Title: Re: Peripheral Illumination Correction for non canon lenses
Post by: Rush on March 08, 2013, 12:52:36 AM
Thanks 1%.

Just did some comparison before/after. I'll stick to no correction, because with this option on I lose dynamic range and get more noise instead.
For real, I like some vignetting and usually add it in post.

Peripheral ilumin. correct TURNED ON:
(http://i.imgur.com/9dEa9fK.png)

Peripheral ilumin. correct TURNED OFF:
(http://i.imgur.com/djxlGqy.png)
Title: Re: Peripheral Illumination Correction for non canon lenses
Post by: 1% on March 08, 2013, 01:06:36 AM
As with all these things, the pc does it better.
Title: Re: Peripheral Illumination Correction for non canon lenses
Post by: g3gg0 on March 08, 2013, 10:07:38 AM
how about video lens correction?
Title: Re: Peripheral Illumination Correction for non canon lenses
Post by: Marsu42 on March 08, 2013, 01:17:02 PM
Quote from: 1% on March 08, 2013, 01:06:36 AM
As with all these things, the pc does it better.

But if shooting 8bit jpeg in-camera vignetting control gives better iq because afaik it's applied *before* color reduction (other than 14 bit raw output) - and with some wide angle primes vignetting on open aperture is so heavy it's important to see the corrected preview in camera, same goes for ca (digic5)

Quote from: g3gg0 on March 08, 2013, 10:07:38 AM
how about video lens correction?

Indeed, that's why having 3rd party profiles would be very nice - like for the Tamron 24-70vc which has image stabilization other than Canon's 24-70 versions.
Title: Re: Peripheral Illumination Correction for non canon lenses
Post by: Indy on March 08, 2013, 04:22:46 PM
See http://www.magiclantern.fm/forum/index.php?topic=4729.msg28083#new
Quote from: g3gg0 on March 07, 2013, 11:40:39 AM
we are currently investigating this question.
Title: Re: Peripheral Illumination Correction for non canon lenses
Post by: a1ex on March 09, 2013, 09:54:40 AM
Mystery solved :)

https://bitbucket.org/hudson/magic-lantern/commits/57509d0efc21

How? By connecting the dots between the latest discoveries from g3gg0 and indy (http://www.magiclantern.fm/forum/index.php?topic=4729.msg27887#msg27887) and the results from DIGIC poke investigations (http://magiclantern.wikia.com/wiki/Register_Map/Brute_Force).

Vignette correction works just like the other DIGIC image effects, and we can fine-tune the exposure according to the distance from image center. The correction value can be from 0 to 1023, which maps to 0 ... +1 EV.

Edit: this seems to work only on old cameras (doesn't work on 5D Mark III). Booo...
Title: Re: Peripheral Illumination Correction for non canon lenses
Post by: Indy on March 09, 2013, 09:58:53 AM
How are used the lens00.bin tables to produce Digic correction data ? how are used aperture and focal ?

Indy
Title: Re: Peripheral Illumination Correction for non canon lenses
Post by: a1ex on March 09, 2013, 10:03:01 AM
They aren't used in ML; g3gg0 found out that C0F08578 is index, C0F0857C is data, and with this info we wrote our own implementation from scratch (which overrides Canon's correction completely).
Title: Re: Peripheral Illumination Correction for non canon lenses
Post by: Indy on March 09, 2013, 10:23:01 AM
OK, thanks for the clarification.
can we have these Digic data ? there are related to attached lend right ? which lens it is ?

Indy
Title: Re: Peripheral Illumination Correction for non canon lenses
Post by: a1ex on March 09, 2013, 10:32:44 AM
You can't read these registers, just write them. So... I don't know the original Canon values.

Same for picture style curves. I know from trial and error that c0f0f100 - c0f0160 describe the luma curve, 0xc0f0f11c/28/34/50/60 are luma values (0-255) and the others seem to be polynomial coefficients, but I have no idea what the default values are or how to configure a smooth curve.
Title: Re: Peripheral Illumination Correction for non canon lenses
Post by: Indy on March 09, 2013, 12:16:46 PM
Excellent!
this is for LV, so for exposim, right ?
the digic must also be used for image data (written to SDcard)

Indy
Title: Re: Peripheral Illumination Correction for non canon lenses
Post by: g3gg0 on March 09, 2013, 01:20:43 PM
http://upload.g3gg0.de/pub_files/72a5cfe0084cf5b33447bc19d7f2e683/VIGN.DAT

data written to digic with 50mm 1.8 II at f/1.8
Title: Re: [DONE] Peripheral Illumination Correction for non canon lenses
Post by: Indy on March 09, 2013, 03:49:06 PM
nice
Title: Re: [DONE] Peripheral Illumination Correction for non canon lenses
Post by: sparedog on March 15, 2013, 02:30:47 AM
Does the DONE mean that this has been achieved? Could I correct my tamron  24-70vc on my 6d?
Title: Re: [DONE] Peripheral Illumination Correction for non canon lenses
Post by: 1% on March 15, 2013, 02:46:00 AM
A1ex said it didn't work on 5d3 just like with the image effects. Probably needs more investigation.
Title: Re: [DONE] Peripheral Illumination Correction for non canon lenses
Post by: Betelgeuza on March 15, 2013, 09:12:08 PM
Quote from: sparedog on February 17, 2013, 12:49:39 AM
I own some non canon zoom lenses, like the Tamron 24-70mm, and would like to use Peripheral Illumination Correction during video.

This cant be replicated in post production, because during video the aperture and focal distance is lost.

But we have the information available in programs like photoshop and lightroom. So is it possible to hack one of the Canon lens Peripheral Illumination Correction profiles I wont ever use, replace its contents with the details for the Tamron 24-70mm, and load that into the camera?
.


im not fully sure but maybe this  turtorial helps you :

http://digitol.free.fr/forum/viewtopic.php?f=2&t=136 (http://digitol.free.fr/forum/viewtopic.php?f=2&t=136)


alsow igot question ..i dont want start new post about this...

in lastes digital photo professional 3.12.52.0 there is new cool feature called   Digital Lens Optimizer   but like for now this stuff not supporting low price lenses what is very  not good..but feature what they add to  DPP is grate competition for Light Room ,, most cool  features  from Light Room are now in DPP..

and question ... :

in EOS Utility  i can load  to camera Lens Profiles and  i got there all my two lenses profiles (in EOU Utility )..so  if im right  profiles from EOS Utility are same lenses profiles what in DPP ,, ?if yes . how i can transfer that profiles from EOS Utility to Photo Digital Professional  list ? list with profiles in DPP is automaticly loaded from Canon Server and not includiong  low price lenses  but EOS Utility got them some where in side program ...this is possible to transfer them ?
Title: Re: [DONE] Peripheral Illumination Correction for non canon lenses
Post by: locoboy on March 15, 2013, 10:53:19 PM
Quote from: sparedog on March 15, 2013, 02:30:47 AM
Does the DONE mean that this has been achieved? Could I correct my tamron  24-70vc on my 6d?
i'm gettin more vignette :/ event with photos
Title: Re: [DONE] Peripheral Illumination Correction for non canon lenses
Post by: a1ex on March 23, 2013, 12:36:12 PM
Just got it working on 5D3. It will probably work on the other digic V cameras too.
Title: Re: [DONE] Peripheral Illumination Correction for non canon lenses
Post by: 1% on March 23, 2013, 04:20:26 PM
Yup, working here.
Title: Re: [DONE] Peripheral Illumination Correction for non canon lenses
Post by: a1ex on March 23, 2013, 09:05:29 PM
Umm... the 1080p videos from 5D3 are no longer playable because of flipping video modes (required to apply new vignette settings). Cleared settings and it's OK again. Enabled vignetting again, got corrupted videos again.

It's not from vignetting itself, but only happens when running flip_zoom (so... changing video modes from ML is not safe on 5D3).

Any such trouble on 6D?

Edit: found a way to update the vignetting correction without requiring video mode changes.
Title: Re: [DONE] Peripheral Illumination Correction for non canon lenses
Post by: 1% on March 23, 2013, 09:52:53 PM
I turned on vignetting (1,1,1) and recorded 3 or 4 1080/24P videos... other than the pink highlights they play back fine... both on the computer and in camera.

Also recorded time lapses this morning which I assume used the video mode flipping and they aren't corrupted.

*Tested video parameter changing... tested gop again and since you fixed it in the code it shows gop in video headers... just for ones that exist in fw tho like 15, 12, etc. Others are ommited and that setting is never written...

Got this in the morning.. I guess I have to look at job state prop:

ML ASSERT:
(int)state <= max_job_state
at ../../src/lens.c:1967 (_prop_handler_PROP_LAST_JOB_STATE), task PropMgr
lv:0 mode:3


Should check eosM and 650d for mode flipping & errors.
Title: Re: [DONE] Peripheral Illumination Correction for non canon lenses
Post by: Greg on March 24, 2013, 01:48:01 AM
500D C85 1.8 :

OFF
(http://img843.imageshack.us/img843/525/67920841.jpg)

ON
(http://img836.imageshack.us/img836/3460/61972227.jpg)

;)
Title: Re: [DONE] Peripheral Illumination Correction for non canon lenses
Post by: Indy on March 24, 2013, 12:55:03 PM
no they are different
with 24-105mm f/4 (lens_id=237) lens data for vignetting and chromatic aberration corrections is 2704 bytes long, and for lens optimization length is 54 102 768 bytes (downloaded 3005.bin in Canon/DPP/bin).

Quote from: Betelgeuza on March 15, 2013, 09:12:08 PM
in EOS Utility  i can load  to camera Lens Profiles and  i got there all my two lenses profiles (in EOU Utility )..so  if im right  profiles from EOS Utility are same lenses profiles what in DPP ,,
Title: Re: [DONE] Peripheral Illumination Correction for non canon lenses
Post by: locoboy on March 27, 2013, 03:10:55 PM
i got a black spot in midel when i turn it on !
lens: 24-70 2.8 VC tamron

correction off
(http://img259.imageshack.us/img259/5814/withoutl.jpg)

correction on
(http://img201.imageshack.us/img201/8121/withh.jpg)

any idea how to solve this problem !!
Title: Re: [DONE] Peripheral Illumination Correction for non canon lenses
Post by: 1% on March 27, 2013, 03:43:19 PM
Try some different settings. You have to set it up per lens.
Title: Re: [DONE] Peripheral Illumination Correction for non canon lenses
Post by: locoboy on March 27, 2013, 03:52:21 PM
Quote from: 1% on March 27, 2013, 03:43:19 PM
Try some different settings. You have to set it up per lens.
ahhh oki just saw theme !! i had an old build :D
Title: Re: Peripheral Illumination Correction for non canon lenses
Post by: Shield on September 23, 2013, 11:20:32 PM
Quote from: 1% on March 08, 2013, 12:13:38 AM
Canon menu -> 1st box. Peripheral ilumin. correct

You can upload more profiles with eos utility.

Sorry to bump an ancient topic, but has this been replaced by the "Vignette" option in the Video tab?
For those of you who use the Tamron 24-70 VC 2.8, what settings are you using?