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

Skip to content

Tests failed on Loongarch platform because of divided by 0 is being handled incorrectly #25795

@CNClareChen

Description

@CNClareChen

System Information

CI: auto test on LoongArch platform

Detailed description

Two modules failed to pass the tests, namely Performance:gapi and Python3.

The analysis shows that the cause of the error in python3 occurs in the test of the cv::divide interface. The python interface will do data processing. When the divisor is 0, it will be changed to the maximum value of its data type. Then the result of the division operation is 0, but when cv::divide divides by 0, it returns 0x7f800000, and the final result is saturated to 255. The same reasons apply to the gapi module.

The solution is to perform a check for INF within the cv_round function in the include/opencv2/core/hal/intrin_lasx.hpp file. When submitting the pull request last year, the issue regarding cv_round was discussed. For more details, please see #23929.

Steps to reproduce

none

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions