Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
reconstructing binary image from scan

Subject: reconstructing binary image from scan

From: Alan B

Date: 28 Feb, 2011 18:48:05

Message: 1 of 1

I am trying to perfectly recover a binary image from a JPEG-compressed scan of a printout of the image. I'm hoping there are functions in the Matlab Image Processing Toolbox that can help me with this.

I'm asking this out of curiosity, rather than necessity - I would just like to know if there is a good way to do this in Matlab, I don't really need to do it.

More details:
I have a PDF document that was created by scanning a paper document. On the paper document was a printout of a binary image. On the real document, the binary image was fairly sharp and clear, with individual pixels clearly identifiable in some regions. On the PDF document, the image was JPEG compressed (or similar) and the pixel edges became blurry, but they are still clearly discernible to a human.

What I've done:
I now have a cropped screenshot of the scanned image, which is about three times larger than the original image (which, I believe, was 256x256). I manually identified the corners of this image, and found a transformation that approximately maps the scanned image to a 256x256 grid. The transformation includes a scaling of about 1/3, and a small rotation and translation.

Questions:
1. I'm not sure about the original image dimensions, so is there a good way to figure that out automatically?
2. Is there a clever way to identify the "correct" transformation, taking advantage of the relatively clear pixel edges present in the scanned image? Maybe the transformation and the original size need to be determined simultaneously?
3. What is the best way to implement the simultaneous general transformation and downsampling?
4. Is there some other application or method that can accomplish this with less effort?

Data:
http://www.picvalley.net/v.php?p=u/1969/204588906416202123861298918494JSYViKbbgVHgE1jCCAWu.PNG . The site truncated it a little, but it still illustrates the quality of the image.

Thanks for any help

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us