If I have an OpenCV cv::Mat, and I have a column of integers:
[1;2;3;1;2;3;1;2;3]
How can select a range of indices by value (ie 1), set those indices to a different value (ie 0), and keep the remaining values unmodified?
If this were MATLAB, I could very easily do:
A = [1;2;3;1;2;3;1;2;3];
A(A==1) = 0;
Resulting in:
[0;2;3;0;2;3;0;2;3]