Commit 25ce6e0e authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

completed the last bayer configuration - Gb,B/R,Gr

parent 4cf95fb9
Pipeline #1071 failed with stages
...@@ -110,6 +110,11 @@ class JP4: ...@@ -110,6 +110,11 @@ class JP4:
if self.bayer==[["Gr","R"],["B","Gb"]]: if self.bayer==[["Gr","R"],["B","Gb"]]:
self.bayer = [["B","Gb"],["Gr","R"]] self.bayer = [["B","Gb"],["Gr","R"]]
elif self.exif.data['Orientation']==1:
self.bayer = [["Gb","B"],["R","Gr"]]
#im = ImageOps.mirror(im) #im = ImageOps.mirror(im)
#im = im.rotate(270) #im = im.rotate(270)
...@@ -354,6 +359,24 @@ class JP4: ...@@ -354,6 +359,24 @@ class JP4:
G[1::2,1::2] = (p10 + narc(p10) + p01 + nabr(p01))/4 G[1::2,1::2] = (p10 + narc(p10) + p01 + nabr(p01))/4
B[1::2,1::2] = (p00 + nabr(p00) + narc(p00 + nabr(p00)))/4 B[1::2,1::2] = (p00 + nabr(p00) + narc(p00 + nabr(p00)))/4
elif bayer==[["Gb","B"],["R","Gr"]]:
R[0::2,0::2] = (p10 + naur(p10))/2
G[0::2,0::2] = (4*p00 + p11 + naur(p11) + nalc(p11 + naur(p11)))/8
B[0::2,0::2] = (p01 + nalc(p01))/2
R[0::2,1::2] = (p10 + naur(p10) + narc(p10 + naur(p10)))/4
G[0::2,1::2] = (p00 + narc(p00) + p11 + naur(p11))/4
B[0::2,1::2] = p01
R[1::2,0::2] = p10
G[1::2,0::2] = (p00 + nabr(p00) + p11 + nalc(p11))/4
B[1::2,0::2] = (p01 + nabr(p01) + nalc(p01 + nabr(p01)))/4
R[1::2,1::2] = (p10 + narc(p10))/2
G[1::2,1::2] = (4*p11 + p00 + nabr(p00) + narc(p00 + nabr(p00)))/8
B[1::2,1::2] = (p01 + nabr(p01))/2
# OpenCV uses BGR format # OpenCV uses BGR format
I = np.dstack([B,G,R]) I = np.dstack([B,G,R])
self.image = I self.image = I
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment