Matlab vs Octave 兼容性 - 计算机视觉差异?
Matlab vs Octave Compatibility - computer vision differences?
我正在尝试从 MathWorks 站点获取此 Matlab 示例以使用 Octave 4.0.0:
http://www.mathworks.com/help/vision/examples/motion-based-multiple-object-tracking.html
我为目前已有的内容创建了一个 GitHub 存储库,主要是上述 MathWorks link 的重新格式化版本:
https://github.com/MicrocontrollersAndMore/Matlab_Octave_Multiple_Object_Tracking
到目前为止我所做的唯一更改是:
-制作了一个单独的 main.m 文件到 运行 multiObjectTracking.m
-由于我没有 MathWorks 使用的 'atrium.avi' 文件,我将代码中的 VideoFileReader 行更改为使用“768x576.avi”,它包含在 OpenCV 中('768x576.avi' 也上传到 GitHub 回购 link 上面)
-间距和注释的细微变化
-在main.m和multiObjectTracking.m的开头添加了"pkg load image;",在几个测试Octave计算机视觉程序中我这样做似乎是必要的,否则会报错达到 "library image has been installed but not loaded"
的效果
当前,当我 运行 程序时,出现以下错误:
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
无法识别 'vision' 对象。
据我了解,'vision' 是 Matlab 工具箱的一部分,但我无法确认这一点,因为我无法访问 Matlab。
到目前为止,这是我的问题:
-是否有 'vision' 对象的 Octave 等价物?
-要在 Octave 下得到这个 Matlab 程序 运行ning 我还应该注意哪些其他区别??
我一直在尝试使用以下网站:
http://www.peterkovesi.com/matlabfns/
但到目前为止还没有很成功地让这些示例工作或作为我正在尝试的 Matlab 到 Octave 转换的指南。
非常感谢来自 Octave 专家或那些在 Matlab 和 Octave 中使用计算机视觉的人的任何帮助。
这些是 Computer Vision System Toolbox 中的 Matlab 函数。
一般规则是,Octave 在匹配 Matlab 工具箱方面存在不足,当它有一些东西时,你需要安装 Octave packages separately。
您提供的站点 link 似乎不支持 vision
对象功能。
我正在尝试从 MathWorks 站点获取此 Matlab 示例以使用 Octave 4.0.0:
http://www.mathworks.com/help/vision/examples/motion-based-multiple-object-tracking.html
我为目前已有的内容创建了一个 GitHub 存储库,主要是上述 MathWorks link 的重新格式化版本:
https://github.com/MicrocontrollersAndMore/Matlab_Octave_Multiple_Object_Tracking
到目前为止我所做的唯一更改是:
-制作了一个单独的 main.m 文件到 运行 multiObjectTracking.m
-由于我没有 MathWorks 使用的 'atrium.avi' 文件,我将代码中的 VideoFileReader 行更改为使用“768x576.avi”,它包含在 OpenCV 中('768x576.avi' 也上传到 GitHub 回购 link 上面)
-间距和注释的细微变化
-在main.m和multiObjectTracking.m的开头添加了"pkg load image;",在几个测试Octave计算机视觉程序中我这样做似乎是必要的,否则会报错达到 "library image has been installed but not loaded"
的效果当前,当我 运行 程序时,出现以下错误:
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
无法识别 'vision' 对象。
据我了解,'vision' 是 Matlab 工具箱的一部分,但我无法确认这一点,因为我无法访问 Matlab。
到目前为止,这是我的问题:
-是否有 'vision' 对象的 Octave 等价物?
-要在 Octave 下得到这个 Matlab 程序 运行ning 我还应该注意哪些其他区别??
我一直在尝试使用以下网站:
http://www.peterkovesi.com/matlabfns/
但到目前为止还没有很成功地让这些示例工作或作为我正在尝试的 Matlab 到 Octave 转换的指南。
非常感谢来自 Octave 专家或那些在 Matlab 和 Octave 中使用计算机视觉的人的任何帮助。
这些是 Computer Vision System Toolbox 中的 Matlab 函数。
一般规则是,Octave 在匹配 Matlab 工具箱方面存在不足,当它有一些东西时,你需要安装 Octave packages separately。
您提供的站点 link 似乎不支持 vision
对象功能。