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
0c325cac
Commit
0c325cac
authored
Apr 24, 2011
by
Anton Obukhov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[~] Minor refactoring, clean-up
[+] Added 128-bit transpose
parent
e2caf4a3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
139 additions
and
114 deletions
+139
-114
NCVHaarObjectDetection.cu
modules/gpu/src/nvidia/NCVHaarObjectDetection.cu
+0
-0
NCVHaarObjectDetection.hpp
modules/gpu/src/nvidia/NCVHaarObjectDetection.hpp
+14
-60
NPP_staging.cu
modules/gpu/src/nvidia/NPP_staging/NPP_staging.cu
+0
-0
NPP_staging.hpp
modules/gpu/src/nvidia/NPP_staging/NPP_staging.hpp
+40
-22
NCV.cu
modules/gpu/src/nvidia/core/NCV.cu
+0
-0
NCV.hpp
modules/gpu/src/nvidia/core/NCV.hpp
+78
-25
NCVRuntimeTemplates.hpp
modules/gpu/src/nvidia/core/NCVRuntimeTemplates.hpp
+2
-2
TestHypothesesFilter.cpp
modules/gpu/test/nvidia/TestHypothesesFilter.cpp
+1
-1
TestResize.cpp
modules/gpu/test/nvidia/TestResize.cpp
+4
-4
No files found.
modules/gpu/src/nvidia/NCVHaarObjectDetection.cu
View file @
0c325cac
This diff is collapsed.
Click to expand it.
modules/gpu/src/nvidia/NCVHaarObjectDetection.hpp
View file @
0c325cac
...
@@ -346,8 +346,8 @@ enum
...
@@ -346,8 +346,8 @@ enum
NCVPipeObjDet_VisualizeInPlace
=
0x004
,
NCVPipeObjDet_VisualizeInPlace
=
0x004
,
};
};
NCV_EXPORTS
NCVStatus
ncvDetectObjectsMultiScale_device
(
NCVMatrix
<
Ncv8u
>
&
d_srcImg
,
NCV
_EXPORTS
NCV
Status
ncvDetectObjectsMultiScale_device
(
NCVMatrix
<
Ncv8u
>
&
d_srcImg
,
NcvSize32u
srcRoi
,
NcvSize32u
srcRoi
,
NCVVector
<
NcvRect32u
>
&
d_dstRects
,
NCVVector
<
NcvRect32u
>
&
d_dstRects
,
Ncv32u
&
dstNumRects
,
Ncv32u
&
dstNumRects
,
...
@@ -373,8 +373,8 @@ NCVStatus ncvDetectObjectsMultiScale_device(NCVMatrix<Ncv8u> &d_srcImg,
...
@@ -373,8 +373,8 @@ NCVStatus ncvDetectObjectsMultiScale_device(NCVMatrix<Ncv8u> &d_srcImg,
#define OBJDET_MASK_ELEMENT_INVALID_32U 0xFFFFFFFF
#define OBJDET_MASK_ELEMENT_INVALID_32U 0xFFFFFFFF
#define HAAR_STDDEV_BORDER 1
#define HAAR_STDDEV_BORDER 1
NCV_EXPORTS
NCVStatus
ncvApplyHaarClassifierCascade_device
(
NCVMatrix
<
Ncv32u
>
&
d_integralImage
,
NCV
_EXPORTS
NCV
Status
ncvApplyHaarClassifierCascade_device
(
NCVMatrix
<
Ncv32u
>
&
d_integralImage
,
NCVMatrix
<
Ncv32f
>
&
d_weights
,
NCVMatrix
<
Ncv32f
>
&
d_weights
,
NCVMatrixAlloc
<
Ncv32u
>
&
d_pixelMask
,
NCVMatrixAlloc
<
Ncv32u
>
&
d_pixelMask
,
Ncv32u
&
numDetections
,
Ncv32u
&
numDetections
,
...
@@ -392,8 +392,8 @@ NCVStatus ncvApplyHaarClassifierCascade_device(NCVMatrix<Ncv32u> &d_integralImag
...
@@ -392,8 +392,8 @@ NCVStatus ncvApplyHaarClassifierCascade_device(NCVMatrix<Ncv32u> &d_integralImag
cudaDeviceProp
&
devProp
,
cudaDeviceProp
&
devProp
,
cudaStream_t
cuStream
);
cudaStream_t
cuStream
);
NCV_EXPORTS
NCVStatus
ncvApplyHaarClassifierCascade_host
(
NCVMatrix
<
Ncv32u
>
&
h_integralImage
,
NCV
_EXPORTS
NCV
Status
ncvApplyHaarClassifierCascade_host
(
NCVMatrix
<
Ncv32u
>
&
h_integralImage
,
NCVMatrix
<
Ncv32f
>
&
h_weights
,
NCVMatrix
<
Ncv32f
>
&
h_weights
,
NCVMatrixAlloc
<
Ncv32u
>
&
h_pixelMask
,
NCVMatrixAlloc
<
Ncv32u
>
&
h_pixelMask
,
Ncv32u
&
numDetections
,
Ncv32u
&
numDetections
,
...
@@ -406,49 +406,11 @@ NCVStatus ncvApplyHaarClassifierCascade_host(NCVMatrix<Ncv32u> &h_integralImage,
...
@@ -406,49 +406,11 @@ NCVStatus ncvApplyHaarClassifierCascade_host(NCVMatrix<Ncv32u> &h_integralImage,
Ncv32u
pixelStep
,
Ncv32u
pixelStep
,
Ncv32f
scaleArea
);
Ncv32f
scaleArea
);
NCV_EXPORTS
NCVStatus
ncvDrawRects_8u_device
(
Ncv8u
*
d_dst
,
Ncv32u
dstStride
,
Ncv32u
dstWidth
,
Ncv32u
dstHeight
,
NcvRect32u
*
d_rects
,
Ncv32u
numRects
,
Ncv8u
color
,
cudaStream_t
cuStream
);
NCV_EXPORTS
NCVStatus
ncvDrawRects_32u_device
(
Ncv32u
*
d_dst
,
Ncv32u
dstStride
,
Ncv32u
dstWidth
,
Ncv32u
dstHeight
,
NcvRect32u
*
d_rects
,
Ncv32u
numRects
,
Ncv32u
color
,
cudaStream_t
cuStream
);
NCV_EXPORTS
NCVStatus
ncvDrawRects_8u_host
(
Ncv8u
*
h_dst
,
Ncv32u
dstStride
,
Ncv32u
dstWidth
,
Ncv32u
dstHeight
,
NcvRect32u
*
h_rects
,
Ncv32u
numRects
,
Ncv8u
color
);
NCV_EXPORTS
NCVStatus
ncvDrawRects_32u_host
(
Ncv32u
*
h_dst
,
Ncv32u
dstStride
,
Ncv32u
dstWidth
,
Ncv32u
dstHeight
,
NcvRect32u
*
h_rects
,
Ncv32u
numRects
,
Ncv32u
color
);
#define RECT_SIMILARITY_PROPORTION 0.2f
#define RECT_SIMILARITY_PROPORTION 0.2f
NCV_EXPORTS
NCVStatus
ncvGrowDetectionsVector_device
(
NCVVector
<
Ncv32u
>
&
pixelMask
,
NCV
_EXPORTS
NCV
Status
ncvGrowDetectionsVector_device
(
NCVVector
<
Ncv32u
>
&
pixelMask
,
Ncv32u
numPixelMaskDetections
,
Ncv32u
numPixelMaskDetections
,
NCVVector
<
NcvRect32u
>
&
hypotheses
,
NCVVector
<
NcvRect32u
>
&
hypotheses
,
Ncv32u
&
totalDetections
,
Ncv32u
&
totalDetections
,
...
@@ -458,8 +420,8 @@ NCVStatus ncvGrowDetectionsVector_device(NCVVector<Ncv32u> &pixelMask,
...
@@ -458,8 +420,8 @@ NCVStatus ncvGrowDetectionsVector_device(NCVVector<Ncv32u> &pixelMask,
Ncv32f
curScale
,
Ncv32f
curScale
,
cudaStream_t
cuStream
);
cudaStream_t
cuStream
);
NCV_EXPORTS
NCVStatus
ncvGrowDetectionsVector_host
(
NCVVector
<
Ncv32u
>
&
pixelMask
,
NCV
_EXPORTS
NCV
Status
ncvGrowDetectionsVector_host
(
NCVVector
<
Ncv32u
>
&
pixelMask
,
Ncv32u
numPixelMaskDetections
,
Ncv32u
numPixelMaskDetections
,
NCVVector
<
NcvRect32u
>
&
hypotheses
,
NCVVector
<
NcvRect32u
>
&
hypotheses
,
Ncv32u
&
totalDetections
,
Ncv32u
&
totalDetections
,
...
@@ -468,27 +430,19 @@ NCVStatus ncvGrowDetectionsVector_host(NCVVector<Ncv32u> &pixelMask,
...
@@ -468,27 +430,19 @@ NCVStatus ncvGrowDetectionsVector_host(NCVVector<Ncv32u> &pixelMask,
Ncv32u
rectHeight
,
Ncv32u
rectHeight
,
Ncv32f
curScale
);
Ncv32f
curScale
);
NCV_EXPORTS
NCVStatus
ncvFilterHypotheses_host
(
NCVVector
<
NcvRect32u
>
&
hypotheses
,
Ncv32u
&
numHypotheses
,
Ncv32u
minNeighbors
,
Ncv32f
intersectEps
,
NCVVector
<
Ncv32u
>
*
hypothesesWeights
);
NCV_EXPORTS
NCV_EXPORTS
NCVStatus
ncvHaarGetClassifierSize
(
const
std
::
string
&
filename
,
Ncv32u
&
numStages
,
NCVStatus
ncvHaarGetClassifierSize
(
const
std
::
string
&
filename
,
Ncv32u
&
numStages
,
Ncv32u
&
numNodes
,
Ncv32u
&
numFeatures
);
Ncv32u
&
numNodes
,
Ncv32u
&
numFeatures
);
NCV_EXPORTS
NCVStatus
ncvHaarLoadFromFile_host
(
const
std
::
string
&
filename
,
NCV
_EXPORTS
NCV
Status
ncvHaarLoadFromFile_host
(
const
std
::
string
&
filename
,
HaarClassifierCascadeDescriptor
&
haar
,
HaarClassifierCascadeDescriptor
&
haar
,
NCVVector
<
HaarStage64
>
&
h_HaarStages
,
NCVVector
<
HaarStage64
>
&
h_HaarStages
,
NCVVector
<
HaarClassifierNode128
>
&
h_HaarNodes
,
NCVVector
<
HaarClassifierNode128
>
&
h_HaarNodes
,
NCVVector
<
HaarFeature64
>
&
h_HaarFeatures
);
NCVVector
<
HaarFeature64
>
&
h_HaarFeatures
);
NCV_EXPORTS
NCV_EXPORTS
NCVStatus
ncvHaarStoreNVBIN_host
(
const
std
::
string
&
filename
,
NCVStatus
ncvHaarStoreNVBIN_host
(
const
std
::
string
&
filename
,
HaarClassifierCascadeDescriptor
haar
,
HaarClassifierCascadeDescriptor
haar
,
NCVVector
<
HaarStage64
>
&
h_HaarStages
,
NCVVector
<
HaarStage64
>
&
h_HaarStages
,
NCVVector
<
HaarClassifierNode128
>
&
h_HaarNodes
,
NCVVector
<
HaarClassifierNode128
>
&
h_HaarNodes
,
...
...
modules/gpu/src/nvidia/NPP_staging/NPP_staging.cu
View file @
0c325cac
This diff is collapsed.
Click to expand it.
modules/gpu/src/nvidia/NPP_staging/NPP_staging.hpp
View file @
0c325cac
...
@@ -96,7 +96,7 @@ cudaStream_t nppStSetActiveCUDAstream(cudaStream_t cudaStream);
...
@@ -96,7 +96,7 @@ cudaStream_t nppStSetActiveCUDAstream(cudaStream_t cudaStream);
* \return NCV status code
* \return NCV status code
*/
*/
NCV_EXPORTS
NCV_EXPORTS
NCVStatus
nppiStD
ownsampleNearest
_32u_C1R
(
Ncv32u
*
d_src
,
Ncv32u
srcStep
,
NCVStatus
nppiStD
ecimate
_32u_C1R
(
Ncv32u
*
d_src
,
Ncv32u
srcStep
,
Ncv32u
*
d_dst
,
Ncv32u
dstStep
,
Ncv32u
*
d_dst
,
Ncv32u
dstStep
,
NcvSize32u
srcRoi
,
Ncv32u
scale
,
NcvSize32u
srcRoi
,
Ncv32u
scale
,
NcvBool
readThruTexture
);
NcvBool
readThruTexture
);
...
@@ -104,10 +104,10 @@ NCVStatus nppiStDownsampleNearest_32u_C1R(Ncv32u *d_src, Ncv32u srcStep,
...
@@ -104,10 +104,10 @@ NCVStatus nppiStDownsampleNearest_32u_C1R(Ncv32u *d_src, Ncv32u srcStep,
/**
/**
* Downsamples (decimates) an image using the nearest neighbor algorithm. 32-bit signed pixels, single channel.
* Downsamples (decimates) an image using the nearest neighbor algorithm. 32-bit signed pixels, single channel.
* \see nppiStD
ownsampleNearest
_32u_C1R
* \see nppiStD
ecimate
_32u_C1R
*/
*/
NCV_EXPORTS
NCV_EXPORTS
NCVStatus
nppiStD
ownsampleNearest
_32s_C1R
(
Ncv32s
*
d_src
,
Ncv32u
srcStep
,
NCVStatus
nppiStD
ecimate
_32s_C1R
(
Ncv32s
*
d_src
,
Ncv32u
srcStep
,
Ncv32s
*
d_dst
,
Ncv32u
dstStep
,
Ncv32s
*
d_dst
,
Ncv32u
dstStep
,
NcvSize32u
srcRoi
,
Ncv32u
scale
,
NcvSize32u
srcRoi
,
Ncv32u
scale
,
NcvBool
readThruTexture
);
NcvBool
readThruTexture
);
...
@@ -115,10 +115,10 @@ NCVStatus nppiStDownsampleNearest_32s_C1R(Ncv32s *d_src, Ncv32u srcStep,
...
@@ -115,10 +115,10 @@ NCVStatus nppiStDownsampleNearest_32s_C1R(Ncv32s *d_src, Ncv32u srcStep,
/**
/**
* Downsamples (decimates) an image using the nearest neighbor algorithm. 32-bit float pixels, single channel.
* Downsamples (decimates) an image using the nearest neighbor algorithm. 32-bit float pixels, single channel.
* \see nppiStD
ownsampleNearest
_32u_C1R
* \see nppiStD
ecimate
_32u_C1R
*/
*/
NCV_EXPORTS
NCV_EXPORTS
NCVStatus
nppiStD
ownsampleNearest
_32f_C1R
(
Ncv32f
*
d_src
,
Ncv32u
srcStep
,
NCVStatus
nppiStD
ecimate
_32f_C1R
(
Ncv32f
*
d_src
,
Ncv32u
srcStep
,
Ncv32f
*
d_dst
,
Ncv32u
dstStep
,
Ncv32f
*
d_dst
,
Ncv32u
dstStep
,
NcvSize32u
srcRoi
,
Ncv32u
scale
,
NcvSize32u
srcRoi
,
Ncv32u
scale
,
NcvBool
readThruTexture
);
NcvBool
readThruTexture
);
...
@@ -126,10 +126,10 @@ NCVStatus nppiStDownsampleNearest_32f_C1R(Ncv32f *d_src, Ncv32u srcStep,
...
@@ -126,10 +126,10 @@ NCVStatus nppiStDownsampleNearest_32f_C1R(Ncv32f *d_src, Ncv32u srcStep,
/**
/**
* Downsamples (decimates) an image using the nearest neighbor algorithm. 64-bit unsigned pixels, single channel.
* Downsamples (decimates) an image using the nearest neighbor algorithm. 64-bit unsigned pixels, single channel.
* \see nppiStD
ownsampleNearest
_32u_C1R
* \see nppiStD
ecimate
_32u_C1R
*/
*/
NCV_EXPORTS
NCV_EXPORTS
NCVStatus
nppiStD
ownsampleNearest
_64u_C1R
(
Ncv64u
*
d_src
,
Ncv32u
srcStep
,
NCVStatus
nppiStD
ecimate
_64u_C1R
(
Ncv64u
*
d_src
,
Ncv32u
srcStep
,
Ncv64u
*
d_dst
,
Ncv32u
dstStep
,
Ncv64u
*
d_dst
,
Ncv32u
dstStep
,
NcvSize32u
srcRoi
,
Ncv32u
scale
,
NcvSize32u
srcRoi
,
Ncv32u
scale
,
NcvBool
readThruTexture
);
NcvBool
readThruTexture
);
...
@@ -137,10 +137,10 @@ NCVStatus nppiStDownsampleNearest_64u_C1R(Ncv64u *d_src, Ncv32u srcStep,
...
@@ -137,10 +137,10 @@ NCVStatus nppiStDownsampleNearest_64u_C1R(Ncv64u *d_src, Ncv32u srcStep,
/**
/**
* Downsamples (decimates) an image using the nearest neighbor algorithm. 64-bit signed pixels, single channel.
* Downsamples (decimates) an image using the nearest neighbor algorithm. 64-bit signed pixels, single channel.
* \see nppiStD
ownsampleNearest
_32u_C1R
* \see nppiStD
ecimate
_32u_C1R
*/
*/
NCV_EXPORTS
NCV_EXPORTS
NCVStatus
nppiStD
ownsampleNearest
_64s_C1R
(
Ncv64s
*
d_src
,
Ncv32u
srcStep
,
NCVStatus
nppiStD
ecimate
_64s_C1R
(
Ncv64s
*
d_src
,
Ncv32u
srcStep
,
Ncv64s
*
d_dst
,
Ncv32u
dstStep
,
Ncv64s
*
d_dst
,
Ncv32u
dstStep
,
NcvSize32u
srcRoi
,
Ncv32u
scale
,
NcvSize32u
srcRoi
,
Ncv32u
scale
,
NcvBool
readThruTexture
);
NcvBool
readThruTexture
);
...
@@ -148,10 +148,10 @@ NCVStatus nppiStDownsampleNearest_64s_C1R(Ncv64s *d_src, Ncv32u srcStep,
...
@@ -148,10 +148,10 @@ NCVStatus nppiStDownsampleNearest_64s_C1R(Ncv64s *d_src, Ncv32u srcStep,
/**
/**
* Downsamples (decimates) an image using the nearest neighbor algorithm. 64-bit float pixels, single channel.
* Downsamples (decimates) an image using the nearest neighbor algorithm. 64-bit float pixels, single channel.
* \see nppiStD
ownsampleNearest
_32u_C1R
* \see nppiStD
ecimate
_32u_C1R
*/
*/
NCV_EXPORTS
NCV_EXPORTS
NCVStatus
nppiStD
ownsampleNearest
_64f_C1R
(
Ncv64f
*
d_src
,
Ncv32u
srcStep
,
NCVStatus
nppiStD
ecimate
_64f_C1R
(
Ncv64f
*
d_src
,
Ncv32u
srcStep
,
Ncv64f
*
d_dst
,
Ncv32u
dstStep
,
Ncv64f
*
d_dst
,
Ncv32u
dstStep
,
NcvSize32u
srcRoi
,
Ncv32u
scale
,
NcvSize32u
srcRoi
,
Ncv32u
scale
,
NcvBool
readThruTexture
);
NcvBool
readThruTexture
);
...
@@ -170,57 +170,57 @@ NCVStatus nppiStDownsampleNearest_64f_C1R(Ncv64f *d_src, Ncv32u srcStep,
...
@@ -170,57 +170,57 @@ NCVStatus nppiStDownsampleNearest_64f_C1R(Ncv64f *d_src, Ncv32u srcStep,
* \return NCV status code
* \return NCV status code
*/
*/
NCV_EXPORTS
NCV_EXPORTS
NCVStatus
nppiStD
ownsampleNearest
_32u_C1R_host
(
Ncv32u
*
h_src
,
Ncv32u
srcStep
,
NCVStatus
nppiStD
ecimate
_32u_C1R_host
(
Ncv32u
*
h_src
,
Ncv32u
srcStep
,
Ncv32u
*
h_dst
,
Ncv32u
dstStep
,
Ncv32u
*
h_dst
,
Ncv32u
dstStep
,
NcvSize32u
srcRoi
,
Ncv32u
scale
);
NcvSize32u
srcRoi
,
Ncv32u
scale
);
/**
/**
* Downsamples (decimates) an image using the nearest neighbor algorithm. 32-bit signed pixels, single channel. Host implementation.
* Downsamples (decimates) an image using the nearest neighbor algorithm. 32-bit signed pixels, single channel. Host implementation.
* \see nppiStD
ownsampleNearest
_32u_C1R_host
* \see nppiStD
ecimate
_32u_C1R_host
*/
*/
NCV_EXPORTS
NCV_EXPORTS
NCVStatus
nppiStD
ownsampleNearest
_32s_C1R_host
(
Ncv32s
*
h_src
,
Ncv32u
srcStep
,
NCVStatus
nppiStD
ecimate
_32s_C1R_host
(
Ncv32s
*
h_src
,
Ncv32u
srcStep
,
Ncv32s
*
h_dst
,
Ncv32u
dstStep
,
Ncv32s
*
h_dst
,
Ncv32u
dstStep
,
NcvSize32u
srcRoi
,
Ncv32u
scale
);
NcvSize32u
srcRoi
,
Ncv32u
scale
);
/**
/**
* Downsamples (decimates) an image using the nearest neighbor algorithm. 32-bit float pixels, single channel. Host implementation.
* Downsamples (decimates) an image using the nearest neighbor algorithm. 32-bit float pixels, single channel. Host implementation.
* \see nppiStD
ownsampleNearest
_32u_C1R_host
* \see nppiStD
ecimate
_32u_C1R_host
*/
*/
NCV_EXPORTS
NCV_EXPORTS
NCVStatus
nppiStD
ownsampleNearest
_32f_C1R_host
(
Ncv32f
*
h_src
,
Ncv32u
srcStep
,
NCVStatus
nppiStD
ecimate
_32f_C1R_host
(
Ncv32f
*
h_src
,
Ncv32u
srcStep
,
Ncv32f
*
h_dst
,
Ncv32u
dstStep
,
Ncv32f
*
h_dst
,
Ncv32u
dstStep
,
NcvSize32u
srcRoi
,
Ncv32u
scale
);
NcvSize32u
srcRoi
,
Ncv32u
scale
);
/**
/**
* Downsamples (decimates) an image using the nearest neighbor algorithm. 64-bit unsigned pixels, single channel. Host implementation.
* Downsamples (decimates) an image using the nearest neighbor algorithm. 64-bit unsigned pixels, single channel. Host implementation.
* \see nppiStD
ownsampleNearest
_32u_C1R_host
* \see nppiStD
ecimate
_32u_C1R_host
*/
*/
NCV_EXPORTS
NCV_EXPORTS
NCVStatus
nppiStD
ownsampleNearest
_64u_C1R_host
(
Ncv64u
*
h_src
,
Ncv32u
srcStep
,
NCVStatus
nppiStD
ecimate
_64u_C1R_host
(
Ncv64u
*
h_src
,
Ncv32u
srcStep
,
Ncv64u
*
h_dst
,
Ncv32u
dstStep
,
Ncv64u
*
h_dst
,
Ncv32u
dstStep
,
NcvSize32u
srcRoi
,
Ncv32u
scale
);
NcvSize32u
srcRoi
,
Ncv32u
scale
);
/**
/**
* Downsamples (decimates) an image using the nearest neighbor algorithm. 64-bit signed pixels, single channel. Host implementation.
* Downsamples (decimates) an image using the nearest neighbor algorithm. 64-bit signed pixels, single channel. Host implementation.
* \see nppiStD
ownsampleNearest
_32u_C1R_host
* \see nppiStD
ecimate
_32u_C1R_host
*/
*/
NCV_EXPORTS
NCV_EXPORTS
NCVStatus
nppiStD
ownsampleNearest
_64s_C1R_host
(
Ncv64s
*
h_src
,
Ncv32u
srcStep
,
NCVStatus
nppiStD
ecimate
_64s_C1R_host
(
Ncv64s
*
h_src
,
Ncv32u
srcStep
,
Ncv64s
*
h_dst
,
Ncv32u
dstStep
,
Ncv64s
*
h_dst
,
Ncv32u
dstStep
,
NcvSize32u
srcRoi
,
Ncv32u
scale
);
NcvSize32u
srcRoi
,
Ncv32u
scale
);
/**
/**
* Downsamples (decimates) an image using the nearest neighbor algorithm. 64-bit float pixels, single channel. Host implementation.
* Downsamples (decimates) an image using the nearest neighbor algorithm. 64-bit float pixels, single channel. Host implementation.
* \see nppiStD
ownsampleNearest
_32u_C1R_host
* \see nppiStD
ecimate
_32u_C1R_host
*/
*/
NCV_EXPORTS
NCV_EXPORTS
NCVStatus
nppiStD
ownsampleNearest
_64f_C1R_host
(
Ncv64f
*
h_src
,
Ncv32u
srcStep
,
NCVStatus
nppiStD
ecimate
_64f_C1R_host
(
Ncv64f
*
h_src
,
Ncv32u
srcStep
,
Ncv64f
*
h_dst
,
Ncv32u
dstStep
,
Ncv64f
*
h_dst
,
Ncv32u
dstStep
,
NcvSize32u
srcRoi
,
Ncv32u
scale
);
NcvSize32u
srcRoi
,
Ncv32u
scale
);
...
@@ -333,6 +333,15 @@ NCVStatus nppiStTranspose_64f_C1R(Ncv64f *d_src, Ncv32u srcStride,
...
@@ -333,6 +333,15 @@ NCVStatus nppiStTranspose_64f_C1R(Ncv64f *d_src, Ncv32u srcStride,
Ncv64f
*
d_dst
,
Ncv32u
dstStride
,
NcvSize32u
srcRoi
);
Ncv64f
*
d_dst
,
Ncv32u
dstStride
,
NcvSize32u
srcRoi
);
/**
* Transposes an image. 128-bit pixels of any type, single channel
* \see nppiStTranspose_32u_C1R
*/
NCV_EXPORTS
NCVStatus
nppiStTranspose_128_C1R
(
void
*
d_src
,
Ncv32u
srcStep
,
void
*
d_dst
,
Ncv32u
dstStep
,
NcvSize32u
srcRoi
);
/**
/**
* Transposes an image. 32-bit unsigned pixels, single channel. Host implementation
* Transposes an image. 32-bit unsigned pixels, single channel. Host implementation
*
*
...
@@ -394,6 +403,15 @@ NCVStatus nppiStTranspose_64f_C1R_host(Ncv64f *h_src, Ncv32u srcStride,
...
@@ -394,6 +403,15 @@ NCVStatus nppiStTranspose_64f_C1R_host(Ncv64f *h_src, Ncv32u srcStride,
Ncv64f
*
h_dst
,
Ncv32u
dstStride
,
NcvSize32u
srcRoi
);
Ncv64f
*
h_dst
,
Ncv32u
dstStride
,
NcvSize32u
srcRoi
);
/**
* Transposes an image. 128-bit pixels of any type, single channel. Host implementation
* \see nppiStTranspose_32u_C1R_host
*/
NCV_EXPORTS
NCVStatus
nppiStTranspose_128_C1R_host
(
void
*
d_src
,
Ncv32u
srcStep
,
void
*
d_dst
,
Ncv32u
dstStep
,
NcvSize32u
srcRoi
);
/**
/**
* Calculates the size of the temporary buffer for integral image creation
* Calculates the size of the temporary buffer for integral image creation
*
*
...
...
modules/gpu/src/nvidia/core/NCV.c
pp
→
modules/gpu/src/nvidia/core/NCV.c
u
View file @
0c325cac
This diff is collapsed.
Click to expand it.
modules/gpu/src/nvidia/core/NCV.hpp
View file @
0c325cac
...
@@ -129,8 +129,8 @@ struct NcvRect8u
...
@@ -129,8 +129,8 @@ struct NcvRect8u
Ncv8u
y
;
Ncv8u
y
;
Ncv8u
width
;
Ncv8u
width
;
Ncv8u
height
;
Ncv8u
height
;
NcvRect8u
()
:
x
(
0
),
y
(
0
),
width
(
0
),
height
(
0
)
{};
__host__
__device__
NcvRect8u
()
:
x
(
0
),
y
(
0
),
width
(
0
),
height
(
0
)
{};
NcvRect8u
(
Ncv8u
x
,
Ncv8u
y
,
Ncv8u
width
,
Ncv8u
height
)
:
x
(
x
),
y
(
y
),
width
(
width
),
height
(
height
)
{}
__host__
__device__
NcvRect8u
(
Ncv8u
x
,
Ncv8u
y
,
Ncv8u
width
,
Ncv8u
height
)
:
x
(
x
),
y
(
y
),
width
(
width
),
height
(
height
)
{}
};
};
...
@@ -140,8 +140,8 @@ struct NcvRect32s
...
@@ -140,8 +140,8 @@ struct NcvRect32s
Ncv32s
y
;
///< y-coordinate of upper left corner.
Ncv32s
y
;
///< y-coordinate of upper left corner.
Ncv32s
width
;
///< Rectangle width.
Ncv32s
width
;
///< Rectangle width.
Ncv32s
height
;
///< Rectangle height.
Ncv32s
height
;
///< Rectangle height.
NcvRect32s
()
:
x
(
0
),
y
(
0
),
width
(
0
),
height
(
0
)
{};
__host__
__device__
NcvRect32s
()
:
x
(
0
),
y
(
0
),
width
(
0
),
height
(
0
)
{};
NcvRect32s
(
Ncv32s
x
,
Ncv32s
y
,
Ncv32s
width
,
Ncv32s
height
)
:
x
(
x
),
y
(
y
),
width
(
width
),
height
(
height
)
{}
__host__
__device__
NcvRect32s
(
Ncv32s
x
,
Ncv32s
y
,
Ncv32s
width
,
Ncv32s
height
)
:
x
(
x
),
y
(
y
),
width
(
width
),
height
(
height
)
{}
};
};
...
@@ -151,8 +151,8 @@ struct NcvRect32u
...
@@ -151,8 +151,8 @@ struct NcvRect32u
Ncv32u
y
;
///< y-coordinate of upper left corner.
Ncv32u
y
;
///< y-coordinate of upper left corner.
Ncv32u
width
;
///< Rectangle width.
Ncv32u
width
;
///< Rectangle width.
Ncv32u
height
;
///< Rectangle height.
Ncv32u
height
;
///< Rectangle height.
NcvRect32u
()
:
x
(
0
),
y
(
0
),
width
(
0
),
height
(
0
)
{};
__host__
__device__
NcvRect32u
()
:
x
(
0
),
y
(
0
),
width
(
0
),
height
(
0
)
{};
NcvRect32u
(
Ncv32u
x
,
Ncv32u
y
,
Ncv32u
width
,
Ncv32u
height
)
:
x
(
x
),
y
(
y
),
width
(
width
),
height
(
height
)
{}
__host__
__device__
NcvRect32u
(
Ncv32u
x
,
Ncv32u
y
,
Ncv32u
width
,
Ncv32u
height
)
:
x
(
x
),
y
(
y
),
width
(
width
),
height
(
height
)
{}
};
};
...
@@ -160,8 +160,8 @@ struct NcvSize32s
...
@@ -160,8 +160,8 @@ struct NcvSize32s
{
{
Ncv32s
width
;
///< Rectangle width.
Ncv32s
width
;
///< Rectangle width.
Ncv32s
height
;
///< Rectangle height.
Ncv32s
height
;
///< Rectangle height.
NcvSize32s
()
:
width
(
0
),
height
(
0
)
{};
__host__
__device__
NcvSize32s
()
:
width
(
0
),
height
(
0
)
{};
NcvSize32s
(
Ncv32s
width
,
Ncv32s
height
)
:
width
(
width
),
height
(
height
)
{}
__host__
__device__
NcvSize32s
(
Ncv32s
width
,
Ncv32s
height
)
:
width
(
width
),
height
(
height
)
{}
};
};
...
@@ -169,8 +169,8 @@ struct NcvSize32u
...
@@ -169,8 +169,8 @@ struct NcvSize32u
{
{
Ncv32u
width
;
///< Rectangle width.
Ncv32u
width
;
///< Rectangle width.
Ncv32u
height
;
///< Rectangle height.
Ncv32u
height
;
///< Rectangle height.
NcvSize32u
()
:
width
(
0
),
height
(
0
)
{};
__host__
__device__
NcvSize32u
()
:
width
(
0
),
height
(
0
)
{};
NcvSize32u
(
Ncv32u
width
,
Ncv32u
height
)
:
width
(
width
),
height
(
height
)
{}
__host__
__device__
NcvSize32u
(
Ncv32u
width
,
Ncv32u
height
)
:
width
(
width
),
height
(
height
)
{}
};
};
...
@@ -275,6 +275,7 @@ enum NCVStatus
...
@@ -275,6 +275,7 @@ enum NCVStatus
{
{
//NCV statuses
//NCV statuses
NCV_SUCCESS
,
NCV_SUCCESS
,
NCV_UNKNOWN_ERROR
,
NCV_CUDA_ERROR
,
NCV_CUDA_ERROR
,
NCV_NPP_ERROR
,
NCV_NPP_ERROR
,
...
@@ -501,13 +502,18 @@ private:
...
@@ -501,13 +502,18 @@ private:
/**
/**
* Copy dispatcher
* Copy dispatcher
s
*/
*/
NCV_EXPORTS
NCVStatus
memSegCopyHelper
(
void
*
dst
,
NCVMemoryType
dstType
,
NCV_EXPORTS
NCVStatus
memSegCopyHelper
(
void
*
dst
,
NCVMemoryType
dstType
,
const
void
*
src
,
NCVMemoryType
srcType
,
const
void
*
src
,
NCVMemoryType
srcType
,
size_t
sz
,
cudaStream_t
cuStream
);
size_t
sz
,
cudaStream_t
cuStream
);
NCV_EXPORTS
NCVStatus
memSegCopyHelper2D
(
void
*
dst
,
Ncv32u
dstPitch
,
NCVMemoryType
dstType
,
const
void
*
src
,
Ncv32u
srcPitch
,
NCVMemoryType
srcType
,
Ncv32u
widthbytes
,
Ncv32u
height
,
cudaStream_t
cuStream
);
/**
/**
* NCVVector (1D)
* NCVVector (1D)
*/
*/
...
@@ -532,7 +538,7 @@ public:
...
@@ -532,7 +538,7 @@ public:
_memtype
=
NCVMemoryTypeNone
;
_memtype
=
NCVMemoryTypeNone
;
}
}
NCVStatus
copySolid
(
NCVVector
<
T
>
&
dst
,
cudaStream_t
cuStream
,
size_t
howMuch
=
0
)
NCVStatus
copySolid
(
NCVVector
<
T
>
&
dst
,
cudaStream_t
cuStream
,
size_t
howMuch
=
0
)
const
{
{
if
(
howMuch
==
0
)
if
(
howMuch
==
0
)
{
{
...
@@ -600,7 +606,6 @@ public:
...
@@ -600,7 +606,6 @@ public:
this
->
_memtype
=
this
->
allocatedMem
.
begin
.
memtype
;
this
->
_memtype
=
this
->
allocatedMem
.
begin
.
memtype
;
}
}
~
NCVVectorAlloc
()
~
NCVVectorAlloc
()
{
{
NCVStatus
ncvStat
;
NCVStatus
ncvStat
;
...
@@ -611,19 +616,16 @@ public:
...
@@ -611,19 +616,16 @@ public:
this
->
clear
();
this
->
clear
();
}
}
NcvBool
isMemAllocated
()
const
NcvBool
isMemAllocated
()
const
{
{
return
(
this
->
allocatedMem
.
begin
.
ptr
!=
NULL
)
||
(
this
->
allocator
.
isCounting
());
return
(
this
->
allocatedMem
.
begin
.
ptr
!=
NULL
)
||
(
this
->
allocator
.
isCounting
());
}
}
Ncv32u
getAllocatorsAlignment
()
const
Ncv32u
getAllocatorsAlignment
()
const
{
{
return
allocator
.
alignment
();
return
allocator
.
alignment
();
}
}
NCVMemSegment
getSegment
()
const
NCVMemSegment
getSegment
()
const
{
{
return
allocatedMem
;
return
allocatedMem
;
...
@@ -658,7 +660,6 @@ public:
...
@@ -658,7 +660,6 @@ public:
this
->
bReused
=
true
;
this
->
bReused
=
true
;
}
}
NCVVectorReuse
(
const
NCVMemSegment
&
memSegment
,
Ncv32u
length
)
NCVVectorReuse
(
const
NCVMemSegment
&
memSegment
,
Ncv32u
length
)
{
{
this
->
bReused
=
false
;
this
->
bReused
=
false
;
...
@@ -674,7 +675,6 @@ public:
...
@@ -674,7 +675,6 @@ public:
this
->
bReused
=
true
;
this
->
bReused
=
true
;
}
}
NcvBool
isMemReused
()
const
NcvBool
isMemReused
()
const
{
{
return
this
->
bReused
;
return
this
->
bReused
;
...
@@ -703,7 +703,6 @@ public:
...
@@ -703,7 +703,6 @@ public:
virtual
~
NCVMatrix
()
{}
virtual
~
NCVMatrix
()
{}
void
clear
()
void
clear
()
{
{
_ptr
=
NULL
;
_ptr
=
NULL
;
...
@@ -713,14 +712,13 @@ public:
...
@@ -713,14 +712,13 @@ public:
_memtype
=
NCVMemoryTypeNone
;
_memtype
=
NCVMemoryTypeNone
;
}
}
Ncv32u
stride
()
const
Ncv32u
stride
()
const
{
{
return
_pitch
/
sizeof
(
T
);
return
_pitch
/
sizeof
(
T
);
}
}
//a side effect of this function is that it copies everything in a single chunk, so the "padding" will be overwritten
NCVStatus
copySolid
(
NCVMatrix
<
T
>
&
dst
,
cudaStream_t
cuStream
,
size_t
howMuch
=
0
)
NCVStatus
copySolid
(
NCVMatrix
<
T
>
&
dst
,
cudaStream_t
cuStream
,
size_t
howMuch
=
0
)
const
{
{
if
(
howMuch
==
0
)
if
(
howMuch
==
0
)
{
{
...
@@ -748,6 +746,24 @@ public:
...
@@ -748,6 +746,24 @@ public:
return
ncvStat
;
return
ncvStat
;
}
}
NCVStatus
copy2D
(
NCVMatrix
<
T
>
&
dst
,
NcvSize32u
roi
,
cudaStream_t
cuStream
)
const
{
ncvAssertReturn
(
this
->
width
()
>=
roi
.
width
&&
this
->
height
()
>=
roi
.
height
&&
dst
.
width
()
>=
roi
.
width
&&
dst
.
height
()
>=
roi
.
height
,
NCV_MEM_COPY_ERROR
);
ncvAssertReturn
((
this
->
_ptr
!=
NULL
||
this
->
_memtype
==
NCVMemoryTypeNone
)
&&
(
dst
.
_ptr
!=
NULL
||
dst
.
_memtype
==
NCVMemoryTypeNone
),
NCV_NULL_PTR
);
NCVStatus
ncvStat
=
NCV_SUCCESS
;
if
(
this
->
_memtype
!=
NCVMemoryTypeNone
)
{
ncvStat
=
memSegCopyHelper2D
(
dst
.
_ptr
,
dst
.
_pitch
,
dst
.
_memtype
,
this
->
_ptr
,
this
->
_pitch
,
this
->
_memtype
,
roi
.
width
*
sizeof
(
T
),
roi
.
height
,
cuStream
);
}
return
ncvStat
;
}
T
*
ptr
()
const
{
return
this
->
_ptr
;}
T
*
ptr
()
const
{
return
this
->
_ptr
;}
Ncv32u
width
()
const
{
return
this
->
_width
;}
Ncv32u
width
()
const
{
return
this
->
_width
;}
Ncv32u
height
()
const
{
return
this
->
_height
;}
Ncv32u
height
()
const
{
return
this
->
_height
;}
...
@@ -817,19 +833,16 @@ public:
...
@@ -817,19 +833,16 @@ public:
this
->
clear
();
this
->
clear
();
}
}
NcvBool
isMemAllocated
()
const
NcvBool
isMemAllocated
()
const
{
{
return
(
this
->
allocatedMem
.
begin
.
ptr
!=
NULL
)
||
(
this
->
allocator
.
isCounting
());
return
(
this
->
allocatedMem
.
begin
.
ptr
!=
NULL
)
||
(
this
->
allocator
.
isCounting
());
}
}
Ncv32u
getAllocatorsAlignment
()
const
Ncv32u
getAllocatorsAlignment
()
const
{
{
return
allocator
.
alignment
();
return
allocator
.
alignment
();
}
}
NCVMemSegment
getSegment
()
const
NCVMemSegment
getSegment
()
const
{
{
return
allocatedMem
;
return
allocatedMem
;
...
@@ -888,6 +901,23 @@ public:
...
@@ -888,6 +901,23 @@ public:
this
->
bReused
=
true
;
this
->
bReused
=
true
;
}
}
NCVMatrixReuse
(
const
NCVMatrix
<
T
>
&
mat
,
NcvRect32u
roi
)
{
this
->
bReused
=
false
;
this
->
clear
();
ncvAssertPrintReturn
(
roi
.
x
<
mat
.
width
()
&&
roi
.
y
<
mat
.
height
()
&&
\
roi
.
x
+
roi
.
width
<=
mat
.
width
()
&&
roi
.
y
+
roi
.
height
<=
mat
.
height
(),
"NCVMatrixReuse ctor:: memory binding failed due to mismatching ROI and source matrix dims"
,
);
this
->
_width
=
roi
.
width
;
this
->
_height
=
roi
.
height
;
this
->
_pitch
=
mat
.
pitch
();
this
->
_ptr
=
mat
.
ptr
()
+
roi
.
y
*
mat
.
stride
()
+
roi
.
x
;
this
->
_memtype
=
mat
.
memType
();
this
->
bReused
=
true
;
}
NcvBool
isMemReused
()
const
NcvBool
isMemReused
()
const
{
{
...
@@ -899,4 +929,27 @@ private:
...
@@ -899,4 +929,27 @@ private:
NcvBool
bReused
;
NcvBool
bReused
;
};
};
/**
* Operations with rectangles
*/
NCV_EXPORTS
NCVStatus
ncvGroupRectangles_host
(
NCVVector
<
NcvRect32u
>
&
hypotheses
,
Ncv32u
&
numHypotheses
,
Ncv32u
minNeighbors
,
Ncv32f
intersectEps
,
NCVVector
<
Ncv32u
>
*
hypothesesWeights
);
NCV_EXPORTS
NCVStatus
ncvDrawRects_8u_host
(
Ncv8u
*
h_dst
,
Ncv32u
dstStride
,
Ncv32u
dstWidth
,
Ncv32u
dstHeight
,
NcvRect32u
*
h_rects
,
Ncv32u
numRects
,
Ncv8u
color
);
NCV_EXPORTS
NCVStatus
ncvDrawRects_32u_host
(
Ncv32u
*
h_dst
,
Ncv32u
dstStride
,
Ncv32u
dstWidth
,
Ncv32u
dstHeight
,
NcvRect32u
*
h_rects
,
Ncv32u
numRects
,
Ncv32u
color
);
NCV_EXPORTS
NCVStatus
ncvDrawRects_8u_device
(
Ncv8u
*
d_dst
,
Ncv32u
dstStride
,
Ncv32u
dstWidth
,
Ncv32u
dstHeight
,
NcvRect32u
*
d_rects
,
Ncv32u
numRects
,
Ncv8u
color
,
cudaStream_t
cuStream
);
NCV_EXPORTS
NCVStatus
ncvDrawRects_32u_device
(
Ncv32u
*
d_dst
,
Ncv32u
dstStride
,
Ncv32u
dstWidth
,
Ncv32u
dstHeight
,
NcvRect32u
*
d_rects
,
Ncv32u
numRects
,
Ncv32u
color
,
cudaStream_t
cuStream
);
#endif // _ncv_hpp_
#endif // _ncv_hpp_
modules/gpu/src/nvidia/core/NCVRuntimeTemplates.hpp
View file @
0c325cac
...
@@ -150,14 +150,14 @@ namespace NCVRuntimeTemplateBool
...
@@ -150,14 +150,14 @@ namespace NCVRuntimeTemplateBool
{
{
//Convenience function used by the user
//Convenience function used by the user
//Takes a variable argument list, transforms it into a list
//Takes a variable argument list, transforms it into a list
static
void
call
(
Func
*
functor
,
int
dummy
,
...)
static
void
call
(
Func
*
functor
,
...)
{
{
//Vector used to collect arguments
//Vector used to collect arguments
std
::
vector
<
int
>
templateParamList
;
std
::
vector
<
int
>
templateParamList
;
//Variable argument list manipulation
//Variable argument list manipulation
va_list
listPointer
;
va_list
listPointer
;
va_start
(
listPointer
,
dummy
);
va_start
(
listPointer
,
functor
);
//Collect parameters into the list
//Collect parameters into the list
for
(
int
i
=
0
;
i
<
NumArguments
;
i
++
)
for
(
int
i
=
0
;
i
<
NumArguments
;
i
++
)
{
{
...
...
modules/gpu/test/nvidia/TestHypothesesFilter.cpp
View file @
0c325cac
...
@@ -134,7 +134,7 @@ bool TestHypothesesFilter::process()
...
@@ -134,7 +134,7 @@ bool TestHypothesesFilter::process()
Ncv32u
numHypothesesSrc
=
h_vecSrc
.
length
();
Ncv32u
numHypothesesSrc
=
h_vecSrc
.
length
();
NCV_SKIP_COND_BEGIN
NCV_SKIP_COND_BEGIN
ncvStat
=
ncv
FilterHypothes
es_host
(
h_vecSrc
,
numHypothesesSrc
,
this
->
minNeighbors
,
this
->
eps
,
NULL
);
ncvStat
=
ncv
GroupRectangl
es_host
(
h_vecSrc
,
numHypothesesSrc
,
this
->
minNeighbors
,
this
->
eps
,
NULL
);
ncvAssertReturn
(
ncvStat
==
NCV_SUCCESS
,
false
);
ncvAssertReturn
(
ncvStat
==
NCV_SUCCESS
,
false
);
NCV_SKIP_COND_END
NCV_SKIP_COND_END
...
...
modules/gpu/test/nvidia/TestResize.cpp
View file @
0c325cac
...
@@ -83,14 +83,14 @@ bool TestResize<T>::process()
...
@@ -83,14 +83,14 @@ bool TestResize<T>::process()
NCV_SKIP_COND_BEGIN
NCV_SKIP_COND_BEGIN
if
(
sizeof
(
T
)
==
sizeof
(
Ncv32u
))
if
(
sizeof
(
T
)
==
sizeof
(
Ncv32u
))
{
{
ncvStat
=
nppiStD
ownsampleNearest
_32u_C1R
((
Ncv32u
*
)
d_img
.
ptr
(),
d_img
.
pitch
(),
ncvStat
=
nppiStD
ecimate
_32u_C1R
((
Ncv32u
*
)
d_img
.
ptr
(),
d_img
.
pitch
(),
(
Ncv32u
*
)
d_small
.
ptr
(),
d_small
.
pitch
(),
(
Ncv32u
*
)
d_small
.
ptr
(),
d_small
.
pitch
(),
srcSize
,
this
->
scaleFactor
,
srcSize
,
this
->
scaleFactor
,
this
->
bTextureCache
);
this
->
bTextureCache
);
}
}
else
if
(
sizeof
(
T
)
==
sizeof
(
Ncv64u
))
else
if
(
sizeof
(
T
)
==
sizeof
(
Ncv64u
))
{
{
ncvStat
=
nppiStD
ownsampleNearest
_64u_C1R
((
Ncv64u
*
)
d_img
.
ptr
(),
d_img
.
pitch
(),
ncvStat
=
nppiStD
ecimate
_64u_C1R
((
Ncv64u
*
)
d_img
.
ptr
(),
d_img
.
pitch
(),
(
Ncv64u
*
)
d_small
.
ptr
(),
d_small
.
pitch
(),
(
Ncv64u
*
)
d_small
.
ptr
(),
d_small
.
pitch
(),
srcSize
,
this
->
scaleFactor
,
srcSize
,
this
->
scaleFactor
,
this
->
bTextureCache
);
this
->
bTextureCache
);
...
@@ -107,13 +107,13 @@ bool TestResize<T>::process()
...
@@ -107,13 +107,13 @@ bool TestResize<T>::process()
NCV_SKIP_COND_BEGIN
NCV_SKIP_COND_BEGIN
if
(
sizeof
(
T
)
==
sizeof
(
Ncv32u
))
if
(
sizeof
(
T
)
==
sizeof
(
Ncv32u
))
{
{
ncvStat
=
nppiStD
ownsampleNearest
_32u_C1R_host
((
Ncv32u
*
)
h_img
.
ptr
(),
h_img
.
pitch
(),
ncvStat
=
nppiStD
ecimate
_32u_C1R_host
((
Ncv32u
*
)
h_img
.
ptr
(),
h_img
.
pitch
(),
(
Ncv32u
*
)
h_small
.
ptr
(),
h_small
.
pitch
(),
(
Ncv32u
*
)
h_small
.
ptr
(),
h_small
.
pitch
(),
srcSize
,
this
->
scaleFactor
);
srcSize
,
this
->
scaleFactor
);
}
}
else
if
(
sizeof
(
T
)
==
sizeof
(
Ncv64u
))
else
if
(
sizeof
(
T
)
==
sizeof
(
Ncv64u
))
{
{
ncvStat
=
nppiStD
ownsampleNearest
_64u_C1R_host
((
Ncv64u
*
)
h_img
.
ptr
(),
h_img
.
pitch
(),
ncvStat
=
nppiStD
ecimate
_64u_C1R_host
((
Ncv64u
*
)
h_img
.
ptr
(),
h_img
.
pitch
(),
(
Ncv64u
*
)
h_small
.
ptr
(),
h_small
.
pitch
(),
(
Ncv64u
*
)
h_small
.
ptr
(),
h_small
.
pitch
(),
srcSize
,
this
->
scaleFactor
);
srcSize
,
this
->
scaleFactor
);
}
}
...
...
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