pydsgz/DeepVOG

Enforce Aspect Ratio

cancan101 opened this issue · 1 comments

I assume that the aspect ratio here should be the same:

ori_video_shape (tuple or list or np.ndarray): Original video shape from your camera, (height, width) in pixel. If you cropped the video before, use the "original" shape but not the cropped shape
sensor_size (tuple or list or np.ndarray): Sensor size of your camera, (height, width) in mm. For 1/3 inch CMOS sensor, it should be (3.6, 4.8). Further reference can be found in https://en.wikipedia.org/wiki/Image_sensor_format and you can look up in your camera product menu

i.e ori_video_shape[0] / ori_video_shape[1] ~= sensor_size [0] / sensor_size[1] (within floating point tolerance)?

If that is the case, then the inputs can be checked with an assertion, etc

Hi,
thanks for the remark. I would recommend to not include any asserts here, since these aspect ratios do not necessarily have to be the same. There are scenarios where the CMOS sensor has a different ratio (e.g. 2:3), and the video gets resampled either at camera output (i.e. the stream received from camera already has ratio 4:3), or at preprocessing level (i.e. the stream received has ratio 2:3 as well, and needs to be resampled in software before feeding to the model). This differentiation was suggested by the paper from Swirski et al. (link to project page).