Here img is 16UC3... Comparing is wrong...Can someone help me with this [closed]
Mat image(5620, 4894, CV_16UC3, Scalar(0, 0, 0));
for (int j = 0; j < Change_Detected.rows; j++)
{
for (int l = 0; l < Change_Detected.cols; l++)
{
if (img.at<Vec3b>(i,j)>200)
{
image.at<Vec3b>(j, l)[0] = img.at<Vec3b>(j, l)[0];
image.at<Vec3b>(j, l)[1] = img.at<Vec3b>(j, l)[1];
image.at<Vec3b>(j, l)[2] = img.at<Vec3b>(j, l)[2];
}
}
}
Instead of posting multiple questions can you clearly tell us your problem?
As Berak answered in your prev question, You are accessing the pixels wrong! i.e instead of using this
You need to use
even, if you correct the type,
the next problem is, that you're trying to compare a Vec3w to a single number here:
what are you trying to achieve ? which channels compare to what ?
again, please don't just throw code at us without further explanation.
I want to compare all 3 channels with different values.. Channel 1 >50 && channel 2 > 60 && channels 3 >110 And i want to store the values in new CV_16UC3 matrix.