Support 0d/1d Mat in FileStorage#26420
Merged
asmorkalov merged 2 commits intoopencv:5.xfrom Nov 6, 2024
Merged
Conversation
Contributor
|
@dkurt, this is definitely useful! I wonder, if you write to FileStorage an empty mat: whether it will be done correctly? I mean, 0-dimensional matrix can mean two different things in OpenCV, a scalar or an empty matrix, depending on whether |
Member
Author
|
@vpisarev, added a test for empty Mat and required changes to handle it properly. |
asmorkalov
approved these changes
Nov 6, 2024
6 tasks
mshabunin
reviewed
Nov 11, 2024
| } | ||
|
|
||
| typedef testing::TestWithParam<const char*> FileStorage_exact_type; | ||
| TEST_P(FileStorage_exact_type, empty_mat) |
Contributor
There was a problem hiding this comment.
This test raises debug assertion
[ RUN ] Core_InputOutput/FileStorage_exact_type.empty_mat/0, where GetParam() = ".yml"
unknown file: Failure
C++ exception with description "OpenCV(5.0.0-pre) /work/opencv/modules/core/include/opencv2/core/mat.inl.hpp:1349: error: (-215:Assertion failed) i < dims() in function 'operator[]'
" thrown in the test body.
[ FAILED ] Core_InputOutput/FileStorage_exact_type.empty_mat/0, where GetParam() = ".yml" (1 ms)
Here:
opencv/modules/core/include/opencv2/core/mat.inl.hpp
Lines 1346 to 1354 in 979428d
Member
Author
There was a problem hiding this comment.
Same on 4.x branch, thanks. I will check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.