1 | initial version |
First of all, read this documentation and see how the result look: DOCS
You should deeply analyse the result from chessboard - there you can see, that adaptive threshold is sth like edge detector. It will detect (set maximum value in you case) only the pixels, which in their local neighborhood has bigger value that "MEAN" + "C". So, the value from pixels ex. (0,0) and (1000,1000) are independent. As I say, this function will detect you edges, not blobs.
In this situation I suggest do sth like to detect blobs: - adaptiveThreshold: find edges in image - findContur: make connected component algorithm (you may to use OPEN or CLOSE morphological operation morphology to delete singe pixels or to connect to edges) - find biggest contour (by area or number of points) and fillPoly it with white color
After this operation you should get sth like you want.