The pictures in the browser show that the car is driving

Source: Internet
Author: User

The pictures in the browser show that the car is driving

The general process is as follows:

First, the real-time location and video data collected by the two cameras are transmitted to the server during the vehicle driving process. Then, the Server communicates with the browser through the websocket protocol, that is, the status is displayed on the browser page.

Technologies used:

1. Use Flask-Socketio for websocket Communication

Flask-Socketio is the Flask plug-in of Socketio. io is very similar. Based on Asynchronous processing of various events, you can choose to use the following asynchronous services: eventlet, gevent, and Werkzeug that comes with Flask.

1. Let the server send data to the client

Without client requests, a permanent connection can be created with only one handshake, allowing bidirectional transmission.

2. Specific Process

Initialization: Socketio = SocketIO (app) Listening event:Socketio. on: send messages using send () or emit (), send () for unnamed events, and emit () for named events (). Namespace: allows the client and server to establish multiple connections through the same socket. If this parameter is not specified, the default namespce is used. Room: If a room is specified for an event, only connections in the same room can receive the event. Each connection belongs to a room named request. sid by default. 2. Draw flickering dots

1. First cache the canvas image to the temporary canvas

2. Clear the image on the main canvas

3. Draw a new circle on the canvas

4. After the new circle is drawn, draw the temporary canvas image back to the main canvas.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.