Here is my code:
% Uploading Image
Img = imread('image1.jpeg')figureimshow(Img)title('This is the original image')grayImg = rgb2gray(Img)figureimshow(grayImg);title('gray image of original')% Turning Image into binary gradient mask
threshold = edge(grayImg, 'sobel');factor = 0.5; %here 0.5 is a random number, i will try other numbers
BGMI = edge(Img,'sobel', threshold*factor);figureimshow(BGMI)title('Binary Gradient Mask Version of Image')error Message: Error using edgeExpected input number 1, I, to be two-dimensional.Error in edge>parse_inputs (line 461)validateattributes(I,{'numeric','logical'},{'real','nonsparse','2d'},mfilename,'I',1);Error in edge (line 189)[a,method,thresh,sigma,thinning,H,kx,ky] = parse_inputs(varargin{:});Error in ImageSegmentation (line 18)BGMI = edge(Img,'sobel', threshold*factor);
Any advise/help is highly appreciated!
Best Answer