Weight adjustment methods, devices, storage media, and electronic devices
Patent Information
- Application Number
- CN202210441573.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-25
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2042-04-25
AI Technical Summary
[0006]本发明实施例提供了一种权重的调整方法、装置、存储介质及电子装置,以至少解决相关技术中存在的得到的评价结果准确率低的问题
[0011] This invention scores a target image from multiple preset dimensions, determines a dimension score for each preset dimension based on the scoring results and the weights of each preset dimension, and determines a deviation score between the target image and a reference image. Based on the dimension scores and deviation scores, a comprehensive target score for the target image is determined. If the comprehensive target score does not meet a first condition, the following operations are repeated until a newly determined comprehensive target score meets the first condition: adjusting the dimension weights of the target dimensions included in the multiple preset dimensions, re-determining the dimension scores based on the scoring results and the adjusted dimension weights of the target dimensions, and re-determining the comprehensive target score based on the newly determined dimension scores and deviation scores. Since it is possible to determine whether the comprehensive target score meets the first condition after it is determined, and if it does not meet the first condition, the dimension weights of the target dimensions are adjusted until the newly determined comprehensive target score meets the first condition, this invention solves the problem of low accuracy in related technologies, thereby improving the accuracy of the evaluation results.
Smart Images

Figure CN114693566B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of image processing, and more specifically, to a method, apparatus, storage medium, and electronic device for adjusting weights. Background Technology
[0002] Automated debugging technology utilizes specialized image processing logic, such as sharpening, brightness enhancement, and noise reduction, combined with the parameter interfaces of the ISP chip package to adjust parameters and achieve the desired image processing effect. Automated evaluation technology performs specialized image processing logic analysis based on the processed image data to determine the effect and achieve a multi-dimensional evaluation that aligns with human visual perception.
[0003] In related technologies, the evaluation of images through automated evaluation techniques can only obtain evaluation results, and cannot adjust the evaluation results when they do not meet the conditions.
[0004] This indicates that the relevant technologies suffer from low accuracy in obtaining evaluation results.
[0005] There is currently no effective solution to the aforementioned problems in the relevant technologies. Summary of the Invention
[0006] This invention provides a method, apparatus, storage medium, and electronic device for adjusting weights, in order to at least solve the problem of low accuracy of evaluation results in related technologies.
[0007] According to an embodiment of the present invention, a weight adjustment method is provided, comprising: scoring a target image from multiple preset dimensions, and determining a dimension score corresponding to each preset dimension based on the scoring results and the weight of each preset dimension; and determining a deviation score between the target image and a reference image; determining a target comprehensive score of the target image based on the dimension scores and the deviation scores; and repeating the following operations if the target comprehensive score does not meet a first condition, until the re-determined target comprehensive score meets the first condition: adjusting the dimension weights of the target dimensions included in the multiple preset dimensions, and re-determining the dimension scores based on the scoring results and the adjusted dimension weights of the target dimensions; and re-determining the target comprehensive score based on the re-determined dimension scores and the deviation scores.
[0008] According to another embodiment of the present invention, a weight adjustment device is provided, comprising: a scoring module, configured to score a target image from multiple preset dimensions, and determine a dimension score corresponding to each preset dimension based on the scoring results and the weight of each preset dimension, and determine a deviation score between the target image and a reference image; a determining module, configured to determine a target comprehensive score of the target image based on the dimension scores and the deviation scores; and an adjustment module, configured to repeatedly perform the following operations when the target comprehensive score does not meet a first condition, until the re-determined target comprehensive score meets the first condition: adjusting the dimension weights of the target dimensions included in the multiple preset dimensions, and re-determining the dimension scores based on the scoring results and the adjusted dimension weights of the target dimensions, and re-determining the target comprehensive score based on the re-determined dimension scores and the deviation scores.
[0009] According to yet another embodiment of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program, when executed by a processor, implements the steps of the method described in any of the preceding claims.
[0010] According to yet another embodiment of the present invention, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0011] This invention scores a target image from multiple preset dimensions, determines a dimension score for each preset dimension based on the scoring results and the weights of each preset dimension, and determines a deviation score between the target image and a reference image. Based on the dimension scores and deviation scores, a comprehensive target score for the target image is determined. If the comprehensive target score does not meet a first condition, the following operations are repeated until a newly determined comprehensive target score meets the first condition: adjusting the dimension weights of the target dimensions included in the multiple preset dimensions, re-determining the dimension scores based on the scoring results and the adjusted dimension weights of the target dimensions, and re-determining the comprehensive target score based on the newly determined dimension scores and deviation scores. Since it is possible to determine whether the comprehensive target score meets the first condition after it is determined, and if it does not meet the first condition, the dimension weights of the target dimensions are adjusted until the newly determined comprehensive target score meets the first condition, this invention solves the problem of low accuracy in related technologies, thereby improving the accuracy of the evaluation results. Attached Figure Description
[0012] Figure 1This is a hardware structure block diagram of a mobile terminal for a weight adjustment method according to an embodiment of the present invention.
[0013] Figure 2 This is a flowchart of a weight adjustment method according to an embodiment of the present invention;
[0014] Figure 3 This is the correspondence between open parameters and multi-dimensional images according to an exemplary embodiment of the present invention;
[0015] Figure 4 This is a schematic diagram of the initial model training process according to an exemplary embodiment of the present invention;
[0016] Figure 5 This is a schematic diagram of the process for determining a target comprehensive score according to an exemplary embodiment of the present invention;
[0017] Figure 6 This is a structural block diagram of a weight adjustment device according to an embodiment of the present invention. Detailed Implementation
[0018] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings and examples.
[0019] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0020] The methods and embodiments provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal for a weight adjustment method according to an embodiment of the present invention. For example... Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0021] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the weight adjustment method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0022] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0023] This embodiment provides a method for adjusting weights. Figure 2 This is a flowchart of a weight adjustment method according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps:
[0024] Step S202: The target image is scored from multiple preset dimensions, and the dimension score corresponding to each preset dimension is determined based on the scoring results and the weight of each preset dimension. Also, the deviation score between the target image and the reference image is determined.
[0025] Step S204: Determine the target comprehensive score of the target image based on the dimensional score and the deviation score;
[0026] Step S206: If the target comprehensive score does not meet the first condition, repeat the following operations until the re-determined target comprehensive score meets the first condition: adjust the dimension weights of the target dimensions included in the multiple preset dimensions, and redetermine the dimension score based on the score result and the adjusted dimension weights of the target dimensions, and redetermine the target comprehensive score based on the re-determined dimension score and the deviation score.
[0027] In the above embodiments, the target image can be an image captured by a camera device. The target image can be a single image or multiple images. When there are multiple target images, the scenes in the different target images are different, that is, the multiple target images are images obtained by shooting different scenes separately. After the target image is captured, the target image can be scored from multiple preset dimensions. The multiple preset dimensions can be predetermined dimensions. The preset dimensions for evaluating the target image can be found in Table 1.
[0028] Table 1
[0029]
[0030] In the above embodiments, an evaluation network can be used to evaluate the target image to determine its overall target score. The evaluation network performs multi-dimensional and multi-scene scoring based on the image, including dimensional scoring and bias scoring. Taking sharpness as an example, after receiving the target image, the evaluation network analyzes the gradient information of different brightness regions, different frequency domains, different color regions, different edge sizes, black-and-white borders, and grid patterns, summarizing these into a score, thus obtaining the score result for each preset dimension.
[0031] In the above embodiments, after determining the score result for each preset dimension, that is, after the scores for each preset dimension are summarized, the dimension score for each preset dimension can be determined according to the weight of each preset dimension. Then, by combining all the test scenarios, the comprehensive score for the project can be obtained. After determining the dimension score for each preset dimension, the scores for multiple dimensions can be added together to determine the comprehensive score.
[0032] In the above embodiments, a reference image corresponding to the scene in the target image can be determined based on the scene in the target image. The target image and the reference image are compared and analyzed to obtain the deviation score of the current scene relative to the reference image. Then, by combining all the test scenes, the comprehensive deviation score of this item relative to the reference image can be obtained.
[0033] In the above embodiments, after determining the deviation score and the dimensional score, the target comprehensive score can be determined based on the weights corresponding to the deviation score and the dimensional scores, as well as the deviation score and the dimensional score. For example, the target comprehensive score can be determined by summing the product of the deviation score and its corresponding weight and the product of the dimensional score and its corresponding weight.
[0034] In the above embodiments, a comprehensive score threshold for the target comprehensive score can be preset. If the deviation between the target comprehensive score and the comprehensive score threshold does not exceed a predetermined deviation, the target comprehensive score is determined to meet the first condition; otherwise, the target comprehensive score is determined not to meet the first condition. The comprehensive score threshold and the predetermined deviation can be custom values, and this invention does not limit them.
[0035] In the above embodiments, the evaluation network may include multiple modules, such as an automated debugging module and an adaptive scene dynamic weight adjustment module. The automated debugging module can guide debugging based on the scores of each module of the evaluation network (as shown in Table 1 above). Before project A is launched, scoring targets are set for each module in each scene, as well as the comprehensive deviation score between the module and the reference image. When the evaluation network scores the data after debugging by the automated debugging module, if the difference from the pre-set scoring target is large (a deviation rate of 5% is set for the score; if it is more than 5% below the scoring target, it is considered unqualified, i.e., the difference is large), the scoring network will feed back the score to the automated debugging module, notifying it to continue automatic debugging, thus realizing the automatic feedback function.
[0036] In the above embodiments, the adaptive scene dynamic weight adjustment module can dynamically adjust the evaluation dimension weights corresponding to each scene based on scene characteristics to adapt to scene changes and perform dynamic optimization. The adaptive scene dynamic weight adjustment module may include an automatic dynamic range calculation module, an automatic color richness calculation module, an automatic texture detail calculation module, an automatic calculation module for different brightness environments, and an automatic calculation module for different target motion strengths. After determining the target comprehensive score, if the target comprehensive score does not meet the first condition, the adaptive scene dynamic weight adjustment module will automatically adjust the dimension weights of the target dimension. The target dimension can be the dimension corresponding to a sub-module included in the adaptive scene dynamic weight adjustment module. Different sub-modules can correspond to one or more dimensions. Adjusting the dimension weights of the target dimension is equivalent to adjusting the weights corresponding to the sub-modules, thus obtaining the final open parameters corresponding to that module. The correspondence between the open parameters and the multi-dimensional image can be found in the appendix. Figure 3 ,like Figure 3 As shown, the ISP chip comes with a series of open parameters. These open parameters are ultimately matched many-to-many with the multi-dimensional concerns in Table 1. Different open parameters will have different effects. They are adjusted in a targeted manner according to the specific differences given by the evaluation network. For example, if the evaluation network shows that there is more noise and the score is lower during the day, the automatic debugging module will adjust parameters 1 and 2, because parameters 1 and 2 will also affect the daytime clarity. After the adjustment is completed, the module will also confirm the impact on daytime clarity.
[0037] Optionally, the entity performing the above steps may be a background processor, such as an ISP chip, or other devices with similar processing capabilities. It may also be a machine that integrates at least an image acquisition device and a data processing device. The image acquisition device may include a camera or other image acquisition module, and the data processing device may include a computer, a mobile phone, or other terminal, but is not limited thereto.
[0038] This invention scores a target image from multiple preset dimensions, determines a dimension score for each preset dimension based on the scoring results and the weight of each preset dimension, and determines a deviation score between the target image and a reference image. Based on the dimension scores and deviation scores, a comprehensive target score for the target image is determined. If the comprehensive target score does not meet a first condition, the following operations are repeated until a newly determined comprehensive target score meets the first condition: adjusting the dimension weights of the target dimensions included in the multiple preset dimensions, re-determining the dimension scores based on the scoring results and the adjusted dimension weights of the target dimensions, and re-determining the comprehensive target score based on the newly determined dimension scores and deviation scores. Since it is possible to determine whether the comprehensive target score meets the first condition after it is determined, and adjusts the dimension weights of the target dimensions if the first condition is not met, until the newly determined comprehensive target score meets the first condition, this invention solves the problem of low accuracy in related technologies, thereby improving the accuracy of the evaluation results.
[0039] In an exemplary embodiment, adjusting the dimensional weights of a target dimension included in a plurality of preset dimensions includes: determining the dynamic range of the target image; if the dynamic range does not satisfy a second condition, determining that the target dimension includes the luminance dimension of the target image; and adjusting the weight of the luminance dimension. In this embodiment, the target dimension to be adjusted can be determined from a plurality of preset dimensions, and after determining the target dimension, its dimensional weights are adjusted. For example, the dynamic range of the target image can be determined, and if the dynamic range does not satisfy the second condition, the target dimension is determined to include the luminance dimension of the target image. Here, dynamic range refers to the contrast between light and dark areas in the image; the greater the contrast, the larger the dynamic range. The second condition can be that the dynamic range is greater than a dynamic range threshold, where the dynamic range threshold can be a predetermined threshold, and this invention does not limit this.
[0040] In the above embodiments, when the dynamic range is too wide, the dynamic range parameter can be dynamically adjusted to narrow the scene's dynamic range performance, and vice versa. The weight of the dynamic range module will be increased, and the detail performance of bright and dark areas needs extra attention, with a greater weight given to the clarity of both bright and dark areas.
[0041] In an exemplary embodiment, adjusting the weight of the brightness dimension includes: dividing the target image into multiple sub-regions; determining a first average value of the brightness values of the pixels included in each sub-region; determining a second average value of the brightness values of each pixel included in the target image; determining a first sub-average value where the average value included in the first average value is greater than or equal to the second average value, and a second sub-average value where the average value included in the first average value is less than the second average value; and determining the weight of the brightness dimension based on the first sub-average value and the second sub-average value. In this embodiment, when adjusting the weight of the brightness dimension, the average value of the entire image's Y can be denoted as avgY, i.e., the second average value. Assuming the target image is divided into 15*15 blocks, the original Y (originY) data of each block can be used as the first average value. The first average value is compared with the second average value, and two new sets of data are generated according to their size relationship. Set A represents data less than the average value avgY, i.e., the second sub-average value, and set B represents data greater than or equal to the average value avgY, i.e., the first sub-average value. Set A data can be denoted as convertP, and set B data can be denoted as convertN. Data points less than the mean (avgY) can be set to 0, and data points greater than or equal to the mean (avg) can be set to 1. Group A data is denoted as convertP, and group B data as convertN. The number of non-zero data points in group A is denoted as norNumP, and the number of non-zero data points in group B is denoted as norNumN. The weights of the brightness dimension are determined based on the first and second sub-means.
[0042] In an exemplary embodiment, determining the weight of the brightness dimension based on the first sub-average value and the second sub-average value includes: determining the product of the number of the second sub-average values and a first constant; determining a first ratio of the number of the first sub-average values to the product; determining a first interval corresponding to the brightness, and a first weight coefficient corresponding to a first endpoint value and a second weight coefficient corresponding to a second endpoint value of the first interval, wherein the first endpoint value is less than the second endpoint value; when the first ratio is less than or equal to the first endpoint value, determining the product of the current weight of the brightness and the first weight coefficient as the weight of the brightness dimension; when the first ratio is greater than or equal to the second endpoint value, determining the product of the current weight of the brightness and the second weight coefficient as the weight of the brightness dimension; when the first ratio is within the first interval, interpolating the values in the first interval based on the first weight and the second weight to determine a third weight coefficient corresponding to the ratio, and determining the product of the current weight of the brightness and the third weight coefficient as the weight of the brightness dimension. In this embodiment, it can be based on the formula... The dynamic range of the target image, i.e., the first ratio, is determined, where the first constant can be 1024. Using this calculation formula, scenes with different backlight levels were tested, and a set of data was obtained, as shown in Table 2.
[0043] Table 2
[0044]
[0045] In the above embodiments, the data levels in Table 2 characterize the dynamic range of the image. Based on the dynamically calculated dynamic range, a threshold range corresponding to the brightness can be set, i.e., the first range is [2.5 5.5] (it should be noted that this range is only an illustrative example, and the endpoint values of the first range can also take other values, which is not limited in this invention). Based on the default weights, the weights of the dynamic range module, the dark area module, and the brightness detail module can be adjusted according to the calculated dormain. 2.5 is set with a weight add of 0 times, 5.5 is set with a weight add of 3 times, and the intermediate values are interpolated. This module can dynamically adjust the weights of the corresponding focus modules according to the dynamic range of the environment. That is, when the first ratio is less than or equal to the first endpoint value (e.g., 2.5, or other values, which are not limited in this invention), the product of the current weight of brightness and the first weight coefficient (e.g., 0, or other values, which are not limited in this invention) is determined as the weight of the brightness dimension; when the first ratio is greater than or equal to the second endpoint value, the product of the current weight of brightness and the second weight coefficient (e.g., 3, or other values, which are not limited in this invention) is determined as the weight of the brightness dimension; when the first ratio is within the first interval, the values in the first interval are interpolated based on the first weight and the second weight to determine the third weight coefficient corresponding to the ratio, and the product of the current weight of brightness and the third weight coefficient is determined as the weight of the brightness dimension.
[0046] In an exemplary embodiment, adjusting the dimensional weight of a target dimension included in a plurality of preset dimensions includes: determining that the target dimension includes a color saturation dimension when the number of colors included in the target image is greater than a predetermined threshold; and adjusting the weight of the color saturation dimension. In this embodiment, for scenes with rich colors, it is necessary to highlight colors and emphasize color representation, while also paying extra attention to color noise and color cast issues, such as color saturation, color cast, and color noise. Therefore, when the number of colors included in the target image is greater than a predetermined threshold, the target dimension can be determined to be color saturation, and the weight of the color saturation dimension can be adjusted.
[0047] In an exemplary embodiment, adjusting the weight of the color saturation dimension includes: determining the color entropy of each channel of the target image to obtain multiple color entropies; determining the average value of the multiple color entropies; determining the value of the color saturation dimension based on the average value; and adjusting the weight of the color saturation dimension based on the value of the color saturation dimension. In this embodiment, when adjusting the weight of the color saturation dimension, data from the R, G, and B channels of the target image can be obtained separately, and image color entropy can be calculated. After determining multiple color entropies, the average value of the color entropies can be determined, denoted as avg. Then, the value of the color saturation dimension is determined based on the average value, and the weight is adjusted based on the value of the color saturation dimension.
[0048] In an exemplary embodiment, determining the value of the color saturation dimension based on the average value includes: determining the square of the difference between each color entropy included in a plurality of color entropies and the average value, obtaining a plurality of squares; determining the sum of the plurality of squares to obtain a first sum; and determining the arithmetic square root of the first sum as the value of the color saturation dimension. In this embodiment, It can represent the value of the color saturation dimension. colorFull represents the richness of color, that is, the color saturation dimension.
[0049] In an exemplary embodiment, determining the color entropy of each channel of the target image to obtain multiple color entropies includes: for each target channel, performing the following operations to obtain the color entropy of the target channel: determining the target channel value of each pixel in the target image in the target channel to obtain multiple target channel values; dividing the channel values into N orders; determining a first number of the multiple target channel values located in each sub-order, wherein the sub-order is any order included in the N orders; determining a first logarithm of the first number with a fourth constant as the base; determining the product of the first logarithm and the first number to obtain a first product corresponding to each sub-order; determining a second sum of the first products corresponding to all sub-orders; and determining the ratio of the second sum to a fifth constant as the color entropy. In this embodiment, when determining the color entropy, the calculation method can be various color component histograms, where p represents the distribution number of each order calculated from 255 order channel values. The color entropy value is confirmed by this calculation and can be represented as Rk, Gk, Bk.
[0050] In an exemplary embodiment, adjusting the weight of the color saturation dimension based on its value includes: determining a second interval corresponding to the value of the color saturation dimension, and a fourth weight coefficient and a fifth weight coefficient corresponding to the third endpoint value of the second interval, wherein the third endpoint value is less than the fourth endpoint value; when the value of the color saturation dimension is less than or equal to the third endpoint value, determining the weight of the color saturation dimension as the product of the current weight of the color saturation dimension and the fourth weight coefficient; when the value of the color saturation dimension is greater than or equal to the fourth endpoint value, determining the weight of the color saturation dimension as the product of the current weight of the color saturation dimension and the fifth weight coefficient; when the value of the color saturation temperature is within the second interval, interpolating the values in the second interval based on the fourth weight coefficient and the fifth weight coefficient to determine a sixth weight coefficient corresponding to the color saturation temperature, and determining the weight of the color saturation dimension as the product of the current weight of the color saturation dimension and the fifth weight coefficient. In this embodiment, for the color saturation dimension, color bias, and color noise weight, a threshold range is set, that is, the second range can be [2, 10]. If it is less than 2, the weight is set to add 0 times (corresponding to the fourth weight coefficient), and if it is greater than 10, the weight is set to add 3 times (corresponding to the fifth weight coefficient). Interpolation is performed on the intermediate values, and the weights of each focus module are dynamically adjusted according to different color richness scenarios.
[0051] In an exemplary embodiment, adjusting the dimensional weights of a target dimension included in a plurality of preset dimensions includes: when the target dimension includes a texture dimension, performing noise reduction processing on the target image to obtain a first image; subtracting the pixel values of corresponding pixels in the first image from those in the target image to obtain a second image; binarizing the second image to obtain a third image; and adjusting the weights of the texture dimension based on the third image. In this embodiment, when the scene in the target image is a scene with rich texture, extra attention needs to be paid to the mid-to-high frequency detail performance, and the weights of sharpening, black and white edges, and small and large edges will be increased. When adjusting the weights of the texture dimension, the target image can be denoised to obtain a first image, and the pixel values of the pixels in the first image can be subtracted from those of the corresponding pixels in the target image to obtain a second image. The second image can then be binarized to obtain a third image, and the weights of the texture dimension can be adjusted based on the third image.
[0052] In the above embodiment, the source raw data of the target image can be copied and processed through an independent ISP, acquiring data twice: once with temporal denoising disabled and once with the strongest temporal denoising enabled. Both sets of data are then filtered using the Sobel operator to remove low frequencies, and the data is binarized to obtain a third image. The weights of the texture dimension are then adjusted based on the third image.
[0053] In one exemplary embodiment, adjusting the weight of the texture dimension based on the third image includes: determining a second number of pixels with a pixel value of 1 in the third image; determining a second ratio between the second number and a third number of all pixels included in the third image; and adjusting the weight of the texture dimension based on the second ratio. In this embodiment, the second ratio of the number of pixels with data 1 to the total number of pixels in the third image can be determined, and the weight of the texture dimension can be adjusted according to the second ratio.
[0054] In an exemplary embodiment, adjusting the weight of the texture dimension based on the second ratio includes: determining a third interval corresponding to the texture dimension, and a seventh weight coefficient corresponding to the fifth endpoint value and an eighth weight coefficient corresponding to the sixth endpoint value of the third interval, wherein the fifth endpoint value is less than the sixth endpoint value; when the second ratio is less than or equal to the fifth endpoint value, determining the weight of the texture dimension by multiplying the current weight of the texture dimension by the seventh weight coefficient; when the second ratio is greater than or equal to the sixth endpoint value, determining the weight of the texture dimension by multiplying the current weight of the texture dimension by the eighth weight coefficient; when the second ratio is within the third interval, interpolating the value of the midpoint of the third interval based on the seventh weight coefficient and the eighth weight coefficient to determine a ninth weight coefficient corresponding to the second ratio, and determining the weight of the texture dimension by multiplying the current weight of the texture dimension by the ninth weight coefficient. In this embodiment, the third interval can be set to [0.6, 0.1]. The weights of the sharpening, black and white edges, small edges and large edges modules are set. If the weight is less than the threshold of 0.1, the weight is added by 0 times. If the weight is greater than 0.6, the weight is added by 3 times. Interpolation is performed on the intermediate values to dynamically adjust the weights of each focus module according to different texture scenes.
[0055] In an exemplary embodiment, adjusting the dimensional weights of a target dimension included in a plurality of preset dimensions includes: when the target dimension includes an exposure dimension, determining the shutter speed, aperture, and gain magnification of the image acquisition device acquiring the target image; determining a second product of the shutter speed, aperture, and gain magnification; determining a second logarithm of the second product with a sixth constant as the base; determining a third product of the second logarithm and a seventh constant; and adjusting the weight of the exposure dimension based on the third product. In this embodiment, the brightness module needs to be adaptively adjusted for different brightness environments. In high-brightness environments, color performance is emphasized, and the weight of color saturation in the brightness module is increased. In low-brightness environments, noise performance is emphasized, and the weights of static and dynamic noise and motion blur need to be increased. Shutter speed, aperture, and gain can be normalized to the same range and expressed in dB. Changes in exposure correspond to changes in the sensor's exposure line, which can be converted to dB. Gain can also be converted to dB, and the amount of light transmitted through the aperture corresponds to a change in aperture area. The second product of shutter speed, aperture, and gain can be determined. This second product can be expressed as a ratio, and the third product can be expressed as dB = 20 * log0 10 ratio. The sixth constant can be 10, and the seventh constant can be 20.
[0056] In an exemplary embodiment, adjusting the weight of the exposure dimension based on the third product includes: determining a fourth interval and a fifth interval corresponding to the exposure dimension, a tenth weight coefficient corresponding to the seventh endpoint value and an eleventh weight coefficient corresponding to the eighth endpoint value of the fourth interval, and a twelfth weight coefficient corresponding to the ninth endpoint value and a thirteenth weight coefficient corresponding to the tenth endpoint value of the fifth interval, wherein the seventh endpoint value is less than the eighth endpoint value, the eighth endpoint value is less than the ninth endpoint value, and the ninth endpoint value is less than the tenth endpoint value; when the third product is less than or equal to the seventh endpoint value, determining the product of the current weight of the color saturation of the target image and the tenth weight coefficient as the weight of the exposure dimension; when the third product is greater than or equal to the eighth endpoint value, determining the product of the current weight of the color saturation of the target image and the eleventh weight coefficient as the weight of the exposure dimension; when the third product is located in the fourth interval... Next, based on the tenth and eleventh weight coefficients, the values in the fourth interval are interpolated to determine the fourteenth weight coefficient corresponding to the color saturation. The product of the current weight of the color saturation and the fourteenth weight coefficient is determined as the weight of the exposure dimension. If the third product is less than the ninth endpoint value, the product of the current weight of the target image's motion blur and the twelfth weight coefficient is determined as the weight of the exposure dimension. If the third product is greater than the tenth endpoint value, the product of the current weight of the target image's motion blur and the thirteenth weight coefficient is determined as the weight of the exposure dimension. If the third product is located in the fifth interval, based on the twelfth and thirteenth weight coefficients, the values in the fifth interval are interpolated to determine the fifteenth weight coefficient corresponding to the motion blur. The product of the current weight of the motion blur and the fifteenth weight coefficient is determined as the weight of the exposure dimension. In this embodiment, it is assumed that the exposure range of the device acquiring the target image is [0, 150 dB]. The higher the exposure, the lower the ambient illuminance. Two threshold intervals can be set to indicate the high-brightness environment [30, 70], i.e., the fourth interval, and the low-brightness environment [100, 150], i.e., the fifth interval. For values greater than 70 dB, the brightness module is set, and the color saturation weight is added by 0 times. For values less than 30 dB, the brightness module is set, and the color saturation weight is added by 3 times. For values less than 100 dB, the static and dynamic noise and motion blur weights are set, with the motion blur weight added by 0 times. For values greater than 150 dB, the static and dynamic noise and motion blur weights are set, with the motion blur weight added by 3 times. Interpolation is performed on intermediate values, and the weights of each interest module are dynamically adjusted according to different illuminance scenarios.
[0057] In an exemplary embodiment, adjusting the dimensional weights of the target dimension included in the plurality of preset dimensions includes: when the target dimension includes a motion edge spatial domain dimension, acquiring a plurality of images continuous with the target image; determining the target image and the motion regions included in the plurality of images; determining a fourth number of moving pixels included in the motion regions; and adjusting the weights of the motion edge spatial domain dimension based on the fourth number. In this embodiment, different motion intensities of the target require increased weights for motion-induced region trailing control, motion region noise reduction, and motion edge spatial domain. When the target dimension is a motion edge spatial domain, a plurality of images continuous with the target image can be acquired. Differences at the same location are retained as motion regions, while differences at different locations are likely noise. For motion regions (requiring a pixel area exceeding 200, where moving objects exceeding 200 can be perceived as moving significantly), a fourth number of moving pixels included in the motion regions can be determined, and the weights of the motion edge spatial domain dimension can be adjusted based on this fourth number.
[0058] In an exemplary embodiment, adjusting the weight of the motion edge spatial dimension based on the fourth quantity includes: determining a sixth interval corresponding to the motion edge spatial dimension, a sixteenth weight coefficient corresponding to the eleventh endpoint value of the sixth interval, and a seventeenth weight coefficient corresponding to the twelfth endpoint value of the fifth interval; if the fourth quantity is less than the eleventh endpoint value, determining the weight of the motion edge spatial dimension as the product of the current weight of the motion edge spatial dimension and the sixteenth weight coefficient; if the fourth quantity is greater than the twelfth endpoint value, determining the weight of the motion edge spatial dimension as the product of the current weight of the motion edge spatial dimension and the seventeenth weight coefficient; if the fourth quantity is within the sixth interval, interpolating the values included in the sixth interval based on the sixteenth and seventeenth weight coefficients to determine an eighteenth weight coefficient corresponding to the motion edge spatial dimension, and determining the weight of the motion edge spatial dimension as the product of the current weight of the motion edge spatial dimension and the eighteenth weight coefficient. In this embodiment, the moving pixel value can be denoted as motion intensity A, where A greater than 2 pixels indicates movement. A threshold range can be set, i.e., the sixth range is [2,8]. When it is less than 2 pixels, the weight of the motion region trailing control, the motion region noise reduction weight, and the motion edge spatial weight are added by 0 times. When it is greater than 8 pixels, the weight of the motion region trailing control, the motion region noise reduction weight, and the motion edge spatial weight are added by 3 times. Interpolation is performed on the intermediate values to dynamically adjust the weight of each attention module according to different motion target regions in the scene.
[0059] In an exemplary embodiment, scoring a target image from multiple preset dimensions, determining a dimension score corresponding to each preset dimension based on the scoring results and the weights of each preset dimension, and determining a deviation score between the target image and a reference image include: scoring the target image from multiple preset dimensions using a target model, determining a dimension score corresponding to each preset dimension based on the scoring results and the weights of each preset dimension, and determining a deviation score between the target image and the reference image using the target model; wherein the target model is obtained by: scoring a training image from multiple preset dimensions using an initial model to determine a comprehensive training score for the image; adjusting the training weights of the multiple preset dimensions and re-determining the comprehensive training score if the comprehensive training score does not meet the first condition, until the comprehensive training score meets the first condition; and determining the initial model when the comprehensive training score meets the first condition as the target model. In this embodiment, a pre-trained target model can be used to determine dimension scores and deviation scores, and the target model can be used to determine a target comprehensive score for the target image. If the target comprehensive score does not meet the first condition, the dimension weights of the target dimensions are adjusted until the target comprehensive score meets the first condition.
[0060] In the above embodiments, during the process of training the initial model to obtain the target model, the device can be placed in a designated environment. The device automatically collects scene raw data, which is then processed by the preset initialization parameters of the automated debugging module to generate training process data. The training process data is sent to the evaluation network module, which evaluates and scores the data based on the multi-dimensional focus points in Table 1. After scoring, the data is compared with the pre-determined evaluation score. If the difference from the pre-determined scoring target is large (a 5% deviation rate is set for the score; if it is more than 5% below the scoring target, it is considered unqualified, i.e., a large difference), the specific focus points with large differences are sent to the automated debugging module. The automated debugging module re-adjusts the open parameters of the ISP chip. After debugging, the training process data is sent to the evaluation network again until the deviation from the pre-determined scoring target is small and the total score requirement is met. Once the requirement is met, the automated debugging module saves all parameters in a certain format to a CFG file and generates a related report. The relevant parameter file is loaded onto the device. After the device moves, it detects scene changes in real time and performs adaptive weight changes based on the specific scene changes and focus points to optimize the parameters and achieve the best effect. After the scene debugging is completed through the collaboration of the automated debugging module and the evaluation network, i.e., the training results for the current scene reach the pre-defined evaluation target, relevant reports and CFG files will be automatically generated. After the parameters generated above are loaded into the device, the device will also call the adaptive scene dynamic weight adjustment module to dynamically adjust the parameters for the specific scene, optimizing the parameters to achieve the best automatic adjustment effect. A schematic diagram of the initial model training process can be found in the appendix. Figure 4 A flowchart illustrating the process for determining the overall target score can be found in the appendix. Figure 5 .
[0061] In the aforementioned embodiments, the automated debugging model combined with the automatic image effect evaluation network can greatly improve development efficiency and reduce errors.
[0062] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0063] This embodiment also provides a weight adjustment device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0064] Figure 6 This is a structural block diagram of a weight adjustment device according to an embodiment of the present invention, such as... Figure 6 As shown, the device includes:
[0065] The scoring module 62 is used to score the target image from multiple preset dimensions, and determine the dimension score corresponding to each preset dimension based on the scoring results and the weight of each preset dimension, and to determine the deviation score between the target image and the reference image.
[0066] Determining module 64 is used to determine the target comprehensive score of the target image based on the dimension score and the deviation score;
[0067] The adjustment module 66 is used to repeatedly perform the following operations when the target comprehensive score does not meet the first condition, until the re-determined target comprehensive score meets the first condition: adjusting the dimension weights of the target dimensions included in the plurality of preset dimensions, re-determining the dimension score based on the score result and the adjusted dimension weights of the target dimensions, and re-determining the target comprehensive score based on the re-determined dimension score and the deviation score.
[0068] In an exemplary embodiment, the adjustment module 66 can adjust the dimension weights of the target dimensions included in the plurality of preset dimensions in the following manner: determining the dynamic range of the target image; if the dynamic range does not meet the second condition, determining that the target dimension includes the brightness dimension of the target image; and adjusting the weights of the brightness dimension.
[0069] In an exemplary embodiment, the adjustment module 66 may adjust the weight of the brightness dimension by: dividing the target image into multiple sub-regions; determining a first average value of the brightness values of the pixels included in each sub-region; determining a second average value of the brightness values of each pixel included in the target image; determining a first sub-average value in which the average value included in the first average value is greater than or equal to the second average value, and a second sub-average value in which the average value included in the first average value is less than the second average value; and determining the weight of the brightness dimension based on the first sub-average value and the second sub-average value.
[0070] In an exemplary embodiment, the adjustment module 66 can determine the weight of the brightness dimension based on the first sub-average value and the second sub-average value in the following manner: determining the product of the number of the second sub-average value and a first constant; determining a first ratio of the number of the first sub-average value to the product; determining a first interval corresponding to the brightness dimension, and a first weight coefficient corresponding to the first endpoint value and a second weight coefficient corresponding to the second endpoint value of the first interval, wherein the first endpoint value is less than the second endpoint value; when the first ratio is less than or equal to the first endpoint value, determining the product of the current weight of the brightness dimension and the first weight coefficient as the weight of the brightness dimension; when the first ratio is greater than or equal to the second endpoint value, determining the product of the current weight of the brightness dimension and the second weight coefficient as the weight of the brightness dimension; when the first ratio is within the first interval, interpolating the values in the first interval based on the first weight and the second weight to determine a third weight coefficient corresponding to the ratio, and determining the product of the current weight of the brightness dimension and the third weight coefficient as the weight of the brightness dimension.
[0071] In an exemplary embodiment, the adjustment module 66 can adjust the dimension weight of the target dimension included in the plurality of preset dimensions in the following manner: when the number of colors included in the target image is greater than a predetermined threshold, it is determined that the target dimension includes the color saturation dimension; the weight of the color saturation dimension is adjusted.
[0072] In an exemplary embodiment, the adjustment module 66 can adjust the weight of the color saturation dimension by: determining the color entropy of each channel of the target image to obtain multiple color entropies; determining the average value of the multiple color entropies; determining the value of the color saturation dimension based on the average value; and adjusting the weight of the color saturation dimension based on the value of the color saturation dimension.
[0073] In an exemplary embodiment, the adjustment module 66 can determine the value of the color saturation dimension based on the average value by: determining the square of the difference between each color entropy included in the plurality of color entropies and the average value, to obtain a plurality of squares; determining the sum of the plurality of squares to obtain a first sum; and determining the arithmetic square root of the first sum as the value of the color saturation dimension.
[0074] In an exemplary embodiment, the adjustment module 66 can determine the color entropy of each channel of the target image to obtain multiple color entropies in the following manner: For each target channel, the following operations are performed to obtain the color entropy of the target channel: determining the target channel value of each pixel in the target image in the target channel to obtain multiple target channel values; dividing the channel values into N orders; determining a first number of the multiple target channel values in each sub-order, wherein the sub-order is any order included in the N orders; determining a first logarithm of the first number with a fourth constant as the base; determining the product of the first logarithm and the first number to obtain a first product corresponding to each sub-order; determining a second sum of the first products corresponding to all sub-orders; and determining the ratio of the second sum to a fifth constant as the color entropy.
[0075] In an exemplary embodiment, the adjustment module 66 can adjust the weight of the color saturation dimension based on the value of the color saturation dimension as follows: determining a second interval corresponding to the value of the color saturation dimension, and a fourth weight coefficient and a fifth weight coefficient corresponding to the third endpoint value of the second interval, wherein the third endpoint value is less than the fourth endpoint value; when the value of the color saturation dimension is less than or equal to the third endpoint value, determining the product of the current weight of the color saturation dimension value and the fourth weight coefficient as the color saturation dimension. The weights are determined as follows: when the value of the color saturation dimension is greater than or equal to the fourth endpoint value, the product of the current weight of the color saturation dimension and the fifth weight coefficient is determined as the weight of the color saturation dimension; when the value of the color saturation temperature is within the second interval, the values in the second interval are interpolated based on the fourth weight coefficient and the fifth weight coefficient to determine the sixth weight coefficient corresponding to the color saturation dimension, and the product of the current weight of the color saturation dimension and the fifth weight coefficient is determined as the weight of the color saturation dimension.
[0076] In an exemplary embodiment, the adjustment module 66 can adjust the dimension weights of the target dimensions included in the plurality of preset dimensions in the following manner: when the target dimensions include a texture dimension, the target image is subjected to noise reduction processing to obtain a first image; the pixel values of the corresponding pixels of the first image and the target image are subtracted to obtain a second image; the second image is subjected to binarization processing to obtain a third image; and the weights of the texture dimension are adjusted based on the third image.
[0077] In an exemplary embodiment, the adjustment module 66 may adjust the weight of the texture dimension based on the third image by: determining a second number of pixels with a pixel value of 1 in the third image; determining a second ratio between the second number and a third number of all pixels included in the third image; and adjusting the weight of the texture dimension based on the second ratio.
[0078] In an exemplary embodiment, the adjustment module 66 can adjust the weight of the texture dimension based on the second ratio as follows: determine a third interval corresponding to the texture dimension, and a seventh weight coefficient corresponding to the fifth endpoint value and an eighth weight coefficient corresponding to the sixth endpoint value of the third interval, wherein the fifth endpoint value is less than the sixth endpoint value; when the second ratio is less than or equal to the fifth endpoint value, determine the weight of the texture dimension by multiplying the current weight of the texture dimension by the seventh weight coefficient; when the second ratio is greater than or equal to the sixth endpoint value, determine the weight of the texture dimension by multiplying the current weight of the texture dimension by the eighth weight coefficient; when the second ratio is within the third interval, perform interpolation processing on the value of the midpoint of the third interval based on the seventh weight coefficient and the eighth weight coefficient to determine a ninth weight coefficient corresponding to the second ratio, and determine the weight of the texture dimension by multiplying the current weight of the texture dimension by the ninth weight coefficient.
[0079] In an exemplary embodiment, the adjustment module 66 can adjust the dimension weights of the target dimensions included in the plurality of preset dimensions in the following manner: when the target dimension includes the exposure dimension, determine the shutter speed, aperture, and gain magnification of the image acquisition device that acquires the target image; determine a second product of the shutter speed, aperture, and gain magnification; determine a second logarithm of the second product with a sixth constant as the base; determine a third product of the second logarithm and a seventh constant; and adjust the weights of the exposure dimension based on the third product.
[0080] In an exemplary embodiment, the adjustment module 66 can adjust the weight of the exposure dimension based on the third product as follows: determine the fourth and fifth intervals corresponding to the exposure dimension, the tenth weight coefficient corresponding to the seventh endpoint value and the eleventh weight coefficient corresponding to the eighth endpoint value of the fourth interval, and the twelfth weight coefficient corresponding to the ninth endpoint value and the thirteenth weight coefficient corresponding to the tenth endpoint value of the fifth interval, wherein the seventh endpoint value is less than the eighth endpoint value, the eighth endpoint value is less than the ninth endpoint value, and the ninth endpoint value is less than the tenth endpoint value; when the third product is less than or equal to the seventh endpoint value, determine the product of the current weight of the color saturation of the target image and the tenth weight coefficient as the weight of the exposure dimension; when the third product is greater than or equal to the eighth endpoint value, determine the product of the current weight of the color saturation of the target image and the eleventh weight coefficient as the weight of the exposure dimension; when the third product is located in the... In the fourth interval, the values in the fourth interval are interpolated based on the tenth and eleventh weight coefficients to determine the fourteenth weight coefficient corresponding to the color saturation. The product of the current weight of the color saturation and the fourteenth weight coefficient is determined as the weight of the exposure dimension. If the third product is less than the ninth endpoint value, the product of the current weight of the target image's motion blur and the twelfth weight coefficient is determined as the weight of the exposure dimension. If the third product is greater than the tenth endpoint value, the product of the current weight of the target image's motion blur and the thirteenth weight coefficient is determined as the weight of the exposure dimension. If the third product is located in the fifth interval, the values in the fifth interval are interpolated based on the twelfth and thirteenth weight coefficients to determine the fifteenth weight coefficient corresponding to the motion blur. The product of the current weight of the motion blur and the fifteenth weight coefficient is determined as the weight of the exposure dimension.
[0081] In an exemplary embodiment, the adjustment module 66 can adjust the dimension weights of the target dimension included in the plurality of preset dimensions in the following manner: when the target dimension includes a motion edge spatial dimension, acquire a plurality of images that are continuous with the target image; determine the target image and the motion region included in the plurality of images; determine a fourth number of moving pixels included in the motion region; and adjust the weights of the motion edge spatial dimension based on the fourth number.
[0082] In an exemplary embodiment, the adjustment module 66 can adjust the weight of the motion edge spatial dimension based on the fourth quantity as follows: determine the sixth interval corresponding to the motion edge spatial dimension, the sixteenth weight coefficient corresponding to the eleventh endpoint value of the sixth interval, and the seventeenth weight coefficient corresponding to the twelfth endpoint value of the fifth interval; when the fourth quantity is less than the eleventh endpoint value, determine the weight of the motion edge spatial dimension by multiplying the current weight of the motion edge spatial dimension by the sixteenth weight coefficient; when the fourth quantity is greater than the twelfth endpoint value, determine the weight of the motion edge spatial dimension by multiplying the current weight of the motion edge spatial dimension by the seventeenth weight coefficient; when the fourth quantity is located in the sixth interval, perform interpolation processing on the values included in the sixth interval based on the sixteenth weight coefficient and the seventeenth weight coefficient to determine the eighteenth weight coefficient corresponding to the motion edge spatial dimension, and determine the weight of the motion edge spatial dimension by multiplying the current weight of the motion edge spatial dimension by the eighteenth weight coefficient.
[0083] In an exemplary embodiment, the scoring module 62 can score a target image from multiple preset dimensions and determine a dimension score corresponding to each preset dimension based on the scoring results and the weight of each preset dimension, and determine a deviation score between the target image and a reference image in the following manner: The target image is scored from multiple dimensions using a target model, and the dimension score corresponding to each preset dimension is determined based on the scoring results and the weight of each preset dimension; the deviation score between the target image and the reference image is determined using the target model; wherein the target model is obtained by: scoring training images from multiple preset dimensions using an initial model to determine a comprehensive training score for the image; if the comprehensive training score does not meet the first condition, adjusting the training weights of the multiple preset dimensions and re-determining the comprehensive training score until the comprehensive training score meets the first condition; and determining the initial model when the comprehensive training score meets the first condition as the target model.
[0084] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0085] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the method described in any of the preceding claims.
[0086] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0087] Embodiments of the present invention also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.
[0088] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0089] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0090] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0091] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for adjusting weights, characterized in that, include: The target image is scored from multiple preset dimensions, and the dimension score corresponding to each preset dimension is determined based on the scoring results and the weight of each preset dimension. The deviation score between the target image and the reference image is also determined. The overall target score of the target image is determined based on the dimensional score and the deviation score. If the target comprehensive score does not meet the first condition, repeat the following operations until the re-determined target comprehensive score meets the first condition: Adjust the dimensional weights of the target dimensions included in the multiple preset dimensions, and redetermine the dimension score based on the scoring results and the adjusted dimensional weights of the target dimensions. The overall target score is re-determined based on the re-determined dimensional scores and the deviation scores; Adjusting the dimensional weights of the target dimension included in the plurality of preset dimensions includes at least one of the following: determining the dynamic range of the target image; if the dynamic range does not meet a second condition, the target dimension includes the luminance dimension of the target image; adjusting the weight of the luminance dimension; if the number of colors included in the target image is greater than a predetermined threshold, the target dimension includes the color saturation dimension; adjusting the weight of the color saturation dimension.
2. The method according to claim 1, characterized in that, Adjusting the weights of the brightness dimension includes: The target image is divided into multiple sub-regions; Determine the first average value of the brightness values of the pixels included in each sub-region; Determine a second average value of the brightness values of each pixel included in the target image; A first sub-average value that includes the first average value and is greater than or equal to the second average value is determined, and a second sub-average value that includes the first average value and is less than the second average value is determined; The weights of the brightness dimension are determined based on the first sub-mean value and the second sub-mean value.
3. The method according to claim 2, characterized in that, Determining the weights of the brightness dimension based on the first sub-mean and the second sub-mean includes: Determine the product of the second sub-average value and the first constant; Determine a first ratio of the number of the first sub-averages to the product; Determine a first interval corresponding to the brightness dimension, and a first weight coefficient corresponding to the first endpoint value and a second weight coefficient corresponding to the second endpoint value of the first interval, wherein the first endpoint value is less than the second endpoint value; If the first ratio is less than or equal to the first endpoint value, the product of the current weight of the brightness dimension and the first weight coefficient is determined as the weight of the brightness dimension. If the first ratio is greater than or equal to the second endpoint value, the product of the current weight of the brightness and the second weight coefficient is determined as the weight of the brightness dimension. When the first ratio is within the first interval, the values in the first interval are interpolated based on the first weight and the second weight to determine the third weight coefficient corresponding to the ratio, and the product of the current weight of the brightness and the third weight coefficient is determined as the weight of the brightness dimension.
4. The method according to claim 1, characterized in that, Adjusting the weights of the color saturation dimension includes: Determine the color entropy of each channel of the target image to obtain multiple color entropies; Determine the average value of the multiple color entropies; The value of the color saturation dimension is determined based on the average value; The weight of the color saturation dimension is adjusted based on the value of the color saturation dimension.
5. The method according to claim 4, characterized in that, Determining the value of the color saturation dimension based on the average value includes: The square of the difference between each color entropy included in the plurality of color entropies and the average value is determined to obtain a plurality of squares; Determine the sum of the multiple squares to obtain a first sum value; The arithmetic square root of the first sum is determined as the value of the color saturation dimension.
6. The method according to claim 4, characterized in that, Determine the color entropy of each channel of the target image to obtain multiple color entropies, including: For each target channel, the following operations are performed to obtain the color entropy of the target channel: Determine the target channel value of each pixel in the target image in the target channel to obtain multiple target channel values; Divide the channel values into N levels; Determine a first number of the multiple target channel values located in each sub-order, wherein the sub-order is any order included in the N orders; Determine the first logarithm of the first quantity with the fourth constant as the base; Determine the product of the first logarithm and the first quantity to obtain the first product corresponding to each of the sub-orders; Determine the second sum value of the first product corresponding to all the said sub-orders; The ratio of the second sum to the fifth constant is determined as the color entropy.
7. The method according to claim 4, characterized in that, Adjusting the weight of the color saturation dimension based on its value includes: Determine the second interval corresponding to the value of the color saturation dimension, and the fourth weight coefficient and the fifth weight coefficient corresponding to the third endpoint value of the second interval, wherein the third endpoint value is less than the fourth endpoint value; If the value of the color saturation dimension is less than or equal to the third endpoint value, the product of the current weight of the color saturation dimension value and the fourth weight coefficient is determined as the weight of the color saturation dimension. If the value of the color saturation dimension is greater than or equal to the fourth endpoint value, the product of the current weight of the color saturation dimension and the fifth weight coefficient is determined as the weight of the color saturation dimension. When the value of the color saturation dimension is within the second interval, the values in the second interval are interpolated based on the fourth weight coefficient and the fifth weight coefficient to determine the sixth weight coefficient corresponding to the color saturation dimension. The product of the current weight of the color saturation dimension and the fifth weight coefficient is determined as the weight of the color saturation dimension.
8. The method according to claim 1, characterized in that, Adjusting the dimensional weights of the target dimensions included in the multiple preset dimensions includes: If the target dimension includes the texture dimension, the target image is subjected to noise reduction processing to obtain a first image; Subtract the pixel values of corresponding pixels in the first image from those in the target image to obtain the second image; The second image is binarized to obtain the third image; The weights of the texture dimension are adjusted based on the third image.
9. The method according to claim 8, characterized in that, Adjusting the weights of the texture dimension based on the third image includes: Determine a second number of pixels with a pixel value of 1 in the third image; Determine a second ratio between the second quantity and a third quantity of all pixels included in the third image; The weight of the texture dimension is adjusted based on the second ratio.
10. The method according to claim 9, characterized in that, Adjusting the weights of the texture dimension based on the second ratio includes: Determine the third interval corresponding to the texture dimension, and the seventh weight coefficient corresponding to the fifth endpoint value and the eighth weight coefficient corresponding to the sixth endpoint value of the third interval, wherein the fifth endpoint value is less than the sixth endpoint value; If the second ratio is less than or equal to the fifth endpoint value, the product of the current weight of the texture dimension and the seventh weight coefficient is determined as the weight of the texture dimension; If the second ratio is greater than or equal to the sixth endpoint value, the product of the current weight of the texture dimension and the eighth weight coefficient is determined as the weight of the texture dimension. When the second ratio is within the third interval, the value of the midpoint of the third interval is interpolated based on the seventh weight coefficient and the eighth weight coefficient to determine the ninth weight coefficient corresponding to the second ratio. The product of the current weight of the texture dimension and the ninth weight coefficient is determined as the weight of the texture dimension.
11. The method according to claim 1, characterized in that, Adjusting the dimensional weights of the target dimensions included in the multiple preset dimensions includes: When the target dimension includes the exposure dimension, determine the shutter speed, aperture, and gain magnification of the image acquisition device that acquires the target image; Determine the second product of the shutter speed, aperture, and gain amplification factor; Determine the second logarithm of the second product with the sixth constant as its base; Determine the third product of the second logarithm and the seventh constant; The weights of the exposure dimension are adjusted based on the third product.
12. The method according to claim 11, characterized in that, Adjusting the weights of the exposure dimension based on the third product includes: Determine the fourth and fifth intervals corresponding to the exposure dimension, the tenth weight coefficient corresponding to the seventh endpoint value and the eleventh weight coefficient corresponding to the eighth endpoint value of the fourth interval, and the twelfth weight coefficient corresponding to the ninth endpoint value and the thirteenth weight coefficient corresponding to the tenth endpoint value of the fifth interval, wherein the seventh endpoint value is less than the eighth endpoint value, the eighth endpoint value is less than the ninth endpoint value, and the ninth endpoint value is less than the tenth endpoint value. If the third product is less than or equal to the seventh endpoint value, the product of the current weight of the color saturation of the target image and the tenth weight coefficient is determined as the weight of the exposure dimension. If the third product is greater than or equal to the eighth endpoint value, the product of the current weight of the color saturation of the target image and the eleventh weight coefficient is determined as the weight of the exposure dimension. When the third product is located in the fourth interval, the values in the fourth interval are interpolated based on the tenth weight coefficient and the eleventh weight coefficient to determine the fourteenth weight coefficient corresponding to the color saturation. The product of the current weight of the color saturation and the fourteenth weight coefficient is determined as the weight of the exposure dimension. If the third product is less than the ninth endpoint value, the product of the current weight of the target image's trail and the twelfth weight coefficient is determined as the weight of the exposure dimension. If the third product is greater than the tenth endpoint value, the product of the current weight of the target image's trail and the thirteenth weight coefficient is determined as the weight of the exposure dimension. When the third product is located in the fifth interval, the values in the fifth interval are interpolated based on the twelfth and thirteenth weight coefficients to determine the fifteenth weight coefficient corresponding to the trailing shadow. The product of the current weight of the trailing shadow and the fifteenth weight coefficient is determined as the weight of the exposure dimension.
13. The method according to claim 1, characterized in that, Adjusting the dimensional weights of the target dimensions included in the multiple preset dimensions includes: When the target dimension includes the motion edge spatial domain dimension, acquire multiple images that are continuous with the target image; Determine the target image and the motion regions included in the plurality of images; Determine the fourth number of moving pixels included in the motion region; The weights of the motion edge spatial dimension are adjusted based on the fourth quantity.
14. The method according to claim 13, characterized in that, Adjusting the weights of the motion edge spatial dimension based on the fourth quantity includes: Determine the sixth interval corresponding to the spatial dimension of the motion edge, the sixteenth weight coefficient corresponding to the eleventh endpoint value of the sixth interval, and the seventeenth weight coefficient corresponding to the twelfth endpoint value of the fifth interval; If the fourth quantity is less than the eleventh endpoint value, the product of the current weight of the motion edge spatial dimension and the sixteenth weight coefficient is determined as the weight of the motion edge spatial dimension. If the fourth quantity is greater than the twelfth endpoint value, the product of the current weight of the motion edge spatial dimension and the seventeenth weight coefficient is determined as the weight of the motion edge spatial dimension. When the fourth quantity is located in the sixth interval, the values included in the sixth interval are interpolated based on the sixteenth weight coefficient and the seventeenth weight coefficient to determine the eighteenth weight coefficient corresponding to the motion edge spatial dimension. The product of the current weight of the motion edge spatial dimension and the eighteenth weight coefficient is determined as the weight of the motion edge spatial dimension.
15. The method according to claim 1, characterized in that, The target image is scored from multiple preset dimensions, and a dimension score corresponding to each preset dimension is determined based on the scoring results and the weight of each preset dimension. The deviation score between the target image and the reference image is determined by: The target image is scored from multiple preset dimensions using a target model, and the dimension score corresponding to each conductive preset dimension is determined based on the scoring results and the weight of each preset dimension. The deviation score between the target image and the reference image is determined using the target model. The target model is obtained in the following way: The training images are scored from multiple dimensions using an initial model to determine the overall training score of the images; If the overall training score does not meet the first condition, the training weights of multiple preset dimensions are adjusted, and the overall training score is re-determined until the overall training score meets the first condition. The initial model that satisfies the first condition when the training comprehensive score is determined as the target model.
16. A weight adjustment device, characterized in that, include: The scoring module is used to score the target image from multiple preset dimensions, and to determine the dimension score corresponding to each preset dimension based on the scoring results and the weight of each preset dimension, and to determine the deviation score between the target image and the reference image. The determination module is used to determine the overall target score of the target image based on the dimensional score and the deviation score; The adjustment module is used to repeatedly perform the following operations when the target comprehensive score does not meet the first condition, until the re-determined target comprehensive score meets the first condition: adjusting the dimension weights of the target dimensions included in the multiple preset dimensions, and re-determining the dimension score based on the score result and the adjusted dimension weights of the target dimensions, and re-determining the target comprehensive score based on the re-determined dimension score and the deviation score. The adjustment module adjusts the dimension weights of the target dimensions included in the multiple preset dimensions in at least one of the following ways: determining the dynamic range of the target image; if the dynamic range does not meet the second condition, the target dimension includes the brightness dimension of the target image; adjusting the weight of the brightness dimension; if the number of colors included in the target image is greater than a predetermined threshold, the target dimension includes the color saturation dimension; adjusting the weight of the color saturation dimension.
17. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method described in any one of claims 1 to 15.
18. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the method as described in any one of claims 1 to 15.
Citation Information
Patent Citations
Picture quality determination method and device, storage medium and electronic device
CN111275681A
Providing image candidates based on diverse adjustments to an image
US8908987B1