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.
回答(1 个)
sudheer devulapalli
2018-12-18
0 个投票
you can split the layers and pass them to your function, then you can apply layerstack on recieved arguments.
类别
在 帮助中心 和 File Exchange 中查找有关 Call Python from MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!