|
|
|
|
@ -89,10 +89,7 @@ public class SpaceHomography : MonoBehaviour |
|
|
|
|
right_homo = Matrix4x4.identity; |
|
|
|
|
FindHomography(dst.ToArray(), src.ToArray(), ref right_homo); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void Update() |
|
|
|
|
{ |
|
|
|
|
Shader.SetGlobalMatrix("front_homo", front_homo); |
|
|
|
|
Shader.SetGlobalMatrix("left_homo", left_homo); |
|
|
|
|
Shader.SetGlobalMatrix("right_homo", right_homo); |
|
|
|
|
@ -100,7 +97,7 @@ public class SpaceHomography : MonoBehaviour |
|
|
|
|
Shader.SetGlobalVector("texture_size", texture_size); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void FindHomography(Vector2[] src, Vector2[] dest, ref Matrix4x4 homography) |
|
|
|
|
private void FindHomography(Vector2[] src, Vector2[] dest, ref Matrix4x4 homography) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
float[,] P = new float[,]{ |
|
|
|
|
@ -128,7 +125,7 @@ public class SpaceHomography : MonoBehaviour |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void GaussianElimination(ref float[,] A, int n) |
|
|
|
|
private void GaussianElimination(ref float[,] A, int n) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
int i = 0; |
|
|
|
|
|