1 | initial version |
You can convert a RGB picture to float64 by dividing each RGB value in the picture by 255:
import numpy as np import cv2 # Read RGB picture img = cv2.imread("picture.png") # Convert to float64 img_float64 = img.astype(np.float64) / 255.0
This will create a new img_float64
ndarray with the RGB values as floating-point numbers between 0.0 and 1.0.