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
49e729f8
Commit
49e729f8
authored
Dec 01, 2013
by
Ilya Lavrenov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ability to use cv::PSNR with transparent cv::norm
parent
88bceb50
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
13 deletions
+15
-13
arithm.cpp
modules/core/src/arithm.cpp
+5
-2
mathfuncs.cpp
modules/core/src/mathfuncs.cpp
+2
-2
ocl.cpp
modules/core/src/ocl.cpp
+1
-1
stat.cpp
modules/core/src/stat.cpp
+3
-4
test_arithm.cpp
modules/core/test/ocl/test_arithm.cpp
+4
-4
No files found.
modules/core/src/arithm.cpp
View file @
49e729f8
...
...
@@ -929,7 +929,10 @@ static bool ocl_binary_op(InputArray _src1, InputArray _src2, OutputArray _dst,
int
srcdepth
=
CV_MAT_DEPTH
(
srctype
);
int
cn
=
CV_MAT_CN
(
srctype
);
if
(
oclop
<
0
||
((
haveMask
||
haveScalar
)
&&
(
cn
>
4
||
cn
==
3
))
)
bool
doubleSupport
=
ocl
::
Device
::
getDefault
().
doubleFPConfig
()
>
0
;
if
(
oclop
<
0
||
((
haveMask
||
haveScalar
)
&&
(
cn
>
4
||
cn
==
3
))
||
(
!
doubleSupport
&&
srcdepth
==
CV_64F
))
return
false
;
char
opts
[
1024
];
...
...
@@ -2626,7 +2629,7 @@ void cv::compare(InputArray _src1, InputArray _src2, OutputArray _dst, int op)
CV_Assert
(
op
==
CMP_LT
||
op
==
CMP_LE
||
op
==
CMP_EQ
||
op
==
CMP_NE
||
op
==
CMP_GE
||
op
==
CMP_GT
);
if
(
ocl
::
useOpenCL
()
&&
_dst
.
isUMat
()
&&
if
(
ocl
::
useOpenCL
()
&&
_
src1
.
dims
()
<=
2
&&
_src2
.
dims
()
<=
2
&&
_
dst
.
isUMat
()
&&
ocl_compare
(
_src1
,
_src2
,
_dst
,
op
))
return
;
...
...
modules/core/src/mathfuncs.cpp
View file @
49e729f8
...
...
@@ -687,7 +687,7 @@ static bool ocl_polarToCart( InputArray _mag, InputArray _angle,
int
type
=
_angle
.
type
(),
depth
=
CV_MAT_DEPTH
(
type
),
cn
=
CV_MAT_CN
(
type
);
bool
doubleSupport
=
ocl
::
Device
::
getDefault
().
doubleFPConfig
()
>
0
;
if
(
_mag
.
empty
()
||
(
!
doubleSupport
&&
depth
==
CV_64F
)
)
if
(
!
doubleSupport
&&
depth
==
CV_64F
)
return
false
;
UMat
mag
=
_mag
.
getUMat
(),
angle
=
_angle
.
getUMat
();
...
...
@@ -717,7 +717,7 @@ void polarToCart( InputArray src1, InputArray src2,
int
type
=
src2
.
type
(),
depth
=
CV_MAT_DEPTH
(
type
),
cn
=
CV_MAT_CN
(
type
);
CV_Assert
((
depth
==
CV_32F
||
depth
==
CV_64F
)
&&
(
src1
.
empty
()
||
src1
.
type
()
==
type
));
if
(
ocl
::
useOpenCL
()
&&
dst1
.
isUMat
()
&&
dst2
.
isUMat
()
&&
if
(
ocl
::
useOpenCL
()
&&
!
src1
.
empty
()
&&
src2
.
dims
()
<=
2
&&
dst1
.
isUMat
()
&&
dst2
.
isUMat
()
&&
ocl_polarToCart
(
src1
,
src2
,
dst1
,
dst2
,
angleInDegrees
))
return
;
...
...
modules/core/src/ocl.cpp
View file @
49e729f8
...
...
@@ -3145,7 +3145,7 @@ const char* memopTypeToStr(int t)
"ushort"
,
"ushort2"
,
"ushort3"
,
"ushort4"
,
"int"
,
"int2"
,
"int3"
,
"int4"
,
"int"
,
"int2"
,
"int3"
,
"int4"
,
"
long"
,
"long2"
,
"long3"
,
"long4
"
,
"
int2"
,
"int4"
,
"?"
,
"int8
"
,
"?"
,
"?"
,
"?"
,
"?"
};
int
cn
=
CV_MAT_CN
(
t
);
...
...
modules/core/src/stat.cpp
View file @
49e729f8
...
...
@@ -635,7 +635,7 @@ static bool ocl_countNonZero( InputArray _src, int & res )
size_t
globalsize
=
dbsize
*
wgs
;
if
(
k
.
run
(
1
,
&
globalsize
,
&
wgs
,
true
))
return
res
=
cv
::
sum
(
db
.
getMat
(
ACCESS_READ
))[
0
]
,
true
;
return
res
=
saturate_cast
<
int
>
(
cv
::
sum
(
db
.
getMat
(
ACCESS_READ
))[
0
])
,
true
;
return
false
;
}
...
...
@@ -2752,9 +2752,8 @@ void cv::findNonZero( InputArray _src, OutputArray _idx )
double
cv
::
PSNR
(
InputArray
_src1
,
InputArray
_src2
)
{
Mat
src1
=
_src1
.
getMat
(),
src2
=
_src2
.
getMat
();
CV_Assert
(
src1
.
depth
()
==
CV_8U
);
double
diff
=
std
::
sqrt
(
norm
(
src1
,
src2
,
NORM_L2SQR
)
/
(
src1
.
total
()
*
src1
.
channels
()));
CV_Assert
(
_src1
.
depth
()
==
CV_8U
);
double
diff
=
std
::
sqrt
(
norm
(
_src1
,
_src2
,
NORM_L2SQR
)
/
(
_src1
.
total
()
*
_src1
.
channels
()));
return
20
*
log10
(
255.
/
(
diff
+
DBL_EPSILON
));
}
...
...
modules/core/test/ocl/test_arithm.cpp
View file @
49e729f8
...
...
@@ -977,10 +977,10 @@ OCL_INSTANTIATE_TEST_CASE_P(Arithm, Absdiff, Combine(OCL_ALL_DEPTHS, OCL_ALL_CHA
OCL_INSTANTIATE_TEST_CASE_P
(
Arithm
,
CartToPolar
,
Combine
(
testing
::
Values
(
CV_32F
,
CV_64F
),
OCL_ALL_CHANNELS
,
Bool
()));
OCL_INSTANTIATE_TEST_CASE_P
(
Arithm
,
PolarToCart
,
Combine
(
testing
::
Values
(
CV_32F
,
CV_64F
),
OCL_ALL_CHANNELS
,
Bool
()));
OCL_INSTANTIATE_TEST_CASE_P
(
Arithm
,
Transpose
,
Combine
(
OCL_ALL_DEPTHS
,
OCL_ALL_CHANNELS
,
Bool
()));
OCL_INSTANTIATE_TEST_CASE_P
(
Arithm
,
Bitwise_and
,
Combine
(
OCL_ALL_DEPTHS
,
OCL_ALL_CHANNELS
,
Bool
()));
OCL_INSTANTIATE_TEST_CASE_P
(
Arithm
,
Bitwise_not
,
Combine
(
OCL_ALL_DEPTHS
,
OCL_ALL_CHANNELS
,
Bool
()));
OCL_INSTANTIATE_TEST_CASE_P
(
Arithm
,
Bitwise_xor
,
Combine
(
OCL_ALL_DEPTHS
,
OCL_ALL_CHANNELS
,
Bool
()));
OCL_INSTANTIATE_TEST_CASE_P
(
Arithm
,
Bitwise_or
,
Combine
(
OCL_ALL_DEPTHS
,
OCL_ALL_CHANNELS
,
Bool
()));
//
OCL_INSTANTIATE_TEST_CASE_P(Arithm, Bitwise_and, Combine(OCL_ALL_DEPTHS, OCL_ALL_CHANNELS, Bool()));
//
OCL_INSTANTIATE_TEST_CASE_P(Arithm, Bitwise_not, Combine(OCL_ALL_DEPTHS, OCL_ALL_CHANNELS, Bool()));
//
OCL_INSTANTIATE_TEST_CASE_P(Arithm, Bitwise_xor, Combine(OCL_ALL_DEPTHS, OCL_ALL_CHANNELS, Bool()));
//
OCL_INSTANTIATE_TEST_CASE_P(Arithm, Bitwise_or, Combine(OCL_ALL_DEPTHS, OCL_ALL_CHANNELS, Bool()));
OCL_INSTANTIATE_TEST_CASE_P
(
Arithm
,
Pow
,
Combine
(
testing
::
Values
(
CV_32F
,
CV_64F
),
OCL_ALL_CHANNELS
,
Bool
()));
OCL_INSTANTIATE_TEST_CASE_P
(
Arithm
,
Compare
,
Combine
(
OCL_ALL_DEPTHS
,
OCL_ALL_CHANNELS
,
Bool
()));
OCL_INSTANTIATE_TEST_CASE_P
(
Arithm
,
AddWeighted
,
Combine
(
OCL_ALL_DEPTHS
,
OCL_ALL_CHANNELS
,
Bool
()));
...
...
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