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
306248e4
Commit
306248e4
authored
Apr 16, 2012
by
Alexey Spizhevoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support of Clp for Windows
parent
601d2843
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
25 deletions
+41
-25
CMakeLists.txt
CMakeLists.txt
+21
-11
global_motion.cpp
modules/videostab/src/global_motion.cpp
+1
-1
motion_stabilizing.cpp
modules/videostab/src/motion_stabilizing.cpp
+19
-13
No files found.
CMakeLists.txt
View file @
306248e4
...
...
@@ -124,7 +124,7 @@ OCV_OPTION(WITH_V4L "Include Video 4 Linux support" ON
OCV_OPTION
(
WITH_VIDEOINPUT
"Build HighGUI with DirectShow support"
ON IF WIN32
)
OCV_OPTION
(
WITH_XIMEA
"Include XIMEA cameras support"
OFF IF WIN32
)
OCV_OPTION
(
WITH_XINE
"Include Xine support (GPL)"
OFF
IF
(
UNIX AND NOT APPLE AND NOT ANDROID AND NOT IOS
)
)
OCV_OPTION
(
WITH_CLP
"Include Clp support (EPL)"
OFF
IF
(
UNIX AND
NOT ANDROID AND NOT IOS
)
)
OCV_OPTION
(
WITH_CLP
"Include Clp support (EPL)"
OFF
IF
(
NOT ANDROID AND NOT IOS
)
)
# OpenCV build components
# ===================================================
...
...
@@ -572,26 +572,36 @@ endif()
set
(
HAVE_CLP FALSE
)
if
(
WITH_CLP
)
PKG_CHECK_MODULES
(
CLP clp
)
if
(
CLP_FOUND
)
set
(
HAVE_CLP TRUE
)
if
(
NOT
${
CLP_INCLUDE_DIRS
}
STREQUAL
""
)
ocv_include_directories
(
${
CLP_INCLUDE_DIRS
}
)
if
(
UNIX
)
PKG_CHECK_MODULES
(
CLP clp
)
if
(
CLP_FOUND
)
set
(
HAVE_CLP TRUE
)
if
(
NOT
${
CLP_INCLUDE_DIRS
}
STREQUAL
""
)
ocv_include_directories
(
${
CLP_INCLUDE_DIRS
}
)
endif
()
link_directories
(
${
CLP_LIBRARY_DIRS
}
)
set
(
OPENCV_LINKER_LIBS
${
OPENCV_LINKER_LIBS
}
${
CLP_LIBRARIES
}
)
endif
()
link_directories
(
${
CLP_LIBRARY_DIRS
}
)
set
(
OPENCV_LINKER_LIBS
${
OPENCV_LINKER_LIBS
}
${
CLP_LIBRARIES
}
)
else
(
)
endif
(
)
if
(
NOT CLP_FOUND
)
find_path
(
CLP_INCLUDE_PATH
"coin"
PATHS
"/usr/local/include"
"/usr/include"
"/opt/include"
DOC
"The path to Clp headers"
)
if
(
CLP_INCLUDE_PATH
)
ocv_include_directories
(
${
CLP_INCLUDE_PATH
}
)
ocv_include_directories
(
${
CLP_INCLUDE_PATH
}
"
${
CLP_INCLUDE_PATH
}
/coin"
)
set
(
CLP_LIBRARY_DIR
"
${
CLP_INCLUDE_PATH
}
/../lib"
CACHE PATH
"Full path of Clp library directory"
)
link_directories
(
${
CLP_LIBRARY_DIR
}
)
set
(
OPENCV_LINKER_LIBS
${
OPENCV_LINKER_LIBS
}
Clp CoinUtils bz2 z lapack blas m
)
if
(
UNIX
)
set
(
OPENCV_LINKER_LIBS
${
OPENCV_LINKER_LIBS
}
Clp CoinUtils bz2 z lapack blas m
)
else
()
set
(
OPENCV_LINKER_LIBS
${
OPENCV_LINKER_LIBS
}
libClp libCoinUtils
)
endif
()
set
(
HAVE_CLP TRUE
)
endif
()
endif
()
endif
()
################## Extra HighGUI libs on Windows ###################
...
...
modules/videostab/src/global_motion.cpp
View file @
306248e4
...
...
@@ -447,7 +447,7 @@ Mat PyrLkRobustMotionEstimator::estimate(const Mat &frame0, const Mat &frame1, b
ninliers
=
0
;
rmse
=
0
;
Point2
d
p0
,
p1
;
Point2
f
p0
,
p1
;
float
x
,
y
,
z
;
for
(
size_t
i
=
0
;
i
<
pointsGood_
.
size
();
++
i
)
...
...
modules/videostab/src/motion_stabilizing.cpp
View file @
306248e4
...
...
@@ -46,13 +46,21 @@
#include "opencv2/videostab/ring_buffer.hpp"
#ifdef HAVE_CLP
#include "coin/ClpSimplex.hpp"
#include "coin/ClpPresolve.hpp"
#include "coin/ClpPrimalColumnSteepest.hpp"
#include "coin/ClpDualRowSteepest.hpp"
#include "ClpSimplex.hpp"
#include "ClpPresolve.hpp"
#include "ClpPrimalColumnSteepest.hpp"
#include "ClpDualRowSteepest.hpp"
#define INF 1e10
#endif
#define INF 1e10
// Clp replaces min and max with ?: globally, we can't use std::min and std::max in case
// when HAVE_CLP is true, otherwise we create the defines by ourselves
#ifndef min
#define min(a,b) std::min(a,b)
#endif
#ifndef max
#define max(a,b) std::max(a,b)
#endif
using
namespace
std
;
...
...
@@ -62,8 +70,7 @@ namespace videostab
{
void
MotionStabilizationPipeline
::
stabilize
(
int
size
,
const
vector
<
Mat
>
&
motions
,
pair
<
int
,
int
>
range
,
Mat
*
stabilizationMotions
)
int
size
,
const
vector
<
Mat
>
&
motions
,
pair
<
int
,
int
>
range
,
Mat
*
stabilizationMotions
)
{
vector
<
Mat
>
updatedMotions
(
motions
.
size
());
for
(
size_t
i
=
0
;
i
<
motions
.
size
();
++
i
)
...
...
@@ -118,8 +125,8 @@ Mat GaussianMotionFilter::stabilize(int idx, const vector<Mat> &motions, pair<in
const
Mat
&
cur
=
at
(
idx
,
motions
);
Mat
res
=
Mat
::
zeros
(
cur
.
size
(),
cur
.
type
());
float
sum
=
0.
f
;
int
iMin
=
std
::
max
(
idx
-
radius_
,
range
.
first
);
int
iMax
=
std
::
min
(
idx
+
radius_
,
range
.
second
);
int
iMin
=
max
(
idx
-
radius_
,
range
.
first
);
int
iMax
=
min
(
idx
+
radius_
,
range
.
second
);
for
(
int
i
=
iMin
;
i
<=
iMax
;
++
i
)
{
res
+=
weight_
[
radius_
+
i
-
idx
]
*
getMotion
(
idx
,
i
,
motions
);
...
...
@@ -266,7 +273,7 @@ LpMotionStabilizer::LpMotionStabilizer(MotionModel model)
{
setMotionModel
(
model
);
setFrameSize
(
Size
(
0
,
0
));
setTrimRatio
(
0.1
);
setTrimRatio
(
0.1
f
);
setWeight1
(
1
);
setWeight2
(
10
);
setWeight3
(
100
);
...
...
@@ -284,8 +291,7 @@ void LpMotionStabilizer::stabilize(int, const vector<Mat>&, pair<int,int>, Mat*)
#else
void
LpMotionStabilizer
::
stabilize
(
int
size
,
const
vector
<
Mat
>
&
motions
,
pair
<
int
,
int
>
range
,
Mat
*
stabilizationMotions
)
int
size
,
const
vector
<
Mat
>
&
motions
,
pair
<
int
,
int
>
range
,
Mat
*
stabilizationMotions
)
{
CV_Assert
(
model_
==
MM_LINEAR_SIMILARITY
);
...
...
@@ -662,7 +668,7 @@ void LpMotionStabilizer::stabilize(
CoinPackedMatrix
A
(
true
,
&
rows_
[
0
],
&
cols_
[
0
],
&
elems_
[
0
],
elems_
.
size
());
A
.
setDimensions
(
nrows
,
ncols
);
ClpSimplex
model
;
ClpSimplex
model
(
false
)
;
model
.
loadProblem
(
A
,
&
collb_
[
0
],
&
colub_
[
0
],
&
obj_
[
0
],
&
rowlb_
[
0
],
&
rowub_
[
0
]);
ClpDualRowSteepest
dualSteep
(
1
);
...
...
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