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
dce310e0
Commit
dce310e0
authored
Jul 12, 2016
by
Sergei Nosov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
provide better error messages
parent
c48e237d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
imgproc.hpp
modules/imgproc/include/opencv2/imgproc.hpp
+4
-2
emd.cpp
modules/imgproc/src/emd.cpp
+6
-4
No files found.
modules/imgproc/include/opencv2/imgproc.hpp
View file @
dce310e0
...
...
@@ -3157,10 +3157,12 @@ same object.
@param signature1 First signature, a \f$\texttt{size1}\times \texttt{dims}+1\f$ floating-point matrix.
Each row stores the point weight followed by the point coordinates. The matrix is allowed to have
a single column (weights only) if the user-defined cost matrix is used.
a single column (weights only) if the user-defined cost matrix is used. The weights must be
non-negative and have at least one non-zero value.
@param signature2 Second signature of the same format as signature1 , though the number of rows
may be different. The total weights may be different. In this case an extra "dummy" point is added
to either signature1 or signature2 .
to either signature1 or signature2. The weights must be non-negative and have at least one non-zero
value.
@param distType Used metric. See cv::DistanceTypes.
@param cost User-defined \f$\texttt{size1}\times \texttt{size2}\f$ cost matrix. Also, if a cost matrix
is used, lower boundary lowerBound cannot be calculated because it needs a metric function.
...
...
modules/imgproc/src/emd.cpp
View file @
dce310e0
...
...
@@ -387,7 +387,7 @@ static int icvInitEMD( const float* signature1, int size1,
}
else
if
(
weight
<
0
)
CV_Error
(
CV_Sts
OutOfRange
,
"
"
);
CV_Error
(
CV_Sts
BadArg
,
"signature1 must not contain negative weights
"
);
}
for
(
i
=
0
;
i
<
size2
;
i
++
)
...
...
@@ -401,11 +401,13 @@ static int icvInitEMD( const float* signature1, int size1,
state
->
idx2
[
dsize
++
]
=
i
;
}
else
if
(
weight
<
0
)
CV_Error
(
CV_Sts
OutOfRange
,
"
"
);
CV_Error
(
CV_Sts
BadArg
,
"signature2 must not contain negative weights
"
);
}
if
(
ssize
==
0
||
dsize
==
0
)
CV_Error
(
CV_StsOutOfRange
,
""
);
if
(
ssize
==
0
)
CV_Error
(
CV_StsBadArg
,
"signature1 must contain at least one non-zero value"
);
if
(
dsize
==
0
)
CV_Error
(
CV_StsBadArg
,
"signature2 must contain at least one non-zero value"
);
/* if supply different than the demand, add a zero-cost dummy cluster */
diff
=
s_sum
-
d_sum
;
...
...
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