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
14671e0c
Commit
14671e0c
authored
Jun 11, 2014
by
Alexander Alekhin
Committed by
OpenCV Buildbot
Jun 11, 2014
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2823 from ilya-lavrenov:tapi_warpaffine
parents
88ceee05
2cc4cf36
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
imgwarp.cpp
modules/imgproc/src/imgwarp.cpp
+11
-10
warp_affine.cl
modules/imgproc/src/opencl/warp_affine.cl
+0
-0
No files found.
modules/imgproc/src/imgwarp.cpp
View file @
14671e0c
...
...
@@ -4167,11 +4167,12 @@ static bool ocl_warpTransform(InputArray _src, OutputArray _dst, InputArray _M0,
int
op_type
)
{
CV_Assert
(
op_type
==
OCL_OP_AFFINE
||
op_type
==
OCL_OP_PERSPECTIVE
);
const
ocl
::
Device
&
dev
=
ocl
::
Device
::
getDefault
();
int
type
=
_src
.
type
(),
depth
=
CV_MAT_DEPTH
(
type
),
cn
=
CV_MAT_CN
(
type
);
double
doubleSupport
=
ocl
::
Device
::
getDefault
()
.
doubleFPConfig
()
>
0
;
double
doubleSupport
=
dev
.
doubleFPConfig
()
>
0
;
int
interpolation
=
flags
&
INTER_MAX
;
int
interpolation
=
flags
&
INTER_MAX
,
rowsPerWI
=
dev
.
isIntel
()
&&
interpolation
<=
INTER_LINEAR
?
4
:
1
;
if
(
interpolation
==
INTER_AREA
)
interpolation
=
INTER_LINEAR
;
...
...
@@ -4193,30 +4194,30 @@ static bool ocl_warpTransform(InputArray _src, OutputArray _dst, InputArray _M0,
String
opts
;
if
(
interpolation
==
INTER_NEAREST
)
{
opts
=
format
(
"-D INTER_NEAREST -D T=%s%s -D T1=%s -D ST=%s -D cn=%d
"
,
ocl
::
typeToStr
(
type
)
,
doubleSupport
?
" -D DOUBLE_SUPPORT"
:
""
,
opts
=
format
(
"-D INTER_NEAREST -D T=%s%s -D T1=%s -D ST=%s -D cn=%d
-D rowsPerWI=%d"
,
ocl
::
typeToStr
(
type
),
doubleSupport
?
" -D DOUBLE_SUPPORT"
:
""
,
ocl
::
typeToStr
(
CV_MAT_DEPTH
(
type
)),
ocl
::
typeToStr
(
sctype
),
cn
);
ocl
::
typeToStr
(
sctype
),
cn
,
rowsPerWI
);
}
else
{
char
cvt
[
2
][
50
];
opts
=
format
(
"-D INTER_%s -D T=%s -D T1=%s -D ST=%s -D WT=%s -D depth=%d -D convertToWT=%s -D convertToT=%s%s -D cn=%d"
,
opts
=
format
(
"-D INTER_%s -D T=%s -D T1=%s -D ST=%s -D WT=%s -D depth=%d"
" -D convertToWT=%s -D convertToT=%s%s -D cn=%d -D rowsPerWI=%d"
,
interpolationMap
[
interpolation
],
ocl
::
typeToStr
(
type
),
ocl
::
typeToStr
(
CV_MAT_DEPTH
(
type
)),
ocl
::
typeToStr
(
sctype
),
ocl
::
typeToStr
(
CV_MAKE_TYPE
(
wdepth
,
cn
)),
depth
,
ocl
::
convertTypeStr
(
depth
,
wdepth
,
cn
,
cvt
[
0
]),
ocl
::
convertTypeStr
(
wdepth
,
depth
,
cn
,
cvt
[
1
]),
doubleSupport
?
" -D DOUBLE_SUPPORT"
:
""
,
cn
);
doubleSupport
?
" -D DOUBLE_SUPPORT"
:
""
,
cn
,
rowsPerWI
);
}
k
.
create
(
kernelName
,
program
,
opts
);
if
(
k
.
empty
())
return
false
;
double
borderBuf
[]
=
{
0
,
0
,
0
,
0
};
double
borderBuf
[]
=
{
0
,
0
,
0
,
0
};
scalarToRawData
(
borderValue
,
borderBuf
,
sctype
);
UMat
src
=
_src
.
getUMat
(),
M0
;
...
...
@@ -4251,7 +4252,7 @@ static bool ocl_warpTransform(InputArray _src, OutputArray _dst, InputArray _M0,
k
.
args
(
ocl
::
KernelArg
::
ReadOnly
(
src
),
ocl
::
KernelArg
::
WriteOnly
(
dst
),
ocl
::
KernelArg
::
PtrReadOnly
(
M0
),
ocl
::
KernelArg
(
0
,
0
,
0
,
0
,
borderBuf
,
CV_ELEM_SIZE
(
sctype
)));
size_t
globalThreads
[
2
]
=
{
dst
.
cols
,
dst
.
rows
};
size_t
globalThreads
[
2
]
=
{
dst
.
cols
,
(
dst
.
rows
+
rowsPerWI
-
1
)
/
rowsPerWI
};
return
k
.
run
(
2
,
globalThreads
,
NULL
,
false
);
}
...
...
modules/imgproc/src/opencl/warp_affine.cl
View file @
14671e0c
This diff is collapsed.
Click to expand it.
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