fix typo and simplify example (grayscale template)
authorMarkus Heck <markus.heck13396@gmx.de>
Fri, 9 Sep 2022 13:27:11 +0000 (15:27 +0200)
committerMarkus Heck <markus.heck13396@gmx.de>
Fri, 9 Sep 2022 13:27:11 +0000 (15:27 +0200)
doc/tutorials/objdetect/generalized_hough_ballard_guil/generalized_hough_ballard_guil.markdown
samples/cpp/tutorial_code/objectDetection/generalizedHoughTransform.cpp

index b6f1479172d4a342c0402c196f83d1d68c9cd254..c5dc2590afe1646633a66c902bf22cc147338f3a 100644 (file)
@@ -8,7 +8,7 @@ Object detection with Generalized Ballard and Guil Hough Transform {#tutorial_ge
 Goal
 ----
 
-In this tutorial you will lern how to:
+In this tutorial you will learn how to:
 
 - Use @ref cv::GeneralizedHoughBallard and @ref cv::GeneralizedHoughGuil to detect an object
 
index 2630dc1f6e7757b71038ac7f90c22503a0ab73ad..dca52b13390b2f6f254b5760dc7813989d1bde16 100644 (file)
@@ -12,14 +12,12 @@ using namespace std;
 
 int main() {
     //! [generalized-hough-transform-load-and-setup]
-//  load source images
+//  load source image and grayscale template
     Mat image = imread("images/generalized_hough_mini_image.jpg");
-    Mat imgTemplate = imread("images/generalized_hough_mini_template.jpg");
+    Mat templ = imread("images/generalized_hough_mini_template.jpg", IMREAD_GRAYSCALE);
 
-//  create grayscale image and template
-    Mat templ = Mat(imgTemplate.rows, imgTemplate.cols, CV_8UC1);
+//  create grayscale image
     Mat grayImage;
-    cvtColor(imgTemplate, templ, COLOR_RGB2GRAY);
     cvtColor(image, grayImage, COLOR_RGB2GRAY);
 
 //  create variable for location, scale and rotation of detected templates