mirror of
https://github.com/opencv/opencv.git
synced 2026-07-28 23:03:03 +04:00
Merge pull request #26937 from MaximSmolskiy:support-bool-type-for-filestorage-base64
Support bool type for FileStorage Base64 #26937 ### Pull Request Readiness Checklist OpenCV extra: https://github.com/opencv/opencv_extra/pull/1238 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
This commit is contained in:
@@ -125,11 +125,17 @@ class filestorage_io_test(NewOpenCVTests):
|
||||
cn = 3
|
||||
|
||||
image = np.zeros((rows, cols, cn), dtype)
|
||||
image[:] = (1, 2, 127)
|
||||
if dtype != bool:
|
||||
image[:] = (1, 2, 127)
|
||||
else:
|
||||
image[:] = (False, True, False)
|
||||
|
||||
for i in range(rows):
|
||||
for j in range(cols):
|
||||
image[i, j, 1] = (i + j) % 256
|
||||
if dtype != bool:
|
||||
image[i, j, 1] = (i + j) % 256
|
||||
else:
|
||||
image[i, j, 1] = (i + j) % 2 != 0
|
||||
|
||||
return image
|
||||
|
||||
@@ -178,6 +184,7 @@ class filestorage_io_test(NewOpenCVTests):
|
||||
|
||||
mats = {'normal_2d_mat_u8': self.get_normal_2d_mat(np.uint8),
|
||||
'normal_2d_mat_u32': self.get_normal_2d_mat(np.uint32),
|
||||
'normal_2d_mat_bool': self.get_normal_2d_mat(bool),
|
||||
'normal_nd_mat': self.get_normal_nd_mat(),
|
||||
'empty_2d_mat': self.get_empty_2d_mat(),
|
||||
'random_mat': self.get_random_mat()}
|
||||
|
||||
Reference in New Issue
Block a user