mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
Merge pull request #462 from gwanglee/dev
coordinate calculation fixed in place_image(). dtype int -> float
This commit is contained in:
commit
259be3217b
@ -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(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