2016-01-23 53 views
0

我試圖從MathWorks公司的網站得到這個Matlab的例子與倍頻4.0.0工作:Matlab與八度兼容性 - 計算機視覺差異?

http://www.mathworks.com/help/vision/examples/motion-based-multiple-object-tracking.html

我做什麼我到目前爲止,一個GitHub的寶庫,它主要是一個重新格式化上述MathWorks的版本鏈接:

https://github.com/MicrocontrollersAndMore/Matlab_Octave_Multiple_Object_Tracking

只是到目前爲止我所作出的變化是:

訂做一個單獨的主.m文件運行multiObjectTracking.m

- 由於我沒有MathWorks使用的'atrium.avi'文件,因此我將代碼中的VideoFileReader行更改爲使用'768x576.avi',它隨附於的OpenCV( '768x576.avi' 也上傳到上述鏈接的GitHub庫)

-Minor間距和註釋改變

- 增加 「PKG負載圖像;」在main.m和multiObjectTracking.m的開頭,在幾個測試Octave計算機視覺程序中,我這樣做似乎是必要的,否則我會得到一個錯誤的影響,「庫圖像已安裝但未加載」

目前,當我運行該程序,我得到以下錯誤:

error: 'vision' undefined near line 38 column 18 
error: called from 
    multiObjectTracking>setupSystemObjects at line 38 column 16 
    multiObjectTracking at line 14 column 7 
    main at line 14 column 1 

在功能換句話說:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    function obj = setupSystemObjects() 
    % initialize Video I/O, create objects for reading a video from a file, drawing the tracked objects in each frame, and playing the video 

    obj.reader = vision.VideoFileReader('768x576.avi');   % create a video file reader 

    obj.videoPlayer = vision.VideoPlayer('Position', [20, 400, 700, 400]);  % create two video players, one to display the video, 
    obj.maskPlayer = vision.VideoPlayer('Position', [740, 400, 700, 400]);  % and one to display the foreground mask 

    % Create System objects for foreground detection and blob analysis 

    % The foreground detector is used to segment moving objects from the background. It outputs a binary mask, where the pixel value 
    % of 1 corresponds to the foreground and the value of 0 corresponds to the background 

    obj.detector = vision.ForegroundDetector('NumGaussians', 3, 'NumTrainingFrames', 40, 'MinimumBackgroundRatio', 0.7); 

    % Connected groups of foreground pixels are likely to correspond to moving objects. The blob analysis System object is used to find such groups 
    % (called 'blobs' or 'connected components'), and compute their characteristics, such as area, centroid, and the bounding box. 

    obj.blobAnalyser = vision.BlobAnalysis('BoundingBoxOutputPort', true, 'AreaOutputPort', true, 'CentroidOutputPort', true, 'MinimumBlobArea', 400); 
    end 

的「願景」的對象不被認可。

這是我的理解,'視覺'是Matlab的工具箱的一部分,但我無法證實這一點,因爲我沒有訪問Matlab。

因此,這裏是我的問題至今:

-Is有一個八度相當於「願景」對象?

- 我應該注意哪些其他差異才能使這個Matlab程序在Octave下運行?

我一直在嘗試使用以下站點:

http://www.peterkovesi.com/matlabfns/

但不是很成功,到目前爲止獲得這些例子的工作或爲導向,以Matlab來倍頻翻譯我試圖。

Octave專家或那些已經獲得計算機視覺在Matlab和Octave中工作的人的任何幫助將不勝感激。

回答

3

這些是來自Computer Vision System Toolbox的Matlab函數。

通用規則是,Octave在匹配Matlab工具箱時很短,當它有什麼時,您需要安裝Octave packages separately

您提供的網站的鏈接似乎不支持vision對象功能。

+0

感謝您的信息。所以,我現在有的其他問題是: - 你認爲將上述Matlab程序翻譯成Octave是一項無望的任務嗎? 在Octave的「圖像」包中尋找,它的功能似乎與Matlab中的「視覺」類似,它們是非常接近還是完全不同? (繼續下一篇文章,我用完了字符......) – cdahms

+0

- 我在OpenCV C++和Visual Basic(使用Emgu CV作爲OpenCV的包裝器)中非常流利。在一個屏幕上閱讀Matlab示例,並將其轉換成OpenCV C++/VB在我的其他屏幕上,儘管我無法運行Matlab示例,會更好嗎?或者你會建議我不斷嘗試將Matlab示例首先轉換爲可用的八度示例? 在這一點上,我的意圖是跳過Octave並直接轉換爲C++或VB,因爲我的Octave體驗非常小。 (繼續下一篇文章,我再次用完字符......) – cdahms

+0

再次感謝迄今爲止的信息,我不希望任何人將我的Matlab程序一行一行地轉換成Octave,當然,這是由我來做的,但如果你可以提出一些建議,以提供進一步的方向,將非常感激,謝謝! – cdahms