由Bagon先生提供的用于Mean Shift Segmentation的eddison_wrapper_mex .cp

Mex file for the edison_wrapper_mex.cpp provided by Mr. Bagon’s stuff for the Mean Shift Segmentation is not working in MATLAB 2014a

本文关键字:Segmentation eddison wrapper cp mex Shift Mean 先生 Bagon 用于      更新时间:2023-10-16

我正在尝试为这个EDISON代码运行MEX包装器以获取平均值移位Shai Bagon先生的网站在MATLAB 2014a中提供的分割。为我按照下面提到的步骤运行这段代码。

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

Step1:>>mex -setup

Step2:选择vc++

Step3:现在尝试运行compile_edison_wrapper,如下所示

但是得到错误:

Error using mex
edison_wrapper_mex.cpp
d:mean shiftedge/BgEdgeList.h : error C4335: Mac file format detected: 
  please convert the source file to either
  DOS or UNIX format
  D:Mean shiftedison_wrapper_mex.cpp(134) : warning C4018: '<' :
   signed/unsigned mismatch
   D:Mean shiftedison_wrapper_mex.cpp(168) : warning C4018: '<' : 
   signed/unsigned mismatch
   D:Mean shiftedison_wrapper_mex.cpp(179) : warning C4018: '<' :  
   signed/unsigned mismatch
   Error in compile_edison_wrapper (line 1)
   mex -O edison_wrapper_mex.cpp ...
  1. 将edison_wrapper_mex.h文件中的'/'更改为''这是因为代码可能是用Mac编写的。

  2. 尝试按指示编译。它会在edge文件夹中的。h和。cpp文件中给出一些错误。这是因为这些文件以UTF-8格式编码,而Windows要求它是UTF-16LE。你可以使用任何编辑器重新编码或复制粘贴整个文本,你会注意到'换行'字符的丢失。只要按回车键,让它看起来很漂亮。以相同的名称保存在edges文件夹中,瞧!

  3. 我在'edgeBgEdgeDetect.cpp'中模糊使用math.h中的pow时出现了一些错误。只要转到错误所在的行号(386),通过显式地将第一个参数设置为double(如下所示)或类型转换为(double),将第一个参数设置为double。即。变化:

    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));