Undefined function or method 'assignDet​ectionsToT​racks' for input arguments of type 'double'

Hi,I don't understand where is the error
function [assignments, unassignedTracks, unassignedDetections] = detectionToTrackAssignment()
nTracks = length(tracks);
nDetections = size(centroids, 1);
% Compute the cost of assigning each detection to each track.
cost = zeros(nTracks, nDetections);
for i = 1:nTracks
cost(i, :) = distance(tracks(i).kalmanFilter, centroids);
end
% Solve the assignment problem.
costOfNonAssignment = 20;
[assignments, unassignedTracks, unassignedDetections] =assignDetectionsToTracks(cost, costOfNonAssignment);
end

1 件のコメント

This is the error Undefined function or method 'assignDetectionsToTracks' for input arguments of type'double'

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2013 年 10 月 27 日
You don't have the function assignDetectionsToTracks. Type this in the command window:
which -all assignDetectionsToTracks
if it's there, it will say so. But most likely you don't have that function. Why do you think that you should have it?

12 件のコメント

I have this situation:
function [assignments, unassignedTracks, unassignedDetections] = detectionToTrackAssignment()
nTracks = length(tracks);
nDetections = size(centroids, 1);
% Compute the cost of assigning each detection to each track.
cost = zeros(nTracks, nDetections);
for i = 1:nTracks
cost(i, :) = distance(tracks(i).kalmanFilter, centroids);
end
% Solve the assignment problem.
costOfNonAssignment = 20;
[assignments, unassignedTracks, unassignedDetections] = assignDetectionsToTracks(cost, costOfNonAssignment);
end
maybe this function does not exist in my matlab?
Image Analyst
Image Analyst 2013 年 10 月 29 日
Well, wherever you have it, it's not being seen by MATLAB. Make sure it's on the search path. Do what I said and issue the which command right before you try to call it. It will probably say it can't find it. What folder and m-file is that code you gave in?
luigi
luigi 2013 年 10 月 29 日
sorry but I don't understand the last question. Maybe the folder in on the desktop. I think that the name assignDetectionsToTracks should be the same of detectionToTrackAssignment,or not ?
Wayne King
Wayne King 2013 年 10 月 29 日
which release are you using? Do you have the Computer Vision System Toolbox installed?
Image Analyst
Image Analyst 2013 年 10 月 29 日
luigi, I have no idea. It's easy enough to try it and see.
luigi
luigi 2013 年 10 月 29 日
編集済み: Image Analyst 2013 年 10 月 30 日
I checked in set path and i have the Computer Vision System Toolbox installed. The version of the computer vision toolbox is 4.0, maybe should be updated
Image Analyst
Image Analyst 2013 年 10 月 30 日
The current name is assignDetectionsToTracks - not sure if they changed that or not. Maybe you or someone typed it in and just got it wrong? Did you try to switch names and see if that worked? Of course upgrading is usually the best approach so I'd encourage you to do that.
luigi
luigi 2013 年 10 月 30 日
Hi,I upgraded matlab and I haven't that kind of error
Image Analyst
Image Analyst 2013 年 10 月 31 日
But detectionToTrackAssignment is not a function in the current version, so why would your code suddenly no longer complain about that function?
luigi
luigi 2013 年 10 月 31 日
before I had computer vision toolbox 4.0. After the update I have computer vision toolbox 5.0
Image Analyst
Image Analyst 2013 年 10 月 31 日
I know, but detectionToTrackAssignment is not in there. So unless you changed the name in your code, it will still complain.
luigi
luigi 2013 年 10 月 31 日
I haven't changed the name

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeIntroduction to Installation and Licensing についてさらに検索

質問済み:

2013 年 10 月 24 日

コメント済み:

2013 年 10 月 31 日

Community Treasure Hunt

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

Start Hunting!

Translated by