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)
User contributions licensed under CC BY-SA 3.0