Self-adaptive correction cigar air-curing night image natural color recovery method

Through the adaptively corrected natural color recovery method of cigar smoke drying night images, the problem of inconsistency in image caused by differences in day and night lighting conditions is solved, and the natural color recovery of cigar smoke night images and high-quality monitoring data support is achieved.

CN119887590AActive Publication Date: 2025-04-25XICHANG COLLEGE
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510368624.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-27
Publication Date
2025-04-25
Estimated Expiration
2045-03-27

AI Technical Summary

Technical Problem

During the process of drying cigar smoke, differences in day and night lighting conditions lead to significant differences in the color temperature and tone of the image, the color of the tobacco leaves is unnatural, and the overall image color deviation is large, which affects the monitoring quality and the reliability of the automated analysis system.

Method used

The natural color recovery method of cigar smoke drying night images is adopted, and the natural color recovery of cigar smoke night images is achieved through image preprocessing, depth feature extraction, color migration, image adjustment and image fusion steps.

Benefits of technology

The color temperature and tone of the cigar smoke drying images at night has been effectively adjusted, the image color deviation has been reduced, and the accurate color restoration has been achieved, which has significantly improved the image correction effect during the cigar smoke drying process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119887590A_ABST
    Figure CN119887590A_ABST
Patent Text Reader

Abstract

The invention discloses a self-adaptive correction cigar air-curing night image natural color recovery method, and belongs to the technical field of cigar air-curing night image natural color recovery, and the method comprises the following steps: S1, obtaining a first cigar night image and a first reference image data set loaded in a tobacco air-curing image as input images, s2, performing image preprocessing operation on the input image; s3, performing feature calculation on the preprocessed image, and obtaining an optimal image in the reference image data set; s4, taking the optimal image as a reference, and carrying out color migration based on the adaptive color corresponding to the feature similarity; s5, performing image adjustment on the image after color migration; and S6, carrying out image fusion on the cigar nighttime image after image adjustment, and obtaining and outputting a cigar nighttime correction image. A zero-sample self-adaptive correction image processing technology is adopted, the night image of the cigar is comprehensively corrected, and the obvious difference between the color temperature and the hue of the air-cured image of the cigar and the color temperature and the hue of the air-cured image of the cigar in the daytime is adjusted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of natural color restoration of cigar drying images at night, and in particular to a method for restoring the natural color of cigar drying images at night with adaptive correction. Background Art

[0002] With the widespread application of image processing technology in the tobacco industry, application scenarios have included tobacco field monitoring, agricultural monitoring in rainy weather, cigar drying monitoring and other tobacco production links. The cigar drying process is a key link to ensure its quality, and it requires all-weather monitoring to record the status of tobacco leaves. However, due to the difference in lighting conditions during the day and night, there is a significant color inconsistency problem in the image acquisition process. Images taken during the day rely on natural light, with a high degree of color restoration, which can truly reflect the actual state of tobacco leaves; while night shooting requires the use of artificial fill lights (such as LED lights), resulting in significant differences in the color temperature and hue of the image from daytime, unnatural tobacco leaf color, and large overall image color deviation. This color inconsistency of day and night images not only affects the continuous monitoring quality of the tobacco drying process, but also increases the complexity of the subsequent division of cigar drying stages, and may even interfere with the computer vision-based automated analysis system, reduce the reliability and consistency of the data, and restrict its practical application in cigar drying. Summary of the invention

[0003] The purpose of the present invention is to overcome the deficiencies of the prior art and to provide a method for restoring the natural colors of a cigar drying night image with adaptive correction.

[0004] The objective of the present invention is achieved through the following technical solutions: The present invention discloses a method for restoring the natural color of a nighttime image of a cigar drying by adaptive correction, comprising the following steps: S1, input image, obtain tobacco leaf drying image in cigar drying room from network or hard disk; load the first cigar night image and the first reference image data set from the obtained tobacco leaf drying image; S2, image preprocessing, performing image preprocessing on the first cigar night image and the first reference image dataset respectively to obtain a second cigar night image and a second reference image dataset; S3, deep feature extraction, calculating the image features of the second cigar night image and the second reference image dataset respectively, and obtaining the best image in the second reference image dataset; S4, color migration, taking the best image obtained in step S3 as a reference, based on the adaptive color corresponding to the feature similarity, color migration is performed on the second cigar night image to obtain a third cigar night image; S5, image adjustment, performing contrast adjustment, saturation adjustment and brightness adjustment on the night image of the third cigar; S6, image fusion, performing weighted fusion, histogram equalization and final fusion on the third cigar night image after image adjustment, to obtain and output a cigar night corrected image.

[0005] Furthermore, the preprocessing described in step S2 specifically includes the following steps: S21, through the formula For the first input image Perform normalization to obtain the first image , wherein the first input image including a first cigar night image and a first reference image dataset, Represents the first input image The maximum value of Represents the first input image The minimum value of , (x, y) represents the image coordinate point, x represents the horizontal coordinate; y represents the vertical coordinate; S22, through the formula For the first image Perform Z-Score normalization to obtain the second image ,in Indicates the first image The mean value of each color channel in , Indicates the first image The standard deviation of each color channel in; then through the formula For the second image The mean of is calculated, where Represents the second image The width of Represents the second image Height, Represents the second image The mean of For the second image The standard deviation is calculated as Represents the second image The standard deviation of S23, through the formula For the second image Perform Gaussian filtering to obtain the third image ; S24, through the formula For the third image Perform bilateral filtering to obtain the fourth image , the fourth image including a second cigar night image and a second reference image dataset, Ω(x,y) Indicates the third image The neighborhood of the image coordinate point (x,y), Represents the image coordinate point The third image value, represents the spatial Gaussian kernel, represents the standard deviation of the spatial Gaussian kernel, Represents the image coordinate point (x, y) and the image coordinate point The spatial distance between represents the range Gaussian kernel, represents the standard deviation of the range Gaussian kernel, Represents the image coordinate point (x, y) and the image coordinate point The difference in pixel values ​​between Represents the normalization factor, and its weight sum is 1, and its calculation method is .

[0006] Preferably, the step S3 specifically includes the following steps: S31, through the formula For the fourth image Perform convolution operation to extract its local features and capture its local texture features and edge features. Indicates that the output feature map is in the image The median coordinate is The value at Representing images In coordinates The pixel value at Indicates the relative position of the convolution kernel The weight value at ; S32, through the ReLU activation function Removal Negative values ​​of increase its nonlinearity and prevent the gradient from disappearing; S33, through the formula Perform batch averaging of images Calculate, where represents the mean of the image batch, represents the output value of the ReLU function in step S32, and m represents the batch size; then, by the formula Variance of image batches Calculate and finally use the formula and Perform batch normalization calculation, where represents a constant to prevent division by zero, γ represents a learnable scaling parameter, β represents a learnable translation parameter, express In the coordinates ( i , j )’s normalized eigenvalues; S34, through the formula Results of batch normalization Perform adaptive pooling, where represents adaptive average pooling; S35, calculating feature similarity, specifically including using the formula Calculate the similarity of feature vectors, where Representing images The characteristic vector of Representing images The characteristic vector of Represents the feature vector The i-th component of Represents the feature vector The i-th component of Represents the feature vector The L2 norm of Represents the feature vector The L2 norm of n represents the length of the vector. Represents the feature vector and the eigenvector degree of similarity.

[0007] Preferably, step S4 specifically includes the following steps: S41, through the formula Calculate the adaptive weights, where represents the color migration weight, represents the feature weight coefficient, min() represents the function used to limit the result to [0, 1]; S42, through the formula For the fourth image Perform color migration to obtain the fifth image , the fifth image Includes a third cigar night image, where Represents the average value of the reference images of the second reference image dataset.

[0008] Preferably, step S5 specifically includes the following steps: S51, through the formula For the fifth image The contrast is adjusted to obtain the contrast adjustment result. ,in Indicates the fifth image The minimum value of Indicates the fifth image The maximum value of S52, through the formula For the fifth image Adjust the saturation to obtain the saturation adjustment result , where γ represents the saturation index; S53, through the formula For the fifth image The brightness is adjusted to obtain the brightness adjustment result ,in represents the contrast parameter, Represents the brightness parameter.

[0009] Preferably, step S6 specifically includes the following steps: S61, through the formula The contrast adjustment results, brightness adjustment results, and saturation adjustment results are integrated to balance the processing effect. Represents the component weight of the brightness adjustment result, represents the component weight of the contrast adjustment result, represents the component weight of the saturation adjustment result, and ; S62, through the formula Performing local histogram equalization on each channel in a second input image, wherein the second input image includes a third cigar night image after image adjustment; represents the local values ​​of the channel map of the second input image, Indicates the maximum channel value in the current local area. Indicates the minimum channel value in the current local area; S63, through the formula Perform range clipping, where represents the minimum allowed value, Indicates the maximum allowed value.

[0010] The beneficial effects of the present invention are: 1) The adaptive correction natural color restoration algorithm for cigar drying night images proposed in this scheme adopts zero-sample adaptive correction image processing technology, breaking through the application bottleneck of traditional enhancement methods and deep learning algorithms in the complex environment of cigar drying.

[0011] 2) On the basis of ensuring efficient calculation, the present invention comprehensively corrects the night-time images of cigars: the color temperature and hue of the night-time drying images of cigars are effectively adjusted to be significantly different from those during the day, thereby reducing the color deviation of the images and achieving accurate color restoration.

[0012] 3) The image correction effect of the present invention under the condition of night-time drying of cigars is remarkable, and it can restore the night-time images of cigars drying under complex environments, filling the gap of the current night-time image correction algorithm of cigars. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 A schematic diagram of the steps of a method for restoring natural colors of a night-time image of cigars drying with adaptive correction according to an embodiment of the present invention; Figure 2 The present invention is a flowchart of a method for restoring natural colors of a night-time image of cigars by adaptive correction according to an embodiment of the present invention. DETAILED DESCRIPTION

[0014] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0015] The present invention provides an adaptive correction method for restoring the natural color of nighttime cigar drying images. Through image preprocessing, deep feature extraction, feature similarity calculation, color migration model, image adjustment, image fusion, etc., it effectively solves the problems of obvious differences in color temperature and hue between the images during the cigar drying process and those during the day, unnatural tobacco leaf color, and large color deviation of the overall image. It can provide high-quality cigar drying images and provide reliable data support for automated monitoring of cigar drying. The schematic diagram of the steps is shown in the figure below. Figure 1 The process diagram is shown in Figure 2 As shown, the specific steps include: S1, input image, obtain tobacco leaf drying image in cigar drying room from network or hard disk; load the first cigar night image and the first reference image data set from the obtained tobacco leaf drying image; S2, image preprocessing, performing image preprocessing on the first cigar night image and the first reference image dataset respectively to obtain a second cigar night image and a second reference image dataset; S3, deep feature extraction, calculating the image features of the second cigar night image and the second reference image dataset respectively, and obtaining the best image in the second reference image dataset; S4, color migration, taking the best image obtained in step S3 as a reference, based on the adaptive color corresponding to the feature similarity, color migration is performed on the second cigar night image to obtain a third cigar night image; S5, image adjustment, performing contrast adjustment, saturation adjustment and brightness adjustment on the night image of the third cigar; S6, image fusion, performing weighted fusion, histogram equalization and final fusion on the third cigar night image after image adjustment, to obtain and output a cigar night corrected image.

[0016] Specifically, the preprocessing described in step S2 specifically includes the following steps: S21, through the formula For the first input image Perform normalization to obtain the first image , wherein the first input image including a first cigar night image and a first reference image dataset, Represents the first input image The maximum value of Represents the first input image The minimum value of , (x, y) represents the image coordinate point, x represents the horizontal coordinate; y represents the vertical coordinate; S22, through the formula For the first image Perform Z-Score standardization, which is a data preprocessing method that converts the data into a mean of 0 and a standard deviation of 1, to obtain the second image ,in Indicates the first image The mean value of each color channel in , Indicates the first image The standard deviation of each color channel in; then through the formula For the second image The mean of is calculated, where Represents the second image The width of Represents the second image Height, Represents the second image The mean of For the second image The standard deviation is calculated as Represents the second image The standard deviation of S23, through the formula For the second image Perform Gaussian filtering to obtain the third image ; S24, through the formula For the third image Perform bilateral filtering to obtain the fourth image , the fourth image including a second cigar night image and a second reference image dataset, Ω(x,y) Indicates the third image In the neighborhood of the image coordinate point (x, y), Represents the image coordinate point The third image value, represents the spatial Gaussian kernel, represents the standard deviation of the spatial Gaussian kernel, Represents the image coordinate point (x, y) and the image coordinate point The spatial distance between represents the range Gaussian kernel, represents the standard deviation of the range Gaussian kernel, Represents the image coordinate point (x, y) and the image coordinate point The difference in pixel values ​​between Represents the normalization factor, and its weight sum is 1, and its calculation method is .

[0017] Specifically, step S3 includes the following steps: S31, through the formula For the fourth image Perform convolution operation to extract its local features and capture its local texture features and edge features. Indicates that the output feature map is in the image The median coordinate is The value at Representing images In coordinates The pixel value at Indicates the relative position of the convolution kernel The weight value at ; S32, through the ReLU activation function Removal Negative values ​​of increase its nonlinearity and prevent the gradient from disappearing; S33, through the formula Perform image batch mean calculation, where represents the mean of the image batch, represents the output value of the ReLU function in step S32, and m represents the batch size; then, by the formula The variance of the image batch is calculated, and finally the formula is used and Perform batch normalization calculation, where represents a constant to prevent division by zero, γ represents a learnable scaling parameter, β represents a learnable translation parameter, express In the coordinates ( i ,j )’s normalized eigenvalues; batch normalization can stabilize deep network training, reduce internal covariate shift, accelerate network convergence, and improve model generalization ability; S34, through the formula Results of batch normalization Perform adaptive pooling, where represents adaptive average pooling; S35, calculating feature similarity, specifically including using the formula Calculate the similarity of feature vectors, where Representing images The characteristic vector of Representing images The characteristic vector of Represents the feature vector The i-th component of Represents the feature vector The i-th component of Represents the feature vector The L2 norm of Represents the feature vector The L2 norm of n represents the length of the vector. Represents the feature vector and the eigenvector Here we calculate the similarity between two feature vectors, which is used to measure the vector similarity in the feature space.

[0018] Specifically, step S4 includes the following steps: S41, through the formula Calculate the adaptive weights, where represents the color migration weight, represents the feature weight coefficient, min() represents a function used to limit the result to [0, 1]. The content in the brackets is the smaller value to be selected; S42, through the formula For the fourth image Perform color migration to obtain the fifth image , the fifth image Includes a third cigar night image, where Represents the average value of the reference images of the second reference image dataset.

[0019] Specifically, step S5 includes the following steps: S51, through the formula For the fifth image The contrast is adjusted to obtain the contrast adjustment result. ,in Indicates the fifth image The minimum value of Indicates the fifth image The maximum value of S52, through the formula For the fifth image Adjust the saturation to obtain the saturation adjustment result , where γ represents the saturation index; S53, through the formula For the fifth image The brightness is adjusted to obtain the brightness adjustment result ,in represents the contrast parameter, Indicates the brightness parameter. is 1.01, is 9.

[0020] Specifically, step S6 includes the following steps: S61, through the formula The contrast adjustment results, brightness adjustment results, and saturation adjustment results are integrated to balance the processing effect. Represents the component weight of the brightness adjustment result, represents the component weight of the contrast adjustment result, represents the component weight of the saturation adjustment result, and ; S62, through the formula Performing local histogram equalization on each channel in a second input image, wherein the second input image includes a third cigar night image after image adjustment; represents the local values ​​of the channel map of the second input image, Indicates the maximum channel value in the current local area. Indicates the minimum channel value in the current local area; S63, through the formula Perform range clipping, where represents the minimum allowed value, Indicates the maximum allowable value. The value is 0. The value is 255.

[0021] The adaptive correction algorithm for restoring the natural color of night-time cigar drying images proposed in the present invention uses zero-sample adaptive correction image processing technology to break through the application bottleneck of traditional enhancement methods and deep learning algorithms in the complex environment of cigar drying. This method comprehensively corrects the night-time images of cigars on the basis of ensuring efficient calculation: it effectively adjusts the color temperature and hue of the night-time cigar drying images to be significantly different from those during the day, reduces the color deviation of the image, and achieves accurate color restoration. This method has a significant effect on image correction under the conditions of night-time cigar drying, and can restore night-time cigar drying images in complex environments, filling the gap in the current night-time cigar image correction algorithm.

[0022] The above is only a preferred embodiment of the present invention. It should be understood that the present invention is not limited to the form disclosed herein, and should not be regarded as excluding other embodiments, but can be used in various other combinations, modifications and environments, and can be modified within the scope of the concept described herein through the above teachings or the technology or knowledge of the relevant field. The changes and modifications made by those skilled in the art shall not deviate from the spirit and scope of the present invention, and shall be within the scope of protection of the claims attached to the present invention.

Claims

1. A method for restoring the natural color of a night-time image of cigars with adaptive correction, characterized in that: The following steps are involved: S1, input image, obtain tobacco leaf drying image in cigar drying room from network or hard disk; load the first cigar night image and the first reference image data set from the obtained tobacco leaf drying image; S2, image preprocessing, performing image preprocessing on the first cigar night image and the first reference image dataset respectively to obtain a second cigar night image and a second reference image dataset; S3, deep feature extraction, calculating the image features of the second cigar night image and the second reference image dataset respectively, and obtaining the best image in the second reference image dataset; S4, color migration, taking the best image obtained in step S3 as a reference, based on the adaptive color corresponding to the feature similarity, color migration is performed on the second cigar night image to obtain a third cigar night image; S5, image adjustment, performing contrast adjustment, saturation adjustment and brightness adjustment on the night image of the third cigar; S6, image fusion, performing weighted fusion, histogram equalization and final fusion on the third cigar night image after image adjustment, to obtain and output a cigar night corrected image.

2. The method for restoring natural colors of night-time cigar drying images by adaptive correction according to claim 1, characterized in that: The preprocessing described in step S2 specifically includes the following steps: S21, through the formula For the first input image Perform normalization to obtain the first image , wherein the first input image including a first cigar night image and a first reference image dataset, Represents the first input image The maximum value of Represents the first input image The minimum value of , (x, y) represents the image coordinate point, x represents the horizontal coordinate; y represents the vertical coordinate; S22, through the formula For the first image Perform Z-Score normalization to obtain the second image ,in Indicates the first image The mean value of each color channel in , Indicates the first image The standard deviation of each color channel in; then through the formula For the second image The mean of is calculated, where Represents the second image The width of Represents the second image Height, Represents the second image The mean of For the second image The standard deviation is calculated as Represents the second image The standard deviation of S23, through the formula For the second image Perform Gaussian filtering to obtain the third image ; S24, through the formula For the third image Perform bilateral filtering to obtain the fourth image , the fourth image including a second cigar night image and a second reference image dataset, Ω(x,y) Indicates the third image The neighborhood of the image coordinate point (x,y), Represents the image coordinate point The third image value, represents the spatial Gaussian kernel, represents the standard deviation of the spatial Gaussian kernel, Represents the image coordinate point (x, y) and the image coordinate point The spatial distance between represents the range Gaussian kernel, represents the standard deviation of the range Gaussian kernel, Represents the image coordinate point (x, y) and the image coordinate point The difference in pixel values ​​between Represents the normalization factor, and its weight sum is 1, and its calculation method is .

3. The method for restoring natural colors of night-time cigar drying images by adaptive correction according to claim 2, characterized in that: The step S3 specifically comprises the following steps: S31, through the formula For the fourth image Perform convolution operation to extract its local features and capture its local texture features and edge features. Indicates that the output feature map is in the image The median coordinate is The value at Representing images In coordinates The pixel value at Indicates the relative position of the convolution kernel The weight value at ; S32, through the ReLU activation function Removal Negative values ​​of increase its nonlinearity and prevent the gradient from disappearing; S33, through the formula Perform batch averaging of images Calculate, where represents the mean of the image batch, represents the output value of the ReLU function in step S32, and m represents the batch size; then, by the formula Variance of image batches Calculate and finally use the formula and Perform batch normalization calculation, where represents a constant to prevent division by zero, γ represents a learnable scaling parameter, β represents a learnable translation parameter, express In the coordinates ( i , j )’s normalized eigenvalues; S34, through the formula Results of batch normalization Perform adaptive pooling, where represents adaptive average pooling; S35, calculating feature similarity, specifically including using the formula Calculate the similarity of feature vectors, where Representing images The characteristic vector of Representing images The characteristic vector of Represents the feature vector The i-th component of Represents the feature vector The i-th component of Represents the feature vector The L2 norm of Represents the feature vector The L2 norm of n represents the length of the vector. Represents the feature vector and the eigenvector degree of similarity.

4. The method for restoring natural colors of night-time cigar drying images by adaptive correction according to claim 3, characterized in that: Step S4 specifically includes the following steps: S41, through the formula Calculate the adaptive weights, where represents the color migration weight, represents the feature weight coefficient, min() represents the function used to limit the result to [0, 1]; S42, through the formula For the fourth image Perform color migration to obtain the fifth image , the fifth image Includes a third cigar night image, where Represents the average value of the reference images of the second reference image dataset.

5. The method for restoring natural colors of night-time cigar drying images by adaptive correction according to claim 4, characterized in that: Step S5 specifically includes the following steps: S51, through the formula For the fifth image The contrast is adjusted to obtain the contrast adjustment result. ,in Indicates the fifth image The minimum value of Indicates the fifth image The maximum value of S52, through the formula For the fifth image Adjust the saturation to obtain the saturation adjustment result , where γ represents the saturation index; S53, through the formula For the fifth image The brightness is adjusted to obtain the brightness adjustment result ,in represents the contrast parameter, Represents the brightness parameter.

6. The method for restoring natural colors of night-time cigar drying images by adaptive correction according to claim 5, characterized in that: Step S6 specifically includes the following steps: S61, through the formula The contrast adjustment results, brightness adjustment results, and saturation adjustment results are integrated to balance the processing effect. Represents the component weight of the brightness adjustment result, represents the component weight of the contrast adjustment result, represents the component weight of the saturation adjustment result, and ; S62, through the formula Performing local histogram equalization on each channel in a second input image, wherein the second input image includes a third cigar night image after image adjustment; represents the local values ​​of the channel map of the second input image, Indicates the maximum channel value in the current local area. Indicates the minimum channel value in the current local area; S63, through the formula Perform range clipping, where represents the minimum allowed value, Indicates the maximum allowed value.

Citation Information

Patent Citations

  • Enhancing method of low-light video images

    CN103606134A

  • Image fusion method, and training method and device of image fusion model

    CN114119378A

  • Weather phenomenon automatic identification method under dark light condition

    CN117746374A

  • Night image enhancement and noise suppression integrated system based on deep learning

    CN118941462A