Skip to content

Solve Rect overflow issues. #21074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 10, 2021
Merged

Solve Rect overflow issues. #21074

merged 1 commit into from
Dec 10, 2021

Conversation

vrabaud
Copy link
Contributor

@vrabaud vrabaud commented Nov 17, 2021

Fow now, it is possible to define valid rectangle for which some
functions overflow (e.g. br(), ares() ...).
This patch fixes the intersection operator so that it works with
any rectangle.

Pull Request Readiness Checklist

  • I agree to contribut/e 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

@vrabaud
Copy link
Contributor Author

vrabaud commented Nov 17, 2021

This is needed as a tool to solve #21037
Also, some other functions could be fixed to deal with overflows too. operator|= and contains.

@vrabaud vrabaud force-pushed the 3.4_rect branch 2 times, most recently from efe4bbe to b0cfcfc Compare November 17, 2021 22:37
Fow now, it is possible to define valid rectangle for which some
functions overflow (e.g. br(), ares() ...).
This patch fixes the intersection operator so that it works with
any rectangle.
@vrabaud
Copy link
Contributor Author

vrabaud commented Dec 9, 2021

I just rebased to update the continuous integration.

Copy link
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

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

Approved with note that we don't have strategy how to handle other Rect_<int> operations.

@opencv-pushbot opencv-pushbot merged commit 9b7f40c into opencv:3.4 Dec 10, 2021
@vrabaud vrabaud deleted the 3.4_rect branch December 10, 2021 16:44
@alalek alalek mentioned this pull request Dec 11, 2021
@alalek alalek mentioned this pull request Dec 30, 2021
@alalek alalek mentioned this pull request Feb 22, 2022
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.

3 participants