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

1 Ansicht (letzte 30 Tage)
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

Antworten (1)

DGM
DGM am 12 Mär. 2023
The output of edge() is already a binary image (class 'logical'). There's no need to use imbinarize() on it.

Kategorien

Mehr zu Modify Image Colors finden Sie in Help Center und File Exchange

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by