Optimal_affine_tracking_3d16_fast_realtime.cpp
Go to the documentation of this file.
00001 /*
00002  * Optimal_affine_tracking_3d16_fast_realtime.cpp
00003  *
00004  * Code generation for function 'Optimal_affine_tracking_3d16_fast_realtime'
00005  *
00006  * C source code generated on: Wed Jul 24 16:11:35 2013
00007  *
00008  */
00009 
00010 /* Include files */
00011 #include "rt_nonfinite.h"
00012 #include "Optimal_affine_tracking_3d16_fast_realtime.h"
00013 #include "compute_prob1.h"
00014 #include "LoadKinectMesh_realtime.h"
00015 #include "init_variables.h"
00016 
00017 /* Type Definitions */
00018 
00019 /* Named Constants */
00020 
00021 /* Variable Declarations */
00022 
00023 /* Variable Definitions */
00024 
00025 /* Function Declarations */
00026 
00027 /* Function Definitions */
00028 void Optimal_affine_tracking_3d16_fast_realtime(const real_T pty[4], const
00029   real_T ptx[4], real_T p[12])
00030 {
00031   static real_T Irgb[504063];
00032   static real_T Ixyz[504063];
00033   real_T center_y;
00034   real_T center_x;
00035   real_T corner_p[12];
00036   static real_T mean_img[3888];
00037   static real_T point_matrix[3888];
00038   static real_T AR_velocity[2250000];
00039   static real_T X_par[2250000];
00040   static real_T dw_dp[15552];
00041   static real_T tracked_images[38880000];
00042   static real_T X_par_pred[2250000];
00043   int32_T t;
00044   real_T centroid[3];
00045   real_T Aff_matrix[9];
00046   int32_T i0;
00047   int32_T i1;
00048   int32_T i2;
00049 
00050   /* % Object template initialization */
00051   /*  [Ixyz,Irgb] = LoadKinectMeshBinary_realtime; */
00052   LoadKinectMesh_realtime(Ixyz, Irgb);
00053 
00054   /*  h1=figure(1); */
00055   init_variables(Ixyz, ptx, pty, X_par_pred, tracked_images, dw_dp, X_par,
00056                  AR_velocity, point_matrix, mean_img, corner_p, &center_x,
00057                  &center_y);
00058 
00059   /* % Execute tracking */
00060   for (t = 0; t < 9999; t++) {
00061     LoadKinectMesh_realtime(Ixyz, Irgb);
00062 
00063     /*      [Ixyz,Irgb] = LoadKinectMeshBinary_realtime;     */
00064     /*     %% Particle propagation and likelihood computation  */
00065     compute_prob1(X_par, X_par_pred, AR_velocity, dw_dp, (real_T)t + 2.0,
00066                   center_x, center_y, Ixyz, point_matrix, mean_img,
00067                   tracked_images, Aff_matrix, centroid);
00068 
00069     /*     %% Display the tracking results */
00070     /*      set(0,'CurrentFigure',h1); */
00071     /*      imshow(Irgb/255); */
00072     for (i0 = 0; i0 < 3; i0++) {
00073       for (i1 = 0; i1 < 4; i1++) {
00074         p[i0 + 3 * i1] = 0.0;
00075         for (i2 = 0; i2 < 3; i2++) {
00076           p[i0 + 3 * i1] += Aff_matrix[i0 + 3 * i2] * corner_p[i2 + 3 * i1];
00077         }
00078       }
00079     }
00080 
00081     /*      hold on;line([p(2,1) p(2,2)],[p(1,1) p(1,2)],'Color','red','LineWidth',3); */
00082     /*      hold on;line([p(2,2) p(2,3)],[p(1,2) p(1,3)],'Color','red','LineWidth',3); */
00083     /*      hold on;line([p(2,3) p(2,4)],[p(1,3) p(1,4)],'Color','red','LineWidth',3); */
00084     /*      hold on;line([p(2,4) p(2,1)],[p(1,4) p(1,1)],'Color','red','LineWidth',3); */
00085     /*      hold off; */
00086     /*      drawnow; */
00087   }
00088 }
00089 
00090 /* End of code generation (Optimal_affine_tracking_3d16_fast_realtime.cpp) */


depth_tracker_ros_vr8
Author(s): shusain
autogenerated on Fri Dec 6 2013 20:45:47