Adaptive cascade detection method and device, electronic equipment and storage medium
By cascading edge detectors with different parameter values, this paper solves the problem of guardrail detection under different weather and lighting conditions using computer vision. It also solves the detection problem of computer vision under different weather and lighting conditions, achieves adaptability, and addresses the problem of low detection efficiency of computer vision, thus improving the efficiency of adaptive detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- UISEE TECH BEIJING LTD
- Filing Date
- 2022-02-18
- Publication Date
- 2026-06-16
AI Technical Summary
Existing computer vision-based methods for detecting guardrail edges lack flexibility and adaptability under different weather and lighting conditions, resulting in low detection efficiency and requiring a large amount of manual intervention.
An adaptive cascaded detection method is adopted, which generates edge detectors that adapt to different weather and lighting conditions by cascading edge detectors with different parameter values, thereby reducing manual intervention and improving robustness and stability.
It improves the robustness and stability of guardrail edge detection, reduces manual intervention, and increases detection efficiency.
Smart Images

Figure CN116664607B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of autonomous driving technology, and in particular to an adaptive cascade detection method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the rise of autonomous vehicles, they are being widely used in parks, factories, airports, and other similar settings. For example, unmanned patrol vehicles are used to detect defects in guardrails in parks, factories, and airports.
[0003] A crucial step in guardrail defect detection is detecting the guardrail's edge regions, which then informs further defect detection. Currently, commonly used edge detection methods include computer vision-based methods. While computer vision-based methods offer good interpretability, they lack flexibility and adaptability. Furthermore, lighting conditions vary significantly throughout the day, especially during dawn and dusk, and weather conditions also change. Therefore, a single set of computer vision-based edge detection parameters cannot adequately adapt to different weather and lighting conditions for guardrail edge detection. In other words, using a single set of edge detection parameters cannot accurately detect guardrail edges under varying weather and / or lighting conditions.
[0004] Therefore, it is necessary to select matching edge detection parameters according to different weather and / or different lighting conditions to detect the edge of the guardrail. This process is usually done manually, which leads to a lot of manual intervention and low detection efficiency. Summary of the Invention
[0005] To address or at least partially address the aforementioned technical problems, this disclosure provides an adaptive cascade detection method, apparatus, electronic device, and storage medium. This reduces manual intervention during algorithm application, improves the robustness and stability of edge detection methods, and thereby enhances detection efficiency.
[0006] In a first aspect, embodiments of this disclosure provide an adaptive cascade detection method, the method comprising:
[0007] Acquire an image of the target object for a preset object;
[0008] The image of the target is input into a cascaded edge detector to obtain the edge density of the target; wherein, the number of cascaded edge detectors is at least two, the edge detection algorithms associated with different edge detectors are the same, and the parameter values of the edge detection algorithms associated with different edge detectors are different;
[0009] Determine whether the edge density reaches the edge density threshold;
[0010] If the edge density reaches the edge density threshold, the cascaded edge detector is exited, and the edge detection result is output.
[0011] Secondly, embodiments of this disclosure also provide an adaptive cascade detection device, the device comprising:
[0012] The acquisition module is used to acquire images of targets for preset objects;
[0013] The calculation module is used to input the image of the target into a cascaded edge detector to obtain the edge density of the target; wherein the number of cascaded edge detectors is at least two, the edge detection algorithms associated with different edge detectors are the same, and the parameter values of the edge detection algorithms associated with different edge detectors are different;
[0014] The determination module is used to determine whether the edge density reaches the edge density threshold;
[0015] The output module is used to exit the cascaded edge detector and output the edge detection result if the edge density reaches the edge density threshold.
[0016] Thirdly, embodiments of this disclosure also provide an electronic device, the electronic device comprising: one or more processors; a storage device for storing one or more programs; and when the one or more programs are executed by the one or more processors, causing the one or more processors to implement the adaptive cascaded detection method as described above.
[0017] Fourthly, embodiments of this disclosure also provide a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the adaptive cascade detection method as described above.
[0018] The adaptive cascaded detection method provided in this disclosure generates cascaded edge detectors by cascading edge detectors with different parameter values to solve the problem that a set of computer vision-based edge detection parameters cannot adapt well to guardrail edge detection under different weather and lighting conditions. Attached Figure Description
[0019] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0020] Figure 1 This is a flowchart of an adaptive cascade detection method in an embodiment of this disclosure;
[0021] Figure 2This is a flowchart of an adaptive cascade detection method in an embodiment of this disclosure;
[0022] Figure 3 This is a flowchart of an adaptive cascade detection method in an embodiment of this disclosure;
[0023] Figure 4 This is a schematic diagram of the structure of an adaptive cascade detector detection device according to an embodiment of this disclosure;
[0024] Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of this disclosure. Detailed Implementation
[0025] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0026] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0027] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0028] Currently, commonly used methods for detecting the edge areas of guardrails typically include computer vision-based methods. While computer vision-based methods offer good interpretability, they lack flexibility and adaptability. Furthermore, lighting conditions vary significantly throughout the day, especially during dawn and dusk, and weather conditions also change. Therefore, a single set of computer vision-based edge detection parameters cannot adequately adapt to different weather and lighting conditions for guardrail edge detection. In other words, using a single set of edge detection parameters cannot accurately detect guardrail edges under varying weather and / or lighting conditions.
[0029] To address the aforementioned problems, this disclosure provides an adaptive cascaded detection method to solve the issue that a single edge detector is insufficient to meet the edge detection requirements of guardrails in complex environments under various weather and lighting conditions. The method is described below with reference to specific embodiments. Figure 1This is a flowchart of an adaptive cascade detection method according to an embodiment of this disclosure. The method can be executed by an adaptive cascade detection device, which can be implemented in software and / or hardware, and can be configured in an electronic device, such as a server. Figure 1 As shown, the method may specifically include the following steps:
[0030] Step 110: Obtain the image of the target for the preset object.
[0031] In some embodiments, acquiring an image of a target for a preset object includes: acquiring an original image including the preset object based on vehicle-mounted sensors; preprocessing the original image of the preset object to obtain a preprocessed image; and inputting the preprocessed image into a pre-trained deep learning semantic segmentation model to obtain the image of the target for the preset object. Specifically, vehicle-mounted sensors include lidar, millimeter-wave radar, cameras, etc., and the original image of the preset object refers to image data of objects such as guardrails captured by the cameras of the autonomous vehicle. Here, the preset object is the guardrail, the target is the wire mesh, and the image of the target of the preset object is the image of the wire mesh of the guardrail. The autonomous vehicle can have multiple cameras installed at different locations on the vehicle body to simultaneously capture images of objects such as guardrails from different angles. For example, one camera can be installed on each of the left and right sides of the vehicle body to simultaneously capture images of the guardrails on both sides.
[0032] The original images of preset objects collected by the vehicle-mounted sensors are preprocessed to obtain preprocessed images. Specifically, the images of objects such as guardrails collected by the cameras of autonomous vehicles are preprocessed by adjusting the image format (e.g., converting color images to grayscale images), resizing, and regularizing, to generate preprocessed images.
[0033] The preprocessed image is input into a pre-trained deep learning semantic segmentation model to obtain the target image for the preset object. The specific process is as follows:
[0034] Regions of interest (ROIs) (i.e., targets, such as the wire mesh of a guardrail) in images acquired by vehicle-mounted sensors are manually labeled. A deep learning semantic network is designed and trained to perform semantic segmentation of ROIs, resulting in a deep learning semantic segmentation model. Irregular regions are segmented from the preprocessed image using this model, and the circumscribed quadrilateral of each irregular region is obtained. The area enclosed by this circumscribed quadrilateral is defined as the dynamic ROI. The image of the ROI is then used as the target image. The dynamic ROI is obtained by the deep learning semantic segmentation model, which dynamically changes based on the environment.
[0035] Step 120: Input the image of the target into a cascaded edge detector to obtain the edge density of the target; wherein, the number of cascaded edge detectors is at least two, the edge detection algorithms associated with different edge detectors are the same, and the parameter values of the edge detection algorithms associated with different edge detectors are different;
[0036] The edge density threshold is an empirical value, set according to needs, such as the number of light intensities collected in different scenarios, at different times and / or under different weather conditions, and the specific value is set to 0.3, 0.5, etc.
[0037] The target image is input into a cascaded edge detector to obtain a processed edge image. This edge image is then further processed to obtain the edge density. For example, the edge image can be represented in matrix form through coding, and then the edge pixels can be obtained by calculating the matrix-like edge image.
[0038] Here, edge density is the ratio of the number of edge pixels of the target detected in the image to the total number of pixels of the target.
[0039] Step 130: Determine whether the edge density reaches the edge density threshold; if the edge density reaches the edge density threshold, exit the cascaded edge detector and output the edge detection result. Specifically, if the edge density is determined to be greater than the edge density threshold, exit the cascaded edge detector and output that the edge detection was successful.
[0040] This disclosure provides an adaptive cascaded detection method. It obtains cascaded edge detectors by cascading at least two edge detectors, where different edge detectors are associated with the same edge detection algorithm, but with different parameter values for the edge detection algorithms. After obtaining an image of a target for a preset object, the target image is input to the cascaded edge detectors. The adapted edge detectors obtain the target's edge density based on the target image, and then determine whether the target image has been detected based on the edge density. This reduces manual intervention during algorithm application, improves the robustness and stability of the edge detection method, and thus increases detection efficiency.
[0041] Figure 2 This is a flowchart of another adaptive cascade detection method according to an embodiment of this disclosure. This embodiment further optimizes the adaptive cascade detection method based on the above embodiments, such as... Figure 2 As shown, the adaptive cascade detection method specifically includes the following steps:
[0042] Step 210: Obtain an image of the target object for the preset object;
[0043] Step 220: Input the image of the target into a cascaded edge detector to obtain the edge density of the target; wherein, the number of cascaded edge detectors is at least two, the edge detection algorithms associated with different edge detectors are the same, and the parameter values of the edge detection algorithms associated with different edge detectors are different;
[0044] Step 230: Determine whether the edge density reaches the edge density threshold;
[0045] Step 240: If the edge density reaches the edge density threshold, exit the cascaded edge detector and output the edge detection result.
[0046] Step 250: If the edge density does not reach the edge density threshold, determine whether the image of the target has traversed each edge detector in the cascaded edge detectors.
[0047] Step 260: Confirm, exit the cascaded edge detector and output a notification message indicating that it could not be detected.
[0048] Step 270: If not, return to step 210.
[0049] This disclosure provides an adaptive cascaded detection method that continuously cascades edge detectors by determining whether the edge density reaches the edge density threshold. This reduces the workload of manually adjusting edge detector parameters frequently based on environmental conditions and minimizes human intervention in the edge detector algorithm.
[0050] Figure 3 This is a flowchart of another adaptive cascade detection method according to an embodiment of this disclosure. This embodiment further optimizes the adaptive cascade detection method based on the above embodiments, such as... Figure 3 As shown, the adaptive cascade detection method specifically includes the following steps:
[0051] First, obtain the image of the target object for the preset object;
[0052] Next, the image of the target is input into the first edge detector in the cascaded edge detector to obtain the first edge density;
[0053] Correspondingly, determining whether the edge density reaches the edge density threshold includes:
[0054] Determine whether the first edge density reaches the edge density threshold;
[0055] Correspondingly, if the edge density reaches the edge density threshold, the cascaded edge detector is exited, and the edge detection result is output, including:
[0056] If the first edge density reaches the edge density threshold, then the first edge detector is exited, and the detection result of the first edge detector is output as the edge detection result.
[0057] In one embodiment, each edge detector is cascaded according to a preset rule based on a density detection threshold associated with each edge detector to obtain the cascaded edge detector; wherein the parameters of the edge detection algorithm associated with each edge detector include the density detection threshold.
[0058] Specifically, density detection thresholds are determined based on different light intensity data collected at different times and / or under different weather conditions. Then, edge detectors are cascaded according to these density detection thresholds, from highest to lowest, to generate a cascaded edge detector. The advantage of this setup is that after acquiring the target image, it is first input to the edge detector with the highest density detection threshold. If this edge detector cannot detect the target image, it is then input to the edge detector with the lowest density detection threshold. This adaptively finds a suitable edge detector for edge detection, ensuring both edge detection rate and accuracy. It is understandable that a higher density detection threshold makes it less likely to detect the edges of the target object.
[0059] The first edge detector is associated with a first density detection threshold and a second density detection threshold. The first density detection threshold is a first high density detection threshold; the second density detection threshold is a first low density detection threshold. Before obtaining the first edge density, the edge pixels must be obtained first.
[0060] Specifically, for a target pixel in the image of the target, if the gradient of the target pixel is greater than the first high-density detection threshold, then the target pixel is determined as an edge pixel.
[0061] If the gradient of the target pixel is determined to be less than the first low-density detection threshold, then the target pixel is determined to be a non-edge pixel.
[0062] If the gradient of a target pixel is less than the first high-density detection threshold but greater than the first low-density detection threshold, then the target pixel is determined to be an edge pixel based on a set rule. Specifically, determining whether a target pixel is an edge pixel based on the set rule means that if the target pixel is connected to a reference pixel whose gradient is greater than the first high-density detection threshold, then the target pixel is determined to be an edge pixel. After determining the edge pixels, the ratio of the number of edge pixels in the target image to the total number of pixels in the target image is calculated to obtain the first edge density. Here, the gradient is the first derivative taken in the desired direction (e.g., the x-direction and y-direction), which can be understood as the location of the largest change between adjacent pixels in the relevant direction.
[0063] In one embodiment, continue as follows Figure 3 As shown, if the first edge density does not reach the edge density threshold, the image of the target is input to the second edge detector in the cascaded edge detector to obtain the second edge density;
[0064] The first edge detector includes a first high-density detection threshold and a first low-density detection threshold, and the second edge detector includes a second high-density detection threshold and a second low-density detection threshold.
[0065] The second high-density detection threshold is less than the first high-density detection threshold;
[0066] Correspondingly, determining whether the edge density reaches the edge density threshold includes:
[0067] Determine whether the second edge density reaches the edge density threshold;
[0068] Correspondingly, if the edge density reaches the edge density threshold, the cascaded edge detector is exited, and the edge detection result is output, including:
[0069] If the second edge density reaches the edge density threshold, the second edge detector is exited, and the detection result of the second edge detector is output as the edge detection result.
[0070] Specifically, the edge detection algorithms associated with the edge detectors, such as the Canny algorithm, can have a first high-density detection threshold and a first low-density detection threshold set for the Canny algorithm associated with the first edge detector. Therefore, multiple Canny algorithms can be cascaded according to the density detection threshold from high to low, thus generating a cascaded edge detector. The cascaded edge detectors also include a second edge detector and a third edge detector. The second edge detector has a second density detection threshold, which includes a second high-density detection threshold and a second low-density detection threshold. The third edge detector has a third density detection threshold, which includes a third high-density detection threshold and a third low-density detection threshold. The high-density detection threshold and the low-density detection threshold are monotonically decreasing, but the low threshold of the first edge detector does not necessarily have to be larger than the high threshold of the second edge detector. For example, the first high-density detection threshold and the first low-density detection threshold are 200 and 100, respectively; the second high-density detection threshold and the second low-density detection threshold are 150 and 90, respectively; and the third high-density detection threshold and the third low-density detection threshold are 80 and 50, respectively. The high-density and low-density detection thresholds are cascaded into a list in descending order: high-density detection threshold [200, 150, 80] low-density detection threshold [100, 90, 50]. This cascading method sorts the edge detectors according to the density detection thresholds from high to low, generating a cascaded detector.
[0071] In this process, the target image is input into the detector with the highest density detection threshold in the cascade detector for edge detection. After the detector with the highest density detection threshold completes its detection, the edge density is obtained. Whether the edge density is greater than the edge density threshold is used to determine whether to proceed to the next detector. In this way, detectors with different density detection thresholds are cascaded together.
[0072] In another embodiment, such as Figure 3 As shown, if the second edge density does not reach the edge density threshold, the image of the target is input to the next edge detector cascaded with the second edge detector. This continues until it is determined that the edge density obtained by the last edge detector in the cascaded edge detector still does not reach the edge density threshold. Then, the cascaded edge detector is exited and a notification message indicating that the target cannot be detected is output.
[0073] This disclosure provides an adaptive cascaded detection method, which reduces the workload of frequently adjusting edge detector parameters based on environmental conditions, thus minimizing human intervention in the edge detector algorithm. Furthermore, combining the adaptive cascaded detection method with the edge detector's edge algorithm enhances the robustness and stability of the overall algorithm. For example, combining the adaptive cascaded detection method with an edge detection algorithm generates a cascaded edge detector, enhancing the algorithm's robustness to changes in lighting and weather, thereby improving the stability of the edge detection algorithm.
[0074] Figure 4 This is a schematic diagram of the structure of an adaptive cascaded detection device according to an embodiment of this disclosure. Figure 4 As shown: The device includes: an acquisition module 410, a calculation module 420, a judgment module 430, and an output module 440.
[0075] The acquisition module 410 is used to acquire an image of a target for a preset object;
[0076] The calculation module 420 is used to input the image of the target into a cascaded edge detector to obtain the edge density of the target; wherein, the number of cascaded edge detectors is at least two, the edge detection algorithms associated with different edge detectors are the same, and the parameter values of the edge detection algorithms associated with different edge detectors are different;
[0077] The judgment module 430 is used to determine whether the edge density reaches the edge density threshold.
[0078] The output module 440 is used to exit the cascaded edge detector and output the edge detection result if the edge density reaches the edge density threshold.
[0079] Optionally, the device further includes: cascading each edge detector according to a preset rule based on a density detection threshold associated with each edge detector to obtain the cascaded edge detector;
[0080] The parameters of the edge detection algorithm associated with the edge detector include the density detection threshold.
[0081] Optionally, the edge detectors can be cascaded in descending order of the density detection threshold.
[0082] Optionally, the density detection threshold and the edge density threshold are determined based on sample data, which is different light intensity data collected for the preset object at different times and / or under different weather conditions.
[0083] Optionally, the step of inputting the image of the target into a cascaded edge detector to obtain the edge density of the target includes:
[0084] The image of the target is input into the first edge detector in the cascaded edge detector to obtain the first edge density;
[0085] Correspondingly, determining whether the edge density reaches the edge density threshold includes:
[0086] Determine whether the first edge density reaches the edge density threshold;
[0087] Correspondingly, if the edge density reaches the edge density threshold, the cascaded edge detector is exited, and the edge detection result is output, including:
[0088] If the first edge density reaches the edge density threshold, then the first edge detector is exited, and the detection result of the first edge detector is output as the edge detection result.
[0089] Optionally, it further includes: if the first edge density does not reach the edge density threshold, then inputting the image of the target into the second edge detector in the cascaded edge detector to obtain the second edge density;
[0090] The second edge detector is cascaded with the first edge detector.
[0091] The first edge detector includes a first high-density detection threshold and a first low-density detection threshold, and the second edge detector includes a second high-density detection threshold and a second low-density detection threshold;
[0092] The second high-density detection threshold is less than the first high-density detection threshold.
[0093] Optionally, it further includes: if the second edge density does not reach the edge density threshold, then inputting the image of the target to the next edge detector cascaded with the second edge detector, until it is determined that the edge density obtained by the last edge detector in the cascaded edge detector still does not reach the edge density threshold, then exiting the cascaded edge detector and outputting a notification message that it cannot be detected.
[0094] Optionally, the first edge detector is associated with a first density detection threshold and a second density detection threshold;
[0095] The step of inputting the image of the target into the first edge detector in the cascaded edge detector to obtain the first edge density includes:
[0096] If the gradient of a target pixel in the image of the target is greater than the first density detection threshold, then the target pixel is determined to be an edge pixel.
[0097] If the gradient of the target pixel is less than the second density detection threshold, the target pixel is determined to be a non-edge pixel.
[0098] If the gradient of the target pixel is less than the first density detection threshold and greater than the second density detection threshold, then the target pixel is determined to be an edge pixel based on the set rules.
[0099] Optionally, determining whether the target pixel is an edge pixel based on a set rule includes:
[0100] If the target pixel is connected to a reference pixel whose gradient is greater than the first density detection threshold, then the target pixel is determined to be an edge pixel.
[0101] Optionally, the preset object includes a guardrail.
[0102] Optionally, acquiring the image of the target for the preset object includes:
[0103] Acquire the original image including the preset object based on the vehicle-mounted sensor;
[0104] The original image of the preset object is preprocessed to obtain a preprocessed image;
[0105] The preprocessed image is input into a pre-trained deep learning semantic segmentation model to obtain the image of the target for the preset object.
[0106] The adaptive cascade detection device provided in this disclosure can execute the steps in the adaptive cascade detection method provided in this disclosure, and has the execution steps and beneficial effects, which will not be repeated here.
[0107] Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of this disclosure. See below for details. Figure 5 It shows a schematic diagram of a structure suitable for implementing the electronic device 500 in the embodiments of this disclosure. Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0108] like Figure 5As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 501, which can perform various appropriate actions and processes to implement the methods of the embodiments described herein, based on a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the electronic device 500. The processing device 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0109] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts, thereby implementing the adaptive cascade detection method as described above. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, it performs the functions defined in the methods of embodiments of this disclosure.
[0110] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0111] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device. The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: acquire an image of a target for a preset object;
[0112] The image of the target is input into a cascaded edge detector to obtain the edge density of the target; wherein, the number of cascaded edge detectors is at least two, the edge detection algorithms associated with different edge detectors are the same, and the parameter values of the edge detection algorithms associated with different edge detectors are different;
[0113] Determine whether the edge density reaches the edge density threshold;
[0114] If the edge density reaches the edge density threshold, the cascaded edge detector is exited, and the edge detection result is output.
[0115] Alternatively, the aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: input an image of the target to a first edge detector in a cascaded edge detector array to obtain a first edge density; and, upon determining that the first edge density does not reach an edge density threshold, input the image of the target to a second edge detector in the cascaded edge detector array to obtain a second edge density.
[0116] If the second edge density does not reach the edge density threshold, the image of the target is input to the next edge detector cascaded with the second edge detector. This continues until it is determined that the edge density obtained by the last edge detector in the cascaded edge detectors still does not reach the edge density threshold. At this point, the cascaded edge detectors exit and output a notification message indicating that detection is not possible. Optionally, when one or more of the above procedures are executed by the electronic device, the electronic device may also execute other steps described in the above embodiments.
[0117] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0118] Solution 1: An adaptive cascade detection method, the method comprising:
[0119] Acquire an image of the target object for a preset object;
[0120] The image of the target is input into a cascaded edge detector to obtain the edge density of the target; wherein, the number of cascaded edge detectors is at least two, the edge detection algorithms associated with different edge detectors are the same, and the parameter values of the edge detection algorithms associated with different edge detectors are different;
[0121] Determine whether the edge density reaches the edge density threshold;
[0122] If the edge density reaches the edge density threshold, the cascaded edge detector is exited, and the edge detection result is output.
[0123] Option 2, the method described in Option 1, further includes:
[0124] According to preset rules, each edge detector is cascaded based on a density detection threshold associated with each edge detector to obtain the cascaded edge detector;
[0125] The parameters of the edge detection algorithm associated with the edge detector include the density detection threshold.
[0126] Solution 3: According to the method described in Solution 2, the step of cascading each edge detector according to a preset rule and a density detection threshold associated with each edge detector includes:
[0127] The edge detectors are cascaded in descending order of the density detection threshold.
[0128] Option 4: According to the method described in Option 2, the density detection threshold and the edge density threshold are determined based on sample data, which are different light intensity data collected for the preset object at different time periods and / or under different weather conditions.
[0129] Solution 5: According to the method described in Solution 1, the step of inputting the image of the target into a cascaded edge detector to obtain the edge density of the target includes:
[0130] The image of the target is input into the first edge detector in the cascaded edge detector to obtain the first edge density;
[0131] Correspondingly, determining whether the edge density reaches the edge density threshold includes:
[0132] Determine whether the first edge density reaches the edge density threshold;
[0133] Correspondingly, if the edge density reaches the edge density threshold, the cascaded edge detector is exited, and the edge detection result is output, including:
[0134] If the first edge density reaches the edge density threshold, then the first edge detector is exited, and the detection result of the first edge detector is output as the edge detection result.
[0135] Option 6, the method described in Option 5, further includes:
[0136] If the first edge density does not reach the edge density threshold, the image of the target is input to the second edge detector in the cascaded edge detector to obtain the second edge density;
[0137] The second edge detector is cascaded with the first edge detector.
[0138] The first edge detector includes a first high-density detection threshold and a first low-density detection threshold, and the second edge detector includes a second high-density detection threshold and a second low-density detection threshold;
[0139] The second high-density detection threshold is less than the first high-density detection threshold.
[0140] Option 7, the method described in Option 6, further includes:
[0141] If the second edge density does not reach the edge density threshold, the image of the target is input to the next edge detector cascaded with the second edge detector. This continues until it is determined that the edge density obtained by the last edge detector in the cascaded edge detector still does not reach the edge density threshold. Then, the cascaded edge detector is exited and a notification message indicating that the target cannot be detected is output.
[0142] Solution 8: According to the method described in Solution 5, the first edge detector is associated with a first density detection threshold and a second density detection threshold;
[0143] The step of inputting the image of the target into the first edge detector in the cascaded edge detector to obtain the first edge density includes:
[0144] If the gradient of a target pixel in the image of the target is greater than the first density detection threshold, then the target pixel is determined to be an edge pixel.
[0145] If the gradient of the target pixel is less than the second density detection threshold, the target pixel is determined to be a non-edge pixel.
[0146] If the gradient of the target pixel is less than the first density detection threshold and greater than the second density detection threshold, then the target pixel is determined to be an edge pixel based on the set rules.
[0147] Solution 9: According to the method described in Solution 8, the step of determining whether the target pixel is an edge pixel based on a set rule includes:
[0148] If the target pixel is connected to a reference pixel whose gradient is greater than the first density detection threshold, then the target pixel is determined to be an edge pixel.
[0149] Option 10: The method described according to any one of Options 1-9, wherein the preset object includes a guardrail.
[0150] Solution 11: The method described in any one of Solutions 1-9, wherein acquiring the image of the target for the preset object includes:
[0151] Acquire the original image including the preset object based on the vehicle-mounted sensor;
[0152] The original image of the preset object is preprocessed to obtain a preprocessed image;
[0153] The preprocessed image is input into a pre-trained deep learning semantic segmentation model to obtain the image of the target for the preset object.
[0154] Option 12: An adaptive cascaded detection device, comprising:
[0155] The acquisition module is used to acquire images of targets for preset objects;
[0156] The calculation module is used to input the image of the target into a cascaded edge detector to obtain the edge density of the target; wherein the number of cascaded edge detectors is at least two, the edge detection algorithms associated with different edge detectors are the same, and the parameter values of the edge detection algorithms associated with different edge detectors are different;
[0157] The determination module is used to determine whether the edge density reaches the edge density threshold;
[0158] The output module is used to exit the cascaded edge detector and output the edge detection result if the edge density reaches the edge density threshold.
[0159] Option 13: An electronic device, the electronic device comprising:
[0160] One or more processors;
[0161] Storage device for storing one or more programs;
[0162] When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of schemes 1-11.
[0163] Option 14: A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any one of Options 1-11.
[0164] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
Claims
1. An adaptive cascade detection method, characterized in that, The method includes: Acquire an image of the target object for a preset object; The image of the target is input into a cascaded edge detector to obtain the edge density of the target. The number of cascaded edge detectors is at least two. Different edge detectors are associated with the same edge detection algorithm, and the parameter values of the edge detection algorithms associated with different edge detectors are different. Each edge detector is associated with a corresponding high-density detection threshold and a low-density detection threshold. In any edge detector, if the gradient of a target pixel in the image of the target is greater than its high-density detection threshold, it is determined to be an edge pixel. If it is less than its low-density detection threshold, it is determined to be a non-edge pixel. If it is between the two, it is determined whether the target pixel is an edge pixel based on a set rule. The cascaded edge detectors are obtained by cascading each edge detector in descending order of high-density detection thresholds that are associated with each edge detector. The high-density detection thresholds and the low-density detection thresholds are determined based on different light intensity data collected at different times and / or under different weather conditions. Determine whether the edge density reaches the edge density threshold; If the edge density reaches the edge density threshold, the cascaded edge detector is exited, and the edge detection result is output.
2. The method according to claim 1, characterized in that, Also includes: According to preset rules, each edge detector is cascaded based on a density detection threshold associated with each edge detector to obtain the cascaded edge detector; The parameters of the edge detection algorithm associated with the edge detector include the density detection threshold.
3. The method according to claim 2, characterized in that, The step of cascading each edge detector according to a preset rule and based on a density detection threshold associated with each edge detector includes: The edge detectors are cascaded in descending order of the density detection threshold.
4. The method according to claim 2, characterized in that, The density detection threshold and the edge density threshold are determined based on sample data, which are different light intensity data collected for the preset object at different times and / or under different weather conditions.
5. The method according to claim 1, characterized in that, The step of inputting the image of the target into a cascaded edge detector to obtain the edge density of the target includes: The image of the target is input into the first edge detector in the cascaded edge detector to obtain the first edge density; Correspondingly, determining whether the edge density reaches the edge density threshold includes: Determine whether the first edge density reaches the edge density threshold; Correspondingly, if the edge density reaches the edge density threshold, the cascaded edge detector is exited, and the edge detection result is output, including: If the first edge density reaches the edge density threshold, then the first edge detector is exited, and the detection result of the first edge detector is output as the edge detection result.
6. The method according to claim 5, characterized in that, Also includes: If the first edge density does not reach the edge density threshold, the image of the target is input to the second edge detector in the cascaded edge detector to obtain the second edge density; The second edge detector is cascaded with the first edge detector. The first edge detector includes a first high-density detection threshold and a first low-density detection threshold, and the second edge detector includes a second high-density detection threshold and a second low-density detection threshold; The second high-density detection threshold is less than the first high-density detection threshold.
7. The method according to claim 6, characterized in that, Also includes: If the second edge density does not reach the edge density threshold, the image of the target is input to the next edge detector cascaded with the second edge detector. This continues until it is determined that the edge density obtained by the last edge detector in the cascaded edge detector still does not reach the edge density threshold. Then, the cascaded edge detector is exited and a notification message indicating that the target cannot be detected is output.
8. The method according to claim 5, characterized in that, The first edge detector is associated with a first density detection threshold and a second density detection threshold; The step of inputting the image of the target into the first edge detector in the cascaded edge detector to obtain the first edge density includes: If the gradient of a target pixel in the image of the target is greater than the first density detection threshold, then the target pixel is determined to be an edge pixel. If the gradient of the target pixel is less than the second density detection threshold, the target pixel is determined to be a non-edge pixel. If the gradient of the target pixel is less than the first density detection threshold and greater than the second density detection threshold, then the target pixel is determined to be an edge pixel based on the set rules.
9. The method according to claim 8, characterized in that, The step of determining whether the target pixel is an edge pixel based on a set rule includes: If the target pixel is connected to a reference pixel whose gradient is greater than the first density detection threshold, then the target pixel is determined to be an edge pixel.
10. The method according to any one of claims 1-9, characterized in that, The preset object includes a guardrail.
11. The method according to any one of claims 1-9, characterized in that, The step of acquiring an image of a target for a preset object includes: Acquire the original image including the preset object based on the vehicle-mounted sensor; The original image of the preset object is preprocessed to obtain a preprocessed image; The preprocessed image is input into a pre-trained deep learning semantic segmentation model to obtain the image of the target for the preset object.
12. An adaptive cascaded detection device, characterized in that, include: The acquisition module is used to acquire images of targets for preset objects; A calculation module is used to input the image of the target into a cascaded edge detector to obtain the edge density of the target. The cascaded edge detectors are at least two in number, and the edge detection algorithms associated with different edge detectors are the same, but the parameter values of the edge detection algorithms associated with different edge detectors are different. Each edge detector is associated with a corresponding high-density detection threshold and a low-density detection threshold. In any edge detector, if the gradient of a target pixel in the image of the target is greater than its high-density detection threshold, it is determined to be an edge pixel; if it is less than its low-density detection threshold, it is determined to be a non-edge pixel; if it is between the two, it is determined whether the target pixel is an edge pixel based on a set rule. The cascaded edge detectors are obtained by cascading each edge detector in descending order of high-density detection thresholds that are associated with each edge detector. The high-density detection thresholds and the low-density detection thresholds are determined based on different light intensity data collected at different times and / or under different weather conditions. The determination module is used to determine whether the edge density reaches the edge density threshold; The output module is used to exit the cascaded edge detector and output the edge detection result if the edge density reaches the edge density threshold.
13. An electronic device, characterized in that, The electronic device includes: One or more processors; Storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-11.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-11.