The simplest solution, which will work in most situations, is to compare the position of the faces. Faces belonging to the same person should appear close to one another, if not in almost the same position.
The reason, the order of the faces change is because it is the order in which the faces were found. Relatively slight changes in relative positions may affect this order.
Thank you for your reply! To be honest I was hoping for you (or anyone willing to help) to say otherwise. I will try to see what I can do.
The thing is that the coordinates of the faces keep on switching between themselves while there are 2 faces on screen. Maybe cv.jit.faces looses count to often (due to bad light) and resets? And this is the reason why it is hard to keep track of every face.
I was thinking that as long as there was an order, I knew that the first face to be detected to be face A, let’s say, and second face to be face B. But as they switch almost every 2 seconds, it’s hell!
Somebody mentioned that you could use an object for blobs sorting and adapt it for faces. Is this a road I should follow? Is there an object like that that I should learn?
PS: I was also thinking about sorting them with jit.bsort, aligning them in relation to their x position. :)