python - Hungarian/munkres algorithm that is able to not link a point based on a max "price" -


i have been using of hungarian/munkres algorithms have been implemented in python (munkres package , scipy linear_sum_assignment specific) , both work (they based on same c implementation think anyway), lacking feature need.

to give context tracking points 1 image another, cost matrix distance between point in image 1 points in image 2.

the issue arises in specific case, if point image 1 lost in second image, new different point detected in image 2, 1 of image 1 points matched new point. , hungarian algorithm working intended, dont me wrong. need hungarian algorithm return "no match" point if point wants match far away. in matlab there example of on file exchange called simpletracker.m, , munkres implementation there can allow case theres no link. if have 2 images 5 particles, might link 2 of particles, cause can use max linking distance parameter decide whether assignment should made or not.

as simple example, if have image1 2 points @ (1,1) , (10,1), , sake of arguement know move 1 pixel right in next image, expect them @ (2,1) , (11,1) in image 2, , hungarian algorithm link correct particles if found in second image. issue arises if 1 of them isnt found, point @ (11,1) , instead random noise point or new point emerging in video found @ (20,1). hungarian algorithm link points (1,1) , (2,1) intended, link (10,1) (20,1).

so in matlab implementation can choose max linking distance value , set cost matrix entries infinity, , if 1 particle can assigned, thats ok , algorithm returns 1 link. in munkres.py package, there called disallowed, prevents assignment every point, algorithm fails. e.g. difference matrix [[1, 9^2],[8^2, 10^2]]. if set 70 max linking distance matrix [[1, disallowed],[64, disallowed]] means valid assignment point 1 in image 1 (1,1) point 1 in image2 (2,1). munkres algorithm return unsolvablematrix: matrix cannot solved! since cant link second point.

so sorry wall of text , possible confusion. im asking if knows of munkres implementation can allow non-assignment has been implemented in python? alternatively, best course of action deal wrongly matched points? thinking try filter out outliers after assignment has been made, or potentially remove columns distance matrix after has been calculated if values disallowed, im not sure if robust enough cover possible cases.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -