Revision 20876 trunk/extensions/extGeoreferencing/src/org/gvsig/georeferencing/process/geotransform/GeoTransformProcess.java
GeoTransformProcess.java | ||
---|---|---|
45 | 45 |
import org.gvsig.raster.util.RasterToolsUtil; |
46 | 46 |
|
47 | 47 |
import Jama.Matrix; |
48 |
import Jama.QRDecomposition; |
|
48 | 49 |
|
49 | 50 |
/** |
50 | 51 |
* Clase que representa una transformacion polinomial para la convertir las |
... | ... | |
214 | 215 |
} |
215 | 216 |
} |
216 | 217 |
} |
218 |
|
|
217 | 219 |
Matrix matrixResult= new Matrix(matrixD); |
218 | 220 |
Matrix matrixResult2= new Matrix(matrixD2); |
219 | 221 |
pixelToMapCoefY=solveSystem(matrixResult,result); |
... | ... | |
232 | 234 |
double [][]a= new double[columResult.length][1]; |
233 | 235 |
for (int i=0; i<columResult.length;i++) |
234 | 236 |
a[i][0]=columResult[i]; |
235 |
Matrix c= matrix.solve(new Matrix(a)); |
|
237 |
Matrix c=null; |
|
238 |
|
|
239 |
if(matrix.det()==0.0){ |
|
240 |
QRDecomposition descomposition = new QRDecomposition(matrix); |
|
241 |
Matrix A= new Matrix(a); |
|
242 |
c=descomposition.solve(A); |
|
243 |
} |
|
244 |
else |
|
245 |
c= matrix.solve(new Matrix(a)); |
|
236 | 246 |
for (int i=0; i<columResult.length;i++) |
237 | 247 |
xCoef[i]=c.get(i,0); |
238 | 248 |
return xCoef; |
Also available in: Unified diff