An electric bicycle reverse driving detection method and an electric bicycle

By installing an on-board camera on the motorcycle, capturing the front environment image and calculating the vehicle count ratio, the problem of inaccurate detection of the reverse direction of the motorcycle in the existing technology is solved, and accurate detection of the reverse direction of the motorcycle and traffic safety are achieved.

CN116453351BActive Publication Date: 2025-06-27HUNAN XIBAODA INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310355987.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-03
Publication Date
2025-06-27
Estimated Expiration
2043-04-03

AI Technical Summary

Technical Problem

The lack of effective counter-travel detection methods in the prior art has led to the inability to guarantee traffic safety.

Method used

By obtaining the current running status of the motorcycle, we determine whether it is in the driving state, and control the on-board camera to enter the side car capture mode in the driving state to capture the environment image in front. Then, an effective image is extracted, the number of the first type reference vehicle (vehicle with the front facing the motorcyclist) and the second type reference vehicle (vehicle with the rear facing the motorcyclist) is determined, and the number ratio of the two is calculated. If the ratio is greater than the preset threshold, it is determined that the motorcycle is in a retrograde state.

Benefits of technology

Accurate detection of the reverse state of the motorcycle is achieved, the accuracy of the detection is improved, and traffic safety is ensured through alarm instructions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116453351B_ABST
    Figure CN116453351B_ABST
Patent Text Reader

Abstract

The present invention provides a method for detecting reverse driving of an electric bicycle and an electric bicycle. By obtaining the current operating state of the electric bicycle, it is determined whether the electric bicycle is in a driving state according to the current operating state. When the electric bicycle is in a driving state, the in-vehicle camera is controlled to enter the side vehicle capture mode, an effective image is extracted from the environmental image captured by the in-vehicle camera, and the number of reference vehicles of the first type and the number of reference vehicles of the second type are determined according to the effective image. Among them, the reference vehicle of the first type is a vehicle with the head facing the electric bicycle, and the reference vehicle of the second type is a vehicle with the tail facing the electric bicycle. The ratio between the number of reference vehicles of the first type and the number of reference vehicles of the second type is determined. When the ratio is greater than a preset threshold, it is determined that the electric bicycle is in a reverse driving state. This application can accurately detect whether the electric bicycle is in a reverse driving state by determining the ratio of the reference vehicles of the first type and the reference vehicles of the second type in the effective image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electric bicycles, and particularly to a method for detecting reverse driving of an electric bicycle and an electric bicycle. Background Art

[0002] With the progress of society, people's awareness of green travel has gradually increased, and shared electric bicycles have emerged as the times require. Traveling by electric bicycle is light, convenient, fast, and cheap, and has become an important part of people's travel.

[0003] However, in the daily travel process, the phenomenon of shared electric bicycles driving in reverse frequently occurs. The reverse driving of shared electric bicycles seriously affects the road traffic safety of motor vehicles, increases the possibility of traffic accidents, and at the same time brings great potential safety hazards to the life and property safety of riders. At present, in the prior art, there is a lack of effective detection means for detecting the reverse driving of electric bicycles, resulting in the inability to guarantee traffic safety.

[0004] In view of this, it is necessary to propose a method for detecting reverse driving of an electric bicycle and an electric bicycle to solve or at least alleviate the above defects. Summary of the Invention

[0005] The main purpose of the present invention is to provide a method for detecting reverse driving of an electric bicycle and an electric bicycle, so as to solve the problem that in the prior art, there is a lack of effective detection means for detecting the reverse driving of an electric bicycle, resulting in the inability to guarantee traffic safety.

[0006] To achieve the above purpose, the present invention provides a method for detecting reverse driving of an electric bicycle, including the steps of:

[0007] S1, obtaining the current operating state of the electric bicycle, and judging whether the electric bicycle is in a driving state according to the current operating state;

[0008] S2, when the electric bicycle is in a driving state, controlling the on-vehicle camera to enter the side vehicle capture mode; wherein, the on-vehicle camera is fixed on the vehicle body of the electric bicycle, and the side vehicle capture mode is used to capture the environmental image containing vehicles in the front area of the electric bicycle;

[0009] S3, extracting an effective image from the environmental image captured by the on-vehicle camera, and determining the number of reference vehicles of the first type and the number of reference vehicles of the second type according to the effective image; wherein, the reference vehicle of the first type is the vehicle with the head facing the electric bicycle, and the reference vehicle of the second type is the vehicle with the tail facing the electric bicycle;

[0010] S4, determining the ratio between the number of reference vehicles of the first type and the number of reference vehicles of the second type, and when the ratio is greater than a first preset threshold, determining that the electric bicycle is in a reverse driving state.

[0011] Preferably, step S3 specifically includes the following steps:

[0012] S31. Determine whether there is a road edge line in the environmental image. When there is a road edge line in the environmental image, determine the electric bicycle and the road edge line closest to the electric bicycle as the target road edge line, and determine the lateral distance between the target road edge line and the electric bicycle.

[0013] S32. When the lateral distance is less than a preset distance, obtain the one-way total width of the lane where the electric bicycle is located at the current moment; and obtain the historical position data set of the electric bicycle within a preset time period before the current moment, and determine the vector driving path of the electric bicycle at the current moment according to the historical position data set.

[0014] S33. Divide the effective image into a first region close to the target road edge line and a second region far from the target road edge line with the vector driving path corresponding to the current moment as the center line; wherein, the lateral width of the first region is the lateral distance, and the lateral width of the second region is the difference between the one-way total width and the lateral distance.

[0015] S34. Calibrate the weight of the first region as k0, and sequentially divide the second region into n sub-regions along the road lateral direction from near to far with the vector driving path corresponding to the current moment as the reference; wherein, the weight of the first sub-region is k1, the weight of the i-th region is ki, the weight of the n-th sub-region is kn, k1≥ki≥kn; 1≤i≤n, both i and n are positive integers.

[0016] S35. Determine the actual number of first-type reference vehicles and the actual number of second-type reference vehicles in each sub-region of the second region and in the first region respectively.

[0017] S36. Determine the weighted average number of first-type reference vehicles and the weighted average number of second-type reference vehicles in the effective image according to the number of first-type reference vehicles, the number of second-type reference vehicles and the corresponding weights in each sub-region of the first region and the second region, and use the weighted average number of first-type reference vehicles as the number of first-type reference vehicles, and use the weighted average number of second-type reference vehicles as the number of second-type reference vehicles.

[0018] Preferably, after step S4, the following steps are further included:

[0019] S51. When the ratio is less than or equal to the first preset threshold, take the current moment as the statistical initial moment, and obtain all environmental images captured by the on-vehicle camera within a preset duration starting from the statistical initial moment.

[0020] S52. Extract valid images from each of the environmental images, and collect all the valid images within the preset duration to obtain a valid image set.

[0021] S53. Determine the ratio of the number of first-type reference vehicles to the number of second-type reference vehicles in the valid image set, and determine whether the ratio is greater than the preset threshold.

[0022] S54. When the ratio is greater than the first preset threshold, determine that the electric bicycle is in a reverse state and execute a preset alarm instruction; when the ratio is less than the second preset threshold, determine that the electric bicycle is in a normal driving state and maintain the current state of the electric bicycle; where the second preset threshold is less than the first preset threshold.

[0023] S55. When the ratio is less than or equal to the first preset threshold, obtain all environmental images captured by the on-vehicle camera within a preset delay step after the current moment, extract valid images from each of the environmental images, collect all the valid images between the statistical initial moment and the end moment of the preset step to obtain an intermediate valid image set, and use the intermediate valid image set as the valid image set, then enter step S53.

[0024] Preferably, the "preset threshold" in step S4 is obtained through the following steps:

[0025] S41. Obtain the real-time traffic flow of the lane where the electric bicycle is located at the current moment.

[0026] S42. Determine the preset threshold according to a preset traffic threshold algorithm.

[0027] Preferably, the preset traffic threshold algorithm includes: the preset threshold is proportional to the real-time traffic flow.

[0028] Preferably, after step S4, there is also a step:

[0029] S6. Extract the images of the second-type reference vehicles from the valid images as alarm images, and send the alarm images to a preset object.

[0030] Preferably, the "one-way total width" in step S32 is obtained through the following steps:

[0031] Obtain the current position of the electric bicycle, and determine the one-way total width according to the current position.

[0032] The present invention also provides an electric bicycle, which includes a vehicle body, and further includes an on-vehicle camera and a control system provided on the vehicle body. Among them, the on-vehicle camera is fixed on the vehicle body of the electric bicycle, and the side-vehicle capture mode is used to capture an environmental image including vehicles in the area in front of the electric bicycle; the on-vehicle camera is connected to the control system, and the control system includes a memory, a processor, and a computer program stored in the memory and operable on the processor. When the processor executes the computer program, the steps of the electric bicycle reverse detection method as described above are implemented.

[0033] The present invention also provides a storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the electric bicycle reverse detection method as described above are implemented.

[0034] Compared with the prior art, the present invention has the following beneficial effects:

[0035] The present invention provides an electric bicycle reverse detection method and an electric bicycle. By obtaining the current running state of the electric bicycle, it is judged whether the electric bicycle is in a driving state according to the current running state. When the electric bicycle is in a driving state, the on-vehicle camera is controlled to enter the side-vehicle capture mode, an effective image is extracted from the environmental image captured by the on-vehicle camera, and the number of first-type reference vehicles and the number of second-type reference vehicles are determined according to the effective image. The first-type reference vehicle is a vehicle with the head facing the electric bicycle, and the second-type reference vehicle is a vehicle with the tail facing the electric bicycle. The ratio between the number of first-type reference vehicles and the number of second-type reference vehicles is determined. When the ratio is greater than a preset threshold, it is determined that the electric bicycle is in a reverse state. In this application, by determining the ratio between the number of first-type reference vehicles and the number of second-type reference vehicles, it is possible to accurately detect whether the electric bicycle is in a reverse state. By dividing the effective image into sub-regions according to the vector driving path corresponding to the current moment, the number of vehicles in each sub-region is determined respectively, and the final weighted average number is obtained as the ratio calculation value. This method can effectively improve the detection accuracy. By introducing a delay loop judgment, that is, when the ratio is less than or equal to the preset threshold, the detection duration is appropriately extended until it is detected whether the electric bicycle is in a reverse state. Description of the Drawings

[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on the structures shown in these drawings.

[0037] Figure 1Schematic flowchart of an embodiment of the present invention;

[0038] Figure 2 Schematic flowchart showing the specific steps included in step S3 in an embodiment of the present invention;

[0039] Figure 3 Schematic flowchart showing the steps further included after step S5 in an embodiment of the present invention.

[0040] The implementation, functional features, and advantages of the present invention will be further described with reference to the embodiments and the accompanying drawings. Detailed implementation manners

[0041] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0042] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0043] It should be noted that all directional indications (such as up, down, left, right, front, back...) in the embodiments of the present invention are only used to explain the relative positional relationship and movement conditions between components in a specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indications will also change accordingly.

[0044] In addition, the descriptions involving "first", "second", etc. in the present invention are only for descriptive purposes, and cannot be understood as indicating or implying their relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include at least one such feature. In addition, the technical solutions between various embodiments can be combined with each other, but it must be based on the fact that those of ordinary skill in the art can implement them. When the combination of technical solutions appears to be contradictory or unable to be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the protection scope required by the present invention.

[0045] Please refer to the attached Figures 1-3 , the present invention provides an electric bicycle reverse detection method, including the steps:

[0046] S1, obtain the current running status of the electric motorcycle, and determine whether the electric motorcycle is in a driving state based on the current running status; it can be understood that in order to detect whether the electric motorcycle is in a reverse state, it is first necessary to detect the running status of the electric motorcycle. For example, it is possible to determine whether the electric motorcycle is in a driving state by obtaining the position change or speed change of the electric motorcycle or the current change of the driving motor.

[0047] S2, when the motorcycle is in motion, controlling the on-board camera to enter a vehicle-side capture mode; wherein the on-board camera is fixed on the body of the motorcycle, and the vehicle-side capture mode is used to capture an environmental image including vehicles in the area in front of the motorcycle; that is, after a vehicle beside the motorcycle enters the shooting area, image capture is performed upon recognition of the presence of the vehicle.

[0048] S3, extracting a valid image from the environmental image captured by the on-board camera, and determining the number of first-type reference vehicles and the number of second-type reference vehicles based on the valid image; wherein, the first-type reference vehicle is a vehicle with its front end facing the electric motorcycle, and the second-type reference vehicle is a vehicle with its rear end facing the electric motorcycle; it can be understood that the first-type reference vehicle is a vehicle traveling in the opposite direction to the electric motorcycle, and the second-type reference vehicle is a vehicle traveling in the same direction as the electric motorcycle.

[0049] S4, determining the ratio between the number of the first type of reference vehicles and the number of the second type of reference vehicles, and when the ratio is greater than a first preset threshold, determining that the motorcycle is in a reverse state. It can be understood that the larger the ratio, the more the number of motorcycles with their fronts facing the motorcycles or the fewer the number of motorcycles with their rears facing the motorcycles, and the more likely the motorcycle is to be in reverse; the smaller the ratio, the fewer the number of motorcycles with their fronts facing the motorcycles or the more the number of motorcycles with their rears facing the motorcycles, and the more likely the motorcycle is to be traveling normally.

[0050] In the technical solution of the present application, by obtaining the current running state of the motorcycle, it is determined whether the motorcycle is in a driving state according to the current running state. When the motorcycle is in a driving state, the on-board camera is controlled to enter the vehicle-side capture mode, and a valid image is extracted from the environmental image captured by the on-board camera. The number of first-type reference vehicles and the number of second-type reference vehicles are determined according to the valid image. The first-type reference vehicle is a vehicle with its front facing the motorcycle, and the second-type reference vehicle is a vehicle with its rear facing the motorcycle. The ratio between the number of first-type reference vehicles and the number of second-type reference vehicles is determined. When the ratio is greater than a preset threshold, it is determined that the motorcycle is in a reverse state. The present application can accurately detect whether the motorcycle is in a reverse state by determining the ratio between the number of first-type reference vehicles and the number of second-type reference vehicles.

[0051] As a preferred embodiment of the present invention, the step S3 specifically includes the following steps:

[0052] S31. Determine whether there is a road edge line in the environmental image. When there is a road edge line in the environmental image, determine the electric bicycle and the road edge line closest to the electric bicycle as the target road edge line, and determine the lateral distance between the target road edge line and the electric bicycle. Considering the actual situation, the reverse driving of shared electric bicycles generally occurs on the side of the road edge line and usually does not drive into the fast lane or the middle lane to reverse. In order to accurately determine whether the electric bicycle is in a reverse state when the electric bicycle is driving on the side of the road edge line, in this embodiment, it is determined whether there is a road edge line in the environmental image. When there is a road edge line in the environmental image, determine the electric bicycle and the road edge line closest to the electric bicycle as the target road edge line, and determine the lateral distance between the target road edge line and the electric bicycle. Among them, the lateral distance can be determined according to the position of the target road line in the environmental image.

[0053] S32. When the lateral distance is less than a preset distance, obtain the one-way total width of the lane where the electric bicycle is located at the current moment; and obtain the historical position data set of the electric bicycle within a preset time period before the current moment, and determine the vector driving path of the electric bicycle at the current moment according to the historical position data set. It can be understood that when the lateral distance is less than the preset distance, for example, when the distance between the electric bicycle and the road edge line is less than 1.5 m, it is very likely that the electric bicycle will reverse within this distance range. Based on this, when the lateral distance is greater than or equal to the preset distance, it may not be considered in this application. By obtaining the one-way total width of the lane where the electric bicycle is located at the current moment; and obtaining the historical position data set of the electric bicycle within a preset time period before the current moment, and determining the vector driving path of the electric bicycle at the current moment according to the historical position data set.

[0054] In a specific embodiment, the "one-way total width" in step S32 is obtained through the following steps: By obtaining the current position of the electric bicycle, the one-way total width is determined according to the current position. It can be understood that the road width of urban roads is known. By obtaining the current position of the electric bicycle, the one-way total width is determined according to the current position. For example, the corresponding one-way total width can be obtained by accessing road data through the current position. It should be noted that, for example, on a two-way lane road, the road is divided into oncoming lanes and same-direction lanes. The one-way total width in this embodiment refers to the total width of the same-direction lane where the electric bicycle is located, generally the width between the road edge line and the dividing line between the oncoming lane and the same-direction lane.

[0055] It should be noted that the vector driving path is used to determine the driving trajectory of the electric bicycle within a preset time period before the current moment, so as to facilitate the subsequent division of the captured pictures. For example, the preset time period can be set to 3s, and the trajectory line for these 3s can be determined according to the vector driving path.

[0056] S33. Divide the effective image into a first region close to the target road edge line and a second region far from the target road edge line with the vector driving path corresponding to the current moment as the center line; wherein, the lateral width of the first region is the lateral distance, and the lateral width of the second region is the difference between the one-way total width and the lateral distance; it should be noted that, in order to obtain an effective image and avoid interference caused by unnecessary environmental image information (such as vehicles in the oncoming lane or vehicles on the sidewalk), in this embodiment, the effective image is divided into a first region close to the target road edge line and a second region far from the target road edge line with the vector driving path corresponding to the current moment as the center line, the lateral width of the first region is the lateral distance, and the lateral width of the second region is the difference between the one-way total width and the lateral distance. The first region and the second region delimited in this way cover all the lateral widths of the electric bicycle in the same-direction lane. The regions divided in this way can improve the accuracy of detecting the reverse driving of the electric bicycle.

[0057] S34. Calibrate the weight of the first region as k0, and sequentially divide the second region into n sub-regions along the road lateral direction from near to far with the vector driving path corresponding to the current moment as the reference; wherein, the weight of the first sub-region is k1, the weight of the i-th region is ki, and the weight of the n-th sub-region is kn, k1≥ki≥kn; 1≤i≤n, both i and n are positive integers; those skilled in the art can understand that, taking the electric bicycle as the reference, the clarity of the image is lower the farther away from the electric bicycle. In order to obtain a clear vehicle image and improve the confidence level, in this embodiment, the weight of the first region is given as k0. Since the proportion of the first region in the width of the same-direction lane is small, this embodiment does not divide the first region into sub-regions; for the second region, since the second region has a relatively large span and considering that the clarity of the image is lower in the range farther away from the electric bicycle, therefore, the second region is sequentially divided into n sub-regions along the road lateral direction from near to far with the vector driving path corresponding to the current moment as the reference; wherein, the weight of the first sub-region is k1, the weight of the i-th region is ki, and the weight of the n-th sub-region is kn, k1≥ki≥kn; that is, the weights of the sub-regions decrease sequentially from near to far.

[0058] S35. Determine the actual number of the first type of reference vehicles and the actual number of the second type of reference vehicles in each sub-region of the second region and in the first region respectively.

[0059] S36. Determine the weighted average number of first - type reference vehicles and the weighted average number of second - type reference vehicles in the effective image based on the number of first - type reference vehicles, the number of second - type reference vehicles, and the corresponding weights in each sub - region of the first region and the second region, and use the weighted average number of first - type reference vehicles as the number of first - type reference vehicles and the weighted average number of second - type reference vehicles as the number of second - type reference vehicles.

[0060] In the technical solution of this embodiment, by determining whether there is a road edge line in the environmental image, when there is a road edge line in the environmental image, determine the electric bicycle and the road edge line closest to the electric bicycle as the target road edge line, and determine the lateral distance between the target road edge line and the electric bicycle. When the lateral distance is less than a preset distance, divide the environmental image into a first region and a second region, and sequentially divide the second region into multiple sub - regions, and then assign different weight values to all regions. By calculating the weighted average, determine the number of first - type reference vehicles and the number of second - type reference vehicles. In this way, the confidence level of image recognition can be greatly improved, and the accuracy of detecting the reverse driving of electric bicycles can be improved.

[0061] As a preferred embodiment, after step S4, the following steps are further included:

[0062] S51. When the ratio is less than or equal to the first preset threshold, use the current moment as the statistical initial moment to obtain all environmental images captured by the on - vehicle camera within a preset time period starting from the statistical initial moment. It should be noted that when the ratio is less than or equal to the first preset threshold, the electric bicycle may be in a normal driving state or a reverse driving state. Therefore, further detection is required. This current moment is when the ratio is less than or equal to the preset threshold. In this embodiment, by counting all images within a certain time period, the detection sample size is increased. Use the current moment as the statistical initial moment to obtain all environmental images captured by the on - vehicle camera within a preset time period starting from the statistical initial moment. Among them, the preset time period can be set as needed. In a specific example, the preset time period can be set to 3s.

[0063] S52. Extract effective images from each of the environmental images, and collect all the effective images within the preset time period to obtain an effective image set. For example, when the preset time period is 3s, for all the captured pictures within 3s, extract effective images from each of the environmental images respectively, and collect all the effective images within the preset time period to obtain an effective image set. At this time, the detection sample size changes from one original image to several current images, increasing the sample detection capacity.

[0064] S53. Determine the ratio of the number of first-type reference vehicles to the number of second-type reference vehicles in the effective image set, and determine whether the ratio is greater than the preset threshold;

[0065] S54. When the ratio is greater than the first preset threshold, determine that the electric bicycle is in a reverse state and execute a preset alarm instruction; when the ratio is less than the second preset threshold, determine that the electric bicycle is in a normal driving state and maintain the current state of the electric bicycle; wherein, the second preset threshold is less than the first preset threshold; it can be understood that by collecting all the effective images within the preset duration to obtain an effective image set, by increasing the sample detection capacity, when the ratio is greater than the first preset threshold, it can be determined that the electric bicycle is in a reverse state at this time. Among them, the alarm instruction can be one or more of a voice prompt instruction, an alarm instruction, an instruction to send information to the server or user account, and an instruction to disconnect the power supply of the electric bicycle. When the ratio is less than the second preset threshold, determine that the electric bicycle is in a normal driving state and maintain the current state of the electric bicycle.

[0066] S55. When the ratio is less than or equal to the first preset threshold, obtain all the environmental images captured by the on-vehicle camera within a preset delay step after the current moment, extract effective images from each of the environmental images, collect all the effective images between the statistical initial moment and the end moment of the preset step to obtain an intermediate effective image set, and use the intermediate effective image set as the effective image set, and then enter step S53. It should be noted that when the ratio is less than or equal to the first preset threshold, at this time, the electric bicycle may still be in a reverse state or in a normal driving state. To further determine whether the electric bicycle is in a reverse state, this embodiment also provides a cyclic detection method, that is, obtain all the environmental images captured by the on-vehicle camera within a preset delay step after the current moment, extract effective images from each of the environmental images, collect all the effective images between the statistical initial moment and the end moment of the preset step to obtain an intermediate effective image set, and use the intermediate effective image set as the effective image set, and then enter step S53. Among them, the preset delay step can be set to 2s, that is, if the ratio is still less than or equal to the preset threshold after the first delay, then a second delay is performed on the original basis, and so on, until it is determined that the ratio is greater than the preset threshold, determine that the electric bicycle is in a reverse state, and execute a preset alarm instruction.

[0067] In this embodiment, when the ratio is less than or equal to the first preset threshold, all environmental images captured by the vehicle-mounted camera within a preset duration starting from the current moment are obtained by taking the current moment as the statistical initial moment. When the ratio is greater than the first preset threshold, it is determined that the electric bicycle is in a reverse state, and a preset alarm instruction is executed. When the ratio is less than or equal to the first preset threshold, all environmental images captured by the vehicle-mounted camera within a preset delay step length after the current moment are obtained. Effective images are extracted from each of the environmental images, and all effective images between the statistical initial moment and the end moment of the preset step length are collected to obtain an intermediate effective image set, and the intermediate effective image set is used as the effective image set, and then step S53 is entered. By introducing a duration judgment method and a loop detection method, it is possible to accurately determine whether the electric bicycle is in a reverse state.

[0068] As a preferred embodiment, the "preset threshold" in step S4 is obtained through the following steps: S41, obtaining the real-time traffic flow of the lane where the electric bicycle is located at the current moment;

[0069] S42, determining the preset threshold according to a preset traffic threshold algorithm.

[0070] Preferably, the preset traffic threshold algorithm includes: the preset threshold is directly proportional to the real-time traffic flow.

[0071] It should be noted by those skilled in the art that the preset threshold in this embodiment is not a fixed value, but a value that can change according to the real-time road environment. It can be understood that when the traffic flow is larger, the number of the first type of vehicles and the number of the second type of vehicles captured by the vehicle-mounted camera will be larger, and the ratio of the first type of vehicles to the second type of vehicles will be larger. Therefore, the preset traffic threshold algorithm can be set such that the preset threshold is directly proportional to the real-time traffic flow. When the traffic flow is relatively small, in order to detect whether the electric bicycle is in a reverse state to the greatest extent, the preset threshold can be set a little smaller at this time. Further, the preset threshold can be set between 0.5 and 0.9.

[0072] In other embodiments, the preset threshold of the present application can also be set as a fixed value, and specifically, those skilled in the art can determine it according to actual needs.

[0073] Further, after step S4, the following steps are also included:

[0074] S6. Extract the image of the second type of reference vehicle from the valid image as an alarm image, and send the alarm image to a preset object. It can be understood that after step S5, the current state of the electric bicycle can be determined to be a reverse state. In this embodiment, by leveraging the reverse state of the electric bicycle, further reverse detection can be performed on the captured vehicle. It can be understood that when the electric bicycle is in a reverse state, the second type of reference vehicle (the vehicle with its tail facing the electric bicycle) in the valid image captured at this time travels in the same direction as the electric bicycle. Therefore, it can be determined that the second type of vehicle is also in a reverse state. The image of the second type of reference vehicle can be used as an alarm image and sent to a preset object. Among them, the preset object includes but is not limited to the traffic control department, the user corresponding to the electric bicycle, and the control background system corresponding to the electric bicycle.

[0075] The present invention also provides an electric bicycle, including a vehicle body, and further including an on-vehicle camera and a control system provided on the vehicle body. Among them, the on-vehicle camera is fixed on the vehicle body of the electric bicycle. The side vehicle capture mode is used to capture the environmental image including vehicles in the front area of the electric bicycle; that is, after a vehicle next to the electric bicycle enters the shooting area and a vehicle is recognized, image capture is performed. The on-vehicle camera is connected to the control system. The control system includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the electric bicycle reverse detection method as described above are implemented.

[0076] The present invention also provides a storage medium storing a computer program, and when the computer program is executed by a processor, the steps of the electric bicycle reverse detection method as described above are implemented.

[0077] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied to other related technical fields, shall be equally included in the patent protection scope of the present invention.

Claims

1. An electric bicycle reverse driving detection method, characterized in that, Including the steps: S1. Obtain the current operating state of the electric bicycle, and determine whether the electric bicycle is in a driving state according to the current operating state; S2. When the electric bicycle is in a driving state, control the in-vehicle camera to enter the side vehicle capturing mode; wherein, the in-vehicle camera is fixed on the vehicle body of the electric bicycle, and the side vehicle capturing mode is used to capture the environmental image containing vehicles in the front area of the electric bicycle; S3. Extract the effective image from the environmental image captured by the in-vehicle camera, and determine the number of first-type reference vehicles and the number of second-type reference vehicles according to the effective image; wherein, the first-type reference vehicle is the vehicle with the head facing the electric bicycle, and the second-type reference vehicle is the vehicle with the tail facing the electric bicycle; S4. Determine the ratio between the number of the first-type reference vehicles and the number of the second-type reference vehicles, and when the ratio is greater than the first preset threshold, determine that the electric bicycle is in a reverse state.

2. The electric bicycle reverse detection method according to claim 1, wherein The step S3 specifically includes the steps: S31. Judge whether there is a road edge line in the environmental image. When there is the road edge line in the environmental image, determine the electric bicycle and the road edge line closest to the electric bicycle as the target road edge line, and determine the lateral distance between the target road edge line and the electric bicycle; S32. When the lateral distance is less than the preset distance, obtain the one-way total width of the lane where the electric bicycle is located at the current moment; And obtain the historical position data set of the electric bicycle within the preset duration before the current moment, and determine the vector driving path of the electric bicycle at the current moment according to the historical position data set; S33. Divide the effective image into a first area close to the target road edge line and a second area far from the target road edge line with the vector driving path corresponding to the current moment as the center line; wherein, the lateral width of the first area is the lateral distance, and the lateral width of the second area is the difference between the one-way total width and the lateral distance; S34. Calibrate the weight of the first area as k0, and sequentially divide the second area into n sub-areas along the road lateral direction from near to far with the vector driving path corresponding to the current moment as the reference; wherein, the weight of the first sub-area is k1, the weight of the i-th area is ki, the weight of the n-th sub-area is kn, k1≥ki≥kn; 1≤i≤n, both i and n are positive integers; S35. Respectively determine the actual number of first-type reference vehicles and the actual number of second-type reference vehicles in each sub-area of the second area and in the first area; S36. Determine the weighted average number of reference vehicles of the first type and the weighted average number of reference vehicles of the second type in the effective image based on the number of reference vehicles of the first type, the number of reference vehicles of the second type, and the corresponding weights in each sub-region of the first region and the second region, and use the weighted average number of reference vehicles of the first type as the number of reference vehicles of the first type, and use the weighted average number of reference vehicles of the second type as the number of reference vehicles of the second type.

3. The electric bicycle reverse detection method according to claim 1, wherein, After the step S4, the following steps are further included: S51. When the ratio is less than or equal to the first preset threshold, use the current moment as the statistical initial moment to obtain all environmental images captured by the on-vehicle camera within a preset duration starting from the statistical initial moment; S52. Extract the effective images from each of the environmental images, and collect all the effective images within the preset duration to obtain an effective image set; S53. Determine the ratio of the number of reference vehicles of the first type to the number of reference vehicles of the second type in the effective image set, and determine whether the ratio is greater than the preset threshold; S54. When the ratio is greater than the first preset threshold, determine that the electric bicycle is in a reverse state and execute a preset alarm instruction; when the ratio is less than the second preset threshold, determine that the electric bicycle is in a normal driving state and maintain the current state of the electric bicycle; wherein, the second preset threshold is less than the first preset threshold; S55. When the ratio is less than or equal to the first preset threshold, obtain all environmental images captured by the on-vehicle camera within a preset delay step length after the current moment, extract the effective images from each of the environmental images, collect all the effective images between the statistical initial moment and the end moment of the preset step length to obtain an intermediate effective image set, and use the intermediate effective image set as the effective image set, and then enter step S53.

4. The electric bicycle reverse detection method according to claim 3, wherein, The preset threshold in the step S4 is obtained through the following steps: S41. Obtain the real-time traffic flow of the lane where the electric bicycle is located at the current moment; S42. Determine the preset threshold according to a preset traffic threshold algorithm.

5. The electric bicycle reverse detection method according to claim 4, wherein, The preset traffic threshold algorithm includes: the preset threshold is proportional to the real-time traffic flow.

6. The electric bicycle reverse detection method according to claim 1, wherein, After the step S4, the following steps are further included: S6. Extract the image of the reference vehicle of the second type from the effective image as an alarm image, and send the alarm image to a preset object.

7. The electric bicycle reverse detection method according to claim 2, characterized in that, The one-way total width in the step S32 is obtained through the following steps: Obtain the current position of the electric bicycle, and determine the one-way total width according to the current position.

8. An electric bicycle, comprising a vehicle body, characterized in that, It further includes a vehicle-mounted camera and a control system provided on the vehicle body. Among them, the vehicle-mounted camera is fixed on the vehicle body of the electric bicycle, and the side vehicle capture mode is used to capture the environmental image including vehicles in the front area of the electric bicycle; the vehicle-mounted camera is connected to the control system, and the control system includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it realizes the steps of the electric bicycle reverse driving detection method according to any one of claims 1 to 7.

9. A storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it realizes the steps of the electric bicycle reverse driving detection method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • An automatic law violation auditing method for vehicle converse driving based on deep learning.

    CN109948417A

  • Vehicle retrograde motion detection method and device, electronic equipment and storage medium

    CN111832376A