Real time video retrieve from camera and simultaneous vehicle detection

2 次查看(过去 30 天)
Hello All, I am following the following link, for performing the vehicle detection and the distance measurement over a pre-saved Video! I have though implemented this, but I need to replace the pre-saved video with the real time data from the attached camera!
Now, this is what I am planning to implement: 1: Taking the webcam data and storing it in a variable (Implemented) 2: Taking the snapshot and implementing the process of vehicle detection and distance measurement. (Implemented) 3: Now, I want to process the whole video frame by frame.
Now, The part of the code responsible for showing the video is as follows: (Note: I have omitted the most of the code as they were irrelevant to this question)
while (1)
% Grab a frame of video
frame = snapshot(cam);
% Compute birdsEyeView image
.......
% Detect lane boundary features
.....
% Obtain lane candidate points in vehicle coordinates
........
% Find lane boundary candidates
..........
% Reject boundaries based on their length and strength
........
% Classify lane marker type
......
% Find ego lanes
......
% Find candidate ego boundaries
......
% Detect vehicles
......
% Visualize sensor outputs and intermediate results. Pack the core
% sensor outputs into a struct.
......
% Pack additional visualization data, including intermediate results
...........
snapshot = takeSnapshot(frame, sensor, sensorOut);
end
Display the video frame. Snapshot is taken at timeStamp seconds.
if ~isempty(snapshot)
figure
imshow(snapshot)
end
The error i am receiving is as follows:
Function 'subsindex' is not defined for values of class 'struct'.
Error in Final_Perception (line 379)
frame = snapshot(cam);
Kindly compare this part with the part of the code as mentioned in the link above and help me rectify the error I am making in this.
In case you want, I can post the correct version of the code part used with pre-saved video.
Thank you. Regards

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Tracking and Motion Estimation 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by