7 #include <opencv/highgui.h> 12 int main(
int argc,
char *argv[]) {
14 printf (
"usage: %s <image>\n", argv[0] );
17 printf (
"%s\n", argv[1] );
19 cv::Mat imgGray = cv::imread(argv[1], 0);
20 cv::Mat imgGauss, imgCanny, imgLinkedEdges(imgGray.rows, imgGray.cols, CV_8UC3);
21 cv::namedWindow(
"img",1);
22 cv::namedWindow(
"canny",1);
23 cv::namedWindow(
"linked_edges",1);
25 el.Init(imgGray.cols, imgGray.rows);
29 cv::GaussianBlur(imgGray, imgGauss, cv::Size(7,7), 1.5, 1.5);
31 el.Perform(imgCanny.data, V4R::Contour::MODE_SIMPLE);
32 el.Draw(imgLinkedEdges.data);
33 cv::imshow(
"img", imgGray);
34 cv::imshow(
"canny", imgCanny);
35 cv::imshow(
"linked_edges", imgLinkedEdges);
36 }
while (cv::waitKey(30) < 0) ;
void Canny(const cv::Mat &image, cv::Mat &edges, cv::Mat &gradient, cv::Mat &direction, cv::Mat &sobel_dx, cv::Mat &sobel_dy, double threshold1, double threshold2, int apertureSize=3, bool L2gradient=false)
int main(int argc, char *argv[])