Spaces:
Sleeping
Sleeping
Update pages/Data Collection.py
Browse files- pages/Data Collection.py +4 -4
pages/Data Collection.py
CHANGED
|
@@ -559,7 +559,7 @@ elif st.session_state.current_page == "opencv_operations":
|
|
| 559 |
import cv2
|
| 560 |
|
| 561 |
# Read the image
|
| 562 |
-
image = cv2.imread('path_to_image.jpg') # Replace 'path_to_image.jpg' with
|
| 563 |
|
| 564 |
# Display the numerical matrix
|
| 565 |
print(image) # This will print the image as an array of pixel values
|
|
@@ -567,7 +567,7 @@ elif st.session_state.current_page == "opencv_operations":
|
|
| 567 |
|
| 568 |
# Explanation for Grayscale Conversion
|
| 569 |
st.write("""
|
| 570 |
-
By default, the `imread()
|
| 571 |
To convert the image to grayscale, pass `0` as the second argument to the `imread()` function. This will return a 2D array where each pixel value represents intensity.
|
| 572 |
""")
|
| 573 |
|
|
@@ -616,8 +616,8 @@ elif st.session_state.current_page == "opencv_operations":
|
|
| 616 |
st.code("""
|
| 617 |
# imshow()
|
| 618 |
cv2.imshow(window_name, image_array)
|
| 619 |
-
# window_name: The title of the pop-up window
|
| 620 |
-
# image_array: The image data (
|
| 621 |
|
| 622 |
# waitKey()
|
| 623 |
cv2.waitKey(delay_in_milliseconds)
|
|
|
|
| 559 |
import cv2
|
| 560 |
|
| 561 |
# Read the image
|
| 562 |
+
image = cv2.imread('path_to_image.jpg') # Replace 'path_to_image.jpg' with the image file path
|
| 563 |
|
| 564 |
# Display the numerical matrix
|
| 565 |
print(image) # This will print the image as an array of pixel values
|
|
|
|
| 567 |
|
| 568 |
# Explanation for Grayscale Conversion
|
| 569 |
st.write("""
|
| 570 |
+
By default, the `imread()` function reads an image as a 3D array in the RGB color space.
|
| 571 |
To convert the image to grayscale, pass `0` as the second argument to the `imread()` function. This will return a 2D array where each pixel value represents intensity.
|
| 572 |
""")
|
| 573 |
|
|
|
|
| 616 |
st.code("""
|
| 617 |
# imshow()
|
| 618 |
cv2.imshow(window_name, image_array)
|
| 619 |
+
# window_name: The title of the pop-up window
|
| 620 |
+
# image_array: The image data (Array)
|
| 621 |
|
| 622 |
# waitKey()
|
| 623 |
cv2.waitKey(delay_in_milliseconds)
|