LakshmiHarika commited on
Commit
f7e74b6
·
verified ·
1 Parent(s): 8ad3a84

Update pages/Data Collection.py

Browse files
Files changed (1) hide show
  1. pages/Data Collection.py +26 -0
pages/Data Collection.py CHANGED
@@ -462,6 +462,32 @@ elif st.session_state.current_page == "explore_images_video":
462
  RGB is the most common color space used in digital imaging and is ideal for screens and devices that emit light.
463
  """)
464
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
465
 
466
 
467
 
 
462
  RGB is the most common color space used in digital imaging and is ideal for screens and devices that emit light.
463
  """)
464
 
465
+ st.subheader("Visualization of RGB Channels")
466
+
467
+ # Load an example image (you can use any image)
468
+ uploaded_file = st.file_uploader("Upload an Image", type=["jpg", "png"])
469
+ if uploaded_file:
470
+ img = Image.open(uploaded_file)
471
+ img_array = np.array(img)
472
+
473
+ # Split into channels
474
+ red_channel = img_array[:, :, 0]
475
+ green_channel = img_array[:, :, 1]
476
+ blue_channel = img_array[:, :, 2]
477
+
478
+ # Plot the channels
479
+ fig, ax = plt.subplots(1, 4, figsize=(12, 4))
480
+ ax[0].imshow(img)
481
+ ax[0].set_title("Original Image")
482
+ ax[1].imshow(red_channel, cmap="Reds")
483
+ ax[1].set_title("Red Channel")
484
+ ax[2].imshow(green_channel, cmap="Greens")
485
+ ax[2].set_title("Green Channel")
486
+ ax[3].imshow(blue_channel, cmap="Blues")
487
+ ax[3].set_title("Blue Channel")
488
+ for a in ax:
489
+ a.axis("off")
490
+ st.pyplot(fig)
491
 
492
 
493