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:
dlopen(/Applications/MATLAB_R2019a.app/bin/maci64/builtins/images_builtins/mwlibmwimagesocv_builtinimpl.dylib,
5): Library not loaded: @rpath/libcudart.10.0.dylib
Referenced from: /Applications/MATLAB_R2019a.app/bin/maci64/libopencv_core.3.4.0.dylib
Reason: no suitable image found. Did find:
/Applications/MATLAB_R2019a.app/bin/maci64/libcudart.10.0.dylib: code signature invalid for
'/Applications/MATLAB_R2019a.app/bin/maci64/libcudart.10.0.dylib'
/Applications/MATLAB_R2019a.app/bin/maci64/./libcudart.10.0.dylib: code signature invalid for
'/Applications/MATLAB_R2019a.app/bin/maci64/./libcudart.10.0.dylib'
/Applications/MATLAB_R2019a.app/bin/maci64/builtins/images_builtins/../../../../bin/maci64/libcudart.10.0.dylib:
code signature invalid for
'/Applications/MATLAB_R2019a.app/bin/maci64/builtins/images_builtins/../../../../bin/maci64/libcudart.10.0.dylib'
/Applications/MATLAB_R2019a.app/Contents/MacOS/../../bin/maci64/libcudart.10.0.dylib: code
signature invalid for
'/Applications/MATLAB_R2019a.app/Contents/MacOS/../../bin/maci64/libcudart.10.0.dylib'

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);
imshow(B);
Please find the documentation for "kmeans" linked below.