OpenPTV / openptv

This is our central repository, holding only the community approved code and documentation
www.openptv.net
GNU Lesser General Public License v3.0
37 stars 28 forks source link

Add y-sorting to the TargetArray class. #131

Closed yosefm closed 7 years ago

yosefm commented 7 years ago

This step needs to be performed after detection if the result is to be used in OpenPTV-Python for tracking and other stuff. The tracking algorithm does target searches. It assumes they are sorted on Y so it can do a binary search.

I used to do this phase inside my correspondences binding, because that's where it starts to matter, but it shouldn't be there, and the correspondences binding I'll eventually contribute will be much simpler than what I have now.

alexlib commented 7 years ago

Simple and clear. recommend to merge.

question - when we do two tests - do we need to do the same test in binded version and in the C version?

alexlib commented 7 years ago

the tests pass

sorting on the Y coordinate in place ... ok

yosefm commented 7 years ago

We don't necessarily have do the same test twice, but sometimes the simplest way to test the binding is to check that it does what the C version does. Only calling it to see that it runs through is not enough because some input/output errors in the Python/C/Python chain will run through but give back garbage. In this case, there is no way to check that the method actually does something except to check that it did something.