Answer the question
In order to leave comments, you need to log in
How to fix "sizes of input arguments do not match" error in OpenCV?
The error occurs when calling the weighted sum function AddWeighted (on the last line). The BLOCK_SIZE parameter is 100.
Scalar newColor = Scalar(0, 0, 0);
if (firstScore > secondScore)
{
newColor = Scalar(255, 255, 255);
}
else
{
newColor = Scalar(0, 0, 0);
}
Mat fragment = resultMat(Rect(j * BLOCK_SIZE, i * BLOCK_SIZE, BLOCK_SIZE, BLOCK_SIZE));
Mat color(fragment.size(), CV_8UC3, newColor);
double alpha = 1.0;
addWeighted(color, alpha, fragment, 1.0 - alpha, 0.0, fragment);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question