Create a binary edge image of Malards.jpg using only the red channel of the image. Obtain the binary image with all edges that are stronger than 50 using Roberts edge detecti

조회 수: 4 (최근 30일)
tried to create a binary edge image using only red channel of the image but when i was running the code i was receiving the error
Error using imbinarize
Expected I to be one of these types:
uint8, uint16, uint32, int8, int16, int32, single, double
Instead its type was logical.
Error in imbinarize>validateImage (line 262)
validateattributes(I,supportedClasses,supportedAttribs,mfilename,'I');
Error in imbinarize>parseInputs (line 198)
validateImage(I);
Error in imbinarize (line 134)
[I,isNumericThreshold,options] = parseInputs(I,varargin{:});
Error in untitled1 (line 5)
binaryImg = imbinarize(edgeImg);
CODE:
img = imread('Malards.jpg');
redChannel = imsplit(img);
redChannel = redChannel(:,:,1);
edgeImg = edge(redChannel, 'Roberts', 50);
binaryImg = imbinarize(edgeImg);
imshow(binaryImg);
any suggestions and help please

답변 (1개)

DGM
DGM 2023년 3월 12일
The output of edge() is already a binary image (class 'logical'). There's no need to use imbinarize() on it.

태그

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by