Plane construction from 3D Points in OpenCV

前端 未结 2 672
梦毁少年i
梦毁少年i 2021-01-16 21:29

I would like to construct a plane from a list of 3D points in OpenCV. I would like to obtain the result by finding the four parameters in the following form: Ax+By+Cz+

2条回答
  •  深忆病人
    2021-01-16 22:17

    If the data does not contain outliers and does not contain more than one plane. Furthermore, all the points lay exactly on a plane (the data is not noisy), it is so simple:

    1. Pick up three random points which are not lay on the same line.
    2. solve this system of linear equations:
    x1+by1+cz1+d = 0
    x2+by2+cz2+d = 0
    x3+by3+cz3+d = 0
    

    then :

    A= Choose any number you want in order to match your scale. 
    B= b*A 
    C= c*A 
    D= d*A
    

    If the data is noisy or contains outliers or more than plane (or both) you need then some kind of Robust Estimation techniques. Search for RANSAC as a start.

    if you are familar with RANSAC you can see this example here (it is about lines you can simply generlize it to deal with plane)

提交回复
热议问题