Ignore:
Timestamp:
02/19/07 09:16:59 (17 years ago)
Author:
gumbau
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Geom/shared/GTGeometry/src/libs/vmi/src/metrics.cpp

    r2090 r2127  
    1313using namespace VMI; 
    1414 
    15 GLdouble VMI::computeMeanProjAreaNoBG(GLuint **histogram, GLuint numCameras, int t) { 
    16     GLuint i; 
     15GLdouble VMI::computeMeanProjAreaNoBG(int **histogram, int numCameras, int t) { 
     16    int i; 
    1717    GLdouble mean_proj_area = 0.0; 
    1818 
     
    2424} 
    2525 
    26 GLdouble VMI::computeMeanProjArea(GLuint **histogram, GLuint numCameras, int t) { 
    27         GLuint i; 
     26GLdouble VMI::computeMeanProjArea(int **histogram, int numCameras, int t) { 
     27        int i; 
    2828        GLdouble mean_proj_area = 0.0, total_proj_area, resolution = width * height; 
    2929 
     
    3838/////////////////////////////////////////////////////////////////////////////// 
    3939// Mutual Information 
    40 GLdouble VMI::computeMI(Mesh *mesh, GLuint **histogram, GLuint numCameras, GLuint cam) { 
     40GLdouble VMI::computeMI(Mesh *mesh, int **histogram, int numCameras, int cam) { 
    4141    GLdouble I = 0.0, pov, po, total_proj_area = width * height; 
    42     GLuint i; 
     42    int i; 
    4343     
    4444    for (i=0; i<mesh->numTriangles; i++) {  
     
    6666} 
    6767 
    68 GLdouble VMI::decMI(GLdouble I, GLuint **histogram, GLuint numCameras, GLuint cam, Change *c) { 
     68GLdouble VMI::decMI(GLdouble I, int **histogram, int numCameras, int cam, Change *c) { 
    6969    GLdouble newI = I * numCameras,  
    7070             pov = 0.0, po; 
     
    109109} 
    110110 
    111 GLdouble VMI::incMI(GLdouble I, GLuint **histogram, GLuint numCameras, GLuint cam, Change *c) { 
     111GLdouble VMI::incMI(GLdouble I, int **histogram, int numCameras, int cam, Change *c) { 
    112112    GLdouble newI = I * numCameras,  
    113113             pov = 0.0, po; 
    114114    GLsizei total_proj_area = width * height; 
    115     GLuint i, t; 
     115    int i, t; 
    116116 
    117117    // increase entropy of modified triangles 
    118     for (i=0; i<(GLuint)c->numMod; i++) {  
     118    for (i=0; i<c->numMod; i++) {  
    119119         
    120120        t = c->modified[i].id; 
     
    140140/////////////////////////////////////////////////////////////////////////////// 
    141141// Kullback-Leibler divergence 
    142 GLdouble VMI::computeKL(Mesh *mesh, GLuint *histogram) { 
     142GLdouble VMI::computeKL(Mesh *mesh, int *histogram) { 
    143143    GLdouble I = 0.0,  
    144144             total_real_area = 0.0, pi, tri_area; 
    145145    GLsizei  total_proj_area = (width * height) - histogram[0]; 
    146     GLuint   i; 
     146    int   i; 
    147147 
    148148    // Compute total real area of all triangles 
     
    169169 
    170170// Hellinger divergence (square root) 
    171 GLdouble VMI::computeHE(Mesh *mesh, GLuint *histogram) { 
     171GLdouble VMI::computeHE(Mesh *mesh, int *histogram) { 
    172172    GLdouble I = 0.0, temp,  
    173173             total_real_area = 0.0, pi, qi; 
    174174    GLsizei  total_proj_area = (width * height) - histogram[0]; 
    175     GLuint i; 
     175    int i; 
    176176     
    177177    // Compute total real area of all triangles 
     
    203203 
    204204// Chi-Square divergence (square root) 
    205 GLdouble VMI::computeCS(Mesh *mesh, GLuint *histogram) { 
     205GLdouble VMI::computeCS(Mesh *mesh, int *histogram) { 
    206206    GLdouble I = 0.0,  
    207207             total_real_area = 0.0, pi, qi; 
    208208    GLsizei  total_proj_area = (width * height) - histogram[0]; 
    209     GLuint i; 
     209    int i; 
    210210     
    211211    /// Compute total real area of all triangles 
     
    231231} 
    232232/////////////////////////////////////////////////////////////////////////////// 
    233 GLdouble VMI::computeEntropy(GLuint **histogram, GLuint numCameras, GLuint k) { 
     233GLdouble VMI::computeEntropy(int **histogram, int numCameras, int k) { 
    234234        GLdouble H = 0.0, POk, pi, 
    235235                                         total_proj_area, resolution = width * height, pv = 1.0 / (GLdouble)numCameras; 
    236         GLuint i; 
     236        int i; 
    237237 
    238238        for (i=0; i<numCameras; i++) { 
     
    253253} 
    254254 
    255 GLdouble VMI::computeMixedEntropy(GLdouble *mixed, GLuint numCameras) { 
     255GLdouble VMI::computeMixedEntropy(GLdouble *mixed, int numCameras) { 
    256256    GLdouble H = 0.0, pi; 
    257     GLuint i; 
     257    int i; 
    258258     
    259259    for (i=0; i<numCameras; i++) { 
     
    269269/////////////////////////////////////////////////////////////////////////////// 
    270270// Jensen-Shannon divergence 
    271 GLdouble VMI::computeJS(GLuint **histogram, GLuint numCameras, GLuint j, GLuint k) { 
     271GLdouble VMI::computeJS(int **histogram, int numCameras, int j, int k) { 
    272272        GLdouble js, Wj = 0.0, Wk = 0.0, POj, POk, pj, pk, total_proj_area, 
    273273                                         resolution = width * height, pv = 1.0 / (GLdouble)numCameras, 
    274274                                         *mixing = (GLdouble *)malloc(numCameras * sizeof(GLdouble)); 
    275         GLuint i; 
     275        int i; 
    276276 
    277277        POj = computeMeanProjArea(histogram, numCameras, j + 1); 
     
    311311} 
    312312/////////////////////////////////////////////////////////////////////////////// 
    313 void VMI::getProjectedAreas(GLuint **histogram, GLuint numCameras) { 
    314  
    315     renderScene(histogram, numCameras); 
    316 } 
    317  
    318 void VMI::getProjectedAreasWin(GLuint **histogram, GLuint numCameras, Change *c) { 
    319  
    320     renderSceneWin(histogram, numCameras, c); 
    321 } 
    322  
    323 void VMI::resetProjectedAreas(GLuint **histogram, GLuint numCameras) { 
    324     GLuint i = 0; 
    325  
    326     // Reset the projected areas for all cameras 
    327     for (i=0; i<numCameras; i++) 
    328         resetSWHistogram(histogram[i], mesh->numTriangles); 
    329 } 
    330  
    331 GLdouble *VMI::initIs(GLuint numCameras) { 
     313 
     314GLdouble *VMI::initIs(int numCameras) { 
    332315    GLdouble *initialIs; 
    333316 
     
    346329} 
    347330 
    348 void VMI::computeCameraIs(GLuint **histogram, GLuint numCameras, GLdouble *mis) { 
    349     GLuint i = 0; 
     331void VMI::computeCameraIs(int **histogram, int numCameras, GLdouble *mis) { 
     332    int i = 0; 
    350333    GLdouble meanI = 0.0; 
    351334 
     
    374357} 
    375358 
    376 void VMI::printIs(GLdouble *mis, GLuint numCameras) { 
    377     GLuint i; 
     359void VMI::printIs(GLdouble *mis, int numCameras) { 
     360    int i; 
    378361 
    379362    printf("\n"); 
Note: See TracChangeset for help on using the changeset viewer.