am getting an error on filter function using this image called _ *sweets.png*_
2 次查看(过去 30 天)
显示 更早的评论
am getting error on using this image called _ sweets.png_ if true % code
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/169093/image.png)
J =filter2(fspecial('sobel'),I); end
Error:
Undefined function 'conv2' for input arguments of type 'double' and attributes 'full 3d real'.
Error in filter2 (line 59) y = conv2(hcol, hrow, x, shape);
Error in last (line 15) J=filter2(fspecial('sobel'),I); end
0 个评论
回答(1 个)
Rik
2018-1-18
In Matlab, a color image is 3D, the third dimension being the color channels. You need to convert it to a grayscale image (e.g. with rgb2gray).
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 3-D Volumetric Image Processing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!