A Viewer For Windows Update - Unsharp Masking
Talented Canadian programmer Rob Latour has released version 1.4.1 of his FREEware Windows program A Viewer For Windows (AV4W). It has many capabilities for viewing and enhancing photos. These include the ability to straighten and sharpen them along with making other adjustments and applying special effects. It is designed to fully or partly overlay the Web Indexing image display area and stay on top - while the Indexers or Reviewers do their work. Multiple instances can be opened at one time, which can be helpful. It also includes the ability to invoke his versatile FREEware A Ruler For Windows (AR4W) and use it as a reading guide while indexing or reviewing using AV4W. Rob has excellent "Quick Help" and "hover" tool help in place.
Here is a link to the AV4W website - the video is about version 1.1: https://rlatour.com/av4w/
Here is a link to the AR4W website.: https://www.arulerforwindows.com/
The filtering functionality was called "Sharpen' in earlier releases but is now called "Effects," as a nod to the variety of filters available - sharpening, smoothing, and special effects. And Rob has given us the ability to choose and apply up to five different filters successively in a very clever way. This release includes a filter ("effect") design area where you can create your own filters or modify existing ones. I (or Rob) will post/share on the AV4W support forum many filters I have developed that have proven useful for me. They are not just for enhancing text, but for use in clearing up blurry regular photos. Now it's time to talk about "Unsharpen Filters."
The concept of "Unsharpen Filters" derives from a technique used in photography for many years in which a picture was purposefully blurred and "subtracted" from the original ("original - blurred"), thus leaving behind a mask of the high-frequency details. A certain "amount" of this leftover detail was then added back to the original to pump up the details - thus sharpening it ("original + (original - blurred) x amount. The Wikipedia article linked below talks about this: https://en.wikipedia.org/wiki/Unsharp_masking
As it mentions: "The typical blending formula for unsharp masking is: sharpened = original + (original − blurred) × amount. So the "unsharp" = blurred part of the image is subtracted from the original, amplified by the "amount" and added back to the original, thus sharpening it. The technique is called Unsharp Masking (USM).
An image in a computer is a grid (matrix( of pixels with various attributes. Each pixel is surrounded by other pixels. To blur an image, we could just replace a pixel by the average of it and its nearest 4 neighbors, i.e. add them up and divide by 5. Laying this little matrix over the image matrix would do just that. We could use all 8 neighboring pixels, in which case the zeroes would be replaced by ones and the divisor would be 9 instead of 5. So here is our example "blurring" filter. We run this around the image and blur it. If, you choose or design this filter and apply it to your photo, you will blur it.
The Wikipedia article runs through an example of mimicking the USM equation with this particular blurring filter. Here is a snip of that, with the "amount" = 5 =. The matrix on the right is the USM Sharpen Filter. If instead, we used an amount of 10 you end up with a matrix with a 9 where the 5 is and -2 where the -1 values are. Below you'll see the calculation done in a spreadsheet that Rob made for me. I've asked him to include this in the effects design area with variable values for "amount." Remember: here is the equation. Our matrix version is written with the sharpened result on the right. Also, those matrices with one in the middle are the "Identity" matrices - they leave the pixel untouched.
sharpened = original + (original − blurred) × amount
There are a variety of blurring functions available. I've found and generated some that use the normal distribution (Gaussian Bell Curve) in two dimensions with various values for the standard deviation = Sigma.
The bottom picture is before sharpening, and the above is after sharpening with an USM (Unsharpen Mask) Sharpen filter using a Gaussian Blurring filter with Sigma =1, with an amount = 34.125 = 273/4. The "natural" amount was 273 (like the 5 in the example), but that was too strong. So I tested different lower amounts by halving until I got a satisfactory result. I'm hoping and have asked Rob to give us the ability to tweak the "amount" multiplier inside the design panel, maybe with a slider or mouse press.
So, how does this help us with Indexing? Well, text images can be a little tougher to "sharpen" than regular photos. But here is a comparison with my current batch image and an amount value of 8.53125, another two half steps down from the above. It's easy to select and try filters, and I got some information from the stronger versions but will show you this one.
Here it is with "amount" = 17.0625.
Whichever filter you choose, you always have the original as a reference and can always try other, different filters as well, if a particular area perhaps requires different handling.
Notice the "sharpening" of the vertical lines. This is an unfortunate byproduct of any kind of sharpening filter. Some folks want those "features" e.g., people reading X-Rays may want to look at edges - there are edge-enhancing special effects in AV4W. Or at least there will be when we post my collection.
This leads me to two final conclusions.
(1) I believe that Family Search is running these Military Roll and Roster images through some sort of filter, perhaps in an effort to help us out. Look at the enhanced vertical lines in the "original." I appreciate the effort, but I wish we had access to the true originals as well as these filtered ones because it is more difficult enhancing something already filtered by some unknown filter
(2) It's obvious to me now, that having FS put a "Sharpen" option within our Web Indexing program is a big ask.
Thank you, Rob Latour. More to come from Rob.