CN115967861A - Image processing method and device - Google Patents
Image processing method and device Download PDFInfo
- Publication number
- CN115967861A CN115967861A CN202310246906.0A CN202310246906A CN115967861A CN 115967861 A CN115967861 A CN 115967861A CN 202310246906 A CN202310246906 A CN 202310246906A CN 115967861 A CN115967861 A CN 115967861A
- Authority
- CN
- China
- Prior art keywords
- value
- exposure
- image
- target
- exposure time
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Landscapes
- Studio Devices (AREA)
Abstract
The invention discloses an image processing method, which comprises the following steps: acquiring a first analog gain value and a first digital gain value of a target image; calculating a noise value of the target image according to the first analog gain value and the first digital gain value; setting a first noise threshold and a second noise threshold, and calculating to obtain the corresponding maximum exposure time of the target according to the first noise threshold, the second noise threshold, the noise value of the target image and the maximum exposure time of an image sensor of the equipment; adjusting exposure parameters of the image to be processed according to the target maximum exposure time, wherein the exposure parameters comprise exposure time, a second analog gain value and a second digital gain value, and the exposure parameters when the difference value between the brightness value of the image and the target brightness value is smaller than a threshold value are used as final exposure parameters; and controlling the equipment to output an image according to the final exposure parameters. The invention solves the technical problem of smear of moving objects in the image.
Description
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to an image processing method and apparatus.
Background
The current image exposure method mainly aims at the exposure method when a normally powered device is in a current-pulling state, exposure adjustment is carried out through real-time brightness information, for a low-power-consumption device, power is generally supplied through a battery, in order to save power, the device is usually set to a sleep mode when the device is not in operation, when the device shoots a moving object, after the device wakes up from the sleep mode, imaging needs to be started quickly, image exposure needs to be converged very quickly, otherwise, the moving object is difficult to shoot, therefore, for the low-power-consumption device, if a traditional image exposure mode is used, proper exposure convergence is difficult to complete within hundreds of milliseconds, and the image can possibly generate technical problems of overexposure, over-darkness, smear and the like.
Disclosure of Invention
In view of the above, an object of the present invention is to provide an image processing method and apparatus, which can shorten the time for image exposure convergence and solve the technical problem of smear of a moving object in an image.
To achieve the above object, the present invention provides an image processing method comprising:
acquiring a first analog gain value and a first digital gain value of a target image;
calculating a noise value of a target image according to the first analog gain value and the first digital gain value, setting a first noise threshold value and a second noise threshold value, and calculating to obtain corresponding target maximum exposure time according to the first noise threshold value, the second noise threshold value, the noise value of the target image and the maximum exposure time of an image sensor of the equipment;
adjusting exposure parameters of the image to be processed according to the target maximum exposure time, wherein the exposure parameters comprise exposure time, a second analog gain value and a second digital gain value, and the exposure parameters when the difference value between the brightness value of the image and the target brightness value is smaller than a threshold value are used as final exposure parameters;
and controlling the equipment to output an image according to the final exposure parameters.
Further, the method further comprises calibrating the exposure meter, and the calibrating step comprises:
acquiring a plurality of photosensitive values corresponding to a plurality of ambient lights with different brightness, calculating an ambient exposure value corresponding to each photosensitive value, and calibrating the mapping relation between the photosensitive values and the ambient exposure values to be an exposure table of the equipment.
Further, the step of obtaining a first analog gain value and a first digital gain value of the target image comprises:
acquiring a current photosensitive value of current ambient light, acquiring a corresponding current ambient exposure value in an exposure table, calculating to obtain an initial exposure parameter of the equipment according to the current photosensitive value, the current ambient exposure value and the maximum exposure time of the image sensor, and controlling the equipment to output an image according to the initial exposure parameter, wherein the initial exposure parameter comprises initial exposure time and an initial analog gain value;
the method comprises the steps of obtaining a brightness value of an image, adjusting exposure parameters of equipment according to the brightness value, a preset target brightness value and the maximum exposure time of an image sensor, acquiring the image according to the adjusted exposure parameters, taking the exposure parameters when the difference value between the brightness value of the acquired image and the target brightness value is smaller than a threshold value as first adjusted exposure parameters of the equipment, and controlling the equipment to output the target image according to the first exposure parameters, wherein the first exposure parameters comprise first exposure time, a first analog gain value and a first digital gain value.
Further, the step of calculating the noise value of the target image comprises:
calculating to obtain a Noise value Noise of the image according to the first analog gain value and the first digital gain value of the target image curr The calculation formula of (2) is as follows:
wherein, again curr Is a first analog gain value, dgain curr Is a first digital gain value;
adjusting the maximum exposure time of the image sensor according to the noise value, the first noise threshold value and the second noise threshold value to obtain the maximum exposure time of the target, and the maximum exposure time of the target limit The calculation formula of (2) is as follows:
wherein fps is frame rate, thre1 is first noise threshold, thre2 is second noise threshold, the first noise threshold is smaller than the second noise threshold, and expose max Is the maximum exposure time of the image sensor.
Further, the step of adjusting the exposure parameter of the image to be processed includes:
acquiring a first frame of image to be processed according to a first exposure parameter, calculating to obtain an average brightness value of the first frame of image to be processed, and taking the ratio of the average brightness value of the first frame of image to be processed and a preset target brightness value of the image as an image exposure adjustment amplitude;
calculating to obtain an adjustment step length according to the adjustment amplitude and a preset exposure convergence speed, taking the calculated second exposure time, a second analog gain value and a second digital gain value as second exposure parameters according to the adjustment amplitude, the adjustment step length, the first exposure parameter and the target maximum exposure time, and outputting a second frame of image to be processed according to a second exposure parameter control device;
and by analogy, adjusting the exposure parameter of the next frame of image to be processed according to the exposure parameter adjusting mode and the exposure parameter of the previous frame, and taking the exposure parameter of the next frame of image as the final exposure parameter when the difference value between the brightness value of the obtained next frame of image to be processed and the target brightness value is smaller than the threshold value.
Further, the step of calculating the average brightness value of the image to be processed in the first frame includes:
dividing a first frame of image to be processed into a plurality of areas, and setting corresponding weight for each area;
accumulating the brightness of all pixels in each area and averaging the brightness;
taking the product of the weight of each region and the corresponding average value as the average brightness value of the region;
and accumulating and averaging the average brightness values of all the areas to obtain the average brightness value of the first frame of image to be processed.
Further, the setting of the region weight further includes: and if the first frame of image to be processed has a moving target, setting the weight of the area where the moving target is located to be higher than that of other areas.
Further, the adjusting step of the second exposure parameter includes:
when the adjustment amplitude is larger than 1, calculating according to the exposure convergence speed and the adjustment amplitude to obtain an adjustment step length;
if the first exposure time is less than the maximum target exposure time, taking the product of the adjustment step length and the first exposure time as a second exposure time, and taking the first analog gain value as a second analog gain value;
if the first exposure time is equal to the target maximum exposure time, calculating to obtain a multiple required to be adjusted by the analog gain according to the adjustment step length, taking the multiple required to be adjusted by the analog gain as a second analog gain value, and if the second analog gain value reaches the maximum value, calculating to obtain a multiple required to be adjusted by the digital gain according to the adjustment step length, and taking the multiple required to be adjusted by the digital gain as a second digital gain value;
wherein the step length AE is adjusted step The calculation formula of (2) is as follows:
wherein AE is ratio To adjust amplitude, AE speed The exposure convergence speed is obtained.
Further, the adjusting step of the second exposure parameter further includes:
when the adjustment amplitude is smaller than 1, calculating according to the exposure convergence speed and the adjustment amplitude to obtain an adjustment step length;
calculating to obtain a multiple required to be adjusted by the digital gain according to the adjustment step length so as to enable the adjusted digital gain to reach a minimum digital gain value, wherein the multiple required to be adjusted by the digital gain is a second digital gain value;
calculating to obtain a multiple required to be adjusted by the analog gain according to the adjustment step length so as to enable the adjusted analog gain to reach a minimum analog gain value, wherein the multiple required to be adjusted by the analog gain is a second analog gain value;
adjusting the exposure time according to the adjustment step length to obtain a second exposure time;
wherein the step length AE is adjusted step The calculation formula of (2) is as follows:
wherein AE is ratio To adjust amplitude, AE speed The exposure convergence speed is obtained.
To achieve the above object, the present invention provides an image processing apparatus comprising:
the acquisition module is used for acquiring a first analog gain value and a first digital gain value of a target image;
the exposure time adjusting module is used for calculating a noise value of the target image according to the first analog gain value and the first digital gain value, setting a first noise threshold value and a second noise threshold value, and calculating to obtain corresponding target maximum exposure time according to the first noise threshold value, the second noise threshold value, the noise value of the target image and the maximum exposure time of an image sensor of the equipment;
the parameter adjusting module is used for adjusting exposure parameters of the image to be processed according to the target maximum exposure time, wherein the exposure parameters comprise exposure time, a second analog gain value and a second digital gain value, and the exposure parameters when the difference value between the brightness value of the image and the target brightness value is smaller than a threshold value are used as final exposure parameters;
and the image output module is used for controlling the equipment to output images according to the final exposure parameters.
According to the invention, through calibration of the exposure meter, the time of image exposure convergence is greatly shortened, and the calibration workload is reduced; the maximum exposure time is restricted based on different environmental exposure values, and the technical problem of smear of a moving target in an image is solved under the condition of reducing image noise.
Drawings
FIG. 1 is a flow chart of an image processing method according to the present invention;
FIG. 2 is a further schematic flow chart diagram of an image processing method according to the present invention;
FIG. 3 is a further flowchart of an image processing method according to the present invention;
fig. 4 is a system diagram of an image processing apparatus according to the present invention.
Detailed Description
The present invention will be described in detail with reference to the specific embodiments shown in the drawings, which are not intended to limit the present invention, and structural, methodological, or functional changes made by those skilled in the art according to the specific embodiments are included in the scope of the present invention.
In an embodiment of the present application, as shown in fig. 1, the present invention provides an image processing method, including:
s1, acquiring a first analog gain value and a first digital gain value of a target image;
s2, calculating a noise value of the target image according to the first analog gain value and the first digital gain value, setting a first noise threshold value and a second noise threshold value, and calculating to obtain corresponding target maximum exposure time according to the first noise threshold value, the second noise threshold value, the noise value of the target image and the maximum exposure time of an image sensor of the equipment;
s3, adjusting exposure parameters of the image to be processed according to the maximum target exposure time, wherein the exposure parameters comprise exposure time, a second analog gain value and a second digital gain value, and the exposure parameters when the difference value between the brightness value of the image and the target brightness value is smaller than a threshold value are used as final exposure parameters;
and S4, controlling the equipment to output an image according to the final exposure parameters.
And performing image preprocessing on the image acquired by the equipment, namely performing image exposure convergence on the acquired image so as to enable the target image acquired by the equipment to meet normal exposure brightness. The method comprises the steps of calculating an analog gain value and a digital gain value of a target image, calculating a noise value of the target image according to the analog gain value and the digital gain value, adjusting the maximum exposure time of an image sensor through the noise value of the image to determine the target maximum exposure time of the image, and adjusting the exposure parameters of the image based on the target maximum exposure time, so that the exposure brightness of the image can be met under the condition of reducing the image noise, and the technical problem of smear of a moving object in the image can be solved.
The device requires calibration of an exposure table to determine initial exposure parameters of the device. As an achievable mode, a plurality of photosensitive values corresponding to a plurality of different-brightness ambient lights are obtained, an ambient exposure value corresponding to each photosensitive value is calculated, and the mapping relation between the photosensitive values and the ambient exposure values is calibrated as an exposure table of the equipment. Reading the corresponding photosensitive value and the exposure time and the gain value after exposure convergence by equipment in different illumination environments, calculating the corresponding environment exposure value under different photosensitive values, and constructing an exposure table by using the mapping relation of the photosensitive value and the environment exposure value. Specifically, the equipment is placed under a uniform light source, the brightness of ambient light is adjusted, the photosensitive value corresponding to the brightness is read through the equipment, the exposure time and the analog gain value of an image sensor in the equipment are adjusted, so that after an image reaches a proper exposure brightness value, the product of the exposure time and the analog gain value is used as the ambient exposure value corresponding to the photosensitive value, and by analogy, the brightness of the ambient light is continuously adjusted to change the photosensitive value, the whole photosensitive measurement range is traversed to obtain the ambient exposure value corresponding to each photosensitive value, so that an exposure table is obtained, the exposure table is set and stored in the equipment, and the calibration of the exposure table of the equipment is completed. As shown in the exposure table below, the values in the table are only examples and do not represent actual values.
In the implementation mode, the calibration of the exposure table is established through the mapping relation between the environment exposure value and the photosensitive value, and is not directly corresponding to the photosensitive value through the exposure time and the gain value of the image sensor in the equipment, so that the maintenance and calibration work of the exposure table can be effectively reduced, and the exposure table is arranged in the equipment, so that the time for convergence of equipment image exposure can be greatly shortened. For example, different devices may have different requirements for the frame rate of an image, the frame rate may be 15 frames, 25 frames, 30 frames, 60 frames, etc., the frame rate may limit the exposure time of the device, and the maximum exposure and frame rate of different image sensors may be different, so that if the exposure time and gain value are directly calibrated, a plurality of tables may be maintained and calibrated under different frame rates and image sensors. The realization mode corresponds to the photosensitive value through the use environment exposure value, and only one exposure table is maintained, so that the workload of calibration and maintenance is obviously reduced.
As an optional implementation manner, the step of acquiring a first analog gain value and a first digital gain value of the target image includes: acquiring a current photosensitive value of current ambient light, acquiring a corresponding current ambient exposure value in an exposure table, calculating to obtain an initial exposure parameter of the equipment according to the current photosensitive value, the current ambient exposure value and the maximum exposure time of the image sensor, and controlling the equipment to output an image according to the initial exposure parameter, wherein the initial exposure parameter comprises initial exposure time and an initial analog gain value; the method comprises the steps of obtaining a brightness value of an image, adjusting exposure parameters of equipment according to the brightness value, a preset target brightness value and the maximum exposure time of an image sensor, carrying out image acquisition according to the adjusted exposure parameters, taking the exposure parameters when the difference value between the brightness value of the acquired image and the target brightness value is smaller than a threshold value as first exposure parameters after the equipment is adjusted, and controlling the equipment to output the target image according to the first exposure parameters, wherein the first exposure parameters comprise first exposure time, a first analog gain value and a first digital gain value.
As an alternative implementation, the initial exposure parameters of the device are determined based on a calibrated exposure table of the device. And acquiring a current photosensitive value of the current environment light, and acquiring a corresponding current environment exposure value in an exposure table. In the exposure table, based on a search direction, searching a current environmental exposure value corresponding to a current photosensitive value in the exposure table by the following search rules, wherein the search rules are as follows:
wherein, adc ori Is the current photosensitive value read by the equipment, adc is the respective photosensitive value in the exposure table, i is the serial number in the exposure table, EE curr Is the current ambient exposure value.
As an alternative implementation, the step of calculating the initial exposure time and the initial analog gain value comprises: if the current environment is exposedAnd if not, the initial exposure time is the maximum exposure time of the image sensor, and the initial analog gain value is the ratio of the current environment exposure value to the maximum exposure time of the image sensor. The user can set the maximum exposure time of the image sensor in the device according to actual conditions. Initial exposure time Expose ori And an initial pseudo-gain value Again ori The calculation formula of (2) is as follows:
wherein, expose max Is the maximum exposure time of the image sensor.
The initial exposure time and the initial analog gain value are used as initial exposure parameters of the image sensor, and the device captures and acquires images based on the initial exposure parameters. Since the exposure time has been calibrated by the light sensitivity value as described above, the brightness of the image taken by the device is substantially normal in most scenes after the exposure parameter settings of the image sensor have been validated. The initial exposure parameters include at least an initial exposure time and an initial analog gain value. Since the photosensitive value may be disturbed by ambient light, it is necessary to converge the image exposure so that the brightness of the image meets the desired image brightness. The image exposure convergence is realized by acquiring the brightness value of an image, adjusting the exposure parameter of equipment according to the brightness value, a preset target brightness value and the maximum exposure time of an image sensor, acquiring the image based on the adjusted exposure parameter, adjusting the exposure parameter for multiple times, taking the exposure parameter as a first exposure parameter after the equipment is adjusted when the difference value between the brightness value of the acquired image and the target brightness value is smaller than a threshold value, controlling the equipment to output the target image according to the first exposure parameter, wherein the first exposure parameter comprises first exposure time, a first analog gain value and a first digital gain value, and obtaining the image meeting the target brightness after the exposure convergence of multi-frame images. In general, exposure convergence for 3-4 frame images is required.
Since the larger the exposure time, the larger the smear of a moving object in an image, the maximum exposure time of the image needs to be limited in order to eliminate the influence of the smear on the image quality. In a low-illumination environment, a smaller maximum exposure value corresponds to a larger gain value, so that a limitation scheme of the maximum exposure time is provided for obtaining a better image effect. Namely, the noise value of the target image is calculated according to the first analog gain value and the first digital gain value. Therefore, on the basis of ensuring that the target image meets the exposure brightness, the exposure time is adjusted according to the noise of the image so as to solve the influence of the smear of the moving object in the image, thereby achieving the effects of ensuring the exposure brightness of the image and eliminating the influence of the moving object in the image. Calculating to obtain a Noise value Noise of the image according to the first analog gain value and the first digital gain value of the target image curr The calculation formula of (2) is as follows:
wherein, again curr Is a first analog gain value, dgain curr Is a first digital gain value.
And setting a first noise threshold and a second noise threshold, and calculating to obtain the corresponding maximum exposure time of the target according to the first noise threshold, the second noise threshold, the noise value of the target image and the maximum exposure time of an image sensor of the equipment. As a realizable technical way, the target maximum exposure time expose limit The calculation formula of (2) is as follows:
wherein fps is frame rate, thre1 is first noise threshold, thre2 is second noise threshold, and the first noise threshold is smaller than the second noise thresholdThreshold value, expose max Is the maximum exposure time of the image sensor.
By limiting the maximum exposure time, the influence of smear can be effectively removed. The setting of the noise threshold value can be set by a user according to the requirements of the image, namely, according to the selection and the selection of the noise and the smear of the image. The first Noise threshold and the second Noise threshold may be set to a maximum Noise value, noise, if more sensitive to image smear max Comprises the following steps:
wherein, again max For simulating the maximum value of gain, dgain max Is the digital gain maximum. The first noise threshold may be set to one-third of the maximum noise value and the second noise threshold may be set to two-thirds of the maximum noise value if it is more sensitive to image noise. In the embodiment, the maximum exposure time is restricted according to different environmental exposure values, and the problem of smear of a moving target is solved under the condition of reducing image noise.
And readjusting the exposure parameters based on the target maximum exposure time. And adjusting exposure parameters of the image to be processed according to the target maximum exposure time, wherein the exposure parameters comprise exposure time, a second analog gain value and a second digital gain value, and the exposure parameters when the difference value between the brightness value of the image and the target brightness value is smaller than a threshold value are used as final exposure parameters.
As an achievable technical means, as shown in fig. 2, the step of adjusting the exposure parameter adjustment of the image to be processed includes:
s201, acquiring a first frame of image to be processed according to a first exposure parameter, calculating to obtain an average brightness value of the first frame of image to be processed, and taking a ratio of the average brightness value of the first frame of image to be processed and a preset target brightness value of the image as an adjustment amplitude of image exposure;
s202, calculating to obtain an adjustment step length according to the adjustment amplitude and a preset exposure convergence speed, taking the calculated second exposure time, a second analog gain value and a second digital gain value as second exposure parameters according to the adjustment amplitude, the adjustment step length, the first exposure parameters and the target maximum exposure time, and outputting a second frame of image to be processed according to a second exposure parameter control device;
and S203, by analogy, adjusting the exposure parameter of the next frame of image to be processed according to the exposure parameter adjusting mode and the exposure parameter of the previous frame, and taking the exposure parameter of the next frame of image as the final exposure parameter when the difference value between the brightness value of the next frame of image to be processed and the target brightness value is smaller than the threshold value.
As an alternative implementation, as shown in fig. 3, the step of calculating the average luminance value of the to-be-processed image of the first frame includes:
s301, dividing a first frame of image to be processed into a plurality of areas, and setting corresponding weight for each area;
s302, accumulating the brightness of all pixels in each area and calculating the average value of the brightness;
s303, taking the product of the weight of each region and the corresponding average value as the average brightness value of the region;
s304, accumulating and averaging the average brightness values of all the areas to obtain the average brightness value of the first frame of image to be processed.
The image to be processed of the first frame is divided into a plurality of areas, the weight of each area is set, the weights of the areas can be the same or different, and the weights are set according to actual conditions. The number of regions is set according to the chip support capability of the device, and generally 25 to 64 regions can be set. The setting of the target brightness value of the image may be set according to the brightness preferred by the user, and is generally set to 60-100.
As an optional implementation manner, if there is a moving target in the first frame of to-be-processed image, the weight of the region where the moving target is located is set to be higher than that of other regions. If a moving target exists in the acquired image, dividing the image into a plurality of areas, setting the weight of the area where the moving target is located to be higher than that of other areas, accumulating the brightness of all pixels in each area and calculating the average value of the brightness, taking the product of the weight of each area and the corresponding average value as the average brightness value of the area, accumulating the average brightness values of all the areas and calculating the average value to obtain the brightness value of a new image, if the obtained brightness value of the image is smaller than the difference value with the target brightness value and smaller than the threshold value, not performing exposure parameter adjustment, outputting the image, and otherwise, performing the exposure parameter adjustment of the steps again. The luminance value calculation scheme in the above embodiment can obtain a better global exposure effect in some scenes, such as a reverse light scene and a highlight scene, but for a moving target object, the exposure luminance is not necessarily appropriate, and therefore, it is necessary to increase the exposure weight of the moving target in the image, for example, the exposure weight of the area where the moving target is located is directly multiplied by a coefficient greater than 1, or a fixed value is directly added to the weight to increase the weight, so that the moving target is exposed appropriately, and the influence of over-darkness and over-exposure is eliminated.
As an optional implementation manner, the adjusting step of the second exposure parameter includes: when the adjustment amplitude is larger than 1, calculating according to the exposure convergence speed and the adjustment amplitude to obtain an adjustment step length; if the first exposure time is less than the maximum target exposure time, taking the product of the adjustment step length and the first exposure time as a second exposure time, and taking the first analog gain value as a second analog gain value; if the first exposure time is equal to the target maximum exposure time, calculating to obtain a multiple required to be adjusted by the analog gain according to the adjustment step length, taking the multiple required to be adjusted by the analog gain as a second analog gain value, and if the second analog gain value reaches the maximum value, calculating to obtain a multiple required to be adjusted by the digital gain according to the adjustment step length, and taking the multiple required to be adjusted by the digital gain as a second digital gain value;
wherein the step length AE is adjusted step The calculation formula of (2) is as follows:
wherein AE is ratio In order to adjust the amplitude of the amplitude,AE speed refers to the convergence rate of exposure.
As an achievable technical mode, the adjusting step of the second exposure parameter further includes: when the adjustment amplitude is smaller than 1, calculating according to the exposure convergence speed and the adjustment amplitude to obtain an adjustment step length; calculating to obtain a multiple required to be adjusted by the digital gain according to the adjustment step length so as to enable the adjusted digital gain to reach a minimum digital gain value, wherein the multiple required to be adjusted by the digital gain is a second digital gain value; calculating to obtain a multiple required to be adjusted by the analog gain according to the adjustment step length so that the adjusted analog gain reaches a minimum analog gain value, wherein the multiple required to be adjusted by the analog gain is a second analog gain value; adjusting the exposure time according to the adjustment step length to obtain a second exposure time, wherein the adjustment step length AE step The calculation formula of (2) is as follows:
wherein AE is ratio To adjust amplitude, AE speed The exposure convergence speed is obtained.
When the adjustment amplitude is equal to 1, the first exposure time is used as the first exposure time, and the first analog gain value is used as the second analog gain value.
And processing the second frame of image to be processed based on the exposure parameter adjusting step to obtain the exposure parameter of the third frame of image to be processed. And by analogy, adjusting the exposure parameter of the next frame of image to be processed according to the exposure parameter adjusting mode and the exposure parameter of the previous frame, and taking the exposure parameter of the next frame of image as the final exposure parameter when the difference value between the brightness value of the obtained next frame of image to be processed and the target brightness value is smaller than the threshold value. And controlling the equipment to output an image according to the final exposure parameters. In general, the threshold may be set to 5. The exposure parameters are adjusted according to the limited maximum exposure time, so that the smear of a moving target is eliminated under the condition of reducing image noise, and the requirement of the exposure brightness of the image can be met.
In an embodiment of the present application, as shown in fig. 4, the present invention provides an image processing apparatus including:
an obtaining module 40, configured to obtain a first analog gain value and a first digital gain value of a target image;
an exposure time adjusting module 41, configured to calculate a noise value of the target image according to the first analog gain value and the first digital gain value, set a first noise threshold and a second noise threshold, and calculate a corresponding target maximum exposure time according to the first noise threshold, the second noise threshold, the noise value of the target image, and a maximum exposure time of an image sensor of the device;
the parameter adjusting module 42 is configured to adjust an exposure parameter of the image to be processed according to the target maximum exposure time, where the exposure parameter includes an exposure time, a second analog gain value, and a second digital gain value, and the exposure parameter when a difference between a brightness value of the image and a target brightness value is smaller than a threshold value is used as a final exposure parameter;
and an image output module 43, configured to control the apparatus to output an image according to the final exposure parameter.
As an optional mode, the image processing apparatus further includes a calibration unit, configured to calculate an environment exposure value corresponding to each photosensitive value according to a plurality of photosensitive values corresponding to a plurality of different-brightness environment lights, and calibrate an exposure table of the device according to a mapping relationship between the photosensitive values and the environment exposure values. And calibrating an exposure table through a calibration unit, so as to set an initial exposure parameter of the equipment, obtain a current photosensitive value of current ambient light, obtain a corresponding current ambient exposure value in the exposure table, and calculate the initial exposure parameter of the equipment according to the current photosensitive value, the current ambient exposure value and the maximum exposure time of the image sensor.
Although the preferred embodiments of the present invention have been disclosed for illustrative purposes, those skilled in the art will appreciate that various modifications, additions and substitutions are possible, without departing from the scope and spirit of the invention as disclosed in the accompanying claims.
Claims (10)
1. An image processing method, characterized in that the method comprises:
acquiring a first analog gain value and a first digital gain value of a target image;
calculating a noise value of the target image according to the first analog gain value and the first digital gain value, setting a first noise threshold value and a second noise threshold value, and calculating to obtain corresponding target maximum exposure time according to the first noise threshold value, the second noise threshold value, the noise value of the target image and the maximum exposure time of an image sensor of the equipment;
adjusting exposure parameters of the image to be processed according to the target maximum exposure time, wherein the exposure parameters comprise exposure time, a second analog gain value and a second digital gain value, and the exposure parameters when the difference value between the brightness value of the image and the target brightness value is smaller than a threshold value are used as final exposure parameters;
and controlling equipment to output images according to the final exposure parameters.
2. The image processing method of claim 1, further comprising calibration of an exposure table, the calibration comprising:
acquiring a plurality of photosensitive values corresponding to a plurality of ambient lights with different brightness, calculating an ambient exposure value corresponding to each photosensitive value, and calibrating the mapping relation between the photosensitive values and the ambient exposure values to be an exposure table of the equipment.
3. The image processing method of claim 2, wherein the step of obtaining the first analog gain value and the first digital gain value of the target image comprises:
acquiring a current photosensitive value of current ambient light, acquiring a corresponding current ambient exposure value in an exposure table, calculating to obtain an initial exposure parameter of equipment according to the current photosensitive value, the current ambient exposure value and the maximum exposure time of the image sensor, and controlling the equipment to output an image according to the initial exposure parameter, wherein the initial exposure parameter comprises initial exposure time and an initial analog gain value;
the method comprises the steps of obtaining a brightness value of an image, adjusting exposure parameters of the equipment according to the brightness value, a preset target brightness value and the maximum exposure time of the image sensor, collecting the image according to the adjusted exposure parameters, taking the exposure parameters when the difference value between the brightness value of the collected image and the target brightness value is smaller than a threshold value as first exposure parameters after the equipment is adjusted, and controlling the equipment to output the target image according to the first exposure parameters, wherein the first exposure parameters comprise first exposure time, a first analog gain value and a first digital gain value.
4. The image processing method of claim 3, wherein the step of calculating the noise value of the target image comprises:
calculating to obtain a Noise value Noise of the image according to the first analog gain value and the first digital gain value of the target image curr The calculation formula of (2) is as follows:
wherein, again curr Is a first analog gain value, dgain curr Is a first digital gain value;
adjusting the maximum exposure time of the image sensor according to the noise value, the first noise threshold value and the second noise threshold value to obtain the maximum exposure time of the target and the maximum exposure time of the target limit The calculation formula of (c) is:
wherein fps is frame rate, thre1 is first noise threshold, thre2 is second noise threshold, the first noise threshold is smaller than the second noise threshold, and expose max Is the maximum exposure time of the image sensor.
5. The image processing method according to claim 4, wherein the step of adjusting the exposure parameter adjustment of the image to be processed comprises:
acquiring a first frame of image to be processed according to the first exposure parameter, calculating to obtain an average brightness value of the first frame of image to be processed, and taking the ratio of the average brightness value of the first frame of image to be processed and a preset target brightness value of the image as the adjustment amplitude of image exposure;
calculating to obtain an adjustment step length according to the adjustment amplitude and a preset exposure convergence speed, taking a second exposure time, a second analog gain value and a second digital gain value which are obtained by calculation as second exposure parameters according to the adjustment amplitude, the adjustment step length, the first exposure parameter and the target maximum exposure time, and outputting a second frame of image to be processed according to the second exposure parameter control equipment;
and by analogy, adjusting the exposure parameter of the next frame of image to be processed according to the exposure parameter adjustment mode and the exposure parameter of the previous frame, and when the difference value between the brightness value of the obtained next frame of image to be processed and the target brightness value is smaller than the threshold value, taking the exposure parameter of the next frame of image as the final exposure parameter.
6. The image processing method according to claim 5, wherein the calculating of the average luminance value of the first frame image to be processed comprises:
dividing the first frame of image to be processed into a plurality of areas, and setting corresponding weight for each area;
accumulating the brightness of all pixels in each area and averaging the brightness;
taking the product of the weight of each region and the corresponding average value as the average brightness value of the region;
and accumulating and averaging the average brightness values of all the areas to obtain the average brightness value of the first frame of image to be processed.
7. The image processing method according to claim 6, wherein the setting of the region weight further comprises:
and if the first frame of image to be processed has a moving target, setting the weight of the area where the moving target is located to be higher than that of other areas.
8. The image processing method according to claim 5, wherein the adjusting of the second exposure parameter comprises:
when the adjustment amplitude is larger than 1, calculating according to the exposure convergence speed and the adjustment amplitude to obtain an adjustment step length;
if the first exposure time is less than the maximum target exposure time, taking the product of the adjustment step length and the first exposure time as a second exposure time, and taking the first analog gain value as a second analog gain value;
if the first exposure time is equal to the target maximum exposure time, calculating to obtain a multiple required to be adjusted by the analog gain according to the adjustment step length, taking the multiple required to be adjusted by the analog gain as a second analog gain value, and if the second analog gain value reaches the maximum value, calculating to obtain a multiple required to be adjusted by the digital gain according to the adjustment step length, and taking the multiple required to be adjusted by the digital gain as a second digital gain value;
wherein the step length AE is adjusted step The calculation formula of (2) is as follows:
wherein AE is ratio To adjust amplitude, AE speed Is the exposure convergence speed.
9. The image processing method according to claim 5, wherein the adjusting of the second exposure parameter further comprises:
when the adjustment amplitude is smaller than 1, calculating according to the exposure convergence speed and the adjustment amplitude to obtain an adjustment step length;
calculating to obtain a multiple required to be adjusted by the digital gain according to the adjustment step length so as to enable the adjusted digital gain to reach a minimum digital gain value, wherein the multiple required to be adjusted by the digital gain is a second digital gain value;
calculating to obtain a multiple required to be adjusted by the analog gain according to the adjustment step length so that the adjusted analog gain reaches a minimum analog gain value, wherein the multiple required to be adjusted by the analog gain is a second analog gain value;
adjusting the exposure time according to the adjustment step length to obtain a second exposure time;
wherein the step length AE is adjusted step The calculation formula of (c) is:
wherein AE is ratio To adjust amplitude, AE speed The exposure convergence speed is obtained.
10. An image processing apparatus, characterized in that the apparatus comprises:
the acquisition module is used for acquiring a first analog gain value and a first digital gain value of a target image;
the exposure time adjusting module is used for calculating a noise value of the target image according to the first analog gain value and the first digital gain value, setting a first noise threshold value and a second noise threshold value, and calculating to obtain corresponding target maximum exposure time according to the first noise threshold value, the second noise threshold value, the noise value of the target image and the maximum exposure time of an image sensor of the equipment;
the parameter adjusting module is used for adjusting exposure parameters of the image to be processed according to the target maximum exposure time, wherein the exposure parameters comprise exposure time, a second analog gain value and a second digital gain value, and the exposure parameters when the difference value between the brightness value of the image and the target brightness value is smaller than a threshold value are used as final exposure parameters;
and the image output module is used for controlling equipment to output images according to the final exposure parameters.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310246906.0A CN115967861B (en) | 2023-03-09 | 2023-03-09 | Image processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310246906.0A CN115967861B (en) | 2023-03-09 | 2023-03-09 | Image processing method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115967861A true CN115967861A (en) | 2023-04-14 |
CN115967861B CN115967861B (en) | 2023-06-16 |
Family
ID=85889829
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310246906.0A Active CN115967861B (en) | 2023-03-09 | 2023-03-09 | Image processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115967861B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118075617A (en) * | 2024-04-22 | 2024-05-24 | 杭州涂鸦信息技术有限公司 | Image exposure method, device, electronic equipment and storage medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2004363658A (en) * | 2003-06-02 | 2004-12-24 | Matsushita Electric Ind Co Ltd | Image signal processor |
US20070092244A1 (en) * | 2005-10-25 | 2007-04-26 | Shimon Pertsel | Camera exposure optimization techniques that take camera and scene motion into account |
CN101095078A (en) * | 2004-12-29 | 2007-12-26 | 诺基亚公司 | Exposure of digital imaging |
US20150163414A1 (en) * | 2013-12-06 | 2015-06-11 | Jarno Nikkanen | Robust automatic exposure control using embedded data |
CN107071308A (en) * | 2016-12-27 | 2017-08-18 | 福建新大陆自动识别技术有限公司 | A kind of CMOS is quickly adjusted to as system and method |
KR102105787B1 (en) * | 2019-01-28 | 2020-04-29 | 한국과학기술원 | Apparatus and method for controlling camera attribute using bayesian optimization |
CN111757015A (en) * | 2019-03-28 | 2020-10-09 | 杭州海康威视数字技术股份有限公司 | Exposure control method and device and electronic equipment |
CN112788250A (en) * | 2021-02-01 | 2021-05-11 | 青岛海泰新光科技股份有限公司 | Automatic exposure control method based on FPGA |
-
2023
- 2023-03-09 CN CN202310246906.0A patent/CN115967861B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2004363658A (en) * | 2003-06-02 | 2004-12-24 | Matsushita Electric Ind Co Ltd | Image signal processor |
CN101095078A (en) * | 2004-12-29 | 2007-12-26 | 诺基亚公司 | Exposure of digital imaging |
US20070092244A1 (en) * | 2005-10-25 | 2007-04-26 | Shimon Pertsel | Camera exposure optimization techniques that take camera and scene motion into account |
US20150163414A1 (en) * | 2013-12-06 | 2015-06-11 | Jarno Nikkanen | Robust automatic exposure control using embedded data |
CN107071308A (en) * | 2016-12-27 | 2017-08-18 | 福建新大陆自动识别技术有限公司 | A kind of CMOS is quickly adjusted to as system and method |
KR102105787B1 (en) * | 2019-01-28 | 2020-04-29 | 한국과학기술원 | Apparatus and method for controlling camera attribute using bayesian optimization |
CN111757015A (en) * | 2019-03-28 | 2020-10-09 | 杭州海康威视数字技术股份有限公司 | Exposure control method and device and electronic equipment |
CN112788250A (en) * | 2021-02-01 | 2021-05-11 | 青岛海泰新光科技股份有限公司 | Automatic exposure control method based on FPGA |
Non-Patent Citations (2)
Title |
---|
UKCHEOL SHIN: "Camera Exposure Control for Robust Robot Vision with Noise-Aware Image Quality Assessment", 2019 IEEE/RSJ INTERNATIONAL CONFERENCE ON INTELLIGENT ROBOTS AND SYSTEMS (IROS) * |
刘业琦;吴治军;刘昌举;祝晓笑;刘戈扬;: "一种应用于安防监控的CMOS图像传感器的自动曝光算法研究", 半导体光电, no. 02 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118075617A (en) * | 2024-04-22 | 2024-05-24 | 杭州涂鸦信息技术有限公司 | Image exposure method, device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN115967861B (en) | 2023-06-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101399919B (en) | Method for automatic exposure and automatic gain regulation and method thereof | |
CN104717435B (en) | Camera device and image capture method | |
US7034870B2 (en) | Image pickup apparatus with reduced flicker and automatic level adjusting method of the same | |
JP4960605B2 (en) | Automatic exposure compensation method and compensation device | |
KR910011059A (en) | Back balance adjustment device which automatically performs back balance adjustment based on the color information signal obtained from the imaging element | |
US20060221216A1 (en) | Imaging apparatus | |
US7633532B2 (en) | Image processing method, image processing apparatus, and image pickup apparatus having first and second exposure values | |
JPWO2005091624A1 (en) | Automatic gain control circuit | |
US20050264682A1 (en) | Exposure control apparatus and exposure control method | |
CN110246101B (en) | Image processing method and device | |
KR20030097687A (en) | Image processing apparatus, camera apparatus, and automatic exposure control method | |
CN110636227B (en) | High dynamic range HDR image synthesis method and high-speed camera integrating same | |
CN115967861B (en) | Image processing method and device | |
CN112118388A (en) | Image processing method, image processing device, computer equipment and storage medium | |
CN106572310A (en) | Light supplement intensity control method and camera | |
EP3226547B1 (en) | Controlling signal-to-noise ratio in high dynamic range automatic exposure control imaging | |
JP2004282133A (en) | Automatic white balance processor and method, and image signal processor | |
JP3861711B2 (en) | Brightness level correction device | |
GB2569593A (en) | Exposure ratio control | |
KR101005769B1 (en) | Auto exposure and auto white-balance method for detecting high dynamic range conditions | |
CN108551555B (en) | Automatic exposure method of industrial camera using CMOS detector | |
CN108830904B (en) | Parameter-optimized camera response curve calibration method | |
US6927799B2 (en) | Auto-strobe apparatus and method for digital camera | |
JP2010183461A (en) | Image capturing apparatus and method of controlling the same | |
JP2021093694A (en) | Information processing apparatus and method for controlling the same |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |