Phaneendrabayi commited on
Commit
d374904
·
verified ·
1 Parent(s): 073e87d

Update pages/Life_cycle_of_ML.py

Browse files
Files changed (1) hide show
  1. pages/Life_cycle_of_ML.py +20 -0
pages/Life_cycle_of_ML.py CHANGED
@@ -561,6 +561,26 @@ def More():
561
 
562
  st.write("These operations help in extracting and analyzing features from images!")
563
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
564
 
565
  else:
566
  st.write("Please upload an image to explore image processing techniques.")
 
561
 
562
  st.write("These operations help in extracting and analyzing features from images!")
563
 
564
+ # Additional Content: Thresholding
565
+ st.subheader("4. Thresholding")
566
+ st.write("Thresholding is used to segment images by converting them into binary forms.")
567
+ _, binary_image = cv2.threshold(grayscale_image, 127, 255, cv2.THRESH_BINARY)
568
+
569
+ # Function: cv2.threshold
570
+ # Definition: Applies a fixed-level threshold to an image, converting it into a binary image.
571
+
572
+ st.image(binary_image, caption="Binary Image")
573
+
574
+ # Additional Content: Blurring
575
+ st.subheader("5. Blurring")
576
+ st.write("Blurring smoothens images to reduce noise.")
577
+ blurred_image = cv2.GaussianBlur(image, (15, 15), 0)
578
+
579
+ # Function: cv2.GaussianBlur
580
+ # Definition: Applies a Gaussian filter to an image, which is useful for noise reduction.
581
+
582
+ st.image(cv2.cvtColor(blurred_image, cv2.COLOR_BGR2RGB), caption="Blurred Image")
583
+
584
 
585
  else:
586
  st.write("Please upload an image to explore image processing techniques.")