Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@savuor
Copy link
Contributor

@savuor savuor commented May 30, 2024

Changes

  • added accuracy tests for mixed type arithmetic operations
    Note: div-by-zero values are removed from checking since the result is implementation-defined in common case
  • added perf tests for the same cases
  • fixed a typo in getMulExtTab() function that lead to dead code

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

@asmorkalov asmorkalov self-requested a review May 31, 2024 08:18
@asmorkalov asmorkalov added this to the 4.10.0 milestone May 31, 2024
@savuor savuor marked this pull request as ready for review May 31, 2024 23:33
}
double getMaxErr(int depth)
{
return depth <= CV_32S ? 2 : depth < CV_64F ? 1e-5 : 1e-12;
Copy link
Contributor

Choose a reason for hiding this comment

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

why 2?

Copy link
Contributor Author

@savuor savuor Jun 1, 2024

Choose a reason for hiding this comment

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

Actually, this part of code wasn't actually changed, it's inherited from previous commit
It's 2 everywhere where multiplication/division is performed
It can be safely dropped to 1 at least on my machine (will check it on CI)
I guess this threshold was tuned to actual accuracy level sometime in the past

@asmorkalov asmorkalov requested a review from opencv-alalek June 1, 2024 06:09
@asmorkalov asmorkalov self-assigned this Jun 2, 2024
@asmorkalov asmorkalov merged commit a7e53aa into opencv:4.x Jun 2, 2024
@savuor savuor deleted the rv/arithm_extend_tests branch June 2, 2024 22:13
@mshabunin mshabunin mentioned this pull request Jun 14, 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