Micro Four Thirds Lens Correction Support in CAQuest

AfterShot Pro Plugins
Post Reply
andrewj
Posts: 32
Joined: Wed Jul 18, 2012 7:13 pm
operating_system: Windows 7 Ultimate
System_Drive: D
32bit or 64bit: 64 Bit

Micro Four Thirds Lens Correction Support in CAQuest

Post by andrewj »

Hi,

I'm making good progress adding support for using the embedded lens correction data in MFT RAW files to drive the geometric correction in Bibble/ASP. So far I have the B5 version of the plugin working, and I've made reasonable progress "reverse engineering" the correction value algorithms. However, it's become clear that the way the values are encoded varies from lens to lens, so it's not as simple as a "one size fits all" solution.

To progress this, I need two things from the community:
1. If anyone has a good technical contact in Panasonic or Olympus, I'd like to discuss with them the possibility of getting formal access to the rules for encoding the correction data. They have clearly made this available to the builders of other RAW software (e.g. Lightroom and SilkyPix), so it's not an unreasonable request.
2. I need to start building up a little library of test MFT RAW files taken with different lenses (and cameras, but the latter isn't so critical). The only real requirement is that they have plenty of straight lines (buildings, brick walls, you know the sort of thing). I can personally cover the Panasonic 14-42 and 45-175 power zooms, and the Olympus 9-18. Anything else would be brilliant.

I am hope to get a provisional B5 version into the community in a week or two. The ASP version will follow, but it's a bit more complex as I have to go back to CAQuest maintaining its own cache of Exif data, which hasn't been necessary for the other functions under ASP.

Let me know what you think, or if you can help,

Andrew
amne
Posts: 1
Joined: Thu Aug 23, 2012 7:09 pm
operating_system: Linux
System_Drive: N/A

Re: Micro Four Thirds Lens Correction Support in CAQuest

Post by amne »

First off: That's great!

I have an Oly OM-D, Pana GF1, Oly 12-50 (the Kit lens from my OM-D), Pana 45-200, Pana 20, Oly 9-18 (already covered by you) and could provide you with images if needed. I also have both b5 and ASP installed (both on Linux) and could do some testing there. As I'm quite busy at the moment I can't promise anything for sure (especially when), but i'll follow this thread and would love to help if i can make it.
klausw
Posts: 12
Joined: Fri Apr 20, 2012 10:48 pm
operating_system: Linux
System_Drive: N/A
32bit or 64bit: 64 Bit

Re: Micro Four Thirds Lens Correction Support in CAQuest

Post by klausw »

This sounds excellent, I saw the initial notes on http://syscall.eu/#pana and was wondering if there was any recent progress.

I can help with this, I have the following m43 lenses to contribute to the collection:
  • Pana 14-140mm
  • Pana 20mm f1.7
  • Olympus 45mm f1.8
  • Pana 100-300mm
  • Pana 12-35mm f2.8
For the test pictures, would it work to just take pictures of simple rectangular grids or nested squares shown on a monitor? Those should be quite reliably straight lines, and probably more accurate than the slightly crooked bathroom tiles I had used for an unsuccessful calibration attempt earlier.

Which software are you using to get correction parameters? I had briefly looked at http://hugin.sourceforge.net/docs/manua ... s_gui.html but didn't try it yet.
andrewj
Posts: 32
Joined: Wed Jul 18, 2012 7:13 pm
operating_system: Windows 7 Ultimate
System_Drive: D
32bit or 64bit: 64 Bit

Re: Micro Four Thirds Lens Correction Support in CAQuest

Post by andrewj »

Thanks for the replies. Samples from these lenses would be great.

I’m not too fussy what you use for the target. I’m not trying to exactly profile each lens, but trying to see which values from the data embedded in the RAW file can be used to produce a result which is visually “about right”. Basically if I get the algorithm right then I will get B5/ASP to reproduce the standard in-camera / LightRoom correction, about as good or as bad as Panasonic/Olympus have made it. On that basis I probably only need a single frame for the primes, and 2-3 frames at different focal lengths for the zooms. Klaus's screen shots should be OK, but the bathroom tiles are probably also fine as long as they are not too crooked.

Re getting the files to me, if you have a website or similar where you can upload them and I can download them that’s probably ideal. If not, I may be able to sort something out. In either case, just PM or email me to let me know.

Andrew
grubernd
Posts: 248
Joined: Thu Jan 12, 2012 8:17 pm
operating_system: Linux
System_Drive: N/A
Location: Graz, Austria

Re: Micro Four Thirds Lens Correction Support in CAQuest

Post by grubernd »

one hint on the calibration pictures:

the smaller the target the closer you have to focus. which in turn crops quite a considerable amount of the outer parts of a lens where the most distortion happens.

try this: put the camera on a tripod, stick a piece of paper to your window. focus on the paper and fill the frame. then focus to eternity and see how much more you see around the paper. so using a bigger target is better. a rough rule would be a focus distance of at least 100 times the focal length. that's 2 meters for a 20mm lens..

most photographic lenses do have this effect, it is called focus breathing. only very expensive cinematic optics are build to avoid or lessen it.

http://en.wikipedia.org/wiki/Breathing_%28lens%29
Bibble since 2004. Aftershot until 2020. From then on darktable.
andrewj
Posts: 32
Joined: Wed Jul 18, 2012 7:13 pm
operating_system: Windows 7 Ultimate
System_Drive: D
32bit or 64bit: 64 Bit

Re: Micro Four Thirds Lens Correction Support in CAQuest

Post by andrewj »

Thanks for the tip. I'm most interested where the aberrations are "naked eye obvious", so shots following these guidelines will probably work best for me.

Andrew
ferdinand-paris
Posts: 224
Joined: Sun Feb 05, 2012 4:37 am
operating_system: Windows XP Pro
System_Drive: C
32bit or 64bit: 32 Bit
motherboard: GA-X58A-UD3R
processor: 3.20 gigahertz Intel Core i7 960
ram: 4Gb
Video Card: NVIDIA GeForce 7300 GS
sound_card: Realtek High Definition Audio on-board
Hard_Drive_Capacity: 2500 Gb
Monitor/Display Make & Model: Eizo CG222W

Re: Micro Four Thirds Lens Correction Support in CAQuest

Post by ferdinand-paris »

I suggest you contact Phil Harvey, the author of ExifTool. Or check out his site. He knows more about decoding EXIF and maker notes than anyone. He has a lot of the tags documented on his site.

F_P
klausw
Posts: 12
Joined: Fri Apr 20, 2012 10:48 pm
operating_system: Linux
System_Drive: N/A
32bit or 64bit: 64 Bit

Re: Micro Four Thirds Lens Correction Support in CAQuest

Post by klausw »

This appears to be the current known info there: http://owl.phy.queensu.ca/~phil/exiftoo ... ortionInfo

PanasonicRaw DistortionInfo Tags

Lens distortion correction information.
Tag ID	Tag Name	Writable	Values / Notes
0x0004	DistortionParamB	int16s	 
0x0005	DistortionScale	int16s	 
7.1	DistortionCorrection	int16s	[Mask 0x0f] 0x0 = Off 0x1 = On
0x0008	DistortionParamA	int16s	 
0x000b	DistortionParamC	int16s	 
0x000c	DistortionN?	int16s
andrewj
Posts: 32
Joined: Wed Jul 18, 2012 7:13 pm
operating_system: Windows 7 Ultimate
System_Drive: D
32bit or 64bit: 64 Bit

Re: Micro Four Thirds Lens Correction Support in CAQuest

Post by andrewj »

I've already been in contact with Phil. He's working from Raphael's original work - the earlier link - but I've established that these are not correct for several of the lenses I own. I've promised to update Phil with my findings.

What I really need is some sort of formal contact with Panasonic or Olympus. Anyone?

Andrew
andrewj
Posts: 32
Joined: Wed Jul 18, 2012 7:13 pm
operating_system: Windows 7 Ultimate
System_Drive: D
32bit or 64bit: 64 Bit

Re: Micro Four Thirds Lens Correction Support in CAQuest

Post by andrewj »

amne wrote:I have an Oly OM-D, Pana GF1, Oly 12-50 (the Kit lens from my OM-D), Pana 45-200, Pana 20, Oly 9-18 (already covered by you) and could provide you with images if needed.
I'd love to see a few images from both these cameras, for each of these lenses. I'm not sure whether I can read OM-D data the same way, and I'm starting to think that some of the data is camera-specific, but both Klaus and I use GH2s, so I can't be sure. Also it would be interesting to see if the Oly 9-18 provides the same data at 9mm for all three cameras.

Thanks
Andrew
klausw
Posts: 12
Joined: Fri Apr 20, 2012 10:48 pm
operating_system: Linux
System_Drive: N/A
32bit or 64bit: 64 Bit

Re: Micro Four Thirds Lens Correction Support in CAQuest

Post by klausw »

If I understand it right, you're currently investigating the geometric distortion only, right? Apparently Panasonic has support for auto-correction of lateral chromatic aberration, and it would be interesting if there's a visible difference in the encoded data when the same lens is used on Olympus vs Panasonic bodies. If yes, that could be useful for getting the lateral CA auto-fixed also.
andrewj
Posts: 32
Joined: Wed Jul 18, 2012 7:13 pm
operating_system: Windows 7 Ultimate
System_Drive: D
32bit or 64bit: 64 Bit

Re: Micro Four Thirds Lens Correction Support in CAQuest

Post by andrewj »

Hi,
Would people be up for a bit of "crowdsourcing" on this? It looks like it's going to take quite a lot of trial and error to find the right algorithm for all lenses, and I'd welcome a bit of help.

If the answer is yes, then I'll set up a website where we can collect and download test files, I'll write a web page holding the information we have so far about how this works, and I'll release a version of CAQuest for B5 from which users can cut and paste data to experiment with different algorithms. As we get to the point where we understand the approach for a given lens, then I'll publish it and add the algorithm into the "database" of known solutions in CAQuest.

We can use this forum to exchange ideas and findings.

Let me know if you'd like to help on this, and I'll set things up.

Thanks
Andrew
klausw
Posts: 12
Joined: Fri Apr 20, 2012 10:48 pm
operating_system: Linux
System_Drive: N/A
32bit or 64bit: 64 Bit

Re: Micro Four Thirds Lens Correction Support in CAQuest

Post by klausw »

Yes, I'd be interested in the crowdsourced approach, and due to the large number of lens + body combinations it should be helpful to have an easy way to share data. For example, each data point could be a set of a RW2 image, corresponding in-camera JPG (using RAW+JPG mode), the EXIF raw data, and (if available) a/b/c parameters in ASP that appear to be a reasonable match.

For tweaking algorithms, it may be useful to just run it on the extracted EXIF distortion data and compare it to manually calibrated values to see if it looks consistent. It would be nice if there were a single algorithm used for the corrections, but I suspect there may well be special cases handled in the firmware where different lenses get different treatment. I remember seeing the GH2 firmware release notes mention improved support for certain lenses, but i don't know if that was related to the corrections.
andrewj
Posts: 32
Joined: Wed Jul 18, 2012 7:13 pm
operating_system: Windows 7 Ultimate
System_Drive: D
32bit or 64bit: 64 Bit

Re: Micro Four Thirds Lens Correction Support in CAQuest

Post by andrewj »

OK, I'll get cracking on the website.

Does everyone have B5, so we can just use that version of the plugin for now, or do I need to get the ASP one working as well?

Andrew
andrewj
Posts: 32
Joined: Wed Jul 18, 2012 7:13 pm
operating_system: Windows 7 Ultimate
System_Drive: D
32bit or 64bit: 64 Bit

Re: Micro Four Thirds Lens Correction Support in CAQuest

Post by andrewj »

Hi All,

As promised, I've set up a project so we can all contribute to this exercise. The project pages are at: I've also set up a separate thread as a discussion for the project. This is: I'm still looking for image samples from cameras other than the GH2. If you can supply these please PM me, and I'll discuss the best way to upload them.

Thanks
Andrew
Post Reply