A method and device for identifying a warning zone, an electronic device and a storage medium

By preprocessing and contour filtering images for different types of warning tapes, and combining pixel count judgment, the accuracy problem of warning tape recognition in complex backgrounds was solved, and accurate identification of warning tape types was achieved.

CN117541811BActive Publication Date: 2026-06-23BEIJING ELITENECT TECHNOLOGIES CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING ELITENECT TECHNOLOGIES CO LTD
Filing Date
2023-11-21
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively identify warning tape in complex environments, particularly failing to distinguish it from slender poles or lane markings, thus affecting recognition accuracy.

Method used

By preprocessing the image of the region to be identified with yellow-white and red warning bands respectively, and combining pixel difference calculation, image edge detection and HSV color model, the contours that meet the characteristics of the warning bands are extracted and screened out, and the warning band type is determined by the number of pixels of the target color.

Benefits of technology

It improves the effectiveness and accuracy of warning tape contour extraction in complex environments, and can effectively distinguish different types of warning tape.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117541811B_ABST
    Figure CN117541811B_ABST
Patent Text Reader

Abstract

The application provides a warning zone identification method and device, electronic equipment and storage medium. The identification method comprises: performing yellow and white warning zone image preprocessing on a to-be-identified region image to determine a processed first image, and performing red warning zone image preprocessing on the to-be-identified region image to determine a processed second image; performing object contour extraction on the first image and the second image to determine a first object contour of the first image and a second object contour of the second image; performing preliminary contour screening processing and contour shape calculation processing on the first object contour and the second object contour to determine a candidate contour; wherein the candidate contour is a contour that meets the warning zone characteristics in the first object contour and the second object contour; and based on the number of pixel points of a target color in the candidate contour, the warning zone in the to-be-identified region image and the type of the warning zone are determined, thereby improving the accuracy of warning zone identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of security technology, and in particular to a method, device, electronic device and storage medium for identifying warning tape. Background Technology

[0002] With the rapid development of mobile robot technology, robots are increasingly being used in complex environments, requiring obstacle avoidance for various types of obstacles. In industrial inspection robot environments, temporary construction work and equipment maintenance are common, often requiring the use of warning tape to isolate areas. For robots, the ability to effectively identify these warning tapes along their inspection paths directly impacts the safety of the robot and on-site equipment or personnel, potentially leading to accidents. Current warning tape recognition methods primarily rely on image processing to extract object contours and then determine whether an object qualifies as a warning tape based on its shape. This method suffers from two main drawbacks: first, it struggles to effectively extract warning tape contours from complex backgrounds; second, it cannot distinguish between objects with similar contours, such as warning tape, long, thin rods, or lane markings on the ground, affecting the accuracy of warning tape recognition. Therefore, improving the accuracy of warning tape recognition has become a significant technical challenge. Summary of the Invention

[0003] In view of this, the purpose of this application is to provide a method, device, electronic device and storage medium for identifying warning tape. By performing different image processing on different types of warning tape, the influence of complex environmental background can be eliminated to a certain extent, the effectiveness of warning tape contour extraction can be improved, and the number of target color pixels in the contour can be used to determine the warning tape and the type of warning tape, thereby improving the accuracy of warning tape identification.

[0004] This application provides a method for identifying warning tape, the method comprising:

[0005] The image of the region to be identified is preprocessed with a yellow-white warning tape to determine the first image after processing, and the image of the region to be identified is preprocessed with a red warning tape to determine the second image after processing.

[0006] Object contours are extracted from the first image and the second image to determine the first object contour of the first image and the second object contour of the second image.

[0007] The first object contour and the second object contour are subjected to preliminary contour screening and contour shape calculation to determine candidate contours; wherein, the candidate contours are the contours of the first object contour and the second object contour that conform to the characteristics of a warning tape.

[0008] Based on the number of target color pixels in the candidate contour, the warning strip and its type in the image of the region to be identified are determined.

[0009] In one possible implementation, the step of performing yellow-white warning tape image preprocessing on the image of the region to be identified to determine the processed first image includes:

[0010] The image of the region to be identified is subjected to image grayscale conversion to determine a grayscale image, and the grayscale image is subjected to median filtering to determine a median filtered image;

[0011] Pixel difference calculation is performed based on the grayscale image and the median filtered image to determine the pixel difference image;

[0012] The pixel difference image is subjected to image binarization processing to determine the binarized image;

[0013] The binarized image is sequentially subjected to opening, closing, and edge detection to determine the first image.

[0014] In one possible implementation, the step of performing red alert tape image preprocessing on the image of the region to be identified to determine the processed second image includes:

[0015] The image of the region to be identified is converted based on the HSV color model to determine the HSV image;

[0016] The HSV image is separated into pixels across multiple channels. Red pixels are selected from the pixels across multiple channels, and non-red pixels are set to black to determine the red pixel image.

[0017] The second image is determined by sequentially performing opening, closing, and edge detection operations on the red pixel image.

[0018] In one possible implementation, the preliminary contour screening and contour shape calculation processing of the first object contour and the second object contour to determine candidate contours includes:

[0019] Based on the contour perimeter, contour area and contour length-width ratio, the contour of the first object and the contour of the second object are initially screened to determine the first object contour and the second object contour after screening.

[0020] Based on the first object contour after filtering, the second object contour after filtering, and the preset warning tape contour, the contour shape calculation process is performed to determine the score value of the first object contour after filtering and the score value of the second object contour after filtering.

[0021] The candidate contour is determined from the filtered first object contour and the filtered second object contour based on the score value.

[0022] In one possible implementation, the score value of the filtered first object contour is determined through the following steps:

[0023] If the width of the first object contour after filtering is greater than the first preset contour width threshold, then the first object contour after filtering is divided into multiple sub-contours according to the second preset contour width.

[0024] Determine the number of sub-contours whose width is less than the first preset contour width threshold among multiple sub-contours;

[0025] The score of the first object contour after filtering is determined based on the total number of sub-contours, the number of sub-contours, and the standard score corresponding to the first object contour after filtering.

[0026] In one possible implementation, the score value of the filtered first object contour is determined through the following steps:

[0027] Set the corresponding standard scoring table based on the length information of the preset warning tape outline;

[0028] If the width of the first object contour after filtering is less than or equal to a first preset contour width threshold, then the score of the first object contour after filtering is determined based on the length information of the first object contour after filtering and the standard score value.

[0029] In one possible implementation, determining the warning strip and its type in the image of the region to be identified based on the number of pixels of the target color in the candidate contour includes:

[0030] The number of yellow pixels, white pixels, and red pixels in the candidate contour are determined.

[0031] Based on the number of yellow pixels, the number of white pixels, the number of red pixels, and the range of preset pixel counts, the warning tape and its type in the image to be identified are determined; wherein, the types of warning tape include red warning tape and yellow-white warning tape.

[0032] This application embodiment also provides a warning tape identification device, the identification device comprising:

[0033] The image processing module is used to perform yellow-white warning tape image preprocessing on the image of the region to be identified to determine the first image after processing, and to perform red warning tape image preprocessing on the image of the region to be identified to determine the second image after processing.

[0034] The contour extraction module is used to extract object contours from the first image and the second image, and determine the first object contour of the first image and the second object contour of the second image.

[0035] The contour filtering module is used to perform preliminary contour filtering and contour shape calculation on the contours of the first object and the second object to determine candidate contours; wherein, the candidate contours are the contours of the first object and the second object that conform to the characteristics of a warning tape.

[0036] The type determination module is used to determine the warning band and its type in the image of the region to be identified based on the number of target color pixels in the candidate contour.

[0037] This application embodiment also provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the warning tape identification method described above are performed.

[0038] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the warning tape identification method described above.

[0039] This application provides a method, apparatus, electronic device, and storage medium for identifying warning tape. The identification method includes: performing preprocessing on an image of a region to be identified (yellowish-white warning tape image) to determine a first image; and performing preprocessing on the image of the region to be identified (red warning tape image) to determine a second image; extracting object contours from the first and second images to determine a first object contour in the first image and a second object contour in the second image; performing preliminary contour screening and contour shape calculation on the first and second object contours to determine candidate contours; wherein the candidate contours are contours from the first and second object contours that conform to the characteristics of a warning tape; and determining the warning tape and its type in the image of the region to be identified based on the number of pixels of the target color in the candidate contours. By performing different image processing on different types of warning tapes, the influence of complex environmental backgrounds can be eliminated to a certain extent, improving the effectiveness of warning tape contour extraction. Determining the warning tape and its type by the number of pixels of the target color in the contour improves the accuracy of warning tape identification.

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

[0041] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0042] Figure 1 A flowchart illustrating a method for identifying a warning tape provided in an embodiment of this application;

[0043] Figure 2 A schematic diagram illustrating a method for identifying a warning tape provided in an embodiment of this application;

[0044] Figure 3 A schematic diagram of the structure of a warning tape identification device provided in an embodiment of this application;

[0045] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0046] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.

[0047] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0048] To enable those skilled in the art to use the content of this application and, in conjunction with the specific application scenario of "identifying warning tape", the following implementation methods are provided. For those skilled in the art, the general principles defined herein can be applied to other embodiments and application scenarios without departing from the spirit and scope of this application.

[0049] First, the applicable scenarios for this application will be introduced. This application can be applied to the field of security technology.

[0050] With the rapid development of mobile robot technology, robots are increasingly being used in complex environments, requiring obstacle avoidance for various types of obstacles. In industrial inspection robot environments, temporary construction work and equipment maintenance are common, often requiring the use of warning tape to isolate areas. For robots, the ability to effectively identify these warning tapes along their inspection paths directly impacts the safety of the robot and on-site equipment or personnel, potentially leading to accidents. Current warning tape recognition methods primarily rely on image processing to extract object contours and then determine whether an object qualifies as a warning tape based on its shape. This method suffers from two main drawbacks: first, it struggles to effectively extract warning tape contours from complex backgrounds; second, it cannot distinguish between objects with similar contours, such as warning tape, long, thin rods, or lane markings on the ground, affecting the accuracy of warning tape recognition. Therefore, improving the accuracy of warning tape recognition has become a significant technical challenge.

[0051] Based on this, the present application provides a method for identifying warning tape. By performing different image processing on different types of warning tape, the influence of complex environmental backgrounds can be eliminated to a certain extent, improving the effectiveness of warning tape contour extraction. The number of target color pixels in the contour determines the warning tape and its type, thereby improving the accuracy of warning tape identification.

[0052] Please see Figure 1 , Figure 1 This is a flowchart illustrating a method for identifying a warning tape provided in an embodiment of this application. Figure 1 As shown in the embodiments of this application, the identification method includes:

[0053] S101: Perform yellow-white warning tape image preprocessing on the image of the region to be identified to determine the first image after processing, and perform red warning tape image preprocessing on the image of the region to be identified to determine the second image after processing.

[0054] In this step, the image of the region to be identified is preprocessed with a yellow-white warning tape to determine the first image after processing, and the image of the region to be identified is preprocessed with a red warning tape to determine the second image after processing.

[0055] Here, since it is uncertain which type of image preprocessing the warning tape in the image to be identified belongs to during the recognition process, it is necessary to perform image preprocessing for yellow-white warning tape and red warning tape separately for the image to be identified.

[0056] In one possible implementation, the step of performing yellow-white warning tape image preprocessing on the image of the region to be identified to determine the processed first image includes:

[0057] A: Perform image grayscale conversion processing on the image of the region to be identified to determine a grayscale image, and perform median filtering processing on the grayscale image to determine a median filtered image.

[0058] Here, the image of the region to be identified is converted to grayscale to determine the grayscale image, and then the grayscale image is filtered by median to determine the median-filtered image.

[0059] B: Pixel difference calculation is performed based on the grayscale image and the median filtered image to determine the pixel difference image.

[0060] Here, the pixel difference is calculated between the grayscale image and the median-filtered image to determine the pixel difference image.

[0061] C: Perform image binarization processing on the pixel difference image to determine the binarized image; perform opening operation processing, closing operation processing, and image edge detection on the binarized image in sequence to determine the first image.

[0062] Here, the pixel difference image is binarized to determine the binarized image. The binarized image is then subjected to opening, closing, and edge detection operations to determine the first image.

[0063] Here, the image of the region to be identified, which is an RGB image, is first converted to a grayscale image through image grayscale conversion. Then, a median filter is applied to the grayscale image to obtain a median-filtered image. The median filter size can be set relatively large (the specific value can be determined through actual testing; in this scheme, the range is 231-261). Next, the pixel difference between the grayscale image and the median-filtered image is calculated to determine the pixel difference image. Then, the pixel difference image is binarized using OpenCV library functions to determine the binarized image. Then, image morphology operations, namely opening and closing operations, are performed on the binarized image. Opening operations can remove noise in the image, eliminate small connected components, and retain larger connected components. This can separate the delicate connections between different objects and smooth the boundaries of connected components without significantly changing the area of ​​larger connected components. Closing operations can remove small holes in connected components, smooth object contours, and connect two adjacent connected components. Finally, image edge detection is performed to obtain the first image.

[0064] In one possible implementation, the step of performing red alert tape image preprocessing on the image of the region to be identified to determine the processed second image includes:

[0065] a: The image of the region to be identified is converted based on the HSV color model to determine the HSV image.

[0066] Here, the image of the region to be identified is transformed according to the HSV color model to determine the HSV image.

[0067] b: Separate the pixels of the HSV image under multiple channels, select the red pixels from the pixels under multiple channels, and set the non-red pixels to black to determine the red pixel image.

[0068] Here, the pixels in the HSV image are separated across multiple channels. Red pixels are selected from the pixels in multiple channels, and non-red pixels are set to black to determine the red pixel image.

[0069] For the color segmentation of the red warning zone, the HSV color model is used. First, the RGB image is converted to an HSV image, which can be achieved using functions in the OpenCV library. Then, the pixels of the H, S, and V channels are separated from the image. The color of each pixel is determined based on the range of values ​​in the H, S, and V channels. Pixels with red color in the H, S, and V channels are extracted and retained, while pixels that are not red are set to black, thus obtaining the segmented red image. The HSV color model is used to determine the color of each pixel by considering the different ranges of its hue, saturation, and value.

[0070] c: Perform opening, closing, and edge detection operations sequentially on the red pixel image to determine the second image.

[0071] Here, the red pixel image is processed sequentially with opening, closing, and edge detection to determine the second image.

[0072] In this scheme, the image of the region to be identified is preprocessed. Different preprocessing methods are used for different types of warning tapes, requiring two preprocessing steps to obtain the preprocessed images, which are then processed and judged separately. Based on common warning tape types in practical use, warning tapes are divided into two categories: yellow-white warning tapes and red warning tapes. For yellow-white warning tapes, image brightness homogenization is first performed to eliminate uneven brightness caused by lighting conditions during image capture. The complex background processing mainly eliminates the influence of complex backgrounds in the environment by using the pixel difference image between the grayscale image and the median-filtered image. Then, image morphological operations are performed, using dilation and erosion to remove small noise points, making the object edges in the image more distinct. For red warning tapes, red pixel images are first obtained through color segmentation to eliminate the influence of environmental backgrounds. Then, image morphological operations are performed to make the object edges in the image more distinct.

[0073] This scheme differentiates between different types of warning tape and employs different preprocessing methods for each type. For yellowish-white warning tape, preprocessing is performed using pixel difference image analysis and image morphology operations to eliminate the influence of the environmental background before contour extraction. For red warning tape, preprocessing is performed using color segmentation methods before contour extraction; other types of solid-color warning tape can be preprocessed using the same method. This approach enables the identification of different types of warning tape by judging them based on pixel color type and quantity.

[0074] S102: Extract object contours from the first image and the second image to determine the first object contour of the first image and the second object contour of the second image.

[0075] In this step, object contours are extracted from the first image and the second image to determine the first object contour in the first image and the second object contour in the second image.

[0076] S103: Perform preliminary contour screening and contour shape calculation on the first object contour and the second object contour to determine candidate contours; wherein, the candidate contours are the contours of the first object contour and the second object contour that conform to the characteristics of a warning tape.

[0077] In this step, preliminary contour screening and contour shape calculation are performed on the contours of the first and second objects to determine the candidate contours.

[0078] Here, the candidate contours are the contours of the first object contour and the second object contour that conform to the features of the warning strip.

[0079] After image preprocessing, contour extraction is performed, and the contours are then filtered twice. The first filtering primarily uses the area and perimeter of the contours to exclude those that are too small or too large. The second filtering focuses on the shape of the contours. Contour scores are calculated by setting a feature scoring method, calculating scores for features such as length and width. When the total contour score exceeds a set threshold, the contour is considered to be similar in shape to the warning tape contour and is selected as a candidate contour.

[0080] In one possible implementation, the preliminary contour screening and contour shape calculation processing of the first object contour and the second object contour to determine candidate contours includes:

[0081] (1): Based on the perimeter of the outline, the area of ​​the outline, and the length-width ratio of the outline, the outline of the first object and the outline of the second object are initially screened to determine the first object outline and the second object outline after screening.

[0082] Here, the contours of the first object and the second object are initially screened based on the contour perimeter, contour area, and contour length-to-width ratio to determine the screened contours of the first object and the second object.

[0083] For a given contour, let the minimum horizontal pixel coordinate be x_min, the maximum horizontal pixel coordinate be x_max, and the minimum vertical pixel coordinate be y_min and the maximum vertical pixel coordinate be y_max. Then: Contour length = x_max - x_min; Contour width = y_max - y_min. First, the contour's perimeter and area are filtered. The area and perimeter calculations can be implemented using OpenCV library functions. The upper and lower bounds of the area and perimeter filtering ranges can be determined through specific implementations. In practice, this is mainly used to filter out small and very large contours, reducing the computational load in subsequent processes. Then, the aspect ratio of the contour is calculated to further filter contours with significant shape differences. The acceptable aspect ratio can be set manually.

[0084] (2): Based on the first object contour after filtering, the second object contour after filtering and the preset warning tape contour, perform contour shape calculation processing to determine the score value of the first object contour after filtering and the score value of the second object contour after filtering.

[0085] Here, the first object contour after screening, the second object contour after screening, and the preset warning tape contour are processed by contour shape calculation to determine the score value of the first object contour after screening and the score value of the second object contour after screening.

[0086] In one possible implementation, the score value of the filtered first object contour is determined through the following steps:

[0087] I: If the width of the first object contour after filtering is greater than the first preset contour width threshold, then the first object contour after filtering is divided into multiple sub-contours according to the second preset contour width.

[0088] Here, if the width of the first object contour after filtering is greater than the first preset contour width threshold, the first object contour after filtering is divided into multiple sub-contours according to the second preset contour width.

[0089] Since the extracted outline of warning tape is usually long and thin, and the installation method is usually horizontal, a score can be set by judging the horizontal length and vertical width of the outline. The closer it is to a strip shape, the higher the score. For the extracted warning tape outline, due to factors such as the installation method, weight, and shooting angle, the shape may not be straight and may be slightly curved or tilted. In the above cases, directly calculating the width value of the warning tape outline cannot fully reflect the actual width of the warning tape. Therefore, when setting the shape scoring mechanism, it is necessary to consider the case of non-absolute straightness. In this solution, the length and width of the warning tape are considered separately, and the shape features are calculated in segments when the width is large. If the outline width is greater than the first preset outline width threshold, the first object outline needs to be divided into several sub-outlines along the horizontal length direction (the width of the sub-outline can be set according to the situation, generally 100-200 pixels; if the final length is not enough for a sub-outline, it is calculated as a sub-outline).

[0090] II: Determine the number of sub-contours whose width is less than the first preset contour width threshold among multiple sub-contours.

[0091] Here, the number of sub-contours whose width is less than a first preset contour width threshold is determined.

[0092] III: Based on the total number of sub-contours, the number of sub-contours, and the standard score value corresponding to the first object contour after filtering, determine the score value of the first object contour after filtering.

[0093] Here, the score of the first object contour after filtering is determined based on the total number of sub-contours, the number of sub-contours, and the standard score corresponding to the first object contour after filtering.

[0094] The score of the first object contour after filtering is determined by the following formula:

[0095]

[0096] Here, S0 is set as the standard score value for different contour lengths. The total number of sub-contours is n+m. The number of sub-contours whose width meets the condition is n, and the number of sub-contours whose width does not meet the condition is m. The score of the first object contour after filtering is S. α and β are coefficient factors, satisfying α+β=1, representing the weights of sub-contours that meet and do not meet the condition, respectively. Generally, α=1 and β=0 can be taken. If the requirement for the width of the warning tape is stricter, and it is desired to detect only warning tapes with good horizontality and straightness, α can be decreased and β increased.

[0097] For example, a contour with a length of 1320 pixels and a width of 230 pixels can be divided into 9 sub-contours based on a set sub-contour length of 150 pixels. If 8 sub-contours have a width less than the threshold and 1 sub-contour has a width exceeding the threshold, the score is:

[0098]

[0099] In this scheme, a standard score is set based on the length of the warning tape. For contours with a horizontal length greater than a certain value (e.g., 200 pixels), a score is calculated, as shown in the table below. In actual use, the specific score value can be adjusted according to the actual testing environment and the size of the image acquired by the camera. In this scheme, the image size is 1920 pixels * 1080 pixels.

[0100] Length (in pixels) <![CDATA[Standard score value S0]]> length>1200 16 1000<=length<1200 15 800<=length<1000 14 600<=length<800 13 400<=length<600 12 300<=length<400 11 200<=length<300 10 length<200 0

[0101] In one possible implementation, the score value of the filtered first object contour is determined through the following steps:

[0102] i: Set the corresponding standard score table based on the length information of the preset warning tape outline.

[0103] Here, a standard score table is set according to the length information of the preset warning tape outline. The standard score values ​​are shown in the table above.

[0104] ii: If the width of the first object contour after filtering is less than or equal to the first preset contour width threshold, then the score of the first object contour after filtering is determined based on the length information of the first object contour after filtering and the standard score value.

[0105] Here, if the width of the first object contour after filtering is less than or equal to the first preset contour width threshold, the score of the first object contour after filtering is determined according to the length information of the first object contour after filtering and the standard score value table.

[0106] Here, after determining the length information of the first object outline after filtering, the corresponding score value is determined in the standard score value table based on the length information of the first object outline after filtering.

[0107] (3): Based on the score, the candidate contour is determined from the first object contour after filtering and the second object contour after filtering.

[0108] Here, the candidate contour is determined from the filtered first object contour and the filtered second object contour based on the score value.

[0109] Here, the score is compared with the set score threshold. If the score is greater than or equal to the score threshold, the contour is considered to be close to the warning tape contour in shape and is judged as a candidate contour. Otherwise, it is judged as a non-candidate contour.

[0110] In this scheme, multiple methods are used to filter the contours. First, contours that meet the characteristics of warning tape in terms of shape are obtained. Then, the contours are judged by the color type, quantity and proportion range of pixels, which can reduce the false recognition rate and improve the recognition accuracy.

[0111] S104: Based on the number of target color pixels in the candidate contour, determine the warning strip and its type in the image of the region to be identified.

[0112] In this step, the number of target color pixels in the candidate contour is used to determine the warning strip and its type in the image of the region to be identified.

[0113] In one possible implementation, determining the warning strip and its type in the image of the region to be identified based on the number of pixels of the target color in the candidate contour includes:

[0114] i: Determine the number of yellow pixels, white pixels, and red pixels in the candidate contour.

[0115] Here, the number of yellow pixels, white pixels, and red pixels in the candidate contour are determined.

[0116] ii: Based on the number of yellow pixels, the number of white pixels, the number of red pixels, and the range of preset pixel counts, determine the warning strip and its type in the image of the area to be identified; wherein the types of warning strips include red warning strips and yellow-white warning strips.

[0117] Here, the warning tape and its type in the image to be identified are determined based on the number of yellow pixels, the number of white pixels, the number of red pixels, and the range of preset pixel counts.

[0118] The determination of the number of pixels of the target color in the candidate contour is achieved using the HSV color model. This involves converting an RGB image to an HSV image, then separating the pixel values ​​of the H, S, and V channels, and determining the color of the pixel based on these values. The number of pixels in the contour can be calculated using OpenCV's function to check if a point is within a polygon. To reduce computation, a region of interest can be defined, and only pixels within that region can be checked for inclusion in the contour.

[0119] In this scheme, for the yellow-white warning strip, the ranges for the number of yellow, white, and red pixels are [100, 20000], [100, 20000], and [10, 1000], respectively. For the red warning strip, the ranges for the number of yellow, white, and red pixels are [0, 5], [0, 5], and [1000, 60000], respectively.

[0120] Here, the color type and quantity of pixels in the candidate contour are statistically analyzed. The number of yellow, white, and red pixels are calculated separately. Based on the number of these three colors of pixels, it is determined whether the candidate contour is a warning zone and what type of warning zone it belongs to. If the number of yellow, white, and red pixels are within the specified range, it is determined to be a yellow-white warning zone. If the number of white and yellow pixels is less than a certain value, and the number of red pixels meets the corresponding range, it is determined to be a red warning zone. If the number of pixels of a specific color does not meet the set conditions, it is not a warning zone.

[0121] For further details, please refer to Figure 2 , Figure 2 This is a schematic diagram illustrating a method for identifying a warning tape provided in an embodiment of this application. Figure 2As shown, the images of the yellow-white and red warning tapes in the region to be identified are preprocessed first. After image preprocessing, contour extraction is performed, followed by a first and second contour filtering. The first contour filtering primarily uses the area and perimeter of the contours to exclude those that are too small or too large. The second contour filtering focuses on the shape of the contours. Contour scores are calculated by setting a feature scoring method, calculating scores for features such as length and width. When the contour score is greater than a set threshold, the contour is considered to be similar in shape to the warning tape contour and is selected as a candidate contour. The color type and quantity of pixels in the candidate contours are statistically analyzed, calculating the number of yellow, white, and red pixels respectively. Based on the number of these three colors of pixels, it is determined whether the candidate contour is a warning tape and what type of warning tape it belongs to.

[0122] This application provides a method for identifying warning tape, comprising: preprocessing an image of a region to be identified with a yellowish-white warning tape to determine a first image; and preprocessing the image of the region to be identified with a red warning tape to determine a second image; extracting object contours from the first and second images to determine a first object contour in the first image and a second object contour in the second image; performing preliminary contour screening and contour shape calculation on the first and second object contours to determine candidate contours; wherein the candidate contours are contours among the first and second object contours that conform to the characteristics of a warning tape; and determining the warning tape and its type in the image of the region to be identified based on the number of pixels of the target color in the candidate contours. By performing different image processing on different types of warning tapes, the influence of complex environmental backgrounds can be eliminated to a certain extent, improving the effectiveness of warning tape contour extraction. Determining the warning tape and its type by the number of pixels of the target color in the contour improves the accuracy of warning tape identification.

[0123] Please see Figure 3 , Figure 3 This is a schematic diagram of the structure of a warning tape identification device provided in an embodiment of this application. Figure 3 As shown, the identification device 300 for the warning tape includes:

[0124] Image processing module 310 is used to perform yellow-white warning tape image preprocessing on the image of the region to be identified to determine the first image after processing, and to perform red warning tape image preprocessing on the image of the region to be identified to determine the second image after processing.

[0125] The contour extraction module 320 is used to extract object contours from the first image and the second image, and determine the first object contour of the first image and the second object contour of the second image.

[0126] The contour filtering module 330 is used to perform preliminary contour filtering and contour shape calculation on the first object contour and the second object contour to determine candidate contours; wherein, the candidate contours are the contours of the first object contour and the second object contour that conform to the characteristics of a warning tape.

[0127] The type determination module 340 is used to determine the warning band and its type in the image of the region to be identified based on the number of target color pixels in the candidate contour.

[0128] Furthermore, when the image processing module 310 performs yellow-white warning tape image preprocessing on the image of the region to be identified to determine the processed first image, the image processing module 310 is specifically used for:

[0129] The image of the region to be identified is subjected to image grayscale conversion to determine a grayscale image, and the grayscale image is subjected to median filtering to determine a median filtered image;

[0130] Pixel difference calculation is performed based on the grayscale image and the median filtered image to determine the pixel difference image;

[0131] The pixel difference image is subjected to image binarization processing to determine the binarized image;

[0132] The binarized image is sequentially subjected to opening, closing, and edge detection to determine the first image.

[0133] Furthermore, when the image processing module 310 performs red alert tape image preprocessing on the image of the region to be identified to determine the processed second image, the image processing module 310 is specifically used for:

[0134] The image of the region to be identified is converted based on the HSV color model to determine the HSV image;

[0135] The HSV image is separated into pixels across multiple channels. Red pixels are selected from the pixels across multiple channels, and non-red pixels are set to black to determine the red pixel image.

[0136] The second image is determined by sequentially performing opening, closing, and edge detection operations on the red pixel image.

[0137] Furthermore, when performing preliminary contour filtering and contour shape calculation on the contours of the first object and the second object to determine candidate contours, the contour filtering module 330 is specifically used for:

[0138] Based on the contour perimeter, contour area and contour length-width ratio, the contour of the first object and the contour of the second object are initially screened to determine the first object contour and the second object contour after screening.

[0139] Based on the first object contour after filtering, the second object contour after filtering, and the preset warning tape contour, the contour shape calculation process is performed to determine the score value of the first object contour after filtering and the score value of the second object contour after filtering.

[0140] The candidate contour is determined from the filtered first object contour and the filtered second object contour based on the score value.

[0141] Furthermore, the contour filtering module 330 determines the score value of the filtered first object contour through the following steps:

[0142] If the width of the first object contour after filtering is greater than the first preset contour width threshold, then the first object contour after filtering is divided into multiple sub-contours according to the second preset contour width.

[0143] Determine the number of sub-contours whose width is less than the first preset contour width threshold among multiple sub-contours;

[0144] The score of the first object contour after filtering is determined based on the total number of sub-contours, the number of sub-contours, and the standard score corresponding to the first object contour after filtering.

[0145] Furthermore, the contour filtering module 330 determines the score value of the filtered first object contour through the following steps:

[0146] Set the corresponding standard scoring table based on the length information of the preset warning tape outline;

[0147] If the width of the first object contour after filtering is less than or equal to a first preset contour width threshold, then the score of the first object contour after filtering is determined based on the length information of the first object contour after filtering and the standard score value.

[0148] Furthermore, when determining the warning strip and its type in the image of the region to be identified based on the number of pixels of the target color in the candidate contour, the type determination module 340 is specifically used for:

[0149] The number of yellow pixels, white pixels, and red pixels in the candidate contour are determined.

[0150] Based on the number of yellow pixels, the number of white pixels, the number of red pixels, and the range of preset pixel counts, the warning tape and its type in the image to be identified are determined; wherein, the types of warning tape include red warning tape and yellow-white warning tape.

[0151] This application provides a device for identifying warning tape, comprising: an image processing module for preprocessing an image of a region to be identified with a yellow-white warning tape to determine a first image, and preprocessing the image of the region to be identified with a red warning tape to determine a second image; a contour extraction module for extracting object contours from the first image and the second image to determine a first object contour in the first image and a second object contour in the second image; a contour filtering module for performing preliminary contour filtering and contour shape calculation on the first object contour and the second object contour to determine candidate contours; wherein the candidate contours are contours among the first object contours and the second object contours that conform to the characteristics of a warning tape; and a type determination module for determining the warning tape and its type in the image of the region to be identified based on the number of pixels of the target color in the candidate contours. By performing different image processing on different types of warning tapes, the influence of complex environmental backgrounds can be eliminated to a certain extent, improving the effectiveness of warning tape contour extraction. Determining the warning tape and its type by the number of pixels of the target color in the contour improves the accuracy of warning tape identification.

[0152] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 4 As shown, the electronic device 400 includes a processor 410, a memory 420, and a bus 430.

[0153] The memory 420 stores machine-readable instructions executable by the processor 410. When the electronic device 400 is running, the processor 410 communicates with the memory 420 via the bus 430. When the machine-readable instructions are executed by the processor 410, they can perform the operations described above. Figure 1The steps of the warning tape identification method in the illustrated method embodiment can be found in the method embodiment for specific implementation, and will not be repeated here.

[0154] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can perform the above-described actions. Figure 1 The steps of the warning tape identification method in the illustrated method embodiment can be found in the method embodiment for specific implementation, and will not be repeated here.

[0155] 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.

[0156] In the several embodiments provided in this application, 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 shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0157] 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.

[0158] In addition, the functional units in the various embodiments of this application 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.

[0159] 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 application, in essence, 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 application. 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.

[0160] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The scope of protection of this application is not limited thereto. Although this application 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, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application. Such 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 this application, and should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for identifying warning tape, characterized in that, The identification method includes: The image of the region to be identified is preprocessed with a yellow-white warning tape to determine the first image after processing, and the image of the region to be identified is preprocessed with a red warning tape to determine the second image after processing. Object contours are extracted from the first image and the second image to determine the first object contour of the first image and the second object contour of the second image. The first object contour and the second object contour are subjected to preliminary contour screening and contour shape calculation to determine candidate contours; wherein, the candidate contours are the contours of the first object contour and the second object contour that conform to the characteristics of a warning tape. Based on the number of target color pixels in the candidate contour, the warning strip and its type in the image of the region to be identified are determined. The process of preprocessing the image of the region to be identified using a yellow-white warning tape to determine the first processed image includes: The image of the region to be identified is subjected to image grayscale conversion to determine a grayscale image, and the grayscale image is subjected to median filtering to determine a median filtered image; Pixel difference calculation is performed based on the grayscale image and the median filtered image to determine the pixel difference image; The pixel difference image is subjected to image binarization processing to determine the binarized image; The binarized image is sequentially subjected to opening, closing, and edge detection to determine the first image. The step of performing red alert zone image preprocessing on the image of the region to be identified to determine the processed second image includes: The image of the region to be identified is converted based on the HSV color model to determine the HSV image; The HSV image is separated into pixels across multiple channels. Red pixels are selected from the pixels across multiple channels, and non-red pixels are set to black to determine the red pixel image. The second image is determined by sequentially performing opening, closing, and edge detection operations on the red pixel image.

2. The identification method according to claim 1, characterized in that, The preliminary contour screening and contour shape calculation processing of the first object contour and the second object contour to determine candidate contours includes: Based on the contour perimeter, contour area and contour length-width ratio, the contour of the first object and the contour of the second object are initially screened to determine the first object contour and the second object contour after screening. Based on the first object contour after filtering, the second object contour after filtering, and the preset warning tape contour, the contour shape calculation process is performed to determine the score value of the first object contour after filtering and the score value of the second object contour after filtering. The candidate contour is determined from the filtered first object contour and the filtered second object contour based on the score value.

3. The identification method according to claim 2, characterized in that, The score of the first object contour after filtering is determined by the following steps: If the width of the first object contour after filtering is greater than the first preset contour width threshold, then the first object contour after filtering is divided into multiple sub-contours according to the second preset contour width. Determine the number of sub-contours whose width is less than the first preset contour width threshold among multiple sub-contours; The score of the first object contour after filtering is determined based on the total number of sub-contours, the number of sub-contours, and the standard score corresponding to the first object contour after filtering.

4. The identification method according to claim 2, characterized in that, The score of the first object contour after filtering is determined by the following steps: Set the corresponding standard scoring table based on the length information of the preset warning tape outline; If the width of the first object contour after filtering is less than or equal to a first preset contour width threshold, then the score of the first object contour after filtering is determined based on the length information of the first object contour after filtering and the standard score value.

5. The identification method according to claim 1, characterized in that, The determination of the warning strip and its type in the image of the region to be identified based on the number of pixels of the target color in the candidate contour includes: The number of yellow pixels, white pixels, and red pixels in the candidate contour are determined. Based on the number of yellow pixels, the number of white pixels, the number of red pixels, and the range of preset pixel counts, the warning tape and its type in the image to be identified are determined; wherein, the types of warning tape include red warning tape and yellow-white warning tape.

6. A device for identifying warning tape, characterized in that, The identification device includes: The image processing module is used to perform yellow-white warning tape image preprocessing on the image of the region to be identified to determine the first image after processing, and to perform red warning tape image preprocessing on the image of the region to be identified to determine the second image after processing. The contour extraction module is used to extract object contours from the first image and the second image, and determine the first object contour of the first image and the second object contour of the second image. The contour filtering module is used to perform preliminary contour filtering and contour shape calculation on the contours of the first object and the second object to determine candidate contours; wherein, the candidate contours are the contours of the first object and the second object that conform to the characteristics of a warning tape. The type determination module is used to determine the warning strip and its type in the image of the region to be identified based on the number of pixels of the target color in the candidate contour. The image processing module is used to preprocess the image of the region to be identified using a yellow-white warning tape to determine the first image after processing. The image of the region to be identified is subjected to image grayscale conversion to determine a grayscale image, and the grayscale image is subjected to median filtering to determine a median filtered image; Pixel difference calculation is performed based on the grayscale image and the median filtered image to determine the pixel difference image; The pixel difference image is subjected to image binarization processing to determine the binarized image; The binarized image is sequentially subjected to opening, closing, and edge detection to determine the first image. The image processing module is used to perform red warning tape image preprocessing on the image of the region to be identified to determine the processed second image: The image of the region to be identified is converted based on the HSV color model to determine the HSV image; The HSV image is separated into pixels across multiple channels. Red pixels are selected from the pixels across multiple channels, and non-red pixels are set to black to determine the red pixel image. The second image is determined by sequentially performing opening, closing, and edge detection operations on the red pixel image.

7. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. The machine-readable instructions are executed by the processor to perform the steps of the warning tape identification method as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the warning tape identification method as described in any one of claims 1 to 5.