An image processing method and apparatus
By analyzing image brightness values and dynamically adjusting fill light parameters, the problem of poor image quality caused by fixed fill light parameters at the same focal length is solved, thus improving image shooting quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-19
- Publication Date
- 2026-03-10
AI Technical Summary
Existing shooting equipment uses the same lighting parameters for the same focal length, which cannot adapt to different environments, resulting in poor image quality.
By determining the brightness values of the image, including the average value of the central region, the average value of pixel blocks with brightness values greater than a threshold, and the average value of the overall pixel blocks, the fill light parameters are dynamically adjusted to adapt to different brightness conditions, thereby improving the image capture effect.
It enables flexible adjustment of fill light parameters based on image brightness information, improving image capture results and ensuring image brightness uniformity and quality.
Smart Images

Figure CN115914847B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to an image processing method and apparatus. Background Technology
[0002] During the shooting process, supplemental lighting can be applied to the shooting equipment to improve the image quality of the captured images.
[0003] Currently, when applying fill light, the shooting device can consult a pre-stored table to obtain the corresponding fill light parameters for that focal length. This table includes fill light parameters for various focal lengths. The shooting device uses these parameters to achieve the best image quality for the captured image.
[0004] In this method, the lighting parameters for the shooting device are all the same at the same focal length. However, a focal length actually includes multiple focal lengths, and even at the same focal length, the shooting environment can vary. Therefore, using the same lighting parameters for the same focal length cannot properly illuminate the shooting device, resulting in poor image quality. Summary of the Invention
[0005] This application provides an image processing method and apparatus for improving the quality of captured images.
[0006] In a first aspect, embodiments of this application provide an image processing method, comprising: determining a first brightness value of a first image from an image capturing device, the first brightness value representing the average brightness of a central region of the first image; determining a second brightness value of the first image, the second brightness value representing the average brightness of pixel blocks in the first image whose brightness values are greater than a first threshold; determining a third brightness value of the first image, the third brightness value representing the average brightness of pixel blocks included in the first image; and determining supplementary lighting parameters of the image capturing device based on at least one of the first brightness value, the second brightness value, and the third brightness value, the supplementary lighting parameters being used by the image capturing device to capture a next image.
[0007] In this embodiment, the image processing device can determine the supplementary lighting parameters for capturing the next image based on the brightness information of the first image (such as the first image) currently captured by the image capturing device. This improves the capturing effect of the next image. Compared to the prior art's method of using the same supplementary lighting parameters at the same focal length, the method of adjusting the supplementary lighting parameters in this embodiment is more flexible, allowing the image capturing device to use different supplementary lighting parameters for different images, thereby improving the image quality. Furthermore, using the brightness information of previously captured images to determine the supplementary lighting parameters for the next image makes the obtained supplementary lighting parameters more valuable and allows for more precise determination of the supplementary lighting parameters.
[0008] In one possible implementation, determining the supplementary lighting parameter of the image processing device based on at least one of the first brightness value, the second brightness value, and the third brightness value includes: if the current brightness value is greater than a second threshold, then determining the difference between a first reference brightness value and a fourth brightness value as the supplementary lighting parameter, wherein the current brightness value is at least one of the first brightness value, the second brightness value, and the third brightness value, and the fourth brightness value is determined based on the current brightness value; if the current brightness value is less than a third threshold, then determining the sum of the first reference brightness value and the fourth brightness value as the supplementary lighting parameter, wherein the second threshold is greater than the third threshold.
[0009] In this embodiment, if the image processing device determines that the current brightness value is greater than the second threshold, it indicates that the brightness of the first image is relatively strong. Therefore, the supplementary lighting parameter for the next image capture can be reduced. Thus, the difference between the first reference brightness value and the fourth brightness value can be determined as the supplementary lighting parameter, thereby improving the effect of the next image capture. If the image processing device determines that the current brightness value is less than the third threshold, it indicates that the brightness of the first image is relatively weak. Therefore, the supplementary lighting parameter for the next image capture needs to be increased. Thus, the sum of the first reference brightness value and the fourth brightness value is determined as the supplementary lighting parameter. Consequently, the brightness of the next image captured by the image capturing device is higher than that of the first image, resulting in a better image effect.
[0010] In one possible implementation, the method further includes: if the first brightness difference and the second brightness difference are greater than a fourth threshold, or if the first brightness difference and the second brightness difference are less than the fourth threshold, then the first brightness value or the second brightness value is determined as the current brightness value, wherein the first brightness difference is the absolute value of the difference between the first brightness value and the first target brightness value, and the second brightness difference is the absolute value of the difference between the second brightness value and the second target brightness value; if one of the first brightness difference and the second brightness difference is less than the fourth threshold and the other is greater than the fourth threshold, then the third brightness value is determined as the current brightness value.
[0011] In this embodiment, if the image processing device determines that both the first brightness difference and the second brightness difference are simultaneously greater than or simultaneously less than a fourth threshold, it indicates that the brightness values of various regions of the first image are not significantly different. Therefore, either the first brightness value or the second brightness value can be selected as the current brightness value to calculate the supplementary lighting parameters. This simplifies the determination of the brightness for the next image and ensures a uniform distribution of brightness in the next image. If one of the first brightness difference and the second brightness difference is greater than the fourth threshold and the other is less than the fourth threshold, it indicates that the brightness values of the central region and the highlight region of the first image are significantly different. Therefore, a third brightness value can be selected to calculate the supplementary lighting parameters, ensuring that the supplementary lighting parameters guarantee the uniformity of brightness in the next image (i.e., the next image) and improving the quality of the next image.
[0012] In one possible implementation, the method further includes: if the first brightness difference is greater than the second brightness difference, and the number of pixel blocks in the first image whose brightness value is greater than the first threshold is less than half the number of pixel blocks included in the first image, then the first brightness value is determined as the current brightness value; or, if the first brightness difference is less than the second brightness difference, and / or the number of pixel blocks corresponding to the second brightness value is greater than half the number of pixel blocks included in the first image, then the second brightness value is determined as the current brightness value.
[0013] In this embodiment, if the image processing device determines that the first brightness difference is greater than the second brightness difference, it means that the brightness value of the central region is greater than the brightness value of the bright region, and the number of pixel blocks included in the bright region is less than half the number of pixel blocks included in the first image. This indicates that the central region of the first image is brighter, while the brightness of the remaining regions is lower. Therefore, the first brightness value better reflects the current supplementary lighting parameters of the image capturing device. Thus, determining the supplementary lighting parameters based on the first brightness value makes the determined supplementary lighting parameters more accurate. Conversely, if the image processing device determines that the brightness value of the central region is less than the brightness value of the bright region, it means that the brightness of the central region is lower, while the brightness of the remaining regions is higher. Therefore, determining the supplementary lighting parameters based on the second brightness value makes the determined supplementary lighting parameters more accurate, which is beneficial to improving the effect of the image capturing device in capturing the next image.
[0014] In one possible implementation, if the current brightness value is greater than the second threshold, then the fourth brightness value is positively correlated with the current brightness value; or, if the current brightness value is less than the third threshold, then the fourth brightness value is negatively correlated with the current brightness value.
[0015] In this embodiment, the image processing device determines the correlation between the fourth brightness value and the current brightness value based on the relationship between the current brightness value and the second threshold, thereby making the calculated fourth brightness value more accurate, and thus the supplementary lighting parameters calculated based on the fourth brightness value are also more accurate.
[0016] In one possible implementation, the method further includes: if the current brightness value is less than a second threshold and greater than a third threshold, then the first reference brightness value is determined as the supplementary lighting parameter.
[0017] In this embodiment, when the image processing device determines that the current brightness value is between the second threshold and the third threshold, it can determine the current first reference brightness value to achieve the best image effect for the first image, so there is no need to adjust the first reference brightness value.
[0018] In one possible implementation, the method further includes: if the supplementary lighting parameter is within a first range and the current brightness value is greater than a fourth threshold, then adjusting the exposure mode of the image processing device to a first mode, wherein the first mode indicates that the exposure of the central area of the image is greater than the exposure of other areas; if the supplementary lighting parameter is not within the first range, or the current brightness value is less than the fourth threshold, then adjusting the exposure mode of the image processing device to a second mode, wherein the second mode indicates that the exposure of the image area is evenly distributed.
[0019] In this embodiment, after the image processing device adjusts the supplementary lighting parameters, if the supplementary lighting parameters are still within the first range (i.e., the supplementary lighting parameters have been adjusted to the minimum range), the exposure mode is adjusted to the first mode. This allows the image capturing device to increase the brightness of the central area of the captured image when capturing the next image, thereby improving the image quality. If the image processing device determines that the supplementary lighting parameters are not within the first range, or the current brightness value is less than a fourth threshold (i.e., the supplementary lighting parameters have been increased), the exposure mode of the image capturing device is adjusted to the second mode. This uniformly increases the brightness of the next image captured by the image capturing device, resulting in a better image quality.
[0020] Secondly, embodiments of this application provide an image processing apparatus, comprising: a brightness determination module, configured to determine a first brightness value of a first image from an image capturing device, the first brightness value representing the average brightness of a central region of the first image; a second brightness value of the first image, the second brightness value representing the average brightness of pixel blocks in the first image whose brightness values are greater than a first threshold; and a third brightness value of the first image, the third brightness value representing the average brightness of pixel blocks included in the first image; and a supplementary lighting parameter adjustment module, configured to determine supplementary lighting parameters of the image capturing device based on at least one of the first brightness value, the second brightness value, and the third brightness value, the supplementary lighting parameters being used by the image capturing device to capture the next image.
[0021] In one possible implementation, the brightness determination module is further configured to: if the current brightness value is greater than a second threshold, determine the difference between a first reference brightness value and a fourth brightness value as the supplementary lighting parameter, wherein the current brightness value is at least one of the first brightness value, the second brightness value, and the third brightness value, and the fourth brightness value is determined based on the current brightness value; and if the current brightness value is less than a third threshold, determine the sum of the first reference brightness value and the fourth brightness value as the supplementary lighting parameter, wherein the second threshold is greater than the third threshold.
[0022] In one possible implementation, the brightness determination module is further configured to: determine the first brightness value or the second brightness value as the current brightness value if the first brightness difference and the second brightness difference are greater than a fourth threshold, or if the first brightness difference and the second brightness difference are less than the fourth threshold; wherein the first brightness difference is the absolute value of the difference between the first brightness value and the first target brightness value, and the second brightness difference is the absolute value of the difference between the second brightness value and the second target brightness value; and determine the third brightness value as the current brightness value if one of the first brightness difference and the second brightness difference is less than the fourth threshold and the other is greater than the fourth threshold.
[0023] In one possible implementation, the brightness determination module is further configured to: determine the first brightness value as the current brightness value if the first brightness difference is greater than the second brightness difference, and the number of pixel blocks in the first image whose brightness value is greater than the first threshold is less than half the number of pixel blocks included in the first image; or, determine the second brightness value as the current brightness value if the first brightness difference is less than the second brightness difference, and / or the number of pixel blocks corresponding to the second brightness value is greater than half the number of pixel blocks included in the first image.
[0024] In one possible implementation, if the current brightness value is greater than the second threshold, then the fourth brightness value is positively correlated with the current brightness value; or, if the current brightness value is less than the third threshold, then the fourth brightness value is negatively correlated with the current brightness value.
[0025] In one possible implementation, the brightness determination module is further configured to determine the first reference brightness value as the supplementary lighting parameter if the current brightness value is less than a second threshold and greater than a third threshold.
[0026] In one possible implementation, the image processing device further includes an exposure adjustment module, which is configured to adjust the exposure mode of the image capturing device to a first mode if the supplementary lighting parameter is within a first range and the current brightness value is greater than a fourth threshold, wherein the first mode indicates that the exposure of the central area of the image capture is greater than the exposure of other areas; and to adjust the exposure mode of the image capturing device to a second mode if the supplementary lighting parameter is not within the first range or the current brightness value is less than the fourth threshold, wherein the second mode indicates that the exposure of the captured area is evenly distributed.
[0027] Thirdly, embodiments of this application provide an image processing apparatus, including: at least one processor, and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the at least one processor implements the method as described in the first aspect and any possible implementation by executing the instructions stored in the memory.
[0028] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer instructions that, when executed on a computer, cause the computer to perform the methods as described in the first aspect and any possible implementation.
[0029] The beneficial effects of the second to fourth aspects can be referred to the discussion in the first aspect above, and will not be listed here again. Attached Figure Description
[0030] Figure 1 This is a schematic diagram illustrating an application scenario of an image processing method provided in an embodiment of this application;
[0031] Figure 2 A schematic flowchart of an image processing method provided in an embodiment of this application;
[0032] Figure 3 This is a schematic diagram of dividing a first image according to an embodiment of the present application;
[0033] Figure 4A schematic flowchart illustrating the process of determining supplementary lighting parameters using an image processing apparatus according to an embodiment of this application;
[0034] Figure 5 A flowchart illustrating a working mode for determining exposure, provided as an embodiment of this application;
[0035] Figure 6 A schematic diagram of the structure of an image processing apparatus provided in this application embodiment. Figure 1 ;
[0036] Figure 7 A schematic diagram of the structure of an image processing apparatus provided in this application embodiment. Figure 2 . Detailed Implementation
[0037] To better understand the technical solutions provided in this application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0038] Please refer to Figure 1 This is a schematic diagram illustrating an application scenario of an image processing method provided in an embodiment of this application. For example... Figure 1 As shown, the scene includes an image capturing device 110 and an image processing device 120. The image capturing device 110 and the image processing device 120 can communicate wirelessly.
[0039] The image capturing device 110 refers to a device with image capturing capabilities, such as a video camera or a camcorder. A video camera may be a bullet camera or a dome camera, and a camcorder may be a panoramic camera. The image processing device 120 refers to a device with image processing capabilities, such as a server or a terminal device. A terminal device may be a personal computer (PC), a tablet, a laptop, or a handheld computer.
[0040] For example, the image capturing device 110 captures (or acquires) an image and sends the image to the image processing device 120. The image processing device 120 receives the image and, based on the brightness information of the image, determines the supplementary lighting parameters required for the next capture by the image capturing device 110. The specific details of how the image processing device 120 determines the supplementary lighting parameters will be described in detail below.
[0041] In one possible implementation, the image capturing device 110 includes a supplementary lighting component 111, which may be, for example, a light-emitting diode (LED) or an incandescent lamp. The supplementary lighting component 111 is used to provide supplementary lighting for the image capturing device.
[0042] For example, after the image processing device 120 determines the supplementary lighting parameters, it can send a control command to the image capturing device 110, which indicates the supplementary lighting parameters. The image capturing device 110 can then control the supplementary lighting component 111 to perform supplementary lighting according to the supplementary lighting parameters based on the control command.
[0043] In one possible implementation, the image processing apparatus 120 includes an image signal processor (ISP). The image signal processor 121 can be software or hardware, and this embodiment of the application does not limit this. The image signal processor 121 can determine the brightness value of each pixel block among a plurality of pixel blocks included in the image.
[0044] In one possible implementation, the image capturing device 110 and the image processing device 120 may be coupled together. In this case, the image capturing device 110 and the image processing device 120 can be considered as the same device. For example, both the image capturing device 110 and the image processing device 120 are terminal devices, with the image capturing device 110 specifically being a camera on the terminal device, and the image processing device 120 being, for example, a processor of the terminal device.
[0045] All embodiments of this application can be applied to Figure 1 The application scenarios shown are illustrated. The image processing apparatus involved in the embodiments of this application is, for example, [example of such apparatus]. Figure 1 The image processing device 120 shown in this application embodiment is, for example, an image capturing device. Figure 1 The image capturing device 110 shown in this application embodiment includes, for example, a supplementary lighting component. Figure 1 The supplementary lighting component 111 shown in this application embodiment is, for example, an image signal processor. Figure 1 The image signal processor 121 shown.
[0046] Please refer to Figure 2 This is a flowchart illustrating an image processing method provided in an embodiment of this application.
[0047] S201, the image processing device determines a first brightness value of the currently captured first image, the first brightness value representing the average brightness of the central region of the first image.
[0048] The first image is an image received by the image processing device from the image capturing device. After acquiring the first image, the image processing device obtains the brightness value of each pixel block from a plurality of pixel blocks, which include all pixel blocks of the first image. The size of the pixel blocks can be preset by the image capturing device or divided by the image processing device. For example, the image processing device divides the first image into multiple pixel blocks using an image signal processor and determines the brightness value of each pixel block within these multiple pixel blocks.
[0049] When the image signal processor divides the first image into multiple pixel blocks, the number of pixel blocks can be set according to actual needs, such as 17*15 pixel blocks or 32*32 pixel blocks. This application embodiment does not limit this.
[0050] As an example, the image processing device may determine the central region of the first image and determine a first brightness value based on the average brightness of the central region.
[0051] Please refer to Figure 3 This is a schematic diagram of the central region of a first image provided in an embodiment of this application. Figure 3 As shown, the first image comprises a total of 9 pixel block sets. Each pixel block set can be referred to as a large block, and each pixel block set includes at least one pixel block. The 9 pixel block sets are specifically as follows: Figure 3 The dashed boxes in the middle indicate the first, second, third, fourth, fifth, sixth, seventh, eighth, and ninth large blocks. The image processing device can determine the average brightness value of the pixel blocks included in the fifth large block and use the determined average value as the average brightness value of the central region of the first image.
[0052] S202, the image processing device determines a second brightness value of the first image, the second brightness value representing the average brightness of pixel blocks in the first image whose brightness values are greater than a first threshold.
[0053] The image processing device filters multiple pixel blocks and identifies pixel blocks with brightness values greater than a first threshold as bright pixel blocks. It then determines the average brightness value of all bright pixel blocks in the first image to obtain a second brightness value.
[0054] Optionally, the first threshold may be pre-stored in the image processing device, and the first threshold may be set by the image processing device according to actual needs.
[0055] For example, the image processing device sets a first threshold based on the data bit width. For instance, the first threshold is set as the rounded result of half the maximum brightness value of the data bit width of the image processing device. The maximum brightness value refers to the maximum upper limit of brightness that the image processing device can adjust within the data bit width. The data bit width refers to the maximum amount of data that the image processing device can transmit at any given time.
[0056] For example, if the data width of the image processing device is 8 bits, and the maximum brightness value of the image processing device under this data width is 255, then the image processing device sets the first threshold to 128.
[0057] S203, the image processing device determines a third brightness value of the first image, the third brightness value representing the average brightness of the pixel blocks included in the first image.
[0058] The image processing device performs an average calculation on the brightness values of multiple pixel blocks in the first image, and the result of the average calculation is the third brightness value.
[0059] S204, the image processing device determines the supplementary lighting parameters of the image capturing device based on at least one of the first brightness value, the second brightness value, and the third brightness value. The supplementary lighting parameters are used by the image capturing device to capture the next image.
[0060] In method one, the image processing device can determine the average value of the first brightness value, the second brightness value, and the third brightness value, and determine the difference between the determined average value and the ninth threshold as the supplementary lighting parameter.
[0061] The ninth threshold can be set according to actual needs or it can be set according to the fourth threshold. For example, the ninth threshold is the same as the fourth threshold. The specific meaning of the fourth threshold will be explained in detail below.
[0062] In the second method, the image processing device can determine the average value of two of the first brightness value, the second brightness value, and the third brightness value, and determine the difference between the determined average value and the ninth threshold as the supplementary lighting parameter.
[0063] In method three, the image processing device can determine the supplementary lighting parameters based on the first brightness value, the second brightness value, or the third brightness value. For ease of description, the first brightness value, the second brightness value, or the third brightness value will be referred to as the current brightness value below.
[0064] The following describes the specific method by which the image processing device determines the current brightness value.
[0065] In the first case, the image processing device determines the first brightness value as the current brightness value.
[0066] If the image processing device determines that both the first brightness difference and the second brightness difference are greater than the fourth threshold, or both the first brightness difference and the second brightness difference are less than the fourth threshold, then it determines that the first brightness difference is greater than the second brightness difference, and that the number of pixel blocks in the first image with brightness values greater than the first threshold is less than half the number of pixel blocks included in the first image, then it determines the first brightness value as the current brightness value.
[0067] Wherein, the first brightness difference is the absolute value of the difference between the first brightness value and the first target brightness value, and the second brightness difference is the absolute value of the difference between the second brightness value and the second target brightness value. The first target brightness value and the second target brightness value are pre-stored in the image processing device. The first target brightness value and the second target brightness value can be understood as the brightness values when the image effect is optimal. The first target brightness value and the second target brightness value can be set according to actual needs. For example, the first target brightness value and the second target brightness value are set according to the processing accuracy in the image processing device. The processing accuracy refers to the maximum word length that the processor in the image processing device can process within a certain period of time.
[0068] For example, if the processor in the image processing device has a precision of 8 bits, then the corresponding image brightness range of the image processing device is 0 to 255. Therefore, one or two brightness values between 0 and 255 can be selected as the first target brightness value and the second target brightness value. In other words, the brightness values of the first target value and the second target value can be the same or different. Furthermore, the first target value or the second target value can also be set as a fourth threshold, which is not limited in this embodiment.
[0069] The fourth threshold may be pre-existing in the image processing device, and the fourth threshold may be determined based on actual needs, such as the first target value or the second target value. This application embodiment does not limit this.
[0070] In the second case, the image processing device uses the second brightness value as the current brightness value.
[0071] If the image processing device determines that both the first brightness difference and the second brightness difference are greater than the fourth threshold, or both the first brightness difference and the second brightness difference are less than the fourth threshold, then it determines that the first brightness difference is less than the second brightness difference, and / or the number of pixel blocks corresponding to the second brightness value is greater than half the number of pixel blocks included in the first image, then the second brightness value is determined as the current brightness value.
[0072] In the third case, the image processing device uses the third brightness value as the current brightness value.
[0073] If the image processing device determines that one of the first brightness difference and the second brightness difference is less than the fourth threshold and the other is greater than the fourth threshold, then the third brightness value is determined as the current brightness value.
[0074] The specific meanings of the first brightness difference, the second brightness difference, and the fourth threshold can be found in the previous discussion, and will not be repeated here.
[0075] In the fourth case, the image processing device determines the current brightness value based on the first brightness value and the second brightness value.
[0076] In the first and second cases described above, the image processing device may also determine the average of the first brightness value and the second brightness value as the current brightness value, or the image processing device may calculate the current brightness value based on the weights of the first brightness value and the second brightness value.
[0077] Method 3 may include any one of the following sub-methods: Method 1 to Method 3.
[0078] In Sub-method 1, the image processing device determines the supplementary lighting parameter by comparing the current brightness value with the fourth threshold value, and then using the difference or sum of the first reference brightness value and the fourth brightness value as the parameter. The current brightness value can be the first brightness value, the second brightness value, or the third brightness value.
[0079] The specific meaning of the fourth threshold can be referred to the content discussed above, and will not be repeated here. The first reference brightness value can be the supplementary lighting parameter used by the image processing device when acquiring the previous frame image of the first image, or the first reference brightness value can also be the initial supplementary lighting parameter set by the image processing device. The first reference value can be determined according to actual needs, and this application embodiment does not limit it. The fourth brightness value is determined by the image processing device based on the current brightness value, and its specific determination method will be described in detail below.
[0080] Sub-mode 2: The image processing device determines the sum of the difference between the current brightness value and the ninth threshold and the first reference brightness value as the supplementary lighting parameter.
[0081] The specific meaning of the ninth threshold can be found in the previous discussion, and will not be repeated here.
[0082] Sub-method 3: The image processing device determines the difference between the current brightness value and the ninth threshold and the first reference value as the supplementary lighting parameter.
[0083] In one possible implementation, after the image processing device obtains the supplementary lighting parameters, it can send the supplementary lighting parameters to the image capturing device, so that the image capturing device can capture the next image based on the supplementary lighting parameters.
[0084] The following is combined Figure 4 The diagram shows a flowchart of an image processing device determining supplementary lighting parameters, and explains the method by which the image processing device determines supplementary lighting parameters according to the first determination method.
[0085] S401, the image processing device determines whether the current brightness value is greater than the second threshold.
[0086] The second threshold is preset in the image processing device, and the second threshold can be set according to actual needs. For example, the second threshold can be set to twice the fourth threshold. This application embodiment does not limit this.
[0087] In one possible implementation, when the image processing device determines that the current brightness value is greater than a second threshold, it may further mark the brightness adjustment trend as decreasing. The brightness adjustment trend is used to indicate whether the image processing device needs to increase or decrease the brightness value based on the first reference brightness value. The brightness adjustment trend includes increase, decrease, and hold on.
[0088] For example, when the image processing device marks the brightness adjustment trend as decreasing, it adds a fourth brightness value to the first reference brightness value to obtain the supplementary lighting parameters.
[0089] If the image processing device determines that the current brightness value is greater than the second threshold, it executes S402, that is, the image processing device determines the difference between the first reference brightness value and the fourth brightness value as the supplementary lighting parameter. The first reference brightness value can be referred to the content discussed above, and will not be repeated here.
[0090] The fourth brightness value is determined based on the current brightness value and is related to the magnitude of the current brightness value. Alternatively, it can be understood that the fourth brightness value is related to the brightness trend marker.
[0091] If the image processing device determines that the current brightness value is greater than the second threshold, or determines that the brightness adjustment trend is marked as decreasing, then it determines the size of the current brightness difference and the eighth threshold. The current brightness difference is the absolute value of the difference between the current brightness value and the fourth threshold. The eighth threshold is pre-stored in the image processing device and can be set according to actual needs. For example, the eighth threshold is one-tenth of the fourth threshold.
[0092] If the image processing device determines that the current brightness difference is greater than the eighth threshold, a specific calculation formula for determining the fourth brightness value is as follows.
[0093] step=table_max*(evError / γ-1) (1)
[0094] If the image processing device determines that the current brightness difference is less than the eighth threshold, a specific calculation method for determining the fourth brightness difference is as follows.
[0095] step=table_max*(1-evError / γ) (2)
[0096] Here, step represents the position of the fourth brightness value in the pre-stored lookup table, which includes brightness values that can be adjusted by the image processing device; table_max represents the maximum number of elements in the lookup table; evError represents the current brightness difference; and γ represents the eighth threshold.
[0097] After the image processing device determines the position of the fourth brightness value in the lookup table using the above formula (1) or formula (2), it can determine the fourth brightness value in the lookup table according to the corresponding position.
[0098] For example, if the image processing device calculates step = 3 and the lookup table is table[step] = {2, 4, 6, 8, 10}, then table[3] = 8, thus obtaining the fourth brightness value of 8.
[0099] If the image processing device determines that the current brightness value is less than the second threshold, then S403 is executed, that is, the image processing device determines whether the current brightness value is less than the third threshold. The third threshold is less than the second threshold, and the third threshold can be set according to actual needs. For example, the third threshold is 1.5 times the fourth threshold; however, this embodiment does not limit this setting.
[0100] S402, the image processing device determines the difference between the first reference brightness value and the fourth brightness value as the supplementary lighting parameter.
[0101] The specific meaning of the first reference brightness value can be found in the previous text and will not be repeated here.
[0102] S403, the image processing device determines whether the current brightness value is less than the third threshold.
[0103] The specific meaning of the third threshold can be found in the previous discussion, and will not be repeated here.
[0104] In one possible implementation, after determining that the current brightness value is less than a third threshold, the image processing device marks the brightness adjustment trend as increasing. The specific meaning of the brightness adjustment trend mark can be found in the preceding discussion and will not be repeated here.
[0105] If the image processing device determines that the current brightness value is less than the third threshold, it executes S404, whereby the image processing device determines the sum of the first reference brightness value and the fourth brightness value as the supplementary lighting parameter. In this case, when the image processing device determines that the current brightness value is less than the third threshold, or determines that the brightness adjustment trend is marked as increasing, it needs to determine the magnitude of the current brightness difference and the eighth threshold to determine the fourth brightness value. The specific meaning of the eighth threshold can be found in the preceding discussion and will not be repeated here.
[0106] If the image processing device determines that the current brightness difference is greater than the eighth threshold, then one method for determining the fourth brightness value is as follows.
[0107] step=(table_max / 2)*(evError / γ-1) (3)
[0108] If the image processing device determines that the current brightness difference is less than the eighth threshold, then a method for determining the fourth brightness value is as follows.
[0109] step=(table_max / 2)*(1-evError / γ) (4)
[0110] The specific method by which the image processing device determines the fourth brightness value based on the above formula (3) or formula (4) can be referred to the specific method by which the image processing device determines the fourth brightness value based on formula (1) or formula (2) mentioned above, and will not be repeated here.
[0111] If the image processing device determines that the current brightness value is less than the second threshold and greater than the third threshold, it executes step S405, which means the image processing device determines the first reference brightness value as the supplementary lighting parameter. In other words, when the image processing device determines that the current brightness value is less than the second threshold and greater than the third threshold, it does not adjust the first reference brightness value, or this can be understood as not adjusting the supplementary lighting parameter of the image processing device. The specific meaning of the first reference brightness value can be found in the preceding discussion and will not be repeated here.
[0112] S404, the image processing device determines the sum of the first reference brightness value and the fourth brightness value as the supplementary lighting parameter.
[0113] S405, the image processing device determines the first reference brightness value as the supplementary lighting parameter. In one possible implementation, when the image processing device determines that the current brightness value is less than a second threshold and greater than a third threshold, it marks the brightness adjustment trend as maintained.
[0114] To achieve optimal image brightness in the image acquired by the image processing device, the exposure mode of the image capturing device can be adjusted. The specific method for adjusting the exposure mode of the image capturing device is explained below.
[0115] For example, the exposure modes of the image capturing device include a first mode and a second mode, wherein the first mode indicates that the exposure of the central area of the image is greater than the exposure of other areas, and the second mode indicates that the exposure of the captured area is evenly distributed. Therefore, the first mode can also be called a center-metering exposure mode, and the second mode can also be called an average-metering exposure mode.
[0116] If the image processing device determines that the supplementary lighting parameters fall within a first range and the current brightness value is greater than a fourth threshold, it adjusts the exposure mode of the image capturing device to the first mode, which indicates that the exposure of the central area of the image is greater than the exposure of other areas. If the image processing device determines that the supplementary lighting parameters do not fall within the first range, or the current brightness value is less than the fourth threshold, it adjusts the exposure mode of the image capturing device to the second mode, which indicates that the exposure of the captured area is evenly distributed.
[0117] The first range can be determined based on actual needs, or it can be determined according to a range of adjustable supplementary lighting parameters of the supplementary lighting component of the image capturing device, such as 5 to 10. This application embodiment does not limit this.
[0118] In one possible implementation, the first range includes only one value (such as a fifth threshold), and the image processing device adjusts the exposure mode of the image capturing device based on the fifth threshold. The following will combine... Figure 5 The flowchart shown illustrates a method for determining the working mode of an image capturing device in this application embodiment.
[0119] S501, the image processing device determines whether the supplementary lighting parameter is greater than the fifth threshold.
[0120] The fifth threshold is set to 0. The specific method for determining the supplementary lighting parameters can be found in the previous discussion and will not be repeated here.
[0121] If the image processing device determines that the supplementary lighting parameter is greater than the fifth threshold, then S502 is executed, that is, the image processing device determines whether the supplementary lighting parameter is equal to the sixth threshold. The sixth threshold can be set according to actual needs, or it can be set according to the supplementary lighting parameter in the image capturing device. For example, the sixth threshold is the minimum value of the supplementary lighting parameter that can be adjusted by the supplementary lighting component in the image capturing device.
[0122] If the image processing device determines that the supplementary lighting parameter is less than the fifth threshold, it executes S506, that is, the image processing device adjusts the exposure mode of the image capturing device to the second mode.
[0123] S502, the image processing device determines whether the supplementary lighting parameter is equal to the sixth threshold.
[0124] If the image processing device determines that the supplementary lighting parameter is equal to the sixth threshold, then S503 is executed, that is, the image processing device determines whether the current brightness value is greater than the fourth threshold. If the image processing device determines that the supplementary lighting parameter is not equal to the sixth threshold, then S506 is executed, that is, the image processing device adjusts the exposure mode of the image capturing device to the second mode.
[0125] S503, the image processing device determines whether the current brightness value is greater than the fourth threshold.
[0126] The specific meaning of the fourth threshold can be found in the previous discussion, and will not be repeated here.
[0127] If the image processing device determines that the current brightness value is greater than the fourth threshold, then S504 is executed, in which the image processing device determines whether the current brightness difference is greater than the seventh threshold. The seventh threshold can be set according to actual needs or determined based on the fourth threshold; for example, the seventh threshold can be one-fifth of the fourth threshold.
[0128] If the image processing device determines that the current brightness value is less than the fourth threshold, it executes S506, that is, the image processing device adjusts the exposure mode of the image capturing device to the second mode.
[0129] S504, the image processing device determines whether the current brightness difference is greater than the seventh threshold.
[0130] If the image processing device determines that the current brightness difference is greater than the seventh threshold, it executes S505, adjusting the exposure mode of the image capturing device to the first mode. If the image processing device determines that the current brightness difference is less than the seventh threshold, it executes S506, adjusting the exposure mode of the image capturing device to the second mode.
[0131] S505, the image processing device adjusts the exposure mode of the image capturing device to the first mode.
[0132] After executing S501 to S504, the image processing device can adjust the exposure mode of the image capturing device to the first mode.
[0133] S506, the image processing device adjusts the exposure mode of the image capturing device to the second mode.
[0134] If any of the following conditions (the supplementary light parameter is greater than the fifth threshold, the supplementary light parameter is equal to the sixth threshold, the current brightness value is greater than the fourth threshold, and the current brightness difference is greater than the seventh threshold) are not met during the execution of S501 to S504, the exposure mode of the image capturing device will be adjusted to the second mode. The specific meaning of the second mode can be referred to the content discussed above, and will not be repeated here.
[0135] Based on the same inventive concept, this application provides an image processing apparatus. This apparatus is used to implement any of the above-described image processing methods, for example... Figure 2 , Figure 4 or Figure 5 The image processing method shown is described, and the device can also perform the functions of the image processing device described above.
[0136] Please refer to Figure 6 This is a schematic diagram of the structure of an image processing device provided in an embodiment of this application. Figure 6 As shown, the image processing device 600 includes a brightness determination module 601 and a supplementary lighting parameter adjustment module 602.
[0137] For example, the brightness determination module 601 is used to determine a first brightness value of a first image from the image capturing device, the first brightness value representing the average brightness of the central region of the first image; and to determine a second brightness value of the first image, the second brightness value representing the average brightness of pixel blocks in the first image whose brightness value is greater than a first threshold; and to determine a third brightness value of the first image, the third brightness value representing the average brightness of pixel blocks included in the first image; the supplementary light parameter adjustment module 602 is used to determine supplementary light parameters of the image capturing device based on at least one of the first brightness value, the second brightness value, and the third brightness value, the supplementary light parameters being used by the image capturing device to capture the next image.
[0138] In one possible implementation, the brightness determination module 601 is further configured to: if the current brightness value is greater than a second threshold, determine the difference between the first reference brightness value and the fourth brightness value as a supplementary lighting parameter, wherein the current brightness value is at least one of the first brightness value, the second brightness value, and the third brightness value, and the fourth brightness value is determined based on the current brightness value; and if the current brightness value is less than a third threshold, determine the sum of the first reference brightness value and the fourth brightness value as a supplementary lighting parameter, wherein the second threshold is greater than the third threshold.
[0139] In one possible implementation, the brightness determination module 601 is further configured to: determine the first brightness value or the second brightness value as the current brightness value if the first brightness difference and the second brightness difference are greater than a fourth threshold, or if the first brightness difference and the second brightness difference are less than the fourth threshold; wherein the first brightness difference is the absolute value of the difference between the first brightness value and the first target brightness value, and the second brightness difference is the absolute value of the difference between the second brightness value and the second target brightness value; and determine the third brightness value as the current brightness value if one of the first brightness difference and the second brightness difference is less than the fourth threshold and the other is greater than the fourth threshold.
[0140] In one possible implementation, the brightness determination module 601 is further configured to: determine the first brightness value as the current brightness value if the first brightness difference is greater than the second brightness difference, and the number of pixel blocks in the first image whose brightness value is greater than the first threshold is less than half the number of pixel blocks included in the first image; or, determine the second brightness value as the current brightness value if the first brightness difference is less than the second brightness difference, and / or the number of pixel blocks corresponding to the second brightness value is greater than half the number of pixel blocks included in the first image.
[0141] In one possible implementation, if the current brightness value is greater than the second threshold, then the fourth brightness value is positively correlated with the current brightness value; or, if the current brightness value is less than the third threshold, then the fourth brightness value is negatively correlated with the current brightness value.
[0142] In one possible implementation, the brightness determination module 601 is further configured to determine the first reference brightness value as the supplementary lighting parameter if the current brightness value is less than the second threshold and greater than the third threshold.
[0143] In one possible implementation, the image processing device further includes an exposure adjustment module 603, which is configured to adjust the exposure mode of the image capturing device to a first mode if the supplementary lighting parameter is within a first range and the current brightness value is greater than a fourth threshold, wherein the first mode indicates that the exposure of the central area of the image capture is greater than the exposure of other areas of the image capture; and to adjust the exposure mode of the image capturing device to a second mode if the supplementary lighting parameter is not within the first range or the current brightness value is less than the fourth threshold, wherein the second mode indicates that the exposure of the captured area is evenly distributed.
[0144] This application provides an image processing apparatus. Please refer to... Figure 7 This is a schematic diagram of the structure of an image processing apparatus 700 provided in an embodiment of this application. The image processing apparatus 700 includes: at least one processor 701, and a memory 702 communicatively connected to the at least one processor 701; wherein the memory 702 stores instructions executable by the at least one processor 701, and the at least one processor 701 implements the image processing method as described above by executing the instructions stored in the memory 702, for example... Figure 2 , Figure 4 or Figure 5 The image processing method shown.
[0145] As an example, an embodiment of this application Figure 7 The image processing device 700 shown can realize the above-mentioned... Figure 6 The functions of the image processing device 600 shown are as follows: Figure 7 At least one processor 701 shown can also implement the aforementioned Figure 6 The functions of the brightness determination module 601, the fill light parameter adjustment module 602, and the exposure adjustment module 603 shown are illustrated.
[0146] This application provides a computer-readable storage medium storing computer instructions. When these instructions are executed on a computer, they cause the computer to perform the image processing method described in any of the preceding embodiments, for example... Figure 2 , Figure 4 or Figure 5 The image processing method shown.
[0147] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0148] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0149] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0150] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the functions specified in one or more boxes. Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, this application also intends to include such modifications and variations if they fall within the scope of the claims of this application and their equivalents.
Claims
1. An image processing method, characterized by, The method is applied to an image processing device, and comprises the following steps: determining a first brightness value of a first image from an image capturing device, the first brightness value representing an average brightness value of a central region of the first image; determining a second brightness value of the first image, the second brightness value representing an average brightness value of a pixel block with a brightness value greater than a first threshold value in the first image; determining a third brightness value of the first image, the third brightness value representing an average brightness value of a pixel block included in the first image; determining a light compensation parameter of the image capturing device according to at least one of the first brightness value, the second brightness value and the third brightness value, the light compensation parameter being used for capturing a next image by the image capturing device, wherein the determining of the light compensation parameter of the image processing device according to at least one of the first brightness value, the second brightness value and the third brightness value comprises: if a current brightness value is greater than a second threshold value, determining a difference between a first reference brightness value and a fourth brightness value as the light compensation parameter, the current brightness value being at least one of the first brightness value, the second brightness value and the third brightness value, the fourth brightness value being determined according to the current brightness value, the first reference brightness value being a light compensation parameter used by the image processing device when acquiring a previous frame image of the first image, or the first reference brightness value being an initial light compensation parameter set by the image processing device; if the current brightness value is less than a third threshold value, determining a sum of the first reference brightness value and the fourth brightness value as the light compensation parameter, the second threshold value being greater than the third threshold value; wherein if a first brightness difference and a second brightness difference are greater than a fourth threshold value, or the first brightness difference and the second brightness difference are less than the fourth threshold value, the current brightness value is the first brightness value or the second brightness value, the first brightness difference being an absolute value of a difference between the first brightness value and a first target brightness value, the second brightness difference being an absolute value of a difference between the second brightness value and a second target brightness value; if one of the first brightness difference and the second brightness difference is less than the fourth threshold value and the other is greater than the fourth threshold value, the current brightness value is the third brightness value, if the current brightness value is greater than the second threshold value, the fourth brightness value is positively correlated with the current brightness value, or if the current brightness value is less than the third threshold value, the fourth brightness value is inversely correlated with the current brightness value.
2. The method of claim 1, wherein, The method further comprises: if the first brightness difference is greater than the second brightness difference, and a number of pixel blocks with a brightness value greater than the first threshold value in the first image is less than half of a number of pixel blocks included in the first image, determining the first brightness value as the current brightness value; or if the first brightness difference is less than the second brightness difference, and / or a number of pixel blocks corresponding to the second brightness value is greater than half of a number of pixel blocks included in the first image, determining the second brightness value as the current brightness value.
3. The method according to claim 1 or 2, characterized in that, The method further comprises: if the current brightness value is less than the second threshold value and greater than the third threshold value, determining the first reference brightness value as the light compensation parameter.
4. The method according to claim 1 or 2, characterized in that, The method further comprises: if the light compensation parameter belongs to the first range and the current brightness value is greater than the fourth threshold value, adjusting an exposure mode of the image capturing device to a first mode, the first mode indicating that exposure of a central region of a captured image is greater than exposure of other regions of the captured image; if the light compensation parameter does not belong to the first range or the current brightness value is less than the fourth threshold value, adjusting the exposure mode of the image capturing device to a second mode, the second mode indicating that exposure of regions of a captured image is evenly distributed.
5. An image processing apparatus characterized by comprising: The method comprises: a brightness determination module configured to determine a first brightness value of a first image from an image capturing device, the first brightness value indicating an average brightness of a central region of the first image, determine a second brightness value of the first image, the second brightness value indicating an average brightness of a pixel block having a brightness value greater than a first threshold value in the first image, and determine a third brightness value of the first image, the third brightness value indicating an average brightness of pixel blocks included in the first image; a light compensation parameter adjustment module configured to determine a light compensation parameter of the image capturing device according to at least one of the first brightness value, the second brightness value and the third brightness value, the light compensation parameter being used by the image capturing device to capture a next image, wherein the light compensation parameter of the image processing device is determined according to at least one of the first brightness value, the second brightness value and the third brightness value, comprising: if the current brightness value is greater than a second threshold value, determining a difference between a first reference brightness value and a fourth brightness value as the light compensation parameter, the current brightness value being at least one of the first brightness value, the second brightness value and the third brightness value, the fourth brightness value being determined according to the current brightness value, the first reference brightness value being a light compensation parameter used by the image processing device when the image processing device acquires a previous frame of the first image, or the first reference brightness value being an initial light compensation parameter set by the image processing device; if the current brightness value is less than a third threshold value, determining a sum of the first reference brightness value and the fourth brightness value as the light compensation parameter, the second threshold value being greater than the third threshold value; wherein if the first brightness difference and the second brightness difference are greater than a fourth threshold value or the first brightness difference and the second brightness difference are less than the fourth threshold value, the current brightness value is the first brightness value or the second brightness value, the first brightness difference being an absolute value of a difference between the first brightness value and a first target brightness value, the second brightness difference being an absolute value of a difference between the second brightness value and a second target brightness value; if one of the first brightness difference and the second brightness difference is less than the fourth threshold value and the other is greater than the fourth threshold value, the current brightness value is the third brightness value, if the current brightness value is greater than the second threshold value, the fourth brightness value is positively correlated with the current brightness value, or if the current brightness value is less than the third threshold value, the fourth brightness value is inversely correlated with the current brightness value.
6. An image processing apparatus characterized by comprising: The method comprises: at least one processor, and a memory connected to the at least one processor in communication. The memory stores instructions executable by the at least one processor, and the at least one processor implements the method according to any one of claims 1-4 by executing the instructions stored in the memory.
7. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions, and when the computer instructions run on the computer, the computer executes the method according to any one of claims 1-4.
Citation Information
Patent Citations
Light supplement lamp intensity adjusting method and device, monitoring equipment and storage medium
CN113301263A
Exposure control apparatus and method thereof
US20020012065A1