CN108174173B - Photographing method and apparatus, computer-readable storage medium, and computer device - Google Patents

Photographing method and apparatus, computer-readable storage medium, and computer device Download PDF

Info

Publication number
CN108174173B
CN108174173B CN201711423781.5A CN201711423781A CN108174173B CN 108174173 B CN108174173 B CN 108174173B CN 201711423781 A CN201711423781 A CN 201711423781A CN 108174173 B CN108174173 B CN 108174173B
Authority
CN
China
Prior art keywords
light source
image
color temperature
frame
color
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
CN201711423781.5A
Other languages
Chinese (zh)
Other versions
CN108174173A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201711423781.5A priority Critical patent/CN108174173B/en
Publication of CN108174173A publication Critical patent/CN108174173A/en
Application granted granted Critical
Publication of CN108174173B publication Critical patent/CN108174173B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/84Camera processing pipelines; Components thereof for processing colour signals
    • H04N23/88Camera processing pipelines; Components thereof for processing colour signals for colour balance, e.g. white-balance circuits or colour temperature control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/95Computational photography systems, e.g. light-field imaging systems
    • H04N23/951Computational photography systems, e.g. light-field imaging systems by using two or more images to influence resolution, frame rate or aspect ratio

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Studio Devices (AREA)
  • Color Television Image Signal Generators (AREA)
  • Processing Of Color Television Signals (AREA)

Abstract

The application discloses a shooting method. The shooting method comprises the following steps: acquiring continuous multi-frame images, wherein the continuous multi-frame images comprise a current frame preview image; processing each frame of image to detect a light source of each frame of image; determining the color of the light source of each frame of image to determine the color temperature of the light source of each frame of image; determining the equivalent color temperature of the preview image of the current frame according to the color temperature of the light source of the continuous multi-frame image; and carrying out white balance processing on the current frame preview image according to the equivalent color temperature. The application also discloses a shooting device, a computer readable storage medium and a computer device. The shooting method and device, the computer readable storage medium and the computer equipment in the embodiment of the application determine the equivalent color temperature of the current frame preview image according to the color temperature of the light source of the continuous multi-frame image, so that the current frame preview image can be subjected to white balance according to the equivalent color temperature, the color of the current frame preview image after white balance processing is more accurate, and the color transition of the continuous multi-frame image is smoother.

Description

Photographing method and apparatus, computer-readable storage medium, and computer device
Technical Field
The present application relates to the field of imaging technologies, and in particular, to a shooting method, a shooting apparatus, a computer-readable storage medium, and a computer device.
Background
In the related art shooting method, the color temperature of the light source of the scene corresponding to the current frame image is detected, and the current frame image is subjected to white balance processing according to the color temperature of the light source and then is used as a preview image, so that when the color temperature of the light source of the scene is greatly changed due to the large change of the scene, the tone of the preview image is also greatly changed, and the user experience is influenced.
Disclosure of Invention
Embodiments of the present application provide a photographing method, a photographing apparatus, a computer-readable storage medium, and a computer device.
The shooting method of the embodiment of the application comprises the following steps:
acquiring continuous multi-frame images, wherein the continuous multi-frame images comprise a current frame preview image;
processing each frame of the image to detect a light source for each frame of the image;
determining a color of a light source of each frame of the image to determine a color temperature of the light source of each frame of the image;
determining the equivalent color temperature of the preview image of the current frame according to the color temperature of the light source of the continuous multi-frame image; and
and carrying out white balance processing on the current frame preview image according to the equivalent color temperature.
The imaging device of the embodiment of the application comprises:
the device comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring continuous multi-frame images, and the continuous multi-frame images comprise a current frame preview image;
a first processing module to process each frame of the image to detect a light source for each frame of the image;
a first determination module to determine a color of a light source of the image for each frame to determine a color temperature of the light source of the image for each frame;
the second determining module is used for determining the equivalent color temperature of the current frame preview image according to the color temperature of the light source of the continuous multi-frame image; and
and the second processing module is used for carrying out white balance processing on the current frame preview image according to the equivalent color temperature.
One or more non-transitory computer-readable storage media embodying computer-executable instructions that, when executed by one or more processors, cause the processors to perform the photography method of embodiments of the present application.
The computer device of the embodiment of the application comprises a memory and a processor, wherein the memory stores computer readable instructions, and the instructions, when executed by the processor, cause the processor to execute the shooting method.
The shooting method and device, the computer readable storage medium and the computer equipment in the embodiment of the application determine the equivalent color temperature of the current frame preview image according to the color temperature of the light source of the continuous multi-frame image, so that the current frame preview image can be subjected to white balance according to the equivalent color temperature, the color of the current frame preview image after white balance processing is more accurate, and the color transition of the continuous multi-frame image is smoother.
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
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a photographing method according to some embodiments of the present application.
FIG. 2 is a block diagram of a camera according to some embodiments of the present application.
FIG. 3 is a schematic plan view of a computer device according to some embodiments of the present application.
Fig. 4 is a schematic flow chart of a photographing method according to some embodiments of the present application.
FIG. 5 is a block diagram of a first processing module of some embodiments of the present application.
FIG. 6 is a schematic illustration of a capture scene according to some embodiments of the present application.
Fig. 7 is a flow chart illustrating a photographing method according to some embodiments of the present application.
FIG. 8 is a schematic illustration of a capture scene according to some embodiments of the present application.
FIG. 9 is a block diagram of a first determination module of certain embodiments of the present application.
FIG. 10 is a graphical representation of a color temperature curve for certain embodiments of the present application.
Fig. 11 is a flow chart illustrating a photographing method according to some embodiments of the present application.
Fig. 12 is a schematic flow chart of a photographing method according to some embodiments of the present application.
FIG. 13 is a block diagram of a second determination module in accordance with certain implementations of the present application.
FIG. 14 is a block diagram of a computer device according to some embodiments of the present application.
FIG. 15 is a block schematic diagram of an image processing circuit according to some embodiments of the present application.
Description of the main element symbols:
the image processing apparatus includes a computer 1000, a camera 100, an acquisition module 112, a first processing module 114, a dividing unit 1142, a first determination unit 1144, a second determination unit 1146, a splicing unit 1148, a first determination unit 1149, a first determination module 116, a second determination unit 1162, a first processing unit 1164, a third determination unit 1166, a second determination module 118, a second processing unit 1182, a third processing unit 1184, a calculation unit 1186, a second processing module 122, a system bus 510, a processor 520, a memory 530, an internal memory 540, a display screen 550, an input device 560, an image processing circuit 800, an ISP processor 810, a control logic 820, a camera 830, a lens 832, an image sensor 834, a sensor 840, an image memory 850, an encoder/decoder 860, and a display 870.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It will be understood that, as used herein, the terms "first," "second," and the like may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another. For example, a first weight can be referred to as a second weight, and similarly, a second weight can be referred to as a first weight, without departing from the scope of the application. Both the first weight and the second weight are weights, but not the same weight.
Referring to fig. 1, a photographing method according to an embodiment of the present application includes the following steps:
s112: acquiring continuous multi-frame images, wherein the continuous multi-frame images comprise a current frame preview image;
s114: processing each frame of image to detect a light source of each frame of image;
s116: determining the color of the light source of each frame of image to determine the color temperature of the light source of each frame of image;
s118: determining the equivalent color temperature of the preview image of the current frame according to the color temperature of the light source of the continuous multi-frame image; and
s122: and carrying out white balance processing on the current frame preview image according to the equivalent color temperature.
Referring to fig. 2, the photographing apparatus 100 according to the embodiment of the present disclosure includes an obtaining module 112, a first processing module 114, a first determining module 116, a second determining module 118, and a second processing module 122. The obtaining module 112 is configured to obtain a plurality of consecutive frames of images, where the plurality of consecutive frames of images include a current frame preview image. The first processing module 114 is used for processing each frame of image to detect a light source of each frame of image. The first determining module 116 is used for determining the color of the light source of each frame of image to determine the color temperature of the light source of each frame of image. The second determining module 118 is configured to determine an equivalent color temperature of the preview image of the current frame according to the color temperature of the light source of the consecutive multi-frame images. The second processing module 122 is configured to perform white balance processing on the current frame preview image according to the equivalent color temperature.
The shooting method according to the embodiment of the present application can be implemented by the shooting apparatus 100 according to the embodiment of the present application, wherein the step S112 can be implemented by the obtaining module 112, the step S114 can be implemented by the first processing module 114, the step S116 can be implemented by the first determining module 116, the step S118 can be implemented by the second determining module 118, and the step S122 can be implemented by the second processing module 122.
Referring to fig. 3, the photographing apparatus 100 according to the embodiment of the present application may be applied to the computer device 1000 according to the embodiment of the present application, that is, the computer device 1000 according to the embodiment of the present application may include the photographing apparatus 100 according to the embodiment of the present application.
The shooting method, the shooting device 100 and the computer device 1000 in the embodiment of the application determine the equivalent color temperature of the current frame preview image according to the color temperature of the light source of the continuous multi-frame image, so that the current frame preview image can be subjected to white balance according to the equivalent color temperature, the color of the current frame preview image after the white balance processing is more accurate, and the color transition of the continuous multi-frame image is smoother.
In some embodiments, the continuous multiframe images can be two or more continuous frames. The continuous multi-frame image may refer to a multi-frame image acquired by a camera of the computer apparatus 1000 within a preset time. For example, if the camera of the computer apparatus 1000 acquires 6 frames of images within 0.2 second, the 6 frames of images may be regarded as a continuous multi-frame image. The current frame preview image may refer to an image displayed on a display screen of the computer device 1000. The current frame preview image is the latest acquired one of the continuous multi-frame images.
In one embodiment, the camera of the computer device 1000 captures a total of 10 frames of images from the time the image was first captured to a time, numbered sequentially from morning to evening by 1-10. The number of frames of the continuous multi-frame image is, for example, 6 frames, and when the display screen of the computer apparatus 1000 displays the image numbered 7 (i.e., the current frame preview image is the image numbered 7), the images numbered 2 to 7 can be regarded as the continuous multi-frame image. When the display screen of the computer apparatus 1000 displays the image numbered 8 (i.e., the current frame preview image is the image numbered 8), the images numbered 3 to 8 may be regarded as a continuous multi-frame image.
In some embodiments, when the camera of the computer device 1000 initially captures an image, the first frame preview image may be regarded as the current frame preview image, and the color temperature of the light source detected by the first frame preview image may be regarded as the equivalent color temperature of the current frame preview image. Before the continuous multiframe images are collected, the previously collected images are regarded as the continuous multiframe images.
In one embodiment, the camera of the computer device 1000 captures a total of 10 frames of images from the time the image was first captured to a time, numbered sequentially from morning to evening by 1-10. The number of frames of the continuous multi-frame image is, for example, 6 frames, and when the display screen of the computer apparatus 1000 displays the image numbered 1 (i.e., the current frame preview image is the image numbered 1), the color temperature of the light source detected by the image numbered 1 may be regarded as the color temperature of the current frame preview image. When the display screen of the computer apparatus 1000 displays the image number 2 (i.e., the current frame preview image number 2), the images number 1 and 2 can be regarded as a continuous multi-frame image.
In some embodiments, when the camera of the computer device 1000 first captures an image, the preview image may not be displayed until a number of consecutive frames of the image are captured.
In one embodiment, the camera of the computer device 1000 captures a total of 10 frames of images from the time the image was first captured to a time, numbered sequentially from morning to evening by 1-10. If the number of frames of the consecutive multi-frame images is, for example, 6 frames, the display screen of the computer device 1000 does not display the images numbered 1 to 5, and displays the images numbered 1 to 5 only when the image of the 6 th frame is acquired, and if the display screen of the computer device 1000 displays the image numbered 6 (i.e., if the preview image of the current frame is the image numbered 6), the images numbered 1 to 6 may be regarded as the consecutive multi-frame images.
In some embodiments, the computer device 1000 pre-stores a corresponding relationship between the equivalent color temperature and the white balance parameter, and the corresponding white balance parameter can be obtained by searching the corresponding relationship between the equivalent color temperature and the white balance parameter according to the equivalent color temperature, so that the white balance processing can be performed on the current frame preview image according to the white balance parameter.
Referring to fig. 4, in some embodiments, step S114 includes the following steps:
s1142: dividing the image into a plurality of regions;
s1144: judging whether the region is a target region comprising a light source according to the histogram of each region;
s1146: judging whether a plurality of adjacent target areas exist or not;
s1148: splicing a plurality of adjacent target areas into a light source when the plurality of adjacent target areas exist; and
s1149: the target area is determined as a light source when there are no adjacent plural target areas.
Referring to fig. 5, in some embodiments, the first processing module 114 includes a dividing unit 1142, a first determining unit 1144, a second determining unit 1146, a splicing unit 1148, and a first determining unit 1149. The dividing unit 1142 is used to divide the image into a plurality of regions. The first determining unit 1144 is configured to determine whether the region is a target region including a light source according to the histogram of each region. The second determination unit 1146 is configured to determine whether there are multiple adjacent target areas. The splicing unit 1148 is configured to splice the adjacent target areas into the light source when the adjacent target areas exist. The first determination unit 1149 is configured to determine the target area as the light source when there are no adjacent multiple target areas.
That is, step S1142 may be implemented by the dividing unit 1142, step S1144 may be implemented by the first determining unit 1144, step S1146 may be implemented by the second determining unit 1146, step S1148 may be implemented by the splicing unit 1148, and step S1149 may be implemented by the first determining unit 1149.
In this manner, the location of the light source in the image can be determined.
In particular, the image may be divided into a plurality of regions, for example 64 x 48 regions. Whether the proportion of pixels of which the pixel values exceed the preset pixel value P in each region exceeds a preset proportion, for example 239, or not, can be determined according to the histogram of each region, that is, whether the proportion of pixels of which the pixel values exceed the preset pixel value P in each region exceeds 5% or not, and the corresponding region of which the proportion of pixels of which the pixel values exceed the preset pixel value P exceeds the preset proportion is a target region including a light source. Judging whether a target area exists in the image, and when the target area exists in the image, indicating that a light source exists in a scene corresponding to the image; when the target area does not exist in the image, the scene corresponding to the image is explained to have no light source. When the target areas exist in the image, judging whether a plurality of adjacent target areas exist, and when the plurality of adjacent target areas exist, the plurality of adjacent target areas belong to the same light source in the scene, so that the plurality of adjacent target areas can be spliced into the light source; when there are no adjacent target areas, the target area can be regarded as a light source. Thus, the location of the light source in the image can be determined by the target area.
Referring to fig. 6, in an example, it may be determined that the area a, the area B, the area C, and the area D are target areas including light sources according to a histogram of each area, for example, it may be determined from the histogram of the area a that an occupation ratio of pixels in the area a whose pixel values exceed a preset pixel value P exceeds a preset proportion, and since the area a, the area B, the area C, and the area D are adjacent target areas, the area a, the area B, the area C, and the area D may be spliced together, so as to obtain a more complete light source.
Referring to fig. 7 and 8, in some embodiments, step S116 includes the following steps:
s1162: determining a high brightness region H and a middle brightness region M according to the radially outward brightness distribution of the center of the light source;
s1164: subtracting the average value of the primary color channel pixels of the medium-brightness area M from the average value of the primary color channel pixels of the high-brightness area H to determine the color of the light source; and
s1166: the color temperature of the light source is determined according to the color of the light source.
Referring to fig. 8 and 9, in some embodiments, the first determination module 116 includes a second determination unit 1162, a first processing unit 1164, and a third determination unit 1166. The second determining unit 1162 is configured to determine the high luminance region H and the medium luminance region M according to the radially outward luminance distribution of the center of the light source. The first processing unit 1164 is configured to subtract the average of the primary color channel pixels of the highlight region H from the average of the primary color channel pixels of the mid-highlight region M to determine the color of the light source. The third determining unit 1166 is configured to determine the color temperature of the light source according to the color of the light source.
That is, step S1162 may be implemented by the second determining unit 1162, step S1164 may be implemented by the first processing unit 1164, and step S1166 may be implemented by the third determining unit 1166.
In this manner, the color and color temperature of the light source can be determined by the high and medium luminance regions H and M.
Referring to fig. 8 again, after the light source position in the image is determined, it can be understood that the central region O of the light source in the image is an overexposed region, which is generally a large white spot and does not include information of the color of the light source. The color of the light source may be determined by the mean of the primary color channel pixels of the highlight region H and the mid-highlight region M. The highlight region H may refer to a region constituted by pixels having luminance values radially outward of the center of the light source in a first luminance range L1, the first luminance range L1 being, for example, [200, 239 ]. The middle-bright region M may refer to a region constituted by pixels having brightness values radially outward of the center of the light source in a second brightness range L2, the second brightness range L2 being [150, 200 ], for example. It should be noted that specific values of the first luminance range L1 and the second luminance range L2 may be determined according to the luminance distribution of the center O of the light source radially outward, for example, the luminance of the light source decays faster, and the first luminance range L1 and the second luminance range L2 may be increased; for example, the luminance of the light source decays relatively slowly, the first luminance range L1 and the second luminance range L2 may be reduced.
In some embodiments, the primary color channel refers to a color channel, for example, including at least one of an R (red) channel, a Gr (green red) channel, a Gb (green blue) channel, and a B (blue) channel, and in some embodiments, the pixel value of the G (green) channel may be obtained by the pixel value of the Gr channel and the pixel value of the Gb channel. The pixel average value may refer to an arithmetic average value of a plurality of pixel values, and the plurality of pixel values may be pixel values of all pixels of the highlight region or pixel values of all pixels of the mid-highlight region. In one example, the average (R) of each primary color channel pixel of the highlight regionavg,Gavg,Bavg) Is (200, 210, 220), the average value (R) of each primary color channel pixel of the middle bright areaavg,Gavg,Bavg) Is (160, 180, 190), the channel (R, G, B) of the color of the light source is (200-.
In some embodiments, the determining the color temperature of the light source according to the color of the light source may specifically be: and determining the color temperature of the light source according to the corresponding relation among the color of the light source, the color of the light source and the color temperature of the light source. The correspondence between the color of the light source and the color temperature of the light source may be a mapping table and/or a color temperature curve.
Referring to fig. 10, in an embodiment, images may be acquired under standard light boxes with color temperatures of 3000K, 4000K, 5000K, 6000K, and the like, respectively, and colors of light sources corresponding to the different color temperatures may be obtained through calculation, so that color temperature curves of the colors and the color temperatures of the light sources may be formed, and the color temperature curves may be stored in the computer device 1000. The color temperature of the corresponding light source can be obtained by searching the color of the light source in the color temperature curve.
Referring to fig. 11, in some embodiments, step S118 includes the following steps:
s1181: and calculating the average value of the color temperatures of the light sources of the continuous multiframe images as the equivalent color temperature.
Referring to fig. 2, in some embodiments, the second determining module 118 is configured to calculate an average value of color temperatures of light sources of consecutive multi-frame images as an equivalent color temperature.
That is, step S1181 may be implemented by the second determining module 118.
In this way, an equivalent color temperature can be obtained quickly.
Specifically, after the color temperatures of the light sources of the consecutive multi-frame images are acquired, an average value of the color temperatures of the light sources of the consecutive multi-frame images may be taken as the equivalent color temperature. In one embodiment, the consecutive multi-frame images are consecutive three-frame images, the color temperature of the light source detected by the first frame image of the consecutive three-frame images is 5000K (kelvin), the color temperature of the light source detected by the second frame image is 6000K, the color temperature of the light source detected by the current frame preview image is 7000K, and the equivalent color temperature is (5000K +6000K +7000K)/3 — 6000K.
Referring to fig. 12, in some embodiments, the consecutive multi-frame images include preview images of previous frames, and step S118 includes the following steps:
s1182: processing the color temperature of a light source of the current frame preview image by using a first weight value to obtain a first color temperature;
s1184: processing the color temperature of the light source of the previous frame preview image by a second weight value to obtain a second color temperature, wherein the first weight value is greater than the second weight value;
s1186: and calculating the equivalent color temperature according to the first color temperature and the second color temperature.
Referring to fig. 13, in some embodiments, the consecutive multi-frame images include preview images of previous frames, and the second determining module 118 includes a second processing unit 1182, a third processing unit 1184, and a calculating unit 1186. The second processing unit 1182 is configured to process the color temperature of the light source of the current frame preview image by the first weight to obtain a first color temperature. The third processing unit 1184 is configured to process the color temperature of the light source of the previous frame preview image with a second weight to obtain a second color temperature, where the first weight is greater than the second weight. The calculating unit 1186 is configured to calculate an equivalent color temperature according to the first color temperature and the second color temperature.
That is, step S1182 may be implemented by the second processing unit 1182, step S1184 may be implemented by the third processing unit 1184, and step S1186 may be implemented by the calculation unit 1186.
In this way, a more accurate equivalent color temperature can be obtained.
Specifically, since the equivalent color temperature of the current frame preview image is used for performing white balance processing on the current frame preview image, when calculating the equivalent color temperature, in order to improve the accuracy of the equivalent color temperature, a first weight may be multiplied by the color temperature of the light source of the current frame preview image to obtain a first color temperature, and a second weight may be multiplied by an average value of the color temperatures of the light sources of the earlier frame preview images to obtain a second color temperature, where the earlier frame preview image is an image other than the current frame preview image in a continuous multi-frame image, and a total of the first weight and the second weight is, for example, 1. The equivalent color temperature may be obtained by adding the first color temperature and the second color temperature.
In one embodiment, the consecutive multi-frame images are consecutive three-frame images, the color temperature of the light source detected by the first frame image of the consecutive three-frame images is 5000K, the color temperature of the light source detected by the second frame image is 6000K, the color temperature of the light source detected by the current frame preview image is 7000K, the first weight is 0.8, the second weight is 0.2, the first color temperature is 0.8 × 7000K — 5600K, the second color temperature is 0.2 [ (5000K +6000K)/2] — 1100K, and the equivalent color temperature is 5600K +1100K — 6700K.
The division of the modules in the shooting device 100 is only for illustration, and in other embodiments, the shooting device 100 may be divided into different modules as needed to complete all or part of the functions of the shooting device 100.
The embodiment of the application also provides a computer readable storage medium. One or more non-transitory computer-readable storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform the steps of:
s112: acquiring continuous multi-frame images, wherein the continuous multi-frame images comprise a current frame preview image;
s114: processing each frame of image to detect a light source of each frame of image;
s116: determining the color of the light source of each frame of image to determine the color temperature of the light source of each frame of image;
s118: determining the equivalent color temperature of the preview image of the current frame according to the color temperature of the light source of the continuous multi-frame image; and
s122: and carrying out white balance processing on the current frame preview image according to the equivalent color temperature.
FIG. 14 is a diagram showing an internal configuration of a computer device according to an embodiment. As shown in fig. 14, the computer apparatus 1000 includes a processor 520, a memory 530 (e.g., a non-volatile storage medium), an internal memory 540, a display screen 550, and an input device 560, which are connected by a system bus 510. The memory 530 of the computer device 1000 has stored therein an operating system and computer readable instructions. The computer readable instructions can be executed by the processor 520 to implement the photographing method according to the embodiment of the present application. The processor 520 is used to provide computing and control capabilities that support the operation of the overall computer device 1000. The internal memory 530 of the computer device 1000 provides an environment for the execution of computer-readable instructions in the memory 520. The display screen 550 of the computer device 1000 may be a liquid crystal display screen or an electronic ink display screen, and the input device 560 may be a touch layer covered on the display screen 550, a key, a track ball or a touch pad arranged on a housing of the computer device 1000, or an external keyboard, a touch pad or a mouse. The computer device 1000 may be a mobile phone, a tablet computer, a notebook computer, a personal digital assistant, or a wearable device (e.g., a smart bracelet, a smart watch, a smart helmet, smart glasses), etc. It will be understood by those skilled in the art that the configuration shown in fig. 14 is only a schematic diagram of a part of the configuration related to the present application, and does not constitute a limitation to the computer device 1000 to which the present application is applied, and a specific computer device 1000 may include more or less components than those shown in the figure, or combine some components, or have a different arrangement of components.
Referring to fig. 15, the computer device 1000 according to the embodiment of the present disclosure includes an Image Processing circuit 800, and the Image Processing circuit 800 may be implemented by hardware and/or software components and may include various Processing units defining an ISP (Image Signal Processing) pipeline. FIG. 15 is a diagram of an image processing circuit 800 in one embodiment. As shown in fig. 15, for convenience of explanation, only aspects of the image processing technique related to the embodiment of the present application are shown.
As shown in fig. 15, image processing circuit 800 includes an ISP processor 810(ISP processor 810 may be processor 520 or part of processor 520) and control logic 820. Image data captured by camera 830 is first processed by ISP processor 810, and ISP processor 810 analyzes the image data to capture image statistics that may be used to determine one or more control parameters for camera 830. The camera 830 may include one or more lenses 832 and an image sensor 834. Image sensor 834 may comprise an array of color filters (e.g., Bayer filters), and image sensor 834 may acquire light intensity and wavelength information captured by each imaging pixel and provide a set of raw image data that may be processed by ISP processor 810. The sensor 840 (e.g., a gyroscope) may provide parameters of the acquired image processing (e.g., anti-shake parameters) to the ISP processor 810 based on the type of sensor 840 interface. The sensor 840 interface may be a SMIA (Standard Mobile Imaging Architecture) interface, other serial or parallel camera interface, or a combination of the above.
Further, image sensor 834 may also transmit raw image data to sensor 840, sensor 840 may provide raw image data to ISP processor 810 based on the type of sensor 840 interface, or sensor 840 may store raw image data in image memory 850.
ISP processor 810 processes raw image data pixel by pixel in a variety of formats. For example, each image pixel may have a bit depth of 8, 10, 12, or 14 bits, and ISP processor 810 may perform one or more image processing operations on the raw image data, gathering statistical information about the image data. Wherein the image processing operations may be performed with the same or different bit depth precision.
ISP processor 810 may also receive image data from image memory 850. For example, sensor 840 interface sends raw image data to image memory 850, where the raw image data in image memory 850 is then provided to ISP processor 810 for processing. Image Memory 850 may be Memory 530, a portion of Memory 530, a storage device, or a separate dedicated Memory within an electronic device, and may include a DMA (Direct Memory Access) feature.
ISP processor 810 may perform one or more image processing operations, such as temporal filtering, upon receiving raw image data from image sensor 834 interface or from sensor 840 interface or from image memory 850. The processed image data may be sent to image memory 850 for additional processing before being displayed. ISP processor 810 receives processed data from image memory 850 and performs image data processing on the processed data in the raw domain and in the RGB and YCbCr color spaces. The image data processed by ISP processor 810 may be output to display 870 (display 870 may include display screen 550) for viewing by a user and/or further processed by a Graphics Processing Unit (GPU). Further, the output of ISP processor 810 may also be sent to image memory 850, and display 870 may read image data from image memory 850. In one embodiment, image memory 850 may be configured to implement one or more frame buffers. In addition, the output of the ISP processor 810 may be transmitted to an encoder/decoder 860 for encoding/decoding image data. The encoded image data may be saved and decompressed before being displayed on the display 870 device. The encoder/decoder 860 may be implemented by a CPU or GPU or coprocessor.
The statistics determined by ISP processor 810 may be sent to control logic 820 unit. For example, the statistical data may include image sensor 834 statistics such as auto-exposure, auto-white balance, auto-focus, flicker detection, black level compensation, lens 832 shading correction, and the like. Control logic 820 may include a processing element and/or microcontroller that executes one or more routines (e.g., firmware) that may determine control parameters for camera 830 and control parameters for ISP processor 810 based on the received statistical data. For example, control parameters for camera 830 may include sensor 840 control parameters (e.g., gain, integration time for exposure control, anti-shake parameters, etc.), camera flash control parameters, lens 832 control parameters (e.g., focal length for focusing or zooming), or a combination of these parameters. The ISP control parameters may include gain levels and color correction matrices for automatic white balance and color adjustment (e.g., during RGB processing), as well as lens 832 shading correction parameters.
The following steps are taken to implement the photographing method using the image processing technique of fig. 15:
s112: acquiring continuous multi-frame images, wherein the continuous multi-frame images comprise a current frame preview image;
s114: processing each frame of image to detect a light source of each frame of image;
s116: determining the color of the light source of each frame of image to determine the color temperature of the light source of each frame of image;
s118: determining the equivalent color temperature of the preview image of the current frame according to the color temperature of the light source of the continuous multi-frame image; and
s122: and carrying out white balance processing on the current frame preview image according to the equivalent color temperature.
It will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by a computer program, which can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above embodiments of the methods. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), or the like.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A photographing method characterized by comprising the steps of:
acquiring continuous multi-frame images, wherein the continuous multi-frame images comprise a current frame preview image;
processing each frame of the image to detect a light source for each frame of the image;
determining a color of a light source of each frame of the image to determine a color temperature of the light source of each frame of the image;
determining the equivalent color temperature of the preview image of the current frame according to the color temperature of the light source of the continuous multi-frame image; and
performing white balance processing on the current frame preview image according to the equivalent color temperature;
the step of determining the color of the light source of the image for each frame to determine the color temperature of the light source of the image for each frame comprises the steps of:
determining a highlight area and a middle-bright area surrounding the central area of the light source according to the brightness distribution of the center of the light source outwards in the radial direction, wherein the brightness value of the highlight area is in a first brightness range, and the brightness value of the middle-bright area is in a second brightness range;
subtracting the average primary color channel pixel value of the medium bright area from the average primary color channel pixel value of the high bright area to determine the color of the light source; and
and determining the color temperature of the light source according to the color of the light source.
2. The photographing method according to claim 1, wherein the step of processing the image for each frame to detect a light source of the image for each frame comprises the steps of:
dividing the image into a plurality of regions;
judging whether the region is a target region comprising the light source according to the histogram of each region;
judging whether a plurality of adjacent target areas exist or not;
splicing a plurality of adjacent target areas into the light source when the plurality of adjacent target areas exist; and
determining the target area as the light source when there are no adjacent plurality of the target areas.
3. The photographing method according to claim 1, wherein the step of determining an equivalent color temperature of the preview image of the current frame from the color temperature of the light source of the consecutive multi-frame images comprises the steps of:
and calculating the average value of the color temperatures of the light sources of the continuous multiframe images as the equivalent color temperature.
4. The photographing method according to claim 1, wherein the consecutive multi-frame images include an earlier frame preview image, and the step of determining an equivalent color temperature of a current frame preview image according to a color temperature of a light source of the consecutive multi-frame images includes the steps of:
processing the color temperature of the light source of the current frame preview image by a first weight value to obtain a first color temperature;
processing the color temperature of the light source of the early frame preview image by a second weight to obtain a second color temperature, wherein the first weight is greater than the second weight;
and calculating the equivalent color temperature according to the first color temperature and the second color temperature.
5. A camera, comprising:
the device comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring continuous multi-frame images, and the continuous multi-frame images comprise a current frame preview image;
a first processing module to process each frame of the image to detect a light source for each frame of the image;
a first determination module to determine a color of a light source of the image for each frame to determine a color temperature of the light source of the image for each frame;
the second determining module is used for determining the equivalent color temperature of the current frame preview image according to the color temperature of the light source of the continuous multi-frame image; and
the second processing module is used for carrying out white balance processing on the current frame preview image according to the equivalent color temperature;
the first determining module includes:
a second determination unit configured to determine a highlight region and a middle-bright region around a central region of the light source according to a luminance distribution of a center of the light source radially outward, a luminance value of the highlight region being in a first luminance range, a luminance value of the middle-bright region being in a second luminance range;
a first processing unit for subtracting the primary color channel pixel average value of the medium bright region from the primary color channel pixel average value of the high bright region to determine the color of the light source; and
a third determination unit for determining a color temperature of the light source according to the color of the light source.
6. The camera according to claim 5, wherein the first processing module comprises:
a dividing unit for dividing the image into a plurality of regions;
a first judging unit, configured to judge whether the region is a target region including the light source according to a histogram of each of the regions;
a second determination unit configured to determine whether there are a plurality of adjacent target regions;
a splicing unit for splicing a plurality of adjacent target regions into the light source when the plurality of adjacent target regions exist; and
a first determination unit for determining the target area as the light source when there are no adjacent plural target areas.
7. The camera of claim 5, wherein the second determining module is configured to:
and calculating the average value of the color temperatures of the light sources of the continuous multiframe images as the equivalent color temperature.
8. The camera according to claim 5, wherein said consecutive multi-frame images include an earlier frame preview image, and said second determination module comprises:
the second processing unit is used for processing the color temperature of the light source of the current frame preview image by using a first weight value to obtain a first color temperature;
a third processing unit, configured to process the color temperature of the light source of the earlier frame preview image by a second weight to obtain a second color temperature, where the first weight is greater than the second weight;
and the calculating unit is used for calculating the equivalent color temperature according to the first color temperature and the second color temperature.
9. A non-transitory computer-readable storage medium containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform the photographing method of any one of claims 1 to 4.
10. A computer device comprising a memory and a processor, the memory having stored therein computer-readable instructions that, when executed by the processor, cause the processor to perform the photographing method of any one of claims 1 to 4.
CN201711423781.5A 2017-12-25 2017-12-25 Photographing method and apparatus, computer-readable storage medium, and computer device Active CN108174173B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711423781.5A CN108174173B (en) 2017-12-25 2017-12-25 Photographing method and apparatus, computer-readable storage medium, and computer device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711423781.5A CN108174173B (en) 2017-12-25 2017-12-25 Photographing method and apparatus, computer-readable storage medium, and computer device

Publications (2)

Publication Number Publication Date
CN108174173A CN108174173A (en) 2018-06-15
CN108174173B true CN108174173B (en) 2020-01-10

Family

ID=62520666

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711423781.5A Active CN108174173B (en) 2017-12-25 2017-12-25 Photographing method and apparatus, computer-readable storage medium, and computer device

Country Status (1)

Country Link
CN (1) CN108174173B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109788268A (en) * 2018-12-25 2019-05-21 努比亚技术有限公司 Terminal and its white balance correction control method and computer readable storage medium
CN110267044A (en) * 2019-07-16 2019-09-20 吉林工程技术师范学院 A kind of chroma coder method and system of film scene
CN111163350B (en) * 2019-12-06 2022-03-01 Oppo广东移动通信有限公司 Image processing method, terminal and computer storage medium
CN111107270B (en) * 2019-12-31 2022-01-28 维沃移动通信有限公司 Shooting method and electronic equipment

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102104709B (en) * 2009-12-21 2013-01-30 展讯通信(上海)有限公司 Method for processing image shot by camera and camera
JP6439531B2 (en) * 2015-03-24 2018-12-19 富士ゼロックス株式会社 Color processing apparatus, color processing system, and program
CN105611264B (en) * 2015-12-30 2018-09-14 努比亚技术有限公司 A kind of auto white balance method and device
CN105959661B (en) * 2016-05-06 2019-07-26 联想(北京)有限公司 A kind of color temperature estimation method and electronic equipment
CN106534835B (en) * 2016-11-30 2018-08-07 珠海市魅族科技有限公司 A kind of image processing method and device
CN106851121B (en) * 2017-01-05 2019-07-05 Oppo广东移动通信有限公司 Control method and control device
CN107277480B (en) * 2017-07-10 2019-03-29 Oppo广东移动通信有限公司 White balance synchronous method, device and terminal device
CN107360410A (en) * 2017-07-10 2017-11-17 广东欧珀移动通信有限公司 Method for controlling white balance, device and terminal device

Also Published As

Publication number Publication date
CN108174173A (en) 2018-06-15

Similar Documents

Publication Publication Date Title
CN108683862B (en) Imaging control method, imaging control device, electronic equipment and computer-readable storage medium
CN108322669B (en) Image acquisition method and apparatus, imaging apparatus, and readable storage medium
CN108174173B (en) Photographing method and apparatus, computer-readable storage medium, and computer device
CN107704798B (en) Image blurring method and device, computer readable storage medium and computer device
CN107395991B (en) Image synthesis method, image synthesis device, computer-readable storage medium and computer equipment
CN107481186B (en) Image processing method, image processing device, computer-readable storage medium and computer equipment
US10798358B2 (en) Image processing method and device for accomplishing white balance regulation, computer-readable storage medium and computer device
CN108174172B (en) Image pickup method and device, computer readable storage medium and computer equipment
US20150278996A1 (en) Image processing apparatus, method, and medium for generating color image data
CN107509044B (en) Image synthesis method, image synthesis device, computer-readable storage medium and computer equipment
CN109040607B (en) Imaging control method, imaging control device, electronic device and computer-readable storage medium
CN109685853B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN108063926B (en) Image processing method and device, computer readable storage medium and computer device
CN107563979B (en) Image processing method, image processing device, computer-readable storage medium and computer equipment
CN110213462B (en) Image processing method, image processing device, electronic apparatus, image processing circuit, and storage medium
CN107194901B (en) Image processing method, image processing device, computer equipment and computer readable storage medium
CN108063934B (en) Image processing method and device, computer readable storage medium and computer device
CN108259754B (en) Image processing method and device, computer readable storage medium and computer device
CN108063933B (en) Image processing method and device, computer readable storage medium and computer device
CN107454317B (en) Image processing method, image processing device, computer-readable storage medium and computer equipment
CN107959843B (en) Image processing method and device, computer readable storage medium and computer equipment
CN107464225B (en) Image processing method, image processing device, computer-readable storage medium and mobile terminal
CN110276730B (en) Image processing method and device and electronic equipment
CN108111831B (en) Photographing method, imaging apparatus, computer-readable storage medium, and computer device
JP7455656B2 (en) Image processing device, image processing method, and program

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after: OPPO Guangdong Mobile Communications Co., Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant before: Guangdong Opel Mobile Communications Co., Ltd.

GR01 Patent grant
GR01 Patent grant