source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/BlueCCal/MultiCamSelfCal/Ransac/lin_fm.c @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 571 bytes
Line 
1#include <math.h>
2#include "mex.h"
3#include "matrix.h"
4
5void mexFunction( int dstN, mxArray **aDstP, int aSrcN, const mxArray **aSrcP )
6{
7  double *u = mxGetPr(aSrcP[0]);
8  double *p, *s;
9  int len = mxGetN(aSrcP[0]);
10  int i,k,l,pos;
11 
12  aDstP[0] = mxCreateDoubleMatrix(len, 9, mxREAL );
13  p = (double *)mxGetData(aDstP[0]);
14
15  s = u;
16  for (i = 0; i < len; i++)
17    {
18      pos = 0;
19      for (k = 0; k < 3; k++)
20        {
21        for (l = 0; l < 3; l++)
22          {
23            *(p+pos) = *(s+k+3) * (*(s+l));
24            pos += len;
25          }
26        } 
27      s += 6;
28      p++;
29    }
30}
31
32 
Note: See TracBrowser for help on using the repository browser.