I am using a function which gives canny edge filtering of colour image, but i am having image input from gui, so there is error i'm facing at imread of "Input strings must have one row". And how can I show the output image on gui. Please reply.

1 view (last 30 days)
I = edgecolor(handles.output);
function R=edgecolor(nm)
img=imread(nm);
[x y z]=size(img);
if z==1
rslt=edge(img,'canny');
elseif z==3
img1=rgb2ycbcr(img);
dx1=edge(img1(:,:,1),'canny');
dx1=(dx1*255);
img2(:,:,1)=dx1;
img2(:,:,2)=img1(:,:,2);
img2(:,:,3)=img1(:,:,3);
rslt=ycbcr2rgb(uint8(img2));
end
R=rslt;

Answers (1)

Image Analyst
Image Analyst on 12 Jan 2015
Put an axes on your GUI, then call imshow(). Also, you messed up the order of the sizes. It should be
[y, x, z] = size(img);
Since the first return argument is the number of rows, which is the height or y size.

Community Treasure Hunt

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

Start Hunting!