Electronic fence generation method, device and equipment of autonomous vehicle and medium

By acquiring and preprocessing map data, determining the maximum outline, and constructing electronic fences, the problem of time-consuming, labor-intensive, and inaccurate manual delineation of electronic fences is solved, thereby improving the safety and efficiency of autonomous vehicles.

CN119762517BActive Publication Date: 2026-01-27WOHANG TECH (NANJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411995733.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2026-01-27
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

In existing technologies, the generation of electronic fences relies on manual delineation of the area on a map, which is time-consuming, labor-intensive, and easily affected by the operator's subjective judgment and skill level, resulting in inaccurate boundary settings and human error.

Method used

By acquiring environmental map data, preprocessing it to obtain an initial map image, performing noise reduction and filling, determining the maximum contour of the target map image based on a pre-set algorithm, traversing the map data to determine the number of segments within the maximum contour, and constructing an electronic fence based on the number of contour segments.

Benefits of technology

It enables accurate delineation of electronic fences, improves the safety of autonomous driving, reduces the time and labor intensity of manual operation, and enhances the safety of autonomous driving.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119762517B_ABST
    Figure CN119762517B_ABST
Patent Text Reader

Abstract

The application provides an electronic fence generation method, device and equipment of an autonomous vehicle and a medium, relates to the technical field of electronic fences, and comprises the following steps: acquiring map data of an environment; preprocessing the map data to obtain an initial map image; denoising and filling the initial map image to obtain a target map image; determining the maximum contour of the target map image based on a pre-set algorithm; determining the number of segments of the contour within the maximum contour by traversing the map data; and constructing an electronic fence based on the number of segments of the contour. In this way, the electronic fence is accurately divided, time and labor are saved, and the safety of autonomous driving is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electronic fence technology, and in particular to a method, apparatus, device and medium for generating electronic fences for autonomous vehicles. Background Technology

[0002] The application of electronic fence technology in the field of autonomous vehicles mainly focuses on delineating key areas such as vehicle driving routes, parking lots, and work areas. Through preset electronic fences, the system can monitor the vehicle's location in real time, ensuring that the vehicle travels within the designated area. Once the vehicle exceeds the preset area, the system automatically issues an alarm, executes an emergency stop, or takes other safety measures to prevent potential safety risks.

[0003] Currently, the generation of electronic fences mainly relies on manual delineation of the area on a map. This method is not only time-consuming and labor-intensive, but also easily affected by the subjective judgment and skill level of the operators, resulting in inaccurate fence boundary settings and human error. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a method, apparatus, device and medium for generating electronic fences for autonomous vehicles, which reduces the loss generated by copper busbars by determining magnetic shielding.

[0005] In a first aspect, embodiments of the present invention provide a method for generating an electronic fence for an autonomous vehicle, comprising: acquiring map data of the environment; preprocessing the map data to obtain an initial map image; denoising and filling the initial map image to obtain a target map image; determining the maximum contour of the target map image based on a pre-set algorithm; traversing the map data to determine the number of segments of the contour within the maximum contour; and constructing an electronic fence based on the number of contour segments.

[0006] In a preferred embodiment of the present invention, the above-mentioned preprocessing of map data to obtain an initial map image includes: converting the map data into a matrix form to obtain a map data matrix; and binarizing the image intensity represented by the pixels in the map data matrix to obtain the initial map image.

[0007] In a preferred embodiment of the present invention, the above-mentioned denoising and filling of the initial map image to obtain the target map image includes: performing morphological operations and foreground region extraction on the initial map image to denoise the initial map image; performing image enhancement and hole filling on the initial map image to fill the initial map image; the denoised and filled initial map image is the target map image.

[0008] In a preferred embodiment of the present invention, the above-described morphological operations and foreground region extraction on the initial map image include: defining a first structural element; the first structural element defines the neighborhood shape and size of the morphological operation; by sliding the first structural element on the initial map image, the first structural element is positioned in the smallest region of the foreground region; if the first structural element contains non-foreground pixels, the pixels at the corresponding positions are set as background, so as to reduce the boundary of the foreground region and complete the noise reduction.

[0009] In a preferred embodiment of the present invention, the above-described image enhancement and hole filling of the initial map image to fill the initial map image includes: defining a second structural element; sliding the second structural element on the initial map image, and calculating the local maximum value within the area covered by the structural element at each location to achieve hole filling.

[0010] In a preferred embodiment of the present invention, the above-mentioned construction of an electronic fence based on the number of segments of a contour includes: determining the size relationship between the number of segments of the current contour and the number of segments of the previous contour; if the size relationship is that the number of segments of the current contour is greater than the number of segments of the previous contour, then two new regions are generated; if the size relationship is that the number of segments of the current contour is less than the number of segments of the previous contour, then a new region is generated; and an electronic fence is constructed through the new region.

[0011] In a preferred embodiment of the present invention, traversing map data to determine the number of segments of the contour within the maximum contour includes: traversing the map data sequentially from top to bottom and from left to right; and determining the number of segments of the contour within each column of the maximum contour.

[0012] Secondly, embodiments of the present invention also provide an electronic fence generation device for autonomous vehicles, comprising: a map data acquisition module for acquiring map data of the environment; a map data preprocessing module for preprocessing the map data to obtain an initial map image; a denoising and filling module for denoising and filling the initial map image to obtain a target map image; a maximum contour determination module for determining the maximum contour of the target map image based on a pre-set algorithm; a map data traversal module for traversing the map data to determine the number of segments of the contour within the maximum contour; and an electronic fence construction module for constructing an electronic fence based on the number of segments of the contour.

[0013] Thirdly, embodiments of the present invention also provide an electronic device, including a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the electronic fence generation method for autonomous vehicles described in the first aspect.

[0014] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are invoked and executed by a processor, the computer-executable instructions cause the processor to implement the electronic fence generation method for autonomous vehicles described in the first aspect.

[0015] The embodiments of the present invention bring the following beneficial effects:

[0016] This invention provides a method, apparatus, device, and medium for generating electronic fences for autonomous vehicles. The method involves: acquiring environmental map data; preprocessing the map data to obtain an initial map image; denoising and filling the initial map image to obtain a target map image; determining the maximum contour of the target map image based on a pre-set algorithm; traversing the map data to determine the number of segments within the maximum contour; and constructing an electronic fence based on the number of contour segments. This method accurately divides the electronic fence, saving time and effort, and improving the safety of autonomous driving.

[0017] Other features and advantages of this disclosure will be set forth in the following description, or some features and advantages may be inferred from the description or determined without doubt, or may be learned by practicing the techniques described above.

[0018] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0019] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0020] Figure 1 A flowchart illustrating a method for generating an electronic fence for an autonomous vehicle, as provided in an embodiment of the present invention;

[0021] Figure 2 A flowchart of another method for generating an electronic fence for an autonomous vehicle provided in an embodiment of the present invention;

[0022] Figure 3 A schematic diagram of the structure of an electronic fence generation device for an autonomous vehicle provided in an embodiment of the present invention;

[0023] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0025] The application of electronic fence technology in the field of autonomous vehicles mainly focuses on delineating key areas such as vehicle driving routes, parking lots, and work areas. Through preset electronic fences, the system can monitor the vehicle's location in real time, ensuring that the vehicle travels within the designated area. Once the vehicle exceeds the preset area, the system automatically issues an alarm, executes an emergency stop, or takes other safety measures to prevent potential safety risks.

[0026] Currently, the generation of electronic fences mainly relies on manual delineation of the area on a map. This method is not only time-consuming and labor-intensive, but also easily affected by the subjective judgment and skill level of the operators, resulting in inaccurate fence boundary settings and human error.

[0027] Based on this, the present invention provides a method, apparatus, device, and medium for generating electronic fences for autonomous vehicles. This method involves: acquiring environmental map data; preprocessing the map data to obtain an initial map image; denoising and filling the initial map image to obtain a target map image; determining the maximum contour of the target map image based on a pre-set algorithm; traversing the map data to determine the number of segments within the maximum contour; and constructing an electronic fence based on the number of contour segments. This approach accurately divides the electronic fence, saving time and effort and improving the safety of autonomous driving.

[0028] To facilitate understanding of this embodiment, a method for generating electronic fences for autonomous vehicles disclosed in this embodiment of the invention will first be described in detail.

[0029] Example 1

[0030] This invention provides a method for generating electronic fences for autonomous vehicles. Figure 1 This is a flowchart illustrating a method for generating an electronic fence for an autonomous vehicle, as provided in an embodiment of the present invention. Figure 1 As shown, the method for generating an electronic fence for an autonomous vehicle may include the following steps:

[0031] Step S101: Obtain environmental map data.

[0032] Among them, environmental map data is obtained through various sensors (such as cameras, radar, etc.).

[0033] Step S102: Preprocess the map data to obtain the initial map image.

[0034] Specifically, preprocessing map data to obtain an initial map image may include: converting the map data into a matrix form to obtain a map data matrix; and binarizing the image intensity represented by the pixels in the map data matrix to obtain the initial map image.

[0035] Each pixel represents the image intensity at that location.

[0036] Specifically, the map data matrix I obtained from the sensor, where each pixel I(x,y) represents the image intensity at that location, is binarized:

[0037] Step S103: Denoise and fill in the initial map image to obtain the target map image.

[0038] One method to achieve noise reduction is to shrink the boundaries of foreground objects to remove small objects or noise points in the image.

[0039] One method is to expand the bright areas outwards and connect them with the surrounding darker areas, thereby enhancing the bright parts of the image and filling in small holes or gaps.

[0040] Step S104: Determine the maximum outline of the target map image based on a pre-set algorithm.

[0041] This process utilizes edge detection algorithms to find edges in the image. Based on the edge information, the starting point of the contour is located, and the entire contour is traversed according to certain rules (clockwise or counterclockwise). Points on the contour are stored, and adjacent contour points are connected to form a complete contour. The found contours are stored in a data structure, along with their hierarchical information to facilitate understanding the relationships between them. Contours are sorted by size, the largest contour is found, and all contours within that largest contour are located based on the stored hierarchical relationships.

[0042] Specifically, using an edge detection algorithm, the edges E in the image are found, where E(x,y) = Edge(I). dilated (x,y)). Find all contours {C} using the edge image E. i} and its hierarchical relationship H i : findContours(E)→({C i},{H i}); Sort the contours according to their area and find the largest contour: C max =max(area(C i Find all sub-contours within the larger contour based on the hierarchical relationship.

[0043] Step S105: Traverse the map data to determine the number of segments within the maximum contour.

[0044] Specifically, traversing the map data to determine the number of segments of the contour within the maximum contour can include: traversing the map data sequentially from top to bottom and from left to right; and determining the number of segments of the contour within each column of the maximum contour.

[0045] Step S106: Construct an electronic fence based on the number of segments of the contour.

[0046] Specifically, constructing an electronic fence based on the number of segments of a contour can include: determining the relationship between the number of segments of the current contour and the number of segments of the previous contour; if the relationship is that the number of segments of the current contour is greater than the number of segments of the previous contour, then two new regions are generated; if the relationship is that the number of segments of the current contour is less than the number of segments of the previous contour, then a new region is generated; and an electronic fence is constructed using the new region.

[0047] In this process, the map data I is traversed, and the number of segments n(x) of each column divided by the contour within the maximum contour is calculated. Based on the number of segments in the two columns before and after, the corresponding logic is triggered. If the current number of segments is more than the previous number of segments, the current area is closed and two new areas are generated. If the current number of segments is less than the previous number of segments, both areas are closed and a new area is generated. Furthermore, an electronic fence composed of multiple areas can be obtained.

[0048] Furthermore, the vehicle is precisely modeled to generate overlay grid templates. By rotating the vehicle around its origin at equal intervals, overlay grid templates are generated in various directions. Each template simulates the vehicle's spatial occupancy under different orientations and postures. These templates are used for subsequent collision detection and boundary violation assessment to ensure safe vehicle operation in complex environments.

[0049] Specifically, a vehicle overlay grid template T is created and rotated at equal intervals from 0° to 360° around the vehicle origin to obtain overlay grid templates {T} in each direction. θ θ∈[0,360]}, T θ = rotate(T, θ).

[0050] Furthermore, by acquiring its own pose in real time through sensors, and using the created vehicle collision detection template, the system overlays its own real-time pose and, through a multi-level detection mechanism, sets different safe distance thresholds. In addition to determining whether the vehicle has crossed the boundary, it adds a warning function for the vehicle approaching the fence boundary. When the vehicle approaches the fence boundary, a warning signal is issued, prompting the autonomous driving system to take measures such as deceleration to avoid the occurrence of boundary crossing. This function ensures that the vehicle takes appropriate safety measures when approaching the electronic fence, thereby improving driving safety.

[0051] The system acquires the real-time pose information of the autonomous vehicle through sensors and overlays the current real-time pose data using a pre-created vehicle collision detection template. It employs a multi-level detection mechanism with different safety distance thresholds to achieve accurate boundary violation judgment and warning functions. When the vehicle approaches the electronic fence boundary, the system triggers corresponding warning and control measures based on the following thresholds: When the vehicle is less than twice the safe distance (set to 1.2 times the vehicle length) from the electronic fence, the system issues a warning signal to alert the autonomous driving system to potential danger. When the vehicle is less than 1.5 times the safe distance, the system instructs the autonomous driving system to decelerate to reduce the potential collision risk. When the vehicle is less than the safe distance from the electronic fence, the system immediately triggers an emergency stop to ensure the vehicle does not cross the set electronic fence boundary.

[0052] The electronic fence generation method for autonomous vehicles provided in this invention involves: acquiring environmental map data; preprocessing the map data to obtain an initial map image; denoising and filling the initial map image to obtain a target map image; determining the maximum contour of the target map image based on a pre-set algorithm; traversing the map data to determine the number of segments within the maximum contour; and constructing an electronic fence based on the number of contour segments. This method accurately divides the electronic fence, saving time and effort, and improving the safety of autonomous driving.

[0053] Example 2

[0054] This invention also provides another method for generating electronic fences for autonomous vehicles; this method is implemented based on the method described in the above embodiments; the method focuses on describing the specific implementation of denoising and filling in the initial map image to obtain the target map image.

[0055] Figure 2 A flowchart of another method for generating electronic fences for autonomous vehicles provided in an embodiment of the present invention is shown below. Figure 2 As shown, the process of denoising and filling in the initial map image to obtain the target map image may include the following steps:

[0056] Step S201: Perform morphological operations and foreground region extraction on the initial map image to denoise the initial map image.

[0057] Specifically, morphological operations and foreground region extraction are performed on the initial map image, including: defining a first structuring element; the first structuring element defines the neighborhood shape and size of the morphological operation; the first structuring element is slid across the initial map image to locate the first structuring element in the smallest region of the foreground; if the first structuring element contains non-foreground pixels, the corresponding pixels are set as background to reduce the boundary of the foreground region and complete the noise reduction.

[0058] The process involves defining a first structuring element that defines the neighborhood shape and size for morphological operations such as erosion and dilation. This is achieved by sliding the structuring element across the image, preserving the smallest area within the foreground region (typically white or highlighted). If any pixel under the structuring element is not a foreground pixel, that pixel is set to the background (typically black or low brightness). This process narrows the boundaries of foreground objects, effectively removing small objects or noise points from the image.

[0059] Wherein, the first structural element S is defined. erosion Morphological erosion is performed by sliding structuring elements across the image.

[0060] Among them, S erosion For a circle with a diameter of 8, the min operation preserves the minimum value where the structuring element is completely located in the foreground region (white area).

[0061] Step S202: Image enhancement and hole filling are performed on the initial map image to fill in the holes.

[0062] Specifically, image enhancement and hole filling are performed on the initial map image to fill the hole, including: defining a second structuring element; sliding the second structuring element on the initial map image and calculating the local maximum value within the area covered by the structuring element at each location to achieve hole filling.

[0063] Here, another structural element S is defined. dilation Based on step two, morphological dilation is performed by sliding structuring elements across the image:

[0064] Among them, S dilation Given a circle with a diameter of 5, the max operation calculates the local maximum value within the area covered by the structuring element.

[0065] Step S203: The initial map image after denoising and filling is the target map image.

[0066] Example 3

[0067] Corresponding to the above method embodiments, this invention provides an electronic fence generation device for autonomous vehicles. Figure 3 This is a schematic diagram of the structure of an electronic fence generation device for an autonomous vehicle provided in an embodiment of the present invention, as shown below. Figure 3 As shown, the electronic fence generation device for the autonomous vehicle may include:

[0068] The map data acquisition module 301 is used to acquire map data of the environment.

[0069] The map data preprocessing module 302 is used to preprocess map data to obtain an initial map image.

[0070] The denoising and filling module 303 is used to denoise and fill the initial map image to obtain the target map image.

[0071] The maximum contour determination module 304 is used to determine the maximum contour of the target map image based on a pre-set algorithm.

[0072] The map data traversal module 305 is used to traverse map data to determine the number of segments within the maximum contour.

[0073] Electronic fence construction module 306 is used to construct electronic fences based on the number of segments of the outline.

[0074] The electronic fence generation device for autonomous vehicles provided in this invention can obtain environmental map data; preprocess the map data to obtain an initial map image; denoise and fill in the initial map image to obtain a target map image; determine the maximum contour of the target map image based on a pre-set algorithm; traverse the map data to determine the number of segments within the maximum contour; and construct an electronic fence based on the number of contour segments. This method accurately divides the electronic fence, saving time and effort, and improving the safety of autonomous driving.

[0075] In some embodiments, the map data preprocessing module is further configured to convert the map data into a matrix form to obtain a map data matrix; and to binarize the image intensity represented by the pixels in the map data matrix to obtain an initial map image.

[0076] In some embodiments, the denoising and filling module is further configured to perform morphological operations and foreground region extraction on the initial map image to denoise the initial map image; perform image enhancement and hole filling on the initial map image to fill the initial map image; the denoised and filled initial map image is the target map image.

[0077] In some embodiments, the denoising and filling module is further configured to define a first structural element; the first structural element defines the neighborhood shape and size of the morphological operation; by sliding the first structural element on the initial map image, the first structural element is positioned in the smallest region of the foreground region; if the first structural element contains non-foreground pixels, the pixels at the corresponding positions are set as background, so as to reduce the boundary of the foreground region to complete the denoising.

[0078] In some embodiments, the denoising and filling module is further configured to define a second structural element; slide the second structural element on the initial map image and calculate the local maximum value within the area covered by the structural element at each location to achieve hole filling.

[0079] In some embodiments, the electronic fence construction module is further configured to determine the size relationship between the number of segments of the current contour and the number of segments of the previous contour; if the size relationship is that the number of segments of the current contour is greater than the number of segments of the previous contour, then two new regions are generated; if the size relationship is that the number of segments of the current contour is less than the number of segments of the previous contour, then a new region is generated; and an electronic fence is constructed through the new region.

[0080] In some embodiments, the map data traversal module is further configured to traverse the map data sequentially from top to bottom and from left to right; and determine the number of segments of the contour within the maximum contour of each column.

[0081] The device provided in this embodiment of the invention has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.

[0082] Example 4

[0083] This invention also provides an electronic device for running the above-described method for generating electronic fences for autonomous vehicles; see also Figure 4 The diagram shows the structure of an electronic device, which includes a memory 400 and a processor 401. The memory 400 stores one or more computer instructions, which are executed by the processor 401 to implement the above-mentioned method for generating electronic fences for autonomous vehicles.

[0084] Furthermore, Figure 4 The electronic device shown also includes a bus 402 and a communication interface 403. The processor 401, the communication interface 403 and the memory 400 are connected via the bus 402.

[0085] The memory 400 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 403 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network. The bus 402 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0086] Processor 401 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 401 or by instructions in software form. Processor 401 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 400, and processor 401 reads information from memory 400 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.

[0087] This invention also provides a computer-readable storage medium storing computer-executable instructions. When these computer-executable instructions are called and executed by a processor, they cause the processor to implement the above-described method for generating electronic fences for autonomous vehicles. For specific implementation details, please refer to the method embodiments, which will not be repeated here.

[0088] The computer program product for generating electronic fences for autonomous vehicles provided in this embodiment of the invention includes a computer-readable storage medium storing non-volatile program code executable by a processor. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation details, please refer to the method embodiments, which will not be repeated here.

[0089] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0090] In the several embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0091] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0092] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0093] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0094] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for generating an electronic fence for an autonomous vehicle, characterized in that, The method includes: Obtain environmental map data; The map data is preprocessed to obtain an initial map image; The initial map image is denoised and filled to obtain the target map image; The maximum outline of the target map image is determined based on a pre-set algorithm; The number of segments within the maximum contour is determined by traversing the map data. An electronic fence is constructed based on the number of segments of the described contour; The specific steps for determining the maximum contour of the target map image based on a pre-set algorithm are as follows: Using edge detection algorithms, edges in the image are found. Based on the edge information, the starting point of the contour is found, and the entire contour is traversed according to certain rules. The points on the contour are stored, and adjacent contour points are connected to form a complete contour. The found contours are stored in a data structure, and the hierarchical information of the contours is also stored to facilitate understanding the relationship between contours. The contours are sorted according to their size, the largest contour is found, and all contours within the largest contour are found according to the stored hierarchical relationship. The construction of the electronic fence based on the number of segments of the contour includes: Determine the relationship between the number of segments in the current contour and the number of segments in the previous contour; If the size relationship is such that the number of segments in the current contour is greater than the number of segments in the previous contour, then two new regions are generated; If the size relationship is such that the number of segments in the current contour is less than the number of segments in the previous contour, then a new region is generated; An electronic fence will be constructed in the new area.

2. The method according to claim 1, characterized in that, The step of preprocessing the map data to obtain an initial map image includes: The map data is converted into a matrix form to obtain a map data matrix; The image intensity represented by the pixels in the map data matrix is ​​binarized to obtain the initial map image.

3. The method according to claim 2, characterized in that, The process of denoising and filling in the initial map image to obtain the target map image includes: Morphological operations and foreground region extraction are performed on the initial map image to denoise it. Image enhancement and hole filling are performed on the initial map image to fill in the holes. The initial map image after denoising and padding is the target map image.

4. The method according to claim 3, characterized in that, The morphological operations and foreground region extraction performed on the initial map image include: Define the first structuring element; the first structuring element defines the neighborhood shape and size of the morphological operation; By sliding the first structural element on the initial map image, the first structural element is positioned in the smallest area of ​​the foreground region; If the first structuring element contains non-foreground pixels, then the pixels at the corresponding positions are set as background pixels to reduce the boundary of the foreground region and complete the noise reduction.

5. The method according to claim 3, characterized in that, The step of performing image enhancement and hole filling on the initial map image to fill in the holes includes: Define the second structural element; The second structuring element is slid across the initial map image, and the local maximum value within the area covered by the structuring element is calculated at each location to fill the voids.

6. The method according to claim 1, characterized in that, Determining the number of segments within the maximum contour by traversing the map data includes: Traverse the map data sequentially from top to bottom and from left to right; Determine the number of segments of the contour within the maximum contour of each column.

7. An electronic fence generation device for autonomous vehicles, characterized in that, The apparatus for implementing the electronic fence generation method for an autonomous vehicle according to any one of claims 1 to 6, the apparatus comprising: The map data acquisition module is used to acquire map data of the environment; The map data preprocessing module is used to preprocess the map data to obtain an initial map image; A denoising and filling module is used to denoise and fill the initial map image to obtain a target map image; The maximum contour determination module is used to determine the maximum contour of the target map image based on a pre-set algorithm. The map data traversal module is used to traverse the map data to determine the number of segments of the contour within the maximum contour; An electronic fence construction module is used to construct an electronic fence based on the number of segments of the outline.

8. An electronic device, characterized in that, The device includes a processor and a memory, the memory storing computer-executable instructions that can be executed by the processor, the processor executing the computer-executable instructions to implement the electronic fence generation method for an autonomous vehicle according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the electronic fence generation method for an autonomous vehicle according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Map fence generation method and device, equipment and storage medium

    CN114443797A

  • Vehicle early warning method and device of electronic fence, electronic equipment and storage medium

    CN115311840A