Phaneendrabayi commited on
Commit
191b3f5
·
verified ·
1 Parent(s): 69aa483

Update pages/Life_cycle_of_ML.py

Browse files
Files changed (1) hide show
  1. pages/Life_cycle_of_ML.py +13 -4
pages/Life_cycle_of_ML.py CHANGED
@@ -538,10 +538,19 @@ def More():
538
  merged_image = cv2.merge((r, g, b))
539
  """, language="python")
540
 
541
- # Display each channel and the manipulated image
542
- st.image(b, caption="Blue Channel")
543
- st.image(g, caption="Green Channel")
544
- st.image(r, caption="Red Channel")
 
 
 
 
 
 
 
 
 
545
  st.image(cv2.cvtColor(merged_image, cv2.COLOR_BGR2RGB), caption="Manipulated Image (Swapped Channels)")
546
 
547
  st.code("""
 
538
  merged_image = cv2.merge((r, g, b))
539
  """, language="python")
540
 
541
+ # Set the green and red channels to zero to keep only the blue channel
542
+ b_only = cv2.merge((b, g*0, r*0))
543
+
544
+ # Set the blue and red channels to zero to keep only the green channel
545
+ g_only = cv2.merge((b*0, g, r*0))
546
+
547
+ # Set the blue and green channels to zero to keep only the red channel
548
+ r_only = cv2.merge((b*0, g*0, g))
549
+
550
+ # Display the individual channels and manipulated images
551
+ st.image(b_only, caption="Blue Channel Only")
552
+ st.image(g_only, caption="Green Channel Only")
553
+ st.image(r_only, caption="Red Channel Only")
554
  st.image(cv2.cvtColor(merged_image, cv2.COLOR_BGR2RGB), caption="Manipulated Image (Swapped Channels)")
555
 
556
  st.code("""