Skip to content

Commit

Permalink
modified the help in examples 20-01 and 02
Browse files Browse the repository at this point in the history
  • Loading branch information
garybradski committed Jun 11, 2017
1 parent a1630a0 commit 58bfa5b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion example_20-01.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ static void help(char* argv[]) {
" of cluster centers and uses kmeans to move those cluster centers to their\n"
" representative location\n"
"Usage:\n"
<< argv[0] << "\n" << endl;
<< argv[0] << "\n\n"
<< "ESC or 'q' or 'Q' to quit\n\n"<< endl;
}

int main(int argc, char** argv) {
help(argv);
const int MAX_CLUSTERS = 5;
cv::Scalar colorTab[] = {
cv::Scalar( 0, 0, 255 ),
Expand Down
7 changes: 4 additions & 3 deletions example_20-02.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ const cv::Scalar colorTab[] = {
static void help(char* argv[]) {
cout << "\nThis program demonstrates using the Mahalanobis distance for classification.\n"
" It generates an image with random points, uses kmeans clustering.\n"
" And then uses the Mahalanobis distance for classification.\n"
" And then uses the Mahalanobis distance for classification of new points (colors) .\n"
"Usage:\n"
<< argv[0] << "\n" << endl;
<< argv[0] << "\n\n"
<< "ESC to quit\n\n"<< endl;
}
int main(int argc, char** argv) {
cv::Mat img(500, 500, CV_8UC3, cv::Scalar::all(0));

cv::Mat points(SAMPLE_COUNT, 1, CV_32FC2);
cv::RNG rng(time(NULL));
help(argv);
rng.fill(points, cv::RNG::UNIFORM, cv::Scalar(0, 0), cv::Scalar(img.cols, img.rows));

cv::Mat labels;
Expand Down

0 comments on commit 58bfa5b

Please sign in to comment.