Deimos is an experimental computer vision library in C
I am trying to distill my knowledge into a computer vision guide, which serves as an introductory guide to this field and goes into details about the algorithms implemented below. I welcome any suggestions/critiques, thanks!
- Geometric Transformations
- Rotation
- Scaling
- Shearing/Warping
- Smoothing
- Gaussian filter
- Median filter
- Bilateral filter
- Box filter
- Edge detection
- Unsharp mask
- Laplacian Filter (Difference of Gaussian)
- Sobel operator
- Color
- Greyscale
- Contrast
- Thresholding
- Global
- Otsu's Method
- Feature extraction
- Harris corner detection
git clone git@github.com:aadv1k/deimos
cd deimos/
make
If you don't have make on windows, you can instead use the
build.bat
, it gets the job done.
git clone git@github.com:aadv1k/deimos
cd deimos/
.\build.bat
Note The filters are un-optimized, they work best on smaller images
.\cv gray ..\data\img1.jpg .\output.png
.\cv sharpen --sigma 3 ..\data\img1.jpg .\output.png
.\cv blur --kernel 9 --sigma 5 ..\data\img1.jpg .\output.png
Usage:
C:\Users\Aadv1k\Desktop\deimos\bin\deimos.exe <command> <args> input output
Examples:
deimos blur --sigma 3.4 --kernel 5 input.png output.png
deimos gray input.png output.png
deimos median --kernel 3 input.png output.png
deimos sharpen --sigma 0.6 --kernel 3 input.png output.png
Commands:
Smoothing:
blur, gaussian Apply Gaussian blur to the image.
median Apply median filter to the image.
bilateral Apply bilateral filter to the image.
box, mean Apply box filter onto the image.
Edge Detection:
sobel Apply Sobel filter to the image.
laplacian Apply Laplacian filter onto the image.
sharpen Sharpen image via an unsharp mask.
Thresholding:
global-threshold Apply the global threshold filter over the image. 'sigma' would be the threshold.
otsu-threshold Apply Otsu's threshold filter over the image.
Feature Extraction:
harris-corners Detect corners within the image via Harris corner detection.
Transformations:
rotate Rotate the image by `sigma` deg.
scale Scale the image by sigma factor; if sigma is negative then downscale else upscale
shear Shear or skew the image at both axis by sigma factor.
flipX Horizontally mirror the image
flipY Vertically mirror the image
Color enhancements:
gray Convert image to grayscale.
contrast Increase/decrease contrast based on `sigma`
Other Commands:
help Print this help message.
Options:
--sigma Specify the primary modifier for the convolutions.
--kernel Define the kernel size for convolutions (if applicable).
--no-threshold Disable specifying a threshold for the sobel operator, default to setting gradient magnitude
Note this showcases only some of the many avaliable filters
.\bin\deimos blur --kernel 9 --sigma 3 .\data\img1.jpg .\img1-gaussian-3-9.png
Original Image | Gaussian Blur |
---|---|
.\bin\deimos median --kernel 9 .\data\img1.jpg ..\output.jpg
Original Image | Median Filter |
---|---|
.\bin\deimos sharpen --kernel 9 --sigma 1.2 .\data\img1.jpg ..\output.jpg
Original Image | Unsharp Mask |
---|---|
.\bin\deimos laplacian --kernel 3 --sigma 1.5 .\data\img1.jpg .\output.jpg
Original Image | Laplacian Filter |
---|---|
.\bin\deimos sobel otsu-threshold .\data\img1.jpg .\output.jpg
Original Image | Otsu's threshold |
---|---|
.\bin\deimos sobel --no-threshold .\data\img1.jpg .\output.jpg
Original Image | Sobel Operator |
---|---|