【问题标题】:Matlab vs Octave Compatibility - computer vision differences?Matlab vs Octave 兼容性 - 计算机视觉差异?
【发布时间】:2016-04-30 04:46:04
【问题描述】:

我正在尝试从 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 行更改为使用 OpenCV 包含的“768x576.avi”(“768x576.avi”也是上传到上面链接的 GitHub 存储库)

-微小的间距和注释更改

-添加“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。

到目前为止,这是我的问题:

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

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

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

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

但到目前为止,让这些示例正常工作或作为我正在尝试的 Matlab 到 Octave 翻译的指南还不是很成功。

非常感谢 Octave 专家或已在 Matlab 和 Octave 中使用计算机视觉的人员提供的任何帮助。

【问题讨论】:

    标签: matlab computer-vision octave matlab-cvst


    【解决方案1】:

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

    一般规则是,Octave 缺少匹配 Matlab 工具箱,当它有东西时,你需要安装 Octave packages separately

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

    【讨论】:

    • 感谢您的信息。所以我现在要提出的其他问题是:-您认为将上述 Matlab 程序翻译成 Octave 是一项无望的任务吗? - 查看 Octave 的“图像”包,功能似乎类似于 Matlab 中的“视觉”,它们是非常接近还是完全不同? (在下一篇文章中继续,我的字符快用完了......)
    • -我非常精通 OpenCV C++ 和 Visual Basic(使用 Emgu CV 作为 OpenCV 的包装器)。在一个屏幕上阅读 Matlab 示例并在我的另一个屏幕上将其翻译成 OpenCV C++/VB 会更好吗,即使我无法运行 Matlab 示例?或者你会建议我先继续尝试将 Matlab 示例转换为工作 Octave 示例吗?在这一点上,我倾向于跳过 Octave 并直接翻译成 C++ 或 VB,因为我几乎没有 Octave 经验。 (继续下一篇文章,我的字符又用完了......)
    • 再次感谢您提供的信息,我不希望任何人为我将 Matlab 程序逐行翻译成 Octave,当然这取决于我,但如果你能做一些建议提供进一步的方向,将不胜感激,谢谢!
    • 很遗憾,我没有足够的专业知识来帮助您。我对 Octave 的体验仅限于核心功能集。也有可能有帮助的视频包。
    • 感谢您的帮助,感谢您迄今为止的帮助。在我将 Matlab 程序翻译成 C++ 或 VB 之前,还有其他人可以提供任何进一步的建议吗??
    猜你喜欢
    • 2016-08-18
    • 2011-09-13
    • 2018-11-07
    • 1970-01-01
    • 1970-01-01
    • 2011-10-18
    • 2017-08-26
    • 2018-02-21
    • 2017-09-20
    相关资源
    最近更新 更多