https://github.com/nicolashaubricht/opencv-course
This repository contains Python scripts for basic image processing using OpenCV. The scripts were developed as part of a free OpenCV course, and the repository will be updated as I progress through the modules.
https://github.com/nicolashaubricht/opencv-course
computer-vision image-processing opencv python
Last synced: about 1 month ago
JSON representation
This repository contains Python scripts for basic image processing using OpenCV. The scripts were developed as part of a free OpenCV course, and the repository will be updated as I progress through the modules.
- Host: GitHub
- URL: https://github.com/nicolashaubricht/opencv-course
- Owner: NicolasHaubricht
- Created: 2025-03-03T20:46:36.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-04T16:56:22.000Z (over 1 year ago)
- Last Synced: 2025-06-08T23:36:29.757Z (about 1 year ago)
- Topics: computer-vision, image-processing, opencv, python
- Language: Python
- Homepage:
- Size: 2.01 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# OpenCV Course
[](https://opencv.org/)
[](https://www.python.org/)
This repository contains Python scripts for basic image processing using OpenCV. The scripts were developed as part of a free OpenCV course, and the repository will be updated as I progress through the modules.
## 🛠Technologies Used
- **Python 3.8+** - Core programming language
- **OpenCV (cv2)** - Computer vision operations
- **NumPy** - Array manipulations and mathematical operations
- **Matplotlib** - Image visualization and plotting
## 📌 Topics Covered
The `main.py` file is organized into sections, each focusing on a specific OpenCV concept I studied. Below is an overview of the topics:
1. **Basic Image Loading and Display**
- Loading grayscale and color images using `cv2.imread()`.
- Inspecting image properties (shape, data type) with NumPy.
- Displaying images using Matplotlib with proper color mapping.
2. **Working with Color Images**
- Handling BGR vs. RGB color formats and converting between them.
- Reversing color channels for proper visualization.
3. **Splitting and Merging Color Channels**
- Splitting an image into its Red, Green, and Blue channels using `cv2.split()`.
- Merging channels back into a full-color image with `cv2.merge()`.
4. **Converting Color Spaces**
- Exploring grayscale and binary image manipulation.
- Modifying pixel values and visualizing changes.
5. **Cropping Images**
- Extracting regions of interest (ROI) from images using array slicing.
6. **Resizing Images**
- Scaling images with different methods:
- Using scaling factors (`fx`, `fy`) with `cv2.resize()`.
- Specifying exact dimensions (with potential aspect ratio issues).
- Maintaining aspect ratio for better quality.
7. **Saving Images**
- Writing processed images to disk using `cv2.imwrite()`.
8. **Flipping Images**
- Applying horizontal, vertical, and combined flips with `cv2.flip()`.
9. **Drawing Shapes**
- Drawing lines with `cv2.line()`.
- Drawing circles with `cv2.circle()`.
- Drawing rectangles with `cv2.rectangle()`.
10. **Adding Text**
- Overlaying text on images using `cv2.putText()` with customizable fonts, sizes, and colors.
11. **Combining Shapes and Text**
- Integrating rectangles and text for annotations on images.
## 📂 Repository Structure
```bash
opencv-course/
├── class/
├ ├── script.py
├── imports.py
├── main.py
└── README.md