Skip to content

Build warning fix for Charuco tests#24942

Merged
asmorkalov merged 1 commit intoopencv:4.xfrom
asmorkalov:as/android_warning_fix
Jan 31, 2024
Merged

Build warning fix for Charuco tests#24942
asmorkalov merged 1 commit intoopencv:4.xfrom
asmorkalov:as/android_warning_fix

Conversation

@asmorkalov
Copy link
Copy Markdown
Contributor

@asmorkalov asmorkalov commented Jan 30, 2024

Fixes warning produced by default Android NDK compiler:

modules/objdetect/test/test_charucodetection.cpp:817:19: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]

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 another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the 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

pixInSquare*(p.y/squareLength));
Mat winCorner = chessboardZoneImg(Rect(Point(cvRound(chessCorner.x) - 1, cvRound(chessCorner.y) - 1), Size(2, 2)));
bool eq = (cv::countNonZero(goldCorner1 != winCorner) == 0) | (cv::countNonZero(goldCorner2 != winCorner) == 0);
bool eq = (cv::countNonZero(goldCorner1 != winCorner) == 0) || (cv::countNonZero(goldCorner2 != winCorner) == 0);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, norm(a, b, NORM_INF) == 0 is faster and accurate than countNonZero(a != b)

@asmorkalov asmorkalov merged commit e48b96b into opencv:4.x Jan 31, 2024
This was referenced Feb 3, 2024
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.

2 participants