Skip to content

Prevent image modification using rolling_ball #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tutorial43_shading_correction_using_rolling_ball.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
from matplotlib import pyplot as plt

img = cv2.imread("images/Particle_gradient.jpg", 0)

img_rb=img.copy() ## Copy the image to prevent modifications on the original image
radius=20
final_img, background = subtract_background_rolling_ball(img, radius, light_background=True,
final_img, background = subtract_background_rolling_ball(img_rb, radius, light_background=True,
use_paraboloid=False, do_presmooth=True)


Expand All @@ -64,10 +64,10 @@
clahe = cv2.createCLAHE(clipLimit=3, tileGridSize=(8,8))
clahe_img = clahe.apply(final_img)

#cv2.imshow("Original image", img)
cv2.imshow("Original image", img)
cv2.imshow("Background image", background)
cv2.imshow("AFter background subtraction", final_img)
cv2.imshow("After CLAHE", clahe_img)

cv2.waitKey(0)
cv2.destroyAllWindows()
cv2.destroyAllWindows()