Safety helmet detection method and system under low light condition
Through multi-sensor data fusion technology combining infrared and optical images under low light conditions, image enhancement is used using deformable convolution and Retinex algorithm, and object detection is performed using feature pyramid network and YOLOv8 model, the problem of degraded safety helmet detection accuracy under low light conditions is solved, and higher detection accuracy and robustness are achieved.
Patent Information
- Application Number
- CN202411597369.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-03-21
AI Technical Summary
Under low light conditions, traditional safety helmet detection methods are difficult to maintain high accuracy, resulting in a decrease in detection accuracy and frequent occurrence of false detection and missed detection.
A safety helmet detection method under low light conditions is adopted to enhance the optical image by acquiring infrared images and optical images of the same scene, combining the image enhancement framework of deformable convolution, MSR and MSRCR, and then feature the enhanced optical image with the infrared image, and object detection is performed using the feature pyramid network and YOLOv8 model.
Through multi-sensor data fusion and advanced image enhancement technology, the accuracy and robustness of safety helmet detection in low-light conditions are significantly improved, missed and missed detection phenomena are reduced, and the adaptability and reliability of the detection system are improved.
Smart Images

Figure CN119672480A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a method and system for detecting a helmet under low-light conditions. Background Art
[0002] In modern industry and construction, the wearing of hard hats is essential to ensure the safety of workers. Whether at construction sites, power maintenance sites, or in mining operations, hard hats can effectively protect workers from falling objects or other external forces and reduce the risk of head injuries. However, traditional hard hat detection methods mainly rely on manual inspections, which are inefficient and easily affected by human factors, resulting in missed inspections or false inspections. With the rapid development of automation and intelligent monitoring technology, automated hard hat detection using image processing technology has become an effective means to improve operational safety.
[0003] In the field of intelligent helmet detection, traditional optical image processing methods perform well in sufficient light and can accurately identify whether workers are wearing helmets. However, in actual application scenarios, due to factors such as weather changes, insufficient lighting conditions, and nighttime operations, the contrast and brightness of optical images are insufficient, resulting in blurring and loss of details. This significantly reduces the performance of traditional detection methods in low-light environments, making it difficult to maintain high accuracy.
[0004] To solve these problems, infrared imaging technology has gradually been introduced into helmet detection as a detection method that does not rely on visible light. Infrared imaging can work normally in complete darkness or low light conditions by capturing the thermal radiation information of objects, which complements the shortcomings of visible light imaging under these conditions. However, there are still limitations to relying solely on infrared imaging, especially when distinguishing helmets from backgrounds or other heat sources. In order to fully utilize the advantages of infrared and visible light, the fusion technology combining multi-sensor data has become an effective way to improve detection accuracy and robustness. Summary of the invention
[0005] Based on this, it is necessary to provide a method and system for detecting safety helmets under low-light conditions to address the above-mentioned technical problems, so as to improve the accuracy of safety helmet detection under low-light conditions.
[0006] In a first aspect, the present application provides a method for detecting a helmet under low light conditions. The method comprises:
[0007] Acquire infrared and optical images of the same scene;
[0008] Based on the image enhancement framework combining deformable convolution, MSR and MSRCR, an optically enhanced image corresponding to the optical image is obtained;
[0009] The optically enhanced image and the infrared image are feature fused to obtain a fused feature map, and target detection is performed based on the fused feature map to obtain the detection result of the helmet.
[0010] In one embodiment, after acquiring the infrared image and the optical image of the same scene, the method further includes:
[0011] The affine transformation matrix between the infrared image and the optical image is constructed based on the random sampling consensus algorithm; the infrared image and the optical image are registered using the affine transformation matrix.
[0012] In one embodiment, based on an image enhancement framework combining deformable convolution, MSR and MSRCR, obtaining an optically enhanced image corresponding to an optical image includes:
[0013] Use deformable convolutional neural network to extract features from optical images and obtain feature images;
[0014] The feature image is processed by using the MSR algorithm to separate the illumination effect and the reflection feature in the feature image to obtain a first enhanced image;
[0015] The first enhanced image is processed by using the MSRCR algorithm, the color information of the first enhanced image is compensated, and an enhanced optical image is obtained.
[0016] In one embodiment, performing feature fusion on the optically enhanced image and the infrared image to obtain a fused feature map includes:
[0017] The enhanced optical image and infrared image are input into the feature pyramid network to obtain multi-scale fused feature maps.
[0018] In one embodiment, target detection is performed based on the fused feature map, and obtaining the detection result of the helmet includes:
[0019] The fused feature map is input into the detection head of YOLOv8 for target detection to obtain the detection result of the helmet.
[0020] In one embodiment, the method further comprises:
[0021] Perform target detection based on the fused feature map to obtain the detection result of the human head;
[0022] Based on the detection results of the helmet and the head, annotations are made in the optical image.
[0023] In a second aspect, the present application also provides a safety helmet detection system under low light conditions. The system comprises:
[0024] An image acquisition module, used to acquire infrared images and optical images of the same scene;
[0025] An image enhancement module, for obtaining an optically enhanced image corresponding to the optical image based on an image enhancement framework combining deformable convolution, MSR and MSRCR;
[0026] The target recognition module is used to fuse the features of the optically enhanced image and the infrared image to obtain a fused feature map, perform target detection based on the fused feature map, and obtain the detection result of the helmet.
[0027] In a third aspect, the present application further provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps in the above-mentioned method for detecting a helmet under low light conditions when executing the computer program.
[0028] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps in the above-mentioned method for detecting a helmet under low light conditions when the computer program is executed by a processor.
[0029] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method for detecting a helmet under low light conditions are implemented.
[0030] The above-mentioned helmet detection method and system under low-light conditions obtain infrared images and optical images of the same scene; based on the image enhancement framework combining deformable convolution, MSR and MSRCR, obtain the optical enhanced image corresponding to the optical image; perform feature fusion of the optical enhanced image and the infrared image to obtain a fused feature map, perform target detection based on the fused feature map, and obtain the detection result of the helmet. By fusing the infrared image and the optical image, the shortcomings of the optical image in low-light environments can be compensated, thereby improving the accuracy and robustness of helmet detection; at the same time, the image enhancement framework combining deformable convolution, MSR and MSRCR is used to enhance the illuminated image, which can highlight local details and contrast while maintaining the overall brightness and color of the image, which is very important for distinguishing helmets of different colors and maintaining visual realism in complex backgrounds, ensuring that the detection system has higher adaptability to color-sensitive environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A schematic diagram of a process for detecting a helmet under low light conditions in one embodiment;
[0032] Figure 2 A schematic diagram of the structure of feature fusion and target detection in one embodiment;
[0033] Figure 3 is a comparison table of different target detection models in one embodiment;
[0034] Figure 4 This is a schematic diagram for visualizing the comparison of detection effects;
[0035] Figure 5 Schematic diagram of the overall process of a method for detecting a helmet under low light conditions in one embodiment;
[0036] Figure 6 FIG. 4 is a structural block diagram of a safety helmet detection system under low light conditions in one embodiment. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. 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.
[0038] In low-light conditions, the image brightness is low and the contrast is insufficient, making it difficult to clearly present the outline and details of the helmet. In this case, traditional visible light-based image processing methods often have difficulty effectively distinguishing between the helmet and the background, resulting in reduced detection accuracy. At the same time, due to the high noise level in low-light images, traditional detection methods are prone to false detection (misjudging non-helmet objects as helmets) and missed detection (failing to detect actual helmets) under these conditions. This problem of inaccurate detection is particularly serious in helmet detection because it is directly related to the safety of personnel in high-risk environments such as construction sites.
[0039] In view of the above problems, the present application provides a method for detecting a helmet under low light conditions. Figure 1 As shown, the following steps are included:
[0040] Step 102: Acquire an infrared image and an optical image of the same scene.
[0041] Image acquisition is the first step in the entire inspection process, and this process is critical to ensuring data quality in subsequent processing steps. Image acquisition devices are high-resolution surveillance cameras that are suitable for real-time monitoring and inspection scenarios. These devices are usually able to capture optical images and provide basic visual information. However, in low-light conditions, the quality of optical images can be significantly affected, resulting in reduced contrast, blurred details, and even difficulty in distinguishing the edges of objects. To overcome this challenge, infrared cameras are added to the acquisition system. Infrared imaging technology relies on capturing the thermal radiation of objects and can work in low-light or even no-light conditions. By combining infrared images with optical images, the image quality in low-light conditions can be significantly improved to ensure that key features are captured.
[0042] Step 104 , based on an image enhancement framework combining deformable convolution, MSR and MSRCR, an optically enhanced image corresponding to the optical image is obtained.
[0043] As a core feature extraction technology, deformable convolution plays a vital role. Deformable convolution is a technology used to improve the adaptability of convolutional neural networks to geometric transformations. Traditional convolution operations sample at fixed positions, while deformable convolution introduces learnable offsets to enable the sampling points to move flexibly on the feature map, thereby better capturing objects and scenes with rich geometric changes.
[0044] MSR (Multi-Scale Retinex) is an image enhancement technology based on the Retinex theory, which aims to improve the brightness and contrast of the image. MSR separates the lighting effect in the image and the reflective characteristics of the object itself by applying the Retinex algorithm at different scales, thereby enhancing the detail performance of the image. In this stage, multiple Retinex filters of different scales are first applied to the input image, and each filter is responsible for extracting information of different frequencies in the image. Then, the processing results of each scale are weighted and synthesized to obtain an enhanced image. This processing method can effectively improve the dynamic range of the image, making the details in the image clearer, especially small features such as cable damage. This step can not only effectively improve the image quality under low light conditions, but also prevent the image from being overexposed under strong light conditions, maintaining the natural color and balance of the image.
[0045] MSRCR (Multi-Scale Retinex with Color Restoration) further introduces a color restoration mechanism based on the multi-scale Retinex process. This is to overcome the color distortion problem that may be caused by the Retinex process and ensure that the enhanced image can present natural colors while maintaining high contrast and detail clarity. This is of great significance for tasks that require the identification of color features, such as color classification in helmet detection. MSRCR compensates for the color information of the image so that the enhanced image is not only improved in brightness and detail, but also truly reflects the original color of the object. Specifically, the MSRCR algorithm will adjust the hue and saturation of the image based on the color channel information of the image while enhancing the image, making the image look more natural and closer to the visual experience of the real world.
[0046] This embodiment can improve image quality under low light conditions, enhance contrast and color restoration, and enhance the visual effect of the image by constructing an image enhancement framework of deformable convolution, MSR and MSRCR, thereby providing effective data for subsequent target detection.
[0047] Step 106, feature fusion of the optically enhanced image and the infrared image to obtain a fused feature map, and target detection is performed based on the fused feature map to obtain a detection result of the helmet.
[0048] The optical enhanced image after image enhancement is fused with the infrared image, and the high resolution information of the optical image and the high contrast advantage of the infrared image under low light conditions are comprehensively utilized to improve the accuracy and reliability of target detection. Fusion methods include weighted fusion, fusion based on wavelet transform, and fusion based on multi-scale decomposition.
[0049] To detect the target on the fused image, a variety of techniques and algorithms can be used, including traditional image processing methods and deep learning methods. Traditional methods include edge detection, and deep learning methods include convolutional neural networks. Through target detection, the helmet can be identified and located.
[0050] In one embodiment, after acquiring an infrared image and an optical image of the same scene, the method further includes: constructing an affine transformation matrix between the infrared image and the optical image based on a random sampling consensus algorithm; and registering the infrared image and the optical image using the affine transformation matrix.
[0051] The devices used for image acquisition include infrared cameras and visible light cameras, which have automatic adjustment functions and can adapt to changing lighting conditions to ensure that the best quality image input can be obtained in various environments.
[0052] In actual operation, in order to reduce the viewing angle deviation, the installation positions of the infrared camera and the visible light camera should be as close or exactly the same as possible, and their imaging axes should be aligned as much as possible. By using affine transformation and combining RANSAC (RANdomSampleAndConsensus) to estimate the optimal affine transformation matrix, the viewing angle deviation caused by the camera position or angle can be corrected. In this process, by extracting common feature points (such as corner points or significant features) in the two images, the required transformation matrix is estimated to accurately align and fuse the images. This method not only optimizes the image quality, but also enhances the practicality of the image, laying a solid foundation for subsequent analysis and processing.
[0053] In one embodiment, based on an image enhancement framework combining deformable convolution, MSR and MSRCR, obtaining an optically enhanced image corresponding to an optical image includes: extracting features of the optical image using a deformable convolutional neural network to obtain a feature image; processing the feature image using an MSR algorithm to separate illumination effects and reflection features in the feature image to obtain a first enhanced image; processing the first enhanced image using an MSRCR algorithm to compensate for color information of the first enhanced image to obtain an enhanced optical image.
[0054] Deformable convolution takes over the role of traditional convolutional layers, and by adding additional offsets to the standard grid positions of the convolution kernel, the shape and position of the convolution kernel can be adaptively adjusted to match the local deformation of the image content. This adaptation is done automatically through a learning process, in which the network learns in which local areas to add offsets and how to adjust the shape of the kernel so that it can more accurately cover and analyze key features in the image, such as complex shapes such as curved wires or irregular textures.
[0055] The generated feature images not only capture the basic image features, but more importantly, they also reflect the detailed structural information of the local deformation in the image. This information is expressed in the activation pattern in the feature image, indicating which areas of the image have a high degree of deformation. In addition, this structural information is also used to guide subsequent image processing steps, especially when adjusting the filter size and shape in the Retinex algorithm. This is particularly important. For example, for areas with large local deformations, larger or more flexible filters can be selected to adapt to these changes, thereby more effectively dealing with uneven lighting or heavy shadows.
[0056] On this basis, the feature map extracted by deformable convolution is applied to MSR processing. MSR processing is performed at different scales, each scale targeting a different frequency range, to separate the illumination effect in the image and the reflective characteristics of the object itself to obtain the first enhanced image. This multi-scale processing enhances the dynamic range of the first enhanced image, making the details more clearly visible, especially in dark or overly bright areas.
[0057] Further MSRCR processing restores the naturalness of the image colors by compensating the color channels of the first enhanced image while maintaining high contrast and clear details. The MSRCR algorithm pays special attention to adjusting color distortion caused by shape deformation, such as color compression or stretching caused by twisting. This step is achieved by adjusting hue and saturation to ensure that the enhanced image colors are realistic and balanced.
[0058] The final output enhanced optical image is obtained by comprehensive MSR processing, MSRCR processing and deformable convolution feature adjustment.
[0059] In one embodiment, before the deformable convolution operation is performed, the original image is first prepared through standard preprocessing steps such as normalization and possible noise reduction. This preparation is necessary because it ensures that the image data reaches a certain level of standardization before entering the network, which helps reduce possible problems during subsequent processing.
[0060] In one embodiment, feature fusion of the optically enhanced image and the infrared image to obtain a fused feature map includes: inputting the enhanced optical image and the infrared image into a feature pyramid network to obtain a multi-scale fused feature map.
[0061] like Figure 2 As shown in Figure 1, in order to improve the detection effect of objects at different scales and resolutions, a feature pyramid network (FPN) can be used to enhance multi-scale feature learning. FPN effectively integrates high-level semantic information and low-level detail features by introducing lateral connections in the top-down path to generate more expressive feature maps.
[0062] Through the FPN structure, multi-scale feature maps are extracted and fused from infrared images and optically enhanced images. Typical multi-scale feature maps include: P2_fused: represents low-level feature maps with higher resolution, which can capture details and small targets; P3_fused: mid-level feature maps, which balance resolution and semantic information; P4_fused: high-level feature maps, which provide strong semantic information and are suitable for detecting medium-sized targets; P5_fused: represents the highest-level feature map, which has the lowest resolution but can capture global semantic information and is suitable for detecting large targets.
[0063] By fusing multi-scale features through FPN, stronger semantic information can be obtained, thereby improving detection performance.
[0064] In one embodiment, performing target detection based on the fused feature map and obtaining a detection result of the safety helmet includes: inputting the fused feature map into a detection head of YOLOv8 to perform target detection and obtain a detection result of the safety helmet.
[0065] These multi-scale feature maps will be input into the detection head of YOLOv8 for target detection: Low-level feature map P2_fused: can help the detection head locate smaller targets at high resolution, such as smaller helmets or thinner object edges. Its meticulous detail capture ability is essential for accurately identifying and locating small targets. Mid-level feature maps P3_fused and P4_fused: provide medium resolution and balanced semantic information, enabling the detection head to detect medium-sized targets within an appropriate range and ensure comprehensive detection. High-level feature map P5_fused: contains rich semantic information at low resolution, enabling the detection head to accurately identify and locate larger target areas, which is particularly useful for detecting large helmets at long distances or overall perspectives.
[0066] At present, the classification and identification methods for safety helmets can be mainly divided into two types: two-stage method and single-stage method.
[0067] Among them, the two-stage method first extracts image features through an algorithm to generate candidate regions, and then uses a classifier to classify and regress these regions. Yogameena et al. used Faster R-CNN to detect marked motorcycles, and then used a convolutional neural network model and a spatial transformer to identify helmets. Ferdous et al. designed a detection system based on the ResNet50 backbone and feature pyramid network (FPN) to classify and locate helmets. The advantage of this type of method is that it can significantly improve detection accuracy, but its real-time performance is insufficient.
[0068] The single-stage method uses an end-to-end strategy to detect and classify objects directly in the image. Typical single-stage methods include SSD (Single Shot MultiBox Detector) and YOLO series models. SSD achieves object detection through multi-scale prediction and anchor mechanism, but performs poorly when dealing with small objects. The YOLO series, such as YOLOv3 and YOLOv4, adopts a strategy of simultaneous detection and classification, which has high computational efficiency and is suitable for real-time detection tasks, but lacks in inference speed.
[0069] YOLOv8 uses a more advanced Backbone network and a more complex feature pyramid network, which enables the model to better extract and utilize multi-scale features, thereby improving detection accuracy. At the same time, YOLOv8 is designed with the lightweight and real-time performance of the model in mind, so that the size and inference speed of the model are optimized while ensuring high accuracy.
[0070] In one embodiment, the method further includes: performing target detection based on the fused feature map to obtain a detection result of a human head; and marking in the optical image according to the detection result of the helmet and the detection result of the human head.
[0071] By separately identifying and detecting the human head and the safety helmet, people who are not wearing safety helmets can be screened out, thereby improving construction safety in a targeted manner.
[0072] In order to compare the performance of the improved model with the baseline model YOLOv8 and SSD in helmet detection, the experimental design should include the following aspects: data set selection and preparation, model training and evaluation, and analysis of experimental results. The following are the specific steps for conducting these experiments:
[0073] Selection of data set: 300 low-light images of people wearing helmets and infrared images were collected. Make sure that each image in the data set is accurately labeled. The annotation information should include the category of the target object (such as wearing a helmet and not wearing a helmet) and the bounding box coordinates. The data set is divided into training set, validation set and test set, with 70% for training, 15% for validation, and 15% for testing. This ensures that the model training, tuning and testing are performed on different data subsets to reduce the risk of overfitting.
[0074] The comparison results are as follows Figure 3 As shown, through analysis Figure 3 From the table, we can see that the improved model performs well in the helmet detection task, not only surpassing YOLOv8 and SSD in terms of accuracy, recall and precision, but also providing better detection performance while maintaining a high detection speed. The improved model combines multi-scale feature fusion and stronger feature learning capabilities, making its detection effect more superior in low-light conditions and complex scenes, and is suitable for high-demand security monitoring systems.
[0075] like Figure 4 The figure shows a comparison of the visual detection effects of the improved model, YOLOv8, and SSD. It can be seen that the improved model can pay better attention to occlusion than YOLOv8 and SSD.
[0076] With the optimization of the model, the missed detection rate has been significantly reduced, especially in complex backgrounds and low-light environments. The improved model can better distinguish between helmets and backgrounds, further improving the robustness of detection. In addition, the optimized model shows higher detection accuracy at different distances and under different lighting conditions, proving the effectiveness of multi-sensor fusion and advanced feature extraction technology in practical applications.
[0077] like Figure 5As shown, it is a complete flow chart of a safety detection method under low light conditions in one embodiment. First, the optical image is input into a variable convolutional network for feature extraction. Then, the MSR module is used to effectively enhance the detail performance in the low-light image by applying the Retinex algorithm at multiple scales. The MSR algorithm can decompose the different frequency components of the image, highlight the local details and contrast while maintaining the overall brightness of the image, so that the helmet contour and other detail features in the image are more obvious, providing a clear input for subsequent detection. Then, the MSRCR algorithm is used for processing. While enhancing the image details, MSRCR can maintain the natural color of the image. This is very important for distinguishing helmets of different colors and maintaining visual realism under complex backgrounds, ensuring that the detection system has higher adaptability to color-sensitive environments. Then, infrared imaging technology is used to capture images under low light or night conditions. Infrared imaging can effectively capture the thermal radiation characteristics of objects and make up for the shortcomings of optical images in low light environments. By fusing the infrared image with the optical image processed by MSRCR, a more information-rich image is obtained, which improves the accuracy and robustness of helmet detection. Finally, combined with the enhanced image information, the advanced deep learning target detection algorithm is used to locate and classify the helmet. YOLOv8 has fast and accurate target detection capabilities. By using the MSRCR enhanced optical image and infrared image fusion results, these models can maintain efficient detection performance in low light conditions and quickly identify and mark the location of the helmet.
[0078] In summary, the present invention proposes a helmet detection method based on multi-sensor fusion and advanced deep learning algorithm, which is particularly suitable for construction site scenes under low light conditions. By introducing the fusion of infrared images and visible light images, using the FPN module for multi-scale feature extraction and fusion, and adopting the YOLOv8 model for target detection, the accuracy and robustness of detection are significantly improved. Experimental results show that compared with traditional methods, the improved model performs well in helmet detection under low light and complex backgrounds, and effectively reduces missed detection and false detection.
[0079] Specifically, the improved model not only shows extremely high accuracy in detecting the helmets of workers at close range, but also maintains stable detection performance at long distances and in complex backgrounds. This shows that the combined use of multi-scale feature fusion and infrared-visible light images can better cope with challenges in practical applications and improve the adaptability and reliability of the detection system.
[0080] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0081] Based on the same inventive concept, the embodiment of the present application also provides a safety helmet detection system under low light conditions for implementing the safety helmet detection method under low light conditions involved above. The implementation scheme for solving the problem provided by the system is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more embodiments of the safety helmet detection system under low light conditions provided below can refer to the limitations of the safety helmet detection method under low light conditions above, and will not be repeated here.
[0082] In one embodiment, Figure 6 As shown, a safety helmet detection system under low light conditions is provided, comprising:
[0083] An image acquisition module 602 is used to acquire an infrared image and an optical image of the same scene;
[0084] An image enhancement module 604 is used to obtain an optically enhanced image corresponding to the optical image based on an image enhancement framework combining deformable convolution, MSR and MSRCR;
[0085] The target recognition module 606 is used to perform feature fusion on the optical enhancement image and the infrared image to obtain a fused feature map, perform target detection based on the fused feature map, and obtain a detection result of the helmet.
[0086] Each module in the above-mentioned helmet detection system under low light conditions can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each of the above modules.
[0087] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in all the above method embodiments when executing the computer program.
[0088] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in all the above method embodiments are implemented.
[0089] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in all the above method embodiments when executed by a processor.
[0090] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0091] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited thereto. The processors involved in each embodiment provided in this application may be general-purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, data processing logic devices based on quantum computing, etc., but are not limited thereto.
[0092] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0093] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for detecting a helmet under low light conditions, characterized in that: The method comprises: Acquire infrared and optical images of the same scene; Obtaining an optically enhanced image corresponding to the optical image based on an image enhancement framework combining deformable convolution, MSR and MSRCR; The optically enhanced image and the infrared image are feature fused to obtain a fused feature map, and target detection is performed based on the fused feature map to obtain a detection result of the helmet.
2. The method according to claim 1, characterized in that After acquiring the infrared image and the optical image of the same scene, the method further comprises: An affine transformation matrix between the infrared image and the optical image is constructed based on a random sampling consensus algorithm; and the infrared image and the optical image are registered using the affine transformation matrix.
3. The method according to claim 1, characterized in that: The method of obtaining an optically enhanced image corresponding to the optical image based on an image enhancement framework combining deformable convolution, MSR and MSRCR includes: Using a deformable convolutional neural network to extract features from the optical image to obtain a feature image; Processing the feature image by using an MSR algorithm to separate the illumination effect and the reflection feature in the feature image to obtain a first enhanced image; The first enhanced image is processed by using the MSRCR algorithm, the color information of the first enhanced image is compensated, and the enhanced optical image is obtained.
4. The method according to claim 1, characterized in that: The performing feature fusion of the optically enhanced image and the infrared image to obtain a fusion feature map comprises: The enhanced optical image and the infrared image are input into a feature pyramid network to obtain a multi-scale fused feature map.
5. The method according to claim 1, characterized in that The performing target detection based on the fused feature map to obtain the detection result of the helmet includes: The fused feature map is input into the detection head of YOLOv8 to perform target detection and obtain the detection result of the helmet.
6. The method according to claim 1, characterized in that The method further comprises: Performing target detection based on the fused feature map to obtain a detection result of a human head; Annotation is performed in the optical image according to the detection result of the helmet and the detection result of the head.
7. A helmet detection system under low light conditions, characterized in that: The system comprises: An image acquisition module, used to acquire infrared images and optical images of the same scene; An image enhancement module, for obtaining an optically enhanced image corresponding to the optical image based on an image enhancement framework combining deformable convolution, MSR and MSRCR; The target recognition module is used to perform feature fusion on the optically enhanced image and the infrared image to obtain a fused feature map, perform target detection based on the fused feature map, and obtain a detection result of the helmet.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.