Matlab与Octave兼容性 - 计算机视觉差异?

时间:2016-01-23 16:48:10

标签: matlab computer-vision octave matlab-cvst

我正在尝试从MathWorks站点获取此Matlab示例以使用Octave 4.0.0:

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

我为我到目前为止制作了一个GitHub存储库,其中大部分是上面MathWorks链接的重新格式化版本:

https://github.com/MicrocontrollersAndMore/Matlab_Octave_Multiple_Object_Tracking

到目前为止,我所做的唯一改变是:

- 创建一个单独的main.m文件来运行multiObjectTracking.m

- 由于我没有MathWorks使用的'atrium.avi'文件,我更改了代码中的VideoFileReader行以使用'768x576.avi',它包含在OpenCV中('768x576.avi'也是上传到上面链接的GitHub仓库)

- 间隔和评论更改

-added“pkg load image;”在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。

所以这是我目前的问题:

- 是否存在与“视觉”对象相当的Octave?

- 要让这个Matlab程序在Octave下运行,我应该注意哪些其他差异?

我一直在尝试使用以下网站:

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

但到目前为止还没有非常成功地让这些例子正常工作或作为我正在尝试的Matlab到Octave翻译的指南。

Octave专家或那些在Matlab和Octave都有计算机视觉工作者的帮助将不胜感激。

1 个答案:

答案 0 :(得分:3)

这些是来自Computer Vision System Toolbox的Matlab函数。

一般规则是,Octave在匹配Matlab工具箱方面不足,当它有某些东西时,你需要安装Octave packages separately

您提供的网站链接似乎不支持vision对象功能。

相关问题