tf-cpn icon indicating copy to clipboard operation
tf-cpn copied to clipboard

crop_size = min(crop_size, objcenter[0] / width * min_shape * 2. - 1.) so damn hard to understand.

Open jiangtaoo2333 opened this issue 5 years ago • 2 comments

crop_size = min(crop_size, objcenter[0] / width * min_shape * 2. - 1.)
crop_size = min(crop_size, (bimg.shape[1] - objcenter[0]) / width * min_shape * 2. - 1)
crop_size = min(crop_size, objcenter[1] / height * min_shape * 2. - 1.)
crop_size = min(crop_size, (bimg.shape[0] - objcenter[1]) / height * min_shape * 2. - 1)

QAQ can somebody help me

jiangtaoo2333 avatar Mar 07 '19 07:03 jiangtaoo2333

It calculates the size of box to be cropped in original image. There are two restrictions:

  1. It should be inside the image and keep the center fixed.
  2. It should keep the aspect ratio of original image while cropping. So we need to expand the size of box to let the aspect ratio of box be same as the the input of network.

chenyilun95 avatar Mar 07 '19 10:03 chenyilun95

really appreciate your help.

It calculates the size of box to be cropped in original image. There are two restrictions:

  1. It should be inside the image and keep the center fixed.
  2. It should keep the aspect ratio of original image while cropping. So we need to expand the size of box to let the aspect ratio of box be same as the the input of network.

jiangtaoo2333 avatar Mar 07 '19 11:03 jiangtaoo2333