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
77027f60
Commit
77027f60
authored
Dec 06, 2010
by
Alexey Spizhevoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactored border interpolation in gpu module
parent
bc21cc6f
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
198 additions
and
33 deletions
+198
-33
border_interpolate.cpp
modules/gpu/src/border_interpolate.cpp
+64
-0
border_interpolate.hpp
modules/gpu/src/border_interpolate.hpp
+57
-0
border_interpolate.hpp
modules/gpu/src/cuda/border_interpolate.hpp
+10
-3
cuda_shared.hpp
modules/gpu/src/cuda/cuda_shared.hpp
+0
-7
imgproc.cu
modules/gpu/src/cuda/imgproc.cu
+0
-1
imgproc_gpu.cpp
modules/gpu/src/imgproc_gpu.cpp
+9
-22
internal_common.hpp
modules/gpu/src/internal_common.hpp
+58
-0
No files found.
modules/gpu/src/border_interpolate.cpp
0 → 100644
View file @
77027f60
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#include "internal_common.hpp"
#include "border_interpolate.hpp"
#include "opencv2/gpu/gpu.hpp"
bool
cv
::
gpu
::
tryConvertToGpuBorderType
(
int
cpuBorderType
,
int
&
gpuBorderType
)
{
if
(
cpuBorderType
==
cv
::
BORDER_REFLECT101
)
{
gpuBorderType
=
cv
::
gpu
::
BORDER_REFLECT101
;
return
true
;
}
if
(
cpuBorderType
==
cv
::
BORDER_REPLICATE
)
{
gpuBorderType
=
cv
::
gpu
::
BORDER_REPLICATE
;
return
true
;
}
return
false
;
}
\ No newline at end of file
modules/gpu/src/border_interpolate.hpp
0 → 100644
View file @
77027f60
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef __OPENCV_GPU_BORDER_INTERPOLATE_HPP__
#define __OPENCV_GPU_BORDER_INTERPOLATE_HPP__
#include "border_interpolate.hpp"
namespace
cv
{
namespace
gpu
{
// Converts CPU border extrapolation mode into GPU internal analogue.
// Returns true if the GPU analogue exists, false otherwise.
bool
tryConvertToGpuBorderType
(
int
cpuBorderType
,
int
&
gpuBorderType
);
}}
#endif
\ No newline at end of file
modules/gpu/src/cuda/border_interpolate.hpp
View file @
77027f60
...
...
@@ -28,7 +28,7 @@
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or
bpied warranties, including, but not limited to, the bp
ied
// any express or
implied warranties, including, but not limited to, the impl
ied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
...
...
@@ -40,6 +40,11 @@
//
//M*/
#ifndef __OPENCV_GPU_BORDER_INTERPOLATE_HPP__
#define __OPENCV_GPU_BORDER_INTERPOLATE_HPP__
#include "../internal_common.hpp"
namespace
cv
{
namespace
gpu
{
struct
BrdReflect101
...
...
@@ -169,4 +174,6 @@ namespace cv { namespace gpu {
int
step
;
};
}}
\ No newline at end of file
}}
#endif
\ No newline at end of file
modules/gpu/src/cuda/cuda_shared.hpp
View file @
77027f60
...
...
@@ -95,13 +95,6 @@ namespace cv
cudaSafeCall
(
cudaUnbindTexture
(
tex
)
);
}
// Available GPU border interpolation modes (named as CPU
// border interpolation modes)
enum
{
BORDER_REFLECT101
=
0
,
BORDER_REPLICATE
};
}
}
...
...
modules/gpu/src/cuda/imgproc.cu
View file @
77027f60
...
...
@@ -42,7 +42,6 @@
#include "cuda_shared.hpp"
#include "border_interpolate.hpp"
#include <stdio.h>
using namespace cv::gpu;
...
...
modules/gpu/src/imgproc_gpu.cpp
View file @
77027f60
...
...
@@ -41,6 +41,7 @@
//M*/
#include "precomp.hpp"
#include "border_interpolate.hpp"
using
namespace
cv
;
using
namespace
cv
::
gpu
;
...
...
@@ -940,18 +941,11 @@ namespace
void
cv
::
gpu
::
cornerHarris
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
blockSize
,
int
ksize
,
double
k
,
int
borderType
)
{
CV_Assert
(
borderType
==
cv
::
BORDER_REFLECT101
||
borderType
==
cv
::
BORDER_REPLICATE
);
int
gpuBorderType
;
switch
(
borderType
)
{
case
cv
:
:
BORDER_REFLECT101
:
gpuBorderType
=
cv
::
gpu
::
BORDER_REFLECT101
;
break
;
case
cv
:
:
BORDER_REPLICATE
:
gpuBorderType
=
cv
::
gpu
::
BORDER_REPLICATE
;
break
;
default
:
CV_Error
(
CV_StsBadArg
,
"cornerHarris: unsupported border extrapolation mode"
);
}
CV_Assert
(
tryConvertToGpuBorderType
(
borderType
,
gpuBorderType
));
GpuMat
Dx
,
Dy
;
extractCovData
(
src
,
Dx
,
Dy
,
blockSize
,
ksize
,
gpuBorderType
);
...
...
@@ -961,18 +955,11 @@ void cv::gpu::cornerHarris(const GpuMat& src, GpuMat& dst, int blockSize, int ks
void
cv
::
gpu
::
cornerMinEigenVal
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
blockSize
,
int
ksize
,
int
borderType
)
{
CV_Assert
(
borderType
==
cv
::
BORDER_REFLECT101
||
borderType
==
cv
::
BORDER_REPLICATE
);
int
gpuBorderType
;
switch
(
borderType
)
{
case
cv
:
:
BORDER_REFLECT101
:
gpuBorderType
=
cv
::
gpu
::
BORDER_REFLECT101
;
break
;
case
cv
:
:
BORDER_REPLICATE
:
gpuBorderType
=
cv
::
gpu
::
BORDER_REPLICATE
;
break
;
default
:
CV_Error
(
CV_StsBadArg
,
"cornerMinEigenVal: unsupported border extrapolation mode"
);
}
CV_Assert
(
tryConvertToGpuBorderType
(
borderType
,
gpuBorderType
));
GpuMat
Dx
,
Dy
;
extractCovData
(
src
,
Dx
,
Dy
,
blockSize
,
ksize
,
gpuBorderType
);
...
...
modules/gpu/src/internal_common.hpp
0 → 100644
View file @
77027f60
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef __OPENCV_GPU_INTERNAL_COMMON_HPP__
#define __OPENCV_GPU_INTERNAL_COMMON_HPP__
namespace
cv
{
namespace
gpu
{
// Internal GPU anlagues of CPU border extrapolation types
enum
{
BORDER_REFLECT101
=
0
,
BORDER_REPLICATE
};
}}
#endif
\ No newline at end of file
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