Skip to content

Address bug in Template Matcher#19975

Merged
opencv-pushbot merged 1 commit intoopencv:3.4from
danielenricocahall:fix-template-matcher-sqdiff
Apr 26, 2021
Merged

Address bug in Template Matcher#19975
opencv-pushbot merged 1 commit intoopencv:3.4from
danielenricocahall:fix-template-matcher-sqdiff

Conversation

@danielenricocahall
Copy link
Copy Markdown
Contributor

@danielenricocahall danielenricocahall commented Apr 26, 2021

Addresses #9597 using workaround described in last comment. Test case was just the example provided in the issue. Note: this only affects the IPP implementation.

Pull Request Readiness Checklist

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

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@alvoron
Copy link
Copy Markdown
Contributor

alvoron commented Apr 26, 2021

@danielenricocahall did you have a chance to run the test without the fix?
I run it without the fix and the test is passed. Could you please double-check?

@danielenricocahall
Copy link
Copy Markdown
Contributor Author

danielenricocahall commented Apr 26, 2021

@danielenricocahall did you have a chance to run the test without the fix?
I run it without the fix and the test is passed. Could you please double-check?

@alvoron ah yes I should have clarified - this specifically affects the IPP implementation i.e; when https://github.com/opencv/opencv/blob/master/modules/imgproc/src/templmatch.cpp#L1188 is used instead of common_matchTemplate. When the IPP implementation is used, without the fix, the result is -8.

@alalek
Copy link
Copy Markdown
Member

alalek commented Apr 26, 2021

@danielenricocahall Could you please clarify which IPP version should be used to validate this fix? (IPPICV or IPP standalone of some version)

@danielenricocahall
Copy link
Copy Markdown
Contributor Author

danielenricocahall commented Apr 26, 2021

@danielenricocahall Could you please clarify which IPP version should be used to validate this fix? (IPPICV or IPP standalone of some version)

@alalek From cv::getBuildInformation():

  Other third-party libraries:
    Intel IPP:                   2020.0.0 Gold [2020.0.0]
           at:                   /home/daniel/CLionProjects/opencv/cmake-build-debug/3rdparty/ippicv/ippicv_lnx/icv
    Intel IPP IW:                sources (2020.0.0)
              at:                /home/daniel/CLionProjects/opencv/cmake-build-debug/3rdparty/ippicv/ippicv_lnx/iw
    VA:                          NO
    Intel VA-API/OpenCL:         NO
    Lapack:                      YES (/usr/lib/x86_64-linux-gnu/libopenblas.so -lm -ldl)
    Eigen:                       YES (ver 3.3.7)
    Custom HAL:                  NO
    Protobuf:                    build (3.5.1)

IPPICV should be used to validate.

@alvoron
Copy link
Copy Markdown
Contributor

alvoron commented Apr 26, 2021

@danielenricocahall thank you for the prompt response!
I've reproduced the issue with IPPICV and verified that the test is passed with your fix.

@alvoron alvoron self-assigned this Apr 26, 2021
@alvoron alvoron self-requested a review April 26, 2021 22:36
@opencv-pushbot opencv-pushbot merged commit 55aa1d4 into opencv:3.4 Apr 26, 2021
@alalek alalek mentioned this pull request May 1, 2021
@alalek alalek mentioned this pull request Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants