A method and system for accelerating video of a cleaning vehicle
By dividing the non-target area and target area of the sweeper video and performing lossy compression processing, and dynamically adjusting the compression rate based on network fluctuations and scene changes, the problem of excessive file size in the transmission of autonomous driving sweeper video is solved and achieved. Smoother video playback effect.
Patent Information
- Application Number
- CN202111683209.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2041-12-31
AI Technical Summary
In self-driving sweepers, the transmission file size of video images is huge, resulting in lagging, which is especially obvious when the network fluctuates, affecting the real-time nature of video playback.
By obtaining the original image, dividing it into non-target areas and target areas, performing lossy compression processing respectively, and dynamically adjusting the compression rate according to the playback frame rate threshold and network fluctuations, forming a layered image definition, reducing file size and optimizing playback Effect.
It reduces the video transmission file size, improves the playback effect, ensures the real-time and smoothness of the video under network fluctuations, and meets different viewing angles and frame rate requirements.
Smart Images

Figure CN114520873B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of intelligent road sweepers, and in particular to a road sweeper video acceleration method and system. Background Art
[0002] During the cleaning process of the sweeper based on autonomous driving, there is data transmission of video images between the sweeper and the autonomous driving cloud control platform. The autonomous driving cloud control platform acts as a server and processes the cleaning video images collected by the sweeper. The autonomous driving cloud control platform also needs to forward the processed video images to the client to complete the real-time video playback of the cleaning process.
[0003] In traditional technology, the street sweeper video that needs to be transmitted includes original images of various different perspectives of the front road surface, the rear road surface, the left road surface, the right road surface, the cleaning parts, etc., so the number of transmitted files is huge.
[0004] The inventors found that the existing road sweepers use the original image for transmission and playback. This method of using the original image will cause freezing due to the large size of each frame of the video. When there is network fluctuation, the freezing phenomenon will be more obvious, and the autonomous driving cloud control platform needs to use additional frame adjustment processing to restore the real-time performance of the video playback during the cleaning process. Summary of the invention
[0005] The purpose of this application is to solve at least one of the technical problems existing in the prior art. The first purpose of this application is to provide a method for accelerating street sweeper videos, reduce the size of transmitted files, and respond to network fluctuations in a timely manner, thereby optimizing the playback effect.
[0006] The second purpose of the present application is to provide a video acceleration system for a street sweeper.
[0007] The third objective of the present application is to provide a video transmission system.
[0008] The fourth objective of the present application is to provide an electronic device.
[0009] A fifth object of the present application is to provide a computer-readable storage medium.
[0010] The sixth object of the present application is to provide a sweeper.
[0011] In order to achieve the above first purpose, this application adopts the following technical solutions:
[0012] A method for accelerating a sweeper video, comprising:
[0013] Get the original image;
[0014] Dividing the original image into a non-target area and a target area according to a first preset cropping area;
[0015] According to a first playback frame rate threshold, the non-target area is subjected to lossy compression processing using a first compression rate, so that the non-target area is set to an image clarity that matches the first playback frame rate threshold;
[0016] splicing the non-target area and the target area to obtain an image to be displayed;
[0017] The image to be displayed forms a layer of image clarity by dividing the entire image into a non-target area and a target area, and the image to be displayed is used to form a video of the road sweeper.
[0018] As a preferred technical solution, the original image is collected by a road sweeper at different viewing angles, and the first preset cropping area is set based on the original image at different viewing angles.
[0019] As a preferred technical solution, before executing the splicing of the non-target area and the target area to obtain the image to be displayed, it also includes:
[0020] According to a second playback frame rate threshold, the target area is subjected to lossy compression processing using a second compression rate, so that the target area is set to an image clarity that matches the second playback frame rate threshold;
[0021] The second compression rate is lower than the first compression rate, so that the image clarity of the image to be displayed in the target area is higher than that in the non-target area.
[0022] As a preferred technical solution, in the step of dividing the original image into a non-target area and a target area according to a first preset cropping area, the first preset cropping area divides the target area into an inner layer of the entire image, and divides the non-target area into an outer layer of the entire image;
[0023] And the sweeper video acceleration method also includes:
[0024] Dividing the non-target area into at least two non-target sub-areas according to the second preset cropping area, setting a plurality of third playback frame rate thresholds and a plurality of third compression rates, and matching a corresponding third playback frame rate threshold and a third compression rate for each non-target sub-area;
[0025] According to the plurality of third playback frame rate thresholds, lossy compression processing is performed on all non-target sub-areas using corresponding third compression rates, so that all non-target sub-areas are set to image clarity matching the plurality of third playback frame rate thresholds.
[0026] As a preferred technical solution, the non-target sub-areas are connected to each other and form a hierarchical structure from the outside to the inside;
[0027] In the hierarchical structure, for any two adjacent non-target sub-areas, the third playback frame rate threshold matched by the non-target sub-area in the outer layer is smaller than the third playback frame rate threshold matched by the non-target sub-area in the inner layer.
[0028] As a preferred technical solution, it also includes:
[0029] Obtaining a color value difference between the original image and a corresponding previous frame of the original image, and determining whether the scene has changed according to a color value change threshold;
[0030] The third playback frame rate thresholds matched to all non-target sub-areas are dynamically adjusted according to the scene changes, and the second playback frame rate thresholds matched to the target area are dynamically adjusted according to the scene changes.
[0031] As a preferred technical solution, the third playback frame rate threshold is set to at least 1 Hz.
[0032] As an optimal technical solution, it also includes: grading the network fluctuation conditions to obtain a network fluctuation level, dynamically adjusting the third playback frame rate threshold matching all non-target sub-areas according to the network fluctuation level, and dynamically adjusting the second playback frame rate threshold matching the target area according to the network fluctuation level.
[0033] As a preferred technical solution, in splicing the non-target area and the target area to obtain the image to be displayed, it also includes: performing anti-aliasing processing on the spliced image to obtain the image to be displayed.
[0034] As a preferred technical solution, the anti-aliasing process specifically includes: performing operations of aliasing edge detection, aliasing edge re-vectorization, and blending aliasing position pixels in sequence.
[0035] As a preferred technical solution, the lossy compression process also includes: image clarity processing, that is, optimizing the image clarity based on a grayscale variance algorithm.
[0036] As a preferred technical solution, before dividing the original image into a non-target area and a target area according to the first preset cropping area, it also includes: image preprocessing, specifically including: removing light-colored pixels according to a light pixel threshold.
[0037] In order to achieve the above second purpose, the present application adopts the following technical solutions:
[0038] A video acceleration system for a road sweeper, comprising:
[0039] A data acquisition module, used to acquire the original image;
[0040] A cropping module, used for dividing the original image into a non-target area and a target area according to a first preset cropping area;
[0041] A compression module, configured to perform lossy compression processing on the non-target area using a first compression rate according to a first playback frame rate threshold, so that the non-target area is set to an image clarity matching the first playback frame rate threshold;
[0042] A splicing module, used for splicing the non-target area and the target area to obtain an image to be displayed;
[0043] The image to be displayed forms a layer of image clarity by dividing the entire image into a non-target area and a target area, and the image to be displayed is used to form a video of the road sweeper.
[0044] In order to achieve the third objective above, this application adopts the following technical solutions:
[0045] A video transmission system is provided with a video acquisition device and a terminal device, wherein the video acquisition device includes at least one camera and a first data transmission module, and the video transmission system also includes a server, wherein the server is used to run the above-mentioned sweeper video acceleration system, and the sweeper video acceleration system also includes a second data transmission module, wherein the camera is used to acquire original video data, the first data transmission module is used to upload the original video data, and the second data transmission module is used to receive the original video data, take the image to be displayed within a preset time period as the video data to be broadcast and send it to the terminal device, wherein the original video data includes multiple original image data, and the original image is the original image data during current processing, and the terminal device is used to receive and display the video data to be broadcast.
[0046] In order to achieve the fourth objective above, the present application adopts the following technical solutions:
[0047] An electronic device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned sweeper video acceleration method when executing the program.
[0048] In order to achieve the fifth objective above, the present application adopts the following technical solutions:
[0049] A computer-readable storage medium stores a computer program, wherein the computer program is suitable for being loaded and executed by a processor so that a computer device having the processor executes the above-mentioned sweeper video acceleration method.
[0050] In order to achieve the sixth objective above, the present application adopts the following technical solutions:
[0051] A cleaning vehicle is provided with a video acquisition device, the video acquisition device includes at least one camera and a first data transmission module, the cleaning vehicle also includes the above-mentioned electronic device, the video acquisition device is connected to the electronic device;
[0052] The camera is used to collect original video data, the first data transmission module is used to upload the original video data, and the electronic device receives the original video data. The original video data includes multiple frames of original image data, and the original image is the original image data during current processing.
[0053] Compared with the prior art, the beneficial effects of the present invention mainly include the following aspects:
[0054] 1. The street sweeper video acceleration method proposed in the present application obtains the image to be displayed by dividing the original image, lossy compression processing, and splicing. The image to be displayed forms a layer of image clarity by dividing the non-target area and the target area in the entire image, forming a matching relationship between the image size and the image clarity. The image file size is reduced by lossy compression while ensuring that the target area meets the clarity required by the user, so that the user can have a better playback experience while being able to play in real time on the client.
[0055] 2. The sweeper video acceleration method proposed in the present application adopts a first compression rate to perform lossy compression processing on the non-target area according to the first playback frame rate threshold and sets the non-target area to a matching image clarity. The method reduces the overall synthesized image file size while reducing the data transmission throughput per second and the time consumed by the client to load the image during the video transmission process under the playback frame rate requirement by meeting the playback frame rate requirement of the target area concerned by the user and reducing the playback frame rate requirement close to the non-target area. Thus, the playback frame rate requirement of the sweeper video image for different display areas can be met. Compared with the prior art method of using the original image for playback, the method has the effect of playback optimization.
[0056] 3. The street sweeper video acceleration method proposed in the present application divides the non-target area into at least two non-target sub-areas, and performs lossy compression processing on all non-target sub-areas using corresponding third compression rates according to multiple third playback frame rate thresholds, so that all non-target sub-areas are set to an image clarity that matches the multiple third playback frame rate thresholds. The application performs targeted detail processing on the non-target sub-areas, so that the processed image to be displayed is clearer and can better meet the monitoring requirements.
[0057] 4. The sweeper video acceleration method proposed in the present application dynamically adjusts the first playback frame rate threshold, the second playback frame rate threshold, and the third playback frame rate threshold by combining scene changes and user requests. This is for the autonomous driving cloud control platform that provides Internet of Vehicles related services. It can adjust the size of the transmission file in time, thereby ensuring the real-time transmission of the sweeper's cleaning video and allowing users to have a smooth viewing effect on the client.
[0058] 5. The street sweeper video acceleration method proposed in the present application dynamically adjusts the third playback frame rate threshold matching all non-target sub-areas according to the network fluctuation level, and dynamically adjusts the second playback frame rate threshold for the target area according to the network fluctuation level; the method can dynamically adjust the target area and all non-target sub-areas according to the network fluctuation during actual transmission, and respond to poor network conditions in a timely manner by timely adjusting the corresponding playback frame rate and image clarity, thereby improving the situation where users experience obvious video playback freezes on the client side due to network fluctuations.
[0059] 6. The sweeper can obtain different types of original images at different viewing angles. Each type of original image has different selections of target areas and different requirements for image clarity. The sweeper video acceleration method proposed in this application is based on original images at different viewing angles, sets corresponding cropping sizes, and performs corresponding compression and re-splicing to form images to be displayed for video playback, thereby achieving the purpose of dynamically processing original images at different viewing angles. Compared with the prior art method of directly transmitting original images of various viewing angles of the front road surface, rear road surface, left road surface, right road surface, cleaning components, etc. for video playback, this method greatly reduces the total size of the image to be displayed while meeting the image clarity, network speed requirements and user-required frame rate requirements, and ultimately achieves the optimal transmission effect while meeting the image clarity and playback frame rate requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 A schematic diagram of a flow chart of a method for accelerating a video of a road sweeper in one embodiment;
[0061] Figure 2 A schematic diagram of a flow chart of steps of anti-aliasing processing in one embodiment;
[0062] Figure 3 A schematic diagram of a display after being processed by a sweeper video acceleration method in an embodiment;
[0063] Figure 4 A schematic block diagram of a system for accelerating a video of a road sweeper according to an embodiment of the present invention;
[0064] Figure 5 The structure of a video transmission system in one embodiment is schematically shown in FIG.
[0065] Among them, 100-sweeper video acceleration system, 101-data acquisition module, 102-cropping module, 103-compression module, 104-stitching module, 105-second data transmission module, 200-video transmission system, 300-video acquisition equipment, 301-camera, 302-first data transmission module, 400-terminal device, 500-server. DETAILED DESCRIPTION
[0066] This section will describe in detail the specific embodiments of the present application. The preferred embodiments of the present application are shown in the accompanying drawings. The purpose of the accompanying drawings is to supplement the description of the text part of the specification with graphics, so that people can intuitively and vividly understand each technical feature and the overall technical solution of the present application, but it cannot be understood as a limitation on the scope of protection of the present application.
[0067] See also Figure 1 As shown, in one embodiment, a method for accelerating a sweeper video is provided, the method comprising:
[0068] S1. Obtain the original image;
[0069] S2, dividing the original image into a non-target area and a target area according to the first preset cropping area;
[0070] It should be noted that after the cropping process is performed in the first preset cropping area, the original image is divided into two areas, one area is used as a non-target area, and the other area is used as a target area. The positioning position of the image cropping can be changed according to the specific first preset cropping area, and those skilled in the art can set it according to the actual needs, and it is not limited here.
[0071] In addition, the original image is collected by a road sweeper at different viewing angles, and a first preset cropping area is set based on the original image at different viewing angles.
[0072] Exemplarily, the first preset cropping area is set to be positioned in the central area of the original image. The first preset cropping area may be a regular frame such as a quadrilateral frame or a circular frame. After the division, the non-target area and the target area may form a hierarchical structure formed from the outside to the inside, that is, the non-target area is divided outside the first preset cropping area to form an outer layer, and the target area is divided inside the first preset cropping area to form an inner layer;
[0073] Exemplarily, the first preset cropping area is set to be positioned in the left area of the original image. For example, the first preset cropping area is a rectangular frame in a regular frame. The first preset cropping area completely overlaps the center line of the original image with one side of the rectangular contour, forming a left and right block area for dividing the original image. After the division, the non-target area and the target area can form a regular block structure distributed left and right, that is, the non-target area is divided outside the first preset cropping area to form a right block, and the target area is divided inside the first preset cropping area to form a left block. Correspondingly, it can also be formed into a regular block structure distributed up and down.
[0074] Exemplarily, a first preset cropping area is set to be positioned at any area of the original image, and an irregular frame is used. The irregular frame can be formed by a straight line, a curve, or a combination of the two. After division, the non-target area and the target area can form an irregular block structure, that is, the non-target area is divided outside the first preset cropping area and forms a first irregular block, and the target area is divided within the first preset cropping area and forms a second irregular block.
[0075] S3, performing lossy compression processing on the non-target area using a first compression rate according to the first playback frame rate threshold, so that the non-target area is set to an image clarity that matches the first playback frame rate threshold;
[0076] It should be noted that lossy compression processing is used to reduce the file size of the image. At the same time, for the same processed image, different compression rates will reduce the image clarity of the screen display, thereby reducing the image clarity of the area where the non-target area is located;
[0077] In addition, the image before processing will be retained before compression. During the lossy compression process, the image clarity will vary with the adjustment of the compression rate. The higher the compression rate, the lower the clarity of the processed image, that is, the higher the image blur.
[0078] Lossy compression processing also includes: image clarity processing.
[0079] It should be noted that the image definition processing is used to optimize the size of the image definition, wherein the image definition processing specifically includes optimizing the size of the image definition based on the grayscale variance algorithm.
[0080] Exemplarily, the image definition processing specifically includes:
[0081] First, subtract and then multiply the two grayscale values of the right neighboring pixels horizontally;
[0082] Then, the square sum of the grayscale differences between two adjacent pixels is obtained by adding them pixel by pixel, and the square sum is adjusted to the preset clarity processing threshold, so that the difference between the sudden pixel and the adjacent pixel becomes larger and the high-frequency component in the image increases, thereby making the image clear.
[0083] S4, splicing the non-target area and the target area to obtain an image to be displayed;
[0084] The image to be displayed forms a layer of image clarity by dividing the non-target area and the target area in the entire image, and the image to be displayed is used to form a video of the sweeper.
[0085] In order to make the spliced image smoother, the process of splicing the non-target area and the target area to obtain the image to be displayed further includes: performing anti-aliasing processing on the spliced image to obtain the image to be displayed.
[0086] The anti-aliasing process specifically includes: performing anti-aliasing edge detection, anti-aliasing edge re-vectorization, and mixing anti-aliasing position pixel operations in sequence. Then, the anti-aliasing process can remove the pixel grains of the image and achieve a smooth effect on the image edge anti-aliasing.
[0087] See also Figure 2 As shown, the anti-aliasing process is specifically implemented through the following operation process:
[0088] S401, edge detection: Depth, brightness, color or any combination thereof are combined to determine the jagged edge. It should be noted that each pixel has 4 adjacent pixels, and theoretically 4 edge detections should be performed, but since pixels share common edges, only the adjacent pixels on the left and top are detected.
[0089] Exemplarily, the horizontal and vertical edges are first detected to obtain jagged edges marked with pixels.
[0090] S402, re-vectorization: automatic re-vectorization or manual re-vectorization is performed on the jagged edge to obtain a hybrid weight.
[0091] The automatic re-vectorization is: re-vectorizing the jagged edge based on the preset search distance to obtain a hybrid weight. It should be noted that the processing unit of this step is the jagged edge, not the pixel.
[0092] For example, a maximum search distance is set, and re-vectorization is performed for the jagged edges in the horizontal and vertical directions respectively from the current position. In the process of re-vectorization, bilinear sampling is used extensively, and finally AreaTex is sampled to obtain the blending weight.
[0093] In addition, manual re-vectorization includes manually setting a sampling position near the jagged edge and performing re-vectorization in conjunction with a preset bilinear sampling to obtain a mixing weight, thereby optimizing the efficiency of the jagged elimination process.
[0094] S403, blending corresponding pixels: blending corresponding pixels according to blending weights, thereby achieving anti-aliasing.
[0095] Before performing splicing of the non-target area and the target area to obtain the image to be displayed, the method further includes:
[0096] According to the second playback frame rate threshold, lossy compression is performed on the target area using a second compression rate, so that the target area is set to an image clarity that matches the second playback frame rate threshold;
[0097] The second compression rate is lower than the first compression rate, so that the image clarity of the image to be displayed in the target area is higher than that in the non-target area.
[0098] In one embodiment, in dividing the original image into the non-target area and the target area according to the first preset cropping area, the first preset cropping area divides the target area into the inner layer of the entire image, and divides the non-target area into the outer layer of the entire image;
[0099] And the sweeper video acceleration method also includes:
[0100] Dividing the non-target area into at least two non-target sub-areas according to the second preset cropping area, setting a plurality of third playback frame rate thresholds and a plurality of third compression rates, and matching a corresponding third playback frame rate threshold and a third compression rate for each non-target sub-area;
[0101] According to the third playback frame rate thresholds, all non-target sub-areas are subjected to lossy compression processing using corresponding third compression rates, so that all non-target sub-areas are set to image clarity matching the third playback frame rate thresholds. Compared with the case of only target areas and non-target areas, further dividing the non-target sub-areas can make the image clarity have multiple levels of gradual changes, thereby enabling users to obtain a better viewing experience.
[0102] Furthermore, the non-target sub-areas are connected to each other and form a hierarchical structure from outside to inside. In the hierarchical structure, for any two adjacent non-target sub-areas, the third playback frame rate threshold matched by the non-target sub-area in the outer layer is smaller than the third playback frame rate threshold matched by the non-target sub-area in the inner layer.
[0103] On the basis of the above-mentioned sweeper video acceleration method, the relative position of each non-target sub-area and the target area can also be obtained, and at least one non-target sub-area whose relative position is closest to the target area can be selected to process the details of various original images in a targeted manner, so that the processed original image is clearer, thereby better meeting the monitoring requirements.
[0104] It should be noted that the first playback frame rate threshold, the second playback frame rate threshold, and the third playback frame rate threshold can be adjusted according to user requests.
[0105] In one embodiment, the above-mentioned sweeper video acceleration method further includes:
[0106] Obtain the color value difference between the original image and the corresponding previous frame original image, and determine whether the scene has changed based on the color value change threshold;
[0107] The third playback frame rate thresholds matched to all non-target sub-areas are dynamically adjusted according to the scene change situation, and the second playback frame rate thresholds matched to the target area are dynamically adjusted according to the scene change situation.
[0108] The determination of whether the scene has changed is based on the color value change threshold, specifically including: when the color value difference is less than or equal to the color value change threshold, it is considered that the scene has not changed, otherwise it is considered that the scene has changed.
[0109] It should be noted that those skilled in the art may choose to determine whether the scene has changed in the non-target area, or to determine whether the scene has changed in the entire original image according to actual conditions, and this embodiment does not limit this.
[0110] The first playback frame rate threshold or the third playback frame rate threshold is set to at least 1 Hz. It should be understood that when the non-target sub-area is not divided, the first playback frame rate threshold is dynamically adjusted for the non-target area according to the scene change.
[0111] Exemplarily, the color value change threshold may be set to any value between 30% and 40%.
[0112] Furthermore, in order to enable the street sweeper video to respond to network fluctuations in a timely manner and dynamically adapt to the acquired network fluctuations under the condition of ensuring the playback frame rate, the transmitted image is as clear as possible while meeting the frame rate requirements. In this regard, the street sweeper video acceleration method further includes:
[0113] The network fluctuation conditions are classified to obtain a network fluctuation level, and the third playback frame rate thresholds matching all non-target sub-areas are dynamically adjusted according to the network fluctuation level, and the second playback frame rate threshold of the target area is dynamically adjusted according to the network fluctuation level.
[0114] It should be noted that different types of original images are obtained from different perspectives of street sweepers, and different types of original images have different selections of target areas and different requirements for image clarity. Therefore, it is necessary to dynamically process the original images by cropping and compressing them, and to achieve an optimal transmission effect while meeting the requirements of image clarity and network speed.
[0115] Exemplarily, the original image obtained near the cleaning head is used as an example for explanation here. The cleaning area of the cleaning head is selected as the target area according to the perspective of the cleaning vehicle at this time, so that the user can play it smoothly on the client to obtain the real-time working status of the cleaning head.
[0116] In this example, the first preset cropping area is positioned at the center area of the original image, and the first preset cropping area is set to be a rectangular frame. After division, the non-target area and the target area can form a hierarchical structure from the outside to the inside. At this time, the target area in the inner layer corresponds to the cleaning area range of the cleaning head.
[0117] In this example, the non-target area is further divided into 4 non-target sub-areas according to the second preset cropping area. The 4 non-target sub-areas form the outer layer of the target area. The 4 non-target sub-areas are connected to each other and form a 4-level structure from the outside to the inside. The corresponding third playback frame rate threshold and third compression rate are matched for each non-target sub-area. The non-target sub-area is subjected to lossy compression processing using the corresponding third compression rate according to the third playback frame rate threshold and forms a corresponding image clarity. In the 4-level structure, for any two adjacent non-target sub-areas, the third playback frame rate threshold matched by the non-target sub-area in the outer layer is less than the third playback frame rate threshold matched by the non-target sub-area in the inner layer.
[0118] See also Figure 3 As shown, based on the fact that the processed image files have the same size, the final image to be displayed is layered from the outer layer to the inner layer in the following order: 100% size + 20% image clarity + 10HZ actual playback frame rate, 80% size + 40% image clarity + 20HZ actual playback frame rate, 60% size + 60% image clarity + 40HZ actual playback frame rate, 40% size + 80% image clarity + 60HZ actual playback frame rate, 20% size + 100% image clarity + 80HZ actual playback frame rate.
[0119] The sweeper video acceleration method adjusts the corresponding frame rates of the target area and the non-target area, selects the corresponding compression rate, reduces the size of the image to be displayed, and makes the image to be displayed have different clarity in the target area and the non-target area. After forming a sweeper video according to a preset frame sequence, multiple images to be displayed are sent to the client. After receiving the sweeper video, the client plays the video according to the corresponding preset frame sequence. Compared with the existing technology that sends the full original image, the sweeper video received by the client effectively reduces the overall video file size, thereby solving the problem of frame jamming in the sweeper video playback.
[0120] It should be noted that the 100% size, 80% size, 60% size, and 40% size correspond to the four non-target sub-areas respectively, and the 20% size corresponds to the target area. And the numerical size here is not the size ratio of the actual area. For the convenience of description, the maximum cropping rectangle size of the original image corresponding to the non-target sub-area and the target area is associated with each other.
[0121] When the user requests that the second playback frame rate threshold for the target area is 30HZ, and the four third playback frame rate thresholds for the four non-target areas from the outer layer to the inner layer are 1HZ, 5HZ, 10HZ, and 200HZ respectively, after adjustment, the final results are 100% size + 20% image clarity + 1HZ actual playback frame rate, 80% size + 40% image clarity + 5HZ actual playback frame rate, 60% size + 60% image clarity + 10HZ actual playback frame rate, 40% size + 80% image clarity + 20HZ actual playback frame rate, and 20% size + 100% image clarity + 30HZ actual playback frame rate.
[0122] In another example, still taking the above-mentioned target area and 4 non-target sub-areas as an example, based on the case where the processed picture file size is the same, it can be adjusted to 100% size + 30% image clarity + 10HZ actual playback frame rate, 80% size + 50% image clarity + 20HZ actual playback frame rate, 60% size + 70% image clarity + 40HZ actual playback frame rate, 40% size + 90% image clarity + 60HZ actual playback frame rate, 20% size + 100% image clarity + 80HZ actual playback frame rate.
[0123] In another exemplary embodiment, still taking the above-mentioned target area and four non-target sub-areas as an example, based on the case where the processed picture file size is the same, it can be adjusted to 100% size + 20% image clarity + 1HZ actual playback frame rate, 80% size + 20% image clarity + 1HZ actual playback frame rate, 60% size + 20% image clarity + 1HZ actual playback frame rate, 40% size + 20% image clarity + 1HZ actual playback frame rate, 20% size + 100% image clarity + 30HZ actual playback frame rate.
[0124] It should be noted that the above examples do not limit the specific actual playback frame rate, image size, and image clarity values. Those skilled in the art should understand that the values of the above parameters can be adaptively set according to actual needs.
[0125] It should be noted that the corresponding compression rate is set according to different playback frame rates, and different compression rates correspond to corresponding image clarity, so that different playback frame rates match corresponding image clarity, so that the same image forms a multi-level layering of image clarity in the target area and the non-target area. It should be understood that the playback frame rate here includes a first playback frame rate threshold, a second playback frame rate threshold, and a third playback frame rate threshold.
[0126] In one embodiment, the above-mentioned sweeper video acceleration method further includes:
[0127] The images to be displayed within the preset time period are packaged and sent to the client.
[0128] It should be noted that the client is a device with a display screen, and the client displays the received image to be displayed.
[0129] For example, when the client plays the video, HTML can be used for multi-layer rendering, that is, playing through multi-layer superimposed images. The inner layers correspond to higher frame rate values and higher image clarity, while the outer layers correspond to lower frame rate values and lower image clarity.
[0130] The multi-layer rendering specifically includes: rendering the non-target area and the target area layer by layer in order from the outer layer to the inner layer, so that the entire image area forms multiple layers of different clarity when displayed.
[0131] It should be noted that those skilled in the art should understand that the playback frame rate threshold, actual playback frame rate, etc. mentioned in this application are all used to describe the frame rate, and are the number of updates within 1 second.
[0132] In one embodiment, before dividing the original image into the non-target area and the target area according to the first preset cropping area, the method further includes: image preprocessing.
[0133] The image preprocessing includes:
[0134] Remove light-colored pixels based on the light pixel threshold.
[0135] Furthermore, the image preprocessing also includes:
[0136] Remove dark pixels based on the dark pixel threshold.
[0137] See also Figure 4 As shown, in one embodiment, a sweeper video acceleration system 100 is provided, the system comprising:
[0138] Data acquisition module 101, used to acquire the original image;
[0139] A cropping module 102, configured to divide the original image into a non-target area and a target area according to a first preset cropping area;
[0140] A compression module 103, configured to perform lossy compression processing on the non-target area using a first compression rate according to a first playback frame rate threshold, so that the non-target area is set to an image clarity that matches the first playback frame rate threshold;
[0141] A splicing module 104, used for splicing the non-target area and the target area to obtain an image to be displayed;
[0142] The image to be displayed forms a layer of image clarity by dividing the non-target area and the target area in the entire image, and the image to be displayed is used to form a video of the sweeper.
[0143] See also Figure 5 As shown, in one embodiment, a video transmission system 200 is provided, which includes a video acquisition device 300, a terminal device 400 and a server 500. The video acquisition device 300 includes at least one camera 301 and a first data transmission module 302. The server 500 is used to run the street sweeper video acceleration system 100 in the above-mentioned embodiments. The street sweeper video acceleration system 100 also includes a second data transmission module 105. The camera 301 is used to acquire original video data. The first data transmission module 302 is used to upload original video data. The second data transmission module 105 is used to receive original video data, take the image to be displayed within a preset time period as the video data to be played and send it to the terminal device 400. The original video data includes multiple original image data, and the original image is the original image data during current processing. The terminal device 400 is used to receive and display the video data to be played.
[0144] It should be noted that the original image data is each frame image in the original video data. Therefore, when the street sweeper video acceleration method of each of the above embodiments is applied, the original image is the current frame image being processed.
[0145] It should be noted that the video acquisition device 300 interacts with the street sweeper video acceleration system 100 for data exchange and establishes a connection through the vehicle-side service. The street sweeper video acceleration system 100 runs on the server 500 and provides data processing services to the requesting party. The server 500 can be implemented with an independent server or a server group composed of multiple servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud information libraries, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, as well as big information and artificial intelligence platforms.
[0146] It should be noted that the terminal device 400 may specifically be a desktop terminal or a mobile terminal, which may be a mobile phone, a tablet computer, a laptop computer, a wearable device, etc.
[0147] In one embodiment, an electronic device is provided, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the cleaning vehicle video acceleration method of each of the above embodiments when executing the program. It should be noted that the steps of the cleaning vehicle video acceleration method here may be the steps of the cleaning vehicle video acceleration method of each of the above embodiments.
[0148] In one embodiment, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and the computer program is suitable for being loaded and executed by a processor, so that a computer device having the processor executes the above-mentioned sweeper video acceleration method. It should be noted that the steps of the sweeper video acceleration method here can be the steps of the sweeper video acceleration method in each of the above-mentioned embodiments.
[0149] In one embodiment, a cleaning vehicle is provided with a video acquisition device 300, the video acquisition device 300 includes at least one camera 301 and a first data transmission module 302, and the cleaning vehicle further includes the electronic device in the above embodiment, the video acquisition device 300 is connected to the electronic device;
[0150] The camera 301 is used to collect original video data of the sweeper at different viewing angles, the first data transmission module 302 is used to upload the original video data, and the electronic device receives the original video data. The original video data includes multiple frames of original image data, and the original image is the original image data during the current processing.
[0151] The above is a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications are also considered to be within the scope of protection of the present application.
[0152] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
Claims
1. A method for accelerating a sweeper video, characterized in that: include: Get the original image; Dividing the original image into a non-target area and a target area according to a first preset cropping area; According to a first playback frame rate threshold, the non-target area is subjected to lossy compression processing using a first compression rate, so that the non-target area is set to an image clarity that matches the first playback frame rate threshold; According to a second playback frame rate threshold, the target area is subjected to lossy compression processing using a second compression rate, so that the target area is set to an image clarity that matches the second playback frame rate threshold; Wherein the second compression rate is lower than the first compression rate, so that the image clarity of the image to be displayed in the target area is higher than the image clarity in the non-target area; Splicing the non-target area and the target area to obtain an image to be displayed, wherein the image to be displayed forms a layer of image clarity by dividing the non-target area and the target area in the entire image; The image to be displayed is used to form a video of the sweeper.
2. The method for accelerating the cleaning vehicle video according to claim 1, characterized in that: The original image is collected by a road sweeper at different viewing angles, and the first preset cropping area is set based on the original image at different viewing angles.
3. The method for accelerating the video of a sweeper according to claim 1, characterized in that: In the step of dividing the original image into a non-target area and a target area according to the first preset cropping area, the first preset cropping area divides the target area into an inner layer of the entire image, and divides the non-target area into an outer layer of the entire image; And the sweeper video acceleration method also includes: Dividing the non-target area into at least two non-target sub-areas according to the second preset cropping area, setting a plurality of third playback frame rate thresholds and a plurality of third compression rates, and matching a corresponding third playback frame rate threshold and a third compression rate for each non-target sub-area; According to the plurality of third playback frame rate thresholds, lossy compression processing is performed on all non-target sub-areas using corresponding third compression rates, so that all non-target sub-areas are set to image clarity matching the plurality of third playback frame rate thresholds.
4. The method for accelerating the video of a sweeper according to claim 3, characterized in that: The non-target sub-areas are connected to each other and form a hierarchical structure from the outside to the inside; In the hierarchical structure, for any two adjacent non-target sub-areas, the third playback frame rate threshold matched by the non-target sub-area in the outer layer is smaller than the third playback frame rate threshold matched by the non-target sub-area in the inner layer.
5. The method for accelerating the video of a sweeper according to claim 3, characterized in that: Also includes: Obtaining a color value difference between the original image and a corresponding previous frame of the original image, and determining whether the scene has changed according to a color value change threshold; The third playback frame rate thresholds matched to all non-target sub-areas are dynamically adjusted according to the scene changes, and the second playback frame rate thresholds matched to the target area are dynamically adjusted according to the scene changes.
6. The method for accelerating the video of a sweeper according to claim 5, characterized in that: The third playback frame rate threshold is set to at least 1 Hz.
7. The method for accelerating the video of a sweeper according to claim 3, characterized in that: Also includes: The network fluctuation conditions are graded to obtain a network fluctuation level, and the third playback frame rate thresholds matching all non-target sub-areas are dynamically adjusted according to the network fluctuation level, and the second playback frame rate thresholds matching the target area are dynamically adjusted according to the network fluctuation level.
8. The method for accelerating a sweeper video according to any one of claims 1 to 7, characterized in that: In splicing the non-target area and the target area to obtain the image to be displayed, the method further includes: performing anti-aliasing processing on the spliced image to obtain the image to be displayed.
9. The method for accelerating the video of a sweeper according to claim 8, characterized in that: Before dividing the original image into a non-target area and a target area according to the first preset cropping area, the method further includes: image preprocessing, specifically including: removing light-colored pixels according to a light pixel threshold.
10. A sweeper video acceleration system, characterized in that: include: A data acquisition module, used to acquire the original image; A cropping module, used for dividing the original image into a non-target area and a target area according to a first preset cropping area; A compression module, configured to perform lossy compression processing on the non-target area using a first compression rate according to a first playback frame rate threshold, so that the non-target area is set to an image clarity that matches the first playback frame rate threshold, and to perform lossy compression processing on the target area using a second compression rate according to a second playback frame rate threshold, so that the target area is set to an image clarity that matches the second playback frame rate threshold; wherein the second compression rate is lower than the first compression rate, so that the image clarity of the image to be displayed in the target area is higher than the image clarity in the non-target area; A splicing module, used for splicing the non-target area and the target area to obtain an image to be displayed; The image to be displayed forms a layer of image clarity by dividing the entire image into a non-target area and a target area, and the image to be displayed is used to form a video of the road sweeper.
11. A video transmission system, comprising a video acquisition device and a terminal device, wherein the video acquisition device comprises at least one camera and a first data transmission module, characterized in that: The video transmission system also includes a server, which is used to run the sweeper video acceleration system as described in claim 10. The sweeper video acceleration system also includes a second data transmission module. The camera is used to collect original video data. The first data transmission module is used to upload the original video data. The second data transmission module is used to receive the original video data, take the image to be displayed within a preset time period as the video data to be broadcast and send it to the terminal device. The original video data includes multiple original image data, and the original image is the original image data during current processing. The terminal device is used to receive and display the video data to be broadcast.
12. An electronic device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the sweeper video acceleration method as described in any one of claims 1 to 9 when executing the program.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded and executed by a processor, so that a computer device having the processor executes the sweeper video acceleration method according to any one of claims 1-9.
14. A cleaning vehicle, provided with a video acquisition device, the video acquisition device comprising at least one camera and a first data transmission module, characterized in that: The cleaning vehicle further comprises the electronic device as claimed in claim 12, wherein the video acquisition device is connected to the electronic device; The camera is used to collect original video data, the first data transmission module is used to upload the original video data, and the electronic device receives the original video data. The original video data includes multiple frames of original image data, and the original image is the original image data during current processing.
