Spaces:
Sleeping
Sleeping
Update pages/7_Unstructured_data.py
Browse files- pages/7_Unstructured_data.py +18 -7
pages/7_Unstructured_data.py
CHANGED
|
@@ -133,18 +133,29 @@ if file_type == "IMAGE":
|
|
| 133 |
st.markdown("""
|
| 134 |
- OpenCV allows users to perform basic operations like reading, displaying, and saving images.
|
| 135 |
- Along with that it also performs resizing, cropping, and filtering of images based on requirements.
|
| 136 |
-
- **Key Functions:** `imread()`, `imshow()`, `imwrite()`
|
| 137 |
- **`imread()`**: Reads an image from the disk, storing it as an array.
|
| 138 |
- **`imshow()`**: Displays the image in a window, allowing for easy visualization.
|
| 139 |
- **`imwrite()`**: Saves the image to a specified location on your storage.
|
| 140 |
```python
|
| 141 |
# Example Usage of OpenCV Functions
|
| 142 |
-
image = cv2.imread('path')
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
cv2.
|
| 146 |
-
|
| 147 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
""", unsafe_allow_html=True)
|
| 149 |
|
| 150 |
|
|
|
|
| 133 |
st.markdown("""
|
| 134 |
- OpenCV allows users to perform basic operations like reading, displaying, and saving images.
|
| 135 |
- Along with that it also performs resizing, cropping, and filtering of images based on requirements.
|
| 136 |
+
- **Key Functions:** `imread()`, `imshow()`, `imwrite()`
|
| 137 |
- **`imread()`**: Reads an image from the disk, storing it as an array.
|
| 138 |
- **`imshow()`**: Displays the image in a window, allowing for easy visualization.
|
| 139 |
- **`imwrite()`**: Saves the image to a specified location on your storage.
|
| 140 |
```python
|
| 141 |
# Example Usage of OpenCV Functions
|
| 142 |
+
image = cv2.imread('path')
|
| 143 |
+
# Reads an image - it always converts to 3D array which uses RGB color space
|
| 144 |
+
|
| 145 |
+
cv2.imshow('Image', array)
|
| 146 |
+
# Displays the image - Creates a pop-up window --> give any name in string format - and then take the array and display
|
| 147 |
+
|
| 148 |
+
cv2.waitKey()
|
| 149 |
+
# It adds a delay --> for how many milliseconds the pop-up window should be active in screen
|
| 150 |
+
|
| 151 |
+
cv2.destroyAllWindows()
|
| 152 |
+
# To remove from RAM --> automatically removes from RAM
|
| 153 |
+
|
| 154 |
+
cv2.imwrite('output.jpg', image)
|
| 155 |
+
# Saves the image to a file
|
| 156 |
+
|
| 157 |
+
cv2.resize(image)
|
| 158 |
+
# Resizes an image to a given dimension.
|
| 159 |
""", unsafe_allow_html=True)
|
| 160 |
|
| 161 |
|