Skip to content

int64 data type in FileStorage#26399

Merged
asmorkalov merged 3 commits intoopencv:5.xfrom
dkurt:dk/file_storage_new_data
Nov 8, 2024
Merged

int64 data type in FileStorage#26399
asmorkalov merged 3 commits intoopencv:5.xfrom
dkurt:dk/file_storage_new_data

Conversation

@dkurt
Copy link
Copy Markdown
Member

@dkurt dkurt commented Nov 1, 2024

Pull Request Readiness Checklist

resolves #23333

Proposed approach is not perfect in terms of complexity and potential bugs. Instead of changing INT raw size from 4 to 8, we check int64 value can be fitted to int32 or not.

Collections such as cv::Mat rely on data type symbol.

This PR is addressed to 5.x branch first to cover CV_64S Mat. Later, it can be backported to 4.x

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

@dkurt dkurt added this to the 5.0-alpha milestone Nov 1, 2024
@asmorkalov
Copy link
Copy Markdown
Contributor

@dkurt The PR triggers massive exceptions in all tests:

[ RUN      ] RGBD_Normals/RenderedNormals.check/0, where GetParam() = (CV_32F, (RgbdNormals::RGBD_NORMALS_METHOD_FALS, (81.8213, 0)), true)
unknown file: Failure
C++ exception with description "OpenCV(5.0.0-pre) /home/ci/opencv/modules/core/src/persistence.cpp:1678: error: (-215:Assertion failed) ofs == fs_data_blksz[blockIdx] in function 'normalizeNodeOfs'
" thrown in the test body.
[  FAILED  ] RGBD_Normals/RenderedNormals.check/0, where GetParam() = (CV_32F, (RgbdNormals::RGBD_NORMALS_METHOD_FALS, (81.8213, 0)), true) (84 ms)

@dkurt
Copy link
Copy Markdown
Member Author

dkurt commented Nov 2, 2024

@asmorkalov, thanks! I just wanted to trigger all the tests by this PR, it's not finished

@dkurt dkurt force-pushed the dk/file_storage_new_data branch 2 times, most recently from 665a328 to ad47a96 Compare November 5, 2024 15:57
@dkurt dkurt changed the title int64 data type in FileStorage. Support 0d and 1d Mat int64 data type in FileStorage Nov 5, 2024
@asmorkalov asmorkalov modified the milestones: 5.0-alpha, 4.11.0 Nov 6, 2024
int64 test (failed)

Positive and negative INT64

correct symbols

int64 Mat

Fix test

fix empty mat

Cast to int64 depends on format

Fix warnings

fix int64 Mat

Write first scalar

Fix writeInt
@dkurt dkurt force-pushed the dk/file_storage_new_data branch from f937791 to afdeea9 Compare November 6, 2024 09:52
@dkurt dkurt added the port into 4.x is needed Label for maintainers. Authors of PR can ignore this label Nov 6, 2024
@dkurt dkurt marked this pull request as ready for review November 8, 2024 02:57
@asmorkalov asmorkalov self-assigned this Nov 8, 2024
@asmorkalov asmorkalov merged commit a7bb17b into opencv:5.x Nov 8, 2024
asmorkalov pushed a commit that referenced this pull request Nov 11, 2024
int64 data type support for FileStorage. 1d and empty Mat with exact dimensions #26434

### Pull Request Readiness Checklist

Port of #26399 to 4.x branch

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
@dkurt dkurt added port/backport done Label for maintainers. Authors of PR can ignore this and removed port into 4.x is needed Label for maintainers. Authors of PR can ignore this labels Nov 11, 2024
thewoz pushed a commit to CobbsLab/OPENCV that referenced this pull request Feb 13, 2025
int64 data type support for FileStorage. 1d and empty Mat with exact dimensions opencv#26434

### Pull Request Readiness Checklist

Port of opencv#26399 to 4.x branch

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: core category: features2d port/backport done Label for maintainers. Authors of PR can ignore this

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants