Compile Computer Vision Toolbox function for Python using Matlab Compiler SDK/Engine API

8 visualizaciones (últimos 30 días)
I have written substantial code in MATLAB using the Computer Vision Toolbox and I would like to convert the code to Python or import this code as a library using something like
import matlab.engine
in Python through 'MATLAB Engine API for Python' functionality. The specific function I am looking to convert is
pcfitplane()
from CV Toolbox but I presume the approach will apply to any future modules I wish to import.
I have tried the basic
matlab.engine()
commands in Python and they work fine but cannot find anything for CVT functions. Any help is appreciated.

Respuestas (1)

Gowtham Uma Maheswari Jaganathan
Gowtham Uma Maheswari Jaganathan el 17 de Mayo de 2018
You were doing the right thing. You have to create MATLAB engine object and then use the engine object to all function from MATLAB.
For example:
import matlab.engine
eng = matlab.engine.start_matlab()
ret = eng.sqrt(4.0) # use whatever function instead of sqrt(4.0)
print(ret)
More infromation can be found in the document page linked below
https://www.mathworks.com/help/matlab/apiref/matlab.engine.matlabengine-class.html
  2 comentarios
Anshul Joshi
Anshul Joshi el 21 de Mayo de 2018
But how to import/call CV toolbox functions using the matlab engine. I tried but there's no drop-down showing the functions and if I call it anyway it says "not found".
Jesus Velazquez
Jesus Velazquez el 2 de Jul. de 2019
have you tried manually adding the path to the toolbox functions? Like:
eng.addpath( "C:\Program Files\MATLAB\R2018b\toolbox\shared\optimlib" );

Iniciar sesión para comentar.

Categorías

Más información sobre Call MATLAB from Python en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by