add outdoor panel

This commit is contained in:
s449273 2020-01-02 17:04:13 +01:00
parent a0dd1ad1c5
commit 30bdca6f0d
9 changed files with 140 additions and 32 deletions

View File

@ -2,21 +2,9 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="1afdfa2b-0340-4e25-8722-635281502d28" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/recordings/output.avi" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/beep-07.wav" beforeDir="false" afterPath="$PROJECT_DIR$/src/noises/beep-07.wav" afterDir="false" />
<change beforePath="$PROJECT_DIR$/black.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/dzialam_viedo.py" beforeDir="false" afterPath="$PROJECT_DIR$/smart_intercom.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/icon1.png" beforeDir="false" afterPath="$PROJECT_DIR$/src/icons/icon1.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/icon2.png" beforeDir="false" afterPath="$PROJECT_DIR$/src/icons/icon2.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/icon3.png" beforeDir="false" afterPath="$PROJECT_DIR$/src/icons/icon3.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/icon4.png" beforeDir="false" afterPath="$PROJECT_DIR$/src/icons/icon4.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/icon5.png" beforeDir="false" afterPath="$PROJECT_DIR$/src/icons/icon5.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/icon6.png" beforeDir="false" afterPath="$PROJECT_DIR$/src/icons/icon6.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/menu.png" beforeDir="false" afterPath="$PROJECT_DIR$/src/images/menu.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/not1.png" beforeDir="false" afterPath="$PROJECT_DIR$/src/notification/not1.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/output.avi" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/recordings/output.avi" beforeDir="false" afterPath="$PROJECT_DIR$/recordings/output.avi" afterDir="false" />
<change beforePath="$PROJECT_DIR$/smart_intercom.py" beforeDir="false" afterPath="$PROJECT_DIR$/smart_intercom.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -116,45 +104,58 @@
<screen x="53" y="27" width="3787" height="1053" />
</state>
<state x="444" y="211" key="#com.intellij.execution.impl.EditConfigurationsDialog/53.27.3787.1053@53.27.3787.1053" timestamp="1575643901302" />
<state width="1377" height="260" key="GridCell.Tab.0.bottom" timestamp="1575643904844">
<screen x="53" y="27" width="3787" height="1053" />
<state x="86" y="123" width="777" height="807" key="CommitChangelistDialog2" timestamp="1577981003041">
<screen x="0" y="27" width="1920" height="1002" />
</state>
<state x="86" y="123" width="777" height="807" key="CommitChangelistDialog2/0.27.1920.1002@0.27.1920.1002" timestamp="1577981003041" />
<state width="937" height="260" key="GridCell.Tab.0.bottom" timestamp="1577980891069">
<screen x="0" y="27" width="1920" height="1002" />
</state>
<state width="937" height="260" key="GridCell.Tab.0.bottom/0.27.1920.1002@0.27.1920.1002" timestamp="1577980891069" />
<state width="1377" height="260" key="GridCell.Tab.0.bottom/53.27.1867.1053@53.27.1867.1053" timestamp="1575643274434" />
<state width="1377" height="260" key="GridCell.Tab.0.bottom/53.27.3787.1053@53.27.3787.1053" timestamp="1575643904844" />
<state width="1377" height="260" key="GridCell.Tab.0.center" timestamp="1575643904844">
<screen x="53" y="27" width="3787" height="1053" />
<state width="937" height="260" key="GridCell.Tab.0.center" timestamp="1577980891068">
<screen x="0" y="27" width="1920" height="1002" />
</state>
<state width="937" height="260" key="GridCell.Tab.0.center/0.27.1920.1002@0.27.1920.1002" timestamp="1577980891068" />
<state width="1377" height="260" key="GridCell.Tab.0.center/53.27.1867.1053@53.27.1867.1053" timestamp="1575643274433" />
<state width="1377" height="260" key="GridCell.Tab.0.center/53.27.3787.1053@53.27.3787.1053" timestamp="1575643904844" />
<state width="1377" height="260" key="GridCell.Tab.0.left" timestamp="1575643904843">
<screen x="53" y="27" width="3787" height="1053" />
<state width="937" height="260" key="GridCell.Tab.0.left" timestamp="1577980891067">
<screen x="0" y="27" width="1920" height="1002" />
</state>
<state width="937" height="260" key="GridCell.Tab.0.left/0.27.1920.1002@0.27.1920.1002" timestamp="1577980891067" />
<state width="1377" height="260" key="GridCell.Tab.0.left/53.27.1867.1053@53.27.1867.1053" timestamp="1575643274433" />
<state width="1377" height="260" key="GridCell.Tab.0.left/53.27.3787.1053@53.27.3787.1053" timestamp="1575643904843" />
<state width="1377" height="260" key="GridCell.Tab.0.right" timestamp="1575643904844">
<screen x="53" y="27" width="3787" height="1053" />
<state width="937" height="260" key="GridCell.Tab.0.right" timestamp="1577980891069">
<screen x="0" y="27" width="1920" height="1002" />
</state>
<state width="937" height="260" key="GridCell.Tab.0.right/0.27.1920.1002@0.27.1920.1002" timestamp="1577980891069" />
<state width="1377" height="260" key="GridCell.Tab.0.right/53.27.1867.1053@53.27.1867.1053" timestamp="1575643274433" />
<state width="1377" height="260" key="GridCell.Tab.0.right/53.27.3787.1053@53.27.3787.1053" timestamp="1575643904844" />
<state width="1377" height="322" key="GridCell.Tab.1.bottom" timestamp="1575643647121">
<screen x="53" y="27" width="3787" height="1053" />
<state width="1897" height="323" key="GridCell.Tab.1.bottom" timestamp="1577976694302">
<screen x="0" y="27" width="1920" height="1002" />
</state>
<state width="1897" height="323" key="GridCell.Tab.1.bottom/0.27.1920.1002@0.27.1920.1002" timestamp="1577976694302" />
<state width="1377" height="322" key="GridCell.Tab.1.bottom/53.27.3787.1053@53.27.3787.1053" timestamp="1575643647121" />
<state width="1377" height="322" key="GridCell.Tab.1.center" timestamp="1575643647120">
<screen x="53" y="27" width="3787" height="1053" />
<state width="1897" height="323" key="GridCell.Tab.1.center" timestamp="1577976694301">
<screen x="0" y="27" width="1920" height="1002" />
</state>
<state width="1897" height="323" key="GridCell.Tab.1.center/0.27.1920.1002@0.27.1920.1002" timestamp="1577976694301" />
<state width="1377" height="322" key="GridCell.Tab.1.center/53.27.3787.1053@53.27.3787.1053" timestamp="1575643647120" />
<state width="1377" height="322" key="GridCell.Tab.1.left" timestamp="1575643647120">
<screen x="53" y="27" width="3787" height="1053" />
<state width="1897" height="323" key="GridCell.Tab.1.left" timestamp="1577976694301">
<screen x="0" y="27" width="1920" height="1002" />
</state>
<state width="1897" height="323" key="GridCell.Tab.1.left/0.27.1920.1002@0.27.1920.1002" timestamp="1577976694301" />
<state width="1377" height="322" key="GridCell.Tab.1.left/53.27.3787.1053@53.27.3787.1053" timestamp="1575643647120" />
<state width="1377" height="322" key="GridCell.Tab.1.right" timestamp="1575643647120">
<screen x="53" y="27" width="3787" height="1053" />
<state width="1897" height="323" key="GridCell.Tab.1.right" timestamp="1577976694301">
<screen x="0" y="27" width="1920" height="1002" />
</state>
<state width="1897" height="323" key="GridCell.Tab.1.right/0.27.1920.1002@0.27.1920.1002" timestamp="1577976694301" />
<state width="1377" height="322" key="GridCell.Tab.1.right/53.27.3787.1053@53.27.3787.1053" timestamp="1575643647120" />
<state x="642" y="380" key="com.intellij.ide.util.TipDialog" timestamp="1575641807897">
<screen x="53" y="27" width="1867" height="1053" />
<state x="606" y="363" key="com.intellij.ide.util.TipDialog" timestamp="1577972208242">
<screen x="0" y="27" width="1920" height="1002" />
</state>
<state x="606" y="363" key="com.intellij.ide.util.TipDialog/0.27.1920.1002@0.27.1920.1002" timestamp="1577972208242" />
<state x="642" y="380" key="com.intellij.ide.util.TipDialog/53.27.1867.1053@53.27.1867.1053" timestamp="1575641807897" />
</component>
</project>

Binary file not shown.

View File

@ -5,6 +5,29 @@ import numpy as np
from pygame import mixer
count = 0
def display(length):
if length == 1:
onestar = cv2.imread('src/images/*.png')
outDoor[220:304, 54:214] = onestar
elif length == 2:
twostar = cv2.imread('src/images/**.png')
outDoor[220:304, 54:214] = twostar
elif length == 3:
threestar = cv2.imread('src/images/***.png')
outDoor[220:304, 54:214] = threestar
elif length == 4:
fourstar = cv2.imread('src/images/****.png')
outDoor[220:304, 54:214] = fourstar
def alert():
mixer.init()
alert = mixer.Sound('src/noises/beep-07.wav')
@ -43,6 +66,73 @@ def click_event(event, x, y, flags, param):
out.release()
cv2.destroyAllWindows()
def click_event2(event, x, y, flags, param):
if event == cv2.EVENT_LBUTTONDOWN:
global displayString
if len(displayString) == 4:
print('zero')
displayString = ""
if 348 <= y <= 370 and 59 <= x <= 86:
print("1 outdoor")
displayString = displayString + '1'
print(displayString)
if 348 <= y <= 370 and 100 <= x <= 128:
print("2 outdoor")
displayString = displayString + '2'
print(displayString)
if 348 <= y <= 370 and 142 <= x <= 169:
print("3 outdoor")
displayString = displayString + '3'
print(displayString)
if 390 <= y <= 412 and 59 <= x <= 86:
print("4 outdoor")
displayString = displayString + '4'
print(displayString)
if 390 <= y <= 412 and 100 <= x <= 128:
print("5 outdoor")
displayString = displayString + '5'
print(displayString)
if 390 <= y <= 412 and 142 <= x <= 169:
print("6 outdoor")
displayString = displayString + '6'
print(displayString)
if 431 <= y <= 453 and 59 <= x <= 86:
print("7 outdoor")
displayString = displayString + '7'
print(displayString)
if 431 <= y <= 453 and 100 <= x <= 128:
print("8 outdoor")
displayString = displayString + '8'
print(displayString)
if 431 <= y <= 453 and 142 <= x <= 169:
print("9 outdoor")
displayString = displayString + '9'
print(displayString)
if 472 <= y <= 495 and 59 <= x <= 86:
print("* outdoor")
displayString = displayString + '*'
print(displayString)
if 472 <= y <= 495 and 100 <= x <= 128:
print("0 outdoor")
displayString = displayString + '0'
print(displayString)
if 472 <= y <= 495 and 142 <= x <= 169:
print("# outdoor")
displayString = displayString + '#'
print(displayString)
display(len(displayString))
def notification():
not1 = cv2.imread('src/notification/not1.png')
@ -57,10 +147,13 @@ def notification():
global a
a = None
global displayString
displayString =""
i = 0
cam_status = 1
liczba = 0
globalna = 0
displayString3 = "jud"
cap = cv2.VideoCapture(0)
four_cc = cv2.VideoWriter_fourcc(*'XVID')
out = cv2.VideoWriter('recordings/output.avi', four_cc, 10.0, (1280, 720))
@ -104,12 +197,26 @@ while cap.isOpened():
icon6 = cv2.imread('src/icons/icon6.png')
frame[640:640 + 63, 1193:1267] = icon6
if globalna == 1:
notification()
cv2.imshow('frame', frame)
outDoor = cv2.imread('src/images/outDoorPanel.png')
display(len(displayString))
cv2.imshow('outDoor', outDoor)
out.write(frameprev)
cv2.setMouseCallback('frame', click_event)
cv2.setMouseCallback('outDoor', click_event2)
if cv2.waitKey(1) & 0xFF == ord('q'):
break

BIN
src/images/****.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
src/images/***.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/images/**.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/images/*.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
src/images/outDoorPanel.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 KiB