A number of image processing and computer vision algorithms implemented with the help of OpenCV. The project is part of a series of assignemts in HCMUS' Computer Vision course.
data/
folder contains some sample input and output imagesinclude/
folder contains C++ header files (*.h
extension)src/
folder contains C++ source files (*.cpp
extension)
At the moment, the following algorithms and processes are implemented:
-
-rgb2grayscale
$^1$ : convert RGB to grayscale image -
-brightness
$^1$ : adjust brightness of the image by a given factor -
-contrast
$^1$ : adjust brightness of the image by a given factor -
-avg
,-med
, and-gau
$^2$ : apply image filtering with average, median, and Gaussian kernel respectively -
-sobel
,-laplace
$^2$ : edge detection using$3 \times 3$ Sobel and Laplacian kernel respectively -
-harris
$^2$ : corner detection with Harris detector
Notes
src/process.cpp
for detailed implementation
src/filter.cpp
for detailed implementation
Compile the program using your choice of environment and invoke the executable.
Here I present the Bash syntax to run the program in Ubuntu terminal:
input="path/to/input/image"
output="path/to/input/image"
factor=1.5 # a floating point number
ksize=5 # integer kernel size (must be an odd number)
# Examples of how to run the program
./main -rgb2gray $input $output
./main -brightness $input $output $factor
./main -contrast $input $output $factor
./main -avg $input $output $ksize
./main -med $input $output $ksize
./main -gau $input $output $ksize
./main -sobel $input $output
./main -laplace $input $output
The testing samples used in this project are products of NASA/ESA Hubble Space Telescope, Twitter user hitsukuya, miHoYo Co., Ltd., and unknown creator of an Internet meme. All data were used for educational and research purposes.