+void CannyThreshold()
+{
+
+ if (g_data == NULL)
+ {
+ g_data = cvCreateMat(g_srcGray->rows,g_srcGray->cols,CV_8UC1);
+ }
+
+ if ( g_edges == NULL)
+ {
+ g_edges = cvCreateMat(g_srcGray->rows,g_srcGray->cols,CV_8UC1);
+ }
+
+ //g_data = 0;
+ cvShowImage("display", g_srcGray);
+ cvWaitKey(0);
+ // Reduce noise with a kernel 3x3. Input the grayscale source image, output to edges. (0's mean it's determined from kernel sizes)
+ cvSmooth( g_srcGray, g_edges, CV_GAUSSIAN, 9, 9 ,0 ,0 );
+
+ cvShowImage("display", g_edges);
+ cvWaitKey(0);
+
+ // Find the edges in the image
+ cvCanny( g_edges, g_edges, lowThreshold, lowThreshold*ratio, kernel_size );
+
+ cvShowImage("display", g_edges);
+ cvWaitKey(0);
+
+ // Mask the edges over G_data
+ //.copyTo( g_data, g_edges);
+}
+