필터 지우기
필터 지우기

how can i use image which is save in variable?

조회 수: 2 (최근 30일)
romasha
romasha 2014년 1월 21일
댓글: romasha 2014년 1월 22일
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
Walter Roberson
Walter Roberson 2014년 1월 21일
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
romasha 2014년 1월 22일
this is the entire error message
  • * *Error in @(hObject,eventdata)gui('PB2_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uicontrol Callback* * *
and respected sir i know the above answers already and i want to use that image which is store in variable b so how can i give the path of that image "im=imread(i want gray image which save in variable b in this paranthesis)"

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2014년 1월 21일

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by