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

Mixup between aria width + height and between numpy shapes #106

Open
AntonioMacaronio opened this issue Jun 8, 2024 · 3 comments
Open

Comments

@AntonioMacaronio
Copy link

Here is a potential bug:

input_image.shape[0] != input_calib_width

input_calib_width refers to the width of the image. For an image represented as a NumPy array, the number of numpy columns is equal to the width of the image, but the code writes input_image.shape[0] != input_calib_width, which is comparing the number of numpy rows.

The same thing but vice versa happens on line 31 with input_image.shape[1] != input_calib_height

@chpeng-fb
Copy link

Hi @AntonioMacaronio,
did you try printing out the value of input_image.shape and input_calib_width/height?

@SeaOtocinclus
Copy link
Contributor

@AntonioMacaronio can you provide any feedback?

@AntonioMacaronio
Copy link
Author

AntonioMacaronio commented Jun 24, 2024

Yes! I can add quick one line PR to fix this if need be (i will also note the changes down below) - since the main RGB camera has solution 1404x1404, no runtime errors arise with that camera.

This only occurs with the side grayscale which have resolution 480x640. What happens is the following:

  1. input_image will be a numpy array of shape (480, 640),
  2. input_calib_width will be equal to 640, and input_calib_height will be equal to 480
  3. therefore the line checking if input_image.shape[0] != input_calib_width or input_image.shape[1] != input_calib_height: will be True and a ValueError will be raised.

Simply changing the conditional to if input_image.shape[1] != input_calib_width or input_image.shape[0] != input_calib_height: fixes this error

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

3 participants