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.
Answers
-
This is an example using the above-mentioned USM (Unsharpen Mask) Filter in AV4W with a Gaussian Blur, Sigma = 1 and Amount = 68.25.
1 -
FamilySearch should incorporate this when digitizing images. Some projects need it badly!
0 -
Hi @samshicat
Choosing an appropriate filter really needs to be an interactive process - you try one, then a stronger or weaker one, etc. until you find what works best. One size doesn't fit all. And sometimes none work really well. Or, different parts of an image require a stronger filter than others - maybe trying to make out a date for instance. But you can change the filter on the fly while you're indexing if you wish. And you always have the original to look at for confirmation. That's one of the purposes of A Viewer For Windows - to enable you to try different filters, and even create your own. Rob has posted the spreadsheet he made for me, so you can create USM (UnSharp Mask) filters of your own - just pick or create a Blurring filter and go for it.
Download A Viewer For Windows (AV4W) and give it a try next time you have a batch image that is difficult to read. You'll have plenty of filters/profiles to play with after I post mine. Rob calls them effects profiles.
I am in the process of renaming my filter/profile collection so that they will sort into three categories in the AV4W dropdowns SH (Sharpen Filters/Profiles), BL (Blurring Filters/Profiles), and SE (Special Effects). And within a given Sharpening filter family, I've given them names that should sort them from weak to strong. I will post them soon - hopefully later today on Rob's support site. I need to nail down that process with him but will post here when I've done it and where you can go to go to get them. Right now I'm focusing on my naming conventions, which is tedious work.
0 -
I have posted my collection of AV4W filters to help get you started.
I have posted to Rob Latour's A Viewer For Windows community support forum a zip file containing filter profiles for use with AV4W. Please see the link below. My username there is empojohn.
https://www.push2run.com/phpbb/viewforum.php?f=23
I think the post is self-contained, but please let me know if you have any questions or issues.
Thanks and good luck.
1 -
Here is an example of how I use these various tools. In the image below, I have three instances of A Viewer For Window (AV4W) open. In the left instance, you see the "original" on the bottom and the results of applying one of my filters on the top. I adjusted the Gamma value to even up the image in the mid-tones - brightness and contrast alone won't do this. I could dismiss that drop-down by clicking on the blue bar and "applying" it, but I wanted to show you how we choose filters in AV4W.
On the right side are two other instances of AV4W, one with the results of applying a more advanced technique called "Blind Deconvolution." In that methodology, the program tries to figure out (by making guesses that it refines) the mechanism (blur model) that caused the blur. The unknown blur was convolved with the untainted version of the original in the first place, like a malicious filter, and the program strives to identify it and "back it out" - de-convolve it. These advanced programs can deliver magical results sometimes, but not always. One is Smart Deblur. There is a free version of it. And Blur Fix is free. Here is an example blur model from Smart Deblur. In Smart Deblur PRO, which I have, one can even edit the blur model, refine it and even save and reuse it. This one is a 100x100 matrix.
Here is my screen with three instances of AV4W. This layout allows me to tweak my filters on the left and refer to the original, and on the right to reference the other two sharpening approaches. I uploaded many of my filters (found, modified, and created by me) to Rob Latour's Community Forum Push2Run.com. I discovered yesterday he also wrote the software for that forum.
Or you can only use AV4W, try different filters as you wish, and have a screen that looks like this.
0 -
Below is the unvarnished original, which the Indexer marked No Extractable Data. Please don't do that with these records. Just return a batch if you can't read it. Some amazing indexers could see through even this blurry, faint mess. I'm impressed when I review their work with my enhanced images by my side. If enough Indexers return a given batch, it will be looked at by a special FS team.
0 -
I wanted to see how these techniques compared with a real family photo. So, I applied them to a picture of my great-grandfather (my mother's maternal grandfather).
It is a clip from my cousin Ron's photo of an old family portrait. It is the far left picture below, and it is blurry. At the time (2013), I thought this was the best I could do. Eventually - fortunately, before I put together and shared the family tree in 2014 - I learned that his sister, my cousin Arlene had the original. She sent me a hi-res scan of that portrait, and I extracted the middle image below. She also had other family photo treasures that were helpful.
Each photo is labeled across the top. I produced the second using AV4W with a mild Unsharpen Mask based on a Gaussian Blur with Sigma = 1, Amount = 8.53125. The untainted original is in the middle, and the last two show the result from Blur Fix with default settings and finally Smart Deblur PRO with matrix size (33x33) matching that of Blur Fix. I don't have much experience with Smart Deblur 1.7 - the free version -, but I couldn't get much out of it, so I didn't post that.
My effort with AV4W was not necessarily the best I could do, but I applied what I had available. This comparison may give you a reference point for what to expect from these methods when using them on our indexing work or possibly sharpening some of your family photos before posting them to the tree.
Or, as in the case of one commenter from a previous discussion, you might wish to sharpen a picture of your relative so that you can read the number of the military unit in which he served from the cap he wore.
0 -
Thank you so much, John, for all your tips and hints for using this program. It will definitely help with the latest batch of records. In the past, darkening or brightening the images, or making them bigger or smaller didn't quite do the trick. I'm sure there is a learning curve to using the program, but I'm willing to give it a try.
0 -
You're welcome, Allyson. I hope you enjoy it and think you'll find it pretty user-friendly. Rob has Quick Help available by clicking a button by that name. He also has more extensive online help that should appear if you click on that button with the Alt key depressed.
But please, once you have downloaded and installed AV4W, go to Rob's Community Forum and download the zip file with a collection of my filters and ones I've found online. Without those filters, you won't have much fun. I also suggest that you download and use A Ruler For Windows (AR4W) with it because the Web Indexing ruler won't be available to you. When you're in AV4W, left-click on the AR4W button, and a reading guide will appear (right-click brings up a ruler). The Windows Magnifier and Windows Snipping tool are accessible within the program too. Please watch the movie. Even though it describes version 1.1, and we're at version 1.4.1, it will help get you oriented. It's only about 12 minutes long.
Here is a link to where you should be able to find my post on Rob's community forum with the attached file containing the filters. I've included Rob's instructions in that post on how to load them into AV4W:
https://www.push2run.com/phpbb/viewforum.php?f=23&sid=0dd3f6a9792ac7eb1e1bacd03fc97066
Here is the link to A Viewer For Windows:
And here is a link to A Ruler For Windows:
https://www.arulerforwindows.com/
Good luck. I hope you find it helpful when you need it.
0