I have a matrix of M measurements and N objects. Each cell contains a cost of assignment a particular measurement to the object. I want to assign them optimally. As the condition, only one measurement can go to one object, and one measurement can go to only one object. I want to set some cost threshold, in effect there may be some measurement or object, which is not assigned at all. How can I do it? I was recently thinking of the auction algorithm, which however will never leave any unassigned measurement or object. If that is false, correct me please. Or help with some alternative solution. Thanks for your time!
The Hungarian Algorithm should be suitable for this case. You have already generated the cost matrix that describes the cost of each measurement to each object. The algorithm determines the assignments that yield the minimum total cost. It can handle cases with more measurements that objects (false positives) and more objects than measurements (when an object isn't detected). (These cases have non-square cost matrices.)
This will assign all measurements if the number of objects if M measurements <= N objects. However, you can then go back and look at the individual costs of the assignments and apply a threshold to weed out matches with low scores.
There are many libraries in various programming languages for this algorithm. One I've used and is well documented is the munkres python library.