I have a opencv image variable called result.
The shape of the array is (28800, 3) & has the following values
[[-9.10972506e-02 -9.10972506e-02 -9.10972506e-02]
[-1.03304401e-01 -1.03304401e-01 -1.03304401e-01]
[-1.05187558e-01 -1.05187558e-01 -1.05187558e-01]
...
[-1.05294801e-01 -1.05294801e-01 -1.05294801e-01]
[-1.06410049e-01 -1.06410049e-01 -1.06410049e-01]
[-1.04490273e-01 -1.04490273e-01 -1.04490273e-01]
[-7.67669156e-02 -7.67669156e-02 -7.67669156e-02]]
... You get the idea
I converted this to an RGB image format by using this.
result = result.reshape(( 144 , 200, 3 ) )
These values are too small & get converted to int 0. How can I convert this to an image that is actually visible & understandable?
Thanks!
Multiply the float values by 255 and cast them to uint8
new = np.multiply(result.reshape((144, 200, 3)), 255).astype(np.uint8)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With