Skip to content

Commit

Permalink
Update background.py
Browse files Browse the repository at this point in the history
  • Loading branch information
arsalanmstn committed Sep 25, 2024
1 parent a7bb309 commit 5698e5f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyopia/background.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ def correct_im_accurate_divide(imbg, imraw):
corrected image, same type as input
'''

zero_mask = imbg == 0 # a mask to find pixels with zero value
imbg[zero_mask] = 1 / 255 # change the zero_value pixels to prevent RuntimeWarning: 'divide by zero'
for i in range(imbg.shape[2]):
imbg[:, :, i][imbg[:, :, i] == 0] = 1 / 255 # change the zero_value pixels to prevent RuntimeWarning: 'divide by zero'

im_corrected = imraw / imbg

Expand Down

0 comments on commit 5698e5f

Please sign in to comment.