CN115967861B - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
CN115967861B
CN115967861B CN202310246906.0A CN202310246906A CN115967861B CN 115967861 B CN115967861 B CN 115967861B CN 202310246906 A CN202310246906 A CN 202310246906A CN 115967861 B CN115967861 B CN 115967861B
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.)
Active
Application number
CN202310246906.0A
Other languages
Chinese (zh)
Other versions
CN115967861A (en
Inventor
曹绪民
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Tuya Information Technology Co Ltd
Original Assignee
Hangzhou Tuya Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Hangzhou Tuya Information Technology Co Ltd filed Critical Hangzhou Tuya Information Technology Co Ltd
Priority to CN202310246906.0A priority Critical patent/CN115967861B/en
Publication of CN115967861A publication Critical patent/CN115967861A/en
Application granted granted Critical
Publication of CN115967861B publication Critical patent/CN115967861B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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 value and a second noise threshold value, and calculating a 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 device; 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 are used as final exposure parameters when the difference value between the brightness value of the image and the target brightness value is smaller than a threshold value; the apparatus outputs an image according to the final exposure parameters. The invention solves the technical problem of smear of the moving object in the image.

Description

Image processing method and device
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 is mainly aimed at an exposure method when a normally-powered device is in a current drawing state, exposure adjustment is carried out through real-time brightness information, for low-power consumption devices, battery power is generally supplied, the device is usually set to a dormant mode when the device is not in operation, when the device shoots a moving object, after the device wakes up from the dormant mode, imaging needs to be started quickly, image exposure needs to be converged very quickly, otherwise, the moving object is difficult to be shot, and therefore, for the low-power consumption devices, if a traditional image exposure mode is used, proper exposure convergence is difficult to be completed within hundreds of milliseconds, and the technical problems of overexposure, darkness, smear and the like can be caused in the image.
Disclosure of Invention
Accordingly, the present invention is directed to an image processing method and apparatus, which can shorten the time of image exposure convergence and solve the technical problem of smear of moving objects in images.
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 a 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 device;
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 are used as final exposure parameters when the difference value between the brightness value of the image and the target brightness value is smaller than a threshold value;
the apparatus outputs an image according to the final exposure parameters.
Further, the method further comprises calibrating the exposure meter, and the calibrating step comprises the following steps:
and acquiring a plurality of photosensitive values corresponding to the plurality of ambient lights with different brightness, calculating an ambient exposure value corresponding to each photosensitive value, and calibrating the ambient exposure value as an exposure table of the equipment according to the mapping relation between the photosensitive values and the ambient exposure values.
Further, the step of acquiring the first analog gain value and the 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 an initial exposure time and an initial analog gain value;
acquiring a brightness value of an image, adjusting exposure parameters of the device 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 device is adjusted, and controlling the device to output the target image according to the first exposure parameters, wherein the first exposure parameters comprise a 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 includes:
according to the first analog gain value and the first number of the target imageWord gain value, noise value Noise of image is calculated curr The calculation formula of (2) is as follows:
Figure SMS_1
wherein Again curr Dgain is the first analog gain value 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 and the second noise threshold to obtain a target maximum exposure time, and the target maximum exposure time limit The calculation formula of (2) is as follows:
Figure SMS_2
wherein fps is the frame rate, thre1 is the first noise threshold, thre2 is the second noise threshold, the first noise threshold is less 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 to-be-processed image according to a first exposure parameter, calculating to obtain an average brightness value of the first frame of to-be-processed image, and taking a ratio of the average brightness value of the first frame of to-be-processed image to a preset target brightness value of the image as an adjustment amplitude of image exposure;
calculating an adjustment step length according to the adjustment amplitude and the preset exposure convergence speed, and controlling equipment to output a second frame of image to be processed according to the second exposure parameter by taking the calculated second exposure time, second analog gain value and second digital gain value as the second exposure parameter according to the adjustment amplitude, the adjustment step length, the first exposure parameter and the target maximum exposure time;
and the like, adjusting the exposure parameters of the image to be processed of the next frame according to the exposure parameter adjusting mode and the exposure parameters of the previous frame, and taking the exposure parameters of the image of the next frame as final exposure parameters when the acquired difference value between the brightness value of the image to be processed of the next frame and the target brightness value is smaller than a threshold value.
Further, the calculating step of the average brightness value of the first frame of the image to be processed includes:
dividing the first frame of image to be processed into a plurality of areas, and setting corresponding weights in 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 image to be processed of the first frame.
Further, the setting of the area weight further includes: and if the first frame of to-be-processed image 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 smaller than the target maximum 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 the multiple of the analog gain to be adjusted according to the adjustment step length, taking the multiple of the analog gain to be adjusted as a second analog gain value, and if the second analog gain value reaches the maximum value, calculating to obtain the multiple of the digital gain to be adjusted according to the adjustment step length, and taking the multiple of the digital gain to be adjusted as a second digital gain value;
wherein, the step AE is adjusted step The calculation formula of (2) is as follows:
Figure SMS_3
wherein AE ratio To adjust the amplitude, AE speed Is the exposure convergence speed.
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 the multiple required to be adjusted for the digital gain according to the adjustment step length so as to enable the adjusted digital gain to reach the minimum digital gain value, wherein the multiple required to be adjusted for the digital gain is a second digital gain value;
calculating the multiple required to be adjusted for the analog gain according to the adjustment step length so as to enable the adjusted analog gain to reach the minimum analog gain value, wherein the multiple required to be adjusted for the analog gain is a second analog gain value;
adjusting the exposure time according to the adjustment step length, so as to obtain a second exposure time;
wherein, the step AE is adjusted step The calculation formula of (2) is as follows:
Figure SMS_4
wherein AE ratio To adjust the amplitude, AE speed Is the exposure convergence speed.
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 the target image;
the exposure time adjusting module is used for calculating the 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 the 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 adjustment 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 are used as final exposure parameters when the difference value between the brightness value of the image and the target brightness value is smaller than a threshold value;
and the image output module is used for controlling the equipment to output an image according to the final exposure parameters.
According to the invention, through the calibration of the exposure meter, the time for image exposure convergence is greatly shortened, and the calibration workload is reduced; based on different environmental exposure values to the maximum exposure time constraint, 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 schematic flow chart of another image processing method according to the present invention;
FIG. 3 is a schematic view of another flow chart of the image processing method according to the present invention;
fig. 4 is a system schematic diagram of an image processing apparatus according to the present invention.
Detailed Description
The present invention will be described in detail below with reference to the specific embodiments shown in the drawings, but these embodiments are not limited to the present invention, and structural, method, or functional modifications made by those skilled in the art based on these 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, which includes:
s1, acquiring a first analog gain value and a first digital gain value of a target image;
s2, 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 a 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 device;
s3, 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 are used as final exposure parameters when the difference value between the brightness value of the image and the target brightness value is smaller than a threshold value;
s4, controlling the equipment to output an image according to the final exposure parameters.
And (3) performing image preprocessing on the image acquired by the equipment, namely performing image exposure convergence on the acquired image so as to ensure that the target image acquired by the equipment meets the 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 and the technical problem of smear of a moving object in the image can be solved under the condition of reducing image noise.
Calibration of the exposure table is required for the device to determine the initial exposure parameters of the device. As an achievable mode, a plurality of photosensitive values corresponding to a plurality of ambient lights with different brightness are obtained, the ambient exposure value corresponding to each photosensitive value is calculated, and the mapping relation between the photosensitive value and the ambient exposure value is calibrated as an exposure table of the device. And reading the corresponding photosensitive values and the exposure time and gain value after exposure convergence by equipment under different illumination environments, so as to calculate the corresponding environment exposure values under different photosensitive values, and constructing an exposure table according to the mapping relation between the photosensitive values and the environment exposure values. Specifically, the device is placed under a uniform light source, the brightness of ambient light is adjusted, the corresponding photosensitive value under the brightness is read through the device, the exposure time and the analog gain value of the image sensor in the device are adjusted so that after the image reaches the proper brightness value for exposure, the product of the exposure time and the analog gain value is used as the corresponding ambient exposure value of the photosensitive value, and the like, the brightness of the ambient light is continuously adjusted so as to change the photosensitive value, the whole photosensitive measurement range is traversed so as to obtain the corresponding ambient exposure value of each photosensitive value, and therefore an exposure table is obtained and is set and stored in the device, and the calibration of the exposure table of the device is completed. The values in the tables are examples only and do not represent true values, as in the exposure tables shown below.
Figure SMS_5
Under the implementation mode, the calibration of the exposure meter is established through the mapping relation between the environment exposure value and the photosensitive value, and the exposure time and the gain value of the image sensor in the equipment are not directly corresponding to the photosensitive value, so that the maintenance and calibration work of the exposure meter can be effectively reduced, the exposure meter is arranged in the equipment, and the time for converging the exposure of the image of the equipment can be greatly shortened. For example, different devices may have different requirements on the frame rate of the image, the frame rate may be 15 frames, 25 frames, 30 frames, 60 frames, etc., the frame rate may limit the size of the device exposure time, and the maximum exposure and frame rate of different image sensors may be different, so if the exposure time and gain values are directly calibrated, multiple tables may be maintained and calibrated at different frame rates and image sensors. According to the implementation mode, the environment exposure value corresponds to the photosensitive value, only one exposure table is maintained, and the workload of calibration and maintenance is obviously reduced.
As an alternative implementation, the step of acquiring the first analog gain value and the 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 an initial exposure time and an initial analog gain value; acquiring a brightness value of an image, adjusting exposure parameters of the device 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 device is adjusted, and controlling the device to output the target image according to the first exposure parameters, wherein the first exposure parameters comprise a 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 ambient light, and acquiring a corresponding current ambient exposure value in an exposure table. In the exposure table, based on a searching direction, searching the current environment exposure value corresponding to the current photosensitive value in the exposure table by the following searching rule:
Figure SMS_6
wherein, add ori Refers to the current photosensitive value read by the equipment, adc refers to each photosensitive value in the exposure table, i refers to 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 environmental exposure value is less than or equal to the maximum exposure time of the image sensor, the initial exposure time is the current environmental exposure value, the initial analog gain value is 1, otherwise, 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 environmental 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 the actual situation. Initial exposure time Expose ori And an initial pseudo-gain value Again ori The calculation formula of (2) is as follows:
Figure SMS_7
wherein, expose max Is the maximum exposure time of the image sensor.
Taking the initial exposure time and the initial analog gain value as initial exposure parameters of the image sensor, the device captures an image based on the initial exposure parameters. Since the exposure time has been calibrated by the light sensitive value as described above, the brightness of the image captured by the device is substantially normal in most scenes after the exposure parameter setting of the image sensor has been effected. The initial exposure parameters include at least an initial exposure time and an initial analog gain value. Since the photosensitive values may be disturbed by ambient light, it is necessary to converge the exposure of the image so that the brightness of the image meets the desired brightness of the image. The image exposure convergence is carried out by acquiring the brightness value of an image, adjusting the exposure parameter of the device according to the brightness value, a preset target brightness value and the maximum exposure time of an image sensor, carrying out image acquisition based on the adjusted exposure parameter, adjusting the exposure parameter for a plurality of times, when the difference value between the acquired brightness value of the image and the target brightness value is smaller than a threshold value, taking the exposure parameter as a first exposure parameter after the device adjustment, controlling the device to output the target image according to the first exposure parameter, wherein the first exposure parameter comprises a 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 a plurality of frames of images. In general, exposure convergence of 3-4 frame images is required.
Since the larger the exposure time, the larger the smear of the moving object in the 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 limiting scheme of the maximum exposure time is provided for obtaining a better image effect. I.e. the noise value of the target image is calculated from the first analog gain value and the first digital gain value. From the above, the target image is subjected to image exposure convergence preprocessing operation, the brightness of the target image can basically meet the expected image brightness and reach the normal exposure brightness, so that the target image is ensured to meet the exposure brightness, and 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 following purposesThe exposure brightness of the image is ensured, and the effect of the influence of moving objects in the image can be eliminated. According to the first analog gain value and the first digital gain value of the target image, calculating to obtain the Noise value of the image, noise value Noise curr The calculation formula of (2) is as follows:
Figure SMS_8
wherein Again curr Dgain is the first analog gain value curr Is the first digital gain value.
Setting a first noise threshold value and a second noise threshold value, and calculating a 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 the image sensor of the device. As an achievable technical way, a target maximum exposure time exposure limit The calculation formula of (2) is as follows:
Figure SMS_9
wherein fps is the frame rate, thre1 is the first noise threshold, thre2 is the second noise threshold, the first noise threshold is less than the second noise threshold, and expose max Is the maximum exposure time of the image sensor.
By limiting the maximum exposure time, the effect of smear can be effectively removed. The noise threshold can be set by the user according to the requirements of the image, namely, the noise and smear of the image can be selected and removed. If the image smear is more sensitive, the first Noise threshold and the second Noise threshold can be set to be maximum Noise values, and the maximum Noise value Noise max The method comprises the following steps:
Figure SMS_10
wherein Again max Dgain, which is the maximum value of the analog gain max Digital gain maximum. If it is more sensitive to image noise, a first noise thresholdThe second 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. In this embodiment, the maximum exposure time is constrained according to different environmental exposure values, and the problem of smear of the moving object is eliminated while reducing image noise.
The exposure parameters are readjusted 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 are taken as final exposure parameters when the difference value between the brightness value of the image and the target brightness value is smaller than a threshold value.
As an implementation manner, as shown in fig. 2, the step of adjusting the exposure parameter of the image to be processed includes:
s201, acquiring a first frame of to-be-processed image according to a first exposure parameter, calculating to obtain an average brightness value of the first frame of to-be-processed image, and taking a ratio of the average brightness value of the first frame of to-be-processed image to a preset target brightness value of the image as an adjustment amplitude of image exposure;
s202, calculating an adjustment step length according to the adjustment amplitude and a preset exposure convergence speed, and controlling equipment to output a second frame of image to be processed according to the second exposure parameter by taking the calculated second exposure time, second analog gain value and second digital gain value as the second exposure parameter according to the adjustment amplitude, the adjustment step length, the first exposure parameter and the target maximum exposure time;
and S203, by analogy, adjusting the exposure parameters of the image to be processed of the next frame according to the exposure parameter adjustment mode and the exposure parameters of the previous frame, and taking the exposure parameters of the image of the next frame as final exposure parameters when the acquired difference value between the brightness value of the image to be processed of the next frame and the target brightness value is smaller than a threshold value.
As an alternative implementation manner, as shown in fig. 3, the step of calculating the average brightness value of the image to be processed of the first frame includes:
s301, dividing a first frame of to-be-processed image into a plurality of areas, and setting corresponding weights in 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 image to be processed of the first frame.
The first frame of the image to be processed 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, the setting is carried out according to the practical situation, generally, the naked eyes of people are more prone to the area in the middle of the image, and therefore the weight of the area in the middle of the general image is higher than that of the area around the image. The number of areas is set according to the chip support capability of the device, and generally 25 to 64 areas can be set. The target brightness value of the image can be set according to the brightness preferred by the user, and is generally set to 60-100.
As an alternative implementation manner, if the moving target exists in the image to be processed of the first frame, the weight of the area where the moving target is located is set to be higher than that of other areas. 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, averaging the brightness of the areas, 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 areas, averaging the average brightness values of all areas to obtain a new brightness value of the image, if the brightness value of the obtained image is smaller than the difference value between the brightness value of the obtained image and the target brightness value and is smaller than a threshold value, not performing exposure parameter adjustment, outputting the image, and otherwise, re-executing exposure parameter adjustment of the steps. In the above embodiment, the luminance value calculation scheme can obtain a better global exposure effect in some scenes, such as backlight and highlight scenes, but for a moving target object, the exposure luminance is not necessarily suitable, so that the exposure weight of the moving target in an image needs to be increased, 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 properly exposed, and the effects of darkness and overexposure are eliminated.
As an alternative implementation, the step of adjusting 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 smaller than the target maximum 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 the multiple of the analog gain to be adjusted according to the adjustment step length, taking the multiple of the analog gain to be adjusted as a second analog gain value, and if the second analog gain value reaches the maximum value, calculating to obtain the multiple of the digital gain to be adjusted according to the adjustment step length, and taking the multiple of the digital gain to be adjusted as a second digital gain value;
wherein, the step AE is adjusted step The calculation formula of (2) is as follows:
Figure SMS_11
wherein AE ratio To adjust the amplitude, AE speed Refers to the convergence speed of exposure.
As an achievable technical manner, 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 the multiple required to be adjusted for the digital gain according to the adjustment step length so as to enable the adjusted digital gain to reach the minimum digital gain value, wherein the multiple required to be adjusted for the digital gain is a second digital gain value; calculating the multiple required to be adjusted for the analog gain according to the adjustment step length so as to enable the adjusted analog gain to reach the minimum analog gain value, wherein the multiple required to be adjusted for 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:
Figure SMS_12
wherein AE ratio To adjust the amplitude, AE speed Is the exposure convergence speed.
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 based on the exposure parameter adjustment step, processing the second frame of to-be-processed image to obtain the exposure parameter of the third frame of to-be-processed image. And the like, adjusting the exposure parameters of the image to be processed of the next frame according to the exposure parameter adjustment mode and the exposure parameters of the previous frame, and taking the exposure parameters of the image of the next frame as final exposure parameters when the acquired difference value between the brightness value of the image to be processed of the next frame and the target brightness value is smaller than a threshold value. The apparatus outputs an image according to the final exposure parameters. Typically, the threshold may be set to 5. The exposure parameters are adjusted according to the limited maximum exposure time, so that the smear of the moving target is eliminated under the condition of reducing the image noise, and the exposure brightness requirement 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 acquisition module 40 for acquiring a first analog gain value and a first digital gain value of the target image;
an exposure time adjustment 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 the maximum exposure time of an image sensor of the device;
a parameter adjustment module 42, 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 is used as a final exposure parameter when a difference between a brightness value of the image and the target brightness value is smaller than a threshold value;
an image output module 43 for controlling the apparatus to output an image according to the final exposure parameters.
As an alternative way, the image processing apparatus further comprises a calibration unit, configured to calculate an ambient exposure value corresponding to each of the plurality of light-sensitive values corresponding to the plurality of ambient lights with different brightness, and calibrate the ambient exposure value as an exposure table of the device according to a mapping relationship between the light-sensitive value and the ambient exposure value. And calibrating an exposure table by a calibration unit, so as to set initial exposure parameters of the equipment, acquiring a current photosensitive value of current ambient light, acquiring a corresponding current ambient exposure value in the exposure table, and calculating to obtain the initial exposure parameters 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, the method comprising:
acquiring a first analog gain value and a first digital gain value of a target image;
calculating the 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 the 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 device;
adjusting exposure parameters of an 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 are used as final exposure parameters when the difference value between the brightness value of the image and the target brightness value is smaller than a threshold value;
and controlling the equipment to output an image according to the final exposure parameters.
2. The image processing method of claim 1, further comprising calibration of an exposure meter, the step of calibrating comprising:
and acquiring a plurality of photosensitive values corresponding to the plurality of ambient lights with different brightness, calculating an ambient exposure value corresponding to each photosensitive value, and calibrating the ambient exposure value as an exposure table of the equipment according to the mapping relation between the photosensitive values and the ambient exposure values.
3. The image processing method according to claim 2, wherein the step of acquiring the first analog gain value and the 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 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 an initial exposure time and an initial analog gain value;
acquiring a brightness value of an image, adjusting an exposure parameter of the device 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 parameter, taking the exposure parameter when the difference value between the brightness value of the collected image and the target brightness value is smaller than the threshold value as a first exposure parameter after device adjustment, and controlling the device to output the target image according to the first exposure parameter, wherein the first exposure parameter comprises a first exposure time, a first analog gain value and a first digital gain value.
4. The image processing method according to claim 3, wherein the step of calculating the noise value of the target image includes:
according to the target graphThe first analog gain value and the first digital gain value of the image are calculated to obtain the Noise value of the image, noise value Noise curr The calculation formula of (2) is as follows:
Figure QLYQS_1
wherein Again curr Dgain is the first analog gain value 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 and the second noise threshold to obtain a target maximum exposure time, and a target maximum exposure time exposure limit The calculation formula of (2) is as follows:
Figure QLYQS_2
wherein fps is the frame rate, thre1 is the first noise threshold, thre2 is the second noise threshold, the first noise threshold is less 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 exposure parameters of the image to be processed includes:
acquiring a first frame of to-be-processed image according to the first exposure parameters, calculating to obtain an average brightness value of the first frame of to-be-processed image, and taking a ratio of the average brightness value of the first frame of to-be-processed image to a preset target brightness value of the image as an adjustment amplitude of image exposure;
calculating an adjustment step length according to the adjustment amplitude and a preset exposure convergence speed, and controlling equipment to output a second frame of image to be processed according to the second exposure parameter, wherein the calculated second exposure time, second analog gain value and second digital gain value are used as second exposure parameters according to the adjustment amplitude, the adjustment step length, the first exposure parameter and the target maximum exposure time;
and by analogy, adjusting the exposure parameters of the image to be processed of the next frame according to the exposure parameter adjustment mode and the exposure parameters of the previous frame, and taking the exposure parameters of the image of the next frame as final exposure parameters when the acquired difference value between the brightness value of the image to be processed of the next frame and the target brightness value is smaller than the threshold value.
6. The image processing method according to claim 5, wherein the calculating of the average luminance value of the first frame of the image to be processed includes:
dividing the first frame to-be-processed image into a plurality of areas, and setting corresponding weights in 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 image to be processed of the first frame.
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 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 smaller than the target maximum 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 the multiple required to be adjusted of the analog gain according to the adjustment step length, taking the multiple required to be adjusted of the analog gain as a second analog gain value, and if the second analog gain value reaches the maximum value, calculating to obtain the multiple required to be adjusted of the digital gain according to the adjustment step length, and taking the multiple required to be adjusted of the digital gain as a second digital gain value;
wherein, the step AE is adjusted step The calculation formula of (2) is as follows:
Figure QLYQS_3
wherein AE ratio To adjust the 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 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 the multiple required to be adjusted for the digital gain according to the adjustment step length so as to enable the adjusted digital gain to reach the minimum digital gain value, wherein the multiple required to be adjusted for the digital gain is a second digital gain value;
calculating the multiple required to be adjusted for the analog gain according to the adjustment step length so as to enable the adjusted analog gain to reach the minimum analog gain value, wherein the multiple required to be adjusted for the analog gain is a second analog gain value;
adjusting the exposure time according to the adjustment step length, so as to obtain a second exposure time;
wherein, the step AE is adjusted step The calculation formula of (2) is as follows:
Figure QLYQS_4
wherein AE ratio To adjust the amplitude, AE speed Is the exposure convergence speed.
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 the target image;
the exposure time adjusting module is used for calculating the 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 the 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 device;
the parameter adjustment 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 are used as final exposure parameters when the difference value between the brightness value of the image and the target brightness value is smaller than a threshold value;
and the image output module is used for controlling the equipment to output an image according to the final exposure parameters.
CN202310246906.0A 2023-03-09 2023-03-09 Image processing method and device Active CN115967861B (en)

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 CN115967861A (en) 2023-04-14
CN115967861B true 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)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118075617B (en) * 2024-04-22 2024-07-23 杭州涂鸦信息技术有限公司 Image exposure method, device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101095078A (en) * 2004-12-29 2007-12-26 诺基亚公司 Exposure of digital imaging
CN107071308A (en) * 2016-12-27 2017-08-18 福建新大陆自动识别技术有限公司 A kind of CMOS is quickly adjusted to as system and method

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4440562B2 (en) * 2003-06-02 2010-03-24 パナソニック株式会社 Video signal processing device
US7546026B2 (en) * 2005-10-25 2009-06-09 Zoran Corporation Camera exposure optimization techniques that take camera and scene motion into account
US9294687B2 (en) * 2013-12-06 2016-03-22 Intel Corporation Robust automatic exposure control using embedded data
KR102105787B1 (en) * 2019-01-28 2020-04-29 한국과학기술원 Apparatus and method for controlling camera attribute using bayesian optimization
CN111757015B (en) * 2019-03-28 2021-12-03 杭州海康威视数字技术股份有限公司 Exposure control method and device and electronic equipment
CN112788250B (en) * 2021-02-01 2022-06-17 青岛海泰新光科技股份有限公司 Automatic exposure control method based on FPGA

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101095078A (en) * 2004-12-29 2007-12-26 诺基亚公司 Exposure of digital imaging
CN107071308A (en) * 2016-12-27 2017-08-18 福建新大陆自动识别技术有限公司 A kind of CMOS is quickly adjusted to as system and method

Also Published As

Publication number Publication date
CN115967861A (en) 2023-04-14

Similar Documents

Publication Publication Date Title
US8194153B2 (en) Imaging apparatus, imaging method and program
US7415203B2 (en) Method and apparatus for controlling automatic exposure in a camera
CN110769164B (en) Method for automatically adjusting illumination level of target scene
CN110248112B (en) Exposure control method of image sensor
CN110636227B (en) High dynamic range HDR image synthesis method and high-speed camera integrating same
CN115967861B (en) Image processing method and device
JP2007067907A (en) Image pickup apparatus, image pickup method, and image pickup program; and image processor, image processing method, and image processing program
CN105100637A (en) Image processing method and electronic equipment
TWI230315B (en) An image capture device and a method of the image exposure process
KR20030097687A (en) Image processing apparatus, camera apparatus, and automatic exposure control method
JP2007082181A (en) Imaging apparatus and image processing method
CN107995396B (en) Two camera modules and terminal
CN104221364A (en) Imaging device and image processing method
CN107635124B (en) White balancing treatment method, device and the equipment of face shooting
CN113639881A (en) Color temperature testing method and device, computer readable medium and electronic equipment
CN110572585B (en) Image processing method, image processing device, storage medium and electronic equipment
CN104869319A (en) Image processing method and image processing device
CN107454388B (en) Image processing method and apparatus using the same
GB2569593A (en) Exposure ratio control
JP6862114B2 (en) Processing equipment, processing systems, imaging equipment, processing methods, programs, and recording media
CN112866596B (en) Anti-strong light three-dimensional capturing method and system based on CMOS sensor
KR20100104498A (en) Auto exposure and auto white-balance method for detecting high dynamic range conditions
TWI768282B (en) Method and system for establishing light source information prediction model
CN114184284A (en) Real-time scene correction method and system for longitudinal scanning thermal infrared imager
CN116634289B (en) Method for dimming overexposed area of image sensor

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