Black screen in video player
Afficher commentaires plus anciens
hello, I am trying to track points in real time. The problem is that my camera is 10 bits and the video player displays it in 16bits so the video is black. How can I change that?
The part of my code where I track and display the video is :
% Création de l'objet vidéo
vid=videoinput(handles.ADA,handles.numero,handles.format);
frame=getsnapshot(vid);
videoPlayer = vision.VideoPlayer;
% Création des trackers
pointTracker = vision.PointTracker('MaxBidirectionalError', 3);
% Création des points à tracker (source)
pointTracker2 = vision.PointTracker('MaxBidirectionalError', 3);
initialize(pointTracker,barycentre1,frame);
point(2,:) = barycentre2;
runloop=true;
while runloop
%Définition du point à tracker
point(1,:) = step(pointTracker,frame);
% Inserer physique sur la vidéo un marqueur
out = insertMarker(frame,point,'x');
% Calcule de la distance entre les 2 markers (norme)
Norme=sqrt(abs(((point(2,2) - point(1,2))).^2+abs((point(2,1) - point(1,1))).^2));
% Calcul de la distance en micro et microrad
Dmili=Norme*PixelNum*0.001;
Drad=(Dmili/FocaleNum)*1000;
% Affiche la distance entre les 2 points
set(handles.dist,'String',num2str(Drad));
set(handles.dist2,'String',num2str(Dmili));
% Affichage de la vidéo
step(videoPlayer, out);
end
1 commentaire
Arnaud Tullio
le 5 Sep 2017
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Acquisition Using Image Acquisition Explorer dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!