I'm studying weed optimization algorithm of brain MRI images using Matlab R2017a. I obtained sample code from the Matlab File Exchange of Weed Optimization Algorithm. When I rand code with a binary image, I got an error message:
Undefined function 'colon' for input arguments of type 'uint8' and attributes 'full 3d real'.
What should I do to solve this problem?
This problem doesn't occur for some images. Sometimes, I get a matrix dimension error. Despite all errors, sample code works great 100%.
I=imread('brainxx.jpeg');
x=graytresh(I);
w=im2bw(I,x);
for.....
%min pixel value
%max pixel value
%image area[pixels]
.....
within-class variance (sum of weighted bg and fg variance)
% lowest within-class variance = optimal threshold (t)
%find and set the optimal threshold and generate binary image
[dat,indx]=min(var_tot);
opt_td = im2double(opt_t)...