'solve' fucntion works badly on ill-conditioned matrices (atleast numpy works better) (Feature #2655)


Added by Alexander Mordvintsev about 12 years ago. Updated over 9 years ago.


Status:Open Start date:2012-12-21
Priority:Low Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:core
Target version:-
Difficulty: Pull request:

Description

Related issue: #2643

import numpy as np
import numpy.linalg as la
import cv2

A = np.float64([[8.193152026529024541e+07, 3.256524952090702206e+07, 1.280089998874972807e+05],
                [3.256524952090702206e+07, 1.432970570196110941e+07, 5.087970962876405974e+04],
                [1.280089998874972807e+05, 5.087970962876405974e+04, 2.000000000000000000e+02]])
B = np.float64( [3.543302075289976597e+07, 1.408204120224751532e+07, 5.536028820708069543e+04] )

print la.svd(A)[1]

x = la.solve(A, B)
x1 = cv2.solve(A, B, flags=cv2.DECOMP_QR)[1].ravel()
x2 = cv2.solve(A, B, flags=cv2.DECOMP_LU)[1].ravel()

print la.norm( A.dot(x) - B )  # 0.000149714585044  
print la.norm( A.dot(x1) - B ) # 0.0858401225198    
print la.norm( A.dot(x2) - B ) # 219.692813301      

Related issues

related to Bug #2643: stereoRectifyUncalibrated returns degenerate homography m... Done 2012-12-18

Associated revisions

Revision 8114e071
Added by Andrey Pavlenko almost 11 years ago

Merge pull request #2655 from akarsakov:ipp_fix_pyramid

History

Updated by Alexander Mordvintsev about 12 years ago

Not sure if this should be fixed at all (see fix to #2643)

  • Priority changed from Normal to Low

Updated by Kirill Kornyakov almost 12 years ago

Looks more like a feature request. Please correct me if I'm wrong.

  • Tracker changed from Bug to Feature

Updated by Maksim Shabunin over 9 years ago

Issue has been transferred to GitHub: https://github.com/Itseez/opencv/issues/4475

Also available in: Atom PDF