fix typo and simplify example (grayscale template)

pull/22482/head
Markus Heck 2 years ago
parent e2a9cff3dc
commit 5408949951
  1. 2
      doc/tutorials/objdetect/generalized_hough_ballard_guil/generalized_hough_ballard_guil.markdown
  2. 8
      samples/cpp/tutorial_code/objectDetection/generalizedHoughTransform.cpp

@ -8,7 +8,7 @@ Object detection with Generalized Ballard and Guil Hough Transform {#tutorial_ge
Goal 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 - Use @ref cv::GeneralizedHoughBallard and @ref cv::GeneralizedHoughGuil to detect an object

@ -12,14 +12,12 @@ using namespace std;
int main() { int main() {
//! [generalized-hough-transform-load-and-setup] //! [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 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 // create grayscale image
Mat templ = Mat(imgTemplate.rows, imgTemplate.cols, CV_8UC1);
Mat grayImage; Mat grayImage;
cvtColor(imgTemplate, templ, COLOR_RGB2GRAY);
cvtColor(image, grayImage, COLOR_RGB2GRAY); cvtColor(image, grayImage, COLOR_RGB2GRAY);
// create variable for location, scale and rotation of detected templates // create variable for location, scale and rotation of detected templates

Loading…
Cancel
Save