Ask Your Question

Revision history [back]

absdiff Mat and Vec3b assert failed

I want to calculate absolute difference between colour image pixels (image: Mat CV_8UC3) and a given colour scalar (chosen: Vec3b).

In version 2.3 I simply used absdiff: absdiff(image,chosen,result);

However in 2.46 it fails and I get OpenCVError: Assertion failed.

What am I doing wrong?

If nothing then... The assert is in module/src/arithm.cpp: static void arithm_op: 1279 and was first introduced in Revision bb333250. "CV_Assert(src2.type() == CV_64F && (src2.rows == 4 || src2.rows == 1));"