For object tracking of many objects.....

1 view (last 30 days)
Mohamed Elwakdy
Mohamed Elwakdy on 19 Feb 2013
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

Answers (1)

Walter Roberson
Walter Roberson on 19 Feb 2013
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 Comments
Walter Roberson
Walter Roberson on 19 Feb 2013
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".
Mohamed Elwakdy
Mohamed Elwakdy on 20 Feb 2013
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

Sign in to comment.

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!