CN114302068B - Image shooting method and device - Google Patents

Image shooting method and device Download PDF

Info

Publication number
CN114302068B
CN114302068B CN202210010747.XA CN202210010747A CN114302068B CN 114302068 B CN114302068 B CN 114302068B CN 202210010747 A CN202210010747 A CN 202210010747A CN 114302068 B CN114302068 B CN 114302068B
Authority
CN
China
Prior art keywords
pixel
threshold value
image
preset
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
CN202210010747.XA
Other languages
Chinese (zh)
Other versions
CN114302068A (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.)
Chongqing Unisinsight Technology Co Ltd
Original Assignee
Chongqing Unisinsight 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 Chongqing Unisinsight Technology Co Ltd filed Critical Chongqing Unisinsight Technology Co Ltd
Priority to CN202210010747.XA priority Critical patent/CN114302068B/en
Publication of CN114302068A publication Critical patent/CN114302068A/en
Application granted granted Critical
Publication of CN114302068B publication Critical patent/CN114302068B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Studio Devices (AREA)

Abstract

The invention relates to the technical field of image acquisition, and provides an image shooting method and equipment, which are applied to a main control chip in image shooting equipment, wherein the method comprises the following steps: under the condition that the light supplementing device supplements light based on a preset first light supplementing intensity, the control lens shoots a first image frame based on a preset first exposure time; under the condition that the light supplementing device supplements light based on a preset second light supplementing intensity, the control lens shoots a second image frame based on a preset second exposure time, and the sum of the first exposure time and the second exposure time is equal to a preset single-frame exposure time; and fusing the first image frame and the second image frame to obtain a final image. The invention can obtain the final image with the foreground and the background meeting the definition, and the definition requirement of the shot image is well met.

Description

Image shooting method and device
Technical Field
The invention relates to the technical field of image acquisition, in particular to an image shooting method and device.
Background
The existing network camera generally adopts a mode of white light, infrared light and white light infrared mixed light filling and even laser light filling, the light filling operation is not carried out on the daytime scene, and the light filling is not needed because the illumination brightness of the daytime scene is enough; in the night scene, the illumination brightness is insufficient, and the light supplementing operation is needed, so that the brightness and the definition of the image exposure are ensured, and the image effect output by the network camera is ensured not to be darker.
However, when the current network camera performs light supplementing operation, the definition and brightness of a near object can be ensured aiming at near light supplementing, but the definition and brightness of a far background cannot be ensured, so that the far background is too dark; when the light is supplemented at a far place, the definition and the brightness of a far-place background and an object can be ensured, but the definition and the brightness of a near object cannot be ensured, so that the brightness of the near object is too high to cause overexposure; the sharpness of the final photographed image cannot meet the requirements.
Disclosure of Invention
The invention aims to provide an image shooting method and device, which can ensure the definition of a near foreground and a far background in a shot image at the same time and well meet the definition requirement of the shot image.
In order to achieve the above purpose, the technical scheme adopted by the invention is as follows:
in a first aspect, the present invention provides an image capturing method, applied to a main control chip in an image capturing apparatus, where the image capturing apparatus further includes a lens and a light supplementing device, both of which are electrically connected to the main control chip, the method includes: controlling the lens to shoot a first image frame based on a preset first exposure time under the condition that the light supplementing device supplements light based on a preset first light supplementing intensity, wherein the definition of the background in the first image frame meets a first preset condition; controlling the lens to shoot a second image frame based on a preset second exposure time under the condition that the light supplementing device supplements light based on a preset second light supplementing intensity, wherein the definition of a foreground in the second image frame meets a second preset condition, and the sum of the first exposure time and the second exposure time is equal to a preset single-frame exposure time; receiving the first image frame and the second image frame sent by the lens; and fusing the first image frame and the second image frame to obtain a final image.
In a second aspect, the invention provides an image shooting device, which comprises a main control chip, a lens and a light supplementing device, wherein the lens and the light supplementing device are electrically connected with the main control chip; the main control chip is used for controlling the lens to shoot a first image frame based on a preset first exposure time under the condition that the light supplementing device supplements light based on a preset first light supplementing intensity, wherein the definition of the background in the first image frame meets a first preset condition; the main control chip is further configured to control the lens to shoot a second image frame based on a second preset exposure time under the condition that the light supplementing device supplements light based on the second preset light supplementing intensity, where the definition of the foreground in the second image frame meets a second preset condition, and the sum of the first exposure time and the second exposure time is equal to a preset single-frame exposure time; the lens is used for sending the first image frame and the second image frame to the main control chip; the main control chip is also used for fusing the first image frame and the second image frame to obtain a final image.
Compared with the prior art, under the condition that the light supplementing device supplements light based on the preset first light supplementing intensity, the control lens shoots a first image frame based on the preset first exposure time, wherein the definition of the background in the first image frame meets a first preset condition; under the condition that the light supplementing device supplements light based on a preset second light supplementing intensity, the control lens shoots a second image frame based on a preset second exposure time, wherein the definition of a foreground in the second image frame meets a second preset condition, and the sum of the first exposure time and the second exposure time is equal to a preset single-frame exposure time; and fusing the first image frame and the second image frame which are sent by the receiving lens to obtain a final image, shooting the first image frame meeting the first preset condition and the second image frame meeting the second preset condition in single-frame exposure time, and finally fusing the first image frame and the second image frame to obtain a final image with the foreground and the background meeting the definition, thereby excellently meeting the definition requirement of the shot image.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a timing chart of exposure and light-compensating PWM control in the prior art according to an embodiment of the present invention.
Fig. 2 is a block schematic diagram of an image capturing apparatus according to an embodiment of the present invention.
Fig. 3 is a flowchart illustrating an image capturing method according to an embodiment of the present invention.
Fig. 4 is an exemplary diagram of a single frame exposure duration of the prior art according to an embodiment of the present invention.
Fig. 5 is an exemplary diagram of exposure time for double frame exposure according to an embodiment of the present invention.
Fig. 6 is a flowchart illustrating another image capturing method according to an embodiment of the present invention.
Fig. 7 is an exemplary diagram of an image luminance histogram according to an embodiment of the present invention.
FIG. 8 is a diagram illustrating intensity control during exposure time in accordance with an embodiment of the present invention.
Fig. 9 is an exemplary diagram of intensity control during a double frame exposure period provided by an embodiment of the present invention.
Fig. 10 is a flowchart illustrating another image capturing method according to an embodiment of the present invention.
Fig. 11 is a flowchart illustrating another image capturing method according to an embodiment of the present invention.
Fig. 12 is an exemplary graph of the relationship between each linear relationship, each weight threshold, and the first pixel threshold and the second pixel threshold provided in the embodiment of the present invention.
Icon: 10-an image capturing apparatus; 11-a main control chip; 12-lens; 121-an image sensor; 122-optics; 13-a light supplementing device; 131-a light supplementing lamp; 132-light supplement controller.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. The components of the embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the invention, as presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
In the description of the present invention, it should be noted that, if the terms "upper", "lower", "inner", "outer", and the like indicate an azimuth or a positional relationship based on the azimuth or the positional relationship shown in the drawings, or the azimuth or the positional relationship in which the inventive product is conventionally put in use, it is merely for convenience of describing the present invention and simplifying the description, and it is not indicated or implied that the apparatus or element referred to must have a specific azimuth, be configured and operated in a specific azimuth, and thus it should not be construed as limiting the present invention.
Furthermore, the terms "first," "second," and the like, if any, are used merely for distinguishing between descriptions and not for indicating or implying a relative importance.
It should be noted that the features of the embodiments of the present invention may be combined with each other without conflict.
The light supplementing mode adopted in the existing shooting technology is that the far background in some images with high light supplementing intensity is clear and bright, but the near background is over-exposed in brightness, or the light supplementing intensity is weak, the near background in the images is clear, but the far background is too dark and unclear, and images which can meet the definition requirements of both the far object and the near object cannot be shot.
In view of this problem, the prior art may also use a wide dynamic double-frame exposure, which can inhibit strong light and bright and dark places, but when the photographed object is in a moving state, a serious smear problem occurs, and the faster the object moves, the more serious the smear phenomenon is, and for this problem, the inventor researches the principles of exposure and light filling in the existing photographing technology, and finds that the existing image photographing device, such as a webcam, has two independent functions, namely, image exposure and light filling, and normally, when the webcam determines according to the brightness value L of the image, whether the light filling needs to be started; when the brightness of the image is lower than the appointed brightness value L1, the light supplementing function is started; after the light supplementing function is started, as the light supplementing is started, the brightness of the image is improved, the exposure time of the image is reduced, and the situation of overexposure of the image is avoided; when the ambient brightness is improved, the light supplementing function is turned off when the brightness value L2 is specified at a high level; after the light supplementing function is closed, the image strength is reduced, and the image exposure time is prolonged; the exposure period of the normal image is 40ms for one frame, and the exposure time is between 0 and 10 ms; the light filling adopts Pulse-width Modulation (PWM) control, the control frequency is F (PWM) KHz, please refer to FIG. 1, FIG. 1 is a timing chart of exposure and light filling PWM control in the prior art provided by the embodiment of the invention, in FIG. 1, T is the image exposure time, and T is the exposure period; the light filling is performed in a functional on state regardless of whether the image exposure time t or the non-exposure time.
Through intensive researches on the implementation principle of the exposure and the light filling, the inventor finds that although the wide dynamic mode adopts double-frame exposure, the exposure time strategy is not basically changed basically, but only long-frame exposure is adopted singly, the total length of the long-frame exposure time in the double-frame exposure is longer than that of single exposure, the total length of the exposure is prolonged, the total length is the root cause of smear, and after the root cause is located, the inventor provides an image shooting method and equipment, which can solve the problem of overexposure or overdose, ensure that shot distant and near objects can meet the requirement of definition, avoid serious smear phenomenon and further describe the method in detail below.
Referring to fig. 2, fig. 2 is a block diagram of an image capturing apparatus 10 according to an embodiment of the present invention, where the image capturing apparatus 10 includes a main control chip 11, a lens 12, and a light compensating device 13, and the main control chip 11 is electrically connected to the lens 12 and the light compensating device 13. The main control chip 11 sets exposure time and light supplementing intensity, the main control chip 11 controls the light supplementing device 13 to supplement light based on the light supplementing intensity, and the main control chip 11 also controls the lens to take a picture based on the exposure time.
The main control Chip 11 may be a System on Chip (SoC), which is also called a System on Chip, and is an integrated circuit with a dedicated target, wherein the integrated circuit contains a complete System and has the entire content of embedded software, and has the functions of executing a software program for data processing and hardware control.
The lens 12 is used for capturing images, and may be a single lens or a lens module composed of a plurality of lenses.
In order to facilitate SoC image processing, as a specific embodiment, the lens 12 may include an image sensor 121 and an optical device 122, where the main control chip 11 is electrically connected to the image sensor 121, and the lens 12 converts an optical signal captured when the optical device 122 photographs an object to be photographed into original image data through the image sensor 121 thereof, and transmits the original image data to the main control chip 11. The image sensor 121 may be a CMOS image sensor.
The light supplementing device 13 is used for supplementing light to a photographed target object.
As a specific embodiment, the light supplementing device 13 may further include a light supplementing lamp 131 and a light supplementing controller 132, where the main control chip 11 is electrically connected to the light supplementing controller 132, and the main control chip 11 controls the light supplementing lamp 131 to emit light according to the specified light supplementing intensity by controlling the light supplementing controller 132. The light supplement controller 132 may be PWM control.
On the basis of fig. 2, the embodiment of the present invention further provides an image capturing method applied to the main control chip 11 in the image capturing device in fig. 1, please refer to fig. 3, fig. 3 is a flowchart illustrating an image capturing method provided in the embodiment of the present invention, the method includes the following steps:
in step S100, when the light supplementing device supplements light based on the preset first light supplementing intensity, the control lens photographs a first image frame based on the preset first exposure time, wherein the definition of the background in the first image frame satisfies a first preset condition.
In this embodiment, the first exposure time and the first light intensity may be empirical values preset according to experimental data, and for different application scenarios, or for different light intensity environments, different first exposure times and different first light intensity may be set.
In this embodiment, the first image frame is an image in which the sharpness of the background satisfies a first preset condition, and the sharpness of the background satisfies the first preset condition may be that the sharpness of the background is greater than or equal to a first preset sharpness threshold. The first image frame may be captured at the first exposure time when the first light intensity is supplemented, or may be captured at the first exposure time when the first light intensity is supplemented.
Step S101, under the condition that the light supplementing device supplements light based on a preset second light supplementing intensity, the control lens shoots a second image frame based on a preset second exposure time, wherein the definition of the foreground in the second image frame meets a second preset condition, and the sum of the first exposure time and the second exposure time is equal to a preset single-frame exposure time.
In this embodiment, the second exposure time and the second light intensity may be empirical values preset according to experimental data, and for different application scenarios, or for different light intensity environments, different second exposure times and different second light intensity may be set.
In this embodiment, the second image frame is an image in which the sharpness of the background satisfies a second preset condition, and the sharpness of the background satisfies the second preset condition may be that the sharpness of the background is greater than or equal to the first preset sharpness threshold. The second image frame may be captured at the second exposure time in the case of the second light intensity supplement, or may be captured at the second exposure time in the case of the adjusted second light intensity supplement by performing the light intensity supplement adjustment, or may be captured at the second exposure time in the case of the adjusted second light intensity supplement, or may be captured at the adjusted second exposure time by performing the exposure time adjustment.
In this embodiment, the sum of the first exposure time and the second exposure time is equal to a preset single-frame exposure duration, and the single-frame exposure duration is the exposure duration of single-frame single exposure. The single-frame single exposure is a shooting mode commonly adopted by the existing image shooting device, and the shooting mode refers to a shooting mode in which a shutter button is pressed to the bottom once, a camera only opens the shutter once no matter how long the shutter button is pressed, and only one frame of image is shot by exposure, please refer to fig. 4, fig. 4 is an exemplary diagram of a single-frame exposure time in the prior art, in fig. 4, T1 is a single-frame exposure time, T2 is a non-exposure time, and T is an exposure period.
In this embodiment, two image frames are shot with two different exposure times within a single frame exposure time, a first image frame is shot based on a first exposure time and a first light-compensating intensity, a second image frame is shot based on a second exposure time and a second light-compensating intensity, please refer to fig. 5, fig. 5 is an example of the exposure time of the double frame exposure provided in the embodiment of the present invention, in fig. 5, T11 is the first exposure time, T12 is the second exposure time, T2 is the non-exposure time, and T is the exposure period.
Note that, t11 and t12 in fig. 5 may be preset values or may be values adjusted based on preset values, but any adjustment is required to satisfy t11+t12=t1 for both t11 and t 12.
Step S102, a first image frame and a second image frame sent by a lens are received.
Step S103, fusing the first image frame and the second image frame to obtain a final image.
In this embodiment, image fusion refers to that image data about the same target acquired by multiple source channels is subjected to image processing, computer technology, and the like, so that beneficial information in each channel is extracted to the maximum extent, and finally, high-quality images are synthesized.
According to the method provided by the embodiment, the first image frame meeting the first preset condition and the second image frame meeting the second preset condition are shot in the single-frame exposure time, and finally the first image frame and the second image frame are fused to obtain the final image with the foreground and the background meeting the definition, so that the definition requirement of the shot image is met well.
On the basis of fig. 3, the embodiment of the present invention further provides a specific implementation manner of capturing a first image frame, referring to fig. 6, fig. 6 is a flowchart illustrating another image capturing method according to the embodiment of the present invention, and step S100 includes the following sub-steps:
substep S1000 takes the first exposure time as the current first exposure time and the first light intensity as the current first light intensity.
Sub-step S1001:
s11: under the condition that the light supplementing device supplements light based on the current first light supplementing intensity, the control lens shoots a first exposure image based on the current first exposure time;
s12: receiving a first exposure image sent by a lens;
s13: if the first exposure image does not meet the first preset condition, the current first exposure time and the current first light supplementing intensity are adjusted, the current first exposure time is replaced by the adjusted current first exposure time, the current first light supplementing intensity is replaced by the adjusted current first light supplementing intensity, and the steps S11-S13 are repeatedly executed until the first exposure image meets the first preset condition.
In this embodiment, as a specific judging manner, whether the first exposure image satisfies the first preset condition may be judged by the image brightness histogram, which is as follows:
first, an image luminance histogram of the first exposure image is generated according to the luminance value of each pixel point in the first exposure image, wherein the image luminance histogram is used for representing distribution diagrams of the luminance values of all the pixel points.
In this embodiment, the first exposure image includes a plurality of pixel points, each pixel point corresponds to a luminance value, and a value interval of the luminance value is: [0, 255] the greater the luminance value, the higher the luminance is represented, wherein 0 represents the darkest region of pure black, 255 represents the brightest pure white, and the middle number is gray of different luminance. Referring to fig. 7, fig. 7 is an exemplary diagram of an image luminance histogram according to an embodiment of the present invention, in which the horizontal axis in the image luminance histogram represents luminance values of 0-255 and the vertical axis represents the number of pixels corresponding to the luminance values in the image.
And secondly, calculating the area ratio of the area of the pixel points with the brightness value in the preset interval in the image brightness histogram to the total area of all the pixel points in the image brightness histogram.
In this embodiment, the preset interval may be set as required, and in general, the preset interval is set to a preset range of luminance values between 0 and 255, for example, the preset interval is a range of luminance values between 100 and 200, taking fig. 7 as an example, the area of all black portions in fig. 7 is the total area of all pixels in the image luminance histogram, and the area of black portions in the rectangular frame is the area of pixels having luminance values in the preset interval in the image luminance histogram.
And finally, if the area ratio is larger than the preset value, judging that the first exposure image meets the first preset condition, otherwise, judging that the first exposure image does not meet the first preset condition.
In this embodiment, the preset value may be set as needed.
It should be further noted that, in the prior art, since the intensity of the light supplement is maintained unchanged during the exposure time, this way cannot be adjusted with finer granularity according to the actual exposure time and the definition requirement of the image, so that the light supplement effect cannot reach the best, please refer to fig. 8, fig. 8 is an exemplary diagram of the intensity control during the exposure time in the prior art, and in fig. 8, the intensity of the light supplement is always maintained at p0 during the exposure time t.
In the embodiment of the present invention, the first light-compensating intensity is further adjusted in a finer granularity based on the preset first light-compensating intensity, and the light-compensating intensity can be controlled within the exposure time, please refer to fig. 9, fig. 9 is an exemplary diagram of intensity control within the double-frame exposure time period provided in the embodiment of the present invention, in fig. 9, the light-compensating intensity is p1 when the exposure time is within the time t1, and the light-compensating intensity is p2 when the exposure time is within the time t 2.
Substep S1002 takes the first exposure image satisfying the first preset condition as the first image frame.
According to the method provided by the embodiment, under the condition that the preset first light supplementing intensity and the preset first exposure time do not meet the requirements, the first exposure image meeting the first preset condition is finally obtained by adjusting the first light supplementing intensity and the first exposure time.
On the basis of fig. 6, the embodiment of the present invention further provides a specific implementation manner of capturing a second image frame, referring to fig. 10, fig. 10 is a flowchart illustrating another image capturing method according to the embodiment of the present invention, and step S101 includes the following sub-steps:
in sub-step S1011, the second exposure time is updated according to the single frame exposure time and the current first exposure time corresponding to the first image frame.
In this embodiment, after the first exposure time is updated, the second exposure time needs to be updated according to the updated exposure time, that is, the current first exposure time corresponding to the first image frame.
In sub-step S1012, the updated second exposure time is used as the current second exposure time, and the second light intensity is used as the current second light intensity.
Substep S1013:
s21: under the condition that the light supplementing device supplements light based on the current second light supplementing intensity, the control lens shoots a second exposure image based on the second exposure time;
s22: receiving a second exposure image sent by a lens;
s23: if the second exposure image does not meet the second preset condition, the current second light supplementing intensity is adjusted, the current second light supplementing intensity is updated by the adjusted current second light supplementing intensity, and the steps S21-S23 are repeatedly executed until the second exposure image meets the second preset condition.
In this embodiment, the manner of determining whether the second exposure image satisfies the second preset condition is the same as the manner of determining whether the first exposure image satisfies the first preset condition, which is not described herein.
Sub-step S1014: and taking the second exposure image meeting the second preset condition as a second image frame.
According to the method provided by the embodiment, under the condition that the preset second light supplementing intensity and the preset second exposure time do not meet the requirements, the second exposure image meeting the second preset condition is finally obtained by adjusting the second light supplementing intensity and the second exposure time.
It should be noted that, in the foregoing fig. 10 is only a specific implementation manner, in fact, the steps S1011 to S1014 may also be directly replaced with the step S101 in fig. 3, and at this time, the preset first light supplementing intensity and the preset first exposure time need not be adjusted, so that the first image frame satisfying the first preset condition can be obtained, and only the preset second light supplementing intensity needs to be adjusted, so as to obtain the second image frame satisfying the second preset condition.
On the basis of fig. 3, the embodiment of the present invention further provides a specific implementation manner of fusing the first image frame and the second image frame, please refer to fig. 11, fig. 11 is a flowchart illustrating another image capturing method provided by the embodiment of the present invention, and step S103 includes the following sub-steps:
substep S1031, determining a first weight according to the first pixel point, the first pixel threshold value, and the second pixel threshold value.
In this embodiment, there are a plurality of first pixels, and for each first pixel, the sub-step S1031 may be used to determine a first weight corresponding to the first pixel.
In this embodiment, the first pixel threshold value and the second pixel threshold value may be set as needed. According to the difference of the pixel values of the first pixel points, the first weight is determined in different ways, and the method at least comprises the following three modes:
and (1.1) if the pixel value of the first pixel point is smaller than the first pixel threshold value, determining a first weight according to the first linear relation.
In this embodiment, the first linear relationship is determined according to a first weight threshold, a first pixel threshold, and a preset maximum value, where the preset maximum value is a weight when the pixel value is 0, and is set to 100%.
(1.2) if the pixel value of the first pixel point is greater than or equal to the first pixel threshold value and less than the second pixel threshold value, determining the first weight according to the second linear relation.
In this embodiment, the second linear relationship is determined according to the first weight threshold, the second weight threshold, the first pixel threshold, and the second pixel threshold.
And (1.3) if the pixel value of the first pixel point is greater than or equal to the second pixel threshold value, determining the first weight according to the third linear relation.
In this embodiment, the third linear relationship is determined according to a third weight threshold, a second pixel threshold, and a preset minimum value, where the preset minimum value is a weight when the pixel value is 255, and is set to 0%.
Sub-step S1032, a second weight is determined based on the second pixel point, the first pixel threshold, and the second pixel threshold.
In this embodiment, there are a plurality of second pixels, and for each second pixel, the sub-step S1032 may be adopted to determine a second weight corresponding to the second pixel.
In this embodiment, according to the difference in the pixel value of the second pixel point, the manner of determining the second weight is also different, and at least the following three methods are included:
(2.1) if the pixel value of the second pixel point is less than the first pixel threshold, determining a second weight according to a fourth linear relationship.
In this embodiment, the fourth linear relationship is determined according to a fourth weight threshold, a first pixel threshold, and a preset minimum value, where the preset minimum value is a weight when the pixel value is 255, and is set to 0%.
(2.2) if the pixel value of the first pixel point is greater than or equal to the first pixel threshold value and less than the second pixel threshold value, determining a second weight according to a fifth linear relation.
In this embodiment, the fifth linear relationship is determined according to the fourth weight threshold, the third weight threshold, the first pixel threshold, and the second pixel threshold.
And (2.3) if the pixel value of the first pixel point is greater than or equal to the second pixel threshold value, determining a second weight according to a sixth linear relation.
In this embodiment, the sixth linear relationship is determined according to the third weight threshold, the second pixel threshold, and the preset maximum value, where the preset maximum value is a weight when the pixel value is 0, and is set to 100%.
In this embodiment, the first weight threshold, the second weight threshold, the third weight threshold, and the fourth weight threshold may be set as needed. To more clearly illustrate the relationships between the linear relationships and the weight thresholds and the first and second pixel thresholds, please refer to fig. 12, and fig. 12 is an exemplary diagram of the relationships between the weight thresholds and the first and second pixel thresholds provided in the embodiment of the present invention.
And step S1033, calculating the pixel value of the third pixel point according to the pixel value of the first pixel point, the first weight, the pixel value of the second pixel point and the second weight to obtain a final image.
In this embodiment, the pixel value pv of the third pixel point may be calculated by the following formula: pv=pv1×w1+pv2×w2, where pv1 is the pixel value of the first pixel, w1 is the first weight, pv2 is the pixel value of the second pixel, and w2 is the second weight.
According to the method provided by the embodiment, different first weights are respectively set for the first pixel points in the first image frame according to different conditions, and different second weights are set for the second pixel points in the second image frame, so that the definition of the foreground and the background of the final image obtained through fusion meets the requirements.
It should be noted that, the substeps S1031 to S1033 of the step S103 may also replace the step S103 in fig. 6 or 10 to achieve the corresponding technical effects.
In summary, the embodiment of the invention provides an image shooting method and device, which are applied to a main control chip in an image shooting device, wherein the image shooting device further comprises a lens and a light supplementing device, the lens and the light supplementing device are electrically connected with the main control chip, and the method comprises the following steps: under the condition that the light supplementing device supplements light based on a preset first light supplementing intensity, the control lens shoots a first image frame based on a preset first exposure time, wherein the definition of the background in the first image frame meets a first preset condition; under the condition that the light supplementing device supplements light based on a preset second light supplementing intensity, the control lens shoots a second image frame based on a preset second exposure time, wherein the definition of a foreground in the second image frame meets a second preset condition, and the sum of the first exposure time and the second exposure time is equal to a preset single-frame exposure time; receiving a first image frame and a second image frame sent by a lens; and fusing the first image frame and the second image frame to obtain a final image. Compared with the prior art, the embodiment of the invention shoots the first image frame meeting the first preset condition and the second image frame meeting the second preset condition in the single frame exposure time, and finally fuses the first image frame and the second image frame to obtain the final image with the foreground and the background meeting the definition, thereby meeting the definition requirement of the shot image very well.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any changes or substitutions easily contemplated by those skilled in the art within the scope of the present invention should be included in the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (5)

1. The image shooting method is characterized by being applied to a main control chip in image shooting equipment, the image shooting equipment further comprises a lens and a light supplementing device, the lens and the light supplementing device are electrically connected with the main control chip, and the method comprises the following steps:
controlling the lens to shoot a first image frame based on a preset first exposure time under the condition that the light supplementing device supplements light based on a preset first light supplementing intensity, wherein the definition of the background in the first image frame meets a first preset condition, and the first image frame comprises a first pixel point;
controlling the lens to shoot a second image frame based on a second preset exposure time under the condition that the light supplementing device supplements light based on a second preset light supplementing intensity, wherein the definition of a foreground in the second image frame meets a second preset condition, the sum of the first exposure time and the second exposure time is equal to a single-frame exposure time which is preset, and the second image frame comprises a second pixel point;
receiving the first image frame and the second image frame sent by the lens;
fusing the first image frame and the second image frame to obtain a final image, wherein the final image comprises a third pixel point;
the step of fusing the first image frame and the second image frame to obtain a final image includes:
determining a first weight according to the first pixel point, the first pixel threshold value and the second pixel threshold value;
determining a second weight according to the second pixel point, the first pixel threshold value and the second pixel threshold value;
calculating the pixel value of the third pixel point according to the pixel value of the first pixel point, the first weight, the pixel value of the second pixel point and the second weight to obtain a final image;
the step of determining the first weight according to the first pixel point, the first pixel threshold value and the second pixel threshold value comprises the following steps:
if the pixel value of the first pixel point is smaller than the first pixel threshold value, determining a first weight according to a first linear relation, wherein the first linear relation is determined according to the first weight threshold value, the first pixel threshold value and a preset maximum value;
if the pixel value of the first pixel point is larger than or equal to the first pixel threshold value and smaller than the second pixel threshold value, determining a first weight according to a second linear relation, wherein the second linear relation is determined according to the first weight threshold value, the second weight threshold value, the first pixel threshold value and the second pixel threshold value;
if the pixel value of the first pixel point is greater than or equal to the second pixel threshold value, determining a first weight according to a third linear relation, wherein the third linear relation is determined according to the third weight threshold value, the second pixel threshold value and a preset minimum value;
the step of determining the second weight according to the second pixel point, the first pixel threshold value and the second pixel threshold value includes:
if the pixel value of the second pixel point is smaller than the first pixel threshold value, determining a second weight according to a fourth linear relation, wherein the fourth linear relation is determined according to the fourth weight threshold value, the first pixel threshold value and a preset minimum value;
if the pixel value of the first pixel point is greater than or equal to the first pixel threshold value and smaller than the second pixel threshold value, determining a second weight according to a fifth linear relation, wherein the fifth linear relation is determined according to a fourth weight threshold value, a third weight threshold value, the first pixel threshold value and the second pixel threshold value;
if the pixel value of the first pixel point is greater than or equal to the second pixel threshold value, determining a second weight according to a sixth linear relation, wherein the sixth linear relation is determined according to a third weight threshold value, the second pixel threshold value and a preset maximum value.
2. The image capturing method according to claim 1, wherein the step of controlling the lens to capture the first image frame based on the preset first exposure time in the case where the light supplementing means supplements light based on the preset first light supplementing intensity includes:
taking the first exposure time as the current first exposure time and taking the first light supplementing intensity as the current first light supplementing intensity;
s11: controlling the lens to shoot a first exposure image based on the current first exposure time under the condition that the light supplementing device supplements light based on the current first light supplementing intensity;
s12: receiving a first exposure image sent by the lens;
s13: if the first exposure image does not meet the first preset condition, adjusting the current first exposure time and the current first light supplementing intensity, replacing the current first exposure time with the adjusted current first exposure time, replacing the current first light supplementing intensity with the adjusted current first light supplementing intensity, and repeatedly executing steps S11-S13 until the first exposure image meets the first preset condition;
and taking the first exposure image meeting the first preset condition as the first image frame.
3. The image capturing method according to claim 2, wherein the first exposure image includes a plurality of pixels, each pixel corresponds to a brightness value, and the step of adjusting the current first exposure time and the current first light compensation intensity if the first exposure image does not satisfy the first preset condition includes, before:
generating an image brightness histogram of the first exposure image according to the brightness value of each pixel point in the first exposure image, wherein the image brightness histogram is used for representing distribution diagrams of the brightness values of all the pixel points;
calculating the area ratio of the area of the pixel points with brightness values in a preset interval in the image brightness histogram to the total area of all the pixel points in the image brightness histogram;
and if the area ratio is larger than a preset value, judging that the first exposure image meets the first preset condition, otherwise, judging that the first exposure image does not meet the first preset condition.
4. The image capturing method according to claim 2, wherein the step of controlling the lens to capture the second image frame based on the preset second exposure time in the case where the light supplementing device supplements light based on the preset second light supplementing intensity includes:
updating the second exposure time according to the single-frame exposure time and the current first exposure time corresponding to the first image frame;
taking the updated second exposure time as the current second exposure time, and taking the second light supplementing intensity as the current second light supplementing intensity;
s21: controlling the lens to shoot a second exposure image based on the second exposure time under the condition that the light supplementing device supplements light based on the current second light supplementing intensity;
s22: receiving the second exposure image sent by the lens;
s23: if the second exposure image does not meet the second preset condition, the current second light supplementing intensity is adjusted, the current second light supplementing intensity is updated by the adjusted current second light supplementing intensity, and the steps S21-S23 are repeatedly executed until the second exposure image meets the second preset condition;
and taking the second exposure image meeting a second preset condition as the second image frame.
5. The image shooting device is characterized by comprising a main control chip, a lens and a light supplementing device, wherein the lens and the light supplementing device are electrically connected with the main control chip;
the main control chip is used for controlling the lens to shoot a first image frame based on a preset first exposure time under the condition that the light supplementing device supplements light based on a preset first light supplementing intensity, wherein the definition of the background in the first image frame meets a first preset condition, and the first image frame comprises a first pixel point;
the main control chip is further configured to control the lens to shoot a second image frame based on a second preset exposure time under the condition that the light supplementing device supplements light based on a second preset light supplementing intensity, where the definition of the foreground in the second image frame meets a second preset condition, the sum of the first exposure time and the second exposure time is equal to a preset single-frame exposure time, and the second image frame includes a second pixel point;
the lens is used for sending the first image frame and the second image frame to the main control chip;
the main control chip is further configured to fuse the first image frame and the second image frame to obtain a final image, where the final image includes a third pixel point;
the main control chip is also used for: determining a first weight according to the first pixel point, the first pixel threshold value and the second pixel threshold value; determining a second weight according to the second pixel point, the first pixel threshold value and the second pixel threshold value; calculating the pixel value of the third pixel point according to the pixel value of the first pixel point, the first weight, the pixel value of the second pixel point and the second weight to obtain a final image;
the main control chip is used for determining a first weight according to a first pixel point, a first pixel threshold value and a second pixel threshold value, and is specifically used for: if the pixel value of the first pixel point is smaller than the first pixel threshold value, determining a first weight according to a first linear relation, wherein the first linear relation is determined according to the first weight threshold value, the first pixel threshold value and a preset maximum value; if the pixel value of the first pixel point is larger than or equal to the first pixel threshold value and smaller than the second pixel threshold value, determining a first weight according to a second linear relation, wherein the second linear relation is determined according to the first weight threshold value, the second weight threshold value, the first pixel threshold value and the second pixel threshold value; if the pixel value of the first pixel point is greater than or equal to the second pixel threshold value, determining a first weight according to a third linear relation, wherein the third linear relation is determined according to the third weight threshold value, the second pixel threshold value and a preset minimum value;
the main control chip is specifically configured to, when determining the second weight according to the second pixel point, the first pixel threshold value, and the second pixel threshold value: if the pixel value of the second pixel point is smaller than the first pixel threshold value, determining a second weight according to a fourth linear relation, wherein the fourth linear relation is determined according to the fourth weight threshold value, the first pixel threshold value and a preset minimum value; if the pixel value of the first pixel point is greater than or equal to the first pixel threshold value and smaller than the second pixel threshold value, determining a second weight according to a fifth linear relation, wherein the fifth linear relation is determined according to a fourth weight threshold value, a third weight threshold value, the first pixel threshold value and the second pixel threshold value; if the pixel value of the first pixel point is greater than or equal to the second pixel threshold value, determining a second weight according to a sixth linear relation, wherein the sixth linear relation is determined according to a third weight threshold value, the second pixel threshold value and a preset maximum value.
CN202210010747.XA 2022-01-06 2022-01-06 Image shooting method and device Active CN114302068B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210010747.XA CN114302068B (en) 2022-01-06 2022-01-06 Image shooting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210010747.XA CN114302068B (en) 2022-01-06 2022-01-06 Image shooting method and device

Publications (2)

Publication Number Publication Date
CN114302068A CN114302068A (en) 2022-04-08
CN114302068B true CN114302068B (en) 2023-09-26

Family

ID=80976225

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210010747.XA Active CN114302068B (en) 2022-01-06 2022-01-06 Image shooting method and device

Country Status (1)

Country Link
CN (1) CN114302068B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115767277B (en) * 2022-09-21 2024-02-06 盐城众拓视觉创意有限公司 Green box shooting light supplementing method based on multi-eye vision

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106534712A (en) * 2016-10-24 2017-03-22 北京旷视科技有限公司 Control method, image processing unit, light-filling and camera device
CN108881730A (en) * 2018-08-06 2018-11-23 成都西纬科技有限公司 Image interfusion method, device, electronic equipment and computer readable storage medium
WO2019071613A1 (en) * 2017-10-13 2019-04-18 华为技术有限公司 Image processing method and device
CN111510637A (en) * 2020-04-20 2020-08-07 威海德盛电子有限公司 Brightness adjusting method and device of light supplementing device, road light supplementing device and electronic equipment
CN112188175A (en) * 2020-08-25 2021-01-05 北京旷视科技有限公司 Photographing apparatus and image processing method
CN113132639A (en) * 2021-04-22 2021-07-16 亮风台(上海)信息科技有限公司 Image processing method and device, electronic equipment and storage medium
CN113395457A (en) * 2020-03-11 2021-09-14 浙江宇视科技有限公司 Parameter adjusting method, device and equipment of image collector and storage medium
CN113438411A (en) * 2021-05-21 2021-09-24 上海闻泰电子科技有限公司 Image shooting method, image shooting device, computer equipment and computer readable storage medium
CN113592887A (en) * 2021-06-25 2021-11-02 荣耀终端有限公司 Video shooting method, electronic device and computer-readable storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4618100B2 (en) * 2005-11-04 2011-01-26 ソニー株式会社 Imaging apparatus, imaging method, and program
JP2017112457A (en) * 2015-12-15 2017-06-22 オリンパス株式会社 Imaging device, imaging program, imaging method
US10991060B2 (en) * 2019-03-15 2021-04-27 Motorola Solutions, Inc. Device, system and method for dispatching responders to patrol routes

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106534712A (en) * 2016-10-24 2017-03-22 北京旷视科技有限公司 Control method, image processing unit, light-filling and camera device
WO2019071613A1 (en) * 2017-10-13 2019-04-18 华为技术有限公司 Image processing method and device
CN108881730A (en) * 2018-08-06 2018-11-23 成都西纬科技有限公司 Image interfusion method, device, electronic equipment and computer readable storage medium
CN113395457A (en) * 2020-03-11 2021-09-14 浙江宇视科技有限公司 Parameter adjusting method, device and equipment of image collector and storage medium
CN111510637A (en) * 2020-04-20 2020-08-07 威海德盛电子有限公司 Brightness adjusting method and device of light supplementing device, road light supplementing device and electronic equipment
CN112188175A (en) * 2020-08-25 2021-01-05 北京旷视科技有限公司 Photographing apparatus and image processing method
CN113132639A (en) * 2021-04-22 2021-07-16 亮风台(上海)信息科技有限公司 Image processing method and device, electronic equipment and storage medium
CN113438411A (en) * 2021-05-21 2021-09-24 上海闻泰电子科技有限公司 Image shooting method, image shooting device, computer equipment and computer readable storage medium
CN113592887A (en) * 2021-06-25 2021-11-02 荣耀终端有限公司 Video shooting method, electronic device and computer-readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
可提高相机动态范围的图像融合方法研究;李洪博;董岩;刘云清;赵馨;宋延嵩;;红外技术(09);全文 *

Also Published As

Publication number Publication date
CN114302068A (en) 2022-04-08

Similar Documents

Publication Publication Date Title
CN108419023B (en) Method for generating high dynamic range image and related equipment
CN105208281B (en) A kind of night scene image pickup method and device
US9030600B2 (en) Method and apparatus for controlling flash
US8896625B2 (en) Method and system for fusing images
CN108616689B (en) Portrait-based high dynamic range image acquisition method, device and equipment
CN101115149B (en) Image processing method
JP4600684B2 (en) Imaging apparatus and imaging method
CN111586314B (en) Image fusion method and device and computer storage medium
CN109474770B (en) Imaging device and imaging method
JP2007067907A (en) Image pickup apparatus, image pickup method, and image pickup program; and image processor, image processing method, and image processing program
CN108337446B (en) High dynamic range image acquisition method, device and equipment based on double cameras
US10313601B2 (en) Image capturing device and brightness adjusting method
CN108289173B (en) Camera shooting control method and device, terminal equipment and storage medium
CN116055897B (en) Photographing method and related equipment thereof
WO2012093519A1 (en) Imaging device and light emission amount control method
CN113014748A (en) Camera infrared lamp dynamic light supplementing system and method
CN114302068B (en) Image shooting method and device
CN112911146B (en) Intelligent dimming method based on human face
US11405562B2 (en) Image processing apparatus, method of controlling the same, image capturing apparatus, and storage medium
CN112383688B (en) Camera shooting light supplement method and device, electronic equipment and intelligent terminal
JP4869801B2 (en) Imaging device
CN115150560A (en) Light supplementing system, image acquisition system, method, equipment and storage medium
CN113347368A (en) Video acquisition method and device based on exposure control
JP2007235421A (en) Imaging apparatus
CN109102481B (en) Automatic wide dynamic processing algorithm based on illumination analysis

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