How can I plot histogram matlab to uiaxes APP designer?

조회 수: 14 (최근 30일)
Jenifer NG
Jenifer NG 2022년 8월 15일
댓글: Cris LaPierre 2025년 5월 16일
Hi Everyone,
Could some one know how to plot histogram of an image to uiaxes ?
This is my code:
v = videoinput("winvideo", 2, "YUY2_640x480"); % capure image from webcam
v.ReturnedColorspace = "grayscale"; % convert to gray
v.ROIPosition = [133 114 410 300]; % crop image
snapshot1 = getsnapshot(v); % capture image
imhist(snapshot1,app.UIAxes) % Plot historam
Thanks all!
Han

채택된 답변

Cris LaPierre
Cris LaPierre 2022년 8월 15일
imhist is not supported in App Designer yet (as best I can tell). However, you may be interested in this example, which uses histogram instead to show the red, green and blue content of an image.
Or open directly in MATLAB with the following command
openExample('matlab/AppdImageHistogramsExample')
  댓글 수: 3
Will Reeves
Will Reeves 2025년 5월 16일
Hi, just wondering if you know if imhist will ever be supported in App Designer? Seems like every plot type should be supported really?
Cris LaPierre
Cris LaPierre 2025년 5월 16일
I've attached a simple example. Here's what the results look like using this example.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by