Spaces:
Sleeping
Sleeping
Update pages/Data Collection.py
Browse files- pages/Data Collection.py +11 -50
pages/Data Collection.py
CHANGED
|
@@ -477,9 +477,9 @@ elif st.session_state.current_page == "explore_images_video":
|
|
| 477 |
|
| 478 |
st.write("""
|
| 479 |
In the next section, we'll dive into the exciting world of **image processing using OpenCV**. We'll cover how to:
|
| 480 |
-
- **
|
| 481 |
-
-
|
| 482 |
-
-
|
| 483 |
|
| 484 |
Curious to see how?👇Click here to start your journey into OpenCV Basics!🚀
|
| 485 |
""")
|
|
@@ -491,61 +491,22 @@ elif st.session_state.current_page == "explore_images_video":
|
|
| 491 |
if st.button("Back to previous page"):
|
| 492 |
navigate_to("main")
|
| 493 |
|
| 494 |
-
# Navigation for OpenCV Operations Page
|
| 495 |
elif st.session_state.current_page == "opencv_operations":
|
| 496 |
-
# Page
|
| 497 |
st.markdown("""
|
| 498 |
-
<h2 style="color: #BB3385;">
|
| 499 |
""", unsafe_allow_html=True)
|
| 500 |
-
|
| 501 |
-
#
|
| 502 |
-
st.write("""
|
| 503 |
-
OpenCV (Open Source Computer Vision Library) is a powerful library used for image processing and computer vision tasks.
|
| 504 |
-
It provides various methods for handling images, such as reading, displaying, and modifying them.
|
| 505 |
-
""")
|
| 506 |
-
|
| 507 |
-
# Basic OpenCV Methods
|
| 508 |
-
st.markdown("""
|
| 509 |
-
<h3 style="color: #e25822;">Basic Operations:</h3>
|
| 510 |
-
""", unsafe_allow_html=True)
|
| 511 |
-
|
| 512 |
st.write("""
|
| 513 |
-
|
| 514 |
-
|
| 515 |
-
|
| 516 |
-
|
| 517 |
-
- **`cv2.cvtColor()`**: Converts an image from one color space to another.
|
| 518 |
""")
|
| 519 |
|
| 520 |
-
# Example Code
|
| 521 |
-
st.markdown("""
|
| 522 |
-
<h3 style="color: #5b2c6f;">Example Code:</h3>
|
| 523 |
-
""")
|
| 524 |
-
|
| 525 |
-
st.code("""
|
| 526 |
-
import cv2
|
| 527 |
-
|
| 528 |
-
# Read an image
|
| 529 |
-
image = cv2.imread("path/to/your/image.jpg")
|
| 530 |
-
|
| 531 |
-
# Display the image
|
| 532 |
-
cv2.imshow("Image", image)
|
| 533 |
-
cv2.waitKey(0)
|
| 534 |
-
cv2.destroyAllWindows()
|
| 535 |
|
| 536 |
-
# Save the image
|
| 537 |
-
cv2.imwrite("output_image.jpg", image)
|
| 538 |
|
| 539 |
-
# Resize the image
|
| 540 |
-
resized_image = cv2.resize(image, (100, 100))
|
| 541 |
-
|
| 542 |
-
# Convert to grayscale
|
| 543 |
-
gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
|
| 544 |
-
""", language="python")
|
| 545 |
-
|
| 546 |
-
# Go Back Button
|
| 547 |
-
if st.button("Go Back to Home Page"):
|
| 548 |
-
navigate_to("main")
|
| 549 |
|
| 550 |
|
| 551 |
|
|
|
|
| 477 |
|
| 478 |
st.write("""
|
| 479 |
In the next section, we'll dive into the exciting world of **image processing using OpenCV**. We'll cover how to:
|
| 480 |
+
- **Read, display, and manipulate images** programmatically.
|
| 481 |
+
- Understand the **core operations** used in computer vision.
|
| 482 |
+
- Transform images to uncover hidden insights.
|
| 483 |
|
| 484 |
Curious to see how?👇Click here to start your journey into OpenCV Basics!🚀
|
| 485 |
""")
|
|
|
|
| 491 |
if st.button("Back to previous page"):
|
| 492 |
navigate_to("main")
|
| 493 |
|
|
|
|
| 494 |
elif st.session_state.current_page == "opencv_operations":
|
| 495 |
+
# Introduction to OpenCV Page
|
| 496 |
st.markdown("""
|
| 497 |
+
<h2 style="color: #BB3385;">Introduction to OpenCV</h2>
|
| 498 |
""", unsafe_allow_html=True)
|
| 499 |
+
|
| 500 |
+
# Informative Content
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 501 |
st.write("""
|
| 502 |
+
Before diving into OpenCV basics, let's understand a few key points:
|
| 503 |
+
- In Python, we have several libraries to work with images. One of the most powerful and popular libraries is **OpenCV**.
|
| 504 |
+
- With **OpenCV**, we can provide machines with **artificial vision**, enabling them to perceive and process visual information.
|
| 505 |
+
- OpenCV allows us to work with both **images and videos**, making it a versatile tool for various computer vision applications.
|
|
|
|
| 506 |
""")
|
| 507 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 508 |
|
|
|
|
|
|
|
| 509 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 510 |
|
| 511 |
|
| 512 |
|