필터 지우기
필터 지우기

Cannot pass an image file from Matlab to Python

조회 수: 13 (최근 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 CenterFile Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by