필터 지우기
필터 지우기

How the change the intensity of the image in the App designer without loading it again and again?

조회 수: 1 (최근 30일)
Hello Everyone,
I am new to the Matlab and I am creating an app which reads an image and you have sliders to select the intensity of the image.
Right now, I am doing this as:
function MinSliderValueChanged(app, event)
min=app.MinSlider.Value;
max=app.MaxSlider.Value;
Y=app.File_Path;
Loaded_Image=imread(Y);
if(min>=max)
f = errordlg('Min cannot be greater than Max!','Error');
else
imshow(Loaded_Image,[min,max],'Parent',app.UIAxes);
end
colormap(app.UIAxes,"jet");
colorbar(app.UIAxes);
end
In this way, I am displaying the image again and again and is slow in case of large files. Is there any work around this?
Thanks a lot.

답변 (1개)

Rik
Rik 2019년 11월 19일
This sounds like you should be able to borrow a lot of code from my WindowLevel FEX submission. The point is to change the caxes, instead of recreating the entire image.
It is always a good idea to create graphics objects only once in your GUI and handle any further modification through the properties of the underlying objects. So in the case of imshow you should be using the image object it returns.

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by