Cannot pass an image file from Matlab to Python

7 ビュー (過去 30 日間)
Asdrubal Cheng Cen
Asdrubal Cheng Cen 2021 年 3 月 23 日
回答済み: Rashed Mohammed 2021 年 3 月 26 日
Hi, so I have been trying to call a python module that I created using a existing MATLAB code. the pyversion of the python interpreter works fine and it outputs:
>> version: '3.8'
>> executable: 'C:\Users\xxx\AppData\Local\Programs\Python\Python38\python.exe'
>> library: 'C:\Users\xxx\AppData\Local\Programs\Python\Python38\python38.dll'
>> home: 'C:\Users\xxx\AppData\Local\Programs\Python\Python38'
>> isloaded: 1
And so, this is what I have so far:
>> image = imread("image_path");
>> info = py.mymodule.myfunction(image);
However, im getting this error: "Python Error: ModuleNotFoundError: No module named 'libmwbuffer'
Python function '' might not be able to accept at least one input argument at position 1. The function may require a specific data type that you can
construct from the MATLAB array. For more information, see the documentation for Python function '' and working with Python arrays."
I was wondering what I could do to solve this issue,
Thank you.

回答 (1 件)

Rashed Mohammed
Rashed Mohammed 2021 年 3 月 26 日
Hi Asdrubal,
Please refer to MATLAB to Python Data Type Mapping and check if the output type implements the Python buffer protocol. You can learn more about it here.
Hope this helps

カテゴリ

Help Center および File ExchangeCall Python from MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by