removed useless comments
This commit is contained in:
parent
38573dcd40
commit
52df356111
11
ds.py
11
ds.py
@ -3,7 +3,7 @@ import pygame
|
||||
import sys
|
||||
|
||||
host = "192.168.1.136"
|
||||
port=5802
|
||||
port = 5802
|
||||
screen = pygame.display.set_mode((640,480),0)
|
||||
|
||||
|
||||
@ -11,9 +11,7 @@ while True:
|
||||
clientsocket=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
clientsocket.connect((host, port))
|
||||
received = []
|
||||
# loop .recv, it returns empty string when done, then transmitted data is completely received
|
||||
while True:
|
||||
#print("esperando receber dado")
|
||||
recvd_data = clientsocket.recv(230400)
|
||||
if not recvd_data:
|
||||
break
|
||||
@ -22,12 +20,11 @@ while True:
|
||||
|
||||
dataset = ''.join(received)
|
||||
print(len(dataset))
|
||||
image = pygame.image.fromstring(dataset,(640,480),"RGB") # convert received image from string
|
||||
screen.blit(image,(0,0)) # "show image" on the screen
|
||||
image = pygame.image.fromstring(dataset,(640,480),"RGB")
|
||||
screen.blit(image,(0,0))
|
||||
pygame.display.update()
|
||||
|
||||
# check for quit events
|
||||
for event in pygame.event.get():
|
||||
if event.type == pygame.QUIT:
|
||||
pygame.quit()
|
||||
sys.exit()
|
||||
sys.exit()
|
||||
|
6
rpi.py
6
rpi.py
@ -20,12 +20,12 @@ floorCam.start()
|
||||
|
||||
while True:
|
||||
connection, address = serversocket.accept()
|
||||
goalImage = goalCam.get_image() # capture image
|
||||
floorImage = floorCam.get_image() # capture image
|
||||
goalImage = goalCam.get_image()
|
||||
floorImage = floorCam.get_image()
|
||||
merged = pygame.Surface([640,480])
|
||||
merged.blit(goalImage,(0,0))
|
||||
merged.blit(floorImage,(320,0))
|
||||
data = pygame.image.tostring(merged,"RGB") # convert captured image to string, use RGB color scheme
|
||||
data = pygame.image.tostring(merged,"RGB")
|
||||
try:
|
||||
connection.sendall(data)
|
||||
except socket.error:
|
||||
|
Loading…
Reference in New Issue
Block a user