Line 207... |
Line 207... |
207 |
//cvtools::writeMat(up0Rect, "up0Rect.mat", "up0Rect");
|
207 |
//cvtools::writeMat(up0Rect, "up0Rect.mat", "up0Rect");
|
208 |
//cvtools::writeMat(up1Rect, "up1Rect.mat", "up1Rect");
|
208 |
//cvtools::writeMat(up1Rect, "up1Rect.mat", "up1Rect");
|
209 |
|
209 |
|
210 |
// color debayer and remap
|
210 |
// color debayer and remap
|
211 |
cv::Mat color0Rect, color1Rect;
|
211 |
cv::Mat color0Rect, color1Rect;
|
212 |
frames0[0].convertTo(color0Rect, CV_8UC1, 1.0/256.0);
|
212 |
// frames0[0].convertTo(color0Rect, CV_8UC1, 1.0/256.0);
|
213 |
cv::cvtColor(color0Rect, color0Rect, CV_BayerBG2RGB);
|
213 |
cv::cvtColor(frames0[0], color0Rect, CV_BayerBG2RGB);
|
214 |
cv::remap(color0Rect, color0Rect, map0X, map0Y, CV_INTER_LINEAR);
|
214 |
cv::remap(color0Rect, color0Rect, map0X, map0Y, CV_INTER_LINEAR);
|
215 |
|
215 |
|
216 |
frames1[0].convertTo(color1Rect, CV_8UC1, 1.0/256.0);
|
216 |
// frames1[0].convertTo(color1Rect, CV_8UC1, 1.0/256.0);
|
217 |
cv::cvtColor(color1Rect, color1Rect, CV_BayerBG2RGB);
|
217 |
cv::cvtColor(frames1[0], color1Rect, CV_BayerBG2RGB);
|
218 |
cv::remap(color1Rect, color1Rect, map1X, map1Y, CV_INTER_LINEAR);
|
218 |
cv::remap(color1Rect, color1Rect, map1X, map1Y, CV_INTER_LINEAR);
|
219 |
|
219 |
|
220 |
//cvtools::writeMat(frames0Rect[18], "frames0Rect_18.mat", "frames0Rect_18");
|
220 |
//cvtools::writeMat(frames0Rect[18], "frames0Rect_18.mat", "frames0Rect_18");
|
221 |
//cvtools::writeMat(frames0Rect[19], "frames0Rect_19.mat", "frames0Rect_19");
|
221 |
//cvtools::writeMat(frames0Rect[19], "frames0Rect_19.mat", "frames0Rect_19");
|
222 |
|
222 |
|
Line 233... |
Line 233... |
233 |
cv::remap(frames1Gray[1], frames1OffRect, map1X, map1Y, CV_INTER_LINEAR);
|
233 |
cv::remap(frames1Gray[1], frames1OffRect, map1X, map1Y, CV_INTER_LINEAR);
|
234 |
|
234 |
|
235 |
// Occlusion masks
|
235 |
// Occlusion masks
|
236 |
cv::Mat occlusion0Rect, occlusion1Rect;
|
236 |
cv::Mat occlusion0Rect, occlusion1Rect;
|
237 |
cv::subtract(frames0OnRect, frames0OffRect, occlusion0Rect);
|
237 |
cv::subtract(frames0OnRect, frames0OffRect, occlusion0Rect);
|
238 |
occlusion0Rect = (occlusion0Rect > 6400) & (occlusion0Rect < 50000);
|
238 |
occlusion0Rect = (occlusion0Rect > 25) & (occlusion0Rect < 250);
|
239 |
cv::subtract(frames1OnRect, frames1OffRect, occlusion1Rect);
|
239 |
cv::subtract(frames1OnRect, frames1OffRect, occlusion1Rect);
|
240 |
occlusion1Rect = (occlusion1Rect > 6400) & (occlusion1Rect < 50000);
|
240 |
occlusion1Rect = (occlusion1Rect > 25) & (occlusion1Rect < 250);
|
241 |
|
241 |
|
242 |
//cvtools::writeMat(occlusion0Rect, "occlusion0Rect.mat", "occlusion0Rect");
|
242 |
//cvtools::writeMat(occlusion0Rect, "occlusion0Rect.mat", "occlusion0Rect");
|
243 |
//cvtools::writeMat(occlusion1Rect, "occlusion1Rect.mat", "occlusion1Rect");
|
243 |
//cvtools::writeMat(occlusion1Rect, "occlusion1Rect.mat", "occlusion1Rect");
|
244 |
|
244 |
|
245 |
// Erode occlusion masks
|
245 |
// Erode occlusion masks
|