Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
7193a73c
Commit
7193a73c
authored
Apr 01, 2013
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move FileStorage to separate header
parent
51706203
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
38 additions
and
20 deletions
+38
-20
core.hpp
modules/core/include/opencv2/core.hpp
+0
-0
base.hpp
modules/core/include/opencv2/core/base.hpp
+1
-0
operations.hpp
modules/core/include/opencv2/core/operations.hpp
+0
-0
persistence.hpp
modules/core/include/opencv2/core/persistence.hpp
+0
-0
private.hpp
modules/core/include/opencv2/core/private.hpp
+4
-0
types_c.h
modules/core/include/opencv2/core/types_c.h
+0
-4
algorithm.cpp
modules/core/src/algorithm.cpp
+1
-1
persistence.cpp
modules/core/src/persistence.cpp
+22
-9
test_precomp.hpp
modules/core/test/test_precomp.hpp
+2
-0
planardetect.cpp
modules/legacy/src/planardetect.cpp
+6
-6
CMakeLists.txt
modules/python/CMakeLists.txt
+2
-0
No files found.
modules/core/include/opencv2/core.hpp
View file @
7193a73c
This diff is collapsed.
Click to expand it.
modules/core/include/opencv2/core/base.hpp
View file @
7193a73c
...
...
@@ -449,6 +449,7 @@ class CV_EXPORTS Range;
class
CV_EXPORTS
TermCriteria
;
class
CV_EXPORTS
KeyPoint
;
class
CV_EXPORTS
DMatch
;
class
CV_EXPORTS
RNG
;
class
CV_EXPORTS
Mat
;
class
CV_EXPORTS
MatExpr
;
...
...
modules/core/include/opencv2/core/operations.hpp
View file @
7193a73c
This diff is collapsed.
Click to expand it.
modules/core/include/opencv2/core/persistence.hpp
0 → 100644
View file @
7193a73c
This diff is collapsed.
Click to expand it.
modules/core/include/opencv2/core/private.hpp
View file @
7193a73c
...
...
@@ -188,6 +188,10 @@ static inline cv::Size cvGetMatSize( const CvMat* mat )
return
cv
::
Size
(
mat
->
cols
,
mat
->
rows
);
}
namespace
cv
{
CV_EXPORTS
void
scalarToRawData
(
const
cv
::
Scalar
&
s
,
void
*
buf
,
int
type
,
int
unroll_to
=
0
);
}
/****************************************************************************************\
...
...
modules/core/include/opencv2/core/types_c.h
View file @
7193a73c
...
...
@@ -1461,15 +1461,11 @@ CvSeqWriter;
int delta_index;
/* = seq->first->start_index */
\
schar* prev_elem;
/* pointer to previous element */
#ifdef __cplusplus
typedef
cv
::
FileNodeIterator
::
SeqReader
CvSeqReader
;
#else
typedef
struct
CvSeqReader
{
CV_SEQ_READER_FIELDS
()
}
CvSeqReader
;
#endif
/****************************************************************************************/
/* Operations on sequences */
...
...
modules/core/src/algorithm.cpp
View file @
7193a73c
...
...
@@ -423,7 +423,7 @@ void AlgorithmInfo::write(const Algorithm* algo, FileStorage& fs) const
cv
::
write
(
fs
,
pname
,
algo
->
get
<
std
::
vector
<
Mat
>
>
(
pname
));
else
if
(
p
.
type
==
Param
::
ALGORITHM
)
{
WriteStructContext
ws
(
fs
,
pname
,
CV_NODE_MAP
);
internal
::
WriteStructContext
ws
(
fs
,
pname
,
CV_NODE_MAP
);
Ptr
<
Algorithm
>
nestedAlgo
=
algo
->
get
<
Algorithm
>
(
pname
);
nestedAlgo
->
write
(
fs
);
}
...
...
modules/core/src/persistence.cpp
View file @
7193a73c
...
...
@@ -5317,7 +5317,7 @@ FileNodeIterator::FileNodeIterator(const CvFileStorage* _fs,
container
=
_node
;
if
(
!
(
_node
->
tag
&
FileNode
::
USER
)
&&
(
node_type
==
FileNode
::
SEQ
||
node_type
==
FileNode
::
MAP
)
)
{
cvStartReadSeq
(
_node
->
data
.
seq
,
&
reader
);
cvStartReadSeq
(
_node
->
data
.
seq
,
(
CvSeqReader
*
)
&
reader
);
remaining
=
FileNode
(
_fs
,
_node
).
size
();
}
else
...
...
@@ -5350,7 +5350,12 @@ FileNodeIterator& FileNodeIterator::operator ++()
if
(
remaining
>
0
)
{
if
(
reader
.
seq
)
CV_NEXT_SEQ_ELEM
(
reader
.
seq
->
elem_size
,
reader
);
{
if
(
((
reader
).
ptr
+=
(((
CvSeq
*
)
reader
.
seq
)
->
elem_size
))
>=
(
reader
).
block_max
)
{
cvChangeSeqBlock
(
(
CvSeqReader
*
)
&
(
reader
),
1
);
}
}
remaining
--
;
}
return
*
this
;
...
...
@@ -5368,7 +5373,12 @@ FileNodeIterator& FileNodeIterator::operator --()
if
(
remaining
<
FileNode
(
fs
,
container
).
size
()
)
{
if
(
reader
.
seq
)
CV_PREV_SEQ_ELEM
(
reader
.
seq
->
elem_size
,
reader
);
{
if
(
((
reader
).
ptr
-=
(((
CvSeq
*
)
reader
.
seq
)
->
elem_size
))
<
(
reader
).
block_min
)
{
cvChangeSeqBlock
(
(
CvSeqReader
*
)
&
(
reader
),
-
1
);
}
}
remaining
++
;
}
return
*
this
;
...
...
@@ -5394,7 +5404,7 @@ FileNodeIterator& FileNodeIterator::operator += (int ofs)
}
remaining
-=
ofs
;
if
(
reader
.
seq
)
cvSetSeqReaderPos
(
&
reader
,
ofs
,
1
);
cvSetSeqReaderPos
(
(
CvSeqReader
*
)
&
reader
,
ofs
,
1
);
return
*
this
;
}
...
...
@@ -5415,7 +5425,7 @@ FileNodeIterator& FileNodeIterator::readRaw( const String& fmt, uchar* vec, size
if
(
reader
.
seq
)
{
cvReadRawDataSlice
(
fs
,
&
reader
,
(
int
)
count
,
vec
,
fmt
.
c_str
()
);
cvReadRawDataSlice
(
fs
,
(
CvSeqReader
*
)
&
reader
,
(
int
)
count
,
vec
,
fmt
.
c_str
()
);
remaining
-=
count
*
cn
;
}
else
...
...
@@ -5475,14 +5485,17 @@ void write( FileStorage& fs, const String& name, const SparseMat& value )
}
WriteStructContext
::
WriteStructContext
(
FileStorage
&
_fs
,
const
String
&
name
,
int
flags
,
const
String
&
typeName
)
:
fs
(
&
_fs
)
internal
::
WriteStructContext
::
WriteStructContext
(
FileStorage
&
_fs
,
const
String
&
name
,
int
flags
,
const
String
&
typeName
)
:
fs
(
&
_fs
)
{
cvStartWriteStruct
(
**
fs
,
!
name
.
empty
()
?
name
.
c_str
()
:
0
,
flags
,
!
typeName
.
empty
()
?
typeName
.
c_str
()
:
0
);
}
WriteStructContext
::~
WriteStructContext
()
{
cvEndWriteStruct
(
**
fs
);
}
internal
::
WriteStructContext
::~
WriteStructContext
()
{
cvEndWriteStruct
(
**
fs
);
}
void
read
(
const
FileNode
&
node
,
Mat
&
mat
,
const
Mat
&
default_mat
)
...
...
@@ -5524,7 +5537,7 @@ void read( const FileNode& node, SparseMat& mat, const SparseMat& default_mat )
void
write
(
FileStorage
&
fs
,
const
String
&
objname
,
const
std
::
vector
<
KeyPoint
>&
keypoints
)
{
WriteStructContext
ws
(
fs
,
objname
,
CV_NODE_SEQ
+
CV_NODE_FLOW
);
internal
::
WriteStructContext
ws
(
fs
,
objname
,
CV_NODE_SEQ
+
CV_NODE_FLOW
);
int
i
,
npoints
=
(
int
)
keypoints
.
size
();
for
(
i
=
0
;
i
<
npoints
;
i
++
)
...
...
modules/core/test/test_precomp.hpp
View file @
7193a73c
...
...
@@ -13,4 +13,6 @@
#include "opencv2/ts.hpp"
#include "opencv2/core/core_c.h"
#include "opencv2/core/private.hpp"
#endif
modules/legacy/src/planardetect.cpp
View file @
7193a73c
...
...
@@ -619,7 +619,7 @@ void LDetector::read(const FileNode& objnode)
void
LDetector
::
write
(
FileStorage
&
fs
,
const
String
&
name
)
const
{
WriteStructContext
ws
(
fs
,
name
,
CV_NODE_MAP
);
internal
::
WriteStructContext
ws
(
fs
,
name
,
CV_NODE_MAP
);
fs
<<
"radius"
<<
radius
<<
"threshold"
<<
threshold
...
...
@@ -709,7 +709,7 @@ FernClassifier::FernClassifier(const std::vector<std::vector<Point2f> >& points,
void
FernClassifier
::
write
(
FileStorage
&
fs
,
const
String
&
objname
)
const
{
WriteStructContext
ws
(
fs
,
objname
,
CV_NODE_MAP
);
internal
::
WriteStructContext
ws
(
fs
,
objname
,
CV_NODE_MAP
);
cv
::
write
(
fs
,
"nstructs"
,
nstructs
);
cv
::
write
(
fs
,
"struct-size"
,
structSize
);
...
...
@@ -718,7 +718,7 @@ void FernClassifier::write(FileStorage& fs, const String& objname) const
cv
::
write
(
fs
,
"compression-method"
,
compressionMethod
);
cv
::
write
(
fs
,
"patch-size"
,
patchSize
.
width
);
{
WriteStructContext
wsf
(
fs
,
"features"
,
CV_NODE_SEQ
+
CV_NODE_FLOW
);
internal
::
WriteStructContext
wsf
(
fs
,
"features"
,
CV_NODE_SEQ
+
CV_NODE_FLOW
);
int
i
,
nfeatures
=
(
int
)
features
.
size
();
for
(
i
=
0
;
i
<
nfeatures
;
i
++
)
{
...
...
@@ -727,7 +727,7 @@ void FernClassifier::write(FileStorage& fs, const String& objname) const
}
}
{
WriteStructContext
wsp
(
fs
,
"posteriors"
,
CV_NODE_SEQ
+
CV_NODE_FLOW
);
internal
::
WriteStructContext
wsp
(
fs
,
"posteriors"
,
CV_NODE_SEQ
+
CV_NODE_FLOW
);
cv
::
write
(
fs
,
posteriors
);
}
}
...
...
@@ -1478,10 +1478,10 @@ void PlanarObjectDetector::read(const FileNode& node)
void
PlanarObjectDetector
::
write
(
FileStorage
&
fs
,
const
String
&
objname
)
const
{
WriteStructContext
ws
(
fs
,
objname
,
CV_NODE_MAP
);
internal
::
WriteStructContext
ws
(
fs
,
objname
,
CV_NODE_MAP
);
{
WriteStructContext
wsroi
(
fs
,
"model-roi"
,
CV_NODE_SEQ
+
CV_NODE_FLOW
);
internal
::
WriteStructContext
wsroi
(
fs
,
"model-roi"
,
CV_NODE_SEQ
+
CV_NODE_FLOW
);
cv
::
write
(
fs
,
modelROI
.
x
);
cv
::
write
(
fs
,
modelROI
.
y
);
cv
::
write
(
fs
,
modelROI
.
width
);
...
...
modules/python/CMakeLists.txt
View file @
7193a73c
...
...
@@ -24,7 +24,9 @@ ocv_module_include_directories(
set
(
opencv_hdrs
"
${
OPENCV_MODULE_opencv_core_LOCATION
}
/include/opencv2/core.hpp"
"
${
OPENCV_MODULE_opencv_core_LOCATION
}
/include/opencv2/core/base.hpp"
"
${
OPENCV_MODULE_opencv_core_LOCATION
}
/include/opencv2/core/types.hpp"
"
${
OPENCV_MODULE_opencv_core_LOCATION
}
/include/opencv2/core/persistence.hpp"
"
${
OPENCV_MODULE_opencv_core_LOCATION
}
/include/opencv2/core/utility.hpp"
"
${
OPENCV_MODULE_opencv_flann_LOCATION
}
/include/opencv2/flann/miniflann.hpp"
"
${
OPENCV_MODULE_opencv_imgproc_LOCATION
}
/include/opencv2/imgproc.hpp"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment