Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

something wrong when run TestSimpleTracker.m #1

Open
youxiaobo opened this issue Jul 3, 2020 · 4 comments
Open

something wrong when run TestSimpleTracker.m #1

youxiaobo opened this issue Jul 3, 2020 · 4 comments

Comments

@youxiaobo
Copy link

youxiaobo commented Jul 3, 2020

hi Jean,
Very nice algorithm. However, I have a question I hope you can help me with. Because there is no munkres.m file,I download munkres.m from this link munkres-assignment-algorithm .
when I run TestSimpleTracker.m, there is some error message as follows:

   Index in position 1 exceeds array bounds (must not exceed 8).
   error in hungarianlinker (line 116)
        target_distances(i) = sqrt ( D ( i , target_indices(i)) );

then I step into hungarianlinker.m, from this code: [ target_indices total_cost ] = munkres(D);, I get the result "target_indices" which is a matrix. But I didn't understand the code below.

image

why do you use target_indices(i) rather than target_indices(i,j)?
Is there something wrong with the munkres.m? can you please offer munkres.m for me?

Look forward to your reply!

Regards,
You Bo

@katherine-brown
Copy link

Hi Jean,

I am having the same issue - it seems the test code no longer works out of the box. I am running Matlab 2020a, perhaps that is the issue?

I would really appreciate any help you can give.

thank you,
K. Brown

@lipilian
Copy link

lipilian commented Jan 6, 2021

I modify the code to
D = D(:)
target_distance(i) = sqrt(D1(i));

@juldub07
Copy link

juldub07 commented Feb 7, 2023

@youxiaobo @katherine-brown, @lipilian is correct. Also, target_indices needs to be converted to double or single before line 103 or else -1s become 1s.
target_indices = double(target_indices); target_indices ( target_indices == 0 ) = -1;

@SamuelPoincloux
Copy link

SamuelPoincloux commented Mar 3, 2023

Apparently we get this error if we use an old version of the munkres.m code, which outputs the assignment (here "target_indices") as a matrix and not a vector.
It can be solved without modifying the code by using the latest version available here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants