Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Trying to extract road from an image but got the error- "Integers can only be combined with integers of the same class, or scalar doubles."

1 回表示 (過去 30 日間)
shantanu shukla
shantanu shukla 2014 年 4 月 22 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
[f,p]= uigetfile('.jpg'); I=imread([p,f]); figure, imshow(I);
if ndims(I)==3 I1=rgb2gray(I); else I1=double(I); end k=3; [mu,mask]=kmeans(I1,k); figure, imshow(mask,[]); title('unsuper');
%I2=mask;
figure,imshow(I3); title('morphpo');
I4=medfilt2(I3,[5,5]); figure,imshow(I4);
levelset_method(I4,I1);
hs=14; hr=12; m=30; me_seg= meseg(I1,hs,hr,m); S1=imcomplement(im2bw(me_seg));
se1=strel('disk',3); Iout=imerode(S1,se1); figure, imshow(I) hold on; contour(Iout,[0,0],'r')
  2 件のコメント
Jan
Jan 2014 年 4 月 22 日
Please post the complete error message. Most of all the part which explains in which line the error occurs is important, such that we do not have to spend time for guessing this detail.

回答 (1 件)

Image Analyst
Image Analyst 2014 年 4 月 22 日
You might try this
I1 = double(rgb2gray(I));

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by