|
|
|
@ -387,7 +387,7 @@ static int icvInitEMD( const float* signature1, int size1, |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
else if( weight < 0 ) |
|
|
|
|
CV_Error(CV_StsOutOfRange, ""); |
|
|
|
|
CV_Error(CV_StsBadArg, "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_StsOutOfRange, ""); |
|
|
|
|
CV_Error(CV_StsBadArg, "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; |
|
|
|
|