Let's look at the filters we have covered in this chapter. With this comprehensive OpenCV project you will be able to interactively see filtering effects on the given image.
This project covers Canny, Sobel, erosion, dilation and the thresholding operation in individual windows with a trackbar to dynamically change the filter variable which dynamically updates the processed image. Please note that practising is the only way to understand these concepts. After studying this project please make alterations to the code to see changes.
In addition to dynamic manipulation capabilities, we cluster each operation in cannyOperation
, sobelOperation
, erosionOperation
, dilationOperation
and thresholdingOperation
functions to make the code much more modular and cleaner. Let's go through the code:
#include "opencv2/imgproc/imgproc.hpp" #include "opencv2/highgui/highgui.hpp" #include <stdlib.h> #include <stdio.h> using namespace cv; /// Definetions #define MAX_BINARY_VALUE (255...