0

There are different libraries available on Matlab/Python. I wonder if there is a way to make them collaborate. The possible ways I can imagine are

  1. Import libraries of Matlab to Python (if possible), and only use Python.
  2. Import libraries of Python to Matlab (if possible), and only use Matlab.
  3. Run both at the same time, exchanging data.

The raw data collected here will be video frames from two webcams. Python process the frames and give an output of some points at each frame. Matlab will use the raw frames and points from Python to reconstruct a 3D scene.

The video frames from webcams can be collected via either matlab/python (or something else).

Could you recommend any idea that will work well in my situation? My intuition says that option 2 may be the best since Matlab is where I process the data as a final stage. But I am not sure whether collecting videos with Python and passing them to Matlab is easy and fast enough.

SSS
  • 621
  • 2
  • 7
  • 25
  • 1
    You can call Python from within MATLAB quite simply, and pass MATLAB data to Python and get data back from Python. That is probably all you need. It is also possible to call MATLAB from within Python, you’d probably end up with a similarly complex solution either way. – Cris Luengo Sep 16 '18 at 23:51
  • Could you give me a link of doing that? Is there a command for that? Thank you! – SSS Sep 17 '18 at 00:25
  • Here is the docs for calling Python from within MATLAB: https://www.mathworks.com/help/matlab/call-python-libraries.html — See this question for doing it the other way around: https://stackoverflow.com/questions/2883189/calling-matlab-functions-from-python – Cris Luengo Sep 17 '18 at 00:59

0 Answers0