Skip to content

Commit 1052724

Browse files
authored
Update BilinearInterpolation.cpp
1 parent 5567d1b commit 1052724

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Image Interpolation/BilinearInterpolation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Mat BilinearInterpolation(Mat src, float sx, float sy) {
1313
if (index_i > row - 2) index_i = row - 2;
1414
int i1 = floor(index_i);
1515
int i2 = ceil(index_i);
16-
float u = index_i - i;
16+
float u = index_i - i1;
1717
for (int j = 0; j < dst_col; j++) {
1818
float index_j = (j + 0.5) / sy - 0.5;
1919
if (index_j < 0) index_j = 0;
@@ -28,4 +28,4 @@ Mat BilinearInterpolation(Mat src, float sx, float sy) {
2828
}
2929
}
3030
return dst;
31-
}
31+
}

0 commit comments

Comments
 (0)