Invention content
To overcome the above technical problem, the especially prior art that can not simply and rapidly produce more visual effectThe problem of video, spy propose following technical scheme:
In a first aspect, the present invention provides a kind of method for processing video frequency, including:
Obtain pending video;
Identify that pending image, the pending image are continuously schemed comprising at least two frames from the videoPiece;
From the continuous picture of at least two frames, several frame pictures are obtained as ghost image picture;
The ghost image picture is synthesized with described image, generates the video with ghost image.
Further, described that the ghost image picture is synthesized with described image, generate the video with ghost image, packetIt includes:
Ghost image picture is obtained, using the ghost image picture as bottom;
The picture for obtaining the subsequent frames of the ghost image picture, using the picture of the subsequent frames as upper layer;
The picture of the subsequent frames is arranged in the top of the ghost image picture, synthesizes the video frame with ghost image to generateVideo with ghost image.
Optionally, the picture of the subsequent frames for obtaining the ghost image picture, including:
Obtain the picture of the 1st frame behind the ghost image picture;Or
Obtain the picture of preset frame number behind the ghost image picture;Or
Obtain the picture of whole frame numbers behind the ghost image picture.
Further, the acquisition ghost image picture, using the ghost image picture as bottom, including:
Ghost image picture is obtained, the transparency of ghost image picture is set as preset value, the ghost image picture after setting transparencyAs bottom.
Further, before the transparency ghost image picture is set as preset value, further include:
The characteristics of obtaining pending image, the transparency that ghost image picture is obtained according to the feature are corresponding described presetValue.
Further, before the transparency ghost image picture is set as preset value, further include:
Confirm situation of change of the picture of the subsequent frames relative to ghost image picture, according to the situation of change, obtains instituteState the corresponding preset value of transparency of ghost image picture.
Further, in the continuous picture from least two frames, obtain several frame pictures as ghost image picture itBefore, further include:
The characteristics of obtaining the video takes frame rate according to what setting interval the characteristics of the video took frame;Or
The performance information of this terminal and the requirement of application are obtained, is arranged according to the requirement of the performance information of this terminal and applicationWhat interval took frame takes frame rate;
In the continuous picture from least two frames, several frame pictures are obtained as ghost image picture, including:
It takes frame rate from the continuous picture of at least two frames with what the interval took frame, obtains several frame picture conductsGhost image picture.
Further, the pending video is the video of this terminal taking;It is described generate with ghost image video itAfterwards, further include:
The video of the generation is sent to content server by application.
Second aspect, the present invention also provides a kind of computer readable storage medium, the computer readable storage mediumOn be stored with computer program, which realizes above-mentioned method for processing video frequency when being executed by processor.
The third aspect, the present invention also provides a kind of terminal, the terminal include one or more processors, memory,One or more application program, wherein one or more of application programs be stored in the memory and be configured as byOne or more of processors execute, and one or more of programs are configured to carry out above-mentioned method for processing video frequency.
Compared with prior art, the present invention having the advantages that:
The present invention by regarding several frame pictures for going out pending image in video as ghost image picture, with pending image intoRow synthesizes, and generates the video with ghost image effect, and video effect is more lively, it is cruel to dazzle, and is without the use of the Video editing software of profession,Simply and rapidly produce the video of more visual effect.
In addition, the present invention takes the transparent of frame rate and/or different ghost image pictures by be arranged that different interval takes frameDegree meets the use demand of different user to export the ghost image video of different degrees of ghost image special efficacy, makes more natural ghost image effectFruit.
Furthermore the present invention determines that the interval of ghost image picture took frame mode takes frame rate also according to the performance information of terminal,When the image procossing performance of terminal is higher, what the interval of the ghost image picture took frame takes frame rate setting smaller, to synthesizeThe more obvious ghost image video of ghost image special efficacy, when the graphics process performance of terminal is relatively low, the interval of the ghost image picture takes frameIt takes frame rate setting larger, faster to synthesize the ghost image video with ghost image special efficacy, effectively utilizes terminal resource, meet notWith the demand of user.
The additional aspect of the present invention and advantage will be set forth in part in the description, these will become from the following descriptionObviously, or practice through the invention is recognized.
Specific implementation mode
The embodiment of the present invention is described below in detail, examples of the embodiments are shown in the accompanying drawings, wherein from beginning to endSame or similar label indicates same or similar element or element with the same or similar functions.Below with reference to attachedThe embodiment of figure description is exemplary, and is only used for explaining the present invention, and is not construed as limiting the claims.
Those skilled in the art of the present technique are appreciated that unless expressly stated, singulative " one " used herein, " oneIt is a ", " described " and "the" may also comprise plural form.It is to be further understood that is used in the specification of the present invention arrangesDiction " comprising " refer to there are the feature, integer, step, operation, but it is not excluded that presence or addition it is one or more otherFeature, integer, step, operation.
Those skilled in the art of the present technique are appreciated that unless otherwise defined, all terms used herein (including technology artLanguage and scientific terminology), there is meaning identical with the general understanding of the those of ordinary skill in fields of the present invention.Should alsoUnderstand, those terms such as defined in the general dictionary, it should be understood that have in the context of the prior artThe consistent meaning of meaning, and unless by specific definitions as here, the meaning of idealization or too formal otherwise will not be usedTo explain.
It will be appreciated by those skilled in the art that so-called " application " of the invention, " application program ", " application software " and classIt is the same concept well known to those skilled in the art like the concept of statement, refers to being instructed by series of computation machine and related dataThe computer software for being suitable for electronics operation of the organic construction of resource.Unless specified, this name itself is not by programming languageType, rank, the operating system of operation of also not rely by it or platform are limited.In the nature of things, this genus also not by appointThe terminal of what form is limited.
In one embodiment, the present invention provides a kind of method for processing video frequency, as shown in Figure 1, this method includes:
S100:Obtain pending video.
S200:Identify that pending image, the pending image include that at least two frames are continuous from the videoPicture.
The application scenarios of the present embodiment are Video Applications, using providing the quick function of making ghost image special efficacy video, when withWhen family carries out recorded video using application, using instructing user to record background frame first, then refer to after background frame determinationIt leads user and records main body picture, user selects to make ghost image special effect processing to video after the completion of video record, which is to wait locatingThe video of reason.The application of the present embodiment then obtains the pending video, is then identified from the pending videoPending image namely the main body picture, the main body picture change with the time of video record, the present embodimentPending image includes the continuous picture of at least two frames.
Specifically, in the present embodiment, it is described to obtain pending video;Pending image is identified from the videoA kind of realization method be:Obtain the video of pending solid background;As reference with the solid background, from the videoIn identify the image occurred on solid background, using the image as pending image.
In recorded video, user records solid background first, and main body picture is then recorded under solid background, applicationAs reference with the solid background, it from the video that recorded main body picture under solid background, subtracts and records when beginningThe ingredient of solid background to identify the main body picture in video, namely identifies the pending image in pending video.
It is described to obtain pending video;Another realization method of pending image is identified from the videoFor:Obtain the video of pending static background;As reference with the static background, it is identified in static state from the videoThe image occurred in background, using the image as pending image.
In recorded video, user records static background first, and main body picture is then recorded under static background, staticBackground does not change, and using from the video that recorded main body picture under static background, subtracts the static background recorded when beginningIdentical component, to identify the main body picture in video, namely identify the pending image in pending video.
Using the image occurred in background as pending image, using an image frame therein to the image of other framesGhost image is carried out, for entire picture carries out the mode of ghost image, it is difficult that processing can be reduced relative to dynamic pixel in entire pictureDegree, ghost image effect can more embody stereovision.
S300:From the continuous picture of at least two frames, several frame pictures are obtained as ghost image picture.
Human eye will think to be continuous dynamic video, the present embodiment when seeing the static images more than 24 frame per secondIn, in order to make the video with ghost image effect, after identifying pending image, include from the pending imageSeveral frame pictures are obtained in the continuous picture of at least two frames as ghost image picture, to make subsequent processing.As shown in Fig. 2, identifyingPending image include the continuous picture of totally 8 frames of frame 1,2,3,4,5,6,7,8, choose several frame figures from the 8 frame picturePiece such as chooses frame 2, frame 5, frame 6 and is used as ghost image picture as ghost image picture.
A kind of embodiment of acquisition ghost image picture of the present embodiment is, in such a way that interval takes frame, connects from least two framesIn continuous picture, several frame pictures are obtained as ghost image picture, as shown in Fig. 2, the pending image identified includes frame 1,2,3,4,5,6,7,8 continuous pictures of totally 8 frames, if choosing ghost image picture in a manner of 1 frame of interval, frame 1 therein, frame 3, frame5, frame 7 is ghost image picture;If choosing ghost image picture in a manner of 2 frame of interval, frame 1 therein, frame 4, frame 7 are ghost image picture,Frame rate is taken to export the ghost image video of different degrees of ghost image special efficacy by be arranged that different interval takes frame.
S400:The ghost image picture is synthesized with described image, generates the video with ghost image.
After obtaining ghost image picture, in order to make ghost image special efficacy, ghost image picture and the pending image are carried outSynthesis, it is acquired in the present embodiment since each frame ghost image picture is the frame picture obtained from the pending imageEach frame ghost image picture be to be synthesized with the pending image of other frames in addition to itself, generate with ghost image special efficacyVideo frame, to generate the video with ghost image effect.For example, the frame 1, frame 3, frame 5, frame 7 in Fig. 2 are ghost image picture, thoseGhost image picture can be synthesized with the pending image of other frames in addition to itself, such as be synthesized frame 1 and frame 2, frame 3 and frame4 synthesis, frame 5 are synthesized with frame 6, and frame 7 is synthesized with frame 8, include frame 1, the frame 12 that frame 1 is synthesized with frame 2, frame 3, frame 3 and frame 4 after synthesisThen the frame 34 of synthesis, frame 5, the frame 56 that frame 5 is synthesized with frame 6, frame 7, the frame 78 that frame 7 is synthesized with frame 8 regard the synthesis of those framesFrequently, to generate the video with ghost image special efficacy.
The present invention by regarding several frame pictures for going out pending image in video as ghost image picture, with pending image intoRow synthesizes, and generates the video with ghost image effect, and video effect is more lively, it is cruel to dazzle, and is without the use of the Video editing software of profession,Simply and rapidly produce the video of more visual effect.
A kind of embodiment of the present invention, described that the ghost image picture is synthesized with described image, generating has ghost imageVideo, including:
S401:Ghost image picture is obtained, using the ghost image picture as bottom;
S402:The picture for obtaining the subsequent frames of the ghost image picture, using the picture of the subsequent frames as upper layer;
S403:The picture of the subsequent frames is arranged in the top of the ghost image picture, the video frame with ghost image is synthesizedTo generate the video with ghost image.
By in ghost image picture and the described image building-up process that identifies, with the ghost image picture of a frame and the synthesis of imageFor illustrate, obtain a frame ghost image picture first, then using ghost image picture as bottom picture, then obtain the frame ghost image figureThe picture of the picture of the subsequent frames of piece, the subsequent frames is equally pending image frame picture therein, behind thisThen the picture of subsequent frames is arranged and is synthesized above the ghost image picture, synthesis has as upper layer by the picture of frame againThe video frame of ghost image, such as choose frame 1 and be used as ghost image picture, picture of the frame 2 as subsequent frames is chosen, frame 1 is placed in bottom, frame2 are placed in upper layer, synthesize the frame 12 with ghost image effect, then by all ghost image pictures of acquisition with the picture of subsequent frames according toAforesaid way is synthesized, and all video frame are obtained, and ultimately produces the video with ghost image.
Further, in above-described embodiment, the picture of the subsequent frames for obtaining the ghost image picture, including:
Obtain the picture of the 1st frame behind the ghost image picture;Or
Obtain the picture of preset frame number behind the ghost image picture;Or
Obtain the picture of whole frame numbers behind the ghost image picture.
When the picture superposition for having more multiframe synthesizes a frame picture, the ghost image effect of picture is more apparent, in the present embodiment,In order to make different degrees of ghost image special efficacy, in a kind of embodiment, after obtaining ghost image picture, behind ghost image pictureThe picture of 1st frame is synthesized as the picture of the subsequent frames with ghost image picture, and the video frame with ghost image effect is obtained;ForSo that ghost image special efficacy is more obvious, it, will be ghost image picture behind in advance after obtaining ghost image picture in another embodimentThe picture for setting frame number is synthesized as the picture of the subsequent frames with ghost image picture, if frame 1 is ghost image picture, getting frame 1Then picture of the picture frame 2, frame 3, frame 4 of 3 frame next as the subsequent frames carries out frame 1 with frame 2, frame 3, frame 4 respectivelySynthesis, obtains the video frame with ghost image effect;Likewise, maximum ghost image effect in order to obtain, another embodiment partyIn formula, after obtaining ghost image picture, the picture by the picture of whole frame numbers behind ghost image picture as the subsequent framesIt is synthesized with ghost image picture, obtains the video frame with ghost image effect.
Further, a kind of embodiment of the invention, the acquisition ghost image picture, using the ghost image picture as bottom, packetIt includes:
Ghost image picture is obtained, the transparency of ghost image picture is set as preset value, the ghost image picture after setting transparencyAs bottom.
Picture due to ghost image picture as bottom and subsequent frames is synthesized, in order to reduce ghost image picture to subsequent framesThe influence of the content information of picture sets the transparency of ghost image picture to preset value, usually after obtaining ghost image pictureThe transparency of ghost image picture is set as 50% hereinafter, then the ghost image picture after setting transparency as bottom, subsequent framesPicture as upper layer, the picture that ghost image picture and subsequent frames after transparency are arranged at this time is synthesized, and ghost image picture is relatively lowThe content information of the picture of subsequent frames is influenced to degree, ghost image picture is as minor coverage information, and the picture of subsequent frames is as masterContent information is wanted, the video frame being synthesized has stereovision, and then the video being synthesized has more ghost image visual effect.
Further, a kind of embodiment of the invention, before the transparency ghost image picture is set as preset value, alsoIncluding:
The characteristics of obtaining pending image obtains the corresponding preset value of transparency of ghost image picture according to the feature.
Pending image is the main body picture in video, and in the present embodiment, different main body pictures is configured foldedThe preset value of the transparency of shadow picture differs, the characteristics of identifying pending image first, i.e., what main body picture is, noThe preset value of the transparency of ghost image picture corresponding to same main body picture is different, for example, when main body picture is personage, obtainsThe corresponding preset value 40% of transparency of ghost image picture, when main body picture is animal, since the movement speed of animal is not easyControl obtains the corresponding preset value 30% of transparency of ghost image picture at this time, when main body picture is the article of absence of vital signs,The corresponding preset value 25% of transparency for obtaining ghost image picture, to show the different degrees of ghost image effect of different subjects picture.
Further, a kind of embodiment of the invention, before the transparency ghost image picture is set as preset value, alsoIncluding:
Confirm situation of change of the picture of the subsequent frames relative to ghost image picture, according to the situation of change, obtains instituteState the corresponding preset value of transparency of ghost image picture.
In above-described embodiment, major embodiment sets the transparency of all ghost image pictures to same preset value, the present embodimentIn, the preset value of the transparency of different ghost image pictures is self-defined according to the progress of the situation of change of ghost image picture and the picture of subsequent framesAdjustment, after obtaining ghost image picture, confirms situation of change of the picture of the subsequent frames relative to ghost image picture, it is preferred thatAfter having chosen ghost image picture, the picture of the subsequent frames is the picture of first frame behind ghost image picture, one kind of the present embodimentEmbodiment calculates the picture of subsequent frames according to SSIM (Structural Similarity Index, structural similarity) and foldsThe situation of change of shadow picture illustrates that the picture of two frame pictures is closer when structural similarity is higher, when structural similarity is lower,Illustrate that the picture difference of two frame pictures is bigger, the preset value of the transparency of ghost image picture then obtained according to the situation of change,When situation of change is bigger, the preset value of the transparency of ghost image picture is lower, when situation of change is smaller, ghost image picture it is transparentThe preset value of degree is higher, so that the ghost image video frame of synthesis is more natural.The another way of the present embodiment, if the subsequent framesPicture relative to ghost image picture variation area ratio be more than predetermined threshold, obtain the first preset value, using the first preset value asThe preset value of the transparency of the ghost image picture;If the picture of the subsequent frames is less than relative to the variation area ratio of ghost image pictureEqual to predetermined threshold, the second preset value is obtained, using the second preset value as the preset value of the transparency of the ghost image picture, firstPreset value is less than the second preset value.
A kind of embodiment of the present invention from the continuous picture of at least two frames, obtains several in a manner of taking frame by intervalBefore frame picture is as ghost image picture, further include:
The characteristics of obtaining the video takes frame rate according to what setting interval the characteristics of the video took frame;Or
The performance information for obtaining terminal takes frame rate according to what the performance information of terminal setting interval took frame.
The frame rate that takes of different ghost image pictures is one of the factor for influencing ghost image effect, in the present embodiment, from describedIn the continuous picture of at least two frames, before obtaining several frame pictures as ghost image picture, obtain video the characteristics of, the videoFeature includes the recording frame per second of video, the resolution ratio etc. for recording duration, video of video, is then obtained according to different video featuresTake it is different take frame rate, for example, when the recording frame per second of video is 30fps, what the interval of setting ghost image picture took frame takes frameFrequency is 1 frame, and when the recording frequency of video is 60fps, it is 2 frames that the interval of setting ghost image picture, which takes the frame rate that takes of frame,;TogetherSample, frame can be also taken according to the interval of other features of video setting ghost image picture takes frame rate, is synthesized with difference with thisThe video frame of ghost image degree, and then generate the ghost image video of different ghost image degree.
Further, take the frequency of frame higher, the video frame using required synthesis is more, and the calculation amount needed for terminal is got overGreatly, it is contemplated that the factor of terminal capabilities, what the interval of the ghost image picture took frame takes frame rate can also be by obtaining the figure of terminalShape process performance information and determine, from the continuous picture of at least two frames, obtaining several frame pictures as ghost image pictureBefore, the graphics process capability message for obtaining terminal, when the image procossing performance of terminal is higher, the interval of the ghost image pictureTake frame takes frame rate setting smaller, to synthesize the more obvious ghost image video of ghost image special efficacy, when the graphics process performance of terminalWhen relatively low, what the interval of the ghost image picture took frame takes frame rate setting larger, folded with ghost image special efficacy faster to synthesizeVideo display frequency, effectively utilizes terminal resource, meets the needs of different user.
In the embodiment of the present invention, the pending video is the video of this terminal taking, further, the generation toolAfter having the video of ghost image, further include:The video of the generation is sent to content server by application.User is applying upper recordAfter the video of video processed and generation with ghost image, the video with ghost image is sent to application server, to pass through applicationPlatform shares made video to more users.
In another embodiment, the present invention provides a kind of computer readable storage medium, computer-readable storage mediumsComputer program is stored in matter, which realizes the method for processing video frequency described in above-described embodiment when being executed by processor.ItsIn, the computer readable storage medium include but not limited to any kind of disk (including floppy disk, hard disk, CD, CD-ROM,And magneto-optic disk), ROM (Read-Only Memory, read-only memory), (Random AcceSS Memory, store RAM immediatelyDevice), EPROM (EraSable Programmable Read-Only Memory, Erarable Programmable Read only Memory),(Electrically EraSable Programmable Read-Only Memory, electric erazable programmable is read-only to be deposited EEPROMReservoir), flash memory, magnetic card or light card.It is, storage device includes by equipment (for example, computer, mobile phone) with energyAny medium for the form storage or transmission information enough read can be read-only memory, disk or CD etc..
A kind of computer readable storage medium provided in an embodiment of the present invention is, it can be achieved that obtain pending video;From instituteIt states and identifies pending image in video, the pending image includes the continuous picture of at least two frames;From it is described at leastIn the continuous picture of two frames, several frame pictures are obtained as ghost image picture;The ghost image picture is synthesized with described image,Generate the video with ghost image.It is and pending by regarding several frame pictures for going out pending image in video as ghost image pictureImage is synthesized, and the video with ghost image effect is generated, and video effect is more lively, it is cruel to dazzle, and is compiled without the use of the video of professionSoftware is collected, the video of more visual effect is simply and rapidly produced.In addition, computer-readable storage medium provided by the inventionMatter can also be achieved takes the transparency of frame rate and/or different ghost image pictures to export not by be arranged that different interval takes frameWith the ghost image video of degree ghost image special efficacy, meet the use demand of different user, makes more natural ghost image effect.In addition, thisThe computer readable storage medium that invention provides can also be achieved determines that the interval of ghost image picture takes frame according to the performance information of terminalMode takes frame rate, effectively utilizes terminal resource, meets the needs of different user.
The embodiment of above-mentioned method for processing video frequency may be implemented in computer readable storage medium provided in an embodiment of the present invention,Concrete function realizes the explanation referred in embodiment of the method, and details are not described herein.
In addition, in another embodiment, the present invention also provides a kind of terminals, as shown in figure 3, the terminal may includeOne or more than one processor 301 further include memory 302, WiFi (wireless fidelity, Wireless Fidelity)It is circuit 303, RF (Radio Frequency, radio frequency) circuit 304, voicefrequency circuit 305, sensor 306, output equipment 307, defeatedEnter equipment 304, power supply 309, processor 301 is the control centre of terminal, utilizes various interfaces and the above each section of connection.It will be understood by those skilled in the art that the restriction of the not structure paired terminal of terminal structure shown in Fig. 3, may include than diagramMore or fewer components either combine certain components or different components arrangement.
WiFi circuitry 303 can provide WLAN or internet access to the user;It may include antenna, WiFi moduleDeng.RF circuits 304 can receive and send messages, or signal sends and receivees in communication process;It may include antenna, at least one putsBig device, tuner, one or more oscillators, coupler, duplexer etc..The audio data that voicefrequency circuit 305 can will receiveIt is converted into electric signal, is transferred to loud speaker, also the voice signal that microphone is collected audio data can be converted to, issue processor301 processing;Loud speaker, microphone, earphone interface etc. can be arranged in it.Sensor 306 can be used for incuding outer signals, and issue placeDevice 301 is managed to handle;It may include motion sensor, optical sensor etc..Output equipment 307 can be used for showing various signals;It canFor using LCD (Liquid Crystal Display, liquid crystal display), OLED (Organic Light-EmittingDiode, Organic Light Emitting Diode) etc. forms configure display panel.Input equipment 304 can be used for inputting the letters such as number and characterBreath;It can be physical button, touch panel etc..Power supply 309 can be that terminal each section is powered, and pass through power-supply management system and processing309 logical connection of device;It may include one or more direct current or AC power, charging system, power supply status indicatorEqual components.Memory 302 can be used for storing software program and module;It can be computer readable storage medium, be specificallyHard disk, flash memory etc..Processor is the control centre of terminal, by running or executing the software program being stored in memory 302And/or module, and the data for being stored in memory 302 are called, execute terminal various functions, processing terminal data.
As one embodiment, terminal includes:One or more processors 301, memory 302, one or more applicationProgram, wherein one or more of application programs are stored in memory 302 and are configured as by one or more ofProcessor 301 executes, and one or more of programs are configured to carry out the method for processing video frequency described in above example.
A kind of terminal provided in an embodiment of the present invention is, it can be achieved that obtain pending video;It is identified from the videoPending image, the pending image include the continuous picture of at least two frames;From the continuous picture of at least two framesIn, several frame pictures are obtained as ghost image picture;The ghost image picture is synthesized with described image, is generated with ghost imageVideo.By regarding several frame pictures for going out pending image in video as ghost image picture, synthesized with pending image, lifeAt the video with ghost image effect, video effect is more lively, it is cruel to dazzle, without the use of the Video editing software of profession, simply, quicklyProduce the video of more visual effect in ground.It is taken in addition, terminal provided by the invention can also be achieved by the way that different intervals is arrangedFrame takes the transparency of frame rate and/or different ghost image pictures to export the ghost image video of different degrees of ghost image special efficacy, meetsThe use demand of different user makes more natural ghost image effect.In addition, terminal provided by the invention can also be achieved according to terminalPerformance information determine that the interval of ghost image picture took frame mode takes frame rate, effectively utilize terminal resource, meet different useThe demand at family.
The embodiment of the method for processing video frequency of above-mentioned offer, concrete function may be implemented in terminal provided in an embodiment of the present inventionRealize the explanation referred in embodiment of the method, details are not described herein.
The above is only some embodiments of the present invention, it is noted that for the ordinary skill people of the artFor member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answeredIt is considered as protection scope of the present invention.