Solved! Using the code below on my secondary PC, for some reason I keep getting the error "iptcheckconn.m" is now inaccessible.", when I use some funcitons on my working PC, I have tried solving it but no luck so far.
clear;
close all;
clc;
I = imread('C:\DilatedRedBeanv0.png');
Ibw = im2bw(I);
Ibw = imfill(Ibw,'holes');
Ilabel = bwlabel(Ibw);
stat = regionprops(Ilabel,'centroid');
imshow(I); hold on;
for x = 1: numel(stat)
plot(stat(x).Centroid(1),stat(x).Centroid(2),'ro');
end
