簡體   English   中英

由Bagon先生的資料提供的edison_wrapper_mex.cpp的Mex文件不適用於MATLAB 2014a

[英]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

我正在嘗試為EDISON代碼運行MEX包裝器,以進行均值偏移分割,該代碼在Shai Bagon先生的網站中提供,適用於MATLAB 2014a。 為了運行此代碼,我遵循以下過程。

在MATLAB命令窗口中,輸入以下說明(我已經安裝了Visual Studio 2010)

步驟1:>> mex -setup

第二步:選擇VC ++

步驟3:現在嘗試運行compile_edison_wrapper,如下所示

但是得到錯誤:

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 ...
  1. 將edison_wrapper_mex.h文件中的'/'更改為'\\',這是因為該代碼可能是用Mac編寫的。

  2. 嘗試按照說明進行編譯。 它會在Edge文件夾的.h和.cpp文件中給出一些錯誤。 這是因為這些文件已經以UTF-8格式編碼,而Windows要求它為UTF-16LE。 您可以使用任何編輯器來重新編碼或復制粘貼整個文本,您會注意到丟失了“換行符”。 只需按Enter鍵,使其看起來令人愉悅即可。 將相同名稱的文件保存在edge文件夾和Voila中。

  3. 我在'edge \\ BgEdgeDetect.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));

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM