We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 396f43d commit dc9ee53Copy full SHA for dc9ee53
modules/stitching/src/seam_finders.cpp
@@ -745,7 +745,9 @@ void DpSeamFinder::computeCosts(
745
{
746
for (int x = roi.x; x < roi.br().x+1; ++x)
747
748
- if (labels_(y, x) == l && x > 0 && labels_(y, x-1) == l)
+ if (x > 0 && x < labels_.cols &&
749
+ labels_(y, x) == l && labels_(y, x-1) == l
750
+ )
751
752
float costColor = (diff(image1, y + dy1, x + dx1 - 1, image2, y + dy2, x + dx2) +
753
diff(image1, y + dy1, x + dx1, image2, y + dy2, x + dx2 - 1)) / 2;
@@ -769,7 +771,9 @@ void DpSeamFinder::computeCosts(
769
771
770
772
for (int x = roi.x; x < roi.br().x; ++x)
773
- if (labels_(y, x) == l && y > 0 && labels_(y-1, x) == l)
774
+ if (y > 0 && y < labels_.rows &&
775
+ labels_(y, x) == l && labels_(y-1, x) == l
776
777
778
float costColor = (diff(image1, y + dy1 - 1, x + dx1, image2, y + dy2, x + dx2) +
779
diff(image1, y + dy1, x + dx1, image2, y + dy2 - 1, x + dx2)) / 2;
0 commit comments