Skip to content

Commit

Permalink
fix redefine dx, dy
Browse files Browse the repository at this point in the history
  • Loading branch information
alemelis committed Jun 18, 2019
1 parent 870e28c commit 819ace3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/data.c
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ data load_data_detection(int n, char **paths, int m, int w, int h, int c, int bo
case 1:
{ // AlexeyAB
int pright, pbot;

pleft = rand_precalc_random(-dw, dw, r1);
pright = rand_precalc_random(-dw, dw, r2);
ptop = rand_precalc_random(-dh, dh, r3);
Expand All @@ -1112,15 +1112,16 @@ data load_data_detection(int n, char **paths, int m, int w, int h, int c, int bo

sx = (float)swidth / ow;
sy = (float)sheight / oh;
dx = ((float)pleft / ow) / sx;
dy = ((float)ptop / oh) / sy;

}
}

//
image cropped = crop_image(orig, pleft, ptop, swidth, sheight);

float dx = ((float)pleft / ow) / sx;
float dy = ((float)ptop / oh) / sy;


image sized = resize_image(cropped, w, h);
if (flip) flip_image(sized);
Expand Down

0 comments on commit 819ace3

Please sign in to comment.