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
How to rescale the image after rio-color operations? #61
Comments
@plant99 It looks like you've implemented your own scaling to the range of 0-1, yes? the rio-color command does this https://github.com/mapbox/rio-color/blob/master/rio_color/utils.py#L15-L20 and it might be worth a try. |
Thank you @sgillies , what you described solved this issue. Do you also feel that Python implementation's documentation has to be improved a bit in README.md? Please let me know if I can help with a PR. Have a nice day! |
@plant99 I appreciate the offer of documentation help! If there is anything incorrect in the readme, we'd love to fix it. However, the team maintaining this package is occupied with other work and doesn't have the time to review major changes. |
@sgillies Since I'm anyway working with this tool, if you don't mind an open PR, may I still make it? |
@plant99 yes, go ahead, and thanks! |
According to documentation, rio-color operations only take rasters of dimensions (3, x, y) for processing, in 0 to 1 range for pixel values.
I'm facing some issues getting the image into the same state as doing
rio color --co photometric=rgb stack.tiff landsat8_color.tiff sigmoidal RGB 20 0.2 -j 1
The code I've used is as follows.
As one can see, I've used both in-house
scale_dtype
and Numpy's linear interpolation to scale the array back, without success.Also, I planned to save the numpy response of sigmoid function as a pickle file, and debug keeping it as reference, but since the job is parallel by
rio-mucho
, it got too complex in very short time.I am almost sure that I'm scaling the image back wrong, because size of the the output tiffs with
a) command line
andb) Python API
are same. (Both usenp.uint16
to store data)Please let me also know, if any other detail is required to understand/debug/help this issue.
Thank you for your time in advance!
The text was updated successfully, but these errors were encountered: