Opencv Matlab compatibility in c++

Hello,
I am trying to run a Matlab (2019b) script from my c++ code. This works in stand alone.
If I add it to my main c++ file, which also has opencv inside, this doesn't work anymore due to the following error:
C1189 #error: Using MATLAB Data API with C Matrix API is not supported. (Quelldatei wird kompiliert MainWindow.cpp)
The two parts of the code could run seperately: I first call Matlab and then opencv., but since they are in one VS project, this stil results in issues.
I suppose that OpenCV somehow uses the C Matrix API, but I am not sure when and how..
Can anyone help?

回答 (1 件)

Nipun Katyal
Nipun Katyal 2020 年 7 月 14 日

0 投票

Hi,
All the data to and from MATLAB is casted as an mxArray pointer, in order to use open cv function you need to convert the mxArray type to cv::Mat type and vice versa. You can use the open cv interface for C++ api given in the link,

カテゴリ

ヘルプ センター および File ExchangeComputer Vision Toolbox についてさらに検索

質問済み:

2020 年 7 月 6 日

回答済み:

2020 年 7 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by