image_warping.cpp
Go to the documentation of this file.
00001 /*
00002  * image_warping.cpp
00003  *
00004  * Code generation for function 'image_warping'
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 "image_warping.h"
00014 #include "round.h"
00015 
00016 /* Type Definitions */
00017 
00018 /* Named Constants */
00019 
00020 /* Variable Declarations */
00021 
00022 /* Variable Definitions */
00023 
00024 /* Function Declarations */
00025 
00026 /* Function Definitions */
00027 void b_image_warping(const real_T frame[336042], const real_T aff_matrix[9],
00028                      const real_T point_matrix[3888], real_T warped_img[1296])
00029 {
00030   int32_T k;
00031   int32_T i10;
00032   real_T transformed_point[3888];
00033   int32_T i11;
00034   real_T maxval[1296];
00035   real_T b_maxval[1296];
00036   real_T u0;
00037   for (k = 0; k < 3; k++) {
00038     for (i10 = 0; i10 < 1296; i10++) {
00039       transformed_point[k + 3 * i10] = 0.0;
00040       for (i11 = 0; i11 < 3; i11++) {
00041         transformed_point[k + 3 * i10] += aff_matrix[k + 3 * i11] *
00042           point_matrix[i11 + 3 * i10];
00043       }
00044     }
00045   }
00046 
00047   for (k = 0; k < 1296; k++) {
00048     u0 = transformed_point[3 * k];
00049     if (u0 <= 381.0) {
00050     } else {
00051       u0 = 381.0;
00052     }
00053 
00054     if ((1.0 >= u0) || rtIsNaN(u0)) {
00055       u0 = 1.0;
00056     }
00057 
00058     maxval[k] = u0;
00059     u0 = transformed_point[1 + 3 * k];
00060     if (u0 <= 882.0) {
00061     } else {
00062       u0 = 882.0;
00063     }
00064 
00065     if ((1.0 >= u0) || rtIsNaN(u0)) {
00066       u0 = 1.0;
00067     }
00068 
00069     b_maxval[k] = u0;
00070   }
00071 
00072   b_round(maxval);
00073   b_round(b_maxval);
00074   for (k = 0; k < 1296; k++) {
00075     warped_img[k] = frame[(int32_T)((b_maxval[k] - 1.0) * 381.0 + maxval[k]) - 1];
00076   }
00077 
00078   /*  warped_img = reshape(frame((y-1)*size_x + x),[crop_x crop_y]); */
00079 }
00080 
00081 void image_warping(const real_T frame[168021], const real_T aff_matrix[9], const
00082                    real_T point_matrix[3888], real_T warped_img[1296])
00083 {
00084   int32_T k;
00085   int32_T i5;
00086   real_T transformed_point[3888];
00087   int32_T i6;
00088   real_T maxval[1296];
00089   real_T b_maxval[1296];
00090   real_T u0;
00091   for (k = 0; k < 3; k++) {
00092     for (i5 = 0; i5 < 1296; i5++) {
00093       transformed_point[k + 3 * i5] = 0.0;
00094       for (i6 = 0; i6 < 3; i6++) {
00095         transformed_point[k + 3 * i5] += aff_matrix[k + 3 * i6] *
00096           point_matrix[i6 + 3 * i5];
00097       }
00098     }
00099   }
00100 
00101   for (k = 0; k < 1296; k++) {
00102     u0 = transformed_point[3 * k];
00103     if (u0 <= 381.0) {
00104     } else {
00105       u0 = 381.0;
00106     }
00107 
00108     if ((1.0 >= u0) || rtIsNaN(u0)) {
00109       u0 = 1.0;
00110     }
00111 
00112     maxval[k] = u0;
00113     u0 = transformed_point[1 + 3 * k];
00114     if (u0 <= 441.0) {
00115     } else {
00116       u0 = 441.0;
00117     }
00118 
00119     if ((1.0 >= u0) || rtIsNaN(u0)) {
00120       u0 = 1.0;
00121     }
00122 
00123     b_maxval[k] = u0;
00124   }
00125 
00126   b_round(maxval);
00127   b_round(b_maxval);
00128   for (k = 0; k < 1296; k++) {
00129     warped_img[k] = frame[(int32_T)((b_maxval[k] - 1.0) * 381.0 + maxval[k]) - 1];
00130   }
00131 
00132   /*  warped_img = reshape(frame((y-1)*size_x + x),[crop_x crop_y]); */
00133 }
00134 
00135 /* End of code generation (image_warping.cpp) */


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