core: report the unsupported type in cv::sum error message

This commit is contained in:
Shiven Solanki
2026-10-16 15:21:15 +08:00
parent 33243e5805
commit f365611686
2 changed files with 23 additions and 1 deletions

View File

@@ -139,7 +139,8 @@ static Scalar sum_(const Mat& src)
if (func == nullptr) {
if (depth == CV_Bool && cn == 1)
return Scalar((double)countNonZero(src));
CV_Error(Error::StsNotImplemented, "");
CV_Error_(Error::StsNotImplemented, ("sum: %s input is not supported, convert the input to another type (e.g. CV_32F) first",
typeToString(src.type()).c_str()));
}
const Mat* arrays[] = {&src, 0};