點雲插值:三維平面參數肯定-不共線三點的平面方程

  參考連接:三維空間中的平面方程              
.net

  這個連接是錯誤的: http://blog.csdn.net/PengPengBlog/article/details/52774421   
3d

 

	//獲取平面方程//Ax + By + Cz + D
	std::vector<float> getPlaneParam(const std::vector<pcl::PointXYZ> &votexs)
	{
		std::vector<float> abcd;
		if (votexs.size()<3){
			return abcd;
		}
		else
		{//取前三個點計算平面
			float x1, x2, x3, y1, y2, y3, z1, z2, z3;
			x1 = votexs[0].x; x2 = votexs[1].x; x3 = votexs[2].x;
			y1 = votexs[0].y; y2 = votexs[1].y; y3 = votexs[2].y;
			z1 = votexs[0].z; z2 = votexs[1].z; z3 = votexs[2].z;
			float A = y1*(z2-z3)+y2*(z3-z1)+y3*(z1-z2);
			float B = z1*(x2-x3)+z2*(x3-x1)+z3*(x1-x2);
			float C = x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2);
			float D = -(x1*(y2*z3-y3*z2)+ x2*(y3*z1-y1*z3) + x3*(y1*z2 -y2*z1) );
			abcd.push_back(A); abcd.push_back(B); abcd.push_back(C);
			abcd.push_back(D);
		}

		return abcd;
	}

以茶壺爲例,點雲插值的效果以下:blog

頂點點雲:
get

Mesh圖像:
class

插值點雲:
float

相關文章
相關標籤/搜索