Jump to content

Distortion correction loosing extra pixels


Recommended Posts

I use LR4 to convert raw (.RW2) files from my Panasonic camera. Panasonic raw files contain extra parameters which define the corrections to be applied to remove CA, vignetting and distortion from the lens and focal length in use at the time. LR4 or SilkyPix raw convertors apply these corrections automatically and there's no way to stop them being applied.

 

Whilst experimenting with RawTherapee (which doesn't apply these parameters) I was surprised to discover how many pixels are unnecessarily discarded during the distortion correction process by LR4. This is illustrated by the image below. The distorted image contains all the pixels in the RW2 file. The red rectangle enclosed the pixels that are retained after the distortion has been corrected. The LR4 image matches the in camera produced jpg, so it seems that Panasonic haven't optimised the correction parameters very well.

 

Composite_1.jpg

 

I could use RawTherapee to manually correct distortion and then optimise the crop, but I prefer LR because RawTherapee doesn't use the parameters to correct CA or vignetting either.

 

To investigate further I used EXIFToolGUI to inspect and edit the parameters in the RW2 file.

 

There's a parameter called DistortionCorrection which is set to "On" by default. Changing it to "Off" stops LR4 from applying distortion correction, but CA and vignetting correction appear to still be applied. This is useful if the image doesn't need distortion correction, but maximum edge to edge sharpness is required, (turning off distortion correction can make quite a difference to corner or edge sharpness).

 

There's another parameter called DistortionScale which is set to "1.00" by default. Changing it to a smaller value retains more pixels after distortion correction is applied. The area enclosed by the yellow rectangle in the image below shows the increase in retained pixels by setting a value of 0.96. This can be useful if you want to maximise the field of view and retained pixels whilst retaining automatic distortion, CA and vignetting removal in LR4.

 

Composite_2.jpg

 

Obviously the value required will vary from lens to lens and with focal length and possibly focal distance, but it's not necessary to set it exactly. If you overdo it you can then crop the image in LR or PS.

 

I still wonder why the parameters aren't set more optimally in the first place.

Link to comment
Share on other sites

Main reason could be simply that it's a zoom, and there are fixed steps in the distortion correction table, which require a certain latitude to be interpolated to determine the actual distortion correction applied. Raw Therapee can also show additional sensor pixels, as LR discards three or four complete pixel rows round the edge. Also, DxO Optics Pro may be able to apply a more intelligent correction which retains hor/ver field without apparent barrelling.

Link to comment
Share on other sites

Main reason could be simply that it's a zoom, and there are fixed steps in the distortion correction table, which require a certain latitude to be interpolated to determine the actual distortion correction applied. Raw Therapee can also show additional sensor pixels, as LR discards three or four complete pixel rows round the edge. Also, DxO Optics Pro may be able to apply a more intelligent correction which retains hor/ver field without apparent barrelling.

Yes could be. The example above shows a band of >75 pixels all around the image being discarded. I think my Canon G15 discards even more pixels at wide angle setting. It's not normally noticeable because the EVF and in camera JPGs all match. It's only when using a RAW convertor that doesn't support the parameters that you notice.

Link to comment
Share on other sites

Perhaps it's too early and I haven't had enough coffee, but I'm not quite following this discussion...

 

M are you saying that your camera does not give you full control of what is or is not applied to your RAW images from camera SD/CF card? And that Lr does the same thing? Surely not, I wouldn't think. I don't have a Panasonic, but do have Lr 4.4 that I use all the time and it applies only that which I want it to.

 

I have a Sony and use old Minolta film lenses on it. That means there isn't any lens profiles within Lr for my set up, so under Lens Corrections module no profile is ever checked. If a RAW files needs CA tweaked I use the Color tab and if I need distortion and the like tweaked I use the Manual tab adjustments. In Lr you can uncheck under Profile which lens you're using and then can manually do as you wish.

 

When I first started shooting, I didn't have a grasped on how to shoot Architecture where little or no adjustments needed to be made. Though when I was way off, more often than not, I would lose too much of the image to keep. So I shot wider than I needed to, to adjust for what I would lose. Now I rarely have to do that, but still on occasion will give me extra wiggle room just in case. I remember when I had images, after adjustments, that were bowed like your examples, but it was me correcting the distorted RAW images manually that would produce such extremes.

Link to comment
Share on other sites

The difference is that film lenses were designed to minimise distortion, which often meant other compromises, while these new digital-only lenses are often made (like Hasselblad's own H*D lenses - 28mm as an example, or the Sony RX100 built in zoom) with strong barrel or other distortions, designed to be corrected in software. The raw file includes header (metadata) info which tells LR/ACR what corrections to apply, and unless you change this data, you can not 'see' anything except the corrected image. The RX100 lens for example is actually a 25mm field of view equivalent, with strong distortion, but is marked as a 28mm equivalent - this is AFTER the software correction.

Link to comment
Share on other sites

The difference is that film lenses were designed to minimise distortion, which often meant other compromises, while these new digital-only lenses are often made (like Hasselblad's own H*D lenses - 28mm as an example, or the Sony RX100 built in zoom) with strong barrel or other distortions, designed to be corrected in software. The raw file includes header (metadata) info which tells LR/ACR what corrections to apply, and unless you change this data, you can not 'see' anything except the corrected image. The RX100 lens for example is actually a 25mm field of view equivalent, with strong distortion, but is marked as a 28mm equivalent - this is AFTER the software correction.

 

That's understood....but from a stock sales perspective I'm not sure it makes a difference as the size of the image doesn't matter.  If size is a concern, then why not shoot the images as a panorama, correct them, then stitch them together?

Link to comment
Share on other sites

David that is basically what I was referring to; one can change how a RAW file distortion is handled. By simply unchecking the lens profile box, correct? Then one can do as they wish manually. Guess the confusion came when reading M say he couldn't stop it from happening in Lr. Or am I still off base? As you can see I'm still pretty new to all of this. 

 

Indeed my film lenses do well with what would you call it... um lateral distortion? Bowed in or out horizontal lines. But the fact remains, does it not, that if one shoots architectural structures incorrectly, it doesn't matter what lens is used or what lens profile is available with editing software, it's going to need adjusting perhaps a lot of it.

Link to comment
Share on other sites

No, in LR4 with Panasonic Lumix Raw files (and probably others too) you can't turn off the distortion correction. It's part of a trend that some manufacturers are following towards using software correction to allow them more freedom in lens design. They store the correction parameters in the RAW file and the RAW convertor applies them. Some RAW convertors ignore the parameters in the RAW file (e.g. RawTherapee), other's e.g. SilkyPix and LR4 apply it automatically and you can't disable it (so far as I can tell). Unless you edit the raw file settings (as per my original posting).

David that is basically what I was referring to; one can change how a RAW file distortion is handled. By simply unchecking the lens profile box, correct? Then one can do as they wish manually. 

 

Why might you want to preserve these pixels? To maximise the field of view in a previously captured image or to maximise edge sharpness. It's not something you want to do all the time, but can save an image that was perhaps too tightly framed or is a bit soft at the edges.

 

It's got little to do with getting any particular number of pixels in the final image, and more to do with only applying distortion corrections (that may degrade image quality) if they're actually needed.

Link to comment
Share on other sites

M are you saying that your camera does not give you full control of what is or is not applied to your RAW images from camera SD/CF card? 

Exactly. Same for LR4.

 

The distortion correction is "built in" and can't be disabled for some camera/lens combinations (e.g. Panasonic Lumix). The converted RAW image (with all corrections in LR turned off) is still not faithful reproduction of the sensor "RAW" image (i.e. the pixels in the converted image are warped relative to those of the sensor).

Link to comment
Share on other sites

 Also, DxO Optics Pro may be able to apply a more intelligent correction which retains hor/ver field without apparent barrelling.

Thanks David. I just tried DxO Optics Pro 9 and it does indeed do a much better job of correcting distortion than LR4. The distortion is accurately corrected and then the image is cropped perfectly without wasting any pixels. The noise reduction seems better too. I think I'll continue with the 30 day trial. 

Link to comment
Share on other sites

To recap - there is metadata embedded raw distortion correction, which is not disabled by turning off lens correction (for example - included with Olympus files) and then there's Adobe LCP (.lcp, Lens Correction Profile) based correction, for which you can download Adobe Lens Profiler and create your own, and share with the user community - and for which some makers like Sigma provide full .lcp files from the start. The two are different data sets and should not be used cumulatively either. DxO goes a step further by having its own lens and camera profiles, including noise and colour profiling, and being able to over-ride inbuilt presets.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.