Start Developing OpenCV Applications Immediately Using the BDTI Quick-Start OpenCV Kit (Article)
Register or sign in to access the Embedded Vision Academy's free technical training content.
The training materials provided by the Embedded Vision Academy are offered free of charge to everyone. All we ask in return is that you register, and tell us a little about yourself so that we can understand a bit about our audience. As detailed in our Privacy Policy, we will not share your registration information, nor contact you, except with your consent.
Registration is free and takes less than one minute. Click here to register, and get full access to the Embedded Vision Academy's unique technical training content.
If you've already registered, click here to sign in.
Eric,
Thank you for this great Quick-Start OpenCV Kit!
Being more used to the Windows OS myself, this definitely got me up and running very rapidly!
In the CannyEdgeDetection example code, you have calls to the Gaussian/Sobel/cartToPolar OpenCV functions, in addition to the Canny function call.
I assume that the Canny function is also doing these operations.
Can you confirm that this is the case, and that you have called these functions redundantly for illustrative purposes?
Regards,
Mario Bergeron
The root password = ubuntu













Mario,
The additional code is required to display the Sobel X,Y, angle, and magnitude outputs.
The OpenCV Canny function does not expose this data.
For Figure 14 (and the demo) I want to show the user what this intermediate data looks like.
The following lines are NOT required for Canny operation:
Sobel( blurred, grad_x, CV_32F, 1, 0, Ksize, 1, 0, BORDER_DEFAULT );
Sobel( blurred, grad_y, CV_32F, 0, 1, Ksize, 1, 0, BORDER_DEFAULT );
cartToPolar( grad_x, grad_y, magnitude, angle, true );
threshold( magnitude, magnitude, LowThres, 0, THRESH_TOZERO );
threshold( grad_x, grad_x, LowThres, 0, THRESH_TOZERO );
threshold( grad_y, grad_y, LowThres, 0, THRESH_TOZERO );
Mat mask, MaskedAngle;
Mat bmask = Mat::zeros(magnitude.rows, magnitude.cols, CV_8U );
threshold( magnitude, mask, LowThres, 1, THRESH_BINARY );
mask.convertTo( bmask, CV_8U );
angle.copyTo( MaskedAngle, bmask );