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

Python Windows error "hi = thdata[96][128][0]" #15

Open
Riska2390 opened this issue Feb 21, 2024 · 6 comments
Open

Python Windows error "hi = thdata[96][128][0]" #15

Riska2390 opened this issue Feb 21, 2024 · 6 comments

Comments

@Riska2390
Copy link

hi = thdata[96][128][0]
IndexError: index 96 is out of bounds for axis 0 with size 0

@m-riley04
Copy link

Also getting this error

@stsypanov
Copy link

stsypanov commented Jan 25, 2025

Is is an issue with OTG cable?

I get this with DIY USB-Type-C-female-to-micro-USB-male cable. Nothing special, just +5V, GND, D+, D-

@m-riley04
Copy link

m-riley04 commented Jan 25, 2025

I actually was able to fix this issue through a large fork I made. It essentially refactors the entire program to be more modular as well.

IIRC, the issue was during the RGB conversion check with Raspberry Pi's. After removing that entire block, it works without a hitch every time.

It even directly addresses this issue as well, since it's rebuilt around being Windows-based.

Fork repo: https://github.com/m-riley04/PyThermalCamera-Windows

@stsypanov
Copy link

@m-riley04 Many thanks! From your code I see that the fix was introduced in the very first commit, is my guess correct?

@m-riley04
Copy link

Yup! I commented out the lines setting the cv2.CAP_PROP_CONVERT_RGB property to 0.0 (or False). After doing so, it seemed to work perfectly on Windows

@stsypanov
Copy link

@m-riley04 thanks, using your code I've finally elaborated the solution for Raspberry Pi Zero 2W. I think I owe you a beer :)
@Riska2390 FYI

Image

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