Subversion Repositories seema-scanner

Rev

Rev 245 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 245 Rev 255
Line 108... Line 108...
108
 
108
 
109
    // Gray-scale
109
    // Gray-scale
110
    std::vector<cv::Mat> frames0Gray(N);
110
    std::vector<cv::Mat> frames0Gray(N);
111
    std::vector<cv::Mat> frames1Gray(N);
111
    std::vector<cv::Mat> frames1Gray(N);
112
    for(unsigned int i=0; i<N; i++){
112
    for(unsigned int i=0; i<N; i++){
-
 
113
        if(frames0[i].depth() == CV_8U)
113
        cv::cvtColor(frames0[i], frames0Gray[i], CV_BayerBG2GRAY);
114
            cv::cvtColor(frames0[i], frames0Gray[i], CV_BayerBG2GRAY);
-
 
115
        else if(frames0[i].channels() == 3)
-
 
116
            cv::cvtColor(frames0[i], frames0Gray[i], CV_RGB2GRAY);
-
 
117
        else
-
 
118
            frames0Gray[i] = frames0[i];
-
 
119
        if(frames1[i].depth() == CV_8U)
114
        cv::cvtColor(frames1[i], frames1Gray[i], CV_BayerBG2GRAY);
120
            cv::cvtColor(frames1[i], frames1Gray[i], CV_BayerBG2GRAY);
-
 
121
        else if(frames1[i].channels() == 3)
-
 
122
            cv::cvtColor(frames1[i], frames1Gray[i], CV_RGB2GRAY);
-
 
123
        else
-
 
124
            frames1Gray[i] = frames1[i];
115
    }
125
    }
116
 
126
 
117
    // Decode camera0 (horizontal)
127
    // Decode camera0 (horizontal)
118
    std::vector<cv::Mat> frames0PrimaryHorz(frames0Gray.begin()+2, frames0Gray.begin()+2+nStepsPrimary);
128
    std::vector<cv::Mat> frames0PrimaryHorz(frames0Gray.begin()+2, frames0Gray.begin()+2+nStepsPrimary);
119
    cv::Mat up0Primary, amplitude0PrimaryHorz, energy0PrimaryHorz;
129
    cv::Mat up0Primary, amplitude0PrimaryHorz, energy0PrimaryHorz;
Line 183... Line 193...
183
        cvtools::writeMat(vp1, "vp1.mat", "vp1");
193
        cvtools::writeMat(vp1, "vp1.mat", "vp1");
184
    #endif
194
    #endif
185
 
195
 
186
    // color debayer and remap
196
    // color debayer and remap
187
    cv::Mat color0, color1;
197
    cv::Mat color0, color1;
-
 
198
    if(frames0[0].depth() == CV_8U)
188
    cv::cvtColor(frames0[0], color0, CV_BayerBG2RGB);
199
        cv::cvtColor(frames0[0], color0, CV_BayerBG2RGB);
-
 
200
    else
-
 
201
        color0 = frames0[0];
-
 
202
    if(frames1[0].depth() == CV_8U)
189
    cv::cvtColor(frames1[0], color1, CV_BayerBG2RGB);
203
        cv::cvtColor(frames1[0], color1, CV_BayerBG2GRAY);
-
 
204
    else
-
 
205
        color1 = frames1[0];
190
 
206
 
191
    #ifdef QT_DEBUG
207
    #ifdef QT_DEBUG
192
        cvtools::writeMat(color0, "color0.mat", "color0");
208
        cvtools::writeMat(color0, "color0.mat", "color0");
193
        cvtools::writeMat(color1, "color1.mat", "color1");
209
        cvtools::writeMat(color1, "color1.mat", "color1");
194
    #endif
210
    #endif