Ask Your Question

Revision history [back]

image description

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);