solveZ returns wrong result on underdetermined systems (Bug #2108)


Added by Vincent Rabaud over 12 years ago. Updated over 12 years ago.


Status:Done Start date:2012-06-28
Priority:Blocker Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:core
Target version:2.4.2
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

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

Revision fd901d83
Added by Vadim Pisarevsky over 12 years ago

fixed #2108 (thanks to Vincent for the report and proposed solution)

Revision 87e0c261
Added by Roman Donchenko about 11 years ago

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

Also available in: Atom PDF