Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

SVD for plane fitting - Not getting right results

$
0
0
I am trying to fit a plane via SVD and was hoping someone could point out the errors in my code. The plane I generate does not seem right at all. I am very sure the points I have filled in are correct. vector Crds; // Fill up Crds Mat matOnes = Mat::ones(Size(1, Crds.size()), CV_32F); Mat homoCrds, matCrds = Mat(Size(3, Crds.size()), CV_32F, Crds.data()); hconcat(matCrds, matOnes, homoCrds); // homogenous coordinates Mat w, u, vt; SVD::compute(homoCrds, w, u, vt); Mat temp = u.row(Crds.size() - 1); // normal vector of plane = eigenvector with the lowest eigenval supPixel[id].plane = temp(Rect(0, 0, 3, 1)).clone();

Viewing all articles
Browse latest Browse all 19555

Trending Articles