Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

[HELP :( ]How to analyse number of circles from few photos in a file instead of uploading a single file and plot a histogram out

1 view (last 30 days)
%How to get a histogram with the results from few photos %12/3/2018 %image analysis for CFU
clear all; close all; workspace; format longg; format compact; fontSize =10; %for histogram results
%load image file rgbImage = imread('test1.jpg'); % image file, check jpg or png
subplot(2, 2, 1); imshow(rgbImage); title('Original Image', 'FontSize', fontSize); % enlarging to full screen. set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
binaryImage = rgbImage(:,:,1) <140; %setting threshold for the image
subplot(2, 2, 2); imshow(binaryImage); title('Setting threshold', 'FontSize', fontSize); %title for the plates after setting threhold hold on;
d = imdistline; %this is used to measure the radius of the circles
[centers, radii] = imfindcircles(binaryImage,[8 20],'ObjectPolarity','dark','Sensitivity',0.87,'EdgeThreshold',0.1)
numberofcircles=length(centers)
[counts values] = hist(numberofcircles); subplot(2, 2, 3); bar(values, counts); grid on; title('Number of Circles (agar plate x)', 'FontSize', fontSize); message = sprintf('The number of circles is %d', numberofcircles); msgbox(message);

Answers (0)

This question is closed.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!