Subversion Repositories seema-scanner

Rev

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

Rev 79 Rev 113
Line 147... Line 147...
147
 
147
 
148
    // Gray-scale everything
148
    // Gray-scale everything
149
    std::vector<cv::Mat> frames0Gray(N);
149
    std::vector<cv::Mat> frames0Gray(N);
150
    std::vector<cv::Mat> frames1Gray(N);
150
    std::vector<cv::Mat> frames1Gray(N);
151
    for(int i=0; i<N; i++){
151
    for(int i=0; i<N; i++){
152
        cv::cvtColor(frames0[i], frames0Gray[i], CV_RGB2GRAY);
152
        cv::cvtColor(frames0[i], frames0Gray[i], CV_BayerBG2GRAY);
153
        cv::cvtColor(frames1[i], frames1Gray[i], CV_RGB2GRAY);
153
        cv::cvtColor(frames1[i], frames1Gray[i], CV_BayerBG2GRAY);
154
    }
154
    }
155
 
155
 
156
    // Decode camera0
156
    // Decode camera0
157
    std::vector<cv::Mat> frames0Primary(frames0Gray.begin()+2, frames0Gray.begin()+2+nSteps);
157
    std::vector<cv::Mat> frames0Primary(frames0Gray.begin()+2, frames0Gray.begin()+2+nSteps);
158
    std::vector<cv::Mat> frames0Secondary(frames0Gray.begin()+2+nSteps, frames0Gray.begin()+2+2*nSteps);
158
    std::vector<cv::Mat> frames0Secondary(frames0Gray.begin()+2+nSteps, frames0Gray.begin()+2+2*nSteps);
Line 204... Line 204...
204
    cv::remap(up1, up1Rect, map1X, map1Y, CV_INTER_CUBIC);
204
    cv::remap(up1, up1Rect, map1X, map1Y, CV_INTER_CUBIC);
205
 
205
 
206
//cvtools::writeMat(up0Rect, "up0Rect.mat", "up0Rect");
206
//cvtools::writeMat(up0Rect, "up0Rect.mat", "up0Rect");
207
//cvtools::writeMat(up1Rect, "up1Rect.mat", "up1Rect");
207
//cvtools::writeMat(up1Rect, "up1Rect.mat", "up1Rect");
208
 
208
 
209
    // Color remaps
209
    // Color debayer and remaps
-
 
210
    cv::Mat temp;
210
    cv::Mat color0Rect, color1Rect;
211
    cv::Mat color0Rect, color1Rect;
-
 
212
    cv::cvtColor(frames0[0], temp, CV_BayerBG2RGB);
211
    cv::remap(frames0[0], color0Rect, map0X, map0Y, CV_INTER_CUBIC);
213
    cv::remap(temp, color0Rect, map0X, map0Y, CV_INTER_CUBIC);
-
 
214
    cv::cvtColor(frames1[0], temp, CV_BayerBG2RGB);
212
    cv::remap(frames1[0], color1Rect, map1X, map1Y, CV_INTER_CUBIC);
215
    cv::remap(temp, color1Rect, map1X, map1Y, CV_INTER_CUBIC);
213
 
216
 
214
//cvtools::writeMat(color0Rect, "color0Rect.mat", "color0Rect");
217
//cvtools::writeMat(color0Rect, "color0Rect.mat", "color0Rect");
215
//cvtools::writeMat(color1Rect, "color1Rect.mat", "color1Rect");
218
//cvtools::writeMat(color1Rect, "color1Rect.mat", "color1Rect");
216
 
219
 
217
    // On/off remaps
220
    // On/off remaps