Skip to content

Commit

Permalink
Camera adapted for 16bits and 8bits images coming from camera
Browse files Browse the repository at this point in the history
  • Loading branch information
romainbrette committed Aug 1, 2017
1 parent 290ae29 commit d0b3624
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion AutomaticPatch/Camera/Camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ def run(self):
temp_frame = cv2.cvtColor(temp_frame, cv2.COLOR_GRAY2BGR)

# Convert to 8 bit gray scale
img = cv2.convertScaleAbs(temp_frame)
if temp_frame.dtype == 'uint8':
img = cv2.convertScaleAbs(temp_frame)
elif temp_frame.dtype == 'uint16':
img = cv2.convertScaleAbs(temp_frame, alpha=2**-2)
else:
img = cv2.convertScaleAbs(temp_frame)

# Increase contrast (Contrast Limited Adaptive Histogram Equalization)
# clahe = cv2.createCLAHE(clipLimit=1.0, tileGridSize=(8, 8))
Expand Down

0 comments on commit d0b3624

Please sign in to comment.