Skip to content

Commit

Permalink
Merge pull request pjreddie#462 from gwanglee/dev
Browse files Browse the repository at this point in the history
coordinate calculation fixed in place_image(). dtype int -> float
  • Loading branch information
pjreddie committed Mar 28, 2018
2 parents 5eba22a + 558ec9c commit 259be32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/image.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,8 +780,8 @@ void place_image(image im, int w, int h, int dx, int dy, image canvas)
for(c = 0; c < im.c; ++c){
for(y = 0; y < h; ++y){
for(x = 0; x < w; ++x){
int rx = ((float)x / w) * im.w;
int ry = ((float)y / h) * im.h;
float rx = ((float)x / w) * im.w;
float ry = ((float)y / h) * im.h;
float val = bilinear_interpolate(im, rx, ry, c);
set_pixel(canvas, x + dx, y + dy, c, val);
}
Expand Down

0 comments on commit 259be32

Please sign in to comment.