I am looking for a function in openCV to help me make masks of images.
for example in MATLAB:
B(A<1)=0;
or
B=zeros(size(A));
B(A==
OpenCV C++ supports the following syntax you might find convenient in creating masks:
Mat B= A > 1;//B(A<1)=0
Mat B = A==10; B *= c;
which should be equivalent to:
B=zeros(size(A)); B(A==10)=c;
You can also use compare(). See the following OpenCV Documentation.
compare()