Skip to content

Commit 801fef0

Browse files
committed
update
1 parent 83682a0 commit 801fef0

File tree

3 files changed

+34
-15
lines changed

3 files changed

+34
-15
lines changed
3.37 MB
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"folders": [
3+
{
4+
"path": "."
5+
}
6+
],
7+
"settings": {}
8+
}

slr/main.py

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ def main():
4747
CAP_HEIGHT = args.height
4848

4949
#: mp Hands
50-
USE_STATIC_IMAGE_MODE = args.use_static_image_mode
50+
# USE_STATIC_IMAGE_MODE = args.use_static_image_mode
51+
USE_STATIC_IMAGE_MODE = True
5152
MAX_NUM_HANDS = args.max_num_hands
5253
MIN_DETECTION_CONFIDENCE = args.min_detection_confidence
5354
MIN_TRACKING_CONFIDENCE = args.min_tracking_confidence
@@ -56,7 +57,7 @@ def main():
5657
USE_BRECT = args.use_brect
5758
MODE = args.mode
5859
DEBUG = int(os.environ.get("DEBUG", "0")) == 1
59-
# CAP_DEVICE = 0
60+
CAP_DEVICE = 0
6061

6162
print("INFO: System initialization Successful")
6263
print("INFO: Opening Camera")
@@ -66,6 +67,8 @@ def main():
6667
cap = cv.VideoCapture(CAP_DEVICE)
6768
cap.set(cv.CAP_PROP_FRAME_WIDTH, CAP_WIDTH)
6869
cap.set(cv.CAP_PROP_FRAME_HEIGHT, CAP_HEIGHT)
70+
71+
background_image = cv.imread("resources/background_prediction.png")
6972

7073
#: Background Image
7174
background_image = cv.imread("resources/background.png")
@@ -117,7 +120,9 @@ def main():
117120
success, image = cap.read()
118121
if not success:
119122
continue
120-
123+
124+
image = cv.resize(image, (CAP_WIDTH, CAP_HEIGHT))
125+
121126
#: Flip Image for mirror display
122127
image = cv.flip(image, 1)
123128
debug_image = copy.deepcopy(image)
@@ -181,24 +186,30 @@ def main():
181186
#: -
182187
#: Set main video footage on Background
183188

184-
if MODE == 0: #: Prediction Mode / Normal mode
189+
# if MODE == 0: #: Prediction Mode / Normal mode
185190

186-
#: Changing to Prediction Background and setting main video footage on Background
187-
background_image = cv.imread("resources/background_prediction.png")
188-
background_image[170:170 + 480, 50:50 + 640] = debug_image
189-
background_image[240:240 + 127, 731:731 + 299] = result_image
190-
background_image[678:678 + 30, 118:118 + 640] = fps_log_image
191+
# #: Changing to Prediction Background and setting main video footage on Background
192+
# background_image = cv.imread("resources/background_prediction.png")
193+
# background_image[170:170 + 480, 50:50 + 640] = debug_image
194+
# background_image[240:240 + 127, 731:731 + 299] = result_image
195+
# background_image[678:678 + 30, 118:118 + 640] = fps_log_image
191196

192-
elif MODE == 1: #: Logging Mode
197+
# elif MODE == 1: #: Logging Mode
193198

194-
#: Changing to Logging Background and setting main video footage on Background
195-
background_image = cv.imread("resources/background_logging.png")
196-
background_image[170:170 + 480, 50:50 + 640] = debug_image
197-
background_image[240:240 + 127, 731:731 + 299] = result_image
198-
background_image[678:678 + 30, 118:118 + 640] = fps_log_image
199+
# #: Changing to Logging Background and setting main video footage on Background
200+
# background_image = cv.imread("resources/background_logging.png")
201+
# background_image[170:170 + 480, 50:50 + 640] = debug_image
202+
# background_image[240:240 + 127, 731:731 + 299] = result_image
203+
# background_image[678:678 + 30, 118:118 + 640] = fps_log_image
204+
205+
206+
background_image[170:170 + 480, 50:50 + 640] = debug_image
207+
background_image[240:240 + 127, 731:731 + 299] = result_image
208+
background_image[678:678 + 30, 118:118 + 640] = fps_log_image
199209

200210
# cv.imshow("Result", result_image)
201211
# cv.imshow("Main Frame", debug_image)
212+
202213
cv.imshow("Sign Language Recognition", background_image)
203214

204215
cap.release()

0 commit comments

Comments
 (0)