[go: up one dir, main page]

CN107948617B - Image processing method, apparatus, computer-readable storage medium, and computer device - Google Patents

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

Info

Publication number
CN107948617B
CN107948617B CN201711277419.1A CN201711277419A CN107948617B CN 107948617 B CN107948617 B CN 107948617B CN 201711277419 A CN201711277419 A CN 201711277419A CN 107948617 B CN107948617 B CN 107948617B
Authority
CN
China
Prior art keywords
image
white balance
processed
target
preview
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
CN201711277419.1A
Other languages
Chinese (zh)
Other versions
CN107948617A (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 CN201711277419.1A priority Critical patent/CN107948617B/en
Publication of CN107948617A publication Critical patent/CN107948617A/en
Application granted granted Critical
Publication of CN107948617B publication Critical patent/CN107948617B/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/10Cameras or camera modules comprising electronic image sensors; Control thereof for generating image signals from different wavelengths
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/62Control of parameters via user interfaces
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Processing Of Color Television Signals (AREA)
  • Color Television Image Signal Generators (AREA)

Abstract

本申请涉及一种图像处理方法、装置、计算机可读存储介质和计算机设备。上述方法,包括:获取多帧预览图像,所述预览图像是计算机设备启动拍摄类应用程序后获取的;若接收到拍摄指令,根据所述拍摄指令确定待处理图像;若所述待处理图像中不存在参考色彩,将所述待处理图像与所述多帧预览图像分别进行匹配,获取与所述待处理图像具有重叠区域的所述预览图像,从所述与所述待处理图像具有重叠区域的所述预览图像中获取目标图像;对所述目标图像进行白平衡处理,获取目标白平衡增益值;根据所述目标白平衡增益值对所述待处理图像进行白平衡处理。上述方法,提高了对待处理图像进行白平衡处理的准确性,使得对图像的色彩还原更精确。

Figure 201711277419

The present application relates to an image processing method, apparatus, computer-readable storage medium, and computer equipment. The above method includes: acquiring multiple frames of preview images, the preview images are acquired after a computer device starts a shooting application; if a shooting instruction is received, determining the image to be processed according to the shooting instruction; if the image to be processed is in the image to be processed There is no reference color, the to-be-processed image and the multi-frame preview images are respectively matched, and the preview image having an overlapping area with the to-be-processed image is obtained, and the overlapping area with the to-be-processed image is obtained from the The target image is obtained from the preview image of the image; the target image is subjected to white balance processing to obtain a target white balance gain value; and the white balance processing is performed on the to-be-processed image according to the target white balance gain value. The above method improves the accuracy of white balance processing on the image to be processed, so that the color restoration of the image is more accurate.

Figure 201711277419

Description

Image processing method, image processing device, computer-readable storage medium and computer equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to an image processing method and apparatus, a computer-readable storage medium, and a computer device.
Background
With the rapid development of intelligent computer equipment, the shooting technology of the intelligent computer is more and more complete. For the shot and acquired images, the intelligent computer equipment can perform various image processing operations. For example, white balance processing, beauty processing, and the like are performed on an image. The white balance processing of the image is to adjust colors in the image, so that the image can accurately reflect the color condition of the object.
Disclosure of Invention
The embodiment of the application provides an image processing method, an image processing device, a computer readable storage medium and computer equipment, which can perform white balance processing on an image.
An image processing method comprising:
acquiring a plurality of frames of preview images, wherein the preview images are acquired after a shooting application program is started by computer equipment;
if a shooting instruction is received, determining an image to be processed according to the shooting instruction;
if no reference color exists in the image to be processed, matching the image to be processed with the multi-frame preview image respectively to obtain the preview image with an overlapping area with the image to be processed, and obtaining a target image from the preview image with the overlapping area with the image to be processed;
performing white balance processing on the target image to obtain a target white balance gain value;
and carrying out white balance processing on the image to be processed according to the target white balance gain value.
An image processing apparatus comprising:
the device comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring a plurality of frames of preview images, and the preview images are acquired after the computer equipment starts a shooting application program;
the shooting module is used for determining an image to be processed according to a shooting instruction if the shooting instruction is received;
the matching module is used for respectively matching the image to be processed with the multi-frame preview image if no reference color exists in the image to be processed, acquiring the preview image with an overlapping area with the image to be processed, and acquiring a target image from the preview image with the overlapping area with the image to be processed;
the processing module is used for carrying out white balance processing on the target image to obtain a target white balance gain value; and carrying out white balance processing on the image to be processed according to the target white balance gain value.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method as set forth above.
A computer device comprising a memory and a processor, the memory having stored therein computer readable instructions which, when executed by the processor, cause the processor to perform a method as described above.
In the embodiment of the application, when the white balance processing is not accurately directly performed on the image to be processed, the preview image with the overlapping area with the image to be processed is obtained, and then the white balance processing is performed on the image to be processed according to the white balance processing parameters of the preview image, so that the accuracy of the white balance processing on the image to be processed is improved, and the color restoration of the image is more accurate.
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 flow diagram of a method of image processing in one embodiment;
FIG. 2 is a diagram of a preview image having an overlap area with a to-be-processed image in one embodiment;
FIG. 3 is a diagram illustrating a preview image and a to-be-processed image combined into a complete image according to an embodiment;
FIG. 4 is a flowchart of an image processing method in another embodiment;
FIG. 5 is a flowchart of an image processing method in another embodiment;
FIG. 6 is a block diagram showing the configuration of an image processing apparatus according to an embodiment;
FIG. 7 is a block diagram showing the construction of an image processing apparatus according to another embodiment;
FIG. 8 is a block diagram showing the construction of an image processing apparatus according to another embodiment;
FIG. 9 is a schematic diagram of an image processing circuit in one embodiment.
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.
FIG. 1 is a flow diagram of a method of image processing in one embodiment. As shown in fig. 1, an image processing method includes:
step 102, acquiring a plurality of frames of preview images, wherein the preview images are acquired after the computer equipment starts a shooting application program.
After the shooting application program is started, the computer equipment can capture the current scene through the camera and image the current scene on the display interface of the computer equipment, namely, the preview image is displayed on the display interface of the computer equipment. A computer device may acquire multiple frames of preview images. Taking a computer device as a mobile terminal as an example, the preview image may be an image obtained by a front camera of the mobile terminal, or an image obtained by a rear camera of the mobile terminal.
And step 104, determining the image to be processed according to the shooting instruction if the shooting instruction is received.
After receiving the shooting instruction, the computer device can take the preview image displayed on the display interface of the computer device at the moment of receiving the shooting instruction as the image to be processed. After the computer device obtains the image to be processed, the image to be processed may be subjected to image processing, such as performing a beautifying process on the image to be processed, performing a white balance process on the image to be processed, and the like.
And 106, if the reference color does not exist in the image to be processed, respectively matching the image to be processed with the multi-frame preview image, acquiring a preview image with an overlapping region with the image to be processed, and acquiring a target image from the preview image with the overlapping region with the image to be processed.
When the computer device performs white balance processing on the image to be processed by adopting a white balance algorithm, whether a reference color exists in the image to be processed can be detected firstly. The reference color is a color having a color difference value with a standard color within a preset range, that is, a color close to the standard color. In general, the standard color may be set to white, and the reference color is a color close to white. In one embodiment, the standard color may also be set to other colors, such as skin tone.
If the reference color exists in the image to be processed, the white balance processing can be carried out on the image to be processed according to the reference color. Each pixel point in the image to be processed is formed by a plurality of color channels, for example, three channels of RGB (three colors of red, green, and blue), or three channels of HSV (hue, saturation, and lightness), or three channels of CMY (three colors of cyan, magenta, or magenta and yellow). The white balance algorithm for the image may include: a gray world algorithm, a perfect reflection algorithm, a white point method, etc. Taking the white point method as an example, the white balance processing of the image to be processed in the RGB three channels may include: taking the standard color as white as an example, if R/G is 1.0 and B/G is 1.0 in a pixel point corresponding to white in an RGB three-color channel, the color range of the reference color close to white is {0.8< R/G <1.2, 0.8< B/G <1.2}, and if the computer device detects that the pixel point in the image to be processed satisfies {0.8< R/G <1.2, 0.8< B/G <1.2}, the pixel point is taken as the reference color point. The R/G _ average and the B/G _ average, namely the average of R/G and the average of B/G in the pixel, can be obtained by averaging the pixel color points in the image to be processed. And multiplying the R channel of each pixel point in the image to be processed by R/G _ average and multiplying the B channel by B/G _ average to finish the white balance processing of the image to be processed.
And if the reference color does not exist in the image to be processed, and the white balance processing directly performed on the image to be processed is inaccurate, respectively matching the acquired image to be processed with the multi-frame preview image, and detecting whether the image to be processed and the preview image have an overlapping area. The computer equipment can respectively extract the characteristic points in the image to be processed and the preview image and then carry out image registration according to the characteristic points. If the image to be processed and the preview image have an overlapping area, the target image can be obtained from the preview image having the overlapping area with the image to be processed.
In one embodiment, acquiring the target image from the preview image having the overlapping area with the image to be processed includes: and if the preview image with the overlapping area with the image to be processed has the reference color, taking the preview image with the overlapping area with the image to be processed and the reference color as the target image.
The computer device can detect whether the reference color exists in the preview image which has the overlapped area with the image to be processed. If the preview image with the overlapping area with the image to be processed has the reference color, the preview image with the overlapping area with the image to be processed is taken as the target image.
According to the method in the embodiment of the application, the computer equipment can select the preview image with the reference color from the preview image with the overlapped area with the image to be processed as the target image, the white balance parameter can be determined according to the reference color in the preview image, the obtained white balance parameter is more accurate, and the white balance processing effect is improved.
And step 108, carrying out white balance processing on the target image to obtain a target white balance gain value.
The computer device can perform white balance processing on the target image to obtain a target white balance gain value. The target white balance gain value is the gain value of the computer device for each color channel in the target image. Taking the RGB three channels as an example, when the standard color is white, the white balance algorithm using the white point as the reference point is the same as the algorithm of the white balance processing of the image to be processed in step 106, where R/G _ average is the gain value of the R channel, and B/G _ average is the gain value of the B channel.
In one embodiment, when a reference color exists in the target image, the target image may be subjected to white balance processing with reference to the reference color point to obtain a target white balance gain value.
And step 110, performing white balance processing on the image to be processed according to the target white balance gain value.
After the target white balance gain value is obtained, the white balance processing can be performed on the image to be processed according to the target white balance gain value. The computer device can perform white balance processing on the image to be processed according to the white balance gain value of each channel in the acquired target white balance gain value.
In general, when a user takes a picture with a computer device (e.g., a mobile terminal), a series of operations such as adjusting a photographing angle, a distance, and focusing are required. That is, before the user takes a picture, the computer device may acquire a plurality of preview images of the current scene, and display the preview images on the display interface of the computer device. And when the computer equipment receives the shooting instruction, shooting the current scene again to acquire the image to be processed. Because the computer device can continuously and uninterruptedly acquire the images between the time of starting the shooting application program and the time of receiving the shooting instruction, the multi-frame preview image acquired by the computer device and the image to be processed are images corresponding to the same scene, most of the multi-frame preview image and the image to be processed have an overlapping area, and the white balance processing parameters can be the same.
As shown in fig. 2, if the image to be processed 204 has an overlapping area with the preview image 202 and the preview image 206, the computer device may perform white balance processing on the preview image 202 and the preview image 206 respectively, obtain a white balance gain value for the preview image 202 and a white balance gain value for the preview image 206, and select one of the white balance gain values for the preview image 202 and the preview image 206 to perform white balance processing on the image to be processed. Selecting one of the white balance gain values for the preview image 202 and the preview image 206 may include obtaining a color difference between a reference color and a standard color in the preview image 202 and the preview image 206, selecting the preview image 206 where the reference color with the smallest color difference is located, and performing white balance processing on the image to be processed according to the white balance gain value of the preview image 206.
According to the method, when the white balance processing is not accurately directly performed on the image to be processed, the preview image with the overlapped area with the image to be processed is obtained, and then the white balance processing is performed on the image to be processed according to the white balance processing parameters of the preview image, so that the accuracy of the white balance processing on the image to be processed is improved, and the color restoration of the image is more accurate.
In one embodiment, the white balance processing on the target image in step 108, and acquiring the target white balance gain value includes: if a plurality of frames of target images exist, respectively obtaining the color difference value between the reference color and the standard color in the plurality of frames of target images; and if the target image with the minimum color difference value exists, performing white balance processing on the target image with the minimum color difference value to obtain a target white balance gain value.
If a plurality of frames of preview images with overlapped areas with the images to be processed, namely a plurality of frames of target images, are obtained by the computer equipment, the reference color in each frame of target image can be respectively obtained, and then the color difference value between the reference color and the standard color is calculated. Wherein, the color difference value can represent the difference between two colors, and in Lab color space, the color difference value can be
Figure BDA0001496862190000061
The computer device may obtain a color difference value of the reference color and the standard color in each frame of the target image. Taking the standard color as white as an example, the color range of the reference color close to white is {0.8< R/G <1.2, 0.8< B/G <1.2}, the computer device can obtain the reference color points of each frame of the target image whose pixel points satisfy the color range of the reference color, calculate the color difference value between the color of each reference color point and white, obtain the target image where the reference color point with the minimum color difference value is located, i.e., select the target image where the reference color point closest to white is located, and perform white balance processing on the target image where the reference color point with the minimum color difference value is located, thereby obtaining the target white balance gain value.
In general, the preview image and the image to be processed are images captured by a computer device in the same scene and the same light source, and the white balance gain value obtained by performing white balance processing on the preview image is also used for performing white balance processing on the image to be processed. According to the method, the reference color with the minimum color difference value with the standard color, namely the reference color closest to the standard color, is selected, so that the white balance gain value obtained by performing white balance processing on the target image is more accurate.
In one embodiment, the white balance processing on the target image in step 108, and acquiring the target white balance gain value includes: if multiple frames of target images exist, respectively carrying out white balance processing on the multiple frames of target images to obtain a first white balance gain value corresponding to each frame of target image; and acquiring the average value of the first white balance gain values as a target white balance gain value.
When a plurality of frames of preview images with overlapped areas with the images to be processed are obtained, namely when a plurality of frames of target images are obtained, the computer equipment can respectively perform white balance processing on each frame of target image, and respectively obtain a first white balance gain value obtained by performing white balance processing on each frame of target image. After the computer device obtains the first white balance gain value of the multi-frame target image, the average value of the first white balance gain value can be obtained as the target white balance gain value. The first white balance gain value may include a white balance gain value for each color channel in the target image.
According to the method in the embodiment of the application, the computer equipment can respectively perform white balance processing on the multi-frame target images, and then perform white balance processing on the images to be processed according to the average value of the white balance processing on the multi-frame target images, so that the target white balance gain value obtained by the computer equipment is more accurate, and the method is favorable for better restoring the real color in the scene.
In one embodiment, after acquiring a preview image having an overlapping area with the image to be processed at step 106, the method further comprises:
(1) and respectively splicing the preview image with the overlapping area with the image to be processed to obtain a complete image.
(2) And carrying out white balance processing on the complete image to obtain a target white balance gain value.
(3) And carrying out white balance processing on the image to be processed according to the target white balance gain value.
After the computer equipment acquires the preview image with the overlapping area with the image to be processed, the preview image with the overlapping area with the image to be processed and the image to be processed can be subjected to image splicing. Wherein, the step of stitching the images comprises: determining the same characteristic points in the two images, and overlapping the same characteristic points in the two images to ensure that the same areas in the two images are overlapped to obtain a complete image. After the computer equipment obtains the complete image, the white balance processing can be carried out on the complete image, and the target white balance gain value is calculated. Wherein, the white balance processing of the complete image by the computer device can comprise: and acquiring a reference color point in the complete image, and calculating a white balance gain value according to the reference color point, wherein a white balance processing algorithm of the computer equipment on the complete image is the same as the algorithm in the step 106, and details are not repeated here. After the computer equipment acquires the white balance gain value for the white balance processing of the complete image, the white balance processing can be carried out on the image to be processed by using the white balance gain value for the white balance processing of the complete image.
As shown in fig. 3, the image to be processed 306 has an overlapping area with the preview image 302, the preview image 304, the preview image 308, and the preview image 310, and then the computer device may perform image stitching on the preview image 302, the preview image 304, the preview image 308, the preview image 310, and the image to be processed 306 to obtain a complete image 312. The computer device may perform white balance processing on the complete image 312 to obtain a white balance gain value, and then perform white balance processing on the image to be processed 306 according to the obtained white balance gain value.
According to the method, the computer equipment can splice the multi-frame preview image and the image to be processed into a complete image, then white balance processing is carried out on the complete image, the white balance gain value is obtained, the computer equipment can carry out white balance processing on the image to be processed according to the white balance gain value of the complete image, the obtained white balance gain value is obtained through the white balance processing on the complete image, and the white balance processing on the image to be processed is more accurate.
In one embodiment, after step 106, further comprising:
and step 112, if no preview image with an overlapped area with the image to be processed exists, acquiring an environmental color temperature value according to the color temperature sensor.
And step 114, determining a second white balance gain value according to the environmental color temperature value.
And step 116, performing white balance processing on the image to be processed according to the second white balance gain value.
If the computer device detects that no preview image with an overlapped area with the image to be processed exists, the computer device can acquire the current environmental color temperature value according to the color temperature sensor. Color temperature is a unit of measure representing the color components contained in light, and light sources of different colors have different color temperatures in an actual image scene. The computer equipment can acquire the current environmental color temperature value through the color temperature sensor. The computer device may pre-store a corresponding relationship between the color temperature and the white balance gain value, after the current environment color temperature value is obtained, the computer device may search for a corresponding white balance gain value according to the current environment color temperature value, and perform white balance processing on the image to be processed according to the searched white balance gain value, that is, the computer device may determine a second white balance gain value according to the current environment color temperature value, and perform white balance processing on the image to be processed according to the second white balance gain value.
According to the method in the embodiment of the application, when other images with overlapping areas with the image to be processed do not exist, the computer equipment can perform white balance processing on the image to be processed according to the color temperature value obtained by the color temperature sensor, namely when no reference color exists in the image to be processed and the preview image cannot provide a white balance gain value for the image to be processed, the white balance processing is performed on the image to be processed according to the obtained color temperature, so that the white balance processing of the image by the computer equipment is more accurate.
In one embodiment, after step 106, further comprising:
and step 118, if no preview image with an overlapping area with the image to be processed exists, detecting whether a stored image with a shooting time interval with the image to be processed within a preset time length exists.
And step 120, if a stored image which has a preset time interval with the shooting time of the image to be processed exists, performing white balance processing on the image to be processed according to the third white balance gain value of the stored image.
If there is no preview image having an overlapping area with the image to be processed in the computer device, it is possible to detect whether there is a stored image having a shooting time interval with the image to be processed within a preset time period in the computer device. The shooting time interval is the time difference between the shooting time of the stored image and the shooting time of the image to be processed. The preset time length can be a value set by computer equipment or a value set by a user. For example 5 minutes, 10 minutes. In the preset time period, it can be assumed that the change of the environmental information is small, that is, the change of the light source angle, the light source color temperature and the like is small, the computer device can acquire the stored image within the preset time period at the shooting time interval, and perform white balance processing on the image to be processed according to the white balance gain value of the stored image, that is, perform white balance processing on the image to be processed according to the third white balance gain value of the stored image. When a plurality of stored images with the shooting time interval between the to-be-processed image and the to-be-processed image within the preset time length exist in the computer equipment, the computer equipment can select the stored image with the shooting time closest to the shooting time of the to-be-processed image, and perform white balance processing on the to-be-processed image according to the white balance gain value of the stored image with the shooting time closest to the shooting time of the to-be-processed image.
According to the method, the white balance gain value of the stored image is selected to process the image to be processed, the problem that the image effect of directly performing white balance processing on the image to be processed is poor when no reference color point exists in the image to be processed can be solved, and the effect of performing white balance processing on the image to be processed is improved.
FIG. 6 is a block diagram showing an example of the structure of an image processing apparatus. As shown in fig. 6, an image processing apparatus includes:
the obtaining module 602 is configured to obtain a plurality of frames of preview images, where the preview images are obtained after the computer device starts the shooting application.
The shooting module 604 is configured to determine, if a shooting instruction is received, an image to be processed according to the shooting instruction.
The matching module 606 is configured to match the image to be processed with the multiple frames of preview images, respectively, if the reference color does not exist in the image to be processed, obtain a preview image having an overlapping region with the image to be processed, and obtain a target image from the preview image having an overlapping region with the image to be processed.
The processing module 608 is configured to perform white balance processing on the target image to obtain a target white balance gain value. And carrying out white balance processing on the image to be processed according to the target white balance gain value.
In one embodiment, the matching module 606 acquires the target image from the preview image having the overlapping region with the image to be processed includes: and if the preview image with the overlapping area with the image to be processed has the reference color, taking the preview image with the overlapping area with the image to be processed and the reference color as the target image.
In one embodiment, the reference color refers to a color difference value from a standard color and a color within a preset range. The processing module 608 performs white balance processing on the target image, and acquiring a target white balance gain value includes: and if the multi-frame target image exists, respectively obtaining the color difference value between the reference color and the standard color in the multi-frame target image. And if the target image with the minimum color difference value exists, performing white balance processing on the target image with the minimum color difference value to obtain a target white balance gain value.
In one embodiment, the processing module 608 performs white balance processing on the target image, and obtaining the target white balance gain value includes: and if multiple frames of target images exist, respectively carrying out white balance processing on the multiple frames of target images to obtain a first white balance gain value corresponding to each frame of target image. And acquiring the average value of the first white balance gain values as a target white balance gain value.
In an embodiment, the matching module 606 is further configured to, after acquiring the preview image having an overlapping area with the image to be processed, respectively stitch the preview image having an overlapping area with the image to be processed to obtain a complete image. The processing module 608 is configured to perform white balance processing on the complete image to obtain a target white balance gain value. And carrying out white balance processing on the image to be processed according to the target white balance gain value.
Fig. 7 is a block diagram showing the configuration of an image processing apparatus according to another embodiment. As shown in fig. 7, an image processing apparatus includes: an acquisition module 702, a shooting module 704, a matching module 706, a processing module 708, and a color temperature acquisition module 710. The acquiring module 702, the shooting module 704, the matching module 706 and the processing module 708 have the same functions as the corresponding modules in fig. 6.
And a color temperature obtaining module 710, configured to obtain an ambient color temperature value according to a color temperature sensor if there is no preview image having an overlapping region with the image to be processed.
And a processing module 708 configured to determine a second white balance gain value according to the ambient color temperature value. And performing white balance processing on the image to be processed according to the second white balance gain value.
Fig. 8 is a block diagram showing the configuration of an image processing apparatus according to another embodiment. As shown in fig. 8, an image processing apparatus includes: the device comprises an acquisition module 802, a shooting module 804, a matching module 806, a processing module 808 and a detection module 810. The acquiring module 802, the shooting module 804, the matching module 806, and the processing module 808 have the same functions as those of the corresponding modules in fig. 6.
The detecting module 810 is configured to detect whether there is a stored image within a preset time interval from a shooting time of the image to be processed if there is no preview image having an overlapping area with the image to be processed.
And the processing module 808 is configured to, if there is a stored image which is within a preset time period from the shooting time interval of the image to be processed, perform white balance processing on the image to be processed according to the third white balance gain value of the stored image.
The division of the modules in the image processing apparatus is only for illustration, and in other embodiments, the image processing apparatus may be divided into different modules as needed to complete all or part of the functions of the image processing apparatus.
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:
(1) acquiring a plurality of frames of preview images, wherein the preview images are acquired after the computer equipment starts a shooting application program.
(2) And if the shooting instruction is received, determining the image to be processed according to the shooting instruction.
(3) And if the reference color does not exist in the image to be processed, respectively matching the image to be processed with the multi-frame preview image, acquiring the preview image with an overlapping region with the image to be processed, and acquiring the target image from the preview image with the overlapping region with the image to be processed.
(4) And carrying out white balance processing on the target image to obtain a target white balance gain value.
(5) And carrying out white balance processing on the image to be processed according to the target white balance gain value.
In one embodiment, acquiring the target image from the preview image having the overlapping area with the image to be processed includes: and if the preview image with the overlapping area with the image to be processed has the reference color, taking the preview image with the overlapping area with the image to be processed and the reference color as the target image.
In one embodiment, the reference color refers to a color difference value from a standard color and a color within a preset range. Performing white balance processing on the target image, and acquiring a target white balance gain value comprises: and if the multi-frame target image exists, respectively obtaining the color difference value between the reference color and the standard color in the multi-frame target image. And if the target image with the minimum color difference value exists, performing white balance processing on the target image with the minimum color difference value to obtain a target white balance gain value.
In one embodiment, the white balance processing on the target image, and the obtaining the target white balance gain value includes: and if multiple frames of target images exist, respectively carrying out white balance processing on the multiple frames of target images to obtain a first white balance gain value corresponding to each frame of target image. And acquiring the average value of the first white balance gain values as a target white balance gain value.
In one embodiment, after the preview image having the overlapping area with the image to be processed is acquired, further performing: and respectively splicing the preview image with the overlapping area with the image to be processed to obtain a complete image. And carrying out white balance processing on the complete image to obtain a target white balance gain value. And carrying out white balance processing on the image to be processed according to the target white balance gain value.
In one embodiment, further performing: and if the preview image with the overlapped area with the image to be processed does not exist, acquiring an environmental color temperature value according to the color temperature sensor. And determining a second white balance gain value according to the environment color temperature value. And performing white balance processing on the image to be processed according to the second white balance gain value.
In one embodiment, further performing: and if the preview image with the overlapped area with the image to be processed does not exist, detecting whether a stored image with the shooting time interval of the image to be processed within a preset time length exists or not. And if the stored image with the shooting time interval of the image to be processed within the preset time length exists, performing white balance processing on the image to be processed according to the third white balance gain value of the stored image.
A computer program product containing instructions which, when run on a computer, cause the computer to perform the steps of:
(1) acquiring a plurality of frames of preview images, wherein the preview images are acquired after the computer equipment starts a shooting application program.
(2) And if the shooting instruction is received, determining the image to be processed according to the shooting instruction.
(3) And if the reference color does not exist in the image to be processed, respectively matching the image to be processed with the multi-frame preview image, acquiring the preview image with an overlapping region with the image to be processed, and acquiring the target image from the preview image with the overlapping region with the image to be processed.
(4) And carrying out white balance processing on the target image to obtain a target white balance gain value.
(5) And carrying out white balance processing on the image to be processed according to the target white balance gain value.
In one embodiment, acquiring the target image from the preview image having the overlapping area with the image to be processed includes: and if the preview image with the overlapping area with the image to be processed has the reference color, taking the preview image with the overlapping area with the image to be processed and the reference color as the target image.
In one embodiment, the reference color refers to a color difference value from a standard color and a color within a preset range. Performing white balance processing on the target image, and acquiring a target white balance gain value comprises: and if the multi-frame target image exists, respectively obtaining the color difference value between the reference color and the standard color in the multi-frame target image. And if the target image with the minimum color difference value exists, performing white balance processing on the target image with the minimum color difference value to obtain a target white balance gain value.
In one embodiment, the white balance processing on the target image, and the obtaining the target white balance gain value includes: and if multiple frames of target images exist, respectively carrying out white balance processing on the multiple frames of target images to obtain a first white balance gain value corresponding to each frame of target image. And acquiring the average value of the first white balance gain values as a target white balance gain value.
In one embodiment, after the preview image having the overlapping area with the image to be processed is acquired, further performing: and respectively splicing the preview image with the overlapping area with the image to be processed to obtain a complete image. And carrying out white balance processing on the complete image to obtain a target white balance gain value. And carrying out white balance processing on the image to be processed according to the target white balance gain value.
In one embodiment, further performing: and if the preview image with the overlapped area with the image to be processed does not exist, acquiring an environmental color temperature value according to the color temperature sensor. And determining a second white balance gain value according to the environment color temperature value. And performing white balance processing on the image to be processed according to the second white balance gain value.
In one embodiment, further performing: and if the preview image with the overlapped area with the image to be processed does not exist, detecting whether a stored image with the shooting time interval of the image to be processed within a preset time length exists or not. And if the stored image with the shooting time interval of the image to be processed within the preset time length exists, performing white balance processing on the image to be processed according to the third white balance gain value of the stored image.
The embodiment of the application also provides computer equipment. The computer apparatus includes therein an Image Processing circuit, which may be implemented using hardware and/or software components, and may include various Processing units defining an ISP (Image Signal Processing) pipeline. FIG. 9 is a schematic diagram of an image processing circuit in one embodiment. As shown in fig. 9, for convenience of explanation, only aspects of the image processing technique related to the embodiments of the present application are shown.
As shown in fig. 9, the image processing circuit includes an ISP processor 940 and a control logic 950. The image data captured by the imaging device 910 is first processed by the ISP processor 940, and the ISP processor 940 analyzes the image data to capture image statistics that may be used to determine and/or control one or more parameters of the imaging device 910. The imaging device 910 may include a camera having one or more lenses 912 and an image sensor 914. Image sensor 914 may include an array of color filters (e.g., Bayer filters), and image sensor 914 may acquire light intensity and wavelength information captured with each imaging pixel of image sensor 914 and provide a set of raw image data that may be processed by ISP processor 940. The sensor 920 (e.g., a gyroscope) may provide parameters of the acquired image processing (e.g., anti-shake parameters) to the ISP processor 940 based on the type of interface of the sensor 920. The sensor 920 interface may utilize an SMIA (Standard Mobile Imaging Architecture) interface, other serial or parallel camera interfaces, or a combination of the above.
In addition, image sensor 914 may also send raw image data to sensor 920, sensor 920 may provide raw image data to ISP processor 940 based on the type of interface of sensor 920, or sensor 920 may store raw image data in image memory 930.
The ISP processor 940 processes the 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 the ISP processor 940 may perform one or more image processing operations on the raw image data, collecting statistical information about the image data. Wherein the image processing operations may be performed with the same or different bit depth precision.
ISP processor 940 may also receive image data from image memory 930. For example, the sensor 920 interface sends raw image data to the image memory 930, and the raw image data in the image memory 930 is then provided to the ISP processor 940 for processing. The image Memory 930 may be a part of a Memory device, a storage device, or a separate dedicated Memory within an electronic device, and may include a DMA (Direct Memory Access) feature.
Upon receiving raw image data from image sensor 914 interface or from sensor 920 interface or from image memory 930, ISP processor 940 may perform one or more image processing operations, such as temporal filtering. The processed image data may be sent to image memory 930 for additional processing before being displayed. ISP processor 940 receives the processed data from image memory 930 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 940 may be output to display 970 for viewing by a user and/or further processed by a Graphics Processing Unit (GPU). Further, the output of ISP processor 940 may also be sent to image memory 930 and display 970 may read image data from image memory 930. In one embodiment, image memory 930 may be configured to implement one or more frame buffers. In addition, the output of the ISP processor 940 may be transmitted to an encoder/decoder 960 for encoding/decoding the image data. The encoded image data may be saved and decompressed before being displayed on a display 970 device. The encoder/decoder 960 may be implemented by a CPU or GPU or coprocessor.
The statistical data determined by the ISP processor 940 may be transmitted to the control logic 950 unit. For example, the statistical data may include image sensor 914 statistics such as auto-exposure, auto-white balance, auto-focus, flicker detection, black level compensation, lens 912 shading correction, and the like. The control logic 950 may include a processor and/or microcontroller that executes one or more routines (e.g., firmware) that may determine control parameters of the imaging device 910 and control parameters of the ISP processor 940 based on the received statistical data. For example, the control parameters of imaging device 910 may include sensor 920 control parameters (e.g., gain, integration time for exposure control, anti-shake parameters, etc.), camera flash control parameters, lens 912 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 912 shading correction parameters.
The following steps are performed to implement the image processing method using the image processing technique in fig. 9:
(1) acquiring a plurality of frames of preview images, wherein the preview images are acquired after the computer equipment starts a shooting application program.
(2) And if the shooting instruction is received, determining the image to be processed according to the shooting instruction.
(3) And if the reference color does not exist in the image to be processed, respectively matching the image to be processed with the multi-frame preview image, acquiring the preview image with an overlapping region with the image to be processed, and acquiring the target image from the preview image with the overlapping region with the image to be processed.
(4) And carrying out white balance processing on the target image to obtain a target white balance gain value.
(5) And carrying out white balance processing on the image to be processed according to the target white balance gain value.
In one embodiment, acquiring the target image from the preview image having the overlapping area with the image to be processed includes: and if the preview image with the overlapping area with the image to be processed has the reference color, taking the preview image with the overlapping area with the image to be processed and the reference color as the target image.
In one embodiment, the reference color refers to a color difference value from a standard color and a color within a preset range. Performing white balance processing on the target image, and acquiring a target white balance gain value comprises: and if the multi-frame target image exists, respectively obtaining the color difference value between the reference color and the standard color in the multi-frame target image. And if the target image with the minimum color difference value exists, performing white balance processing on the target image with the minimum color difference value to obtain a target white balance gain value.
In one embodiment, the white balance processing on the target image, and the obtaining the target white balance gain value includes: and if multiple frames of target images exist, respectively carrying out white balance processing on the multiple frames of target images to obtain a first white balance gain value corresponding to each frame of target image. And acquiring the average value of the first white balance gain values as a target white balance gain value.
In one embodiment, after the preview image having the overlapping area with the image to be processed is acquired, further performing: and respectively splicing the preview image with the overlapping area with the image to be processed to obtain a complete image. And carrying out white balance processing on the complete image to obtain a target white balance gain value. And carrying out white balance processing on the image to be processed according to the target white balance gain value.
In one embodiment, further performing: and if the preview image with the overlapped area with the image to be processed does not exist, acquiring an environmental color temperature value according to the color temperature sensor. And determining a second white balance gain value according to the environment color temperature value. And performing white balance processing on the image to be processed according to the second white balance gain value.
In one embodiment, further performing: and if the preview image with the overlapped area with the image to be processed does not exist, detecting whether a stored image with the shooting time interval of the image to be processed within a preset time length exists or not. And if the stored image with the shooting time interval of the image to be processed within the preset time length exists, performing white balance processing on the image to be processed according to the third white balance gain value of the stored image.
Any reference to memory, storage, database, or other medium used herein may include non-volatile and/or volatile memory. Suitable non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and bus dynamic RAM (RDRAM).
The above examples 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. An image processing method, comprising:
acquiring a plurality of frames of preview images, wherein the preview images are acquired after a shooting application program is started by computer equipment;
if a shooting instruction is received, determining an image to be processed according to the shooting instruction;
if no reference color exists in the image to be processed, matching the image to be processed with the plurality of frames of preview images respectively to obtain the preview image with an overlapping area with the image to be processed, and if the reference color exists in the preview image with the overlapping area with the image to be processed, taking the preview image with the overlapping area with the image to be processed, in which the reference color exists, as a target image;
performing white balance processing on the target image to obtain a target white balance gain value;
performing white balance processing on the image to be processed according to the target white balance gain value;
the preview image is an image of a current scene acquired by the computer equipment before a shooting instruction is received; the preview image and the image to be processed are images shot and obtained in the same scene;
after the obtaining of the preview image having an overlapping area with the image to be processed, further comprising:
respectively carrying out image splicing on the preview image which has an overlapping area with the image to be processed and the image to be processed to obtain a complete image;
performing white balance processing on the complete image to obtain the target white balance gain value;
and carrying out white balance processing on the image to be processed according to the target white balance gain value.
2. The method of claim 1, wherein:
the reference color refers to a color difference value between the reference color and a standard color and a color within a preset range;
performing white balance processing on the target image, and acquiring a target white balance gain value comprises:
if a plurality of frames of the target images exist, respectively obtaining color difference values of the reference colors and the standard colors in the plurality of frames of the target images; and if the target image with the minimum color difference value exists, performing white balance processing on the target image with the minimum color difference value to obtain the target white balance gain value.
3. The method of claim 1, wherein the step of image stitching comprises:
determining the same characteristic points in the two images, and overlapping the same characteristic points in the two images to ensure that the same areas in the two images are overlapped to obtain a complete image.
4. The method of any of claims 1-2, further comprising:
if the preview image with the overlapping area with the image to be processed does not exist, acquiring an environmental color temperature value according to a color temperature sensor;
determining a second white balance gain value according to the environment color temperature value;
and carrying out white balance processing on the image to be processed according to the second white balance gain value.
5. The method of any of claims 1-2, further comprising:
if the preview image with the overlapping area with the image to be processed does not exist, detecting whether a stored image with the shooting time interval of the image to be processed within a preset time length exists or not;
and if the stored image with the shooting time interval of the image to be processed within the preset time length exists, carrying out white balance processing on the image to be processed according to the third white balance gain value of the stored image.
6. An image processing apparatus characterized by comprising:
the device comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring a plurality of frames of preview images, and the preview images are acquired after the computer equipment starts a shooting application program;
the shooting module is used for determining an image to be processed according to a shooting instruction if the shooting instruction is received;
the matching module is used for respectively matching the image to be processed with the multi-frame preview image if no reference color exists in the image to be processed, acquiring the preview image with an overlapping area with the image to be processed, and taking the preview image with the overlapping area with the image to be processed, which has the reference color, as a target image if the reference color exists in the preview image with the overlapping area with the image to be processed;
the processing module is used for carrying out white balance processing on the target image to obtain a target white balance gain value; performing white balance processing on the image to be processed according to the target white balance gain value;
the preview image is an image of a current scene acquired by the computer equipment before a shooting instruction is received; the preview image and the image to be processed are images shot and obtained in the same scene;
the matching module is also used for splicing the preview image with the overlapping area with the image to be processed respectively after the preview image with the overlapping area with the image to be processed is obtained, so as to obtain a complete image;
the processing module is further used for carrying out white balance processing on the complete image to obtain a target white balance gain value; and carrying out white balance processing on the image to be processed according to the target white balance gain value.
7. The apparatus of claim 6,
the device further comprises: the color temperature acquisition module is used for acquiring an environment color temperature value according to a color temperature sensor if the preview image which has an overlapping area with the image to be processed does not exist;
the processing module is further used for determining a second white balance gain value according to the environment color temperature value; and carrying out white balance processing on the image to be processed according to the second white balance gain value.
8. The apparatus of claim 6,
the device further comprises: the detection module is used for detecting whether a stored image with the shooting time interval of the image to be processed within a preset time length exists or not if the preview image with the overlapping area with the image to be processed does not exist;
and the processing module is also used for carrying out white balance processing on the image to be processed according to the third white balance gain value of the stored image if the stored image with the shooting time interval of the image to be processed within the preset time length exists.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1 to 5.
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 method of any of claims 1 to 5.
CN201711277419.1A 2017-12-06 2017-12-06 Image processing method, apparatus, computer-readable storage medium, and computer device Active CN107948617B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711277419.1A CN107948617B (en) 2017-12-06 2017-12-06 Image processing method, apparatus, computer-readable storage medium, and computer device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711277419.1A CN107948617B (en) 2017-12-06 2017-12-06 Image processing method, apparatus, computer-readable storage medium, and computer device

Publications (2)

Publication Number Publication Date
CN107948617A CN107948617A (en) 2018-04-20
CN107948617B true CN107948617B (en) 2021-03-02

Family

ID=61945952

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711277419.1A Active CN107948617B (en) 2017-12-06 2017-12-06 Image processing method, apparatus, computer-readable storage medium, and computer device

Country Status (1)

Country Link
CN (1) CN107948617B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108769521B (en) * 2018-06-05 2021-02-02 Oppo广东移动通信有限公司 Photographing method, mobile terminal and computer readable storage medium
WO2020019134A1 (en) * 2018-07-23 2020-01-30 太平洋未来科技(深圳)有限公司 Illumination information optimization method and apparatus, and electronic device
CN108833870A (en) * 2018-09-20 2018-11-16 陕西土豆数据科技有限公司 A kind of white balance algorithm based on oblique photograph camera
CN111107270B (en) * 2019-12-31 2022-01-28 维沃移动通信有限公司 Shooting method and electronic equipment
CN111429536B (en) * 2020-03-13 2023-12-19 深圳市雄帝科技股份有限公司 Method, system and storage medium for toning skin color in image
CN113177886B (en) * 2021-04-14 2023-05-05 RealMe重庆移动通信有限公司 Image processing method, device, computer equipment and readable storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5259291B2 (en) * 2008-07-30 2013-08-07 オリンパス株式会社 White balance correction device and signal processing program
JP2011055170A (en) * 2009-08-31 2011-03-17 Canon Inc Information processing apparatus and control method therefor
CN103402102B (en) * 2013-07-17 2015-12-09 广东欧珀移动通信有限公司 The method and apparatus of dual camera camera system and white balance adjusting thereof
CN105227945B (en) * 2015-10-21 2017-05-17 维沃移动通信有限公司 Automatic white balance control method and mobile terminal

Also Published As

Publication number Publication date
CN107948617A (en) 2018-04-20

Similar Documents

Publication Publication Date Title
CN107948617B (en) Image processing method, apparatus, computer-readable storage medium, and computer device
US10997696B2 (en) Image processing method, apparatus and device
CN109712192B (en) Camera module calibration method and device, electronic equipment and computer readable storage medium
CN108198152B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN108063891B (en) Image processing method, image processing device, computer-readable storage medium and computer equipment
CN110213494B (en) Photographing method and device, electronic equipment and computer readable storage medium
CN107862658B (en) Image processing method, apparatus, computer-readable storage medium and electronic device
CN107800965B (en) Image processing method, image processing device, computer-readable storage medium and computer equipment
CN109685853B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN109360254B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN109712177B (en) Image processing method, apparatus, electronic device, and computer-readable storage medium
CN112004029B (en) Exposure processing method, exposure processing device, electronic apparatus, and computer-readable storage medium
CN109559353B (en) Camera module calibration method, device, electronic device, and computer-readable storage medium
CN107911625A (en) Light measuring method, light measuring device, readable storage medium and computer equipment
CN107578372B (en) Image processing method, apparatus, computer-readable storage medium and electronic device
US11218650B2 (en) Image processing method, electronic device, and computer-readable storage medium
CN107959841B (en) Image processing method, image processing apparatus, storage medium, and electronic device
CN110121031A (en) Image acquisition method and device, electronic equipment and computer readable storage medium
CN107920205B (en) Image processing method, image processing apparatus, storage medium, and electronic device
CN107635124A (en) White balance processing method, device and equipment for face shooting
CN107948618A (en) Image processing method, image processing device, computer-readable storage medium and computer equipment
CN107948619B (en) Image processing method, apparatus, computer-readable storage medium, and mobile terminal
CN107770447B (en) Image processing method, apparatus, computer-readable storage medium and electronic device
CN108012133B (en) Image processing method, apparatus, computer-readable storage medium, and computer device
CN109120846B (en) Image processing method and device, electronic equipment and computer readable storage medium

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

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

Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

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

Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant