未验证 提交 f9c056ef 编写于 作者: V Vincent Rabaud 提交者: GitHub

Fix potential NaN in cv::norm

The behavior is actually proper in cv::norm( InputArray _src1, InputArray _src2, int normType), not in double cv::norm( InputArray _src1, InputArray _src2, int normType, InputArray _mask ).
The fix and bug were both introduced in https://github.com/opencv/opencv/commit/34530da66e9e5d9fdba091b11ceef16ae267ae0c
上级 2b84c97a
......@@ -1171,7 +1171,7 @@ double norm( InputArray _src1, InputArray _src2, int normType, InputArray _mask
// special case to handle "integer" overflow in accumulator
const size_t esz = src1.elemSize();
const int total = (int)it.size;
const int intSumBlockSize = normType == NORM_L1 && depth <= CV_8S ? (1 << 23) : (1 << 15);
const int intSumBlockSize = (normType == NORM_L1 && depth <= CV_8S ? (1 << 23) : (1 << 15))/cn;
const int blockSize = std::min(total, intSumBlockSize);
int isum = 0;
int count = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册