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
1bf42982
Commit
1bf42982
authored
Sep 25, 2013
by
Juan Manuel Perez
Committed by
Vadim Pisarevsky
Sep 30, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Macro removal
parent
aa73dafb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
emdL1.cpp
modules/shape/src/emdL1.cpp
+9
-9
emdL1_def.hpp
modules/shape/src/emdL1_def.hpp
+0
-1
No files found.
modules/shape/src/emdL1.cpp
View file @
1bf42982
...
...
@@ -51,7 +51,7 @@
#include "precomp.hpp"
#include "emdL1_def.hpp"
#include <limits>
/****************************************************************************************\
* EMDL1 Class *
...
...
@@ -286,7 +286,7 @@ bool EmdL1::greedySolution2()
for
(
r
=
0
;
r
<
binsDim1
;
r
++
)
{
dFlow
=
D
[
r
][
c
];
bUpward
=
(
r
<
binsDim1
-
1
)
&&
(
std
::
abs
(
dFlow
+
d2s
[
c
+
1
])
>
std
::
abs
(
dFlow
+
d1s
[
r
+
1
]));
// Move upward or right
bUpward
=
(
r
<
binsDim1
-
1
)
&&
(
fabs
(
dFlow
+
d2s
[
c
+
1
])
>
f
abs
(
dFlow
+
d1s
[
r
+
1
]));
// Move upward or right
// modify basic variables, record BV and related values
if
(
bUpward
)
...
...
@@ -308,7 +308,7 @@ bool EmdL1::greedySolution2()
d2s
[
c
+
1
]
+=
dFlow
;
// auxilary matrix maintanence
}
pBV
->
pParent
->
pChild
=
pBV
;
pBV
->
flow
=
std
::
abs
(
dFlow
);
pBV
->
flow
=
f
abs
(
dFlow
);
pBV
->
iDir
=
dFlow
>
0
;
// 1:outward, 0:inward
}
...
...
@@ -320,7 +320,7 @@ bool EmdL1::greedySolution2()
pBV
=
&
(
m_EdgesUp
[
r
][
c
]);
D
[
r
+
1
][
c
]
+=
dFlow
;
// auxilary matrix maintanence
pBV
->
pParent
->
pChild
=
pBV
;
pBV
->
flow
=
std
::
abs
(
dFlow
);
pBV
->
flow
=
f
abs
(
dFlow
);
pBV
->
iDir
=
dFlow
>
0
;
// 1:outward, 0:inward
}
return
true
;
...
...
@@ -393,9 +393,9 @@ bool EmdL1::greedySolution3()
//- determine which direction to move, either right or upward
dFlow
=
D
[
i1
][
i2
][
i3
];
f1
=
(
i1
<
(
binsDim1
-
1
))
?
std
::
abs
(
dFlow
+
d1s
[
i1
+
1
])
:
VHIGH
;
f2
=
(
i2
<
(
binsDim2
-
1
))
?
std
::
abs
(
dFlow
+
d2s
[
i2
+
1
])
:
VHIGH
;
f3
=
(
i3
<
(
binsDim3
-
1
))
?
std
::
abs
(
dFlow
+
d3s
[
i3
+
1
])
:
VHIGH
;
f1
=
(
i1
<
(
binsDim1
-
1
))
?
fabs
(
dFlow
+
d1s
[
i1
+
1
])
:
std
::
numeric_limits
<
float
>::
max
()
;
f2
=
(
i2
<
(
binsDim2
-
1
))
?
fabs
(
dFlow
+
d2s
[
i2
+
1
])
:
std
::
numeric_limits
<
float
>::
max
()
;
f3
=
(
i3
<
(
binsDim3
-
1
))
?
fabs
(
dFlow
+
d3s
[
i3
+
1
])
:
std
::
numeric_limits
<
float
>::
max
()
;
if
(
f1
<
f2
&&
f1
<
f3
)
{
...
...
@@ -422,7 +422,7 @@ bool EmdL1::greedySolution3()
d3s
[
i3
+
1
]
+=
dFlow
;
}
pBV
->
flow
=
std
::
abs
(
dFlow
);
pBV
->
flow
=
f
abs
(
dFlow
);
pBV
->
iDir
=
dFlow
>
0
;
// 1:outward, 0:inward
pBV
->
pParent
->
pChild
=
pBV
;
}
...
...
@@ -679,7 +679,7 @@ void EmdL1::findNewSolution()
void
EmdL1
::
findLoopFromEnterBV
()
{
// Initialize Leaving-BV edge
float
minFlow
=
VHIGH
;
float
minFlow
=
std
::
numeric_limits
<
float
>::
max
()
;
cvPEmdEdge
pE
=
NULL
;
int
iLFlag
=
0
;
// 0: in the FROM list, 1: in the TO list
...
...
modules/shape/src/emdL1_def.hpp
View file @
1bf42982
...
...
@@ -44,7 +44,6 @@
#include <math.h>
#include <vector>
#define VHIGH 1e10;
/****************************************************************************************\
* For EMDL1 Framework *
\****************************************************************************************/
...
...
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