Subversion Repositories seema-scanner

Rev

Rev 208 | Rev 229 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 208 Rev 228
Line 12... Line 12...
12
#include <math.h>
12
#include <math.h>
13
 
13
 
14
#include "cvtools.h"
14
#include "cvtools.h"
15
#include "algorithmtools.h"
15
#include "algorithmtools.h"
16
 
16
 
-
 
17
#define SM_DEBUG 1
-
 
18
 
17
static unsigned int nStepsPrimary = 16; // number of shifts/steps in primary
19
static unsigned int nStepsPrimary = 16; // number of shifts/steps in primary
18
static unsigned int nStepsSecondary = 8; // number of shifts/steps in secondary
20
static unsigned int nStepsSecondary = 8; // number of shifts/steps in secondary
19
static float nPeriodsPrimary = 40; // primary period
21
static float nPeriodsPrimary = 40; // primary period
20
 
22
 
21
AlgorithmPhaseShiftTwoFreq::AlgorithmPhaseShiftTwoFreq(unsigned int _screenCols, unsigned int _screenRows) : Algorithm(_screenCols, _screenRows){
23
AlgorithmPhaseShiftTwoFreq::AlgorithmPhaseShiftTwoFreq(unsigned int _screenCols, unsigned int _screenRows) : Algorithm(_screenCols, _screenRows){
Line 144... Line 146...
144
    }
146
    }
145
 
147
 
146
    // Threshold on energy at primary frequency
148
    // Threshold on energy at primary frequency
147
    occlusion0 = occlusion0 & (amplitude0Primary > 5.0*nStepsPrimary);
149
    occlusion0 = occlusion0 & (amplitude0Primary > 5.0*nStepsPrimary);
148
    // Threshold on energy ratios
150
    // Threshold on energy ratios
149
    occlusion0 = occlusion0 & (amplitude0Primary > 0.85*energy0Primary);
151
    occlusion0 = occlusion0 & (amplitude0Primary > 0.25*energy0Primary);
150
    occlusion0 = occlusion0 & (amplitude0Secondary > 0.85*energy0Secondary);
152
    occlusion0 = occlusion0 & (amplitude0Secondary > 0.25*energy0Secondary);
151
 
153
 
152
    #ifdef SM_DEBUG
154
    #ifdef SM_DEBUG
153
        cvtools::writeMat(up0Primary, "up0Primary.mat", "up0Primary");
155
        cvtools::writeMat(up0Primary, "up0Primary.mat", "up0Primary");
154
        cvtools::writeMat(up0Secondary, "up0Secondary.mat", "up0Secondary");
156
        cvtools::writeMat(up0Secondary, "up0Secondary.mat", "up0Secondary");
155
        cvtools::writeMat(up0Equivalent, "up0Equivalent.mat", "up0Equivalent");
157
        cvtools::writeMat(up0Equivalent, "up0Equivalent.mat", "up0Equivalent");
Line 218... Line 220...
218
    }
220
    }
219
 
221
 
220
    // Threshold on energy at primary frequency
222
    // Threshold on energy at primary frequency
221
    occlusion1 = occlusion1 & (amplitude1Primary > 5.0*nStepsPrimary);
223
    occlusion1 = occlusion1 & (amplitude1Primary > 5.0*nStepsPrimary);
222
    // Threshold on energy ratios
224
    // Threshold on energy ratios
223
    occlusion1 = occlusion1 & (amplitude1Primary > 0.85*energy1Primary);
225
    occlusion1 = occlusion1 & (amplitude1Primary > 0.25*energy1Primary);
224
    occlusion1 = occlusion1 & (amplitude1Secondary > 0.85*energy1Secondary);
226
    occlusion1 = occlusion1 & (amplitude1Secondary > 0.25*energy1Secondary);
225
 
227
 
226
    #ifdef SM_DEBUG
228
    #ifdef SM_DEBUG
227
        cvtools::writeMat(up1, "up1.mat", "up1");
229
        cvtools::writeMat(up1, "up1.mat", "up1");
228
    #endif
230
    #endif
229
}
231
}