Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
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_contrib
Commits
96a7fdf3
Commit
96a7fdf3
authored
Sep 06, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
face: fix I/O for 'splitr' structure on 32-bit platforms
parent
386f52c7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
4 deletions
+15
-4
face_alignmentimpl.hpp
modules/face/src/face_alignmentimpl.hpp
+1
-1
getlandmarks.cpp
modules/face/src/getlandmarks.cpp
+6
-1
trainFacemark.cpp
modules/face/src/trainFacemark.cpp
+8
-2
No files found.
modules/face/src/face_alignmentimpl.hpp
View file @
96a7fdf3
...
...
@@ -103,7 +103,7 @@ protected:
// This function randomly generates test splits to get the best split.
splitr
getTestSplits
(
std
::
vector
<
Point2f
>
pixel_coordinates
,
int
seed
);
// This function writes a split node to the XML file storing the trained model
void
writeSplit
(
std
::
ofstream
&
os
,
const
splitr
split
);
void
writeSplit
(
std
::
ofstream
&
os
,
const
splitr
&
split
);
// This function writes a leaf node to the binary file storing the trained model
void
writeLeaf
(
std
::
ofstream
&
os
,
const
std
::
vector
<
Point2f
>
&
leaf
);
// This function writes a tree to the binary file containing the model
...
...
modules/face/src/getlandmarks.cpp
View file @
96a7fdf3
...
...
@@ -26,7 +26,12 @@ bool FacemarkKazemiImpl :: findNearestLandmarks( vector< vector<int> >& nearest)
}
void
FacemarkKazemiImpl
::
readSplit
(
ifstream
&
is
,
splitr
&
vec
)
{
is
.
read
((
char
*
)
&
vec
,
sizeof
(
splitr
));
is
.
read
((
char
*
)
&
vec
.
index1
,
sizeof
(
vec
.
index1
));
is
.
read
((
char
*
)
&
vec
.
index2
,
sizeof
(
vec
.
index2
));
is
.
read
((
char
*
)
&
vec
.
thresh
,
sizeof
(
vec
.
thresh
));
uint32_t
dummy_
=
0
;
is
.
read
((
char
*
)
&
dummy_
,
sizeof
(
dummy_
));
// buggy writer structure alignment
CV_CheckEQ
((
int
)(
sizeof
(
vec
.
index1
)
+
sizeof
(
vec
.
index2
)
+
sizeof
(
vec
.
thresh
)
+
sizeof
(
dummy_
)),
24
,
"Invalid build configuration"
);
}
void
FacemarkKazemiImpl
::
readLeaf
(
ifstream
&
is
,
vector
<
Point2f
>
&
leaf
)
{
...
...
modules/face/src/trainFacemark.cpp
View file @
96a7fdf3
...
...
@@ -219,9 +219,15 @@ void FacemarkKazemiImpl :: writeLeaf(ofstream& os, const vector<Point2f> &leaf)
os
.
write
((
char
*
)
&
size
,
sizeof
(
size
));
os
.
write
((
char
*
)
&
leaf
[
0
],
leaf
.
size
()
*
sizeof
(
Point2f
));
}
void
FacemarkKazemiImpl
::
writeSplit
(
ofstream
&
os
,
splitr
split
)
void
FacemarkKazemiImpl
::
writeSplit
(
ofstream
&
os
,
const
splitr
&
vec
)
{
os
.
write
((
char
*
)
&
split
,
sizeof
(
split
));
os
.
write
((
char
*
)
&
vec
.
index1
,
sizeof
(
vec
.
index1
));
os
.
write
((
char
*
)
&
vec
.
index2
,
sizeof
(
vec
.
index2
));
os
.
write
((
char
*
)
&
vec
.
thresh
,
sizeof
(
vec
.
thresh
));
uint32_t
dummy_
=
0
;
os
.
write
((
char
*
)
&
dummy_
,
sizeof
(
dummy_
));
// buggy original writer structure alignment
CV_CheckEQ
((
int
)(
sizeof
(
vec
.
index1
)
+
sizeof
(
vec
.
index2
)
+
sizeof
(
vec
.
thresh
)
+
sizeof
(
dummy_
)),
24
,
"Invalid build configuration"
);
}
void
FacemarkKazemiImpl
::
writeTree
(
ofstream
&
f
,
regtree
tree
)
{
...
...
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