Clear Filters
Clear Filters

am getting an error on filter function using this image called _ *sweets.png*_

2 views (last 30 days)
am getting error on using this image called _ sweets.png_ if true % code
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

Answers (1)

Rik
Rik on 18 Jan 2018
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).

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!