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
f5ded410
Commit
f5ded410
authored
Nov 18, 2013
by
Roman Donchenko
Committed by
OpenCV Buildbot
Nov 18, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1808 from alalek:ocl_fix_cvtcolor_xyz
parents
f95ff0a3
0a698bf1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
color.cpp
modules/ocl/src/color.cpp
+8
-8
No files found.
modules/ocl/src/color.cpp
View file @
f5ded410
...
@@ -305,7 +305,7 @@ static void cvtColor_caller(const oclMat &src, oclMat &dst, int code, int dcn)
...
@@ -305,7 +305,7 @@ static void cvtColor_caller(const oclMat &src, oclMat &dst, int code, int dcn)
bidx
=
code
==
CV_BGR2XYZ
?
0
:
2
;
bidx
=
code
==
CV_BGR2XYZ
?
0
:
2
;
dst
.
create
(
sz
,
CV_MAKE_TYPE
(
depth
,
3
));
dst
.
create
(
sz
,
CV_MAKE_TYPE
(
depth
,
3
));
void
*
pdata
=
NULL
;
Mat
c
;
if
(
depth
==
CV_32F
)
if
(
depth
==
CV_32F
)
{
{
float
coeffs
[]
=
float
coeffs
[]
=
...
@@ -320,7 +320,7 @@ static void cvtColor_caller(const oclMat &src, oclMat &dst, int code, int dcn)
...
@@ -320,7 +320,7 @@ static void cvtColor_caller(const oclMat &src, oclMat &dst, int code, int dcn)
std
::
swap
(
coeffs
[
3
],
coeffs
[
5
]);
std
::
swap
(
coeffs
[
3
],
coeffs
[
5
]);
std
::
swap
(
coeffs
[
6
],
coeffs
[
8
]);
std
::
swap
(
coeffs
[
6
],
coeffs
[
8
]);
}
}
pdata
=
coeffs
;
Mat
(
1
,
9
,
CV_32FC1
,
&
coeffs
[
0
]).
copyTo
(
c
)
;
}
}
else
else
{
{
...
@@ -336,9 +336,9 @@ static void cvtColor_caller(const oclMat &src, oclMat &dst, int code, int dcn)
...
@@ -336,9 +336,9 @@ static void cvtColor_caller(const oclMat &src, oclMat &dst, int code, int dcn)
std
::
swap
(
coeffs
[
3
],
coeffs
[
5
]);
std
::
swap
(
coeffs
[
3
],
coeffs
[
5
]);
std
::
swap
(
coeffs
[
6
],
coeffs
[
8
]);
std
::
swap
(
coeffs
[
6
],
coeffs
[
8
]);
}
}
pdata
=
coeffs
;
Mat
(
1
,
9
,
CV_32SC1
,
&
coeffs
[
0
]).
copyTo
(
c
)
;
}
}
oclMat
oclCoeffs
(
1
,
9
,
depth
==
CV_32F
?
CV_32FC1
:
CV_32SC1
,
pdata
);
oclMat
oclCoeffs
(
c
);
fromRGB_caller
(
src
,
dst
,
bidx
,
"RGB2XYZ"
,
""
,
oclCoeffs
);
fromRGB_caller
(
src
,
dst
,
bidx
,
"RGB2XYZ"
,
""
,
oclCoeffs
);
break
;
break
;
...
@@ -351,7 +351,7 @@ static void cvtColor_caller(const oclMat &src, oclMat &dst, int code, int dcn)
...
@@ -351,7 +351,7 @@ static void cvtColor_caller(const oclMat &src, oclMat &dst, int code, int dcn)
bidx
=
code
==
CV_XYZ2BGR
?
0
:
2
;
bidx
=
code
==
CV_XYZ2BGR
?
0
:
2
;
dst
.
create
(
sz
,
CV_MAKE_TYPE
(
depth
,
dcn
));
dst
.
create
(
sz
,
CV_MAKE_TYPE
(
depth
,
dcn
));
void
*
pdata
=
NULL
;
Mat
c
;
if
(
depth
==
CV_32F
)
if
(
depth
==
CV_32F
)
{
{
float
coeffs
[]
=
float
coeffs
[]
=
...
@@ -366,7 +366,7 @@ static void cvtColor_caller(const oclMat &src, oclMat &dst, int code, int dcn)
...
@@ -366,7 +366,7 @@ static void cvtColor_caller(const oclMat &src, oclMat &dst, int code, int dcn)
std
::
swap
(
coeffs
[
1
],
coeffs
[
7
]);
std
::
swap
(
coeffs
[
1
],
coeffs
[
7
]);
std
::
swap
(
coeffs
[
2
],
coeffs
[
8
]);
std
::
swap
(
coeffs
[
2
],
coeffs
[
8
]);
}
}
pdata
=
coeffs
;
Mat
(
1
,
9
,
CV_32FC1
,
&
coeffs
[
0
]).
copyTo
(
c
)
;
}
}
else
else
{
{
...
@@ -382,9 +382,9 @@ static void cvtColor_caller(const oclMat &src, oclMat &dst, int code, int dcn)
...
@@ -382,9 +382,9 @@ static void cvtColor_caller(const oclMat &src, oclMat &dst, int code, int dcn)
std
::
swap
(
coeffs
[
1
],
coeffs
[
7
]);
std
::
swap
(
coeffs
[
1
],
coeffs
[
7
]);
std
::
swap
(
coeffs
[
2
],
coeffs
[
8
]);
std
::
swap
(
coeffs
[
2
],
coeffs
[
8
]);
}
}
pdata
=
coeffs
;
Mat
(
1
,
9
,
CV_32SC1
,
&
coeffs
[
0
]).
copyTo
(
c
)
;
}
}
oclMat
oclCoeffs
(
1
,
9
,
depth
==
CV_32F
?
CV_32FC1
:
CV_32SC1
,
pdata
);
oclMat
oclCoeffs
(
c
);
toRGB_caller
(
src
,
dst
,
bidx
,
"XYZ2RGB"
,
""
,
oclCoeffs
);
toRGB_caller
(
src
,
dst
,
bidx
,
"XYZ2RGB"
,
""
,
oclCoeffs
);
break
;
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