For object tracking of many objects.....

Dear Sir,
I am working now on "Object Tracking Project"... I found this website on Mathworks http://www.mathworks.it/it/help/vision/examples/motion-based-multiple-object-tracking.html and this website help me to know some information that I must know them about each object...This Program required from me to make this Function "tracks = initializeTracks" BUT... I found problem when I go to use this Function " predictNewLocationsOfTracks ()" where I don't know the "Length of tracks" so I find ERROR in the "FOR LOOP" in this function..... I would like to know "How can I know the number of tracks??"
Thank you very much
Have Great and Fantastic day

回答(1 个)

The example has all the necessary code, including initializeTracks.
Please note that at the very end of the example, there is an "end" right above the "Was this topic helpful?". That "end" is needed. You need to put all the routines in the same file, and the structure should look like
function multiObjectTracking()
[... ] code here
function obj = setupSystemObjects()
[...] code here
end
function tracks = initializeTracks()
[...] code here
end
[...] more function / end pairs here
end %the stray "end" from the bottom of the page
When all the function/end pairs are created like this, "tracks" will become a variable that is shared with all of the routines.

6 个评论

Dear Walter,
Thank you very much on your interesting....
I made such as you required from me but I have the same problem.. "length (tracks) = 0" in "predictNewLocationsOfTracks (tracks)" Function and "nTracks = 0" in function [assignments, unassignedTracks, unassignedDetections] = detectionToTrackAssignment(tracks,centroids)... I would like to know if there is anything that I can do it for solving this problem....
Thank you very much
Have Great and Fantastic Day
Dear Walter,
I think my problem in this code that the knowing of "legnth (tracks)"... if I have this information that I think that my problem will be solved....
Thank you very much
length(tracks) is intended to start out as 0.
I believe that it detects objects to be tracked as it goes.
Dear Walter,
Thank you very much on your interesting....
The program is run already but I didn,t see the "labels" or anything indicates to the tracks in the "displays" of the Video or forground mask.... I think that the problem is the value of "length(tracks)" and "nTracks" = 0 in all of frames.... I think that this is happened because in this function " "predictNewLocationsOfTracks (tracks)":
for i = 1: length (tracks) % length (tracks) = 0 already so the value of "nTracks" is always with "0" in all of frames... This is the problem.... I would like to help me in solving this problem....
Thank you very much
No, createNewTracks() turns detected objects into tracks. The program detects and tracks objects as it goes, and even deletes objects that have gone away for too long. It might take a few steps before a detected object is promoted to be a "track".
Dear Walter,
Thank you very much on your interesting...
In my code, I wanted to recognize on the tracks of three objects so I certain their positions (left, bottom, width, height) through I put them inside "3 boxes"... I have the problem to display tracks that have been visible, display predicted bounding box or create labels for objects in "displayTrackingResults" function after I made run of the code where I noted that the program isn't going to the " if ~isempty(reliableTracks)" in "displayTrackingResults" function... when I tried to make some changes by putting "tracks1= tracks" in "createNewTracks" function, change the "minVisibleCount" with "low" value in the "function displayTrackingResults(frame, mask, tracks1,obj)", I noted that the program "run" after if statement "if ~isempty(reliableTracks)" but it give me this error:
Error using insertObjectAnnotation>crossCheckInputs (line 247) The number of columns in POSITION must be 4 for the 'rectangle' shape, or 3 for the 'circle' shape.
Error in insertObjectAnnotation>validateAndParseInputs (line 161) crossCheckInputs(shape, position, numLabels, color, textColor);
Error in insertObjectAnnotation (line 99) [RGB, shape, position, label, color, textColor, ...
Error in displayTrackingResults (line 67) frame = insertObjectAnnotation(frame, 'rectangle',bboxes, labels);
Error in Demo (line 272) displayTrackingResults(frame, mask, tracks1,obj);
I would like you to help me to fix this error to have the ability to see the tracks that have been visibl, display predicted bounding box or create labels for objects in "displayTrackingResults"....
Thank you very much
Have Great and Fantastic Day
Mohamed Elwakdy

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Tracking and Motion Estimation 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by