Line 232... |
Line 232... |
232 |
// amplitude remaps
|
232 |
// amplitude remaps
|
233 |
cv::Mat amplitude0Rect, amplitude1Rect;
|
233 |
cv::Mat amplitude0Rect, amplitude1Rect;
|
234 |
cv::remap(amplitude0, amplitude0Rect, map0X, map0Y, CV_INTER_LINEAR);
|
234 |
cv::remap(amplitude0, amplitude0Rect, map0X, map0Y, CV_INTER_LINEAR);
|
235 |
cv::remap(amplitude1, amplitude1Rect, map1X, map1Y, CV_INTER_LINEAR);
|
235 |
cv::remap(amplitude1, amplitude1Rect, map1X, map1Y, CV_INTER_LINEAR);
|
236 |
|
236 |
|
237 |
cvtools::writeMat(up0Rect, "up0Rect.mat", "up0Rect");
|
237 |
cvtools::writeMat(amplitude0Rect, "amplitude0Rect.mat", "amplitude0Rect");
|
238 |
cvtools::writeMat(up1Rect, "up1Rect.mat", "up1Rect");
|
238 |
cvtools::writeMat(amplitude1Rect, "amplitude1Rect.mat", "amplitude1Rect");
|
239 |
|
239 |
|
240 |
// color debayer and remap
|
240 |
// color debayer and remap
|
241 |
cv::Mat color0Rect, color1Rect;
|
241 |
cv::Mat color0Rect, color1Rect;
|
242 |
// frames0[0].convertTo(color0Rect, CV_8UC1, 1.0/256.0);
|
242 |
// frames0[0].convertTo(color0Rect, CV_8UC1, 1.0/256.0);
|
243 |
cv::cvtColor(frames0[0], color0Rect, CV_BayerBG2RGB);
|
243 |
cv::cvtColor(frames0[0], color0Rect, CV_BayerBG2RGB);
|
Line 263... |
Line 263... |
263 |
cv::remap(frames1Gray[1], frames1OffRect, map1X, map1Y, CV_INTER_LINEAR);
|
263 |
cv::remap(frames1Gray[1], frames1OffRect, map1X, map1Y, CV_INTER_LINEAR);
|
264 |
|
264 |
|
265 |
// Occlusion masks
|
265 |
// Occlusion masks
|
266 |
cv::Mat occlusion0Rect, occlusion1Rect;
|
266 |
cv::Mat occlusion0Rect, occlusion1Rect;
|
267 |
cv::subtract(frames0OnRect, frames0OffRect, occlusion0Rect);
|
267 |
cv::subtract(frames0OnRect, frames0OffRect, occlusion0Rect);
|
268 |
occlusion0Rect = (occlusion0Rect > 25) & (occlusion0Rect < 250);
|
268 |
occlusion0Rect = (occlusion0Rect > 35) & (occlusion0Rect < 250);
|
269 |
cv::subtract(frames1OnRect, frames1OffRect, occlusion1Rect);
|
269 |
cv::subtract(frames1OnRect, frames1OffRect, occlusion1Rect);
|
270 |
occlusion1Rect = (occlusion1Rect > 25) & (occlusion1Rect < 250);
|
270 |
occlusion1Rect = (occlusion1Rect > 35) & (occlusion1Rect < 250);
|
271 |
|
271 |
|
272 |
// // Threshold on energy at primary frequency
|
272 |
// // Threshold on energy at primary frequency
|
273 |
// occlusion0Rect = occlusion0Rect & (amplitude0Rect > 5.0*nStepsPrimary);
|
273 |
// occlusion0Rect = occlusion0Rect & (amplitude0Rect > 5.0*nStepsPrimary);
|
274 |
// occlusion1Rect = occlusion1Rect & (amplitude1Rect > 5.0*nStepsPrimary);
|
274 |
// occlusion1Rect = occlusion1Rect & (amplitude1Rect > 5.0*nStepsPrimary);
|
275 |
|
275 |
|