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

cvtools.imarray_crop turn 0-1 float rgb to blank uint8 #62

Closed
HowcanoeWang opened this issue Dec 15, 2022 · 0 comments
Closed

cvtools.imarray_crop turn 0-1 float rgb to blank uint8 #62

HowcanoeWang opened this issue Dec 15, 2022 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@HowcanoeWang
Copy link
Member

>>> rotated
array([[[0.31690149, 0.38752052, 0.14294289],
        [0.3404107 , 0.41297721, 0.16013014],
        [0.38506028, 0.4331061 , 0.17238887],
        ...,
        [0.67001947, 0.70273325, 0.44726555],
        [0.71262498, 0.74353751, 0.49159185],
        [0.63883647, 0.66216885, 0.41865424]],
>>> rotated_geotiff_imarray, _ = idp.cvtools.imarray_crop(rotated, roi_geotiff_offseted.astype(int))
>>> plt.imshow(rotated_geotiff_imarray)

image

>>> rotated_geotiff_imarray[:,:,0]
array([[0, 0, 0, ..., 0, 0, 0],
       [0, 0, 0, ..., 0, 0, 0],
       [0, 0, 0, ..., 0, 0, 0],
       ...,
       [0, 0, 0, ..., 0, 0, 0],
       [0, 0, 0, ..., 0, 0, 0],
       [0, 0, 0, ..., 0, 0, 0]], dtype=uint8)

Can be fixed only if the input image type is uint8

>>> rotated = (rotated * 255).astype(np.uint8)
@HowcanoeWang HowcanoeWang added the bug Something isn't working label Dec 15, 2022
@HowcanoeWang HowcanoeWang added this to the 2.0.0.dev4 milestone Dec 15, 2022
@HowcanoeWang HowcanoeWang self-assigned this Dec 15, 2022
@HowcanoeWang HowcanoeWang moved this to Done in EasyIDP v2.0 Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

1 participant