baidut / OpenVehicleVision

An opensource lib. for vehicle vision applications (written by MATLAB), lane marking detection, road segmentation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

运行shadow_code

baidut opened this issue · comments

问题1 在windows下跑linux matlab code
可以删除该行,或者从msys2中打开matlab

Undefined function or variable 'edison_wrapper_mex'.

mex edison_wrapper_mex.cpp

Error using mex
edison_wrapper_mex.cpp
e:\documents\matlab\openvehiclevision\thirdparty\linux\shadow_code\meanshift\edge/BgEdgeList.h
: error C4335: 检测到 Mac 文件格式:  请将源文件转换为 DOS 格式或 UNIX 格式
E:\Documents\MATLAB\OpenVehicleVision\thirdparty\linux\shadow_code\meanshift\edison_wrapper_mex.cpp(134)
: warning C4018: “<”: 有符号/无符号不匹配
E:\Documents\MATLAB\OpenVehicleVision\thirdparty\linux\shadow_code\meanshift\edison_wrapper_mex.cpp(168)
: warning C4018: “<”: 有符号/无符号不匹配
E:\Documents\MATLAB\OpenVehicleVision\thirdparty\linux\shadow_code\meanshift\edison_wrapper_mex.cpp(179)
: warning C4018: “<”: 有符号/无符号不匹配

复制内容到新建的文件中,替换原来文件

mex edison_wrapper_mex.cpp

Building with 'Microsoft Visual C++ 2013 Professional'.
Error using mex
   正在创建库 edison_wrapper_mex.lib 和对象 edison_wrapper_mex.exp
edison_wrapper_mex.obj : error LNK2019: 无法解析的外部符号 "public: void __cdecl
MeanShift::DefineKernel(enum kernelType *,float *,int *,int)"
(?DefineKernel@MeanShift@@QEAAXPEAW4kernelType@@PEAMPEAHH@Z),该符号在函数 mexFunction 中被引用
edison_wrapper_mex.obj : error LNK2019: 无法解析的外部符号 "public: void __cdecl
MeanShift::DefineLInput(float *,int,int,int)" (?DefineLInput@MeanShift@@QEAAXPEAMHHH@Z),该符号在函数
mexFunction 中被引用
edison_wrapper_mex.obj : error LNK2019: 无法解析的外部符号 "public: __cdecl
msImageProcessor::msImageProcessor(void)" (??0msImageProcessor@@QEAA@XZ),该符号在函数 mexFunction 中被引
用
edison_wrapper_mex.obj : error LNK2019: 无法解析的外部符号 "public: __cdecl
msImageProcessor::~msImageProcessor(void)" (??1msImageProcessor@@QEAA@XZ),该符号在函数 mexFunction 中被
引用
edison_wrapper_mex.obj : error LNK2019: 无法解析的外部符号 "public: void __cdecl
msImageProcessor::SetWeightMap(float *,float)" (?SetWeightMap@msImageProcessor@@QEAAXPEAMM@Z),该符号在
函数 mexFunction 中被引用
edison_wrapper_mex.obj : error LNK2019: 无法解析的外部符号 "public: void __cdecl
msImageProcessor::Filter(int,float,enum SpeedUpLevel)"
(?Filter@msImageProcessor@@QEAAXHMW4SpeedUpLevel@@@Z),该符号在函数 mexFunction 中被引用
edison_wrapper_mex.obj : error LNK2019: 无法解析的外部符号 "public: void __cdecl
msImageProcessor::FuseRegions(float,int)" (?FuseRegions@msImageProcessor@@QEAAXMH@Z),该符号在函数
mexFunction 中被引用
edison_wrapper_mex.obj : error LNK2019: 无法解析的外部符号 "public: void __cdecl
msImageProcessor::GetRawData(float *)" (?GetRawData@msImageProcessor@@QEAAXPEAM@Z),该符号在函数
mexFunction 中被引用
edison_wrapper_mex.obj : error LNK2019: 无法解析的外部符号 "public: int __cdecl
msImageProcessor::GetRegions(int * *,float * *,int * *)"
(?GetRegions@msImageProcessor@@QEAAHPEAPEAHPEAPEAM0@Z),该符号在函数 mexFunction 中被引用
edison_wrapper_mex.obj : error LNK2019: 无法解析的外部符号 "public: __cdecl BgImage::BgImage(void)"
(??0BgImage@@QEAA@XZ),该符号在函数 mexFunction 中被引用
edison_wrapper_mex.obj : error LNK2019: 无法解析的外部符号 "public: __cdecl BgImage::~BgImage(void)"
(??1BgImage@@QEAA@XZ),该符号在函数 mexFunction 中被引用
edison_wrapper_mex.obj : error LNK2019: 无法解析的外部符号 "public: void __cdecl
BgImage::SetImage(unsigned char *,int,int,bool)" (?SetImage@BgImage@@QEAAXPEAEHH_N@Z),该符号在函数
mexFunction 中被引用
edison_wrapper_mex.obj : error LNK2019: 无法解析的外部符号 "public: void __cdecl
BgEdgeDetect::ComputeEdgeInfo(class BgImage *,float *,float *)"
(?ComputeEdgeInfo@BgEdgeDetect@@QEAAXPEAVBgImage@@PEAM1@Z),该符号在函数 mexFunction 中被引用
edison_wrapper_mex.obj : error LNK2019: 无法解析的外部符号 "public: __cdecl
BgEdgeDetect::BgEdgeDetect(int)" (??0BgEdgeDetect@@QEAA@H@Z),该符号在函数 mexFunction 中被引用
edison_wrapper_mex.obj : error LNK2019: 无法解析的外部符号 "public: __cdecl
BgEdgeDetect::~BgEdgeDetect(void)" (??1BgEdgeDetect@@QEAA@XZ),该符号在函数 mexFunction 中被引用
edison_wrapper_mex.mexw64 : fatal error LNK1120: 15 个无法解析的外部命令

#pragma comment( lib, "opencv_highgui231d.lib")
#pragma comment( lib, "opencv_core231d.lib")就可以了

一般遇到这种问题就是缺少库文件,在头文件后面加入#pragma comment( lib, "*****.lib")就OK


解决办法:进入meanshift目录,然后
compile_edison_wrapper

compile_edison_wrapper

Building with 'Microsoft Visual C++ 2013 Professional'.
Error using mex
BgEdgeDetect.cpp
E:\Documents\MATLAB\OpenVehicleVision\thirdparty\linux\shadow_code\meanshift\edge\BgEdgeDetect.cpp(386)
: error C2668: “pow”: 对重载函数的调用不明确
        C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(1233): 可能是“long
        double pow(long double,int) throw()”
        C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(1231): 或       “long
        double pow(long double,long double) throw()”
        C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(1117): 或       “float
        pow(float,int) throw()”
        C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(1115): 或       “float
        pow(float,float) throw()”
        C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(1027): 或       “double
        pow(double,int) throw()”
        C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(512): 或       “double
        pow(double,double)”
        尝试匹配参数列表“(int, int)”时



Error in compile_edison_wrapper (line 1)
mex -O edison_wrapper_mex.cpp ...

http://stackoverflow.com/questions/31693621/mex-file-for-the-edison-wrapper-mex-cpp-provided-by-mr-bagon-s-stuff-for-the-me

// w = pow(2,(-2*WL_))*factorial(2*WL_)/(factorial(WL_-i)*factorial(WL_+i));
w = pow(2.0,(-2*WL_))*factorial(2*WL_)/(factorial(WL_-i)*factorial(WL_+i));

BgEdgeList.cpp/h 都有 检测到 Mac 文件格式: 的问题 修改完成后

compile_edison_wrapper
Building with 'Microsoft Visual C++ 2013 Professional'.
MEX completed successfully.
Done edison_wraper compilation

😄

太多混合编程,需要重新编译,太麻烦,不做了

http://bbs.csdn.net/topics/390916552
不要做A语言代码修改为B语言代码的无用功。
也不要做用A语言代码直接调用B语言代码库这样复杂、这样容易出错的傻事。
只需让A、B语言代码的输入输出重定向到文本文件,或修改A、B语言代码让其通过文本文件输入输出。
即可很方便地让A、B两种语言之间协调工作。
比如:
A将请求数据写到文件a.txt,写完后改名为aa.txt
B发现aa.txt存在时,读取其内容,调用相应功能,将结果写到文件b.txt,写完后删除aa.txt,改名为bb.txt
A发现bb.txt存在时,读取其内容,读完后删除bb.txt
以上A可以替换为任何一种开发语言或开发环境,B可以替换为任何一种与A不同的开发语言或开发环境。
除非A或B不支持判断文件是否存在、文件读写和文件更名。
但是谁又能举出不支持判断文件是否存在、文件读写和文件更名的开发语言或开发环境呢?

共享临时文本文件这种进程之间的通讯方法相比其它方法的优点有很多,下面仅列出我现在能想到的:
·进程之间松耦合
·进程可在同一台机器上,也可跨机,跨操作系统,跨硬件平台,甚至跨国。
·方便调试和监视,只需让第三方或人工查看该临时文本文件即可。
·方便在线开关服务,只需删除或创建该临时文本文件即可。
·方便实现分布式和负载均衡。
·方便队列化提供服务,而且几乎不可能发生队列满的情况(除非硬盘空间满)