Image brightness and contrast recognition and control method and system

By segmenting and obtaining parameters of the target image and adjusting it in combination with preset judgment conditions, the problem of insufficient intelligent adjustment of image brightness and contrast in the prior art is solved, and accurate recognition and intelligent adjustment are achieved.

CN120219256APending Publication Date: 2025-06-27SHANGHAI INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510199022.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-24
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

In the prior art, intelligent adjustment of image brightness and contrast is insufficient in combination with equipment, resulting in the inability to achieve accurate automatic adjustment.

Method used

By performing the first segmentation operation on the target image, the target parameters of different regions are obtained, the preset judgment conditions are used to determine the light and dark effect based on the target parameters, and the determination is made based on the judgment results.

Benefits of technology

Accurate recognition and intelligent adjustment of image brightness and contrast are realized, adjustment efficiency and accuracy are improved, and the problem of insufficient intelligent adjustment in the prior art is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120219256A_ABST
    Figure CN120219256A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of automation control, and discloses an image brightness and contrast recognition and control method and system, and the method comprises the steps: carrying out the first segmentation operation of a target image, and obtaining the target parameters of different regions after the first segmentation operation; presetting a first judgment condition, and judging the light and shade effect of the target image in combination with the target parameter; according to the first judgment result, the target image is adjusted in combination with the preset adjustment operation, accurate recognition of the image brightness and contrast can be achieved, intelligent adjustment can be carried out according to the recognition result, and the recognition accuracy is improved. Therefore, the problem of insufficient combination operation of intelligent adjustment of image brightness and contrast and equipment in the prior art is solved. Besides, by presetting the first data set, performing region segmentation on the target image and obtaining the optimal number of segmented regions, segmentation of the target image is more reasonable, and the recognition precision of the image brightness and the contrast is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automatic control, and particularly to a method and system for identifying and controlling image brightness and contrast. Background Art

[0002] With the development of artificial intelligence, more and more devices are advancing side by side on the road of intelligent automation. The ability to achieve automatic adjustment has become an essential function of current industrial equipment, and the adjustment of brightness and contrast in a scanning electron microscope is the basis, and even the top priority, of electron microscope imaging adjustment.

[0003] The identification method of brightness and contrast and its automatic adjustment control method can achieve precise adjustment of brightness and contrast. Most of the existing research on image brightness and contrast stays at finding patterns, rather than expanding research on how to combine with equipment operation after realizing intelligent adjustment. Summary of the Invention

[0004] In view of the above existing problems, the present invention is proposed.

[0005] Therefore, the present invention provides a method and system for identifying and controlling image brightness and contrast, which can solve the problem of insufficient combination of intelligent adjustment of image brightness and contrast with equipment operation in the prior art.

[0006] To solve the above technical problems, the present invention provides the following technical solutions:

[0007] In a first aspect, the present invention provides a method for identifying and controlling image brightness and contrast, including:

[0008] Performing a first segmentation operation on a target image, and obtaining target parameters of different regions after the first segmentation operation;

[0009] Presetting a first judgment condition, and judging the light and dark effect of the target image in combination with the target parameters;

[0010] The light and dark effect is only the effect generated by image brightness and contrast, and the light and dark effect includes a first effect and a second effect;

[0011] Adjusting the target image in combination with a preset adjustment operation according to the first judgment result;

[0012] The preset adjustment operation is an adjustment operation designed according to the first judgment condition, and the preset adjustment operation includes a first adjustment operation for the first effect and a second adjustment operation for the second effect.

[0013] As a preferred solution of the method for identifying and controlling image brightness and contrast according to the present invention, wherein: the performing a first segmentation operation on a target image includes:

[0014] Preset a first data set, where the first data set is a data set composed of different numbers of segmentation regions;

[0015] Perform region segmentation on the images of the same type as the target image in sequence according to the number of segmentation regions in the first data set;

[0016] Obtain the optimal number of segmentation regions in the first data set, and perform a first segmentation operation according to the optimal number of segmentation regions.

[0017] As a preferred solution of the method for identifying and controlling image brightness and contrast according to the present invention, wherein: the obtaining of the optimal number of segmentation regions in the first data set includes:

[0018] Obtain the target parameters after performing region segmentation on the images of the same type as the target image in sequence according to the number of segmentation regions in the first data set;

[0019] Calculate the probability when the target parameters corresponding to different numbers of segmentation regions satisfy the first condition;

[0020] Take the number of segmentation regions corresponding to the maximum probability as the optimal number of segmentation regions.

[0021] As a preferred solution of the method for identifying and controlling image brightness and contrast according to the present invention, wherein: the target parameters include at least the following: the maximum and minimum brightness values of different regions and the average brightness value of the target image, as well as the maximum and minimum contrast values of different regions and the average contrast value of the target image.

[0022] As a preferred solution of the method for identifying and controlling image brightness and contrast according to the present invention, wherein: the presetting of the first judgment condition and the judging of the light and dark effect of the target image by combining the target parameters include:

[0023] If the target parameters satisfy the first judgment condition, then judge that the light and dark effect of the target image is the first effect;

[0024] If the target parameters do not satisfy the first judgment condition, then judge that the light and dark effect of the target image is the second effect;

[0025] The first judgment condition is implemented by presetting a screening threshold.

[0026] As a preferred solution of the method for identifying and controlling image brightness and contrast according to the present invention, wherein: the adjusting of the target image according to the first judgment result and in combination with the preset adjusting operation includes:

[0027] If the light and dark effect of the target image is the first effect, then perform a first adjusting operation;

[0028] The first adjustment operation includes performing a first assignment operation and obtaining a first target parameter after the first assignment operation;

[0029] If the first target parameter does not meet the score threshold, adjust the brightness and contrast of the target image according to a preset adjustment step.

[0030] As a preferred solution of the method for identifying and controlling image brightness and contrast according to the present invention, wherein: adjusting the target image according to the first judgment result and combining a preset adjustment operation further includes:

[0031] If the light and dark effect of the target image is a second effect, perform a second adjustment operation;

[0032] The second adjustment operation includes performing a second assignment operation and obtaining a second target parameter after the second assignment operation;

[0033] If the second target parameter does not meet the score threshold, adjust the brightness and contrast of the target image according to a preset adjustment step.

[0034] In a second aspect, the present invention provides an image brightness and contrast recognition and control system, characterized by including:

[0035] A parameter acquisition module, configured to perform a first segmentation operation on a target image and obtain target parameters of different regions after the first segmentation operation;

[0036] A judgment module, configured to preset a first judgment condition and judge the light and dark effect of the target image in combination with the target parameters;

[0037] The light and dark effect is only the effect generated by the image brightness and contrast, and the light and dark effect includes a first effect and a second effect;

[0038] An adjustment module, configured to adjust the target image according to the first judgment result and in combination with a preset adjustment operation;

[0039] The preset adjustment operation is an adjustment operation designed according to the first judgment condition, and the preset adjustment operation includes a first adjustment operation for the first effect and a second adjustment operation for the second effect.

[0040] In a third aspect, the present invention provides a computer device, including a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the steps of the method described above are implemented.

[0041] In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method described above are implemented.

[0042] Compared with the prior art, the beneficial effects of the present invention are as follows: The present invention provides a method and system for identifying and controlling image brightness and contrast. By performing a first segmentation operation on a target image and obtaining target parameters of different regions after the first segmentation operation, a first judgment condition is preset, and the brightness and darkness effect of the target image is judged in combination with the target parameters. According to the first judgment result, the target image is adjusted in combination with a preset adjustment operation. The present invention can not only accurately identify the brightness and contrast of an image, but also perform intelligent adjustment according to the recognition result, thereby solving the problem of insufficient combination operation of intelligent adjustment of image brightness and contrast and equipment in the prior art. In addition, the present invention presets a first data set, performs regional segmentation on the target image, and obtains the optimal number of segmented regions, making the segmentation of the target image more reasonable and further improving the recognition accuracy of image brightness and contrast. At the same time, the present invention also realizes the automatic adjustment of the brightness and contrast of the target image by presetting judgment conditions and adjustment operations, improving the adjustment efficiency and accuracy. Therefore, the present invention has significant technical effects and practical application value. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can obtain other drawings without creative efforts based on these drawings.

[0044] Figure 1 It is a flowchart of a method for identifying and controlling image brightness and contrast provided by an embodiment of the present invention;

[0045] Figure 2 It is a schematic diagram of the output gray histogram of a method for identifying and controlling image brightness and contrast provided by an embodiment of the present invention;

[0046] Figure 3 It is a detailed flowchart of a method for identifying and controlling image brightness and contrast provided by an embodiment of the present invention;

[0047] Figure 4 It is an internal structure diagram of a computer device of a method for identifying and controlling image brightness and contrast provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0048] To make the above objects, features, and advantages of the present invention more obvious and understandable, the following provides a detailed description of the specific embodiments of the present invention with reference to the accompanying drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present invention.

[0049] Embodiment 1

[0050] Refer to Figures 1-4 , which is the first embodiment of the present invention. This embodiment provides a method for identifying and controlling image brightness and contrast, including:

[0051] In the existing related technologies, there are some problems. For example, the intelligent adjustment of image brightness and contrast in combination with the device operation is insufficient, resulting in the inability to achieve precise automatic adjustment in actual applications.

[0052] This application provides a method that can effectively solve the above-mentioned problems. Next, multiple embodiments will be combined to elaborate in detail on how to implement the method for identifying and controlling image brightness and contrast;

[0053] Figure 1 Figure 1 shows a method for identifying and controlling image brightness and contrast, including:

[0054] S101, perform a first segmentation operation on the target image, and obtain the target parameters of different regions after the first segmentation operation;

[0055] In an optional embodiment, the target image can be different types of images, such as medical images, industrial inspection images, or natural landscape photos, etc. In this application, the target image is an image in a scanning electron microscope. The requirements for brightness and contrast in the scanning electron microscope image are higher than those of ordinary images. Therefore, precise adjustment of its brightness and contrast is particularly important.

[0056] In the embodiment of this application, the target parameters include at least the following: the maximum and minimum brightness values of different regions and the average brightness value of the target image, as well as the maximum and minimum contrast values of different regions and the average contrast value of the target image. Those skilled in the art can select other target parameters according to actual needs. However, if the design concept is similar to that of this application, regardless of the selected target parameters, they should all fall within the scope of protection of this application.

[0057] It should be noted that when identifying and controlling the brightness and contrast of an image, if only a general processing is performed on the entire image, it is impossible to accurately identify and control the brightness and contrast. Therefore, a method that can perform more detailed segmentation of the image is required to obtain more accurate brightness and contrast information.

[0058] It should also be noted that in the process of segmentation, the specific number of regions to be divided into is an important parameter that needs to be adjusted according to the actual situation.

[0059] In an alternative embodiment, the segmentation method can be implemented through existing technologies. For example, region segmentation can be performed based on algorithms such as edge detection, threshold segmentation, or clustering segmentation of images. However, these existing technologies all have certain limitations, such as inaccurate segmentation and poor adaptability to specific types of images.

[0060] In the embodiment of the present application, performing a first segmentation operation on the target image, that is, dividing the target image into multiple regions, can more accurately obtain the brightness and contrast parameters of each region, providing a more reliable data basis for subsequent judgment and adjustment.

[0061] In the embodiment of the present application, the performing a first segmentation operation on the target image includes:

[0062] Presetting a first data set, where the first data set is a data set composed of different numbers of segmentation regions;

[0063] Performing region segmentation on images of the same type as the target image in sequence according to the numbers of segmentation regions in the first data set;

[0064] Obtaining the optimal number of segmentation regions in the first data set, and performing the first segmentation operation according to the optimal number of segmentation regions.

[0065] In an alternative embodiment, the sequential region segmentation can be performed in ascending or descending order of the numbers, or in a preset segmentation order. For example, a preset number arrangement order is designed, and the segmentation is performed in the order of 4, 9, 16, 25, 36, 49. The specific segmentation order is not limited in the present application.

[0066] In an alternative embodiment, the number of segmentation regions can be different numbers of data generated randomly, or different numbers of data set in advance, such as 4, 9, 16, 25, etc. The specific data setting is not limited in the present application.

[0067] In the embodiment of the present application, the obtaining the optimal number of segmentation regions in the first data set includes:

[0068] Obtaining the target parameters after performing region segmentation on images of the same type as the target image in sequence according to the numbers of segmentation regions in the first data set;

[0069] Calculating the probabilities when the target parameters corresponding to different numbers of segmentation regions meet the first condition;

[0070] Taking the number of segmentation regions corresponding to the maximum probability as the optimal number of segmentation regions.

[0071] It should be noted that the first condition can be a condition rule obtained by preferentially designing through existing data. For example, the average brightness and the average contrast conform to a preset threshold range, or the fluctuation range of the maximum and minimum brightness and the maximum and minimum contrast in different regions is within a preset range, etc. It can also be a screening condition obtained according to experimental data. For example, in the experiment, by segmenting a large number of similar images and obtaining parameters, the probability that the target parameter satisfies the first condition under different numbers of segmented regions is statistically calculated, so as to determine the optimal number of segmented regions. This step ensures the rationality of segmentation and improves the accuracy of subsequent brightness and contrast recognition.

[0072] In the embodiment of the present application, by analyzing the gray values of pictures with different brightness and contrast effects, the rule of the brightness and contrast values of the pictures with better effects is obtained to obtain the first condition.

[0073] It should be noted that using gray values to judge image brightness and contrast is regarded as the optimal method because it is direct, efficient, simple, and has strong versatility. Gray values directly reflect light information, facilitating the calculation of overall brightness and contrast, with a small amount of calculation, and are applicable to real-time processing and analysis of various images.

[0074] Specifically, the steps for obtaining the first condition are to read the image and output the gray histogram; set the region exceeding 0.4 times the peak value as the peak region, mark the peak region in yellow, and output the peak interval, such as Figure 2 ; calculate the image brightness and contrast, and output their values, where the first condition is to set the region exceeding 0.4 times the peak value as the peak region.

[0075] In the embodiment of the present application, based on multiple experimental evidences, setting the region exceeding 0.4 times the peak value as the peak region can better distinguish the images with brightness and contrast meeting the required effects.

[0076] It should be noted that calculating the probability that the target parameter satisfies the first condition corresponding to different numbers of segmented regions is to solve the ratio of the number of target parameters satisfying the first condition in each region after segmentation according to different segmentation numbers to the number of segments of the entire image segmentation, so as to obtain the probability distribution of the target parameter satisfying the first condition under different numbers of segmented regions. By comparing the probability distributions, the number of segmented regions corresponding to the maximum probability is selected as the optimal number of segmented regions. This step not only improves the accuracy of image segmentation, but also provides a reliable data basis for subsequent brightness and contrast recognition.

[0077] In an optional embodiment, brightness (mean): Brightness usually refers to the average brightness level of an image, which can be obtained by calculating the average value of all pixel values. For a grayscale image, its formula is:

[0078]

[0079] Wherein, W and H are the width and height of the image respectively, I(i, j) is the pixel value at the coordinate (i, j), and the summation symbol represents the accumulation of all pixel values in the image.

[0080] In an optional embodiment, the contrast (standard deviation): The contrast refers to the degree of difference between the bright and dark regions in the image, and is usually measured by calculating the standard deviation of the pixel values. The formula is:

[0081]

[0082] Wherein, brightness is the image brightness (mean value) calculated previously, and are the width and height of the image respectively, is the pixel value at the coordinate, and this formula calculates the square root of the average of the squares of the differences between the pixel value and the brightness mean value.

[0083] This application segments the image into 4, 9, 16, 25, 36, and 49 regions in sequence, and conducts grayscale value analysis on the pictures with different brightness and contrast effects to obtain the maximum, minimum, and average differences between the brightness and contrast of the images with better effects and those with worse effects. Finally, it is found that the effect of segmenting into 36 regions is the best. If other relevant technical personnel choose other numbers of segmentation, the best segmentation number obtained may be different, but if the design idea is similar to this application, no matter which segmentation number is selected, it should be within the protection scope of this application.

[0084] It should be noted that the first segmentation operation is not carried out randomly, but is based on a preset first data set to determine the optimal number of segmentation regions. The first data set contains a data set composed of different numbers of segmentation regions. Through experiments on images of the same type as the target image, the target parameters corresponding to different numbers of segmentation regions are obtained, and the probability when the first condition is met is calculated. Finally, the number of segmentation regions corresponding to the maximum probability is selected as the optimal number of segmentation regions. This process ensures the rationality and accuracy of the segmentation operation and improves the accuracy of subsequent brightness and contrast recognition.

[0085] S102, preset the first judgment condition, and combine the target parameters to judge the light and dark effect of the target image;

[0086] In the embodiment of this application, the light and dark effect is only the effect generated by the image brightness and contrast, and the light and dark effect includes a first effect and a second effect.

[0087] In an alternative embodiment, the first judgment condition may be a series of thresholds and rules preset according to historical data and experimental results. For example, reasonable ranges for the average brightness and average contrast may be set, as well as the fluctuation ranges for the maximum and minimum brightness and contrast values in different regions. When the target parameters fall within the preset threshold ranges, it is considered that the light and dark effect of the target image is good, that is, it conforms to the first effect; while when the target parameters exceed the preset threshold ranges, it is considered that the light and dark effect of the target image is poor and needs further adjustment, that is, it belongs to the second effect.

[0088] In an alternative embodiment, the first judgment condition may also be a series of rules and logics preset according to historical image adjustment experience and expert knowledge. For example, a judgment system based on fuzzy logic may be designed, with the target parameters as the input, and the judgment result of the light and dark effect of the target image is obtained through fuzzy inference.

[0089] In an alternative embodiment, the design of the first judgment condition needs to comprehensively consider various factors, including the type of the target image, the application scenario, the user requirements, etc. By reasonably presetting the judgment condition, an accurate judgment of the light and dark effect of the target image can be achieved, providing a reliable basis for subsequent intelligent adjustment.

[0090] In the embodiment of the present application, after sample testing, if the maximum and minimum values and the average values of the brightness and contrast in the entire image are directly extracted to judge the image effect, inaccurate judgment will occur. The reason for this phenomenon is that the light and dark distribution in most images is uneven, resulting in too large or too small local brightness and contrast values, which directly affect the size of the maximum and minimum values and the average value.

[0091] Exemplarily, during the testing of the present application, the image is equally divided into 4, 9, 16, 25, 36, and 49 regions for result comparison. It is experimentally found that when the image is equally divided into 4, 9, 26, and 25 parts, the overall maximum and minimum values are still affected by the local maximum and minimum values, while the 36 and 49 equal divisions are not affected. In order to improve the calculation efficiency of the program, the image is finally selected to be equally divided into 36 parts.

[0092] Among them, after the 36 equal divisions, the maximum and minimum values and the average values of the brightness and contrast in different regions of the image are extracted, and the maximum and minimum values and the average value are extracted again from the maximum and minimum values and the average value, and the obtained values are the maximum and minimum values and the average value of the entire image. By performing the following calculations on the maximum and minimum values and the average values of the image brightness and contrast, the light and dark difference of the image can be obtained. The light and dark difference is the values of diffbri1, diffbri2, diffcon1, and diffcon2, and if they are all less than 10, the light and dark difference is less than 10.

[0093] condiff = conmax - conmin

[0094] bridiff = brimax - brimin

[0095] diffbri1 = |brimax - brimean|

[0096] diffbri2 = |brimin - brimean|

[0097] diffcon1 = |conmax - conmean|

[0098] diffcon2 = |conmin - conmean|

[0099] In the embodiments of the present application, the differences between the images with better effects and other image data are found, and the first judgment condition for two different brightness difference images is obtained. The first judgment condition of the present application is the relationship between the difference between the maximum value and the average value and 10. An image with a difference between the maximum value and the average value less than 10 is an image with a small brightness difference, that is, the first effect, and an image with a difference between the maximum value and the average value greater than 10 is an image with a large brightness difference, that is, the second effect.

[0100] In the embodiments of the present application, the preset first judgment condition is combined with the target parameter to judge the brightness effect of the target image, including:

[0101] If the target parameter meets the first judgment condition, it is judged that the brightness effect of the target image is the first effect;

[0102] If the target parameter does not meet the first judgment condition, it is judged that the brightness effect of the target image is the second effect;

[0103] The first judgment condition is implemented by a preset screening threshold.

[0104] It should be noted that the preset screening threshold of the present application is that the difference between the maximum value and the average value is 10. Other relevant technical personnel can flexibly adjust the preset screening threshold according to the actual application scenarios and requirements to adapt to different types of images and brightness effect judgment needs. This step ensures the accuracy and flexibility of the judgment and provides a reliable basis for subsequent brightness and contrast adjustment.

[0105] It should be noted that presetting the first judgment condition and combining the target parameter to judge the brightness effect of the target image can automatically and accurately judge the brightness effect of the target image, thus avoiding the subjectivity and inaccuracy of manual judgment. At the same time, judging based on the preset first judgment condition can greatly improve the judgment efficiency and reduce the processing time. In addition, this step also provides a clear guiding direction for subsequent brightness and contrast adjustment, ensuring the pertinence and effectiveness of the adjustment. In specific embodiments, the present application adopts a judgment method based on the difference between the maximum value and the average value, and distinguishes the quality of the brightness effect through a preset screening threshold (that is, the difference between the maximum value and the average value is 10). This method is simple, intuitive, and easy to implement.

[0106] S103. Adjust the target image according to the first judgment result in combination with a preset adjustment operation.

[0107] The preset adjustment operation is an adjustment operation designed according to the first judgment condition, and the preset adjustment operation includes a first adjustment operation for the first effect and a second adjustment operation for the second effect.

[0108] In an alternative embodiment, the preset adjustment operation is a preset operation for the judgment result of the first judgment condition, and can be a series of operations based on an image processing algorithm. For example, parameters such as the brightness, contrast, and saturation of the image are adjusted, or a specific image enhancement technique is applied. These preset operations are intended to improve the visual effect of the image and make it more suitable for a specific application scenario or user requirements.

[0109] In an alternative embodiment, for the first effect, that is, when the light and dark effect of the target image is already good, the first adjustment operation may be relatively minor, mainly for some fine-tuning to maintain or further enhance the visual effect of the image. For example, the brightness or contrast can be slightly adjusted to make the image clearer and more vivid.

[0110] In an alternative embodiment, for the second effect, that is, when the light and dark effect of the target image is not good, the second adjustment operation needs to be more significant to significantly improve the light and dark effect of the image. This may include adjusting the brightness and contrast parameters by a large margin, or applying a more complex image enhancement algorithm. The aim is to make the brightness distribution of the image more uniform and the contrast more distinct, thereby enhancing the overall visual effect of the image.

[0111] In the embodiment of the present application, the design of the preset adjustment operation needs to fully consider the characteristics of the target image and the application scenario. Through reasonable preset adjustment operations, effective adjustment of the target image can be achieved, making its light and dark effect more in line with the user's needs or the requirements of the application scenario.

[0112] It should be noted that the preset adjustment operation is not fixed and can be flexibly adjusted according to the actual application scenario and user requirements. For example, under different lighting conditions, different preset adjustment operations may be required to adapt to the brightness change of the image. In addition, for different types of images (such as medical images, industrial inspection images, etc.), different preset adjustment operations need to be designed due to their different characteristics and requirements.

[0113] In the embodiment of the present application, the adjustment of the target image according to the first judgment result in combination with the preset adjustment operation includes:

[0114] If the light and dark effect of the target image is the first effect, perform the first adjustment operation.

[0115] The first adjustment operation includes performing a first assignment operation and obtaining a first target parameter after the first assignment operation;

[0116] If the first target parameter does not meet the score threshold, the brightness and contrast of the target image are adjusted according to a preset adjustment step.

[0117] In the embodiment of the present application, the adjusting of the target image according to the first judgment result and in combination with a preset adjustment operation further includes:

[0118] If the light and dark effect of the target image is a second effect, a second adjustment operation is performed;

[0119] The second adjustment operation includes performing a second assignment operation and obtaining a second target parameter after the second assignment operation;

[0120] If the second target parameter does not meet the score threshold, the brightness and contrast of the target image are adjusted according to a preset adjustment step.

[0121] It should be noted that through large-sample tests, it can be obtained that the minimum brightness value that meets the requirements for images with a light and dark difference less than 10 is between 90 and 100, the minimum contrast value is between 2 and 20, and the larger the value, the better the effect. For images with a light and dark difference greater than 10, the minimum brightness value that meets the requirements is between 50 and 70, the maximum contrast value is between 50 and 75, and the larger the value, the better the effect.

[0122] In the embodiment of the present application, scores are assigned to the values of brightness and contrast. The score assigned to brightness is score1, and the score assigned to contrast is score2. The first assignment operation is an operation for the first effect, that is, the score calculation expression for images with a small light and dark difference is:

[0123] score1 = (brimin - 90) * 10 + (-1) * 100 brimin-100

[0124] score2 = (conmin - 2) * 5 + (-1) * 100 conmin-20

[0125] score = score1 * 0.5 + score2 * 0.5

[0126] Among them, score1 and score2 are the brightness and contrast scores respectively, brimin is the average value of the minimum brightness, conmin is the average value of the minimum contrast, and score is the total score.

[0127] In the embodiment of the present application, the second assignment operation is an operation for the second effect, that is, the score calculation expression for images with a large light and dark difference is:

[0128] score1 = (brimin - 50) * 5 + (-1) * 100 brimin-70

[0129] score2 = (conmax - 50) * 4 + (-1) * 100 conmax-75

[0130] score = score1 * 0.5 + score2 * 0.5

[0131] Among them, score1 and score2 are the brightness and contrast scores respectively, brimin is the average value of the minimum brightness, conmax is the average value of the maximum contrast, and score is the total score.

[0132] In an alternative embodiment, the score threshold is a reasonable range preset according to historical data and experimental results. For example, it can be set such that the total score reaches a certain specific value. When the first target parameter or the second target parameter meets the score threshold, it is considered that the adjusted image brightness and darkness effect has reached the expectation and no further adjustment is required; while when the target parameter does not meet the score threshold, the brightness and contrast of the image need to be adjusted continuously according to the preset adjustment steps until the score threshold is met. This step ensures the accuracy and effectiveness of the adjustment, making the final image brightness and darkness effect more in line with the user's needs or the requirements of the application scenario.

[0133] It should be noted that in the sample test, the effects presented by the image brightness and contrast are scored respectively. Experiments have found that too high a scoring threshold will cause the program to oscillate repeatedly around the optimal value when searching for the optimal value, resulting in too long an experimental time, and too low a scoring threshold will cause the finally presented image to have unclear or dark image details due to too low brightness or contrast. After repeated comparison and debugging, it is most reasonable to set the scoring threshold to 40.

[0134] In an alternative embodiment, the score threshold is set such that the average score of score1 and score2 is greater than 40. If score1 or score2 is less than 40, the device parameters for adjusting the brightness or contrast are adjusted until the average score of score1 and score2 is greater than 40.

[0135] In an alternative embodiment, the preset adjustment steps can automatically adjust the parameters of the image processing device, such as brightness gain, contrast gain, etc., according to the current brightness and contrast values of the target image and the preset adjustment rules. This step aims to gradually approach the preset ideal values of the image brightness and contrast through a step-by-step approximation method, so as to achieve the purpose of improving the image brightness and darkness effect.

[0136] In the embodiment of the present application, the initial values of brightness and contrast are both set to 35. The image effects at the initial values are compared with those without setting the initial values, and the brightness and contrast of the image are identified and scored.

[0137] When the score does not reach the score threshold, the brightness and contrast parameters of the device are adjusted, and an initial step size is set. The adjustment is divided into coarse adjustment and fine adjustment. During coarse adjustment, if the identified brightness and contrast deviate too much from the normal range, the brightness is adjusted using 1.8 times the current step size, and the contrast is adjusted using 1.1 times the current step size. If the detected adjustment direction is incorrect, the reverse adjustment is performed using 1 / 2 of the current step size. If it is close to the normal parameter range, the current step size is used for adjustment.

[0138] After the coarse adjustment is completed, fine adjustment is performed. It is judged whether the difference in brightness and darkness of the image is obvious, and two judgment conditions are used to adjust the images with large and small differences in brightness and darkness respectively. The brightness adjustment step size is 0.2, and the contrast step size is 0.5. Minor adjustments can be made according to the different precisions of different devices.

[0139] When the obtained score reaches the score threshold and the values of brightness and contrast are within the appropriate range, the brightness and contrast data of the device can be locked to output the final image.

[0140] In the embodiment of the present application, if the step sizes of the coarse adjustment and fine adjustment of brightness and contrast are changed, different precision devices can be applied.

[0141] In summary, the present invention proposes an image brightness and contrast recognition and control method. By performing a first segmentation operation on a target image and obtaining target parameters of different regions after the first segmentation operation; presetting a first judgment condition, and combining the target parameters to judge the brightness and darkness effects of the target image; according to the first judgment result, combining a preset adjustment operation to adjust the target image. The present invention can not only accurately identify the brightness and contrast of the image, but also perform intelligent adjustment according to the recognition result, thus solving the problem of insufficient combination operation of intelligent adjustment of image brightness and contrast and equipment in the prior art. In addition, the present invention presets a first data set, performs regional segmentation on the target image, and obtains the optimal number of segmented regions, making the segmentation of the target image more reasonable and further improving the recognition accuracy of image brightness and contrast. At the same time, the present invention also realizes the automatic adjustment of the brightness and contrast of the target image by presetting judgment conditions and adjustment operations, improving the adjustment efficiency and accuracy. Therefore, the present invention has significant technical effects and practical application values.

[0142] Embodiment 2

[0143] In a preferred embodiment, when testing, the image is equally divided into 4, 9, 16, 25, 36, or 49 regions for result comparison. Experiments have found that when the image is divided into 4, 9, 26, or 25 equal parts, the overall maximum and minimum values are still affected by the local maximum and minimum values. However, when divided into 36 or 49 equal parts, there is no such influence. To improve the computational efficiency of the program, the image is finally chosen to be divided into 36 equal parts.

[0144] Among them, after dividing the image into 36 equal parts, the maximum, minimum, and average values of brightness and contrast in different regions of the image are extracted. Then, the maximum and minimum values are further extracted from these maximum, minimum, and average values, and the obtained values are the maximum and minimum values of the entire image. By performing the following calculations on the maximum, minimum, and average values of the image brightness and contrast, the brightness difference of the image can be obtained. The brightness differences are the values of diffbri1, diffbri2, diffcon1, and diffcon2. If all of them are less than 10, the brightness difference is less than 10.

[0145] The following is combined with Figure 3 Describe the operation. First, divide the image into 36 regions, and identify the maximum, minimum, and average values of brightness and contrast in each region. Then, obtain the maximum value again from the obtained maximum and minimum values of brightness and contrast, and obtain the average value again according to the average values of each region. At this time, the maximum and minimum values are the maximum and minimum values of the entire image, and the average value is the average value of the entire image. Then, calculate the brightness difference based on the final maximum and minimum values and average value. If it is less than 10, use judgment condition 1; if it is greater than 10, use judgment condition 2. Finally, determine whether the average value of the scores of brightness and contrast is greater than 40. If it is greater than or equal to 40, output the result; if it is less than 40, return for re - debugging.

[0146] All the above numerical values are empirical values obtained through experiments to ensure that the quality of the adjusted image reaches the optimal level. In the experiment, by testing and analyzing a large number of image samples, these numerical ranges are obtained. They can reflect the reasonable adjustment range of image brightness and contrast, thus ensuring that the adjusted image has appropriate brightness and contrast to meet visual requirements.

[0147] In the specific implementation process, these numerical ranges can be preset in the image - processing device or software as a reference basis for automatically adjusting brightness and contrast. When the device receives an image to be processed, first, it preliminarily evaluates the brightness and contrast of the image according to the preset numerical ranges, then selects the corresponding adjustment strategy and operation parameters according to the evaluation results, and finally automatically adjusts the image so that its brightness and contrast reach the preset numerical ranges, thereby obtaining a high - quality image output.

[0148] In addition, the method for identifying and controlling image brightness and contrast of the present application can also be combined with other image processing technologies, such as image enhancement, image sharpening, image denoising, etc., to further improve the processing effect and visual quality of the image. These technologies can be selected and combined according to the actual application scenarios and requirements to achieve more complex and diverse image processing functions.

[0149] In summary, the method for identifying and controlling image brightness and contrast of the present application has significant technical advantages and practical application values. It can not only accurately identify the brightness and contrast of the image, but also perform intelligent adjustment according to the recognition results, thereby improving the efficiency and accuracy of image processing. At the same time, the method also has flexibility and scalability, and can be combined with other image processing technologies to meet different application scenarios and requirements. Therefore, the method of the present application has a wide range of application prospects in the field of image processing.

[0150] Embodiment 3

[0151] In this embodiment, an image brightness and contrast recognition and control system is further provided, which is characterized by including:

[0152] A parameter acquisition module, configured to perform a first segmentation operation on a target image and acquire target parameters of different regions after the first segmentation operation;

[0153] A judgment module, configured to preset a first judgment condition and judge the brightness and darkness effect of the target image in combination with the target parameters;

[0154] The brightness and darkness effect is only the effect generated by image brightness and contrast, and the brightness and darkness effect includes a first effect and a second effect;

[0155] An adjustment module, configured to adjust the target image in combination with a preset adjustment operation according to the first judgment result;

[0156] The preset adjustment operation is an adjustment operation designed according to the first judgment condition, and the preset adjustment operation includes a first adjustment operation for the first effect and a second adjustment operation for the second effect.

[0157] The above-mentioned each unit module can be embedded in or independent of a processor in a computer device in a hardware form, or can be stored in a memory in a computer device in a software form, so that the processor can call and execute the operations corresponding to the above-mentioned each module.

[0158] This embodiment also provides a computer device, which can be a terminal, and its internal structure diagram can be as Figure 4As shown in the figure. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner, and the wireless manner can be achieved through WIFI, carrier network, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it realizes an image brightness and contrast recognition and control method. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball, or touchpad set on the computer device housing, or an external keyboard, touchpad, or mouse, etc.

[0159] This embodiment also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by the processor, the following steps are realized:

[0160] Perform a first segmentation operation on the target image and obtain the target parameters of different regions after the first segmentation operation;

[0161] Preset a first judgment condition, and combine the target parameters to judge the light and dark effect of the target image;

[0162] The light and dark effect is only the effect generated by the image brightness and contrast, and the light and dark effect includes a first effect and a second effect;

[0163] According to the first judgment result, combine the preset adjustment operation to adjust the target image;

[0164] The preset adjustment operation is an adjustment operation designed according to the first judgment condition, and the preset adjustment operation includes a first adjustment operation for the first effect and a second adjustment operation for the second effect.

[0165] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered within the scope of the claims of the present invention.

[0166] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code. The solutions in the embodiments of the present application can be implemented in various computer languages.

[0167] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or combinations of blocks.

[0168] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or combinations of blocks.

[0169] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or combinations of blocks.

[0170] Although the preferred embodiments of the present application have been described, those skilled in the art can make additional changes and modifications to these embodiments once they know the basic creative concepts. Therefore, the appended claims are intended to be construed to include the preferred embodiments as well as all changes and modifications that fall within the scope of the present application.

[0171] Obviously, those skilled in the art can make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalent technologies, this application is also intended to include these modifications and variations.

Claims

1. A method for identifying and controlling image brightness and contrast, characterized in that: include: Performing a first segmentation operation on the target image, and obtaining target parameters of different regions after the first segmentation operation; Preset a first judgment condition, and judge the light and dark effect of the target image in combination with the target parameter; The light and dark effect is only the effect produced by the brightness and contrast of the image, and the light and dark effect includes a first effect and a second effect; According to the first judgment result, adjusting the target image in combination with a preset adjustment operation; The preset adjustment operation is an adjustment operation designed according to the first judgment condition, and the preset adjustment operation includes a first adjustment operation for the first effect and a second adjustment operation for the second effect.

2. The image brightness and contrast recognition and control method according to claim 1, characterized in that: The first segmentation operation on the target image comprises: Preset a first data set, wherein the first data set is a data set consisting of different numbers of segmented regions; Performing region segmentation on images of the same type as the target image in sequence according to the number of segmented regions in the first data set; An optimal number of segmentation regions in the first data set is obtained, and a first segmentation operation is performed according to the optimal number of segmentation regions.

3. The image brightness and contrast recognition and control method according to claim 2, characterized in that: The obtaining of the optimal number of segmented regions in the first data set comprises: Obtain target parameters after sequentially segmenting an image of the same type as the target image according to the number of segmented regions in the first data set; Calculate the probability that the target parameters corresponding to different numbers of segmented regions meet the first condition; The number of segmentation regions corresponding to the maximum probability is taken as the optimal number of segmentation regions.

4. The image brightness and contrast recognition and control method according to claim 1, 2 or 3, characterized in that: The target parameters include at least the following: the maximum brightness values ​​of different regions and the average brightness value of the target image, and the maximum contrast values ​​of different regions and the average contrast value of the target image.

5. The image brightness and contrast recognition and control method according to claim 1, characterized in that: The preset first judgment condition, combined with the target parameter, judges the light and dark effect of the target image, including: If the target parameter satisfies the first judgment condition, determining that the shading effect of the target image is the first effect; If the target parameter does not satisfy the first judgment condition, determining that the shading effect of the target image is the second effect; The first judgment condition is achieved by presetting a screening threshold.

6. The image brightness and contrast recognition and control method according to claim 1 or 5, characterized in that: The adjusting the target image according to the first judgment result in combination with a preset adjustment operation includes: If the light and dark effect of the target image is the first effect, performing a first adjustment operation; The first adjustment operation includes performing a first value assignment operation and obtaining a first target parameter after the first value assignment operation; If the first target parameter does not meet the score threshold, the brightness and contrast of the target image are adjusted according to the preset adjustment steps.

7. The method for identifying and controlling image brightness and contrast according to claim 6, characterized in that: The adjusting the target image according to the first judgment result in combination with a preset adjustment operation further includes: If the light and dark effect of the target image is the second effect, performing a second adjustment operation; The second adjustment operation includes performing a second assignment operation and obtaining a second target parameter after the second assignment operation; If the second target parameter does not meet the score threshold, the brightness and contrast of the target image are adjusted according to the preset adjustment steps.

8. A system applied to the method for identifying and controlling image brightness and contrast according to any one of claims 1 to 7, characterized in that: include: A parameter acquisition module, used to perform a first segmentation operation on the target image and obtain target parameters of different regions after the first segmentation operation; A judgment module, used to preset a first judgment condition and judge the light and dark effect of the target image in combination with the target parameter; The light and dark effect is only the effect produced by the brightness and contrast of the image, and the light and dark effect includes a first effect and a second effect; An adjustment module, configured to adjust the target image according to the first judgment result and in combination with a preset adjustment operation; The preset adjustment operation is an adjustment operation designed according to the first judgment condition, and the preset adjustment operation includes a first adjustment operation for the first effect and a second adjustment operation for the second effect.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the image brightness and contrast recognition and control method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the image brightness and contrast recognition and control method described in any one of claims 1 to 7 are implemented.