Sobel derivative in OpenCV

This code snippet is to demonstrate how to compute Sobel 3×3 derivatives convolving the image with Sobel kernels. You can easily extend to different kernel sizes giving the kernel radius as input to my_sobel, and creating the appropriate kernel. #include <opencv2\opencv.hpp> #include <iostream> using namespace std; using namespace cv; void my_sobel(const Mat1b& src, Mat1s& dst, … Read more