diff --git a/examples/image_ex.cpp b/examples/image_ex.cpp index e050a12d2..72a05402e 100644 --- a/examples/image_ex.cpp +++ b/examples/image_ex.cpp @@ -45,12 +45,15 @@ int main(int argc, char** argv) // to BMP files. load_image(img, argv[1]); - // Now lets use some image functions. This example is going to perform - // simple edge detection on the image. First lets find the horizontal and - // vertical gradient images. + + // Now lets use some image functions. First lets blur the image a little. + array2d blurred_img; + gaussian_blur(img, blurred_img); + + // Now find the horizontal and vertical gradient images. array2d horz_gradient, vert_gradient; array2d edge_image; - sobel_edge_detector(img, horz_gradient, vert_gradient); + sobel_edge_detector(blurred_img, horz_gradient, vert_gradient); // now we do the non-maximum edge suppression step so that our edges are nice and thin suppress_non_maximum_edges(horz_gradient, vert_gradient, edge_image);