September 2018
Intermediate to advanced
380 pages
9h 40m
English
As Sobel does not provide rotation symmetry, a Scharr operator is used to overcome that by using different filter masks as follows:

As can be seen from the mask, the Scharr operator gives more weight to central rows or central columns to find edges. The program to implement a Scharr filter is as follows:
#include <iostream>#include "opencv2/opencv.hpp"int main (){ cv::Mat h_img1 = cv::imread("images/blobs.png",0); cv::cuda::GpuMat d_img1,d_resultx,d_resulty,d_resultxy; d_img1.upload(h_img1); cv::Ptr<cv::cuda::Filter> filterx,filtery; filterx = cv::cuda::createScharrFilter(CV_8UC1,CV_8UC1,1,0); filterx->apply(d_img1, d_resultx); ...Read now
Unlock full access