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
5da72400
Commit
5da72400
authored
May 06, 2013
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
made dependecy from gpufilters optional
parent
f614e354
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
5 deletions
+45
-5
CMakeLists.txt
modules/gpuimgproc/CMakeLists.txt
+1
-1
canny.cpp
modules/gpuimgproc/src/canny.cpp
+8
-0
corners.cpp
modules/gpuimgproc/src/corners.cpp
+1
-1
corners.cu
modules/gpuimgproc/src/cuda/corners.cu
+7
-1
hough_circles.cu
modules/gpuimgproc/src/cuda/hough_circles.cu
+5
-0
generalized_hough.cpp
modules/gpuimgproc/src/generalized_hough.cpp
+18
-0
hough_circles.cpp
modules/gpuimgproc/src/hough_circles.cpp
+1
-1
precomp.hpp
modules/gpuimgproc/src/precomp.hpp
+4
-1
No files found.
modules/gpuimgproc/CMakeLists.txt
View file @
5da72400
...
...
@@ -6,4 +6,4 @@ set(the_description "GPU-accelerated Image Processing")
ocv_warnings_disable
(
CMAKE_CXX_FLAGS /wd4127 /wd4100 /wd4324 /wd4512 /wd4515 -Wundef -Wmissing-declarations -Wshadow -Wunused-parameter
)
ocv_define_module
(
gpuimgproc opencv_imgproc
opencv_gpufilters OPTIONAL opencv_gpuarithm
)
ocv_define_module
(
gpuimgproc opencv_imgproc
OPTIONAL opencv_gpuarithm opencv_gpufilters
)
modules/gpuimgproc/src/canny.cpp
View file @
5da72400
...
...
@@ -122,7 +122,9 @@ namespace
GpuMat
mag_
;
GpuMat
map_
;
GpuMat
st1_
,
st2_
;
#ifdef HAVE_OPENCV_GPUFILTERS
Ptr
<
Filter
>
filterDX_
,
filterDY_
;
#endif
int
old_apperture_size_
;
};
...
...
@@ -152,10 +154,14 @@ namespace
}
else
{
#ifndef HAVE_OPENCV_GPUFILTERS
throw_no_cuda
();
#else
filterDX_
->
apply
(
image
,
dx_
);
filterDY_
->
apply
(
image
,
dy_
);
canny
::
calcMagnitude
(
dx_
,
dy_
,
mag_
,
L2gradient_
);
#endif
}
CannyCaller
(
edges
);
...
...
@@ -191,12 +197,14 @@ namespace
ensureSizeIsEnough
(
image_size
,
CV_32SC1
,
dx_
);
ensureSizeIsEnough
(
image_size
,
CV_32SC1
,
dy_
);
#ifdef HAVE_OPENCV_GPUFILTERS
if
(
apperture_size_
!=
3
&&
apperture_size_
!=
old_apperture_size_
)
{
filterDX_
=
gpu
::
createDerivFilter
(
CV_8UC1
,
CV_32S
,
1
,
0
,
apperture_size_
,
false
,
1
,
BORDER_REPLICATE
);
filterDY_
=
gpu
::
createDerivFilter
(
CV_8UC1
,
CV_32S
,
0
,
1
,
apperture_size_
,
false
,
1
,
BORDER_REPLICATE
);
old_apperture_size_
=
apperture_size_
;
}
#endif
ensureSizeIsEnough
(
image_size
,
CV_32FC1
,
mag_
);
ensureSizeIsEnough
(
image_size
,
CV_32SC1
,
map_
);
...
...
modules/gpuimgproc/src/corners.cpp
View file @
5da72400
...
...
@@ -45,7 +45,7 @@
using
namespace
cv
;
using
namespace
cv
::
gpu
;
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
|| !defined(HAVE_OPENCV_GPUFILTERS)
Ptr
<
gpu
::
CornernessCriteria
>
cv
::
gpu
::
createHarrisCorner
(
int
,
int
,
int
,
double
,
int
)
{
throw_no_cuda
();
return
Ptr
<
gpu
::
CornernessCriteria
>
();
}
Ptr
<
gpu
::
CornernessCriteria
>
cv
::
gpu
::
createMinEigenValCorner
(
int
,
int
,
int
,
int
)
{
throw_no_cuda
();
return
Ptr
<
gpu
::
CornernessCriteria
>
();
}
...
...
modules/gpuimgproc/src/cuda/corners.cu
View file @
5da72400
...
...
@@ -48,6 +48,10 @@
#include "opencv2/core/cuda/saturate_cast.hpp"
#include "opencv2/core/cuda/border_interpolate.hpp"
#include "opencv2/opencv_modules.hpp"
#ifdef HAVE_OPENCV_GPUFILTERS
namespace cv { namespace gpu { namespace cudev
{
namespace imgproc
...
...
@@ -271,4 +275,6 @@ namespace cv { namespace gpu { namespace cudev
}
}}}
#endif
#endif // HAVE_OPENCV_GPUFILTERS
#endif // CUDA_DISABLER
modules/gpuimgproc/src/cuda/hough_circles.cu
View file @
5da72400
...
...
@@ -46,6 +46,10 @@
#include "opencv2/core/cuda/emulation.hpp"
#include "opencv2/core/cuda/dynamic_smem.hpp"
#include "opencv2/opencv_modules.hpp"
#ifdef HAVE_OPENCV_GPUFILTERS
namespace cv { namespace gpu { namespace cudev
{
namespace hough_circles
...
...
@@ -251,5 +255,6 @@ namespace cv { namespace gpu { namespace cudev
}
}}}
#endif // HAVE_OPENCV_GPUFILTERS
#endif /* CUDA_DISABLER */
modules/gpuimgproc/src/generalized_hough.cpp
View file @
5da72400
...
...
@@ -133,22 +133,32 @@ namespace
virtual
void
detectImpl
(
const
GpuMat
&
edges
,
const
GpuMat
&
dx
,
const
GpuMat
&
dy
,
OutputArray
positions
)
=
0
;
private
:
#ifdef HAVE_OPENCV_GPUFILTERS
GpuMat
dx_
,
dy_
;
GpuMat
edges_
;
Ptr
<
gpu
::
CannyEdgeDetector
>
canny_
;
Ptr
<
gpu
::
Filter
>
filterDx_
;
Ptr
<
gpu
::
Filter
>
filterDy_
;
#endif
};
GeneralizedHoughBase
::
GeneralizedHoughBase
()
{
#ifdef HAVE_OPENCV_GPUFILTERS
canny_
=
gpu
::
createCannyEdgeDetector
(
50
,
100
);
filterDx_
=
gpu
::
createSobelFilter
(
CV_8UC1
,
CV_32S
,
1
,
0
);
filterDy_
=
gpu
::
createSobelFilter
(
CV_8UC1
,
CV_32S
,
0
,
1
);
#endif
}
void
GeneralizedHoughBase
::
setTemplate
(
InputArray
_templ
,
int
cannyThreshold
,
Point
templCenter
)
{
#ifndef HAVE_OPENCV_GPUFILTERS
(
void
)
_templ
;
(
void
)
cannyThreshold
;
(
void
)
templCenter
;
throw_no_cuda
();
#else
GpuMat
templ
=
_templ
.
getGpuMat
();
CV_Assert
(
templ
.
type
()
==
CV_8UC1
);
...
...
@@ -170,6 +180,7 @@ namespace
templCenter
=
Point
(
templ
.
cols
/
2
,
templ
.
rows
/
2
);
setTemplateImpl
(
edges_
,
dx_
,
dy_
,
templCenter
);
#endif
}
void
GeneralizedHoughBase
::
setTemplate
(
InputArray
_edges
,
InputArray
_dx
,
InputArray
_dy
,
Point
templCenter
)
...
...
@@ -186,6 +197,12 @@ namespace
void
GeneralizedHoughBase
::
detect
(
InputArray
_image
,
OutputArray
positions
,
int
cannyThreshold
)
{
#ifndef HAVE_OPENCV_GPUFILTERS
(
void
)
_image
;
(
void
)
positions
;
(
void
)
cannyThreshold
;
throw_no_cuda
();
#else
GpuMat
image
=
_image
.
getGpuMat
();
CV_Assert
(
image
.
type
()
==
CV_8UC1
);
...
...
@@ -204,6 +221,7 @@ namespace
canny_
->
detect
(
dx_
,
dy_
,
edges_
);
detectImpl
(
edges_
,
dx_
,
dy_
,
positions
);
#endif
}
void
GeneralizedHoughBase
::
detect
(
InputArray
_edges
,
InputArray
_dx
,
InputArray
_dy
,
OutputArray
positions
)
...
...
modules/gpuimgproc/src/hough_circles.cpp
View file @
5da72400
...
...
@@ -45,7 +45,7 @@
using
namespace
cv
;
using
namespace
cv
::
gpu
;
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
|| !defined(HAVE_OPENCV_GPUFILTERS)
Ptr
<
gpu
::
HoughCirclesDetector
>
cv
::
gpu
::
createHoughCirclesDetector
(
float
,
float
,
int
,
int
,
int
,
int
,
int
)
{
throw_no_cuda
();
return
Ptr
<
HoughCirclesDetector
>
();
}
...
...
modules/gpuimgproc/src/precomp.hpp
View file @
5da72400
...
...
@@ -44,7 +44,6 @@
#define __OPENCV_PRECOMP_H__
#include "opencv2/gpuimgproc.hpp"
#include "opencv2/gpufilters.hpp"
#include "opencv2/core/utility.hpp"
#include "opencv2/core/private.hpp"
...
...
@@ -56,4 +55,8 @@
# include "opencv2/gpuarithm.hpp"
#endif
#ifdef HAVE_OPENCV_GPUFILTERS
# include "opencv2/gpufilters.hpp"
#endif
#endif
/* __OPENCV_PRECOMP_H__ */
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