What would be the best approach for despeckling/denoising?
this is somewhat tangential to panorama stitching, but some of the
things that a panorama stitcher does apply to my use case as well, so I
hope the panotools are useful anyway.
Since the use case description is MUCH longer than the question, let me
write the question first:
What tools should I look at first to get a working toolchaing for my use
Use case: I have to scan a lot of pages, and I want to get as much
quality out of the scan as possible.
It's a six-digit number of pages, so automation trumps everything,
closely followed by quality :-)
Approach I am currently exploring: Each page is scanned multiple times,
and the bitmaps are used to identify the random stuff (noise, one-time
dust specks), leaving me with a bitmap with what's present every time.
- The pages tend to be slightly differently oriented; in extreme cases,
the angle between scans might be as much as 10°.
- There's some automatic cropping inside the scanner's firmware that I
cannot fully control. The same page might come out with the whitespace
around the text cropped, or not.
- The scanner motor might go slightly uneven, so the pages might be
slightly distorted. I don't expect much variation here, but I noticed
that some stitching tools work at sub-pixel accuracy (which totally
makes sense to me), and I would not find it surprising if the scanner
turns out to have some sub-pixel inaccuracies here.
I hope that panotools will be able to detect and correct that effect
because similar effects can happen with CCD cameras that are not 100%
- No lens distortion, obviously.
- I can run the scanner at 300 and at 600 dpi.
- Scanner will have to run in color mode. Greyscale processing is an
options, but I will want to retain the color tint of each page
(rendering intent is perception).
- I have made an ICC profile of the scanner (with the help of a Wolf
Faust calibration target).
- The final bitmaps after quality-improvement processing should look
as if somebody scanned with a higher-quality scanner at 300 dpi.
- The originals will go to the trash after the scans are done, so
keeping as much quality as possible is an important subgoal.
Re: What would be the best approach for despeckling/denoising?
Am 23.02.2018 um 16:43 schrieb Joachim Durchholz:
> this is somewhat tangential to panorama stitching, but some of the
> things that a panorama stitcher does apply to my use case as well, so I
> hope the panotools are useful anyway.
> Since the use case description is MUCH longer than the question, let me
> write the question first:
> What tools should I look at first to get a working toolchaing for my use
Sorry for being late...
I'd use vuescan for scanning. It has built in multi pass scanning.
Actually two types, but their availability depends on the scanner: it
either scans one page multiple times or it reads the scan line multiple
times before it's advanced. The second case would mean there is no
alignment problem at all. In fact vuescan does the averaging itself.
However, multi pass scanning is intended for high dynamic range scans
like slides or negative film. It shouldn't be of any benefit when
scanning paper, where the dynamic range is fairly low by nature.
I'd focus on image manipulation techniques to reduce noise, dust and
speckles. The usual way is to use a sequence of minimum and maximum
filters to smoothen the characters and remove bad pixels. The minimum
filter colors the pixel in question with the minimum of the surrounding
pixels, effectively shaving one or more pixels from all dark areas.
Anything that is smaller than the chosen radius will be eliminated. The
maximum filter does the opposite, it makes dark areas larger by it's
radius, such restoring the original character's weight, but with
Obviously you need to adjust those filters such that characters don't
get split. Some experimentation would be needed. You should investigate
ImageMagick, wich is a very powerful command line image editor.
> I hope that panotools will be able to detect and correct that effect
> because similar effects can happen with CCD cameras that are not 100%
Original panotools has correction parameters for image shear like
typically caused by line scanners as well as for lens distortion and
image alignment. So in theory you could use a decent control point
generator to generate control points between scans of the same page,
then feed those points in a script to PTOptimizer which calculates the
necessary distortions, then feed the resulting script to PTStitcher,
which would do the actual warping of the images. Then you could pass
them to a tool that averages them, f.e. PTAverage.
However, all those tools are very old now and probably very slow
compared to the more modern tools contained in hugin or PTGui.
(You already asked on hugin list, did you?)