i am doing a project on face detection over wifi streaming.Faces are being detected in the ide but not in the browser over wifi. Please help me out in this.i am attaching my code .
# MJPEG Streaming AP.
# This example shows off how to do MJPEG streaming in AccessPoint mode.
# Chrome, Firefox and MJpegViewer App on Android have been tested.
# Connect to OPENMV_AP and use this URL: http://192.168.1.1:8080 to view the stream.
import sensor, image, time, network, usocket, sys
SSID ='OPENMV_AP' # Network SSID
KEY ='1234567890' # Network key (must be 10 chars)
HOST = '' # Use first available interface
PORT = 8080 # Arbitrary non-privileged port
# Reset sensor
# Set sensor settings
# Load Haar Cascade
# By default this will use all stages, lower satges is faster but less accurate.
face_cascade = image.HaarCascade("frontalface", stages=25)
# Init wlan module in AP mode.
wlan = network.WINC(mode=network.WINC.MODE_AP)
wlan.start_ap(SSID, key=KEY, security=wlan.WEP, channel=2)
# You can block waiting for client to connect
print ('Waiting for connections..')
client, addr = s.accept()
# set client socket timeout to 2s
print ('Connected to ' + addr + ':' + str(addr))
# Read request from client
data = client.recv(1024)
# Should parse client request here
Actually I am trying to view the detected faces over wifi. But, unsuccessful… I am not being able to send the faces through the socket… The video is being transmitted, but face detection is not… I have tried by changing the socket to a Tcp socket. But, I am not getting the idea that how to send the algorithm " for r in objects
Img.draw_rectangle(r)" over wifi… This is where I am stucked. Please help me out. I am trying for a long period and I have been through many videos and tutorials but unsuccessful…
Hi, you haven’t described what application is receiving your data. A socket has to connect to some device and send the data to it. If you want to do a WiFi based application you need to think about what will receive the data and clearly define a protocol for that reception.
I have tried, but we can’t draw after compression… Rest of the code is working well, but I need to pack the draw_rectangle algorithm so that we can send it to wifi socket using client.send().