Skip to content

Commit 2d84efe

Browse files
authored
Update BilinearInterpolation.cpp
1 parent 1052724 commit 2d84efe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Image Interpolation/BilinearInterpolation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Mat BilinearInterpolation(Mat src, float sx, float sy) {
88
int dst_col = round(col * sy);
99
Mat dst(dst_row, dst_col, CV_8UC3);
1010
for (int i = 0; i < dst_row; i++) {
11-
int index_i = (i + 0.5) / sx - 0.5;
11+
float index_i = (i + 0.5) / sx - 0.5;
1212
if (index_i < 0) index_i = 0;
1313
if (index_i > row - 2) index_i = row - 2;
1414
int i1 = floor(index_i);

0 commit comments

Comments
 (0)