This repository contains a collection of image processing programs implemented in Python. Each project demonstrates fundamental image processing techniques such as thresholding, edge detection, segmentation, and video cartoonization. The projects were implemented as standalone scripts to demonstrate practical applications and concepts.
This program applies thresholding to an input image. Only the pixels within a defined intensity range are preserved, while all others are set to black.
Features:
- Read grayscale images or convert color images to grayscale.
- Accept two threshold values (0–255) as input.
- Generate a new image containing only pixels within the threshold range.
Example Output:
- Original vs. Thresholded Image
This program detects edges in grayscale images using the Sobel operator.
Features:
- Apply convolution with the Sobel kernel to compute image gradients.
- Threshold the gradient magnitude to detect edges.
- Optionally apply smoothing before edge detection to reduce noise.
Example Output:
- Edges detected with and without smoothing
This program identifies the green regions of football fields in images.
Features:
- Process images to detect football field regions using color segmentation.
- Highlight detected green regions with a red mask over the original image.
Example Output:
- Original image with green football field highlighted in red
This program segments coins in images while removing added text or background noise.
Workflow:
- Load the image and convert it to grayscale.
- Apply thresholding for initial segmentation.
- Use morphological operations (erosion, dilation, opening, closing) to remove noise and text.
- Fill holes inside coins generated by segmentation.
- Use the final mask to restore the original image without text.
Tips:
- Experiment with different kernel sizes and operation combinations for best results.
Example Output:
- Original image → segmented coins → restored image
This program cartoonizes videos by applying a watercolor-inspired effect to each frame.
Features:
- Process video frame by frame for cartoon effect.
- Control the number of colors and edge thickness (via edge dilation).
- Output a fully processed cartoonized video.
Example Output:
- Original video vs. cartoonized video