Dark light image color restoration method, device and equipment based on image segmentation
By acquiring and processing the image of the target object under dark light conditions, and using light characteristic parameters for image segmentation and feature matching, the accurate restoration of image color is achieved, and the complexity and complexity of image color restoration under dark light conditions in the existing technology is solved. The problem of accuracy improves the monitoring effect and user experience of care scenes.
Patent Information
- Application Number
- CN202311742643.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-15
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2043-12-15
AI Technical Summary
The existing technology cannot simply and accurately restore image color under dark light conditions, resulting in poor user experience during care. The image fusion process is complex and the calculation complexity is high, which may lead to information loss and color deviation.
By obtaining the images collected at the first and second time in the care scene of the target object, extract the light characteristic parameters, determine the environment based on the collection time, perform image segmentation and feature matching, output the target area image, and perform color restoration processing on it.
Dynamically adapt to different lighting conditions, improve image quality, enhance target object recognition accuracy, improve user experience, reduce system misjudgment rate, and improve monitoring effects.
Smart Images

Figure CN117670740B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a method, device and equipment for color restoration of dark-light images based on image segmentation. Background Art
[0002] With the progress of urbanization, the use of AI devices for intelligent care of target objects, including infants, young children, and the elderly, has gradually been recognized by people. In the process of using AI devices to care for target objects, it is of great significance to judge the current state of the target object's body, posture, behavior, etc. in real time. The current mainstream monitoring or camera equipment uses infrared fill lights to detect and present images under dark conditions at night. Infrared emission devices are used to actively project infrared light onto objects. After the infrared light is reflected by the object, it enters the lens for imaging. The image formed in this way is black and white, which cannot meet the needs of some users who want to view colorful and bright images at night.
[0003] The existing Chinese patent CN115460343A discloses an image processing method, device and storage medium, the method comprising: performing noise reduction on the black and white image data collected by the black and white camera and the color image data collected by the color camera, respectively, to obtain black and white image data and color image data with a high signal-to-noise ratio, thereby improving the clarity of the image data. By performing image fusion on the black and white image data and the color image data after noise reduction, the brightness information and detail information of the black and white image data after noise reduction can be fused with the color information of the color image data after noise reduction, thereby obtaining image data with a high signal-to-noise ratio, clear details and accurate colors. Although the above patent discloses that the color information of the color image data can be integrated into the black and white image data by image fusion, which can play a certain role in color restoration, however, the image fusion requires complex algorithm processing of the black and white image data and the color image data after noise reduction, including the fusion of brightness information and color information. This will increase the computational complexity and require more computing resources and time; before the black and white image data and the color image data are fused, it is necessary to ensure that the two are spatially aligned. If the image alignment is inaccurate, the fused image may be distorted, have artifacts, or have color deviations. Information may be lost during the image fusion process. The fusion algorithm may not be able to fully retain the brightness and detail information of the black-and-white image data after noise reduction, nor may it be able to fully retain the color information of the color image data. This may result in a slight loss in the quality of the final fused image.
[0004] Therefore, how to simply and accurately restore the color of images under dark light conditions and improve the user's target object care experience is an urgent problem to be solved. Summary of the invention
[0005] In view of this, the present invention provides a method, device and equipment for color restoration of dark-light images based on image segmentation, so as to solve the problem in the prior art that it is impossible to simply and accurately restore the color of images under dark-light conditions, resulting in poor target object care experience for users.
[0006] The technical solution adopted by the present invention is:
[0007] In a first aspect, the present invention provides a method for color restoration of dark-light images based on image segmentation, the method comprising:
[0008] S1: Acquire a first image acquired at a first time and a second image acquired at a second time in a nursing scene for a target object;
[0009] S2: extracting features from the first image and the second image, and outputting first light feature parameters corresponding to the first image and second light feature parameters corresponding to the second image;
[0010] S3: determining the acquisition environment of the first image and the acquisition environment of the second image according to the first light characteristic parameter and the second light characteristic parameter in combination with the first time and the second time;
[0011] S4: if it is determined that the acquisition environment of the first image is a bright light environment, performing image segmentation on the first image and outputting a first target area image;
[0012] S5: If it is determined that the acquisition environment of the second image is a dark light environment, performing image segmentation and feature matching on the second image, and outputting a second target area image that matches the first target area image;
[0013] S6: Performing color restoration processing on the second target area image, and outputting a restored color image.
[0014] Preferably, S3 includes:
[0015] S31: Acquire a first sample image captured in a bright light environment and a second sample image captured in a dark light environment, perform feature extraction on the first sample image and the second sample image, and output first sample light feature parameters and second sample light feature parameters;
[0016] S32: extracting features from a plurality of frames of first target images adjacent to the first image and a plurality of frames of second target images adjacent to the second image, and outputting the extracted light feature parameters corresponding to each frame of the first target image and the light feature parameters corresponding to each frame of the second target image;
[0017] S33: performing feature matching on the light feature parameters corresponding to each frame of the first target image and the first light feature parameters respectively with the first sample light feature parameters in sequence, and obtaining the number of matched first image frames;
[0018] S34: performing feature matching on the light feature parameters corresponding to each frame of the second target image and the second light feature parameters with the second sample light feature parameters in sequence, and obtaining the number of matched second image frames;
[0019] S35: Determine the acquisition environment of the first image and the acquisition environment of the second image according to the first image frame number, the second image frame number and a preset frame number threshold value, in combination with the first time and the second time.
[0020] Preferably, the S4 includes:
[0021] S41: Acquire a first training image in the nursing scene, and pre-label contour feature information of a preset target in the first training image;
[0022] S42: Inputting the first training image and contour feature information into a first deep learning model for training, and obtaining a loss function in model training;
[0023] S43: When it is determined according to the loss function that the output of the first deep learning model fits the input, outputting the trained first deep learning model as an image segmentation model;
[0024] S44: if it is determined that the acquisition environment of the first image is a bright light environment, input the first image into the image segmentation model, and output first target contour feature information;
[0025] S45: Segmenting the closed area image enclosed by the outline of the first target according to the first target outline feature information, and outputting the first target area image.
[0026] Preferably, the S5 includes:
[0027] S51: If it is determined that the acquisition environment of the second image is a dark light environment, input the first image and the second image into a pre-trained object detection model, and output first detection frame information, a first object category, second detection frame information, and a second object category;
[0028] S52: Matching the first detection frame information with the second detection frame information, and matching the first object category with the second object category, to obtain a second object in the second image that matches the first object;
[0029] S53: Input the second image into the image segmentation model, and output the closed area image surrounded by the outline of the second target as the second target area image.
[0030] Preferably, the S6 includes:
[0031] S61: Acquire a first color mean value of the first target area and a second color mean value of the second target area;
[0032] S62: inputting the first color mean and the second color mean into a pre-trained noise prediction model, and outputting the noise between the first target area and the second target area;
[0033] S63: performing noise reduction processing on the second target area according to the noise;
[0034] S64: When the second color mean value of the second target area is restored to the first color mean value, output the color image.
[0035] Preferably, before S62, the steps include:
[0036] S6201: Acquire a second training image set collected in a bright light environment and a third training image set collected in a dark light environment;
[0037] S6202: Annotate the color mean values in the second training image set and the color mean values in the third training image set, and output a first annotated image set and a second annotated image set;
[0038] S6203: Input the first annotated image set and the second annotated image set into a second deep learning model for training, and output the noise prediction model.
[0039] Preferably, the first light characteristic parameter and the second light characteristic parameter include at least: exposure value, color saturation, contrast, shadow and highlight, color temperature and noise.
[0040] In a second aspect, the present invention provides a dark light image color restoration device based on image segmentation, the device comprising:
[0041] An image acquisition module, used to acquire a first image acquired at a first time and a second image acquired at a second time in a nursing scene for a target object;
[0042] A feature extraction module, used to extract features from the first image and the second image, and output a first light feature parameter corresponding to the first image and a second light feature parameter corresponding to the second image;
[0043] An environment determination module, configured to determine the acquisition environment of the first image and the acquisition environment of the second image according to the first light characteristic parameter and the second light characteristic parameter in combination with the first time and the second time;
[0044] A bright light image segmentation module, configured to segment the first image and output a first target area image if it is determined that the acquisition environment of the first image is a bright light environment;
[0045] a feature matching module, configured to perform image segmentation and feature matching on the second image if it is determined that the acquisition environment of the second image is a dark light environment, and output a second target area image that matches the first target area image;
[0046] The color restoration module is used to perform color restoration processing on the second target area image and output a restored color image.
[0047] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising: at least one processor, at least one memory, and computer program instructions stored in the memory, which, when executed by the processor, implement the method of the first aspect in the above-mentioned embodiment.
[0048] In a fourth aspect, an embodiment of the present invention further provides a storage medium on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the method of the first aspect in the above-mentioned embodiment is implemented.
[0049] In summary, the beneficial effects of the present invention are as follows:
[0050] The present invention provides a method, device and equipment for color restoration of dark-light images based on image segmentation, the method comprising: obtaining a first image captured at a first time and a second image captured at a second time in a nursing scene for a target object; performing feature extraction on the first image and the second image, and outputting first light characteristic parameters corresponding to the first image and second light characteristic parameters corresponding to the second image; judging the acquisition environment of the first image and the second image based on the first light characteristic parameters and the second light characteristic parameters, in combination with the first time and the second time; if the acquisition environment of the first image is determined to be a bright-light environment, performing image segmentation on the first image, and outputting a first target area image; if the acquisition environment of the second image is determined to be a dark-light environment, performing image segmentation and feature matching on the second image, and outputting a second target area image that matches the first target area image; performing color restoration processing on the second target area image, and outputting a restored color image. The present invention can compare images collected at different time points by extracting light characteristic parameters of the first and second images, and use the light characteristic parameters in combination with the collection time to determine the collection environment, dynamically adapt to different lighting conditions, and when it is determined that the collection environment of the first image is a bright light environment, image segmentation is performed to output the target area image, which is helpful for extracting the target object, reducing the processing of irrelevant information, and improving the efficiency of the system; when it is determined that the collection environment of the second image is a dark light environment, image segmentation and feature matching are performed to more accurately identify the target object under low light conditions, increasing the accuracy of the system in complex environments; color restoration processing is performed on the second target area image, so that the output image is more realistic and easier for humans to observe and understand. In general, by performing color restoration processing in a dark light environment, it is possible to improve image quality, improve the recognition accuracy of the target object, enhance user experience, and reduce the system misjudgment rate, thereby improving the monitoring effect and practicality of the entire nursing scene. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solution of the embodiment of the present invention, the drawings required for use in the embodiment of the present invention will be briefly introduced below. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work, and these are all within the protection scope of the present invention.
[0052] Figure 1 It is a schematic diagram of the overall working process of the dark light image color restoration method based on image segmentation in Example 1 of the present invention;
[0053] Figure 2 This is a schematic diagram of a process for determining the acquisition environment of a first image and the acquisition environment of a second image in Embodiment 1 of the present invention;
[0054] Figure 3 is a schematic diagram of a process of performing image segmentation on the first image in Embodiment 1 of the present invention;
[0055] Figure 4 This is a schematic diagram of a process of performing image segmentation and feature matching on the second image in Embodiment 1 of the present invention;
[0056] Figure 5 This is a schematic diagram of a process of performing color noise reduction and restoration processing on the second target area in Embodiment 1 of the present invention;
[0057] Figure 6 A schematic diagram of a process for obtaining the noise prediction model in Embodiment 1 of the present invention;
[0058] Figure 7 This is a schematic diagram of the process of detecting and restoring an occluded area image in Embodiment 2 of the present invention;
[0059] Figure 8 is a structural block diagram of a dark light image color restoration device based on image segmentation in Embodiment 3 of the present invention;
[0060] Fig. 9 It is a schematic diagram of the structure of an electronic device in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0061] In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly and completely described in conjunction with the drawings in the embodiment of the present invention. It should be noted that, in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. In the description of the present invention, it should be understood that the orientation or position relationship indicated by the terms "center", "upper", "lower", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc. is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such a process, method, article or device. In the absence of further restrictions, the elements defined by the phrase "comprising..." do not exclude the existence of other identical elements in the process, method, article or device comprising the elements. If there is no conflict, the embodiments of the present invention and the various features in the embodiments can be combined with each other, all within the protection scope of the present invention.
[0062] Example 1
[0063] See also Figure 1 Embodiment 1 of the present invention discloses a method for color restoration of dark-light images based on image segmentation, the method comprising:
[0064] S1: Acquire a first image acquired at a first time and a second image acquired at a second time in a nursing scene for a target object;
[0065] Specifically, in the target object care scenario, a first image captured at a first time and a second image captured at a second time are acquired with the help of a monitoring device; the monitoring device can capture the activities and scenes of the target object, the elderly or other target objects in real time, and transmit the image data to a related system for processing and analysis; wherein, the first image captured at the first time is usually a color image acquired under sufficient light conditions, which is a color image of a specific area captured by a color camera; and the second image captured at the second time is usually a black-and-white image acquired under dark light conditions. When the ambient light is dark or insufficient, a black-and-white image is captured with the help of infrared night vision technology or other low-light camera equipment. If the ambient light is too dark and the image features are not obvious, a fill light is used for fill light, and further image processing is performed on the first image and the second image to achieve monitoring and care of the target object.
[0066] S2: extracting features from the first image and the second image, and outputting first light feature parameters corresponding to the first image and second light feature parameters corresponding to the second image;
[0067] Specifically, feature extraction is performed on the first image and the second image, and first light characteristic parameters corresponding to the first image and second light characteristic parameters corresponding to the second image are output; the first light characteristic parameters and the second light characteristic parameters include at least: exposure value, color saturation, contrast, shadows and highlights, color temperature and noise. The feature extraction method includes: the exposure value reflects the intensity of light in the image, and the exposure value is calculated by the brightness histogram of the image or by directly extracting the average brightness of pixels from the image; the color saturation represents the vividness of the color in the image, and the color saturation is obtained by extracting the color histogram of the image and then calculating the color saturation; the contrast describes the difference in brightness between adjacent areas in the image, and the histogram equalization technology is used to enhance the contrast, and the contrast information is extracted from the enhanced image; the intensity of shadows and highlights is estimated by analyzing the dark and bright parts of an image and the second image, and this is achieved by histogram analysis or by using an algorithm with a dynamic range adjustment function; the color temperature represents the overall color bias of the image, and the color temperature is estimated by the white balance information in the image, and the white balance adjustment can be used to adjust the color temperature of the image; the noise represents the random color change in the image, which is usually caused by low light conditions, and the image processing filter or statistical method is used to estimate the noise level in the image.
[0068] S3: determining the acquisition environment of the first image and the acquisition environment of the second image according to the first light characteristic parameter and the second light characteristic parameter in combination with the first time and the second time;
[0069] Specifically, a first light feature in the first image is obtained, and the light feature includes at least one of the following indicators: exposure value, color saturation, contrast, shadow and highlight, color temperature and noise. The first light feature is analyzed and compared with the light feature under bright light conditions. When the light feature matches the light feature under bright light conditions, and the first time when the first image is captured is during the day, that is, the first time is within the pre-set daytime time interval, it is considered that the first image is captured under bright light conditions. The first image is segmented to separate the first target area in the image from the background or other interference parts. In the nursing scene, by segmenting the target area of the target object, the target object itself can be highlighted and focused, which facilitates monitoring and observation of important details such as the target object's movements and expressions; at the same time, through image segmentation, attention can be focused on the target area of the target object, reducing the processing and analysis of the entire image, which can save computing resources and processing time and improve processing efficiency.
[0070] In one embodiment, see Figure 2 , said S3 comprises:
[0071] S31: Acquire a first sample image captured in a bright light environment and a second sample image captured in a dark light environment, perform feature extraction on the first sample image and the second sample image, and output first sample light feature parameters and second sample light feature parameters;
[0072] Specifically, the preset bright light condition is acquired, where the bright light condition is a scene with sufficient light, such as bright indoor lighting or natural light. Collect image samples with sufficient light, extract exposure value, color saturation, contrast, shadow and highlight, color temperature and noise features in the image samples, and the specific method of extracting light features includes: converting image samples to grayscale space, calculating the average brightness value of image samples as exposure value feature; converting image samples to HSV (hue, saturation, value) color space, calculating the average saturation value of the image as color saturation feature; converting the image to grayscale space, calculating the pixel value range or standard deviation of the image as contrast feature; converting the image to grayscale space; using threshold segmentation or edge detection algorithm to detect shadow and highlight areas in the image, and calculating the pixel ratio or pixel value range of the shadow and highlight areas as features; converting the image to HSV (hue, saturation, value) color space, and extracting color temperature features by calculating the hue distribution or color temperature offset of the image; using image denoising algorithm (such as Gaussian blur, median filtering, etc.) to remove noise in the image, calculating the noise density or mean square error of the image as noise feature, and counting and recording the above light features as the target light features. By acquiring the target light characteristics under preset bright light conditions, a standard for judging the light conditions is provided for subsequent steps, so that subsequent image processing can be optimized for bright light conditions.
[0073] S32: extracting features from a plurality of frames of first target images adjacent to the first image and a plurality of frames of second target images adjacent to the second image, and outputting the extracted light feature parameters corresponding to each frame of the first target image and the light feature parameters corresponding to each frame of the second target image;
[0074] Specifically, multiple frames of the first target image and the second target image are respectively collected before and after the first time and before and after the second time to ensure that the range of light changes is covered, and the above-mentioned light feature extraction operation is performed on each frame of the target image, and the extracted light feature parameters corresponding to each frame of the first target image and the light feature parameters corresponding to each frame of the second target image are output.
[0075] S33: performing feature matching on the light feature parameters corresponding to each frame of the first target image and the first light feature parameters respectively with the first sample light feature parameters in sequence, and obtaining the number of matched first image frames;
[0076] S34: performing feature matching on the light feature parameters corresponding to each frame of the second target image and the second light feature parameters with the second sample light feature parameters in sequence, and obtaining the number of matched second image frames;
[0077] Specifically, the light characteristic parameters of each frame of the target image are matched with the preset target light characteristic parameters one by one. The matching method uses a similarity measurement method (such as Euclidean distance, cosine similarity, correlation coefficient, etc.) to calculate the similarity between the target light characteristic parameters and the light characteristic parameters of each frame of the image. When the similarity is greater than a preset similarity threshold, the two frames of images are considered to be matched; the light characteristic parameters corresponding to the first target image of each frame and the first light characteristic parameters are respectively and sequentially feature matched with the first sample light characteristic parameters to obtain the number of matched first image frames; the light characteristic parameters corresponding to the second target image of each frame and the second light characteristic parameters are respectively and sequentially feature matched with the second sample light characteristic parameters to obtain the number of matched second image frames.
[0078] S35: Determine the acquisition environment of the first image and the acquisition environment of the second image based on the first image frame number, the second image frame number and the preset frame number threshold value, combined with the first time and the second time. Specifically, compare the first image frame number and the second image frame number with the frame number threshold value respectively. If the first image frame number is greater than the frame number threshold value and combined with the timestamp of the first time being a bright light environment, the acquisition environment of the first image is a bright light environment; similarly, if the second image frame number is greater than the frame number threshold value and combined with the timestamp of the second time being a dark light environment, the acquisition environment of the second image is a dark light environment.
[0079] S4: if it is determined that the acquisition environment of the first image is a bright light environment, performing image segmentation on the first image and outputting a first target area image;
[0080] Specifically, if it is determined that the acquisition environment of the first image is a bright light environment, the first image is segmented to separate the first target area from the background or other interference parts, wherein the image segmentation can be performed by threshold-based segmentation, edge detection-based segmentation, or region growth-based segmentation. Through the image segmentation, the first target area in the first image can be effectively separated from the background, and the first target area is output, providing accurate first target area information for subsequent target tracking, feature matching, and other processing.
[0081] In one embodiment, see Figure 3 , the S41 comprises:
[0082] S41: Acquire a first training image in the nursing scene, and pre-label contour feature information of a preset target in the first training image;
[0083] Specifically, in the target object care scenario, a large amount of image data is collected as training samples. The collected image data can come from cameras, monitoring equipment or other image acquisition devices. Each frame of the training image is annotated, including marking the contours of preset targets such as infants, adults, pets, beds, pillows, sofas and dining chairs. Image annotation tools can be used to manually draw the contours of the target or use semi-automatic auxiliary annotation tools; according to the contour feature information of the preset target, the training image is segmented to separate the target from the background. For example, image processing algorithms or deep learning-based image segmentation methods such as semantic segmentation and instance segmentation can be used; the training image data and the corresponding preset target contour feature information are stored and organized to establish a training data set, and the data is organized in a directory structure or database format to facilitate subsequent training and model loading.
[0084] S42: Inputting the first training image and contour feature information into a first deep learning model for training, and obtaining a loss function in model training;
[0085] Specifically, a preset first deep learning model is obtained, such as a convolutional neural network (CNN), U-Net, etc., for an image segmentation task. The model has a sufficient number of network layers and parameter capacity and is capable of learning contour information of targets in the image. The first training image and contour feature information are input into the first deep learning model for training. In order to train the model and optimize its parameters, a loss function needs to be defined to measure the difference between the model prediction result and the true label. Commonly used loss functions include cross entropy loss, Dice loss, and bounding box loss.
[0086] S43: When it is determined according to the loss function that the output of the first deep learning model fits the input, outputting the trained first deep learning model as an image segmentation model;
[0087] Specifically, the first training image and contour feature information are input into the model, and the prediction result of the model is compared with the true label to calculate the loss value. Through the back propagation algorithm and the optimizer, the parameters of the model are adjusted to minimize the loss function and the first deep learning model that has been trained is output as an image segmentation model.
[0088] S44: if it is determined that the acquisition environment of the first image is a bright light environment, input the first image into the image segmentation model, and output first target contour feature information;
[0089] Specifically, if it is determined that the acquisition environment of the first image is a bright light environment, the first image is input into the image segmentation model, and the contour feature information of the first target is output, wherein the first target includes at least one of the following preset targets: infants, the elderly, adults, pets, beds, pillows, sofas and dining chairs; the contour feature information of the first target includes the boundary point coordinates of the first target, the position and size of the bounding box or other feature vectors describing the contour of the first target, and the extracted contour feature information can accurately describe the contour of the first target.
[0090] S45: Segmenting the closed area image enclosed by the outline of the first target according to the first target outline feature information, and outputting the first target area image.
[0091] Specifically, using the extracted contour feature information, a closed area representing the contour of the first target is drawn according to the boundary point coordinates or bounding box information of the first target. The closed area represents the precise position and shape of the first target, which helps to focus on the key area of the first target for subsequent target analysis and processing; the closed area can be used to extract the image area where the first target is located, which can be used for subsequent target recognition, feature extraction, image analysis and other tasks, providing more information for target object care.
[0092] S5: If it is determined that the acquisition environment of the second image is a dark light environment, performing image segmentation and feature matching on the second image, and outputting a second target area image that matches the first target area image;
[0093] Specifically, a second light feature in the second image is obtained, where the light feature includes at least one of the following indicators: exposure value, color saturation, contrast, shadow and highlight, color temperature and noise. The second light feature is analyzed and compared with the light feature under dark light conditions. When the light feature matches the light feature under dark light conditions, and the second time when the second image is captured is at night, that is, the second time is within a preset time interval of the night, then it is considered that the second image is captured under dark light conditions. Image segmentation and feature matching are performed on the second image to separate the second target area in the image from the background or other interference parts. The feature matching can use feature descriptors and matching algorithms, such as SIFT, SURF, ORB, etc., to extract and match features of the target area.
[0094] In one embodiment, see Figure 4 , the S5 comprises:
[0095] S51: If it is determined that the acquisition environment of the second image is a dark light environment, input the first image and the second image into a pre-trained object detection model, and output first detection frame information, a first object category, second detection frame information, and a second object category;
[0096] S52: Matching the first detection frame information with the second detection frame information, and matching the first object category with the second object category, to obtain a second object in the second image that matches the first object;
[0097] S53: Input the second image into the image segmentation model, and output the closed area image surrounded by the outline of the second target as the second target area image.
[0098] Specifically, if it is determined that the acquisition environment of the second image is a dark light environment, the first image and the second image are respectively input into the pre-trained target detection model, and the first target feature information and the second target feature information are output, wherein the target feature information includes: the position, size and category of the target detection box, wherein the pre-training process is: collecting a large-scale image data set, and annotating these images, and the annotations include the location and category information of the target. For example, in the pre-training of the target detection model in the target object care scenario, it is necessary to collect image data containing infants, the elderly, adults, pets, beds, pillows, sofas and dining chairs, and annotate these images; select a network architecture suitable for the target detection task, common network architectures include YOLO, SSD, etc.; the network architecture is usually composed of a convolutional neural network (CNN) and other modules for extracting image features and performing target detection; the annotated image data is input into the target detection model, and after forward propagation, the feature representation in the image is extracted. These feature representations contain information about different targets in the image, which are used for subsequent target detection and feature matching; target detection is performed using the extracted features, that is, the target is located and identified in the image, and the target detection loss function is calculated by comparing with the marked target position, which is used to adjust the model parameters to optimize the target detection performance; according to the calculated loss function, the model parameters are updated using the back propagation algorithm to minimize the loss function. Common optimization algorithms include stochastic gradient descent (SGD), Adam, etc.; feature matching is performed on the first target feature information and the second target feature information. Common matching algorithms include the nearest neighbor algorithm and the RANSAC algorithm. The second target that matches the first target in the second image is obtained, and the closed area surrounded by the contour of the second target is output as the second target area. By extracting the second target area, the correlation analysis of the same target between bright light conditions and dark light conditions in the target object care scene is realized.
[0099] S6: Performing color restoration processing on the second target area image and outputting a restored color image. Specifically, performing color noise reduction and restoration processing on the second target area and outputting a restored color image can improve image quality and provide more accurate and clear visual information.
[0100] In one embodiment, see Figure 5 , the S6 comprises:
[0101] S61: Acquire a first color mean value of the first target area and a second color mean value of the second target area;
[0102] Specifically, the pixel values of the first target area are extracted, and the first color mean of the pixel values of the first target area is calculated: the means of the three channels of red, green and blue can be calculated respectively, or the mean of the grayscale values can be calculated, depending on the color mode of the image; the second color mean of the second target area under dark light conditions is obtained by the above method, and then the color characteristics under two different lighting conditions are obtained.
[0103] In one embodiment, see Figure 6 , before S62, including:
[0104] S6201: Acquire a second training image set collected in a bright light environment and a third training image set collected in a dark light environment;
[0105] S6202: Annotate the color mean values in the second training image set and the color mean values in the third training image set, and output a first annotated image set and a second annotated image set;
[0106] S6203: Input the first annotated image set and the second annotated image set into a second deep learning model for training, and output the noise prediction model.
[0107] Specifically, the first annotated image set and the second annotated image set are prepared as training data to ensure that each image has corresponding annotations to represent the noise or other features in the image, and an appropriate deep learning model architecture is selected, such as a convolutional neural network, an autoencoder, for the noise prediction task. The second deep learning model is trained using the first annotated image set and the second annotated image set, and the loss is calculated and the parameters are updated according to the prediction results and annotations to optimize the performance of the model. The trained model is evaluated using a validation set or a test set to check its ability to predict noise, and the model is tuned according to the evaluation results, such as adjusting hyperparameters, increasing the amount of training data, etc. After the model training and tuning are completed, the noise prediction model obtained by training is exported to a usable format, such as saved as a model file or deployed as an executable application. The noise prediction model can be used to predict the noise situation in the image and provide a reference for subsequent image processing and noise reduction.
[0108] S62: inputting the first color mean and the second color mean into a pre-trained noise prediction model, and outputting the noise between the first target area and the second target area;
[0109] Specifically, the first color mean and the second color mean are prepared as input data, ensuring that the numerical range and format of the color mean match the requirements of the noise prediction model; the noise prediction model is loaded from the pre-trained model, ensuring that the architecture and weight parameters of the model are consistent with the training process; the first color mean and the second color mean are input into the noise prediction model, and the model will calculate according to the input color mean and output the noise between the first target area and the second target area. The output noise result can be interpreted and analyzed to understand the noise characteristics and differences between the first target area and the second target area, and the first color mean and the second color mean are input into the pre-trained noise prediction model to obtain the noise information between the first target area and the second target area, which can be used for further image processing and restoration to improve image quality and reduce noise impact.
[0110] S63: performing noise reduction processing on the second target area according to the noise;
[0111] Specifically, the image data of the second target area is obtained, and the image of the second target area is subjected to denoising using the noise information. Common denoising methods may be used, such as mean filtering: replacing the value of the current pixel with the mean of the neighborhood around the pixel, median filtering: replacing the value of the current pixel with the median of the neighborhood around the pixel, and bilateral filtering: performing smoothing while retaining edge information. The denoised second target area is processed so that it maintains the same features and details as the original image.
[0112] S64: When the second color mean value of the second target area is restored to the first color mean value, output the color image.
[0113] Specifically, the color mean of the second target area after noise reduction processing is compared with the first color mean to determine whether the color mean of the second target area is equal to or close to the first color mean. A threshold can be set to determine whether the difference between the two is less than the threshold. If the color mean of the second target area has been restored to a level equal to or close to the first color mean, it means that the noise reduction processing has achieved the expected effect, and a color image is output, in which the second target area has been subjected to noise reduction processing and is consistent with other image parts.
[0114] Example 2
[0115] On the basis of Example 1, in another embodiment, if the target object is partially blocked by an obstruction under bright light conditions, resulting in a partial image in the area where the target object is located showing dark light, it is necessary to further segment the extracted second target area image. Figure 7 , the S44 further includes:
[0116] S441: If it is determined that the acquisition environment of the first image is a bright light environment, perform color space conversion on the first image to obtain a target color space image;
[0117] Specifically, if it is determined that the acquisition environment of the first image is a bright light environment, the first image is converted into a color space to obtain a target color space image; the purpose of the color space conversion is to convert the image representation from RGB to other color spaces to better capture and express the color information in the image. In a bright light environment, some color spaces that are more suitable for brightness changes are selected, such as XYZ, Lab or YcbCr. This selection is intended to make the color information in the image clearer and more distinguishable, which is helpful for the subsequent difference analysis and processing of the occluded area.
[0118] S442: For each pixel in the target color space image, calculate the color difference value between it and surrounding pixels;
[0119] Specifically, for each pixel in the target color space image, the color difference value between it and the surrounding pixels is calculated; the color difference value is calculated to quantify the color difference between pixels in the image so as to determine the possible occlusion area in the next step, using different difference calculation methods, such as Euclidean distance, color histogram difference or structural similarity index (SSI). The specific choice depends on the nature and requirements of the problem. Calculating the color difference value helps to find areas that are significantly different in color from the surrounding environment.
[0120] S443: judging the occluded area according to the color difference value and a preset color difference threshold, and determining the position information of the occluded area;
[0121] Specifically, based on the color difference value and the preset color difference threshold, the occluded area is judged to determine the position information of the occluded area; the selection of the color difference threshold determines which color differences are considered to be caused by occlusion, and the preset threshold is determined based on empirical values, statistical information or by analyzing the color difference distribution of occluded and non-occluded areas in a known data set. The adjustment of the threshold needs to balance the sensitivity and anti-interference of the occluded area to ensure that the occluded area is accurately detected without being affected by the non-occluded area.
[0122] S444: Segmenting the first image according to the occlusion area position information, and outputting an occlusion area image;
[0123] Specifically, according to the occlusion area position information, the first image is segmented and the occlusion area image is output; according to the determined occlusion area position information, the first image is segmented to separate the occlusion area from other parts, and the segmentation adopts a simple binarization method to set the pixels of the occlusion area to black, or uses a more complex segmentation algorithm, such as a segmentation network based on region growing or deep learning. The segmented occlusion area image can be used for subsequent color restoration processing.
[0124] S445: Perform color restoration processing on the occluded area image, and output a restored color image.
[0125] Example 3
[0126] See also Figure 8 Embodiment 2 of the present invention further provides a dark light image color restoration device based on image segmentation, the device comprising:
[0127] An image acquisition module, used to acquire a first image acquired at a first time and a second image acquired at a second time in a nursing scene for a target object;
[0128] A feature extraction module, used to extract features from the first image and the second image, and output a first light feature parameter corresponding to the first image and a second light feature parameter corresponding to the second image;
[0129] An environment determination module, configured to determine the acquisition environment of the first image and the acquisition environment of the second image according to the first light characteristic parameter and the second light characteristic parameter in combination with the first time and the second time;
[0130] In one embodiment, the environment determination module includes:
[0131] A sample feature extraction unit, used to obtain a first sample image captured in a bright light environment and a second sample image captured in a dark light environment, perform feature extraction on the first sample image and the second sample image, and output a first sample light feature parameter and a second sample light feature parameter;
[0132] A light characteristic parameter extraction unit is used to extract characteristics of a plurality of frames of first target images adjacent to the first image and a plurality of frames of second target images adjacent to the second image, and output the extracted light characteristic parameters corresponding to each frame of the first target image and the light characteristic parameters corresponding to each frame of the second target image;
[0133] A first sample feature matching unit is used to perform feature matching on the light feature parameters corresponding to each frame of the first target image and the first light feature parameters with the first sample light feature parameters in sequence, to obtain the number of matched first image frames;
[0134] A second sample feature matching unit is used to perform feature matching on the light feature parameters corresponding to each frame of the second target image and the second light feature parameters with the second sample light feature parameters in sequence, to obtain the number of matched second image frames;
[0135] The acquisition environment determination unit is used to determine the acquisition environment of the first image and the acquisition environment of the second image based on the first image frame number, the second image frame number and a preset frame number threshold, combined with the first time and the second time.
[0136] A bright light image segmentation module, configured to segment the first image and output a first target area image if it is determined that the acquisition environment of the first image is a bright light environment;
[0137] In one embodiment, the bright light image segmentation module includes:
[0138] A contour feature information labeling unit, used to obtain a first training image in the nursing scene, and pre-label the contour feature information of a preset target in the first training image;
[0139] A loss function acquisition unit, used to input the first training image and contour feature information into a first deep learning model for training, and acquire a loss function in model training;
[0140] A model output unit, configured to output the trained first deep learning model as an image segmentation model when it is determined according to the loss function that the output of the first deep learning model fits the input;
[0141] A first target contour feature information acquisition unit is configured to input the first image into the image segmentation model and output first target contour feature information if it is determined that the acquisition environment of the first image is a bright light environment;
[0142] In one embodiment, the first target contour feature information acquisition unit includes:
[0143] a target color space image acquisition subunit, configured to perform color space conversion on the first image to obtain a target color space image if it is determined that the acquisition environment of the first image is a bright light environment;
[0144] The color difference value calculation subunit is used to calculate the color difference value between each pixel in the target color space image and the surrounding pixels;
[0145] An occlusion region determination subunit, configured to determine the occlusion region based on the color difference value and a preset color difference threshold, and determine the position information of the occlusion region;
[0146] An occlusion area image acquisition subunit, configured to segment the first image according to the occlusion area position information and output an occlusion area image;
[0147] The occluded area color restoration subunit is used to perform color restoration processing on the occluded area image and output a restored color image.
[0148] The first target area image acquisition unit is used to segment the closed area image surrounded by the outline of the first target according to the first target outline feature information, and output the first target area image.
[0149] a feature matching module, configured to perform image segmentation and feature matching on the second image if it is determined that the acquisition environment of the second image is a dark light environment, and output a second target area image that matches the first target area image;
[0150] In one embodiment, the feature matching module includes:
[0151] an object detection unit, configured to input the first image and the second image into a pre-trained object detection model if it is determined that the acquisition environment of the second image is a dark light environment, and output first detection frame information, a first object category, second detection frame information, and a second object category;
[0152] a second target acquisition unit, configured to match the first detection frame information with the second detection frame information, and match the first target category with the second target category, to acquire a second target in the second image that matches the first target;
[0153] The second target area image acquisition unit is used to input the second image into the image segmentation model, and output the closed area image surrounded by the outline of the second target as the second target area image.
[0154] The color restoration module is used to perform color restoration processing on the second target area image and output a restored color image.
[0155] In one embodiment, the color restoration module includes:
[0156] A color mean value acquisition unit, used to acquire a first color mean value of the first target area and a second color mean value of the second target area;
[0157] A noise prediction unit, configured to input the first color mean and the second color mean into a pre-trained noise prediction model, and output the noise between the first target area and the second target area;
[0158] A noise reduction processing unit, configured to perform noise reduction processing on the second target area according to the noise;
[0159] A color image output unit is used to output the color image when the second color mean value of the second target area is restored to the first color mean value.
[0160] In one embodiment, the noise prediction unit further includes:
[0161] The training image set acquisition subunit is used to acquire a second training image set in a bright light environment and a third training image set in a dark light environment;
[0162] A color mean value annotation subunit is used to annotate the color mean values in the second training image set and the color mean values in the third training image set, and output a first annotated image set and a second annotated image set;
[0163] The model training subunit is used to input the first annotated image set and the second annotated image set into a second deep learning model for training, and output the noise prediction model.
[0164] Specifically, a dark-light image color restoration device based on image segmentation provided by an embodiment of the present invention is adopted, and the device includes: an image acquisition module, used to acquire a first image captured at a first time and a second image captured at a second time in a nursing scene for a target object; a feature extraction module, used to perform feature extraction on the first image and the second image, and output a first light characteristic parameter corresponding to the first image and a second light characteristic parameter corresponding to the second image; an environment determination module, used to determine the acquisition environment of the first image and the acquisition environment of the second image according to the first light characteristic parameter and the second light characteristic parameter, in combination with the first time and the second time; a bright-light image segmentation module, used to perform image segmentation on the first image if it is determined that the acquisition environment of the first image is a bright-light environment, and output a first target area image; a feature matching module, used to perform image segmentation and feature matching on the second image if it is determined that the acquisition environment of the second image is a dark-light environment, and output a second target area image that matches the first target area image; a color restoration module, used to perform color restoration processing on the second target area image, and output a restored color image. By extracting the light characteristic parameters of the first and second images, the device can compare the images collected at different time points, use the light characteristic parameters in combination with the collection time to determine the collection environment, dynamically adapt to different lighting conditions, and when it is determined that the collection environment of the first image is a bright light environment, image segmentation is performed to output the target area image, which is helpful for extracting the target object, reducing the processing of irrelevant information, and improving the efficiency of the system; when it is determined that the collection environment of the second image is a dark light environment, image segmentation and feature matching are performed to more accurately identify the target object under low light conditions, increasing the accuracy of the system in complex environments; color restoration processing is performed on the second target area image, making the output image more realistic and easier for humans to observe and understand. In general, by performing color restoration processing in a dark light environment, image quality can be improved, the recognition accuracy of the target object can be improved, the user experience can be enhanced, and the system misjudgment rate can be reduced, thereby improving the monitoring effect and practicality of the entire nursing scene.
[0165] Example 3
[0166] In addition, combined Figure 1 The dark-light image color restoration method based on image segmentation described in Embodiment 1 of the present invention can be implemented by an electronic device. Fig. 9 A schematic diagram of the hardware structure of an electronic device provided in Embodiment 3 of the present invention is shown.
[0167] The electronic device may include a processor and a memory storing computer program instructions.
[0168] Specifically, the processor may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present invention.
[0169] The memory may include a large capacity memory for data or instructions. By way of example and not limitation, the memory may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory may include a removable or non-removable (or fixed) medium. Where appropriate, the memory may be inside or outside a data processing device. In a particular embodiment, the memory is a non-volatile solid-state memory. In a particular embodiment, the memory includes a read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM) or a flash memory or a combination of two or more of these.
[0170] The processor implements any one of the dark-light image color restoration methods based on image segmentation in the above embodiments by reading and executing computer program instructions stored in the memory.
[0171] In one example, the electronic device may further include a communication interface and a bus. Fig. 9 As shown, the processor, memory, and communication interface are connected via a bus and communicate with each other.
[0172] The communication interface is mainly used to implement communication between the modules, devices, units and / or equipment in the embodiments of the present invention.
[0173] The bus includes hardware, software or both, and the parts of the device are coupled to each other. For example, but not limitation, the bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In suitable cases, the bus may include one or more buses. Although the embodiment of the present invention describes and shows a specific bus, the present invention considers any suitable bus or interconnection.
[0174] Example 4
[0175] In addition, in combination with the dark-light image color restoration method based on image segmentation in the above embodiment 1, embodiment 4 of the present invention can also provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the dark-light image color restoration methods based on image segmentation in the above embodiments is implemented.
[0176] In summary, the embodiments of the present invention provide a method, device and apparatus for color restoration of dark-light images based on image segmentation.
[0177] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.
[0178] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0179] It should also be noted that the exemplary embodiments mentioned in the present invention describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiments, or in a different order from the embodiments, or several steps can be performed simultaneously.
[0180] The above is only a specific implementation of the present invention. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the system, module and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. It should be understood that the protection scope of the present invention is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be covered within the protection scope of the present invention.
Claims
1. A method for color restoration of dark light images based on image segmentation, characterized in that: The method comprises: S1: Acquire a first image acquired at a first time and a second image acquired at a second time in a nursing scene for a target object; S2: extracting features from the first image and the second image, and outputting first light feature parameters corresponding to the first image and second light feature parameters corresponding to the second image; S3: determining the acquisition environment of the first image and the acquisition environment of the second image according to the first light characteristic parameter and the second light characteristic parameter in combination with the first time and the second time; S4: if it is determined that the acquisition environment of the first image is a bright light environment, performing image segmentation on the first image and outputting a first target area image; S5: If it is determined that the acquisition environment of the second image is a dark light environment, performing image segmentation and feature matching on the second image, and outputting a second target area image that matches the first target area image; S6: performing color restoration processing on the second target area image, and outputting a restored color image; The S3 includes: S31: Acquire a first sample image captured in a bright light environment and a second sample image captured in a dark light environment, perform feature extraction on the first sample image and the second sample image, and output first sample light feature parameters and second sample light feature parameters; S32: extracting features from a plurality of frames of first target images adjacent to the first image and a plurality of frames of second target images adjacent to the second image, and outputting the extracted light feature parameters corresponding to each frame of the first target image and the light feature parameters corresponding to each frame of the second target image; S33: performing feature matching on the light feature parameters corresponding to each frame of the first target image and the first light feature parameters respectively with the first sample light feature parameters in sequence, and obtaining the number of matched first image frames; S34: performing feature matching on the light feature parameters corresponding to each frame of the second target image and the second light feature parameters with the second sample light feature parameters in sequence, and obtaining the number of matched second image frames; S35: determining the acquisition environment of the first image and the acquisition environment of the second image according to the first image frame number, the second image frame number and a preset frame number threshold, in combination with the first time and the second time; The S6 includes: S61: Acquire a first color mean value of the first target area and a second color mean value of the second target area; S62: inputting the first color mean and the second color mean into a pre-trained noise prediction model, and outputting the noise between the first target area and the second target area; S63: performing noise reduction processing on the second target area according to the noise; S64: when the second color mean value of the second target area after the noise reduction process is restored to the first color mean value, output the color image; The first light characteristic parameter and the second light characteristic parameter include at least the following parameters: exposure value, color saturation, contrast, shadow and highlight, color temperature and noise.
2. The dark light image color restoration method based on image segmentation according to claim 1, characterized in that: The S4 includes: S41: Acquire a first training image in the nursing scene, and pre-label contour feature information of a preset target in the first training image; S42: Inputting the first training image and contour feature information into a first deep learning model for training, and obtaining a loss function in model training; S43: When it is determined according to the loss function that the output of the first deep learning model fits the input, outputting the trained first deep learning model as an image segmentation model; S44: if it is determined that the acquisition environment of the first image is a bright light environment, input the first image into the image segmentation model, and output first target contour feature information; S45: Segmenting the closed area image enclosed by the outline of the first target according to the first target outline feature information, and outputting the first target area image.
3. The dark light image color restoration method based on image segmentation according to claim 1, characterized in that: The S5 includes: S51: If it is determined that the acquisition environment of the second image is a dark light environment, input the first image and the second image into a pre-trained object detection model, and output first detection frame information, a first object category, second detection frame information, and a second object category; S52: Matching the first detection frame information with the second detection frame information, and matching the first object category with the second object category, to obtain a second object in the second image that matches the first object; S53: Input the second image into the image segmentation model, and output the closed area image surrounded by the outline of the second target as the second target area image.
4. The dark light image color restoration method based on image segmentation according to claim 1, characterized in that: The S62 includes: S6201: Acquire a second training image set collected in a bright light environment and a third training image set collected in a dark light environment; S6202: Annotate the color mean values in the second training image set and the color mean values in the third training image set, and output a first annotated image set and a second annotated image set; S6203: Input the first annotated image set and the second annotated image set into a second deep learning model for training, and output the noise prediction model.
5. A dark light image color restoration device based on image segmentation, characterized in that: The device comprises: An image acquisition module, used to acquire a first image acquired at a first time and a second image acquired at a second time in a nursing scene for a target object; A feature extraction module, used to extract features from the first image and the second image, and output a first light feature parameter corresponding to the first image and a second light feature parameter corresponding to the second image; An environment determination module, configured to determine the acquisition environment of the first image and the acquisition environment of the second image according to the first light characteristic parameter and the second light characteristic parameter in combination with the first time and the second time; A bright light image segmentation module, configured to segment the first image and output a first target area image if it is determined that the acquisition environment of the first image is a bright light environment; a feature matching module, configured to perform image segmentation and feature matching on the second image if it is determined that the acquisition environment of the second image is a dark light environment, and output a second target area image that matches the first target area image; A color restoration module, used for performing color restoration processing on the second target area image and outputting a restored color image; The determining of the acquisition environment of the first image and the acquisition environment of the second image according to the first light characteristic parameter and the second light characteristic parameter in combination with the first time and the second time includes: Acquire a first sample image captured in a bright light environment and a second sample image captured in a dark light environment, perform feature extraction on the first sample image and the second sample image, and output a first sample light feature parameter and a second sample light feature parameter; Performing feature extraction on a plurality of frames of first target images adjacent to the first image and a plurality of frames of second target images adjacent to the second image, and outputting the extracted light feature parameters corresponding to each frame of the first target image and the light feature parameters corresponding to each frame of the second target image; The light characteristic parameters corresponding to each frame of the first target image and the first light characteristic parameters are sequentially matched with the first sample light characteristic parameters to obtain the number of matched first image frames; The light characteristic parameters corresponding to each frame of the second target image and the second light characteristic parameters are sequentially matched with the second sample light characteristic parameters to obtain the number of matched second image frames; Determining the acquisition environment of the first image and the acquisition environment of the second image according to the first image frame number, the second image frame number and a preset frame number threshold value, in combination with the first time and the second time; The performing color restoration processing on the second target area image and outputting the restored color image comprises: Acquire a first color mean value of the first target area and a second color mean value of the second target area; Inputting the first color mean and the second color mean into a pre-trained noise prediction model, and outputting the noise between the first target area and the second target area; performing noise reduction processing on the second target area according to the noise; When the second color mean value of the second target area after the noise reduction process is restored to the first color mean value, outputting the color image; The first light characteristic parameter and the second light characteristic parameter include at least the following parameters: exposure value, color saturation, contrast, shadow and highlight, color temperature and noise.
6. An electronic device, characterized in that: include: At least one processor, at least one memory and computer program instructions stored in the memory, when the computer program instructions are executed by the processor, implement the method according to any one of claims 1 to 4.
7. A storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Image processing method and device and storage medium
CN115460343A
Path extraction and identification method of visual guidance system under complex illumination condition
CN107622502A
Exposure control method, shooting processing method, device and medium
CN114785966A
