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.
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.