Disclosure of Invention
The invention provides a photo processing method and a photo processing device, which are used for at least solving the problem that the photo processing in the related technology has defects.
According to an aspect of the present invention, there is provided a photograph processing method including: the method comprises the steps that scenery at different positions in a view finding range is photographed through a main camera and an auxiliary camera, wherein the main camera is used for photographing N photos of the scenery at different positions, the auxiliary camera is used for obtaining depth of field information of the photos in the view finding range, and N is larger than or equal to 2; determining a picture corresponding to the focus from the N pictures according to the selected focus; and synthesizing the picture according to the picture corresponding to the focus and the depth information.
Further, the photographing of the scenery at different positions in the viewing range through the main camera and the auxiliary camera comprises: focusing the scenery at different positions in the viewing range through the main camera, and adjusting an aperture to take N pictures, wherein the N pictures are a group of pictures with the same characteristics; and taking a picture through the auxiliary camera, and obtaining the depth of field information of the picture according to the definition of the scenery in the picture taken by the auxiliary camera.
Further, focusing the scenery at different positions in the viewing range through the main camera, and adjusting the aperture to take N pictures comprises: and automatically adjusting the size of an aperture according to the brightness information around the focusing position or adjusting the brightness of the photo area by using a preset algorithm to take N photos.
Further, the synthesizing the picture according to the picture corresponding to the focus and the depth information includes: and taking the picture corresponding to the focus as a negative film, taking the picture shot by the auxiliary camera as an upper film, covering the upper film on the negative film, carrying out image buckling on the focus of the upper film, and carrying out blurring treatment on the image which belongs to different depth information positions around the focus.
Further, after synthesizing the picture by the picture corresponding to the focus and the depth information, the method further includes: and displaying the synthesized photo.
According to another aspect of the present invention, there is also provided a photograph processing apparatus including: the shooting module is used for shooting the scenery at different positions in a view finding range through a main camera and an auxiliary camera, wherein the main camera is used for shooting N photos of the scenery at different positions, the auxiliary camera is used for obtaining depth of field information of the photos in the view finding range, and N is greater than or equal to 2; the determining module is used for determining the picture corresponding to the focus from the N pictures according to the selected focus; and the synthesis processing module is used for synthesizing the picture through the picture corresponding to the focus and the depth information.
Further, the photographing module comprises: the focusing unit is used for focusing the scenery at different positions in the framing range through the main camera and adjusting an aperture to take N pictures, wherein the N pictures are a group of pictures with the same characteristics; and the obtaining unit is used for shooting the picture through the auxiliary camera and obtaining the depth of field information of the picture according to the definition degree of the scenery in the picture shot by the auxiliary camera.
Further, the focusing unit includes: and the focusing shooting subunit is used for automatically adjusting the size of the aperture according to the brightness information around the focusing position or shooting N pictures by adjusting the brightness of the picture area by using a preset algorithm.
Further, the synthesis processing module includes: and the synthesis processing unit is used for taking the picture corresponding to the focus as a negative film, taking the picture shot by the auxiliary camera as a top film, covering the top film on the negative film, carrying out image buckling on the focus of the top film, and carrying out blurring processing on the images at different depth information positions around the focus.
Further, the apparatus further comprises: and the display module is used for displaying the synthesized photo.
According to the invention, the main camera and the auxiliary camera are adopted to photograph the scenery at different positions in the viewing range, wherein the main camera is used for photographing N photos of the scenery at different positions, the auxiliary camera is used for obtaining the depth of field information of the photos in the viewing range, and N is greater than or equal to 2; determining a picture corresponding to the focus from the N pictures according to the selected focus; the picture is synthesized through the picture corresponding to the focus and the depth of field information, the problem that the picture processing in the related technology has defects is solved, the picture can be synthesized according to the focus determined by the user, and user experience is improved.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
An embodiment of the present invention provides a photo processing method, and fig. 1 is a flowchart of the photo processing method according to the embodiment of the present invention, as shown in fig. 1, including:
step S102, shooting the scenery at different positions in a view finding range through a main camera and an auxiliary camera, wherein the main camera is used for shooting N photos of the scenery at different positions, the auxiliary camera is used for obtaining depth of field information of the photos in the view finding range, and N is greater than or equal to 2;
step S104, determining a picture corresponding to the focus from the N pictures according to the selected focus;
and step S106, synthesizing the picture according to the picture corresponding to the focus and the depth information.
Through the steps, the scenery at different positions in the view finding range is photographed through the main camera and the auxiliary camera, wherein the main camera is used for photographing N photos of the scenery at different positions, the auxiliary camera is used for obtaining the depth of field information of the photos in the view finding range, and N is greater than or equal to 2; determining a picture corresponding to the focus from the N pictures according to the selected focus; the picture is synthesized through the picture corresponding to the focus and the depth of field information, the problem that the picture processing in the related technology has defects is solved, the picture can be synthesized according to the focus determined by the user, and user experience is improved.
Further, taking pictures of the scenery at different positions in the viewing range through the main camera and the auxiliary camera may include: focusing the scenery at different positions in the viewing range through the main camera, and adjusting an aperture to take N pictures, wherein the N pictures are a group of pictures with the same characteristics; and taking a picture through the auxiliary camera, and obtaining the depth of field information of the picture according to the definition of the scenery in the picture taken by the auxiliary camera.
Further, focusing the scenery at different positions in the viewing range through the main camera, and adjusting the aperture to take N pictures may include: and automatically adjusting the size of an aperture according to the brightness information around the focusing position or adjusting the brightness of the photo area by using a preset algorithm to take N photos.
Further, synthesizing the picture through the picture corresponding to the focus and the depth information may include: and taking the picture corresponding to the focus as a negative film, taking the picture shot by the secondary camera as a top film, covering the top film on the negative film, carrying out image buckling at the focus of the top film, and carrying out blurring treatment on the image at the position of different depth of field information around the focus.
Further, after the picture is synthesized by the picture corresponding to the focus and the depth information, the synthesized picture is displayed.
Fig. 2 is a block diagram of a photo processing apparatus according to an embodiment of the present invention, and as shown in fig. 2, the photo processing apparatus includes a photographing module 22, a determining module 24, and a synthesis processing module 26, which are briefly described below.
The photographing module 22 is configured to photograph scenes at different positions within a viewing range through a main camera and a sub-camera, where the main camera is configured to photograph N photos of the scenes at the different positions, and the sub-camera is configured to obtain depth-of-field information of the photos within the viewing range, where N is greater than or equal to 2;
a determining module 24, configured to determine, according to the selected focal point, a photo corresponding to the focal point from the N photos;
and a synthesis processing module 26, configured to perform synthesis processing on the picture according to the picture corresponding to the focus and the depth information.
Fig. 3 is a block diagram of a photograph processing apparatus according to a preferred embodiment of the present invention, as shown in fig. 3, the photographing module 22 includes:
a focusing unit 32, configured to focus a scene at different positions within the viewing range through the main camera, and adjust an aperture to take N pictures, where the N pictures are a group of pictures with the same characteristics;
and an obtaining unit 34 for taking a picture by the sub-camera and obtaining depth information of the picture according to the degree of sharpness of the subject in the picture taken by the sub-camera.
Fig. 4 is a block diagram two of the photo processing apparatus according to the preferred embodiment of the present invention, and as shown in fig. 4, the focusing unit 32 includes:
and the focusing shooting sub-unit 42 is used for automatically adjusting the aperture size according to the brightness information around the focusing position or shooting N pictures by adjusting the brightness of the picture area by using a preset algorithm.
Fig. 5 is a block diagram three of the photograph processing apparatus according to the preferred embodiment of the present invention, and as shown in fig. 5, the composition processing module 26 includes:
and the synthesis processing unit 52 is configured to use the picture corresponding to the focus as a negative film, use the picture taken by the secondary camera as a top film, cover the top film on the negative film, perform a snap-off process on the focus of the top film, and perform blurring processing on the image at the position around the focus where the image belongs to different depth information positions.
Fig. 6 is a block diagram four of a photograph processing apparatus according to a preferred embodiment of the present invention, as shown in fig. 6, the apparatus further comprising:
and a display module 62, configured to display the synthesized photo.
The following examples are provided to further illustrate the present invention.
The embodiment of the invention provides a device for realizing photographing first and then focusing by using double cameras, which realizes automatic adjustment of different aperture sizes according to different focal positions. The device may include two cameras, including a main camera and a sub-camera, a main camera photographing module, a sub-camera depth-of-field calculating module, a focus image selecting module, a photograph display synthesizing module, a display module, etc., where the functions of these modules are implemented by the photographing module 22, the determining module 24, and the synthesizing processing module 26, and each module is further described below.
The main camera is used for shooting a picture, the main camera is high in shooting pixel and can automatically focus, and the processor automatically adjusts the size of an aperture according to brightness information around a focus position or adjusts the brightness of a picture area by using an algorithm;
the auxiliary camera is used for calculating the depth of field, the shooting pixels of the auxiliary camera are not high, the shooting speed is high, automatic focusing is not available, and the depth of field of different scenes can be calculated quickly;
the main camera shooting module divides a shooting area into different sub-areas, if shot objects are displayed on a display screen, the display area is divided into five areas including an upper left area, an upper right area, a lower left area, a lower right area and a middle area, after the objects in the sub-areas are automatically focused and the aperture of the objects is adjusted, a plurality of pictures are shot, and the shot pictures are stored in a storage area of the terminal device as a group of related pictures.
The auxiliary camera depth of field calculation module is used for calculating depth of field data of different shot scenes and storing shot pictures and the depth of field data obtained through calculation in a storage area of the terminal device;
the focus image selection module is used for calling a picture which is shot after the automatic focusing and the aperture adjusting are carried out on the picture in a group of pictures shot by the main camera after a user selects to focus a certain area of the picture again;
the picture display and synthesis module takes the picture selected by the focus image selection module and shot by the main camera as a negative film, takes the picture shot by the auxiliary camera as a top film, changes the snap picture at the focus of the top film into transparent, and performs blurring treatment on the images at different depth of field positions around the focus, wherein the blurring degree is higher at the position which is farther away from the depth of field of the focus scene;
and the display module displays the image provided by the photo display and synthesis module and displays the image on a display screen.
The embodiment of the present invention further provides a method for implementing focusing after photographing by using two cameras, and fig. 7 is a flowchart of the method for implementing focusing after photographing by using two cameras according to the embodiment of the present invention, as shown in fig. 7, including:
step S702, starting shooting by a main camera and an auxiliary camera, wherein the main camera automatically focuses and adjusts an aperture to shoot scenes at different positions, a plurality of photos are shot to form a group of photos with the same characteristics, and the photos automatically generate a group of related photos which are identified by the serial numbers of each photo, such as 20180520-a, 20180520-b, 20180520-c and 20180520-d, and are stored in a storage unit; the auxiliary camera takes a picture, and depth-of-field data of the scenery is formed according to the definition of the scenery in the picture;
step S704, the user selects to refocus the shot picture, selects the refocusing position, and the focus image selection module calls the picture corresponding to the refocusing position;
step S706, the picture display and synthesis module takes the picture called by the focus image selection module as a negative film, the picture taken by the secondary camera as a top film, the top film covers the negative film, the snap-down image at the focus of the top film is changed into transparent, the blurring degree of the images belonging to different depth of field positions around the focus is higher, the farther the depth of field of the focus scene is, the higher the blurring degree is, and the synthesized picture is provided for the display module to be displayed.
In the following, taking three trees with different distances from the camera as an example for further explanation, fig. 8 is a schematic diagram of taking pictures with different distances from the camera according to an embodiment of the present invention, as shown in fig. 8, a main camera respectively takes focus shooting on three trees, namely, far, middle and near trees, to generate three pictures, and the generated three pictures are respectively as follows: focusing the trees at the far position, wherein the trees at the middle part and the near part represent shooting fuzziness by using dotted lines, and only the trees at the far position focus clearly; focusing the middle tree, wherein the trees at the far part and the near part represent shooting fuzziness by using dotted lines, and only the middle tree is clearly focused; focusing is carried out on trees at the near position, trees at the far part and the middle part are indicated by dotted lines to show shooting blur, and only trees at the near position are focused clearly.
Fig. 9 is a schematic diagram of photo synthesis according to an embodiment of the present invention, as shown in fig. 9, a left image is a photograph taken by a main camera, a right image is photograph data generated by a photograph taken by a sub-camera, the two photographs are superimposed, the photograph taken by the main camera is a negative film, the photograph data taken by the sub-camera is a top film, the top film covers the negative film, the top film cuts out a focusing area, scenes around the cutting area are blurred, image data for focusing a near tree is formed, and a synthesized image is displayed on a display screen.
According to the embodiment of the invention, a plurality of pictures are continuously shot, different pictures select different brightness places to be focus points, better exposure is automatically obtained through different apertures, or better brightness is obtained by utilizing an algorithm, the shot pictures can obtain details of scenes at the focus points, after the pictures are shot, when a user reselects a certain position in the pictures to be the focus point, the corresponding pictures can be called, and then the depth of field information obtained by the auxiliary camera is utilized to synthesize the surrounding blurred pictures.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.