Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ Bagon先生提供的edison_wrapper_Mex.cpp的Mex文件&x2019;在MATLAB 2014a中,均值漂移分割的东西不起作用_C++_Matlab - Fatal编程技术网

C++ Bagon先生提供的edison_wrapper_Mex.cpp的Mex文件&x2019;在MATLAB 2014a中,均值漂移分割的东西不起作用

C++ Bagon先生提供的edison_wrapper_Mex.cpp的Mex文件&x2019;在MATLAB 2014a中,均值漂移分割的东西不起作用,c++,matlab,C++,Matlab,我正在尝试运行这个爱迪生代码的MEX包装器来实现均值偏移 MATLAB 2014a中Shai Bagon先生网站上提供的分段。对于 运行这段代码时,我遵循下面提到的过程 在MATLAB命令窗口中,我键入以下指令 (我已经安装了Visual Studio 2010) 步骤1:>>mex-设置 步骤2:选择VC++ 步骤3:现在尝试运行下面给出的compile\u-edison\u包装器 但是得到错误: Error using mex edison_wrapper_mex.cpp d:\mean s

我正在尝试运行这个爱迪生代码的MEX包装器来实现均值偏移 MATLAB 2014a中Shai Bagon先生网站上提供的分段。对于 运行这段代码时,我遵循下面提到的过程

在MATLAB命令窗口中,我键入以下指令 (我已经安装了Visual Studio 2010)

步骤1:>>mex-设置

步骤2:选择VC++

步骤3:现在尝试运行下面给出的compile\u-edison\u包装器

但是得到错误:

Error using mex
edison_wrapper_mex.cpp
d:\mean shift\edge/BgEdgeList.h : error C4335: Mac file format detected: 
  please convert the source file to either
  DOS or UNIX format
  D:\Mean shift\edison_wrapper_mex.cpp(134) : warning C4018: '<' :
   signed/unsigned mismatch

   D:\Mean shift\edison_wrapper_mex.cpp(168) : warning C4018: '<' : 
   signed/unsigned mismatch
   D:\Mean shift\edison_wrapper_mex.cpp(179) : warning C4018: '<' :  
   signed/unsigned mismatch
   Error in compile_edison_wrapper (line 1)
   mex -O edison_wrapper_mex.cpp ...
使用mex时出现
错误
edison_wrapper_mex.cpp
d:\mean shift\edge/bgeList.h:错误C4335:检测到Mac文件格式:
请将源文件转换为
DOS或UNIX格式
D:\Mean shift\edison\u wrapper\u mex.cpp(134):警告C4018:'
  • 将文件edison\u wrapper\u mex.h中的“/”更改为“\” 这是因为代码可能是用Mac编写的

  • 试着按照指示编译。它将在edges文件夹中的.h和.cpp文件中给出一些错误。这是因为这些文件已编码为UTF-8格式,而Windows要求其为UTF-16LE。您可以使用任何编辑器重新编码或复制粘贴整个文本,您会注意到“换行符”字符的丢失。只需点击回车键,让它看起来令人愉悦。将文件以相同的名称保存在Edge文件夹中,瞧

  • 我在“edge\BgEdgeDetect.cpp”中模糊使用math.h中的pow时出错。只需转到错误点所在的行号(386),并通过显式地将第一个参数设置为double(如下所述)或将其类型转换为double(双精度)。 即 更改:

  • 致:


    是否尝试将源文件切换为Windows字符编码和Windows换行符?任何好的文本编辑器都可以改变这一点。我看不出第3点的两个“pow”示例有什么不同?@DavidMaster-将第一个参数“2”改为两个“2.0”
    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));