patents.google.com

CN105847674B - A kind of preview image processing method and mobile terminal based on mobile terminal - Google Patents

  • ️Fri Jun 07 2019

Specific embodiment

Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts Example, shall fall within the protection scope of the present invention.

First embodiment

The embodiment of the present invention is applied to the mobile terminal with camera function, such as smart phone, tablet computer, and the shifting Dynamic terminal includes the first camera and second camera, as shown in Figure 1, for the first embodiment of the present invention provide based on movement The flow chart of the preview image processing method of terminal, this method comprises:

First camera and the second camera are respectively set to different focal modes by step 101.

Wherein, different focal modes are determined according to background blurring algorithm requirements and the existing focusing strategy of a camera Fixed.Mobile terminal applied by the embodiment of the present invention includes the first camera and second camera, then according to background blurring The existing focusing strategy of algorithm requirements and a camera arrives the first camera and the second camera setting of the mobile terminal In different focal modes, when so that carrying out image preview before actually taking pictures, it can be obtained different cameras and capture not With the preview image of focal length.

Step 102, acquisition first camera and the second camera acquire respectively under different focal modes The first preview image and the second preview image.

When the first camera and second camera of mobile terminal to be respectively provided to different focusing moulds by step 101 After in formula, the first preview image that the first camera acquires under its corresponding focal modes can be obtained by step 102, with And the second preview image that second camera acquires under its corresponding focal modes.

Wherein, first preview image and second preview image belong to same photographed scene.Furthermore it is preferred that First preview image is identical as the acquisition moment of second preview image.That is, first preview image and described Two preview images are first camera and the second camera in synchronization, are adopted respectively under different focal modes The image of the same photographed scene of collection.

Step 103 carries out background blurring processing to first preview image and second preview image, generates target Image.

In the embodiment of the present invention, background blurring processing refers to that acquisition main body is clear, and the region Relative Fuzzy except main body Image.It in step 103, is that the first preview image and the second preview with different focal length will be obtained from step 102 Image carries out background blurring processing, to obtain the main body clearly preview image of the region Relative Fuzzy except main body.Therefore, The target image generated in step 103 i.e. based on the clear and preview image of the region Relative Fuzzy except main body.

In addition, the target image is then shown on the display screen of mobile terminal, to reach after generating target image The preview interface real-time display of mobile terminal has the effect of the image of background blurring effect.

Preferably, a background blurring mode can be arranged on the mobile terminal to start switch, which can be with hard The form setting of part button on mobile terminals, when the hardware button is pressed, then opens background blurring mode.Alternatively, may be used also One switch, when user is under the preview interface of camera, the touching of manual sliding mobile terminal are set in the preview interface of camera When touching the corresponding position of display screen for switch opening, then background blurring mode is opened.Wherein, which it is empty to open background After change mode, the first camera and the second camera shooting camera are opened, and then can have in the preview interface live preview of camera The image of background blurring effect.It follows that the setting that background blurring mode starts switch, provides more previews for user Model selection improves the usage experience of user.

The preview image processing method based on mobile terminal of the embodiment of the present invention, by being imaged the first of mobile terminal On head and second camera setting to different focal modes, when so as to carry out image preview before actually taking pictures The preview image for the different focal length that different cameras capture is obtained, and then background is carried out to the preview image of the different focal length of acquisition Virtualization processing generates the main body clearly target image of the region Relative Fuzzy except main body, to realize that live preview has The effect of the image of background blurring effect solves and is only just able to achieve background blurring effect when taking pictures, and cannot be pre- The problem of What You See Is What You Get is realized when looking at.

Second embodiment

The embodiment of the present invention is applied to the mobile terminal with camera function, such as smart phone, tablet computer, and the shifting Dynamic terminal includes the first camera and second camera, as shown in Fig. 2, for the second embodiment of the present invention provide based on movement The flow chart of the preview image processing method of terminal, this method comprises:

First camera and the second camera are respectively set to different focal modes by step 201.

Wherein, different focal modes are determined according to background blurring algorithm requirements and the existing focusing strategy of a camera Fixed.Mobile terminal applied by the embodiment of the present invention includes the first camera and second camera, then according to background blurring The existing focusing strategy of algorithm requirements and a camera arrives the first camera and the second camera setting of the mobile terminal In different focal modes, when so that carrying out image preview before actually taking pictures, it can be obtained different cameras and capture not With the preview image of focal length.

In an embodiment of the present invention, the focal modes of the first camera are automatic focusing mode, pair of second camera Burnt mode is remote burnt mode.Wherein, accordingly, two cameras of mobile terminal, can be all made of with automatic focusing function One of focal length is fixed to remote burnt mode by mould group;Or it using a mould group with automatic focusing function, arranges in pairs or groups one Fixed-focus mould group with more long-focus, to reach better effect.

Wherein, under automatic focusing mode, the first camera can do lasting focusing with scene changes with centring region Main body then focus by target of touch screen area when detecting the touch screen behavior of user, after opening recognition of face, It focuses if recognizing face by target of face.Under remote burnt mode, the focal length of second camera is generally infinite Far.

Step 202, acquisition first camera and the second camera acquire respectively under different focal modes The first preview image and the second preview image.

Wherein, first preview image and second preview image belong to same photographed scene.Furthermore it is preferred that First preview image is identical as the acquisition moment of second preview image.That is, first preview image and described Two preview images are first camera and the second camera in synchronization, are adopted respectively under different focal modes The image of the same photographed scene of collection.

In the embodiment of the present invention, the focal modes of the first camera are automatic focusing mode, the focusing of second camera Mode is remote burnt mode.So the first preview graph is that the focus that the first camera acquires under automatic focusing mode is being taken Image on object, and the clarity in region locating for subject is higher than the clarity in other regions except the region.The The focus that two preview images are second cameras to be acquired under remote burnt mode is at subject rear, such as focus is in infinity The image at place, and the clarity in region locating for subject is lower than the clarity in other regions except the region.

Step 203, according to first preview image and second preview image, determine in first preview image Background area.

Wherein, the focus of the first preview image is located on subject, and the focus of the second preview image, which is located at, to be taken Object rear, so, the subject in the first preview image, more relative to the subject in the second preview image Clearly.Therefore, the fog-level of the first preview image and the fog-level of the second preview image are compared, it can be from first The background area of the first preview image is determined in preview image.

Specifically, step 203 includes:

By individual element manner of comparison, the fuzzy journey of first preview image and second preview image is determined Degree;

It, will be in first preview image according to the fog-level of first preview image and second preview image The image-region fuzzyyer than corresponding position in second preview image is determined as the background area in first preview image Domain.

Wherein, the determination of fog-level can be using the method for comparing contrast.For a scene, image it is clear Clear degree is different, and contrast will be different.The first preview image and second camera acquisition for the acquisition of the first camera The second preview image, the two picture material is consistent, but comparatively, and in the image acquired under remote burnt mode, background compares Clearly main body Relative Fuzzy;In the image acquired under automatic focusing mode, the subject comparing is clear and background Relative Fuzzy.

Therefore, for the first preview image, the ground fuzzyyer than the second preview image can be judged as background area, Its ground more clearer than the second preview image can be judged as body region.Two cameras can be compared pixel by pixel herein Collected preview image calculates its contrast, and the fog-level of the two is determined according to the difference of contrast, and then distinguishes Body region and background area.

Wherein, for certain piece image, included by each pixel all have itself contrast, and each pixel The contrast of point can be calculated according to following formula:

Wherein, i indicates that ith pixel point, j indicate j-th of pixel around ith pixel point, and 1≤j≤n, and n For positive integer, r (i, j) indicates that the gray scale difference between ith pixel point and surrounding j-th of pixel, p (i, j) are i-th of picture The probability distribution of gray scale difference between vegetarian refreshments and surrounding j-th of pixel.In addition, under normal circumstances, n value is 4 or 8, i.e., The contrast of a certain pixel, usually calculates the pixel and difference of the gray values of 4 or 8 pixels obtains around it.Its In, the contrast of pixel is smaller, then the pixel is fuzzyyer.Therefore, by by the first preview image and the second preview image, In such a way that individual element compares, the contrast of compared pixels point can determine the first preview image and the second preview image Fog-level.Pixel i.e. at the same position of the first preview image and the second preview image, the big pixel of contrast It is relatively clear, the small pixel of contrast is more fuzzy.So than corresponding to position in the second preview image in the first preview image Set the background area that fuzzyyer image-region is confirmed as in the first preview image.

Step 204 carries out virtualization processing to the background area in first preview image, generates target image.

Wherein, although the background area in the first preview image is more fuzzy compared to body region, the background area Image in domain is still the image without virtualization effect, so, the background in the first preview image is determined by step 203 Behind region, it is also necessary to further virtualization processing is carried out to the image in the region, to obtain the mesh with background blurring effect Logo image.After generating target image, which is then shown on the display screen of mobile terminal, to reach mobile whole The preview interface real-time display at end has the effect of the image of background blurring effect.

In addition, the treatment process of step 203 and step 204, can expend certain time, if cannot be within the time of a frame Processing is completed, and low frame per second, affect experience can be dragged.Simultaneously the process can than relatively time-consuming, so, the processing of the process can be put into Processing in external digital signal processor (Digital Signal Processor, DSP), to improve real-time and user's body It tests.

Preferably, a background blurring mode can be arranged on the mobile terminal to start switch, which can be with hard The form setting of part button on mobile terminals, when the hardware button is pressed, then starts background blurring mode.Alternatively, may be used also One switch, when user is under the preview interface of camera, the touching of manual sliding mobile terminal are set in the preview interface of camera When touching the corresponding position of display screen for switch opening, then background blurring mode is opened.Wherein, which it is empty to open background After change mode, corresponding camera is opened, and then has the image of background blurring effect in the preview interface live preview of camera. It follows that the setting that background blurring mode starts switch, provides more preview mode selections for user, improves user Usage experience.

The preview image processing method based on mobile terminal of the embodiment of the present invention, by being imaged the first of mobile terminal Head does automatic focusing, remote burnt mode is set by second camera, to obtain focus in the first preview graph being taken in main body Picture and focus are in second preview image at main body rear that is taken, to be determined according to the first preview image and the second preview image Background area in first preview image out, and the background area virtualization is handled, obtain the target with background blurring effect Image.Therefore, the preview image processing method based on mobile terminal of the embodiment of the present invention, can be realized live preview has back Scape blurs the effect of the image of effect, solves and is only just able to achieve background blurring effect when taking pictures, and cannot be in preview The problem of Shi Shixian What You See Is What You Get.

3rd embodiment

The embodiment of the present invention is applied to the mobile terminal with camera function, such as smart phone, tablet computer, and the shifting Dynamic terminal includes the first camera and second camera, as shown in figure 3, for the third embodiment of the present invention provide based on movement The flow chart of the preview image processing method of terminal, this method comprises:

First camera and the second camera are respectively set to different focal modes by step 301.

Wherein, different focal modes are determined according to background blurring algorithm requirements and the existing focusing strategy of a camera Fixed.Mobile terminal applied by the embodiment of the present invention includes the first camera and second camera, then according to background blurring The existing focusing strategy of algorithm requirements and a camera arrives the first camera and the second camera setting of the mobile terminal In different focal modes, when so that carrying out image preview before actually taking pictures, it can be obtained different cameras and capture not With the preview image of focal length.

In an embodiment of the present invention, the focal modes of the first camera are automatic focusing mode, pair of second camera Burnt mode is nearly burnt mode.Wherein, under automatic focusing mode, the first camera can do lasting focusing with scene changes to be aligned The main body of central area is then focused by target of touch screen area when detecting the touch screen behavior of user, when unlatching face After identification, focus if recognizing face by target of face.

Step 302, acquisition first camera and the second camera acquire respectively under different focal modes The first preview image and the second preview image.

Wherein, first preview image and second preview image belong to same photographed scene.Furthermore it is preferred that First preview image is identical as the acquisition moment of second preview image.That is, first preview image and described Two preview images are first camera and the second camera in synchronization, are adopted respectively under different focal modes The image of the same photographed scene of collection.

In the embodiment of the present invention, the focal modes of the first camera are automatic focusing mode, so the first preview graph is Image of the focus that first camera acquires under automatic focusing mode on subject, and region locating for subject Clarity be higher than the region except other regions clarity.

The focal modes of second camera are nearly burnt mode, so, the background of the second preview image itself is fuzzy (if not microshot, entire picture is typically all fuzzy), so the embodiment of the present invention is by second camera close Burnt blurred image second preview image of pattern acquiring, to save subsequent the step of blurring processing to background area.

Step 303, the stingy figure instruction for obtaining user's input.

Wherein, the stingy figure instruction is that the automatic figure of scratching that user inputs from mobile terminal instructs, such as user is in movement It is slided manually at corresponding character positions in the preview interface of terminal;Or the stingy figure instruction is that user is defeated from mobile terminal The lasso trick entered scratches figure instruction, such as user draws a closed figure with hand in the preview interface of mobile terminal;Or it is described Scratching figure instruction is that the fixation shape that user inputs from mobile terminal scratches figure instruction, such as is arranged in the preview interface of mobile terminal There is a stingy figure to start switch, then when user opens the switch, mobile terminal defaults some rectangle or heart automatically to scratch figure Region.

Step 304 obtains according to the stingy figure instruction and scratches graph region.

Wherein, if user slides at corresponding character positions manually in the preview interface of mobile terminal, graph region is scratched For the region where corresponding portrait;If user depicts a closed figure with hand in the preview interface of mobile terminal, Scratching graph region is region included by the closed figure;If the stingy figure instruction is the fixation shape that user inputs from mobile terminal Shape scratches figure instruction, then scratches the region of some rectangle or heart-shaped the inside that graph region is mobile terminal default.

Step 305 scratches nomography by default, and the image in the stingy graph region is obtained in first preview image Data, and the image data in the stingy graph region is determined as the first image to be synthesized.

Wherein, the image data in the stingy graph region belongs to user and needs main body outstanding, i.e. clearly body region. Because the focus of the first preview image data is located on subject, the image category for including in the first preview image data In clear image, so can obtain to be located at from the first preview image data and be somebody's turn to do after getting stingy graph region from step 304 The clearly image data in graph region is scratched, that is, determines the first image to be synthesized.

The stingy graph region is mapped on second preview image by step 306, and in second preview image The image data outside the stingy graph region is obtained, and the image data outside the stingy graph region is determined as the second figure to be synthesized Picture.

When due to drawing motor of camera to nearly burnt position background it is inherently fuzzy (if not microshot, entirely Picture is typically all fuzzy), so second preview image itself is blurred image image, thus can be by the second preview graph It is located at the image data scratched outside graph region as in as the background with virtualization effect, that is, determines it as the second figure to be synthesized Picture.

Wherein, the default stingy nomography can be combined using the tracking of figure segmenting edge with α algorithm for estimating.That is figure Segmenting edge track algorithm sketches the contours of the profile of stingy graph region, and careful edge processing is then carried out using α algorithm for estimating, To clearly distinguish foreground area with background area, so that obtaining the picture number in foreground area in step 305 According to that is, determining first image to be synthesized;Determining background area is mapped on the second preview image within step 306, to obtain The image data in background area is taken, that is, determines the second image to be synthesized.(wherein, the color of any point on image all may be used It regards as and is mixed by foreground color and background color, and α then indicates specific gravity shared by foreground color.)

In embodiments of the present invention, the default stingy nomography is mutually tied by the tracking of figure segmenting edge with α algorithm for estimating It closes, full-automatic accurate scratch may be implemented and scheme, so that the conjunction of the body region of the target image finally obtained and background area It is more preferable at effect, further promote the visual experience of user.

Described first image to be synthesized is synthesized processing with the described second image progress image to be synthesized by step 307, is generated Target image.

User is defined in step 305 and needs body region (the i.e. first image to be synthesized) outstanding, in step 306 In define background area (the i.e. second image to be synthesized), it is possible to directly the two synthesis is handled, ultimately generates main body The clearly target image of blurred background.

After generating target image, which is then shown on the display screen of mobile terminal, to reach in movement The preview interface real-time display of terminal has the effect of the image of background blurring effect.

Preferably, a background blurring mode can be arranged on the mobile terminal to start switch, which can be with hard The form setting of part button on mobile terminals, when the hardware button is pressed, then starts background blurring mode.Alternatively, may be used also One switch, when user is under the preview interface of camera, the touching of manual sliding mobile terminal are set in the preview interface of camera When touching the corresponding position of display screen for switch opening, then background blurring mode is opened.Wherein, which it is empty to open background After change mode, corresponding camera is opened, and then has the image of background blurring effect in the preview interface live preview of camera. It follows that the setting that background blurring mode starts switch, provides more preview mode selections for user, improves user Usage experience.

The preview image processing method based on mobile terminal of the embodiment of the present invention, passes through the first camera of mobile terminal Do automatic focusing, second camera setting in close burnt mode, come obtain focus the first preview image being taken in main body with Blurred image second preview image, so that user institute is determined in the stingy figure instruction according to user's input from the first preview image Clear body region outstanding (the i.e. first image to be synthesized) is wanted, is determined except clear body region from the second preview image Region (the i.e. second image to be synthesized), and carry out synthesis processing, obtain the target image with background blurring effect.Therefore, The preview image processing method based on mobile terminal of the embodiment of the present invention can be realized live preview with background blurring effect Image effect, solve and be only just able to achieve background blurring effect when taking pictures, and seen in cannot being realized in preview The problem of obtained by i.e..

Fourth embodiment

As shown in figure 4, the structural block diagram of the mobile terminal provided for the fourth embodiment of the present invention.Movement shown in Fig. 4 Terminal 400 includes: Focusing module 401, obtains module 402, blurring module 403.

Focusing module 401, for first camera and the second camera to be respectively set to different focusings Mode;

Module 402 is obtained, for obtaining first camera and the second camera under different focal modes The first preview image and the second preview image acquired respectively;

Blurring module 403, first preview image and second preview for being obtained to the acquisition module 402 Image carries out background blurring processing, generates target image.

Preferably, the focal modes of first camera are automatic focusing mode, the focusing mould of the second camera Formula is remote burnt mode.

As shown in figure 5, the blurring module 403 includes:

First determination unit 4031, described in determining according to first preview image and second preview image Background area in first preview image;

Unit 4032 is blurred, described in first preview image determining to first determination unit 4031 Background area carries out virtualization processing, generates target image.

Preferably, first determination unit 4031 includes:

Comparing subunit 40311, for by individual element manner of comparison, determining first preview image and described the The fog-level of two preview images;

Determine subelement 40312, first preview image and institute for determining according to the comparing subunit 40311 The fog-level for stating the second preview image, by first preview image than corresponding position more mould in second preview image The image-region of paste is determined as the background area in first preview image.

Preferably, the focal modes of first camera are automatic focusing mode, the focusing mould of the second camera Formula is nearly burnt mode.

As shown in fig. 6, the blurring module 403 includes:

Acquiring unit 4033, for obtaining the stingy figure instruction of user's input;

Second determination unit 4034, the stingy figure for being obtained according to the acquiring unit 4033 instruct, determine and scratch figure Region;

First stingy figure unit 4035, for by default stingy nomography, obtaining described the in first preview image The image data in the stingy graph region that two determination units 4034 determine, and the image data in the stingy graph region is determined For the first image to be synthesized;

Second stingy figure unit 4036, the stingy graph region for determining second determination unit 4034 are mapped to institute It states on the second preview image, and obtains the image data outside the stingy graph region in second preview image, and will be described The image data scratched outside graph region is determined as the second image to be synthesized;

Synthesis unit 4037 is synthesized for the described first image to be synthesized to be carried out image with the described second image to be synthesized Processing generates target image.

Mobile terminal 400 can be realized each process that mobile terminal is realized in the embodiment of the method for Fig. 1 to Fig. 3, to keep away Exempt to repeat, which is not described herein again.

The mobile terminal 400 of the embodiment of the present invention, by Focusing module 401 by the first camera of mobile terminal 400 and Second camera is set as different focal modes, so that obtaining, module 402 obtains the first camera and second camera exists The first preview image and the second preview image acquired respectively under different focus mode, and then pass through 403 pairs of blurring module acquisitions The first preview image and the second preview image that module 402 obtains carry out background blurring processing, target image are generated, to realize Live preview has the effect of the image of background blurring effect, solves and is only just able to achieve background blurring effect when taking pictures Fruit, and the problem of cannot realize What You See Is What You Get in preview.

5th embodiment

Fig. 7 is the block diagram of the mobile terminal of another embodiment of the present invention.Specifically, the mobile terminal 700 in Fig. 7 can be with For mobile phone, tablet computer, personal digital assistant (Personal Digital Assistant, PDA) or vehicle-mounted computer etc..

Mobile terminal 700 shown in Fig. 7 includes: at least one processor 701, memory 702, at least one network interface 704, other users interface 703 and component 706 of taking pictures, component 706 of taking pictures include the first camera and second camera.It is mobile whole Various components in end 700 are coupled by bus system 705.It is understood that bus system 705 is for realizing these components Between connection communication.Bus system 705 further includes power bus, control bus and state letter in addition to including data/address bus Number bus.But for the sake of clear explanation, various buses are all designated as bus system 705 in Fig. 7.

Wherein, user interface 703 may include display, keyboard or pointing device.For example, mouse, trace ball (trackball), touch-sensitive plate or touch screen etc..

It is appreciated that the memory 702 in the embodiment of the present invention can be volatile memory or nonvolatile memory, It or may include both volatile and non-volatile memories.Wherein, nonvolatile memory can be read-only memory (Read- Only Memory, ROM), programmable read only memory (Programmable ROM, PROM), the read-only storage of erasable programmable Device (Erasable PROM, EPROM), electrically erasable programmable read-only memory (Electrically EPROM, EEPROM) or Flash memory.Volatile memory can be random access memory (Random Access Memory, RAM), be used as external high Speed caching.By exemplary but be not restricted explanation, the RAM of many forms is available, such as static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), Synchronous Dynamic Random Access Memory (Synchronous DRAM, SDRAM), double data speed synchronous dynamic RAM (Double Data Rate SDRAM, DDRSDRAM), enhanced Synchronous Dynamic Random Access Memory (Enhanced SDRAM, ESDRAM), synchronized links Dynamic random access memory (Synchlink DRAM, SLDRAM) and direct rambus random access memory (Direct Rambus RAM, DRRAM).The memory 702 of system and method described herein is intended to include but is not limited to these and arbitrarily its It is suitble to the memory of type.

In some embodiments, memory 702 stores following element, executable modules or data structures, or Their subset of person or their superset: operating system 7021 and application program 7022.

Wherein, operating system 7021 include various system programs, such as ccf layer, core library layer, driving layer etc., are used for Realize various basic businesses and the hardware based task of processing.Application program 7022 includes various application programs, such as media Player (Media Player), browser (Browser) etc., for realizing various applied business.Realize the embodiment of the present invention The program of method may be embodied in application program 7022.

In embodiments of the present invention, by the program or instruction of calling memory 702 to store, specifically, can be application The program or instruction stored in program 7022, it is difference that the first camera and second camera in component 706 of taking pictures, which is respectively set, Focal modes, first camera and the second camera are then obtained in different focusing moulds by processor 701 The first preview image and the second preview image acquired respectively under formula, thus to first preview image and second preview Image carries out background blurring processing, generates target image.

The method that the embodiments of the present invention disclose can be applied in processor 701, or be realized by processor 701. Processor 701 may be a kind of IC chip, the processing capacity with signal.During realization, the above method it is each Step can be completed by the integrated logic circuit of the hardware in processor 701 or the instruction of software form.Above-mentioned processing Device 701 can be general processor, digital signal processor (Digital Signal Processor, DSP), dedicated integrated electricity Road (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components.It may be implemented or execute disclosed each method, step and the logic diagram in the embodiment of the present invention.It is general Processor can be microprocessor or the processor is also possible to any conventional processor etc..In conjunction with institute of the embodiment of the present invention The step of disclosed method, can be embodied directly in hardware decoding processor and execute completion, or with the hardware in decoding processor And software module combination executes completion.Software module can be located at random access memory, and flash memory, read-only memory may be programmed read-only In the storage medium of this fields such as memory or electrically erasable programmable memory, register maturation.The storage medium is located at The step of memory 702, processor 701 reads the information in memory 702, completes the above method in conjunction with its hardware.

It is understood that embodiments described herein can with hardware, software, firmware, middleware, microcode or its Combination is to realize.For hardware realization, processing unit be may be implemented in one or more specific integrated circuit (Application Specific Integrated Circuits, ASIC), digital signal processor (Digital Signal Processing, DSP), digital signal processing appts (DSP Device, DSPD), programmable logic device (Programmable Logic Device, PLD), field programmable gate array (Field-Programmable Gate Array, FPGA), general processor, In controller, microcontroller, microprocessor, other electronic units for executing herein described function or combinations thereof.

For software implementations, it can be realized herein by executing the module (such as process, function etc.) of function described herein The technology.Software code is storable in memory and is executed by processor.Memory can in the processor or It is realized outside processor.

Preferably, the focal modes of first camera are automatic focusing mode, the focusing mould of the second camera Formula is remote burnt mode.

Accordingly, processor 701 is carrying out background blurring place to first preview image and second preview image Reason is specifically used for when generating target image: according to first preview image and second preview image, determining described the Background area in one preview image;Virtualization processing is carried out to the background area in first preview image, generates mesh Logo image.

Preferably, the processor 701 is described in determine according to first preview image and second preview image When background area in the first preview image, it is specifically used for: by individual element manner of comparison, determines first preview image With the fog-level of second preview image;According to the fuzzy journey of first preview image and second preview image Image-region fuzzyyer than corresponding position in second preview image in first preview image is determined as described by degree Background area in first preview image.

Preferably as another embodiment, the focal modes of first camera are automatic focusing mode, described the The focal modes of two cameras are nearly burnt mode.

Accordingly, processor 701 is carrying out background blurring place to first preview image and second preview image Reason is also used to when generating target image: obtaining the stingy figure instruction of user's input;It is instructed according to the stingy figure, determines the area Kou Tu Domain;By default stingy nomography, the image data in the stingy graph region is obtained in first preview image, and will be described The image data scratched in graph region is determined as the first image to be synthesized;The stingy graph region is mapped to second preview image On, and the image data outside the stingy graph region is obtained in second preview image, and by the figure outside the stingy graph region As data are determined as the second image to be synthesized;Described first image to be synthesized and the described second image to be synthesized are subjected to image conjunction At processing, target image is generated.

Mobile terminal 700 can be realized each process that mobile terminal is realized in previous embodiment, to avoid repeating, here It repeats no more.

The mobile terminal 700 of the embodiment of the present invention is taken the photograph by the first camera and second for including in the component 706 that will take pictures As head is respectively set to different focal modes, so as to be obtained with institute when carrying out image preview before actually taking pictures State the first preview image that the first camera and the second camera acquire respectively under different focal modes and second pre- It lookes at image, and then background blurring processing is carried out to the first preview image and the second preview image, generate target image, realize real-time Preview has the effect of the image of background blurring effect, solves and is only just able to achieve background blurring effect when taking pictures, and The problem of What You See Is What You Get cannot be realized in preview, improve the usage experience of user.

Sixth embodiment

Fig. 8 is the structural block diagram of the mobile terminal of another embodiment of the present invention.Specifically, the mobile terminal 800 in Fig. 8 It can be mobile phone, tablet computer, personal digital assistant (Personal Digital Assistant, PDA) or vehicle-mounted computer Deng.

Mobile terminal 800 in Fig. 8 includes radio frequency (Radio Frequency, RF) circuit 810, memory 820, input Unit 830, display unit 840, processor 860, component 850 of taking pictures, voicefrequency circuit 870, WiFi (Wireless Fidelity) Module 880 and power supply 890, wherein component 850 of taking pictures includes the first camera and second camera.

Wherein, input unit 830 can be used for receiving the number or character information of user's input, and generation and mobile terminal The related signal input of 800 user setting and function control.Specifically, in the embodiment of the present invention, which can To include touch panel 831.Touch panel 831, also referred to as touch screen collect the touch operation of user on it or nearby (for example user uses the operations of any suitable object or attachment on touch panel 831 such as finger, stylus), and according to preparatory The formula of setting drives corresponding attachment device.

Optionally, touch panel 831 may include both touch detecting apparatus and touch controller.Wherein, inspection is touched The touch orientation of device detection user is surveyed, and detects touch operation bring signal, transmits a signal to touch controller;It touches Controller receives touch information from touch detecting apparatus, and is converted into contact coordinate, then gives the processor 860, and The order that processor 860 is sent can be received and executed.Furthermore, it is possible to using resistance-type, condenser type, infrared ray and surface The multiple types such as sound wave realize touch panel 831.In addition to touch panel 831, input unit 830 can also include that other inputs are set Standby 832, other input equipments 832 can include but is not limited to physical keyboard, function key (for example press by volume control button, switch Key etc.), trace ball, mouse, one of operating stick etc. or a variety of.

Wherein, display unit 840 can be used for showing information input by user or be supplied to the information and movement of user The various menu interfaces of terminal 800.Display unit 840 may include display panel 841, optionally, can use LCD or organic hair The forms such as optical diode (Organic Light-Emitting Diode, OLED) configure display panel 841.

It should be noted that touch panel 831 can cover display panel 841, touch display screen is formed, when the touch display screen is examined After measuring touch operation on it or nearby, processor 860 is sent to determine the type of touch event, is followed by subsequent processing device 860 provide corresponding visual output according to the type of touch event in touch display screen.

Touch display screen includes Application Program Interface viewing area and common control viewing area.The Application Program Interface viewing area And arrangement mode of the common control viewing area does not limit, can be arranged above and below, left-right situs etc. can distinguish two it is aobvious Show the arrangement mode in area.The Application Program Interface viewing area is displayed for the interface of application program.Each interface can be with The interface elements such as the icon comprising at least one application program and/or widget desktop control.The Application Program Interface viewing area Or the empty interface not comprising any content.This commonly uses control viewing area for showing the higher control of utilization rate, for example, Application icons such as button, interface number, scroll bar, phone directory icon etc. are set.

Wherein processor 860 is the control centre of mobile terminal 800, utilizes various interfaces and connection whole mobile phone Various pieces, by running or executing the software program and/or module that are stored in first memory 821, and calling storage Data in second memory 822 execute the various functions and processing data of mobile terminal 800, thus to mobile terminal 800 Carry out integral monitoring.Optionally, processor 860 may include one or more processing units.

In embodiments of the present invention, it is set as different by the first camera in the component 850 that will take pictures and second camera Focal modes, and make processor 860 by call store the first memory 821 in software program and/or module and/ Or the data in the second memory 822, to obtain first camera and the second camera in different focusing moulds The first preview image and the second preview image acquired respectively under formula, and to first preview image and second preview graph As carrying out background blurring processing, target image is generated.

Preferably, the focal modes of first camera are automatic focusing mode, the focusing mould of the second camera Formula is remote burnt mode.

Accordingly, processor 860 is carrying out background blurring place to first preview image and second preview image Reason is specifically used for when generating target image: according to first preview image and second preview image, determining described the Background area in one preview image;Virtualization processing is carried out to the background area in first preview image, generates mesh Logo image.

Preferably, processor 860 determines described first according to first preview image and second preview image When background area in preview image, it is specifically used for: by individual element manner of comparison, determines first preview image and institute State the fog-level of the second preview image;It, will according to the fog-level of first preview image and second preview image The image-region fuzzyyer than corresponding position in second preview image is determined as described first in first preview image Background area in preview image.

Preferably as another embodiment, the focal modes of first camera are automatic focusing mode, described the The focal modes of two cameras are nearly burnt mode.

Accordingly, processor 860 is carrying out background blurring place to first preview image and second preview image Reason is also used to when generating target image: obtaining the stingy figure instruction of user's input;It is instructed according to the stingy figure, determines the area Kou Tu Domain;By default stingy nomography, the image data in the stingy graph region is obtained in first preview image, and will be described The image data scratched in graph region is determined as the first image to be synthesized;The stingy graph region is mapped to second preview image On, and the image data outside the stingy graph region is obtained in second preview image, and by the figure outside the stingy graph region As data are determined as the second image to be synthesized;Described first image to be synthesized and the described second image to be synthesized are subjected to image conjunction At processing, target image is generated.

Mobile terminal 800 can be realized each process that mobile terminal is realized in previous embodiment, to avoid repeating, here It repeats no more.

The mobile terminal 800 of the embodiment of the present invention, by the first camera for including in component 850 of taking pictures and the second setting head Different focal modes are set as, so as to which described first can be got when carrying out image preview before actually taking pictures The first preview image and the second preview image that camera and the second camera acquire respectively under different focal modes, And then background blurring processing is carried out to first preview image and second preview image, target image is generated, is realized Live preview has the effect of the image of background blurring effect, solves and is only just able to achieve background blurring effect when taking pictures Fruit, and the problem of cannot realize What You See Is What You Get in preview, promote the usage experience of user.

Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed The scope of the present invention.

It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.

In embodiment provided herein, it should be understood that disclosed device and method can pass through others Mode is realized.For example, the apparatus embodiments described above are merely exemplary, for example, the division of the unit, only A kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or components can combine or Person is desirably integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual Between coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or communication link of device or unit It connects, can be electrical property, mechanical or other forms.

The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the effect of this embodiment scheme Fruit.

It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.

It, can be with if the function is realized in the form of SFU software functional unit and when sold or used as an independent product It is stored in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially in other words The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a People's computer, server or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention. And storage medium above-mentioned includes: that USB flash disk, mobile hard disk, ROM, RAM, magnetic or disk etc. are various can store program code Medium.

The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain Lid is within protection scope of the present invention.Therefore, protection scope of the present invention should be subject to the protection scope in claims.