Harika22 commited on
Commit
2a04c62
·
verified ·
1 Parent(s): 018926d

Update pages/7_Unstructured_data.py

Browse files
Files changed (1) hide show
  1. pages/7_Unstructured_data.py +20 -3
pages/7_Unstructured_data.py CHANGED
@@ -129,7 +129,7 @@ if file_type == "IMAGE":
129
  - Especially images are handled by pil --> pillow
130
  - These operations are essential for tasks such as image processing, computer vision.
131
  """)
132
-
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.
@@ -142,7 +142,7 @@ if file_type == "IMAGE":
142
  - **`imwrite()`**: Saves the image to a specified location on your storage.
143
  ```python
144
  # Example Usage of OpenCV Functions
145
-
146
  image = cv2.imread('path')
147
  # Reads an image - it always converts to 3D array which uses RGB color space
148
 
@@ -161,6 +161,23 @@ if file_type == "IMAGE":
161
  cv2.resize(image)
162
  # Resizes an image to a given dimension.
163
  """, unsafe_allow_html=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
 
165
 
166
 
@@ -173,7 +190,7 @@ if file_type == "IMAGE":
173
  <li>Gray Scale Color Space </li>
174
  <li>RGB Color Space </li>
175
  </ul>
176
- """, unsafe_allow_html=True)
177
  st.header('**Black & White Color Space**')
178
  st.markdown('''
179
  - It preserves only two colors which are **black(0) and white(1)**
 
129
  - Especially images are handled by pil --> pillow
130
  - These operations are essential for tasks such as image processing, computer vision.
131
  """)
132
+ st.subheader('**Image Operations**')
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.
 
142
  - **`imwrite()`**: Saves the image to a specified location on your storage.
143
  ```python
144
  # Example Usage of OpenCV Functions
145
+ import cv2
146
  image = cv2.imread('path')
147
  # Reads an image - it always converts to 3D array which uses RGB color space
148
 
 
161
  cv2.resize(image)
162
  # Resizes an image to a given dimension.
163
  """, unsafe_allow_html=True)
164
+
165
+ st.subheader('**Image to Tabular Data**')
166
+ st.markdown('''
167
+ - Basically there are 5 steps to convert a iamge into tabular data
168
+ - **Image** which is in 2D format converts into array uses color space(gray) using a image operation `imread()`.
169
+ - **Array** which can be of any dimension so to make sure that every array having same dimension or (pixels) we use `resize()` operation
170
+ - **Resize** which can be done in 2 ways which are `Compression` and `Expansion`
171
+ - **`Compression`** - It removes pixels which has a disadvantage of loosing the information
172
+ - **`Expansion`** - It adds rows or columns which has a disadvantage of adding noise
173
+ - lots of information is lost --> type of features lost are **Spatial Features**
174
+ - **Flatten** after resizing the image it converts every nd array to 1D array
175
+ - **Concatenation** after flattening the array then concatenate every 1D array
176
+
177
+ ---> So that image is converted into tabular data
178
+ - Images ------> Array ------> Resize ------> Flatten ------>Concatenation
179
+ - using thse steps images are converted into tabular data
180
+ ''')
181
 
182
 
183
 
 
190
  <li>Gray Scale Color Space </li>
191
  <li>RGB Color Space </li>
192
  </ul>
193
+ """, unsafe_allow_html=True)
194
  st.header('**Black & White Color Space**')
195
  st.markdown('''
196
  - It preserves only two colors which are **black(0) and white(1)**