Skip to content

Commit

Permalink
Add black level assertion.
Browse files Browse the repository at this point in the history
  • Loading branch information
ebezzam committed Nov 29, 2023
1 parent 8e3747b commit 1b21fdb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lensless/utils/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@ def bayer2rgb_cc(
dtype = np.uint16
else:
dtype = np.uint8
assert (
black_level < 2**nbits - 1
), f"Black level ({black_level}) too high for bit depth ({nbits})."

# demosaic Bayer data
img = cv2.cvtColor(img, cv2.COLOR_BayerRG2RGB)
Expand Down

0 comments on commit 1b21fdb

Please sign in to comment.