Skip to content

weiyi-li/MATLAB-Scanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

MATLAB-Scanner

Introduction

This program is able to convert real document photo to a scanned copy with scanner texture.
This program extracts the RGB channels and pixel values in the file image, and sets the color thresholds of red, green, blue and gray according to the conversion relationship between gray and RGB in the sRGB color gamut. By adjusting the RGB assignment, the red, green, and blue domains are saturated and the areas exceeding the grayscale threshold are replaced with white. The saturation of the color part is preserved and the white background effect of the document can be realized.

Demonstration

Test1 File with 1 RGB primary color (blue)

The picture wiht 1 RGB primary color can be smoothly converted by saturizing the color and wiping out the region with intermediate gray value. The fold of paper can also be relieved of eliminated since it is classified as an intermediate gray value.

Original image

Image

Scanned image

Image

Test2 Picture mainly with black and RGB primary colors

The picture mainly composed of black and RGB primary colors can be smoothly converted by saturizing the color.

Original image

Image

Scanned image

Image

Test3 Picture with mixed colors

The conversion of photo part with mixed color is a limitation.

Original image

Image

Scanned image

Image

Test4 File with more than 1 RGB primary color (blue and red)

The document with black and white and the RGB primary colors blue and red can be smoothly converted by saturizing the color, but the conversion of photo part with mixed color is not that perfect since the mixed color is stratified to RGB primary colors. The blurred areas performed by Gaussian blur can be replaced by white color if the blur radius is relatively larger (greater than approximately 40 pixels).

Original image

Image

Scanned image

Image

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages