CN108337446B - High dynamic range image acquisition method, device and equipment based on double cameras - Google Patents
High dynamic range image acquisition method, device and equipment based on double cameras Download PDFInfo
- Publication number
- CN108337446B CN108337446B CN201810326327.6A CN201810326327A CN108337446B CN 108337446 B CN108337446 B CN 108337446B CN 201810326327 A CN201810326327 A CN 201810326327A CN 108337446 B CN108337446 B CN 108337446B
- Authority
- CN
- China
- Prior art keywords
- camera
- compensation value
- overexposure
- underexposure
- dynamic range
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/70—Circuitry for compensating brightness variation in the scene
- H04N23/741—Circuitry for compensating brightness variation in the scene by increasing the dynamic range of the image compared to the dynamic range of the electronic image sensors
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Studio Devices (AREA)
- Facsimile Image Signal Circuits (AREA)
Abstract
The application discloses a method, a device and equipment for acquiring high dynamic range images based on double cameras, wherein the method comprises the following steps: generating a preview picture according to the picture acquired by the first camera; adjusting an exposure value of a second camera, and determining an underexposure compensation value and an overexposure compensation value which respectively correspond to each color channel histogram corresponding to a picture acquired by the second camera when the color channel histogram meets a preset condition; and acquiring a high dynamic range image of the current scene according to the underexposure compensation value and the overexposure compensation value. The method realizes that the optimal underexposure compensation value and the optimal overexposure compensation value corresponding to the shooting scene are dynamically determined by using the pictures acquired by the non-preview camera, so that the accuracy of the determined underexposure compensation value and the determined overexposure compensation value can be ensured, the quality of the finally acquired high-dynamic-range image can be improved, and the user experience is improved.
Description
Technical Field
The present application relates to the field of image processing technologies, and in particular, to a method, an apparatus, and a device for acquiring a high dynamic range image based on two cameras.
Background
Nowadays, various intelligent terminals become necessary articles for daily life of users, and the users can operate various functions through terminal equipment. For example, a High-dynamic range (HDR) image is captured by a camera in the terminal device. The HDR is obtained by fusing three images, namely a normal exposure image, an underexposure image and an overexposure image.
In the practical application process, when a user shoots a high dynamic range image by using a camera, a terminal device usually collects a picture of a shooting area by using a camera module and previews the picture, then determines a color histogram of a preview picture to estimate an underexposure amount and an overexposure amount, and shoots an underexposure image and an overexposure image of the same area according to the estimated underexposure amount and overexposure amount. And then synthesizing the shot normal exposure image, the shot underexposure image and the shot overexposure image through an image fusion technology to obtain a high dynamic range image.
However, in practical application, due to the fact that truncation characteristics may exist at two ends of a color histogram of a preview picture, large errors exist in estimated underexposure amount and overexposure amount, the obtained underexposure image and overexposure image are insufficient in exposure amount, the dynamic range of the obtained high dynamic range image is affected, and the quality of the obtained high dynamic range image is poor.
Disclosure of Invention
The present application aims to address at least to some extent one of the above-mentioned technical drawbacks.
Therefore, a first objective of the present application is to provide a method for acquiring a high dynamic range image based on two cameras, which dynamically determines an optimal underexposure compensation value and an optimal overexposure compensation value corresponding to a shooting scene by using a picture acquired by a non-preview camera, so that not only can the accuracy of the determined underexposure compensation value and overexposure compensation value be ensured, but also the quality of the finally acquired high dynamic range image can be improved, and user experience is improved.
A second objective of the present application is to provide a dual-camera based high dynamic range image capturing apparatus.
A third object of the present application is to provide a terminal device.
A fourth object of the present application is to propose a computer readable storage medium.
In order to achieve the above object, a method for acquiring a high dynamic range image based on two cameras in an embodiment of the first aspect of the present application includes: generating a preview picture according to the picture acquired by the first camera; adjusting an exposure value of a second camera, and determining an underexposure compensation value and an overexposure compensation value which respectively correspond to each color channel histogram corresponding to a picture acquired by the second camera when the color channel histogram meets a preset condition; and acquiring a high dynamic range image of the current scene according to the underexposure compensation value and the overexposure compensation value.
In order to achieve the above object, a dual-camera high dynamic range image capturing apparatus according to an embodiment of the second aspect of the present application includes: the generating module is used for generating a preview picture according to the picture acquired by the first camera; the determining module is used for adjusting an exposure value of a second camera and determining an underexposure compensation value and an overexposure compensation value which respectively correspond to each color channel histogram corresponding to a picture acquired by the second camera when the color channel histogram meets a preset condition; and the acquisition module is used for acquiring the high dynamic range image of the current scene according to the underexposure compensation value and the overexposure compensation value.
In order to achieve the above object, a terminal device according to an embodiment of the third aspect of the present application includes: the device comprises a memory, a processor and a camera module; the camera module is used for acquiring an image in a current shooting scene; the memory for storing executable program code; the processor is configured to read the executable program code stored in the memory to run a program corresponding to the executable program code, so as to implement the dual-camera-based high dynamic range image acquisition method described in the embodiment of the first aspect.
In order to achieve the above object, a computer-readable storage medium of an embodiment of a fourth aspect of the present application has a computer program stored thereon, and the computer program is executed by a processor to implement the dual-camera based high dynamic range image acquisition method according to the embodiment of the first aspect.
The technical scheme disclosed in the application has the following beneficial effects:
firstly, generating a preview picture according to a picture acquired by a first camera, then adjusting an exposure value of a second camera, determining corresponding underexposure compensation values and overexposure compensation values when a histogram of each color channel corresponding to the picture acquired by the second camera meets a preset condition, and then acquiring a high dynamic range image of a current scene according to the determined underexposure compensation values and overexposure compensation values. Therefore, the optimal underexposure compensation value and the optimal overexposure compensation value corresponding to the shooting scene are dynamically determined by utilizing the pictures acquired by the non-preview camera, so that the accuracy of the determined underexposure compensation value and the determined overexposure compensation value can be ensured, the quality of the finally acquired high-dynamic-range image can be improved, and the user experience is improved.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
The above and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which,
FIG. 1 is a flow diagram of a method for dual-camera based high dynamic range image acquisition according to one embodiment of the present application;
FIG. 2(a) is a schematic diagram of a red channel histogram according to one embodiment of the present application;
FIG. 2(b) is a schematic diagram of a green channel histogram according to one embodiment of the present application;
FIG. 2(c) is a schematic diagram of a blue channel histogram according to one embodiment of the present application;
FIG. 3 is a flow diagram of a method for dual-camera based high dynamic range image acquisition according to another embodiment of the present application;
FIG. 4 is a flow diagram of a method for dual-camera based high dynamic range image acquisition according to yet another embodiment of the present application;
FIG. 5 is a schematic diagram of a dual-camera based high dynamic range image capture device according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a dual-camera based high dynamic range image capture device according to another embodiment of the present application;
FIG. 7 is a schematic diagram of a dual-camera based high dynamic range image capture device according to yet another embodiment of the present application;
fig. 8 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary and intended to be used for explaining the present application and should not be construed as limiting the present application.
In order to solve the problem that in the related art, when the underexposure amount and the overexposure amount are estimated according to the color histogram of the preview picture, due to the fact that truncation characteristics possibly exist at two ends of the color histogram of the preview picture, the estimated underexposure amount and the estimated overexposure amount have large errors, the acquired underexposure image and the acquired overexposure image are insufficient, and finally acquired high-dynamic-range images are poor in quality, a high-dynamic-range image acquisition method based on two cameras is provided.
According to the high dynamic range image obtaining method based on the double cameras, the preview picture is generated only according to the picture collected by the first camera, then when the exposure value of the second camera is adjusted to determine that each color channel histogram corresponding to the picture collected by the second camera meets the preset condition, the underexposure compensation value and the overexposure compensation value respectively correspond to each color channel histogram, and then the high dynamic range image of the current scene is obtained according to the underexposure compensation value and the overexposure compensation value. Therefore, the optimal underexposure compensation value and the optimal overexposure compensation value corresponding to the shooting scene are dynamically determined by utilizing the pictures acquired by the non-preview camera, so that the accuracy of the determined underexposure compensation value and the determined overexposure compensation value can be ensured, the quality of the finally acquired high-dynamic-range image can be improved, and the user experience is improved.
The following describes a method, an apparatus, and a device for acquiring a high dynamic range image based on two cameras according to an embodiment of the present application with reference to the accompanying drawings.
First, referring to fig. 1, a method for acquiring a high dynamic range image based on two cameras according to the present application will be specifically described.
FIG. 1 is a flow chart of a method for dual-camera based high dynamic range image acquisition according to one embodiment of the present application.
As shown in fig. 1, the dual-camera-based high dynamic range image acquisition method of the present application may include the following steps:
and 101, generating a preview picture according to the picture acquired by the first camera.
Specifically, the method for acquiring a high dynamic range image based on two cameras provided by the embodiment of the present application can be executed by the terminal device provided by the present application. The terminal equipment is provided with a high dynamic range image acquisition device based on two cameras so as to realize management or control of image acquisition in the current shooting scene.
In this embodiment, the terminal device may be any hardware device with two cameras, such as a smart phone, a camera, a Personal Computer (PC), and the like, which is not limited in this application.
Optionally, the dual cameras may refer to two cameras with the same orientation in the terminal device, for example, two rear cameras in a mobile phone, or two front cameras, and so on.
It should be noted that, in this embodiment, the two rear cameras may be arranged in the following manner, but are not limited to the following manner:
the first method is as follows: arranged in the horizontal direction.
The second method comprises the following steps: arranged in a vertical direction.
The horizontal direction is a direction parallel to the short side of the terminal device, and the vertical direction is a direction parallel to the long side of the terminal device.
In specific implementation, when a shooting instruction is obtained, the shooting mode of the terminal equipment can be firstly determined by the high dynamic range image obtaining device based on the double cameras so as to determine whether the current shooting mode of the terminal equipment is the high dynamic range shooting mode. When the current shooting mode is determined to be the high dynamic range shooting mode, the first camera can be controlled to collect the picture of the current shooting scene so as to generate a preview picture and display the preview picture through the display interface of the terminal equipment.
Among other things, the present application may determine that the current photographing mode is the high dynamic range photographing mode in the following manner.
First implementation
And acquiring an image acquisition instruction with a high dynamic range.
Specifically, the high dynamic range image acquisition instruction acquired in this embodiment may be an acquisition instruction triggered by a user by clicking a high dynamic range image acquisition function key on a display panel of the terminal device; or, the mode dial is rotated to align the mark with the HDR shooting mode, and the like, which is not particularly limited in the present application.
Second implementation
And determining that the current shooting scene is a backlight scene.
Specifically, when the shooting scene is backlight, an image shot in the ordinary shooting mode may be under-exposed or over-exposed, so that in order to acquire more details of the image, the terminal device may automatically switch the shooting mode to the high dynamic range image mode when determining that the current shooting mode is backlight.
Furthermore, according to the method and the device, the first camera is controlled to collect the current picture of the shot scene, and the second camera can be controlled to collect the current picture of the shot scene, so that the subsequent analysis and processing operation can be conveniently carried out according to the collected pictures.
And 102, adjusting an exposure value of the second camera, and determining an underexposure compensation value and an overexposure compensation value which respectively correspond to each color channel histogram corresponding to the picture acquired by the second camera when the color channel histogram meets a preset condition.
The preset condition may be adaptively set according to an actual shooting scene, which is not specifically limited in the present application. For example, as the luminance value increases in the histogram of each color channel, the sum of the pixel ratios reaches a pixel ratio threshold, and so on.
In practical application, the image brightness range which can be represented in the horizontal axis by each color channel histogram is displayed in a truncated manner, namely, only the pixel distribution condition with the brightness range between 0 and 255 can be displayed. For example, if the luminance in the red channel histogram is 255 and the number of corresponding pixels is 1000, it can only be stated that the number of pixels whose luminance range corresponding to the red channel in the current picture is greater than or equal to 255 is 1000, at this time, the luminance corresponding to the number of 800 pixels is 500 or more and the luminance corresponding to only 200 pixels is 255, which makes the accuracy of the determined value insufficient when determining the underexposure compensation value or the overexposure compensation value according to each color channel histogram only, thereby affecting the dynamic range of the HDR image. Therefore, in the embodiment of the application, when the underexposure compensation value and the overexposure compensation value are determined, the underexposure compensation value and the overexposure compensation value in the current shooting scene are dynamically determined by using the pictures acquired by the camera which are not used for preview display.
Specifically, when the terminal device displays the preview picture in the display interface, the terminal device may perform statistical analysis on the picture acquired by the second camera, so as to determine the underexposure compensation value and the overexposure compensation value in the current shooting scene according to each color channel histogram corresponding to the picture acquired by the second camera. And then controlling the second camera to respectively acquire corresponding overexposure compensation pictures and underexposure compensation pictures according to the determined underexposure compensation values and overexposure compensation values, and respectively re-analyzing the newly acquired pictures so as to judge whether the color channel histograms respectively corresponding to the newly acquired pictures meet preset conditions.
If so, determining the determined underexposure compensation value and overexposure compensation value as final underexposure compensation value and overexposure compensation value; if the preset conditions are met, determining a new underexposure compensation value and a new overexposure compensation value again according to the color channel histograms respectively corresponding to the newly acquired pictures, then controlling the second camera to acquire the corresponding pictures according to the new underexposure compensation value and the new overexposure compensation value which are determined again, and repeating the steps until the color channel histograms corresponding to the acquired pictures meet the preset conditions, and then determining the corresponding underexposure compensation value and overexposure compensation value as the underexposure compensation value and the overexposure compensation value under the current shooting scene when the preset conditions are met.
In the present application, each color channel histogram corresponding to the picture acquired by the second camera may be determined according to RGB data, which is not described in detail in this embodiment.
It should be noted that, if the RGB data acquired in this embodiment includes three color channels, namely, red (R), green (G), and blue (B), the histograms of the color channels determined correspondingly are three, namely, the red channel histogram, the green channel histogram, and the blue channel histogram.
Further, the three color channel histograms determined above can be specifically shown in fig. 2, where fig. 2(a) is a red channel histogram, fig. 2(b) is a green channel histogram, and fig. 2(c) is a blue channel histogram. In each color channel histogram, the x-axis represents the image brightness, and the y-axis represents the pixel proportion of each pixel in the image at the brightness.
If the RGB data obtained in this embodiment includes four color channels R, Gr, Gb, and B, the number of the corresponding determined color channel histograms is four, and the color channel histograms are a red channel histogram, a green (Gr) channel histogram, a green (Gb) channel histogram, and a blue channel histogram.
Furthermore, since the size of the picture has no or little influence on the histograms of the color channels corresponding to the picture, in order to reduce the calculation amount in the embodiment of the present application, the present application may further increase the calculation speed by reducing the current resolution of the second camera before adjusting the exposure value of the second camera.
That is to say, the present application reduces the current resolution of the second camera to reduce the size of the acquired picture, and the reduction of the size of the acquired picture does not affect the luminance histogram, thereby reducing the amount of computation and increasing the computation speed. For example, the second camera resolution is reduced from 2000 ten thousand to 50 thousand, and so on.
And 103, acquiring a high dynamic range image of the current scene according to the underexposure compensation value and the overexposure compensation value.
Specifically, after the underexposure compensation value and the overexposure compensation value in the current shooting scene are determined, the high dynamic range image acquisition device based on the double cameras can acquire the high dynamic range image of the current scene according to the underexposure compensation value and the overexposure compensation value.
In specific implementation, the high dynamic range image of the current scene can be acquired by using the first camera and/or the second camera according to the underexposure compensation value and the overexposure compensation value.
It can be understood that, the obtaining of the high dynamic range image of the current scene by using the first camera and/or the second camera may be obtaining an underexposed image of the current scene by using the first camera, obtaining an overexposed image of the current scene by using the second camera, and then performing fusion processing on the obtained normal exposed image, the underexposed image and the overexposed image of the current scene to generate the high dynamic range image of the current scene;
or, acquiring an overexposure image, an underexposure compensation image and a normal exposure image of the current scene according to the underexposure compensation value and the overexposure compensation value by only using the first camera, and then performing fusion processing on the acquired overexposure image, the underexposure compensation value and the normal exposure image to generate a high dynamic range image of the current scene;
or, the overexposure image, the underexposure compensation image, and the normal exposure image of the current scene may be obtained only by using the second camera according to the underexposure compensation value and the overexposure compensation value, and then the obtained overexposure image, the underexposure compensation value, and the normal exposure image are subjected to fusion processing to generate the high dynamic range image of the current scene, which is not specifically limited in this application.
It should be noted that, when the first camera is used to acquire the high dynamic range image of the current scene, in order to acquire an image whose exposure satisfies the condition, the underexposure compensation value and the overexposure compensation value determined according to the picture acquired by the second camera may be mapped to the first camera, so that the first camera can acquire the corresponding high dynamic range image.
According to the high dynamic range image obtaining method based on the double cameras, firstly, a preview picture is generated according to a picture collected by the first camera, then, an exposure value of the second camera is adjusted, when it is determined that each color channel histogram corresponding to the picture collected by the second camera meets a preset condition, an underexposure compensation value and an overexposure compensation value which correspond to each other are obtained, and then, a high dynamic range image of a current scene is obtained according to the determined underexposure compensation value and the determined overexposure compensation value. Therefore, the optimal underexposure compensation value and the optimal overexposure compensation value corresponding to the shooting scene are dynamically determined by utilizing the pictures acquired by the non-preview camera, so that the accuracy of the determined underexposure compensation value and the determined overexposure compensation value can be ensured, the quality of the finally acquired high-dynamic-range image can be improved, and the user experience is improved.
Through the analysis, in the embodiment of the application, the underexposure compensation value and the overexposure compensation value in the current shooting scene can be dynamically determined according to the pictures acquired by the non-preview camera (the second camera). In a specific implementation, in an actual shooting process, shooting parameters of the first camera and the second camera are different, and parameters such as exposure or sensitivity are different. Therefore, in order to obtain an underexposure image and an overexposure image with exposure values meeting requirements, in this embodiment, after determining an underexposure compensation value and an overexposure compensation value by using each color channel histogram corresponding to a preview picture currently acquired by one camera, an underexposure compensation value or an overexposure compensation value corresponding to another camera needs to be determined according to the exposure values and sensitivities respectively corresponding to the two cameras. The method for acquiring a high dynamic range image based on two cameras according to the present application is further described with reference to fig. 3.
Fig. 3 is a flow chart of another dual-camera based high dynamic range image acquisition method of the present application.
As shown in fig. 3, the dual-camera-based high dynamic range image acquisition method of the present application may include the following steps:
And step 302, adjusting an exposure value of the second camera, and determining an underexposure compensation value and an overexposure compensation value which respectively correspond to each color channel histogram corresponding to the picture acquired by the second camera when the color channel histogram meets a preset condition.
That is to say, when the two cameras are used for respectively acquiring images with different exposure parameters, it is required to ensure that the exposure parameters corresponding to the cameras are matched with the shooting parameters of the cameras, so that both the underexposed images and the overexposed images acquired by the first camera and the second camera respectively meet the requirements.
In this embodiment, the exposure amount obtaining manner of the first camera and the second camera may be determined according to the formulas (1) and (2):
specifically, the exposure amount is the speed at which the photoreceptor receives light × exposure time … … … … … … (1)
Speed of light received by photoreceptor-intensity of ambient light × diaphragm … … … … … … … … (2)
Then, by combining the above equations (1) and (2), the exposure time of the diaphragm × (referred to as equation (3)) can be obtained by setting the exposure amount to the intensity of ambient light ×.
In practical applications, since the exposure time is the time when the shutter is open, i.e., the shutter, equation (3) above can be converted to an exposure amount that is equal to the intensity × of the ambient light, i.e., the aperture × shutter.
That is, when in natural light and without the help of a flash and a reflector, the ambient light cannot be changed, so that in most cases, the exposure amount can be controlled by changing the lens aperture of the camera and changing the shutter time.
Further, since the sensitivity (ISO) is a photosensitive speed of a Charge-coupled Device (CCD) or a Complementary Metal Oxide Semiconductor (CMOS) in the terminal Device, the sensitivity can be determined by formula (4). Therefore, the present application can acquire the sensitivities of the first camera and the second camera according to formula (4).
Specifically, the sensitivity is calculated as in formula (4):
H*S=0.8…………………………………………(4)
where H denotes exposure and S denotes sensitivity.
That is, the higher the ISO value, the stronger the light sensing capability of the light sensing component.
Furthermore, after the exposure and the sensitivity of the first camera and the second camera are obtained, the high dynamic range image obtaining device based on the dual cameras in the application can determine the target underexposure compensation value and the target overexposure compensation value corresponding to the first camera according to the obtained exposure and the sensitivity of the first camera, the exposure and the sensitivity of the second camera, and the underexposure compensation value and the overexposure compensation value determined according to the picture collected by the second camera.
And step 304, acquiring a high dynamic range image of the current scene according to the underexposure compensation value and the overexposure compensation value.
According to the method for acquiring the high dynamic range image based on the double cameras, the under-exposure compensation value and the over-exposure compensation value are determined by utilizing the histograms of all color channels corresponding to the preview picture currently acquired by the second camera, and then the target under-exposure compensation value and the target over-exposure compensation value corresponding to the first camera are determined according to the exposure and the sensitivity respectively corresponding to the first camera and the second camera and the under-exposure compensation value and the over-exposure compensation value, so that the under-exposure compensation value and the over-exposure compensation value are determined more accurately and reliably, and the quality of the finally acquired high dynamic range image is effectively ensured.
According to the analysis, the first camera is controlled to acquire the picture for previewing, the second camera is controlled to acquire the same picture, the exposure value of the second camera is adjusted according to each color channel histogram corresponding to the picture, until the fact that each color channel histogram corresponding to the picture acquired by the second camera meets the preset condition is determined, the corresponding underexposure compensation value and overexposure compensation value are obtained, and then the high dynamic range image of the current scene is obtained according to the determined underexposure compensation value and overexposure compensation value. For clarity, the corresponding underexposure compensation value and overexposure compensation process in the current scene are determined. The process of determining the underexposure compensation value according to the picture acquired by the second camera provided by the present application is further described below with reference to fig. 4 by taking the underexposure compensation value as an example.
Fig. 4 is a flowchart of another dual-camera based high dynamic range image acquisition method of the present application.
As shown in fig. 4, the dual-camera-based high dynamic range image acquisition method of the present application may include the following steps:
step 401, generating a preview image according to the image collected by the first camera.
In a specific implementation, the pixel proportions of the color channels may be superimposed from high to low according to the histograms of the color channels corresponding to the first picture until the superimposed sum of the pixel proportions reaches the pixel proportion threshold, and then the luminance value corresponding to the superimposed sum of the pixel proportions reaching the pixel proportion threshold may be determined.
After determining the brightness value corresponding to the pixel proportion threshold, the brightness value may be compared with the normal exposure brightness threshold to obtain a first overexposure degree of the current scene.
The first overexposure degree may be a specific value or a range of values, which is not specifically limited in this application.
In specific implementation, the first overexposure degree of the current scene and the normal exposure brightness threshold value may be subjected to difference processing to obtain a corresponding difference value, and then the first underexposure compensation value of the current scene is determined according to the difference value.
And step 404, controlling a second camera to acquire a second picture according to the first underexposure compensation value.
Specifically, after the second camera is controlled to collect the second picture, whether the second overexposure degree is within the preset range is determined by analyzing each color channel histogram corresponding to the second picture. When the second overexposure degree is determined to be in the preset range, determining that the first underexposure compensation value is the underexposure compensation value corresponding to the second camera; and when the second exposure degree is determined not to be in the preset range, continuously determining a second underexposure compensation value according to the second overexposure, and controlling the second camera to obtain a third picture according to the second underexposure compensation value.
And step 406, determining that the first underexposure compensation value is the underexposure compensation value corresponding to the second camera.
And step 408, controlling the second camera to acquire a third picture according to the second underexposure compensation value until the overexposure degree of the second camera is determined to be within the preset range according to each color channel histogram corresponding to the picture acquired by the second camera latest.
That is to say, different underexposure compensation values are determined by continuously analyzing the color channel histograms corresponding to the pictures acquired by the second camera, and the second camera is controlled to acquire the pictures according to the iterative underexposure compensation values until the overexposure degree of each color channel histogram corresponding to the pictures acquired by the second camera reaches the expectation.
Similarly, when determining the first overexposure compensation value of the current scene, similar to the process of determining the first underexposure compensation value of the current scene, the only difference is that the proportion of pixels in each color channel needs to be overlapped in a manner that the brightness is increased from low to high.
And step 409, acquiring a high dynamic range image of the current scene according to the underexposure compensation value and the overexposure compensation value.
According to the high dynamic range image obtaining method based on the double cameras, firstly, a preview picture is generated according to a picture collected by the first camera, then, an exposure value of the second camera is adjusted, when it is determined that each color channel histogram corresponding to the picture collected by the second camera meets a preset condition, an underexposure compensation value and an overexposure compensation value which correspond to each other are obtained, and then, a high dynamic range image of a current scene is obtained according to the determined underexposure compensation value and the determined overexposure compensation value. Therefore, the optimal underexposure compensation value and the optimal overexposure compensation value corresponding to the shooting scene are dynamically determined by utilizing the pictures acquired by the non-preview camera, so that the accuracy of the determined underexposure compensation value and the determined overexposure compensation value can be ensured, the quality of the finally acquired high-dynamic-range image can be improved, and the user experience is improved.
In order to implement the above embodiments, the present application further provides a high dynamic range image acquisition apparatus based on two cameras.
Fig. 5 is a schematic structural diagram of a dual-camera-based high dynamic range image capturing apparatus according to an embodiment of the present application.
As shown in fig. 5, the dual-camera based high dynamic range image capturing apparatus of the present application includes: a generating module 110, a determining module 111 and an obtaining module 112.
The generating module 110 is configured to generate a preview image according to an image acquired by the first camera;
the determining module 111 is configured to adjust an exposure value of a second camera, and determine an underexposure compensation value and an overexposure compensation value corresponding to each color channel histogram corresponding to a picture acquired by the second camera when the color channel histogram meets a preset condition;
the obtaining module 112 is configured to obtain a high dynamic range image of the current scene according to the underexposure compensation value and the overexposure compensation value.
In an optional implementation form, the obtaining module 112 is specifically configured to obtain a high dynamic range image of a current scene by using the first camera and/or the second camera according to the underexposure compensation value and the overexposure compensation value.
In an optional implementation form, the obtaining module 112 is further configured to obtain an underexposed image of the current scene by using the first camera, and obtain an overexposed image of the current scene by using the second camera; and carrying out fusion processing on the normal exposure image, the underexposure image and the overexposure image of the current scene to generate a high dynamic range image of the current scene.
In an optional implementation form, the high dynamic range image capturing apparatus based on two cameras in the embodiment of the present application further includes: and an adjusting module.
And the adjusting module is used for reducing the current resolution of the second camera.
It should be noted that the foregoing explanation of the embodiment of the method for acquiring a high dynamic range image based on two cameras is also applicable to the apparatus for acquiring a high dynamic range image based on two cameras of this embodiment, and the implementation principle is similar, and therefore, no further description is given here.
The high dynamic range image obtaining apparatus based on two cameras provided in this embodiment generates a preview image according to a picture acquired by a first camera, adjusts an exposure value of a second camera, determines that each color channel histogram corresponding to the picture acquired by the second camera meets a preset condition, and obtains a high dynamic range image of a current scene according to the determined underexposure compensation value and overexposure compensation value. Therefore, the acquired picture color histogram is analyzed in real time by using the non-preview camera to obtain the optimal underexposure compensation value and the optimal overexposure compensation value corresponding to the shooting scene, so that the high dynamic range image of the shooting scene is obtained according to the optimal underexposure compensation value and the optimal overexposure compensation value, the accuracy of the determined underexposure compensation value and the determined overexposure compensation value can be ensured, and the quality of the finally shot high dynamic range image can be improved.
Fig. 6 is a schematic structural diagram of a dual-camera-based high dynamic range image capturing apparatus according to another embodiment of the present application.
Referring to fig. 6, the dual-camera based high dynamic range image acquisition apparatus may include:
the generating module 110 is configured to generate a preview image according to an image acquired by the first camera;
the determining module 111 is configured to adjust an exposure value of a second camera, and determine an underexposure compensation value and an overexposure compensation value corresponding to each color channel histogram corresponding to a picture acquired by the second camera when the color channel histogram meets a preset condition;
in an optional implementation form, the high dynamic range image capturing apparatus based on two cameras in the embodiment of the present application further includes: a second determination module 113.
The second determining module 113 is configured to determine a target underexposure compensation value and a target overexposure compensation value corresponding to the first camera according to the exposure amount and the sensitivity corresponding to the first camera, the exposure amount and the sensitivity corresponding to the second camera, and the underexposure compensation value and the overexposure compensation value.
The obtaining module 112 is configured to obtain a high dynamic range image of the current scene according to the underexposure compensation value and the overexposure compensation value.
It should be noted that the foregoing explanation of the embodiment of the method for acquiring a high dynamic range image based on two cameras is also applicable to the apparatus for acquiring a high dynamic range image based on two cameras of this embodiment, and the implementation principle is similar, and therefore, no further description is given here.
According to the high dynamic range image acquisition device based on the double cameras, the under-exposure compensation value and the over-exposure compensation value are determined by utilizing the color channel histograms corresponding to the preview pictures acquired by the second camera at present, then the target under-exposure compensation value and the target over-exposure compensation value corresponding to the first camera are determined according to the exposure and the sensitivity respectively corresponding to the first camera and the second camera and the under-exposure compensation value and the over-exposure compensation value, so that the under-exposure compensation value and the over-exposure compensation value are determined more accurately and reliably, and the finally acquired high dynamic range image quality is effectively ensured.
Fig. 7 is a schematic structural diagram of a dual-camera-based high dynamic range image capturing apparatus according to still another embodiment of the present application.
Referring to fig. 7, the dual-camera based high dynamic range image acquisition apparatus may include:
the generating module 110 is configured to generate a preview image according to an image acquired by the first camera;
in an optional implementation form, the high dynamic range image capturing apparatus based on two cameras in the embodiment of the present application further includes: a third determination module 114, a fourth determination module 115, a first control module 116, a judgment module 117, a fifth determination module 118, a sixth determination module 119, and a second control module 120.
The third determining module 114 is configured to determine, according to each color channel histogram corresponding to a first picture acquired by the second camera, a first overexposure degree corresponding to the second camera;
the fourth determining module 115 is configured to determine a first underexposure compensation value according to the first overexposure degree;
the first control module 116 is configured to control the second camera to acquire a second picture according to the first underexposure compensation value;
the judging module 117 is configured to judge whether a second overexposure degree corresponding to the second camera is within a preset range according to each color channel histogram corresponding to the second picture;
the fifth determining module 118 is configured to determine that the first underexposure compensation value is an underexposure compensation value corresponding to the second camera if the first underexposure compensation value is positive.
The sixth determining module 119 is configured to determine a second underexposure compensation value according to the second overexposure degree if the second underexposure compensation value is not determined;
the second control module 120 is configured to control the second camera to acquire a third picture according to the second underexposure compensation value until it is determined that the overexposure degree of the second camera is within a preset range according to each color channel histogram corresponding to the picture newly acquired by the second camera.
The obtaining module 112 is configured to obtain a high dynamic range image of the current scene according to the underexposure compensation value and the overexposure compensation value.
It should be noted that the foregoing explanation of the embodiment of the method for acquiring a high dynamic range image based on two cameras is also applicable to the apparatus for acquiring a high dynamic range image based on two cameras of this embodiment, and the implementation principle is similar, and therefore, no further description is given here.
According to the high dynamic range image acquisition device based on the double cameras, a preview picture is generated according to a picture acquired by the first camera, then the exposure value of the second camera is adjusted, when it is determined that each color channel histogram corresponding to the picture acquired by the second camera meets preset conditions, an underexposure compensation value and an overexposure compensation value which correspond to each color channel histogram respectively are obtained, and then a high dynamic range image of a current scene is acquired according to the determined underexposure compensation value and the determined overexposure compensation value. Therefore, the optimal underexposure compensation value and the optimal overexposure compensation value corresponding to the shooting scene are dynamically determined by utilizing the pictures acquired by the non-preview camera, so that the accuracy of the determined underexposure compensation value and the determined overexposure compensation value can be ensured, the quality of the finally acquired high-dynamic-range image can be improved, and the user experience is improved.
In order to implement the above embodiments, the present application further provides a terminal device.
Fig. 8 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Referring to fig. 8, the terminal device 100 of the present application includes a memory 210, a processor 220, and a camera module 230;
the camera module 230 is configured to obtain an image in a current shooting scene;
the memory 210 is used for storing executable program codes;
the processor 220 is configured to read the executable program code stored in the memory 210 to run a program corresponding to the executable program code, so as to implement the dual-camera-based high dynamic range image acquisition method described in the embodiment of the first aspect.
In this embodiment, the terminal device may be any hardware device with two cameras, such as a smart phone, a camera, a Personal Computer (PC), and the like, which is not limited in this application.
It should be noted that the foregoing explanation of the embodiment of the method for acquiring a high dynamic range image based on two cameras is also applicable to the terminal device of the embodiment, and the implementation principle is similar, and is not repeated here.
In the terminal device provided in this embodiment, a preview picture is generated according to a picture acquired by a first camera, then an exposure value of a second camera is adjusted, and when it is determined that each color channel histogram corresponding to the picture acquired by the second camera meets a preset condition, an underexposure compensation value and an overexposure compensation value that correspond to each color channel histogram respectively are obtained, and then a high dynamic range image of a current scene is obtained according to the determined underexposure compensation value and overexposure compensation value. Therefore, the acquired picture color histogram is analyzed in real time by using the non-preview camera to obtain the optimal underexposure compensation value and the optimal overexposure compensation value corresponding to the shooting scene, so that the high dynamic range image of the shooting scene is obtained according to the optimal underexposure compensation value and the optimal overexposure compensation value, the accuracy of the determined underexposure compensation value and the determined overexposure compensation value can be ensured, and the quality of the finally shot high dynamic range image can be improved.
In order to implement the above embodiments, the present application also proposes a computer-readable storage medium.
The computer-readable storage medium has stored thereon a computer program which, when executed by a processor, implements the dual-camera based high dynamic range image acquisition method of the first aspect embodiment.
In this application, unless expressly stated or limited otherwise, the terms "disposed," "connected," and the like are to be construed broadly and include, for example, mechanical and electrical connections; they may be directly connected or indirectly connected through intervening media, or they may be connected internally or in any other suitable relationship, unless expressly stated otherwise. The specific meaning of the above terms in the present application can be understood by those of ordinary skill in the art as appropriate.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and the scope of the preferred embodiments of the present application includes other implementations in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.
Claims (8)
1. A high dynamic range image acquisition method based on double cameras is characterized by comprising the following steps:
generating a preview picture according to the picture acquired by the first camera;
adjusting an exposure value of a second camera, and determining an underexposure compensation value and an overexposure compensation value which respectively correspond to each color channel histogram corresponding to a picture acquired by the second camera when the color channel histogram meets a preset condition;
acquiring a high dynamic range image of the current scene according to the underexposure compensation value and the overexposure compensation value;
when adjusting the exposure value of the second camera and determining that each color channel histogram corresponding to the picture acquired by the second camera meets the preset condition, the corresponding underexposure compensation value and overexposure compensation value respectively comprise:
determining a first overexposure degree corresponding to the second camera according to each color channel histogram corresponding to a first picture acquired by the second camera;
determining a first underexposure compensation value according to the first overexposure degree;
controlling the second camera to acquire a second picture according to the first underexposure compensation value;
judging whether a second overexposure degree corresponding to the second camera is within a preset range or not according to each color channel histogram corresponding to the second picture;
if so, determining the first underexposure compensation value as an underexposure compensation value corresponding to the second camera;
before the adjusting the exposure value of the second camera, the method further includes:
and reducing the current resolution of the second image pick-up.
2. The method of claim 1, wherein after determining whether the second overexposure degree corresponding to the second camera is within a preset range, the method further comprises:
if not, determining a second underexposure compensation value according to the second overexposure degree;
and controlling the second camera to collect a third picture according to the second underexposure compensation value until the overexposure degree of the second camera is determined to be within a preset range according to each color channel histogram corresponding to the picture newly collected by the second camera.
3. The method of claim 1, wherein said obtaining a high dynamic range image of a current scene based on said underexposure compensation value and overexposure compensation value comprises:
and acquiring a high dynamic range image of the current scene by using the first camera and/or the second camera according to the underexposure compensation value and the overexposure compensation value.
4. The method of claim 3, wherein the first camera and the second camera correspond to different exposures and/or sensitivities, respectively;
before the obtaining of the high dynamic range image of the current scene by using the first camera and the second camera, the method further includes:
and determining a target underexposure compensation value and a target overexposure compensation value corresponding to the first camera according to the exposure and the sensitivity corresponding to the first camera, the exposure and the sensitivity corresponding to the second camera and the underexposure compensation value and the overexposure compensation value.
5. The method of claim 3 or 4, wherein said acquiring a high dynamic range image of a current scene with the first camera and/or the second camera comprises:
acquiring an underexposed image of the current scene by using the first camera, and acquiring an overexposed image of the current scene by using the second camera;
and carrying out fusion processing on the normal exposure image, the underexposure image and the overexposure image of the current scene to generate a high dynamic range image of the current scene.
6. A dual-camera based high dynamic range image capture device, comprising:
the generating module is used for generating a preview picture according to the picture acquired by the first camera;
the determining module is used for adjusting an exposure value of a second camera and determining an underexposure compensation value and an overexposure compensation value which respectively correspond to each color channel histogram corresponding to a picture acquired by the second camera when the color channel histogram meets a preset condition;
the acquisition module is used for acquiring a high dynamic range image of the current scene according to the underexposure compensation value and the overexposure compensation value;
when adjusting the exposure value of the second camera and determining that each color channel histogram corresponding to the picture acquired by the second camera meets the preset condition, the corresponding underexposure compensation value and overexposure compensation value respectively comprise:
determining a first overexposure degree corresponding to the second camera according to each color channel histogram corresponding to a first picture acquired by the second camera;
determining a first underexposure compensation value according to the first overexposure degree;
controlling the second camera to acquire a second picture according to the first underexposure compensation value;
judging whether a second overexposure degree corresponding to the second camera is within a preset range or not according to each color channel histogram corresponding to the second picture;
if so, determining the first underexposure compensation value as an underexposure compensation value corresponding to the second camera;
before the adjusting the exposure value of the second camera, the method further includes:
and reducing the current resolution of the second image pick-up.
7. A terminal device, comprising: the device comprises a memory, a processor and a camera module;
the camera module is used for acquiring an image in a current shooting scene;
the memory for storing executable program code;
the processor is used for reading the executable program codes stored in the memory to run programs corresponding to the executable program codes, so as to realize the high dynamic range image acquisition method based on the double cameras according to any one of claims 1 to 5.
8. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method for dual-camera based high dynamic range image acquisition according to any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810326327.6A CN108337446B (en) | 2018-04-12 | 2018-04-12 | High dynamic range image acquisition method, device and equipment based on double cameras |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810326327.6A CN108337446B (en) | 2018-04-12 | 2018-04-12 | High dynamic range image acquisition method, device and equipment based on double cameras |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108337446A CN108337446A (en) | 2018-07-27 |
CN108337446B true CN108337446B (en) | 2020-07-31 |
Family
ID=62934041
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810326327.6A Active CN108337446B (en) | 2018-04-12 | 2018-04-12 | High dynamic range image acquisition method, device and equipment based on double cameras |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108337446B (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109862269B (en) | 2019-02-18 | 2020-07-31 | Oppo广东移动通信有限公司 | Image acquisition method and device, electronic equipment and computer readable storage medium |
CN110166705B (en) * | 2019-06-06 | 2021-04-23 | Oppo广东移动通信有限公司 | High dynamic range HDR image generation method and device, electronic equipment and computer readable storage medium |
CN110177221B (en) * | 2019-06-25 | 2021-02-26 | 维沃移动通信有限公司 | Shooting method and device for high dynamic range image |
CN110675527B (en) * | 2019-09-28 | 2021-01-29 | 侯小芳 | On-site prevention device for porcelain collision behavior |
CN113132643B (en) * | 2019-12-30 | 2023-02-07 | Oppo广东移动通信有限公司 | Image processing method and related product |
CN111429387A (en) * | 2020-03-12 | 2020-07-17 | 上海扩博智能技术有限公司 | Image brightness adjusting method, system, device and storage medium |
CN113572970A (en) * | 2021-06-24 | 2021-10-29 | 维沃移动通信(杭州)有限公司 | Image processing method and device and electronic equipment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106060406A (en) * | 2016-07-27 | 2016-10-26 | 维沃移动通信有限公司 | Photographing method and mobile terminal |
CN106161967A (en) * | 2016-09-13 | 2016-11-23 | 维沃移动通信有限公司 | A kind of backlight scene panorama shooting method and mobile terminal |
CN107613218A (en) * | 2017-09-15 | 2018-01-19 | 维沃移动通信有限公司 | The image pickup method and mobile terminal of a kind of high dynamic range images |
CN107635102A (en) * | 2017-10-30 | 2018-01-26 | 广东欧珀移动通信有限公司 | High dynamic range images exposure compensating value-acquiring method and device |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4214160B2 (en) * | 2006-08-31 | 2009-01-28 | フジノン株式会社 | Surveillance camera system |
-
2018
- 2018-04-12 CN CN201810326327.6A patent/CN108337446B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106060406A (en) * | 2016-07-27 | 2016-10-26 | 维沃移动通信有限公司 | Photographing method and mobile terminal |
CN106161967A (en) * | 2016-09-13 | 2016-11-23 | 维沃移动通信有限公司 | A kind of backlight scene panorama shooting method and mobile terminal |
CN107613218A (en) * | 2017-09-15 | 2018-01-19 | 维沃移动通信有限公司 | The image pickup method and mobile terminal of a kind of high dynamic range images |
CN107635102A (en) * | 2017-10-30 | 2018-01-26 | 广东欧珀移动通信有限公司 | High dynamic range images exposure compensating value-acquiring method and device |
Also Published As
Publication number | Publication date |
---|---|
CN108337446A (en) | 2018-07-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107635102B (en) | Method and device for acquiring exposure compensation value of high-dynamic-range image | |
CN108337446B (en) | High dynamic range image acquisition method, device and equipment based on double cameras | |
CN108683862B (en) | Imaging control method, imaging control device, electronic equipment and computer-readable storage medium | |
CN108337445B (en) | Photographing method, related device and computer storage medium | |
CN108337449A (en) | High-dynamic-range image acquisition method, device based on dual camera and equipment | |
CN108616689B (en) | Portrait-based high dynamic range image acquisition method, device and equipment | |
CN109788207B (en) | Image synthesis method and device, electronic equipment and readable storage medium | |
CN110225248B (en) | Image acquisition method and device, electronic equipment and computer readable storage medium | |
CN107846556B (en) | Imaging method, imaging device, mobile terminal and storage medium | |
US8106965B2 (en) | Image capturing device which corrects a target luminance, based on which an exposure condition is determined | |
CN109862269B (en) | Image acquisition method and device, electronic equipment and computer readable storage medium | |
US8937677B2 (en) | Digital photographing apparatus, method of controlling the same, and computer-readable medium | |
CN110166705B (en) | High dynamic range HDR image generation method and device, electronic equipment and computer readable storage medium | |
JP6752667B2 (en) | Image processing equipment and image processing methods and programs | |
CN107888839B (en) | high dynamic range image acquisition method, device and equipment | |
JP2002064745A (en) | Camera aperture control method, lens-control method and device, contour emphasis control method and device, and camera | |
CN110198418B (en) | Image processing method, image processing device, storage medium and electronic equipment | |
CN108156369B (en) | Image processing method and device | |
CN110493539B (en) | Automatic exposure processing method, processing device and electronic equipment | |
CN110290325B (en) | Image processing method, image processing device, storage medium and electronic equipment | |
US11496694B2 (en) | Dual sensor imaging system and imaging method thereof | |
CN101227562A (en) | Luminance correcting method | |
US11601600B2 (en) | Control method and electronic device | |
CN107682611B (en) | Focusing method and device, computer readable storage medium and electronic equipment | |
CN110266967B (en) | Image processing method, image processing device, storage medium and electronic equipment |
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 |