Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
67ac182f
Commit
67ac182f
authored
Sep 03, 2012
by
Davis King
Browse files
Added serialization support to the full_object_detection.
parent
62239be0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
0 deletions
+45
-0
dlib/image_processing/full_object_detection.h
dlib/image_processing/full_object_detection.h
+26
-0
dlib/image_processing/full_object_detection_abstract.h
dlib/image_processing/full_object_detection_abstract.h
+19
-0
No files found.
dlib/image_processing/full_object_detection.h
View file @
67ac182f
...
...
@@ -6,6 +6,7 @@
#include "../geometry.h"
#include "full_object_detection_abstract.h"
#include <vector>
#include "../serialize.h"
namespace
dlib
{
...
...
@@ -49,6 +50,31 @@ namespace dlib
return
parts
[
idx
];
}
friend
void
serialize
(
const
full_object_detection
&
item
,
std
::
ostream
&
out
)
{
int
version
=
1
;
serialize
(
version
,
out
);
serialize
(
item
.
rect
,
out
);
serialize
(
item
.
parts
,
out
);
}
friend
void
deserialize
(
full_object_detection
&
item
,
std
::
istream
&
in
)
{
int
version
=
0
;
deserialize
(
version
,
in
);
if
(
version
!=
1
)
throw
serialization_error
(
"Unexpected version encountered while deserializing dlib::full_object_detection."
);
deserialize
(
item
.
rect
,
in
);
deserialize
(
item
.
parts
,
in
);
}
private:
rectangle
rect
;
std
::
vector
<
point
>
parts
;
...
...
dlib/image_processing/full_object_detection_abstract.h
View file @
67ac182f
...
...
@@ -5,6 +5,7 @@
#include <vector>
#include "../geometry.h"
#include "../serialize.h"
namespace
dlib
{
...
...
@@ -84,6 +85,24 @@ namespace dlib
!*/
};
// ----------------------------------------------------------------------------------------
void
serialize
(
const
full_object_detection
&
item
,
std
::
ostream
&
out
);
/*!
provides serialization support
!*/
void
deserialize
(
full_object_detection
&
item
,
std
::
istream
&
in
);
/*!
provides deserialization support
!*/
// ----------------------------------------------------------------------------------------
bool
all_parts_in_rect
(
...
...
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