Bookmark and Share

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.

See a sample of this page's content below:


OpenCV is an open-source software component library for computer vision application development.  OpenCV is a powerful tool for prototyping embedded vision algorithms.  Originally released in 2000, it has been downloaded over 3.5 million times.  The OpenCV library supports over 2,500 functions and contains dozens of valuable vision application examples.  The library supports C, C++, and Python and has been ported to Windows, Linux, Android, MAC OS X and iOS.

The most difficult part of using OpenCV is building the library and configuring the tools.  The OpenCV development team has made great strides in simplifying the OpenCV build process, but it can still be time consuming.  To make it as easy as possible to start using OpenCV, BDTI has created the Quick-Start...

Eric Gregori's picture
Offline
Last seen: 19 weeks 9 hours ago
Level 6: Enchanter
Joined: 2011-08-16
Points: 202

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 );

 
 
OpenCV performs all of the above operations within the Canny() call.
Offline
Last seen: 2 days 18 hours ago
Level 1: Prestidigitator
Joined: 2011-10-04
Points: 3

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

Eric Gregori's picture
Offline
Last seen: 19 weeks 9 hours ago
Level 6: Enchanter
Joined: 2011-08-16
Points: 202

The root password = ubuntu