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
678f3925
Commit
678f3925
authored
Nov 29, 2010
by
Alexey Spizhevoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added is_signed into numeric_limits_gpu, fixed incorrect min max finding for floating values
parent
6ad158db
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
49 deletions
+61
-49
arithm.cpp
modules/gpu/src/arithm.cpp
+16
-16
limits_gpu.hpp
modules/gpu/src/cuda/limits_gpu.hpp
+12
-0
mathfunc.cu
modules/gpu/src/cuda/mathfunc.cu
+26
-26
arithm.cpp
tests/gpu/src/arithm.cpp
+7
-7
No files found.
modules/gpu/src/arithm.cpp
View file @
678f3925
...
...
@@ -524,20 +524,20 @@ void cv::gpu::minMax(const GpuMat& src, double* minVal, double* maxVal, const Gp
typedef
void
(
*
Caller
)(
const
DevMem2D
,
double
*
,
double
*
,
PtrStep
);
static
const
Caller
callers
[
2
][
7
]
=
{
{
min_max_multipass_caller
<
unsigned
char
>
,
min_max_multipass_caller
<
signed
char
>
,
min_max_multipass_caller
<
unsigned
short
>
,
min_max_multipass_caller
<
s
igned
s
hort
>
,
{
{
min_max_multipass_caller
<
unsigned
char
>
,
min_max_multipass_caller
<
char
>
,
min_max_multipass_caller
<
unsigned
short
>
,
min_max_multipass_caller
<
short
>
,
min_max_multipass_caller
<
int
>
,
min_max_multipass_caller
<
float
>
,
0
},
{
min_max_caller
<
unsigned
char
>
,
min_max_caller
<
signed
char
>
,
min_max_caller
<
unsigned
short
>
,
min_max_caller
<
s
igned
s
hort
>
,
{
min_max_caller
<
unsigned
char
>
,
min_max_caller
<
char
>
,
min_max_caller
<
unsigned
short
>
,
min_max_caller
<
short
>
,
min_max_caller
<
int
>
,
min_max_caller
<
float
>
,
min_max_caller
<
double
>
}
};
typedef
void
(
*
MaskedCaller
)(
const
DevMem2D
,
const
PtrStep
,
double
*
,
double
*
,
PtrStep
);
static
const
MaskedCaller
masked_callers
[
2
][
7
]
=
{
{
min_max_mask_multipass_caller
<
unsigned
char
>
,
min_max_mask_multipass_caller
<
signed
char
>
,
min_max_mask_multipass_caller
<
unsigned
short
>
,
min_max_mask_multipass_caller
<
s
igned
s
hort
>
,
{
{
min_max_mask_multipass_caller
<
unsigned
char
>
,
min_max_mask_multipass_caller
<
char
>
,
min_max_mask_multipass_caller
<
unsigned
short
>
,
min_max_mask_multipass_caller
<
short
>
,
min_max_mask_multipass_caller
<
int
>
,
min_max_mask_multipass_caller
<
float
>
,
0
},
{
min_max_mask_caller
<
unsigned
char
>
,
min_max_mask_caller
<
signed
char
>
,
min_max_mask_caller
<
unsigned
short
>
,
min_max_mask_caller
<
s
igned
s
hort
>
,
{
min_max_mask_caller
<
unsigned
char
>
,
min_max_mask_caller
<
char
>
,
min_max_mask_caller
<
unsigned
short
>
,
min_max_mask_caller
<
short
>
,
min_max_mask_caller
<
int
>
,
min_max_mask_caller
<
float
>
,
min_max_mask_caller
<
double
>
}
};
...
...
@@ -615,9 +615,9 @@ void cv::gpu::minMaxLoc(const GpuMat& src, double* minVal, double* maxVal, Point
switch
(
src
.
type
())
{
case
CV_8U
:
min_max_loc_caller
<
unsigned
char
>
(
src
,
minVal
,
maxVal
,
minLoc_
,
maxLoc_
,
valbuf
,
locbuf
);
break
;
case
CV_8S
:
min_max_loc_caller
<
signed
char
>
(
src
,
minVal
,
maxVal
,
minLoc_
,
maxLoc_
,
valbuf
,
locbuf
);
break
;
case
CV_8S
:
min_max_loc_caller
<
char
>
(
src
,
minVal
,
maxVal
,
minLoc_
,
maxLoc_
,
valbuf
,
locbuf
);
break
;
case
CV_16U
:
min_max_loc_caller
<
unsigned
short
>
(
src
,
minVal
,
maxVal
,
minLoc_
,
maxLoc_
,
valbuf
,
locbuf
);
break
;
case
CV_16S
:
min_max_loc_caller
<
s
igned
s
hort
>
(
src
,
minVal
,
maxVal
,
minLoc_
,
maxLoc_
,
valbuf
,
locbuf
);
break
;
case
CV_16S
:
min_max_loc_caller
<
short
>
(
src
,
minVal
,
maxVal
,
minLoc_
,
maxLoc_
,
valbuf
,
locbuf
);
break
;
case
CV_32S
:
min_max_loc_caller
<
int
>
(
src
,
minVal
,
maxVal
,
minLoc_
,
maxLoc_
,
valbuf
,
locbuf
);
break
;
case
CV_32F
:
min_max_loc_caller
<
float
>
(
src
,
minVal
,
maxVal
,
minLoc_
,
maxLoc_
,
valbuf
,
locbuf
);
break
;
case
CV_64F
:
...
...
@@ -634,9 +634,9 @@ void cv::gpu::minMaxLoc(const GpuMat& src, double* minVal, double* maxVal, Point
switch
(
src
.
type
())
{
case
CV_8U
:
min_max_loc_multipass_caller
<
unsigned
char
>
(
src
,
minVal
,
maxVal
,
minLoc_
,
maxLoc_
,
valbuf
,
locbuf
);
break
;
case
CV_8S
:
min_max_loc_multipass_caller
<
signed
char
>
(
src
,
minVal
,
maxVal
,
minLoc_
,
maxLoc_
,
valbuf
,
locbuf
);
break
;
case
CV_8S
:
min_max_loc_multipass_caller
<
char
>
(
src
,
minVal
,
maxVal
,
minLoc_
,
maxLoc_
,
valbuf
,
locbuf
);
break
;
case
CV_16U
:
min_max_loc_multipass_caller
<
unsigned
short
>
(
src
,
minVal
,
maxVal
,
minLoc_
,
maxLoc_
,
valbuf
,
locbuf
);
break
;
case
CV_16S
:
min_max_loc_multipass_caller
<
s
igned
s
hort
>
(
src
,
minVal
,
maxVal
,
minLoc_
,
maxLoc_
,
valbuf
,
locbuf
);
break
;
case
CV_16S
:
min_max_loc_multipass_caller
<
short
>
(
src
,
minVal
,
maxVal
,
minLoc_
,
maxLoc_
,
valbuf
,
locbuf
);
break
;
case
CV_32S
:
min_max_loc_multipass_caller
<
int
>
(
src
,
minVal
,
maxVal
,
minLoc_
,
maxLoc_
,
valbuf
,
locbuf
);
break
;
case
CV_32F
:
min_max_loc_multipass_caller
<
float
>
(
src
,
minVal
,
maxVal
,
minLoc_
,
maxLoc_
,
valbuf
,
locbuf
);
break
;
default
:
CV_Error
(
CV_StsBadArg
,
"minMaxLoc: unsupported type"
);
...
...
@@ -683,9 +683,9 @@ int cv::gpu::countNonZero(const GpuMat& src, GpuMat& buf)
switch
(
src
.
type
())
{
case
CV_8U
:
return
count_non_zero_caller
<
unsigned
char
>
(
src
,
buf
);
case
CV_8S
:
return
count_non_zero_caller
<
signed
char
>
(
src
,
buf
);
case
CV_8S
:
return
count_non_zero_caller
<
char
>
(
src
,
buf
);
case
CV_16U
:
return
count_non_zero_caller
<
unsigned
short
>
(
src
,
buf
);
case
CV_16S
:
return
count_non_zero_caller
<
s
igned
s
hort
>
(
src
,
buf
);
case
CV_16S
:
return
count_non_zero_caller
<
short
>
(
src
,
buf
);
case
CV_32S
:
return
count_non_zero_caller
<
int
>
(
src
,
buf
);
case
CV_32F
:
return
count_non_zero_caller
<
float
>
(
src
,
buf
);
case
CV_64F
:
...
...
@@ -698,9 +698,9 @@ int cv::gpu::countNonZero(const GpuMat& src, GpuMat& buf)
switch
(
src
.
type
())
{
case
CV_8U
:
return
count_non_zero_multipass_caller
<
unsigned
char
>
(
src
,
buf
);
case
CV_8S
:
return
count_non_zero_multipass_caller
<
signed
char
>
(
src
,
buf
);
case
CV_8S
:
return
count_non_zero_multipass_caller
<
char
>
(
src
,
buf
);
case
CV_16U
:
return
count_non_zero_multipass_caller
<
unsigned
short
>
(
src
,
buf
);
case
CV_16S
:
return
count_non_zero_multipass_caller
<
s
igned
s
hort
>
(
src
,
buf
);
case
CV_16S
:
return
count_non_zero_multipass_caller
<
short
>
(
src
,
buf
);
case
CV_32S
:
return
count_non_zero_multipass_caller
<
int
>
(
src
,
buf
);
case
CV_32F
:
return
count_non_zero_multipass_caller
<
float
>
(
src
,
buf
);
}
...
...
modules/gpu/src/cuda/limits_gpu.hpp
View file @
678f3925
...
...
@@ -58,6 +58,7 @@ namespace cv
__device__
static
type
infinity
()
{
return
type
();
}
__device__
static
type
quiet_NaN
()
{
return
type
();
}
__device__
static
type
signaling_NaN
()
{
return
T
();
}
static
const
bool
is_signed
;
};
template
<>
struct
numeric_limits_gpu
<
bool
>
...
...
@@ -71,6 +72,7 @@ namespace cv
__device__
static
type
infinity
();
__device__
static
type
quiet_NaN
();
__device__
static
type
signaling_NaN
();
static
const
bool
is_signed
=
false
;
};
template
<>
struct
numeric_limits_gpu
<
char
>
...
...
@@ -84,6 +86,7 @@ namespace cv
__device__
static
type
infinity
();
__device__
static
type
quiet_NaN
();
__device__
static
type
signaling_NaN
();
static
const
bool
is_signed
=
(
char
)
-
1
==
-
1
;
};
template
<>
struct
numeric_limits_gpu
<
unsigned
char
>
...
...
@@ -97,6 +100,7 @@ namespace cv
__device__
static
type
infinity
();
__device__
static
type
quiet_NaN
();
__device__
static
type
signaling_NaN
();
static
const
bool
is_signed
=
false
;
};
template
<>
struct
numeric_limits_gpu
<
short
>
...
...
@@ -110,6 +114,7 @@ namespace cv
__device__
static
type
infinity
();
__device__
static
type
quiet_NaN
();
__device__
static
type
signaling_NaN
();
static
const
bool
is_signed
=
true
;
};
template
<>
struct
numeric_limits_gpu
<
unsigned
short
>
...
...
@@ -123,6 +128,7 @@ namespace cv
__device__
static
type
infinity
();
__device__
static
type
quiet_NaN
();
__device__
static
type
signaling_NaN
();
static
const
bool
is_signed
=
false
;
};
template
<>
struct
numeric_limits_gpu
<
int
>
...
...
@@ -136,6 +142,7 @@ namespace cv
__device__
static
type
infinity
();
__device__
static
type
quiet_NaN
();
__device__
static
type
signaling_NaN
();
static
const
bool
is_signed
=
true
;
};
...
...
@@ -150,6 +157,7 @@ namespace cv
__device__
static
type
infinity
();
__device__
static
type
quiet_NaN
();
__device__
static
type
signaling_NaN
();
static
const
bool
is_signed
=
false
;
};
template
<>
struct
numeric_limits_gpu
<
long
>
...
...
@@ -163,6 +171,7 @@ namespace cv
__device__
static
type
infinity
();
__device__
static
type
quiet_NaN
();
__device__
static
type
signaling_NaN
();
static
const
bool
is_signed
=
true
;
};
template
<>
struct
numeric_limits_gpu
<
unsigned
long
>
...
...
@@ -176,6 +185,7 @@ namespace cv
__device__
static
type
infinity
();
__device__
static
type
quiet_NaN
();
__device__
static
type
signaling_NaN
();
static
const
bool
is_signed
=
false
;
};
template
<>
struct
numeric_limits_gpu
<
float
>
...
...
@@ -189,6 +199,7 @@ namespace cv
__device__
static
type
infinity
();
__device__
static
type
quiet_NaN
();
__device__
static
type
signaling_NaN
();
static
const
bool
is_signed
=
true
;
};
template
<>
struct
numeric_limits_gpu
<
double
>
...
...
@@ -202,6 +213,7 @@ namespace cv
__device__
static
type
infinity
();
__device__
static
type
quiet_NaN
();
__device__
static
type
signaling_NaN
();
static
const
bool
is_signed
=
true
;
};
}
}
...
...
modules/gpu/src/cuda/mathfunc.cu
View file @
678f3925
...
...
@@ -405,9 +405,9 @@ namespace cv { namespace gpu { namespace mathfunc
// appropriate type (32 bits minimum)
template <typename T> struct MinMaxTypeTraits {};
template <> struct MinMaxTypeTraits<unsigned char> { typedef int best_type; };
template <> struct MinMaxTypeTraits<
signed
char> { typedef int best_type; };
template <> struct MinMaxTypeTraits<char> { typedef int best_type; };
template <> struct MinMaxTypeTraits<unsigned short> { typedef int best_type; };
template <> struct MinMaxTypeTraits<s
igned s
hort> { typedef int best_type; };
template <> struct MinMaxTypeTraits<short> { typedef int best_type; };
template <> struct MinMaxTypeTraits<int> { typedef int best_type; };
template <> struct MinMaxTypeTraits<float> { typedef float best_type; };
template <> struct MinMaxTypeTraits<double> { typedef double best_type; };
...
...
@@ -492,7 +492,7 @@ namespace cv { namespace gpu { namespace mathfunc
unsigned int tid = threadIdx.y * blockDim.x + threadIdx.x;
T mymin = numeric_limits_gpu<T>::max();
T mymax = numeric_limits_gpu<T>::min();
T mymax = numeric_limits_gpu<T>::
is_signed ? -numeric_limits_gpu<T>::max() : numeric_limits_gpu<T>::
min();
unsigned int y_end = min(y0 + (ctheight - 1) * blockDim.y + 1, src.rows);
unsigned int x_end = min(x0 + (ctwidth - 1) * blockDim.x + 1, src.cols);
for (unsigned int y = y0; y < y_end; y += blockDim.y)
...
...
@@ -584,9 +584,9 @@ namespace cv { namespace gpu { namespace mathfunc
}
template void min_max_mask_caller<unsigned char>(const DevMem2D, const PtrStep, double*, double*, PtrStep);
template void min_max_mask_caller<
signed
char>(const DevMem2D, const PtrStep, double*, double*, PtrStep);
template void min_max_mask_caller<char>(const DevMem2D, const PtrStep, double*, double*, PtrStep);
template void min_max_mask_caller<unsigned short>(const DevMem2D, const PtrStep, double*, double*, PtrStep);
template void min_max_mask_caller<s
igned s
hort>(const DevMem2D, const PtrStep, double*, double*, PtrStep);
template void min_max_mask_caller<short>(const DevMem2D, const PtrStep, double*, double*, PtrStep);
template void min_max_mask_caller<int>(const DevMem2D, const PtrStep, double*, double*, PtrStep);
template void min_max_mask_caller<float>(const DevMem2D, const PtrStep, double*, double*, PtrStep);
template void min_max_mask_caller<double>(const DevMem2D, const PtrStep, double*, double*, PtrStep);
...
...
@@ -613,9 +613,9 @@ namespace cv { namespace gpu { namespace mathfunc
}
template void min_max_caller<unsigned char>(const DevMem2D, double*, double*, PtrStep);
template void min_max_caller<
signed
char>(const DevMem2D, double*, double*, PtrStep);
template void min_max_caller<char>(const DevMem2D, double*, double*, PtrStep);
template void min_max_caller<unsigned short>(const DevMem2D, double*, double*, PtrStep);
template void min_max_caller<s
igned s
hort>(const DevMem2D, double*, double*, PtrStep);
template void min_max_caller<short>(const DevMem2D, double*, double*, PtrStep);
template void min_max_caller<int>(const DevMem2D, double*, double*, PtrStep);
template void min_max_caller<float>(const DevMem2D, double*,double*, PtrStep);
template void min_max_caller<double>(const DevMem2D, double*, double*, PtrStep);
...
...
@@ -668,9 +668,9 @@ namespace cv { namespace gpu { namespace mathfunc
}
template void min_max_mask_multipass_caller<unsigned char>(const DevMem2D, const PtrStep, double*, double*, PtrStep);
template void min_max_mask_multipass_caller<
signed
char>(const DevMem2D, const PtrStep, double*, double*, PtrStep);
template void min_max_mask_multipass_caller<char>(const DevMem2D, const PtrStep, double*, double*, PtrStep);
template void min_max_mask_multipass_caller<unsigned short>(const DevMem2D, const PtrStep, double*, double*, PtrStep);
template void min_max_mask_multipass_caller<s
igned s
hort>(const DevMem2D, const PtrStep, double*, double*, PtrStep);
template void min_max_mask_multipass_caller<short>(const DevMem2D, const PtrStep, double*, double*, PtrStep);
template void min_max_mask_multipass_caller<int>(const DevMem2D, const PtrStep, double*, double*, PtrStep);
template void min_max_mask_multipass_caller<float>(const DevMem2D, const PtrStep, double*, double*, PtrStep);
...
...
@@ -697,9 +697,9 @@ namespace cv { namespace gpu { namespace mathfunc
}
template void min_max_multipass_caller<unsigned char>(const DevMem2D, double*, double*, PtrStep);
template void min_max_multipass_caller<
signed
char>(const DevMem2D, double*, double*, PtrStep);
template void min_max_multipass_caller<char>(const DevMem2D, double*, double*, PtrStep);
template void min_max_multipass_caller<unsigned short>(const DevMem2D, double*, double*, PtrStep);
template void min_max_multipass_caller<s
igned s
hort>(const DevMem2D, double*, double*, PtrStep);
template void min_max_multipass_caller<short>(const DevMem2D, double*, double*, PtrStep);
template void min_max_multipass_caller<int>(const DevMem2D, double*, double*, PtrStep);
template void min_max_multipass_caller<float>(const DevMem2D, double*, double*, PtrStep);
...
...
@@ -802,10 +802,10 @@ namespace cv { namespace gpu { namespace mathfunc
unsigned int y0 = blockIdx.y * blockDim.y * ctheight + threadIdx.y;
unsigned int tid = threadIdx.y * blockDim.x + threadIdx.x;
T
val = ((const T*)src.ptr(0))[0]
;
T mym
in = val, mymax = val
;
unsigned int myminloc = 0
, mymaxloc = 0
;
T
mymin = numeric_limits_gpu<T>::max()
;
T mym
ax = numeric_limits_gpu<T>::is_signed ? -numeric_limits_gpu<T>::max() : numeric_limits_gpu<T>::min()
;
unsigned int myminloc = 0;
unsigned int mymaxloc = 0;
unsigned int y_end = min(y0 + (ctheight - 1) * blockDim.y + 1, src.rows);
unsigned int x_end = min(x0 + (ctwidth - 1) * blockDim.x + 1, src.cols);
...
...
@@ -814,13 +814,13 @@ namespace cv { namespace gpu { namespace mathfunc
const T* ptr = (const T*)src.ptr(y);
for (unsigned int x = x0; x < x_end; x += blockDim.x)
{
val = ptr[x];
if (val < mymin)
T
val = ptr[x];
if (val <
=
mymin)
{
mymin = val;
myminloc = y * src.cols + x;
}
else if (val >
mymax)
if (val >=
mymax)
{
mymax = val;
mymaxloc = y * src.cols + x;
...
...
@@ -916,9 +916,9 @@ namespace cv { namespace gpu { namespace mathfunc
}
template void min_max_loc_caller<unsigned char>(const DevMem2D, double*, double*, int[2], int[2], PtrStep, PtrStep);
template void min_max_loc_caller<
signed
char>(const DevMem2D, double*, double*, int[2], int[2], PtrStep, PtrStep);
template void min_max_loc_caller<char>(const DevMem2D, double*, double*, int[2], int[2], PtrStep, PtrStep);
template void min_max_loc_caller<unsigned short>(const DevMem2D, double*, double*, int[2], int[2], PtrStep, PtrStep);
template void min_max_loc_caller<s
igned s
hort>(const DevMem2D, double*, double*, int[2], int[2], PtrStep, PtrStep);
template void min_max_loc_caller<short>(const DevMem2D, double*, double*, int[2], int[2], PtrStep, PtrStep);
template void min_max_loc_caller<int>(const DevMem2D, double*, double*, int[2], int[2], PtrStep, PtrStep);
template void min_max_loc_caller<float>(const DevMem2D, double*, double*, int[2], int[2], PtrStep, PtrStep);
template void min_max_loc_caller<double>(const DevMem2D, double*, double*, int[2], int[2], PtrStep, PtrStep);
...
...
@@ -987,9 +987,9 @@ namespace cv { namespace gpu { namespace mathfunc
}
template void min_max_loc_multipass_caller<unsigned char>(const DevMem2D, double*, double*, int[2], int[2], PtrStep, PtrStep);
template void min_max_loc_multipass_caller<
signed
char>(const DevMem2D, double*, double*, int[2], int[2], PtrStep, PtrStep);
template void min_max_loc_multipass_caller<char>(const DevMem2D, double*, double*, int[2], int[2], PtrStep, PtrStep);
template void min_max_loc_multipass_caller<unsigned short>(const DevMem2D, double*, double*, int[2], int[2], PtrStep, PtrStep);
template void min_max_loc_multipass_caller<s
igned s
hort>(const DevMem2D, double*, double*, int[2], int[2], PtrStep, PtrStep);
template void min_max_loc_multipass_caller<short>(const DevMem2D, double*, double*, int[2], int[2], PtrStep, PtrStep);
template void min_max_loc_multipass_caller<int>(const DevMem2D, double*, double*, int[2], int[2], PtrStep, PtrStep);
template void min_max_loc_multipass_caller<float>(const DevMem2D, double*, double*, int[2], int[2], PtrStep, PtrStep);
...
...
@@ -1126,9 +1126,9 @@ namespace cv { namespace gpu { namespace mathfunc
}
template int count_non_zero_caller<unsigned char>(const DevMem2D, PtrStep);
template int count_non_zero_caller<
signed
char>(const DevMem2D, PtrStep);
template int count_non_zero_caller<char>(const DevMem2D, PtrStep);
template int count_non_zero_caller<unsigned short>(const DevMem2D, PtrStep);
template int count_non_zero_caller<s
igned s
hort>(const DevMem2D, PtrStep);
template int count_non_zero_caller<short>(const DevMem2D, PtrStep);
template int count_non_zero_caller<int>(const DevMem2D, PtrStep);
template int count_non_zero_caller<float>(const DevMem2D, PtrStep);
template int count_non_zero_caller<double>(const DevMem2D, PtrStep);
...
...
@@ -1171,9 +1171,9 @@ namespace cv { namespace gpu { namespace mathfunc
}
template int count_non_zero_multipass_caller<unsigned char>(const DevMem2D, PtrStep);
template int count_non_zero_multipass_caller<
signed
char>(const DevMem2D, PtrStep);
template int count_non_zero_multipass_caller<char>(const DevMem2D, PtrStep);
template int count_non_zero_multipass_caller<unsigned short>(const DevMem2D, PtrStep);
template int count_non_zero_multipass_caller<s
igned s
hort>(const DevMem2D, PtrStep);
template int count_non_zero_multipass_caller<short>(const DevMem2D, PtrStep);
template int count_non_zero_multipass_caller<int>(const DevMem2D, PtrStep);
template int count_non_zero_multipass_caller<float>(const DevMem2D, PtrStep);
...
...
tests/gpu/src/arithm.cpp
View file @
678f3925
...
...
@@ -701,7 +701,7 @@ struct CV_GpuMinMaxTest: public CvTest
for
(
int
i
=
0
;
i
<
src
.
rows
;
++
i
)
{
Mat
row
(
1
,
src
.
cols
*
src
.
elemSize
(),
CV_8U
,
src
.
ptr
(
i
));
rng
.
fill
(
row
,
RNG
::
UNIFORM
,
Scalar
(
0
),
Scalar
(
25
5
));
rng
.
fill
(
row
,
RNG
::
UNIFORM
,
Scalar
(
0
),
Scalar
(
25
6
));
}
double
minVal
,
maxVal
;
...
...
@@ -714,7 +714,7 @@ struct CV_GpuMinMaxTest: public CvTest
else
{
minVal
=
std
::
numeric_limits
<
double
>::
max
();
maxVal
=
std
::
numeric_limits
<
double
>::
min
();
maxVal
=
-
std
::
numeric_limits
<
double
>::
max
();
for
(
int
i
=
0
;
i
<
src
.
rows
;
++
i
)
for
(
int
j
=
0
;
j
<
src
.
cols
;
++
j
)
{
...
...
@@ -747,7 +747,7 @@ struct CV_GpuMinMaxTest: public CvTest
for
(
int
i
=
0
;
i
<
src
.
rows
;
++
i
)
{
Mat
row
(
1
,
src
.
cols
*
src
.
elemSize
(),
CV_8U
,
src
.
ptr
(
i
));
rng
.
fill
(
row
,
RNG
::
UNIFORM
,
Scalar
(
0
),
Scalar
(
25
5
));
rng
.
fill
(
row
,
RNG
::
UNIFORM
,
Scalar
(
0
),
Scalar
(
25
6
));
}
cv
::
Mat
mask
(
src
.
size
(),
CV_8U
);
...
...
@@ -765,7 +765,7 @@ struct CV_GpuMinMaxTest: public CvTest
{
// OpenCV's minMaxLoc doesn't support CV_8S type
minVal
=
std
::
numeric_limits
<
double
>::
max
();
maxVal
=
std
::
numeric_limits
<
double
>::
min
();
maxVal
=
-
std
::
numeric_limits
<
double
>::
max
();
for
(
int
i
=
0
;
i
<
src_
.
rows
;
++
i
)
for
(
int
j
=
0
;
j
<
src_
.
cols
;
++
j
)
{
...
...
@@ -826,7 +826,7 @@ struct CV_GpuMinMaxLocTest: public CvTest
for
(
int
i
=
0
;
i
<
src
.
rows
;
++
i
)
{
Mat
row
(
1
,
src
.
cols
*
src
.
elemSize
(),
CV_8U
,
src
.
ptr
(
i
));
rng
.
fill
(
row
,
RNG
::
UNIFORM
,
Scalar
(
0
),
Scalar
(
25
5
));
rng
.
fill
(
row
,
RNG
::
UNIFORM
,
Scalar
(
0
),
Scalar
(
25
6
));
}
double
minVal
,
maxVal
;
...
...
@@ -838,7 +838,7 @@ struct CV_GpuMinMaxLocTest: public CvTest
{
// OpenCV's minMaxLoc doesn't support CV_8S type
minVal
=
std
::
numeric_limits
<
double
>::
max
();
maxVal
=
std
::
numeric_limits
<
double
>::
min
();
maxVal
=
-
std
::
numeric_limits
<
double
>::
max
();
for
(
int
i
=
0
;
i
<
src
.
rows
;
++
i
)
for
(
int
j
=
0
;
j
<
src
.
cols
;
++
j
)
{
...
...
@@ -895,7 +895,7 @@ struct CV_GpuCountNonZeroTest: CvTest
for
(
int
i
=
0
;
i
<
src
.
rows
;
++
i
)
{
Mat
row
(
1
,
src
.
cols
*
src
.
elemSize
(),
CV_8U
,
src
.
ptr
(
i
));
rng
.
fill
(
row
,
RNG
::
UNIFORM
,
Scalar
(
0
),
Scalar
(
25
5
));
rng
.
fill
(
row
,
RNG
::
UNIFORM
,
Scalar
(
0
),
Scalar
(
25
6
));
}
int
n_gold
=
cv
::
countNonZero
(
src
);
...
...
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