solvePnP in JuMP (Pose Estimation)

first steps in JuMP
How can I solve the PnP problem using JuMP?

I have a set of labeled 2d points with the corresponding 3d points.
The camera matrix K is known.

For any given R(3-element unit quaternion representing rotation) and T(3-element vector) the reprojection error is
is the mean squared distance between actual 2d-points and projected 3d-points

I want to use Levenberq-marquedt to minimize the reprojection error.
I don’t want to supply gradients or jacobians by hand , but I want some magic to do auto differentiating for me.

This optimization problem need to be re-usable and to run fast…I have about 8ms to spare.

I’m not familiar with this problem area, but can you express what your unknown variables, objective function, and constraints are? Are the objective and constraint functions linear, quadratic, more complicated nonlinear? Equality and/or inequality constraints? When you use JuMP you usually don’t need to worry about what optimization algorithm is getting used to solve the problem, you just have to select an available solver that is capable of solving your problem class based on the characteristics of your objective and constraints. If you can write functions algebraically within JuMP’s macros and they are smooth, well-behaved functions, then JuMP will handle auto-differentiation to calculate the Jacobian and Hessian for you without you having to do anything else.

Are you solving a sequence of related problems (say same structure, but modified initial conditions or constraint parameters) in a loop?

I may be wrong, but I think it’s unlikely you’ll obtain solves in 8ms using JuMP off the shelf. JuMP is designed to be fast but has never been explicitly optimized for the millisecond use case (PRs accepted).

Thanks guys, I think I looked in the wrong place , what I need is
in:
https://github.com/JuliaNLSolvers