Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce Aspect Ratio #23

Open
cancan101 opened this issue Feb 6, 2023 · 1 comment
Open

Enforce Aspect Ratio #23

cancan101 opened this issue Feb 6, 2023 · 1 comment

Comments

@cancan101
Copy link
Contributor

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

@mangotee
Copy link
Collaborator

mangotee commented Feb 7, 2023

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants