Predator(Zdenek Kalal 的 TLD 算法)RGB 模式跟踪 (Matlab)

发布于 2024-12-05 17:48:59 字数 791 浏览 1 评论 0原文

实际上我正在研究这个算法并且我一直在探索他的代码(目前在Matlab中)。我想知道是否有人尝试过运行这个算法,并且有人可以指出我如何在颜色/RGB 模式下跟踪对象。目前,当我运行它时,它以灰度模式检测对象。

TLD 代码是开源的,位于:https://github.com/zk00006/OpenTLD

我已经探索了代码,有一个文件 img_alloc.m 其中包含:

function img = img_alloc(in,imsize)
% Allocates image structure. 

if ischar(in)
    in = imread(in);
end

if ndims(in) == 3
    img.input = rgb2gray(in);

else
    img.input = in;
end

 %img.input = fliplr(img.input);

if exist('imsize','var')
    img.input = imresize(img.input,imsize);
end

img.blur = img_blur(img.input,2);

语句“img.input = rgb2gray(in);”将输入从 RGB 模式转换为灰度模式。当我试图通过将其更改为“img.input = in;”来阻止它时程序以 RGB 模式启动,但在 1 或 2 帧后卡住。

任何帮助将不胜感激。

PS:我是Matlab编程的新手。

Actually I am studying this algorithm and I have been exploring his code (which is currently in Matlab). I was wondering if anyone has tried running this algorithm and could anyone point me out how to track objects in Color/RGB mode. Currently, when I run it, it detects object in Grayscale mode.

TLD Code is open source and located at : https://github.com/zk00006/OpenTLD

As far as I have explored the code, there is a file img_alloc.m which contains:

function img = img_alloc(in,imsize)
% Allocates image structure. 

if ischar(in)
    in = imread(in);
end

if ndims(in) == 3
    img.input = rgb2gray(in);

else
    img.input = in;
end

 %img.input = fliplr(img.input);

if exist('imsize','var')
    img.input = imresize(img.input,imsize);
end

img.blur = img_blur(img.input,2);

The statement "img.input = rgb2gray(in);" converts input from rgb to grayscale mode. When I try to stop it by changing it to "img.input = in;" the programs starts in RGB mode but gets stuck after 1 or 2 frames.

Any help would be much appreciated.

P.S: I am a newbie in Matlab Programming.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

李不 2024-12-12 17:48:59

那段代码告诉我该算法(或至少这段代码)不处理 RGB 图像。完全没有。

我怀疑这一点的原因很简单,因为它明确检查输入是 1D(灰度)还是 3D(RGB),如果是 3D,则将其转换为灰度。

此外,使用算法处理颜色很少像只提供 3D 矩阵而不是 1D 矩阵那么简单,因为额外的维度通常意味着至少需要一些额外的工作。

That piece of code tells me that the algorithm (or atleast this code) does not handle RGB images. At all.

My reason to suspect this is simply because it explicitly checks if the input is 1D (grayscale) or 3D (RGB) and if it is 3D it converts it into grayscale.

Also, handling color with an algorithm is seldom as simple as just feeding it a 3D matrix instead of 1D matrix since the extra dimensions usually mean that at least some additional work is required.

土豪我们做朋友吧 2024-12-12 17:48:59

有两个组件需要修复:
1. 1BIT 特征 - 您必须将它们应用于不同的颜色平面(也就是说,每个特征必须位于其中一个平面中)
2. Lucas Kanade追踪器;它实际上在彩色方面效果更好(如果您的输入没有噪音;您将需要比灰度更好质量的相机),但 predator 使用的 OpenCV 不包含版本。 (不,我不知道是否有开源的)。

There are two components that need fixing:
1. the 1BIT features - you'll have to make them apply to the different color planes (that is, each feature will have to be in one of the planes)
2. The Lucas Kanade tracker; it actually works better in color (if your input is not noisy; you will need a better quality camera than for grayscale), but OpenCV used by predator does not include a version. (and no, I don't know if an open source one is available).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文