https://doi.org/10.5201/ipol.2020.245
Raw File
Tip revision: 5f23fb0b6e1d50d996ac54daaa7e637e5d8decaf authored by Software Heritage on 05 May 2020, 00:00:00 UTC
ipol: Deposit 1363 in collection ipol
Tip revision: 5f23fb0
linalg.h
/*
IPOL SIFT
Copyright (C) 2014, Ives Rey-Otero, CMLA ENS Cachan

<ives.rey-otero@cmla.ens-cachan.fr>

Version 20141201 (December 1st, 2014)

This C ANSI source code is related to the IPOL publication

    [1] "Anatomy of the SIFT Method."
        I. Rey Otero  and  M. Delbracio
        Image Processing Online, 2013.
        http://www.ipol.im/pub/algo/rd_anatomy_sift/

An IPOL demo is available at
        http://www.ipol.im/pub/demo/rd_anatomy_sift/
*/

#ifndef LINALG_H
#define LINALG_H

// 3x3 matrices are represented by arrays of length 9.
//                   a[0] a[1] a[2]
// The ordering  is: a[3] a[4] a[5]
//                   a[6] a[7] a[8]


// Apply a homography given by a 3x3 matrix h to a 2D point
// y: output point
// h: homography
// x: input point
void apply_homography(double y[2], double h[9], double x[2]);


// Compute the inverse of a 3x3 matrix
// o: output matrix
// i: input matrix
void matrix_33_inverse(double o[9], double i[9]);


// Compute the product of two 3x3 matrices
// ab: output product
// a, b: input matrices
void matrix_33_product(double ab[9], double a[9], double b[9]);


// Compute the minimum and maximum of on array of doubles
// x: pointer to the first element of the array
// n: length of the array
double min_n(double *x, int n);
double max_n(double *x, int n);


// Parse a string for doubles
// nmax: maximum number of doubles to read from the input string
// ss: input string
// *n: output number of doubles that have actually been read
double *alloc_parse_doubles(int nmax, const char *ss, int *n);

// Compute two rectifying similarities from an affine fundamental matrix
void rectifying_similarities_from_affine_fundamental_matrix(float s1[3],
        float s2[3],
        double f[5]);
#endif //LINALG_H
back to top