Commit 90cce3a2 authored by Gary Bradski's avatar Gary Bradski

fixed minor bug, doc'd

parent 6eb0fc6e
...@@ -5,6 +5,24 @@ ...@@ -5,6 +5,24 @@
using namespace cv; using namespace cv;
void help()
{
printf("\nDemonstrate the use of the distance transform function between edge images.\n"
"Usage:\n"
"./distrans [image_name -- default image is stuff.jpg]\n"
);
printf( "\nHot keys: \n"
"\tESC - quit the program\n"
"\tC - use C/Inf metric\n"
"\tL1 - use L1 metric\n"
"\tL2 - use L2 metric\n"
"\t3 - use 3x3 mask\n"
"\t5 - use 5x5 mask\n"
"\t0 - use precise distance transform\n"
"\tv - switch Voronoi diagram mode on/off\n"
"\tSPACE - loop through all the modes\n" );
}
int maskSize0 = CV_DIST_MASK_5; int maskSize0 = CV_DIST_MASK_5;
bool buildVoronoi = false; bool buildVoronoi = false;
int edgeThresh = 100; int edgeThresh = 100;
...@@ -89,21 +107,11 @@ int main( int argc, char** argv ) ...@@ -89,21 +107,11 @@ int main( int argc, char** argv )
gray = imread(filename, 0); gray = imread(filename, 0);
if(gray.empty()) if(gray.empty())
{ {
printf("Usage: distrans <image_name>\n"); help();
return 0; return -1;
} }
printf( "Hot keys: \n" help();
"\tESC - quit the program\n"
"\tC - use C/Inf metric\n"
"\tL1 - use L1 metric\n"
"\tL2 - use L2 metric\n"
"\t3 - use 3x3 mask\n"
"\t5 - use 5x5 mask\n"
"\t0 - use precise distance transform\n"
"\tv - switch Voronoi diagram mode on/off\n"
"\tSPACE - loop through all the modes\n" );
namedWindow("Distance Map", 1); namedWindow("Distance Map", 1);
createTrackbar("Brightness Threshold", "Distance Map", &edgeThresh, 255, onTrackbar, 0); createTrackbar("Brightness Threshold", "Distance Map", &edgeThresh, 255, onTrackbar, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment