[go: up one dir, main page]

CN107071274B - Distortion processing method and terminal - Google Patents

Distortion processing method and terminal Download PDF

Info

Publication number
CN107071274B
CN107071274B CN201710144925.7A CN201710144925A CN107071274B CN 107071274 B CN107071274 B CN 107071274B CN 201710144925 A CN201710144925 A CN 201710144925A CN 107071274 B CN107071274 B CN 107071274B
Authority
CN
China
Prior art keywords
image
white balance
target image
terminal
camera
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.)
Expired - Fee Related
Application number
CN201710144925.7A
Other languages
Chinese (zh)
Other versions
CN107071274A (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.)
Shaanxi Wender Cloud Computing Co ltd
Original Assignee
Qihe Technology Nanjing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qihe Technology Nanjing Co Ltd filed Critical Qihe Technology Nanjing Co Ltd
Priority to CN201710144925.7A priority Critical patent/CN107071274B/en
Publication of CN107071274A publication Critical patent/CN107071274A/en
Application granted granted Critical
Publication of CN107071274B publication Critical patent/CN107071274B/en
Expired - Fee Related 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/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
    • 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
    • H04N23/13Cameras or camera modules comprising electronic image sensors; Control thereof for generating image signals from different wavelengths with multiple sensors
    • 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
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
    • H04N5/265Mixing

Landscapes

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

Abstract

本发明实施例公开了一种失真处理方法及终端,该方法包括:控制第一摄像头和第二摄像头同时对拍摄目标进行拍摄,分别生成第一目标图像和第二目标图像;利用白平衡技术对所述第一目标图像进行白平衡处理,生成所述第一目标图像对应的第一白平衡图像;获取所述第二目标图像中的失真区域;利用所述白平衡技术对所述失真区域进行白平衡处理,生成所述第二目标图像对应的第二白平衡图像;对所述第一白平衡图像和所述第二白平衡图像进行图像融合处理,生成第三目标图像。该方法能够较好地解决经过白平衡处理后的图像,其局部仍有失真的问题。

Figure 201710144925

Embodiments of the present invention disclose a distortion processing method and a terminal. The method includes: controlling a first camera and a second camera to shoot a shooting target at the same time, and generating a first target image and a second target image respectively; using white balance technology to The first target image is subjected to white balance processing to generate a first white balance image corresponding to the first target image; a distortion area in the second target image is obtained; and the distortion area is processed using the white balance technology. White balance processing: generate a second white balance image corresponding to the second target image; perform image fusion processing on the first white balance image and the second white balance image to generate a third target image. This method can better solve the problem that the image after white balance processing still has local distortion.

Figure 201710144925

Description

一种失真处理方法及终端Distortion processing method and terminal

技术领域technical field

本发明涉及图像处理领域,尤其涉及一种失真处理方法及终端。The present invention relates to the field of image processing, in particular to a distortion processing method and terminal.

背景技术Background technique

许多人在使用摄像机时都会遇到这样的问题:在日光灯的房间内拍摄的图像会发绿,在钨丝灯光的房间内拍摄的图像会偏黄,而在日光阴影处拍摄的图像则会偏蓝。其原因在于摄像机没有记忆性和适应性,它显示的图像的颜色会随着照射光线色温的不同而发生变化,一张白纸在不同的光线下,有时偏蓝,有时偏红或是偏黄。基于此,白平衡技术应运而生,该技术能够让白色所成的像依然是白色,其基本工作原理是:摄像机内部有三个电子耦合元件(CCD,Charge-coupled Device),即CCD图像传感器,它们分别感受蓝色、绿色、红色的光线,在预置情况下这三个感光电路电子放大比例是相同的,为1:1:1的关系,白平衡的调整就是根据被调校的景物改变了这种比例关系。比如被调校景物的蓝、绿、红色光的比例关系是2:1:1(蓝光比例多,色温偏高),那么白平衡调整后的比例关系为1:2:2,调整后的电路放大比例中明显蓝的比例减少,增加了绿和红的比例,这样被调校景物通过白平衡调整电路到所拍摄的影像,蓝、绿、红的比例才会相同。也就是说如果被调校的白色偏一点蓝,那么白平衡调整就改变正常的比例关系减弱蓝电路的放大,同时增加绿和红的比例,使所成影像依然为白色。Many people have this problem when using a camera: images taken in a room with fluorescent lighting will appear greenish, images taken in a room with tungsten lighting will appear yellowish, and images taken in sunlight shaded areas will appear yellowish. blue. The reason is that the camera has no memory and adaptability. The color of the image it displays will change with the color temperature of the irradiated light. A piece of white paper is sometimes blue, sometimes red or yellow under different light. . Based on this, the white balance technology came into being, which can make the white image still white. They sense blue, green, and red light respectively. Under the preset condition, the electronic amplification ratio of these three photosensitive circuits is the same, which is a relationship of 1:1:1. The adjustment of white balance is to change according to the adjusted scene. this proportional relationship. For example, the ratio of blue, green, and red light of the scene to be adjusted is 2:1:1 (the ratio of blue light is high, and the color temperature is high), then the ratio of the adjusted white balance is 1:2:2, and the adjusted circuit In the magnification ratio, the proportion of obvious blue is reduced, and the proportion of green and red is increased, so that the adjusted scene passes through the white balance adjustment circuit to the captured image, and the proportion of blue, green and red will be the same. That is to say, if the adjusted white is a little blue, then the white balance adjustment will change the normal proportional relationship to weaken the magnification of the blue circuit, and at the same time increase the ratio of green and red, so that the resulting image is still white.

通常情况下,被拍摄的原始图像的失真程度受光源、色温、焦距等多种因素的影响,即使对原始图像进行了白平衡处理,但是经过白平衡处理后的图像的某些区域仍然存在较为严重的失真现象。Under normal circumstances, the degree of distortion of the original image captured is affected by various factors such as light source, color temperature, focal length, etc. Even if the original image is subjected to white balance processing, some areas of the image after white balance processing still exist relatively severe distortion.

发明内容SUMMARY OF THE INVENTION

本发明的主要目的在于提出一种失真处理方法及终端,旨在利用终端的双摄像头特点解决上述经白平衡处理后的图像的某些区域仍然存在失真的问题。The main purpose of the present invention is to propose a distortion processing method and a terminal, aiming at solving the above-mentioned problem of distortion in some areas of an image after white balance processing by utilizing the dual-camera feature of the terminal.

为达到上述目的,本发明的技术方案是这样实现的:In order to achieve the above object, the technical scheme of the present invention is achieved in this way:

第一方面,本发明实施例提供了一种失真处理方法,该方法包括:In a first aspect, an embodiment of the present invention provides a distortion processing method, which includes:

控制第一摄像头和第二摄像头同时对拍摄目标进行拍摄,分别生成第一目标图像和第二目标图像;Controlling the first camera and the second camera to shoot the shooting target at the same time to generate the first target image and the second target image respectively;

利用白平衡技术对所述第一目标图像进行白平衡处理,生成所述第一目标图像对应的第一白平衡图像;Perform white balance processing on the first target image by using a white balance technology to generate a first white balance image corresponding to the first target image;

获取所述第二目标图像中的失真区域;obtaining a distorted area in the second target image;

利用所述白平衡技术对所述失真区域进行白平衡处理,生成所述第二目标图像对应的第二白平衡图像;Use the white balance technology to perform white balance processing on the distortion area to generate a second white balance image corresponding to the second target image;

对所述第一白平衡图像和所述第二白平衡图像进行图像融合处理,生成第三目标图像。Perform image fusion processing on the first white balance image and the second white balance image to generate a third target image.

在上述方案中,所述第一摄像头和第二摄像头设置于终端同一个侧面的同一水平线上,并且所述第一摄像头和第二摄像头之间的距离小于预设的距离阈值。In the above solution, the first camera and the second camera are arranged on the same horizontal line on the same side of the terminal, and the distance between the first camera and the second camera is less than a preset distance threshold.

在上述方案中,所述获取所述第二目标图像中的失真区域,包括:In the above solution, the acquiring the distorted area in the second target image includes:

遍历所述第二目标图像中的所有像素单元,当所述像素单元对应的像素值落入预设的像素值范围内时,将所述像素单元标记为近白单元;Traverse all pixel units in the second target image, and mark the pixel unit as a near-white unit when the pixel value corresponding to the pixel unit falls within a preset pixel value range;

按照预设的图像划分规则对所述第二目标图像进行划分,得到N个图像子区域;Divide the second target image according to a preset image division rule to obtain N image sub-regions;

计算每个所述图像子区域中所包含的近白单元数目,并将包含所述近白单元数目最多的图像子区域作为所述第二目标图像中的失真区域。Calculate the number of near-white cells included in each of the image sub-regions, and use the image sub-region containing the largest number of near-white cells as the distortion region in the second target image.

在上述方案中,所述获取所述第二目标图像中的失真区域,包括:In the above solution, the acquiring the distorted area in the second target image includes:

接收针对终端显示屏上任意位置的触控操作,获取所述触控操作在所述终端显示屏的位置信息;Receive a touch operation for any position on the terminal display screen, and obtain position information of the touch operation on the terminal display screen;

以所述触控操作在所述终端显示屏的位置信息为中心,确定在所述终端显示屏上的失真区域。Taking the position information of the touch operation on the terminal display screen as the center, the distortion area on the terminal display screen is determined.

在上述方案中,所述以所述触控操作在所述终端显示屏的位置信息为中心,确定在所述终端显示屏上的失真区域,具体包括:In the above solution, determining the distortion area on the terminal display screen based on the position information of the touch operation on the terminal display screen, specifically includes:

获取预设的半径参数值;Get the preset radius parameter value;

以所述触控操作在所述终端显示屏的位置信息为中心,以所述半径参数值为半径,确定在所述终端显示屏上的失真区域。Taking the position information of the touch operation on the terminal display screen as the center, and using the radius parameter value as the radius, the distortion area on the terminal display screen is determined.

第二方面,本发明实施例提供了一种终端,所述终端包括:拍摄模块、第一处理模块、获取模块、第二处理模块和第三处理模块;其中,In a second aspect, an embodiment of the present invention provides a terminal, where the terminal includes: a photographing module, a first processing module, an acquisition module, a second processing module, and a third processing module; wherein,

所述拍摄模块,用于控制第一摄像头和第二摄像头同时对拍摄目标进行拍摄,分别生成第一目标图像和第二目标图像;The shooting module is used to control the first camera and the second camera to simultaneously shoot the shooting target, and generate the first target image and the second target image respectively;

所述第一处理模块,用于利用白平衡技术对所述第一目标图像进行白平衡处理,生成所述第一目标图像对应的第一白平衡图像;The first processing module is configured to perform white balance processing on the first target image by using a white balance technology to generate a first white balance image corresponding to the first target image;

所述获取模块,用于获取所述第二目标图像中的失真区域;the acquiring module, configured to acquire the distorted region in the second target image;

所述第二处理模块,用于利用所述白平衡技术对所述失真区域进行白平衡处理,生成所述第二目标图像对应的第二白平衡图像;The second processing module is configured to perform white balance processing on the distortion area by using the white balance technology, and generate a second white balance image corresponding to the second target image;

所述第三处理模块,用于对所述第一白平衡图像和所述第二白平衡图像进行图像融合处理,生成第三目标图像。The third processing module is configured to perform image fusion processing on the first white balance image and the second white balance image to generate a third target image.

在上述方案中,所述第一摄像头和第二摄像头设置于终端同一个侧面的同一水平线上,并且所述第一摄像头和第二摄像头之间的距离小于预设的距离阈值。In the above solution, the first camera and the second camera are arranged on the same horizontal line on the same side of the terminal, and the distance between the first camera and the second camera is less than a preset distance threshold.

在上述方案中,所述获取模块,具体用于:In the above solution, the acquisition module is specifically used for:

遍历所述第二目标图像中的所有像素单元,当所述像素单元对应的像素值落入预设的像素值范围内时,将所述像素单元标记为近白单元;Traverse all pixel units in the second target image, and mark the pixel unit as a near-white unit when the pixel value corresponding to the pixel unit falls within a preset pixel value range;

按照预设的图像划分规则对所述第二目标图像进行划分,得到N个图像子区域;Divide the second target image according to a preset image division rule to obtain N image sub-regions;

计算每个所述图像子区域中所包含的近白单元数目,并将包含所述近白单元数目最多的图像子区域作为所述第二目标图像中的失真区域。Calculate the number of near-white cells included in each of the image sub-regions, and use the image sub-region containing the largest number of near-white cells as the distortion region in the second target image.

在上述方案中,所述获取模块,具体用于:In the above solution, the acquisition module is specifically used for:

接收针对终端显示屏上任意位置的触控操作,获取所述触控操作在所述终端显示屏的位置信息;Receive a touch operation for any position on the terminal display screen, and obtain position information of the touch operation on the terminal display screen;

以所述触控操作在所述终端显示屏的位置信息为中心,确定在所述终端显示屏上的失真区域。Taking the position information of the touch operation on the terminal display screen as the center, the distortion area on the terminal display screen is determined.

在上述方案中,所述获取模块,具体用于:In the above solution, the acquisition module is specifically used for:

获取预设的半径参数值;Get the preset radius parameter value;

以所述触控操作在所述终端显示屏的位置信息为中心,以所述半径参数值为半径,确定在所述终端显示屏上的失真区域。Taking the position information of the touch operation on the terminal display screen as the center, and using the radius parameter value as the radius, the distortion area on the terminal display screen is determined.

本发明实施例所提供的一种失真处理方法及终端,该方法主要将第一摄像头拍摄的第一目标图像进行整体地白平衡处理(即全局性地白平衡处理);同时对第二摄像头拍摄的第二目标图像中失真较为严重的区域进行白平衡处理(即局部性地白平衡处理),并将两者白平衡处理后的图像进行融合,如此,解决了整体白平衡处理后某些区域仍然存在严重失真的问题。In a distortion processing method and terminal provided by the embodiments of the present invention, the method mainly performs overall white balance processing (ie, global white balance processing) on a first target image captured by a first camera; In the second target image, the more severely distorted areas are subjected to white balance processing (that is, local white balance processing), and the two white balance processed images are fused. In this way, some areas after the overall white balance processing are solved. There is still the problem of severe distortion.

附图说明Description of drawings

图1为本发明实施例提供的一种移动终端的硬件结构示意图;1 is a schematic diagram of a hardware structure of a mobile terminal according to an embodiment of the present invention;

图2为本发明实施例提供的一种失真处理方法示意图;2 is a schematic diagram of a distortion processing method provided by an embodiment of the present invention;

图3为本发明实施例提供的一种失真处理方法的优选实施过程示意图;3 is a schematic diagram of a preferred implementation process of a distortion processing method provided by an embodiment of the present invention;

图4为本发明实施例提供的一种第二目标图像的界面显示图;FIG. 4 is an interface display diagram of a second target image provided by an embodiment of the present invention;

图5为本发明实施例提供的另一种第二目标图像的界面显示图;5 is an interface display diagram of another second target image provided by an embodiment of the present invention;

图6为本发明实施例提供的一种终端结构示意图。FIG. 6 is a schematic structural diagram of a terminal according to an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.

现在将参考附图1来描述实现本发明各个实施例的移动终端。在后续的描述中,使用用于表示元件的诸如“模块”、“部件”或“单元”的后缀仅为了有利于本发明的说明,其本身并没有特定的意义。因此,"模块"与"部件"可以混合地使用。A mobile terminal implementing various embodiments of the present invention will now be described with reference to FIG. 1 . In the following description, suffixes such as 'module', 'component' or 'unit' used to represent elements are used only to facilitate the description of the present invention, and have no specific meaning per se. Therefore, "module" and "part" can be mixed.

移动终端可以以各种形式来实施。例如,本发明中描述的终端可以包括诸如移动电话、智能电话、笔记本电脑、数字广播接收器、个人数字助理(PDA)、平板电脑(PAD)、便携式多媒体播放器(PMP)、导航装置等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。下面,假设终端是移动终端。然而,本领域技术人员将理解的是,除了特别用于移动目的的元件之外,根据本发明的实施方式的构造也能够应用于固定类型的终端。The mobile terminal may be implemented in various forms. For example, the terminals described in the present invention may include, for example, mobile phones, smart phones, notebook computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (PADs), portable multimedia players (PMPs), navigation devices, etc. mobile terminals as well as stationary terminals such as digital TVs, desktop computers, etc. Below, it is assumed that the terminal is a mobile terminal. However, those skilled in the art will understand that the configuration according to the embodiments of the present invention can also be applied to stationary type terminals, in addition to elements especially for mobile purposes.

图1为实现本发明各个实施例的移动终端的硬件结构示意。FIG. 1 is a schematic diagram of a hardware structure of a mobile terminal implementing various embodiments of the present invention.

移动终端100可以包括无线通信单元110、音频/视频(A/V)输入单元120、用户输入单元130、输出单元150、存储器160、接口单元170、控制器180和电源单元190等等。图1示出了具有各种组件的移动终端,但是应理解的是,并不要求实施所有示出的组件,可以替代地实施更多或更少的组件,将在下面详细描述移动终端的元件。The mobile terminal 100 may include a wireless communication unit 110, an audio/video (A/V) input unit 120, a user input unit 130, an output unit 150, a memory 160, an interface unit 170, a controller 180, a power supply unit 190, and the like. FIG. 1 shows a mobile terminal with various components, but it should be understood that implementation of all of the illustrated components is not required, and more or fewer components may alternatively be implemented, and the elements of the mobile terminal will be described in detail below. .

无线通信单元110通常包括一个或多个组件,其允许移动终端100与无线通信系统或网络之间的无线电通信。例如,无线通信单元可以包括移动通信模块112和无线互联网模块113中的至少一个。The wireless communication unit 110 typically includes one or more components that allow radio communication between the mobile terminal 100 and a wireless communication system or network. For example, the wireless communication unit may include at least one of the mobile communication module 112 and the wireless Internet module 113 .

移动通信模块112将无线电信号发送到基站(例如,接入点、节点B等等)、外部终端以及服务器中的至少一个和/或从其接收无线电信号。这样的无线电信号可以包括语音通话信号、视频通话信号、或者根据文本和/或多媒体消息发送和/或接收的各种类型的数据。The mobile communication module 112 transmits and/or receives radio signals to and/or from at least one of a base station (eg, an access point, a Node B, etc.), an external terminal, and a server. Such radio signals may include voice call signals, video call signals, or various types of data sent and/or received in accordance with text and/or multimedia messages.

无线互联网模块113支持移动终端的无线互联网接入。该模块可以内部或外部地耦接到终端。该模块所涉及的无线互联网接入技术可以包括WLAN(无线LAN)(Wi-Fi)、Wibro(无线宽带)、Wimax(全球微波互联接入)、HSDPA(高速下行链路分组接入)等等。The wireless Internet module 113 supports wireless Internet access of the mobile terminal. The module can be internally or externally coupled to the terminal. The wireless Internet access technologies involved in this module may include WLAN (Wireless LAN) (Wi-Fi), Wibro (Wireless Broadband), Wimax (World Interoperability for Microwave Access), HSDPA (High Speed Downlink Packet Access), etc. .

A/V输入单元120用于接收音频或视频信号。A/V输入单元120可以包括相机121,相机121对在视频捕获模式或图像捕获模式中由图像捕获装置获得的静态图片或视频的图像数据进行处理。处理后的图像帧可以显示在显示单元151上。经相机121处理后的图像帧可以存储在存储器160(或其它存储介质)中或者经由无线通信单元110进行发送,可以根据移动终端的构造提供两个或更多相机121。The A/V input unit 120 is used to receive audio or video signals. The A/V input unit 120 may include a camera 121 that processes image data of still pictures or videos obtained by an image capture device in a video capture mode or an image capture mode. The processed image frame may be displayed on the display unit 151 . The image frames processed by the camera 121 may be stored in the memory 160 (or other storage medium) or transmitted via the wireless communication unit 110, and two or more cameras 121 may be provided according to the configuration of the mobile terminal.

用户输入单元130可以根据用户输入的命令生成键输入数据以控制移动终端的各种操作。用户输入单元130允许用户输入各种类型的信息,并且可以包括键盘、锅仔片、触摸板(例如,检测由于被接触而导致的电阻、压力、电容等等的变化的触敏组件)、滚轮、摇杆等等。特别地,当触摸板以层的形式叠加在显示单元151上时,可以形成触摸屏。The user input unit 130 may generate key input data to control various operations of the mobile terminal according to commands input by the user. User input unit 130 allows a user to input various types of information, and may include a keyboard, dome, touch pad (eg, a touch-sensitive component that detects changes in resistance, pressure, capacitance, etc. due to being touched), scroll wheel , joystick, etc. In particular, when the touch panel is superimposed on the display unit 151 in the form of a layer, a touch screen may be formed.

接口单元170用作至少一个外部装置与移动终端100连接可以通过的接口。例如,外部装置可以包括有线或无线头戴式耳机端口、外部电源(或电池充电器)端口、有线或无线数据端口、存储卡端口、用于连接具有识别模块的装置的端口、音频输入/输出(I/O)端口、视频I/O端口、耳机端口等等。识别模块可以是存储用于验证用户使用移动终端100的各种信息并且可以包括用户识别模块(UIM)、客户识别模块(SIM)、通用客户识别模块(USIM)等等。另外,具有识别模块的装置(下面称为"识别装置")可以采取智能卡的形式,因此,识别装置可以经由端口或其它连接装置与移动终端100连接。接口单元170可以用于接收来自外部装置的输入(例如,数据信息、电力等等)并且将接收到的输入传输到移动终端100内的一个或多个元件或者可以用于在移动终端和外部装置之间传输数据。The interface unit 170 serves as an interface through which at least one external device can be connected to the mobile terminal 100 . For example, external devices may include wired or wireless headset ports, external power (or battery charger) ports, wired or wireless data ports, memory card ports, ports for connecting devices with identification modules, audio input/output (I/O) ports, video I/O ports, headphone ports, and more. The identification module may store various information for authenticating the user using the mobile terminal 100 and may include a user identification module (UIM), a customer identification module (SIM), a universal customer identification module (USIM), and the like. In addition, a device having an identification module (hereinafter referred to as an "identification device") may take the form of a smart card, and thus, the identification device may be connected to the mobile terminal 100 via a port or other connection means. The interface unit 170 may be used to receive input (eg, data information, power, etc.) from an external device and transmit the received input to one or more elements within the mobile terminal 100 or may be used between the mobile terminal and the external device transfer data between.

另外,当移动终端100与外部底座连接时,接口单元170可以用作允许通过其将电力从底座提供到移动终端100的路径或者可以用作允许从底座输入的各种命令信号通过其传输到移动终端的路径。从底座输入的各种命令信号或电力可以用作用于识别移动终端是否准确地安装在底座上的信号。输出单元150被构造为以视觉、音频和/或触觉方式提供输出信号(例如,音频信号、视频信号、警报信号、振动信号等等)。输出单元150可以包括显示单元151、音频输出模块152等等。In addition, when the mobile terminal 100 is connected to an external base, the interface unit 170 may function as a path through which power is allowed to be supplied from the base to the mobile terminal 100 or may function as a path through which various command signals input from the base are transmitted to the mobile terminal 100 The path to the terminal. Various command signals or power input from the base may be used as a signal for identifying whether the mobile terminal is accurately mounted on the base. The output unit 150 is configured to provide output signals (eg, audio signals, video signals, alarm signals, vibration signals, etc.) in a visual, audio and/or tactile manner. The output unit 150 may include a display unit 151, an audio output module 152, and the like.

显示单元151可以显示在移动终端100中处理的信息。例如,当移动终端100处于电话通话模式时,显示单元151可以显示与通话或其它通信(例如,文本消息收发、多媒体文件下载等等)相关的用户界面(UI)或图形用户界面(GUI)。当移动终端100处于视频通话模式或者图像捕获模式时,显示单元151可以显示捕获的图像和/或接收的图像、示出视频或图像以及相关功能的UI或GUI等等。The display unit 151 may display information processed in the mobile terminal 100 . For example, when the mobile terminal 100 is in a phone call mode, the display unit 151 may display a user interface (UI) or a graphical user interface (GUI) related to a call or other communication (eg, text messaging, multimedia file download, etc.). When the mobile terminal 100 is in a video call mode or an image capture mode, the display unit 151 may display a captured image and/or a received image, a UI or GUI showing the video or image and related functions, and the like.

同时,当显示单元151和触摸板以层的形式彼此叠加以形成触摸屏时,显示单元151可以用作输入装置和输出装置。显示单元151可以包括液晶显示器(LCD)、薄膜晶体管LCD(TFT-LCD)、有机发光二极管(OLED)显示器、柔性显示器、三维(3D)显示器等等中的至少一种。这些显示器中的一些可以被构造为透明状以允许用户从外部观看,这可以称为透明显示器,典型的透明显示器可以例如为TOLED(透明有机发光二极管)显示器等等。根据特定想要的实施方式,移动终端100可以包括两个或更多显示单元(或其它显示装置),例如,移动终端可以包括外部显示单元(未示出)和内部显示单元(未示出)。触摸屏可用于检测触摸输入压力以及触摸输入位置和触摸输入面积。Meanwhile, when the display unit 151 and the touch panel are superimposed on each other in the form of layers to form a touch screen, the display unit 151 may function as an input device and an output device. The display unit 151 may include at least one of a liquid crystal display (LCD), a thin film transistor LCD (TFT-LCD), an organic light emitting diode (OLED) display, a flexible display, a three-dimensional (3D) display, and the like. Some of these displays may be constructed to be transparent to allow users to view from the outside, which may be referred to as transparent displays, a typical transparent display may be, for example, a TOLED (Transparent Organic Light Emitting Diode) display or the like. Depending on the particular desired implementation, the mobile terminal 100 may include two or more display units (or other display devices), eg, the mobile terminal may include an external display unit (not shown) and an internal display unit (not shown) . The touch screen can be used to detect touch input pressure as well as touch input position and touch input area.

音频输出模块152可以在移动终端处于呼叫信号接收模式、通话模式、记录模式、语音识别模式、广播接收模式等等模式下时,将无线通信单元110接收的或者在存储器160中存储的音频数据转换音频信号并且输出为声音。而且,音频输出模块152可以提供与移动终端100执行的特定功能相关的音频输出(例如,呼叫信号接收声音、消息接收声音等等)。音频输出模块152可以包括扬声器、蜂鸣器等等。The audio output module 152 can convert the audio data received by the wireless communication unit 110 or stored in the memory 160 when the mobile terminal is in a call signal receiving mode, a talking mode, a recording mode, a voice recognition mode, a broadcast receiving mode, etc. audio signal and output as sound. Also, the audio output module 152 may provide audio output related to a specific function performed by the mobile terminal 100 (eg, call signal reception sound, message reception sound, etc.). The audio output module 152 may include a speaker, a buzzer, and the like.

存储器160可以存储由控制器180执行的处理和控制操作的软件程序等等,或者可以暂时地存储已经输出或将要输出的数据(例如,电话簿、消息、静态图像、视频等等)。而且,存储器160可以存储关于当触摸施加到触摸屏时输出的各种方式的振动和音频信号的数据。The memory 160 may store software programs and the like for processing and control operations performed by the controller 180, or may temporarily store data (eg, phonebooks, messages, still images, videos, etc.) that have been output or will be output. Also, the memory 160 may store data on various manners of vibration and audio signals output when a touch is applied to the touch screen.

存储器160可以包括至少一种类型的存储介质,所述存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等等。而且,移动终端100可以与通过网络连接执行存储器160的存储功能的网络存储装置协作。The memory 160 may include at least one type of storage medium including flash memory, hard disk, multimedia card, card-type memory (eg, SD or DX memory, etc.), random access memory (RAM), static random access memory ( SRAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), programmable read only memory (PROM), magnetic memory, magnetic disks, optical disks, and the like. Also, the mobile terminal 100 may cooperate with a network storage device that performs the storage function of the memory 160 through a network connection.

控制器180通常控制移动终端的总体操作。例如,控制器180执行与语音通话、数据通信、视频通话等等相关的控制和处理。另外,控制器180可以包括用于再现(或回放)多媒体数据的多媒体模块181,多媒体模块181可以构造在控制器180内,或者可以构造为与控制器180分离。控制器180可以执行模式识别处理,以将在触摸屏上执行的手写输入或者图片绘制输入识别为字符或图像。The controller 180 generally controls the overall operation of the mobile terminal. For example, the controller 180 performs control and processing related to voice calls, data communications, video calls, and the like. In addition, the controller 180 may include a multimedia module 181 for reproducing (or playing back) multimedia data, and the multimedia module 181 may be constructed within the controller 180 or may be constructed separately from the controller 180 . The controller 180 may perform pattern recognition processing to recognize handwriting input or picture drawing input performed on the touch screen as characters or images.

电源单元190在控制器180的控制下接收外部电力或内部电力并且提供操作各元件和组件所需的适当的电力。The power supply unit 190 receives external power or internal power under the control of the controller 180 and provides appropriate power required to operate various elements and components.

这里描述的各种实施方式可以以使用例如计算机软件、硬件或其任何组合的计算机可读介质来实施。对于硬件实施,这里描述的实施方式可以通过使用特定用途集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理装置(DSPD)、可编程逻辑装置(PLD)、现场可编程门阵列(FPGA)、处理器、控制器、微控制器、微处理器、被设计为执行这里描述的功能的电子单元中的至少一种来实施,在一些情况下,这样的实施方式可以在控制器180中实施。对于软件实施,诸如过程或功能的实施方式可以与允许执行至少一种功能或操作的单独的软件模块来实施。软件代码可以由以任何适当的编程语言编写的软件应用程序(或程序)来实施,软件代码可以存储在存储器160中并且由控制器180执行。The various embodiments described herein can be implemented in computer-readable media using, for example, computer software, hardware, or any combination thereof. For hardware implementation, the embodiments described herein can be implemented using application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays ( FPGA), processors, controllers, microcontrollers, microprocessors, electronic units designed to perform the functions described herein are implemented, in some cases such implementations may be implemented in the controller 180 implemented in. For software implementation, embodiments such as procedures or functions may be implemented with separate software modules that allow the performance of at least one function or operation. The software codes may be implemented by a software application (or program) written in any suitable programming language, which may be stored in memory 160 and executed by controller 180 .

至此,已经按照其功能描述了移动终端。下面,为了简要起见,将描述诸如折叠型、直板型、摆动型、滑动型移动终端等等的各种类型的移动终端中的滑动型移动终端作为示例。因此,本发明能够应用于任何类型的移动终端,并且不限于滑动型移动终端。So far, the mobile terminal has been described in terms of its functions. Hereinafter, for the sake of brevity, a slide-type mobile terminal among various types of mobile terminals such as a folder-type, bar-type, swing-type, slide-type mobile terminal and the like will be described as an example. Therefore, the present invention can be applied to any type of mobile terminal, and is not limited to a slide-type mobile terminal.

如图1中所示的移动终端100可以被构造为利用经由帧或分组发送数据的诸如有线和无线通信系统以及基于卫星的通信系统来操作。The mobile terminal 100 as shown in FIG. 1 may be configured to operate using, for example, wired and wireless communication systems and satellite-based communication systems that transmit data via frames or packets.

基于上述移动终端硬件结构,提出本发明方法各个实施例。Based on the above-mentioned hardware structure of the mobile terminal, various embodiments of the method of the present invention are proposed.

实施例一Example 1

如图2所示,该图给出了本发明实施例提供的一种失真处理方法,从图中可以看出,该方法可以包括:As shown in FIG. 2, the figure shows a distortion processing method provided by an embodiment of the present invention. As can be seen from the figure, the method may include:

S210、控制第一摄像头和第二摄像头同时对拍摄目标进行拍摄,分别生成第一目标图像和第二目标图像;S210, control the first camera and the second camera to simultaneously shoot the shooting target, and generate the first target image and the second target image respectively;

这里,需要说明的是,所述第一摄像头和第二摄像头设置于终端同一个侧面的同一水平线上,并且所述第一摄像头和第二摄像头之间的距离小于预设的距离阈值,其目的是使生成的第一目标图像和第二目标图像所包含的所有图像特征都相同,例如图像尺寸、分辨率、明暗度、色彩等特征均相同。Here, it should be noted that the first camera and the second camera are arranged on the same horizontal line on the same side of the terminal, and the distance between the first camera and the second camera is less than a preset distance threshold, the purpose of which is All the image features included in the generated first target image and the second target image are the same, for example, the image size, resolution, brightness, color and other features are the same.

S220、利用白平衡技术对所述第一目标图像进行白平衡处理,生成所述第一目标图像对应的第一白平衡图像;S220, performing white balance processing on the first target image by using a white balance technology to generate a first white balance image corresponding to the first target image;

S230、获取所述第二目标图像中的失真区域;S230, obtaining the distortion area in the second target image;

S240、利用所述白平衡技术对所述失真区域进行白平衡处理,生成所述第二目标图像对应的第二白平衡图像;S240, using the white balance technology to perform white balance processing on the distortion area to generate a second white balance image corresponding to the second target image;

由于被拍摄的原始图像的失真程度容易受光源、色温、焦距等多种因素的影响,因此,原始图像中不同区域的失真程度有所不同。所以,可以重点对图像中失真较为严重的区域进行白平衡处理。可以理解地,在处理一张图像时,通常需要考虑图像中所包含的所有图像特征,因此,在进行白平衡处理时,对整张图像进行白平衡处理相比于对图像的局部进行白平衡处理,前者考虑的因素较为复杂,后者由于具有针对性,处理区域的图像特点较为单一,因此后者的处理结果会优于前者,也就是说,局部性(有针对性)的白平衡处理效果比整体性(全局性)的白平衡处理效果较好。Since the distortion degree of the captured original image is easily affected by various factors such as light source, color temperature, focal length, etc., the distortion degree of different areas in the original image is different. Therefore, it is possible to focus on white balance processing on areas with serious distortion in the image. It is understandable that when processing an image, it is usually necessary to consider all the image features contained in the image. Therefore, when performing white balance processing, white balance processing is performed on the entire image rather than white balance on a part of the image. Processing, the former considers more complex factors, the latter is targeted, and the image characteristics of the processing area are relatively simple, so the processing results of the latter will be better than the former, that is, local (targeted) white balance processing The effect is better than the overall (global) white balance processing effect.

S250、对所述第一白平衡图像和所述第二白平衡图像进行图像融合处理,生成第三目标图像。S250. Perform image fusion processing on the first white balance image and the second white balance image to generate a third target image.

可以理解地,图像融合是指综合两个或多个源图像中的有利信息,以期获取对同一场景同一目标的更为精确、全面和可靠的图像描述。该技术充分利用了多个待融合图像中的冗余信息和互补信息,其主要包括像素级图像融合方法、特征级图像融合方法和决策级图像融合方法,对于每种方法的具体实现步骤,由于属于现有技术,所以此处不再赘述。Understandably, image fusion refers to synthesizing favorable information from two or more source images in order to obtain a more accurate, comprehensive and reliable image description of the same scene and the same target. This technology makes full use of redundant information and complementary information in multiple images to be fused. It mainly includes pixel-level image fusion methods, feature-level image fusion methods, and decision-level image fusion methods. For the specific implementation steps of each method, due to It belongs to the prior art, so it is not repeated here.

另外,还需要说明的是,所谓白平衡:指在图像处理的过程中,对原本材质为白色的物体的图像进行色彩还原,去除外部光源色温的影响,使其在照片上也显示白色。也就是说,不管在任何光源下,都能将白色物体还原为白色。常见的白平衡算法有灰色世界法、标准差加权灰度世界算法和全反射算法等;其中,灰色世界法主要根据灰度世界理论,将原始图的RGB均值分别调整到R=G=B即可,不完美的地方就是这个算法对颜色不丰富的图像敏感程度一般,处理起来效果也就不会很理想,局限性很大;标准差加权灰度世界算法,该算法是针对上面算法的改进,它的原理是把图像等分成几块,然后对每块利用统计学进行分析,看里面颜色的丰富程度,颜色多的加权,颜色少的就减少权重,最后求和得到一个均值,根据这个相对精确的数值来进行RGB数值的修正;全反射算法,该算法认为最亮的那个点就是白色,如果不是,就针对偏离白色的数值进行逆向修正。缺点是没有高亮点或者图像色彩复杂,它的修正效果就会比较乏力。由于这些算法都属于现有技术,因此此处对于这些算法的具体实现步骤不再赘述。In addition, it should be noted that the so-called white balance: refers to the process of image processing, the color restoration of the image of the original material is white, and the influence of the color temperature of the external light source is removed, so that it also appears white in the photo. That is to say, no matter under any light source, white objects can be restored to white. Common white balance algorithms include gray world method, standard deviation weighted gray world algorithm and total reflection algorithm, etc. Among them, the gray world method mainly adjusts the RGB mean value of the original image to R=G=B according to the gray world theory. However, the imperfection is that this algorithm is generally less sensitive to images that are not rich in color, so the processing effect will not be very satisfactory, and the limitations are very large; the standard deviation weighted gray world algorithm, this algorithm is an improvement for the above algorithm , its principle is to divide the image into several blocks, and then use statistics to analyze each block to see the richness of the color inside, the weight of the color is more, the weight of the color is reduced, and finally the sum is obtained to get a mean, according to this A relatively accurate value is used to correct the RGB value; the total reflection algorithm, the algorithm thinks that the brightest point is white, and if not, reverse correction is performed for the value deviating from white. The disadvantage is that there is no high point or the color of the image is complex, and its correction effect will be relatively weak. Since these algorithms belong to the prior art, the specific implementation steps of these algorithms will not be repeated here.

示例性地,对于步骤S230,所述获取所述第二目标图像中的失真区域,具体可以包括如下步骤:Exemplarily, for step S230, the acquiring the distortion area in the second target image may specifically include the following steps:

S2301a、遍历所述第二目标图像中的所有像素单元,当所述像素单元对应的像素值落入预设的像素值范围内时,将所述像素单元标记为近白单元;S2301a, traversing all pixel units in the second target image, when the pixel value corresponding to the pixel unit falls within a preset pixel value range, marking the pixel unit as a near-white unit;

S2302a、按照预设的图像划分规则对所述第二目标图像进行划分,得到N个图像子区域;S2302a, dividing the second target image according to a preset image dividing rule to obtain N image sub-regions;

这里,为了减少技术方案实施的复杂性,可以将所述第二目标图像进行均匀、等比例划分。Here, in order to reduce the complexity of implementing the technical solution, the second target image may be divided evenly and in equal proportions.

S2303a、计算每个所述图像子区域中所包含的近白单元数目,并将包含所述近白单元数目最多的图像子区域作为所述第二目标图像中的失真区域。S2303a: Calculate the number of near-white cells included in each of the image sub-regions, and use the image sub-region containing the largest number of near-white cells as the distortion region in the second target image.

为了解决不同色温下引起的白色漂移现象,通常将白色作为调整图像颜色的基色。因此,这里可以预先设定与白色相近的最大像素值和最小像素值,通过扫描所述第二目标图像获取所述第二目标图像中像素值大于或等于所述最小像素值且小于或等于所述最大像素值的像素单元,并将所述第二目标图像中像素值大于或等于所述最小像素值且小于或等于所述最大像素值的像素单元较密集的区域设定为近白区域,即所述第二目标图像中的失真区域。In order to solve the white drift phenomenon caused by different color temperatures, white is usually used as the base color for adjusting the color of the image. Therefore, the maximum pixel value and minimum pixel value similar to white can be preset here, and the pixel value in the second target image obtained by scanning the second target image is greater than or equal to the minimum pixel value and less than or equal to the minimum pixel value. The pixel unit of the maximum pixel value, and the pixel value of the second target image is greater than or equal to the minimum pixel value and is less than or equal to the maximum pixel value. The area where the pixel units are denser is set as a near-white area, That is, the distorted area in the second target image.

对于步骤S230,所述获取所述第二目标图像中的失真区域,还可以通过如下方式实现:For step S230, the obtaining of the distorted region in the second target image may also be implemented in the following manner:

S2301b、接收针对终端显示屏上任意位置的触控操作,获取所述触控操作在所述终端显示屏的位置信息;S2301b. Receive a touch operation for any position on the terminal display screen, and obtain position information of the touch operation on the terminal display screen;

S2302b、以所述触控操作在所述终端显示屏的位置信息为中心,确定在所述终端显示屏上的失真区域。S2302b, taking the position information of the touch operation on the display screen of the terminal as the center, determine the distortion area on the display screen of the terminal.

具体地,对于步骤S2302b,所述以所述触控操作在所述终端显示屏的位置信息为中心,确定在所述终端显示屏上的失真区域,可以包括:获取预设的半径参数值;以所述触控操作在所述终端显示屏的位置信息为中心,以所述半径参数值为半径,确定在所述终端显示屏上的失真区域。Specifically, for step S2302b, the determining the distortion area on the terminal display screen with the position information of the touch operation on the terminal display screen as the center may include: obtaining a preset radius parameter value; Taking the position information of the touch operation on the terminal display screen as the center, and using the radius parameter value as the radius, the distortion area on the terminal display screen is determined.

由于人的大脑对于图像的颜色具有记忆性和适应性,也就是说,用户可以通过眼睛直接辨别出所拍摄的图像颜色是否失真以及所拍摄的图像中哪个区域失真较为严重。基于此,所述失真区域可以由用户自主选择和标定,从而方便终端对失真区域的获取以及后续白平衡的处理。Since the human brain has memory and adaptability to the color of the image, that is to say, the user can directly identify whether the color of the captured image is distorted and which area in the captured image is more distorted through the eyes. Based on this, the distortion area can be independently selected and calibrated by the user, thereby facilitating the terminal to obtain the distortion area and subsequent white balance processing.

本发明实施例提供了一种失真处理方法,该方法主要将第一摄像头拍摄的第一目标图像进行整体的白平衡处理(即全局性地白平衡处理);同时对第二摄像头拍摄的第二目标图像中失真较为严重的区域进行白平衡处理(即局部性地白平衡处理),并将两者白平衡处理后的图像进行融合,如此,解决了整体白平衡处理后某些区域仍然存在严重失真的问题。An embodiment of the present invention provides a distortion processing method. The method mainly performs overall white balance processing (ie, global white balance processing) on a first target image captured by a first camera; The areas with severe distortion in the target image are subjected to white balance processing (that is, local white balance processing), and the two white balance processed images are fused. Distortion problem.

实施例二Embodiment 2

为了方便对上述技术方案的理解,如图3所示,该图以前置具有两个摄像头或者后置具有两个摄像头的终端为例,给出了本发明实施例提供的一种失真处理方法的优选实施过程,从图中可以看出,该过程具体包括如下步骤:In order to facilitate the understanding of the above technical solutions, as shown in FIG. 3 , a terminal with two cameras in the front or two cameras in the rear is taken as an example, and the diagram of a distortion processing method provided by an embodiment of the present invention is given. The preferred implementation process, as can be seen from the figure, specifically includes the following steps:

S310、所述终端控制第一摄像头和第二摄像头同时对拍摄目标进行拍摄,分别生成第一目标图像和第二目标图像;S310, the terminal controls the first camera and the second camera to shoot the shooting target at the same time, so as to generate the first target image and the second target image respectively;

这里,所述第一摄像头和第二摄像头为并排靠近且被设置在所述终端的同一个侧面上的两个摄像头,如终端前置的两个摄像头或者后置的两个摄像头。具体地,所述第一摄像头和第二摄像头可以设置于终端同一个侧面的同一水平线上,并且所述第一摄像头和第二摄像头之间的距离小于预设的距离阈值,其目的是使生成的第一目标图像和第二目标图像所包含的所有图像特征都相同,例如图像尺寸、分辨率、明暗度、色彩等特征均相同。Here, the first camera and the second camera are two cameras that are close side by side and are disposed on the same side of the terminal, such as two cameras at the front of the terminal or two cameras at the back of the terminal. Specifically, the first camera and the second camera may be arranged on the same horizontal line on the same side of the terminal, and the distance between the first camera and the second camera is less than a preset distance threshold, the purpose of which is to make the generated All the image features contained in the first target image and the second target image are the same, for example, the image size, resolution, brightness, color and other features are the same.

S320、所述终端利用白平衡技术对所述第一目标图像进行白平衡处理,生成所述第一目标图像对应的第一白平衡图像;S320. The terminal performs white balance processing on the first target image by using a white balance technology to generate a first white balance image corresponding to the first target image;

S330、所述终端接收针对终端显示屏上任意位置的触控操作,获取所述触控操作在所述终端显示屏的位置信息;S330. The terminal receives a touch operation for any position on the terminal display screen, and obtains position information of the touch operation on the terminal display screen;

S340、所述终端获取预设的半径参数值,并以所述触控操作在所述终端显示屏的位置信息为中心,以所述半径参数值为半径,确定在所述终端显示屏上的失真区域;S340. The terminal acquires a preset radius parameter value, and takes the position information of the touch operation on the terminal display screen as the center, and uses the radius parameter value as the radius to determine the value of the radius parameter on the terminal display screen. Distortion area;

S350、所述终端利用所述白平衡技术对所述失真区域进行白平衡处理,生成所述第二目标图像对应的第二白平衡图像;S350, the terminal uses the white balance technology to perform white balance processing on the distortion area, to generate a second white balance image corresponding to the second target image;

S360、所述终端对所述第一白平衡图像和所述第二白平衡图像进行图像融合处理,生成第三目标图像。S360. The terminal performs image fusion processing on the first white balance image and the second white balance image to generate a third target image.

例如,在充满白炽灯光的房间内,某用户利用后置有双摄像头的手机进行拍照,当用户打开手机中的相机应用后,对准房间内的某拍摄目标后,点击相机应用界面上的拍照键,此时,手机利用后置的双摄像头同时对拍摄目标进行拍摄,并分别生成了两张相同的原始图像,即第一目标图像和第二目标图像;随即,手机利用白平衡技术对所述第一目标图像进行白平衡处理,生成所述第一目标图像对应的第一白平衡图像;同时,如图4所示,手机将拍摄的第二目标图像显示在相机界面,并通过提示信息提示用户标定需要进行白平衡处理的区域,从图中可以看出,此时用户可以通过移动白色圆框标定图像中需要进行白平衡处理的区域,并且还可以通过调节白色圆框的大小来调整标定区域的大小;在用户在第二目标图像上标定需要进行白平衡处理的区域后,如图5所示,白色圆框内的区域为用户标定的需要进行白平衡处理的区域,手机检测用户标定的区域在所述第二目标图像中的位置区,并对该位置区在第二目标图像中对应的区域进行白平衡处理,得到第二白平衡图像;进一步地,手机通过图像融合技术将白平衡处理后得到的第一白平衡图像和第二白平衡图像进行融合,最终生成第三目标图像。For example, in a room full of incandescent lights, a user uses a mobile phone with dual cameras on the back to take a photo. After the user opens the camera application in the mobile phone, points to a shooting target in the room, and clicks on the camera application interface to take a photo key, at this time, the mobile phone uses the rear dual cameras to shoot the target at the same time, and generates two identical original images, namely the first target image and the second target image; then, the mobile phone uses the white balance technology to The first target image is subjected to white balance processing to generate a first white balance image corresponding to the first target image; at the same time, as shown in FIG. Prompt the user to calibrate the area that needs to be white balance processed. As can be seen from the figure, at this time, the user can calibrate the area that needs to be white balance processed by moving the white circle frame, and can also adjust the size of the white circle frame. The size of the calibration area; after the user calibrates the area that needs to be white-balanced on the second target image, as shown in Figure 5, the area in the white circle is the area that the user has calibrated that needs to be white-balanced, and the mobile phone detects the user The location area of the calibrated area in the second target image, and white balance processing is performed on the area corresponding to the location area in the second target image to obtain a second white balance image; further, the mobile phone uses an image fusion technology to The first white balance image and the second white balance image obtained after the white balance processing are fused to finally generate a third target image.

由上述失真处理方法的优选实施过程以及具体实例可知,该方法能够对第一摄像头拍摄的第一目标图像进行整体地白平衡处理的同时,还能够对第二摄像头拍摄的第二目标图像进行失真较为严重的区域进行白平衡处理,最终通过将两者白平衡处理后的图像进行融合处理,得到用户较为满意的照片,如此,解决了整体白平衡处理后某些区域仍然存在失真的问题。It can be seen from the preferred implementation process and specific examples of the above-mentioned distortion processing method that the method can perform overall white balance processing on the first target image captured by the first camera, and can also distort the second target image captured by the second camera. The more serious areas are subjected to white balance processing, and finally, the images that have been processed by the two white balance processing are fused to obtain a photo that is more satisfactory to the user. In this way, the problem of distortion in some areas after the overall white balance processing is solved.

实施例三Embodiment 3

基于前述相同的技术构思,如图6所示,该图给出了本发明实施例提供的一种终端60,从图中可以看出,该终端包括:拍摄模块610、第一处理模块620、获取模块630、第二处理模块640和第三处理模块650;其中,Based on the same technical concept described above, as shown in FIG. 6 , the figure shows a terminal 60 provided by an embodiment of the present invention. It can be seen from the figure that the terminal includes: a shooting module 610, a first processing module 620, an acquisition module 630, a second processing module 640 and a third processing module 650; wherein,

所述拍摄模块610,用于控制第一摄像头和第二摄像头同时对拍摄目标进行拍摄,分别生成第一目标图像和第二目标图像;The shooting module 610 is configured to control the first camera and the second camera to simultaneously shoot the shooting target, and generate the first target image and the second target image respectively;

所述第一处理模块620,用于利用白平衡技术对所述第一目标图像进行白平衡处理,生成所述第一目标图像对应的第一白平衡图像;The first processing module 620 is configured to perform white balance processing on the first target image by using a white balance technology to generate a first white balance image corresponding to the first target image;

所述获取模块630,用于获取所述第二目标图像中的失真区域;The obtaining module 630 is configured to obtain the distorted area in the second target image;

所述第二处理模块640,用于利用所述白平衡技术对所述失真区域进行白平衡处理,生成所述第二目标图像对应的第二白平衡图像;The second processing module 640 is configured to perform white balance processing on the distortion area by using the white balance technology, and generate a second white balance image corresponding to the second target image;

所述第三处理模块650,用于对所述第一白平衡图像和所述第二白平衡图像进行图像融合处理,生成第三目标图像。The third processing module 650 is configured to perform image fusion processing on the first white balance image and the second white balance image to generate a third target image.

在上述方案中,所述第一摄像头和第二摄像头设置于终端同一个侧面的同一水平线上,并且所述第一摄像头和第二摄像头之间的距离小于预设的距离阈值。In the above solution, the first camera and the second camera are arranged on the same horizontal line on the same side of the terminal, and the distance between the first camera and the second camera is less than a preset distance threshold.

在上述方案中,所述获取模块630,具体用于:In the above solution, the obtaining module 630 is specifically used for:

遍历所述第二目标图像中的所有像素单元,当所述像素单元对应的像素值落入预设的像素值范围内时,将所述像素单元标记为近白单元;Traverse all pixel units in the second target image, and mark the pixel unit as a near-white unit when the pixel value corresponding to the pixel unit falls within a preset pixel value range;

按照预设的图像划分规则对所述第二目标图像进行划分,得到N个图像子区域;Divide the second target image according to a preset image division rule to obtain N image sub-regions;

计算每个所述图像子区域中所包含的近白单元数目,并将包含所述近白单元数目最多的图像子区域作为所述第二目标图像中的失真区域。Calculate the number of near-white cells included in each of the image sub-regions, and use the image sub-region containing the largest number of near-white cells as the distortion region in the second target image.

在上述方案中,所述获取模块630,具体用于:In the above solution, the obtaining module 630 is specifically used for:

接收针对终端显示屏上任意位置的触控操作,获取所述触控操作在所述终端显示屏的位置信息;Receive a touch operation for any position on the terminal display screen, and obtain position information of the touch operation on the terminal display screen;

以所述触控操作在所述终端显示屏的位置信息为中心,确定在所述终端显示屏上的失真区域。Taking the position information of the touch operation on the terminal display screen as the center, the distortion area on the terminal display screen is determined.

在上述方案中,所述获取模块630,具体用于:In the above solution, the obtaining module 630 is specifically used for:

获取预设的半径参数值;Get the preset radius parameter value;

以所述触控操作在所述终端显示屏的位置信息为中心,以所述半径参数值为半径,确定在所述终端显示屏上的失真区域。Taking the position information of the touch operation on the terminal display screen as the center, and using the radius parameter value as the radius, the distortion area on the terminal display screen is determined.

需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, herein, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements, It also includes other elements not expressly listed or inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.

上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The above-mentioned serial numbers of the embodiments of the present invention are only for description, and do not represent the advantages or disadvantages of the embodiments.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明各个实施例所描述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform, and of course hardware can also be used, but in many cases the former is better implementation. Based on this understanding, the technical solutions of the present invention can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products are stored in a storage medium (such as ROM/RAM, magnetic disk, CD), including several instructions to make a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in the various embodiments of the present invention.

以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only preferred embodiments of the present invention, and are not intended to limit the scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the description and drawings of the present invention, or directly or indirectly applied in other related technical fields , are similarly included in the scope of patent protection of the present invention.

Claims (8)

1. A distortion handling method, the method comprising:
controlling a first camera and a second camera to shoot a shooting target simultaneously, and respectively generating a first target image and a second target image;
performing white balance processing on the first target image by using a white balance technology to generate a first white balance image corresponding to the first target image;
traversing all pixel units in the second target image, and marking the pixel units as near-white units when pixel values corresponding to the pixel units fall into a preset pixel value range;
dividing the second target image according to a preset image division rule to obtain N image subregions;
calculating the number of near white units contained in each image subregion, and taking the image subregion containing the most number of near white units as a distortion region in the second target image;
performing white balance processing on the distortion area by using the white balance technology to generate a second white balance image corresponding to the second target image;
and carrying out image fusion processing on the first white balance image and the second white balance image to generate a third target image.
2. The method according to claim 1, wherein the first camera and the second camera are disposed on the same horizontal line on the same side of the terminal, and the distance between the first camera and the second camera is smaller than a preset distance threshold.
3. The method of claim 1, further comprising:
receiving touch operation aiming at any position on a terminal display screen, and acquiring position information of the touch operation on the terminal display screen;
and determining a distortion area on the terminal display screen by taking the position information of the touch operation on the terminal display screen as a center.
4. The method according to claim 3, wherein the determining a distortion area on the terminal display screen by taking the position information of the touch operation on the terminal display screen as a center specifically comprises:
acquiring a preset radius parameter value;
and determining a distortion area on the terminal display screen by taking the position information of the touch operation on the terminal display screen as a center and the radius parameter value as a radius.
5. A terminal, characterized in that the terminal comprises: the device comprises a shooting module, a first processing module, an acquisition module, a second processing module and a third processing module; wherein,
the shooting module is used for controlling the first camera and the second camera to shoot a shooting target simultaneously and respectively generating a first target image and a second target image;
the first processing module is configured to perform white balance processing on the first target image by using a white balance technology, and generate a first white balance image corresponding to the first target image;
the acquisition module is used for traversing all pixel units in the second target image, and when the pixel values corresponding to the pixel units fall into a preset pixel value range, marking the pixel units as near-white units;
dividing the second target image according to a preset image division rule to obtain N image subregions;
calculating the number of near white units contained in each image subregion, and taking the image subregion containing the most number of near white units as a distortion region in the second target image;
the second processing module is configured to perform white balance processing on the distortion region by using the white balance technology, and generate a second white balance image corresponding to the second target image;
and the third processing module is used for carrying out image fusion processing on the first white balance image and the second white balance image to generate a third target image.
6. The terminal according to claim 5, wherein the first camera and the second camera are disposed on the same horizontal line on the same side of the terminal, and a distance between the first camera and the second camera is smaller than a preset distance threshold.
7. The terminal of claim 5, wherein the obtaining module is specifically configured to:
receiving touch operation aiming at any position on a terminal display screen, and acquiring position information of the touch operation on the terminal display screen;
and determining a distortion area on the terminal display screen by taking the position information of the touch operation on the terminal display screen as a center.
8. The terminal of claim 7, wherein the obtaining module is specifically configured to:
acquiring a preset radius parameter value;
and determining a distortion area on the terminal display screen by taking the position information of the touch operation on the terminal display screen as a center and the radius parameter value as a radius.
CN201710144925.7A 2017-03-13 2017-03-13 Distortion processing method and terminal Expired - Fee Related CN107071274B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710144925.7A CN107071274B (en) 2017-03-13 2017-03-13 Distortion processing method and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710144925.7A CN107071274B (en) 2017-03-13 2017-03-13 Distortion processing method and terminal

Publications (2)

Publication Number Publication Date
CN107071274A CN107071274A (en) 2017-08-18
CN107071274B true CN107071274B (en) 2020-08-21

Family

ID=59621951

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710144925.7A Expired - Fee Related CN107071274B (en) 2017-03-13 2017-03-13 Distortion processing method and terminal

Country Status (1)

Country Link
CN (1) CN107071274B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20240292115A1 (en) * 2021-07-27 2024-08-29 Google Llc Automatic White-Balance (AWB) for a Camera System

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114663320B (en) * 2020-12-22 2025-07-11 阿里巴巴集团控股有限公司 Image processing method, data set expansion method, storage medium and electronic device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101166285A (en) * 2006-10-16 2008-04-23 展讯通信(上海)有限公司 Automatic white balance method and device
CN101815223A (en) * 2009-02-20 2010-08-25 三星数码影像株式会社 Method for adjusting white balance of image and apparatus applying the same
CN105141833A (en) * 2015-07-20 2015-12-09 努比亚技术有限公司 Terminal photographing method and device
CN105721846A (en) * 2014-12-22 2016-06-29 摩托罗拉移动有限责任公司 Multiple Camera Apparatus and Method for Synchronized Auto White Balance

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4692770B2 (en) * 2006-12-27 2011-06-01 富士フイルム株式会社 Compound eye digital camera

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101166285A (en) * 2006-10-16 2008-04-23 展讯通信(上海)有限公司 Automatic white balance method and device
CN101815223A (en) * 2009-02-20 2010-08-25 三星数码影像株式会社 Method for adjusting white balance of image and apparatus applying the same
CN105721846A (en) * 2014-12-22 2016-06-29 摩托罗拉移动有限责任公司 Multiple Camera Apparatus and Method for Synchronized Auto White Balance
CN105141833A (en) * 2015-07-20 2015-12-09 努比亚技术有限公司 Terminal photographing method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20240292115A1 (en) * 2021-07-27 2024-08-29 Google Llc Automatic White-Balance (AWB) for a Camera System

Also Published As

Publication number Publication date
CN107071274A (en) 2017-08-18

Similar Documents

Publication Publication Date Title
US10958850B2 (en) Electronic device and method for capturing image by using display
CN105430295B (en) Image processing apparatus and method
CN106375596B (en) Device and method for prompting focusing object
US9819870B2 (en) Photographing method and electronic device
US9451173B2 (en) Electronic device and control method of the same
CN106651955B (en) Method and device for positioning target object in picture
US9692959B2 (en) Image processing apparatus and method
WO2018076935A1 (en) Image blurring processing method, device, mobile terminal, and computer storage medium
WO2017067520A1 (en) Mobile terminal having binocular cameras and photographing method therefor
CN104853092A (en) Photographing method and device
CN105450932B (en) Backlight photographic method and device
CN110378954A (en) Projected picture correcting method, device, mobile device and storage medium
CN105371948B (en) Detect the method and its electronic device of ultraviolet light
WO2017206657A1 (en) Image processing method and device, mobile terminal, and computer storage medium
WO2017206655A1 (en) Image processing method, terminal, and computer storage medium
CN107566742A (en) Shooting method, device, storage medium and electronic equipment
CN108419009A (en) Image definition enhancing method and device
KR102409616B1 (en) Color filter substrates, displays, and terminals
CN108009563B (en) Image processing method and device and terminal
CN104535178A (en) A light intensity value detection method and terminal
CN107071274B (en) Distortion processing method and terminal
CN107121875A (en) A kind of light compensating apparatus, filming apparatus and mobile terminal
CN108184103A (en) The method and apparatus for showing image
CN106331476A (en) Image processing method and device
CN107431744A (en) Camera apparatus, image processing apparatus and image processing method

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
TA01 Transfer of patent application right

Effective date of registration: 20200709

Address after: 210013, Gu Ping Gang 4, Gulou District, Jiangsu, Nanjing

Applicant after: Qihe Technology (Nanjing) Co.,Ltd.

Address before: 518000 Guangdong Province, Shenzhen high tech Zone of Nanshan District City, No. 9018 North Central Avenue's innovation building A, 6-8 layer, 10-11 layer, B layer, C District 6-10 District 6 floor

Applicant before: NUBIA TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20230713

Address after: 710000 G1-063, 7th Floor, Xixian Talent Building, Century Avenue, Fengdong New City, Xi'an City, Shaanxi Province

Patentee after: Shaanxi Wender Cloud Computing Co.,Ltd.

Address before: 210013 gulping 4, Gulou District, Nanjing, Jiangsu

Patentee before: Qihe Technology (Nanjing) Co.,Ltd.

TR01 Transfer of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20200821

CF01 Termination of patent right due to non-payment of annual fee