I think the problem here is, that cv:Canny
will leave a lot of open edges, because of "non maxima suppression". So you can't fill these contours in a satisfactory way.
A method to avoid this problem is to blur your image in the first step with cv::GaussianBlur
or cv::blur
. Than use cv::Sobel
or cv::Laplacian
and finally use a cv::threshold
please post the original image
I post the original image .I would find image contours and fill the contours to make the picture more clear
You can try to use
cv::adaptiveThreshold()
instead ofcv:Canny
. Or you can trycv::niBlackThreshold()
from the ximgproc in contrib modules. Here I have posted some other statistical thresholds you can try (you have to scroll down).Here is an actual link to the paper.