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
c9e07bbc
Commit
c9e07bbc
authored
Jan 22, 2015
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
exclude compactPoints and calcWobbleSuppressionMaps from compilation
if they are not needed
parent
6ebc9547
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
57 deletions
+51
-57
global_motion.cpp
modules/videostab/src/global_motion.cpp
+23
-26
wobble_suppression.cpp
modules/videostab/src/wobble_suppression.cpp
+28
-31
No files found.
modules/videostab/src/global_motion.cpp
View file @
c9e07bbc
...
...
@@ -49,34 +49,31 @@
#include "opencv2/core/private.cuda.hpp"
#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
namespace
cv
{
namespace
cuda
{
static
void
compactPoints
(
GpuMat
&
,
GpuMat
&
,
const
GpuMat
&
)
{
throw_no_cuda
();
}
}}
#else
namespace
cv
{
namespace
cuda
{
namespace
device
{
namespace
globmotion
{
int
compactPoints
(
int
N
,
float
*
points0
,
float
*
points1
,
const
uchar
*
mask
);
}}}}
namespace
cv
{
namespace
cuda
{
static
void
compactPoints
(
GpuMat
&
points0
,
GpuMat
&
points1
,
const
GpuMat
&
mask
)
{
CV_Assert
(
points0
.
rows
==
1
&&
points1
.
rows
==
1
&&
mask
.
rows
==
1
);
CV_Assert
(
points0
.
type
()
==
CV_32FC2
&&
points1
.
type
()
==
CV_32FC2
&&
mask
.
type
()
==
CV_8U
);
CV_Assert
(
points0
.
cols
==
mask
.
cols
&&
points1
.
cols
==
mask
.
cols
);
#if defined(HAVE_OPENCV_CUDAIMGPROC) && defined(HAVE_OPENCV_CUDAOPTFLOW)
#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
namespace
cv
{
namespace
cuda
{
static
void
compactPoints
(
GpuMat
&
,
GpuMat
&
,
const
GpuMat
&
)
{
throw_no_cuda
();
}
}}
#else
namespace
cv
{
namespace
cuda
{
namespace
device
{
namespace
globmotion
{
int
compactPoints
(
int
N
,
float
*
points0
,
float
*
points1
,
const
uchar
*
mask
);
}}}}
namespace
cv
{
namespace
cuda
{
static
void
compactPoints
(
GpuMat
&
points0
,
GpuMat
&
points1
,
const
GpuMat
&
mask
)
{
CV_Assert
(
points0
.
rows
==
1
&&
points1
.
rows
==
1
&&
mask
.
rows
==
1
);
CV_Assert
(
points0
.
type
()
==
CV_32FC2
&&
points1
.
type
()
==
CV_32FC2
&&
mask
.
type
()
==
CV_8U
);
CV_Assert
(
points0
.
cols
==
mask
.
cols
&&
points1
.
cols
==
mask
.
cols
);
int
npoints
=
points0
.
cols
;
int
remaining
=
cv
::
cuda
::
device
::
globmotion
::
compactPoints
(
npoints
,
(
float
*
)
points0
.
data
,
(
float
*
)
points1
.
data
,
mask
.
data
);
points0
=
points0
.
colRange
(
0
,
remaining
);
points1
=
points1
.
colRange
(
0
,
remaining
);
}
}}
int
npoints
=
points0
.
cols
;
int
remaining
=
cv
::
cuda
::
device
::
globmotion
::
compactPoints
(
npoints
,
(
float
*
)
points0
.
data
,
(
float
*
)
points1
.
data
,
mask
.
data
);
points0
=
points0
.
colRange
(
0
,
remaining
);
points1
=
points1
.
colRange
(
0
,
remaining
);
}
}}
#endif
#endif
namespace
cv
...
...
modules/videostab/src/wobble_suppression.cpp
View file @
c9e07bbc
...
...
@@ -50,37 +50,34 @@
# include "opencv2/cudawarping.hpp"
#endif
#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
namespace
cv
{
namespace
cuda
{
static
void
calcWobbleSuppressionMaps
(
int
,
int
,
int
,
Size
,
const
Mat
&
,
const
Mat
&
,
GpuMat
&
,
GpuMat
&
)
{
throw_no_cuda
();
}
}}
#else
namespace
cv
{
namespace
cuda
{
namespace
device
{
namespace
globmotion
{
void
calcWobbleSuppressionMaps
(
int
left
,
int
idx
,
int
right
,
int
width
,
int
height
,
const
float
*
ml
,
const
float
*
mr
,
PtrStepSzf
mapx
,
PtrStepSzf
mapy
);
}}}}
namespace
cv
{
namespace
cuda
{
static
void
calcWobbleSuppressionMaps
(
int
left
,
int
idx
,
int
right
,
Size
size
,
const
Mat
&
ml
,
const
Mat
&
mr
,
GpuMat
&
mapx
,
GpuMat
&
mapy
)
{
CV_Assert
(
ml
.
size
()
==
Size
(
3
,
3
)
&&
ml
.
type
()
==
CV_32F
&&
ml
.
isContinuous
());
CV_Assert
(
mr
.
size
()
==
Size
(
3
,
3
)
&&
mr
.
type
()
==
CV_32F
&&
mr
.
isContinuous
());
mapx
.
create
(
size
,
CV_32F
);
mapy
.
create
(
size
,
CV_32F
);
cv
::
cuda
::
device
::
globmotion
::
calcWobbleSuppressionMaps
(
left
,
idx
,
right
,
size
.
width
,
size
.
height
,
ml
.
ptr
<
float
>
(),
mr
.
ptr
<
float
>
(),
mapx
,
mapy
);
}
}}
#if defined(HAVE_OPENCV_CUDAWARPING)
#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
namespace
cv
{
namespace
cuda
{
static
void
calcWobbleSuppressionMaps
(
int
,
int
,
int
,
Size
,
const
Mat
&
,
const
Mat
&
,
GpuMat
&
,
GpuMat
&
)
{
throw_no_cuda
();
}
}}
#else
namespace
cv
{
namespace
cuda
{
namespace
device
{
namespace
globmotion
{
void
calcWobbleSuppressionMaps
(
int
left
,
int
idx
,
int
right
,
int
width
,
int
height
,
const
float
*
ml
,
const
float
*
mr
,
PtrStepSzf
mapx
,
PtrStepSzf
mapy
);
}}}}
namespace
cv
{
namespace
cuda
{
static
void
calcWobbleSuppressionMaps
(
int
left
,
int
idx
,
int
right
,
Size
size
,
const
Mat
&
ml
,
const
Mat
&
mr
,
GpuMat
&
mapx
,
GpuMat
&
mapy
)
{
CV_Assert
(
ml
.
size
()
==
Size
(
3
,
3
)
&&
ml
.
type
()
==
CV_32F
&&
ml
.
isContinuous
());
CV_Assert
(
mr
.
size
()
==
Size
(
3
,
3
)
&&
mr
.
type
()
==
CV_32F
&&
mr
.
isContinuous
());
mapx
.
create
(
size
,
CV_32F
);
mapy
.
create
(
size
,
CV_32F
);
cv
::
cuda
::
device
::
globmotion
::
calcWobbleSuppressionMaps
(
left
,
idx
,
right
,
size
.
width
,
size
.
height
,
ml
.
ptr
<
float
>
(),
mr
.
ptr
<
float
>
(),
mapx
,
mapy
);
}
}}
#endif
#endif
namespace
cv
...
...
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