Reputation: 2033
I have the following two examples when loading 2 different raw images (one with Nikon and another with Sony Both having Bayer filters):
Can someone please explain the meaning of the output of the raw_pattern here along with difference in the outputs of the examples provided.
Upvotes: 2
Views: 1436
Reputation: 309
Code to get bayer partten string
import rawpy, numpy as np
raw_obj = rawpy.imread("xxx.dng")
bayer_partten = "".join([chr(raw_obj.color_desc[i]) for i in raw_obj.raw_pattern.flatten()])
Upvotes: 2
Reputation: 2527
The Nikon (NEF) pattern means "GBRG" and the Sony (ARW) pattern means "RGGB", assuming that a.color_desc == "RGBG"
. So the integers in raw_pattern
are indices to color_desc
.
Upvotes: 1