how to convert unit8 type images to logical type
12 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
neha viswanath
le 16 Fév 2015
Commenté : neha viswanath
le 17 Fév 2015
if true
myFolder = 'E:\\inverted\\i1';
for PicNum = 100:-1:1;
fullFileName = fullfile(myFolder,sprintf('%d.bmp',PicNum));
fprintf(1, 'Now reading %s\n', fullFileName);
imageArray{PicNum}=imread(fullFileName);
logical(imageArray{PicNum});//here im trying to convert my images to logical but its not happening
imshow(imageArray{PicNum}); % Display image.
end
end
0 commentaires
Réponse acceptée
Image Analyst
le 16 Fév 2015
To convert a gray level image to a logical binary image you must threshold:
binaryImage = grayImage > someValue;
4 commentaires
Plus de réponses (1)
Adam
le 16 Fév 2015
Modifié(e) : Adam
le 16 Fév 2015
imageArrayLogical = cellfun( @(im) logical(im), imageArray, 'UniformOutput', false );
or you can just do it in a for loop if you prefer. Note the result is still a cell array of your data so you still have to index into it using cell notation.
0 commentaires
Voir également
Catégories
En savoir plus sur Convert Image Type dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
