Webcam preview in GUI axes is shown as black image
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Valentin Stegmaier
le 14 Juin 2019
Commenté : Valentin Stegmaier
le 15 Juin 2019
Hi there,
i'm trying to show the live video of a webcam in an GUI right now using the axes area.
By using the preview function in it's own window i can see the live video of the webcam.
But by using the preview function with the image handle to show the sequence in the axes area there is just a black image displayed.
I already changed the resolution and tried a different webcam, but i always get the black image.
The Webcam is a Logitech c922 Pro Stream and i'm using Windows 10 64 bit with Matlab R2019a.
Thank you very much for your help in advance.
Best
Valentin
Here is the code i'm using:
function pushbutton_start_Callback(hObject, eventdata, handles)
cam = webcam(2);
frame = snapshot(cam);
im = image(handles.axes_video,zeros(size(frame),'uint8'));
axis(handles.axes_video,'image');
preview(cam,im)
end
0 commentaires
Réponse acceptée
Geoff Hayes
le 14 Juin 2019
Valentin - please see similar question and answer at https://www.mathworks.com/matlabcentral/answers/466753-webcam-preview-in-gui-not-showing-up.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!