Undefined function 'imsegkmeans' for input arguments of type 'uint8'.

18 views (last 30 days)
>> RGB = imread('013.jpg');
RGB = imresize(RGB,0.5);
imshow(RGB)
L = imsegkmeans(RGB,2);
B = labeloverlay(RGB,L);
imshow(B)
title('Labeled Image');
Warning: Image is too big to fit on screen; displaying at 67%
> In imuitools\private\initSize at 72
In imshow at 283
Undefined function 'imsegkmeans' for input arguments of type 'uint8'.

Accepted Answer

Adam Danz
Adam Danz on 21 Dec 2022
Edited: Adam Danz on 21 Dec 2022
imsegkmeans accepts uint8 values which means either
  1. You don't have the image processing Toolbox, or
  2. You are using a MATLAB release prior to R2018b which is when imsegkmeans became available.
To test wether you have image processing toolbox,
license('test','image_toolbox') % returns 1 if you have the toolbox
To test whether you are using a MATLAB release 18b or later,
~verLessThan('matlab','9.5') % returns true if using >=18b

More Answers (1)

Steven Lord
Steven Lord on 21 Dec 2022
The imsegkmeans function is part of Image Processing Toolbox and was introduced in release R2018b. Do you have this toolbox installed and licensed and are you using release R2018b or later? You can check both of these by running the ver command and looking for a line starting with "Image Processing Toolbox" in the displayed output.
If that line does not exist you will need to install Image Processing Toolbox to use this function.
If that line exists but it lists a release earlier than R2018b then you will need to upgrade your installation to R2018b or later to use this function.

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!