Skip to content

techno-robocup/cv2-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

OpenCV C++ Demo

A comprehensive demonstration of OpenCV capabilities in C++, showcasing image processing, drawing operations, and webcam capture.

Features

  • Image Processing: Grayscale conversion, Gaussian blur, Canny edge detection
  • Drawing Operations: Circles, rectangles, lines, polygons, and text
  • Webcam Capture: Real-time video feed processing (optional)
  • Custom Filter: Template for implementing your own image filters

Prerequisites

Ubuntu/Debian

sudo apt update
sudo apt install libopencv-dev cmake build-essential

macOS

brew install opencv cmake

Fedora/RHEL

sudo dnf install opencv-devel cmake gcc-c++

Building

mkdir build
cd build
cmake ..
make

Running

./opencv_demo

Controls

  • Press any key to advance through demos
  • Press 'q' to quit
  • In webcam mode: Press 'q' to exit webcam feed

Customization

The applyCustomFilter() function in main.cpp is left for you to implement! Try experimenting with:

  • Bilateral filtering: bilateralFilter()
  • Morphological operations: erode(), dilate(), morphologyEx()
  • Color space conversions: cvtColor() with different color spaces
  • Histogram equalization: equalizeHist()
  • Image sharpening or embossing
  • Custom kernels with filter2D()

Learning Resources

Troubleshooting

If you get "cannot open webcam" error, make sure:

  1. Your webcam is connected and not in use by another application
  2. You have permissions to access the webcam
  3. Try changing the camera index from 0 to 1 or 2 in VideoCapture cap(0)

About

A demo repo for writing cv2 using C++.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published