threshold function
I am getting creazy with Thresholding function in opencv...
I want to keep all values higher than 200 and remove rest of them!
seems I should use this THRESH_TOZERO type but I do not know what should I write instead of double maxval
threshold( Src2, dst, 200, double maxval ,THRESH_TOZERO );
any idea would be appreciated...
EDIT:
Thanks for your comments, I changed it like this but still I do not get the correct result:
#define THRESHOLD TO ZERO 3
threshold(Src2, dst, 200, CV_THRESH_BINARY , 3);
all values < 200 will be 0, and all values >200 will be ? maxVal!
they should not be changed..if it is 587 after thresholding should remain 587!
then you got the idea of thresholding wrong. it's a binarization. there's only 2 values left after it. low and high
just to clarify @beraks comments: it won't be binary with THRESH_TOZERO, but with THRESH_BINARY / THRESH_BINARY_INV, i.e. your first line is correct (with an arbitrary maxval) and your last one isn't (logically and syntactically).