Subversion Repositories seema-scanner

Rev

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

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