Images to train free ARW2 repair program

Started Aug 20, 2015 | Discussions thread
ProfHankD
OP ProfHankD Veteran Member • Posts: 6,598
Very preliminary results...
37

Well, I've now got a version of the ARW2 repair tool working well enough to show a couple of little examples. These are patches from the ISO 100 raw posted in DPReview's Sony Alpha 7R II: Real-world ISO invariance study. The left side is from the article, the right is from my fully automated repair, which is automatically performed on ARW2 files without any user guidance. I have tried to roughly match DPReview's JPEG processing, but I used only free software (DCRaw with my patches, RawTherapee, and GIMP), so it doesn't quite match.

The artifacts showcased in the article (default section of the image shown)

Another section with even more serious artifacting

There are still a variety of improvements to be made to both image quality and processing speed. The biggest issue is that although the repair is done on the raw data (rather than after Bayer interpolation, etc.), I don't quite have it generating a fully legit DNG. I'm looking at using EXIFTool to help with transcribing some of the EXIF fields....

The Algorithm? Well, first let me thank mgrum for sending me his simple and elegant patch to DCRaw. His approach basically replaces the lost data with well-designed randomness, which really works quite well -- just not quite well enough. After several dozen attempts to improve upon his algorithm with only partial success, I realized that the problem was really not the lossy compression, but that not all the bits in the values that were encoded were actually trustworthy. In other words, not only is the lost data primarily noise, but least significant data bits that are preserved often are wrong. So, my algorithm that made the repair quality breakthrough essentially uses mgrum's approach to compute values for the pixels subjected to lossy encoding, but only uses those values as initial estimates to drive a texture synthesis algorithm. The estimated pixel values are then updated using the synthesized texture, such that final values of pixels that suffered data loss are not directly constrained to round to the values that appeared in the ARW2 file.

Of course, this is a very preliminary result from just a couple of days working with only a few ARW2 files from A7RII, but I'm fairly confident this repair will be good enough to be useful as a free software tool... and publishable as research.  Thanks to those who have submitted training images, but I could still use more.  I'll announce on DPReview when I have a WWW-interfaced version of the tool ready for user testing... probably within the next week or two.

 ProfHankD's gear list:ProfHankD's gear list
Canon PowerShot SX530 Olympus TG-860 Sony a7R II Canon EOS 5D Mark IV Sony a6500 +30 more
Post (hide subjects) Posted by
Keyboard shortcuts:
FForum PPrevious NNext WNext unread UUpvote SSubscribe RReply QQuote BBookmark MMy threads
Color scheme? Blue / Yellow