Homography No Success

homography (2D) bugs me as it often doesn’t succeed and i don’t understand why or when this happens. also the patch behind is somehow obfuscated :)

is that the same algorithm as the one from the beta nodes? the problem wasn’t showing up there.

Can you give a project file with a problem? What version of gamma do you have?

This is 2020.3 0068

yes, it is the same. The way it works is that the matrix values are the solution of a linear equation system A*x = b with 8 unknowns. the “obfuscated” patch is just setting up the equations and the solver solves it. it could be that the C# solver that we use is a bit more “careful” than the one we use in beta.

so did you test that with real-world data and it doesn’t solve for cases it should? my guess would be that if there is a solution that makes sense, the solver would find it. if not, we have to find another solver, which shouldn’t be hard, every linear algebra lib should have one.

if you look at the screenshot, you see the thing that comes closest to a pattern:

  • if you enter quad corners in the original and screen-space points, there’s no solution
  • if you change only one screen-space y-value then, there’s no solution
  • if you then change any screen-space x-value, it can be solved.
  • this is the workaround i’m using now

i think this is a real-world scenario, because those values are what you enter when doing a simple corner-pin transform.

see this patch:
homography.vl (22.3 KB)