4
2
Since I don't have a copier or scanner, I'm using an 8 megapixel camera to copy documents. This works pretty well except they need a lot of processing afterward. I'd like to get from a photo to a bitmap, but using
djpeg -grayscale -pnm photo.jpg |
pgmtopbm -threshold -value XXX
does not work so well, for two reasons:
It's hard to guess what XXX should be, and XXX is different for different photos.
Illumination varies, and sometimes a single threshold isn't what's right for the image.
How can I do better? The ideal solution will be fully automatic command-line program that I can run on Linux. (I have already written a program to remove dark pixels from the edges of images.)
NOTE: I really want a bitmap, that's just black and white pixels. No grayscale, no dithering.
http://unix.stackexchange.com/questions/108613/how-do-you-binarize-a-colored-image || Requiring ImageMagick: http://superuser.com/questions/405686/how-to-convert-a-photo-to-a-black-and-white-image-by-imagemagick – Ciro Santilli 新疆改造中心法轮功六四事件 – 2015-09-26T08:21:35.193
Similar question here: http://superuser.com/questions/107313/software-to-clean-up-photos-of-whiteboards-and-documents/
– Simon East – 2010-08-02T04:02:27.110