Log in

View Full Version : About scanned documents


tormento
12th October 2024, 10:55
I'd like to apply some more advanced filtering to my document scans.

Do you have some experience regards it?

1) Can PDF be ingested by AVS+ with some plugin?
2) What are the most effective filters for deskew and denoise? Anything able to understand that the dot over the "i" is not a spot but mandatory?
2) How can I save the processed image as TIF/JPG/JBIG2, assigning a specific type of compression (CCITT or LZW, as example) and DPI parameter?

AVIL
12th October 2024, 22:58
Hi

A theoretical approach could be:

1. Extract images from pdf (e.g. with command pdfimages in linux)
2. Import to avisynth (imagesource)
3. Deskew with defreq plugin from Fizick or FQuiver by vcmohan
4. Denoise spatially with a denoiser of your choice
5 Write the result wiith imagewriter to your preferred format

But this is only a theoretical approach. Real life is usually harder.

Good luck.

johnmeyer
13th October 2024, 00:05
In Adobe Acrobat you can use the Enhance feature in the Scan & OCR tool.

You can try photographing the documents instead of scanning them. This is helpful if your noise comes from textured paper.

If you OCR a document using Acrobat, it will deskew the image prior to doing the OCR.

FranceBB
13th October 2024, 00:31
On Windows you can use the good old PDFill (it works on XP and later) to convert the PDF to images.
At that point, either ImageSource() or FFImageSource() will do.
Once you have the images (either png or tiff since they're lossless) indexed in Avisynth, the choice of the filter is yours.
I can't really suggest anything 'cause I haven't actually tried on documents (I only applied filters on scanned photografies from days gone by, when it was common to have a reel with x many pictures and you had to bring them to a photographer to develop them in a dark room).
Anyway, if there's text, I would definitely stay away from dfttest() as it could very easily destroy the whole thing.
What you describe, though, feels more like ringing than noise (like dots around letters caused by jpeg compression and whatnot) so perhaps some deringing filters will probably help (just not BlindPP() as it would destroy the whole thing).

Best of luck.

tormento
13th October 2024, 11:39
Ok guys, how can I "batch" hundreds of images and "execute" the avs files?

I am used to GUIs but they accept ffmpeg encoders only.

FranceBB
13th October 2024, 22:44
Ok guys, how can I "batch" hundreds of images and "execute" the avs files?

This looks like a good fit for FFAStrans. ;)
https://forum.doom9.org/showthread.php?t=176655

You can build a very simple workflow from the user interface, put the A/V Decoder in (i.e the indexer) followed by a custom AVS Script and then a picture encoder.
From there, it's gonna be as easy as right clicking and selecting all the pictures with ctrl + a and then submitting them to the workflow. ;)

tormento
15th October 2024, 12:08
This looks like a good fit for FFAStrans. ;)
Isn't that "too much"?

Like using a nuke to dig a pond.

FranceBB
15th October 2024, 12:12
Isn't that "too much"?

Like using a nuke to dig a pond.

Maybe, but it literally takes 5 minutes to create an Avisynth workflow, so it's kinda worth it, especially if you're ever gonna need it again. I can show you if you want. ;)