An open API service indexing awesome lists of open source software.

https://github.com/vidhi1290/ai-ml-cartoonifier

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.πŸ˜›
https://github.com/vidhi1290/ai-ml-cartoonifier

bilateral-filter cartoonify-ai edge-detection matplotlib numpy opencv skimage tensorflow

Last synced: 7 months ago
JSON representation

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.πŸ˜›

Awesome Lists containing this project

README

          

# 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! πŸŽ‰