There are many commonly used scanning algorithms, here according to the steps of PS to give an automatic implementation method:
1. Seeking grayscale images
2. Inverting the grayscale image
3. Gaussian blur of inverse grayscale image
4. Mix the results of step 1 and step 4 in a mixture of color Dodge, and a little, so-called color Dodge, is a common layer of PS inside the blending method,
In a mathematical formula: Mix = min (A + (a X B)/(255-b), 255), where a is the foreground layer, B is the background layer, and mix represents the mixed result
The disadvantage of this approach is that it is easy to lose detail information.
Clearclcclose alli=imread ('. \image.jpg '); [Width,height] = size (i); gray_image = double (Rgb2gray (i)); reverse_image = 255-gray_image;h = fspecial (' Gaussian ', 5,2); Gaussian_reverse_image = IMFilter (reverse_image,h, ' same '); result = Gray_image + gray_image.*gaussian_reverse_image./ (255-gaussian_reverse_image); result = min (result,255); Figure,imshow (uint8 (Result), []), title (' Dummy scanning ') Imwrite (uint8 (Result), '. \dummyscanning.jpg ')
Original
Result diagram
Image Filter---image scanning algorithm