I want to detect the background of the following image whose foreground is always lots of black dots:
img.png
Someone performs morphological closing on the image with disk-shaped structuring element and obtain a good result:
Matlab code:
img = imread('c:img.png');
bg = imclose(img, strel('disk', 15));
figure('name', 'bg'), imshow(bg);
So how to implement imclose(IM, SE) in opencv to replace the work in MATLAB or there is another better way to detect such background using opencv method?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…