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
a0cff0be
Commit
a0cff0be
authored
6 years ago
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imgproc(cvtColor): slightly improve error messages
Do not try to process empty inputs.
parent
9f2edc11
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
color.cpp
modules/imgproc/src/color.cpp
+2
-0
color.hpp
modules/imgproc/src/color.hpp
+5
-1
No files found.
modules/imgproc/src/color.cpp
View file @
a0cff0be
...
...
@@ -178,6 +178,8 @@ void cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
{
CV_INSTRUMENT_REGION
()
CV_Assert
(
!
_src
.
empty
());
if
(
dcn
<=
0
)
dcn
=
dstChannels
(
code
);
...
...
This diff is collapsed.
Click to expand it.
modules/imgproc/src/color.hpp
View file @
a0cff0be
...
...
@@ -247,10 +247,14 @@ struct CvtHelper
{
CvtHelper
(
InputArray
_src
,
OutputArray
_dst
,
int
dcn
)
{
CV_Assert
(
!
_src
.
empty
());
int
stype
=
_src
.
type
();
scn
=
CV_MAT_CN
(
stype
),
depth
=
CV_MAT_DEPTH
(
stype
);
CV_Assert
(
VScn
::
contains
(
scn
)
&&
VDcn
::
contains
(
dcn
)
&&
VDepth
::
contains
(
depth
)
);
CV_Check
(
scn
,
VScn
::
contains
(
scn
),
"Invalid number of channels in input image"
);
CV_Check
(
dcn
,
VDcn
::
contains
(
dcn
),
"Invalid number of channels in output image"
);
CV_CheckDepth
(
depth
,
VDepth
::
contains
(
depth
),
"Unsupported depth of input image"
);
if
(
_src
.
getObj
()
==
_dst
.
getObj
())
// inplace processing (#6653)
_src
.
copyTo
(
src
);
...
...
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