First time here? Check out the FAQ!
answered 2020-01-08 16:04:58 -0600
Using a 2D vector like this is not as efficient as using a single vector<uchar> to hold all of the pixels, where the index is equal to size_t index = y*x_resolution+x; Here y and x are gotten from for loop iteration.
size_t index = y*x_resolution+x;
y
x