Acquisition stereo video sequence with 2 webcam

7 次查看(过去 30 天)
Hello,
I am working on project where I would like to detect vehicles and their distance from ego vehicle in real time. I saw very useful video >> https://uk.mathworks.com/help/vision/ug/depth-estimation-from-stereo-video.html
I just could not find out anywhere how should I record stereo video sequence, which will be used for further processing, disparity map calculation
I can do preview both cameras n separate windows, but I am not able to record the video. I tried also Image aquisition toolbox where recording is easy, but only from one camera, once it is choosen other camera, the first one is unplugged.
I would be very thankful for some advice how can I obtain stereo video for disparity map calculation.
Kind regards.

回答(1 个)

Vidip Jain
Vidip Jain 2023-10-5
I understand you want to record a stereo video sequence for disparity map calculation, but you are not able to record the video form two cameras at the same time.
To record a stereo video sequence for disparity map calculation using MATLAB, you can use the VideoWriter object to create video files from your stereo camera feed. Here are the general steps to accomplish this:
  1. Initialize the Stereo Camera: Make sure you have initialized your stereo camera system properly and can preview both cameras in separate windows.
  2. Create VideoWriter Objects: You'll need to create two VideoWriter objects, one for each camera. These objects will be used to write frames from each camera to video files.
  3. Capture and Write Frames: Inside a loop where you are capturing frames from the stereo cameras, you can write each frame to the corresponding video file using the writeVideo function.
  4. Close VideoWriter Objects: After you have finished recording, be sure to close the VideoWriter objects to save and finalize the video files.
For further information, refer to the documentation links below:
  1 个评论
Juraj Janura
Juraj Janura 2023-10-10
Dear Vidip Jain,
Thanks a lot for your comment. Yes I am trying to do disparity map from 2 separate USB web cams. I have done calibration but I am quite struggling with recording of simultaneous videos. I don't have stereo camera system. In image acquisition app is possible to connect only 1 camera at the time. It is not possile to preview both camera and record simultaneously
I can do only single preview of both camera with command "preview ( cam1) and preview (cam2)"
It would be helpful to know how can I recor frames from both cameras.
Thank you very much once again for your comment and support.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Camera Calibration 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by