Image optimization method, device, equipment and storage medium

The image is collected and classified by the comparison machine, the optimal value of the Gamma curve and the average grayscale histogram of each category are determined, and the parameters of the image acquisition equipment are automatically adjusted, which solves the simplicity and instability problems of Gamma curve adjustment in the existing technology. Achieved wider scene adaptation and improved adjustment efficiency.

CN114359397BActive Publication Date: 2025-01-24DALIAN THUNDER SOFTWARE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111154597.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-29
Publication Date
2025-01-24
Estimated Expiration
2041-09-29

AI Technical Summary

Technical Problem

The existing Gamma curve adjustment method is too simple, and it is difficult to obtain the optimal Gamma curve. There are cognitive differences and non-convergence in subjective adjustments, so it is impossible to adapt to multiple shooting scenes.

Method used

Collect images of different scenes through a comparison machine, use grayscale histograms for classification, determine the optimal value of the Gamma curve and average grayscale histogram of each category, and automatically adjust the Gamma curve and grayscale histogram of the image acquisition device.

Benefits of technology

It avoids the poor controllability of manual interactive adjustment, avoids the situation where Gamma curve adjustment does not converge, and can adapt to more shooting scenes under limited Gamma curve conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114359397B_ABST
    Figure CN114359397B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses an image optimization method, device, equipment and storage medium. The method includes: using a contrast machine to collect first scene images of different scenes, and classifying the first scene images according to a first grayscale histogram; determining the optimal value of the Gamma curve of different categories; using an image acquisition device to collect a second scene image that matches the first scene image; adjusting the second scene image according to the optimal value of the Gamma curve of the corresponding category; adjusting the second grayscale histogram of the adjusted second scene image according to the average grayscale histogram of the corresponding category; when the differences between the adjusted second grayscale histograms before and after the adjustment are all less than the preset difference, it is determined that the adjustment of the image acquisition device is completed. The embodiment of the present application can avoid the poor controllability of the manual interactive Gamma curve adjustment method, and can also avoid the situation where the Gamma curve does not converge, and can also achieve limited Gamma curves to adapt to more shooting scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of image processing technology, and in particular to an image optimization method, device, equipment and storage medium. Background Art

[0002] With the development of visual technology in the smart Internet of Things, people have higher and higher requirements for the image quality of pictures and videos taken by cameras. Usually, the module, sensor, restoration and installation accuracy of the camera will affect the image quality. Among them, the module and sensor can be corrected through Camera Tuning, which is the process of tuning the camera's imaging quality through chip platform tools. The adjustment of the gamma curve is one of the main tasks of Camera Tuning. Whether the gamma curve is appropriate directly affects the size of the image quality problem.

[0003] A comparator is a camera that takes pictures and videos with image quality that meets the standard. Usually, the image taken by the comparator is used as a reference, and the image taken by the camera is compared with the reference to evaluate whether the gamma curve is appropriate. If the current gamma curve is not appropriate, the control points of the gamma curve can be subjectively adjusted for the camera image, and the current gamma curve can be adjusted to the optimal gamma curve so that the quality of the camera image can meet the standard.

[0004] However, the current Gamma curve adjustment method has the following problems:

[0005] (1) This adjustment method is too simple. It is difficult to obtain the optimal Gamma curve by adjusting limited control points.

[0006] (2) There are cognitive differences in subjective adjustment of the Gamma curve, and the adjustment results are unstable, resulting in the Gamma curve not converging, which greatly reduces the adjustment efficiency;

[0007] (3) Due to lighting and color temperature issues, it is inappropriate to use a gamma curve for each scene, and the limited gamma curves cannot adapt to more shooting scenes. Summary of the invention

[0008] The embodiments of the present application provide an image optimization method, device, equipment and storage medium, which can not only avoid the poor controllability of the manual interactive Gamma curve adjustment method, but also avoid the non-convergence during the Gamma curve adjustment process, and can also adapt to more shooting scenes under limited Gamma curve conditions. The technical solution is as follows:

[0009] On the one hand, an embodiment of the present application provides an image optimization method, the method comprising:

[0010] Using a comparison machine to collect a plurality of first scene images of different scenes, and classifying the plurality of first scene images according to first grayscale histograms of the plurality of first scene images to obtain first scene images of different categories;

[0011] In the comparison machine, respectively determining the optimal value of the gamma curve and the average grayscale histogram of the first scene images of different categories;

[0012] Using an image acquisition device to respectively acquire a plurality of second scene images matching the plurality of first scene images, and obtaining from the comparison machine the optimal value of the gamma curve of the corresponding category and the average grayscale histogram of the corresponding category;

[0013] In the image acquisition device, the plurality of second scene images are adjusted respectively according to the optimal values ​​of the gamma curves of the corresponding categories to obtain a plurality of adjusted second scene images;

[0014] In the image acquisition device, adjusting the second grayscale histograms of the plurality of adjusted second scene images respectively according to the average grayscale histograms of the corresponding categories to obtain a plurality of adjusted second grayscale histograms;

[0015] When the adjustment differences between the multiple adjusted second grayscale histograms and the second grayscale histograms before adjustment are less than a preset difference, it is determined that the adjustment of the image acquisition device is completed, so that the adjusted image acquisition device adopts the optimal value of the Gamma curve to optimize the acquired image accordingly.

[0016] On the other hand, an embodiment of the present application provides an image optimization device, the device comprising:

[0017] A first scene image classification module, used to collect a plurality of first scene images of different scenes using a comparison machine, and classify the plurality of first scene images according to first grayscale histograms of the plurality of first scene images to obtain first scene images of different categories;

[0018] A parameter determination module, used for determining the optimal value of the gamma curve and the average grayscale histogram of the first scene images of different categories in the comparison machine;

[0019] A parameter acquisition module, used to respectively acquire a plurality of second scene images matching the plurality of first scene images using an image acquisition device, and to acquire an optimal value of a gamma curve of a corresponding category and an average grayscale histogram of the corresponding category from the comparison machine;

[0020] A second scene image adjustment module, configured to adjust the plurality of second scene images in the image acquisition device according to the optimal values ​​of the gamma curves of the corresponding categories, to obtain a plurality of adjusted second scene images;

[0021] A second grayscale histogram adjustment module is used to adjust the second grayscale histograms of the plurality of adjusted second scene images in the image acquisition device according to the average grayscale histograms of the corresponding categories, so as to obtain a plurality of adjusted second grayscale histograms;

[0022] The verification module is used to determine that the adjustment of the image acquisition device is completed when the adjustment differences between the multiple adjusted second grayscale histograms and the second grayscale histograms before adjustment are less than a preset difference, so that the adjusted image acquisition device adopts the optimal value of the Gamma curve to optimize the acquired image accordingly.

[0023] On the other hand, an embodiment of the present application provides a computer device, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the method described in the above aspects.

[0024] On the other hand, an embodiment of the present application provides a computer-readable storage medium, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the method described in the above aspects.

[0025] On the other hand, an embodiment of the present application provides a computer program product, which, when executed, is used to execute the method described in the above aspects.

[0026] In the technical solution provided in the embodiment of the present application, for images of different scenes captured by the comparator, the images of different scenes are classified by taking the grayscale histogram of the image as the classification basis to obtain images of different categories, and then the gamma curves that are most suitable for the various categories of images are determined respectively. This can avoid the situation where it is inappropriate to use one gamma curve for each scene due to problems of lighting and color temperature, and can also adapt to more shooting scenes under limited gamma curve conditions.

[0027] In addition, by using an image acquisition device to acquire an image that matches the image in the comparator, the Gamma curve and average grayscale histogram of the corresponding category can be obtained from the comparator, and then the Gamma curve of the corresponding category is used to automatically adjust the image of the image acquisition device, and then the average grayscale histogram of the corresponding category is used to automatically adjust the grayscale histogram of the image of the image acquisition device. When the difference between the grayscale histogram before and after the adjustment is less than the preset difference, it can be verified that the Gamma curve is the most suitable Gamma curve for the current image acquisition device image, so that the adjusted image acquisition device can use the Gamma curve to optimize the acquired image accordingly, thereby avoiding the poor controllability of the manual interactive Gamma curve adjustment method and avoiding the non-convergence during the Gamma curve adjustment process. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1A to Figure 1B They are the non-ideal Gamma curve and the relatively ideal Gamma curve;

[0029] Figure 2 It is a Gamma adjustment curve diagram in the prior art;

[0030] Figure 3 is a flowchart of the steps of an image optimization method provided by an embodiment of the present application;

[0031] Figure 4 This is a flowchart of the operation of the chip platform for the image comparison machine in the embodiment of the present application;

[0032] Figure 5 This is a flowchart of the operation of the chip platform for the image acquisition device image in the embodiment of the present application;

[0033] Figure 6 It is a structural block diagram of an image optimization device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0034] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0035] With the rapid development of visual technology in the IOT (Internet of Things) industry, surround monitoring and visual equipment relying on wide-field-of-view cameras can achieve the goal of high information volume and low hardware investment. Nowadays, the demand for cameras in the IOT industry is in the hundreds of millions.

[0036] Camera product quality issues greatly restrict its delivery cycle, and the factors affecting Camera product quality include modules, sensors, restoration and installation accuracy. Among them, modules and sensors can be corrected through the Camera Tuning process. Specifically, Camera Tuning is due to the fact that the Camera itself has different performances in different environments. Taking the Camera module as an example, the Camera module obtained from the supplier is a simple module. The Camera module is installed on different platforms. Due to the inconsistency of the module itself, the difference in the computing platform, etc., there may be many problems with its initial imaging, such as distortion, color aberration, blur, spots, shadows, etc., so it is necessary to adjust the parameters of each module of the Camera so that it can obtain better imaging effects in the current environment.

[0037] Gamma curve adjustment is one of the main tasks of Camera Tuning. Whether the Gamma curve is appropriate directly affects the size of the image quality problem. Figure 1A to Figure 1B , respectively show the non-ideal Gamma curve and the more ideal Gamma curve, where Figure 1A It is a non-ideal Gamma curve. Figure 1B is the ideal Gamma curve. The ideal Gamma curve can make the image have a wider dynamic range. The wider the dynamic range of an image, the higher its contrast and the better its quality. Therefore, for the same image, Figure 1B The Gamma curve is appropriate.

[0038] During the Camera Tuning process, the Tuning software generally provides one or more curves that satisfy the preset Gamma value, such as Gamma = 2.2. Figure 2 , shows a Gamma adjustment curve diagram in the prior art, taking the image taken by the comparison machine as the reference target, by manually adjusting the control points, based on the reference target, these control points are continuously adjusted to obtain the subjective optimal Gamma curve.

[0039] However, this adjustment method is too simple. It is difficult to obtain the optimal Gamma curve by adjusting limited control points. There are cognitive differences in subjective adjustment of the Gamma curve, and the adjustment results are unstable, resulting in the Gamma curve not converging, greatly reducing the adjustment efficiency. Due to lighting and color temperature issues, it is inappropriate to use a Gamma curve for each scene, and the limited Gamma curve cannot adapt to more shooting scenes.

[0040] In response to the above problems, an embodiment of the present application provides an image optimization method, which can not only avoid the poor controllability of the manual interactive Gamma curve adjustment method, but also avoid the non-convergence during the Gamma curve adjustment process, and can also adapt to more shooting scenes under limited Gamma curve conditions.

[0041] Reference Figure 3 , shows a flowchart of the steps of an image optimization method provided by an embodiment of the present application, and the method may specifically include the following steps:

[0042] Step 301: Use a comparator to collect multiple first scene images of different scenes, and classify the multiple first scene images according to first grayscale histograms of the multiple first scene images to obtain first scene images of different categories.

[0043] In the embodiment of the present application, the image classification process for the comparison machine and the image adjustment process for the image acquisition device may belong to the Camera Tuning process. The Camera Tuning process may be performed on a Tuning chip platform. The chip platform generally refers to a collection of integrated circuits with an independent computing control unit (CPU), supporting system-on-chip (SOC) development, and capable of supporting more software and hardware expansions (such as graphics cards, storage, video acquisition, etc.).

[0044] In an embodiment of the present application, the comparator is a camera that can take pictures or videos with image quality that meets standards. The comparator can be used to capture first scene images of different scenes so that the image quality requirements of the first scene images can meet standards.

[0045] In the embodiment of the present application, the first scene image may be a scene image that can reflect the Gamma curve effect. Specifically, the first scene image may have obvious dark areas, such as shadows, and obvious bright areas, such as direct or reflected light, so that the first scene image can have a higher contrast and a wider dynamic range.

[0046] In one example of the present application, scenes may include scenes such as the sea, bridges, buildings, etc., and the number of scenes may be specified as more than 10 scenes. The more scenes there are, the more conducive it is for the adjusted image acquisition device to use a limited gamma curve to adapt to more shooting scenes. The first scene image of each scene may include scene images captured at different times. For example, the first scene image of the sea scene may include the sea in the early morning and the sea at dusk. The number of first scene images of each scene may be predetermined. For example, it may be specified that each scene includes more than 3 first scene images. In addition, the number of scenes may be specified as less than 10, and the number of first scene images of each scene may be specified as less than 3. The embodiment of the present application does not limit the number of scenes and the number of first scene images of each scene.

[0047] In the embodiment of the present application, each first scene image may have a corresponding first grayscale histogram. By using the first grayscale histogram as a classification basis to classify multiple first scene images, first scene images of different categories may be obtained.

[0048] In an optional embodiment of the present application, the step of classifying the multiple first scene images according to the first grayscale histograms of the multiple first scene images may include the following sub-steps:

[0049] Sub-step S11, in the comparator, respectively calculating first grayscale histograms corresponding to the plurality of first scene images; the first grayscale histogram represents the relationship between the frequency of occurrence of each grayscale pixel value in the first scene image and the grayscale level.

[0050] It should be noted that the grayscale histogram reflects the relationship between the frequency of occurrence of each grayscale pixel value in an image and the grayscale level. With the grayscale level as the horizontal axis and the frequency as the vertical axis, the image plotting the relationship between frequency and grayscale is the grayscale histogram of an image.

[0051] In the embodiment of the present application, the first grayscale histogram can be denoted by h i , i refers to a first scene image, i∈[1,P], P is the upper limit of the number of first scene images. The first grayscale histogram h i It can represent the relationship between the frequency of occurrence of each grayscale pixel value in the first scene image and the grayscale.

[0052] Specifically, the number of occurrences of each grayscale pixel value in the first scene image can be counted, and then the number of occurrences of each grayscale pixel value can be divided by the total number of pixels, so as to obtain the frequency of occurrence of each grayscale pixel value, and then the frequency of occurrence of each grayscale pixel value and the grayscale are represented by a graph to obtain the first grayscale histogram h i, each first scene image may have a corresponding first grayscale histogram h i .

[0053] In order to simply explain the first grayscale histogram h i In the calculation process, it can be assumed that the data of the first scene image is 8*8, and the grayscale pixel value g∈[0,7], then the number of times each number from 0 to 7 appears can be counted, and then the number of times each number appears can be divided by the total number of pixels, that is, divided by 64, to get the frequency of occurrence of each grayscale pixel value. For example, if the number 0 appears 5 times, then the frequency of the number 0 is f0=5 / 24, and so on. After obtaining the frequency of occurrence of the numbers 0-7, the numbers 0-7 are used as the horizontal coordinates and the frequency of occurrence of the numbers 0-7 as the vertical coordinates to draw the first grayscale histogram corresponding to the first scene image. The above examples are only used to enable those skilled in the art to better understand the embodiments of the present application, and the present application does not limit this.

[0054] In an example of the present application, the length of the first grayscale histogram can be 256 dimensions, that is, the grayscale pixel value g∈[0,255], where 0 represents black and 255 represents white. 256 dimensions can represent that there are 256 grayscale pixel values ​​in the process from black to white.

[0055] Sub-step S12, in the comparison machine, if the similarity between the first grayscale histograms corresponding to the two first scene images exceeds a preset percentage, the two first scene images are classified into the same category; each category includes first scene images of at least one scene.

[0056] In the embodiment of the present application, the first scene image may have a corresponding first grayscale histogram. Then, for the first scene image captured by the contrast machine, the first grayscale histogram h may be obtained based on a density method. i Clustering is performed to obtain first scene images of different categories, that is, the similarity between any two first grayscale histograms of the same category exceeds a preset percentage.

[0057] In an example of the present application, assuming that the similarity between the first grayscale histogram A corresponding to the first scene image A and the first grayscale histogram B corresponding to the first scene image B exceeds 90%, the first scene image A and the first scene image B can be classified into the same category. The above example is only used to enable those skilled in the art to better understand the embodiments of the present application, and the present application does not limit this.

[0058] Due to the problems of illumination and color temperature, the grayscale histograms corresponding to the images of the same scene may be very different. For example, for the "sea" scene, the grayscale histograms of the sea in the early morning and the sea at dusk are quite different, and it is not suitable to use the same Gamma curve. Therefore, the embodiment of the present application classifies the first scene images of different scenes based on the first grayscale histogram, which can effectively solve the above problem.

[0059] In the embodiment of the present application, based on the first grayscale histogram h i After classifying the first scene image, we can get first scene images of different categories, the number of categories d∈[1,P], and the category label L i ∈[1,d], each category can include the first scene image of at least one scene.

[0060] Step 302: In the comparison machine, optimal values ​​of the gamma curves and average grayscale histograms of the first scene images of different categories are determined respectively.

[0061] In the embodiment of the present application, based on the first grayscale histogram h i , after classifying the first scene image and obtaining the first scene images of different categories, the optimal value of the Gamma curve and the average grayscale histogram of the first scene images of different categories can be determined respectively, the optimal value of the Gamma curve can be used in the subsequent adjustment step of the second scene image of the image acquisition device, and the average grayscale histogram can be used in the subsequent adjustment step of the second grayscale histogram of the image acquisition device.

[0062] The embodiment of the present application uses categories as units to find the optimal value of the gamma curve that best suits each unit, wherein each unit includes at least one scene. This not only avoids the situation where it is inappropriate to use one gamma curve for each scene due to problems with lighting and color temperature, but is also conducive to adapting more shooting scenes under limited gamma curve conditions.

[0063] In an optional embodiment of the present application, each category includes a plurality of first grayscale histograms, and the step of respectively determining the average grayscale histograms of the first scene images of different categories may include the following sub-steps:

[0064] Sub-step S21, in the comparator, respectively superimposes and averages a plurality of first grayscale histograms in the same category to obtain an average grayscale histogram of the first scene images of different categories.

[0065] In the embodiment of the present application, each category may include multiple first scene images. In other words, each category may include multiple first grayscale histograms, wherein the similarity between any two of the multiple first grayscale histograms of the same category exceeds a preset percentage. On this basis, the average grayscale histogram of the first scene images of different categories may be obtained according to the following formula 1, and the average grayscale histogram may be denoted as h: j , j∈[1,d], j is the category label, d is the number of categories:

[0066]

[0067] In order to simply explain the calculation process of the above formula 1, it can be assumed that a certain category includes a first grayscale histogram A, a first grayscale histogram B and a first grayscale histogram C, wherein the grayscale pixel values ​​of the first grayscale histogram can all be g∈[0,255]. If the frequencies of the first grayscale histogram A, the first grayscale histogram B and the first grayscale histogram C at g=0 are f respectively. a 、f b 、f c , then the calculated average grayscale histogram h j The frequency at g = 0 can be (f a 、f b 、f c ) / 3, and so on, calculate the average grayscale histogram h j Frequency when g=0~255.

[0068] According to the above method, the average grayscale histograms h of the first scene images of different categories can be obtained respectively. j , where each category can include a mean grayscale histogram h j The above examples are only used to help those skilled in the art better understand the embodiments of the present application, and the present application does not limit them.

[0069] In an optional embodiment of the present application, the step of respectively determining the optimal values ​​of the gamma curves of the first scene images of different categories may include the following sub-steps:

[0070] Sub-step S31, in the comparator, the average grayscale histogram is integrated according to the grayscale pixel values ​​to obtain the Gamma curve response values ​​of the first scene images of different categories.

[0071] In the embodiment of the present application, based on the condition of scene screening, that is, based on the first grayscale histogram, the first scene images of different scenes are classified. It can be assumed that the first grayscale histograms h of the same category i The main influencing condition is the Gamma curve, and the first grayscale histogram hi The distribution is relatively uniform, so the average grayscale histogram h can be accumulated without changing the contrast machine. j It can be compared to the Gamma curve, that is, for any category, the Gamma value at the grayscale pixel value △∈[0,255] can be obtained by calculating the average grayscale histogram h j The response of the Gamma curve can be obtained by integrating, that is, the response value of the Gamma curve. The response value of the Gamma curve can be y j , j∈[1,d], j is the category label, d is the number of categories:

[0072]

[0073] Among them, y △ is the average grayscale histogram h for a certain category j After integration, the response of the Gamma curve at a certain grayscale pixel value △. For example, the average grayscale histogram h for a certain category j , integrate it, then the response of the Gamma curve at the grayscale pixel value △ = 0 is y0, the response of the Gamma curve at the grayscale pixel value △ = 1 is y1, and so on, until the response of the Gamma curve at the grayscale pixel value △ = 0 to 255 is obtained, so that the Gamma curve response value y of this category can be obtained j .

[0074] Sub-step S32, obtaining a first Gamma curve standard value of the comparison machine.

[0075] In an optional embodiment of the present application, the first Gamma curve standard value is obtained by calculating the standard reflectivity of a standard grayscale chart collected by the comparator.

[0076] It should be noted that the grayscale value is the grayscale pixel value. Grayscale can refer to the brightness change between the brightest and darkest being divided into different levels. Each level represents a brightness change. The more intermediate levels there are, the more delicate the picture effect will be. Grayscale g∈[0,255] can represent 256 brightness levels. The standard grayscale chart can be a tool specifically used to detect the grayscale levels of products such as cameras and displays. The more grayscale levels of the display screen measured, the smoother and softer the picture change trend presented by the screen will be.

[0077] In the embodiment of the present application, in addition to collecting first scene images of different scenes, the comparator can also collect standard grayscale charts. The standard grayscale charts have standard reflectivity. Therefore, the comparator can be used to collect standard grayscale charts, and the Gamma curve of the standard grayscale charts can be used as the standard Gamma curve of the comparator. The embodiment of the present application can calculate the standard value of the first Gamma curve of the comparator based on the standard grayscale chart with standard reflectivity. The standard reflectivity can be set to r, and the standard value of the first Gamma curve can be set to y:

[0078] y=ar γ Formula 3

[0079] Where a∈R + represents the adjustment coefficient, γ∈R + Represents the value of the transformation.

[0080] Sub-step S33, in the comparator, using the first Gamma curve standard value, uniformly calculates the Gamma curve response values ​​respectively to obtain the optimal Gamma curve values ​​of the first scene images of different categories.

[0081] In the embodiment of the present application, since the similarity between the first grayscale histograms corresponding to the two first scene images of the same category exceeds the preset percentage, the difference between the actual reflectivity corresponding to the two first scene images of the same category will not be too obvious, and the actual reflectivity can be set to r j * .

[0082] However, since the same category includes different scenes, there are still scene differences in the same category, which may cause the actual reflectivity r corresponding to the first scene images of each pair to be j * The difference between them results in the Gamma curve not converging.

[0083] Since the Gamma curve response value y j is the average grayscale histogram h j The average grayscale histogram h is obtained by integrating j are multiple first grayscale histograms h of the same category i In order to minimize the impact of scene differences and avoid the situation where the Gamma curve does not converge, the first Gamma curve standard value y can be used to calculate the Gamma curve response value y of various categories. j Perform uniform calculation.

[0084] In an optional embodiment of the present application, the sub-step S33 may include the following sub-steps:

[0085] Sub-step S331, in the comparator, based on the Gamma curve response value and the first Gamma curve standard value, respectively calculate the reflectance difference between the first scene image of each category and the standard grayscale chart to obtain the reflectance difference of different categories.

[0086] In the embodiment of the present application, the reflectivity difference between the first scene image of each category and the standard grayscale chart can be calculated according to the following formula 4, and the reflectivity difference can be set as j is the category label, d is the number of categories:

[0087]

[0088] Among them, a∈R+ ​​represents the adjustment coefficient, γ∈R+ represents the value of the transformation, and the actual reflectivity r corresponding to the first scene image is affected by the scene difference. j * Therefore, the Gamma curve response value y j and the first Gamma curve standard value y, respectively calculate the reflectance difference between the first scene image of each category and the standard grayscale chart Then the reflectivity difference can be taken Perform uniform calculations to indirectly adjust the gamma curve response value of each category.

[0089] Sub-step S332, in the comparator, the reflectivity differences are uniformly calculated according to the image height, image width and the grayscale pixel values ​​of the first scene image, to obtain the uniform reflectivity differences of the different categories.

[0090] In the embodiment of the present application, the reflectivity difference of various types after uniformization can be calculated according to the following formula 5, and the reflectivity difference after uniformization can be set to j is the category label, d is the number of categories:

[0091]

[0092] Wherein, M represents the height of the first scene image, N represents the width of the first scene image, g represents the grayscale pixel value, g∈[0,255], and, With r j * The difference can be considered to be caused by scene differences. In order to reduce the impact of scene differences, Alternative j * , With r j *The difference can be eliminated through the subsequent Equation 6 and fitting calculation steps.

[0093] Sub-step S333, in the comparator, respectively calculating the gamma curve compensation values ​​of the first scene images of the different categories according to the evenly-divided reflectivity differences of the different categories.

[0094] Sub-step S334, in the comparator, respectively adding the Gamma curve compensation value to the first Gamma curve standard value to obtain the Gamma curve average value of the first scene images of different categories.

[0095] In the embodiment of the present application, the reflectivity difference after uniformization can be The Gamma curve compensation values ​​of the first scene images of different categories are calculated respectively, and then the Gamma curve compensation values ​​of different categories are further added to the first Gamma curve standard value, so that the Gamma curve average value of the first scene images of different categories can be obtained. The Gamma curve average value can be set to j is the category label, d is the number of categories:

[0096]

[0097] Where a∈R + represents the adjustment coefficient, γ∈R + represents the transformed value, Represents the Gamma curve compensation value, Represents the averaged Gamma curve.

[0098] Sub-step S335, in the comparator, fitting calculation is performed on the Gamma curve uniform value respectively to obtain the Gamma curve optimal value of the first scene image of the different categories; each category includes an optimal Gamma curve value.

[0099] In the embodiment of the present application, there is still noise data in the average value of the Gamma curve, and the noise data will affect the universality of the average value of the Gamma curve. The embodiment of the present application can perform fitting calculation on the average value of the Gamma curve, which can not only achieve the purpose of minimizing the impact of scene differences, but also eliminate the noise data, so that the fitting result is more universal. The fitting result can be y j * ,y j * Represents the optimal value of the Gamma curve. Each category can include a Gamma curve optimal value y j * .

[0100] Step 303: Use an image acquisition device to respectively acquire a plurality of second scene images matching the plurality of first scene images, and obtain from the comparator the optimal value of the gamma curve of the corresponding category and the average grayscale histogram of the corresponding category.

[0101] In the embodiment of the present application, for the first scene images of different scenes collected by the comparison machine, the optimal value y of the Gamma curve of the first scene images of different categories can be obtained from step 301 to step 302. j * , then you can adjust the image acquisition device.

[0102] In one example of the present application, a Camera product needs to undergo a Camera Tuning process before it is launched on the market or during an upgrade. The present application embodiment may use an image acquisition device, i.e., a Camera, to respectively acquire multiple second scene images that match multiple first scene images. Then, the optimal value of the Gamma curve corresponding to the category of each second scene image and the average grayscale histogram of the corresponding category may be obtained from the optimal values ​​of the Gamma curve and the average grayscale histogram of different categories of the comparison machine. The optimal value of the Gamma curve may be used to adjust the second scene image of the image acquisition device, and the average grayscale histogram may be used to adjust the second grayscale histogram of the image acquisition device.

[0103] In an optional embodiment of the present application, the step of using an image acquisition device to respectively acquire a plurality of second scene images matching the plurality of first scene images may include the following sub-steps:

[0104] Sub-step S41, determining the shooting attributes of the plurality of first scene images respectively; the shooting attributes include shooting time and shooting scene.

[0105] Sub-step S42: Based on the shooting time and the shooting scene, using an image acquisition device to respectively acquire a plurality of second scene images that match the shooting attributes of the plurality of first scene images.

[0106] In an embodiment of the present application, the first scene image may have corresponding shooting attributes, wherein the shooting attributes may include shooting time and shooting scene. Therefore, the embodiment of the present application may determine the shooting attributes of the first scene image, and then based on the shooting time and shooting scene, use an image acquisition device to respectively acquire a second scene image that matches the shooting attributes of the first scene image.

[0107] In one example of the present application, assuming that the comparison machine collects a first scene image of a scene such as the sea, a bridge, a building, etc., then based on the shooting scene, an image acquisition device can be used to collect a second scene image of the scene such as the sea, a bridge, a building, etc. In addition, assuming that the sea scene collected by the comparison machine includes the sea in the early morning and the sea at dusk, then based on the shooting time, an image acquisition device can be used to collect the second scene images of the sea in the early morning and the sea at dusk. In addition, the embodiments of the present application can also be based on shooting attributes such as shooting location, shooting weather, shooting direction, etc. The above examples are only used to enable those skilled in the art to better understand the embodiments of the present application, and the present application does not limit this.

[0108] Step 304: In the image acquisition device, the plurality of second scene images are adjusted according to the optimal values ​​of the gamma curves of the corresponding categories to obtain a plurality of adjusted second scene images.

[0109] In an embodiment of the present application, after using an image acquisition device to capture multiple second scene images, since the second scene images match the first scene images, the optimal value of the gamma curve of the corresponding category of each second scene image can be obtained from the optimal values ​​of the gamma curve of different categories of the comparator, and then the second scene image can be adjusted according to the optimal value of the gamma curve of the corresponding category.

[0110] In an example of the present application, it is assumed that the second scene image may include a second scene image A2, a second scene image B2, and a second scene image C2, wherein the second scene image A2 matches the first scene image A1, the second scene image B2 matches the first scene image B1, and the second scene image C2 matches the first scene image C1. Then, for the second scene image A2, the category in which the first scene image A1 belongs can be used as the corresponding category of the second scene image A2, and then the optimal value of the gamma curve of the corresponding category can be obtained from the comparator, and the second scene image A2 can be adjusted according to the optimal value of the gamma curve of the corresponding category to obtain the adjusted second scene image A2.

[0111] According to the above method, for the second scene image B2 and the second scene image C2, the optimal values ​​of the Gamma curves of the corresponding categories are obtained respectively, and then the second scene image B2 and the second scene image C2 are adjusted respectively according to the optimal values ​​of the Gamma curves of the corresponding categories to obtain the adjusted second scene image B2 and the adjusted second scene image C2. The above examples are only used to enable those skilled in the art to better understand the embodiments of the present application, and the present application does not limit this.

[0112] In an optional embodiment of the present application, step 304 may include the following sub-steps:

[0113] Sub-step S51, obtaining a second Gamma curve standard value of the image acquisition device.

[0114] In an optional embodiment of the present application, the second Gamma curve standard value is obtained by calculating the standard reflectivity of a standard grayscale chart acquired by the image acquisition device.

[0115] In the embodiment of the present application, in addition to capturing the second scene image of different scenes, the image acquisition device can also capture a standard grayscale chart. The standard grayscale chart has a standard reflectivity. Therefore, the image acquisition device can be used to capture the standard grayscale chart, and the Gamma curve of the standard grayscale chart is used as the standard Gamma curve of the image acquisition device. The embodiment of the present application can calculate the standard value of the second Gamma curve of the image acquisition device based on the standard grayscale chart with a standard reflectivity. The standard reflectivity can be set to r, and the standard value of the second Gamma curve can be set to y. t :

[0116]

[0117] Among them, a t ∈R + represents the adjustment coefficient, γ t ∈R + Represents the value of the transformation.

[0118] Sub-step S52: In the image acquisition device, the second Gamma curve standard value is used to perform inverse transformation calculations on the plurality of second scene images respectively to obtain a plurality of inverse transformed second scene images.

[0119] Since the image acquisition device will be affected by the Gamma curve before adjustment, it is necessary to eliminate the influence of the Gamma curve before adjustment. Otherwise, the simulation result of the image acquisition device is a combined value, which is the superposition of the Gamma curve after adjustment and the Gamma curve before adjustment, causing the simulation result to be inconsistent with the actual result, thereby affecting the accuracy of the simulation result.

[0120] In the embodiment of the present application, the second Gamma curve standard value may be used to perform an inverse transformation calculation on the second scene image to obtain the inverse transformed second scene image. The second scene image before the inverse transformation may be denoted as I, and the second scene image after the inverse transformation may be denoted as I':

[0121]

[0122] Among them, u∈[1,Y], v∈[1,X], (X,Y) represents the width and height of the current second scene image, u and v represent the row and column numbers respectively, I(u,v) represents the grayscale value of the second scene image at the u row and v column coordinates before the inverse transformation, and I'(u,v) represents the grayscale value of the second scene image at the u row and v column coordinates after the inverse transformation. Through the above formula 8, the influence of the Gamma curve before adjustment can be eliminated, so that the simulation results are consistent with the actual results, and the accuracy of the simulation results is improved.

[0123] Sub-step S53, in the image acquisition device, adjusting the grayscale pixel values ​​of the plurality of inverse-transformed second scene images according to the optimal value of the Gamma curve of the corresponding category, to obtain a plurality of adjusted second scene images.

[0124] In the embodiment of the present application, the grayscale pixel value g∈[0,255] can adopt the optimal value y of the Gamma curve of the corresponding category j * By adjusting the values ​​of the grayscale pixel values ​​of the inversely transformed second scene image I' one by one, a plurality of adjusted second scene images can be obtained. The adjusted second scene images can be:

[0125]

[0126] in, Represents the optimal value y of the Gamma curve for the corresponding category j * The adjustment factor at grayscale I'(u,v), Represents the adjusted second scene image Grayscale value at row u, column v.

[0127] In order to simplify the calculation process of the above formula 9, it can be assumed that the optimal value y of the Gamma curve of the corresponding category is j * The values ​​at g=0, g=1, and g=2 are respectively X0, X1, and X2. Then the values ​​of the second scene image I' after the inverse transformation at g=0, g=1, and g=2 are respectively adjusted to X0, X1, and X2. By analogy, according to the above method, multiple adjusted second scene images are obtained. The above examples are only used to help those skilled in the art better understand the embodiments of the present application, and the present application does not limit this.

[0128] Step 305: In the image acquisition device, the second grayscale histograms of the plurality of adjusted second scene images are adjusted according to the average grayscale histograms of the corresponding categories to obtain a plurality of adjusted second grayscale histograms.

[0129] In the embodiment of the present application, the optimal value y of the Gamma curve of the corresponding category is adopted. j * , the inverse transformed second scene image I' is adjusted to obtain the adjusted second scene image Next, you can verify the adjusted second scene image Check whether the image quality meets the standards.

[0130] Since the first scene image is collected by a contrast machine, which is a camera that takes pictures or videos with satisfactory image quality, the average grayscale histogram h of the corresponding category can be used. j , for the adjusted second scene image The second grayscale histogram is adjusted to prepare for the subsequent verification step.

[0131] In an optional embodiment of the present application, step 305 may include the following sub-steps:

[0132] Sub-step S61, in the image acquisition device, respectively calculating second grayscale histograms corresponding to the multiple adjusted second scene images; the second grayscale histogram represents the relationship between the frequency of occurrence of each grayscale pixel value in the adjusted second scene image and the grayscale level.

[0133] In the embodiment of the present application, the second grayscale histogram may represent the adjusted second scene image: The relationship between the frequency of occurrence of each grayscale pixel value and the grayscale level can be made into the second grayscale histogram: L t is the category label, and d is the number of categories.

[0134] Since the calculation process of the second grayscale histogram is the same as the calculation process of the first grayscale histogram, please refer to sub-step S11 for details, which will not be repeated here.

[0135] Sub-step S62, in the image acquisition device, adjusting the grayscale pixel values ​​of the second grayscale histograms of the plurality of adjusted second scene images respectively according to the average grayscale histogram of the corresponding category to obtain a plurality of adjusted second grayscale histograms.

[0136] In the embodiment of the present application, in order to verify the adjusted second scene image The average grayscale histogram h of the corresponding category can be used to determine whether the image quality meets the standard.j , for the adjusted second scene image The second grayscale histogram The grayscale pixel values ​​g are adjusted, g∈[0,255], and the adjusted second grayscale histogram can be obtained. The adjusted second grayscale histogram can be made as

[0137] Step 306, when the adjustment differences between the multiple adjusted second grayscale histograms and the second grayscale histograms before adjustment are less than the preset difference, it is determined that the adjustment of the image acquisition device is completed, so that the adjusted image acquisition device adopts the optimal value of the Gamma curve to optimize the acquired image accordingly.

[0138] In the embodiment of the present application, the adjusted second grayscale histogram can be calculated The second grayscale histogram before adjustment The cross information entropy between them represents the adjustment difference, and the adjustment difference can be set to τ:

[0139]

[0140] Among them, the grayscale pixel value △∈[0,255], Represents the second grayscale histogram before adjustment The value at △∈[0,255], Represents the adjusted second grayscale histogram Value at △∈[0,255].

[0141] In the embodiment of the present application, when the adjusted second grayscale histogram The second grayscale histogram before adjustment When the adjustment difference τ between them is less than the preset difference, it can be said that the current second scene image has the same quality as the corresponding first scene image. Then, it can be determined that the verification result of the current second scene image is passed, and the optimal value of the Gamma curve of the corresponding category y j * It can be the optimal Gamma curve of the current second scene image, and the remaining multiple second scene images can be verified in the above manner. In addition, the preset difference can be a value obtained after several experiments, and the preset difference can be 0.12 / 0.1 / 0.85, etc. The embodiment of the present application does not limit the preset difference.

[0142] In the embodiment of the present application, when a plurality of adjusted second scene images When the verification results are all of quality passed, that is, when multiple adjusted second grayscale histograms Respectively compared with the second grayscale histogram before adjustment When the adjustment difference τ between is less than the preset difference, it can be determined that the adjustment of the image acquisition device is completed. This allows the adjusted image acquisition device to use the optimal value y of the Gamma curve after it is launched or upgraded. j * , and optimize the acquired images accordingly.

[0143] In an example of the present application, it can be assumed that after the adjusted image acquisition device is put on the market or upgraded, when it acquires images of "bridge" and "building", since "bridge" and "building" belong to the same category, a Gamma curve optimal value y corresponding to the category can be used together. j * Image optimization can be performed to adapt to more shooting scenes under limited gamma curve conditions.

[0144] In an example of the present application, it can be assumed that after the adjusted image acquisition device is launched or upgraded, when it acquires images of "the sea in the early morning" and "the sea in the dusk", since "the sea in the early morning" and "the sea in the dusk" belong to different categories, a gamma curve optimal value y corresponding to the category of "the sea in the early morning" can be used. j * The image of "the sea at dawn" is optimized, and the optimal value y of a gamma curve corresponding to the category of "the sea at dusk" can be used. j * The image of "Sea at Dusk" is optimized to avoid the situation where a gamma curve is inappropriate for each scene due to lighting and color temperature issues.

[0145] The above examples are only used to help those skilled in the art better understand the embodiments of the present application, and the present application does not limit this.

[0146] In an optional embodiment of the present application, the method may further include:

[0147] When the adjustment difference between a second grayscale histogram after adjustment and the second grayscale histogram before adjustment is not less than a preset difference, the corresponding adjusted second scene image is used as the scene image to be fine-tuned; the adjusted second grayscale histogram and the second grayscale histogram before adjustment are used to construct an objective function for the scene image to be fine-tuned; the objective function is iteratively calculated to iteratively update the optimal value of the Gamma curve of the corresponding category, and the updated optimal value of the Gamma curve is used to adjust the scene image to be fine-tuned, until it is determined that the adjustment of the image acquisition device is completed, so that the adjusted image acquisition device uses the updated optimal value of the Gamma curve to optimize the acquired image accordingly.

[0148] In an optional embodiment of the present application, the step of iteratively calculating the objective function to iteratively update the optimal value of the Gamma curve of the corresponding category may include the following sub-steps:

[0149] In each iterative operation, a fine-tuning factor corresponding to each grayscale pixel value is obtained; in each iterative operation, the fine-tuning factor corresponding to each grayscale pixel value is used to update the optimal value of the Gamma curve of the corresponding category.

[0150] In an optional embodiment of the present application, the step of using the updated optimal value of the gamma curve to fine-tune the scene image to be fine-tuned until it is determined that the adjustment of the image acquisition device is completed may include the following sub-steps:

[0151] When the maximum number of iterative operations is reached, the minimum objective function value is determined; the objective function value represents the degree of fine-tuning in each iterative operation; the optimal value of the Gamma curve after the minimum objective function value is obtained; in the image acquisition device, the image of the scene to be fine-tuned is adjusted according to the corresponding optimal value of the Gamma curve after the update to determine that the adjustment of the image acquisition device is completed.

[0152] In the embodiment of the present application, when a second grayscale histogram after adjustment The second grayscale histogram before adjustment When the adjustment difference τ between the two is not less than the preset difference, the corresponding adjusted second scene image As the scene image to be fine-tuned. For example, when the adjustment difference τ between the second grayscale histogram A before and after adjustment is greater than the preset difference, since the second scene image A corresponding to the second grayscale histogram A is adjusted by the optimal value of the gamma curve of the corresponding category, the second scene image A can be further fine-tuned, and the second scene image A can be used as the scene image to be fine-tuned.

[0153] In the embodiment of the present application, the adjusted second grayscale histogram may be used. And the corresponding second grayscale histogram before adjustment Construct an objective function for the scene image to be fine-tuned. The scene image to be fine-tuned can be fine-tuned using the following objective function:

[0154]

[0155] Among them, ω represents the fine-tuning factor of the Gamma curve corresponding to each grayscale, grayscale g∈[0,255], then ω∈[0,255], α represents the constraint fine-tuning weight, α∈(0,1).

[0156] In an embodiment of the present application, the above-mentioned objective function can be iteratively calculated, so that the optimal value of the Gamma curve of the corresponding category can be iteratively updated, and then the updated optimal value of the Gamma curve can be used to adjust the image of the scene to be fine-tuned until it is determined that the adjustment of the image acquisition device is completed.

[0157] Specifically, the number of iterations can be set to n. In each iteration, the fine-tuning factor ω corresponding to each grayscale pixel value g can be obtained. Then, in each iteration, the fine-tuning factor ω corresponding to each grayscale pixel value g can be used to obtain the optimal value y of the Gamma curve of the corresponding category. j * to update.

[0158] The maximum number of iterations can be set to κ∈(1,∞], where κ can be a value obtained after several experiments. When the maximum number of iterative operations κ is reached, the minimum objective function value can be determined, and the objective function value can be set to δ, where the objective function value δ represents the degree of fine-tuning in each iterative operation, which can be obtained by calculating the number of occurrences of |ω-1|≠0 at g∈[0,255]. In the current number of iterations, the objective function value δ can be the number of occurrences of |ω-1|≠0. Generally speaking, the more non-zero elements, that is, the greater the number of occurrences of |ω-1|≠0, the more drastic the degree of fine-tuning in the current number of iterations, and thus the more extreme the solution obtained. Therefore, the embodiment of the present application can determine the minimum degree of fine-tuning by determining the minimum objective function value δ.

[0159] After determining the minimum objective function value δ, the corresponding updated Gamma curve optimal value y can be obtained j ** , so that the optimal value y of the corresponding updated Gamma curve can be obtained j **, adjust the scene image to be fine-tuned until the adjustment of the image acquisition device is completed, so that the adjusted image acquisition device can use the updated optimal value y of the Gamma curve after it is launched or upgraded. j ** , and optimize the acquired images accordingly.

[0160] In order to make it easier for those skilled in the art to understand the iterative calculation process of the above objective function, the following example is given:

[0161] In each iterative operation, the fine-tuning factor ω is first initialized, the initial value of ω is 1, and the iterative operation starts from n=1;

[0162] 1) When n=1, based on Solve the fine-tuning factor ω corresponding to each grayscale pixel value g, assuming The value at g = 0 is 12, The value at g = 0 is 10, so the value of ω at g = 0 is 1.2; The value at g = 1 is 12, The value at g = 1 is 12, so the value of ω at g = 1 is 1; and so on, until the value of ω at g = 0 to 255 is calculated;

[0163] 2) When n = 1, calculate the zero norm of |ω-1|≠0, that is, the number of non-zero values, that is, the number of times the value of ω is not 1 at g = 0 to 255. Since the initial value of the fine-tuning factor ω is 1 in each iterative operation, ω = 1 means that at a certain grayscale and The values ​​are equal. For example, in the above step 1), the value of ω at g = 1 is 1, then and The values ​​at g = 1 are equal;

[0164] 3) When n = 1, the number of non-zero values ​​is taken as the objective function value δ1. Assuming that the number of occurrences of |ω-1|≠0 at g = 0 to 255 is 30, then the objective function value δ1 = 30;

[0165] 4) When n = 1, according to y n =y n-1 ω, where y n-1 =y0=y j * , the optimal value y for the Gamma curve j * For example, in step 1), the values ​​of ω at g = 0 and g = 1 are 1.2 and 1 respectively, then the optimal value y of the Gamma curve can be j* The values ​​at g = 0 and g = 1 are updated to 1.2 and 1 respectively; and so on, until the optimal value y of the Gamma curve is determined. j * At the value of g = 0 to 255, the updated optimal value y1 of the Gamma curve can be obtained;

[0166] 5) When n=1, the scene image to be fine-tuned can be Use the updated optimal value y1 of the Gamma curve to fine-tune the scene image After fine-tuning, the fine-tuned scene image can be obtained. The scene image to be fine-tuned after fine-tuning Further fine-tuning is required;

[0167] 6) When n=1, the fine-tuned scene image to be fine-tuned can be The corresponding second grayscale histogram is The average grayscale histogram h of the corresponding category can be used j , the second grayscale histogram is Fine-tune, so as to obtain a fine-tuned second grayscale histogram, and the fine-tuned second grayscale histogram can be denoted as h′1;

[0168] 7) n=n+1, determine whether the maximum number of iterations κ is exceeded. Assuming that the preset maximum number of iterations κ is 5, then n=2 at this time, and it is determined that the maximum number of iterations κ is not exceeded, then return to the above step 1);

[0169] ...[n=2-5, loop through steps 1) to 7)]

[0170] 8) When n=6, it is judged that the maximum number of iterations κ is exceeded, then the objective function values ​​δ1~δ5 for n=1~5 can be obtained;

[0171] 9) Determine the minimum objective function value from the objective function values ​​δ1 to δ5. Assuming that δ3 is the minimum value, the updated optimal value y3 of the Gamma curve corresponding to the minimum objective function value δ3 can be obtained;

[0172] 10) Since the scene image to be fine-tuned is fine-tuned when n=1-5, y3 can be used in this step 10) to fine-tune the scene image to be fine-tuned again. For example, the current scene image to be fine-tuned is Then we can use y3 to fine-tune the scene image again. Make fine adjustments;

[0173] 11) Make sure that the image acquisition device has been adjusted so that the optimal value of the updated Gamma curve is y j** For example, in the above steps 9) to 10), y3 is the updated optimal value of the Gamma curve corresponding to the minimum objective function value δ3, so y j ** =y3, so that the adjusted image acquisition device can use the updated optimal value y of the Gamma curve j ** , and optimize the acquired images accordingly.

[0174] In an example of the present application, it can be assumed that after the adjusted image acquisition device is launched or upgraded, when it acquires images of "bridge" and "building", since "bridge" and "building" belong to the same category, the optimal value y of the gamma curve corresponding to the category is j ** If it is updated, then the updated Gamma curve optimal value y corresponding to this category can be used together j ** Image optimization is performed to adapt to more shooting scenes under limited gamma curve conditions.

[0175] In an example of the present application, it can be assumed that after the adjusted image acquisition device is launched or upgraded, when it acquires images of "the sea in the early morning" and "the sea in the dusk", since "the sea in the early morning" and "the sea in the dusk" belong to different categories, a gamma curve optimal value y corresponding to the category of "the sea in the early morning" can be used. j * The image of "the sea in the early morning" is optimized, and the optimal value y of the gamma curve of the corresponding category of "the sea at dusk" is j ** If it is updated, then we can use the updated optimal value y of the Gamma curve corresponding to the category of "sea at dusk" j ** The image of "Sea at Dusk" is optimized to avoid the situation where a gamma curve is inappropriate for each scene due to lighting and color temperature issues.

[0176] The above examples are only used to help those skilled in the art better understand the embodiments of the present application, and the present application does not limit this.

[0177] To summarize, in the technical solution provided in the embodiments of the present application, on the one hand, for the first scene images of different scenes captured by the comparator, by taking the first grayscale histogram as the classification basis, the first scene images are classified to obtain first scene images of different categories, and then the gamma curves that are most suitable for the first scene images of various categories are determined respectively, thereby avoiding the situation where one gamma curve is inappropriate for the same scene due to lighting and color temperature issues, and can also adapt to more shooting scenes under limited gamma curve conditions.

[0178] On the other hand, by using an image acquisition device to acquire a second scene image that matches the first scene image, a gamma curve of a corresponding category can be obtained from a comparator, and then the gamma curve of the corresponding category is used to automatically adjust the second scene image of the image acquisition device, without the need for manual subjective adjustment of the control points of the gamma curve of the second scene image. This not only avoids the poor controllability of the manual interactive gamma curve adjustment method, but also avoids non-convergence due to subjective factors during the gamma curve adjustment process.

[0179] On the other hand, since the calculation / adjustment process of the first grayscale histogram, the second scene image, the second grayscale histogram, the image to be fine-tuned, and the second grayscale histogram corresponding to the image to be fine-tuned are all based on the grayscale pixel value g∈[0,255] as the calculation / adjustment dimension, not only can the optimal Gamma curve be obtained, but also the adjustment can be made more delicate.

[0180] On the other hand, after adjusting the second scene image using the optimal value of the Gamma curve of the corresponding category, the second grayscale histogram of the adjusted second scene image is adjusted using the average grayscale histogram of the corresponding category, and the image quality of the adjusted second scene image is verified to be up to standard by judging whether the adjustment difference between the adjusted second grayscale histogram and the second grayscale histogram before adjustment is less than a preset difference. If the verification fails, the optimal value of the Gamma curve can be iteratively updated by constructing an objective function to obtain the optimal value of the Gamma curve that is most suitable for the second scene image, thereby ensuring that the image quality of the adjusted / fine-tuned second scene image is up to standard, so that the adjusted image acquisition device adopts the most suitable optimal value of the Gamma curve to optimize the acquired image accordingly.

[0181] In order to enable those skilled in the art to better understand the embodiments of the present application, the embodiments of the present application are described below by means of two examples:

[0182] Example 1: Operational procedures involving the chip platform for contrast machine images.

[0183] refer to Figure 4, shows an operation flow chart of the chip platform for the image comparison machine in the embodiment of the present application, and the specific operation flow is as follows:

[0184] 1. Collect first scene images of different scenes; each scene includes a plurality of first scene images, and the first scene images have obvious dark areas and obvious bright areas;

[0185] 2. Calculate a first grayscale histogram of the first scene image; the first grayscale histogram represents the relationship between the frequency of occurrence of each grayscale pixel value in the first scene image and the grayscale level;

[0186] 3. Based on the first grayscale histogram, classify the first scene image; each category includes the first scene image of at least one scene;

[0187] 4. Calculate the average grayscale histogram of various categories; the average grayscale histogram is obtained by superimposing and averaging multiple first grayscale histograms of the same category;

[0188] 5. Integrate the average grayscale histogram of the same category to obtain the Gamma curve response values ​​of various categories;

[0189] 6. Obtain a first Gamma curve standard value of the comparison machine; the first Gamma curve standard value is obtained by calculating the standard reflectivity of a standard grayscale chart collected by the comparison machine;

[0190] 7. Calculate the reflectivity difference of various categories according to the Gamma curve response value and the first Gamma curve standard value; the reflectivity difference is the reflectivity difference between the first scene image and the standard grayscale chart;

[0191] 8. According to the image height, image width and each grayscale pixel value of the first scene image, the reflectivity difference of each category is uniformly calculated; the grayscale pixel value g∈[0,255];

[0192] 9. Calculate various types of Gamma curve compensation values ​​based on the reflectivity difference after uniformization;

[0193] 10. Add the Gamma curve compensation value to the first Gamma curve standard value to obtain the average value of the Gamma curve of various categories;

[0194] 11. Fit and calculate the average value of the Gamma curve to obtain the optimal value of the Gamma curve of various categories.

[0195] Example 2: Operational procedures involving a chip platform targeting images from an image acquisition device.

[0196] refer to Figure 5, shows an operation flow chart of the chip platform for the image acquisition device image in the embodiment of the present application, and the operation flow is as follows:

[0197] 1. Acquire a second scene image that matches the shooting attributes of the first scene image; the shooting attributes include shooting time and shooting scene;

[0198] 2. Obtain the optimal value of the gamma curve and the average grayscale histogram of the corresponding category from the comparison machine;

[0199] 3. Obtain a second Gamma curve standard value of the image acquisition device; the second Gamma curve standard value is obtained by calculating the standard reflectivity of a standard grayscale chart acquired by the image acquisition device;

[0200] 4. Using the second Gamma curve standard value, perform inverse transformation calculation on the second scene image;

[0201] 5. According to the optimal value of the Gamma curve of the corresponding category, adjust the grayscale pixel values ​​in each inverse transformed second scene image; the grayscale pixel value g∈[0,255];

[0202] 6. Calculate a second grayscale histogram corresponding to the adjusted second scene image; the second grayscale histogram represents the relationship between the frequency of occurrence of each grayscale pixel value and the grayscale level in the adjusted second scene image;

[0203] 7. According to the average grayscale histogram of the corresponding category, adjust the grayscale pixel values ​​of the second grayscale histogram of the adjusted second scene image;

[0204] 8. When the adjustment differences between multiple adjusted second grayscale histograms and the second grayscale histograms before adjustment are less than the preset difference, it is determined that the adjustment of the image acquisition device is completed; when the adjustment difference between a certain adjusted second grayscale histogram and the second grayscale histogram before adjustment is not less than the preset difference, the corresponding adjusted second scene image is used as the scene image to be fine-tuned, and an objective function is constructed for the scene image to be fine-tuned to iteratively update the optimal value of the Gamma curve of the corresponding category until it is determined that the adjustment of the image acquisition device is completed.

[0205] The present application also provides an image optimization device, referring to Figure 6 , shows a structural block diagram of an image optimization device provided in an embodiment of the present application, which may specifically include the following modules:

[0206] The first scene image classification module 601 is used to collect a plurality of first scene images of different scenes using a comparison machine, and classify the plurality of first scene images according to first grayscale histograms of the plurality of first scene images to obtain first scene images of different categories;

[0207] A parameter determination module 602 is used to determine the optimal value of the gamma curve and the average grayscale histogram of the first scene images of different categories in the comparison machine;

[0208] A parameter acquisition module 603 is used to respectively acquire a plurality of second scene images matching the plurality of first scene images using an image acquisition device, and acquire an optimal value of a gamma curve of a corresponding category and an average grayscale histogram of the corresponding category from the comparison machine;

[0209] The second scene image adjustment module 604 is used to adjust the plurality of second scene images in the image acquisition device according to the optimal value of the gamma curve of the corresponding category to obtain a plurality of adjusted second scene images;

[0210] A second grayscale histogram adjustment module 605 is used to adjust the second grayscale histograms of the plurality of adjusted second scene images in the image acquisition device according to the average grayscale histograms of the corresponding categories, to obtain a plurality of adjusted second grayscale histograms;

[0211] The verification module 606 is used to determine that the adjustment of the image acquisition device is completed when the adjustment differences between the multiple adjusted second grayscale histograms and the second grayscale histograms before adjustment are less than a preset difference, so that the adjusted image acquisition device adopts the optimal value of the Gamma curve to optimize the acquired image accordingly.

[0212] In an optional embodiment of the present application, the first scene image classification module 601 may include:

[0213] A first grayscale histogram calculation submodule is used to calculate, in the comparison machine, first grayscale histograms corresponding to the plurality of first scene images respectively; the first grayscale histogram represents the relationship between the frequency of occurrence of each grayscale pixel value in the first scene image and the grayscale level;

[0214] The first scene image classification submodule is used in the comparison machine to classify the two first scene images into the same category if the similarity between the first grayscale histograms corresponding to the two first scene images exceeds a preset percentage; each category includes the first scene images of at least one scene.

[0215] In an optional embodiment of the present application, each category includes a plurality of first grayscale histograms, and the parameter determination module 602 may include:

[0216] The average grayscale histogram calculation submodule is used to superimpose and average multiple first grayscale histograms in the same category in the comparison machine to obtain the average grayscale histogram of the first scene image of the different category.

[0217] In an optional embodiment of the present application, the parameter determination module 602 may include:

[0218] A Gamma curve response value obtaining submodule, used for integrating the average grayscale histogram according to the grayscale pixel values ​​in the comparison machine to obtain the Gamma curve response values ​​of the first scene images of different categories;

[0219] A first Gamma curve standard value acquisition submodule, used to acquire a first Gamma curve standard value of the comparison machine;

[0220] The Gamma curve optimal value obtaining submodule is used to use the first Gamma curve standard value in the comparison machine to uniformly calculate the Gamma curve response values ​​respectively to obtain the Gamma curve optimal values ​​of the first scene images of different categories.

[0221] In an optional embodiment of the present application, the parameter acquisition module 603 may include:

[0222] A first scene image shooting attribute determination submodule, used to respectively determine the shooting attributes of the plurality of first scene images; the shooting attributes include shooting time and shooting scene;

[0223] The second scene image acquisition submodule is used to use an image acquisition device to respectively acquire a plurality of second scene images matching the shooting attributes of the plurality of first scene images based on the shooting time and the shooting scene.

[0224] In an optional embodiment of the present application, the second scene image adjustment module 604 may include:

[0225] A second Gamma curve standard value acquisition submodule, used to acquire a second Gamma curve standard value of the image acquisition device;

[0226] A second scene image inverse transformation submodule, configured to, in the image acquisition device, use the second Gamma curve standard value to perform inverse transformation calculations on the plurality of second scene images respectively, to obtain a plurality of inverse transformed second scene images;

[0227] The second scene image adjustment submodule is used to adjust the grayscale pixel values ​​of the multiple inverse transformed second scene images in the image acquisition device according to the optimal value of the Gamma curve of the corresponding category, so as to obtain multiple adjusted second scene images.

[0228] In an optional embodiment of the present application, the first Gamma curve standard value is obtained by calculating the standard reflectivity of the standard grayscale chart captured by the comparator, and the second Gamma curve standard value is obtained by calculating the standard reflectivity of the standard grayscale chart captured by the image acquisition device.

[0229] In an optional embodiment of the present application, the Gamma curve optimal value obtaining submodule may include:

[0230] a reflectivity difference calculation unit, configured to calculate, in the comparator, the reflectivity difference between the first scene image of each category and the standard grayscale chart according to the gamma curve response value and the first gamma curve standard value, so as to obtain reflectivity differences of different categories;

[0231] A reflectivity difference uniformity unit, used to uniformly calculate the reflectivity differences in the comparator according to the image height, image width and the grayscale pixel values ​​of the first scene image, to obtain the uniform reflectivity differences of different categories;

[0232] A gamma curve compensation value obtaining unit, configured to calculate, in the comparator, the gamma curve compensation values ​​of the first scene images of the different categories respectively according to the reflectivity differences of the different categories after the uniformization;

[0233] a gamma curve average value obtaining unit, configured to add the gamma curve compensation value and the first gamma curve standard value in the contrast machine to obtain the gamma curve average values ​​of the first scene images of different categories;

[0234] The Gamma curve optimal value obtaining unit is used to perform fitting calculation on the Gamma curve uniform value in the comparison machine to obtain the Gamma curve optimal values ​​of the first scene images of different categories; each category includes an optimal Gamma curve value.

[0235] In an optional embodiment of the present application, the second grayscale histogram adjustment module 605 may include:

[0236] A second grayscale histogram calculation submodule is used to calculate, in the image acquisition device, second grayscale histograms corresponding to the plurality of adjusted second scene images respectively; the second grayscale histogram represents the relationship between the frequency of occurrence of each grayscale pixel value in the adjusted second scene image and the grayscale level;

[0237] The second grayscale histogram adjustment submodule is used to adjust the grayscale pixel values ​​of the second grayscale histograms of the multiple adjusted second scene images in the image acquisition device according to the average grayscale histogram of the corresponding category, so as to obtain multiple adjusted second grayscale histograms.

[0238] In an optional embodiment of the present application, the device may further include:

[0239] A module for determining a scene image to be fine-tuned, configured to, when an adjustment difference between a second grayscale histogram after adjustment and a second grayscale histogram before adjustment is not less than a preset difference value, use the corresponding adjusted second scene image as the scene image to be fine-tuned;

[0240] An objective function construction module, used to construct an objective function for the scene image to be fine-tuned by using the adjusted second grayscale histogram and the adjusted second grayscale histogram;

[0241] The gamma curve optimal value iterative update module is used to iteratively calculate the objective function to iteratively update the gamma curve optimal value of the corresponding category, and use the updated gamma curve optimal value to adjust the scene image to be fine-tuned until it is determined that the adjustment of the image acquisition device is completed, so that the adjusted image acquisition device uses the updated gamma curve optimal value to optimize the acquired image accordingly.

[0242] In an optional embodiment of the present application, the Gamma curve optimal value iterative update module may include:

[0243] A fine-tuning factor acquisition submodule is used to obtain the fine-tuning factor corresponding to each grayscale pixel value in each iterative operation;

[0244] A Gamma curve optimal value updating submodule, used to update the optimal value of the Gamma curve of the corresponding category by using the fine-tuning factor corresponding to each grayscale pixel value in each iterative operation;

[0245] In an optional embodiment of the present application, the Gamma curve optimal value iterative update module may include:

[0246] A minimum objective function value determination submodule is used to determine the minimum objective function value when the maximum number of iterative operations is reached; the objective function value represents the degree of fine-tuning in each iterative operation;

[0247] An updated Gamma curve optimal value acquisition submodule is used to obtain the updated Gamma curve optimal value corresponding to the minimum objective function value;

[0248] The scene image to be fine-tuned adjustment submodule is used to adjust the scene image to be fine-tuned in the image acquisition device according to the corresponding updated optimal value of the Gamma curve to determine that the adjustment of the image acquisition device is completed.

[0249] To summarize, in the technical solution provided in the embodiments of the present application, on the one hand, for the first scene images of different scenes captured by the comparator, by taking the first grayscale histogram as the classification basis, the first scene images are classified to obtain first scene images of different categories, and then the gamma curves that are most suitable for the first scene images of various categories are determined respectively, thereby avoiding the situation where one gamma curve is inappropriate for the same scene due to lighting and color temperature issues, and can also adapt to more shooting scenes under limited gamma curve conditions.

[0250] On the other hand, by using an image acquisition device to acquire a second scene image that matches the first scene image, a gamma curve of a corresponding category can be obtained from a comparator, and then the gamma curve of the corresponding category is used to automatically adjust the second scene image of the image acquisition device, without the need for manual subjective adjustment of the control points of the gamma curve of the second scene image. This not only avoids the poor controllability of the manual interactive gamma curve adjustment method, but also avoids non-convergence due to subjective factors during the gamma curve adjustment process.

[0251] On the other hand, since the calculation / adjustment process of the first grayscale histogram, the second scene image, the second grayscale histogram, the image to be fine-tuned, and the second grayscale histogram corresponding to the image to be fine-tuned are all based on the grayscale pixel value g∈[0,255] as the calculation / adjustment dimension, not only can the optimal Gamma curve be obtained, but also the adjustment can be made more delicate.

[0252] On the other hand, after adjusting the second scene image using the optimal value of the Gamma curve of the corresponding category, the second grayscale histogram of the adjusted second scene image is adjusted using the average grayscale histogram of the corresponding category, and the image quality of the adjusted second scene image is verified to be up to standard by judging whether the adjustment difference between the adjusted second grayscale histogram and the second grayscale histogram before adjustment is less than a preset difference. If the verification fails, the optimal value of the Gamma curve can be iteratively updated by constructing an objective function to obtain the optimal value of the Gamma curve that is most suitable for the second scene image, thereby ensuring that the image quality of the adjusted / fine-tuned second scene image is up to standard, so that the adjusted image acquisition device adopts the most suitable optimal value of the Gamma curve to optimize the acquired image accordingly.

[0253] It should be noted that the device provided in the above embodiment, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0254] The embodiment of the present application also provides a computer device, the computer device includes a processor and a memory, the memory stores at least one instruction, at least one program, code set or instruction set. The at least one instruction, at least one program, code set or instruction set is configured to be executed by one or more processors to implement the above-mentioned image optimization method.

[0255] An embodiment of the present application also provides a computer-readable storage medium, in which at least one instruction, at least one program, a code set or an instruction set is stored. When the at least one instruction, the at least one program, the code set or the instruction set is executed by a processor of a computer device, the above-mentioned image optimization method is implemented.

[0256] Optionally, the computer-readable storage medium may be a ROM, RAM, CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.

[0257] The embodiment of the present application also provides a computer program product, which, when executed, is used to implement the above-mentioned image optimization method.

[0258] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.

[0259] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. An image optimization method, characterized in that: The method comprises: Using a comparison machine to collect a plurality of first scene images of different scenes, and classifying the plurality of first scene images according to first grayscale histograms of the plurality of first scene images to obtain first scene images of different categories; In the comparison machine, respectively determining the optimal value of the gamma curve and the average grayscale histogram of the first scene images of different categories; Using an image acquisition device to respectively acquire a plurality of second scene images matching the plurality of first scene images, and obtaining from the comparison machine the optimal value of the gamma curve of the corresponding category and the average grayscale histogram of the corresponding category; In the image acquisition device, the plurality of second scene images are adjusted respectively according to the optimal values ​​of the gamma curves of the corresponding categories to obtain a plurality of adjusted second scene images; In the image acquisition device, adjusting the second grayscale histograms of the plurality of adjusted second scene images respectively according to the average grayscale histograms of the corresponding categories to obtain a plurality of adjusted second grayscale histograms; When the adjustment differences between the multiple adjusted second grayscale histograms and the second grayscale histograms before adjustment are less than a preset difference, it is determined that the adjustment of the image acquisition device is completed, so that the adjusted image acquisition device adopts the optimal value of the Gamma curve to optimize the acquired image accordingly.

2. The method according to claim 1, characterized in that The classifying the plurality of first scene images according to the first grayscale histograms of the plurality of first scene images comprises: In the comparison machine, first grayscale histograms corresponding to the plurality of first scene images are respectively calculated; the first grayscale histogram represents the relationship between the frequency of occurrence of each grayscale pixel value in the first scene image and the grayscale level; In the comparison machine, if the similarity between the first grayscale histograms corresponding to the two first scene images exceeds a preset percentage, the two first scene images are classified into the same category; each category includes first scene images of at least one scene; Each category includes a plurality of first grayscale histograms, and the step of respectively determining the average grayscale histograms of the first scene images of different categories includes: In the comparison machine, a plurality of first grayscale histograms in the same category are superimposed and averaged to obtain an average grayscale histogram of the first scene images of different categories.

3. The method according to claim 2, characterized in that The step of respectively determining the optimal values ​​of the gamma curves of the first scene images of different categories comprises: In the comparison machine, the average grayscale histogram is integrated according to the grayscale pixel values ​​to obtain the gamma curve response values ​​of the first scene images of different categories; Obtaining a first gamma curve standard value of the comparison machine; In the comparator, the first Gamma curve standard value is adopted to uniformly calculate the Gamma curve response values ​​respectively, so as to obtain the optimal Gamma curve values ​​of the first scene images of different categories.

4. The method according to claim 1, characterized in that: The using an image acquisition device to respectively acquire a plurality of second scene images matching the plurality of first scene images comprises: Determine the shooting attributes of the plurality of first scene images respectively; the shooting attributes include shooting time and shooting scene; Based on the shooting time and the shooting scene, an image acquisition device is used to respectively acquire a plurality of second scene images that match the shooting attributes of the plurality of first scene images.

5. The method according to claim 3, characterized in that: The method of adjusting the plurality of second scene images in the image acquisition device according to the optimal values ​​of the gamma curves of the corresponding categories to obtain a plurality of adjusted second scene images includes: Obtaining a second Gamma curve standard value of the image acquisition device; In the image acquisition device, using the second Gamma curve standard value, respectively performing inverse transformation calculations on the plurality of second scene images to obtain a plurality of inverse transformed second scene images; In the image acquisition device, the grayscale pixel values ​​of the plurality of inverse-transformed second scene images are adjusted according to the optimal value of the Gamma curve of the corresponding category, so as to obtain a plurality of adjusted second scene images.

6. The method according to claim 5, characterized in that The first Gamma curve standard value is obtained by calculating the standard reflectivity of the standard grayscale chart collected by the comparator, and the second Gamma curve standard value is obtained by calculating the standard reflectivity of the standard grayscale chart collected by the image acquisition device.

7. The method according to claim 6, characterized in that The method of using the first Gamma curve standard value in the comparison machine to uniformly calculate the Gamma curve response values ​​to obtain the optimal Gamma curve values ​​of the first scene images of different categories includes: In the comparator, the reflectance difference between the first scene image of each category and the standard grayscale chart is calculated according to the gamma curve response value and the first gamma curve standard value, so as to obtain the reflectance difference of different categories; In the comparator, the reflectivity differences are uniformly calculated according to the image height, image width and the grayscale pixel values ​​of the first scene image to obtain the uniform reflectivity differences of different categories; In the comparator, the gamma curve compensation values ​​of the first scene images of the different categories are respectively calculated according to the reflectivity differences of the different categories after the uniformization; In the comparison machine, the gamma curve compensation value is added to the first gamma curve standard value to obtain the gamma curve average value of the first scene images of different categories; In the comparison machine, the Gamma curve uniform values ​​are fitted and calculated respectively to obtain the optimal Gamma curve values ​​of the first scene images of different categories; each category includes an optimal Gamma curve value.

8. The method according to claim 1, characterized in that In the image acquisition device, adjusting the second grayscale histograms of the plurality of adjusted second scene images respectively according to the average grayscale histograms of the corresponding categories to obtain a plurality of adjusted second grayscale histograms includes: In the image acquisition device, second grayscale histograms corresponding to the plurality of adjusted second scene images are respectively calculated; the second grayscale histograms represent the relationship between the frequency of occurrence of each grayscale pixel value in the adjusted second scene image and the grayscale level; In the image acquisition device, each grayscale pixel value of the second grayscale histogram of the plurality of adjusted second scene images is adjusted according to the average grayscale histogram of the corresponding category, so as to obtain a plurality of adjusted second grayscale histograms.

9. The method according to claim 1, characterized in that: The method further comprises: When an adjustment difference between a second grayscale histogram after adjustment and a second grayscale histogram before adjustment is not less than a preset difference value, taking the corresponding adjusted second scene image as the scene image to be fine-tuned; Using the adjusted second grayscale histogram and the adjusted second grayscale histogram to construct an objective function for the scene image to be fine-tuned; The objective function is iteratively calculated to iteratively update the optimal value of the Gamma curve of the corresponding category, and the updated optimal value of the Gamma curve is used to adjust the scene image to be fine-tuned, until it is determined that the adjustment of the image acquisition device is completed, so that the adjusted image acquisition device uses the updated optimal value of the Gamma curve to optimize the acquired image accordingly.

10. The method according to claim 9, characterized in that The iterative operation of the objective function to iteratively update the optimal value of the Gamma curve of the corresponding category includes: In each iterative operation, the fine-tuning factor corresponding to each grayscale pixel value is obtained; In each iterative operation, the fine-tuning factor corresponding to each grayscale pixel value is used to update the optimal value of the gamma curve of the corresponding category; The step of using the updated optimal value of the gamma curve to fine-tune the scene image to be fine-tuned until it is determined that the adjustment of the image acquisition device is completed includes: When the maximum number of iterative operations is reached, a minimum objective function value is determined; the objective function value represents the degree of fine-tuning in each iterative operation; Obtain the updated optimal value of the Gamma curve corresponding to the minimum objective function value; In the image acquisition device, the scene image to be fine-tuned is adjusted according to the corresponding updated optimal value of the Gamma curve to determine that the adjustment of the image acquisition device is completed.

11. An image optimization device, characterized in that: The device comprises: A first scene image classification module, used to collect a plurality of first scene images of different scenes using a comparison machine, and classify the plurality of first scene images according to first grayscale histograms of the plurality of first scene images to obtain first scene images of different categories; A parameter determination module, used for determining the optimal value of the gamma curve and the average grayscale histogram of the first scene images of different categories in the comparison machine; A parameter acquisition module, used to respectively acquire a plurality of second scene images matching the plurality of first scene images using an image acquisition device, and to acquire an optimal value of a gamma curve of a corresponding category and an average grayscale histogram of the corresponding category from the comparison machine; A second scene image adjustment module, configured to adjust the plurality of second scene images in the image acquisition device according to the optimal values ​​of the gamma curves of the corresponding categories, to obtain a plurality of adjusted second scene images; A second grayscale histogram adjustment module is used to adjust the second grayscale histograms of the plurality of adjusted second scene images in the image acquisition device according to the average grayscale histograms of the corresponding categories, so as to obtain a plurality of adjusted second grayscale histograms; The verification module is used to determine that the adjustment of the image acquisition device is completed when the adjustment differences between the multiple adjusted second grayscale histograms and the second grayscale histograms before adjustment are less than a preset difference, so that the adjusted image acquisition device adopts the optimal value of the Gamma curve to optimize the acquired image accordingly.

12. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Image processing method and system thereof

    CN103778599A

  • An image enhancement method based on gamma correction of infrared images

    CN106342330B