Canny Edge Detector¶
This code snippet shows how to highlight edges by means of the Canny edge detector algorithm.
C++¶
#include <eVision/EasyImage/ECannyEdgeDetector.h>
using namespace eVision;
// Images constructor
EImageBW8 srcImage;
EImageBW8 dstImage;
// ...
// Canny edge detector
ECannyEdgeDetector canny;
// Source and destination images must have the same size
dstImage.SetSize(&srcImage);
// Perform the edges detection
canny.Apply(srcImage, dstImage);
See also
C#¶
using eVision;
// Images constructor
EImageBW8 srcImage = new EImageBW8();
EImageBW8 dstImage = new EImageBW8();
// ...
// Canny edge detector
ECannyEdgeDetector canny = new ECannyEdgeDetector();
// Source and destination images must have the same size
dstImage.SetSize(srcImage);
// Perform the edges detection
canny.Apply(srcImage, dstImage);
See also
Python¶
import eVision
# Images constructor
src_image = eVision.EImageBW8()
dst_image = eVision.EImageBW8()
# ...
# Canny edge detector
canny = eVision.ECannyEdgeDetector()
# Source and destination images must have the same size
dst_image.SetSize(src_image)
# Perform the edges detection
canny.Apply(src_image, dst_image)
See also