mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
coordinate calcuration fiex in place_image(). change data type from int to float, for bilienar interpolation
This commit is contained in:
parent
80d9bec20f
commit
558ec9c64c
@ -749,8 +749,8 @@ void place_image(image im, int w, int h, int dx, int dy, image canvas)
|
|||||||
for(c = 0; c < im.c; ++c){
|
for(c = 0; c < im.c; ++c){
|
||||||
for(y = 0; y < h; ++y){
|
for(y = 0; y < h; ++y){
|
||||||
for(x = 0; x < w; ++x){
|
for(x = 0; x < w; ++x){
|
||||||
int rx = ((float)x / w) * im.w;
|
float rx = ((float)x / w) * im.w;
|
||||||
int ry = ((float)y / h) * im.h;
|
float ry = ((float)y / h) * im.h;
|
||||||
float val = bilinear_interpolate(im, rx, ry, c);
|
float val = bilinear_interpolate(im, rx, ry, c);
|
||||||
set_pixel(canvas, x + dx, y + dy, c, val);
|
set_pixel(canvas, x + dx, y + dy, c, val);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user