Since the python, I have not used PS! Take you to the photo into a cartoon picture!

Source: Internet
Author: User

1th step: Reduce Image Color

Because the smooth and flat area of the bilateral filter keeps the edges clear at the same time, it is ideal for converting RGB images to cartoons. Although the speed seems to be slower, one technique is to repeat (for example, by num_bilateral = 77 times) To apply a small bilateral filter instead of just one large bilateral filter.

3rd Step: Creating Outlines

After noise reduction, you can safely apply adaptive thresholds to create outlines. Even if there is some image noise, blockSize = 9 of the CV2. The Adaptive_thresh_mean_c algorithm also ensures that the threshold value is applied to the average of the 9x9 neighborhood minus C = 2.

4 steps: Combining outlines and color images

The final step is to combine the processed color image (Img_color) with the Edge Mask (Img_edge). At this point, a cartoon can be a picture of the original code is written. Picture effect a bit of the aesthetics of science and technology, not enough literature and art, the effect lost to Photoshop, but in the efficiency of a city.

Finally, the above code is encapsulated into a function. Import Python's OS module to facilitate file processing.

J into the group: 125240963 to get dozens of sets of PDFs Oh!

Since the python, I have not used PS! Take you to the photo into a cartoon picture!

Related Article

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.