Exposure parameter determination method and device, electronic equipment and storage medium
By extracting the brightness value of pixel points in the target area in the image processing, eliminating interference points based on the preset light reflectance value, and determining exposure parameters, the image brightness problem caused by improper exposure parameters in the prior art is solved, and higher brightness quality and stability are achieved.
Patent Information
- Application Number
- CN202311526280.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-15
- Publication Date
- 2025-05-16
AI Technical Summary
When determining exposure parameters in the prior art, the brightness of the area obtained by metering may be too small or too large, resulting in overexposed or insufficient exposure of the image and low brightness quality.
By extracting the target area where the target object is located, determining the brightness values of each pixel point in the area, determining the pixel point with a large or small light reflectance based on the brightness value and the preset value, eliminating interference with its brightness value, and determining the exposure parameters based on the brightness value of the remaining pixel points.
It effectively improves the brightness quality of the image, avoids overexposure or insufficient problems caused by improper exposure parameters, and ensures the brightness stability and quality of the image.
Smart Images

Figure CN120017974A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a method, device, electronic device and storage medium for determining exposure parameters. Background Art
[0002] The quality of an image will have a certain impact on the application of the image. Low-quality images are not conducive to the application of images. The brightness quality of an image is an important aspect of image quality.
[0003] Regarding how to improve the brightness quality of an image, related technologies use a photometry method to measure the target area in the image, obtain the regional brightness of the target area, and increase or decrease the current exposure parameters of the acquisition device according to the regional brightness, that is, determine the exposure parameters for subsequent image acquisition to improve the brightness quality of subsequent acquired images.
[0004] When the above method determines the exposure parameters, the regional brightness obtained by light measurement may be too small or too large, causing the determined exposure parameters to be too large or too small, resulting in overexposure or underexposure of the subsequently collected images, resulting in images with lower brightness quality. Therefore, the exposure parameters determined by this method cannot effectively improve the brightness quality of the image. Summary of the invention
[0005] The present invention provides a method, device, electronic device and storage medium for determining exposure parameters, so as to solve the defect that the exposure parameters determined in the prior art cannot effectively improve the brightness quality of an image, and achieve the purpose that the determined exposure parameters can effectively improve the brightness quality of an image.
[0006] The present invention provides a method for determining exposure parameters, comprising:
[0007] In the case where it is determined that the first image includes the target object, extracting a first target area where the target object is located;
[0008] Determine the brightness value of each first pixel in the first target area;
[0009] Determine a second pixel in the first target area based on the brightness value of each of the first pixel points, the light reflectivity of the second pixel point is less than a first preset value, or the light reflectivity is greater than a second preset value, and the second preset value is greater than the first preset value;
[0010] An exposure parameter is determined based on a brightness value of a third pixel point in the first target area except the second pixel point.
[0011] According to the exposure parameter determination method provided by the present invention, determining the brightness value of each first pixel in the first target area includes:
[0012] Determine the photometric weight of each first pixel point in the first target area as a first value, and determine the photometric weight of each fourth pixel point in other areas of the first image except the first target area as a second value; the first value is used to retain the brightness value of each first pixel point, and the second value is used to filter out the brightness value of each fourth pixel point;
[0013] Obtaining a brightness value of each pixel in the first image;
[0014] The brightness value of each first pixel in the first target area is determined based on the brightness value of each pixel in the first image, each first value, and each second value.
[0015] According to the method for determining exposure parameters provided by the present invention, determining a second pixel point in the first target area based on the brightness value of each of the first pixel points includes:
[0016] Determining a reference brightness value based on the brightness value of each of the first pixels;
[0017] For the brightness value of each of the first pixel points, the first pixel point corresponding to the reference brightness value whose brightness value is less than a first preset multiple, and the first pixel point corresponding to the reference brightness value whose brightness value is greater than a second preset multiple are both determined as the second pixel points, and the first preset multiple is less than the second preset multiple.
[0018] According to the method for determining exposure parameters provided by the present invention, determining a second pixel point in the first target area based on the brightness value of each of the first pixel points includes:
[0019] Acquire a second image, where the first image and the second image are images with the same content captured at different fill light intensities;
[0020] Determine a brightness value of a fifth pixel point corresponding to each of the first pixels in a second target area where the target object is located in the second image;
[0021] For each of the first pixel points, determining a brightness change amount between a brightness value of the first pixel point and a brightness value of a corresponding fifth pixel point;
[0022] Based on each of the brightness changes, a second pixel point in the first target area is determined.
[0023] According to the method for determining exposure parameters provided by the present invention, determining the second pixel point in the first target area based on each of the brightness changes includes:
[0024] Determine a target brightness change based on the brightness change corresponding to each of the first pixel points;
[0025] For the brightness change corresponding to each of the first pixel points, the first pixel point corresponding to the target brightness change whose brightness change is less than the third preset multiple, and the first pixel point corresponding to the target brightness change whose brightness change is greater than the fourth preset multiple are both determined as the second pixel points, and the third preset multiple is less than the fourth preset multiple.
[0026] According to the method for determining exposure parameters provided by the present invention, the exposure parameters are determined based on the brightness value of a third pixel point other than the second pixel point in the first target area, including:
[0027] Updating the light metering weight of each of the second pixel points to the second value;
[0028] Determine a brightness value of the first target area based on a second value corresponding to the second pixel and a first value corresponding to the third pixel;
[0029] The exposure parameter is determined based on the brightness value of the first target area and a target brightness value.
[0030] The present invention also provides a device for determining exposure parameters, comprising:
[0031] an extraction module, configured to extract a first target area where the target object is located when it is determined that the first image includes the target object;
[0032] A determination module, used to determine the brightness value of each first pixel in the first target area;
[0033] The determination module is further configured to determine, based on the brightness value of each of the first pixel points, a second pixel point in the first target area, the light reflectivity of the second pixel point being less than a first preset value, or the light reflectivity being greater than a second preset value, and the second preset value being greater than the first preset value;
[0034] The determination module is further configured to determine an exposure parameter based on a brightness value of a third pixel point in the first target area except the second pixel point.
[0035] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for determining the exposure parameters as described above is implemented.
[0036] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method for determining the exposure parameters as described above is implemented.
[0037] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method for determining the exposure parameters as described above is implemented.
[0038] The present invention provides a method, device, electronic device and storage medium for determining exposure parameters. In the case of determining that a target object is included in a first image, the method extracts a first target area where the target object is located; determines the brightness value of each first pixel in the first target area; determines the second pixel in the first target area based on the brightness value of each first pixel, the light reflectivity of the second pixel is less than the first preset value, or the light reflectivity is greater than the second preset value, and the second preset value is greater than the first preset value; and determines the exposure parameters based on the brightness value of the third pixel other than the second pixel in the first target area. If the brightness value of the pixel with a larger light reflectivity or a smaller light reflectivity is too large or too small, the overall brightness value of the first target area will be larger or smaller, which will affect the determination of the exposure parameters. In the method, based on the first preset value and the second preset value, each second pixel in the first target area with a larger light reflectivity or a smaller light reflectivity can be determined, and when determining the exposure parameters, the interference of the brightness value of each second pixel on the average brightness value of the first target area can be eliminated. Therefore, the exposure parameters determined based on the brightness value of each third pixel with a moderate light reflectivity can effectively improve the brightness quality of the image. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 is a flow chart of a method for determining exposure parameters provided by an embodiment of the present invention;
[0041] Figure 2 is a schematic block diagram of a process for determining exposure parameters provided by an embodiment of the present invention;
[0042] Figure 3 is a schematic structural diagram of an exposure parameter determination device provided by an embodiment of the present invention;
[0043] Figure 4 It is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0045] It should be noted that the serial numbers assigned to the objects described in the present invention, such as "first", "second", etc., are only used to distinguish the objects described and do not have any order or technical meaning.
[0046] In practical applications, the brightness quality of an image has a great impact on the application of the image. Taking the image collected by the video surveillance system as an example, if the brightness quality of the image is low, that is, the brightness of the image is too high or too low, it may lead to the inability to obtain the image of the person in the image. Therefore, how to collect high-brightness quality images has become an objective problem in practical applications.
[0047] When improving the brightness quality of captured images, image acquisition devices such as cameras or webcams can adjust the automatic exposure (AE) parameters of the image signal processing (ISP) module, where the AE parameters include shutter, analog gain, and digital gain, etc. It can be understood that the image brightness quality of subsequent captured images is improved by automatically adjusting exposure parameters such as exposure time, gain, and aperture through the ISP module. However, in order to ensure the brightness quality of the characters in the picture, the image acquisition device generally chooses to configure a human-shaped photometry or a face photometry area to determine the exposure parameters.
[0048] Conventional human figure metering mode distinguishes the human figure from the background and performs regional metering on the human figure area or increases the metering weight ratio. However, in real applications, due to the different materials of people's clothes, when collecting images based on determined exposure parameters, the brightness quality of the image cannot be effectively improved.
[0049] For example, if the clothing of the person in the human-shaped area is black with low light reflectivity, the average brightness value of the human-shaped area calculated by AE will be smaller, which will increase the exposure parameters and may cause the person to be overexposed; if the clothing of the person in the human-shaped area is white with high light reflectivity, the average brightness value of the human-shaped area calculated by AE will be larger, which will reduce the exposure parameters and may cause the person to be too dark. For light intelligent products that are not equipped with face metering, there is currently no effective method to determine the exposure parameters based only on human-shaped metering to improve the brightness quality of the person in the captured image. Compared with face detection, human-shaped detection has a larger target object area, so the algorithm complexity and required power consumption are lower, and pedestrians with their backs to the camera can be identified.
[0050] If the brightness value of a pixel point with a larger or smaller light reflectivity is too large or too small, it will cause the overall brightness value of the first target area to be larger or smaller, which will in turn affect the determination of the exposure parameters. Based on this, the exposure parameter determination method provided in the embodiment of the present invention can determine the second pixel points with a larger or smaller light reflectivity in the first target area based on the first preset value and the second preset value, and when determining the exposure parameters, it can eliminate the interference of the brightness value of each second pixel point on the average brightness value of the first target area, so that the exposure parameters determined based on the brightness value of each third pixel point with a moderate light reflectivity can effectively improve the brightness quality of the image.
[0051] The method for determining exposure parameters provided in an embodiment of the present invention may be executed by an electronic device such as a camera, a camera head, a video camera, a mobile phone, a computer or a server, or a specially designed smart device, or may be an exposure parameter determination device set in the electronic device or the smart device. The exposure parameter determination device may be implemented by software, hardware or a combination of both.
[0052] The method of the present invention can be applied to various application scenarios in which the image brightness quality is improved by determining exposure parameters. For example, exposure parameters are determined based on images collected by an image acquisition device in a video surveillance system to improve the image brightness quality of the surveillance image. Figure 1 and Figure 2 A method for determining exposure parameters provided by an embodiment of the present invention is described. Figure 1 FIG. 1 is a flow chart of a method for determining exposure parameters provided by an embodiment of the present invention. Figure 1 As shown, the method for determining the exposure parameters includes steps 110 to 140.
[0053] Step 110: When it is determined that the first image includes the target object, extract a first target area where the target object is located.
[0054] Specifically, the first image may be an image captured by any image acquisition device, such as an image captured from a video captured by a camera, or a picture taken by a camera. The target object may be an object of interest in the first image when determining the exposure parameters, and the exposure parameters are determined based on the brightness quality requirements for the object. For example, in the image captured by the video surveillance system, if the brightness quality requirements for the image of a person are high, the person is the object of interest in the first image, and the person object is the target object.
[0055] When determining whether the first image includes the target object, an image detection method may be used for determination. For example, when a human object is the target object, target detection may be performed on the first image based on a human shape detection algorithm to determine whether the target object exists in the first image; when a static object is the target object, target detection may be performed on the first image based on a static object detection algorithm to determine whether the target object exists in the first image.
[0056] Furthermore, the first target region where the target object is located can be extracted based on a method for extracting a target in an image. For example, when it is determined that the first image includes the target object based on a human figure detection algorithm, a position frame of the target object in the first image can be determined based on a target extraction algorithm, and the first target region where the target object is located can be extracted based on the coordinates of the position frame. The position frame can be a position frame of a regular shape, such as a rectangular frame or a circular frame, etc.; the position frame can also be a position frame of an irregular shape, such as a position frame with the same shape as the outline of the target object, etc.
[0057] Step 120: Determine the brightness value of each first pixel in the first target area.
[0058] Specifically, the first pixel is a pixel in the first target area. The process of the image acquisition device acquiring the first image, that is, the process of the image acquisition device performing image signal processing, during which the image signal processing module of the image acquisition device can count the image parameters of the first image, including the brightness value of each pixel in the first image. After obtaining the image parameters of the first image counted by the image signal processing module, the brightness value of each first pixel in the first target area can be obtained for the first target area.
[0059] For example, when capturing the first image, the AE module in the camera will count the brightness value of each pixel in the first image to obtain AE statistical information, including the corresponding relationship between the position coordinates of each pixel in the first image and the brightness value of each pixel. After performing human figure detection on the first image, when it is determined that the first image includes the target object, the position frame of the human figure area can be further determined, that is, the position frame of the first target area is determined. Based on the position frame of the first target area, the position coordinates of each first pixel in the first target area can be determined. By querying the AE statistical information, the brightness value of each first pixel can be determined.
[0060] Step 130, based on the brightness value of each first pixel point, determine the second pixel point in the first target area, the light reflectivity of the second pixel point is less than the first preset value, or the light reflectivity is greater than the second preset value, and the second preset value is greater than the first preset value.
[0061] Exemplarily, the brightness value of a pixel point is correlated with the light reflectivity of the imaging object point corresponding to the pixel point. For example, under normal circumstances, if the brightness value of a pixel point is large, the light reflectivity of the corresponding imaging object point is also large; if the brightness value of a pixel point is small, the light reflectivity of the corresponding imaging object point is also small. Therefore, the light reflectivity of the first pixel point can be determined based on the brightness value of the first pixel point.
[0062] For example, the light reflectivity of the first pixel can be determined by camera calibration and image processing algorithms. The calibration process can use a calibrated standard object or reference image to establish a mapping model between brightness value and light reflectivity by measuring the area of its known light reflectivity. The mapping model can be linear or nonlinear, depending on the specific application scenario and the device used. Through the mapping model, the light reflectivity of the first pixel can be determined according to the brightness value of the first pixel.
[0063] Specifically, the second pixel point may be a pixel point determined among the first pixel points. Among the first pixel points, the first pixel points whose light reflectance is less than the first preset value or whose light reflectance is greater than the second preset value are all determined as the second pixel points. The first preset value and the second preset value may be preset values for determining the light reflectance of the first pixel point, and the second preset value is greater than the first preset value. The first preset value and the second preset value may be calculated values or empirical values, etc.
[0064] The light reflectivity of the second pixel point can be understood as the light reflectivity of the imaging object point corresponding to the second pixel point. For example, when the imaging object point is a dark gray or black object point, its light reflectivity is small, and the light reflectivity of the second pixel point corresponding to it is small; for another example, when the imaging object point is a white or yellow object point, its light reflectivity is large, and the light reflectivity of the second pixel point corresponding to it is large.
[0065] Step 140: determining exposure parameters based on the brightness value of a third pixel point other than the second pixel point in the first target area.
[0066] Specifically, after determining the second pixel point among the first pixel points in the first target area, all the pixel points other than the second pixel point among the first pixel points can be determined as the third pixel point. The third pixel point can be understood as a first pixel point whose light reflectance is greater than or equal to the first preset value, and whose light reflectance is less than or equal to the second preset value. It can be understood that the light reflectance of the imaging object point corresponding to the third pixel point is relatively moderate, so when determining the exposure parameter based on the brightness value of the third pixel point, the interference of the brightness value of the second pixel point on the average brightness value of the first target area can be avoided.
[0067] When the exposure parameter is determined based on the brightness value of the third pixel, the brightness value representing the average brightness of the first target area can be determined based on the brightness value of the third pixel, and the exposure parameter that can improve the brightness quality of the first image can be determined based on the brightness value representing the average brightness of the first target area. The exposure parameter can make the brightness of the obtained image close to or reach the expected target brightness.
[0068] The method for determining exposure parameters provided by the embodiment of the present invention extracts a first target area where the target object is located when it is determined that the first image includes the target object; determines the brightness value of each first pixel in the first target area; determines the second pixel in the first target area based on the brightness value of each first pixel, the light reflectivity of the second pixel is less than the first preset value, or the light reflectivity is greater than the second preset value, and the second preset value is greater than the first preset value; determines the exposure parameters based on the brightness value of the third pixel other than the second pixel in the first target area. If the brightness value of the pixel with a larger light reflectivity or a smaller light reflectivity is too large or too small, it will cause the overall brightness value of the first target area to be larger or smaller, which will affect the determination of the exposure parameters. In this method, based on the first preset value and the second preset value, the second pixel in the first target area with a larger light reflectivity or a smaller light reflectivity can be determined, and when determining the exposure parameters, the interference of the brightness value of each second pixel on the average brightness value of the first target area can be eliminated. Therefore, the exposure parameters determined based on the brightness value of each third pixel with a moderate light reflectivity can effectively improve the brightness quality of the image.
[0069] Exemplarily, for pixels within the first target area and pixels outside the first target area, the brightness value of each pixel can be retained or filtered out using photometry weights of different values, thereby quickly determining the brightness value of each first pixel within the first target area.
[0070] In one embodiment, when determining the brightness value of each first pixel point in the first target area, the photometric weight of each first pixel point in the first target area can be determined as a first value, and the photometric weight of each fourth pixel point in other areas of the first image except the first target area can be determined as a second value; the first value is used to retain the brightness value of each first pixel point, and the second value is used to filter out the brightness value of each fourth pixel point; the brightness value of each pixel point in the first image is obtained; based on the brightness value of each pixel point in the first image, each first value and each second value, the brightness value of each first pixel point in the first target area is determined.
[0071] Specifically, the photometric weight may be a weight value used to weight the brightness value of a pixel point. After determining the first target area in the first image, the photometric weight of each first pixel point in the first target area may be determined as a first value. For example, the photometric weight of each first pixel point in the first target area is determined to be 1. If the first value is 1, then after weighted calculation of the brightness value of the first pixel point based on the first value, the brightness value of each first pixel point remains unchanged, thereby achieving the purpose of retaining the brightness value of each first pixel point.
[0072] The fourth pixel point may be each pixel point in the first image that is not in the first target area. After determining the first target area in the first image, the photometric weight of each fourth pixel point that is not in the first target area may be determined as the second value. For example, the photometric weight of each fourth pixel point is determined to be 0. If the second value is 0, then after weighted calculation of the brightness value of the fourth pixel point based on the second value, the brightness value of each fourth pixel point is equal to 0, which achieves the purpose of filtering out the brightness value of each fourth pixel point. It should be understood that the first value and the second value may also be other values that can retain or filter out the brightness value of the weighted pixel point. When the second value is a non-zero value, the purpose of filtering out the brightness value of each fourth pixel point may be achieved based on the judgment threshold set for the weighted brightness value. This will not be elaborated here.
[0073] Exemplarily, the brightness value of each pixel in the first image can be obtained by calling the image parameters of the first image. For example, when the image signal processing module of the image acquisition device counts the image parameters of the first image, the brightness value of each pixel can be called to obtain the brightness value of each pixel.
[0074] When determining the brightness value of each first pixel in the first target area based on the brightness value of each pixel in the first image, each first value and each second value, the brightness value of each fourth pixel can be filtered out after weighting the brightness value of the fourth pixel based on the second value. The brightness value of each first pixel in the first image is multiplied based on the first value to obtain the weighted brightness value of each first pixel, and the weighted brightness value of each first pixel is the determined brightness value of each first pixel in the first target area. It should be understood that determining the brightness value of each first pixel in the first target area is also determining the brightness value of the first target area.
[0075] In this embodiment, based on the first value and the second value, the brightness values of the pixels within the first target area in the first image can be retained, and the brightness values of the fourth pixels not within the first target area can be filtered out, so that the brightness values of the first pixels within the first target area can be quickly and accurately determined.
[0076] In practical applications, when the brightness value of a pixel is large, it can be determined that the light reflectivity of the pixel is also large, and when the brightness value of a pixel is small, it can be determined that the light reflectivity of the pixel is also small. Based on this, the second pixel in the first target area can be determined by judging the brightness value of the first pixel.
[0077] In one embodiment, based on the brightness value of each first pixel point, determining the second pixel point in the first target area can be specifically implemented in the following manner:
[0078] Based on the brightness value of each first pixel point, a reference brightness value is determined; for the brightness value of each first pixel point, the first pixel point corresponding to the reference brightness value having a brightness value less than a first preset multiple and the first pixel point corresponding to the reference brightness value having a brightness value greater than a second preset multiple are both determined as second pixel points, and the first preset multiple is less than the second preset multiple.
[0079] Specifically, the reference brightness value may be a reference value determined based on the brightness values of each first pixel. For example, an average value may be calculated based on the brightness values of each first pixel, and the obtained average brightness value may be determined as the reference brightness value; for another example, the median, maximum, or minimum value of the brightness values of each first pixel may be determined as the reference brightness value.
[0080] The reference brightness value of the first preset multiple may be a value obtained by multiplying the first preset multiple by the reference brightness value, and the first preset multiple may be any value, such as 0.1, 0.2, or 0.3, etc. The reference brightness value of the second preset multiple may be a value obtained by multiplying the second preset multiple by the reference brightness value, and the second preset multiple may be any value greater than the first preset multiple, such as 1, 2, or 3, etc.
[0081] The brightness value of each first pixel point is compared with a reference brightness value of a first preset multiple and a reference brightness value of a second preset multiple, and the first pixel point corresponding to the reference brightness value having a brightness value less than the first preset multiple and the first pixel point corresponding to the reference brightness value having a brightness value greater than the second preset multiple are both determined as second pixel points, thereby achieving the purpose of determining the second pixel point from the first target area.
[0082] In this embodiment, based on the brightness value of each first pixel, the reference brightness value of the first preset multiple, and the reference brightness value of the second preset multiple, each first pixel can be quickly distinguished, and each second pixel can be determined therefrom. Based on this, the efficiency of determining the second pixel can be improved, and the timeliness of determining the exposure parameters can be improved.
[0083] In practical applications, the brightness change of a pixel point can also reflect the size of the light reflectivity corresponding to the pixel point. For example, when the brightness change of a pixel point is large, its corresponding light reflectivity is also large; when the brightness change of a pixel point is small, its corresponding light reflectivity is also small. Therefore, it can be determined whether the first pixel point is the second pixel point based on the brightness change of the first pixel point.
[0084] In one embodiment, based on the brightness value of each first pixel point, determining the second pixel point in the first target area can be achieved in the following manner:
[0085] Acquire a second image, where the first image and the second image are images with the same content shot under different fill light intensities; determine the brightness value of the fifth pixel corresponding to each first pixel in a second target area where the target object in the second image is located; for each first pixel, determine the brightness change between the brightness value of the first pixel and the brightness value of the corresponding fifth pixel; and determine the second pixel in the first target area based on each brightness change.
[0086] Specifically, the second image has the same content as the first image, and the light intensity when shooting the second image is different from the light intensity when shooting the first image, that is, different fill light intensities. For example, two frames of images are continuously captured within a short time interval, and different fill light intensities are set when capturing the two frames of images, so that two frames of images with different light intensities and the same content can be obtained, that is, the first image and the second image are obtained.
[0087] A second target area can be determined in the second image based on the method for determining the first target area, and the second target area is the area where the same target object is located in the second image. Each pixel point in the second target area is a fifth pixel point corresponding to each first pixel point.
[0088] In the case where other shooting factors are the same and only the light intensity during shooting is different, due to the different light intensities, the brightness value of the first pixel in the first image is different from the brightness value of the fifth pixel corresponding to the first pixel in the second image, and the corresponding brightness change can be determined based on the brightness value of the first pixel and the brightness value of the corresponding fifth pixel. For example, the brightness value of the fifth pixel minus the brightness value of the corresponding first pixel can obtain the brightness change corresponding to the first pixel, and based on the brightness change, it can be determined whether the first pixel is the second pixel.
[0089] In this embodiment, based on the acquired second image, the brightness value of the fifth pixel corresponding to each first pixel can be determined, and then the brightness change between the brightness value of each first pixel and the corresponding fifth pixel can be determined; combined with the fact that the brightness change of the pixel can reflect the characteristics of the light reflectivity corresponding to the pixel, each second pixel can be quickly determined based on the brightness change corresponding to each first pixel, thereby improving the determination efficiency of the second pixel.
[0090] In one implementation, when determining the second pixel point in the first target area based on each brightness change amount, the target brightness change amount can be determined based on the brightness change amount corresponding to each first pixel point; for the brightness change amount corresponding to each first pixel point, the first pixel point corresponding to the target brightness change amount whose brightness change amount is less than a third preset multiple and the first pixel point corresponding to the target brightness change amount whose brightness change amount is greater than a fourth preset multiple are both determined as second pixel points, and the third preset multiple is less than the fourth preset multiple.
[0091] Specifically, the target brightness change amount may be a reference value determined based on the brightness change amount corresponding to each first pixel point. For example, an average value may be calculated based on the brightness change amount corresponding to each first pixel point, and the obtained average brightness change amount may be determined as the target brightness change amount; for another example, the median, maximum or minimum value of the brightness change amount corresponding to each first pixel point may be determined as the target brightness change amount.
[0092] The target brightness change amount of the third preset multiple may be a value obtained by multiplying the third preset multiple by the target brightness change amount, and the third preset multiple may be any value, such as 0.1, 0.2 or 0.3, etc. The target brightness change amount of the fourth preset multiple may be a value obtained by multiplying the fourth preset multiple by the target brightness change amount, and the fourth preset multiple may be any value greater than the third preset multiple, such as 1, 2 or 3, etc.
[0093] The brightness change of each first pixel point is compared with the target brightness change of the third preset multiple and the target brightness change of the fourth preset multiple, and the first pixel point corresponding to the target brightness change of the target brightness change of the third preset multiple and the first pixel point corresponding to the target brightness change of the target brightness change of the fourth preset multiple are both determined as second pixel points, thereby achieving the purpose of determining the second pixel point from the first target area.
[0094] In this embodiment, the brightness change of each first pixel can be determined based on the target brightness change of the third preset multiple and the target brightness change of the fourth preset multiple, so that the first pixel with a larger or smaller brightness change can be distinguished, and the second pixel can be determined. Based on this method, each second pixel can be effectively determined, thereby improving the applicability of the determined exposure parameters to improve the brightness quality of the subsequent collected images.
[0095] In practical applications, the target brightness value can be determined based on the requirements for image brightness quality. When the acquired image reaches the target brightness value, the brightness quality of the image meets the actual requirements. Therefore, the exposure parameters determined based on the target brightness value are exposure parameters that meet the image brightness quality requirements.
[0096] In one embodiment, the exposure parameter is determined based on the brightness value of a third pixel point other than the second pixel point in the first target area, which can be achieved in the following manner:
[0097] Update the metering weight of each second pixel point to a second value; determine the brightness value of the first target area based on the second value corresponding to the second pixel point and the first value corresponding to the third pixel point; determine the exposure parameter based on the brightness value of the first target area and the target brightness value.
[0098] Specifically, after determining each second pixel point in the first target area, the photometric weight of each second pixel point can be updated to a second value, that is, the brightness value of each second pixel point with a larger or smaller light reflectivity is filtered out by the second value. After filtering out the brightness value of each second pixel point, what remains in the first target area is the brightness value of the third pixel point with a moderate light reflectivity.
[0099] Exemplarily, the brightness value of the first target area may be a brightness value representing an average brightness of the first target area. When determining the brightness value of the first target area, the average value of each weighted brightness value obtained by weighting the brightness value of each third pixel point based on the first value is calculated, and the calculated average value may be determined as the brightness value of the first target area.
[0100] In view of the requirements of image brightness quality, a target brightness value can be set. If the image captured based on the determined exposure parameters can reach the target brightness value, the brightness quality of the image meets the requirements. After determining the brightness value of the first target area, a difference calculation can be performed based on the brightness value of the first target area and the target brightness value, and the adjustment amount of exposure parameters such as exposure time, gain and aperture can be determined based on the calculated difference. The current exposure parameters can be adjusted based on the adjustment amount to determine the exposure parameters.
[0101] In this embodiment, the exposure parameter determined based on the brightness value of the first target area and the target brightness value is an exposure parameter that can meet the image brightness quality requirements. Therefore, based on the exposure parameter determined in this manner, an image with higher image brightness quality can be captured. Based on this, the efficiency of determining the exposure parameter can be improved through this method, and the quality of the determined exposure parameter can be improved.
[0102] In order to further describe the specific implementation process of the method for determining exposure parameters provided by the embodiment of the present invention, the method is illustrated below by taking a camera as an example.
[0103] Figure 2 FIG. 1 is a schematic block diagram of a process for determining exposure parameters provided by an embodiment of the present invention. Figure 2 As described above, after the start, the camera can be used to collect images, and the collected images are subjected to human shape detection, and it is determined whether a human shape is detected. This step is to determine whether there is a target object in the first image. If a human body is detected, the next step is performed, otherwise the step of collecting images is continued.
[0104] When a human body is detected, the coordinates of the human-shaped area need to be reported, that is, the first target area where the target object is located needs to be extracted. For example, the ISP module segments the acquired image and extracts the corresponding human-shaped area. At this time, the exposure weight of the pixel points in the human-shaped area is set to 1, and the exposure weight of the pixel points in other areas of the image is set to 0, and the metering weight table AEWeight1 can be obtained.
[0105] The brightness values of all pixels in the first image can be obtained according to the acquired AE statistical information. The brightness values of all pixels in the first image are weighted by the light metering weight table AEWeight1, and the brightness values of the pixels in the non-human-shaped area can be filtered out, that is, the brightness value Y of each pixel in the human-shaped area can be obtained. (i,j) , where (i, j) represents the coordinate value of the pixel point. Based on the brightness value of each pixel point in the human-shaped area, the average brightness value Y of the human-shaped area can be calculated. ave .
[0106] According to the brightness value Y of each pixel in the human figure area (i,j) And the average brightness value Y of the humanoid area ave, a reflectivity detection model can be established, and reflectivity detection can be performed based on the reflectivity detection model, that is, the light reflectivity of the imaging object points corresponding to each pixel point in the human-shaped area can be judged. The reflectivity detection model is used to eliminate the pixel points corresponding to the pixel areas with low or high reflectivity in the human-shaped area, for example, the pixel areas where the clothes with high or low reflectivity in the image are located can be eliminated. Based on the judgment of each pixel point in the human-shaped area, the light metering weight table AEWeight2 can be updated.
[0107] When the reflectivity detection is performed based on the reflectivity detection model, the specific method may be as follows: first, the pixels in the human-shaped area are traversed in sequence. (i,j) <0.3*Y ave , it is determined that the pixel corresponds to an area with lower light reflectivity, which may be dark gray and black clothing. At this time, the exposure weight corresponding to the pixel in AEWeight1 is modified to 0. (i,j) >2*Y ave When the pixel corresponds to an area with a higher light reflectivity, the area may be white, yellow and other colored clothing. At this time, the exposure weight corresponding to the pixel in AEWeight1 is modified to 0. Then, the remaining pixels in the human-shaped area are identified as normal areas, and the exposure weights of these pixels are kept at 1, thereby obtaining the updated photometric weight table AEWeight2.
[0108] Based on the updated photometric weight table AEweight2, the brightness value Luma of the human-shaped area is recalculated. According to the brightness value Luma of the human-shaped area and the preset exposure target value Target, the exposure parameter adjustment amount can be determined, and then the exposure parameter can be determined based on the exposure parameter adjustment amount. Among them, the preset exposure target value Target is the target brightness value. After determining the exposure parameter, you can continue to capture images and loop the above-mentioned exposure parameter determination method to continue to determine the exposure parameters that need to be determined during subsequent image capture.
[0109] The method for determining exposure parameters provided in an embodiment of the present invention can be used to optimize the selection of photometric weights for the human detection area based on the different reflectivity of clothing of different colors to light. In practical applications, more sophisticated photometric weights are conducive to ensuring better image brightness quality. This method not only ensures the image quality in various scenes, but also improves the adaptability of the device. Compared with other algorithms, the exposure parameters determined by this method can make the brightness of the image more stable and the image quality higher; at the same time, it improves the performance of the image acquisition device and makes it more adaptable.
[0110] The following describes an exposure parameter determination device provided in an embodiment of the present invention. The exposure parameter determination device described below and the exposure parameter determination method described above can refer to each other.
[0111] Figure 3 is a schematic diagram of the structure of an exposure parameter determination device provided by an embodiment of the present invention, such as Figure 3 As shown, the exposure parameter determination device 300 includes:
[0112] An extraction module 310 is used to extract a first target area where the target object is located when it is determined that the first image includes the target object;
[0113] A determination module 320, configured to determine the brightness value of each first pixel in the first target area;
[0114] The determination module 320 is further used to determine, based on the brightness value of each first pixel point, a second pixel point in the first target area, the light reflectivity of the second pixel point is less than the first preset value, or the light reflectivity is greater than the second preset value, and the second preset value is greater than the first preset value;
[0115] The determination module 320 is further configured to determine an exposure parameter based on a brightness value of a third pixel point other than the second pixel point in the first target area.
[0116] In an exemplary embodiment, the determination module 320 is specifically configured to:
[0117] Determine the photometric weight of each first pixel point in the first target area as a first value, and determine the photometric weight of each fourth pixel point in other areas of the first image except the first target area as a second value; the first value is used to retain the brightness value of each first pixel point, and the second value is used to filter out the brightness value of each fourth pixel point;
[0118] Obtaining the brightness value of each pixel in the first image;
[0119] Based on the brightness value of each pixel in the first image, each first value and each second value, the brightness value of each first pixel in the first target area is determined.
[0120] In an exemplary embodiment, the determination module 320 is specifically configured to:
[0121] Determining a reference brightness value based on the brightness value of each first pixel;
[0122] For the brightness value of each first pixel point, the first pixel point corresponding to the reference brightness value whose brightness value is less than the first preset multiple and the first pixel point corresponding to the reference brightness value whose brightness value is greater than the second preset multiple are both determined as second pixel points, and the first preset multiple is less than the second preset multiple.
[0123] In an exemplary embodiment, the determination module 320 is specifically configured to:
[0124] Acquire a second image, where the first image and the second image are images with the same content shot at different fill light intensities;
[0125] Determine a brightness value of a fifth pixel point corresponding to each first pixel point in a second target area where the target object is located in the second image;
[0126] For each first pixel, determining a brightness change between a brightness value of the first pixel and a brightness value of a corresponding fifth pixel;
[0127] Based on each brightness change amount, a second pixel point in the first target area is determined.
[0128] In an exemplary embodiment, the determination module 320 is specifically configured to:
[0129] Determine a target brightness change based on a brightness change corresponding to each first pixel point;
[0130] For the brightness change corresponding to each first pixel point, the first pixel point corresponding to the target brightness change amount whose brightness change amount is less than the third preset multiple and the first pixel point corresponding to the target brightness change amount whose brightness change amount is greater than the fourth preset multiple are both determined as second pixel points, and the third preset multiple is less than the fourth preset multiple.
[0131] In an exemplary embodiment, the determination module 320 is specifically configured to:
[0132] Updating the light metering weight of each second pixel point to a second value;
[0133] Determine a brightness value of the first target area based on a second value corresponding to the second pixel and a first value corresponding to the third pixel;
[0134] Based on the brightness value of the first target area and the target brightness value, an exposure parameter is determined.
[0135] The device of this embodiment can be used to execute the method of any embodiment in the embodiment of the method for determining exposure parameters. Its specific implementation process and technical effects are similar to those in the embodiment of the method for determining exposure parameters. For details, please refer to the detailed description in the embodiment of the method for determining exposure parameters, which will not be repeated here.
[0136] Figure 4 is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention, such as Figure 4As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the above-mentioned exposure parameter determination method, which includes: extracting a first target area where the target object is located when determining that the first image includes the target object; determining the brightness value of each first pixel point in the first target area; determining the second pixel point in the first target area based on the brightness value of each first pixel point, the light reflectivity of the second pixel point is less than the first preset value, or the light reflectivity is greater than the second preset value, and the second preset value is greater than the first preset value; determining the exposure parameter based on the brightness value of the third pixel point other than the second pixel point in the first target area.
[0137] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0138] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the above-mentioned exposure parameter determination method, which includes: when it is determined that the first image includes a target object, extracting a first target area where the target object is located; determining the brightness value of each first pixel point in the first target area; based on the brightness value of each first pixel point, determining a second pixel point in the first target area, the light reflectivity of the second pixel point is less than a first preset value, or the light reflectivity is greater than a second preset value, and the second preset value is greater than the first preset value; based on the brightness value of a third pixel point other than the second pixel point in the first target area, determining the exposure parameter.
[0139] On the other hand, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the exposure parameter determination method provided by the above-mentioned methods, the method comprising: extracting a first target area where the target object is located when it is determined that the first image includes a target object; determining the brightness value of each first pixel point in the first target area; based on the brightness value of each first pixel point, determining a second pixel point in the first target area, the light reflectivity of the second pixel point is less than a first preset value, or the light reflectivity is greater than a second preset value, and the second preset value is greater than the first preset value; and determining the exposure parameter based on the brightness value of a third pixel point other than the second pixel point in the first target area.
[0140] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0141] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0142] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for determining exposure parameters, characterized in that: include: In the case where it is determined that the first image includes the target object, extracting a first target area where the target object is located; Determine the brightness value of each first pixel in the first target area; Determine a second pixel in the first target area based on the brightness value of each of the first pixel points, the light reflectivity of the second pixel point is less than a first preset value, or the light reflectivity is greater than a second preset value, and the second preset value is greater than the first preset value; An exposure parameter is determined based on a brightness value of a third pixel point in the first target area except the second pixel point.
2. The method for determining exposure parameters according to claim 1, characterized in that: Determining the brightness value of each first pixel in the first target area includes: Determine the photometric weight of each first pixel point in the first target area as a first value, and determine the photometric weight of each fourth pixel point in other areas of the first image except the first target area as a second value; the first value is used to retain the brightness value of each first pixel point, and the second value is used to filter out the brightness value of each fourth pixel point; Obtaining a brightness value of each pixel in the first image; The brightness value of each first pixel in the first target area is determined based on the brightness value of each pixel in the first image, each first value, and each second value.
3. The method for determining exposure parameters according to claim 1, characterized in that: Determining a second pixel point in the first target area based on the brightness value of each of the first pixel points includes: Determining a reference brightness value based on the brightness value of each of the first pixels; For the brightness value of each of the first pixel points, the first pixel point corresponding to the reference brightness value whose brightness value is less than a first preset multiple, and the first pixel point corresponding to the reference brightness value whose brightness value is greater than a second preset multiple are both determined as the second pixel points, and the first preset multiple is less than the second preset multiple.
4. The method for determining exposure parameters according to any one of claims 1 to 3, characterized in that: Determining a second pixel point in the first target area based on the brightness value of each of the first pixel points includes: Acquire a second image, where the first image and the second image are images with the same content captured at different fill light intensities; Determine a brightness value of a fifth pixel point corresponding to each of the first pixels in a second target area where the target object is located in the second image; For each of the first pixel points, determining a brightness change amount between a brightness value of the first pixel point and a brightness value of a corresponding fifth pixel point; Based on each of the brightness changes, a second pixel point in the first target area is determined.
5. The method for determining exposure parameters according to claim 4, characterized in that: The determining, based on each of the brightness changes, a second pixel point in the first target area includes: Determine a target brightness change based on the brightness change corresponding to each of the first pixel points; For the brightness change corresponding to each of the first pixel points, the first pixel point corresponding to the target brightness change whose brightness change is less than the third preset multiple, and the first pixel point corresponding to the target brightness change whose brightness change is greater than the fourth preset multiple are both determined as the second pixel points, and the third preset multiple is less than the fourth preset multiple.
6. The method for determining exposure parameters according to claim 2, characterized in that: The determining of the exposure parameter based on the brightness value of a third pixel point other than the second pixel point in the first target area includes: Updating the light metering weight of each of the second pixel points to the second value; Determine a brightness value of the first target area based on a second value corresponding to the second pixel and a first value corresponding to the third pixel; The exposure parameter is determined based on the brightness value of the first target area and a target brightness value.
7. A device for determining exposure parameters, characterized in that: include: an extraction module, configured to extract a first target area where the target object is located when it is determined that the first image includes the target object; A determination module, used to determine the brightness value of each first pixel in the first target area; The determination module is further configured to determine, based on the brightness value of each of the first pixel points, a second pixel point in the first target area, the light reflectivity of the second pixel point being less than a first preset value, or the light reflectivity being greater than a second preset value, and the second preset value being greater than the first preset value; The determination module is further configured to determine an exposure parameter based on a brightness value of a third pixel point in the first target area except the second pixel point.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method for determining the exposure parameters according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for determining the exposure parameters according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for determining the exposure parameters according to any one of claims 1 to 6 is implemented.