气泡柱中的气泡尺寸分布使用图像处理技术

时间:2017-04-30 15:32:50

标签: matlab image-processing

我有一个视频,我从中提取了几帧。我需要分析它们以获得气泡的总数和大小。到目前为止,我所拥有的程序可以识别图像中的单个气泡,但无法确定多个气泡。

代码:

clc;
clear all;
close all;
% ----------------- Select the image -------------------------------
% Double click the image fle to be selected
[FileName,PathName] = uigetfile('*.png','Select the image');
file = fullfile(PathName,FileName);

img=imread(file); % Reads the image
rgb = imcrop(img);
figure,imshow(rgb)
d = imdistline;   %to find the appropriate radius range

delete(d);
gray_image = rgb2gray(rgb);
figure, imshow(gray_image);
impixelinfo
[centers, radii] = imfindcircles(rgb,[3 10],'ObjectPolarity','dark')
hold on
[centers, radii] = imfindcircles(rgb,[3 10],'ObjectPolarity','dark', ...
    'Sensitivity',0.96)
hold off
figure, imshow(rgb);

h = viscircles(centers,radii);
[centers, radii] = imfindcircles(rgb,[3 10],'ObjectPolarity','dark', ...
    'Sensitivity',0.96);

length(centers)
delete(h);  % Delete previously drawn circles
h = viscircles(centers,radii);
%second method(2 stage )
[centers, radii] = imfindcircles(rgb,[3 10], 'ObjectPolarity','dark', ...
          'Sensitivity',0.96,'Method','twostage');

delete(h);

h = viscircles(centers,radii);

The Frame Given As Input To Code
Output i am getting

我需要帮助才能在图像中获得正确数量的气泡。 因为在输出屏幕截图中有一些集合,其中algo无法获得正确数量的气泡。

0 个答案:

没有答案