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

I find problem in Surface.from_image() function.... #51

Open
LQY404 opened this issue Mar 10, 2021 · 0 comments
Open

I find problem in Surface.from_image() function.... #51

LQY404 opened this issue Mar 10, 2021 · 0 comments

Comments

@LQY404
Copy link

LQY404 commented Mar 10, 2021

the probelm is:
when i use a image, to initial the Surface,
error was arise:
UFuncTypeError: Cannot cast ufunc 'add' output from dtype('float64') to dtype('uint8') with casting rule 'same_kind'

after look for the source code, I find the problem of source code:
np.dstack([image, 255 * np.ones((h, w))])

the input image' shape is [w, h, 3], type is np.uint8
I change the code to:
np.dstack([image, 255 * np.ones((h, w), dtype=np.uint8)])

the problem is disappear.

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

1 participant