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
9613135e
Commit
9613135e
authored
Feb 16, 2013
by
yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix compiling errors on Linux
more operators use oclMatExpr
parent
69fd2d82
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
36 deletions
+42
-36
matrix_operations.hpp
modules/ocl/include/opencv2/ocl/matrix_operations.hpp
+12
-6
ocl.hpp
modules/ocl/include/opencv2/ocl/ocl.hpp
+6
-6
arithm.cpp
modules/ocl/src/arithm.cpp
+24
-24
No files found.
modules/ocl/include/opencv2/ocl/matrix_operations.hpp
View file @
9613135e
...
...
@@ -12,6 +12,7 @@
//
// Copyright (C) 2010-2012, Institute Of Software Chinese Academy Of Science, all rights reserved.
// Copyright (C) 2010-2012, Advanced Micro Devices, Inc., all rights reserved.
// Copyright (C) 2010-2012, Multicoreware, 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,
...
...
@@ -51,23 +52,28 @@ namespace cv
enum
{
MAT_ADD
,
MAT_ADD
=
1
,
MAT_SUB
,
MAT_MUL
,
MAT_DIV
MAT_DIV
,
MAT_NOT
,
MAT_AND
,
MAT_OR
,
MAT_XOR
};
class
oclMatExpr
class
CV_EXPORTS
oclMatExpr
{
public
:
oclMatExpr
()
:
a
(
oclMat
()),
b
(
oclMat
()),
op
(
0
)
{}
oclMatExpr
(
const
oclMat
&
_a
,
const
oclMat
&
_b
,
int
_op
)
:
a
(
_a
),
b
(
_b
),
op
(
_op
){}
:
a
(
_a
),
b
(
_b
),
op
(
_op
)
{}
operator
oclMat
()
const
;
void
assign
(
oclMat
&
m
)
const
;
protected
:
int
op
;
oclMat
a
,
b
;
int
op
;
};
////////////////////////////////////////////////////////////////////////
//////////////////////////////// oclMat ////////////////////////////////
...
...
@@ -255,7 +261,7 @@ namespace cv
return
*
this
;
}
oclMat
&
oclMat
::
operator
=
(
const
oclMatExpr
&
expr
)
inline
oclMat
&
oclMat
::
operator
=
(
const
oclMatExpr
&
expr
)
{
expr
.
assign
(
*
this
);
return
*
this
;
...
...
modules/ocl/include/opencv2/ocl/ocl.hpp
View file @
9613135e
...
...
@@ -153,7 +153,7 @@ namespace cv
oclMat
&
operator
=
(
const
oclMat
&
m
);
//! assignment operator. Perfom blocking upload to device.
oclMat
&
operator
=
(
const
Mat
&
m
);
oclMat
&
operator
=
(
const
oclMatExpr
&
expr
);
oclMat
&
operator
=
(
const
oclMatExpr
&
expr
);
//! pefroms blocking upload data to oclMat.
void
upload
(
const
cv
::
Mat
&
m
);
...
...
@@ -463,10 +463,10 @@ namespace cv
CV_EXPORTS
void
bitwise_xor
(
const
oclMat
&
src1
,
const
Scalar
&
s
,
oclMat
&
dst
,
const
oclMat
&
mask
=
oclMat
());
//! Logical operators
CV_EXPORTS
oclMat
operator
~
(
const
oclMat
&
src
);
CV_EXPORTS
oclMat
operator
|
(
const
oclMat
&
src1
,
const
oclMat
&
src2
);
CV_EXPORTS
oclMat
operator
&
(
const
oclMat
&
src1
,
const
oclMat
&
src2
);
CV_EXPORTS
oclMat
operator
^
(
const
oclMat
&
src1
,
const
oclMat
&
src2
);
CV_EXPORTS
oclMat
Expr
operator
~
(
const
oclMat
&
src
);
CV_EXPORTS
oclMat
Expr
operator
|
(
const
oclMat
&
src1
,
const
oclMat
&
src2
);
CV_EXPORTS
oclMat
Expr
operator
&
(
const
oclMat
&
src1
,
const
oclMat
&
src2
);
CV_EXPORTS
oclMat
Expr
operator
^
(
const
oclMat
&
src1
,
const
oclMat
&
src2
);
//! Mathematics operators
CV_EXPORTS
oclMatExpr
operator
+
(
const
oclMat
&
src1
,
const
oclMat
&
src2
);
...
...
@@ -478,7 +478,7 @@ namespace cv
//! support only CV_32FC1 type
CV_EXPORTS
void
convolve
(
const
oclMat
&
image
,
const
oclMat
&
temp1
,
oclMat
&
result
);
CV_EXPORTS
void
cvtColor
(
const
oclMat
&
src
,
oclMat
&
dst
,
int
code
,
int
dcn
=
0
);
CV_EXPORTS
void
cvtColor
(
const
oclMat
&
src
,
oclMat
&
dst
,
int
code
,
int
dcn
=
0
);
//////////////////////////////// Filter Engine ////////////////////////////////
...
...
modules/ocl/src/arithm.cpp
View file @
9613135e
...
...
@@ -2125,56 +2125,44 @@ void cv::ocl::bitwise_xor(const oclMat &src1, const Scalar &src2, oclMat &dst, c
bitwise_scalar
(
src1
,
src2
,
dst
,
mask
,
kernelName
,
&
arithm_bitwise_xor_scalar
);
}
cv
::
ocl
::
oclMat
cv
::
ocl
::
operator
~
(
const
oclMat
&
src
)
oclMatExpr
cv
::
ocl
::
operator
~
(
const
oclMat
&
src
)
{
oclMat
dst
;
bitwise_not
(
src
,
dst
);
return
dst
;
return
oclMatExpr
(
src
,
oclMat
(),
MAT_NOT
);
}
cv
::
ocl
::
oclMat
cv
::
ocl
::
operator
|
(
const
oclMat
&
src1
,
const
oclMat
&
src2
)
oclMatExpr
cv
::
ocl
::
operator
|
(
const
oclMat
&
src1
,
const
oclMat
&
src2
)
{
oclMat
dst
;
bitwise_or
(
src1
,
src2
,
dst
);
return
dst
;
return
oclMatExpr
(
src1
,
src2
,
MAT_OR
);
}
cv
::
ocl
::
oclMat
cv
::
ocl
::
operator
&
(
const
oclMat
&
src1
,
const
oclMat
&
src2
)
oclMatExpr
cv
::
ocl
::
operator
&
(
const
oclMat
&
src1
,
const
oclMat
&
src2
)
{
oclMat
dst
;
bitwise_and
(
src1
,
src2
,
dst
);
return
dst
;
return
oclMatExpr
(
src1
,
src2
,
MAT_AND
);
}
cv
::
ocl
::
oclMat
cv
::
ocl
::
operator
^
(
const
oclMat
&
src1
,
const
oclMat
&
src2
)
oclMatExpr
cv
::
ocl
::
operator
^
(
const
oclMat
&
src1
,
const
oclMat
&
src2
)
{
oclMat
dst
;
bitwise_xor
(
src1
,
src2
,
dst
);
return
dst
;
return
oclMatExpr
(
src1
,
src2
,
MAT_XOR
);
}
cv
::
ocl
::
oclMatExpr
cv
::
ocl
::
operator
+
(
const
oclMat
&
src1
,
const
oclMat
&
src2
)
{
oclMatExpr
dst
(
src1
,
src2
,
cv
::
ocl
::
MAT_ADD
);
return
dst
;
return
oclMatExpr
(
src1
,
src2
,
cv
::
ocl
::
MAT_ADD
);
}
cv
::
ocl
::
oclMatExpr
cv
::
ocl
::
operator
-
(
const
oclMat
&
src1
,
const
oclMat
&
src2
)
{
oclMatExpr
dst
(
src1
,
src2
,
cv
::
ocl
::
MAT_SUB
);
return
dst
;
return
oclMatExpr
(
src1
,
src2
,
cv
::
ocl
::
MAT_SUB
);
}
cv
::
ocl
::
oclMatExpr
cv
::
ocl
::
operator
*
(
const
oclMat
&
src1
,
const
oclMat
&
src2
)
{
oclMatExpr
dst
(
src1
,
src2
,
cv
::
ocl
::
MAT_MUL
);
return
dst
;
return
oclMatExpr
(
src1
,
src2
,
cv
::
ocl
::
MAT_MUL
);
}
cv
::
ocl
::
oclMatExpr
cv
::
ocl
::
operator
/
(
const
oclMat
&
src1
,
const
oclMat
&
src2
)
{
oclMatExpr
dst
(
src1
,
src2
,
cv
::
ocl
::
MAT_DIV
);
return
dst
;
return
oclMatExpr
(
src1
,
src2
,
cv
::
ocl
::
MAT_DIV
);
}
void
oclMatExpr
::
assign
(
oclMat
&
m
)
const
...
...
@@ -2193,6 +2181,18 @@ void oclMatExpr::assign(oclMat& m) const
case
MAT_DIV
:
divide
(
a
,
b
,
m
);
break
;
case
MAT_NOT
:
bitwise_not
(
a
,
m
);
break
;
case
MAT_AND
:
bitwise_and
(
a
,
b
,
m
);
break
;
case
MAT_OR
:
bitwise_or
(
a
,
b
,
m
);
break
;
case
MAT_XOR
:
bitwise_xor
(
a
,
b
,
m
);
break
;
}
}
...
...
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