Subversion Repositories seema-scanner

Rev

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

Rev 148 Rev 167
Line 72... Line 72...
72
cv::Mat AlgorithmPhaseShiftTwoFreq::getEncodingPattern(unsigned int depth){
72
cv::Mat AlgorithmPhaseShiftTwoFreq::getEncodingPattern(unsigned int depth){
73
    return patterns[depth];
73
    return patterns[depth];
74
}
74
}
75
 
75
 
76
 
76
 
77
// Absolute phase from 3 frames
77
//// Absolute phase from 3 frames
78
static cv::Mat getPhase(const cv::Mat I1, const cv::Mat I2, const cv::Mat I3){
78
//static cv::Mat getPhase(const cv::Mat I1, const cv::Mat I2, const cv::Mat I3){
79
 
79
 
80
    cv::Mat_<float> I1_(I1);
80
//    cv::Mat_<float> I1_(I1);
81
    cv::Mat_<float> I2_(I2);
81
//    cv::Mat_<float> I2_(I2);
82
    cv::Mat_<float> I3_(I3);
82
//    cv::Mat_<float> I3_(I3);
83
 
-
 
84
    cv::Mat phase;
-
 
85
 
-
 
86
    // One call approach
-
 
87
    cv::phase(2.0*I1_-I3_-I2_, sqrt(3.0)*(I2_-I3_), phase);
-
 
88
    return phase;
-
 
89
 
83
 
-
 
84
//    cv::Mat phase;
90
}
85
 
-
 
86
//    // One call approach
-
 
87
//    cv::phase(2.0*I1_-I3_-I2_, sqrt(3.0)*(I2_-I3_), phase);
-
 
88
//    return phase;
-
 
89
 
-
 
90
//}
91
 
91
 
92
// Phase unwrapping by means of a phase cue
92
// Phase unwrapping by means of a phase cue
93
static cv::Mat unwrapWithCue(const cv::Mat up, const cv::Mat upCue, float nPhases){
93
static cv::Mat unwrapWithCue(const cv::Mat up, const cv::Mat upCue, float nPhases){
94
 
94
 
95
    const float pi = M_PI;
95
    const float pi = M_PI;
Line 147... Line 147...
147
    int frameCols = frames0[0].cols;
147
    int frameCols = frames0[0].cols;
148
 
148
 
149
    // Gray-scale everything
149
    // Gray-scale everything
150
    std::vector<cv::Mat> frames0Gray(N);
150
    std::vector<cv::Mat> frames0Gray(N);
151
    std::vector<cv::Mat> frames1Gray(N);
151
    std::vector<cv::Mat> frames1Gray(N);
152
    for(int i=0; i<N; i++){
152
    for(unsigned int i=0; i<N; i++){
153
        cv::cvtColor(frames0[i], frames0Gray[i], CV_BayerBG2GRAY);
153
        cv::cvtColor(frames0[i], frames0Gray[i], CV_BayerBG2GRAY);
154
        cv::cvtColor(frames1[i], frames1Gray[i], CV_BayerBG2GRAY);
154
        cv::cvtColor(frames1[i], frames1Gray[i], CV_BayerBG2GRAY);
155
    }
155
    }
156
 
156
 
157
    // Decode camera0
157
    // Decode camera0