I want to read the exr file format images and see the pixel intensities in the corresponding location. And also wanted to stack them together to give them into a neural network. How can I do the normal image processing on these kind of formats? Please help me in doing this!
I have tried this code using OpenEXR file but unable to proceed further.
import OpenEXR
file = OpenEXR.InputFile('file_name.exr')
I am expected to see the normal image processing tools like
file.size()
file.show()
file.write('another format')
file.min()
file.extract_channels()
file.append('another exr file')
OpenEXR seems to be lacking the fancy image processing features such as displaying images or saving the image to a different format. For this I would suggest you using
OpenCV, which is full of image processing features.What you may need to do is:
exrusingOpenEXRonly, then extract channels and convert them to numpy arrays asrCh = np.asarray(rCh, dtype=np.uint8)img_rgb = cv2.merge([b, g, r]).img_rgb.shapecv2.imshow(img_rgb)cv2.imwrite("path/to/file.jpg", img_rgb)np.min(b),np.min(g),np.min(r)b, g, r = cv2.split(img_rgb)