Acquisition stereo video sequence with 2 webcam

11 visualizaciones (últimos 30 días)
Juraj Janura
Juraj Janura el 17 de Sept. de 2022
Comentada: Juraj Janura el 10 de Oct. de 2023
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.

Respuestas (1)

Vidip Jain
Vidip Jain el 5 de Oct. de 2023
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 comentario
Juraj Janura
Juraj Janura el 10 de Oct. de 2023
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.

Iniciar sesión para comentar.

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by