For folks who know history demosaicing and TCA correction.

Started 3 months ago | Questions thread
OP jw10 Contributing Member • Posts: 911
Re: RT has pre-demosaic CA correction

Jack Hogan wrote:

jw10 wrote:

ipopov wrote:

Darktable has a "Raw CA correction" module that operates before demosaic. I believe Raw Therapee has a similar module.


Darktable's raw CA correction is not transverse chromatic aberration correction. It merely attempts to detect color aberrations due to high contrast edges, (like purple fringing), and fix them.

If it uses RT's code it probably does more than that. See for instance here and here .

I can't read C (it gives me a headache) but looking at the comments it appears that in Auto mode the algorithm tries to find color variance locally throughout the image and 'solve for the interpolation position that minimizes...variance over the tile' based on white balanced raw data. Then it does a polynomial fit over the shift distributions and feeds that to the (4) color plane stretching routine. It seems like a sound approach.

As for the fact that the correction is not applied at the sub-pixel level, neither is deconvolution capture sharpening - yet both work surprisingly well in practice.


That's really fascinating.   A quick look at that code and it appears to be breaking the image down into subblocks, computing shifts necessary on the CFA color components to minimize aberrations in each subblock, and applying those shifts.   Sort of a equationless version of what lensfun does with TCA and a predetermined correction equation.

I have darktable code and went a looked at it and it's probably based on the same code.

That may actually be the answer to my original question.


-- hide signature --

Jeff (aka jw10)

 jw10's gear list:jw10's gear list
Canon PowerShot A95 Canon PowerShot S3 IS Sony Cyber-shot DSC-WX150 Panasonic Lumix DMC-FZ200 Sony RX100 II
Keyboard shortcuts:
FForum PPrevious NNext WNext unread UUpvote SSubscribe RReply QQuote BBookmark MMy threads
Color scheme? Blue / Yellow