Home > Back-end >  Opencv subtractive algorithm error expressions must have integral or did not distinguish between the
Opencv subtractive algorithm error expressions must have integral or did not distinguish between the

Time:09-20

A big genuflect is begged
 
Void colorReduce (Mat image, int div=64)
{
Int n=static_cast & lt; Int> (log (static_cast & lt; Double> (div))/log (2.0) + 0.5);
Uchar mask=0 XFF & lt; Uchar div2=div & gt;> 1;
//the iterator
Mat_ & lt; Vec3d & gt; : : iterator it=image. BeginMat_ & lt; Vec3d & gt; : : iterator it_end=image. EndFor (; it !=it_end; + + it)
{
for (int i=0; I & lt; 3; I++)
{
(* it) [I] & amp;=mask;
//error: here expressions must have integral or not distinguish range enum type
(* it) [I] +=div2;
}
}
}
  • Related