Mat A = Mat::zeros(100, 200, CV_32FC1); Mat B = Mat::zeros(100, 200, CV_8UC3); // Mat C = A.mul(B); Mat Afc3, Bfc3; Mat t[] = {A, A, A}; merge(t, 3, Afc3); B.convertTo(Bfc3, CV_32FC3, 1/255.0); Mat C = Afc3.mul(Bfc3);