Vehicle scratch detection method, device, electronic device and storage medium
By intelligently obtaining and analyzing the vehicle boundary lines in the surveillance video, and combining distance and weight methods, automatically identifying and marking the vehicle scratching period, the problem of inefficiency in the existing technology is solved and efficient scratch recognition and protection is achieved.
Patent Information
- Application Number
- CN202411883975.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-12-19
AI Technical Summary
In the prior art, the recognition efficiency of the vehicle scratching period in surveillance video is low, and it requires manual search in a large number of videos, which takes a long time and is inefficient.
By intelligently obtaining the boundary line of the parked vehicle and the boundary line of the driving into the vehicle, determining the monitoring weight based on the distance between the vehicles, and selecting the data analysis frequency based on the weight to analyze the monitoring video. If the vehicle boundary lines overlap, it is judged that scratches have occurred and the image segment is recorded.
It improves the recognition efficiency of vehicle scratching period video recording, reduces the cumbersomeness of manual search, and realizes key protection of scratching situations.
Smart Images

Figure CN119339559B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent monitoring, and in particular to a vehicle scratch detection method, device, electronic device and storage medium. Background Art
[0002] At present, there are still many irregularities in the use of temporary parking lots on urban roads, and it is common for vehicles to be scratched after being parked.
[0003] In the related art, although video surveillance technology is used to monitor vehicles, even if there are surveillance videos of urban roads, since it is unknown when the scratch occurred, it is still necessary to manually search for the scratch period video in a large amount of surveillance video data. Obviously, manually searching for the scratch period data in a large amount of surveillance video data is time-consuming and inefficient.
[0004] In summary, how to improve the efficiency of identifying vehicle scratching period videos in surveillance videos is an urgent problem to be solved. Summary of the invention
[0005] The embodiments of the present application provide a vehicle scratch detection method, device, electronic device and storage medium, which are used to improve the efficiency of identifying vehicle scratch period recording in surveillance video.
[0006] An embodiment of the present application provides a vehicle scratch detection method, the method comprising:
[0007] For at least one first vehicle parked in the monitoring range, a first boundary line corresponding to each first vehicle is obtained, and a second boundary line of at least one second vehicle driving into the monitoring range is obtained; the first boundary line and the second boundary line represent the position and outline of the vehicle;
[0008] For each second vehicle, during the driving process of the second vehicle, a monitoring weight of the second vehicle per unit time is determined according to the distance between the second vehicle and the first vehicle; the monitoring weight is negatively correlated with the distance;
[0009] For the surveillance video clips within the unit time corresponding to the surveillance range, a target surveillance weight is selected from the various surveillance weights determined within the unit time, and data analysis is performed on the surveillance video clips according to the data analysis frequency corresponding to the target surveillance weight; the data analysis frequency is positively correlated with the surveillance weight;
[0010] If a second boundary line of at least one target second vehicle in the second vehicles overlaps with a first boundary line of a target first vehicle in the at least one first vehicle, it is determined that a scratch occurs between the target first vehicle and the target second vehicle, and the surveillance video clip is marked.
[0011] An embodiment of the present application provides a vehicle scratch detection device, the device comprising:
[0012] an acquisition unit, configured to acquire, for at least one first vehicle parked in a monitoring range, a first boundary line corresponding to each first vehicle, and acquire a second boundary line of at least one second vehicle traveling into the monitoring range; the first boundary line and the second boundary line represent the position and contour of the vehicle;
[0013] a determining unit, configured to determine, for each second vehicle, a monitoring weight of the second vehicle per unit time according to a distance between the second vehicle and the first vehicle during the travel of the second vehicle; the monitoring weight is negatively correlated with the distance;
[0014] A data analysis unit, for selecting, for a surveillance video segment within a unit time corresponding to the surveillance range, a target surveillance weight from various surveillance weights determined within the unit time, and performing data analysis on the surveillance video segment according to a data analysis frequency corresponding to the target surveillance weight; the data analysis frequency is positively correlated with the surveillance weight;
[0015] A marking unit is used to determine that a scratch occurs between the target first vehicle and the target second vehicle if a second boundary line of at least one target second vehicle in the second vehicles crosses and overlaps with a first boundary line of the target first vehicle in the at least one first vehicle, and to mark the surveillance video clip.
[0016] Optionally, the first boundary line includes a first tracking frame representing the position of the first vehicle; the second boundary line includes a second tracking frame representing the position of the second vehicle; and the device further includes:
[0017] a detection unit, configured to detect, for each of the second vehicles, whether there is an obstruction between the second vehicle and each of the first vehicles during the driving of the second vehicle;
[0018] If there is an occlusion between the second vehicle and the first vehicle, the geometric shapes of the corresponding first tracking frame and the second tracking frame are adjusted.
[0019] Optionally, the detection unit is specifically used for:
[0020] The first tracking frame and the second tracking frame are adjusted to be stereo frames, and the heights of the first tracking frame and the second tracking frame are adjusted so that there is no occlusion between the first tracking frame and the second tracking frame.
[0021] Optionally, the first boundary line also includes a first contour line representing the contour of the first vehicle; the second boundary line also includes a second contour line representing the contour of the second vehicle; the first contour line is located in the upper plane of the first tracking frame, and the second contour line is located in the upper plane of the second tracking frame.
[0022] Optionally, the detection unit is further used for:
[0023] If there is no occlusion between the second vehicle and the first vehicle, and the first tracking frame and the second tracking frame are planar frames, keeping the geometric shapes of the first tracking frame and the second tracking frame unchanged;
[0024] If there is no occlusion between the second vehicle and the first vehicle, and the first tracking frame and the second tracking frame are three-dimensional frames, the first tracking frame and the second tracking frame are adjusted to be two-dimensional frames.
[0025] Optionally, the first boundary line includes a first tracking frame representing the position of the first vehicle and a first contour line representing the outline of the first vehicle; the second boundary line includes a second tracking frame representing the position of the second vehicle and a second contour line representing the outline of the second vehicle; then the marking unit is specifically used to:
[0026] If an edge line in the second tracking frame of the target second vehicle, which is far from the roadway, overlaps with an edge line in the first tracking frame of the target first vehicle, which is close to the roadway, then detecting a positional relationship between the second contour line and the first contour line;
[0027] If the second contour line of the target second vehicle crosses and overlaps with the first contour line of the target first vehicle, it is determined that a scratch occurs between the target first vehicle and the target second vehicle.
[0028] Optionally, the marking unit is specifically used for:
[0029] When an edge line of the second tracking frame of the target second vehicle, which is far from the roadway, overlaps with an edge line of the first tracking frame of the target first vehicle, which is close to the roadway, the corresponding surveillance video clip is saved;
[0030] When the second contour line of the target second vehicle crosses and overlaps with the first contour line of the target first vehicle, the corresponding monitoring video segment is marked.
[0031] An electronic device provided in an embodiment of the present application includes a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of any one of the above-mentioned vehicle scratch detection methods.
[0032] An embodiment of the present application provides a computer-readable storage medium, which includes a computer program. When the computer program is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of any one of the above-mentioned vehicle scratch detection methods.
[0033] An embodiment of the present application provides a computer program product, which includes a computer program, and the computer program is stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the electronic device performs the steps of any one of the above-mentioned vehicle scratch detection methods.
[0034] The beneficial effects of this application are as follows:
[0035] The embodiments of the present application provide a vehicle scratch detection method, device, electronic device and storage medium. In the embodiments of the present application, the first boundary line of the parked first vehicle and the second boundary line of the second vehicle entering are intelligently obtained through monitoring video, and the data analysis frequency of the monitoring video is determined according to the distance between the first vehicle and the second vehicle, and then the monitoring video is analyzed. If the first boundary line and the second boundary line cross and overlap, it is determined that the target first vehicle corresponding to the first boundary line and the second vehicle have scratched each other, and the monitoring video clip is marked, that is, there is no need to manually identify the video clip where the scratch occurs, and the monitoring clip with the scratch is protected, which greatly improves the recognition of the vehicle scratch clip in the monitoring video and reduces the tediousness of retrieving the video.
[0036] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0038] Figure 1 A schematic diagram of an application scenario of a vehicle scratch detection method provided in an embodiment of the present application;
[0039] Figure 2 A flowchart of a vehicle scratch detection method provided in an embodiment of the present application;
[0040] Figure 3 A schematic diagram of a first boundary line provided in an embodiment of the present application;
[0041] Figure 4 A schematic diagram of a second boundary line provided in an embodiment of the present application;
[0042] Figure 5 A schematic diagram of a stereo tracking frame provided in an embodiment of the present application;
[0043] Figure 6 A schematic diagram of an edge line provided in an embodiment of the present application;
[0044] Figure 7 A schematic diagram of another edge line provided in an embodiment of the present application;
[0045] Figure 8 A flowchart of another vehicle scratch detection method provided in an embodiment of the present application;
[0046] Fig. 9 A schematic diagram of the structure of a vehicle scratch detection device in an embodiment of the present application;
[0047] Fig.10 A schematic diagram of a hardware structure of an electronic device to which an embodiment of the present application is applied;
[0048] Fig.11 A schematic diagram of the hardware composition structure of a computing device using an embodiment of the present application. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the technical solution of the present application, rather than all of the embodiments. Based on the embodiments recorded in the application documents, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the technical solution of the present application.
[0050] The following is a brief introduction to the design concept of the embodiment of the present application:
[0051] At present, there are still many irregularities in the use of temporary parking lots on urban roads, and it is common for parked vehicles to be scratched. Although the current video surveillance technology is developing rapidly and the quality is very high, there are still some details and corners in the surveillance video that are blurred and unclear. Even if there is surveillance video at the time, it may still be difficult to determine when the scratch occurred when reviewing the surveillance video later. It is necessary to manually search through a large number of surveillance videos for the specific time point when the two vehicles scratched each other. Obviously, manual searching is very time-consuming.
[0052] In related technologies, the detection method for vehicle scratches is often used in the scene of car entering and exiting the warehouse. When the distance between the vehicle and the target object is less than or equal to the preset threshold, an early warning begins. However, when the threshold is small, if the driver does not make adjustments during the time from the early warning to the collision, the collision will still occur.
[0053] In view of this, the embodiments of the present application provide a vehicle scratch detection method, device, electronic device and storage medium. In the embodiments of the present application, the first boundary line of the parked first vehicle and the second boundary line of the second vehicle entering are intelligently obtained through monitoring video, and the data analysis frequency of the monitoring video is determined according to the distance between the first vehicle and the second vehicle, and then the monitoring video is analyzed. If the first boundary line and the second boundary line cross and overlap, it is determined that the target first vehicle corresponding to the first boundary line and the second vehicle have scratched each other, and the monitoring video clip is marked, that is, there is no need to manually identify the video clip where the scratch occurred, and the monitoring clip with the scratch situation is protected, which greatly improves the recognition of the vehicle scratch clip in the monitoring video and reduces the tediousness of retrieving the video.
[0054] The preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application. In addition, the embodiments and features in the embodiments of the present application may be combined with each other if there is no conflict.
[0055] like Figure 1 As shown, it is a schematic diagram of an application scenario of an embodiment of the present application. The application scenario diagram includes a first vehicle 110, a second vehicle 120, a monitoring device 130, a terminal device 140 and a server 150.
[0056] It should be noted that the vehicle scratch detection method in each embodiment of the present application can be executed by an electronic device, and the electronic device can be a terminal device 140 or a server 150, that is, the method can be executed by the terminal device 140 or the server 150 alone, or can be executed by the terminal device 140 and the server 150 together. For example, when the terminal device 140 and the server 150 are executed together, the monitoring device 130 collects at least one first vehicle 110 parked in the monitoring range, and sends the collected monitoring video to the terminal device 140, the terminal device 140 obtains the first boundary line corresponding to each first vehicle and sends it to the server 150, the monitoring device 130 collects at least one second vehicle 120 driving into the monitoring range, and sends the collected monitoring video to the terminal device 140, and the terminal device 140 obtains the second boundary line of each second vehicle and sends it to the server 150. For each first vehicle 110, during the driving of the second vehicle 120, the server 150 determines the monitoring weight of the second vehicle 110 per unit time according to the distance between the second vehicle 150 and the first vehicle 110; for the monitoring video segment per unit time corresponding to the monitoring range, the server 150 selects a target monitoring weight from each monitoring weight determined within the unit time, and performs data analysis on the monitoring video segment according to the data analysis frequency corresponding to the target monitoring weight; if the server 150 determines that the second boundary line of the target second vehicle 120 in at least one second vehicle 120 overlaps with the first boundary line of the target first vehicle 110 in at least one first vehicle 110, it is determined that the target first vehicle 110 and the target second vehicle 120 have a scratch, and the monitoring video segment is marked and sent to the terminal device 140, so that the terminal device 140 presents the marked monitoring video.
[0057] In an optional implementation, the monitoring device 130 , the terminal device 140 and the server 150 may communicate with each other via a communication network.
[0058] In an optional implementation, the communication network is a wired network or a wireless network.
[0059] It should be noted that Figure 1 The figure is only an example. In fact, the number of terminal devices and servers is not limited and is not specifically limited in the embodiments of the present application.
[0060] The vehicle scratch detection method provided by the exemplary embodiment of the present application is described below in combination with the application scenarios described above and with reference to the accompanying drawings. It should be noted that the above application scenarios are only shown to facilitate understanding of the spirit and principles of the present application, and the implementation methods of the present application are not limited in this respect.
[0061] See also Figure 2As shown, it is an implementation flow chart of a vehicle scratch detection method provided by an embodiment of the present application. The specific implementation process of the method includes S201~S204:
[0062] S201: For at least one first vehicle parked in a monitoring range, obtain a first boundary line corresponding to each first vehicle, and obtain a second boundary line of at least one second vehicle traveling into the monitoring range.
[0063] The first boundary line and the second boundary line represent the position and outline of the vehicle. The first boundary line includes a first tracking frame representing the position of the first vehicle; the second boundary line includes a second tracking frame representing the position of the second vehicle; the first boundary line also includes a first outline representing the outline of the first vehicle; the second boundary line also includes a second outline representing the outline of the second vehicle.
[0064] The tracking frame is a rectangular vehicle frame that changes position as the vehicle moves, and the direction of the frame is consistent with the direction of the vehicle. The contour line is the plane shape of the vehicle.
[0065] It should be noted that the method provided in the embodiment of the present application can be applied to any place or scene where a vehicle can be parked, such as an underground parking lot, a dedicated parking lot, a roadside parking space, a temporary parking area, etc. The following content uses a temporary parking lot as an example to illustrate the method proposed in the embodiment of the present application.
[0066] Specifically, the monitoring equipment installed in the temporary parking area is initialized, the first vehicle parked in the parking space within the monitoring range is retrieved, and the boundary line generation function is enabled for the first vehicle to obtain the first boundary line, including the first tracking frame and the first contour line.
[0067] Since the first vehicle parked in the parking space is prone to scratching the second vehicle driving towards the parking space from the road, the side of the first vehicle close to the road is more likely to scratch, while the probability of scratching the side away from the road is lower.
[0068] Therefore, in an optional implementation, the outer first boundary line of each outer first vehicle in at least one first vehicle is recorded according to the positional relationship between the monitoring range and the roadway.
[0069] as follows Figure 3 As shown, it is a schematic diagram of a first boundary line provided by an embodiment of the present application, wherein 301 is a first contour line, 302 is a first tracking frame, 303 is a parking space line, 304 is a first vehicle outside the roadway, and 305 is a first vehicle away from the roadway.
[0070] In addition to detecting the parked first vehicle, the monitoring device also detects whether a second vehicle enters the monitoring range. The second vehicle here includes a vehicle driving on the road but just passing through the monitoring range, a vehicle starting to leave the parking space, and a vehicle driving from the road to the parking space. The latter two situations may cause a scratch with the stationary first vehicle. If the monitoring device does not detect the second vehicle, it continues to be in the monitoring state.
[0071] If a second vehicle is detected entering the monitoring range, since the second vehicle may be a vehicle leaving the parking space, in this case a second boundary line has been generated for the second vehicle. However, if the second vehicle is a vehicle driving from the roadway to the parking space, the second boundary line has not yet been generated for the second vehicle. Therefore, it is necessary to first determine whether the second boundary line has been generated for the second vehicle to avoid regenerating the boundary line. If the second boundary line has been generated, the subsequent steps are performed. Otherwise, a second boundary line is generated for the second vehicle, including a second tracking frame and a second contour line.
[0072] like Figure 4 401 is a second vehicle driving towards a parking space, 402 is a tracking frame generated for the second vehicle, and 403 is a contour line generated for the second vehicle.
[0073] In the above embodiment, by detecting the first vehicle and the second vehicle and acquiring the corresponding first boundary line and second boundary line, it is helpful to perform a subsequent scratch determination based on the first boundary line and the second boundary line.
[0074] S202: For each second vehicle, during the driving process of the second vehicle, determine a monitoring weight of the second vehicle per unit time according to a distance between the second vehicle and the first vehicle.
[0075] The monitoring weight is negatively correlated with the distance. The unit time is an empirical value, usually set to 1 second, 2 seconds, etc.
[0076] The closer the distance between the second vehicle and the first vehicle is, the more likely they are to collide with each other, and this is also the part that should be focused on in the surveillance video. Therefore, the embodiment of the present application sets the monitoring weight according to the distance between the two vehicles.
[0077] In an optional implementation manner, the embodiment of the present application determines the monitoring weight of the first vehicle-to-vehicle relationship in the following manner:
[0078] A first frame of image data of a second vehicle in the surveillance video is obtained, a driving trajectory of the second vehicle is predicted according to a second tracking frame in the first frame of image data, and a monitoring weight of the second vehicle is determined according to a distance between the driving trajectory and the first vehicle.
[0079] The target duration is determined according to the driving speed of the second vehicle and the distance between the second vehicle and the roadway and the parking space.
[0080] Specifically, if the driving trajectory is closer to at least one first vehicle, the monitoring weight of the second vehicle will be greater. At the same time, the monitoring video is continuously analyzed to correct the predicted result of the driving trajectory and the monitoring weight of the second vehicle.
[0081] Similarly, the monitoring weight of the first vehicle can also be adjusted based on the distance between the driving trajectory and the first vehicle. The monitoring weights of the first vehicle and the second vehicle can also be combined to form the final monitoring weight, etc. This application does not make specific limitations on this.
[0082] In the above embodiment, the driving trajectory of the second vehicle is predicted by the second tracking frame, and the monitoring weight of the first vehicle or the second vehicle is increased in combination with the driving trajectory of the second vehicle, so as to focus on monitoring the second vehicle with a tendency to scratch, thereby reducing the subsequent video data analysis operations.
[0083] S203: For the surveillance video segments within the unit time corresponding to the surveillance range, a target surveillance weight is selected from various surveillance weights determined within the unit time, and data analysis is performed on the surveillance video segments according to the data analysis frequency corresponding to the target surveillance weight.
[0084] The data analysis frequency is positively correlated with the monitoring weight, and the target monitoring weight is the maximum monitoring weight. For example, a larger monitoring weight may correspond to a data analysis frequency of 20 frames per second, while a smaller monitoring weight may correspond to a data analysis frequency of 5 frames per second, and so on.
[0085] Specifically, since there may be multiple second vehicles in the same monitoring range and different second vehicles correspond to different monitoring weights, the largest monitoring weight is selected as the monitoring weight per unit time to avoid the problem of difficulty in distinguishing scratch events due to low data analysis frequency per unit time.
[0086] Furthermore, considering that there may be occlusion between the first vehicle and the second vehicle from the perspective of the monitoring device, a simple planar tracking frame cannot meet the subsequent scratch detection requirements, resulting in the scratch detection being unable to proceed normally. Therefore, the embodiment of the present application takes the occlusion of the first vehicle and the second vehicle into consideration and provides a variety of tracking frames to meet different needs.
[0087] In an optional implementation manner, the embodiment of the present application provides a variety of tracking frames in the following manner:
[0088] For each second vehicle, during the driving process of the second vehicle, it is detected whether there is an occlusion between the second vehicle and each first vehicle; and according to the detection result, the geometric shapes of the corresponding first tracking frame and the second tracking frame are adjusted.
[0089] Here, the geometric state refers to a plane frame or a three-dimensional frame.
[0090] Specifically, according to different detection results, the tracking frame is divided into the following three cases:
[0091] Case 1: If there is occlusion between the second vehicle and the first vehicle, the first tracking frame and the second tracking frame are adjusted to be stereo frames, and the heights of the first tracking frame and the second tracking frame are adjusted so that there is no occlusion between the first tracking frame and the second tracking frame.
[0092] Specifically, if there is an obstruction between vehicles that may scratch each other, the camera calibration technology is used to calculate the height and width of the first vehicle and the second vehicle, respectively, and generate a three-dimensional tracking frame. The three-dimensional tracking frame has a fixed width that remains unchanged at the width of the vehicle and adjusts the height according to the vehicle obstruction so that there is no obstruction between the first tracking frame and the second tracking frame.
[0093] like Figure 5 As shown, it is a schematic diagram of a stereoscopic tracking frame provided by an embodiment of the present application. 501 is a first vehicle, 502 is a second vehicle, and there is an occlusion between the two vehicles. Therefore, a stereoscopic first tracking frame 503 is generated for the first vehicle, and a stereoscopic second tracking frame 504 is generated for the second vehicle, wherein the height of 504 is much higher than 503, so there is no occlusion between the two stereoscopic frames.
[0094] In the above implementation, considering the situation where there is occlusion between vehicles, a stereo tracking frame processing method is added, the width maintains the vehicle width, and the height can be adjusted according to the occlusion situation, so that scratch detection can still be performed according to the adjusted stereo frame when the vehicle is occluded.
[0095] Since the tracking frame is a three-dimensional frame and the contour line is a plane diagram, the first contour line is placed on the upper plane of the first tracking frame and the second contour line is placed on the upper plane of the second tracking frame so that the contour line is not blocked and subsequent scratch detection can be performed.
[0096] Case 2: If there is no occlusion between the second vehicle and the first vehicle, and the first tracking frame and the second tracking frame are planar frames, the geometric shapes of the first tracking frame and the second tracking frame are kept unchanged.
[0097] Specifically, the tracking frame generated by default may be set as a planar frame, and when there is no occlusion between vehicles, it remains as a planar frame.
[0098] Case 3: If there is no occlusion between the second vehicle and the first vehicle, and the first tracking frame and the second tracking frame are three-dimensional frames, adjust the first tracking frame and the second tracking frame to be two-dimensional frames.
[0099] Specifically, if the tracking frame is not set as a plane frame by default, the generated tracking frame may be a stereo frame directly. In this case, the stereo frame can be adjusted to a plane frame, and then the plane frames of the first vehicle and the second vehicle can be subsequently judged.
[0100] Alternatively, it is also possible not to adjust to a plane frame, but to keep it as a three-dimensional frame for subsequent judgment, and this application does not make any specific limitation on this.
[0101] S204: If the second boundary line of the target second vehicle in the at least one second vehicle overlaps with the first boundary line of the target first vehicle in the at least one first vehicle, it is determined that the target first vehicle and the target second vehicle have a scratch, and the surveillance video segment is marked.
[0102] Specifically, after determining the monitoring weight of each second vehicle and adjusting the tracking frame according to the occlusion situation, the scratch judgment can be performed based on the tracking frame and the contour line.
[0103] In an optional implementation manner, the present application embodiment performs scratch determination in the following manner:
[0104] Step 1: If the edge line in the second tracking frame far from the roadway overlaps with the edge line in the first tracking frame of the target first vehicle close to the roadway, the positional relationship between the second contour line and the first contour line is detected.
[0105] Specifically, based on the above steps, the processing ratio of the second vehicle with the highest current monitoring weight will be increased. Obtain the monitoring video and determine whether the tracking frame in the monitoring video is a three-dimensional frame or a plane frame. If it is a plane tracking frame, obtain the edge line of the second tracking frame of the second vehicle away from the roadway and close to the parking space, and the edge line of the first tracking frame of the first vehicle close to the roadway. As the second vehicle travels, according to the data analysis frequency corresponding to the target monitoring weight, the monitoring video is continuously analyzed. If the two edge lines overlap, go to step 2.
[0106] like Figure 6 As shown, it is a schematic diagram of an edge line provided in an embodiment of the present application. Figure 6 The middle edge line AB is the edge line of the second vehicle away from the road, and the edge line CD is the edge line of the first vehicle close to the road. Figure 6 It can be seen that the two edge lines overlap.
[0107] If it is a three-dimensional tracking frame, obtain the edge line of the second tracking frame on the plane above the parking space side and the edge line of the first tracking frame on the plane above the road side. As the second vehicle travels, perform continuous data analysis on the surveillance video according to the data analysis frequency corresponding to the target monitoring weight. If the two edge lines overlap, proceed to step 2.
[0108] like Figure 7 As shown, it is a schematic diagram of another edge line provided in an embodiment of the present application. Figure 7 701 is the edge line on the side close to the road in the upper plane of the first tracking frame, and 702 is the edge line on the side away from the road in the upper plane of the second tracking frame.
[0109] In order to easily identify whether the edge lines cross and overlap, the two edge lines can be translated to the same plane and the same height for judgment.
[0110] In addition, when an edge line in the second tracking frame of the target second vehicle, which is far from the roadway, overlaps with an edge line in the first tracking frame of the target first vehicle, which is close to the roadway, the corresponding surveillance video clip is saved.
[0111] Specifically, after determining that the two edge lines cross and overlap, the surveillance video clips can be memorized and saved starting from the overlapping moment, or important data of the surveillance video a certain time before the intersection can be saved for later review and use. The certain time is an empirical value, which can be 10 seconds, 20 seconds, etc.
[0112] Step 2: If the second contour line overlaps with the first contour line of the target first vehicle, it is determined that the target first vehicle and the second vehicle have a scratch.
[0113] Specifically, since the first tracking frame and the second tracking frame overlap, it means that there is a high possibility that the two cars will actually scrape each other, so it is necessary to continue to analyze the data of the video frames of the surveillance video. When it is detected that the first contour line and the second contour line also overlap, the two cars have scraped each other.
[0114] In addition, when the second contour line of the target second vehicle and the first contour line of the target first vehicle intersect and overlap, the corresponding monitoring video segment is marked.
[0115] Specifically, after determining that the two contour lines intersect and overlap, in the saved surveillance video clips, the surveillance video clip when the two contour lines overlap can be highlighted, or the surveillance video clip a certain time before the intersection can be highlighted for later review and use. The certain time is an empirical value, which can be 10 seconds, 20 seconds, etc.
[0116] If the first contour line and the second contour line do not cross or overlap, the process returns to the determination process of whether the vehicle is blocked.
[0117] In the above embodiment, a double judgment is made on whether the vehicle has scratched, that is, the vehicle tracking frame overlaps and the vehicle contour line overlaps. The double judgment effectively improves the recognition accuracy of the scratch monitoring video clip. In addition, when the tracking frame and the contour line overlap, the monitoring video clip is saved as a key point to facilitate the later viewing of the monitoring video data.
[0118] After performing the above scratch judgment, it is determined whether the second vehicle that has been scratched is still within the monitoring range. If the second vehicle is still within the monitoring range and parked in the parking space, return to S201; if the second vehicle is still within the monitoring range and not parked in the parking space, return to S203.
[0119] like Figure 8 As shown, it is an implementation flow chart of another vehicle scratch detection method provided by an embodiment of the present application, which specifically includes S801~812:
[0120] S801: For at least one first vehicle parked in a monitoring range, obtaining a first boundary line corresponding to each first vehicle;
[0121] S802: Detect whether the second vehicle enters the monitoring range;
[0122] Specifically, if the second vehicle enters the monitoring range, execute S803; otherwise, execute S801.
[0123] S803: Detect whether the second boundary line has been generated;
[0124] Specifically, if the second boundary line has been generated, execute S806; otherwise, execute S804.
[0125] S804: Generate a second boundary line;
[0126] S805: For each second vehicle, during the driving process of the second vehicle, determining a monitoring weight of the second vehicle per unit time according to a distance between the second vehicle and the first vehicle;
[0127] S806: Performing data analysis on the surveillance video clips according to the data analysis frequency corresponding to the target surveillance weight;
[0128] S807: Detect whether the vehicle is blocked;
[0129] Specifically, if the vehicle is blocked, execute S808; otherwise, execute S809.
[0130] S808: If there is an occlusion between the second vehicle and the first vehicle, adjust the corresponding first tracking frame and the second tracking frame to be a stereoscopic frame, and adjust the heights of the first tracking frame and the second tracking frame;
[0131] S809: Determine whether the first tracking frame and the second tracking frame overlap each other;
[0132] Specifically, if the first tracking frame and the second tracking frame overlap, execute S810; otherwise, execute S812.
[0133] S810: Determine whether the first contour line and the second contour line cross or overlap;
[0134] Specifically, if the first contour line and the second contour line overlap, execute S811; otherwise, execute S807.
[0135] S811: Determine that a collision occurs between the first target vehicle and the second target vehicle, and mark the surveillance video segment;
[0136] S812: Determine whether the second vehicle is within the monitoring range;
[0137] Specifically, if the second vehicle is within the monitoring range, execute S813; otherwise, execute S814.
[0138] S813: Determine whether the second vehicle is parked in the parking space;
[0139] Specifically, if the second vehicle is parked in the parking space, execute S802; otherwise, execute S806.
[0140] S814: End.
[0141] In an embodiment of the present application, the first boundary line of the parked first vehicle and the second boundary line of the entering second vehicle are intelligently obtained through surveillance video. After the data analysis frequency of the surveillance video is determined according to the distance between the first vehicle and the second vehicle, video analysis is performed on the surveillance video. If the first boundary line and the second boundary line overlap, it is determined that the target first vehicle corresponding to the first boundary line and the second vehicle have scratched each other, and the surveillance video segment is marked. That is, there is no need to manually identify the video segment where the scratch has occurred, and it is also possible to focus on protecting the surveillance segment with scratches, which greatly improves the recognition of vehicle scratch segments in surveillance videos and reduces the tediousness of video retrieval.
[0142] By applying video intelligence to the scenario of vehicle scratch identification, the front end obtains vehicle dynamic information, the back end stores the recorder device, and transmits the parking scene video stream data to the back end storage device. The storage device performs data analysis on the surveillance video and saves important videos. In addition, the video at the time when the scratch occurred is marked and saved as important surveillance video. This greatly reduces the time for reviewing the video when the scratch occurred and filters out unnecessary surveillance videos.
[0143] Based on the same inventive concept, the embodiment of the present application also provides a vehicle scratch detection device 900. Fig. 9 As shown, it is a schematic diagram of the structure of a vehicle scratch detection device, which may include:
[0144] The acquisition unit 901 is used to acquire, for at least one first vehicle parked in the monitoring range, a first boundary line corresponding to each first vehicle, and acquire a second boundary line of at least one second vehicle driving into the monitoring range; the first boundary line and the second boundary line represent the position and outline of the vehicle;
[0145] The determining unit 902 is used to determine, for each second vehicle, a monitoring weight of the second vehicle per unit time according to the distance between the second vehicle and the first vehicle during the driving process of the second vehicle; the monitoring weight is negatively correlated with the distance;
[0146] The data analysis unit 903 is used to select a target monitoring weight from various monitoring weights determined within the unit time for the monitoring video clips within the unit time corresponding to the monitoring range, and perform data analysis on the monitoring video clips according to the data analysis frequency corresponding to the target monitoring weight; the data analysis frequency is positively correlated with the monitoring weight;
[0147] The marking unit 904 is used to determine that a scratch occurs between the target first vehicle and the target second vehicle if a second boundary line of the target second vehicle in the at least one second vehicle crosses and overlaps with a first boundary line of the target first vehicle in the at least one first vehicle, and mark the surveillance video clip.
[0148] Optionally, the first boundary line includes a first tracking frame representing the position of the first vehicle; the second boundary line includes a second tracking frame representing the position of the second vehicle; and the device further includes:
[0149] A detection unit 905 is used to detect, for each second vehicle, whether there is an obstruction between the second vehicle and each first vehicle during the driving process of the second vehicle;
[0150] If there is an occlusion between the second vehicle and the first vehicle, the geometric shapes of the corresponding first tracking frame and the second tracking frame are adjusted.
[0151] Optionally, the detection unit 905 is specifically used for:
[0152] The corresponding first tracking frame and the second tracking frame are adjusted to be three-dimensional frames, and the heights of the first tracking frame and the second tracking frame are adjusted so that there is no occlusion between the first tracking frame and the second tracking frame.
[0153] Optionally, the first boundary line also includes a first contour line representing the contour of the first vehicle; the second boundary line also includes a second contour line representing the contour of the second vehicle; the first contour line is located in the upper plane of the first tracking frame, and the second contour line is located in the upper plane of the second tracking frame.
[0154] Optionally, the detection unit 905 is further configured to:
[0155] If there is no occlusion between the second vehicle and the first vehicle, and the first tracking frame and the second tracking frame are planar frames, the geometric shapes of the first tracking frame and the second tracking frame are kept unchanged;
[0156] If there is no occlusion between the second vehicle and the first vehicle, and the first tracking frame and the second tracking frame are three-dimensional frames, the first tracking frame and the second tracking frame are adjusted to be two-dimensional frames.
[0157] Optionally, the first boundary line includes a first tracking frame representing the position of the first vehicle and a first contour line representing the outline of the first vehicle; the second boundary line includes a second tracking frame representing the position of the second vehicle and a second contour line representing the outline of the second vehicle; then the marking unit 904 is specifically used for:
[0158] If the edge line of the second tracking frame of the target second vehicle, which is far from the roadway, overlaps with the edge line of the first tracking frame of the target first vehicle, which is close to the roadway, the positional relationship between the second contour line and the first contour line is detected;
[0159] If the second contour line of the target second vehicle crosses and overlaps with the first contour line of the target first vehicle, it is determined that the target first vehicle and the target second vehicle collide with each other.
[0160] Optionally, the marking unit 904 is specifically used for:
[0161] When an edge line of the second tracking frame of the target second vehicle, which is far from the roadway, overlaps with an edge line of the first tracking frame of the target first vehicle, which is close to the roadway, the corresponding surveillance video clip is saved;
[0162] When the second contour line of the target second vehicle crosses and overlaps with the first contour line of the target first vehicle, the corresponding monitoring video segment is marked.
[0163] Based on the same inventive concept, an electronic device is also provided in an embodiment of the present application. In one embodiment, the electronic device may be Figure 1In this embodiment, the structure of the electronic device can be as follows: Fig.10 As shown, it includes a memory 1001 , a communication module 1003 and one or more processors 1002 .
[0164] The memory 1001 is used to store computer programs executed by the processor 1002. The memory 1001 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and programs required for running the instant messaging function, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.
[0165] The memory 1001 may be a volatile memory, such as a random-access memory (RAM); the memory 1001 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or the memory 1001 may be any other medium that can be used to carry or store a desired computer program in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 1001 may be a combination of the above memories.
[0166] The processor 1002 may include one or more central processing units (CPU) or a digital processing unit, etc. The processor 1002 is used to implement the above-mentioned vehicle scratch detection method when calling the computer program stored in the memory 1001 .
[0167] The communication module 1003 is used to communicate with electronic devices and other servers.
[0168] The specific connection medium between the memory 1001, the communication module 1003 and the processor 1002 is not limited in the embodiment of the present application. Fig.10 In the embodiment, the memory 1001 and the processor 1002 are connected via a bus 1004. The bus 1004 is connected to the processor 1002 via a bus 1004. Fig.10 The connections between the other components are only for illustration and are not intended to be limiting. The bus 1004 can be divided into an address bus, a data bus, a control bus, etc. For ease of description, Fig.10 The diagram shows that only one thick line is used, but this does not mean that there is only one bus or one type of bus.
[0169] The memory 1001 stores a computer storage medium, and the computer storage medium stores computer executable instructions, and the computer executable instructions are used to implement the vehicle scratch detection method of the embodiment of the present application. The processor 1002 is used to execute the above-mentioned vehicle scratch detection method. Based on the same inventive concept, the embodiment of the present application provides a computer-readable storage medium, and the computer program product includes: computer program code, when the computer program code runs on the computer, the computer executes any of the vehicle scratch detection methods discussed above. Since the principle of solving the problem by the above-mentioned computer-readable storage medium is similar to that of the vehicle scratch detection method, the implementation of the above-mentioned computer-readable storage medium can refer to the implementation of the method, and the repeated parts will not be repeated.
[0170] Refer to the following Fig.11 1100 according to this embodiment of the present application is described. Fig.11 The computing device 1100 is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0171] like Fig.11 The computing device 1100 is in the form of a general computing device. The components of the computing device 1100 may include, but are not limited to: at least one processing unit 1101, at least one storage unit 1102, and a bus 1103 connecting different system components (including the storage unit 1102 and the processing unit 1101).
[0172] Bus 1103 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a processor, or a local bus using any of a variety of bus architectures.
[0173] The storage unit 1102 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 1121 and / or a cache memory 1122 , and may further include a read-only memory (ROM) 1123 .
[0174] The storage unit 1102 may also include a program / utility 1125 having a set (at least one) of program modules 1124, such program modules 1124 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0175] The computing device 1100 may also communicate with one or more external devices 1104 (e.g., keyboards, pointing devices, etc.), one or more devices that enable a user to interact with the computing device 1100, and / or any device that enables the computing device 1100 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1105. Furthermore, the computing device 1100 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 1106. Fig.11 As shown, the network adapter 1106 communicates with other modules for the computing device 1100 via the bus 1103. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the computing device 1100, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0176] The embodiment of the present application also provides a computer program product, and the method in the present application can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in the present application is executed in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device, a core network device, an OAM or other programmable device.
[0177] The computer-readable storage medium can be implemented as a computer program product, that is, an embodiment of the present application also provides a computer-readable storage medium, which includes a computer program, and when the computer program is executed by a processor, it implements any of the above-mentioned vehicle scratch detection methods.
[0178] The computer program or instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it may also be an optical medium, such as a digital video disk; it may also be a semiconductor medium, such as a solid-state drive. The computer-readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.
[0179] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0180] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0181] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0182] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0183] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A vehicle scratch detection method, characterized in that: The method comprises: For at least one first vehicle parked in the monitoring range, a first boundary line corresponding to each of the first vehicles is obtained, and a second boundary line of at least one second vehicle driving into the monitoring range is obtained; the first boundary line and the second boundary line represent the position and contour of the vehicle; the first boundary line includes a first tracking frame representing the position of the first vehicle and a first contour line representing the contour of the first vehicle; the second boundary line includes a second tracking frame representing the position of the second vehicle and a second contour line representing the contour of the second vehicle; For each second vehicle, during the driving process of the second vehicle, a monitoring weight of the second vehicle per unit time is determined according to the distance between the second vehicle and the first vehicle; the monitoring weight is negatively correlated with the distance; For the surveillance video clips within the unit time corresponding to the surveillance range, the maximum surveillance weight within the unit time is used as the target surveillance weight, and data analysis is performed on the surveillance video clips according to the data analysis frequency corresponding to the target surveillance weight; the data analysis frequency is positively correlated with the surveillance weight; If an edge line in the second tracking frame of at least one target second vehicle, which is away from the roadway, overlaps with an edge line in the first tracking frame of the target first vehicle, which is close to the roadway, the positional relationship between the second contour line and the first contour line is detected; if the second contour line of the target second vehicle overlaps with the first contour line of the target first vehicle, it is determined that a scratch occurs between the target first vehicle and the target second vehicle, and the surveillance video clip is marked.
2. The method according to claim 1, characterized in that Before determining that a scratch occurs between the target first vehicle and the target second vehicle if the second boundary line overlaps with the first boundary line of the target first vehicle among the at least one first vehicle, the method further includes: For each of the second vehicles, during the driving of the second vehicle, detecting whether there is an obstruction between the second vehicle and each of the first vehicles; If there is an occlusion between the second vehicle and the first vehicle, the geometric shapes of the corresponding first tracking frame and the second tracking frame are adjusted.
3. The method according to claim 2, characterized in that The adjusting the geometric shapes of the first tracking frame and the second tracking frame according to the judgment result includes: The first tracking frame and the second tracking frame are adjusted to be stereo frames, and the heights of the first tracking frame and the second tracking frame are adjusted so that there is no occlusion between the first tracking frame and the second tracking frame.
4. The method according to claim 3, characterized in that The first contour line is located on an upper plane of the first tracking frame, and the second contour line is located on an upper plane of the second tracking frame.
5. The method according to claim 2, characterized in that The method further comprises: If there is no occlusion between the second vehicle and the first vehicle, and the first tracking frame and the second tracking frame are planar frames, keeping the geometric shapes of the first tracking frame and the second tracking frame unchanged; If there is no occlusion between the second vehicle and the first vehicle, and the first tracking frame and the second tracking frame are three-dimensional frames, the first tracking frame and the second tracking frame are adjusted to be two-dimensional frames.
6. The method according to claim 1, characterized in that The step of determining that the first target vehicle and the second target vehicle collide with each other and marking the surveillance video segment includes: When an edge line of the second tracking frame of the target second vehicle, which is far from the roadway, overlaps with an edge line of the first tracking frame of the target first vehicle, which is close to the roadway, the corresponding surveillance video clip is saved; When the second contour line of the target second vehicle and the first contour line of the target first vehicle intersect and overlap, the corresponding monitoring video segment is marked.
7. A vehicle scratch detection device, characterized in that: The device comprises: An acquisition unit is used to acquire, for at least one first vehicle parked in a monitoring range, a first boundary line corresponding to each first vehicle, and acquire a second boundary line of at least one second vehicle driving into the monitoring range; the first boundary line and the second boundary line represent the position and contour of the vehicle; the first boundary line includes a first tracking frame representing the position of the first vehicle and a first contour line representing the contour of the first vehicle; the second boundary line includes a second tracking frame representing the position of the second vehicle and a second contour line representing the contour of the second vehicle; a determining unit, configured to determine, for each second vehicle, a monitoring weight of the second vehicle per unit time according to a distance between the second vehicle and the first vehicle during the travel of the second vehicle; the monitoring weight is negatively correlated with the distance; A data analysis unit is used to analyze the surveillance video clips within a unit time corresponding to the surveillance range, taking the maximum surveillance weight within the unit time as a target surveillance weight, and performing data analysis on the surveillance video clips according to a data analysis frequency corresponding to the target surveillance weight; the data analysis frequency is positively correlated with the surveillance weight; A marking unit is used to detect the positional relationship between the second contour line and the first contour line if an edge line of a second tracking frame of at least one target second vehicle in the second vehicles, which is far from the roadway, overlaps with an edge line of a first tracking frame of a target first vehicle in the at least one first vehicle, which is close to the roadway; if the second contour line of the target second vehicle overlaps with the first contour line of the target first vehicle, it is determined that a scratch occurs between the target first vehicle and the target second vehicle, and the surveillance video clip is marked.
8. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of any one of the methods of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: It includes a computer program, and when the computer program is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of any method described in claims 1 to 6.
10. A computer program product, characterized in that The method comprises a computer program stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the electronic device executes the steps of any one of the methods described in claims 1 to 6.
Citation Information
Patent Citations
Vehicle scratch detection method based on video analysis
CN111091061A
Method and device for outputting information
CN113469115A
Device, method, and program for detecting object
US20170277183A1