3
$\begingroup$

I have a JPEG file with a 200 dpi scan of a sample printout from a badly maintained old drum printer. I was able to segment it and to collect all instances of each letter together, for example

Letters A Letters G Letters Q Letters W

I would like to recreate its font; as the first step I've written a utility that estimates the shift amount (in pixels) between two images using MSE, then weighted-averages them according to that shift amount, and continues until all instances of a character have been processed.

My results look like

Sample result

Is this the best I can hope for, or are there smarter algorithms that are able to deal with low-quality samples?

Specifically, I would like to get rid of the ink smear at the top of the characters due to the rotational momentum of the drum with respect to the hammers.

(As far as I understand, super-resolution is not a good match for this task, and I couldn't find a good open source implementation of it.)

The second step is to use Potrace, of course.

$\endgroup$
8
  • $\begingroup$ Can it be assumed that the orientation of all instances of a character are identical? That is, that there is zero rotation? $\endgroup$ Commented May 27, 2017 at 13:32
  • $\begingroup$ Are you able to share the raw data for people to experiment? $\endgroup$ Commented May 27, 2017 at 13:33
  • 1
    $\begingroup$ @trichoplax There is a very slight consistent rotation clockwise as a scanning artifact. I've accounted for it when segmenting. There is no variation of rotation of individual characters. Initial image Charset encoding Segmented $\endgroup$ Commented May 27, 2017 at 16:44
  • $\begingroup$ Interesting indeed. just an idea- since you make own program, how is about setting different threshold by averaging, depending on which pixel row it is - say the top pixel row contributes pixels which are >95% black, second slightly more, say, all pixels which are >94% black ... and so on. $\endgroup$ Commented May 29, 2017 at 21:58
  • $\begingroup$ @Mikhail That's a good idea, but it definitely requires tuning. $\endgroup$ Commented May 30, 2017 at 3:02

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.