I'm having trouble solving a problem using "Ceres" and I could use some help!
To simplify the problem:
Imagine I have a mesh "A" that I want to scale and rotate (with scale + rotation represented as variables!) to be as close to a mesh "B" as possible.
"Closeness" is defined as the sum of....
- For each vertex in A, find the distance to the nearest vertex in B
- For each vertex in B, find the distance to the nearest vertex in A
Now that first clause is super easy to model.
We can add a residual block for each vertex in "A", deform the vertex within the Cost Function using our variables, and work out their nearest neighbour in "B" - great.
But what about that second clause?
Do we have to do it in a single residual block? Deform every vertex in "A" in the residual block and compare to every vertex in "B"?
Do we create a residual block for every vertex in "B", and then have to re-deform every vertex in "A" within each residual block?
Is there something better that we can do to break down the problem??
Any help would be truly appreciated - I've spent hours thinking about it and I feel kinda stuck!