Hello!
I am new in openCV and try to change colour of some pixels my matrix. if i work with new "Mat::zeros" matrix created by me, my code works (type of elements is CV_8UC1).
If i work with some image, code does not work correct.
But why? is it specific trait of image's depth or channels? can t get some properties of image like depth and number of channels.
The original image is here.
Please help me to make it clear.
The code for changing colour is:
for (int i = 0; i < img.rows; i++)
for (int j = 0; j < img.cols; j++)
if ((i % 20 == 10 && j % 2 == 1) ||
(j % 50 == 25 && i % 2 == 1))
{
img.at<uchar>(i, j) = 255;
}