solveZ returns wrong result on underdetermined systems (Bug #2108)
Description
The following piece of code shows how it fails: solveZ should call SVD with cv::SVD::FULL_UV. Then again, I did not fix it myself as I am not sure of what the matrix U and Vt are filled with in that case: the docs do not specify it.
cv::Mat A = (Mat_<double>(3,4) << 1, 2, -1, 4, 2, 4, 3, 5, -1, -2, 6, 7);
{
cv::Mat x;
cv::SVD::solveZ(A,x);
std::cout << "try 0 " << std::endl << A*x <<std::endl;
}
{
cv::SVD svd(A);
std::cout << "try 1 " << std::endl << A*svd.vt.row(2).t() <<std::endl;
}
{
cv::SVD svd(A, cv::SVD::FULL_UV);
std::cout << "try 2 " << std::endl << A*svd.vt.row(3).t() <<std::endl;
}
Associated revisions
fixed #2108 (thanks to Vincent for the report and proposed solution)
Merge pull request #2108 from pemmanuelviel:flannMemoryLeak
History
Updated by Vadim Pisarevsky over 12 years ago
thanks! fixed in r8827
- Status changed from Open to Done
Updated by Andrey Kamaev over 12 years ago
- Target version set to 2.4.2