Skip to content

Commit

Permalink
fix polarizer angle definition (0->90, 90->0)
Browse files Browse the repository at this point in the history
  • Loading branch information
elerac committed Sep 23, 2020
1 parent 232c760 commit f7ebd05
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions polanalyser/demosaicing.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ def __demosaicing_float(bayer):
pre_bayer = (np.array((bayer,bayer,bayer,bayer)) * value_position).transpose(1, 2, 0)

img_polarization = cv2.filter2D(pre_bayer, -1, kernel)
return img_polarization[:,:,[0, 1, 3, 2]]
return img_polarization[:,:,[3, 1, 0, 2]]

def __demosaicing_uint(bayer):
"""
Polarization demosaicing for np.uint8 or np.uint16 type
"""
BG = cv2.cvtColor(bayer, cv2.COLOR_BayerBG2BGR)
GR = cv2.cvtColor(bayer, cv2.COLOR_BayerGR2BGR)
img_polarization = np.array((BG[:,:,2], GR[:,:,0], BG[:,:,0], GR[:,:,2])).transpose(1, 2, 0)
img_polarization = np.array((BG[:,:,0], GR[:,:,0], BG[:,:,2], GR[:,:,2])).transpose(1, 2, 0)
return img_polarization

def demosaicing(img_bayer):
Expand Down

0 comments on commit f7ebd05

Please sign in to comment.