Passing an image form python to matlab compiled code

I have a working compiled Matlab code which I compiled using Matlab compiler. All I need to do is pass the image I obtain from python (ndarray) to the matlab compiled function. Only thing here is I would not have a matlab in the new machine where I use my compiled code. For better understanding
import mymatlabcompiledpackage
eng=mymatlabcompiledpackage.initalize() // initalizes everything from my matlab code without requiring matlab. I have also intalled matlab runtime
im=misc.imread('imglocation')
// below is the issue
out=eng.myfunction(im) // I cannot pass im here since it is ndarray
The solution that i know which works is pass matlab.uint8(im.tolist()) but for this i need the matlab.engine which requires matlab. Since I have already compiled every other function that i wrote in matlab. I just wish to know is there a way I could just pass an RGB image in a format that doesnt require me to use matlab engine.

Risposte (1)

you can split the layers and pass them to your function, then you can apply layerstack on recieved arguments.

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by