Browse Source

Clean up

tags/kitchen
Pete Shadbolt 3 years ago
parent
commit
fcdeaa73ca
1 changed files with 12 additions and 11 deletions
  1. +12
    -11
      radio.py

+ 12
- 11
radio.py View File

@@ -7,6 +7,7 @@ RED = [0, 0, 255]


def draw_rectangles(frame):
""" Draw some rectangles on top of the image """
height, width, d = frame.shape
n = DENSITY
m = math.ceil(n * (height / width))
@@ -19,17 +20,17 @@ def draw_rectangles(frame):
return frame


camera = cv2.VideoCapture(0)
if __name__ == '__main__':
camera = cv2.VideoCapture(0)

while True:
ret, frame = camera.read()
frame = draw_rectangles(frame)
frame = cv2.rectangle(frame, (0, 0), (100, 100), (255, 0, 0), 2)
cv2.imshow('Input', frame)
while True:
ret, frame = camera.read()
frame = draw_rectangles(frame)
cv2.imshow('Input', frame)

c = cv2.waitKey(1)
if c == 27:
break
c = cv2.waitKey(1)
if c == 27:
break

camera.release()
cv2.destroyAllWindows()
camera.release()
cv2.destroyAllWindows()

Loading…
Cancel
Save