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 vue (au cours des 30 derniers jours)
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

Réponses (1)

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

Catégories

En savoir plus sur Modify Image Colors dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by