I'm trying to manually change every pixel in a Mat.
For simplicity reasons, let's say I want to color each pixel black. I'm using the following method:
for (int i = 0; i < imageToWorkWith.rows; i++) {
for (int j = 0; j < imageToWorkWith.cols; j++) {
imageToWorkWith.at<cv::Vec3b>(i,j) = cv::Vec3b(0,0,0);
}
}
Logically, it seems like this should go over every pixel in the mat, as it reads all the possible combinations of row/col.
Unfortunately, this doesn't work. For every image, I'm missing a "chunk" of columns. For example, when loading this image:
The result is this:
This "chunk" I'm missing is the same size, no matter what image I use. I can't seem to understand the reason for that. I know that the order of row/col for the "at" function is (row, col), but i tried switching them just for kicks, and the result of course is even worse.
What am I missing here? is looping over all rows/cols not enough?