CN104660905A - Shooting processing method and device - Google Patents
Shooting processing method and device Download PDFInfo
- Publication number
- CN104660905A CN104660905A CN201510096220.3A CN201510096220A CN104660905A CN 104660905 A CN104660905 A CN 104660905A CN 201510096220 A CN201510096220 A CN 201510096220A CN 104660905 A CN104660905 A CN 104660905A
- Authority
- CN
- China
- Prior art keywords
- color value
- pixel
- image
- goal
- selling object
- 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.)
- Granted
Links
Landscapes
- Studio Devices (AREA)
- Image Processing (AREA)
Abstract
本发明适用于移动终端技术领域,提供了一种拍照处理方法及装置,所述方法包括:在镜头采集图像后,获取所述图像中每一个像素的颜色值;在检测到所述图像中包含预设目标对象时,设置所述预设目标对象对应的像素的颜色值为第一颜色值以及设置所述图像上其余部分的像素的颜色值为第二颜色值;所述图像上其余部分的像素为所述图像上除所述预设目标对象对应的像素外的其余像素。本发明实现了单色拍照,所获取的照片在预设目标对象上以预设颜色突出显示,而除预设目标对象外的其余部分则显示其他颜色,丰富了现有的拍照功能且提升了用户拍摄的体验感。
The present invention is applicable to the technical field of mobile terminals, and provides a photographing processing method and device. The method includes: acquiring the color value of each pixel in the image after the lens captures the image; When the target object is preset, the color value of the pixel corresponding to the preset target object is set to the first color value and the color value of the rest of the pixels on the image is set to the second color value; The pixels are other pixels on the image except the pixels corresponding to the preset target object. The present invention realizes monochromatic photographing, and the acquired photographs are highlighted with a preset color on the preset target object, while other parts except the preset target object are displayed in other colors, which enriches the existing photographing function and improves the The user's shooting experience.
Description
技术领域technical field
本发明属于移动终端技术领域,尤其涉及一种拍照处理方法及装置。The invention belongs to the technical field of mobile terminals, and in particular relates to a photographing processing method and device.
背景技术Background technique
随着科技的发展,智能手机成为人们日常生活中接触最多的电子设备。现有的智能手机的拍照功能繁多,比如全景、夜景防抖、滤镜等,满足了人们多样化的拍照需求。然而现有的智能手机无法实现单色拍照,即无法获得目标对象以预设颜色值突出显示的照片,比如只有嘴唇呈现红色的黑白图片。With the development of science and technology, smartphones have become the most contacted electronic devices in people's daily life. Existing smartphones have many camera functions, such as panorama, night view anti-shake, filter, etc., which meet people's diverse camera needs. However, existing smartphones cannot take monochrome photos, that is, photos in which the target object is highlighted with preset color values, such as a black and white picture in which only the lips are red, cannot be obtained.
发明内容Contents of the invention
鉴于此,本发明实施例提供了一种拍照处理方法及装置,以实现拍摄目标对象以预设颜色突出显示的图像,提升所拍摄图像的艺术感。In view of this, an embodiment of the present invention provides a photographing processing method and device, so as to achieve an image in which a target object is highlighted in a preset color and enhance the artistic sense of the photographed image.
第一方面,提供了一种拍照处理方法,所述方法包括:In a first aspect, there is provided a photographing processing method, the method comprising:
在镜头采集图像后,获取所述图像中每一个像素的颜色值;After the camera captures the image, obtain the color value of each pixel in the image;
在检测到所述图像中包含预设目标对象时,设置所述预设目标对象对应的像素的颜色值为第一颜色值以及设置所述图像上其余部分的像素的颜色值为第二颜色值;When it is detected that the image contains a preset target object, the color value of the pixel corresponding to the preset target object is set to a first color value and the color value of the remaining pixels on the image is set to a second color value ;
所述图像上其余部分的像素为所述图像上除所述预设目标对象对应的像素外的其余像素。The rest of the pixels on the image are the remaining pixels on the image except the pixels corresponding to the preset target object.
进一步地,所述在检测到所述图像中包含预设目标对象时,设置所述预设目标对象对应的像素的颜色值为第一颜色值以及设置所述图像上其余部分的像素的颜色值为第二颜色值具体包括:Further, when it is detected that the image contains a preset target object, the color value of the pixel corresponding to the preset target object is set to the first color value and the color value of the remaining pixels on the image is set. Specific values for the second color include:
在检测到所述图像中包含预设目标对象时,获取所述预设目标对象对应的像素及所述像素的颜色值;When detecting that the image includes a preset target object, acquiring a pixel corresponding to the preset target object and a color value of the pixel;
判断所述预设目标对象对应的像素的颜色值是否为第一颜色值;judging whether the color value of the pixel corresponding to the preset target object is the first color value;
若是,设置所述图像上其余部分的像素的颜色值为第二颜色值;If so, set the color value of the pixels on the rest of the image to the second color value;
否则,设置所述预设目标对象对应的像素的颜色值为第一颜色值以及设置所述图像上其余部分的像素的颜色值为第二颜色值。Otherwise, set the color value of the pixel corresponding to the preset target object to the first color value and set the color value of the rest of the pixels on the image to the second color value.
进一步地,所述第二颜色值为像素的灰度值。Further, the second color value is a gray value of a pixel.
进一步地,所述颜色值为红绿蓝RGB格式,包括红色分量像素值、绿色分量像素值和蓝色分量像素值。Further, the color value is in a red-green-blue RGB format, including a red component pixel value, a green component pixel value and a blue component pixel value.
进一步地,在获取所述图像中每一个像素的颜色值之前,所述方法还包括:Further, before obtaining the color value of each pixel in the image, the method also includes:
在启动拍照功能时,开启预设目标对象检测功能,以获取镜头所采集的图像中的预设目标对象。When the camera function is activated, the preset target object detection function is turned on, so as to obtain the preset target object in the image captured by the lens.
第二方面,提供了一种拍照处理装置,所述装置包括:In a second aspect, a camera processing device is provided, the device comprising:
获取模块,用于在镜头采集图像后,获取所述图像中每一个像素的颜色值;An acquisition module, configured to acquire the color value of each pixel in the image after the lens captures the image;
设置模块,用于在检测到所述图像中包含预设目标对象时,设置所述预设目标对象对应的像素的颜色值为第一颜色值以及设置所述图像上其余部分的像素的颜色值为第二颜色值;A setting module, configured to, when detecting that the image contains a preset target object, set the color value of the pixel corresponding to the preset target object to the first color value and set the color values of the remaining pixels on the image is the second color value;
所述图像上其余部分的像素为所述图像上除所述预设目标对象对应的像素外的其余像素。The rest of the pixels on the image are the remaining pixels on the image except the pixels corresponding to the preset target object.
进一步地,所述设置模块包括:Further, the setting module includes:
获取单元,用于在检测到所述图像中包含预设目标对象时,获取所述预设目标对象对应的像素及所述像素的颜色值;an acquiring unit, configured to acquire a pixel corresponding to the preset target object and a color value of the pixel when it is detected that the image contains a preset target object;
判断单元,用于判断所述预设目标对象对应的像素的颜色值是否为第一颜色值;a judging unit, configured to judge whether the color value of the pixel corresponding to the preset target object is the first color value;
第一设置单元,用于在判断单元的判断结果为是时,设置所述图像上其余部分的像素的颜色值为第二颜色值;The first setting unit is used to set the color value of the remaining pixels on the image to the second color value when the judgment result of the judging unit is Yes;
第二设置单元,用于在判断单元的判断结果为否时,设置所述预设目标对象对应的像素的颜色值为第一颜色值以及设置所述图像上其余部分的像素的颜色值为第二颜色值。The second setting unit is used to set the color value of the pixel corresponding to the preset target object to the first color value and set the color value of the remaining pixels on the image to the second color value when the judgment result of the judging unit is No. Two color values.
进一步地,所述第二颜色值为像素的灰度值。Further, the second color value is a gray value of a pixel.
进一步地,所述颜色值为红绿蓝RGB格式,包括红色分量像素值、绿色分量像素值和蓝色分量像素值。Further, the color value is in a red-green-blue RGB format, including a red component pixel value, a green component pixel value and a blue component pixel value.
进一步地,所述装置还包括:Further, the device also includes:
启动模块,用于在启动拍照功能时,开启预设目标对象检测功能,以获取镜头所采集的图像中的预设目标对象。The starting module is configured to enable the detection function of the preset target object when the camera function is started, so as to obtain the preset target object in the image captured by the lens.
与现有技术相比,本发明实施例通过在镜头采集图像后,获取所述图像中每一个像素的颜色值;在检测到所述图像中包含预设目标对象时,设置所述预设目标对象对应的像素的颜色值为第一颜色值以及设置所述图像上其余部分的像素的颜色值为第二颜色值;其中,所述图像上其余部分的像素为所述图像上除所述预设目标对象对应的像素外的其余像素,从而实现了单色拍照,所获取的照片在预设目标对象上以预设颜色突出显示,而除预设目标对象外的其余部分则显示其他颜色,丰富了现有的拍照功能。Compared with the prior art, the embodiment of the present invention obtains the color value of each pixel in the image after the lens captures the image; when it is detected that the image contains a preset target object, the preset target is set The color value of the pixel corresponding to the object is the first color value and the color value of the rest of the pixels on the image is set to the second color value; wherein, the rest of the pixels on the image are the image except the preset Set the rest of the pixels except the pixels corresponding to the target object, so as to realize the monochromatic photographing, and the obtained photos are highlighted with the preset color on the preset target object, while the rest of the parts except the preset target object display other colors, Enriched the existing camera function.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained according to these drawings without any creative effort.
图1是本发明实施例一提供的拍照处理方法的第一实现流程图;FIG. 1 is a first implementation flow chart of the photographing processing method provided by Embodiment 1 of the present invention;
图2是本发明实施例二提供的拍照处理方法的第二实现流程图;Fig. 2 is a second implementation flowchart of the photographing processing method provided by Embodiment 2 of the present invention;
图3是本发明实施例三提供的拍照处理装置的组成结构图。FIG. 3 is a structural diagram of a camera processing device provided in Embodiment 3 of the present invention.
具体实施方式Detailed ways
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and 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.
本发明实施例通过在镜头采集图像后,获取所述图像中每一个像素的颜色值;在检测到所述图像中包含预设目标对象时,设置所述预设目标对象对应的像素的颜色值为第一颜色值以及设置所述图像上其余部分的像素的颜色值为第二颜色值;其中,所述图像上其余部分的像素为所述图像上除所述预设目标对象对应的像素外的其余像素,从而实现了单色拍照,所获取的照片在预设目标对象上以预设颜色突出显示,而除预设目标对象外的其余部分则显示其他颜色,大大地提升了用户的拍摄体验感。本发明实施例还提供了相应的装置,以下分别进行详细的说明。In the embodiment of the present invention, after the lens captures the image, the color value of each pixel in the image is acquired; when the preset target object is detected in the image, the color value of the pixel corresponding to the preset target object is set be the first color value and set the color value of the rest of the pixels on the image to the second color value; wherein, the rest of the pixels on the image are the pixels on the image except for the pixels corresponding to the preset target object The rest of the pixels, so as to achieve monochrome photography, the acquired photos are highlighted in the preset color on the preset target object, while the rest of the preset target object is displayed in other colors, which greatly improves the user's shooting sense of experience. Embodiments of the present invention also provide corresponding devices, which will be described in detail below.
实施例一Embodiment one
图1示出了本发明实施例一提供的拍照处理方法的第一实现流程,为了便于说明,仅示出了与本发明相关的部分。FIG. 1 shows a first implementation flow of a photographing processing method provided by Embodiment 1 of the present invention. For ease of description, only parts related to the present invention are shown.
在本发明实施例中,所述方法应用于具有拍照功能的移动终端。所述移动终端包括但不限于移动电话、口袋计算机(Pocket personal Computer,PPC)、掌上电脑、个人数字助理(Personal Digital Assistant,PDA)等,优选为智能手机、平板电脑等。所述移动终端上设置有摄像头、图像处理器。In the embodiment of the present invention, the method is applied to a mobile terminal with a camera function. The mobile terminal includes, but is not limited to, a mobile phone, a pocket computer (Pocket personal Computer, PPC), a palmtop computer, a personal digital assistant (Personal Digital Assistant, PDA), etc., preferably a smart phone, a tablet computer, etc. The mobile terminal is provided with a camera and an image processor.
如图1所示,所述方法包括:As shown in Figure 1, the method includes:
在步骤S101中,在镜头采集图像后,获取所述图像中每一个像素的颜色值。In step S101, after the lens captures an image, the color value of each pixel in the image is acquired.
用户按下移动终端提供的拍照功能键进行拍照,摄像头撷取当前的图像数据,并由图像传感器对所述图像数据进行处理及输出,从而获得镜头所采集的图像中每一个像素的颜色值。The user presses the camera function key provided by the mobile terminal to take a picture, the camera captures the current image data, and the image sensor processes and outputs the image data, thereby obtaining the color value of each pixel in the image captured by the lens.
优选地,所述颜色值为红绿蓝RGB格式,包括红色分量像素值、绿色分量像素值和蓝色分量像素值。图像传感器输出的图像数据格式为yuv格式时,则将所述yuv格式的图像数据转换成RGB格式数据。比如,yuv格式转换成RGB格式时,假设图像数据的yuv格式表示为(Y,U,V),对应的RGB格式表示为(R,G,B),转换公式为:Preferably, the color value is in a red-green-blue RGB format, including a red component pixel value, a green component pixel value and a blue component pixel value. When the image data output by the image sensor is in the yuv format, the image data in the yuv format is converted into RGB format data. For example, when the yuv format is converted to RGB format, it is assumed that the yuv format of the image data is expressed as (Y, U, V), and the corresponding RGB format is expressed as (R, G, B), and the conversion formula is:
R=Y+1.4075*(V-128)R=Y+1.4075*(V-128)
G=Y-0.3455*(U-128)-0.7169*(V-128)G=Y-0.3455*(U-128)-0.7169*(V-128)
B=Y+1.779*(U-128)B=Y+1.779*(U-128)
若用户设置了目标对象检测功能,则在获取到图像传感器输出的RGB格式的图像数据后,对所述图像数据进行局部特征检测,通过在预先设置的分类器判断当前的图像数据是否满足相应的特征,以检测预设目标对象。其中,所述预设目标对象的检测通过HAAR特征算法进行,HAAR特征算法是通过使用在各种不同场景条件下得到的局部特征数据样本做培养得到的相应局部特征的分类器。优选地,所述目标对象包括但不限于红唇、红领巾、四角风车、眼珠等。If the user sets the target object detection function, after obtaining the image data in RGB format output by the image sensor, the local feature detection is performed on the image data, and the current image data is judged by the preset classifier whether it satisfies the corresponding features to detect preset target objects. Wherein, the detection of the preset target object is performed through the HAAR feature algorithm, which is a classifier of corresponding local features obtained by using local feature data samples obtained under various scene conditions for training. Preferably, the target objects include but are not limited to red lips, red scarves, four-cornered pinwheels, eyeballs and the like.
在步骤S102中,在检测到所述图像中包含预设目标对象时,设置所述预设目标对象对应的像素的颜色值为第一颜色值以及设置所述图像上其余部分的像素的颜色值为第二颜色值。In step S102, when it is detected that the image contains a preset target object, set the color value of the pixel corresponding to the preset target object to the first color value and set the color values of the remaining pixels on the image is the second color value.
在本发明实施例中,所述图像上其余部分的像素为所述图像上除所述预设目标对象对应的像素外的其余像素。In the embodiment of the present invention, the remaining pixels on the image are the remaining pixels on the image except the pixels corresponding to the preset target object.
其中,所述第一颜色值可以为用户在启动目标对象检测功能时通过弹出的提示框输入的RGB颜色值,也可以为图像传感器输出的目标对象对应的像素的颜色值。Wherein, the first color value may be the RGB color value input by the user through the pop-up prompt box when starting the target object detection function, or may be the color value of the pixel corresponding to the target object output by the image sensor.
示例性地,当所述第一颜色值为用户设定的RGB颜色值,所述第二颜色值为像素的灰度值,若检测到图像中包含预设目标对象,则设置所述预设目标对象对应的像素的颜色值为用户所设定的RGB颜色值(即用户设定的彩色),而对所述图像上除所述目标对象对应的像素外的其余部分的像素进行灰度化处理,以使所述图像上除所述目标对象对应的像素外的其余部分呈现黑白色,从而使得处理后得到的图像达到单色拍照的效果,即只在目标对象上显示设定的彩色颜色,而其他部分则显示黑白颜色,大大地提升了所拍摄的图像的艺术感。Exemplarily, when the first color value is the RGB color value set by the user, the second color value is the grayscale value of the pixel, and if it is detected that the image contains a preset target object, then the preset The color value of the pixel corresponding to the target object is the RGB color value set by the user (that is, the color set by the user), and the remaining pixels on the image except the pixel corresponding to the target object are grayscaled processing, so that the remaining part of the image except the pixel corresponding to the target object appears black and white, so that the image obtained after processing achieves the effect of monochrome photography, that is, only the set color color is displayed on the target object , while other parts are displayed in black and white, greatly enhancing the artistic sense of the captured image.
优选地,所述第二颜色值还可以为经过滤镜处理后对应的颜色值,比如黑白滤镜、怀旧滤镜、浅绿色滤镜、色调滤镜、冲印滤镜等。Preferably, the second color value may also be a corresponding color value processed by a filter, such as a black and white filter, nostalgic filter, light green filter, tone filter, and print filter.
本发明实施例通过在镜头采集图像后,获取所述图像中每一个像素的颜色值;在检测到所述图像中包含预设目标对象时,设置所述预设目标对象对应的像素的颜色值为第一颜色值以及设置所述图像上其余部分的像素的颜色值为第二颜色值;其中,所述图像上其余部分的像素为所述图像上除所述预设目标对象对应的像素外的其余像素,从而实现了单色拍照,所获取的照片在预设目标对象上以预设颜色突出显示,而除预设目标对象外的其余部分则显示其他颜色,大大地提升了用户的拍摄体验感。In the embodiment of the present invention, after the lens captures the image, the color value of each pixel in the image is acquired; when the preset target object is detected in the image, the color value of the pixel corresponding to the preset target object is set be the first color value and set the color value of the rest of the pixels on the image to the second color value; wherein, the rest of the pixels on the image are the pixels on the image except for the pixels corresponding to the preset target object The rest of the pixels, so as to achieve monochrome photography, the acquired photos are highlighted in the preset color on the preset target object, while the rest of the preset target object is displayed in other colors, which greatly improves the user's shooting sense of experience.
实施例二Embodiment two
图2示出了本发明实施例二提供的拍照处理方法的第二实现流程,为了便于说明,仅示出了与本发明相关的部分。FIG. 2 shows a second implementation flow of the photographing processing method provided by Embodiment 2 of the present invention. For convenience of description, only parts related to the present invention are shown.
如图2所示,所述方法包括:As shown in Figure 2, the method includes:
在步骤S201中,启动目标对象拍照功能。In step S201, the function of taking pictures of the target object is started.
在步骤S202中,在镜头采集图像后,获取图像传感器输出的YUV格式的图像,并将所述YUV格式的图像数据转换为RGB格式的图像。In step S202, after the lens captures the image, the image in YUV format output by the image sensor is acquired, and the image data in YUV format is converted into an image in RGB format.
在步骤S203中,判断所述RGB格式的图像中是否包含预设目标对象。In step S203, it is determined whether the image in RGB format contains a preset target object.
在本发明实施例中,所述预设目标对象的检测通过HAAR特征算法进行,HAAR特征算法是通过使用在各种不同场景条件下得到的局部特征数据样本做培养得到的相应局部特征的分类器。在进行局部特征检测时,通过在分类器中查找匹配,判断是否为目标对象拍照功能对应的目标对象。优选地,所述目标对象包括但不限于红唇、红领巾、四角风车、眼珠等,相应的,所述目标对象拍照功能可实现对红红唇、红领巾、四角风车、眼珠等对象的检测。In the embodiment of the present invention, the detection of the preset target object is performed through the HAAR feature algorithm, which is a classifier of corresponding local features obtained by using local feature data samples obtained under various scene conditions. . When performing local feature detection, by looking for a match in the classifier, it is judged whether it is the target object corresponding to the target object’s camera function. Preferably, the target objects include but are not limited to red lips, red scarves, four-cornered pinwheels, eyeballs, etc. Correspondingly, the target object camera function can realize the detection of red lips, red scarves, four-cornered pinwheels, eyeballs and other objects.
若所述RGB格式的图像中包含预设目标对象,则执行步骤S204;否则,执行步骤S207。If the image in RGB format contains a preset target object, perform step S204; otherwise, perform step S207.
在步骤S204中,根据所述RGB格式的图像获取目标对象在图像中的位置信息,并且判断所述目标对象对应的像素的颜色值是否为第一颜色值。In step S204, the position information of the target object in the image is acquired according to the image in RGB format, and it is judged whether the color value of the pixel corresponding to the target object is the first color value.
若判断结果为是,则执行步骤S205;否则,执行步骤S206。If the judgment result is yes, execute step S205; otherwise, execute step S206.
在步骤S205中,保留目标对象对应的像素的颜色值,并设置图像上其余部分的像素的颜色值为第二颜色值。In step S205, retain the color value of the pixel corresponding to the target object, and set the color value of the rest of the pixels on the image to the second color value.
在步骤S206中,设置所述预设目标对象对应的像素的颜色值为第一颜色值以及设置图像上其余部分的像素的颜色值为第二颜色值。In step S206, the color value of the pixel corresponding to the preset target object is set to the first color value and the color value of the rest of the pixels on the image is set to the second color value.
在步骤S207中,设置图像上每一个像素对应的颜色为第二颜色值。In step S207, the color corresponding to each pixel on the image is set as the second color value.
需要说明的是,所述第一颜色值可以为用户在拍摄前设定的颜色值,也可以为所选择的预设目标拍照功能中规定的目标对象对应的颜色值。所述第二颜色值可以为用户在拍摄前设定的颜色值,也可以为经过用户设定的滤镜处理方式后对应的颜色值,比如黑白滤镜、怀旧滤镜、浅绿色滤镜、色调滤镜、冲印滤镜等。因此,上述“设置图像上其余部分的像素的颜色值为第二颜色值”的设置方式可以为直接设置图像上其余部分的像素的颜色值为拍照前设定的颜色值,也可以为按照用户设定的滤镜处理方式对图像上的其余部分的像素进行处理,使得处理后的像素的颜色值为第二颜色值。It should be noted that the first color value may be a color value set by the user before shooting, or may be a color value corresponding to a target object specified in the selected preset target photographing function. The second color value can be the color value set by the user before shooting, or the corresponding color value after the filter processing method set by the user, such as black and white filter, nostalgic filter, light green filter, Toning filters, Develop filters, and more. Therefore, the above-mentioned setting method of "setting the color value of the pixel on the remaining part of the image to the second color value" can be directly setting the color value of the pixel on the remaining part of the image to the color value set before taking pictures, or it can be based on the user's The set filter processing method processes the rest of the pixels on the image, so that the color value of the processed pixel is the second color value.
本发明实施例通过在镜头采集图像后,获取所述图像中每一个像素的颜色值;在检测到所述图像中包含预设目标对象时,设置所述预设目标对象对应的像素的颜色值为第一颜色值以及设置所述图像上其余部分的像素的颜色值为第二颜色值;其中,所述图像上其余部分的像素为所述图像上除所述预设目标对象对应的像素外的其余像素,从而实现了单色拍照,所获取的照片在预设目标对象上以预设颜色突出显示,而除预设目标对象外的其余部分则显示其他颜色,大大地提升了用户的拍摄体验感。In the embodiment of the present invention, after the lens captures the image, the color value of each pixel in the image is acquired; when the preset target object is detected in the image, the color value of the pixel corresponding to the preset target object is set be the first color value and set the color value of the rest of the pixels on the image to the second color value; wherein, the rest of the pixels on the image are the pixels on the image except for the pixels corresponding to the preset target object The rest of the pixels, so as to achieve monochrome photography, the acquired photos are highlighted in the preset color on the preset target object, while the rest of the preset target object is displayed in other colors, which greatly improves the user's shooting sense of experience.
实施例三Embodiment Three
图3示出了本发明实施例三提供的拍照处理装置的组成结构,为了便于说明,仅示出了与本发明相关的部分。FIG. 3 shows the composition and structure of the photographing processing device provided by Embodiment 3 of the present invention. For the convenience of description, only the parts related to the present invention are shown.
在本发明实施例中,所述装置用于实现图1或图2实施例所述的拍照处理方法,可以是内置于移动终端的软件单元、硬件单元或者软硬件结合的单元。所述移动终端包括但不限于移动电话、口袋计算机(Pocket personalComputer,PPC)、掌上电脑、个人数字助理(Personal Digital Assistant,PDA)、等,优选为智能手机、平板电脑等。所述移动终端上设置有摄像头、图像处理器。In the embodiment of the present invention, the device is used to implement the photographing processing method described in the embodiment in FIG. 1 or FIG. 2 , and may be a software unit, a hardware unit or a combination of software and hardware built in the mobile terminal. The mobile terminal includes, but is not limited to, a mobile phone, a pocket computer (Pocket personalComputer, PPC), a palmtop computer, a personal digital assistant (Personal Digital Assistant, PDA), etc., preferably a smart phone, a tablet computer, etc. The mobile terminal is provided with a camera and an image processor.
如图3所示,所述装置包括:As shown in Figure 3, the device includes:
获取模块31,用于在镜头采集图像后,获取所述图像中每一个像素的颜色值。The acquiring module 31 is configured to acquire the color value of each pixel in the image after the lens captures the image.
设置模块32,用于在检测到所述图像中包含预设目标对象时,设置所述预设目标对象对应的像素的颜色值为第一颜色值以及设置所述图像上其余部分的像素的颜色值为第二颜色值。A setting module 32, configured to set the color value of the pixel corresponding to the preset target object to the first color value and set the colors of the remaining pixels on the image when it is detected that the image contains a preset target object The value is the second color value.
所述图像上其余部分的像素为所述图像上除所述预设目标对象对应的像素外的其余像素。The rest of the pixels on the image are the remaining pixels on the image except the pixels corresponding to the preset target object.
进一步地,所述设置模块32具体包括:Further, the setting module 32 specifically includes:
获取单元321,用于在检测到所述图像中包含预设目标对象时,获取所述预设目标对象对应的像素及所述像素的颜色值。The acquiring unit 321 is configured to acquire a pixel corresponding to the preset target object and a color value of the pixel when it is detected that the image contains a preset target object.
判断单元322,用于判断所述预设目标对象对应的像素的颜色值是否为第一颜色值。The judging unit 322 is configured to judge whether the color value of the pixel corresponding to the preset target object is the first color value.
第一设置单元323,用于在判断单元的判断结果为是时,设置所述图像上其余部分的像素的颜色值为第二颜色值。The first setting unit 323 is configured to set the color values of the remaining pixels on the image to the second color value when the determination result of the determination unit is yes.
第二设置单元324,用于在判断单元的判断结果为否时,设置所述预设目标对象对应的像素的颜色值为第一颜色值以及设置所述图像上其余部分的像素的颜色值为第二颜色值。The second setting unit 324 is used to set the color value of the pixel corresponding to the preset target object to the first color value and set the color value of the remaining pixels on the image when the judgment result of the judging unit is No. The second color value.
优选地,所述颜色值为红绿蓝RGB格式,包括红色分量像素值、绿色分量像素值和蓝色分量像素值。镜头采集的图像经过图像传感器后输出的图像数据格式为yuv格式时,则将所述yuv格式的图像数据转换成RGB格式数据。Preferably, the color value is in a red-green-blue RGB format, including a red component pixel value, a green component pixel value and a blue component pixel value. When the image captured by the lens passes through the image sensor and the output image data format is in the yuv format, the image data in the yuv format is converted into RGB format data.
优选地,所述装置还包括:Preferably, the device also includes:
启动模块33,用于在启动拍照功能时,开启预设目标对象检测功能,以获取镜头所采集的图像中的预设目标对象。The starting module 33 is configured to start the preset target object detection function when the camera function is started, so as to obtain the preset target object in the image captured by the lens.
在本发明实施例中,所述第一颜色值可以为用户在拍摄前设定的颜色值,也可以为所启动的预设目标拍照功能中规定的目标对象对应的颜色值。所述第二颜色值可以为用户在拍摄前设定的颜色值,也可以为经过用户设定的滤镜处理后对应的颜色值,比如黑白滤镜、怀旧滤镜、浅绿色滤镜、色调滤镜、冲印滤镜等。因此,上述第二设置单元324设置图像上其余部分的像素的颜色值为第二颜色值的方式可以为直接设置图像上其余部分的像素的颜色值为拍照前设定的颜色值,也可以为按照用户设定的滤镜处理方式对图像上的其余部分的像素进行处理,使得处理后的像素的颜色值为第二颜色值。示例性地,所述第二颜色值为像素的灰度值(即黑白)、怀旧滤镜后的暗黄色、浅绿色滤镜后的浅绿色等。In the embodiment of the present invention, the first color value may be the color value set by the user before shooting, or may be the color value corresponding to the target object specified in the activated preset target photographing function. The second color value can be the color value set by the user before shooting, or the corresponding color value after the filter processing set by the user, such as black and white filter, nostalgic filter, light green filter, color tone Filters, Print Filters, etc. Therefore, the above-mentioned second setting unit 324 can set the color value of the pixel of the remaining part of the image to the second color value by directly setting the color value of the pixel of the remaining part of the image to the color value set before taking pictures, or it can be The rest of the pixels on the image are processed according to the filter processing method set by the user, so that the color value of the processed pixel is the second color value. Exemplarily, the second color value is the gray value of the pixel (that is, black and white), dark yellow after nostalgic filter, light green after light green filter, and the like.
需要说明的是,本发明实施例中的装置可以用于实现上述方法实施例中的全部技术方案,其各个功能模块的功能可以根据上述方法实施例中的方法具体实现,其具体实现过程可参照上述实施例中的相关描述,此处不再赘述。It should be noted that the device in the embodiment of the present invention can be used to realize all the technical solutions in the above method embodiment, and the functions of each functional module can be realized according to the method in the above method embodiment, and the specific implementation process can refer to Relevant descriptions in the foregoing embodiments will not be repeated here.
本发明实施例通过在镜头采集图像后,获取所述图像中每一个像素的颜色值;在检测到所述图像中包含预设目标对象时,设置所述预设目标对象对应的像素的颜色值为第一颜色值以及设置所述图像上其余部分的像素的颜色值为第二颜色值;其中,所述图像上其余部分的像素为所述图像上除所述预设目标对象对应的像素外的其余像素,从而实现了单色拍照,所获取的照片在预设目标对象上以预设颜色突出显示,而除预设目标对象外的其余部分则显示其他颜色,大大地提升了所拍摄图像的艺术感,也提升了用户的拍摄体验感。In the embodiment of the present invention, after the lens captures the image, the color value of each pixel in the image is acquired; when the preset target object is detected in the image, the color value of the pixel corresponding to the preset target object is set be the first color value and set the color value of the rest of the pixels on the image to the second color value; wherein, the rest of the pixels on the image are the pixels on the image except for the pixels corresponding to the preset target object The rest of the pixels, so as to achieve monochrome photography, the acquired photo is highlighted in the preset color on the preset target object, while the rest of the preset target object is displayed in other colors, greatly improving the captured image The artistic sense also enhances the user's shooting experience.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein 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 several 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,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。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 media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc., which can store program codes. .
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应所述以权利要求的保护范围为准。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 (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510096220.3A CN104660905B (en) | 2015-03-04 | 2015-03-04 | Take pictures processing method and processing device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510096220.3A CN104660905B (en) | 2015-03-04 | 2015-03-04 | Take pictures processing method and processing device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104660905A true CN104660905A (en) | 2015-05-27 |
CN104660905B CN104660905B (en) | 2018-03-16 |
Family
ID=53251561
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510096220.3A Expired - Fee Related CN104660905B (en) | 2015-03-04 | 2015-03-04 | Take pictures processing method and processing device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104660905B (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105516606A (en) * | 2016-01-21 | 2016-04-20 | 努比亚技术有限公司 | Shooting device and method |
CN106101666A (en) * | 2016-06-30 | 2016-11-09 | 维沃移动通信有限公司 | The method of a kind of image color reservation and mobile terminal |
CN106791379A (en) * | 2016-12-05 | 2017-05-31 | 奇酷互联网络科技(深圳)有限公司 | Method and device based on the synthesis of dual camera image |
CN106791733A (en) * | 2016-12-05 | 2017-05-31 | 奇酷互联网络科技(深圳)有限公司 | Method and device based on the synthesis of single camera image |
CN108206917A (en) * | 2017-12-29 | 2018-06-26 | 中兴通讯股份有限公司 | The method and device of image procossing, storage medium, electronic device |
CN112532869A (en) * | 2018-10-15 | 2021-03-19 | 华为技术有限公司 | Image display method in shooting scene and electronic equipment |
CN113395441A (en) * | 2020-03-13 | 2021-09-14 | 华为技术有限公司 | Image color retention method and device |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1372109A2 (en) * | 2002-05-31 | 2003-12-17 | Eastman Kodak Company | Method and system for enhancing portrait images |
US20050286785A1 (en) * | 2004-06-29 | 2005-12-29 | Zink Scott E | Area mapped compressed image bit budget monitor |
CN102254307A (en) * | 2011-07-15 | 2011-11-23 | 深圳市万兴软件有限公司 | Color translation processing method and device |
CN102546945A (en) * | 2012-01-04 | 2012-07-04 | 广东步步高电子工业有限公司 | How to automatically optimize mobile phone photos |
CN102917158A (en) * | 2012-09-07 | 2013-02-06 | 中兴通讯股份有限公司 | Dynamic color replacing device and method as well as cellphone |
CN103605975A (en) * | 2013-11-28 | 2014-02-26 | 小米科技有限责任公司 | Image processing method and device and terminal device |
CN103763475A (en) * | 2014-01-28 | 2014-04-30 | 宇龙计算机通信科技(深圳)有限公司 | Photographing method and device |
CN103914699A (en) * | 2014-04-17 | 2014-07-09 | 厦门美图网科技有限公司 | Automatic lip gloss image enhancement method based on color space |
-
2015
- 2015-03-04 CN CN201510096220.3A patent/CN104660905B/en not_active Expired - Fee Related
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1372109A2 (en) * | 2002-05-31 | 2003-12-17 | Eastman Kodak Company | Method and system for enhancing portrait images |
CN1475969A (en) * | 2002-05-31 | 2004-02-18 | ��˹���´﹫˾ | Method and system for intensify human image pattern |
US20050286785A1 (en) * | 2004-06-29 | 2005-12-29 | Zink Scott E | Area mapped compressed image bit budget monitor |
CN102254307A (en) * | 2011-07-15 | 2011-11-23 | 深圳市万兴软件有限公司 | Color translation processing method and device |
CN102546945A (en) * | 2012-01-04 | 2012-07-04 | 广东步步高电子工业有限公司 | How to automatically optimize mobile phone photos |
CN102917158A (en) * | 2012-09-07 | 2013-02-06 | 中兴通讯股份有限公司 | Dynamic color replacing device and method as well as cellphone |
CN103605975A (en) * | 2013-11-28 | 2014-02-26 | 小米科技有限责任公司 | Image processing method and device and terminal device |
CN103763475A (en) * | 2014-01-28 | 2014-04-30 | 宇龙计算机通信科技(深圳)有限公司 | Photographing method and device |
CN103914699A (en) * | 2014-04-17 | 2014-07-09 | 厦门美图网科技有限公司 | Automatic lip gloss image enhancement method based on color space |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105516606A (en) * | 2016-01-21 | 2016-04-20 | 努比亚技术有限公司 | Shooting device and method |
CN106101666A (en) * | 2016-06-30 | 2016-11-09 | 维沃移动通信有限公司 | The method of a kind of image color reservation and mobile terminal |
CN106791379A (en) * | 2016-12-05 | 2017-05-31 | 奇酷互联网络科技(深圳)有限公司 | Method and device based on the synthesis of dual camera image |
CN106791733A (en) * | 2016-12-05 | 2017-05-31 | 奇酷互联网络科技(深圳)有限公司 | Method and device based on the synthesis of single camera image |
CN108206917A (en) * | 2017-12-29 | 2018-06-26 | 中兴通讯股份有限公司 | The method and device of image procossing, storage medium, electronic device |
CN112532869A (en) * | 2018-10-15 | 2021-03-19 | 华为技术有限公司 | Image display method in shooting scene and electronic equipment |
KR20210064330A (en) * | 2018-10-15 | 2021-06-02 | 후아웨이 테크놀러지 컴퍼니 리미티드 | Methods and electronic devices for displaying images during photo taking |
US11223772B2 (en) | 2018-10-15 | 2022-01-11 | Huawei Technologies Co., Ltd. | Method for displaying image in photographing scenario and electronic device |
JP2022512715A (en) * | 2018-10-15 | 2022-02-07 | 華為技術有限公司 | Photography scenarios and methods for displaying images on electronic devices |
JP7238115B2 (en) | 2018-10-15 | 2023-03-13 | 華為技術有限公司 | Photography scenarios and methods for displaying images on electronic devices |
US11696018B2 (en) | 2018-10-15 | 2023-07-04 | Huawei Technologies Co., Ltd. | Method for displaying image in photographing scenario and electronic device |
CN113395441A (en) * | 2020-03-13 | 2021-09-14 | 华为技术有限公司 | Image color retention method and device |
Also Published As
Publication number | Publication date |
---|---|
CN104660905B (en) | 2018-03-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104660905A (en) | Shooting processing method and device | |
WO2017008377A1 (en) | Image processing method and terminal | |
CN104883504B (en) | Open the method and device of high dynamic range HDR functions on intelligent terminal | |
CN105049718A (en) | Image processing method and terminal | |
CN104735362B (en) | Photographic method and device | |
CN110008783A (en) | Human face in-vivo detection method, device and electronic equipment based on neural network model | |
JP5110098B2 (en) | Display processing apparatus and program | |
CN107704798B (en) | Image blurring method, apparatus, computer-readable storage medium, and computer device | |
CN104754239A (en) | Photographing method and device | |
CN115550570B (en) | Image processing method and electronic device | |
EP4175275B1 (en) | White balance processing method and electronic device | |
CN107172354A (en) | Method for processing video frequency, device, electronic equipment and storage medium | |
CN104780313A (en) | Image processing method and mobile terminal | |
WO2023124201A1 (en) | Image processing method and electronic device | |
CN105611132A (en) | Exposure control method and device | |
CN104486546A (en) | Photographing method and device and mobile terminal | |
CN116668838B (en) | Image processing methods and electronic equipment | |
CN106982327B (en) | Image processing method and device | |
EP4195679B1 (en) | Image processing method and electronic device | |
US20080170812A1 (en) | Image composition processing method, computer system with image composition processing function | |
CN107454374B (en) | Image processing device, image processing method, and image processing system | |
CN108401119B (en) | An image processing method, mobile terminal and related media products | |
CN116437198B (en) | Image processing method and electronic equipment | |
CN105979151B (en) | A kind of image processing method and terminal | |
WO2023151210A1 (en) | Image processing method, electronic device and computer-readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20170411 Address after: Changan town in Guangdong province Dongguan 523841 usha Beach Road No. 18 Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. Address before: 518000 Guangdong city of Shenzhen province Nanshan District Gao Xin Road No. 013 Fu technology building B block 6 Building Applicant before: SHENZHEN OPPO COMMUNICATION SOFTWARE Co.,Ltd. |
|
TA01 | Transfer of patent application right | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address |
Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Patentee after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. Address before: Changan town in Guangdong province Dongguan 523841 usha Beach Road No. 18 Patentee before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. |
|
CP03 | Change of name, title or address | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20180316 |
|
CF01 | Termination of patent right due to non-payment of annual fee |