absdiff Mat and Vec3b assert failed

asked 2013-11-05 13:24:49 -0600

Fafa gravatar image

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));"

edit retag flag offensive close merge delete

Comments

1

it works, if you use a Scalar instead of Vec3b, but i got no explanation

berak gravatar imageberak ( 2013-11-05 13:36:52 -0600 )edit