【发布时间】: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