Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Here img is 16UC3... Comparing is wrong...Can someone help me with this

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]; } } }

Here img is 16UC3... Comparing is wrong...Can someone help me with this

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)
        {
                for (int l = 0; l < Change_Detected.cols; l++)
                {
                    if (img.at<vec3b>(i,j)>200)
                    {
                        image.at<vec3b>(j, image.at<Vec3b>(j, l)[0] = img.at<vec3b>(j, img.at<Vec3b>(j, l)[0];
                        image.at<vec3b>(j, image.at<Vec3b>(j, l)[1] = img.at<vec3b>(j, img.at<Vec3b>(j, l)[1];
                        image.at<vec3b>(j, image.at<Vec3b>(j, l)[2] = img.at<vec3b>(j, img.at<Vec3b>(j, l)[2];
         }
     }
            }

}