Nikhithapotnuru commited on
Commit
1309a5e
Β·
verified Β·
1 Parent(s): 3d53d64

Update Home.py

Browse files
Files changed (1) hide show
  1. Home.py +169 -1
Home.py CHANGED
@@ -57,7 +57,7 @@ if st.session_state.page == "Home":
57
  # Display description
58
  st.write(descriptions[step])
59
 
60
- # Add a button to navigate to the Data Collection page
61
  if step == '1.Translation(Shifting)':
62
  if st.button("Learn More About Translation"):
63
  navigate_to("Translation")
@@ -92,3 +92,171 @@ elif st.session_state.page == "Translation":
92
  if st.button("Back to Home Page"):
93
  navigate_to("Home")
94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  # Display description
58
  st.write(descriptions[step])
59
 
60
+ # Add a button to navigate to the Translation page
61
  if step == '1.Translation(Shifting)':
62
  if st.button("Learn More About Translation"):
63
  navigate_to("Translation")
 
92
  if st.button("Back to Home Page"):
93
  navigate_to("Home")
94
 
95
+
96
+ # Add a button to navigate to the Rotating page
97
+ if step == '2.Rotating':
98
+ if st.button("Learn More About Rotating"):
99
+ navigate_to("Rotating")
100
+
101
+ # Rotating
102
+ elif st.session_state.page == "Rotating":
103
+ st.title("2. πŸ”„ Rotation")
104
+
105
+ # Content for Rotating
106
+ st.write('''
107
+ Definition:
108
+ Rotation turns the image around a fixed center point (usually the center of the image) by a certain angle.
109
+ ''')
110
+ st.image(r"Images/translationform.jpg",caption = "Mathmetical Form", width = 500)
111
+ st.write('''Example:
112
+ Moving an image 10 pixels to the right and 5 pixels down.
113
+ ''')
114
+ st.subheader("Code:")
115
+ st.code("""
116
+ import cv2
117
+ import numpy as np
118
+ tx = -50,ty = -50
119
+ tm = np.array([[1,0,tx],[0,1,ty]], dtype = np.float32)
120
+ trans_img = cv2.warpAffine(img,tm,dsize = (500,700))
121
+ cv2.imshow("originalimg",img)
122
+ cv2.imshow("translateimg",trans_img)
123
+ cv2.waitKey()
124
+ cv2.destroyAllWindows()""",language = "python")
125
+
126
+ st.markdown("<hr>", unsafe_allow_html=True)
127
+
128
+ if st.button("Back to Home Page"):
129
+ navigate_to("Home")
130
+
131
+
132
+ # Add a button to navigate to the Rotating page
133
+ if step == '2.Rotating':
134
+ if st.button("Learn More About Rotating"):
135
+ navigate_to("Rotating")
136
+
137
+ # Rotating
138
+ elif st.session_state.page == "Rotating":
139
+ st.title("2. πŸ”„ Rotation")
140
+
141
+ # Content for Rotating
142
+ st.write('''
143
+ Definition:
144
+ Rotation turns the image around a fixed center point (usually the center of the image) by a certain angle.
145
+ ''')
146
+ st.image(r"Images/translationform.jpg",caption = "Mathmetical Form", width = 500)
147
+ st.write('''Example:
148
+ Moving an image 10 pixels to the right and 5 pixels down.
149
+ ''')
150
+ st.subheader("Code:")
151
+ st.code("""
152
+ import cv2
153
+ import numpy as np
154
+ tx = -50,ty = -50
155
+ tm = np.array([[1,0,tx],[0,1,ty]], dtype = np.float32)
156
+ trans_img = cv2.warpAffine(img,tm,dsize = (500,700))
157
+ cv2.imshow("originalimg",img)
158
+ cv2.imshow("translateimg",trans_img)
159
+ cv2.waitKey()
160
+ cv2.destroyAllWindows()""",language = "python")
161
+
162
+ st.markdown("<hr>", unsafe_allow_html=True)
163
+
164
+ if st.button("Back to Home Page"):
165
+ navigate_to("Home")
166
+
167
+
168
+
169
+
170
+
171
+
172
+ # Rotating
173
+ elif st.session_state.page == "Rotating":
174
+ st.title("2. πŸ”„ Rotation")
175
+
176
+ # Content for Rotating
177
+ st.write('''
178
+ Definition:
179
+ Rotation turns the image around a fixed center point (usually the center of the image) by a certain angle.
180
+ ''')
181
+ st.image(r"Images/translationform.jpg",caption = "Mathmetical Form", width = 500)
182
+ st.write('''Example:
183
+ Moving an image 10 pixels to the right and 5 pixels down.
184
+ ''')
185
+ st.subheader("Code:")
186
+ st.code("""
187
+ import cv2
188
+ import numpy as np
189
+ tx = -50,ty = -50
190
+ tm = np.array([[1,0,tx],[0,1,ty]], dtype = np.float32)
191
+ trans_img = cv2.warpAffine(img,tm,dsize = (500,700))
192
+ cv2.imshow("originalimg",img)
193
+ cv2.imshow("translateimg",trans_img)
194
+ cv2.waitKey()
195
+ cv2.destroyAllWindows()""",language = "python")
196
+
197
+ st.markdown("<hr>", unsafe_allow_html=True)
198
+
199
+ if st.button("Back to Home Page"):
200
+ navigate_to("Home")
201
+
202
+
203
+ # Rotating
204
+ elif st.session_state.page == "Rotating":
205
+ st.title("2. πŸ”„ Rotation")
206
+
207
+ # Content for Rotating
208
+ st.write('''
209
+ Definition:
210
+ Rotation turns the image around a fixed center point (usually the center of the image) by a certain angle.
211
+ ''')
212
+ st.image(r"Images/translationform.jpg",caption = "Mathmetical Form", width = 500)
213
+ st.write('''Example:
214
+ Moving an image 10 pixels to the right and 5 pixels down.
215
+ ''')
216
+ st.subheader("Code:")
217
+ st.code("""
218
+ import cv2
219
+ import numpy as np
220
+ tx = -50,ty = -50
221
+ tm = np.array([[1,0,tx],[0,1,ty]], dtype = np.float32)
222
+ trans_img = cv2.warpAffine(img,tm,dsize = (500,700))
223
+ cv2.imshow("originalimg",img)
224
+ cv2.imshow("translateimg",trans_img)
225
+ cv2.waitKey()
226
+ cv2.destroyAllWindows()""",language = "python")
227
+
228
+ st.markdown("<hr>", unsafe_allow_html=True)
229
+
230
+ if st.button("Back to Home Page"):
231
+ navigate_to("Home")
232
+
233
+
234
+ # Rotating
235
+ elif st.session_state.page == "Rotating":
236
+ st.title("2. πŸ”„ Rotation")
237
+
238
+ # Content for Rotating
239
+ st.write('''
240
+ Definition:
241
+ Rotation turns the image around a fixed center point (usually the center of the image) by a certain angle.
242
+ ''')
243
+ st.image(r"Images/translationform.jpg",caption = "Mathmetical Form", width = 500)
244
+ st.write('''Example:
245
+ Moving an image 10 pixels to the right and 5 pixels down.
246
+ ''')
247
+ st.subheader("Code:")
248
+ st.code("""
249
+ import cv2
250
+ import numpy as np
251
+ tx = -50,ty = -50
252
+ tm = np.array([[1,0,tx],[0,1,ty]], dtype = np.float32)
253
+ trans_img = cv2.warpAffine(img,tm,dsize = (500,700))
254
+ cv2.imshow("originalimg",img)
255
+ cv2.imshow("translateimg",trans_img)
256
+ cv2.waitKey()
257
+ cv2.destroyAllWindows()""",language = "python")
258
+
259
+ st.markdown("<hr>", unsafe_allow_html=True)
260
+
261
+ if st.button("Back to Home Page"):
262
+ navigate_to("Home")