Spaces:
Sleeping
Sleeping
Update pages/Data Collection.py
Browse files- pages/Data Collection.py +21 -0
pages/Data Collection.py
CHANGED
|
@@ -887,6 +887,27 @@ elif st.session_state.current_page == "image_operations":
|
|
| 887 |
)
|
| 888 |
else:
|
| 889 |
st.write("Please upload an image to proceed.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 890 |
|
| 891 |
|
| 892 |
elif st.session_state.current_page == "explore_audio":
|
|
|
|
| 887 |
)
|
| 888 |
else:
|
| 889 |
st.write("Please upload an image to proceed.")
|
| 890 |
+
|
| 891 |
+
# Heading for cv2.cvtColor() function
|
| 892 |
+
st.markdown("""
|
| 893 |
+
<h3 style="color: #e25822;">Converting Color Spaces with cv2.cvtColor()</h3>
|
| 894 |
+
""", unsafe_allow_html=True)
|
| 895 |
+
|
| 896 |
+
# About cv2.cvtColor() function
|
| 897 |
+
st.write("""
|
| 898 |
+
The **`cv2.cvtColor()`** function in OpenCV is used to convert an image from one color space to another.
|
| 899 |
+
This function is widely used for various color space transformations, such as converting a color image to grayscale or converting between RGB and HSV.
|
| 900 |
+
""")
|
| 901 |
+
|
| 902 |
+
# Syntax example for cv2.cvtColor()
|
| 903 |
+
st.code("""
|
| 904 |
+
# Converting an RGB image to Grayscale
|
| 905 |
+
gray_image = cv2.cvtColor(rgb_image, cv2.COLOR_BGR2GRAY) # Convert from BGR to Grayscale
|
| 906 |
+
|
| 907 |
+
# Converting a Grayscale image to RGB
|
| 908 |
+
rgb_image = cv2.cvtColor(gray_image, cv2.COLOR_GRAY2BGR) # Convert from Grayscale to BGR
|
| 909 |
+
""", language="python")
|
| 910 |
+
|
| 911 |
|
| 912 |
|
| 913 |
elif st.session_state.current_page == "explore_audio":
|