Embodiment 1
According to embodiments of the present invention, there is provided a kind of embodiment of the method based on multiple photographic head composographs, needIt is bright, can hold in the such as computer system of one group of computer executable instructions the step of the flow process of accompanying drawing is illustratedOK, and, although show logical order in flow charts, but in some cases, can be with different from order hereinPerform shown or described step.
Fig. 1 is the method flow diagram based on multiple photographic head composographs according to embodiments of the present invention, as shown in figure 1,The method comprises the steps:
Step S102, is obtained the first image for containing destination object, is obtained by second camera by the first photographic headTake in the second image of synthesis destination object.
Specifically, in above-mentioned steps, destination object can be people to be shot or thing;First image can be byThe image for containing the destination object that one photographic head shoots;Second image can be for closing by second camera shootingInto the background image of above-mentioned destination object;In a kind of optional embodiment, the first photographic head can be the preposition of mobile devicePhotographic head, second camera can be the rear photographic head of the mobile device.
Alternatively, above-mentioned mobile device can be the Intelligent mobile equipments such as smart mobile phone, panel computer.
Step S104, obtains the synthesis region in the second image, wherein, it is the area according to pre-conditioned selection to synthesize regionDomain.
Specifically, in above-mentioned steps, above-mentioned synthesis region can in the second image according to the one of pre-conditioned selectionIndividual or multiple regions, in a kind of optional embodiment, user can select of arbitrary dimension size in the second imageRegion synthesizes the first image of destination object as synthesis region.
First image is synthesized to synthesis region, the 3rd image after being synthesized by step S106.
Specifically, in above-mentioned steps, above-mentioned 3rd image is that the first image for containing destination object is synthesized toThe image formed behind synthesis region in two images;The first image for containing destination object is obtained by the first photographic head, is led toCross second camera to obtain for synthesizing after the second image of destination object, obtain in the second image according to pre-conditioned selectionSynthesis region, the synthesis region the first image for containing destination object being synthesized in the second image, after being synthesizedThe 3rd image, the 3rd image is to contain the image of destination object and background image (the second image).
In a kind of optional embodiment, by taking mobile phone as an example, above-mentioned first photographic head can be the front-facing camera of mobile phone, onThe rear photographic head that second camera can be mobile phone is stated, above-mentioned destination object can be people.As Fig. 2 (a) is shown according to thisA kind of optional schematic diagram that user images are shot by mobile phone front-facing camera of bright embodiment, Fig. 2 (b) are shown according to thisThe schematic diagram of a kind of optional photographic head shooting background image after mobile phone of inventive embodiments, Fig. 2 (c) are shown according to thisA kind of optional background image that the user images that cell phone front camera shoots are synthesized to rear photographic head of inventive embodimentsSchematic diagram.In Fig. 2 (a), icon 201 show the destination object shot by mobile phone front-facing camera;Icon 21 showContain the first image of the destination object;In Fig. 2 (b), icon 23 show the background that photographic head shoots after mobile phoneImage (that is, the second image), icon 203 show the synthesis region in background image (that is, the second image);In Fig. 2 (c),Icon 25 show the 3rd image obtained after the first image is synthesized to the second image.Can be seen by Fig. 2 (a) to Fig. 2 (c)Go out, the image of user, then the image of the rear photographic head acquisition current background by mobile phone obtained by the front-facing camera of mobile phone,Obtain in background image for synthesizing the synthesis region of user images, by the figure of the user obtained by mobile phone front-facing cameraAs being blended in background image, so as to obtain the image of the user under current background.
From the foregoing, it will be observed that in the above embodiments of the present application, obtaining the image comprising destination object by the first photographic head, lead toCross second camera to obtain for synthesizing the background image of the destination object, obtain in background image according to pre-conditioned selectionThe synthesis region for synthesizing destination object after, the image of destination object is synthesized to into background image, the bag after being synthesizedThe image of destination object and background is contained, has reached by two photographic head while obtaining image, and will take the photograph by one of themAs the image that head is obtained is synthesized to the purpose in precalculated position in the image obtained by another photographic head, realize by movementThe front camera and rear camera of equipment is taken pictures simultaneously, it is possible to the technology effect of synthesising position of the self-defined destination object in background imageReally, and then solve prior art and front camera and rear camera cannot be utilized while taking pictures and the technology of self-defined composograph cannot be realizedProblem.
In a kind of optional embodiment, as shown in figure 3, before the synthesis region in the second image is obtained, above-mentioned sideMethod can also comprise the steps:
Step S302, is multiple images region by the second image division;
Step S304, selects one or more image-region conducts from multiple images region according to default regional extentSynthesis region.
Specifically, in above-mentioned steps, the second image can be for synthesizing above-mentioned target pair by photographic head shootingThe background image of elephant;Image-region can be the multiple regions in the second image according to pre-conditioned setting, a kind of optional realityApply in example, before shooting, user arbitrarily can choose proactive acquisition human body according to actual scene and the style liked of oneselfOne or more residing in the background image-regions of image are used as synthesis region.
Used as a kind of optional embodiment, Fig. 4 show a kind of optional composograph mould according to embodiments of the present inventionIntend schematic diagram, icon 401 show the second image, i.e. background image;Icon 403 show synthesis region, for synthesis firstImage;Wherein, the image that photographic head shoots after " 1 " represents, " 0 " are expressed as the image that front photographic head shoots;It should be noted thatMultiple images region can be chosen in the second image as synthesis region, the first figure of destination object is contained for synthesisPicture.
By above-described embodiment, realize and divide in background image for synthesizing one or more images of destination objectThe purpose in region.
In a kind of optional embodiment, as shown in figure 5, the first image is being synthesized to into synthesis region, after being synthesizedThe 3rd image before, said method can also comprise the steps:
Step S502, detects the brightness of the first image and the second image;
Whether step S504, judge the difference of brightness of the first image and the second image more than predetermined threshold value;
Step S506, if the difference of brightness is more than predetermined threshold value, adjusts the brightness of the first image and/or the second image.
Specifically, in above-mentioned steps, the first image can be to contain the target pair by what the first photographic head shotThe image of elephant;Second image can be the background image for synthesizing above-mentioned destination object shot by second camera;ByThe difference of the sensitive chip used in the first photographic head and second camera, can cause the image sensitive degree for shooting to occur certainDifference, certain lofty of image synthesis appearance in order that the overall photosensitive degree of image after synthesis uniformly and does not seem canSo that the first image is being synthesized to synthesis region, before the 3rd image after being synthesized, the first image and the second image are detectedBrightness, judge the difference of brightness value of the first image and the second image whether more than predetermined threshold value, if the difference of brightness is more than pre-The brightness of the first image and/or the second image if threshold value, is then adjusted, so as to preferably composograph.
Alternatively, above-mentioned predetermined threshold value can be 6EV, specifically, in the light of actual conditions can be adjusted.
Herein it should be noted that the brightness value size of the first photographic head and second camera be it is adjustable, according to realityScene carries out appropriate debugging.
By above-described embodiment, before composograph, by the bright of the image and background image to including destination objectDegree is adjusted so that the image after synthesis is more natural, coordination.
In a kind of optional embodiment, as shown in fig. 6, the first image is synthesized to into synthesis region, after being synthesized3rd image, may include steps of:
Step S602, the first image is processed as follows, obtains the 4th image:Intercept from the first imageThe image of predefined size, and/or, the first image is zoomed in and out into process according to the size in synthesis region;
Step S604, by the synthesis region in the 4th copying image to the second image, obtains the 3rd image.
Specifically, in above-mentioned steps, the first image can be the image for containing destination object, and the second image can beFor synthesizing the background image of destination object;It is used for synthesizing the situation for synthesizing region of destination object in the second image is gotUnder, in a kind of optional embodiment, can intercept from the first image the image of predefined size as the 4th copying image toSynthesis region in second image, obtains the 3rd image;In another kind of optional embodiment, can be by the first image according to conjunctionSize into region zooms in and out process, and the image after scaling is processed is as the 4th copying image to the synthesis in the second imageRegion, obtains the 3rd image.
By above-described embodiment, realize and the first image for containing destination object obtained by the first photographic head is closedInto to the purpose in the second image obtained by second camera.
In a kind of optional embodiment, as shown in fig. 7, by the synthesis zone in the 4th copying image to the second imageDomain, after obtaining the 3rd image, said method can also comprise the steps:
Step S702, carries out virtualization process to synthesizing the predetermined image region in region in addition to destination object;
Step S704, fills up the image of virtualization part using the former area information in synthesis region.
Specifically, in above-mentioned steps, in the image by predefined size is intercepted in the first image, and/or, by the first imageSize according to synthesis region zooms in and out the synthesis region in the copying image to the second image obtained after processing, and obtains the 3rdAfter image, virtualization process can be carried out to synthesizing the predetermined image region in region in addition to destination object in the second image,And the image of virtualization part, and then the final figure after being synthesized are filled up using the former area information for synthesizing region in the second imagePicture.
Herein it should be noted that due to by the first photographic head obtain the first image for containing destination object in,Other some photographing informations incoherent with the image information of destination object would generally be mingled with, can be calculated using some image procossingsMethod processes these information while blurring parts of images fills up virtualization part (being commonly called as to take root in process) using former area information.
In a kind of optional embodiment, if destination object is people, can be using special human bioequivalence algorithm process theOther background image informations incoherent with people in one image.
By above-described embodiment, the image after synthesis is further processed, when can reach synthesize after image more andHumorous, harmonious purpose.
The above embodiments of the present application can be illustrated with reference to Fig. 8 preferred embodiment as a kind of, Fig. 8 show oneThe method flow diagram that the preferred image for being shot using mobile phone front camera and rear camera simultaneously synthesizes piece image is planted, as shown in figure 8,Comprise the steps:
Step S802, camera application program on starting hand-set.
Specifically, in above-mentioned steps, before being shot, user needs to open the camera application program on mobile phone,The camera application program can be the camera application program given tacit consent to when mobile phone dispatches from the factory, or the camera applications journey that user downloadsSequence.
Step S804, clicks on and opens front camera and rear camera camera function simultaneously.
Specifically, in above-mentioned steps, after the application program on mobile phone is opened, click on and open front camera and rear camera bat simultaneouslyAccording to function, then the front camera and rear camera into mobile phone is while camera function.
Step S806, the front photographic head and rear photographic head of starting hand-set.
Specifically, in above-mentioned steps, click in user and open the front camera and rear camera of mobile phone simultaneously after camera function, mobile phoneOpen front photographic head and rear photographic head simultaneously.
It should be noted that general when the proactive head using mobile phone and rear photographic head obtain image, we are usualDuring front photographic head or rear photographic head can be chosen any one used as main imaging camera head, another is associated image photographic head, mainPhotographic head mainly provides background imaging, and auxiliary camera mainly provides anthropometric dummy and carries out image synthesis, a kind of preferred enforcementIn example, using the rear photographic head of mobile phone as main photographic head, for providing background image, the front photographic head of mobile phone is taken the photograph as auxiliaryAs head, for providing the image of destination object, i.e. human body image.
Step S808, obtains human body image by front photographic head, obtains background image by rear photographic head.
Specifically, in above-mentioned steps, front photographic head is the first photographic head, and rear photographic head is second camera;Above-mentioned peopleBody image is the first image for containing destination object, and above-mentioned background image is the second image for synthesizing destination object;WillThe rear photographic head of mobile phone and obtains the image of people as main photographic head for obtaining background image by the front photographic head of mobile phone.Preferably, human body image and background image can be shown in the camera application program of mobile phone simultaneously, user can be in BackgroundThe pattern liked according to oneself or human body image is assigned into according to actual scene certain position in background image as in.
Step S810, extracts the human body image in front photographic head using anthropometric dummy algorithm.
Specifically, in above-mentioned steps, in the front camera and rear camera simultaneously in the case of camera function of user's starting hand-set, handssThe front photographic head of machine will extract the human body information of photographer by anthropometric dummy algorithm.
Step S812, the image of photographic head after subregion.
Specifically, in above-mentioned steps, after background image is got by the rear photographic head of mobile phone, can be to BackgroundAs carrying out subregion, multiple images region is divided, for synthesizing the human body image that front photographic head is obtained.
Step S814, the human body image of photographic head before assigning in the selection area of the image of rear photographic head.
Specifically, in above-mentioned steps, user can select one or many in the image that the rear photographic head of mobile phone is obtainedIndividual image as synthesis region, for the human body image for assigning front photographic head to obtain.
Herein it should be noted that before assigning in the selection area of the image of rear photographic head photographic head human body image itBefore, needs extract human body information to front photographic head, and anthropometric dummy is carried out the scaling of certain ratio according to selected region,To adapt to synthesize the size in region in background image.
Step S816, carries out image " taking root in process " to human body image periphery.
Specifically, in above-mentioned steps, behind the synthesis region that user chooses, will be the proactive anthropometric dummy sent back directIt is replicated in above the region, is not desired to close with human body information as the region selected by anthropometric dummy algorithm would generally be mingled with otherProactive photographing information, is blurred parts of images simultaneously by special these information of human bioequivalence algorithm process and is filled out using former area informationQi-restoratives part (is commonly called as to take root in process).
Step S818, adjusts the overall brightness contrast of composograph, the brightness of unified composograph.
Specifically, in above-mentioned steps, by detecting that main photographic head claps the luma target (target luminance) for taking imageIt is compared with the luma target of human body image, if both gaps will (concrete gap can be by actual tune more than 6It is whole) adjust both luma target to coordinate both bright gaps so as to preferably synthesis.
By above-described embodiment, while the front camera and rear camera for opening mobile device obtains image, passed by front camera and rear cameraThe image returned, using algorithm and fuzzy algorithmic approach process is taken root in, realizes the combination of figure and ground so that imaging technique has into oneThe lifting of step so that mobile phone can obtain the image of front camera and rear camera simultaneously and synthesize piece image and be possibly realized, and then realizeFront camera and rear camera is imaged simultaneously, it is possible to the self-defined technique effect for carrying out image synthesis.
Embodiment 2
According to embodiments of the present invention, additionally provide a kind of device embodiment based on multiple photographic head composographs.ThisThe method based on multiple photographic head composographs in bright embodiment 1 can be performed in the device of the embodiment of the present invention 2.
Fig. 9 is a kind of schematic device based on multiple photographic head composographs according to embodiments of the present invention, such as Fig. 9 institutesShow, the device includes:First acquisition module 901, the second acquisition module 903 and synthesis module 905.
Wherein, the first acquisition module 901, for the first image for containing destination object is obtained by the first photographic head,Obtained for synthesizing the second image of destination object by second camera;Second acquisition module 903, for obtaining the second imageIn synthesis region, wherein, it is region according to pre-conditioned selection to synthesize region;Synthesis module 905, for by the first imageIt is synthesized to synthesis region, the 3rd image after being synthesized.
From the foregoing, it will be observed that in the above embodiments of the present application, obtaining the image comprising destination object by the first photographic head, lead toCross second camera to obtain for synthesizing the background image of the destination object, obtain in background image according to pre-conditioned selectionThe synthesis region for synthesizing destination object after, the image of destination object is synthesized to into background image, the bag after being synthesizedThe image of destination object and background is contained, has reached by two photographic head while obtaining image, and will take the photograph by one of themAs the image that head is obtained is synthesized to the purpose in precalculated position in the image obtained by another photographic head, realize by movementThe front camera and rear camera of equipment is taken pictures simultaneously, it is possible to the technology effect of synthesising position of the self-defined destination object in background imageReally, and then solve prior art and front camera and rear camera cannot be utilized while taking pictures and the technology of self-defined composograph cannot be realizedProblem.
In a kind of optional embodiment, said apparatus can also include:Division module, for by the second image division beingMultiple images region;Selecting module, for one or more figures are selected from multiple images region according to default regional extentAs region is used as synthesis region.
In a kind of optional embodiment, said apparatus can also include:Detection module, for detecting the first image and theThe brightness of two images;Judge module, for judging the difference of the brightness of the first image and the second image whether more than predetermined threshold value;AdjustMould preparation block, if the difference for brightness is more than predetermined threshold value, adjusts the brightness of the first image and/or the second image.
In a kind of optional embodiment, above-mentioned synthesis module includes:First processing module, for by the first image according toFollowing manner is processed, and obtains the 4th image:The image of predefined size is intercepted from the first image, and/or by the first imageSize according to synthesis region zooms in and out process;Replication module, for by the synthesis in the 4th copying image to the second imageRegion, obtains the 3rd image.
In a kind of optional embodiment, above-mentioned replication module includes:Second processing module, for removing in region to synthesizingPredetermined image region outside destination object carries out virtualization process;3rd processing module, for utilizing the former region in synthesis regionInformation filling blurs the image of part.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.
In the above embodiment of the present invention, the description to each embodiment all emphasizes particularly on different fields, and does not have in certain embodimentThe part of detailed description, may refer to the associated description of other embodiment.
In several embodiments provided herein, it should be understood that disclosed technology contents, can pass through otherMode is realized.Wherein, device embodiment described above is only schematic, such as the division of described unit, Ke YiweiA kind of division of logic function, can have when actually realizing other dividing mode, such as multiple units or component can with reference to orPerson is desirably integrated into another system, or some features can be ignored, or does not perform.Another, shown or discussed is mutualBetween coupling or direct-coupling or communication connection can be INDIRECT COUPLING or communication link by some interfaces, unit or moduleConnect, can be electrical or other forms.
The unit as separating component explanation can be or may not be it is physically separate, it is aobvious as unitThe part for showing can be or may not be physical location, you can local to be located at one, or can also be distributed to multipleOn unit.Some or all of unit therein can be selected according to the actual needs to realize the purpose of this embodiment scheme.
In addition, each functional unit in each embodiment of the invention can be integrated in a processing unit, it is also possible toIt is that unit is individually physically present, it is also possible to which two or more units are integrated in a unit.Above-mentioned integrated listUnit both can be realized in the form of hardware, it would however also be possible to employ the form of SFU software functional unit is realized.
If the integrated unit is realized and as independent production marketing or use using in the form of SFU software functional unitWhen, can be stored in a computer read/write memory medium.Based on such understanding, technical scheme is substantiallyThe part for contributing to prior art in other words or all or part of the technical scheme can be in the form of software productsEmbody, the computer software product is stored in a storage medium, use so that a computer including some instructionsEquipment (can be personal computer, server or network equipment etc.) perform the whole of each embodiment methods described of the invention orPart steps.And aforesaid storage medium includes:USB flash disk, read only memory (ROM, Read-Only Memory), random access memory are depositedReservoir (RAM, Random Access Memory), portable hard drive, magnetic disc or CD etc. are various can be with store program codesMedium.
The above is only the preferred embodiment of the present invention, it is noted that for the ordinary skill people of the artFor member, under the premise without departing from the principles of the invention, some improvements and modifications can also be made, these improvements and modifications also shouldIt is considered as protection scope of the present invention.