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
667a9328
Commit
667a9328
authored
Jun 30, 2014
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2829 from ilya-lavrenov:tapi_cvtcolor
parents
2d81595e
007593ca
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
16 deletions
+8
-16
color.cpp
modules/imgproc/src/color.cpp
+5
-13
cvtcolor.cl
modules/imgproc/src/opencl/cvtcolor.cl
+0
-0
test_color.cpp
modules/imgproc/test/ocl/test_color.cpp
+3
-3
No files found.
modules/imgproc/src/color.cpp
View file @
667a9328
...
...
@@ -2730,8 +2730,6 @@ struct mRGBA2RGBA
#ifdef HAVE_OPENCL
#define DIVUP(total, grain) (((total) + (grain) - 1) / (grain))
static
bool
ocl_cvtColor
(
InputArray
_src
,
OutputArray
_dst
,
int
code
,
int
dcn
)
{
bool
ok
=
false
;
...
...
@@ -2739,23 +2737,17 @@ static bool ocl_cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
Size
sz
=
src
.
size
(),
dstSz
=
sz
;
int
scn
=
src
.
channels
(),
depth
=
src
.
depth
(),
bidx
;
int
dims
=
2
,
stripeSize
=
1
;
size_t
globalsize
[]
=
{
src
.
cols
,
src
.
rows
};
ocl
::
Kernel
k
;
if
(
depth
!=
CV_8U
&&
depth
!=
CV_16U
&&
depth
!=
CV_32F
)
return
false
;
cv
::
String
opts
=
format
(
"-D depth=%d -D scn=%d "
,
depth
,
scn
);
ocl
::
Device
dev
=
ocl
::
Device
::
getDefault
();
int
pxPerWIy
=
1
;
if
(
dev
.
isIntel
()
&&
(
dev
.
type
()
&
ocl
::
Device
::
TYPE_GPU
)
&&
!
(
code
==
CV_BGR2Luv
||
code
==
CV_RGB2Luv
||
code
==
CV_LBGR2Luv
||
code
==
CV_LRGB2Luv
||
code
==
CV_Luv2BGR
||
code
==
CV_Luv2RGB
||
code
==
CV_Luv2LBGR
||
code
==
CV_Luv2LRGB
))
pxPerWIy
=
4
;
globalsize
[
1
]
=
DIVUP
(
globalsize
[
1
],
pxPerWIy
);
opts
+=
format
(
"-D PIX_PER_WI_Y=%d "
,
pxPerWIy
);
int
pxPerWIy
=
dev
.
isIntel
()
&&
(
dev
.
type
()
&
ocl
::
Device
::
TYPE_GPU
)
?
4
:
1
;
size_t
globalsize
[]
=
{
src
.
cols
,
(
src
.
rows
+
pxPerWIy
-
1
)
/
pxPerWIy
};
cv
::
String
opts
=
format
(
"-D depth=%d -D scn=%d -D PIX_PER_WI_Y=%d "
,
depth
,
scn
,
pxPerWIy
);
switch
(
code
)
{
...
...
modules/imgproc/src/opencl/cvtcolor.cl
View file @
667a9328
This diff is collapsed.
Click to expand it.
modules/imgproc/test/ocl/test_color.cpp
View file @
667a9328
...
...
@@ -305,11 +305,11 @@ OCL_TEST_P(CvtColor8u32f, Lab2LRGBA) { performTest(3, 4, CVTCODE(Lab2LRGB), dept
OCL_TEST_P
(
CvtColor8u32f
,
BGR2Luv
)
{
performTest
(
3
,
3
,
CVTCODE
(
BGR2Luv
),
depth
==
CV_8U
?
1
:
1e-2
);
}
OCL_TEST_P
(
CvtColor8u32f
,
RGB2Luv
)
{
performTest
(
3
,
3
,
CVTCODE
(
RGB2Luv
),
depth
==
CV_8U
?
1
:
1e-2
);
}
OCL_TEST_P
(
CvtColor8u32f
,
LBGR2Luv
)
{
performTest
(
3
,
3
,
CVTCODE
(
LBGR2Luv
),
depth
==
CV_8U
?
1
:
4e-3
);
}
OCL_TEST_P
(
CvtColor8u32f
,
LRGB2Luv
)
{
performTest
(
3
,
3
,
CVTCODE
(
LRGB2Luv
),
depth
==
CV_8U
?
1
:
4
e-3
);
}
OCL_TEST_P
(
CvtColor8u32f
,
LRGB2Luv
)
{
performTest
(
3
,
3
,
CVTCODE
(
LRGB2Luv
),
depth
==
CV_8U
?
1
:
5
e-3
);
}
OCL_TEST_P
(
CvtColor8u32f
,
BGRA2Luv
)
{
performTest
(
4
,
3
,
CVTCODE
(
BGR2Luv
),
depth
==
CV_8U
?
1
:
8e-3
);
}
OCL_TEST_P
(
CvtColor8u32f
,
RGBA2Luv
)
{
performTest
(
4
,
3
,
CVTCODE
(
RGB2Luv
),
depth
==
CV_8U
?
1
:
9e-3
);
}
OCL_TEST_P
(
CvtColor8u32f
,
LBGRA2Luv
)
{
performTest
(
4
,
3
,
CVTCODE
(
LBGR2Luv
),
depth
==
CV_8U
?
1
:
4
e-3
);
}
OCL_TEST_P
(
CvtColor8u32f
,
LRGBA2Luv
)
{
performTest
(
4
,
3
,
CVTCODE
(
LRGB2Luv
),
depth
==
CV_8U
?
1
:
4
e-3
);
}
OCL_TEST_P
(
CvtColor8u32f
,
LBGRA2Luv
)
{
performTest
(
4
,
3
,
CVTCODE
(
LBGR2Luv
),
depth
==
CV_8U
?
1
:
5
e-3
);
}
OCL_TEST_P
(
CvtColor8u32f
,
LRGBA2Luv
)
{
performTest
(
4
,
3
,
CVTCODE
(
LRGB2Luv
),
depth
==
CV_8U
?
1
:
5
e-3
);
}
OCL_TEST_P
(
CvtColor8u32f
,
Luv2BGR
)
{
performTest
(
3
,
3
,
CVTCODE
(
Luv2BGR
),
depth
==
CV_8U
?
1
:
7e-5
);
}
OCL_TEST_P
(
CvtColor8u32f
,
Luv2RGB
)
{
performTest
(
3
,
3
,
CVTCODE
(
Luv2RGB
),
depth
==
CV_8U
?
1
:
7e-5
);
}
...
...
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