how can i use image which is save in variable?
Afficher commentaires plus anciens
in the following code i wanted to use gray image which saved in variable b for further use,but it gives an error "undefined b" on second line... kindly sort this out
CODE:
i=imread('C:\Users\Romesha\Desktop\eye.jpg');
b=rgb2gray(i);
imshow(b);
im = imread(b);
imshow(im);
4 commentaires
Azzi Abdelmalek
le 21 Jan 2014
Post the entire error message
Bruno Pop-Stefanov
le 21 Jan 2014
im = imread(b);
is not going to work. imread should be called on a file, not a variable, like you did in
i=imread('C:\Users\Romesha\Desktop\eye.jpg');
Walter Roberson
le 21 Jan 2014
Good catch, Bruno. I got sidetracked by the "undefined b".
But to be more correct, you can use a variable in imread(), but it needs to be a variable that contains a string. For example,
F = 'C:\Users\Romesha\Desktop\eye.jpg';
im = imread(F);
romasha
le 22 Jan 2014
Réponses (1)
Catégories
En savoir plus sur Read, Write, and Modify Image dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!