我正在尝试测量此图像中显示的每个粒子的面积:

我设法使用这里显示的MSER获得每个粒子的一般形状:

但是我在删除背景时遇到了麻烦.我尝试使用MATLAB的imfill,但它没有填满所有的粒子,因为有些粒子在边缘被切断了.有关如何摆脱背景或以其他方式找到粒子区域的任何提示?干杯.
编辑:这是imfill看起来像:

编辑2:这是用于获取大纲的代码.我用这个用于MSER.
%Compute region seeds and elliptial frames.
%MinDiversity = how similar to its parent MSER the region is
%MaxVariation = stability of the region
%BrightOnDark is used as the void is primarily dark. It also prevents dark
%patches in the void being detected.
[r,f] = vl_mser(I,'MinDiversity',0.7,...
'MaxVariation',0.2,...
'Delta',10,...
'BrightOnDark',1,'DarkOnBright',0) ;
%Plot region frames, but not used right now
%f = vl_ertr(f) ;
%vl_plotframe(f) ;
%Plot MSERs
M = zeros(size(I)) ; %M = …Run Code Online (Sandbox Code Playgroud)