why it is showing Undefined function for input arguments of type 'uint8'
13 次查看(过去 30 天)
显示 更早的评论
basically i want to divide given image in to 4 segment using crop1 function but it is showing
Undefined function 'crop1' for input arguments of type 'uint8'.
function crop1 is
where I in an intensity image
function s = crop1(I)
%RGB input image
%"s" structure of croped images
%Assuming size be 2104*1000
%Segmente the give input image in to four unequal part
%First segment having s(1)= 100 vertical pixel
%Second segment having s(2)= 100 vertical pixel
%Third segment having s(3)= 250 vertical pixel
%Fourth segment having s(4)= 450 vertical pixel
a=[100,150,250,500];
% b=[150,650];
s(4).new=[];% Pre allocation of structure for rapid iteration
% for a
s(1).new(:,:,:)=I(1:a(1),:,:);
s(2).new(:,:,:)=I(a(1):a(1)+a(2),:,:);
s(3).new(:,:,:)=I(a(1)+a(2):a(1)+a(2)+a(3),:,:);
s(4).new(:,:,:)=I(a(1)+a(2)+a(3):end,:,:);
0 个评论
采纳的回答
Wayne King
2012-3-25
Did you save crop1.m in a folder that is on the MATLAB path?
If you save crop1.m in c:\mfiles for example, then use addpath() or pathtool to add that folder to the MATLAB search path so you can use the function.
If you have added it correctly, you should be able to type
>>which crop1
and MATLAB returns the path to the Matlab program.
更多回答(1 个)
Walter Roberson
2012-3-25
And make sure that you are consistent about whether it is crop followed by the digit one, or crop followed by lower-case-L
2 个评论
sheroo
2022-12-21
>> 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'.
im facing that problem kindly help me
Steven Lord
2022-12-21
This was asked and answered in https://www.mathworks.com/matlabcentral/answers/1882632-undefined-function-imsegkmeans-for-input-arguments-of-type-uint8
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!