Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the related art.
Therefore, a first objective of the present invention is to provide a shooting method based on front and rear cameras, which intelligently determines an optimal splicing manner according to attribute information of a frame, so that an image obtained by splicing is more stereoscopic, natural and aesthetic, a shooting effect is improved, a personalized requirement of a user is met, and user experience is improved.
The second purpose of the invention is to provide a shooting device based on front and back cameras.
A third object of the invention is to propose an electronic device.
A fourth object of the invention is to propose a computer-readable storage medium.
A fifth object of the invention is to propose an application.
In order to achieve the above object, a first embodiment of the present invention provides a front and back camera-based shooting method, where the method includes:
acquiring frame pictures respectively acquired by front and rear cameras at present;
analyzing the frame pictures and determining attribute information of each frame picture;
determining a target splicing mode according to the attribute information of each frame picture;
and splicing and shooting the frame pictures respectively collected by the front camera and the rear camera at present according to the target splicing mode.
In the shooting method based on the front and rear cameras provided by this embodiment, frame pictures currently and respectively collected by the front and rear cameras are obtained to analyze the frame pictures, attribute information of each frame picture is determined, then a corresponding target splicing mode is determined according to the attribute information of each frame picture, and the frame pictures collected by the front and rear cameras are spliced and shot according to the determined target splicing mode. Therefore, when the double-camera shooting is carried out, the optimal splicing mode is intelligently determined according to the attribute information of the frame picture, so that the image shot by splicing is more three-dimensional and natural, is rich in aesthetic feeling, improves the shooting effect, meets the personalized requirement of a user, and improves the user experience.
In addition, the shooting method based on front and back cameras provided by the above embodiment of the present invention may further have the following additional technical features:
in an embodiment of the present invention, before obtaining frame pictures respectively acquired by front and rear cameras currently, the method further includes:
and receiving a starting instruction of a front camera and a rear camera splicing shooting mode.
In another embodiment of the present invention, the attribute information of the frame picture includes one or more of the following information: the color and the brightness of the frame picture, the type of the shot object contained in the frame picture, the distance between the shot object and the camera and the motion state of the shot object.
In another embodiment of the present invention, the method further comprises:
acquiring current audio data;
if the current audio data comprises user voice, analyzing the current audio data and the frame picture, and determining the frame picture of the current speaking user;
the frame pictures that to the current difference of front and back camera is gathered are carried out the amalgamation and are shot, include:
after the frame picture of the current speaking user is amplified, the frame picture is spliced and shot with other frame pictures.
In another embodiment of the present invention, before the acquiring the current audio data, the method further includes:
and determining that the frame pictures respectively acquired by the front camera and the rear camera at present comprise face images.
In another embodiment of the present invention, the frame images currently and respectively collected by the front and rear cameras each include a portrait area;
the frame pictures that to the current difference of front and back camera is gathered are carried out the amalgamation and are shot, include:
splicing and shooting a portrait area included in any frame of picture with another frame of picture;
or,
and splicing and shooting the portrait areas in the two frame pictures with a preset background image.
In another embodiment of the present invention, the current frame pictures respectively collected by the front and rear cameras are both scene pictures;
the frame pictures that to the current difference of front and back camera is gathered are carried out the amalgamation and are shot, include:
and if the current shooting mode is determined to be panoramic shooting, splicing and shooting the multi-frame pictures continuously collected by the front camera and the rear camera to generate a panoramic image.
In order to achieve the above object, a second embodiment of the present invention provides a front and back camera based shooting device, including:
the first acquisition module is used for acquiring frame pictures respectively acquired by the front camera and the rear camera at present;
the first analysis module is used for analyzing the frame pictures and determining the attribute information of each frame picture;
the first determining module is used for determining a target splicing mode according to the attribute information of each frame picture;
and the processing module is used for splicing and shooting the frame pictures respectively collected by the front camera and the rear camera at present according to the target splicing mode.
In the shooting device based on the front and rear cameras provided by this embodiment, frame pictures currently and respectively collected by the front and rear cameras are obtained to analyze the frame pictures, attribute information of each frame picture is determined, then a corresponding target splicing manner is determined according to the attribute information of each frame picture, and the frame pictures collected by the front and rear cameras are spliced and shot according to the determined target splicing manner. Therefore, when the double-camera shooting is carried out, the optimal splicing mode is intelligently determined according to the attribute information of the frame picture, so that the image shot by splicing is more three-dimensional and natural, is rich in aesthetic feeling, improves the shooting effect, meets the personalized requirement of a user, and improves the user experience.
In addition, the photographing device based on front and rear cameras provided by the above embodiment of the present invention may further have the following additional technical features:
in one embodiment of the present invention, further comprising:
and the receiving module is used for receiving a starting instruction of a front camera and a rear camera splicing shooting mode.
In another embodiment of the present invention, the attribute information of the frame picture includes one or more of the following information: the color and the brightness of the frame picture, the type of the shot object contained in the frame picture, the distance between the shot object and the camera and the motion state of the shot object.
In another embodiment of the present invention, the method further comprises:
the second acquisition module is used for acquiring current audio data;
the second analysis module is used for analyzing the current audio data and the frame picture if the current audio data comprises the user voice, and determining the frame picture of the current speaking user;
the processing module specifically comprises:
after the frame picture of the current speaking user is amplified, the frame picture is spliced and shot with other frame pictures.
In another embodiment of the present invention, before the second obtaining module, the method further includes:
and the second determining module is used for determining that the frame pictures respectively acquired by the front camera and the rear camera at present comprise face images.
In another embodiment of the present invention, the frame images currently and respectively collected by the front and rear cameras each include a portrait area;
the processing module specifically comprises:
splicing and shooting a portrait area included in any frame of picture with another frame of picture;
or,
and splicing and shooting the portrait areas in the two frame pictures with a preset background image.
In another embodiment of the present invention, the current frame pictures respectively collected by the front and rear cameras are both scene pictures;
the processing module specifically comprises:
and if the current shooting mode is determined to be panoramic shooting, splicing and shooting the multi-frame pictures continuously collected by the front camera and the rear camera to generate a panoramic image.
To achieve the above object, a third aspect of the present invention provides an electronic device, including: the device comprises a memory, a processor and a display screen;
the memory for storing executable program code;
the display screen is used for displaying the spliced image;
the processor is configured to read the executable program code stored in the memory to run a program corresponding to the executable program code, so as to implement the front-back camera-based shooting method described in the embodiment of the first aspect.
In the electronic device provided in this embodiment, frame pictures currently and respectively acquired by the front and rear cameras are acquired to analyze the frame pictures, determine attribute information of each frame picture, determine a corresponding target splicing manner according to the attribute information of each frame picture, and splice and shoot the frame pictures acquired by the front and rear cameras according to the determined target splicing manner. Therefore, when the double-camera shooting is carried out, the optimal splicing mode is intelligently determined according to the attribute information of the frame picture, so that the image shot by splicing is more three-dimensional and natural, is rich in aesthetic feeling, improves the shooting effect, meets the personalized requirement of a user, and improves the user experience.
To achieve the above object, a fourth embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the front-back camera-based shooting method described in the first embodiment.
To achieve the above object, a fifth embodiment of the present invention provides an application program, which when executed by a processor implements the front-back camera-based shooting method described in the first embodiment.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
The embodiment of the invention mainly aims to solve the problems that when the electronic equipment is used for double-lens shooting at present, the existing shooting picture presentation layout mode is simple, the manual layout of a user is needed, the operation is complicated, and the shooting effect is poor, and provides a shooting method based on front and rear cameras.
The shooting method based on the front camera and the rear camera comprises the steps of obtaining frame pictures respectively collected by the front camera and the rear camera at present, analyzing the frame pictures, determining attribute information of each frame picture, determining a corresponding target splicing mode according to the attribute information of each frame picture, and splicing and shooting the frame pictures collected by the front camera and the rear camera according to the determined target splicing mode. Therefore, when the double-camera shooting is carried out, the optimal splicing mode is intelligently determined according to the attribute information of the frame picture, so that the image shot by splicing is more three-dimensional and natural, is rich in aesthetic feeling, improves the shooting effect, meets the personalized requirement of a user, and improves the user experience.
The following describes in detail a photographing method based on front and rear cameras according to an embodiment of the present invention with reference to the accompanying drawings.
Fig. 1 is a flowchart of a front-rear camera-based photographing method according to an embodiment of the present invention.
As shown in fig. 1, the front and rear camera-based photographing method may include the steps of:
step 101, acquiring frame pictures respectively acquired by front and rear cameras at present.
Specifically, the front-back camera-based shooting method provided in this embodiment may be executed by the front-back camera-based shooting device provided in the present invention, where the device is configured in an electronic device to process frame pictures collected by the front-back camera.
In the embodiment of the present invention, the electronic device may be any hardware device having a shooting function, such as: smart phones, personal digital assistants, PCs, tablet computers, and the like, which are not specifically limited in this respect.
In a specific implementation, before S101, the method may further include:
and receiving a starting instruction of a front camera and a rear camera splicing shooting mode.
Specifically, if a user wants to use front and rear cameras on the electronic device to perform split shooting, the front and rear camera split shooting mode can be started in the following manners, for example, as follows:
in a first implementation, a function icon of a dual-lens shooting function in a camera of the electronic device is clicked to start a front camera and a rear camera splicing shooting function.
In the second implementation mode, the function of splicing and shooting front and rear cameras is started in a voice input mode.
It should be noted that the above two implementation manners are only exemplary and are not intended to specifically limit the present invention.
Furthermore, after the front camera and the rear camera are started to be in the split mode according to the starting instruction, frame pictures of the shooting area at the current moment can be collected through the front camera and the rear camera respectively.
Step 102, analyzing the frame picture, and determining the attribute information of each frame picture.
Specifically, after the shooting devices based on the front and rear cameras acquire frame images acquired by the front and rear cameras, real-time calculation can be performed on each frame image to determine attribute information corresponding to each frame image.
The attribute information of the frame picture may include one or more of the following information: the color and brightness of the frame picture, the type of the shot object contained in the frame picture, the distance between the shot object and the camera, and the motion state of the shot object.
In this embodiment, the type of the shot object can be determined by combining the object outline, color, face recognition, networking and gallery comparison in big data. For example, the photographic subject type is a person, an animal, a still or a landscape, or the like.
And 103, determining a target splicing mode according to the attribute information of each frame picture.
Specifically, in actual application, different splicing strategies may be configured in advance in the electronic device. Therefore, after the attribute information of each frame picture is determined, the corresponding splicing mode can be matched in the splicing strategy according to the attribute information.
For example, when it is determined that the attribute information of the frame picture is the type of the photographed object, and the types of the photographed objects are a person and a landscape, matching is performed in a plurality of different matching strategies according to the person and the landscape, so as to obtain a matching mode for fusing the person and the landscape.
And 104, splicing and shooting the frame pictures respectively collected by the front camera and the rear camera at present according to the target splicing mode.
For example, as shown in fig. 2, if the determined target matching method is to blend a person and a landscape in a frame, the person contour is obtained from the corresponding frame through a matting method, and then the obtained person contour is blended with the landscape in another frame and captured to obtain a matching image.
Wherein, the matting mode in this embodiment may be, but is not limited to: magic wand, path editor, etc.
Further, after the shooting is completed, the shot picture can be presented in a display interface of the electronic equipment, so that the user can conveniently preview and view the shot picture.
In the shooting method based on the front and rear cameras provided by this embodiment, frame pictures respectively collected by the front and rear cameras are obtained to analyze the frame pictures, attribute information corresponding to each frame picture is determined, then a corresponding target splicing manner is determined according to the attribute information of each frame picture, and the frame pictures collected by the front and rear cameras are spliced and shot according to the determined target splicing manner. Therefore, when the double-camera shooting is carried out, the optimal splicing mode is intelligently determined according to the attribute information of the frame picture, so that the image shot by splicing is more three-dimensional and natural, is rich in aesthetic feeling, improves the shooting effect, meets the personalized requirement of a user, and improves the user experience.
Fig. 3 is a flowchart of a front-back camera-based shooting method according to an embodiment of the present invention.
As shown in fig. 3, the shooting method based on front and back cameras according to the embodiment of the present invention may include the following steps:
step 301, acquiring frame pictures currently and respectively acquired by front and rear cameras.
Step 302, determining whether the frame pictures respectively acquired by the front camera and the rear camera currently comprise face images, if yes, executing step 303, and if not, executing step 307.
Optionally, in this embodiment, a face detection technology may be used to perform face analysis on the acquired frame pictures to determine whether the frame pictures acquired by the front and rear cameras include a face image.
The face detection technology is that for any given image, a certain strategy is adopted to search the image to determine whether the image contains a face, and if so, the position, size and posture of one face are returned.
Step 303, acquiring current audio data, and determining whether the current audio data includes a user voice, if so, executing step 304, otherwise, executing step 306.
Specifically, when it is determined that the frame pictures respectively acquired by the front camera and the rear camera include the face images, the audio data corresponding to the acquired frame pictures is further acquired, the acquired audio data is processed through audio recognition, and whether the current audio data includes the user voice is determined.
Step 304, analyzing the current audio data and frame picture, and determining the frame picture of the current speaking user.
And 305, amplifying the frame picture of the current speaking user, and then performing splicing shooting with other frame pictures.
For example, if it is detected that the user Amy is currently speaking in the frame pictures acquired by the rear camera of the front and rear cameras, the frame picture where the user Amy is located is amplified and displayed, and then the amplified frame picture and the frame picture acquired by the front camera are spliced and photographed, as shown in fig. 4.
Further, if it is detected that the user in the frame image collected by the front camera starts speaking after the split shooting is completed, the frame image collected by the front camera may be amplified, and then the amplified frame image and the frame image collected by the rear camera are subjected to split shooting.
That is to say, the present embodiment can continuously acquire the frame images and the audio data acquired by the front and rear cameras, perform real-time analysis on the acquired frame images and audio data, switch the amplification operation of the frame images in real time according to the analysis result, and then perform the splicing shooting operation as needed.
And step 306, performing splicing shooting on the portrait area included in any frame of picture and another frame of picture.
Specifically, the portrait area in the frame picture can be pieced together and photographed in the following manner, for example, as follows:
in a first implementation manner, one of the two frames of pictures with stronger background light is selected as a spliced background, then a portrait area in the other frame of picture is obtained, and the obtained portrait area is fused with the portrait area, which can be specifically shown in fig. 5.
The portrait areas may be arranged in a parallel manner, or may be arranged adaptively according to the characteristics of the portrait areas, which is not limited in this application.
In a second implementation manner, the frame pictures collected by the rear camera are spliced on the frame pictures collected by the front camera.
In a third implementation mode, the frame pictures collected by the front camera are spliced on the frame pictures collected by the rear camera.
In a fourth implementation manner, the portrait areas in the two frame pictures are spliced with a preset background image for shooting.
That is to say, in this embodiment, the portrait areas may be respectively obtained from the two frames of pictures, then the favorite background images are obtained from the preset gallery, and the obtained portrait areas are merged onto the obtained background images.
The preset image library may be pre-stored in the electronic device by the user, or may be on the network side, which is not limited in this embodiment.
And 307, scene pictures are respectively obtained in the frame pictures currently collected by the front camera and the rear camera.
And 308, if the current shooting mode is determined to be panoramic shooting, splicing and shooting the multi-frame pictures continuously collected by the front camera and the rear camera to generate a panoramic image.
Specifically, the user who uses electronic equipment can evenly rotate electronic equipment after starting the panorama shooting mode to make the sustainable multiframe picture of gathering of front and back camera, and carry out the amalgamation with the multiframe picture that obtains and obtain panoramic image, thereby make panoramic image can show wider scene, consequently have stronger visual impact force, satisfied user demand.
In the shooting method based on the front camera and the rear camera, the front camera and the rear camera acquire corresponding frame pictures, and an optimal splicing mode is intelligently determined according to the attribute information of the frame pictures, so that the spliced and shot images are more three-dimensional and natural and are rich in aesthetic feeling, the shooting effect is improved, the personalized requirements of users are met, and the user experience is improved.
The following describes a photographing apparatus based on front and rear cameras according to an embodiment of the present invention with reference to the accompanying drawings.
Fig. 6 is a schematic structural diagram of a photographing device based on front and rear cameras according to an embodiment of the present invention.
Referring to fig. 6, the apparatus includes: the device comprises a first acquisition module 11, a first analysis module 12, a first determination module 13 and a processing module 14.
The first obtaining module 11 is configured to obtain frame pictures currently and respectively collected by front and rear cameras;
the first analyzing module 12 is configured to analyze the frame pictures and determine attribute information of each frame picture;
wherein the attribute information of the frame picture comprises one or more of the following information: the color and the brightness of the frame picture, the type of the shot object contained in the frame picture, the distance between the shot object and the camera and the motion state of the shot object.
The first determining module 13 is configured to determine a target splicing mode according to the attribute information of each frame;
the processing module 14 is configured to perform splicing shooting on the frame pictures currently and respectively acquired by the front and rear cameras according to the target splicing manner.
Specifically, in the embodiment of the present invention, the photographing device based on front and rear cameras further includes: further comprising:
and the receiving module is used for receiving a starting instruction of a front camera and a rear camera splicing shooting mode.
Further, in another embodiment of the present invention, the front and rear camera-based photographing apparatus further includes: the device comprises a second determining module, a second obtaining module and a second analyzing module.
And the second determining module is used for determining that the frame pictures respectively acquired by the front camera and the rear camera at present comprise face images.
The second acquisition module is used for acquiring current audio data;
the second analysis module is used for analyzing the current audio data and the frame picture if the current audio data comprises the user voice, and determining the frame picture of the current speaking user;
the processing module 14 specifically includes:
after the frame picture of the current speaking user is amplified, the frame picture is spliced and shot with other frame pictures.
In another embodiment of the present invention, the front and rear camera-based photographing apparatus further includes:
the frame pictures respectively collected by the front camera and the rear camera at present comprise portrait areas;
the processing module 14 specifically includes:
splicing and shooting a portrait area included in any frame of picture with another frame of picture;
or,
and splicing and shooting the portrait areas in the two frame pictures with a preset background image.
In another embodiment of the present invention, the front and rear camera-based photographing apparatus further includes:
scene pictures are respectively obtained in the frame pictures currently collected by the front camera and the rear camera;
the processing module 14 specifically includes:
and if the current shooting mode is determined to be panoramic shooting, splicing and shooting the multi-frame pictures continuously collected by the front camera and the rear camera to generate a panoramic image.
It should be noted that, for the implementation process and the technical principle of the photographing apparatus based on front and back cameras of this embodiment, reference is made to the foregoing explanation of the embodiment of the photographing method based on front and back cameras, and details are not described here again.
In the shooting device based on the front and rear cameras provided by this embodiment, frame pictures currently and respectively collected by the front and rear cameras are obtained to analyze the frame pictures, attribute information of each frame picture is determined, then a corresponding target splicing manner is determined according to the attribute information of each frame picture, and the frame pictures collected by the front and rear cameras are spliced and shot according to the determined target splicing manner. Therefore, when the double-camera shooting is carried out, the optimal splicing mode is intelligently determined according to the attribute information of the frame picture, so that the image shot by splicing is more three-dimensional and natural, is rich in aesthetic feeling, improves the shooting effect, meets the personalized requirement of a user, and improves the user experience.
In order to implement the above embodiments, the present invention further provides an electronic device.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
As shown in fig. 7, the electronic apparatus includes: a memory 21, a processor 22 and a display 23;
the memory 21 is used for storing executable program codes;
the display screen 23 is used for displaying the spliced images;
the processor 22 is configured to read the executable program code stored in the memory 21 to run a program corresponding to the executable program code, so as to implement the front-back camera-based shooting method described in the first embodiment.
It should be noted that, for the implementation process and the technical principle of the electronic device of this embodiment, reference is made to the foregoing explanation of the embodiment of the shooting method based on front and back cameras, and details are not described here again.
In the electronic device provided in this embodiment, frame pictures currently and respectively acquired by the front and rear cameras are acquired to analyze the frame pictures, determine attribute information of each frame picture, determine a corresponding target splicing manner according to the attribute information of each frame picture, and splice and shoot the frame pictures acquired by the front and rear cameras according to the determined target splicing manner. Therefore, when the double-camera shooting is carried out, the optimal splicing mode is intelligently determined according to the attribute information of the frame picture, so that the image shot by splicing is more three-dimensional and natural, is rich in aesthetic feeling, improves the shooting effect, meets the personalized requirement of a user, and improves the user experience.
In order to achieve the above object, the present invention also discloses a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the front-rear camera-based photographing method described in the embodiment of the first aspect. The method comprises the following steps: acquiring frame pictures respectively acquired by front and rear cameras at present; analyzing the frame pictures and determining attribute information of each frame picture; determining a target splicing mode according to the attribute information of each frame picture; and splicing and shooting the frame pictures respectively collected by the front camera and the rear camera at present according to the target splicing mode.
In order to achieve the above object, the present invention further discloses an application program, which when executed by a processor implements the front-back camera-based shooting method according to the embodiment of the first aspect. The method comprises the following steps: acquiring frame pictures respectively acquired by front and rear cameras at present; analyzing the frame pictures and determining attribute information of each frame picture; determining a target splicing mode according to the attribute information of each frame picture; and splicing and shooting the frame pictures respectively collected by the front camera and the rear camera at present according to the target splicing mode.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.