CARVIEW |
Navigation Menu
-
-
Notifications
You must be signed in to change notification settings - Fork 56.2k
core: persistence: output reals as human-friendly expression. #25351
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
Conversation
~~I'm sorry but I cannot find file Very sorry, I found it in OpenCV Contrib xfeatures2d.
Implementation package is xfeatures2d, but test package is in feature2d. |
6e3995b
to
85dd602
Compare
In opencv-contrib, test is passed with merging this patch. So I retry to run CI. |
Usually when dealing with floating point numbers, my concern is to not lose "data" when saving to text for debugging purposes. If the text output is too heavy, maybe an option to set the desired precision for floating point numbers? |
Thank you for your comment. I thought same suggestion(it is old pull request).
If we can set the desired precision for floating point numbers, some information of input data will be lost. However we cannot explain that what truncate rule was applied. The truncated number only left. I believe the persistent function should not be truncated information of inputs. The reading value should be same as writing value. I think this is not unnatural. And the number of bytes required for the "%.17g" expression after modification is smaller than the "%.16e" expression before modification. Following are conversion example in test cases.
|
Thank you very much! (I'm sorry, it is repeatly) |
Thank you very much ! opencv/opencv_contrib#3714 is merged. |
TEST_P(Core_InputOutput_regression_25073, my_float16) | ||
{ | ||
cv::String res = ""; | ||
cv::float16_t my_float16(0.5); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not use cv::float16_t
internally in OpenCV. See #25387
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your comment, I create pull request #25391 to use hfloat instead of float16_t.
core: persistence: output reals as human-friendly expression. opencv#25351 Close opencv#25073 Related opencv#25087 This patch is need to merge same time with opencv/opencv_contrib#3714 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] 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 - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
core: persistence: output reals as human-friendly expression. opencv#25351 Close opencv#25073 Related opencv#25087 This patch is need to merge same time with opencv/opencv_contrib#3714 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] 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 - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
Close #25073
Related #25087
This patch is need to merge same time with opencv/opencv_contrib#3714
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.