Road throwing identification method and device, medium and equipment

By performing color-based adaptive grayscale processing and background pixel value adjustment on the image of road throwing objects, combined with threshold segmentation and target object matching methods, the problem of poor identification effect of road throwing objects in the prior art is solved, and accurate recognition is achieved in the light change environment.

CN119741659AActive Publication Date: 2025-04-01CHINA TOWER CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411835677.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-04-01
Estimated Expiration
2044-12-13

AI Technical Summary

Technical Problem

In the prior art, the identification effect of road spills is poor, especially in outdoor environments where light intensity changes, recognition failure or errors are prone to occur.

Method used

The original image is processed using color-based adaptive grayscale processing, and the pixel value of the background area is adjusted to an extreme value on the image. The characteristic image is obtained through threshold segmentation, and the target object is matched until the matching similarity is not less than the threshold.

Benefits of technology

Under the influence of light, accurate and rapid identification of road sprinkles is achieved, and the effect of road sprinkles is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119741659A_ABST
    Figure CN119741659A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a road throwing identification method and device, a medium and equipment, and relates to the technical field of road monitoring, the data dimension of an original image is reduced through graying, pixel distribution of a real image can be reserved based on a color adaptive mode, the visual perception of human eyes can be better met, and the accuracy of road throwing identification is improved. Selecting a pixel extreme value on the grayed image, taking the pixel extreme value as a pixel value of a background region, enabling the pixel extreme value to be more obvious in comparison with a recognition region where the thrown object is located, then carrying out target object matching recognition on the feature image, and if the similarity is relatively low, indicating that the real contour of the thrown object is not segmented, otherwise, carrying out target object matching recognition on the feature image. According to the method, segmentation can be carried out after the pixel value of the background area is adjusted step by step, and the above operation is repeated to enable the feature image to gradually approach the real contour of the thrown object until the feature image is enough to complete the matching identification of the target object, thereby achieving the accurate and rapid identification of the thrown object under the illumination influence, and improving the recognition effect of the road thrown object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of road monitoring technology, and in particular to a road spillage identification method, device, medium and equipment. Background Art

[0002] Road monitoring is mainly based on fast ball monitoring, and monitoring points are distributed on the road. The road traffic situation is uploaded to the road monitoring command center in real time through the image transmission channel, so that the center staff can timely understand the road conditions in various areas. One of the important aspects is the identification of scattered objects on the road, especially for main roads and highways. Accurately and timely identification of the presence of scattered objects on the road and the type of scattered objects can greatly improve the safety management of the road.

[0003] The existing mainstream recognition method is to adopt an image-based target detection algorithm, obtain the contour features of the spilled objects on the image through threshold segmentation, and then identify the specific category of the spilled objects based on the contour features. However, in outdoor environments, affected by many factors related to light intensity such as street light, car light, weather, etc., reflections or shadows often appear on the target objects in the image or around them, making it difficult for threshold segmentation to directly and accurately divide the contours of the target objects, resulting in poor recognition results, and often resulting in failure or error in recognition of spilled objects. Summary of the invention

[0004] The main purpose of the present application is to provide a road spillage identification method, device, medium and equipment, aiming to solve the problem of poor recognition effect of road spillage in the prior art.

[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of the present application are as follows:

[0006] In a first aspect, an embodiment of the present application provides a method for identifying road spillage, comprising the following steps:

[0007] Perform color-based adaptive grayscale conversion on the original image to obtain the road image to be identified;

[0008] The pixel value of the background area of ​​the road image to be identified is adjusted to an extreme value of the pixel on the road image to be identified, and the road image to be identified is updated to obtain a target identification image;

[0009] Perform threshold segmentation based on the target recognition image to obtain a feature image;

[0010] The target object is matched based on the feature image. When the matching similarity is less than the similarity threshold, the pixel value of the background area is adjusted step by step according to the selection of the extreme value, and the threshold segmentation is performed based on the target recognition image to obtain the feature image step until the matching similarity is not less than the similarity threshold, and the target scattered object is obtained to complete the recognition.

[0011] In a possible implementation of the first aspect, performing color-based adaptive grayscale conversion on the original image to obtain the road image to be identified includes:

[0012] Perform color recognition on the original image to obtain color distribution and intensity information;

[0013] According to the color distribution and intensity information, the weights of the three RGB channels are adjusted to grayscale and obtain the road image to be identified.

[0014] In a possible implementation manner of the first aspect, before adjusting the pixel value of the background area of ​​the road image to be identified to an extreme value of the pixel on the road image to be identified, the method further includes:

[0015] Based on the location of the target spilled object, the area to be identified and the background area are marked on the road image to be identified.

[0016] In a possible implementation of the first aspect, based on the position of the target spilled object, marking the area to be identified and the background area on the road image to be identified includes:

[0017] Based on the location of the target spilled object, marking a first area to be identified on the image of the road to be identified;

[0018] Expand the outline of the first area to be identified by a target pixel unit to obtain the area to be identified;

[0019] A background area is obtained based on an area other than the area to be identified on the road image to be identified.

[0020] In a possible implementation manner of the first aspect, after performing threshold segmentation based on the target recognition image to obtain the feature image, the method further includes:

[0021] The feature image is subtracted from the background image to obtain a target feature image; wherein the background image is an image with the same size as the feature image, and the pixels of the background image are the same as the pixels of the background area.

[0022] In a possible implementation manner of the first aspect, stepwise adjusting the pixel value of the background area according to the selection of the extreme value includes:

[0023] According to the selection of the extreme value as the maximum value, the pixel value of the background area is stepped down, or, according to the selection of the extreme value as the minimum value, the pixel value of the background area is stepped up.

[0024] In a possible implementation manner of the first aspect, before performing target object matching based on the feature image, the method further includes:

[0025] Establishing a target object recognition library; wherein the target object recognition library contains a number of targets and their feature information, and the feature information includes feature information extracted from identifying the target objects from different directions;

[0026] Target matching based on feature images, including:

[0027] Based on the feature image, the target is matched in the target recognition library.

[0028] In a second aspect, an embodiment of the present application provides a road spillage identification device, comprising:

[0029] Grayscale module: The grayscale module is used to perform color-based adaptive grayscale conversion on the original image to obtain the road image to be identified;

[0030] An adjustment module, the adjustment module is used to adjust the pixel value of the background area of ​​the road image to be identified to an extreme value of the pixel on the road image to be identified, and update the road image to be identified to obtain a target recognition image;

[0031] The segmentation module is used to perform threshold segmentation based on the target recognition image to obtain a feature image;

[0032] The recognition module is used to match the target object based on the feature image. When the matching similarity is less than the similarity threshold, the pixel value of the background area is adjusted step by step according to the selection of the extreme value, and the threshold segmentation is returned based on the target recognition image to obtain the feature image, until the matching similarity is not less than the similarity threshold, the target scattered object is obtained to complete the recognition.

[0033] In a third aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program. When the computer program is loaded and executed by a processor, the road spillage identification method provided in any one of the first aspects above is implemented.

[0034] In a fourth aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, wherein:

[0035] The memory is used to store computer programs;

[0036] The processor is used to load and execute a computer program so that the electronic device executes the road spillage identification method provided in any one of the first aspects above.

[0037] Compared with the prior art, the beneficial effects of this application are:

[0038] The embodiments of the present application propose a method, device, medium and equipment for identifying road spills, which method includes: performing color-based adaptive grayscale conversion on the original image to obtain a road image to be identified; adjusting the pixel value of the background area of ​​the road image to be identified to an extreme value of the pixel on the road image to be identified, and updating the road image to be identified to obtain a target identification image; performing threshold segmentation based on the target identification image to obtain a feature image; performing target object matching based on the feature image, and when the matching similarity is less than the similarity threshold, stepwise adjusting the pixel value of the background area according to the selection of the extreme value, and returning to the step of performing threshold segmentation based on the target identification image to obtain the feature image, until the matching similarity is not less than the similarity threshold, and the target spilled object is obtained to complete the identification. The present application first reduces the data dimension of the original image by graying. Since the graying method is an adaptive method based on color, it can retain the pixel distribution of the real image and is more in line with the visual perception of the human eye. Affected by the light intensity, the threshold segmentation cannot directly and accurately identify the contour features of the spilled object. Therefore, a pixel extreme value on the grayed image is selected and used as the pixel value of the background area to make the contrast between it and the identification area where the spilled object is located more obvious, so that the feature image obtained by the threshold segmentation can be used to characterize the location of the spilled object, and then the feature image is matched and identified for the target object. If the similarity is low, it means that the real contour of the spilled object has not been segmented out. The pixel value of the background area can be adjusted in steps, and the threshold segmentation can be performed again. In this way, a part of the area where the spilled object is located can be divided into the background area. Repeating the above operation can gradually bring the feature image close to the real contour of the spilled object until the feature image is sufficient to complete the matching and identification of the target object, thereby achieving accurate and rapid identification of the spilled object under the influence of light, thereby improving the effect of identifying road spilled objects. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 A schematic diagram of the structure of an electronic device of a hardware operating environment involved in an embodiment of the present application;

[0040] Figure 2 A schematic diagram of a process flow of a road spill identification method provided in an embodiment of the present application;

[0041] Figure 3 A schematic diagram of a module of a road spillage identification device provided in an embodiment of the present application;

[0042] Markings in the figure: 101 - processor, 102 - communication bus, 103 - network interface, 104 - user interface, 105 - memory. DETAILED DESCRIPTION

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

[0044] Refer to the attached Figure 1 , attached Figure 1 This is a schematic diagram of the structure of an electronic device of the hardware operating environment involved in the embodiment of the present application. The electronic device may include: a processor 101, such as a central processing unit (CPU), a communication bus 102, a user interface 104, a network interface 103, and a memory 105. Among them, the communication bus 102 is used to realize the connection and communication between these components. The user interface 104 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the user interface 104 may also include a standard wired interface and a wireless interface. The network interface 103 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 105 may optionally be a storage device independent of the aforementioned processor 101. The memory 105 may be a high-speed random access memory (RAM) memory, or it may be a stable non-volatile memory (NVM), such as at least one disk storage; the processor 101 may be a general-purpose processor, including a central processing unit, a network processor, etc., or it may be a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component.

[0045] Those skilled in the art will appreciate that Figure 1 The structure shown in the figure does not constitute a limitation on the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0046] As attached Figure 1 As shown, the memory 105 as a storage medium may include an operating system, a network communication module, a user interface module, and a road spillage identification device.

[0047] In the attached Figure 1 In the electronic device shown, the network interface 103 is mainly used for data communication with the network server; the user interface 104 is mainly used for data interaction with the user; the processor 101 and the memory 105 in the present application can be set in the electronic device, and the electronic device calls the road spillage identification device stored in the memory 105 through the processor 101, and executes the road spillage identification method provided in the embodiment of the present application.

[0048] Refer to the attached Figure 2Based on the hardware device of the aforementioned embodiment, the embodiment of the present application provides a road spillage identification method, comprising the following steps:

[0049] S10: Perform color-based adaptive grayscale conversion on the original image to obtain a road image to be identified.

[0050] In the specific implementation process, the original image is a road image taken by a road monitoring camera, which can be a frame segmented from a monitoring video, usually an image with color retained. In order to reduce the data dimension, the original image is grayscaled. Usually, grayscale means setting the values ​​of the three RGB channels to be equal, and the equal value is the grayscale value of the image. However, considering that the processed image must not only adapt to software processing, but also need to be displayed to relevant personnel, it is subjected to color-based adaptive grayscale to improve the grayscale effect. Specifically:

[0051] The original image is converted to grayscale based on color to obtain the road image to be identified, including:

[0052] Perform color recognition on the original image to obtain color distribution and intensity information;

[0053] According to the color distribution and intensity information, the weights of the three RGB channels are adjusted to grayscale and obtain the road image to be identified.

[0054] In the specific implementation process, through the weighted average based on color sensitivity, according to the distribution and intensity of different color components in the image, the weights of the three components of RGB are dynamically adjusted to obtain a better grayscale effect, which not only helps to improve the quality and applicability of grayscale images, provides a better foundation for subsequent image processing operations, but also can obtain grayscale images that are more in line with the visual characteristics of the human eye. In the grayscale process, the calculation of the grayscale value of the image is expressed as:

[0055] Gray value = wR×R+wG×G+wB×B

[0056] Among them: wR, wG, wB represent the weights of the red (R), green (G), and blue (B) channels respectively; R, G, and B represent the pixel values ​​of the red, green, and blue channels respectively, and the value range is usually 0 to 255. Further, the weight is calculated by the distribution and intensity of the color components. For example, assuming that the initial state can be evenly distributed, wG = a*wG + b*wG, a and b are adjustment coefficients based on distribution and intensity respectively, and the initial state is a = b = 0.5. If the green component in the image accounts for a large proportion and has a high intensity, then the weight of the green component can be appropriately increased. The specific operation is to enlarge the values ​​of a and b, such as a = 0.55 and b = 0.6, and then obtain a new weight of 1.15wG, which corresponds to the weight enlargement of the green channel.

[0057] S20: adjusting the pixel value of the background area of ​​the road image to be identified to an extreme value of the pixel on the road image to be identified, and updating the road image to be identified to obtain a target recognition image.

[0058] In the specific implementation process, the segmentation of the scattered objects is actually to separate the target from the background. Considering the influence of light illumination, the scattered objects themselves or their vicinity usually show reflections or shadows, which makes it difficult to specifically identify the boundary contour between them and the background. Therefore, in the embodiment of the present application, it is considered to process the background to continuously optimize the contour. Considering that the aforementioned steps are based on color adaptive grayscale, the grayscale value of the image will be different according to the different color expressions on the original image. Therefore, it is considered to start from the extreme value of the pixels on the image, continuously adjust the recognition of the background area, and gradually approach the true contour. In order to cooperate with this asymptotic process, the pixel value of the background area can start from the extreme value, such as starting from the maximum value and gradually decreasing, or starting from the minimum value and gradually increasing.

[0059] For the initial road image to be identified, it is necessary to determine the initial background area and the area of ​​the scattered objects, which are usually determined based on the scattered objects on the image, that is, before the pixel value of the background area of ​​the road image to be identified is adjusted to an extreme value of the pixel on the road image to be identified, the method further includes:

[0060] Based on the location of the target scattered object, the area to be identified and the background area are marked on the road image to be identified. Specifically: Based on the location of the target scattered object, the area to be identified and the background area are marked on the road image to be identified, including:

[0061] Based on the location of the target spilled object, marking a first area to be identified on the image of the road to be identified;

[0062] Expand the outline of the first area to be identified by a target pixel unit to obtain the area to be identified;

[0063] A background area is obtained based on an area other than the area to be identified on the road image to be identified.

[0064] In the specific implementation process, the area to be identified is the area where the spilled object is located. The outline of the spilled object is expanded outward. On the one hand, this is to ensure that it can be extracted completely, and the size of the area to be identified is made slightly larger than the actual size. On the other hand, the influence of shadows or reflections usually makes the target range under visual detection larger. The marking of the first area to be identified can be manual or machine. Since the marking is not a direct identification of the actual outline of the spilled object, this rough marking is less difficult and will not consume too many resources to implement.

[0065] S30: Perform threshold segmentation based on the target recognition image to obtain a feature image.

[0066] In the specific implementation process, threshold segmentation is a basic method in image processing, which divides the image into different areas or objects based on the grayscale or color features of the image. Since the embodiment of the present application only needs to separate the spilled objects from the background, each threshold segmentation only needs to select a threshold value, which can select the pixel value of the background area, and directly separate the background to obtain the spilled objects as the goal. Since the marked background area in the above steps is not the real background, there is also a background area in the marked area to be identified, so this part of the area will be divided out during the threshold segmentation, and the area with the same pixel value as the set threshold will be obtained. The area outside this part is the feature area, that is, the feature image that characterizes the spilled objects.

[0067] The effect of threshold segmentation is affected by the threshold selection. An excellent threshold setting can segment feature information more accurately and quickly. The sum of the entropy of the foreground and background is used to characterize the threshold:

[0068] max H(T)=-∑[i=1,k]p i log2(p i )

[0069] Among them, H(T) represents the entropy of the image after segmentation, p i Represents the probability of gray level occurrence, k represents the number of gray levels, and by traversing all possible thresholds T, we find the T value that maximizes the sum of the entropy H(T) of the foreground and background, which is the optimal threshold.

[0070] In one embodiment, after performing threshold segmentation based on the target recognition image to obtain the feature image, the method further includes:

[0071] The feature image is subtracted from the background image to obtain a target feature image; wherein the background image is an image with the same size as the feature image, and the pixels of the background image are the same as the pixels of the background area.

[0072] In the specific implementation process, in order to improve the quality of the feature image and enhance the feature information of the scattered objects carried thereon, the feature image is subtracted from the background image to remove some background noise interference on the image and enhance the contrast. The pixels of the background image are set to be the same as the pixels of the background area. The background image can be considered to be the image of the background area. The difference is that the size of the background image needs to be the same as the size of the feature image, so that the pixels of the corresponding points can be directly subtracted. The subtraction operation is implemented according to the following formula:

[0073] g(x,y)=f1(x,y)-f2(x,y)

[0074] Where g(x, y) represents the pixel value of the target feature image at the coordinate (x, y), f1(x, y) represents the pixel value of the feature image at the coordinate (x, y), and f2(x, y) represents the pixel value of the background image at the coordinate (x, y). Pixel values ​​are usually non-negative, such as in the range of 0-255. In the subtraction process, in order to avoid the appearance of negative values, the result is taken as an absolute value or truncated. Alternatively, negative values ​​can be assigned according to the pixel value distribution on the feature image. In short, the purpose is to ensure that the pixel value is within the valid range.

[0075] S40: Match the target object based on the feature image. When the similarity of the match is less than the similarity threshold, adjust the pixel value of the background area in steps according to the selection of the extreme value, and return to the step of performing threshold segmentation based on the target recognition image to obtain the feature image, until the similarity of the match is not less than the similarity threshold, and the target scattered object is obtained to complete the recognition.

[0076] In the specific implementation process, after the feature image is segmented, the target object is matched therewith. The target object matching can be performed based on the target object recognition library, that is, before the target object matching is performed based on the feature image, the method further includes:

[0077] Establishing a target object recognition library; wherein the target object recognition library contains a number of targets and their feature information, and the feature information includes feature information extracted from identifying the target objects from different directions;

[0078] Target matching based on feature images, including:

[0079] Based on the feature image, the target is matched in the target recognition library.

[0080] By establishing a target object recognition library, images of information on some common road spills are saved. Since many spills are dropped from vehicles or other places, they usually do not present a general state. For example, conical buckets are usually placed vertically for use, but due to the influence of traffic, they may be dumped on the road; therefore, the target object recognition library can store the target objects and their feature information under multi-directional recognition to ensure that the spilled objects cannot be identified due to posture changes. Compared with the existing technology that uses more complex algorithms to extract features, correct postures, and identify and judge, the present application directly realizes target matching by comparing features and postures, which can save computing power.

[0081] The result of the matching verification is characterized by similarity. The quantification of similarity can be achieved by directly comparing image pixel values, feature matching algorithms, Euclidean distance, etc. For example, a feature matching algorithm (such as nearest neighbor search) is used to find similar features in two images, and the similarity of the images is evaluated by calculating the number or quality of matching features, or a hash algorithm is used to convert the images into hash values, and the similarity of the images is evaluated by comparing the similarity of the hash values.

[0082] A similarity threshold is set. If the similarity reaches the similarity threshold, it can be considered that the matching and identification of the spilled object is successful, and the specific category of the spilled object can be determined based on the matched object. If the similarity is less than the similarity threshold, it is considered that the match is not successful, indicating that the real contour of the spilled object represented by the feature image obtained by threshold segmentation is not sufficient to meet the recognition requirements, and the impact on the image is still large, requiring further segmentation. Then, the pixel value of the background area is step-adjusted before threshold segmentation, which is equivalent to further expanding the background area to approach the real position of the spilled object. The adjusted step value can be set to several pixel units based on actual conditions. The direction of the step adjustment is determined according to the selection of the extreme value. If the extreme value is selected as the maximum value, the step adjustment will decrease; if the mechanism is selected as the minimum value, the step adjustment will increase.

[0083] Of course, there may be a special situation. The target object recognition library may not have the information of the current category of spilled objects preset. In this case, a number of cycles can be set. For example, if the step adjustment reaches 10 times and still fails to meet the similarity matching requirement, the contour is actually sufficient for recognition, but it cannot be recognized because there is no related object in the library. In this case, it is determined to be a new spilled object. At this time, manual intervention is used to identify the spilled object, and the information of the new spilled object is updated to the target object recognition library to continuously expand its recognition range.

[0084] In this embodiment, the data dimension of the original image is first reduced by graying. Since the graying method is an adaptive method based on color, it can retain the pixel distribution of the real image and is more in line with the visual perception of the human eye. Affected by the light intensity, threshold segmentation cannot directly and accurately identify the contour features of the spilled object. Therefore, a pixel extreme value on the grayed image is selected and used as the pixel value of the background area to make the contrast between it and the identification area where the spilled object is located more obvious, so that the feature image obtained by threshold segmentation can be used to characterize the location of the spilled object, and then the feature image is used for target object matching and identification. If the similarity is low, it means that the real contour of the spilled object has not been segmented out. The pixel value of the background area can be adjusted step by step, and threshold segmentation can be performed again. In this way, a part of the area where the spilled object is located can be divided into the background area. Repeating the above operation can gradually bring the feature image close to the real contour of the spilled object until the feature image is sufficient to complete the matching and identification of the target object, thereby achieving accurate and rapid identification of the spilled object under the influence of light, thereby improving the effect of identifying road spilled objects.

[0085] Refer to the attached Figure 3 Based on the same inventive concept as in the above-mentioned embodiment, the embodiment of the present application further provides a road spillage identification device, comprising:

[0086] Grayscale module: The grayscale module is used to perform color-based adaptive grayscale conversion on the original image to obtain the road image to be identified;

[0087] An adjustment module, the adjustment module is used to adjust the pixel value of the background area of ​​the road image to be identified to an extreme value of the pixel on the road image to be identified, and update the road image to be identified to obtain a target recognition image;

[0088] The segmentation module is used to perform threshold segmentation based on the target recognition image to obtain a feature image;

[0089] The recognition module is used to match the target object based on the feature image. When the matching similarity is less than the similarity threshold, the pixel value of the background area is adjusted step by step according to the selection of the extreme value, and the threshold segmentation is returned based on the target recognition image to obtain the feature image, until the matching similarity is not less than the similarity threshold, the target scattered object is obtained to complete the recognition.

[0090] Those skilled in the art should understand that the division of the various modules in the embodiment is only a division of logical functions, and can be fully or partially integrated into one or more actual carriers in actual application, and these modules can be all implemented in the form of software called by the processing unit, or all implemented in the form of hardware, or implemented in the form of a combination of software and hardware. It should be noted that each module in the road spillage identification device in this embodiment corresponds one-to-one to each step in the road spillage identification method in the aforementioned embodiment. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned road spillage identification method, which will not be repeated here.

[0091] Based on the same inventive concept as in the aforementioned embodiment, the embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when loaded and executed by a processor, implements a road spillage identification method as provided in the embodiment of the present application.

[0092] Based on the same inventive concept as in the above-mentioned embodiment, an embodiment of the present application further provides an electronic device, including a processor and a memory, wherein:

[0093] The memory is used to store computer programs;

[0094] The processor is used to load and execute a computer program so that the electronic device executes the road spillage identification method provided in the embodiment of the present application.

[0095] In some embodiments, the computer readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or various devices including one or any combination of the above memories. The computer may be various computing devices including intelligent terminals and servers.

[0096] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.

[0097] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).

[0098] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.

[0099] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0100] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0101] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a multimedia terminal device (which can be a mobile phone, a computer, a television receiver, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0102] In summary, the present application provides a method, device, medium and equipment for road spillage recognition, which includes: performing color-based adaptive grayscale conversion on the original image to obtain a road image to be recognized; adjusting the pixel value of the background area of ​​the road image to be recognized to an extreme value of the pixel on the road image to be recognized, and updating the road image to be recognized to obtain a target recognition image; performing threshold segmentation based on the target recognition image to obtain a feature image; performing target object matching based on the feature image, and when the matching similarity is less than the similarity threshold, stepwise adjusting the pixel value of the background area according to the selection of the extreme value, and returning to the step of performing threshold segmentation based on the target recognition image to obtain the feature image, until the matching similarity is not less than the similarity threshold, and the target spillage is obtained to complete the identification. The present application first reduces the data dimension of the original image by graying. Since the graying method is an adaptive method based on color, it can retain the pixel distribution of the real image and is more in line with the visual perception of the human eye. Affected by the light intensity, the threshold segmentation cannot directly and accurately identify the contour features of the spilled object. Therefore, a pixel extreme value on the grayed image is selected and used as the pixel value of the background area to make the contrast between it and the identification area where the spilled object is located more obvious, so that the feature image obtained by the threshold segmentation can be used to characterize the location of the spilled object, and then the feature image is matched and identified for the target object. If the similarity is low, it means that the real contour of the spilled object has not been segmented out. The pixel value of the background area can be adjusted in steps, and the threshold segmentation can be performed again. In this way, a part of the area where the spilled object is located can be divided into the background area. Repeating the above operation can gradually bring the feature image close to the real contour of the spilled object until the feature image is sufficient to complete the matching and identification of the target object, thereby achieving accurate and rapid identification of the spilled object under the influence of light, thereby improving the effect of identifying road spilled objects.

[0103] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A method for identifying road spillage, characterized in that: The following steps are involved: Perform color-based adaptive grayscale conversion on the original image to obtain the road image to be identified; Adjusting the pixel value of the background area of ​​the road image to be identified to an extreme value of the pixel on the road image to be identified, and updating the road image to be identified to obtain a target recognition image; Perform threshold segmentation based on the target recognition image to obtain a feature image; Target object matching is performed based on the feature image. When the matching similarity is less than the similarity threshold, the pixel value of the background area is adjusted step by step according to the selection of the extreme value, and the step of performing threshold segmentation based on the target recognition image to obtain the feature image is returned until the matching similarity is not less than the similarity threshold, and the target scattered object is obtained to complete the recognition.

2. The road spillage identification method according to claim 1, characterized in that: The step of performing color-based adaptive grayscale conversion on the original image to obtain the road image to be identified includes: Perform color recognition on the original image to obtain color distribution and intensity information; According to the color distribution and intensity information, the weights of the three RGB channels are adjusted to perform grayscale conversion to obtain a road image to be identified.

3. The road spillage identification method according to claim 1, characterized in that: Before adjusting the pixel value of the background area of ​​the road image to be identified to an extreme value of the pixel on the road image to be identified, the method further includes: Based on the position of the target scattered object, the area to be identified and the background area are marked on the road image to be identified.

4. The road spillage identification method according to claim 3, characterized in that: The step of marking the area to be identified and the background area on the road image to be identified based on the position of the target scattered object comprises: Based on the position of the target scattered object, marking a first area to be identified on the road image to be identified; Expand the outline of the first area to be identified by a target pixel unit to obtain an area to be identified; The background area is obtained based on an area other than the to-be-recognized area on the to-be-recognized road image.

5. The road spillage identification method according to claim 1, characterized in that: After performing threshold segmentation based on the target recognition image to obtain a feature image, the method further includes: The feature image is subtracted from the background image to obtain a target feature image; wherein the background image is an image with the same size as the feature image, and the pixels of the background image are the same as the pixels of the background area.

6. The road spillage identification method according to claim 1, characterized in that: The stepwise adjustment of the pixel value of the background area according to the selection of the extreme value comprises: According to the selection of the extreme value as the maximum value, the pixel value of the background area is step-adjusted to decrease, or, according to the selection of the extreme value as the minimum value, the pixel value of the background area is step-adjusted to increase.

7. The road spillage identification method according to claim 1, characterized in that: Before performing target object matching based on the feature image, the method further includes: Establishing a target object recognition library; wherein the target object recognition library contains a number of targets and their feature information, and the feature information includes feature information extracted from identifying the target object from different directions; The target object matching based on the feature image includes: Based on the feature image, target matching is performed in the target recognition library.

8. A road spill identification device, characterized in that: include: A grayscale module, which is used to perform color-based adaptive grayscale conversion on the original image to obtain a road image to be identified; An adjustment module, the adjustment module is used to adjust the pixel value of the background area of ​​the road image to be identified to an extreme value of the pixel on the road image to be identified, and update the road image to be identified to obtain a target recognition image; A segmentation module, the segmentation module is used to perform threshold segmentation based on the target recognition image to obtain a feature image; The recognition module is used to match the target object based on the feature image. When the matching similarity is less than the similarity threshold, the pixel value of the background area is adjusted step by step according to the selection of the extreme value, and the threshold segmentation based on the target recognition image is returned to obtain the feature image, until the matching similarity is not less than the similarity threshold, and the target scattered object is obtained to complete the recognition.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is loaded and executed by a processor, the road spillage identification method according to any one of claims 1 to 7 is implemented.

10. An electronic device, characterized in that: comprising a processor and a memory, wherein: The memory is used to store computer programs; The processor is used to load and execute the computer program so that the electronic device executes the road spillage identification method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Road throwing object detection method, electronic equipment and storage medium

    CN114694060A

  • Highway thrown object detection method and device based on background model and tracking

    CN116434160A

  • Computer-implemented method of detecting foreign object on background object in an image, apparatus for detecting foreign object on background object in an image, and computer-program product

    US20210233245A1

  • Image processing method and apparatus, device, and storage medium

    WO2021120455A1