An image processing method, an image processing device, and a storage medium

By identifying the target region and calculating the brightness reduction value in image processing, the problem of low efficiency in image vignetting processing in existing technologies is solved, achieving an efficient and natural vignetting transition effect.

CN120751248BActive Publication Date: 2026-04-21HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2024-06-11
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing methods for adding vignetting to images cannot simultaneously balance processing efficiency and visual quality, resulting in high computational demands that lead to low efficiency or poor results.

Method used

By acquiring the image to be processed and the vignetting intensity parameter, the target area is determined, and the brightness reduction value of each pixel is calculated using the vignetting intensity parameter and random quantity. Only the brightness value of the target area is adjusted, reducing the amount of computation and improving efficiency.

Benefits of technology

While ensuring good image vignetting, the processing efficiency was significantly improved, achieving a smooth and natural transition of vignetting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120751248B_ABST
    Figure CN120751248B_ABST
Patent Text Reader

Abstract

This application provides an image processing method, an image processing apparatus, and a storage medium, aiming to improve the efficiency of image vignetting processing while ensuring good vignetting processing results. The image processing method provided in this application includes: acquiring an image to be processed and vignetting intensity parameters; determining a target region from the vignetting addition region; determining the brightness reduction value of each pixel in the target region using the vignetting intensity parameters and a random amount of vignetting intensity in the target region; and adjusting the brightness value of each pixel in the vignetting addition region using the brightness reduction values ​​of each pixel in the target region. In the above implementation, a random amount of vignetting intensity is introduced when processing the vignetting of the image to be processed, improving the vignetting processing effect; and when processing the vignetting of the image to be processed, only the brightness reduction value of the target region needs to be calculated, without needing to calculate the brightness reduction value of each pixel in the vignetting addition region, thus improving the efficiency of image vignetting processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to an image processing method, an image processing apparatus, and a storage medium. Background Technology

[0002] Vignetting refers to the darkening of the four corners of an image when photographing a scene. In the hands of some photographers or designers, a moderate amount of vignetting can be used as a visual technique to enhance the three-dimensionality and visual impact of an image.

[0003] However, some existing methods for adding vignetting to images suffer from high computational costs, resulting in low efficiency in vignetting processing, while others produce poor vignetting effects. In other words, existing methods for adding vignetting to images cannot simultaneously achieve both efficiency and effectiveness in vignetting processing. Summary of the Invention

[0004] This application provides an image processing method, an image processing apparatus, and a storage medium, with the aim of improving the efficiency of image vignetting processing while ensuring good vignetting processing results.

[0005] To achieve the above objectives, this application provides the following technical solution:

[0006] A first aspect of this application provides an image processing method, the method comprising:

[0007] Obtain the image to be processed and the vignetting intensity parameter, wherein the vignetting intensity parameter is the initial value of the brightness decrease in the vignetting area of ​​the image to be processed;

[0008] A target region is determined from the vignetting region, the target region including at least one corner of the image to be processed;

[0009] Using the vignetting intensity parameter and the random vignetting intensity of the target region, the brightness decrease value of each pixel in the target region is determined, wherein the brightness decrease value of each pixel in the target region is positively correlated with the distance between each pixel in the target region and the center point of the image to be processed;

[0010] The brightness values ​​of each pixel in the dark corner addition area are adjusted using the brightness decrease value of each pixel in the target area.

[0011] In the above implementation scheme, a random variable for vignetting intensity is introduced when processing the vignetting of the image to be processed. This allows the brightness decrease value generated based on the vignetting intensity parameter and the random variable to adjust the brightness value of each pixel in the vignetting addition area of ​​the image to be processed. As a result, the vignetting transition in the adjusted image to be processed is smooth and natural, improving the vignetting processing effect. Furthermore, when adjusting the brightness of the image to be processed, only the brightness decrease value of the target area in the vignetting addition area needs to be calculated, without having to calculate the brightness decrease value of each pixel in the vignetting addition area. This reduces the computational load during vignetting processing and improves the efficiency of vignetting processing. Thus, it is possible to improve the efficiency of vignetting processing while ensuring a good vignetting processing effect.

[0012] In one possible implementation of the first aspect of this application, determining the target region from the vignetting region includes: determining attribute data of the image to be processed, the attribute data including length and width; creating a two-dimensional array based on the attribute data, the two-dimensional array being used to record the brightness decrease value of each pixel within the target region, each element in the two-dimensional array corresponding to a pixel within the target region. In the above implementation, the target region can be determined from the vignetting region by constructing a two-dimensional array including the location information of the target region. This allows the brightness decrease value of each pixel within the vignetting region to be determined based on the brightness decrease value of the target region after calculating it. Consequently, when performing vignetting processing on the image to be processed, only the brightness decrease value of the target region within the vignetting region needs to be calculated, without needing to calculate the brightness decrease value of each pixel within the vignetting region. This reduces the computational load during image vignetting processing and improves the efficiency of image vignetting processing, thereby improving the efficiency of image vignetting processing while ensuring good vignetting processing results.

[0013] In one possible implementation of the first aspect of this application, determining the brightness reduction value of each pixel in the target area using the vignetting intensity parameter and the random amount of vignetting intensity in the target area includes: performing parabolic interpolation based on the vignetting intensity parameter and the distance between each pixel in the target area and the center point of the image to be processed to obtain the brightness reduction value to be adjusted for each pixel in the target area; generating the random amount of vignetting intensity in the target area; and subtracting the brightness reduction value to be adjusted for each pixel in the target area from the random amount of vignetting intensity to obtain the brightness reduction value of each pixel in the target area. In the above implementation, parabolic interpolation can be performed first based on the vignetting intensity parameter and the position of each pixel in the target area to obtain the brightness reduction value to be adjusted for each pixel in the target area; then, the brightness reduction value to be adjusted for each pixel in the target area can be further adjusted based on the generated random amount of vignetting intensity to obtain the brightness reduction value of each pixel in the target area. This ensures that after adjusting the brightness values ​​of each pixel in the vignetting area of ​​the image to be processed based on the brightness reduction values ​​of each pixel in the target area, the resulting adjusted image to be processed has a smooth and natural vignetting transition, improving the image vignetting processing effect.

[0014] In one possible implementation of the first aspect of this application, the vignetting intensity random quantity follows a normal distribution with an expected value of 0. In the above implementation, the vignetting intensity random quantity of the target region can be a random quantity with a normal distribution near 0, used to further adjust the vignetting intensity parameter input by the user to determine the brightness reduction value of each pixel within the target region. That is, by utilizing the vignetting intensity random quantity of the target region, when performing vignetting processing on the image to be processed based on the brightness reduction values ​​of each pixel within the target region determined by the vignetting intensity parameter and the vignetting intensity random quantity, the vignetting transition in the obtained target image is smooth and natural, thereby improving the image vignetting processing effect.

[0015] In one possible implementation of the first aspect of this application, the target region includes multiple pixels divided into multiple pixel sets, and the random value of the vignetting intensity of each pixel in each pixel set is the same. In the above implementation, when generating the random value of the vignetting intensity of the target region, the pixels in the target region can be divided into multiple pixel sets, each pixel set including multiple pixels, and the same random value of the vignetting intensity can be determined for each pixel in each pixel set. That is, multiple pixels in the target region can be assigned the same random value of the vignetting intensity, meaning that multiple pixels in the target region only need to generate one random value of the vignetting intensity. This can further reduce the computational load during image vignetting processing and improve the efficiency of image vignetting processing while making the image vignetting transition smooth and natural and improving the image vignetting processing effect.

[0016] In one possible implementation of the first aspect of this application, adjusting the brightness values ​​of each pixel in the vignetting area using the brightness decrease values ​​of each pixel in the target area includes: determining the brightness decrease value of the vignetting area based on the brightness decrease value of the target area; reading the brightness channel parameters of each pixel in the vignetting area; and adjusting the brightness channel parameters of each pixel in the vignetting area based on the brightness decrease value of the vignetting area. In the above implementation, after generating the brightness decrease values ​​of each pixel in the target area, the brightness decrease values ​​of each pixel in the entire vignetting area can be further generated based on the brightness decrease values ​​of each pixel in the target area. Then, the brightness channel parameters of each pixel in the vignetting area are adjusted based on the brightness decrease values ​​of each pixel in the vignetting area, without needing to calculate and generate the brightness decrease values ​​corresponding to each pixel in the entire vignetting area from the beginning. This reduces the computational load during image vignetting processing and improves the efficiency of image vignetting processing.

[0017] In one possible implementation of the first aspect of this application, determining the brightness decrease value of the vignetting region based on the brightness decrease value of the target region includes: determining the corresponding pixel of each pixel in the target region in other regions of the vignetting region, wherein the corresponding pixel is centrally symmetrical with respect to the center point of the image to be processed about the target region; and determining the brightness decrease value of each pixel in the target region as the brightness decrease value of the corresponding pixel. In the above implementation, the corresponding pixel of each pixel in the target region in other regions of the vignetting region can be determined based on the principle of central symmetry. Then, the brightness decrease value of each pixel in the target region can be directly determined as the brightness decrease value of the corresponding pixel to obtain the brightness decrease value of each pixel in the vignetting region. This eliminates the need to calculate and generate the brightness decrease value corresponding to each pixel in the entire vignetting region from the beginning, reducing the computational load during image vignetting processing and improving the efficiency of image vignetting processing.

[0018] In one possible implementation of the first aspect of this application, after adjusting the brightness values ​​of each pixel in the vignetting area using the brightness decrease values ​​of each pixel in the target area, the method includes: acquiring attribute data of the image to be processed, the attribute data including length and width; establishing a correspondence between the attribute data, the vignetting intensity parameter, and the brightness decrease values ​​of each pixel in the target area; and storing the correspondence and the brightness decrease values ​​of each pixel in the target area in a database. In the above implementation, after determining the brightness decrease values ​​of each pixel in the target area, the brightness decrease values ​​of each pixel in the target area and the correspondence between the brightness decrease values ​​of each pixel in the target area and the attribute data and vignetting intensity parameter of the image to be processed can be stored in a database. This allows for the direct vignetting processing of images with the same attribute data and the same vignetting intensity parameter by recalculating the brightness decrease values ​​of each pixel in the target area from the database, thus reducing the computational load and improving the efficiency of vignetting processing.

[0019] In one possible implementation of the first aspect of this application, before determining the target region from the vignetting region, the method further includes: determining attribute data of the image to be processed, the attribute data including length and width; if the database stores brightness reduction values ​​of each pixel in the target region corresponding to the attribute data and the vignetting intensity parameter, obtaining the brightness reduction values ​​of each pixel in the target region from the database; if the database does not store brightness reduction values ​​of each pixel in the target region corresponding to the attribute data and the vignetting intensity parameter, performing the step of determining the target region from the vignetting region. In the above implementation, before determining the target region from the vignetting region, it can first be determined in the database whether there are brightness reduction values ​​of each pixel in the target region corresponding to the attribute data and the vignetting intensity parameter of the image to be processed. If they exist, the corresponding brightness reduction values ​​of each pixel in the target region can be directly retrieved from the database, thereby eliminating the need to recalculate and generate the brightness reduction values ​​of each pixel in the target region, further reducing the computational load during image vignetting processing and improving the efficiency of image vignetting processing.

[0020] A second aspect of this application provides an image processing apparatus, the apparatus comprising:

[0021] The acquisition module is used to acquire the image to be processed and the vignetting intensity parameter, wherein the vignetting intensity parameter is the initial value of the brightness decrease of the vignetting area in the image to be processed;

[0022] A first determining module is configured to determine a target region from the vignetting region, the target region including at least one corner of the image to be processed;

[0023] The second determining module is used to determine the brightness decrease value of each pixel in the target area using the vignetting intensity parameter and the random amount of vignetting intensity of the target area, wherein the brightness decrease value of each pixel in the target area is positively correlated with the distance between each pixel in the target area and the center point of the image to be processed;

[0024] The adjustment module is used to adjust the brightness values ​​of each pixel in the dark corner addition area by using the brightness decrease value of each pixel in the target area.

[0025] A third aspect of this application provides an image processing apparatus, comprising: a memory and at least one processor. The memory is used to store a program, and the at least one processor is used to execute the computer program or computer instructions stored in the memory, so that the image processing apparatus implements an image processing method provided in the first aspect of this application.

[0026] The fourth aspect of this application is a computer storage medium for storing a computer program, which, when executed, implements an image processing method provided in the first aspect of this application.

[0027] The fifth aspect of this application provides a computer program product containing instructions that, when run on a computer, cause the computer to perform an image processing method as described in the first aspect above. Attached Figure Description

[0028] Figure 1 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0029] Figure 2 A schematic flowchart of an image processing method provided in an embodiment of this application;

[0030] Figure 3 A schematic diagram of a visual interface provided for an embodiment of this application;

[0031] Figure 4 This is a schematic diagram of region division of an image to be processed, provided in an embodiment of this application;

[0032] Figure 5 This application provides a schematic diagram showing the position of pixels in a target area according to an embodiment of the present application.

[0033] Figure 6(a) is a schematic diagram of the effect of an image without adding random values ​​for vignetting intensity according to an embodiment of this application;

[0034] Figure 6(b) is a schematic diagram of the effect of adding a random amount of vignetting intensity to an image according to an embodiment of this application;

[0035] Figure 7 A schematic diagram of a target image provided in an embodiment of this application;

[0036] Figure 8 This application provides a schematic diagram showing the position of pixels in a vignetting area according to an embodiment of the present application.

[0037] Figure 9 A flowchart illustrating another image processing method provided in an embodiment of this application;

[0038] Figure 10 This is a schematic diagram of the structure of an image processing device provided in an embodiment of this application. Detailed Implementation

[0039] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. The terminology used in the following embodiments is for the purpose of describing specific embodiments only and is not intended to be a limitation of this application. As used in the specification and appended claims of this application, the singular expressions "a," "an," "the," "the," "the," and "this" are intended to also include expressions such as "one or more," unless the context clearly indicates otherwise. It should also be understood that in the embodiments of this application, "one or more" refers to one, two, or more; "and / or" describes the relationship between related objects, indicating that three relationships may exist; for example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship.

[0040] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0041] The "multiple" mentioned in the embodiments of this application refers to two or more. It should be noted that in the description of the embodiments of this application, terms such as "first" and "second" are used only for the purpose of distinguishing descriptions and should not be construed as indicating or implying relative importance, nor should they be construed as indicating or implying order.

[0042] Vignetting refers to the darkening of the four corners of an image when photographing a scene. In the hands of some photographers or designers, a moderate amount of vignetting can be used as a visual technique to enhance the three-dimensionality and visual impact of an image.

[0043] Commonly used methods for adding vignetting to images include Gaussian blur algorithms, vignetting lens model algorithms, linear / nonlinear interpolation algorithms, painting algorithms, and deep learning algorithms. Gaussian blur algorithms work by adding a Gaussian blur effect to the four corners of the image to achieve vignetting. The degree of blur is controlled by a user-defined radius parameter. Its advantage is a natural effect, but its disadvantages include high computational complexity, poor real-time performance, and low efficiency in vignetting processing. Vignetting lens model algorithms simulate the vignetting effect produced by real lenses. They construct a mathematical model based on lens specifications (focal length, aperture, etc.) and calculate the transmittance coefficient of each pixel using image coordinates to achieve vignetting. The advantage of vignetting lens model algorithms is accurate physical models, but their disadvantages include complex parameter settings, high computational complexity, and low efficiency in vignetting processing. Linear / nonlinear interpolation algorithms achieve vignetting by setting the four corners to black and applying linear / nonlinear interpolation to the remaining areas. Linear interpolation is fast but produces a harsh effect, resulting in poor vignetting performance. Nonlinear interpolation produces a natural effect but is computationally intensive, leading to low efficiency. Inpainting algorithms first blacken the corners and then recover pixels near the corners using local image features, employing partial differential equations or sample-guided restoration techniques. The advantage of inpainting is a natural transition, but its computational complexity results in low efficiency. Deep learning algorithms utilize convolutional neural networks for supervised training on a large number of images with vignetting. The network learns the mapping relationship between the vignetted image and the original image to achieve vignetting. The advantage of deep learning algorithms is ease of parameter tuning, but it requires a large amount of labeled training data, resulting in low efficiency.

[0044] As can be seen from the above introduction, some existing methods for adding vignetting to images suffer from high computational load, resulting in low efficiency in vignetting processing, while others suffer from poor vignetting processing effects. In other words, existing methods for adding vignetting to images cannot simultaneously achieve both efficiency and effectiveness in vignetting processing.

[0045] To overcome the above problems, this application provides an image processing method, an image processing device, and a storage medium, with the aim of improving the efficiency of image vignetting processing while ensuring good image vignetting processing effect.

[0046] The following describes, in conjunction with embodiments, the electronic device to which the image processing method provided in this application is applicable and the specific process of the method.

[0047] The image processing method provided in this application can be applied to electronic devices with screens, such as mobile phones, tablets, wearable devices, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, and personal digital assistants (PDAs). The screen of the electronic device can be an OLED screen or similar. The electronic device in this application can be an image processing device or other devices; this application does not limit the specific type of electronic device.

[0048] For example, Figure 1 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0049] The electronic device may include a processor 310, an external memory interface 320, an internal memory 321, a display screen 330, a camera 340, an antenna 1, an antenna 2, a mobile communication module 350, and a wireless communication module 360, etc.

[0050] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0051] Processor 310 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0052] It is understood that the interface connection relationships between the modules illustrated in this embodiment are merely illustrative and do not constitute a limitation on the structure of the electronic device. In other embodiments of this application, the electronic device may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0053] The external storage interface 320 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 310 through the external storage interface 320 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.

[0054] Internal memory 321 can be used to store executable program code, including instructions. Processor 310 executes various functional applications and data processing of the electronic device by running the instructions stored in internal memory 321. Internal memory 321 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of the electronic device (such as audio data, phonebook, etc.). Furthermore, internal memory 321 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 310 executes various functional applications and data processing of the electronic device by running instructions stored in internal memory 321 and / or instructions stored in memory located within the processor.

[0055] The wireless communication function of electronic devices can be realized through antenna 1, antenna 2, mobile communication module 350, wireless communication module 360, modem processor and baseband processor, etc.

[0056] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover one or more communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.

[0057] The mobile communication module 350 can provide solutions for wireless communication applications including 2G / 3G / 4G / 5G in electronic devices. The mobile communication module 350 may include at least one filter, switch, power amplifier, low-noise amplifier (LNA), etc. The mobile communication module 350 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 350 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 350 may be housed in the processor 310. In some embodiments, at least some functional modules of the mobile communication module 350 and at least some modules of the processor 310 may be housed in the same device.

[0058] In some embodiments, the electronic device initiates or receives call requests via the mobile communication module 350 and the antenna 1.

[0059] Furthermore, an operating system runs on top of the aforementioned components. Examples include iOS, Android, and Windows operating systems. Applications can be installed and run on this operating system. Those skilled in the art will understand that, for the sake of convenience and brevity, explanations and beneficial effects of the relevant content in any of the above-described electronic devices can be found in the corresponding method embodiments provided below, and will not be repeated here.

[0060] Please see Figure 2 , Figure 2 The diagram shown is a flowchart of an image processing method provided in an embodiment of this application. The image processing method provided in this application mainly includes the following steps:

[0061] 201. Obtain the image to be processed and the vignetting intensity parameters.

[0062] The vignetting intensity parameter is the initial value for adjusting the brightness of the vignetting area in the image to be processed.

[0063] In this embodiment, the image to be processed and the vignetting intensity parameter can be obtained first. The image to be processed can be an image requiring vignetting processing; it can be an image input by the user or retrieved from a database. The vignetting intensity parameter can be the initial brightness adjustment value set by the user for each pixel in the vignetting addition area of ​​the image to be processed. The vignetting addition area can be the region in the image to be processed where vignetting needs to be added, i.e., the region in the image to be processed where brightness adjustment is required. The vignetting addition area can be the entire region of the image to be processed or a portion of the image. The user can manually set the vignetting addition area in the image to be processed, or the vignetting addition area can be a pre-defined default region; this embodiment does not limit this. The vignetting addition area can include the four corners of the image to be processed. It is understood that the user can transmit the image to be processed in real time through a visual interface, or input an image search command through a visual interface, allowing the electronic device to retrieve the image to be processed from the database according to the user's input image search command. The user can also input the vignetting intensity parameter through the visual interface so that the electronic device can perform vignetting processing on the image to be processed according to the user's needs. Figure 3 As shown, users can determine and input the vignetting intensity parameter by adjusting the parameter bar on the visualization interface. Users can also input the vignetting intensity parameter through the parameter input box on the visualization interface.

[0064] Specifically, the image to be processed can be in YUV format. YUV is an important image color encoding method. It is designed based on the different sensitivities of the human visual system to luminance and chrominance. Here, "Y" represents luminance, i.e., grayscale value; "U" and "V" represent chrominance, used to describe the color and saturation of the image. YUV is an efficient image color encoding method that achieves effective compression and transmission of image data by separating luminance and chrominance information and utilizing the differences in human eye sensitivity to these two. It has wide applications in video encoding, transmission, and image processing.

[0065] 202. Determine the target area from the area added from the vignettes.

[0066] The target region includes at least one corner of the image to be processed.

[0067] In this embodiment, since the vignetting in the image to be processed can be centrally symmetrical about the center point of the image to be processed, the target area can be determined from the vignetting addition area first. The target area includes a corner of the image to be processed, so that only the brightness decrease value of each pixel in the target area of ​​the vignetting addition area needs to be calculated to derive the brightness decrease value of each pixel in the entire vignetting addition area, without having to calculate the brightness decrease value of each pixel in the vignetting addition area. This reduces the amount of computation when processing the image vignetting and improves the efficiency of image vignetting processing. Thus, the efficiency of image vignetting processing can be improved while ensuring a good image vignetting processing effect.

[0068] In one possible implementation of this application embodiment, attribute data of the image to be processed is determined, including length and width. A two-dimensional array is created based on the attribute data, the two-dimensional array being used to record the brightness decrease value of each pixel within the target area, and each element in the two-dimensional array corresponding to a pixel within the target area. In this application embodiment, a two-dimensional array including the location information of the target area can be created based on the length and width of the image to be processed. This allows the target area to be determined from the vignetting area, so that after calculating the brightness decrease value of the target area, the brightness decrease value of each pixel within the vignetting area can be determined based on the brightness decrease value of the target area. Therefore, when performing vignetting processing on the image to be processed, only the brightness decrease value of the target area within the vignetting area needs to be calculated, without needing to calculate the brightness decrease value of each pixel within the vignetting area. This reduces the computational load during image vignetting processing and improves the efficiency of image vignetting processing, thereby improving the efficiency of image vignetting processing while ensuring good vignetting processing results. Furthermore, the two-dimensional array can be used to record the brightness decrease value of each pixel within the target area, that is, each element in the two-dimensional array corresponds to a pixel within the target area. As we can understand it, a two-dimensional array is a data structure that can be viewed as an array of multiple one-dimensional arrays that share the same set of indices. Two-dimensional arrays are commonly used to represent tabular data, matrices, images, and so on. In the field of image processing, two-dimensional arrays are a core data structure used to represent and manipulate image data.

[0069] Specifically, such as Figure 4 As shown, when the vignetting area is the entire area of ​​the image to be processed, the target area can be at least one of the upper left, upper right, lower left, and lower right areas of the image to be processed. That is, the upper left area of ​​the image to be processed can be used as the target area, or the upper left and upper right areas can be used as the target area at the same time, or the upper left, upper right, and lower right areas can be used as the target area at the same time.

[0070] 203. Using the vignetting intensity parameter and the random vignetting intensity of the target area, determine the brightness reduction value of each pixel in the target area.

[0071] The brightness decrease of each pixel in the target area is positively correlated with the distance between each pixel in the target area and the center point of the image to be processed.

[0072] In this embodiment of the application, in order to make the vignetting transition in the target image smooth and natural, the brightness reduction value of each pixel in the target area is obtained by adjusting the vignetting intensity parameter and the random amount of vignetting intensity in the target area. This value can be positively correlated with the distance between the pixel in the target area and the center point of the image to be processed. That is, the brightness reduction value of the pixel in the target area that is closer to the center point of the image to be processed can be less than or equal to the brightness reduction value of the pixel in the target area that is farther away from the center point of the image to be processed. For example Figure 5 As shown, the distance from the first pixel a in the target area to the center point of the image to be processed is greater than the distance from the second pixel b in the target area to the center point of the image to be processed. The brightness decrease value of the first pixel a can be greater than or equal to the brightness decrease value of the second pixel b.

[0073] Understandably, the random value of the vignetting intensity in the target area can be a random value that is normally distributed near 0. This random value is used to further adjust the vignetting intensity parameter input by the user to determine the brightness reduction value of each pixel in the target area. In other words, by utilizing the random value of the vignetting intensity in the target area, when performing vignetting processing on the image to be processed based on the brightness reduction value of each pixel in the target area determined by the vignetting intensity parameter and the random value of the vignetting intensity, the vignetting transition in the resulting target image is smooth and natural, thereby improving the vignetting processing effect.

[0074] Specifically, the effect of introducing a random amount of vignetting intensity can be seen in the comparison of Figures 6(a) and 6(b). Figure 6(a) shows the effect without adding a random amount of vignetting intensity, and Figure 6(b) shows the effect with adding a random amount of vignetting intensity. By comparing Figures 6(a) and 6(b), it can be seen that in Figure 6(a), the brightness of the vignetting area does not change significantly, and the vignetting transition is relatively abrupt; while in Figure 6(b), the brightness of the vignetting area is higher closer to the center point of the image to be processed, and the brightness of the pixels gradually increases as the distance from the center point of the image to be processed decreases, that is, the vignetting transition is softer and smoother.

[0075] In addition, a two-dimensional array can be created to record the random amount of vignetting intensity in the target area. The size of this two-dimensional array can be the product of the width and height of the image to be processed, divided by 16, and can be named a vignetting intensity random amount table. The vignetting intensity random amount table can include the position information of each pixel in the target area and the random amount of vignetting intensity for each pixel in the target area.

[0076] In one possible implementation of this application, parabolic interpolation can be performed based on the vignetting intensity parameter and the distance between each pixel in the target area and the center point of the image to be processed to obtain the brightness reduction value to be adjusted for each pixel in the target area; a random amount of vignetting intensity in the target area is generated; and the brightness reduction value to be adjusted for each pixel in the target area is subtracted from the random amount of vignetting intensity to obtain the brightness reduction value of each pixel in the target area. It can be understood that, in this application embodiment, the vignetting intensity parameter can first be used as the initial brightness reduction value of the pixel in the target area that is furthest from the center point of the image to be processed, i.e., the initial brightness reduction value of the pixel corresponding to the corner of the image to be processed. Then, the initial brightness reduction value of the pixel in the target area that is closest to the center point of the image to be processed is determined to be 0 or other default values. Finally, parabolic interpolation is performed based on the initial brightness reduction value of the pixel corresponding to the corner of the image to be processed, the initial brightness reduction value of the pixel in the target area that is closest to the center point of the image to be processed, and the distance between each pixel in the target area and the center point of the image to be processed to obtain the brightness reduction value to be adjusted for each pixel in the target area. To further ensure a smooth and natural transition of vignetting in the target image, a random value for the vignetting intensity of the target region can be generated. Based on this random value, the brightness reduction value of each pixel in the target region can be further adjusted to obtain the brightness reduction value of each pixel in the target region.

[0077] Specifically, a random value for the vignetting intensity of the target area can be generated using a random function or similar method. Multiple random values ​​for the vignetting intensity of the target area can be generated. The number of random values ​​can be the same as the number of pixels in the target area, or it can be one-nth of the number of pixels in the target area, where n is a positive integer. That is, multiple adjacent pixels in the target area can share a single random value for vignetting intensity to further adjust the brightness reduction value, thereby further reducing the computational load during image vignetting processing. In one implementation, n can be 4, meaning that four adjacent pixels in the target area can share a single random value for vignetting intensity. After determining the random value for the vignetting intensity of each pixel in the target area, the brightness reduction value of each pixel in the target area can be obtained by subtracting the desired brightness reduction value from the random value for vignetting intensity.

[0078] For example, if the user inputs a vignetting intensity parameter of 50, after parabolic interpolation, the brightness reduction value to be adjusted for the first pixel a is 45, and the brightness reduction value to be adjusted for the second pixel b is 40. Furthermore, based on the generated vignetting intensity random value, the vignetting intensity random value for the first pixel a is determined to be 2, and the vignetting intensity random value for the second pixel b is determined to be 1. Therefore, the brightness reduction value for the first pixel a is determined to be 43, and the brightness reduction value for the second pixel is determined to be 39.

[0079] In one possible implementation of this application embodiment, the target region includes multiple pixels divided into multiple pixel sets, and the random value of the vignetting intensity of each pixel in each pixel set is the same. It is understood that when generating the random value of the vignetting intensity of the target region, the pixels in the target region can first be divided into multiple pixel sets, each pixel set including multiple pixels, and the same random value of the vignetting intensity can be determined for each pixel in each pixel set. That is, multiple pixels in the target region can be assigned the same random value of the vignetting intensity, meaning that only one random value of the vignetting intensity needs to be generated for multiple pixels in the target region. This allows for a smooth and natural transition of the vignetting in the target image, improving the vignetting processing effect, while further reducing the computational load during vignetting processing and improving the efficiency of vignetting processing. Specifically, each pixel set may include 4 pixels.

[0080] In addition, a two-dimensional array can be created to record the brightness decrease value of each pixel within the target area. The size of this two-dimensional array can be the product of the width and height of the image to be processed divided by 4, and it can be named a vignetting intensity lookup table. Each element in the vignetting intensity lookup table corresponds to a pixel within the target area, and each element can correspond to the brightness decrease value of that pixel within the target area.

[0081] 204. Adjust the brightness values ​​of each pixel in the dark corner addition area by using the brightness decrease value of each pixel in the target area.

[0082] In this embodiment, after generating the brightness decrease value of each pixel within the target area, the brightness values ​​of each pixel within the vignetting area of ​​the image to be processed can be adjusted based on these values. This allows for the addition of an image vignetting feature to the image to be processed, resulting in a target image containing the vignetting feature. This eliminates the need to calculate the brightness decrease value of the target area within the vignetting feature when adjusting the brightness of the image to be processed, thus reducing the computational load and improving the efficiency of vignetting processing. Specifically, based on the principle of symmetry between the vignetting feature and the center point of the image to be processed, the brightness decrease value of each pixel within the target area can be determined. Then, the brightness values ​​of the vignetting feature in the image to be processed can be adjusted based on these values ​​to obtain a target image containing the vignetting feature. Figure 7 As shown, Figure 7 This is a schematic diagram of a target image.

[0083] In one possible implementation of this application, the brightness reduction value of the vignetting area can be determined based on the brightness reduction value of the target area; the brightness channel parameters of each pixel within the vignetting area can be read; and the brightness channel parameters of each pixel within the vignetting area can be adjusted based on the brightness reduction value of the vignetting area. It is understood that when the image to be processed is in YUV format, the brightness reduction value of each pixel within the entire vignetting area can be determined based on the principle of central symmetry of the image vignetting with respect to the center point of the image to be processed, according to the brightness reduction value of each pixel within the target area. A vignetting intensity lookup table can be created to store the brightness reduction values ​​of each pixel within the vignetting area. Furthermore, the Y channel data of the image to be processed can be read row by row, and the value by which the brightness of each pixel within the vignetting area should be reduced can be obtained by looking up the vignetting intensity lookup table. The brightness channel parameters of each pixel within the vignetting area are then subtracted from the brightness reduction value to adjust and apply the brightness channel parameters, thereby adding an image vignetting to the image to be processed, resulting in a target image containing the image vignetting.

[0084] In one possible implementation of this application, the corresponding pixels of each pixel in the target area in other areas of the vignetting region are determined, wherein the corresponding pixels are centrally symmetrical with respect to the center point of the image to be processed about the target area. The brightness decrease value of each pixel in the target area is determined as the brightness decrease value of the corresponding pixel. It can be understood that the corresponding pixels of each pixel in the target area in other areas of the vignetting region can be determined based on the principle of central symmetry, and then the brightness decrease value of each pixel in the target area can be directly determined as the brightness decrease value of the corresponding pixel to obtain the brightness decrease value of each pixel in the vignetting region, without having to calculate and generate the brightness decrease value corresponding to each pixel in the entire vignetting region from the beginning, thereby reducing the computational load during image vignetting processing and improving the efficiency of image vignetting processing.

[0085] Specifically, based on the positional information of each pixel within the target area and the positional information of each pixel within the vignetting area, the corresponding pixels in other areas of the vignetting area can be determined. This positional information can be, for example, coordinates. Figure 8 As shown, for example, the first pixel a is a pixel in the target area, and the third pixel c, fourth pixel d, and fifth pixel e are pixels in other areas of the vignetting area. The coordinates of the first pixel a in a coordinate system with the center of the image to be processed as the origin are (-x, y), the coordinates of the third pixel c are (x, y), the coordinates of the fourth pixel d are (-x, -y), and the coordinates of the fifth pixel e are (x, -y). Based on the principle of central symmetry, the corresponding pixels of the first pixel a in other areas of the vignetting area are the third pixel c, the fourth pixel d, and the fifth pixel e. If the brightness reduction value of the first pixel a is 49, then the brightness reduction values ​​of the third pixel c, the fourth pixel d, and the fifth pixel e can be directly set to 49 without recalculating their brightness reduction values, thus reducing the computational load and improving the efficiency of vignetting processing.

[0086] In one possible implementation of this application, attribute data of the image to be processed can be obtained, including length and width; a correspondence can be established between the attribute data, the vignetting intensity parameter and the brightness decrease value of each pixel in the target area; and the correspondence and the brightness decrease value of each pixel in the target area can be stored in a database. In this embodiment, to further improve the efficiency of image vignetting processing, after generating the brightness decrease value of the target area in the image to be processed, the length and width of the image to be processed can be obtained. The brightness decrease value of each pixel in the target area and the correspondence between the brightness decrease value of each pixel in the target area and the attribute data and vignetting intensity parameters of the image to be processed are stored in the database. Specifically, the brightness decrease value of each pixel in the target area can be recorded in a table first and then stored in the table. This is so that when processing images with the same attribute data and the same vignetting intensity parameters, that is, when the length and width of the image to be processed input or indicated by the user are the same as the length and width of the previously processed image, and the vignetting intensity parameters input by the user are also the same, the brightness decrease value of each pixel in the target area can be directly obtained from the database for image vignetting processing without recalculating the brightness decrease value of each pixel in the target area. This reduces the amount of computation during image vignetting processing and improves the efficiency of image vignetting processing.

[0087] As illustrated by the examples in the foregoing embodiments, this application introduces a random variable for vignetting intensity when processing the vignetting of the image to be processed. This allows the brightness values ​​of each pixel in the vignetting addition area of ​​the image to be processed to be adjusted based on the brightness decrease value generated by the vignetting intensity parameter and the random variable for vignetting intensity. As a result, the vignetting transition in the adjusted image to be processed is smooth and natural, improving the vignetting processing effect. Furthermore, when adjusting the brightness of the image to be processed, only the brightness decrease value of the target area in the vignetting addition area needs to be calculated, without having to calculate the brightness decrease value of each pixel in the vignetting addition area. This reduces the computational load during vignetting processing and improves the efficiency of vignetting processing, thereby improving the efficiency of vignetting processing while ensuring a good vignetting processing effect.

[0088] Please see Figure 9 , Figure 9 The diagram shown is a flowchart of another image processing method provided in an embodiment of this application. This other image processing method mainly includes the following steps:

[0089] 901. Obtain the image to be processed and the vignetting intensity parameters.

[0090] The vignetting intensity parameter is the initial value of the brightness reduction in the vignetting area of ​​the image to be processed.

[0091] Step 901 above is similar to step 901 mentioned earlier, and will not be described in detail here.

[0092] 902. Determine the attribute data of the image to be processed.

[0093] The attribute data includes length and width.

[0094] In this embodiment, after acquiring the image to be processed, attribute data of the image to be processed, including length and width, can be further determined so that the image to be processed can be matched with the brightness reduction values ​​of each pixel in the target area in the database. It is understood that the attribute data of the image to be processed may include not only length and width, but also image resolution, etc.

[0095] 903. If the database stores the brightness reduction values ​​of each pixel in the target area corresponding to the attribute data and the vignetting intensity parameter, retrieve the brightness reduction values ​​of each pixel in the target area from the database.

[0096] In this embodiment, after determining the attribute data and vignetting intensity parameters of the image to be processed, the attribute data and vignetting intensity parameters of the image to be processed can be matched with data in the database to determine whether a match can be found for the brightness decrease value of each pixel in the corresponding target area. If a match is found, the brightness decrease value of each pixel in the target area is directly obtained from the database. It is understood that the database stores the correspondence between attribute data, vignetting intensity parameters, and brightness decrease values ​​of each pixel in the target area, as well as various brightness decrease values ​​for each pixel in the target area. The brightness decrease value of each pixel in the target area is generated based on the image's vignetting intensity parameters and a random vignetting intensity value, and can be used to perform vignetting processing on the image, adding vignetting to the image. The brightness decrease value of each pixel in the target area can be stored in the database in tabular form. In other words, the attribute data and vignetting intensity parameters of the image to be processed can be matched with the corresponding relationship stored in the database to determine whether there is a brightness reduction value of each pixel in the target area corresponding to the attribute data and vignetting intensity parameters of the image to be processed. If there is, the brightness reduction value of each pixel in the target area can be directly obtained from the database, without having to recalculate and generate the brightness reduction value of the target area, which further reduces the amount of computation in image vignetting processing and improves the efficiency of image vignetting processing.

[0097] 904. If the database does not store the brightness reduction values ​​of each pixel in the target area corresponding to the attribute data and the vignetting intensity parameter, determine the target area from the vignetting addition area.

[0098] In this embodiment of the application, after matching the attribute data and vignetting intensity parameters of the image to be processed with the corresponding relationship stored in the database, if no brightness reduction value of each pixel in the target area corresponding to the attribute data and vignetting intensity parameters of the image to be processed is found in the database, the target area can be determined from the vignetting addition area.

[0099] The target region includes at least one corner of the image to be processed.

[0100] 905. Using the vignetting intensity parameter and the random amount of vignetting intensity in the target area, determine the brightness reduction value of each pixel in the target area.

[0101] The brightness decrease of each pixel in the target area is positively correlated with the distance between each pixel in the target area and the center point of the image to be processed.

[0102] 906. Adjust the brightness values ​​of each pixel in the dark corner addition area by using the brightness decrease value of each pixel in the target area.

[0103] Steps 904 to 906 described above are similar to steps 202 to 204 in the previous embodiments, and will not be described in detail here.

[0104] As can be seen from the examples in the foregoing embodiments, in this application embodiment, before determining the target area from the vignetting addition area, it is possible to first determine in the database whether there are brightness reduction values ​​of each pixel in the target area corresponding to the attribute data and vignetting intensity parameters of the image to be processed. If they exist, the corresponding brightness reduction values ​​of each pixel in the target area can be directly retrieved from the database, thereby eliminating the need to recalculate and generate the brightness reduction values ​​of each pixel in the target area, further reducing the amount of computation during image vignetting processing and improving the efficiency of image vignetting processing. If the database does not contain the corresponding brightness reduction values ​​for each pixel within the target area, a random value for vignetting intensity is introduced when processing the vignetting of the image to be processed. This allows the brightness reduction values ​​generated based on the vignetting intensity parameters and the random value to adjust the brightness values ​​of each pixel within the vignetting area in the image to be processed. As a result, the vignetting transition in the adjusted image to be processed is smooth and natural, improving the vignetting processing effect. Furthermore, when adjusting the brightness of the image to be processed, only the brightness reduction value of the target area within the vignetting area needs to be calculated, without having to calculate the brightness reduction value of each pixel within the vignetting area. This reduces the computational load during vignetting processing and improves the efficiency of vignetting processing. Thus, it is possible to improve the efficiency of vignetting processing while ensuring a good vignetting processing effect.

[0105] Figure 10 This is a schematic diagram of the structure of an image processing device provided in an embodiment of this application. The image processing device specifically includes:

[0106] The acquisition module 1001 is used to acquire the image to be processed and the vignetting intensity parameter, wherein the vignetting intensity parameter is the initial value of the brightness decrease of the vignetting area in the image to be processed;

[0107] The first determining module 1002 is used to determine a target region from the vignetting region, the target region including at least one corner of the image to be processed;

[0108] The second determining module 1003 is used to determine the brightness decrease value of each pixel in the target area using the vignetting intensity parameter and the random amount of vignetting intensity of the target area, wherein the brightness decrease value of each pixel in the target area is positively correlated with the distance between each pixel in the target area and the center point of the image to be processed.

[0109] The adjustment module 1004 is used to adjust the brightness value of each pixel in the dark corner addition area by using the brightness decrease value of each pixel in the target area.

[0110] In one possible implementation of this application embodiment, the first determining module 1002 is specifically used for:

[0111] Determine the attribute data of the image to be processed, the attribute data including length and width;

[0112] A two-dimensional array is created based on the attribute data. The two-dimensional array is used to record the brightness decrease value of each pixel in the target area. The two-dimensional array includes the location information of the target area.

[0113] In one possible implementation of this application embodiment, the second determining module 1003 is specifically used for:

[0114] Based on the vignetting intensity parameter and the distance between each pixel in the target area and the center point of the image to be processed, parabolic interpolation is performed to obtain the brightness reduction value to be adjusted for each pixel in the target area.

[0115] Generate a random value for the vignetting intensity of the target region;

[0116] The brightness reduction value of each pixel in the target area is obtained by subtracting the random amount of vignetting intensity from the brightness reduction value of each pixel in the target area.

[0117] In one possible implementation of this application, the target region includes multiple sets of pixels, and the dark corner intensity of each pixel in each set of pixels is the same.

[0118] In one possible implementation of this application embodiment, the adjustment module 1004 is specifically used for:

[0119] The brightness reduction value of the vignetting area is determined based on the brightness reduction value of the target area;

[0120] Read the brightness channel parameters of each pixel within the dark corner addition area;

[0121] The brightness channel parameters of each pixel within the vignetting area are adjusted based on the brightness decrease value of the vignetting area.

[0122] In one possible implementation of this application embodiment, the adjustment module 1004 is specifically used for:

[0123] Each pixel in the target area is identified in another area of ​​the vignetting addition area, and the corresponding pixel is symmetrical to each pixel in the target area about the center point of the image to be processed.

[0124] The brightness decrease value of each pixel within the target area is determined as the brightness decrease value of the corresponding pixel.

[0125] In one possible implementation of this application embodiment, the apparatus further includes:

[0126] The acquisition module 1001 is further configured to acquire attribute data of the image to be processed, the attribute data including length and width;

[0127] A module is established to establish the correspondence between the attribute data, the vignetting intensity parameter, and the brightness decrease value of each pixel in the target area;

[0128] The storage module is used to store the correspondence and the brightness reduction value of each pixel in the target area in the database.

[0129] In one possible implementation of this application embodiment, the apparatus further includes:

[0130] The third determining module is used to determine the attribute data of the image to be processed, the attribute data including length and width;

[0131] The acquisition module 1001 is further configured to acquire the brightness decrease value of each pixel in the target area from the database if the database stores the brightness decrease value of each pixel in the target area corresponding to the attribute data and the dark corner intensity parameter;

[0132] The first determining module 1002 is specifically used to determine the target area from the vignetting area if the database does not store the brightness reduction value of each pixel in the target area corresponding to the attribute data and the vignetting intensity parameter.

[0133] As illustrated by the examples in the foregoing embodiments, this application introduces a random variable for vignetting intensity when processing the vignetting of the image to be processed. This allows the brightness values ​​of each pixel in the vignetting addition area of ​​the image to be processed to be adjusted based on the brightness decrease value generated by the vignetting intensity parameter and the random variable for vignetting intensity. As a result, the vignetting transition in the adjusted image to be processed is smooth and natural, improving the vignetting processing effect. Furthermore, when adjusting the brightness of the image to be processed, only the brightness decrease value of the target area in the vignetting addition area needs to be calculated, without having to calculate the brightness decrease value of each pixel in the vignetting addition area. This reduces the computational load during vignetting processing and improves the efficiency of vignetting processing, thereby improving the efficiency of vignetting processing while ensuring a good vignetting processing effect.

[0134] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0135] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between devices or modules, and may be electrical, mechanical, or other forms.

[0136] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0137] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.

[0138] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the essential contribution of the technical solution of this application, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the processes of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks.

[0139] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. An image processing method, characterized in that, The method includes: Obtain the image to be processed and the vignetting intensity parameter, wherein the vignetting intensity parameter is the initial value of the brightness decrease in the vignetting area of ​​the image to be processed; A target region is determined from the vignetting region, the target region including at least one corner of the image to be processed; Using the vignetting intensity parameter and the random vignetting intensity of the target region, the brightness decrease value of each pixel in the target region is determined, wherein the brightness decrease value of each pixel in the target region is positively correlated with the distance between each pixel in the target region and the center point of the image to be processed; The brightness values ​​of each pixel in the dark corner addition area are adjusted using the brightness decrease value of each pixel in the target area; The step of determining the brightness decrease value of each pixel in the target area using the vignetting intensity parameter and the random amount of vignetting intensity in the target area includes: Based on the vignetting intensity parameter and the distance between each pixel in the target area and the center point of the image to be processed, parabolic interpolation is performed to obtain the brightness reduction value to be adjusted for each pixel in the target area. The vignetting intensity of the target region is generated randomly, and the random vignetting intensity follows a normal distribution with an expected value of 0. The brightness reduction value of each pixel in the target area is obtained by subtracting the random amount of vignetting intensity from the brightness reduction value of each pixel in the target area.

2. The method according to claim 1, characterized in that, Determining the target region from the vignetting area includes: Determine the attribute data of the image to be processed, the attribute data including length and width; A two-dimensional array is created based on the attribute data. The two-dimensional array is used to record the brightness decrease value of each pixel in the target area. Each element in the two-dimensional array corresponds to a pixel in the target area.

3. The method according to claim 1, characterized in that, The target region includes multiple pixels, which are divided into multiple pixel sets. The dark corner intensity of each pixel in each pixel set is the same.

4. The method according to claim 1, characterized in that, The step of adjusting the brightness values ​​of each pixel in the dark corner addition area using the brightness decrease value of each pixel in the target area includes: The brightness reduction value of the vignetting area is determined based on the brightness reduction value of the target area; Read the brightness channel parameters of each pixel within the dark corner addition area; The brightness channel parameters of each pixel within the vignetting area are adjusted based on the brightness decrease value of the vignetting area.

5. The method according to claim 4, characterized in that, Determining the brightness reduction value of the vignetting area based on the brightness reduction value of the target area includes: Each pixel in the target area is identified in another area of ​​the vignetting addition area, and the corresponding pixel is symmetrical to each pixel in the target area about the center point of the image to be processed. The brightness decrease value of each pixel within the target area is determined as the brightness decrease value of the corresponding pixel.

6. The method according to any one of claims 1 to 5, characterized in that, After adjusting the brightness values ​​of each pixel in the vignetting area using the brightness decrease values ​​of each pixel in the target area, the process includes: Obtain the attribute data of the image to be processed, the attribute data including length and width; Establish the correspondence between the attribute data, the vignette intensity parameter, and the brightness decrease value of each pixel in the target area; The correspondence and the brightness reduction value of each pixel in the target area are stored in the database.

7. The method according to claim 1, characterized in that, Before determining the target region from the vignetting area, the method further includes: Determine the attribute data of the image to be processed, the attribute data including length and width; If the database stores the brightness decrease value of each pixel in the target area corresponding to the attribute data and the vignetting intensity parameter, obtain the brightness decrease value of each pixel in the target area from the database; If the database does not store the brightness reduction values ​​of each pixel in the target area corresponding to the attribute data and the vignetting intensity parameter, the step of determining the target area from the vignetting addition area is executed.

8. An image processing apparatus, characterized in that, The device includes: The acquisition module is used to acquire the image to be processed and the vignetting intensity parameter, wherein the vignetting intensity parameter is the initial value of the brightness decrease of the vignetting area in the image to be processed; A first determining module is configured to determine a target region from the vignetting region, the target region including at least one corner of the image to be processed; The second determining module is used to determine the brightness decrease value of each pixel in the target area using the vignetting intensity parameter and the random amount of vignetting intensity of the target area, wherein the brightness decrease value of each pixel in the target area is positively correlated with the distance between each pixel in the target area and the center point of the image to be processed; An adjustment module is used to adjust the brightness values ​​of each pixel in the dark corner addition area by using the brightness decrease value of each pixel in the target area; The second determining module is specifically used for: Based on the vignetting intensity parameter and the distance between each pixel in the target area and the center point of the image to be processed, parabolic interpolation is performed to obtain the brightness reduction value to be adjusted for each pixel in the target area. Generate a random quantity of vignetting intensity for the target region, wherein the random quantity of vignetting intensity follows a normal distribution with an expected value of 0; The brightness reduction value of each pixel in the target area is obtained by subtracting the random amount of vignetting intensity from the brightness reduction value of each pixel in the target area.

9. An image processing apparatus, characterized in that, The device includes: Memory is used to store computer programs or computer instructions; A processor for executing a computer program or computer instructions stored in the memory, causing the apparatus to perform the method as described in any one of claims 1 to 7.

10. A computer storage medium, characterized in that, Used to store a computer program, which, when executed by a processor, is used to implement the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and device for adjusting image contrast

    CN108009997A

  • High dynamic range video image processing method, computer device and computer readable storage medium

    CN113935911A