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.π
- Host: GitHub
- URL: https://github.com/vidhi1290/ai-ml-cartoonifier
- Owner: Vidhi1290
- Created: 2024-04-19T14:21:20.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-19T14:23:11.000Z (over 1 year ago)
- Last Synced: 2025-02-02T18:33:17.362Z (9 months ago)
- Topics: bilateral-filter, cartoonify-ai, edge-detection, matplotlib, numpy, opencv, skimage, tensorflow
- Language: Jupyter Notebook
- Homepage:
- Size: 2.32 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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! π