Movatterモバイル変換


[0]ホーム

URL:


CN106454085B - Image processing method and mobile terminal - Google Patents

Image processing method and mobile terminal
Download PDF

Info

Publication number
CN106454085B
CN106454085BCN201610879529.4ACN201610879529ACN106454085BCN 106454085 BCN106454085 BCN 106454085BCN 201610879529 ACN201610879529 ACN 201610879529ACN 106454085 BCN106454085 BCN 106454085B
Authority
CN
China
Prior art keywords
picture
fisrt feature
region
feature
pixel region
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
CN201610879529.4A
Other languages
Chinese (zh)
Other versions
CN106454085A (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.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication 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 Vivo Mobile Communication Co LtdfiledCriticalVivo Mobile Communication Co Ltd
Priority to CN201610879529.4ApriorityCriticalpatent/CN106454085B/en
Publication of CN106454085ApublicationCriticalpatent/CN106454085A/en
Application grantedgrantedCritical
Publication of CN106454085BpublicationCriticalpatent/CN106454085B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The embodiment of the invention provides a kind of image processing method and mobile terminals, are applied to mobile terminal, and the mobile terminal includes at least two cameras, which is characterized in that the described method includes: receiving the shooting request of user;It is requested for the shooting, the first picture is shot using the first camera, and, second picture is shot using second camera;The fisrt feature region for meeting presetting rule is identified from first picture;Wherein, the fisrt feature region has first location information;The corresponding second feature region of the first location information is extracted from the second picture;The fisrt feature region is replaced using the second feature region in first picture, generates third picture.It identifies " barrier " for accounting for certain picture ratio in the first picture, and uses the similar part of second picture, described in substitution " barrier ", guarantee the total tune of the picture of picture, improve the quality of shooting picture, enhance the experience of user.

Description

Translated fromChinese
一种图像处理方法和移动终端Image processing method and mobile terminal

技术领域technical field

本发明涉及移动终端的技术领域,特别是涉及一种基于移动终端的图像处理方法和一种基于移动终端的图像处理装置。The present invention relates to the technical field of mobile terminals, in particular to an image processing method based on a mobile terminal and an image processing device based on a mobile terminal.

背景技术Background technique

随着电子产品的不断发展,具有拍摄功能的移动终端越来越普及,用户可以随时随地用它来进行拍照,所得的图像以多媒体的短信等形式发送给亲朋好友,即拍即发,方便快捷。With the continuous development of electronic products, mobile terminals with shooting functions are becoming more and more popular. Users can use them to take pictures anytime and anywhere, and the resulting images are sent to relatives and friends in the form of multimedia text messages, which is convenient and fast. .

智能手机等移动终端已经不再是简单的通信工具,而是集休闲、娱乐和通信等功能的工艺品。与此同时,用户对拍摄效果的要求也越来越高。用户在使用移动终端拍照时,通常都会要求图片的质量有一定的提高,例如,要求图片的画面整体的亮度及画面景物的协调性,但是,画面景物的之间的布局是难以改变的,特别是自然景物的布局,这就要求移动终端对拍摄得到的图片进行一定的处理。进一步地,用户采用移动终端拍照时,因为拍摄角度的原因,某些“障碍物”会使原来的图片的景物受到遮挡。Mobile terminals such as smart phones are no longer simple communication tools, but handicrafts that integrate leisure, entertainment and communication functions. At the same time, users have higher and higher requirements for shooting effects. When users use mobile terminals to take pictures, they usually require a certain improvement in the quality of the pictures. For example, they require the overall brightness of the picture and the coordination of the scenes in the picture. However, the layout of the scenes in the picture is difficult to change, especially It is the layout of natural scenery, which requires the mobile terminal to perform certain processing on the captured pictures. Furthermore, when the user uses the mobile terminal to take pictures, some "obstacles" will block the scene of the original picture due to the shooting angle.

发明内容Contents of the invention

鉴于上述问题,本发明实施例提供一种图像处理方法和移动终端,以解决现有技术中拍摄的景物会被遮挡及协调性的上述问题。In view of the above problems, embodiments of the present invention provide an image processing method and a mobile terminal to solve the above problems in the prior art that the photographed scene is blocked and coordinated.

为了解决上述问题,本发明实施例公开了一种图像处理方法,应用于移动终端,所述移动终端包括至少两个摄像头,其特征在于,所述方法包括:In order to solve the above problems, an embodiment of the present invention discloses an image processing method, which is applied to a mobile terminal, and the mobile terminal includes at least two cameras, wherein the method includes:

接收用户的拍摄请求;Receive the user's shooting request;

针对所述拍摄请求,采用第一摄像头拍摄第一图片,以及,采用第二摄像头拍摄第二图片;For the shooting request, use the first camera to take the first picture, and use the second camera to take the second picture;

从所述第一图片中识别出满足预置规则的第一特征区域;其中,所述第一特征区域具有第一位置信息;Identifying a first feature area satisfying a preset rule from the first picture; wherein, the first feature area has first position information;

从所述第二图片提取所述第一位置信息对应的第二特征区域;extracting a second feature region corresponding to the first location information from the second picture;

在所述第一图片中采用所述第二特征区域替换所述第一特征区域,生成第三图片。replacing the first feature area with the second feature area in the first picture to generate a third picture.

本发明实施例还公开了一种移动终端,所述移动终端包括至少两个摄像头,所述终端包括:The embodiment of the present invention also discloses a mobile terminal, the mobile terminal includes at least two cameras, and the terminal includes:

拍摄请求接收模块,用于接收用户的拍摄请求;A photographing request receiving module, configured to receive a photographing request from a user;

图片拍摄模块,用于针对所述拍摄请求,采用第一摄像头拍摄第一图片,以及,采用第二摄像头拍摄第二图片;The picture shooting module is configured to use the first camera to take the first picture, and use the second camera to take the second picture in response to the shooting request;

第一特征区域识别模块,用于从所述第一图片中识别出满足预置规则的第一特征区域;其中,所述第一特征区域具有第一位置信息;A first feature area identification module, configured to identify a first feature area that satisfies a preset rule from the first picture; wherein, the first feature area has first position information;

第二特征区域提取模块,用于从所述第二图片提取所述第一位置信息对应的第二特征区域;A second feature area extraction module, configured to extract a second feature area corresponding to the first position information from the second picture;

第三图片生成模块,用于在所述第一图片中采用所述第二特征区域替换所述第一特征区域,生成第三图片。A third picture generation module, configured to replace the first feature area with the second feature area in the first picture to generate a third picture.

本发明实施例包括以下优点:Embodiments of the present invention include the following advantages:

本发明实施例中,针对所述拍摄请求,采用第一摄像头拍摄第一图片,以及,采用第二摄像头拍摄第二图片,从所述第一图片中识别出满足预置规则的第一特征区域;依据所述第一特征区域的第一位置信息从所述第二图片提取对应的第二特征区域,在所述第一图片中采用所述第二特征区域替换所述第一特征区域,生成第三图片。本发明实施例采用至少两个摄像头拍摄的两张图片,识别出第一图片的中的占一定图片比例的“障碍物”,并且采用第二图片的相近的部分,替代所述“障碍物”,保证图片的画面的整体协调性,提高拍摄图片的质量,增强用户的体验。In the embodiment of the present invention, in response to the shooting request, the first camera is used to take a first picture, and the second camera is used to take a second picture, and a first characteristic area satisfying a preset rule is identified from the first picture ; Extracting a corresponding second feature area from the second picture according to the first position information of the first feature area, replacing the first feature area with the second feature area in the first picture, generating third picture. The embodiment of the present invention uses two pictures taken by at least two cameras to identify the "obstacle" in the first picture that accounts for a certain proportion of the picture, and uses a similar part of the second picture to replace the "obstacle" , to ensure the overall coordination of the pictures, improve the quality of the captured pictures, and enhance the user experience.

本发明实施例中,识别出第一图片的小于一定图片比例的与第一图片整体风格并不相符的“障碍物”,将所述“障碍物”用第二图片中与相邻的第一特征像素区域相似的第二特征区域替换所述第一特征像素区域,避免了拍摄的景物被遮挡,产生整体画面质量一致的图片,提高整体画面的协调性,保持画面的风格一致性,提高的生成的图片的质量,对用户的体验有极大的提高,增强用户的粘性。In the embodiment of the present invention, "obstacles" that are smaller than a certain proportion of the first picture and do not conform to the overall style of the first picture are identified, and the "obstacles" are used in the second picture and adjacent to the first picture. The second feature area similar to the feature pixel area replaces the first feature pixel area, avoiding the blocking of the captured scene, producing a picture with the same quality of the overall picture, improving the coordination of the overall picture, maintaining the consistency of the style of the picture, and improving the overall picture quality. The quality of the generated pictures greatly improves the user experience and enhances user stickiness.

附图说明Description of drawings

为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained based on these drawings without creative effort.

图1是本发明实施例的一种图像处理方法实施例一的步骤流程图;FIG. 1 is a flow chart of the steps of Embodiment 1 of an image processing method according to an embodiment of the present invention;

图2是本发明实施例的一种图像处理方法实施例二的步骤流程图;FIG. 2 is a flow chart of steps in Embodiment 2 of an image processing method according to an embodiment of the present invention;

图3是本发明实施例中装置实施例三的一种移动终端的结构框图;FIG. 3 is a structural block diagram of a mobile terminal of a third device embodiment in the embodiment of the present invention;

图4是本发明实施例中装置实施例四的一种移动终端的结构框图;Fig. 4 is a structural block diagram of a mobile terminal in the fourth embodiment of the device in the embodiment of the present invention;

图5是本发明实施例中装置实施例五的一种移动终端的结构示意图。Fig. 5 is a schematic structural diagram of a mobile terminal in the fifth embodiment of the device in the embodiment of the present invention.

具体实施方式Detailed ways

为了使本发明实施例所解决的技术问题、技术方案及有益效果更加清楚明白,以下结合附图及实施例,对本发明实施例进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the technical problems, technical solutions and beneficial effects solved by the embodiments of the present invention clearer, the embodiments of the present invention will be further described in detail below in conjunction with the accompanying drawings and the embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

方法实施例一Method embodiment one

参照图1,示出了本发明实施例的一种图像处理方法实施例一的步骤流程图,应用于移动终端,所述移动终端包括至少两个摄像头,具体可以包括如下步骤:Referring to FIG. 1 , it shows a flow chart of the steps of Embodiment 1 of an image processing method according to an embodiment of the present invention, which is applied to a mobile terminal. The mobile terminal includes at least two cameras, and may specifically include the following steps:

步骤101,接收用户的拍摄请求;Step 101, receiving a shooting request from a user;

本发明实施例中,移动终端可以包括至少两个摄像头的智能设备,采用所述移动终端进行拍摄,首先接收用户触发的拍摄请求,其中,用户触发拍摄请求的方式可以通过接触屏幕的点击事件,也可以是通过按压实体按键的按压事件,或者通过设置自动定时拍摄的方式拍摄图片,本发明实施例对此不作任何的限制。In the embodiment of the present invention, the mobile terminal may include a smart device with at least two cameras, and the mobile terminal is used for shooting, first receiving a shooting request triggered by the user, where the user triggers the shooting request through a touch event on the screen, It may also be a press event of pressing a physical button, or taking a picture by setting automatic timing shooting, which is not limited in this embodiment of the present invention.

步骤102,针对所述拍摄请求,采用第一摄像头拍摄第一图片,以及,采用第二摄像头拍摄第二图片;Step 102, for the shooting request, use the first camera to take the first picture, and use the second camera to take the second picture;

应用于本发明实施例,还采用不同的焦点信息来设置第一摄像头及第二摄像头,进一步地,本发明实施例中,采用不同拍摄参数分别设置移动终端的第一摄像头及第二摄像头,其中,所述拍摄参数可以包括焦距信息和/或光圈信息和/或快门时间信息和/或增益信息,具体地,焦距信息指是的移动终端的摄像头中,从镜片中心到CCD(感光器件,Charge-coupled Device)成像平面的距离,焦距信息可以设置为10mm-35mm之间,本发明实施例中,第一摄像头与第二摄像头的焦距信息设置为不同的参数;光圈是一个用来控制光线透过摄像头的镜头进入CCD光量的装置,其通常是在镜头内部。表达光圈信息大小一般是用F值,例如F1,F1.4,F2,F2.8,F4,F5.6,F8,f值越大,进光量越小。快门是摄像器材中用来控制光线照射CCD的时间的装置。快门时间信息可以为照射CCD的时间,例如,1/250秒、1/60秒,其决定照片的亮度。增益信息指的是对图片进行补偿的过程参数。需要说明的是,即使用不同的对焦方式(不同的焦点信息及不同的焦距信息),获得不同角度的第一图片及第二图片,其中,第一摄像头与第二摄像头的排列方式可以水平排列或者竖立排列,本发明实施例对此不作任何限制。Applied to the embodiment of the present invention, different focus information is also used to set the first camera and the second camera. Further, in the embodiment of the present invention, different shooting parameters are used to respectively set the first camera and the second camera of the mobile terminal, wherein , the shooting parameters may include focal length information and/or aperture information and/or shutter time information and/or gain information, specifically, the focal length information refers to the distance from the lens center to the CCD (photosensitive device, Charge -coupled Device) the distance of the imaging plane, the focal length information can be set between 10mm-35mm, in the embodiment of the present invention, the focal length information of the first camera and the second camera are set to different parameters; The device that enters the CCD light through the lens of the camera, which is usually inside the lens. F value is generally used to express aperture information, such as F1, F1.4, F2, F2.8, F4, F5.6, F8, the larger the f value, the smaller the amount of incoming light. The shutter is a device used in camera equipment to control the time when light illuminates the CCD. The shutter time information can be the time of illuminating the CCD, for example, 1/250 second, 1/60 second, which determines the brightness of the photo. Gain information refers to a process parameter for compensating a picture. It should be noted that even if different focusing methods (different focus information and different focal length information) are used to obtain the first picture and the second picture at different angles, the arrangement of the first camera and the second camera can be arranged horizontally Alternatively, they may be arranged vertically, which is not limited in this embodiment of the present invention.

步骤103,从所述第一图片中识别出满足预置规则的第一特征区域;其中,所述第一特征区域具有第一位置信息;Step 103, identifying a first feature area that satisfies a preset rule from the first picture; wherein, the first feature area has first position information;

具体而言,将所述第一图片转换为第一灰度图片,选取出所述第一灰度图片的亮度小于第一预设阈值的第一特征像素区域,判断所述第一特征像素区域是否小于固定比例,当所述第一特征像素区域小于固定比例时,确定所述第一特征像素区域为第一特征区域。将所述第一图片转换为第一灰度图片,在所述第一灰度图片中识别出满足预置规则的第一特征区域,其中,满足预置规则的第一特征区域可以包括亮度小于的预设阈值的并且所述占第一图片的面积的小于固定比例的第一特征区域,应用于本发明实施例,所述第一特征区域可以为第一图片上的某些“障碍物”,例如,一张整体色彩明亮的图片的占一定图片比例的黑色岩石或占一定图片比例的黑色阴影等。首先识别出上述的“障碍物”,识别的方式可以包括对比亮度及占图片比例的大小,识别出“障碍物”,然后获取“障碍物”的在图片上的位置信息。Specifically, converting the first picture into a first grayscale picture, selecting a first feature pixel region whose brightness of the first grayscale picture is less than a first preset threshold, and judging the first feature pixel region Whether it is smaller than a fixed ratio, when the first characteristic pixel area is smaller than a fixed ratio, determine that the first characteristic pixel region is the first characteristic region. converting the first picture into a first grayscale picture, and identifying a first feature region satisfying a preset rule in the first grayscale picture, wherein the first feature region satisfying a preset rule may include a brightness less than The first feature area with a preset threshold value and the area of the first picture is less than a fixed ratio is applied to the embodiment of the present invention, and the first feature area may be some "obstacles" on the first picture , for example, black rocks or black shadows accounting for a certain proportion of a picture with a bright overall color. Firstly, the above-mentioned "obstacle" is identified, and the identification method may include comparing the brightness and the size of the proportion of the picture to identify the "obstacle", and then obtain the position information of the "obstacle" on the picture.

步骤104,从所述第二图片提取所述第一位置信息对应的第二特征区域;Step 104, extracting a second feature region corresponding to the first position information from the second picture;

举例而言,依据第一位置信息从第二摄像头的拍摄的第二图片提取对应的第二特征区域,需要说明的是,也可以提取出第一位置信息的在第二图片的相邻的位置信息,选取所述相邻的位置信息对应的特征像素区域作为第二特征区域,换而言之,所述第二特征区域的数量可以包括多个,本发明实施例对此不作限制。For example, the corresponding second feature area is extracted from the second picture taken by the second camera according to the first position information. It should be noted that the adjacent position in the second picture of the first position information can also be extracted Information, select the feature pixel area corresponding to the adjacent position information as the second feature area, in other words, the number of the second feature area may include multiple, which is not limited in this embodiment of the present invention.

步骤105,在所述第一图片中采用所述第二特征区域替换所述第一特征区域,生成第三图片。Step 105, replacing the first feature area with the second feature area in the first picture to generate a third picture.

具体到本发明实施例中,按照所述第一位置信息获取所述第一图片的相邻的第一特征像素区域,获取所述第二特征区域与所述相邻的第一特征像素区域的特征相似度,当所述特征相似度大于第二预设阈值时,则采用所述第二图片的第二特征区域替换所述第一图片的第一特征区域,生成第三图片。比对第二特征区域与第一图片的相邻的第一特征像素区域的特征相似度,所述特征相似度可以为直方图组相似度,还可以是图像外包多边形相似度,还可以是基于特征点的图像相似度,本发明实施例对此不作限制。针对第二图片提取的第二特征区域与第一图片的第一特征区域(可以理解为“障碍物”)相邻的特征像素区域进行对比,当所述相似度大于一定的第二预设阈值,例如,相似度大于80%时,则采用第二图片的第二特征区域替换第一图片的第一特征区域。Specifically, in the embodiment of the present invention, the adjacent first feature pixel area of the first picture is obtained according to the first position information, and the distance between the second feature area and the adjacent first feature pixel area is obtained. feature similarity, when the feature similarity is greater than a second preset threshold, the second feature area of the second picture is used to replace the first feature area of the first picture to generate a third picture. Comparing the feature similarity between the second feature area and the adjacent first feature pixel area of the first picture, the feature similarity can be a histogram group similarity, or an image outsourcing polygon similarity, or based on The image similarity of feature points is not limited in this embodiment of the present invention. The second feature area extracted for the second picture is compared with the feature pixel area adjacent to the first feature area (which can be understood as "obstacle") of the first picture, and when the similarity is greater than a certain second preset threshold For example, when the similarity is greater than 80%, the first characteristic region of the first picture is replaced with the second characteristic region of the second picture.

本发明实施例中,针对所述拍摄请求,采用第一摄像头拍摄第一图片,以及,采用第二摄像头拍摄第二图片,从所述第一图片中识别出满足预置规则的第一特征区域;其中,所述第一特征区域具有第一位置信息,依据所述第一特征区域的第一位置信息从所述第二图片提取对应的第二特征区域,在所述第一图片中采用所述第二特征区域替换所述第一特征区域,生成第三图片。本发明实施例采用至少两个摄像头拍摄的两张图片,识别出第一图片的中的占一定图片比例的“障碍物”,并且采用第二图片的相近的部分,替代所述“障碍物”,保证图片的画面的整体协调性,提高拍摄图片的质量,增强用户的体验。In the embodiment of the present invention, in response to the shooting request, the first camera is used to take a first picture, and the second camera is used to take a second picture, and a first characteristic area satisfying a preset rule is identified from the first picture ; Wherein, the first characteristic region has first position information, and the corresponding second characteristic region is extracted from the second picture according to the first position information of the first characteristic region, and the first characteristic region is used in the first picture The second feature area replaces the first feature area to generate a third picture. The embodiment of the present invention uses two pictures taken by at least two cameras to identify the "obstacle" in the first picture that accounts for a certain proportion of the picture, and uses a similar part of the second picture to replace the "obstacle" , to ensure the overall coordination of the pictures, improve the quality of the captured pictures, and enhance the user experience.

方法实施例二Method embodiment two

参照图2,示出了本发明实施例的一种图像处理方法实施例二的步骤流程图,应用于移动终端,所述移动终端包括至少两个摄像头,具体可以包括如下步骤:Referring to FIG. 2 , it shows a flow chart of the steps of Embodiment 2 of an image processing method according to an embodiment of the present invention, which is applied to a mobile terminal. The mobile terminal includes at least two cameras, and may specifically include the following steps:

步骤201,接收用户的拍摄请求;Step 201, receiving a shooting request from a user;

本发明实施例中,移动终端可以包括至少两个摄像头的智能设备,用户可以根据虚拟按键和/或实体按键触发拍摄请求,本发明实施例对此不作限制。In the embodiment of the present invention, the mobile terminal may be a smart device including at least two cameras, and the user may trigger a shooting request according to virtual keys and/or physical keys, which is not limited in the embodiment of the present invention.

步骤202,采用所述第一摄像头以第一焦点拍摄第一图片;Step 202, using the first camera to take a first picture with a first focal point;

步骤203,采用所述第二摄像头以第二焦点拍摄第二图片;Step 203, using the second camera to take a second picture with a second focal point;

应用于本发明实施例中,采用不同的焦点信息来设置第一摄像头及第二摄像头,拍摄得到两张不同角度的图片,此外,本发明实施例中,还使用其它参数设置第一摄像头及第二摄像头,例如,焦距信息和/或光圈信息和/或快门时间信息和/或增益信息。Applied to the embodiment of the present invention, different focus information is used to set the first camera and the second camera, and two pictures of different angles are obtained by shooting. In addition, in the embodiment of the present invention, other parameters are also used to set the first camera and the second camera. For the second camera, for example, focal length information and/or aperture information and/or shutter time information and/or gain information.

步骤204,将所述第一图片转换为第一灰度图片;Step 204, converting the first picture into a first grayscale picture;

进一步地,将第一摄像头的第一图片转换为灰度图片,转换方式可以为三原色通道的平均值,也可以调用其它软件直接转换,本发明实施例对此不任何限制。Further, the first picture of the first camera is converted into a grayscale picture, and the conversion method may be the average value of the three primary color channels, or other software may be called for direct conversion, which is not limited in this embodiment of the present invention.

步骤205,选取出所述第一灰度图片的亮度小于第一预设阈值的第一特征像素区域;Step 205, selecting a first feature pixel region of the first grayscale picture whose brightness is smaller than a first preset threshold;

本发明实施例的一种优选实施例中,所述选取出所述第一灰度图片的亮度小于第一预设阈值的第一特征像素区域的步骤包括以下的步骤:将所述第一灰度图片分割为面积相同的多个像素区域;判断所述像素区域的亮度是否小于第一预设阈值;当所述像素区域的亮度小于第一预设阈值时,选取对应的像素区域作为第一特征像素区域。In a preferred embodiment of the embodiment of the present invention, the step of selecting the first feature pixel region whose brightness of the first grayscale image is smaller than a first preset threshold includes the following steps: The high-degree picture is divided into a plurality of pixel areas with the same area; it is judged whether the brightness of the pixel area is less than the first preset threshold; when the brightness of the pixel area is less than the first preset threshold, the corresponding pixel area is selected as the first Feature pixel area.

具体而言,将所述第一图片对应灰度图片的分为多个像素区域,例如,可以将灰度图片划分为长为10个像素,宽为10个像素的像素矩形或半径为10个像素的像素圆,本发明实施例对此不作限制,判断所述像素区域亮度是否在小于一个特定的阈值,其中,特定的阈值可以为第一图片的亮度平均值,也可以是根据实际情况设置的亮度平均值,本发明实施例对此不作限制。Specifically, the first picture corresponding to the grayscale picture is divided into a plurality of pixel areas, for example, the grayscale picture can be divided into a pixel rectangle with a length of 10 pixels and a width of 10 pixels or a radius of 10 pixels. The pixel circle of the pixel, which is not limited in the embodiment of the present invention, determines whether the brightness of the pixel area is less than a specific threshold, wherein the specific threshold can be the average brightness of the first picture, or can be set according to the actual situation The average brightness value of is not limited in this embodiment of the present invention.

步骤206,判断所述第一特征像素区域是否小于固定比例;Step 206, judging whether the first feature pixel area is smaller than a fixed ratio;

进一步,判断所述第一特征像素区域(“障碍物”)的大小(占图片比例的大小),例如,当所述第一特征像素区域小于图片面积的2%时,认为“障碍物”所占的比例小,替换“障碍物”的同时可以保留整张图片的风格与美观。Further, judge the size of the first feature pixel area ("obstacle") (the size of the proportion of the picture), for example, when the first feature pixel area is less than 2% of the picture area, it is considered that the "obstacle" The proportion is small, and the style and beauty of the entire picture can be retained while replacing the "obstacle".

步骤207,当所述第一特征像素区域小于固定比例时,确定所述第一特征像素区域为第一特征区域;Step 207, when the first feature pixel area is smaller than a fixed ratio, determine the first feature pixel area as the first feature area;

应用于本发明实施例,当所述第一特征像素区域小于固定比例时,确定所述第一特征像素区域为第一特征区域,确定符合条件的像素区域为特征区域(占一定图片比例的“障碍物”)。Applied to the embodiment of the present invention, when the first feature pixel area is smaller than a fixed ratio, the first feature pixel area is determined as the first feature area, and the qualified pixel area is determined as the feature area (accounting for a certain proportion of the picture " obstacle").

步骤208,在所述第一图片中采用所述第二特征区域替换所述第一特征区域,生成第三图片。Step 208, replacing the first feature area with the second feature area in the first picture to generate a third picture.

本发明实施例的一种优选实施例中,所述在所述第一图片中采用所述第二特征区域替换所述第一特征区域,生成第三图片的步骤包括:按照所述第一位置信息获取所述第一图片相邻的第一特征像素区域。获取所述第二特征区域与所述相邻的第一特征像素区域的特征相似度;判断所述特征相似度是否大于第二预设阈值;当所述特征相似度大于第二预设阈值时,则采用所述第二图片的第二特征区域替换所述第一图片的第一特征区域,生成第三图片。In a preferred embodiment of the embodiment of the present invention, the step of replacing the first feature area with the second feature area in the first picture, and generating a third picture includes: according to the first position The information acquires the first feature pixel area adjacent to the first picture. Obtaining the feature similarity between the second feature area and the adjacent first feature pixel area; judging whether the feature similarity is greater than a second preset threshold; when the feature similarity is greater than a second preset threshold , then replace the first feature area of the first picture with the second feature area of the second picture to generate a third picture.

本发明实施例的另一种优选实施例中,所述采用所述第一位置信息获取所述第一图片相邻的第一特征像素区域的步骤包括以下步骤:获取所述第一位置信息的相邻位置信息;采用所述相邻位置信息获取所述相邻的第一特征像素区域。In another preferred embodiment of the embodiment of the present invention, the step of acquiring the first feature pixel region adjacent to the first picture by using the first position information includes the following steps: acquiring the first position information Adjacent position information: acquiring the adjacent first feature pixel region by using the adjacent position information.

实际而言,将第二图片中的第二特征区域与第一图片相邻的第一特征像素区域的特定相似度,将第二图片的第二特征区域的特征相似度大于一定的第二预设阈值的第二特征区域替代所述第一图片的第一特征区域,生成第三图片,本发明实施例中,第二预设阈值可以为90%,也可以根据实际情况而设置的任何数值,本发明实施例对此不作限制。In practice, the specific similarity between the second characteristic region in the second picture and the first characteristic pixel region adjacent to the first picture is determined, and the characteristic similarity of the second characteristic region of the second picture is greater than a certain second predetermined value. The second feature area of the threshold is used to replace the first feature area of the first picture to generate a third picture. In the embodiment of the present invention, the second preset threshold can be 90%, or any value that can be set according to the actual situation , which is not limited in this embodiment of the present invention.

本发明实施例中,采用两个不同的摄像头以不同的焦点信息拍摄两张不同角度的图片,选取出所述第一图片对应的第一灰度图片的亮度小于第一预设阈值的第一特征像素区域,当所述第一特征像素区域小于固定比例时,确定所述第一特征像素区域为第一特征区域,在所述第一图片中采用所述第二特征区域替换所述第一特征区域,生成第三图片,识别出第一图片的小于一定图片比例的与第一图片整体风格并不相符的“障碍物”,将所述“障碍物”用第二图片中与相邻的第一特征像素区域相似的第二特征区域替换所述第一特征像素区域,产生整体画面质量一致的图片,提高整体画面的协调性,保持画面的风格一致性,提高的生成的图片的质量,对用户的体验有极大的提高,增强用户的粘性。In the embodiment of the present invention, two different cameras are used to take pictures of two different angles with different focus information, and the first gray-scale picture corresponding to the first picture is selected, and the brightness of the first grayscale picture is smaller than the first preset threshold. A feature pixel area, when the first feature pixel area is smaller than a fixed ratio, determine the first feature pixel area as the first feature area, and use the second feature area to replace the first feature pixel area in the first picture Feature area, generate the third picture, identify the "obstacles" in the first picture that are smaller than a certain proportion of the picture and do not match the overall style of the first picture, and use the "obstacles" in the second picture with the adjacent Replace the first characteristic pixel region with the second characteristic region similar to the first characteristic pixel region, generate a picture with the same quality of the overall picture, improve the coordination of the whole picture, maintain the consistency of the style of the picture, and improve the quality of the generated picture, It greatly improves the user experience and enhances user stickiness.

需要说明的是,对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明实施例并不受所描述的动作顺序的限制,因为依据本发明实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本发明实施例所必须的。It should be noted that, for the method embodiment, for the sake of simple description, it is expressed as a series of action combinations, but those skilled in the art should know that the embodiment of the present invention is not limited by the described action sequence, because According to the embodiment of the present invention, certain steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification belong to preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

装置实施例三Device Embodiment Three

图3是本发明一个实施例的移动终端的框图。图3所示的移动终端300包括拍摄请求接收模块301、图片拍摄模块302、第一特征区域识别模块303、第二特征区域提取模块304和第三图片生成模块305。FIG. 3 is a block diagram of a mobile terminal according to an embodiment of the present invention. The mobile terminal 300 shown in FIG. 3 includes a shooting request receiving module 301 , a picture shooting module 302 , a first feature area identification module 303 , a second feature area extraction module 304 and a third picture generation module 305 .

拍摄请求接收模块301,用于接收用户的拍摄请求;A photographing request receiving module 301, configured to receive a photographing request from a user;

图片拍摄模块302、,用于针对所述拍摄请求,采用第一摄像头拍摄第一图片,以及,采用第二摄像头拍摄第二图片;The picture shooting module 302' is configured to use the first camera to take a first picture, and use the second camera to take a second picture in response to the shooting request;

第一特征区域识别模块303,用于从所述第一图片中识别出满足预置规则的第一特征区域;其中,所述第一特征区域具有第一位置信息;The first feature area identification module 303 is configured to identify a first feature area satisfying a preset rule from the first picture; wherein, the first feature area has first position information;

第二特征区域提取模块304,用于从所述第二图片提取所述第一位置信息对应的第二特征区域;A second feature area extraction module 304, configured to extract a second feature area corresponding to the first position information from the second picture;

第三图片生成模块305,用于在所述第一图片中采用所述第二特征区域替换所述第一特征区域,生成第三图片。The third picture generation module 305 is configured to replace the first feature area with the second feature area in the first picture to generate a third picture.

可选地,所述图片拍摄模块302包括:Optionally, the picture taking module 302 includes:

第一图片拍摄子模块,用于采用所述第一摄像头以第一焦点拍摄第一图片;The first picture taking sub-module is used to take the first picture with the first focal point by using the first camera;

第二图片拍摄子模块,用于采用所述第二摄像头以第二焦点拍摄第二图片。The second picture taking sub-module is configured to take a second picture with the second focal point by using the second camera.

可选地,所述第一特征区域识别模块303包括:Optionally, the first feature area identification module 303 includes:

第一灰度图片转换子模块,用于将所述第一图片转换为第一灰度图片;The first grayscale picture conversion submodule is used to convert the first picture into a first grayscale picture;

第一特征像素区域选取子模块,用于选取出所述第一灰度图片的亮度小于第一预设阈值的第一特征像素区域;The first feature pixel area selection sub-module is used to select the first feature pixel area whose brightness of the first grayscale picture is less than a first preset threshold;

第一特征像素区域判断子模块,用于判断所述第一特征像素区域是否小于固定比例;The first feature pixel area judging sub-module is used to judge whether the first feature pixel area is smaller than a fixed ratio;

第一特征区域确定子模块,用于当所述第一特征像素区域小于固定比例时,确定所述第一特征像素区域为第一特征区域。The first feature area determination sub-module is configured to determine the first feature pixel area as the first feature area when the first feature pixel area is smaller than a fixed ratio.

可选地,所述第一特征像素区域选取子模块包括:Optionally, the first feature pixel region selection submodule includes:

像素区域分割单元,用于将所述第一灰度图片分割为面积相同的多个像素区域;A pixel region segmentation unit, configured to divide the first grayscale image into multiple pixel regions with the same area;

第二预设阈值判断单元,用于判断所述像素区域的亮度是否小于第一预设阈值;a second preset threshold judging unit, configured to judge whether the brightness of the pixel area is smaller than a first preset threshold;

第一特征像素区域选取单元,用于当所述像素区域的亮度小于第一预设阈值时,选取对应的像素区域作为第一特征像素区域。The first feature pixel area selection unit is configured to select the corresponding pixel area as the first feature pixel area when the brightness of the pixel area is less than a first preset threshold.

可选地,所述第三图片生成模块305包括:Optionally, the third picture generation module 305 includes:

相邻的第一特征像素区域获取子模块,用于按照所述第一位置信息获取所述第一图片中与第一特征区域相邻的第一特征像素区域;An adjacent first feature pixel area acquisition submodule, configured to acquire a first feature pixel area adjacent to the first feature area in the first picture according to the first position information;

特征相似度获取子模块,用于获取所述第二特征区域与所述相邻的第一特征像素区域的特征相似度;A feature similarity acquisition submodule, configured to acquire the feature similarity between the second feature area and the adjacent first feature pixel area;

第二预设阈值判断子模块,用于判断所述特征相似度是否大于第二预设阈值;A second preset threshold judging submodule, configured to judge whether the feature similarity is greater than a second preset threshold;

第三图片生成子模块,用于当所述特征相似度大于第二预设阈值时,则采用所述第二图片的第二特征区域替换所述第一图片的第一特征区域,生成第三图片。The third picture generation submodule is used to replace the first feature area of the first picture with the second feature area of the second picture when the feature similarity is greater than the second preset threshold, and generate a third picture. picture.

可选地,所述相邻的第一特征像素区域获取子模块包括:Optionally, the acquisition submodule of the adjacent first feature pixel area includes:

相邻位置信息获取单元,用于获取所述第一位置信息的相邻位置信息;An adjacent location information acquiring unit, configured to acquire adjacent location information of the first location information;

相邻的第一特征像素区域获取单元,用于采用所述相邻位置信息获取所述相邻的第一特征像素区域。An adjacent first feature pixel area acquiring unit, configured to acquire the adjacent first feature pixel area by using the adjacent position information.

装置实施例四Device Embodiment Four

图4是本发明另一个实施例的移动终端的框图。图4所示的移动终端400包括:至少一个处理器401、存储器402、至少一个网络接口404、其他用户接口403和拍照组件406。移动终端400中的各个组件通过总线系统405耦合在一起。可理解,总线系统405用于实现这些组件之间的连接通信。总线系统405除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图4中将各种总线都标为总线系统405,拍照组件406包括第一摄像头和第二摄像头,其中,第一摄像头第二摄像头分别用于拍摄不同角度的图片。Fig. 4 is a block diagram of a mobile terminal according to another embodiment of the present invention. The mobile terminal 400 shown in FIG. 4 includes: at least one processor 401 , a memory 402 , at least one network interface 404 , other user interfaces 403 and a camera component 406 . Various components in the mobile terminal 400 are coupled together through the bus system 405 . It can be understood that the bus system 405 is used to realize connection and communication between these components. In addition to the data bus, the bus system 405 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, in FIG. 4, various buses are marked as bus system 405, and the photographing component 406 includes a first camera and a second camera, wherein the first camera and the second camera are respectively used to take pictures from different angles.

其中,用户接口403可以包括显示器、键盘或者点击设备(例如,鼠标,轨迹球(trackball)、触感板或者触摸屏等。Wherein, the user interface 403 may include a display, a keyboard or a pointing device (for example, a mouse, a trackball (trackball), a touch panel or a touch screen, and the like.

可以理解,本发明实施例中的存储器402可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-OnlyMemory,ROM)、可编程只读存储器(ProgrammableROM,PROM)、可擦除可编程只读存储器(ErasablePROM,EPROM)、电可擦除可编程只读存储器(ElectricallyEPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(RandomAccessMemory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(StaticRAM,SRAM)、动态随机存取存储器(DynamicRAM,DRAM)、同步动态随机存取存储器(SynchronousDRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(DoubleDataRateSDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(SynchlinkDRAM,SLDRAM)和直接内存总线随机存取存储器(DirectRambusRAM,DRRAM)。本发明实施例描述的系统和方法的存储器402旨在包括但不限于这些和任意其它适合类型的存储器。It can be understood that the memory 402 in the embodiment of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory can be read-only memory (Read-OnlyMemory, ROM), programmable read-only memory (ProgrammableROM, PROM), erasable programmable read-only memory (ErasablePROM, EPROM), electrically erasable Programming read-only memory (Electrically EPROM, EEPROM) or flash memory. The volatile memory may be random access memory (Random Access Memory, RAM), which acts as an external cache. By way of illustration and not limitation, many forms of RAM are available such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (Synchronous DRAM, SDRAM), Double data rate synchronous dynamic random access memory (DoubleDataRateSDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous connection dynamic random access memory (SynchlinkDRAM, SLDRAM) and direct memory bus random access Memory (Direct Rambus RAM, DRRAM). The memory 402 of the systems and methods described in embodiments of the present invention is intended to include, but is not limited to, these and any other suitable types of memory.

在一些实施方式中,存储器402存储了如下的元素,可执行模块或者数据结构,或者他们的子集,或者他们的扩展集:操作系统4021和应用程序4022。In some implementations, the memory 402 stores the following elements, executable modules or data structures, or their subsets, or their extended sets: an operating system 4021 and an application program 4022 .

其中,操作系统4021,包含各种系统程序,例如框架层、核心库层、驱动层等,用于实现各种基础业务以及处理基于硬件的任务。应用程序4022,包含各种应用程序,例如媒体播放器(MediaPlayer)、浏览器(Browser)等,用于实现各种应用业务。实现本发明实施例方法的程序可以包含在应用程序4022中。Among them, the operating system 4021 includes various system programs, such as framework layer, core library layer, driver layer, etc., for realizing various basic services and processing hardware-based tasks. The application program 4022 includes various application programs, such as a media player (MediaPlayer), a browser (Browser), etc., and is used to implement various application services. The program for realizing the method of the embodiment of the present invention may be included in the application program 4022 .

在本发明实施例中,通过调用存储器402存储的程序或指令,具体的,可以是应用程序4022中存储的程序或指令,处理器401用于接收用户的拍摄请求;针对所述拍摄请求,采用第一摄像头拍摄第一图片,以及,采用第二摄像头拍摄第二图片;从所述第一图片中识别出满足预置规则的第一特征区域;其中,所述第一特征区域具有第一位置信息;依据所述第一位置信息从所述第二图片提取对应的第二特征区域;在所述第一图片中采用所述第二特征区域替换所述第一特征区域,生成第三图片。In the embodiment of the present invention, the processor 401 is used to receive the user's shooting request by calling the program or instruction stored in the memory 402, specifically, the program or instruction stored in the application program 4022; for the shooting request, adopt The first camera takes a first picture, and the second camera is used to take a second picture; a first feature area satisfying a preset rule is identified from the first picture; wherein the first feature area has a first position Information; extracting a corresponding second feature area from the second picture according to the first position information; replacing the first feature area with the second feature area in the first picture to generate a third picture.

上述本发明实施例揭示的方法可以应用于处理器401中,或者由处理器401实现。处理器401可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器401中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器401可以是通用处理器、数字信号处理器(DigitalSignalProcessor,DSP)、专用集成电路(ApplicationSpecificIntegratedCircuit,ASIC)、现成可编程门阵列(FieldProgrammableGateArray,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本发明实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本发明实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器402,处理器401读取存储器402中的信息,结合其硬件完成上述方法的步骤。The methods disclosed in the foregoing embodiments of the present invention may be applied to the processor 401 or implemented by the processor 401 . The processor 401 may be an integrated circuit chip and has signal processing capability. In the implementation process, each step of the above method may be completed by an integrated logic circuit of hardware in the processor 401 or instructions in the form of software. The above-mentioned processor 401 may be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), an off-the-shelf programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or Transistor logic devices, discrete hardware components. Various methods, steps and logic block diagrams disclosed in the embodiments of the present invention may be implemented or executed. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, and the like. The steps of the methods disclosed in the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register. The storage medium is located in the memory 402, and the processor 401 reads the information in the memory 402, and completes the steps of the above method in combination with its hardware.

可以理解的是,本发明实施例描述的这些实施例可以用硬件、软件、固件、中间件、微码或其组合来实现。对于硬件实现,处理单元可以实现在一个或多个专用集成电路(ApplicationSpecificIntegratedCircuits,ASIC)、数字信号处理器(DigitalSignalProcessing,DSP)、数字信号处理设备(DSPDevice,DSPD)、可编程逻辑设备(ProgrammableLogicDevice,PLD)、现场可编程门阵列(Field-ProgrammableGateArray,FPGA)、通用处理器、控制器、微控制器、微处理器、用于执行本申请所述功能的其它电子单元或其组合中。It can be understood that the embodiments described in the embodiments of the present invention may be implemented by hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processor (Digital Signal Processing, DSP), digital signal processing device (DSPDevice, DSPD), programmable logic device (ProgrammableLogicDevice, PLD ), Field-Programmable Gate Array (Field-Programmable GateArray, FPGA), general-purpose processor, controller, microcontroller, microprocessor, other electronic units for performing the functions described in this application, or a combination thereof.

对于软件实现,可通过执行本发明实施例所述功能的模块(例如过程、函数等)来实现本发明实施例所述的技术。软件代码可存储在存储器中并通过处理器执行。存储器可以在处理器中或在处理器外部实现。For software implementation, the techniques described in the embodiments of the present invention may be implemented through modules (such as procedures, functions, etc.) that execute the functions described in the embodiments of the present invention. Software codes can be stored in memory and executed by a processor. Memory can be implemented within the processor or external to the processor.

可选地,处理器401还用于:采用所述第一摄像头以第一焦点信息拍摄第一图片;Optionally, the processor 401 is further configured to: use the first camera to take a first picture with first focus information;

采用所述第二摄像头以第二焦点信息拍摄第二图片。The second camera is used to take a second picture with the second focus information.

可选地,处理器401还用于:将所述第一图片转换为第一灰度图片;Optionally, the processor 401 is further configured to: convert the first picture into a first grayscale picture;

选取出所述第一灰度图片的亮度小于第一预设阈值的第一特征像素区域;Selecting a first feature pixel region whose brightness of the first grayscale picture is less than a first preset threshold;

判断所述第一特征像素区域是否小于固定比例;judging whether the first feature pixel area is smaller than a fixed ratio;

当所述第一特征像素区域小于固定比例时,确定所述第一特征像素区域为第一特征区域。When the first feature pixel area is smaller than a fixed ratio, determine the first feature pixel area as the first feature area.

可选地,处理器401还用于:将所述第一灰度图片分割为面积相同的多个像素区域;Optionally, the processor 401 is further configured to: divide the first grayscale picture into multiple pixel regions with the same area;

判断所述像素区域的亮度是否小于第一预设阈值;judging whether the brightness of the pixel area is less than a first preset threshold;

当所述像素区域的亮度小于第一预设阈值时,选取对应的像素区域作为第一特征像素区域。When the brightness of the pixel area is smaller than the first preset threshold, the corresponding pixel area is selected as the first characteristic pixel area.

可选地,处理器401还用于:按照所述第一位置信息获取所述第一图片中与第一特征区域相邻的第一特征像素区域;Optionally, the processor 401 is further configured to: acquire a first feature pixel area adjacent to the first feature area in the first picture according to the first position information;

获取所述第二特征区域与所述相邻的第一特征像素区域的特征相似度;Obtaining the feature similarity between the second feature area and the adjacent first feature pixel area;

判断所述特征相似度是否大于第二预设阈值;judging whether the feature similarity is greater than a second preset threshold;

当所述特征相似度大于第二预设阈值时,则采用所述第二图片的第二特征区域替换所述第一图片的第一特征区域,生成第三图片。When the feature similarity is greater than a second preset threshold, the second feature area of the second picture is used to replace the first feature area of the first picture to generate a third picture.

可选地,处理器401还用于:获取所述第一位置信息的相邻位置信息;Optionally, the processor 401 is further configured to: acquire adjacent location information of the first location information;

采用所述相邻位置信息获取所述相邻的第一特征像素区域。The adjacent first feature pixel regions are acquired by using the adjacent position information.

本发明实施例中,针对所述拍摄请求,采用第一摄像头拍摄第一图片,以及,采用第二摄像头拍摄第二图片,从所述第一图片中识别出满足预置规则的第一特征区域;其中,所述第一特征区域具有第一位置信息,依据所述第一特征区域的第一位置信息从所述第二图片提取对应的第二特征区域,在所述第一图片中采用所述第二特征区域替换所述第一特征区域,生成第三图片。本发明实施例采用至少两个摄像头拍摄的两张图片,识别出第一图片的中的占一定图片比例的“障碍物”,并且采用第二图片的相近的部分,替代所述“障碍物”,保证图片的画面的整体协调性,提高拍摄图片的质量,增强用户的体验。In the embodiment of the present invention, in response to the shooting request, the first camera is used to take a first picture, and the second camera is used to take a second picture, and a first characteristic area satisfying a preset rule is identified from the first picture ; Wherein, the first characteristic region has first position information, and the corresponding second characteristic region is extracted from the second picture according to the first position information of the first characteristic region, and the first characteristic region is used in the first picture The second feature area replaces the first feature area to generate a third picture. The embodiment of the present invention uses two pictures taken by at least two cameras to identify the "obstacle" in the first picture that accounts for a certain proportion of the picture, and uses a similar part of the second picture to replace the "obstacle" , to ensure the overall coordination of the pictures, improve the quality of the captured pictures, and enhance the user experience.

装置实施例五Device Embodiment Five

图5是本发明另一个实施例的移动终端的结构示意图。具体地,图5中的移动终端500可以为手机、平板电脑、个人数字助理(PersonalDigital Assistant,PDA)、或车载电脑等。Fig. 5 is a schematic structural diagram of a mobile terminal according to another embodiment of the present invention. Specifically, the mobile terminal 500 in FIG. 5 may be a mobile phone, a tablet computer, a personal digital assistant (Personal Digital Assistant, PDA), or a vehicle-mounted computer.

图5中的移动终端500包括射频(RadioFrequency,RF)电路510、存储器520、输入单元530、显示单元540、处理器560、音频电路570、WiFi(WirelessFidelity)模块580、电源590和拍照件5100。The mobile terminal 500 in FIG. 5 includes a radio frequency (Radio Frequency, RF) circuit 510, a memory 520, an input unit 530, a display unit 540, a processor 560, an audio circuit 570, a WiFi (Wireless Fidelity) module 580, a power supply 590 and a camera 5100.

其中,输入单元530可用于接收用户输入的数字或字符信息,以及产生与移动终端500的用户设置以及功能控制有关的信号输入。具体地,本发明实施例中,该输入单元530可以包括触控面板531。触控面板531,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板531上的操作),并根据预先设定的程式驱动相应的连接装置。可选的,触控面板531可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给该处理器560,并能接收处理器560发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板531。除了触控面板531,输入单元530还可以包括其他输入设备532,其他输入设备532可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。Wherein, the input unit 530 can be used for receiving number or character information input by the user, and generating signal input related to the user setting and function control of the mobile terminal 500 . Specifically, in the embodiment of the present invention, the input unit 530 may include a touch panel 531 . The touch panel 531, also referred to as a touch screen, can collect user's touch operations on or near it (such as the user's operation on the touch panel 531 using any suitable object or accessory such as a finger and a stylus), and The specified program drives the corresponding connected device. Optionally, the touch panel 531 may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, and detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and sends it to the to the processor 560, and can receive and execute commands sent by the processor 560. In addition, the touch panel 531 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 531, the input unit 530 may also include other input devices 532, which may include but not limited to physical keyboards, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, joysticks, etc. one or more of.

其中,显示单元540可用于显示由用户输入的信息或提供给用户的信息以及移动终端500的各种菜单界面。显示单元540可包括显示面板541,可选的,可以采用LCD或有机发光二极管(OrganicLight-EmittingDiode,OLED)等形式来配置显示面板541。Wherein, the display unit 540 can be used to display information input by the user or information provided to the user and various menu interfaces of the mobile terminal 500 . The display unit 540 may include a display panel 541. Optionally, the display panel 541 may be configured in the form of an LCD or an organic light-emitting diode (Organic Light-Emitting Diode, OLED).

应注意,触控面板531可以覆盖显示面板541,形成触摸显示屏,当该触摸显示屏检测到在其上或附近的触摸操作后,传送给处理器560以确定触摸事件的类型,随后处理器560根据触摸事件的类型在触摸显示屏上提供相应的视觉输出。It should be noted that the touch panel 531 can cover the display panel 541 to form a touch display screen. When the touch display screen detects a touch operation on or near it, it is sent to the processor 560 to determine the type of the touch event, and then the processor The 560 provides corresponding visual output on the touch display screen according to the type of the touch event.

触摸显示屏包括应用程序界面显示区及常用控件显示区。该应用程序界面显示区及该常用控件显示区的排列方式并不限定,可以为上下排列、左右排列等可以区分两个显示区的排列方式。该应用程序界面显示区可以用于显示应用程序的界面。每一个界面可以包含至少一个应用程序的图标和/或widget桌面控件等界面元素。该应用程序界面显示区也可以为不包含任何内容的空界面。该常用控件显示区用于显示使用率较高的控件,例如,设置按钮、界面编号、滚动条、电话本图标等应用程序图标等。The touch display screen includes an application program interface display area and a common control display area. The arrangement of the display area of the application program interface and the display area of the commonly used controls is not limited, and may be an arrangement in which the two display areas can be distinguished, such as vertical arrangement, left-right arrangement, and the like. The application program interface display area can be used to display the interface of the application program. Each interface may include at least one interface element such as an icon of an application program and/or a widget desktop control. The application program interface display area can also be an empty interface without any content. The commonly used control display area is used to display controls with a high usage rate, for example, application icons such as setting buttons, interface numbers, scroll bars, and phonebook icons.

拍照组件5100包括第一摄像头和第二摄像头,其中,第一摄像头第二摄像头分别用于拍摄不同角度的图片。The photographing component 5100 includes a first camera and a second camera, wherein the first camera and the second camera are respectively used to take pictures from different angles.

其中处理器560是移动终端500的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在第一存储器521内的软件程序和/或模块,以及调用存储在第二存储器522内的数据,执行移动终端500的各种功能和处理数据,从而对移动终端500进行整体监控。可选的,处理器560可包括一个或多个处理单元。Wherein the processor 560 is the control center of the mobile terminal 500, utilizes various interfaces and lines to connect the various parts of the whole mobile phone, runs or executes the software programs and/or modules stored in the first memory 521, and calls the software programs and/or modules stored in the second memory 521. The data in the memory 522 executes various functions of the mobile terminal 500 and processes data, so as to monitor the mobile terminal 500 as a whole. Optionally, the processor 560 may include one or more processing units.

在本发明实施例中,通过调用存储该第一存储器521内的软件程序和/或模块和/或该第二存储器522内的数据,处理器560用于接收用户的拍摄请求;针对所述拍摄请求,采用第一摄像头拍摄第一图片,以及,采用第二摄像头拍摄第二图片;从所述第一图片中识别出满足预置规则的第一特征区域;其中,所述第一特征区域具有第一位置信息;依据所述第一位置信息从所述第二图片提取对应的第二特征区域;在所述第一图片中采用所述第二特征区域替换所述第一特征区域,生成第三图片。In the embodiment of the present invention, the processor 560 is configured to receive a user's shooting request by calling the software program and/or module stored in the first memory 521 and/or the data in the second memory 522; Request, use the first camera to take a first picture, and use a second camera to take a second picture; identify a first feature area that meets a preset rule from the first picture; wherein, the first feature area has first position information; extracting a corresponding second feature area from the second picture according to the first position information; replacing the first feature area with the second feature area in the first picture to generate a second feature area Three pictures.

可选地,采用所述第一摄像头以第一焦点拍摄第一图片;Optionally, using the first camera to take a first picture with a first focal point;

可选地,采用所述第二摄像头以第二焦点拍摄第二图片。Optionally, the second camera is used to take a second picture with a second focus.

可选地,将所述第一图片转换为第一灰度图片;Optionally, converting the first picture into a first grayscale picture;

可选地,选取出所述第一灰度图片的亮度小于第一预设阈值的第一特征像素区域;Optionally, selecting a first feature pixel region whose brightness of the first grayscale picture is less than a first preset threshold;

可选地,判断所述第一特征像素区域是否小于固定比例;Optionally, judging whether the first feature pixel area is smaller than a fixed ratio;

可选地,当所述第一特征像素区域小于固定比例时,确定所述第一特征像素区域为第一特征区域。Optionally, when the first characteristic pixel area is smaller than a fixed ratio, the first characteristic pixel area is determined to be the first characteristic area.

可选地,将所述第一灰度图片分割为面积相同的多个像素区域;Optionally, dividing the first grayscale picture into a plurality of pixel regions with the same area;

可选地,判断所述像素区域的亮度是否小于第一预设阈值;Optionally, judging whether the brightness of the pixel area is less than a first preset threshold;

可选地,当所述像素区域的亮度小于第一预设阈值时,选取对应的像素区域作为第一特征像素区域。Optionally, when the brightness of the pixel area is less than a first preset threshold, the corresponding pixel area is selected as the first feature pixel area.

可选地,按照所述第一位置信息获取所述第一图片中与第一特征区域相邻的第一特征像素区域;Optionally, acquiring a first feature pixel area adjacent to the first feature area in the first picture according to the first position information;

可选地,获取所述第二特征区域与所述相邻的第一特征像素区域的特征相似度;Optionally, acquiring the feature similarity between the second feature area and the adjacent first feature pixel area;

可选地,判断所述特征相似度是否大于第二预设阈值;Optionally, judging whether the feature similarity is greater than a second preset threshold;

可选地,当所述特征相似度大于第二预设阈值时,则采用所述第二图片的第二特征区域替换所述第一图片的第一特征区域,生成第三图片。Optionally, when the feature similarity is greater than a second preset threshold, the second feature area of the second picture is used to replace the first feature area of the first picture to generate a third picture.

可选地,获取所述第一位置信息的相邻位置信息;Optionally, acquiring adjacent location information of the first location information;

可选地,采用所述相邻位置信息获取所述相邻的第一特征像素区域。Optionally, the adjacent first feature pixel regions are acquired by using the adjacent position information.

可见,本发明实施例中,采用两个不同的摄像头以不同的焦点信息拍摄两张不同角度的图片,选取出所述第一图片对应的第一灰度图片的亮度小于第一预设阈值的第一特征像素区域,当所述第一特征像素区域小于固定比例时,确定所述第一特征像素区域为第一特征区域,在所述第一图片中采用所述第二特征区域替换所述第一特征区域,生成第三图片,识别出第一图片的小于一定图片比例的与第一图片整体风格并不相符的“障碍物”,将所述“障碍物”用第二图片中与相邻的第一特征像素区域相似的第二特征区域替换所述第一特征像素区域,产生整体画面质量一致的图片,提高整体画面的协调性,保持画面的风格一致性,提高的生成的图片的质量,对用户的体验有极大的提高,增强用户的粘性。It can be seen that in the embodiment of the present invention, two different cameras are used to take two pictures of different angles with different focus information, and the brightness of the first grayscale picture corresponding to the first picture is selected to be less than the first preset threshold. The first feature pixel area, when the first feature pixel area is smaller than a fixed ratio, determine the first feature pixel area as the first feature area, and use the second feature area in the first picture to replace the The first feature area, generate the third picture, identify the "obstacles" in the first picture that are smaller than a certain proportion of the picture and do not match the overall style of the first picture, and use the "obstacles" in the second picture with the corresponding The second feature area similar to the adjacent first feature pixel area replaces the first feature pixel area to generate a picture with consistent overall picture quality, improve the coordination of the overall picture, maintain the style consistency of the picture, and improve the quality of the generated picture. Quality greatly improves user experience and enhances user stickiness.

本领域普通技术人员可以意识到,结合本发明实施例中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those of ordinary skill in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed in the embodiments of the present invention can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present invention.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.

在本申请所提供的实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.

所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。If the functions described above are realized in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media capable of storing program codes such as U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk.

以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Anyone skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present invention. Should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims (6)

CN201610879529.4A2016-09-302016-09-30 Image processing method and mobile terminalActiveCN106454085B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201610879529.4ACN106454085B (en)2016-09-302016-09-30 Image processing method and mobile terminal

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201610879529.4ACN106454085B (en)2016-09-302016-09-30 Image processing method and mobile terminal

Publications (2)

Publication NumberPublication Date
CN106454085A CN106454085A (en)2017-02-22
CN106454085Btrue CN106454085B (en)2019-09-27

Family

ID=58172301

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201610879529.4AActiveCN106454085B (en)2016-09-302016-09-30 Image processing method and mobile terminal

Country Status (1)

CountryLink
CN (1)CN106454085B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN108063884B (en)*2017-11-152021-02-26维沃移动通信有限公司Image processing method and mobile terminal
CN108494996B (en)*2018-05-142021-01-15Oppo广东移动通信有限公司 Image processing method, device, storage medium and mobile terminal
CN109035185A (en)*2018-06-292018-12-18努比亚技术有限公司A kind of image processing method and terminal
CN109104573B (en)*2018-09-292021-01-08维沃移动通信(杭州)有限公司Method for determining focusing point and terminal equipment
CN109587410A (en)*2018-12-122019-04-05北京北电科林电子有限公司Panoptic visualization safety defense monitoring system
CN109948644A (en)*2019-01-212019-06-28深圳壹账通智能科技有限公司A kind of similar source of houses data detection method, device and terminal device
CN110377259B (en)*2019-07-192023-07-07深圳前海达闼云端智能科技有限公司Equipment hiding method, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103826065A (en)*2013-12-122014-05-28小米科技有限责任公司Image processing method and apparatus
CN103856719A (en)*2014-03-262014-06-11深圳市金立通信设备有限公司Photographing method and terminal

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
KR20110090164A (en)*2010-02-032011-08-10삼성전자주식회사 Image data transmission method, and display device and display method using same

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103826065A (en)*2013-12-122014-05-28小米科技有限责任公司Image processing method and apparatus
CN103856719A (en)*2014-03-262014-06-11深圳市金立通信设备有限公司Photographing method and terminal

Also Published As

Publication numberPublication date
CN106454085A (en)2017-02-22

Similar Documents

PublicationPublication DateTitle
CN106454085B (en) Image processing method and mobile terminal
CN107197169B (en) A high dynamic range image shooting method and mobile terminal
CN106331510B (en) A backlight photographing method and mobile terminal
CN106161967B (en)Backlight scene panoramic shooting method and mobile terminal
CN107395898B (en)Shooting method and mobile terminal
CN105847674A (en)Preview image processing method based on mobile terminal, and mobile terminal therein
CN105872148A (en)Method and mobile terminal for generating high dynamic range images
CN107395976B (en) A shooting parameter setting method and mobile terminal
CN110300264B (en) Image processing method, device, mobile terminal and storage medium
CN105827965A (en)Image processing method based on mobile terminal and mobile terminal
CN107507239A (en)A kind of image partition method and mobile terminal
CN107395998A (en)A kind of image capturing method and mobile terminal
CN105827754A (en)High dynamic-range image generation method and mobile terminal
CN105915782A (en)Picture obtaining method based on face identification, and mobile terminal
CN107147837A (en) A shooting parameter setting method and mobile terminal
CN106791357A (en)A kind of image pickup method and mobile terminal
CN107197170A (en)A kind of exposal control method and mobile terminal
CN106454086B (en) An image processing method and mobile terminal
CN106060386A (en)Preview image generation method and mobile terminal
CN106506962A (en) Image processing method and mobile terminal
CN106170058A (en)A kind of exposure method and mobile terminal
CN107509030A (en) A focusing method and mobile terminal
CN106126108A (en)A kind of breviary map generalization method and mobile terminal
CN105979155A (en)Photographing method and mobile terminal
CN110266926B (en) Image processing method, device, mobile terminal and storage medium

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp