CN105678696B - A kind of information processing method and electronic equipment - Google Patents

A kind of information processing method and electronic equipment Download PDF

Info

Publication number
CN105678696B
CN105678696B CN201410670018.2A CN201410670018A CN105678696B CN 105678696 B CN105678696 B CN 105678696B CN 201410670018 A CN201410670018 A CN 201410670018A CN 105678696 B CN105678696 B CN 105678696B
Authority
CN
China
Prior art keywords
picture
foreground image
size
status information
depth information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410670018.2A
Other languages
Chinese (zh)
Other versions
CN105678696A (en
Inventor
严琼
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN201410670018.2A priority Critical patent/CN105678696B/en
Priority to US14/658,756 priority patent/US9607394B2/en
Publication of CN105678696A publication Critical patent/CN105678696A/en
Application granted granted Critical
Publication of CN105678696B publication Critical patent/CN105678696B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a kind of information processing methods, which comprises obtains the first operation, first operation is for choosing foreground image from the first picture;Based on first operation, the foreground image being located in the first picture is determined;Obtain the status information of the foreground image;The second operation is obtained, second operation is for the foreground image to be placed in second picture;Based on second operation, it is determined as the second picture of background;Obtain the status information of the second picture;According to the status information of the status information of the foreground image and the second picture, foreground image target size occupied in the second picture is determined;The foreground image is scaled the target size;The foreground image is shown in the second picture with the target size, is presented to the user.The present invention also discloses a kind of electronic equipment.

Description

A kind of information processing method and electronic equipment
Technical field
The present invention relates to electronic technology more particularly to a kind of information processing methods and electronic equipment.
Background technique
Background replacement is a common features in picture editting's application software.Background replacement is such a process: will Object O in one width picture A is placed into another width picture B as prospect, and wherein object O is referred to as foreground object or prospect Image.During this of background replacement, it usually needs zoomed in and out to foreground object O.Foreground object is zoomed in and out, one As there are two reason: first the reason is that, by scaling so that the scale size of foreground object O and picture B in human vision Matching;Second the reason is that, after foreground object O is moved to picture B, need to zoom in and out foreground object O to adapt to New background (i.e. picture B).These manually scale process and make the learning difficulty of background replacement function bigger, for non-special Industry editor is not easy to grasp.
Summary of the invention
In view of this, the embodiment of the present invention be solve the problems, such as it is existing in the prior art at least one and a kind of information is provided Processing method and electronic equipment, can auto zoom foreground image, to promote user experience.
The technical solution of the embodiment of the present invention is achieved in that
In a first aspect, the embodiment of the present invention provides a kind of information processing method, which comprises
The first operation is obtained, first operation is for choosing foreground image from the first picture;
Based on first operation, the foreground image being located in the first picture is determined;
Obtain the status information of the foreground image;
The second operation is obtained, second operation is for the foreground image to be placed in second picture;
Based on second operation, it is determined as the second picture of background;
Obtain the status information of the second picture;
According to the status information of the status information of the foreground image and the second picture, determine that the foreground image exists Occupied target size in the second picture;
The foreground image is scaled the target size;
The foreground image is shown in the second picture with the target size, is presented to the user.
Second aspect, the embodiment of the present invention provide a kind of electronic equipment, and the electronic equipment includes first acquisition unit, the One determination unit, second acquisition unit, third acquiring unit, the second determination unit, the 4th acquiring unit, third determination unit, Unit for scaling and display unit, in which:
The first acquisition unit, for obtaining the first operation, first operation is for choosing prospect from the first picture Image;
First determination unit, for determining the foreground image being located in the first picture based on first operation;
The second acquisition unit, for obtaining the status information of the foreground image;
The third acquiring unit, for obtaining the second operation, second operation is for the foreground image to be placed in In second picture;
Second determination unit, for being determined as the second picture of background based on second operation;
4th acquiring unit, for obtaining the status information of the second picture;
The third determination unit, for being believed according to the status information of the foreground image and the state of the second picture Breath determines foreground image target size occupied in the second picture;
The unit for scaling, for the foreground image to be scaled the target size;
The display unit is used to the target size be shown the foreground image in the second picture, is in Now give user.
Information processing method and electronic equipment provided in an embodiment of the present invention, in which: obtain the first operation, first behaviour It acts on from the first picture and chooses foreground image;Based on first operation, the foreground image being located in the first picture is determined;It obtains Take the status information of the foreground image;The second operation is obtained, second operation is for being placed in second for the foreground image In picture;Based on second operation, it is determined as the second picture of background;Obtain the status information of the second picture;Root According to the status information of the foreground image and the status information of the second picture, determine the foreground image in second figure Occupied target size in piece;The foreground image is scaled the target size;By the foreground image with the mesh Dimensioning is shown in the second picture, is presented to the user;It so, it is possible auto zoom foreground image, to promote user Experience.
Detailed description of the invention
Fig. 1-1 is the implementation process schematic diagram of one information processing method of the embodiment of the present invention;
Fig. 1-2 to Fig. 1-5 is that first operation and the second operation are the movement with continuity in the embodiment of the present invention one Operation chart;
Fig. 1-6 to Fig. 1-10 is that first operation is illustrated with the operation that the second operation is two movements in the embodiment of the present invention one Figure;
Fig. 2 is the implementation process schematic diagram of two information processing method of the embodiment of the present invention;
Fig. 3 is the composed structure schematic diagram of three electronic equipment of the embodiment of the present invention.
Specific embodiment
The embodiment of the present invention provides a kind of information processing method, belongs to field of image processing, is applied to electronic equipment, described Electronic equipment include smart phone, tablet computer, laptop, desktop computer, navigator, personal digital assistant (PDA), The terminals such as electronic reader, the electronic equipment can run application program (hereinafter referred to as applying), which includes at least one A application for editing picture;The electronic equipment of the embodiment of the present invention preferably can also be including an image acquisition units such as Camera, other than the imaging function that can have common camera, which can also be used to get institute the camera The depth information of reference object.During specific implementation, which can be array camera (Array Camera), battle array Column camera is made of multiple optical systems and multiple images sensor, and array camera can acquire two or more simultaneously Then picture forms image by algorithm generated data, and can estimate depth information using algorithm.In array camera Multiple sensors also contribute to creating various special-effects, such as it can choose any object and focuses, and shoot photo When or shooting after may be selected scene in any object focused again;Array camera can also focus multiple objects.
Information processing method provided in an embodiment of the present invention can pass through the processor caller code in electronic equipment It realizes or the information processing method is embodied with application program, the production firm of electronic equipment can directly be preset in electricity It being used in sub- equipment for user, certain user can also download the application program such as picture editor from application shop and apply, Regardless of mode, which can be stored in computer storage medium in a manner of program code.It needs Illustrate, which can also include above-mentioned array camera etc. other than including pocessor and storage media.
The technical solution of the present invention is further elaborated in the following with reference to the drawings and specific embodiments.
Fig. 1-1 is the implementation process schematic diagram of one information processing method of the embodiment of the present invention, as Figure 1-1, this method Include:
Step 101, the first operation is obtained, first operation is for choosing foreground image from the first picture;Based on described First operation, determines the foreground image being located in the first picture;
Here, first operation can be preset movement, and during specific implementation, the first operation can be figure Default movement in piece editor application, for example, starting picture editor's application, opens the first figure using picture editor application Then piece chooses one from the first picture using such as selected tool of the tool carried in picture editor's application, clipping tool A object, using the object as foreground image.There can certainly be easier mode of operation, for example, if electronic equipment Display unit be touch-sensitive display screen, then user can be with some object in the first picture of long-pressing, using the object as before Scape object, wherein long-pressing refers to that operating body stops certain threshold value or more on object, for example, stop 2 seconds or more are considered long-pressing Operation, operating body can be finger and be also possible to stylus, be can be on time using finger is long using single finger long-pressing or two A finger long-pressing.
Here, first picture is made of pixel, and each pixel may include following message, such as: colouring information And depth information.Wherein colouring information can be using grayscale information and indicate, can also be indicated using colour information, when adopting When with grayscale information, that is, color indicates only brightness, when indicating using colour information it can pass through saturation degree, tone, brightness To indicate.
Step 102, the status information of the foreground image is obtained;
Here, the status information includes at least size occupied by object, the size in depth information and picture and refers to The size in region occupied by object, in general, size occupied by object can be indicated using the number of pixel.Institute The status information for stating foreground image includes size occupied by the depth information and the foreground image of foreground image.This field Technical staff can obtain the status information of the foreground image by the various prior arts, and which is not described herein again.
Step 103, the second operation is obtained, second operation is for the foreground image to be placed in second picture;Base In second operation, it is determined as the second picture of background;
Here, first picture is different from the second picture, and the difference is primarily referred to as the first picture and the second figure The background of piece is different.
Step 104, the status information of the second picture is obtained;
Here, the status information of the second picture includes the depth information of each object in the second picture, when second When picture includes multiple objects, the depth information of each object can be the same in the second picture, can also be different, wherein the The object that object in two pictures can be in the face of people or certain a part of limbs, certain second picture is also possible to scenery Such as one big tree or still life such as desk, wall etc..
Step 105, according to the status information of the status information of the foreground image and the second picture, determine it is described before Scape image target size occupied in the second picture;
Step 106, the foreground image is scaled the target size;By the foreground image with the target size It is shown in the second picture, is presented to the user.
It is described to obtain first when the display unit of the electronic equipment is touch-sensitive display screen in the embodiment of the present invention Operation, may include step A1 and step A2;Wherein,
Step A1 detects whether the touch control operation for occurring to meet the first predetermined condition;
Step A2 is determined as obtaining the first operation when the operation meets first predetermined condition.
Here, the touch control operation meets first predetermined condition, can realize through but not limited to following form: institute State whether touch control operation is to click touching operation;Alternatively, whether the touch control operation is to double-click touching operation.
Here, when the display unit of the electronic equipment is non-touch display screen, i.e., the described electronic equipment is using tradition Key-press input mode when, it is described to obtain the first operation, including step B1 and step B2, in which:
Step B1 detects whether the button operation for occurring to meet the second predetermined condition;
Step B2 is determined as obtaining the first operation when the button operation meets second predetermined condition.
Here, the button operation meets second predetermined condition, can realize through but not limited to following form: institute State whether button operation is a certain key of long-pressing, such as pressing function key-HOME key is more than 2 seconds;Alternatively, the button operation is The no combination for certain keys, such as the combination of function key-HOME key and volume key.
In the embodiment of the present invention, first operation is the movement with continuity with second operation;Alternatively, described First operation has two movements of first time period with second operation for interval.When first operation and described second When operation is two movements that interval has first time period, the above-mentioned operation of acquisition first is suitable for the second operation of acquisition class Seemingly, it therefore repeats no more.
It is operated below with described second for the movement with continuity, to illustrate the embodiment of the present invention with first operation The scene that the technical solution of offer can be used for: starting picture editor's application as shown in Figs. 1-2, is answered using the picture editor With two pictures 11 and 14 of opening, wherein include a book 13 in the first picture 11, put one-pen 12 on book 13;Second figure Include a desk 15 in piece 14, a repeated book 16 is placed on desk.Then, as shown in Figure 1-3, in the first picture of user's long-pressing 11 Pen 12, i.e., selected pen 12 is used as foreground image, then drags and pen 12 is placed on the desk 15 of second picture 14.Such as Fig. 1- Shown in 4, user discharges pen 12 in place;As shown in Figs. 1-5, the size reduction of pen 12 is the size of pen 17, Yong Huke Perception, application program are reduced 12 size of pen in former first picture, obtain the size of pen 17, so as to second Background in picture preferably matches.It should be noted that application program will obtain pen during user's long-pressing pen 12 12 status information, when user is when discharging pen 12, application program can also obtain the status information of second picture 14, this Sample, application program will determine pen 12 in second picture 14 according to the status information of pen 12 and the status information of second picture 14 In occupied target size;Then pen 12 is scaled the target size (i.e. the size of pen 17);Finally by pen 12 with pen 17 size is shown in second picture 14, is presented to the user.In the present embodiment, user selectes foreground image-by long-pressing Foreground image this series of movement to target position is dragged, to realize above-mentioned the first operation and the second operation.
It is below two movements of the interval with first time period with first operation and second operation, to illustrate The scene that technical solution provided in an embodiment of the present invention can be used for: starting picture editor's application as shown in figures 1 to 6, utilizes institute It states picture editor's application and opens the first picture 11, wherein include a book 13 in the first picture 11, put one-pen on book 13 12.Then, as shown in figs. 1-7, user selectes 12 (Fig. 1-7 of pen in the first picture 11 by the select tools in application program In pen 12 be in dotted line, to show that pen 12 select by user), i.e., selected pen 12 is as foreground image.Then as shown in figures 1-8, Second picture 14 is opened using picture editor application, includes a desk 15 in second picture 14, a pile is placed on desk Book 16;Then as shown in figs 1-9, user selects suitable position by mouse or picking and originally selected pen 12 is placed on second On the desk 15 of picture 14.As Figure 1-10 shows, the size reduction of pen 12 is the size of pen 17, and user is appreciable to be, application Program is reduced 12 size of pen in former first picture, obtains the size of pen 17, so as to the background in second picture Preferably matching.It should be noted that application program will obtain the state letter of pen 12 during user selectes pen 12 Breath, when user is when discharging pen 12, application program can also obtain the status information of second picture 14, in this way, application program The mesh occupied in second picture 14 of pen 12 will be determined according to the status information of pen 12 and the status information of second picture 14 Dimensioning;Then pen 12 is scaled the target size (i.e. the size of pen 17);Finally pen 12 is shown with the size of pen 17 In second picture 14, it is presented to the user.In the present embodiment, user selectes foreground image and determines that second picture is to pass through tool There are two movements of certain time interval to realize.
Information processing method and electronic equipment provided in an embodiment of the present invention, in which: the first operation is obtained, based on described the One operation, determines the foreground image being located in the first picture;Obtain the status information of the foreground image;The second operation is obtained, Based on second operation, it is determined as the second picture of background;Obtain the status information of the second picture;Before described The status information of the status information of scape image and the second picture determines that the foreground image is shared in the second picture According to target size;The foreground image is scaled the target size;The foreground image is shown with the target size Show in the second picture, is presented to the user;It so, it is possible auto zoom foreground image, to promote user experience.
Embodiment two
Based on the above embodiments one, the embodiment of the present invention provides a kind of information processing method, is applied to electronic equipment, figure 2 be the implementation process schematic diagram of two information processing method of the embodiment of the present invention, as shown in Fig. 2, this method comprises:
Step 201, the first operation is obtained, first operation is for choosing foreground image from the first picture;Based on described First operation, determines the foreground image being located in the first picture;
Here, first operation can be preset movement, and during specific implementation, the first operation can be figure Default movement in piece editor application, for example, starting picture editor's application, opens the first figure using picture editor application Then piece chooses one from the first picture using such as selected tool of the tool carried in picture editor's application, clipping tool A object, using the object as foreground image.There can certainly be easier mode of operation, for example, if electronic equipment Display unit be touch-sensitive display screen, then user can be with some object in the first picture of long-pressing, using the object as before Scape object, wherein long-pressing refers to that operating body stops certain threshold value or more on object, for example, stop 2 seconds or more are considered long-pressing Operation, operating body can be finger and be also possible to stylus, be can be on time using finger is long using single finger long-pressing or two A finger long-pressing.
Here, first picture is made of pixel, and each pixel may include following message, such as: colouring information And depth information.Wherein colouring information can be using grayscale information and indicate, can also be indicated using colour information, when adopting When with grayscale information, that is, color indicates only brightness, when indicating using colour information it can pass through saturation degree, tone, brightness To indicate.
Step 202, the foreground image first size and the foreground picture occupied in first picture are obtained As the first depth information in first picture;
Step 203, the second operation is obtained, second operation is for the foreground image to be placed in second picture;Base In second operation, it is determined as the second picture of background;
Here, first picture is different from the second picture, and the difference is primarily referred to as the first picture and the second figure The background of piece is different.
Step 204, the second depth information of the second picture is obtained;
Step 205, according to the first size, first depth information and second depth information determine it is described before Scape image target size occupied in the second picture;
Step 206, the foreground image is scaled the target size;By the foreground image with the target size It is shown in the second picture, is presented to the user.
In the embodiment of the present invention, in step 205 deeply according to the first size, first depth information and described second Degree information determines foreground image target size C' occupied in the second picture, specifically can be by following Formula (1) is calculated:
C' is target size in formula (1), and C is the first size, and d' is first depth information, and d is described second Depth information.
It is described to obtain foreground image first size occupied in first picture in the embodiment of the present invention, Include:
Sum of all pixels included by the foreground image is obtained, is specifically included:
Judge that the pixel in first picture whether in the foreground object, obtains the first judging result one by one;
When first judging result shows that the pixel is in the foreground object, included by the foreground object Number of pixels adds 1;
When first judging result shows the pixel not in the foreground object, judge in first picture Next pixel whether in the foreground object.
The method of sum of all pixels included by the acquisition foreground image of above-mentioned offer, i.e., check in the first picture one by one Whether each pixel is in foreground image, if it is determined that and sum of all pixels of the pixel in foreground image then in foreground image adds 1, Otherwise next pixel is judged whether in foreground image, finally checks the sum of all pixels of available foreground image when finishing i.e. For C.
In the embodiment of the present invention, the status information further includes the focal length for shooting the image acquisition units of picture;
Accordingly, step 205, true according to the first size, first depth information and second depth information Fixed foreground image target size occupied in the second picture, comprising:
According to the first size, first depth information, second depth information, for shooting first figure The focal length of the focal length of the image acquisition units of piece, image acquisition units for shooting the second picture, determines the prospect Image target size occupied in the second picture, can be specifically calculated by following formula (2):
In formula (2), C' is target size, and C is the first size, and d' is first depth information, and d is described second Depth information, f' are the focal length for shooting the image acquisition units of the second picture, and f is the figure for shooting first picture As the focal length of acquisition unit, wherein image acquisition units include camera or camera.Wherein, focal length is the one of image acquisition units The inner parameter of a fixation can be obtained by the method that standard pattern is demarcated, have existing algorithm that can find out at present The focal length of image acquisition units, therefore repeat no more.
For formula (2), when the first picture uses same image acquisition units with second picture, formula (2) can become Shape is formula (3):
Above-mentioned formula (1) and the first depth information in formula (2) and the second depth information can be adopted from corresponding image Collection unit obtains, and can have corresponding depth information for each pixel, the first depth letter in the embodiment of the present invention Breath can be the average value of the depth information of foreground image, and the second depth information being averaged for the depth information of second picture Value.
In the embodiment of the present invention, above-mentioned formula (1) and formula (2) are first situated between below through the following steps that be derived by It continues and how to derive formula (2):
In above formula,Be it is well known, due to the image acquisition units for shooting the second picture Focal length f' is far smaller than d', and the focal length f for shooting the image acquisition units of first picture is far smaller than d, therefore can push away Derived expression (1):
Embodiment three
Based on above-mentioned embodiment of the method, the embodiment of the present invention provides a kind of electronic equipment, it is described below in the electronics set The function that standby included each unit is realized can be realized by the processor caller code in electronic equipment;Fig. 3 For the composed structure schematic diagram of three electronic equipment of the embodiment of the present invention, as shown in figure 3, the electronic equipment 300 includes first obtaining Unit 301, the first determination unit 302, second acquisition unit 303, third acquiring unit 304, the second determination unit the 305, the 4th Acquiring unit 306, third determination unit 307, unit for scaling 308 and display unit 309, in which:
The first acquisition unit 301, for obtaining the first operation, first operation is for before the selection of the first picture Scape image;
First determination unit 302, for determining the foreground picture being located in the first picture based on first operation Picture;
The second acquisition unit 303, for obtaining the status information of the foreground image;
The third acquiring unit 304, for obtaining the second operation, second operation is for setting the foreground image In second picture;
Second determination unit 305, for being determined as the second picture of background based on second operation;
4th acquiring unit 306, for obtaining the status information of the second picture;
The third determination unit 307, for according to the status information of the foreground image and the shape of the second picture State information determines foreground image target size occupied in the second picture;
The unit for scaling 308, for the foreground image to be scaled the target size;
The display unit 309, for being shown the foreground image in the second picture with the target size, It is presented to the user.
Here, first operation can be preset movement, and during specific implementation, the first operation can be figure Default movement in piece editor application, for example, starting picture editor's application, opens the first figure using picture editor application Then piece chooses one from the first picture using such as selected tool of the tool carried in picture editor's application, clipping tool A object, using the object as foreground image.There can certainly be easier mode of operation, for example, if electronic equipment Display unit be touch-sensitive display screen, then user can be with some object in the first picture of long-pressing, using the object as before Scape object, wherein long-pressing refers to that operating body stops certain threshold value or more on object, for example, stop 2 seconds or more are considered long-pressing Operation, operating body can be finger and be also possible to stylus, be can be on time using finger is long using single finger long-pressing or two A finger long-pressing.
Here, first picture is made of pixel, and each pixel may include following message, such as: colouring information And depth information.Wherein colouring information can be using grayscale information and indicate, can also be indicated using colour information, when adopting When with grayscale information, that is, color indicates only brightness, when indicating using colour information it can pass through saturation degree, tone, brightness To indicate.
Here, the status information includes at least size occupied by object, the size in depth information and picture and refers to The size in region occupied by object, in general, size occupied by object can be indicated using the number of pixel.Institute The status information for stating foreground image includes size occupied by the depth information and the foreground image of foreground image.This field Technical staff can obtain the status information of the foreground image by the various prior arts, and which is not described herein again.
Here, first picture is different from the second picture, and the difference is primarily referred to as the first picture and the second figure The background of piece is different.
Here, the status information of the second picture includes the depth information of each object in the second picture, when second When picture includes multiple objects, the depth information of each object can be the same in the second picture, can also be different, wherein the The object that object in two pictures can be in the face of people or certain a part of limbs, certain second picture is also possible to scenery Such as one big tree or still life such as desk, wall etc..
In the embodiment of the present invention, first operation is the movement with continuity with second operation;Alternatively, described First operation has two movements of first time period with second operation for interval.When first operation and described second When operation is two movements that interval has first time period, the above-mentioned operation of acquisition first is suitable for the second operation of acquisition class Seemingly, it therefore repeats no more.
It is operated below with described second for the movement with continuity, to illustrate the embodiment of the present invention with first operation The scene that the technical solution of offer can be used for: starting picture editor's application as shown in Figs. 1-2, is answered using the picture editor With two pictures 11 and 14 of opening, wherein include a book 13 in the first picture 11, put one-pen 12 on book 13;Second figure Include a desk 15 in piece 14, a repeated book 16 is placed on desk.Then, as shown in Figure 1-3, in the first picture of user's long-pressing 11 Pen 12, i.e., selected pen 12 is used as foreground image, then drags and pen 12 is placed on the desk 15 of second picture 14.Such as Fig. 1- Shown in 4, user discharges pen 12 in place;As shown in Figs. 1-5, the size reduction of pen 12 is the size than 17, Yong Huke Perception, application program are reduced 12 size of pen in former first picture, obtain the size of pen 17, so as to second Background in picture preferably matches.It should be noted that application program will obtain pen during user's long-pressing pen 12 12 status information, when user is when discharging pen 12, application program can also obtain the status information of second picture 14, this Sample, application program will determine pen 12 in second picture 14 according to the status information of pen 12 and the status information of second picture 14 In occupied target size;Then the target size (size i.e. than 17) will be scaled than 12;Finally by pen 12 with pen 17 size is shown in second picture 14, is presented to the user.In the present embodiment, user selectes foreground image-by long-pressing Foreground image this series of movement to target position is dragged, to realize above-mentioned the first operation and the second operation.
It is below two movements of the interval with first time period with first operation and second operation, to illustrate The scene that technical solution provided in an embodiment of the present invention can be used for: starting picture editor's application as shown in figures 1 to 6, utilizes institute It states picture editor's application and opens the first picture 11, wherein include a book 13 in the first picture 11, put one-pen on book 13 12.Then, as shown in figs. 1-7, user selectes 12 (Fig. 1-7 of pen in the first picture 11 by the select tools in application program In pen 12 be in dotted line, to show that pen 12 select by user), i.e., selected pen 12 is as foreground image.Then as shown in figures 1-8, Second picture 14 is opened using picture editor application, includes a desk 15 in second picture 14, a pile is placed on desk Book 16;Then as shown in figs 1-9, user selects suitable position by mouse or picking and originally selected pen 12 is placed on second On the desk 15 of picture 14.As Figure 1-10 shows, the size reduction of pen 12 is the size than 17, and user is appreciable to be, application Program is reduced 12 size of pen in former first picture, obtains the size of pen 17, so as to the background in second picture Preferably matching.It should be noted that application program will obtain the state letter of pen 12 during user selectes pen 12 Breath, when user is when discharging pen 12, application program can also obtain the status information of second picture 14, in this way, application program The mesh occupied in second picture 14 of pen 12 will be determined according to the status information of pen 12 and the status information of second picture 14 Dimensioning;Then the target size (size i.e. than 17) will be scaled than 12;Finally pen 12 is shown with the size of pen 17 In second picture 14, it is presented to the user.In the present embodiment, user selectes foreground image and determines that second picture is to pass through tool There are two movements of certain time interval to realize.
Information processing method and electronic equipment provided in an embodiment of the present invention, in which: first acquisition unit 301 obtains first Operation, the first determination unit 302 are based on first operation, determine the foreground image being located in the first picture;Second obtains list Member 303 obtains the status information of the foreground image;Third acquiring unit 304 obtains the second operation, second determination unit 305, based on second operation, are determined as the second picture of background;4th acquiring unit 306 obtains second figure The status information of piece;The third determination unit 307 is according to the status information of the foreground image and the shape of the second picture State information determines foreground image target size occupied in the second picture;The unit for scaling 308 will be described Foreground image is scaled the target size;The display unit 309 shows the foreground image with the target size In the second picture, it is presented to the user;It so, it is possible auto zoom foreground image, to promote user experience.
Example IV
Based on the above embodiments three, the embodiment of the present invention provides a kind of electronic equipment, it is described below in the electronic equipment The function that included each unit is realized can be realized by the processor caller code in electronic equipment;The electronics Equipment includes first acquisition unit, the first determination unit, second acquisition unit, third acquiring unit, the second determination unit, the 4th Acquiring unit, third determination unit, unit for scaling and display unit, in which:
The first acquisition unit, for obtaining the first operation, first operation is for choosing prospect from the first picture Image;
Here, first operation can be preset movement, and during specific implementation, the first operation can be figure Default movement in piece editor application, for example, starting picture editor's application, opens the first figure using picture editor application Then piece chooses one from the first picture using such as selected tool of the tool carried in picture editor's application, clipping tool A object, using the object as foreground image.There can certainly be easier mode of operation, for example, if electronic equipment Display unit be touch-sensitive display screen, then user can be with some object in the first picture of long-pressing, using the object as before Scape object, wherein long-pressing refers to that operating body stops certain threshold value or more on object, for example, stop 2 seconds or more are considered long-pressing Operation, operating body can be finger and be also possible to stylus, be can be on time using finger is long using single finger long-pressing or two A finger long-pressing.
First determination unit, for determining the foreground image being located in the first picture based on first operation;
Here, first picture is made of pixel, and each pixel may include following message, such as: colouring information And depth information.Wherein colouring information can be using grayscale information and indicate, can also be indicated using colour information, when adopting When with grayscale information, that is, color indicates only brightness, when indicating using colour information it can pass through saturation degree, tone, brightness To indicate.
The second acquisition unit, for obtaining foreground image first size occupied in first picture With first depth information of the foreground image in first picture;
The third acquiring unit, for obtaining the second operation, second operation is for the foreground image to be placed in In second picture;
Second determination unit, for being determined as the second picture of background based on second operation;
Here, first picture is different from the second picture, and the difference is primarily referred to as the first picture and the second figure The background of piece is different.
4th acquiring unit, for obtaining the second depth information of the second picture;
The third determination unit, for according to the first size, first depth information and second depth Information determines foreground image target size occupied in the second picture;
The unit for scaling, for the foreground image to be scaled the target size;
The display unit is used to the target size be shown the foreground image in the second picture, is in Now give user.
In the embodiment of the present invention, the third determination unit is according to the first size, first depth information and institute It states the second depth information and determines foreground image target size C' occupied in the second picture, can specifically lead to Following formula (1) is crossed to be calculated:
C' is target size in formula (1), and C is the first size, and d' is first depth information, and d is described second Depth information.
In the embodiment of the present invention, it is shared in first picture that the foreground image is obtained in the second acquisition unit According to first size, comprising:
Sum of all pixels included by the foreground image is obtained, is specifically included:
Judge that the pixel in first picture whether in the foreground object, obtains the first judging result one by one;
When first judging result shows that the pixel is in the foreground object, included by the foreground object Number of pixels adds 1;
When first judging result shows the pixel not in the foreground object, judge in first picture Next pixel whether in the foreground object.
The method of sum of all pixels included by the acquisition foreground image of above-mentioned offer, i.e., check in the first picture one by one Whether each pixel is in foreground image, if it is determined that and sum of all pixels of the pixel in foreground image then in foreground image adds 1, Otherwise next pixel is judged whether in foreground image, finally checks the sum of all pixels of available foreground image when finishing i.e. For C.
In the embodiment of the present invention, the status information further includes the focal length for shooting the image acquisition units of picture;
Accordingly, the third determination unit, deeply according to the first size, first depth information and described second Degree information determines foreground image target size occupied in the second picture, comprising:
According to the first size, first depth information, second depth information, for shooting first figure The focal length of the focal length of the image acquisition units of piece, image acquisition units for shooting the second picture, determines the prospect Image target size occupied in the second picture, can be specifically calculated by following formula (2):
C' is target size in formula (2), and C is the first size, and d' is first depth information, and d is described second Depth information, f' are the focal length for shooting the image acquisition units of the second picture, and f is the figure for shooting first picture As the focal length of acquisition unit, wherein image acquisition units include camera or camera.Wherein, focal length is the one of image acquisition units The inner parameter of a fixation can be obtained by the method that standard pattern is demarcated, have existing algorithm that can find out at present The focal length of image acquisition units, therefore repeat no more.
For formula (2), when the first picture uses same image acquisition units with second picture, formula (2) can become Shape is formula (3):
Above-mentioned formula (1) and the first depth information in formula (2) and the second depth information can be adopted from corresponding image Collection unit obtains, and can have corresponding depth information for each pixel, the first depth letter in the embodiment of the present invention Breath can be the average value of the depth information of foreground image, and the second depth information being averaged for the depth information of second picture Value.
In the embodiment of the present invention, above-mentioned formula (1) and formula (2) are first situated between below through the following steps that be derived by It continues and how to derive formula (2):
In above formula,Be it is well known, due to the image acquisition units for shooting the second picture Focal length f' is far smaller than d', and the focal length f for shooting the image acquisition units of first picture is far smaller than d, therefore can push away Derived expression (1):
In several embodiments provided herein, it should be understood that disclosed device and method can pass through it Its mode is realized.Apparatus embodiments described above are merely indicative, for example, the division of the unit, only A kind of logical function partition, there may be another division manner in actual implementation, such as: multiple units or components can combine, or It is desirably integrated into another system, or some features can be ignored or not executed.In addition, shown or discussed each composition portion Mutual coupling or direct-coupling or communication connection is divided to can be through some interfaces, the INDIRECT COUPLING of equipment or unit Or communication connection, it can be electrical, mechanical or other forms.
Above-mentioned unit as illustrated by the separation member, which can be or may not be, to be physically separated, aobvious as unit The component shown can be or may not be physical unit;Both it can be located in one place, and may be distributed over multiple network lists In member;Some or all of units can be selected to achieve the purpose of the solution of this embodiment according to the actual needs.
In addition, each functional unit in various embodiments of the present invention can be fully integrated in one processing unit, it can also To be each unit individually as a unit, can also be integrated in one unit with two or more units;It is above-mentioned Integrated unit both can take the form of hardware realization, can also realize in the form of hardware adds SFU software functional unit.
Those of ordinary skill in the art will appreciate that: realize that all or part of the steps of above method embodiment can pass through The relevant hardware of program instruction is completed, and program above-mentioned can store in computer-readable storage medium, which exists When execution, step including the steps of the foregoing method embodiments is executed;And storage medium above-mentioned includes: movable storage device, read-only deposits The various media that can store program code such as reservoir (Read Only Memory, ROM), magnetic or disk.
If alternatively, the above-mentioned integrated unit of the present invention is realized in the form of software function module and as independent product When selling or using, it also can store in a computer readable storage medium.Based on this understanding, the present invention is implemented Substantially the part that contributes to existing technology can be embodied in the form of software products the technical solution of example in other words, The computer software product is stored in a storage medium, including some instructions are used so that computer equipment (can be with It is personal computer, server or network equipment etc.) execute all or part of each embodiment the method for the present invention. And storage medium above-mentioned includes: various Jie that can store program code such as movable storage device, ROM, magnetic or disk Matter.
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 based on the protection scope of the described claims.

Claims (10)

1. a kind of information processing method, which is characterized in that the described method includes:
The first operation is obtained, first operation is for choosing foreground image from the first picture;
Based on first operation, the foreground image being located in the first picture is determined;
Obtain the status information of the foreground image;Wherein, the status information of the foreground image includes: that the foreground image exists The first depth information of occupied first size and the foreground image in first picture in first picture;
The second operation is obtained, second operation is for the foreground image to be placed in second picture;
Based on second operation, it is determined as the second picture of background;
Obtain the status information of the second picture;Wherein, the status information of the second picture includes: the second picture Second depth information;
According to the status information of the status information of the foreground image and the second picture, determine the foreground image described Occupied target size in second picture;Wherein, the target size is directly proportional to the first size;
The foreground image is scaled the target size;
The foreground image is shown in the second picture with the target size, is presented to the user.
2. the method according to claim 1, wherein first operation is with second operation for coherent The movement of property;Alternatively,
First operation has two movements of first time period with second operation for interval.
3. the method according to claim 1, wherein the status information includes the depth information of object in picture With size occupied by object in picture;
Accordingly, the status information of the foreground image is obtained, comprising:
Obtain the foreground image in first picture occupied first size and the foreground image described first The first depth information in picture;
Accordingly, the status information of the second picture is obtained, comprising:
Obtain the second depth information of the second picture;
Accordingly, according to the status information of the status information of the foreground image and the second picture, the foreground picture is determined As occupied target size in the second picture, comprising:
Determine the foreground image described according to the first size, first depth information and second depth information Occupied target size in second picture.
4. according to the method described in claim 3, it is characterized in that, the status information further includes the image for shooting picture The focal length of acquisition unit;
Accordingly, the foreground picture is determined according to the first size, first depth information and second depth information As occupied target size in the second picture, comprising:
According to the first size, first depth information, second depth information, for shooting first picture The focal length of the focal length of image acquisition units, image acquisition units for shooting the second picture, determines the foreground image The occupied target size in the second picture.
5. according to the method described in claim 3, it is characterized in that, described obtain the foreground image in first picture Occupied first size, comprising:
Obtain sum of all pixels included by the foreground image.
6. a kind of electronic equipment, which is characterized in that the electronic equipment includes first acquisition unit, the first determination unit, second Acquiring unit, third acquiring unit, the second determination unit, the 4th acquiring unit, third determination unit, unit for scaling and display are single Member, in which:
The first acquisition unit, for obtaining the first operation, first operation is for choosing foreground image from the first picture;
First determination unit, for determining the foreground image being located in the first picture based on first operation;
The second acquisition unit, for obtaining the status information of the foreground image;Wherein, the state letter of the foreground image Breath include: the foreground image in first picture occupied first size and the foreground image in first figure The first depth information in piece;
The third acquiring unit, for obtaining the second operation, second operation is for being placed in second for the foreground image In picture;
Second determination unit, for being determined as the second picture of background based on second operation;
4th acquiring unit, for obtaining the status information of the second picture;Wherein, the state letter of the second picture Breath includes: the second depth information of the second picture;
The third determination unit, for according to the status information of the foreground image and the status information of the second picture, Determine foreground image target size occupied in the second picture;Wherein, the target size and described first Size is directly proportional;
The unit for scaling, for the foreground image to be scaled the target size;
The display unit is presented to for being shown the foreground image in the second picture with the target size User.
7. electronic equipment according to claim 6, which is characterized in that it is described first operation with it is described second operation for The movement of continuity;Alternatively,
First operation has two movements of first time period with second operation for interval.
8. electronic equipment according to claim 6 or 7, which is characterized in that the status information includes object in picture Size occupied by object in depth information and picture;
Accordingly, the second acquisition unit includes that the first acquisition module and second obtain module, wherein described first obtains mould Block, for obtaining foreground image first size occupied in first picture;
Described second obtains module, for obtaining first depth information of the foreground image in first picture;
Accordingly, the 4th acquiring unit, for obtaining the second depth information of the second picture;
Accordingly, the third determination unit is used for according to the first size, first depth information and described second deeply Degree information determines foreground image target size occupied in the second picture.
9. electronic equipment according to claim 8, which is characterized in that the status information further includes for shooting picture The focal length of image acquisition units;
Accordingly, the third determination unit is used for according to the first size, first depth information, described second deeply Degree information, the focal length of image acquisition units for shooting first picture are adopted for shooting the image of the second picture The focal length for collecting unit determines foreground image target size occupied in the second picture.
10. electronic equipment according to claim 8, which is characterized in that it is described first obtain module, for obtain it is described before Sum of all pixels included by scape image.
CN201410670018.2A 2014-11-20 2014-11-20 A kind of information processing method and electronic equipment Active CN105678696B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201410670018.2A CN105678696B (en) 2014-11-20 2014-11-20 A kind of information processing method and electronic equipment
US14/658,756 US9607394B2 (en) 2014-11-20 2015-03-16 Information processing method and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410670018.2A CN105678696B (en) 2014-11-20 2014-11-20 A kind of information processing method and electronic equipment

Publications (2)

Publication Number Publication Date
CN105678696A CN105678696A (en) 2016-06-15
CN105678696B true CN105678696B (en) 2019-03-29

Family

ID=56958044

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410670018.2A Active CN105678696B (en) 2014-11-20 2014-11-20 A kind of information processing method and electronic equipment

Country Status (1)

Country Link
CN (1) CN105678696B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106375662B (en) * 2016-09-22 2019-04-12 宇龙计算机通信科技(深圳)有限公司 A kind of image pickup method based on dual camera, device and mobile terminal
CN108270978B (en) * 2016-12-30 2021-08-13 纳恩博(北京)科技有限公司 Image processing method and device
CN112689196B (en) * 2021-03-09 2021-06-11 北京世纪好未来教育科技有限公司 Interactive video playing method, player, equipment and storage medium
CN113507575B (en) * 2021-09-08 2021-11-26 上海英立视电子有限公司 Human body self-photographing lens generation method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101305401A (en) * 2005-11-14 2008-11-12 微软公司 Stereo video for gaming
CN101853498A (en) * 2009-03-31 2010-10-06 华为技术有限公司 Image synthetizing method and image processing device
CN102932541A (en) * 2012-10-25 2013-02-13 广东欧珀移动通信有限公司 Mobile phone photographing method and system
CN103024271A (en) * 2012-12-14 2013-04-03 广东欧珀移动通信有限公司 Method photographing on electronic device and electronic device adopting method
CN103442181A (en) * 2013-09-06 2013-12-11 深圳市中兴移动通信有限公司 Image processing method and image processing device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7720283B2 (en) * 2005-12-09 2010-05-18 Microsoft Corporation Background removal in a live video
US8626930B2 (en) * 2007-03-15 2014-01-07 Apple Inc. Multimedia content filtering
US9203918B2 (en) * 2007-03-15 2015-12-01 Nokia Technologies Oy Pulling information from information sources via refer requests
CN102855459B (en) * 2011-06-30 2015-11-25 株式会社理光 For the method and system of the detection validation of particular prospect object

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101305401A (en) * 2005-11-14 2008-11-12 微软公司 Stereo video for gaming
CN101853498A (en) * 2009-03-31 2010-10-06 华为技术有限公司 Image synthetizing method and image processing device
CN102932541A (en) * 2012-10-25 2013-02-13 广东欧珀移动通信有限公司 Mobile phone photographing method and system
CN103024271A (en) * 2012-12-14 2013-04-03 广东欧珀移动通信有限公司 Method photographing on electronic device and electronic device adopting method
CN103442181A (en) * 2013-09-06 2013-12-11 深圳市中兴移动通信有限公司 Image processing method and image processing device

Also Published As

Publication number Publication date
CN105678696A (en) 2016-06-15

Similar Documents

Publication Publication Date Title
JP7090210B2 (en) User interface for simulated depth effects
CN104410785B (en) A kind of information processing method and electronic equipment
CN106134176B (en) System and method for multifocal imaging
US9607394B2 (en) Information processing method and electronic device
CN108347559A (en) A kind of image pickup method, terminal and computer readable storage medium
CN107771391B (en) Method and apparatus for determining exposure time of image frame
CN105678696B (en) A kind of information processing method and electronic equipment
CN102148917B (en) Display processing apparatus
KR20110086111A (en) Method system and software for providing image sensor based human machine interfacing
CN109145970B (en) Image-based question and answer processing method and device, electronic equipment and storage medium
CN104917967A (en) Photographing method and terminal
JP5962249B2 (en) Character input program, information processing apparatus, and character input method
CN104333688B (en) The device and method of image formation sheet feelings symbol based on shooting
CN206595991U (en) A kind of double-camera mobile terminal
CN108781252A (en) A kind of image capturing method and device
KR20190111034A (en) Feature image acquisition method and device, and user authentication method
WO2016006090A1 (en) Electronic apparatus, method, and program
CN107426490A (en) A kind of photographic method and terminal
CN110619325A (en) Text recognition method and device
CN101593348B (en) Mobile call terminal with image processing function and image processing method thereof
CN110136233B (en) Method, terminal and storage medium for generating nail effect map
CN109981967A (en) For the image pickup method of intelligent robot, device, terminal device and medium
JP2015184906A (en) Skin color detection condition determination device, skin color detection condition determination method and skin color detection condition determination computer program
CN104519233B (en) Information processor and its control method
CN110363814A (en) A kind of method for processing video frequency, device, electronic device and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant