Matlab - Error al usar vision.VideoPlayer

 
Vista:
sin imagen de perfil
Val: 2
Ha aumentado su posición en 40 puestos en Matlab (en relación al último mes)
Gráfica de Matlab

Error al usar vision.VideoPlayer

Publicado por Leonardo (2 intervenciones) el 30/05/2019 02:34:58
Hola, he estado intentado correr algunos códigos de ejemplo en matlab pero he tenido un error al usar la función :
vision.VideoPlayer
Aparece el mensaje:
Caught unexpected fl::except::IInternalException
Pero no se que lo genera y como solucionarlo ya que no se mencionan en otros foros

El programa detecta rostros por webcam y hace un seguimiento

El código completo es:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
%% detectAndTrackFaces
% Automatically detects and tracks multiple faces in a webcam-acquired
% video stream.
%
% Copyright 2013-2014 The MathWorks, Inc 
 
clear classes;
 
%% Instantiate video device, face detector, and KLT object tracker
vidObj = webcam;
 
faceDetector = vision.CascadeObjectDetector(); % Finds faces by default
tracker = MultiObjectTrackerKLT;
 
%% Get a frame for frame-size information
frame = snapshot(vidObj);
frameSize = size(frame);
 
%% Create a video player instance
videoPlayer  = vision.VideoPlayer('Position',[200 100 fliplr(frameSize(1:2)+30)]);
 
%% Iterate until we have successfully detected a face
bboxes = [];
while isempty(bboxes)
    framergb = snapshot(vidObj);
    frame = rgb2gray(framergb);
    bboxes = faceDetector.step(frame);
end
tracker.addDetections(frame, bboxes);
 
%% And loop until the player is closed
frameNumber = 0;
keepRunning = true;
disp('Press Ctrl-C to exit...');
while keepRunning
 
    framergb = snapshot(vidObj);
    frame = rgb2gray(framergb);
 
    if mod(frameNumber, 10) == 0
        % (Re)detect faces.
        %
        % NOTE: face detection is more expensive than imresize; we can
        % speed up the implementation by reacquiring faces using a
        % downsampled frame:
        % bboxes = faceDetector.step(frame);
        bboxes = 2 * faceDetector.step(imresize(frame, 0.5));
        if ~isempty(bboxes)
            tracker.addDetections(frame, bboxes);
        end
    else
        % Track faces
        tracker.track(frame);
    end
 
    % Display bounding boxes and tracked points.
    displayFrame = insertObjectAnnotation(framergb, 'rectangle',...
        tracker.Bboxes, tracker.BoxIds);
    displayFrame = insertMarker(displayFrame, tracker.Points);
    videoPlayer.step(displayFrame);
 
    frameNumber = frameNumber + 1;
end
 
%% Clean up
release(videoPlayer);
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder