Subversion Repositories seema-scanner

Rev

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

Rev 182 Rev 185
Line 167... Line 167...
167
    cv::Mat up1 = unwrapWithCue(up1Primary, up1Equivalent, (float)screenCols/nPeriodsPrimary);
167
    cv::Mat up1 = unwrapWithCue(up1Primary, up1Equivalent, (float)screenCols/nPeriodsPrimary);
168
    up1 *= screenCols/(2.0*pi);
168
    up1 *= screenCols/(2.0*pi);
169
    cv::Mat amplitude1;
169
    cv::Mat amplitude1;
170
    cv::magnitude(F1Primary[2], -F1Primary[3], amplitude1);
170
    cv::magnitude(F1Primary[2], -F1Primary[3], amplitude1);
171
 
171
 
172
    #ifdef Q_DEBUG
172
    #ifdef QT_DEBUG
173
        cvtools::writeMat(up0Primary, "up0Primary.mat", "up0Primary");
173
        cvtools::writeMat(up0Primary, "up0Primary.mat", "up0Primary");
174
        cvtools::writeMat(up0Secondary, "up0Secondary.mat", "up0Secondary");
174
        cvtools::writeMat(up0Secondary, "up0Secondary.mat", "up0Secondary");
175
        cvtools::writeMat(up0Tertiary, "up0Tertiary.mat", "up0Tertiary");
175
        cvtools::writeMat(up0Tertiary, "up0Tertiary.mat", "up0Tertiary");
176
        cvtools::writeMat(up0EquivalentPS, "up0EquivalentPS.mat", "up0EquivalentPS");
176
        cvtools::writeMat(up0EquivalentPS, "up0EquivalentPS.mat", "up0EquivalentPS");
177
        cvtools::writeMat(up0EquivalentST, "up0EquivalentST.mat", "up0EquivalentST");
177
        cvtools::writeMat(up0EquivalentST, "up0EquivalentST.mat", "up0EquivalentST");
Line 186... Line 186...
186
    // Color debayer and remap
186
    // Color debayer and remap
187
    cv::Mat color0, color1;
187
    cv::Mat color0, color1;
188
    cv::cvtColor(frames0[0], color0, CV_BayerBG2RGB);
188
    cv::cvtColor(frames0[0], color0, CV_BayerBG2RGB);
189
    cv::cvtColor(frames1[0], color1, CV_BayerBG2RGB);
189
    cv::cvtColor(frames1[0], color1, CV_BayerBG2RGB);
190
 
190
 
191
    #ifdef Q_DEBUG
191
    #ifdef QT_DEBUG
192
        cvtools::writeMat(color0, "color0.mat", "color0");
192
        cvtools::writeMat(color0, "color0.mat", "color0");
193
        cvtools::writeMat(color1, "color1.mat", "color1");
193
        cvtools::writeMat(color1, "color1.mat", "color1");
194
    #endif
194
    #endif
195
 
195
 
196
    // Occlusion masks
196
    // Occlusion masks
Line 198... Line 198...
198
    cv::subtract(frames0Rect[0], frames0Rect[1], occlusion0);
198
    cv::subtract(frames0Rect[0], frames0Rect[1], occlusion0);
199
    occlusion0 = (occlusion0 > 5) & (occlusion0 < 250);
199
    occlusion0 = (occlusion0 > 5) & (occlusion0 < 250);
200
    cv::subtract(frames1Rect[0], frames1Rect[1], occlusion1);
200
    cv::subtract(frames1Rect[0], frames1Rect[1], occlusion1);
201
    occlusion1 = (occlusion1 > 5) & (occlusion1 < 250);
201
    occlusion1 = (occlusion1 > 5) & (occlusion1 < 250);
202
 
202
 
203
    #ifdef Q_DEBUG
203
    #ifdef QT_DEBUG
204
        // Erode occlusion masks
204
        // Erode occlusion masks
205
        cv::Mat strel = cv::getStructuringElement(cv::MORPH_ELLIPSE, cv::Size(5,5));
205
        cv::Mat strel = cv::getStructuringElement(cv::MORPH_ELLIPSE, cv::Size(5,5));
206
        cv::erode(occlusion0, occlusion0, strel);
206
        cv::erode(occlusion0, occlusion0, strel);
207
        cv::erode(occlusion1, occlusion1, strel);
207
        cv::erode(occlusion1, occlusion1, strel);
208
    #endif
208
    #endif
Line 213... Line 213...
213
    occlusion0 = occlusion0 & (abs(edges0) < 150);
213
    occlusion0 = occlusion0 & (abs(edges0) < 150);
214
    cv::Mat edges1;
214
    cv::Mat edges1;
215
    cv::Sobel(up1, edges1, -1, 1, 1, 5);
215
    cv::Sobel(up1, edges1, -1, 1, 1, 5);
216
    occlusion1 = occlusion1 & (abs(edges1) < 150);
216
    occlusion1 = occlusion1 & (abs(edges1) < 150);
217
 
217
 
218
    #ifdef Q_DEBUG
218
    #ifdef QT_DEBUG
219
        cvtools::writeMat(edges0, "edges0.mat", "edges0");
219
        cvtools::writeMat(edges0, "edges0.mat", "edges0");
220
        cvtools::writeMat(edges1, "edges1.mat", "edges1");
220
        cvtools::writeMat(edges1, "edges1.mat", "edges1");
221
    #endif
221
    #endif
222
 
222
 
223
    // Match phase maps
223
    // Match phase maps