Commit Graph

59 Commits

Author SHA1 Message Date
Alexander Alekhin
75f28245a8 core: fix persistence bug in RAW I/O code
- persistence.cpp code expects special sizeof value for passed structures
- this assumption is lead to memory corruption problems
- fixed/workarounded test to prevent memory corruption on Linux 32-bit systems
2017-04-26 17:19:26 +03:00
Vladislav Sovrasov
931b32d102 core: add single DMatch/Keypoint I/O 2017-03-03 13:58:55 +03:00
Alexander Alekhin
89ce2dc405 core: DMatch I/O tests 2017-03-03 13:55:27 +03:00
Vladislav Sovrasov
c321d025c4 Fix DMatch and Keypoint I/O in FileStorage 2017-03-01 15:07:38 +03:00
Vladislav Sovrasov
896c34fab3 Add support of type headings from YAML1.2 2017-01-17 16:40:38 +03:00
Vladislav Sovrasov
7c266ffffe Add support of vector of vectors serialization to FileStorage 2016-11-16 13:37:30 +03:00
Vladislav Sovrasov
38483fe7a7 Skip UTF-8 BOM in FileStorage 2016-11-02 14:51:07 +03:00
fegorsch
ddf0554fff Use colon in "%YAML:1.0" directive when persisting to YAML-files
In YAML 1.0 the colon is mandatory. See http://yaml.org/spec/1.0/#id2558635.

This also allows prior releases to read YAML files created with the current version.
2016-10-25 18:18:35 +02:00
MYLS
47f2e618ee Add two tests.
- one test for type_id;
- another for comments in JSON;
2016-08-24 17:01:57 +08:00
MYLS
8596e82d98 Add JSON support.
a JSON emitter, a parser, tests and some basic doc.
2016-08-11 00:53:15 +08:00
MYLS
3935855365 Merge remote-tracking branch 'refs/remotes/opencv/master' into FileStorageBase64DocsTests
# Conflicts:
#	modules/core/test/test_io.cpp
2016-07-30 01:08:27 +08:00
Vadim Pisarevsky
134154ec6d Merge pull request #6963 from ilya-lavrenov:vec2i_fs 2016-07-21 20:55:05 +00:00
Ilya Lavrenov
313f54bc39 read/write vec2i from/to filestorage 2016-07-21 10:58:49 +03:00
Ilya Lavrenov
87ae4e0564 fixed clone of empty matrix 2016-07-19 11:31:53 +03:00
MYLS
617df09143 Modify Base64 functions and add test and documentation
Major changes:

- modify the Base64 functions to compatible with `cvWriteRawData` and so
on.
- add a Base64 flag for FileStorage and outputs raw data in Base64
automatically.
- complete all  testing and documentation.
2016-07-19 15:54:38 +08:00
Philipp Hasper
00112bbe10 persistence: fixing crash with space-only values 2016-07-08 12:41:05 +02:00
MYLS
df5a7c8ee9 build again for OpenCL.
I could not find the cause of the error:

```
C:\builds_ocv\precommit_opencl\opencv\modules\ts\src\ts_perf.cpp(361):
error: The difference between expect_max and actual_max is
8445966.0000002384, which exceeds eps, where

expect_max evaluates to 0.9999997615814209,

actual_max evaluates to 8445967, and

eps evaluates to 1.0000000000000001e-005.

Argument "dst0" has unexpected maximal value
```

Hope this is a false alarm.
2016-06-25 02:24:33 +08:00
MYLS
677d4d20ce fixed an error in the test... 2016-06-25 00:37:13 +08:00
MYLS
959002fb96 solve warnings and errors in test. 2016-06-24 23:41:40 +08:00
MYLS
7c92ee2e6e Split cvWriteRawData_Base64 into three functions
The three new functions:

```cpp
void cvStartWriteRawData_Base64(::CvFileStorage * fs, const char* name,
int len, const char* dt);
void cvWriteRawData_Base64(::CvFileStorage *
fs, const void* _data, int len);
void
cvEndWriteRawData_Base64(::CvFileStorage * fs);
```

Test is also updated. (And it's remarkable that there is a bug in
`cvWriteReadData`.)
2016-06-24 22:27:42 +08:00
MYLS
29921d055d change the parameter to CvMat and CvMatND
```cpp
cvWriteMat_Base64(::cv::FileStorage & fs, ::cv::String const & name,
::cv::Mat const & mat)
```
becomes:
```cpp
CV_EXPORTS void cvWriteMat_Base64(::CvFileStorage* fs, const char* name,
const ::CvMat* mat);
CV_EXPORTS void
cvWriteMatND_Base64(::CvFileStorage* fs, const char* name, const
::CvMatND* mat);
```
2016-06-20 16:59:58 +08:00
MYLS
958263d245 Solve warnings, and adjusted the test case. 2016-06-19 02:00:32 +08:00
MYLS
882e4221e7 fix errors from test.
Two other test are still needed.

1. Verify the Base64 data.
2. Read an old YML file for compatibility test.
2016-06-19 00:45:51 +08:00
MYLS
7b1f7c8d8e Add Base64 support for FileStorage
1. Add Base64 support for reading and writing XML\YML file.

The two new functions for writing:

```cpp
void cvWriteRawData_Base64(cv::FileStorage & fs, const void* _data, int
len, const char* dt);
void cvWriteMat_Base64(cv::FileStorage & fs, cv::String const & name,
cv::Mat const & mat);
```

2. Change YML file header form `YAML:1.0` to `YAML 1.0`. (standard
format)

3. Add test for Base64 part.
2016-06-18 22:14:11 +08:00
MYLS
ecd827fc8e Add Base64 support for FileStorage
[GSoC] FileStorage:
Add base64 support for reading and writting XML\YML file.
The two new functions:
```
void cvWriteRawData_Base64(cv::FileStorage & fs, const void* _data, int
len, const char* dt);
void cvWriteMat_Base64(cv::FileStorage & fs, cv::String const & name,
cv::Mat const & mat);
```
2016-06-18 21:40:29 +08:00
Philipp Hasper
47c4ee974a operator<< handles keys starting with underscore 2016-04-11 09:55:33 +02:00
Mansour Moufid
b99f7a29df Cast some image coordinates and sizes to double.
Conflicts:
	modules/gpu/perf/perf_imgproc.cpp

Cast a long integer to double explicitly.

Conflicts:
	modules/python/src2/cv2.cpp

Cast some matrix sizes to type int.

Change some vector mask types to unsigned.

Conflicts:
	modules/core/src/arithm.cpp
2015-04-25 18:54:53 +02:00
Adil Ibragimov
8a4a1bb018 Several type of formal refactoring:
1. someMatrix.data -> someMatrix.prt()
2. someMatrix.data + someMatrix.step * lineIndex -> someMatrix.ptr( lineIndex )
3. (SomeType*) someMatrix.data -> someMatrix.ptr<SomeType>()
4. someMatrix.data -> !someMatrix.empty() ( or !someMatrix.data -> someMatrix.empty() ) in logical expressions
2014-08-13 15:21:35 +04:00
Ilya Lavrenov
aa5326c231 cv::norm -> cvtest::norm in tests
Conflicts:

	modules/core/src/stat.cpp
2014-04-08 14:49:20 +04:00
Koji Miyazato
0a5d6e10b9 Added test code for I/O of user-defined types. 2014-03-22 00:32:44 +09:00
Ilya Lavrenov
37789f015a deleted excess semicolons, commas 2014-01-18 01:31:33 +04:00
Roman Donchenko
8200a95ced Boring changes - core.
This and several following commits contain the "boring" changes required
to support the new Ptr. These are changes like:

* new T -> makePtr<T> or .reset(new T) or Ptr<T>(new T)
  (depending on the situation)
* p.empty() -> !p
* delete_obj -> DefaultDeleter::operator()

and similar changes that are numerous, but primitive.
2013-09-05 18:26:43 +04:00
Roman Donchenko
2c4bbb313c Merge commit '43aec5ad' into merge-2.4
Conflicts:
	cmake/OpenCVConfig.cmake
	cmake/OpenCVLegacyOptions.cmake
	modules/contrib/src/retina.cpp
	modules/gpu/doc/camera_calibration_and_3d_reconstruction.rst
	modules/gpu/doc/video.rst
	modules/gpu/src/speckle_filtering.cpp
	modules/python/src2/cv2.cv.hpp
	modules/python/test/test2.py
	samples/python/watershed.py
2013-08-27 13:26:44 +04:00
Roman Donchenko
f55740da70 Deleted all trailing whitespace. 2013-08-21 18:59:24 +04:00
Roman Donchenko
f76dd99299 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	cmake/OpenCVModule.cmake
	doc/tutorials/calib3d/camera_calibration/camera_calibration.rst
	doc/tutorials/features2d/feature_detection/feature_detection.rst
	doc/tutorials/features2d/feature_flann_matcher/feature_flann_matcher.rst
	doc/tutorials/features2d/feature_homography/feature_homography.rst
	modules/core/include/opencv2/core/operations.hpp
	modules/core/src/arithm.cpp
	modules/gpu/perf/perf_video.cpp
	modules/imgproc/include/opencv2/imgproc/imgproc.hpp
	modules/java/generator/gen_java.py
	modules/java/generator/src/cpp/VideoCapture.cpp
	modules/nonfree/src/opencl/surf.cl
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/ocl/perf/perf_haar.cpp
	modules/ocl/perf/perf_precomp.hpp
	modules/ocl/src/color.cpp
	modules/ocl/src/filtering.cpp
	modules/ocl/test/test_color.cpp
	modules/ocl/test/test_objdetect.cpp
	modules/python/src2/cv2.cpp
	samples/gpu/CMakeLists.txt
	samples/gpu/super_resolution.cpp
2013-08-19 19:02:36 +04:00
Bahram Dahi
6cf9070b9a Added ability to read several opencv types (Size, Point, etc.) to FileStorage. Solves issue #3196 2013-08-14 15:08:34 -07:00
Andrey Kamaev
3b364330ad Merge branch '2.4' 2013-04-12 15:35:38 +04:00
Roman Donchenko
f64d512774 Backported globbing from master. 2013-04-10 19:36:39 +04:00
Andrey Kamaev
c979de1eed Rewrite Mat formatting without std streams 2013-04-03 11:55:19 +04:00
Andrey Kamaev
715fa3303e Move cv::Mat out of core.hpp 2013-04-01 15:24:34 +04:00
Andrey Kamaev
f77a375354 Merge branch '2.4' 2013-03-29 19:38:35 +04:00
Andrey Kamaev
be7bbe3aa9 Drop cv:: prefix from cv::String used inside the cv namespace 2013-03-22 22:14:50 +04:00
Andrey Kamaev
762aefd71b Compile opencv_test_core with cv::String instead of std::string
All tests passed!
2013-03-22 22:14:22 +04:00
Vadim Pisarevsky
a4815cf359 removed extra whitespaces 2013-03-22 15:12:55 +04:00
Vadim Pisarevsky
38693ef37c fixed http://code.opencv.org/issues/2899 2013-03-22 15:10:54 +04:00
marina.kolpakova
a486aafe7c add dlobbing under *nix 2013-03-09 21:10:45 +04:00
Marina Kolpakova
162f9fd7ea merged the trunk r8735:8766, r8769, r8777:8780, r8790 and r8800:8811 2012-06-28 17:07:17 +00:00
Andrey Kamaev
d9c74f63e1 All tests writing temporary files are updated to use cv::tempfile() function 2012-06-25 11:24:06 +00:00
Andrey Kamaev
9ad470ba5c backported API for storing OpenCV data structures to text string and reading them back (r8481, r8516, r8518, r8522) 2012-05-31 10:25:29 +00:00
Vadim Pisarevsky
17d9509e31 changed "void FileStorage::release(string&)" to "string FileStorage::releaseAndGetString()" 2012-05-30 13:02:45 +00:00