Revision 18305 trunk/extensions/extRemoteSensing/src/org/gvsig/remotesensing/georeferencing/geotransform/GeoTransformProcess.java

View differences:

GeoTransformProcess.java
114 114
		
115 115
		// Obtencion del polinomio de transformaci?n en y
116 116
		getPolinomialCoefY();
117
	
117 118
	}
118 119

  
119 120

  
......
160 161

  
161 162
					// Se calcula el resultado de !!!!!
162 163
					for(int v=0; v<geo_points.length;v++)
163
						result[k]+=(Math.pow(geo_points[v][0],i-j)* Math.pow(geo_points[v][1],exp[filas][1]))*image_points[v][0];				
164
						result[k]+=(Math.pow(geo_points[v][0],i-j)* Math.pow(geo_points[v][0],exp[filas][0]))
165
						* (Math.pow(geo_points[v][1],j)* Math.pow(geo_points[v][1],exp[filas][1]))*image_points[v][0];				
164 166
				}
165 167
	
166 168
			}
......
171 173
		} catch (BadDeteminantException e) {
172 174
			// Resolver sistema de ecuaciones o por otro metodo
173 175
		}
174
	
175 176
	}
176 177
	
177 178
	
178 179
	// TO DO: Ver la manera de unificar con setDxGeneral(Parametrizar un metodo general)..... Estudiar optimizaciones!!! 
180
	// Cambios necesarios para el caolculo de coeficientes para coordenadas y
179 181
	public void setDyGeneral(){
180
		double matrixDx[][]= new double [minGPC][minGPC]; 
182
		double matrixDy[][]= new double [minGPC][minGPC]; 
181 183
		double result[]= new double[minGPC];
182 184
		int exp[][]=new int[minGPC][2];
183 185
		int k=-1;
......
189 191
			for(int j=0; j<=i; j++){
190 192
				k++;
191 193
				for(int v=0; v<geo_points.length;v++)
192
					matrixDx[filas][k]+=(Math.pow(geo_points[v][0],i-j)* Math.pow(geo_points[v][0],exp[filas][0]))
194
					matrixDy[filas][k]+=(Math.pow(geo_points[v][0],i-j)* Math.pow(geo_points[v][0],exp[filas][0]))
193 195
							* (Math.pow(geo_points[v][1],j)* Math.pow(geo_points[v][1],exp[filas][1]));			
194 196
				// Para la fila 0 se guardan los exponentes
195 197
				if(filas==0){
......
198 200

  
199 201
					// Se calcula el resultado de !!!!!
200 202
					for(int v=0; v<geo_points.length;v++)
201
						result[k]+=(Math.pow(geo_points[v][0],i-j)* Math.pow(geo_points[v][1],exp[filas][1]))*image_points[v][0];				
203
						result[k]+=(Math.pow(geo_points[v][0],i-j)* Math.pow(geo_points[v][0],exp[filas][0]))
204
						* (Math.pow(geo_points[v][1],j)* Math.pow(geo_points[v][1],exp[filas][1]))*image_points[v][0];				
202 205
				}
203 206
	
204 207
			}
205 208
		}
206
		Matrix matrixResult= new Matrix(matrixDx);
209
		Matrix matrixResult= new Matrix(matrixDy);
207 210
		try {
208
			coefX=solveSistemforCramer(matrixResult,result);
211
			coefY=solveSistemforCramer(matrixResult,result);
209 212
		} catch (BadDeteminantException e) {
210 213
			// Resolver sistema de ecuaciones opor otro metodo
211 214
		}
212
	
213 215
	}
214 216
		
215 217
	/**

Also available in: Unified diff