Error 0xC0000005 Matlab engine for python

I'm using Matlab engine for python.
I test it with the code:
import matlab.engine
eng = matlab.engine.start_matlab()
eng.isprime(3)
Everything goes fine until this point.
When trying with this:
eng.regionprops(matlab.uint8(thrVariance.tolist()), 'Eccentricity')
I got:
ValueError: only struct scalar can be returned from MATLAB
So I created region_props.m with the following code:
function rv = region_props(img, opc)
rv = struct('r',regionprops(img, opc));
to convert the result of regionprops function to scalar struct.
When I test this in Matlab work fine but in python the code:
eng.region_props(matlab.uint8(thrVariance.tolist()), 'Eccentricity')
throw:
Process finished with exit code -1073741819 (0xC0000005)

댓글 수: 2

Jan
Jan 2019년 3월 14일
The returned struct rv still contains a struct array. All you have changed was to move it into a deeper struct level. Is there any evidence, that struct arrays are accepted by Python?
so, what can I do to get the result of this function in python side?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Call MATLAB from Python에 대해 자세히 알아보기

태그

질문:

2019년 3월 14일

댓글:

2019년 3월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by