Git Product home page Git Product logo

vidhi1290 / ai-ml-cartoonifier Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 2.38 MB

Welcome to Cartoonify, a fun and interactive project that converts real photos into cartoonified masterpieces! This project guides you through the entire process, from loading the image to displaying the final cartoon version.😛

Jupyter Notebook 100.00%
bilateral-filter cartoonify-ai edge-detection matplotlib numpy opencv skimage tensorflow

ai-ml-cartoonifier's Introduction

AI-ML-CARTOONIFIER😎❤️

🎨 Cartoonify: Turning Photos into Fun Art! 🎉

In this guide, we'll walk you through the entire process of transforming real photos into cartoonified images. Along the way, we'll explain each step and the technology stack involved in the process. Let's dive in!

Tech Stack

  • OpenCV: We use OpenCV for image processing tasks such as loading the image, converting color formats, and applying filters.
  • Matplotlib: Matplotlib helps visualize the images and results of each step in the transformation process.
  • NumPy: NumPy is used for efficient numerical computations throughout the process.
  • TensorFlow/Keras: This stack could be useful for potential advanced image processing applications.
  • Skimage: Provides image manipulation functions that may be used in more advanced versions of the process.

Steps Overview

Here's what we'll do in this process:

  1. 🖼️ Load the Image

    • Tech: OpenCV
    • What happens: Load the input image using OpenCV and convert it from BGR to RGB format. Display the real image to see where the journey begins!
  2. ✨ Apply Edge Detection

    • Tech: OpenCV
    • What happens: Convert the image to grayscale and apply a median blur to reduce noise. Use the Canny edge detection algorithm to find and visualize the edges in the image.
  3. 🎨 Apply Bilateral Filter

    • Tech: OpenCV
    • What happens: Apply a bilateral filter to smooth the image while preserving the edges. This filter helps to create a soft, artistic look.
  4. 🖌️ Cartoonify the Image

    • Tech: OpenCV
    • What happens: Invert the edges to create a mask, convert it to 3 channels, and combine it with the filtered image using bitwise operations. This creates the cartoonified version.
  5. 🆚 Display and Compare

    • Tech: Matplotlib
    • What happens: Display the real and cartoonified images side by side for comparison. Observe the magical transformation from reality to cartoon!

Backend and Process Details

  • Image Loading: The load_image function uses OpenCV to load the image and convert it to RGB format for consistency in further processing.

  • Edge Detection: The apply_edge_detection function converts the image to grayscale, applies a median blur, and uses Canny edge detection to find edges.

  • Bilateral Filter: The apply_bilateral_filter function uses a bilateral filter to smooth the image while preserving the edges for a soft, cartoonish appearance.

  • Cartoonify Image: The cartoonify_image function combines the filtered image with the inverted edges mask using bitwise operations. This creates the final cartoonified image.

  • Displaying Images: The show_comparison function uses Matplotlib to display the real and cartoonified images side by side for comparison.

Now you have a complete understanding of the tech stack and the process involved in converting real photos into cartoonified art. Enjoy your artistic journey! 🎉

ai-ml-cartoonifier's People

Contributors

vidhi1290 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.