First time here? Check out the FAQ!
answered 2017-06-26 10:28:41 -0600
Mat temp1; Mat temp2; Mat mask; Mat dst; threshold(src,temp1,50,255,THRESH_OTSU); threshold(src,temp2,50,255,THRESH_BINARY); bitwise_not(temp1,mask); temp2.copyTo(dst,mask); temp1.copyTo(dst,temp2);