This repository contains a collection of Python programs for basic image processing tasks using various libraries such as OpenCV, Matplotlib, and PIL. Each program is designed to demonstrate specific image processing techniques and functions.
-
Read, Display, and Save Image Using Various Libraries:
- Reads an image using OpenCV, PIL, and Matplotlib.
- Converts the image to grayscale using different libraries.
- Displays the image using OpenCV, PIL, and Matplotlib.
- Saves the grayscale images.
-
Image Attributes:
- Retrieves and displays information about an image, including height, width, number of channels, and separates RGB channels.
-
Resize, Rotate, and Convert Image:
- Resizes and rotates an image using PIL.
- Converts the original image to binary.
-
Display Image Attributes:
- Utilizes PIL and OpenCV to extract and display attributes of an image, such as width, height, number of channels, image type, and shape.
-
Arithmetic and Logical Operations on Image:
- Performs arithmetic operations (addition, subtraction, multiplication, division) on two images.
- Performs logical operations (AND, OR, XOR, NOT) on two images.
-
Image Processing Operations:
- Image slicing.
- Blending of images using masks, filters, and blur functions.
- Cropping.
- Generating the negative of an image.
- Drawing on an image.
- Basic statistics of an image.
-
Edge Detection:
- Canny Edge Detection.
- Sobel Edge Detection.
- Prewitt Edge Detection.
- Laplacian Edge Detection.
-
Thresholding:
- Global thresholding.
- Local (adaptive) thresholding.
-
Histogram Equalization:
- Histogram equalization without using a function.
- Histogram equalization using the built-in function.
-
Image Resampling:
- Downsamples and upsamples an image.
-
Median and Mean Filters:
- Applies median and mean filters to an image.
-
Batch Processing:
- Iterates through all image files in a directory, applies rotation and resizing transformations, and displays the results.
- Clone this repository to your local machine.
- Install the required libraries using
pip install -r requirements.txt
. - Run the programs individually to see the results of each image processing task.
- Modify the programs as needed for your specific use case.
Feel free to explore, modify, and use these programs for your image processing projects!