solvePnPGeneric() solution order

Are the poses returned by solvePnPGeneric() supposed to be ordered according to reprojection errors? Sorting by reprojection errors is an explicit, documented guarantee of solveP3P(), but not of solvePnPGeneric(). However, looking at the source code for solvePnP() I can see it calls solvePnPGeneric() and takes rvecs[0] and tvecs[0]without checking for reprojection error.

I’m currently doing the following even though it currently always chooses index 0:

        const int solution_index = err0 <= err1 ? 0 : 1;
        marker_rvecs[id] = rvecs[solution_index];
        marker_tvecs[id] = tvecs[solution_index];

The presence or absence of any ordering guarantees is something I think the documentation should address explicitly. Could I maybe get an official word on this?

I’m not the official word.

If you would like that, I would recommend checking OpenCV’s github for related issues. If you see none, you should file an issue and request a change to the docs. Make sure that you get answers justified by references to the source code, ideally from the core developers.