1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-25 13:23:02 +04:00

Merge pull request #23442 from LaurentBerger:tuto_findFile

Fix image loading in tutorials code #23442

Fixes https://github.com/opencv/opencv/issues/23378

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [X] I agree to contribute to the project under Apache 2 License.
- [X] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [X] The PR is proposed to the proper branch
- [X] There is a reference to the original bug report and related work
- [X] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [X] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
Laurent Berger
2023-04-06 12:02:00 +02:00
committed by GitHub
parent 793c966c40
commit 9742c73254
7 changed files with 63 additions and 33 deletions
@@ -13,8 +13,9 @@ using namespace std;
int main() {
//! [generalized-hough-transform-load-and-setup]
// load source image and grayscale template
Mat image = imread("images/generalized_hough_mini_image.jpg");
Mat templ = imread("images/generalized_hough_mini_template.jpg", IMREAD_GRAYSCALE);
samples::addSamplesDataSearchSubDirectory("doc/tutorials/imgproc/generalized_hough_ballard_guil");
Mat image = imread(samples::findFile("images/generalized_hough_mini_image.jpg"));
Mat templ = imread(samples::findFile("images/generalized_hough_mini_template.jpg"), IMREAD_GRAYSCALE);
// create grayscale image
Mat grayImage;
@@ -105,4 +106,4 @@ int main() {
//! [generalized-hough-transform-draw-results]
return EXIT_SUCCESS;
}
}