Home | History | Annotate | Download | only in src

Lines Matching full:roi

78             Rect roi;
79 if (overlapRoi(corners_[i], corners_[j], sizes_[i], sizes_[j], roi))
80 findInPair(i, j, roi);
111 void VoronoiSeamFinder::findInPair(size_t first, size_t second, Rect roi)
114 Mat submask1(roi.height + 2 * gap, roi.width + 2 * gap, CV_8U);
115 Mat submask2(roi.height + 2 * gap, roi.width + 2 * gap, CV_8U);
122 for (int y = -gap; y < roi.height + gap; ++y)
124 for (int x = -gap; x < roi.width + gap; ++x)
126 int y1 = roi.y - tl1.y + y;
127 int x1 = roi.x - tl1.x + x;
133 int y2 = roi.y - tl2.y + y;
134 int x2 = roi.x - tl2.x + x;
152 for (int y = 0; y < roi.height; ++y)
154 for (int x = 0; x < roi.width; ++x)
157 mask2.at<uchar>(roi.y - tl2.y + y, roi.x - tl2.x + x) = 0;
159 mask1.at<uchar>(roi.y - tl1.y + y, roi.x - tl1.x + x) = 0;
732 Rect roi(tls_[comp], brs_[comp]);
740 costV.create(roi.height, roi.width+1);
742 for (int y = roi.y; y < roi.br().y; ++y)
744 for (int x = roi.x; x < roi.br().x+1; ++x)
751 costV(y - roi.y, x - roi.x) = costColor;
756 costV(y - roi.y, x - roi.x) = costColor / costGrad;
760 costV(y - roi.y, x - roi.x) = badRegionCost;
764 costH.create(roi.height+1, roi.width);
766 for (int y = roi.y; y < roi.br().y+1; ++y)
768 for (int x = roi.x; x < roi.br().x; ++x)
775 costH(y - roi.y, x - roi.x) = costColor;
780 costH(y - roi.y, x - roi.x) = costColor / costGrad;
784 costH(y - roi.y, x - roi.x) = badRegionCost;
799 Rect roi(tls_[comp], brs_[comp]);
800 Point src = p1 - roi.tl();
801 Point dst = p2 - roi.tl();
825 Mat_<uchar> control = Mat::zeros(roi.size(), CV_8U);
826 Mat_<uchar> reachable = Mat::zeros(roi.size(), CV_8U);
827 Mat_<float> cost = Mat::zeros(roi.size(), CV_32F);
839 for (int y = 0; y < roi.height; ++y)
845 if (labels_(y + roi.y, x + roi.x) == l)
851 if (y < roi.height-1 && reachable(y+1, x-1))
869 for (int x = 0; x < roi.width; ++x)
875 if (labels_(y + roi.y, x + roi.x) == l)
881 if (x < roi.width-1 && reachable(y-1, x+1))
903 seam.push_back(p + roi.tl());
907 for (; p.x != src.x; seam.push_back(p + roi.tl()))
916 for (; p.y != src.y; seam.push_back(p + roi.tl()))
1069 void findInPair(size_t first, size_t second, Rect roi);
1218 void GraphCutSeamFinder::Impl::findInPair(size_t first, size_t second, Rect roi)
1227 Mat subimg1(roi.height + 2 * gap, roi.width + 2 * gap, CV_32FC3);
1228 Mat subimg2(roi.height + 2 * gap, roi.width + 2 * gap, CV_32FC3);
1229 Mat submask1(roi.height + 2 * gap, roi.width + 2 * gap, CV_8U);
1230 Mat submask2(roi.height + 2 * gap, roi.width + 2 * gap, CV_8U);
1231 Mat subdx1(roi.height + 2 * gap, roi.width + 2 * gap, CV_32F);
1232 Mat subdy1(roi.height + 2 * gap, roi.width + 2 * gap, CV_32F);
1233 Mat subdx2(roi.height + 2 * gap, roi.width + 2 * gap, CV_32F);
1234 Mat subdy2(roi.height + 2 * gap, roi.width + 2 * gap, CV_32F);
1237 for (int y = -gap; y < roi.height + gap; ++y)
1239 for (int x = -gap; x < roi.width + gap; ++x)
1241 int y1 = roi.y - tl1.y + y;
1242 int x1 = roi.x - tl1.x + x;
1258 int y2 = roi.y - tl2.y + y;
1259 int x2 = roi.x - tl2.x + x;
1277 const int vertex_count = (roi.height + 2 * gap) * (roi.width + 2 * gap);
1278 const int edge_count = (roi.height - 1 + 2 * gap) * (roi.width + 2 * gap) +
1279 (roi.width - 1 + 2 * gap) * (roi.height + 2 * gap);
1297 for (int y = 0; y < roi.height; ++y)
1299 for (int x = 0; x < roi.width; ++x)
1301 if (graph.inSourceSegment((y + gap) * (roi.width + 2 * gap) + x + gap))
1303 if (mask1.at<uchar>(roi.y - tl1.y + y, roi.x - tl1.x + x))
1304 mask2.at<uchar>(roi.y - tl2.y + y, roi.x - tl2.x + x) = 0;
1308 if (mask2.at<uchar>(roi.y - tl2.y + y, roi.x - tl2.x + x))
1309 mask1.at<uchar>(roi.y - tl1.y + y, roi.x - tl1.x + x) = 0;
1361 void GraphCutSeamFinderGpu::findInPair(size_t first, size_t second, Rect roi)
1370 Mat subimg1(roi.height + 2 * gap, roi.width + 2 * gap, CV_32FC3);
1371 Mat subimg2(roi.height + 2 * gap, roi.width + 2 * gap, CV_32FC3);
1372 Mat submask1(roi.height + 2 * gap, roi.width + 2 * gap, CV_8U);
1373 Mat submask2(roi.height + 2 * gap, roi.width + 2 * gap, CV_8U);
1374 Mat subdx1(roi.height + 2 * gap, roi.width + 2 * gap, CV_32F);
1375 Mat subdy1(roi.height + 2 * gap, roi.width + 2 * gap, CV_32F);
1376 Mat subdx2(roi.height + 2 * gap, roi.width + 2 * gap, CV_32F);
1377 Mat subdy2(roi.height + 2 * gap, roi.width + 2 * gap, CV_32F);
1380 for (int y = -gap; y < roi.height + gap; ++y)
1382 for (int x = -gap; x < roi.width + gap; ++x)
1384 int y1 = roi.y - tl1.y + y;
1385 int x1 = roi.x - tl1.x + x;
1401 int y2 = roi.y - tl2.y + y;
1402 int x2 = roi.x - tl2.x + x;
1446 for (int y = 0; y < roi.height; ++y)
1448 for (int x = 0; x < roi.width; ++x)
1452 if (mask1.at<uchar>(roi.y - tl1.y + y, roi.x - tl1.x + x))
1453 mask2.at<uchar>(roi.y - tl2.y + y, roi.x - tl2.x + x) = 0;
1457 if (mask2.at<uchar>(roi.y - tl2.y + y, roi.x - tl2.x + x))
1458 mask1.at<uchar>(roi.y - tl1.y + y, roi.x - tl1.x + x) = 0;