MATLAB: Do I get a “Bundle#60 start failed” error using “imsegkmeans” on macOS 10.10 Yosemite

Image Processing Toolboxkmeansmac

I am using R2019a on macOS Yosemite 10.10. I get the following error when I try using the "imsegkmeans" function.
>> I = imread('cameraman.tif');
>> [L,centers] = imsegkmeans(I, 3);
Bundle#60 start failed:
5): Library not loaded: @rpath/libcudart.10.0.dylib
Referenced from: /Applications/
Reason: no suitable image found. Did find:
/Applications/ code signature invalid for
/Applications/ code signature invalid for
code signature invalid for
/Applications/ code
signature invalid for

Best Answer

Please note that macOS Yosemite is not a supported operating system for the R2019a release. Based on the error message, it looks like the issue is caused by incompatible libraries. To resolve this, please upgrade to one of the supported operating systems listed in the link below.
If you cannot upgrade the OS, you can also try using the "kmeans" function from the Statistics and Machine Learning Toolbox. For example:
I = imread('cameraman.tif');
% kmeans requires numeric input, so convert to double
I = im2double(I);
idx = kmeans(I(:), 3);
% idx is a n x 1 vector, so reshape it to the size of the image
L = reshape(idx, size(I));
B = labeloverlay(I,L);
Please find the documentation for "kmeans" linked below.