How can I plot histogram matlab to uiaxes APP designer?

22 次查看(过去 30 天)
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')

更多回答(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