En la matriz original la matriz identidad a la

Info icon This preview shows pages 25–30. Sign up to view the full content.

* En la matriz original la Matriz Identidad ' * A la derecha la matriz de Paso = Inversa de la Matriz normal For i = 0 To Matriz1.GetUpperBound(0) factor = Matriz1(i, i) 'En la matriz original sólo se divide la diagonal porque el resto es cero (ya es diagonal) 'Si quieres ver cómo se modifica la matriz original activa la siguiente línea Matriz1(i, i) = Matriz1(i, i) / factor For j = 0 To Matriz1.GetUpperBound(0) MatrizInversa(i, j) = Matriz2(i, j) / factor Next 11
Image of page 25

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

Curso 2009-2010 Herramientas Informáticas Geotecnologías Cartográficas en Ingeniería y Arquitectura para el Geoprocesado Next 'Es necesario esta sentencia para que la función devuelva la matriz calculada Return MatrizInversa End Function Ejemplo de uso: Dim A(2, 2) As Double A(0, 0) = 2 : A(0, 1) = 3 : A(0, 2) = 2 A(1, 0) = 4 : A(1, 1) = 1 : A(1, 2) = 5 A(2, 0) = 3 : A(2, 1) = 3 : A(2, 2) = 1 Dim R_Inv As Double(,) = Inversa(A) Dim Identidad As Double(,) = Producto(A, R_Inv) 2.5.2.- Cálculo de los parámetros y remuestreo En primer lugar debes incluir en la sección de Declaraciones del formulario la definición de la estructura Punto : Public Structure Punto Dim X As Double Dim Y As Double End Structure Inserta el siguiente código en una nueva opción del menú Transformaciones llamada Proyectiva. Utiliza para probarlo la imagen Malla.bmp. Recuerda que debes abrir la imagen y luego cargar la matriz. 12
Image of page 26
T RATAMIENTO G EOMÉTRICO B ENJAMÍN A RIAS P ÉREZ P ROCESAMIENTO D IGITAL DE I MÁGENES Dim Origen(3), Destino(3) As Punto Origen(0).X = 50 Origen(0).Y = 50 Origen(1).X = 390 Origen(1).Y = 50 Origen(2).X = 390 Origen(2).Y = 440 Origen(3).X = 50 Origen(3).Y = 440 Destino(0).X = 64 Destino(0).Y = 66 Destino(1).X = 296 Destino(1).Y = 120 Destino(2).X = 401 Destino(2).Y = 441 Destino(3).X = 27 Destino(3).Y = 462 'Declaración de matrices Dim A(Origen.GetUpperBound(0) * 2 + 1, Origen.GetUpperBound(0) * 2 + 1) As Double Dim L(Origen.GetUpperBound(0) * 2 + 1, 0) As Double 'Declaración de variables auxiliares Dim i, j As Short 'Matriz de diseño For i = 0 To Origen.GetUpperBound(0) 'Primera fila A(2 * i, 0) = (Origen(i).X) 13
Image of page 27

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

Curso 2009-2010 Herramientas Informáticas Geotecnologías Cartográficas en Ingeniería y Arquitectura para el Geoprocesado A(2 * i, 1) = (Origen(i).Y) A(2 * i, 2) = 1 A(2 * i, 3) = 0 A(2 * i, 4) = 0 A(2 * i, 5) = 0 A(2 * i, 6) = -(Origen(i).X) * (Destino(i).X) A(2 * i, 7) = -(Origen(i).Y) * (Destino(i).X) 'Segunda fila A(2 * i + 1, 0) = 0 A(2 * i + 1, 1) = 0 A(2 * i + 1, 2) = 0 A(2 * i + 1, 3) = (Origen(i).X) A(2 * i + 1, 4) = (Origen(i).Y) A(2 * i + 1, 5) = 1 A(2 * i + 1, 6) = -(Origen(i).X) * (Destino(i).Y) A(2 * i + 1, 7) = -(Origen(i).Y) * (Destino(i).Y) Next 'Matriz de términos independientes For i = 0 To Origen.GetUpperBound(0) L(2 * i, 0) = Destino(i).X L(2 * i + 1, 0) = Destino(i).Y Next 'Cálculo de parámetros Dim N As Double(,) = Producto(Transpuesta(A), A) Dim N_inv As Double(,) = Inversa(N) Dim T As Double(,) = Producto(Transpuesta(A), L) Dim X As Double(,) = Producto(N_inv, T) Dim Rojo, Verde, Azul As Byte Dim bmp As New Bitmap(Matriz.GetUpperBound(0) * 2, Matriz.GetUpperBound(1) * 2) Dim img As Image img = CType(bmp, Image) PictureBox2.Image = img 14
Image of page 28
T RATAMIENTO G EOMÉTRICO B ENJAMÍN A RIAS P ÉREZ P ROCESAMIENTO D IGITAL DE I MÁGENES Panel2.AutoScrollMinSize = PictureBox2.Image.Size PictureBox2.Refresh() For i = 0 To Matriz.GetUpperBound(0) For j = 0 To Matriz.GetUpperBound(1) Rojo = Matriz(i, j).R Verde = Matriz(i, j).G
Image of page 29

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

Image of page 30
This is the end of the preview. Sign up to access the rest of the document.
  • Fall '18
  • Pixel, NeXT, Procesamiento digital de imágenes, BENJAMÍN ARIAS PÉREZ

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern