LakshmiHarika commited on
Commit
befa3fd
·
verified ·
1 Parent(s): d29c915

Update pages/Data Collection.py

Browse files
Files changed (1) hide show
  1. pages/Data Collection.py +18 -0
pages/Data Collection.py CHANGED
@@ -415,6 +415,24 @@ elif st.session_state.current_page == "explore_images_video":
415
  Grayscale eliminates color information, focusing entirely on the intensity of light in an image. Each pixel has only one intensity value, making it a simpler and more compact representation compared to color images.
416
  """)
417
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
418
  # Section: What is RGB Color Space?
419
  st.subheader("What is RGB Color Space?")
420
  st.write("""
 
415
  Grayscale eliminates color information, focusing entirely on the intensity of light in an image. Each pixel has only one intensity value, making it a simpler and more compact representation compared to color images.
416
  """)
417
 
418
+ # Section: Grayscale Representation
419
+ st.subheader("Grayscale Representation")
420
+
421
+ # Create grayscale gradient with labeled intensity values
422
+ gradient = np.linspace(0, 255, 256) # Generate gradient values
423
+ gradient = np.tile(gradient, (10, 1)) # Repeat the gradient to make it visually clear
424
+
425
+ # Plot the gradient
426
+ fig, ax = plt.subplots(figsize=(8, 2))
427
+ ax.imshow(gradient, cmap='gray', aspect='auto')
428
+ ax.set_xticks(np.linspace(0, 255, 11)) # Set ticks for every 25.5 (0, 25, ..., 255)
429
+ ax.set_xticklabels([str(int(x)) for x in np.linspace(0, 255, 11)], fontsize=10, color='red') # Add labels in red
430
+ ax.set_yticks([]) # Remove y-axis ticks
431
+ ax.set_title("Grayscale Representation", fontsize=12)
432
+
433
+ # Render the plot in Streamlit
434
+ st.pyplot(fig)
435
+
436
  # Section: What is RGB Color Space?
437
  st.subheader("What is RGB Color Space?")
438
  st.write("""