Harika22 commited on
Commit
5be21f1
·
verified ·
1 Parent(s): 71653b0

Update pages/7_Unstructured_data.py

Browse files
Files changed (1) hide show
  1. pages/7_Unstructured_data.py +13 -10
pages/7_Unstructured_data.py CHANGED
@@ -133,17 +133,20 @@ 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:**
137
- <ul class="icon-bullet">
138
- <li>imread() </li>
139
- <li>imshow() </li>
140
- <li>imwrite() </li>
141
- </ul>
142
-
143
- - **imread()**: Reads an image from the disk, storing it as an array.
144
- - **imshow()**: Displays the image in a window, allowing for easy visualization.
145
- - **imwrite()**: Saves the image to a specified location on your storage.
 
 
146
  """, unsafe_allow_html=True)
 
147
 
148
 
149
  elif data_type1 == "Color Space":
 
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') # Reads an image - it always converts to 3D array which uses RGB color space
143
+ cv2.imshow('Image', array) # Displays the image - Creates a pop-up window --> give any name in string format - and then take the array and display
144
+ cv2.waitKey() # It adds a delay --> for how many milliseconds the pop-up window should be active in screen
145
+ cv2.destroyAllWindows() # To remove from RAM --> automatically removes from RAM
146
+ cv2.imwrite('output.jpg', image) # Saves the image to a file
147
+ cv2.resize(image) # Resizes an image to a given dimension.
148
  """, unsafe_allow_html=True)
149
+
150
 
151
 
152
  elif data_type1 == "Color Space":