Over on genealogy.SE, I proposed a method of manipulating images to make "bleed through" less visible and the handwriting on the correct side of the page more legible.
Here are the original images:
The idea is to make a mirror image of the other page, and then remove things that are dark on the flipped page and lighter on the target page, and similarly keep things that are darker on the target page than the flipped page. Here's the flipped page:
page17cropflip = ImageReflect[page17crop, Left]
Here was the set of commands that worked tolerably well in this case (it looks better at full size):
With[{brightness = -0.3`, contrast = 0, final = 0.903`,
highbleed = 0.159`, lowbleed = 0.221`, method = "Cluster"},
Binarize[ImageAdjust[
ImageClip[
ImageAdd[Blur[page18crop, 3],
ImageClip[page17cropflip, {lowbleed, lowbleed + highbleed}]], {0,
final}], {contrast, brightness}], Method -> method]]
But I needed to crop the images by hand (I used ImageDifference
to help line it up) so that the bleeding through text lined up with the actual text on the image of the facing page. Is there a way to automate this?
ImageTransformation
can wrap. If you have per-pixel offsets (as you would have with many optical flow or non-parametric registration algorithms), this question might be useful: mathematica.stackexchange.com/questions/31274/… $\endgroup$ImageForwardTransformation
to apply the warp. It didn't work very well though. $\endgroup$