Image Filter---image scanning algorithm

Source: Internet
Author: User
Tags image filter

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.