1 | initial version |

A plane can be defined by 3 points, that are not on the same line. This seems to be an edge case for the algorithm, that should actually fail with infinitely many solutions. Although extrapolations can be made for point on the same line, the error seems to be prohibitely large. For points not on the line, the extrapolations are insane.

A workaround seems to be to add a small value, so that the input data are not precisely on the same line. In the example in the question, adding `0.0001`

to the first row produced this results:

```
X Y Z'
---- ---- -----
4 7 463.17
5 7 553.736
7 7 734.869
8 7 825.435
```

Adding this to the program might be easier, but it would more correct to avoid such cases or to use simple linear regression in this case.

Copyright OpenCV foundation, 2012-2018. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.