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
Cresson Remi
LSGRM
Commits
dc93112c
Commit
dc93112c
authored
Feb 17, 2017
by
remi cresson
Browse files
FIX: Win32/64 bugfix provided by Raffaele Gaetano (CIRAD)
parent
84c4d6fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/lsgrmGraphOperations.txx
View file @
dc93112c
//#include "lsgrmGraphOperations.h"
#include <unistd.h>
//#include <unistd.h>
#include <cstdio>
namespace lsgrm
{
...
...
@@ -836,9 +837,9 @@ void ReadGraph(TSegmenter& segmenter,
const std::string& nodesPath,
const std::string& edgesPath)
{
FILE * nodeStream = fopen(nodesPath.c_str(), "r");
FILE * nodeStream = fopen(nodesPath.c_str(), "r
b
");
assert(nodeStream != NULL);
FILE * edgeStream = fopen(edgesPath.c_str(), "r");
FILE * edgeStream = fopen(edgesPath.c_str(), "r
b
");
assert(edgeStream != NULL);
segmenter.ReadGraph(nodeStream, edgeStream);
...
...
include/lsgrmSegmenter.h
View file @
dc93112c
...
...
@@ -87,12 +87,13 @@ public:
std
::
size_t
contourSize
=
node
->
m_Contour
.
size
();
fwrite
(
&
(
contourSize
),
sizeof
(
contourSize
),
1
,
nodeStream
);
short
moves
[
contourSize
];
std
::
vector
<
short
>
moves
;
moves
.
reserve
(
contourSize
);
for
(
unsigned
int
b
=
0
;
b
<
contourSize
;
b
++
)
{
moves
[
b
]
=
node
->
m_Contour
[
b
];
}
fwrite
(
moves
,
sizeof
(
short
),
contourSize
,
nodeStream
);
fwrite
(
&
moves
.
front
()
,
sizeof
(
short
),
contourSize
,
nodeStream
);
}
/*
...
...
@@ -135,8 +136,9 @@ public:
{
std
::
size_t
contourSize
;
fread
(
&
(
contourSize
),
sizeof
(
contourSize
),
1
,
nodeStream
);
short
moves
[
contourSize
];
fread
(
&
moves
,
sizeof
(
short
),
contourSize
,
nodeStream
);
std
::
vector
<
short
>
moves
;
moves
.
reserve
(
contourSize
);
fread
(
&
moves
.
front
(),
sizeof
(
short
),
contourSize
,
nodeStream
);
for
(
unsigned
int
b
=
0
;
b
<
contourSize
;
b
++
)
{
node
->
m_Contour
.
push_back
(
moves
[
b
]);
...
...
@@ -236,7 +238,3 @@ public:
}
// end of namespace lsgrm
#endif
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