A method and device for detecting a retroreflective strip
By combining infrared and visible light image processing technologies, the installation status of vehicle reflective strips is identified, solving the problem of inaccurate reflective strip detection in adverse weather conditions and achieving efficient reflective strip detection and illegal behavior identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-17
- Publication Date
- 2026-03-17
AI Technical Summary
In adverse weather conditions or at night when visible light images are poor, reflective strip detection is inaccurate, and existing technologies struggle to effectively identify whether vehicles have affixed or installed reflective strips as required.
By combining infrared and visible light images of the vehicle, the system identifies the vehicle model, crops the image area, and performs adaptive grayscale thresholding to comprehensively determine the installation status of the reflective strips. Logical operations are then used to determine the authenticity of the reflective strips.
It improves the accuracy of reflective strip detection, enabling effective identification of reflective strips under various weather conditions, combating illegal activities, and ensuring road safety.
Smart Images

Figure CN114298987B_ABST
Abstract
Description
Technical Field
[0001] This application relates to image processing technology, and in particular to a method and apparatus for detecting reflective stripes. Background Technology
[0002] Reflective strips, a common safety device, are affixed to the rear and sides of trucks and trailers to reflect ambient light at night, thus serving as a warning to pedestrians and drivers.
[0003] To ensure road safety, it is often necessary to check whether vehicles have affixed or installed reflective strips as required. However, in some current application scenarios, such as inclement weather or poor visible light imaging at night, the detection of reflective strips is often inaccurate. Summary of the Invention
[0004] This application provides a method and apparatus for detecting reflective strips, so as to improve the detection accuracy of reflective strips.
[0005] This application provides a method for detecting reflective stripes, which is applied to an image acquisition device and includes:
[0006] Obtain visible light and infrared images of the same target vehicle acquired at the same time;
[0007] Identify the vehicle model of the target vehicle in the visible light image, and the position information of the target vehicle in the visible light image when the vehicle model is the target vehicle model; the target vehicle model is the vehicle model that is designated to have reflective strips installed or affixed.
[0008] The visible light image is cropped based on the location information to obtain a visible light vehicle body area image, and the infrared image is cropped based on the location information to obtain an infrared vehicle body area image;
[0009] The visible light vehicle body area image is binarized according to the specified reflective strip attributes to obtain a visible light mask image; and a grayscale threshold for binarization is adaptively determined according to the brightness of the reflective strip area in the infrared vehicle body area image, and the infrared vehicle body area image is binarized according to the grayscale threshold to obtain an infrared mask image.
[0010] The target vehicle is checked for the presence or absence of compliant reflective strips based on visible light mask images and infrared mask images.
[0011] This application provides a reflective stripe detection device, which is applied to an image acquisition device and includes:
[0012] The acquisition unit is used to acquire visible light and infrared images of the same target vehicle collected at the same time.
[0013] The identification unit is used to identify the vehicle model of the target vehicle in the visible light image, and the position information of the target vehicle in the visible light image when the vehicle model is the target vehicle model; the target vehicle model is the vehicle model that is designated to have reflective strips installed or affixed.
[0014] The processing unit is configured to: crop the visible light image based on the location information to obtain a visible light vehicle body region image; crop the infrared image based on the location information to obtain an infrared vehicle body region image; binarize the visible light vehicle body region image according to a specified reflective stripe attribute to obtain a visible light mask image; and adaptively determine a grayscale threshold for binarization based on the brightness of the reflective stripe region in the infrared vehicle body region image, and binarize the infrared vehicle body region image according to the grayscale threshold to obtain an infrared mask image.
[0015] The detection unit is used to detect whether the target vehicle has installed or affixed reflective strips that meet the requirements, based on the visible light mask image and the infrared mask image.
[0016] This application also provides an electronic device. The electronic device includes: a processor and a machine-readable storage medium;
[0017] The machine-readable storage medium stores machine-executable instructions that can be executed by the processor;
[0018] The processor is used to execute machine-executable instructions to implement the steps of the disclosed method.
[0019] As can be seen from the above technical solutions, this embodiment combines the reflective characteristics of the reflective strips in the infrared image of the vehicle with the properties of the reflective strips in the visible light image of the vehicle to comprehensively determine whether the vehicle has installed or pasted reflective strips that meet the requirements, which realizes the detection of reflective strips that meet the requirements.
[0020] Furthermore, in this embodiment, by combining the infrared image and the visible light image of the vehicle to comprehensively detect the reflective strips, the problem caused by relying solely on the visible light image to identify the reflective strips can be effectively solved, and the problem of poor accuracy in identifying reflective strips under conditions of dirt, obstruction, and bad weather can also be avoided.
[0021] Furthermore, this embodiment not only detects whether the target vehicle has installed or affixed reflective strips, but also determines the authenticity of the reflective strips, which can combat the illegal behavior of vehicles not affixing reflective markings as required. Attached Figure Description
[0022] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0023] Figure 1 A flowchart illustrating the method provided in this application embodiment;
[0024] Figure 2 This is a flowchart illustrating the implementation of a visible light mask image provided in an embodiment of this application.
[0025] Figure 3 A flowchart of the adaptive grayscale threshold determination method provided in the embodiments of this application;
[0026] Figure 4 This is a flowchart illustrating the implementation of the infrared mask image provided in the embodiments of this application.
[0027] Figure 5 This is a structural diagram of the device provided in the embodiments of this application;
[0028] Figure 6 This is a structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0029] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0030] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0031] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of this application, and to make the above-mentioned objectives, features and advantages of the embodiments of this application more apparent and understandable, the technical solutions in the embodiments of this application will be further described in detail below with reference to the accompanying drawings.
[0032] See Figure 1 , Figure 1 This is a flowchart illustrating a method provided in an embodiment of this application. This process can be applied to image acquisition devices such as snapshot cameras. Optionally, in this embodiment, if... Figure 1 If the process shown is applied to a traffic checkpoint, the image acquisition device described above can be a capture camera installed on a traffic gantry.
[0033] like Figure 1 As shown, the process may include the following steps:
[0034] Step 101: Obtain visible light and infrared images of the same target vehicle collected at the same time.
[0035] In one example, suppose the reflective strip is required to be installed or affixed to the rear of the vehicle. To ensure that the reflective strip is present in both the final visible light and infrared images, the image acquisition device may optionally capture both a visible light image and an infrared image of the vehicle simultaneously when it detects that the distance between the rear of the vehicle and the trigger line deployed on the ground is less than or equal to a specified distance. The vehicle whose rear is less than or equal to the specified distance from the trigger line can be considered the target vehicle. This ultimately achieves the goal of obtaining both a visible light image and an infrared image of the same target vehicle captured simultaneously, as described in step 101.
[0036] Here, the trigger line is set primarily to ensure that both the final captured visible light and infrared images contain reflective stripes. As for the specified distance, it can be set according to actual needs; this embodiment does not impose a specific limitation.
[0037] It should be noted that, in order to ensure that the visible light and infrared images of the target vehicle captured are clear and undistorted, in this embodiment, the image acquisition device can also turn on the strobe light or supplementary light according to the current environment when capturing the visible light and infrared images of the target vehicle.
[0038] It should also be noted that, to ensure the accuracy of the final reflective strip detection results, the obtained visible light image and infrared image can be registered before performing the following steps to ensure that the same object is positioned consistently in both images. As for how to perform the registration, existing registration methods can be referenced, and will not be specified here.
[0039] Step 102: Identify the vehicle type of the target vehicle in the visible light image, and the location information of the target vehicle in the visible light image when the vehicle type is the target vehicle type.
[0040] In this embodiment, generally only vehicles such as trailers, trucks, and special vehicles need to have reflective strips installed or affixed, while other vehicles such as cars and buses do not. Under this premise, the target vehicle type in this embodiment can be the vehicle type designated to have reflective strips installed or affixed, such as trailers, trucks, and special vehicles.
[0041] Optionally, in this embodiment, identifying the vehicle model of the target vehicle in the visible light image, and the target vehicle's location information in the visible light image when the vehicle model is the target model, can be achieved using a trained vehicle localization and recognition model based on the SSD algorithm. Specifically, the visible light image can be input into the trained vehicle localization and recognition model based on the SSD algorithm to obtain the output result. In one example, the output result can be location information (specifically, the output is the target vehicle's location information in the visible light image when the target vehicle's vehicle model is the target model). In another example, if the target vehicle's vehicle model in the visible light image is not the target model, the output result can directly be the target vehicle's vehicle model.
[0042] The training method for the aforementioned vehicle localization and recognition model can be summarized as follows: Collect captured vehicle images (taken from behind), and label the vehicle's location and model information. Specifically, draw the smallest rectangle containing the vehicle body, save the rectangle's coordinates (i.e., the vehicle's location), and the model information includes sedans, buses, trailers, and trucks, with trailers, trucks, and special vehicles designated as target models (reflective strips must be affixed). Then, create a dataset using the labeled vehicle model and location images, and train the SSD-based vehicle localization and recognition model based on this dataset. This ultimately trains the aforementioned SSD-based vehicle localization and recognition model. Subsequently, this SSD-based vehicle localization and recognition model can be used to identify the model of a target vehicle in a visible light image, and, if the model matches the target model, further identify the target vehicle's location information in the visible light image.
[0043] Step 103: Based on the above location information, crop the visible light image to obtain a visible light vehicle body area image, and based on the above location information, crop the infrared image to obtain an infrared vehicle body area image.
[0044] Finally, step 103 ensures that the visible light vehicle body area image and the infrared vehicle body area image generally only contain the vehicle body of the target vehicle, eliminating other unnecessary areas.
[0045] Step 104: Binarize the visible light vehicle body area image according to the specified reflective strip attributes to obtain a visible light mask image; and adaptively determine the grayscale threshold for binarization based on the brightness of the reflective strip area in the infrared vehicle body area image, and binarize the infrared vehicle body area image according to the grayscale threshold to obtain an infrared mask image.
[0046] Reflective strips generally have specific requirements, such as alternating red and white stripes or defined dimensions. Therefore, in this embodiment, these requirements can be set as the aforementioned specified reflective strip attributes. Based on this, as described in step 104, in this embodiment, the visible light vehicle body area image is binarized using the specified reflective strip attributes to remove the background of the reflective strip in the visible light vehicle body area image, ultimately obtaining a visible light mask image that only indicates the reflective strip area. As for how to perform binarization processing on the visible light vehicle body area image based on the specified reflective strip attributes to obtain the visible light mask image... Figure 2 One specific implementation is described as an example, which will not be elaborated on here.
[0047] Furthermore, due to the inherent characteristics of reflective strips, the brightness of the reflective strip area in the infrared vehicle body image is generally higher than that of other areas of the vehicle body. Therefore, optionally, in this embodiment, a grayscale threshold for binarization processing can be adaptively determined based on the brightness of the reflective strip area in the infrared vehicle body image. Then, the infrared vehicle body image is binarized based on the grayscale threshold to obtain an infrared mask image indicating the reflective strip area. The specific methods for adaptively determining the grayscale threshold for binarization processing based on the brightness of the reflective strip area in the infrared vehicle body image, and for binarizing the infrared vehicle body image based on the grayscale threshold, are described below through examples and are not further limited here.
[0048] Step 105: Detect whether the target vehicle has installed or affixed reflective strips that meet the requirements based on the visible light mask image and infrared mask image.
[0049] Optionally, in this embodiment, the visible light mask image and the infrared mask image can be configured to perform logical operations according to logical rules, and the result of the logic can be used to determine whether the target vehicle has installed or affixed reflective strips, and if so, the authenticity of the reflective strips. Here, whether the target vehicle has installed or affixed reflective strips, and the authenticity of the reflective strips, are collectively referred to as whether the target vehicle has installed or affixed reflective strips that meet the requirements, as described in step 105.
[0050] Optionally, as an embodiment, the above logical rule can be a logical AND operation. For example, a logical AND operation can be performed on the visible light mask image and the infrared mask image to obtain a logical result; when the logical result is 0, it is determined that the target vehicle has not installed or pasted a compliant reflective strip; otherwise, it is determined that the target vehicle has installed or pasted a compliant reflective strip.
[0051] Ultimately, through steps 101 to 105 above, the method of detecting whether the target vehicle has installed or affixed reflective strips that meet the requirements was achieved.
[0052] This concludes the process. Figure 1 The process is shown below.
[0053] pass Figure 1 As can be seen from the process shown, this embodiment combines the reflective characteristics of the reflective strips in the infrared image of the vehicle with the properties of the reflective strips in the visible light image of the vehicle to comprehensively determine whether the vehicle has installed or pasted reflective strips that meet the requirements, which realizes the detection of reflective strips that meet the requirements.
[0054] Furthermore, in this embodiment, by combining the infrared image and the visible light image of the vehicle to comprehensively detect the reflective strips, the problem caused by relying solely on the visible light image to identify the reflective strips can be effectively solved, and the problem of poor accuracy in identifying reflective strips under conditions of dirt, obstruction, and bad weather can also be avoided.
[0055] Furthermore, this embodiment not only detects whether the target vehicle has installed or affixed reflective strips, but also determines the authenticity of the reflective strips, which can combat the illegal behavior of vehicles not affixing reflective markings as required.
[0056] The following describes how, in step 104, the visible light vehicle body area image is binarized based on the specified reflective strip attributes to obtain the visible light mask image:
[0057] See Figure 2 , Figure 2 This is a flowchart illustrating the implementation of a visible light mask image provided in an embodiment of this application. Figure 2 As shown, the process may include the following steps:
[0058] Step 201: Input the visible light vehicle body area image into the trained reflective strip detection model to obtain reflective strip position information.
[0059] In short, in this embodiment, the reflective bar detection model can be trained in the following way: First, the positions of reflective bars in the sample images are manually labeled, specifically by drawing the smallest rectangle containing the reflective bars. The coordinates of the reflective bar rectangle are the positions of the reflective bars. Then, a training dataset is created using the sample images with labeled reflective bar positions. The reflective bar detection model based on the SSD algorithm is then trained using the training dataset. Finally, the reflective bar detection model is trained.
[0060] Based on this, in step 201, the visible light vehicle body area image is input into the aforementioned reflective strip detection model, which will then output the reflective strip position information. It should be noted that if the target vehicle does not have reflective strips installed or affixed, the reflective strip position information may be a default position, such as the default location where reflective strips are installed or affixed, or it may be a misidentified reflective strip position due to error, such as when the target vehicle is mistakenly assumed to have reflective strips installed or affixed. This embodiment does not specifically limit this.
[0061] Step 202: Obtain an initial image of the same size as the visible light vehicle body area image, and initialize the grayscale value of all pixels in the initial image to 0.
[0062] Through step 202, a mask image of the same size as the original image (i.e., the visible vehicle body area) can be created, which is the initial image mentioned above. All pixels in the initial image are initialized to 0, and the final initial image becomes a completely black image.
[0063] Step 203: Fill the target area in the initial image corresponding to the position information of the reflective strip to obtain the first reference image; the gray value of the pixels in the filled target area is 255.
[0064] Step 203 allows setting all pixel values in the r1 region (target region) of the mask image (initial image) to 255, effectively turning the entire r1 region (target region) white.
[0065] Step 204: Based on the first reference image and the specified reflective strip attributes, the visible light vehicle body area image is binarized to obtain a visible light mask image.
[0066] As described above regarding the specified reflective strip attributes, optionally, in this embodiment, step 204 can use the first reference image and the specified reflective strip attributes to binarize the visible light vehicle body area image to obtain a visible light mask image. For example: first, use the first reference image and the visible light vehicle body area image to perform masking to obtain a second reference image; then, binarize the second reference image according to the specified reflective strip attributes so that the grayscale value of pixels in the second reference image that satisfy the specified reflective strip attributes is a first value, such as 255, and the grayscale value of pixels that do not satisfy the specified reflective strip attributes is a second value, such as 0, finally obtaining a third reference image; then, perform connected component detection on the third reference image and filter out connected components that do not meet the specified conditions from the third reference image to obtain a visible light mask image. Here, the specified conditions are only to remove some connected components that interfere with the reflective stripes, such as reflections caused by rear vehicle lights. It should be noted that this is only an example of how to use the first reference image and the specified reflective strip attributes to binarize the visible light vehicle body area image to obtain a visible light mask image, and is not intended to limit the scope of the application.
[0067] This concludes the process. Figure 2 The process is shown below.
[0068] pass Figure 2 The process shown demonstrates how to binarize a visible light vehicle body area image based on specified reflective strip attributes to obtain a visible light mask image.
[0069] The following describes how, in step 104, the grayscale threshold for binarization is adaptively determined based on the brightness of the reflective stripe region in the infrared vehicle body image:
[0070] See Figure 3 , Figure 3 A flowchart illustrating the adaptive grayscale threshold determination method provided in this application embodiment. Figure 3 As shown, the process may include the following steps:
[0071] Step 301: Compare the average brightness of the rear area of the vehicle where reflective strips are required to be deployed in the infrared vehicle body area image with a preset brightness threshold. If the average brightness is greater than or equal to the preset brightness threshold, proceed to step 302. If the average brightness is less than the preset brightness threshold, proceed to step 303.
[0072] Reflective strips are required to be deployed in the rear area of the vehicle, meaning the brightness of this area is generally higher than other areas. Therefore, by comparing the average brightness of the rear area where reflective strips are required in the infrared vehicle image with a preset brightness threshold, the target vehicle is categorized into two types: brighter and darker. A brighter vehicle is considered to have an average brightness greater than or equal to the preset brightness threshold, while a darker vehicle is considered to have an average brightness less than the preset brightness threshold.
[0073] Step 302: Obtain the grayscale histogram corresponding to the infrared vehicle body area image, and use a set sliding window to slide in the grayscale histogram to adaptively select a grayscale threshold that meets the specified conditions.
[0074] After obtaining the grayscale histogram, slide a sliding window (e.g., 3 pixels in size) across the grayscale histogram. If a grayscale value changes during the sliding process, the grayscale value is determined to be the aforementioned grayscale threshold.
[0075] Step 303: Obtain the grayscale histogram of the truncated infrared vehicle body area image. The maximum grayscale value of the truncated grayscale histogram is less than 255. Use the Otsu algorithm to adaptively select the grayscale threshold in the obtained grayscale histogram.
[0076] Step 303 is performed under the premise that the vehicle is in a relatively dark environment, that is, the average brightness value is less than the preset brightness threshold. Based on this, in order to reduce the workload, a part of the infrared vehicle body area image can be truncated. The gray value of the truncated part is relatively low, while the maximum gray value of the remaining part (referred to as the truncated infrared vehicle body area image) is also less than 255.
[0077] Then, as described in step 303, the Otsu algorithm is used to adaptively select a grayscale threshold in the obtained grayscale histogram. Here, the Otsu algorithm is used to automatically binarize clustered images, or to degenerate a grayscale image into a binary image. For details, please refer to the existing Otsu algorithm, which will not be elaborated here.
[0078] Finally, based on the above steps 302 to 303, it is possible to adaptively determine the corresponding grayscale threshold regardless of whether the average brightness of the rear area of the vehicle where reflective strips are required to be deployed in the infrared vehicle body area image is greater than or equal to the preset brightness threshold or less than the preset brightness threshold.
[0079] This completes the task. Figure 3 The process is shown below.
[0080] It should be noted that, Figure 3 This is merely an example illustrating how to adaptively determine the grayscale threshold for binarization based on the brightness of the reflective stripe area in the infrared vehicle body image; it is not intended to impose limitations.
[0081] The following describes how to perform binarization processing on the infrared vehicle body area image based on the grayscale threshold to obtain the infrared mask image in step 104:
[0082] See Figure 4 , Figure 4 This is a flowchart illustrating the implementation of the infrared mask image provided in an embodiment of this application. Figure 4 As shown, the process may include:
[0083] Step 401: Binarize the infrared vehicle body area image according to the grayscale threshold to obtain the fourth reference image.
[0084] For example, in this embodiment, the gray values of pixels with gray levels less than the gray level threshold in the infrared vehicle body area image can be reset to 0, while the gray values of pixels with gray levels greater than or equal to the gray level threshold can be reset to 255, thus achieving binarization processing of the infrared vehicle body area image.
[0085] Step 402: Perform connected component detection on the fourth reference image and filter out connected components that do not meet the specified conditions from the fourth reference image to obtain the infrared mask image.
[0086] Here, the specified conditions are only to remove some connected regions that interfere with the reflective strips, such as reflections caused by the taillights of other vehicles.
[0087] Finally, steps 401 to 402 were used to binarize the infrared vehicle body area image based on a grayscale threshold to obtain an infrared mask image. It should be noted that... Figure 4 This is just an example and is not intended to be limiting.
[0088] The methods provided in the embodiments of this application have been described above. The apparatus provided in the embodiments of this application is described below:
[0089] See Figure 5 , Figure 5 A structural diagram of a device provided in an embodiment of this application. The device is applied to an image acquisition equipment and includes:
[0090] The acquisition unit is used to acquire visible light and infrared images of the same target vehicle collected at the same time.
[0091] The identification unit is used to identify the vehicle model of the target vehicle in the visible light image, and the position information of the target vehicle in the visible light image when the vehicle model is the target vehicle model; the target vehicle model is the vehicle model that is designated to have reflective strips installed or affixed.
[0092] The processing unit is configured to: crop the visible light image based on the location information to obtain a visible light vehicle body region image; crop the infrared image based on the location information to obtain an infrared vehicle body region image; binarize the visible light vehicle body region image according to a specified reflective stripe attribute to obtain a visible light mask image; and adaptively determine a grayscale threshold for binarization based on the brightness of the reflective stripe region in the infrared vehicle body region image, and binarize the infrared vehicle body region image according to the grayscale threshold to obtain an infrared mask image.
[0093] The detection unit is used to detect whether the target vehicle has installed or affixed reflective strips that meet the requirements, based on the visible light mask image and the infrared mask image.
[0094] Optionally, the acquisition unit acquires visible light and infrared images of the same target vehicle acquired at the same time, including:
[0095] When the distance between the rear of the target vehicle and the trigger line deployed on the ground is less than or equal to a specified distance, both visible light and infrared images of the target vehicle are captured simultaneously.
[0096] Optionally, the processing unit performs binarization processing on the visible light vehicle body area image to obtain a visible light mask image based on the specified reflective strip attributes, including: inputting the visible light vehicle body area image into a trained reflective strip detection model to obtain reflective strip position information; obtaining an initial image of the same size as the visible light vehicle body area image, wherein the grayscale value of all pixels in the initial image is initialized to 0; filling the target area in the initial image corresponding to the reflective strip position information to obtain a first reference image; wherein the grayscale value of the pixels in the filled target area is 255; and performing binarization processing on the visible light vehicle body area image based on the first reference image and the specified reflective strip attributes to obtain a visible light mask image.
[0097] Optionally, the processing unit performs binarization processing on the visible light vehicle body area image to obtain a visible light mask image based on the first reference image and the specified reflective stripe attribute, including: performing mask processing on the first reference image and the visible light vehicle body area image to obtain a second reference image; performing binarization processing on the second reference image based on the specified reflective stripe attribute, so that the grayscale value of pixels in the second reference image that satisfy the specified reflective stripe attribute is a first value, and the grayscale value of pixels that do not satisfy the specified reflective stripe attribute is a second value, to obtain a third reference image; performing connected component detection on the third reference image, and filtering out connected components that do not meet the specified conditions from the third reference image to obtain a visible light mask image.
[0098] Optionally, the processing unit adaptively determines the grayscale threshold for binarization based on the brightness of the reflective strip area in the infrared vehicle body area image, including: when the average brightness of the rear area of the vehicle body area image where reflective strips are required is greater than or equal to a preset brightness threshold, obtaining the grayscale histogram corresponding to the infrared vehicle body area image, and using a set sliding window to slide in the grayscale histogram to adaptively select a grayscale threshold that meets the specified conditions; when the average brightness of the rear area in the infrared vehicle body area image is less than the preset brightness threshold, obtaining the grayscale histogram of the truncated infrared vehicle body area image, wherein the maximum grayscale value of the truncated grayscale histogram is less than 255, and using the Otsu algorithm to adaptively select a grayscale threshold in the obtained grayscale histogram.
[0099] Optionally, the processing unit performs binarization processing on the infrared vehicle body area image based on the grayscale threshold to obtain an infrared mask image, including: performing binarization processing on the infrared vehicle body area image based on the grayscale threshold to obtain a fourth reference image; performing connected component detection on the fourth reference image, and filtering out connected components that do not meet the specified conditions from the fourth reference image to obtain an infrared mask image.
[0100] Optionally, the detection unit detects whether the target vehicle has installed or affixed a compliant reflective strip based on the visible light mask image and the infrared mask image by: performing a logical AND operation on the visible light mask image and the infrared mask image to obtain a logical result; when the logical result is 0, it is determined that the target vehicle has not installed or affixed a compliant reflective strip; otherwise, it is determined that the target vehicle has installed or affixed a compliant reflective strip.
[0101] This concludes the process. Figure 5 Structural description of the device shown.
[0102] This application also provides embodiments that... Figure 5 The hardware structure of the device shown. See also Figure 6 , Figure 6 This is a structural diagram of an electronic device provided in an embodiment of this application. Figure 6 As shown, the hardware structure may include: a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor; the processor is used to execute the machine-executable instructions to implement the method disclosed in the above example of this application.
[0103] Based on the same application concept as the above method, this application embodiment also provides a machine-readable storage medium storing a plurality of computer instructions, which, when executed by a processor, can implement the method disclosed in the above examples of this application.
[0104] For example, the aforementioned machine-readable storage medium can be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, etc. For instance, machine-readable storage media can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid-state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or combinations thereof.
[0105] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which can take the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email sending and receiving device, game console, tablet computer, wearable device, or any combination of these devices.
[0106] For ease of description, the above devices are described separately by function as various units. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.
[0107] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0108] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0109] Furthermore, these computer program instructions can also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in the process. Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0110] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0111] The above description is merely an embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of this application should be included within the scope of the claims of this application.
Claims
1. A method of detecting a retroreflective strip, characterized by, The method is applied to an image acquisition device located outside a vehicle, comprising: obtaining a visible light image and an infrared image of a same target vehicle collected at a same time; identifying a vehicle model of the target vehicle in the visible light image, and position information of the target vehicle in the visible light image when the vehicle model is a target vehicle model; the target vehicle model is a vehicle model designated to be required to install or paste a reflective strip; the reflective strip is located at a tail of the vehicle; cutting the visible light image according to the position information in the visible light image to obtain a visible light vehicle body region image, and cutting the infrared image according to the position information in the visible light image to obtain an infrared vehicle body region image; performing binaryzation processing on the visible light vehicle body region image according to a designated reflective strip attribute to obtain a visible light mask Mask image, the reflective strip attribute including size information, and the visible light mask Mask image indicating a reflective strip region; and a reflective strip region in the infrared vehicle body region image has higher brightness than other regions of the vehicle body, a gray threshold value for performing binaryzation processing is adaptively determined according to brightness of the reflective strip region in the infrared vehicle body region image, and binaryzation processing is performed on the infrared vehicle body region image according to the gray threshold value to obtain an infrared Mask image, the infrared Mask image indicating the reflective strip region; performing logical operation on the visible light Mask image indicating the reflective strip region and the infrared Mask image indicating the reflective strip region, and detecting whether the target vehicle is installed or pasted with a required reflective strip according to a logical operation result; when the logical result is 0, it is determined that the target vehicle is not installed or pasted with the required reflective strip, otherwise, it is determined that the target vehicle is installed or pasted with the required reflective strip; the binaryzation processing on the infrared vehicle body region image according to the gray threshold value to obtain the infrared Mask image comprises: performing binaryzation processing on the infrared vehicle body region image according to the gray threshold value to obtain a fourth reference image; performing connected domain detection on the fourth reference image, and screening out a connected domain not meeting a designated condition from the fourth reference image to obtain the infrared Mask image.
2. The method of claim 1, wherein, the obtaining of the visible light image and the infrared image of the same target vehicle collected at the same time comprises: simultaneously capturing the visible light image and the infrared image of the target vehicle when it is detected that a distance between a tail of the target vehicle and a trigger line deployed on the ground is less than or equal to a designated distance.
3. The method of claim 1, wherein, the binaryzation processing on the visible light vehicle body region image according to the designated reflective strip attribute to obtain the visible light mask Mask image comprises: inputting the visible light vehicle body region image into a trained reflective strip detection model to obtain reflective strip position information; obtaining an initial image with a same size as the visible light vehicle body region image, and initializing a gray value of all pixel points in the initial image to 0; filling a target region corresponding to the reflective strip position information in the initial image to obtain a first reference image; a gray value of a pixel point in the filled target region is 255; The first reference image is used to binarize the visible light vehicle body region image to obtain a visible light Mask image according to the specified retroreflective strip attribute.
4. The method of claim 3, wherein, The binarization of the visible light vehicle body region image according to the first reference image and the specified retroreflective strip attribute comprises: The first reference image and the visible light vehicle body region image are used to perform mask processing to obtain a second reference image; The second reference image is binarized according to the specified retroreflective strip attribute, so that the gray value of a pixel point in the second reference image that meets the specified retroreflective strip attribute is a first value, and the gray value of a pixel point that does not meet the specified retroreflective strip attribute is a second value, to obtain a third reference image; The third reference image is subjected to connected domain detection, and connected domains that do not meet the specified condition are filtered out from the third reference image to obtain a visible light Mask image.
5. The method of claim 1, wherein, The gray threshold value used for binarization is adaptively determined according to the brightness of the retroreflective strip region in the infrared vehicle body region image, comprising: When the average brightness of the tail region of the vehicle in which the retroreflective strip is required to be deployed in the infrared vehicle body region image is greater than or equal to a preset brightness threshold value, a gray histogram corresponding to the infrared vehicle body region image is obtained, and a set sliding window is used to slide in the gray histogram to adaptively select a gray threshold value that meets the specified condition; When the average brightness of the tail region of the vehicle in which the retroreflective strip is required to be deployed in the infrared vehicle body region image is less than a preset brightness threshold value, a gray histogram of the infrared vehicle body region image that has been truncated is obtained, wherein the maximum gray value of the truncated gray histogram is less than 255, and an Otsu algorithm is used to adaptively select a gray threshold value in the obtained gray histogram.
6. A retroreflective strip detection apparatus characterized by, The device is applied to an image acquisition device located outside the vehicle, comprising: An obtaining unit is configured to obtain a visible light image and an infrared image of a same target vehicle collected at a same time; An identifying unit is configured to identify a vehicle model of the target vehicle in the visible light image, and identify position information of the target vehicle in the visible light image when the vehicle model is a target vehicle model; the target vehicle model is a vehicle model that is specified to need to be installed or pasted with a retroreflective strip; the retroreflective strip is located at a tail of the vehicle; A processing unit is configured to crop the visible light image according to the position information in the visible light image to obtain a visible light vehicle body region image, and crop the infrared image according to the position information in the visible light image to obtain an infrared vehicle body region image; and The visible light body area image is binarized according to the specified retroreflective strip attribute to obtain a visible light mask Mask image, the retroreflective strip attribute including size information, and the retroreflective strip region being indicated by the visible light mask Mask image; and the brightness of the retroreflective strip region in the infrared body area image is higher than that of other regions of the body, the gray threshold value for binarization processing is adaptively determined according to the brightness of the retroreflective strip region in the infrared body area image, the infrared body area image is binarized according to the gray threshold value to obtain an infrared mask Mask image, and the retroreflective strip region is indicated by the infrared mask Mask image; the binarization of the infrared body area image according to the gray threshold value to obtain the infrared mask Mask image includes: binarizing the infrared body area image according to the gray threshold value to obtain a fourth reference image; performing connected domain detection on the fourth reference image, and screening out connected domains that do not meet the specified condition from the fourth reference image to obtain the infrared mask Mask image. The detection unit performs logical operation on the visible light mask Mask image indicating the retroreflective strip region and the infrared mask Mask image indicating the retroreflective strip region, and detects whether the target vehicle is installed or pasted with the retroreflective strip meeting the requirements according to the logical operation result; when the logical result is 0, it is determined that the target vehicle is not installed or pasted with the retroreflective strip meeting the requirements, otherwise, it is determined that the target vehicle is installed or pasted with the retroreflective strip meeting the requirements.
7. The apparatus of claim 6, wherein, The processing unit binarizes the visible light body area image according to the specified retroreflective strip attribute to obtain a visible light mask Mask image, which includes: inputting the visible light body area image into a trained retroreflective strip detection model to obtain retroreflective strip position information; obtaining an initial image with the same size as the visible light body area image, and initializing the gray value of all pixel points in the initial image to 0; filling a target region corresponding to the retroreflective strip position information in the initial image to obtain a first reference image; the gray value of the pixel points in the filled target region is 255; binarizing the visible light body area image according to the first reference image and the specified retroreflective strip attribute to obtain a visible light mask Mask image; wherein binarizing the visible light body area image according to the first reference image and the specified retroreflective strip attribute to obtain the visible light mask Mask image at least includes: performing mask processing on the first reference image and the visible light body area image to obtain a second reference image; binarizing the second reference image according to the specified retroreflective strip attribute, so that the gray value of the pixel points meeting the specified retroreflective strip attribute in the second reference image is a first value, and the gray value of the pixel points not meeting the specified retroreflective strip attribute is a second value, to obtain a third reference image; performing connected domain detection on the third reference image, and screening out connected domains that do not meet the specified condition from the third reference image to obtain the visible light mask Mask image.
8. The apparatus of claim 6, wherein, The processing unit adaptively determines the gray threshold value for the binarization processing according to the brightness of the reflective strip region in the infrared vehicle body region image, comprising: when the average brightness of the vehicle tail region in the infrared vehicle body region image, where the reflective strip is required to be arranged, is greater than or equal to a preset brightness threshold value, obtaining the gray histogram corresponding to the infrared vehicle body region image, and sliding a set sliding window in the gray histogram to adaptively select a gray threshold value satisfying a specified condition; when the average brightness of the vehicle tail region in the infrared vehicle body region image is less than the preset brightness threshold value, obtaining the gray histogram of the infrared vehicle body region image that has been truncated, wherein the maximum gray value of the truncated gray histogram is less than 255, and adaptively selecting a gray threshold value in the obtained gray histogram by using the Otsu algorithm.
Citation Information
Patent Citations
Visible light and infrared light fused target recognition method
CN111611905A
Visible light and infrared fusion image-based object detection method and apparatus
WO2020171281A1