CN108093178A - A kind of method and shooting mobile phone that the variation of the photo colour of skin is realized by PCA linear transformations - Google Patents

A kind of method and shooting mobile phone that the variation of the photo colour of skin is realized by PCA linear transformations Download PDF

Info

Publication number
CN108093178A
CN108093178A CN201810005801.5A CN201810005801A CN108093178A CN 108093178 A CN108093178 A CN 108093178A CN 201810005801 A CN201810005801 A CN 201810005801A CN 108093178 A CN108093178 A CN 108093178A
Authority
CN
China
Prior art keywords
skin
pca
colour
mobile phone
colourity
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.)
Pending
Application number
CN201810005801.5A
Other languages
Chinese (zh)
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.)
Shanghai Chuanying Information Technology Co Ltd
Original Assignee
Shanghai Chuanying Information Technology 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 Shanghai Chuanying Information Technology Co Ltd filed Critical Shanghai Chuanying Information Technology Co Ltd
Priority to CN201810005801.5A priority Critical patent/CN108093178A/en
Publication of CN108093178A publication Critical patent/CN108093178A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/62Control of parameters via user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/213Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
    • G06F18/2135Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods based on approximation criteria, e.g. principal component analysis
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/10Cameras or camera modules comprising electronic image sensors; Control thereof for generating image signals from different wavelengths
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/61Control of cameras or camera modules based on recognised objects
    • H04N23/611Control of cameras or camera modules based on recognised objects where the recognised objects include parts of the human body

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Telephone Function (AREA)

Abstract

The invention discloses a kind of method for realizing that by linear transformation the photo colour of skin changes, comprising:Before taking pictures, color parameter, debugging saturation degree, colourity, gray scale are detected with PCA;When taking pictures, the parameter of the random call colour of skin or the colour of skin wanted by user's selection;S3, according to the different colours of skin, corresponding selection different saturation, colourity, gray value correspond to the parameter of the colour of skin by debugging, achieve the effect that change the colour of skin in PCA.The present invention produces the different colours of skin by the customized mostly set parameters that dissolve of PCA, PCA is as a kind of effective Principal Component Analysis, the validity feature of target can easily be extracted, reduce the complexity of data processing, it is suitble to mobile phone application, the different colours of skin is produced by the customized mostly set parameters that dissolve of PCA, achievees the purpose that entertaining self-timer flexibly changes skin according to the demand progress of client.

Description

A kind of method and shooting mobile phone that the variation of the photo colour of skin is realized by PCA linear transformations
Technical field
The present invention relates to image processing fields, apply in the photo disposal of mobile phone shooting, in particular to one kind passes through line Property conversion realize the method and shooting mobile phone of the variation of the photo colour of skin.
Background technology
The appearance of mobile phone changes people’s lives mode.Current phone industry quickly develops, diversified Function enters the visual field of people, it has been not only the communication tool sent short messages that can make a phone call, and requirement of the people to him is more next It is higher.Instantly for mobile phone photograph into mainstream, people like that sharing the photo of oneself in social networks shows life.For liking It is beautiful for the people to take pictures, it is a thing that cannot at all put up with.More and more fans that take pictures are keen to entertaining and take pictures, Show different style, embody the individual character of oneself.Since first item shooting mobile phone Sharp J-SH04 appears on the market, mobile phone is taken pictures Function just puts forth effort to publicize by each producer always, and the camera function of flagship mobile phone is all greatly shown off in each news conference, together When also paid attention to by consumer.This attention has also been continued until now.
Mobile phone photograph from introduction to specialty early in this wheel smart mobile phone spring tide arriving before, based on function machine when In generation, Sony Ericsson just has to take pictures equally has the N for taking pictures and intelligently laying equal stress on serial for leading K/C series, Nokia, at these It is considered as by later age in classical series of taking pictures, we have witnessed pixel from 200 ten thousand to 1,200 ten thousand, have witnessed CMOS from ignoring Size rise to 1/2.5 inch, again to 1/1.83 inch, witnessed mechanical shutter, iris ring, xenon flash lamp, optics The function that zoom etc. is only just seen on camera originally is appeared on mobile phone ...
Although being nowadays 4G popularizations, 5G near, opposite 2G networks have real qualitative change, country's mobile Internet to start Basis WCDMA networks be just to start commercialization on October 1st, 2009, and attend by WCDMA networks together with Consumption of China Person's meeting is the iPhone 3GS for entering inland of China market for the first time at that time.Back to back 2010 and 2011, user The lower Android of threshold starts to enter China on a large scale, and the speed of mobile Internet and contemporary smart mobile phone popularization is greatly Soon, it is the social networks of fulcrum also in continuous refreshes user alive data using mobile phone.The photo that consumer is taken with mobile phone has Splendid usage scenario (including being not limited to sharing on social networks), requirement of the consumer for mobile phone photograph is originally It is further improved on not low Demand Base.For example, the related personnel of OPPO just revealed to love model, returned according to consumer It visits, OPPO mobile phone users more like taking pictures and sharing.
On the other hand, have benefited from Sony of CMOS suppliers important in industry technique continuously improve with new technology should With the image quality of mobile phone photograph is enhanced in the case where CMOS size constancies even become smaller.When image quality is guaranteed certain On level, the performance of CMOS is also steadily increasing.For example, cmos data bandwidth greatly improves, then it is combined with mobile phone ISP performances Enhancing, this just allows a variety of styles (background blurring, multiframe noise reduction, panning mode etc.) of mobile phone photograph to be possibly realized;For another example, The upper focus point quantity of CMOS is significantly increased, and the rate in blocks of mobile phone photograph is allowed to improve much.
Following mobile phone photograph image quality may may proceed to be enhanced, but this amplitude may be less and less or even small To ignoring.Final situation is perhaps mobile phone on the premise of certain image quality of taking pictures is ensured, the importance of image quality can allow Industrial design, manipulation experience and playability positioned at mobile phone.Camera function is from being logged in mobile phone, just always by producer and consumer Pay attention to.Its first stage developed, the constantly integrated function from card camera of mobile phone become increasingly " specialty ";In mobile phone It takes pictures the second stage of development, as social networks becomes the main application scenarios of cell phone pictures and is limited to the body of mobile phone Product and thickness, mobile phone are no longer pursued " specialty ", then pursue " entertaining " and " handy ".Basic reason or because consumer couple The experience taken pictures becomes variation, and differentiation attraction is built using these effects of taking pictures by producer.Entertaining is taken pictures and is usually being shot In add in various styles and special efficacy in real time, such as oil painting, miss old times or old friends, sketch comprising diversified basic lens.Human body complexion becomes Change, can allow photographer's experience it is different oneself, can more increase the enjoyment of shooting.
The method that the prior art realizes human body complexion conversion generally use correction, such as Publication No. CN103065290A Invention《The apparatus and method that flesh correction is carried out in photo》Disclose a kind of device of the correct skin tones in photo, the device Including:Setup module, for setting personage colour of skin colourity section and the acquiescence colour of skin in the photo of shooting;Photo module is used for Shoot photo and storage photo caching;Identification module, for the skin area in photo to be identified;Processing module is used In control more than modules for controlling more than modules, and by the colourity of the image data after identification module identifies Space is transformed into YCbCr space, and flesh correction processing is carried out to chrominance C b, Cr, and the colour of skin shown on photo is made to be in described and is set In the colour of skin colourity section for putting module setting.Furthermore, it is understood that identification module therein is to detect photo by detection unit The skin area of middle personage calculates the colour of skin colourity section for judging that the colour of skin of the skin area is in by judging unit, Selecting unit is used to select suitable colour of skin colourity section from judging result.Processing module therein is also stored with acquiescence skin Color can select the acquiescence colour of skin according to user, set the colour of skin of personage in photo.
Or the invention of Publication No. CN103325089A《Colour of skin processing method and processing device in image》Disclose one kind Colour of skin processing method in image, includes the following steps:Obtain colour of skin process instruction;Skin is triggered by the colour of skin process instruction Color model extracts the area of skin color of image;The area of skin color is adjusted according to the colour of skin process instruction.Skin in above-mentioned image After colour of skin process instruction is obtained, the area of skin color of image is extracted by complexion model for color processing method and system, and then The area of skin color of extraction is adjusted, for a user image is only needed to import and input colour of skin process instruction can accomplished pin Processing to area of skin color in image need not be concerned about concrete implementation details, improve operational convenience.It is being handled It further includes in the process:
The area of skin color of extraction is filtered, rejects the noise spot in area of skin color;
The colour of skin is acquired before triggering the step of complexion model extracts the area of skin color of image by colour of skin process instruction Image, and the bianry image of the broca scale picture is obtained, go out the area of skin color in broca scale picture using binary image segmentation;
The bianry image is trained to obtain complexion model:
First step carries out color space conversion to bianry image and obtains the bianry image in hsv color space;
Second step is trained to obtain complexion model by Bayesian model to the bianry image in hsv color space.
The thinking invented above is photo to be post-processed to realize skin color transition upon taking a picture, and another thinking is being clapped Change the colour of skin according to the preceding setting by ambient light.
For example, the invention of Publication No. CN104683701A《A kind of front camera that optimizes is from middle face complexion of taking a picture Method and system》A kind of front camera that optimizes is disclosed from the method for middle face complexion of taking a picture, is specifically included following The step of:Step 1: the pure color picture of setting different colours, user select different colors according to the colour of skin and current light source situation Face complexion is optimized as light filling color;Step 2: after user starts self-timer, front camera starts, in user When starting to take pictures, the pure color picture of the selected color of step display one, and by the brightness adjustment of display screen to most on a display screen It is high;Step 3: the brightness of display screen and the color of pure color picture is kept to be completed until taking pictures, then remove pure on display screen Chromatic graph piece and by the luminance recovery of display screen to original value.Under different light conditions, the face after shooting is present with general Red or green tinged situation, it is therefore desirable to different color compensations is carried out according to different light conditions, face complexion is balanced, makes one The face colour of skin is more natural.
For another example existing patent application CN201310315531.5 discloses a kind of self-timer light compensation method, self-timer light compensating apparatus And electronic equipment.The self-timer light compensation method includes step:A, receive self-timer enabled instruction, and according to self-timer enabled instruction start before Camera is put, to gather picture signal;B, according to picture signal, the luminance information of current environment is obtained;C, according to current environment Luminance information, it is determined whether carry out light filling operation;And D, such as progress light filling operation, then believed according to the brightness of current environment Breath carries out light filling operation using the backlight of display screen.Its specific light filling process is:As supplementary lighting module judges current environment brightness Less than the ambient brightness of setting, then for supplementary lighting module according to the ambient brightness of setting and the difference of current environment brightness, calculating should The backlight illumination of supplement;Then according to the backlight illumination that should be supplemented calculated, the backlight of corresponding bright is used in display screen Show pure color picture, and in order to ensure that the color for supplementing backlight will not have an impact photo environment, it can generally use pure white figure Piece or pure gray scale picture.
Above in the prior art, the method operand of post processing of image is big, and implementation complexity is higher, in computer equipment It can realize, although the processing capacity of mobile phone has been greatly improved, but still can not achieve this method;And adjust ambient light The headlamp (such as flash lamp) that is configured to mobile phone of method have higher requirement, multiple color, the light of intensity can be given out, Existing mobile phone does not satisfy the requirements also, and the controllability of method is low, dependent on the manual adjusting of operator, thus does not also benefit from The welcome at family.
In short, the innovative technology applied and the colour of skin is converted in mobile phone photograph is also lacked in the prior art.
The content of the invention
The present invention provides a kind of method and shooting mobile phone that the variation of the photo colour of skin is realized by PCA linear transformations, realizes and shines The phase colour of skin is converted, and reduces equipment amount of calculation.
To achieve the above object, the present invention provides a kind of method that the variation of the photo colour of skin is realized by PCA linear transformations, Feature is to comprise the following steps:
Before taking pictures, color parameter, debugging saturation degree, colourity, gray scale are detected with PCA linear transformations by step S1;
Step S2 when taking pictures, randomly chooses a kind of colour of skin or by the desired colour of skin of user's selection;
Step S3, according to the colour of skin, saturation degree, colourity, the parameter of gray value, pass through the PCA described in corresponding selection The customized generation of linear transformation covers the saturation degree, colourity, gray scale more, and produces the different colours of skin.
Above-mentioned steps S1 specifically includes following sub-step:
Step S101, eigencenter extract each dimension PCA data of image, every one-dimensional data are all subtracted the dimension Average;
Step S102 calculates the covariance matrix of the PCA data and characteristic value, feature vector;
Step S103 sorts to the characteristic value, selects the relevant characteristic value of the colour of skin and described eigenvector, The parameter set being simplified;
Step S104 debugs camera, detects the corresponding saturation degree of different color, colourity, the parameter of gray value, Debug described and corresponding the PCA characteristic values and feature vector.
Above-mentioned steps S3 includes following sub-step:
Step S301 calculates saturation degree;
Step S302 extracts the characteristic value for representing brightness and reservation from original image;
Step S303 calculates contrast;
Also, the calculating saturation degree and calculating contrast, the parameter value used in calculating is according to the step User selects in rapid S2 the hobby colour of skin and it is pre-set.
Started by the software of mobile phone by user or started by the Face datection software in mobile phone described by described The customized generation of PCA linear transformations covers the saturation degree, colourity, gray scale more, and produces the different colours of skin.
A kind of shooting mobile phone that the variation of the photo colour of skin is realized by linear transformation, its main feature is that, comprising
Pre- debugging module is debugged for camera, and color parameter, debugging saturation degree, color are detected using PCA linear transformations Degree, grey parameter generate PCA characteristic values and feature vector corresponding to different parameters;
Photo module, for shooting the photo with face;
Skin color transition module, saturation degree, colourity, the parameter of gray value described in corresponding selection, passes through the PCA linear transformations Customized generation covers the saturation degree, colourity, gray scale more, and produces the different colours of skin.
It is opened by the software of mobile phone by user or is opened by the Face datection software in mobile phone, by described in unlatching Switch enables the skin color transition module.
The data of photo captured by storage unit storage are further included in above-mentioned photo module.
Above-mentioned pre- debugging module includes following submodule,
Submodule is pre-processed, each dimension PCA data of the photograph image is extracted, every one-dimensional data is all subtracted into the dimension Average, carry out eigencenter processing;
Feature calculation submodule calculates the covariance matrix of the PCA data and characteristic value, feature vector;
Colour of skin PCA feature extraction submodules sort to the characteristic value of the PCA data, select colour of skin associated eigenvalue Corresponding feature vector obtains new data set;
PCA matched sub-blocks debug camera, detect the different color corresponding saturation degree, colourity, gray value Parameter debugs described and corresponding the PCA characteristic values and feature vector.
Above-mentioned skin color transition module includes, saturation computation submodule, and brightness extracting sub-module and contrast calculate son Module.
A kind of method changed by the PCA linear transformations realization photo colour of skin of the present invention and shooting mobile phone and prior art phase Than the advantage is that, the present invention produces the different colours of skin by the customized mostly set parameters that dissolve of PCA, and PCA technologies have as one kind The Principal Component Analysis of effect, it may be convenient to extract the validity feature of target, in Camera debugging, color is detected with PCA Parameter, saturation degree and hue values (colourity) in tuning parameter control the color of object, then by PCA it is customized dissolve it is more Set parameter produces the different colours of skin, to achieve the purpose that entertaining self-timer flexibly changes skin according to the demand progress of client, makes The workload of index selection can be reduced with PCA methods, reduces amount of calculation compared with the prior art.
Description of the drawings
It in order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is attached drawing needed in technology description simply to be introduced, it is clear that, the accompanying drawings in the following description is the present invention Some embodiments, for those of ordinary skill in the art, without having to pay creative labor, can be with root Other attached drawings are obtained according to these attached drawings.
Fig. 1 is a kind of flow diagram for the method that the variation of the photo colour of skin is realized by linear transformation in the present invention;
Fig. 2 is the sub-process schematic diagram of step S1 in first preferred embodiment of the invention;
Fig. 3 is the sub-process schematic diagram of step S3 in second preferred embodiment of the invention;
Fig. 4 is a kind of structure diagram for the shooting mobile phone that the variation of the photo colour of skin is realized by linear transformation in the present invention;
Fig. 5 is the structure diagram of the pre- debugging module of shooting mobile phone in the present invention;
Fig. 6 is the structure diagram of the skin color transition module of shooting mobile phone in the present invention.
Specific embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, the technical solution in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is Part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art All other embodiments obtained without making creative work belong to the scope of protection of the invention.
It should be noted that herein, the relational terms (if present) such as " first ", " second ", " the 3rd " is only Only it is used for distinguishing one entity or operation from another entity or operation, without necessarily requiring or implying these realities There are any actual relationship or orders between body or operation.It should be appreciated that the term so used is in the appropriate case Can exchange, so as to the embodiment of the present invention described herein, such as can with except illustrate or describe herein those with Outer order is implemented.In addition, term " comprising ", "comprising", " having " or its any other variant are intended to nonexcludability Include so that process, method, article or terminal device including a series of elements not only include those elements, and And it further includes other elements that are not explicitly listed or further includes as this process, method, article or terminal device institute Intrinsic element.In the absence of more restrictions, the element limited by sentence " including ... " or " including ... ", not Also there are other elements in the process including the element, method, article or terminal device for exclusion.In addition, herein In, " being more than ", " being less than ", " being more than " etc. are interpreted as not including this number;" more than ", " following ", " within " etc. be interpreted as including this Number.
Below in conjunction with Fig. 1~Fig. 6, technical scheme is described in detail with specifically embodiment.Below this Several specific embodiments can be combined with each other, may be no longer superfluous in some embodiments for the same or similar concept or process It states.
Referring to Fig. 1, be the flow diagram of the method that the variation of the photo colour of skin is realized by linear transformation of the present embodiment, Include the following steps:
Before taking pictures, color parameter, debugging saturation degree, colourity, gray scale are detected with PCA by S1.
S2, when taking pictures, the parameter of the random call colour of skin or the colour of skin wanted by user's selection.
S3, according to the different colours of skin, corresponding selection different saturation, colourity, gray value correspond to skin by debugging in PCA The parameter of color achievees the effect that change the colour of skin.The different colours of skin is produced by the customized mostly set parameters that dissolve of PCA.
In statistics, principal component analysis (principal components analysis, PCA) is a kind of simplified number According to the technology of collection.It is a linear transformation.This conversion is transformed the data into a new coordinate system so that any number According to the first big variance of projection on first coordinate (being known as first principal component), second largest variance is in second coordinate (second Principal component) on, and so on.Principal component analysis reduces the dimension of data set through common, at the same keep data set to variance tribute Offer maximum feature.This is by retaining low order principal component, ignoring what high-order principal component was accomplished.So low order ingredient tends to Retain the most important aspect of data.
Initial data is transformed to the expression of one group of each dimension linear independence by linear transformation by PCA, available for extracting number According to main feature component, PCA be not only to high dimensional data carry out dimensionality reduction, it is often more important that eliminate noise by dimensionality reduction, The pattern being found that in data.Principal component analysis is also referred to as principal component analysis, it is intended to using the thought of dimensionality reduction, multi objective be converted into A few overall target.Be in the present embodiment PCA be applied to cell phone pictures image procossing, original photograph image number According to by a small amount of m feature substitution, m feature is independent linear combination each other.
In the first preferred embodiment of the present invention, referring to Fig. 2, step S1 includes following sub-step:
Step S101, eigencenter, this step are also named pretreatment.Each dimension PCA data of image is extracted, it will be per one-dimensional Data all subtract the average of the dimension.What " dimension " here referred to is exactly a feature (or attribute), per one-dimensional equal after conversion Value all becomes 0.
Specifically in project treatment, photograph image is carried out using overlap partition mode to be blocked into multiple subgraphs, according to The subgraph that the expected matrix processing subgraph of all subgraphs is standardized, according to row significant samples probability and arranges important sample The row and column that the subgraph that this probability randomly selects standardization specifies number forms the subgraph main information matrix, is denoted as original number According to matrix A, after each row of A are subtracted the column mean, matrix B is obtained.The essence of pretreatment is that coordinate origin is moved on to sample point Central point.
Step S102 calculates the covariance matrix of PCA data and characteristic value, feature vector
The covariance matrix of PCA data is calculated first, is then calculated covariance matrix and is carried out Eigenvalues Decomposition, acquires association side The characteristic value and feature vector of poor matrix.Covariance illustrates that feature vector is positive correlation for timing, special when covariance is bears Sign vector is negative correlativing relation, and feature vector is mutual indepedent when covariance is 0.
There are many mathematical methods to realize the calculating of covariance matrix, are usually two-dimensional data for cell phone pictures image, 2D-PCA methods may be employed, Feature Dimension Reduction is carried out to image, the image array of higher-dimension is converted to the image array of low-dimensional;It will be low The image array of dimension is converted into a dimensional vector;According to a dimensional vector of training set image, divergence in the class of training set is acquired Matrix SW and class scatter matrix SB, then does Eigenvalues Decomposition to SW and S B respectively:With D_A, D_B estimations acquire respectively The column space W2 of column space W1 sums obtains the optimal projector space W=of the feature extraction algorithm of the two-stage LDA based on 2D-PCA [W1,W2];Low-dimensional image array is projected in optimal projector space W, obtains the feature vector of image.
Step S103 sorts to characteristic value, selects the corresponding feature vector of the relevant characteristic value of the colour of skin, obtain new number According to collection.
Selecting step, which generally comprises, sorts from big to small to characteristic value, retains k maximum feature vector, then by data It is transformed into the new space of k feature vector structure.Assuming that sample number is m, characteristic n subtracts the sample matrix after average For DataAdjust (mXn), covariance matrix is nXn, and the matrix of the k feature vector composition of selection is EigenVectors (nXk).So project after data FinalData be
FinalData (m × k)=DataAdjust (m × n) × EigenVectors (n × k)
So, the n dimensional features of original sample are just become into k dimensions, this k dimensions are exactly projection of the primitive character in k dimensions, generation The original n feature of table.
In the present embodiment, tieed up using the colour of skin as k only retain after the one-dimensional or dimensionality reduction in main feature the colour of skin this Feature gets rid of other features as main feature, has thus obtained main feature --- the colour of skin of our concerns.
Step S104 debugs Camera, detects different color parameter, saturation degree and hue value (colors in tuning parameter Degree) corresponding to PCA characteristic values and feature vector.
In the second preferred embodiment of the present invention, saturation degree, colourity, gray value calculating process corresponding to the colour of skin are introduced Step.
HSU color modes are a kind of color standards of industrial quarters, are by contrast (H), saturation degree (S), brightness (L) three The variation of a Color Channel and their mutual superpositions obtain miscellaneous color, this standard almost includes The all colours that human eyesight can perceive are current with one of most wide color system.
Brightness is the figure primary colors (form and aspect of the primary colors of such as RGB image for tri- kinds of R, G, B or various certainly) of a variety of colors The adjustment of shading value, brightness adjustment i.e. shading value.Brightness range is divided into 256 grades from 0 to 255.And we are usually The gray level image said, has divided the brightness of 256 ranks exactly between pure white and ater, that is, from vain to ash, then Turn black.Similarly, the shading value of the shading value, i.e. red green blue tricolor of a primary colors is then represented in RGB patterns, from shallow to depth.
Saturation degree is that the chroma of color of image has a kind of artificial defined standard color, saturation for each color Degree is exactly the physical quantity with the close degree between description color and standard color.It is exactly to adjust the coloured silk of image to adjust saturation degree Degree.When saturation degree item by an image is zero, image then becomes a gray level image.
Contrast is the difference between different colours.Contrast is bigger, and the difference between two kinds of colors is bigger, conversely, just It is closer.Such as, a width gray level image improve its contrast can be more in sharp contrast, during the limit being transferred to, become black white image, Conversely, we can obtain the painting canvas of a width grey.
Referring to Fig. 3, step S3 includes following sub-step:
Step S301, calculates saturation degree first
Saturation computation formula:Chroma=100%mean ((a*i_meas2+b*i_meas2) 1/2)/mean ((a*i_ ideal2+b*i_ideal2)1/2);
a*i_meas2:Color lump calculated corresponds to the average a of color lump.
b*i_meas2:Color lump calculated corresponds to the average b of color lump.
a*i_ideal2:As the corresponding average a of calculation template color lump.
b*i_ideal2:As the corresponding average b of calculation template color lump.
Next step S302 determines brightness, due to that the purpose of the present invention is changing the colour of skin of personage, need not change bright Degree, therefore the characteristic value for representing brightness, reservation need to be only extracted from original image.
Obtain image in brightness value the step of be:Facial image is converted into gray level image, gray level image is counted Calculation obtains brightness value.
Step S303, next calculates contrast, is divided into the following two kinds situation,
● the color error ratio Cab not comprising brightness:
A*i_corr=100a*i_meas/Sat;B*i_corr=100b*i_meas/Sat
Δ Ci_corr=| Ci_corr-Ci_ideal |=((a*i_corr-a*i_ideal) 2+ (b*i_corr-b*i_ ideal)2)1/2
● the color error ratio Eab comprising brightness:
Δ E*ab=((L2*-L1*) 2+ (a2*-a1*) 2+ (b2*-b1*) 2) 1/2;Δ C*=((a2*-a1*) 2+ (b2*- b1*)2)1/2
It needs to particularly point out, the parameter value in above-mentioned calculating, is pre- according to the hobby colour of skin that user in step S2 selects First it is arranged in mobile phone.Or in a further advantageous embodiment, mobile phone detects random call skin after face when taking pictures The parameter of color so that take pictures all show the different colours of skin at random every time.
In addition, in practical application, the premise for realizing above-mentioned steps is the people first parsed from photo under current scene Face image can realize the target there are many technical solution, and details are not described herein again.
It please refers to Fig.4, is a kind of shooting mobile phone that the variation of the photo colour of skin is realized by linear transformation of the embodiment of the present invention Structure diagram.Including,
The pre- debugging modules of M1 are debugged for Camera, and color parameter, debugging saturation degree, color are detected using PCA methods The parameters such as degree, gray scale generate PCA characteristic values and feature vector corresponding to different color parameter.
M2 photo modules, for shooting human face photo.Further, in the module institute is stored also with storage unit The data of photo are shot, for the processing of the subsequent conversion colour of skin.
M3 skin color transition modules, corresponding selection different saturation, colourity, gray value correspond to the colour of skin by debugging in PCA Parameter achievees the effect that change the colour of skin.The different colours of skin is produced by the customized mostly set parameters that dissolve of PCA.
Under preferable case, a switch M4 is further included, is opened or by the people in mobile phone by the software of mobile phone by user Face inspection software is opened, and skin color transition module is just enabled after unlatching.
Further, referring to Fig. 5, also including following submodule in the pre- debugging modules of M1:
M101 pre-processes submodule, extracts each dimension PCA data of image, every one-dimensional data are all subtracted the equal of the dimension Value carries out eigencenter processing.
M102 feature calculation submodules calculate the covariance matrix of PCA data and characteristic value, feature vector.
M103 colour of skin PCA feature extraction submodules sort to the characteristic value of M102 outputs, select the relevant feature of the colour of skin It is worth corresponding feature vector, obtains new data set.
M104PCA matched sub-blocks debug Camera, detect different color parameter, the saturation degree in tuning parameter with And PCA characteristic values and feature vector corresponding to hue values (colourity).
Further, referring to Fig. 6, also including following submodule in M3 skin color transition modules:
M301 saturation computation submodules,
M302 brightness extracting sub-modules,
M303 contrast computational submodules.
Summary, PCA is as a kind of effective Principal Component Analysis, it may be convenient to the validity feature of target is extracted, In Camera debugging, color parameter is detected with PCA, the saturation degree and hue values (colourity) in tuning parameter control object Then the color of body produces the different colours of skin by the customized mostly set parameters that dissolve of PCA.To reach entertaining self-timer according to visitor The demand at family flexibly change the purpose of skin.The workload of index selection can be reduced using PCA methods, compared with the prior art Reduce amount of calculation.
It should be understood by those skilled in the art that, the various embodiments described above can be provided as method, apparatus or computer program production Product.The embodiment in terms of complete hardware embodiment, complete software embodiment or combination software and hardware can be used in these embodiments Form.All or part of step in the method that the various embodiments described above are related to can instruct relevant hardware complete by program Into the program can be stored in the storage medium that computer equipment can be read, for performing the various embodiments described above method The all or part of step.
The various embodiments described above are with reference to method, equipment (system) and the computer program product according to embodiment Flowchart and/or the block diagram describes.It should be understood that it can be realized by computer program instructions every in flowchart and/or the block diagram The combination of flow and/or box in one flow and/or box and flowchart and/or the block diagram.These computers can be provided Program instruction is to the processor of computer equipment to generate a machine so that passes through the finger that the processor of computer equipment performs Order generates and is used to implement what is specified in one flow of flow chart or multiple flows and/or one box of block diagram or multiple boxes The device of function.
Although present disclosure is discussed in detail by above preferred embodiment, but it should be appreciated that above-mentioned Description is not considered as limitation of the present invention.After those skilled in the art have read the above, for the present invention's A variety of modifications and substitutions all will be apparent.Therefore, protection scope of the present invention should be limited to the appended claims.

Claims (9)

  1. A kind of 1. method that the variation of the photo colour of skin is realized by PCA linear transformations, which is characterized in that comprise the following steps:
    Before taking pictures, color parameter, debugging saturation degree, colourity, gray scale are detected with PCA linear transformations by step S1;
    Step S2 when taking pictures, randomly chooses a kind of colour of skin or by the desired colour of skin of user's selection;
    Step S3, according to the colour of skin, saturation degree, colourity, the parameter of gray value, linear by the PCA described in corresponding selection It converts customized generation and covers the saturation degree, colourity, gray scale more, and produce the different colours of skin.
  2. 2. according to the method described in claim 1, it is characterized in that, the step S1 specifically includes following sub-step:
    Step S101, eigencenter extract each dimension PCA data of image, every one-dimensional data are all subtracted the equal of the dimension Value;
    Step S102 calculates the covariance matrix of the PCA data and characteristic value, feature vector;
    Step S103 sorts to the characteristic value, selects the relevant characteristic value of the colour of skin and described eigenvector,
    The parameter set being simplified;
    Step S104 debugs camera, detects the corresponding saturation degree of different color, colourity, the parameter of gray value,
    Debug described and corresponding the PCA characteristic values and feature vector.
  3. 3. according to the method described in claim 1, it is characterized in that, the step S3 includes following sub-step:
    Step S301 calculates saturation degree;
    Step S302 extracts the characteristic value for representing brightness and reservation from original image;
    Step S303 calculates contrast;
    Also, the calculating saturation degree and calculating contrast, the parameter value used in calculating is according to the step S2 The hobby colour of skin of middle user selection and it is pre-set.
  4. 4. according to the method described in claim 1, it is characterized in that,
    Started by user by the software of mobile phone or by passing through the PCA lines described in the Face datection software startup in mobile phone Property the customized generation of conversion cover the saturation degree, colourity, gray scale more, and produce the different colours of skin.
  5. 5. a kind of shooting mobile phone that the variation of the photo colour of skin is realized by linear transformation, which is characterized in that include
    Pre- debugging module is debugged for camera, and color parameter is detected using PCA linear transformations, debugging saturation degree, colourity, Grey parameter generates PCA characteristic values and feature vector corresponding to different parameters;
    Photo module, for shooting the photo with face;
    Skin color transition module, saturation degree, colourity, the parameter of gray value described in corresponding selection are customized by the PCA linear transformations Metaplasia produces the different colours of skin into covering the saturation degree, colourity, gray scale more.
  6. 6. shooting mobile phone according to claim 5, which is characterized in that further include a switch, mobile phone is passed through by user Software is opened or opened by the Face datection software in mobile phone, and the skin color transition module is enabled by opening the switch.
  7. 7. shooting mobile phone according to claim 5, which is characterized in that storage unit storage is further included in the photo module The data of captured photo.
  8. 8. shooting mobile phone according to claim 5, which is characterized in that the pre- debugging module includes following submodule,
    Submodule is pre-processed, each dimension PCA data of the photograph image is extracted, every one-dimensional data is all subtracted into the equal of the dimension Value carries out eigencenter processing;
    Feature calculation submodule calculates the covariance matrix of the PCA data and characteristic value, feature vector;
    Colour of skin PCA feature extraction submodules sort to the characteristic value of the PCA data, select colour of skin associated eigenvalue correspondence Feature vector, obtain new data set;
    PCA matched sub-blocks debug camera, detect the corresponding saturation degree of different color, colourity, the ginseng of gray value Number debugs described and corresponding the PCA characteristic values and feature vector.
  9. 9. shooting mobile phone according to claim 5, which is characterized in that the skin color transition module includes, saturation computation Submodule, brightness extracting sub-module and contrast computational submodule.
CN201810005801.5A 2018-01-03 2018-01-03 A kind of method and shooting mobile phone that the variation of the photo colour of skin is realized by PCA linear transformations Pending CN108093178A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810005801.5A CN108093178A (en) 2018-01-03 2018-01-03 A kind of method and shooting mobile phone that the variation of the photo colour of skin is realized by PCA linear transformations

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810005801.5A CN108093178A (en) 2018-01-03 2018-01-03 A kind of method and shooting mobile phone that the variation of the photo colour of skin is realized by PCA linear transformations

Publications (1)

Publication Number Publication Date
CN108093178A true CN108093178A (en) 2018-05-29

Family

ID=62179914

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810005801.5A Pending CN108093178A (en) 2018-01-03 2018-01-03 A kind of method and shooting mobile phone that the variation of the photo colour of skin is realized by PCA linear transformations

Country Status (1)

Country Link
CN (1) CN108093178A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022212577A1 (en) * 2021-03-30 2022-10-06 Snap Inc. Inclusive camera

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101226591A (en) * 2008-01-31 2008-07-23 上海交通大学 Personal identification method based on mobile phone pick-up head combining with human face recognition technique
CN106845328A (en) * 2016-11-09 2017-06-13 广州市贺氏办公设备有限公司 A kind of Intelligent human-face recognition methods and system based on dual camera
CN107153807A (en) * 2016-03-03 2017-09-12 重庆信科设计有限公司 A kind of non-greedy face identification method of two-dimensional principal component analysis
CN107545536A (en) * 2017-08-17 2018-01-05 上海展扬通信技术有限公司 The image processing method and image processing system of a kind of intelligent terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101226591A (en) * 2008-01-31 2008-07-23 上海交通大学 Personal identification method based on mobile phone pick-up head combining with human face recognition technique
CN107153807A (en) * 2016-03-03 2017-09-12 重庆信科设计有限公司 A kind of non-greedy face identification method of two-dimensional principal component analysis
CN106845328A (en) * 2016-11-09 2017-06-13 广州市贺氏办公设备有限公司 A kind of Intelligent human-face recognition methods and system based on dual camera
CN107545536A (en) * 2017-08-17 2018-01-05 上海展扬通信技术有限公司 The image processing method and image processing system of a kind of intelligent terminal

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
冯亚丽 等: "一种改进的基于肤色分割和PCA人脸检测方法", 《科学技术与工程》 *
许国根 等: "《模式识别与智能计算的MATLAB实现 第2版》", 31 July 2017 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022212577A1 (en) * 2021-03-30 2022-10-06 Snap Inc. Inclusive camera

Similar Documents

Publication Publication Date Title
CN105409211B (en) For the automatic white balance positive with skin-color adjustment of image procossing
CN106165390B (en) Image processing apparatus, camera, image processing method
CN105144233B (en) Reference picture selection for moving ghost image filtering
CN103945104B (en) Information processing method and electronic equipment
CN107771336A (en) Feature detection and mask in image based on distribution of color
KR100791372B1 (en) Apparatus and method for facial image compensating
CN104636759B (en) A kind of method and picture filter information recommendation system for obtaining picture and recommending filter information
CN106101541A (en) A kind of terminal, photographing device and image pickup method based on personage's emotion thereof
CN108810406B (en) Portrait light effect processing method, device, terminal and computer readable storage medium
CN106412458A (en) Image processing method and apparatus
CN108876753A (en) Optional enhancing is carried out using navigational figure pairing growth exposure image
CN103745430B (en) Rapid beautifying method of digital image
CN108885785A (en) Motion Adaptive stream process for temporal noise reduction
CN106447604A (en) Method and device for transforming facial frames in videos
CN109242794A (en) Image processing method, device, electronic equipment and computer readable storage medium
CN102546945A (en) Method for automatically optimizing mobile phone photography
CN106815803B (en) Picture processing method and device
Zhao et al. Adaptive light estimation using dynamic filtering for diverse lighting conditions
CN109035151A (en) Image processing apparatus, image processing method and storage medium
CN114219976A (en) Image processing method, image processing device, electronic equipment, storage medium and computer product
KR20140124087A (en) System and method for recommending hair based on face and style recognition
CN111127367A (en) Method, device and system for processing face image
CN114120068A (en) Image processing method, image processing device, electronic equipment, storage medium and computer product
CN108093178A (en) A kind of method and shooting mobile phone that the variation of the photo colour of skin is realized by PCA linear transformations
CN113450431B (en) Virtual hair dyeing method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180529