Added Laplace and Canny reST tutorials and corrected a small bug in Canny sample code

This commit is contained in:
Ana Huaman
2011-06-27 17:06:54 +00:00
parent cf28846bce
commit 832262e376
8 changed files with 371 additions and 19 deletions

View File

@@ -30,10 +30,10 @@ char* window_name = "Edge Map";
void CannyThreshold(int, void*)
{
/// Reduce noise with a kernel 3x3
blur( src_gray, dst, Size(3,3) );
blur( src_gray, detected_edges, Size(3,3) );
/// Canny detector
Canny( src_gray, detected_edges, lowThreshold, lowThreshold*ratio, kernel_size );
Canny( detected_edges, detected_edges, lowThreshold, lowThreshold*ratio, kernel_size );
/// Using Canny's output as a mask, we display our result
dst = Scalar::all(0);
@@ -54,6 +54,9 @@ int main( int argc, char** argv )
if( !src.data )
{ return -1; }
/// Create a matrix of the same type and size as src (for dst)
dst.create( src.size(), src.type() );
/// Convert the image to grayscale
cvtColor( src, src_gray, CV_BGR2GRAY );