CN108924405B - Photographing focus correction and image processing method and device based on distance - Google Patents
Photographing focus correction and image processing method and device based on distance Download PDFInfo
- Publication number
- CN108924405B CN108924405B CN201810596881.6A CN201810596881A CN108924405B CN 108924405 B CN108924405 B CN 108924405B CN 201810596881 A CN201810596881 A CN 201810596881A CN 108924405 B CN108924405 B CN 108924405B
- Authority
- CN
- China
- Prior art keywords
- images
- distance
- image
- corresponding camera
- shot
- 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.)
- Expired - Fee Related
Links
- 238000012937 correction Methods 0.000 title claims abstract description 33
- 238000003672 processing method Methods 0.000 title claims abstract description 17
- 238000000034 method Methods 0.000 claims abstract description 47
- 230000008569 process Effects 0.000 claims abstract description 13
- 238000012545 processing Methods 0.000 claims description 40
- 238000004590 computer program Methods 0.000 claims description 12
- 230000001960 triggered effect Effects 0.000 claims description 12
- 238000013461 design Methods 0.000 description 12
- 238000010586 diagram Methods 0.000 description 10
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000009977 dual effect Effects 0.000 description 3
- 230000003068 static effect Effects 0.000 description 3
- 241001465754 Metazoa Species 0.000 description 2
- 230000004888 barrier function Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 210000003746 feather Anatomy 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 241000692870 Inachis io Species 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000008439 repair process Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/67—Focus control based on electronic image sensor signals
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
- G06T3/4038—Image mosaicing, e.g. composing plane images from plane sub-images
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/95—Computational photography systems, e.g. light-field imaging systems
- H04N23/951—Computational photography systems, e.g. light-field imaging systems by using two or more images to influence resolution, frame rate or aspect ratio
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Theoretical Computer Science (AREA)
- Computing Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Studio Devices (AREA)
Abstract
The embodiment of the invention provides a distance-based photographing focusing correction and image processing method and device, wherein the method comprises the following steps: acquiring shooting information of at least two first images, wherein the at least two first images are images shot by a terminal with at least two cameras at the same time, the focal length of each first image is the focal length after focusing correction is carried out according to the distance between each part of object and the camera in the process of pre-shooting, and the shooting information comprises the distance between each part of object in the first image and the corresponding camera; determining obstacles and shot objects in each first image according to the distance between each part of object and the corresponding camera; and splicing at least two first images according to the distance between the shot object at the edge of the obstacle in one first image and the corresponding camera and the distance between the shot object in other first images and the corresponding camera to obtain a second image, wherein the second image does not have the obstacle. The embodiment can overcome the difficulty caused by the shooting and image splicing of the obstacles.
Description
Technical Field
The invention relates to the technical field of image processing, in particular to a photographing focusing correction and image processing method and device based on distance.
Background
With the spread of photographing apparatuses such as cameras, more and more users record live drips through apparatuses having a photographing function.
Conventionally, for safety reasons, obstacles such as fences and wires are provided between an object and a photographer to isolate the object from the photographer. When a user shoots an object, the user cannot directly shoot the object due to the obstruction of the obstacle and must shoot the object through the obstacle, so that the shot image not only contains the object but also fences, wires and the like, and the user cannot obtain an attractive image. And due to the existence of the obstacles, the camera may focus on the obstacles in general, especially on the wire mesh, so that it is difficult to acquire the image without the obstacles at the later stage.
Disclosure of Invention
The embodiment of the invention provides a distance-based photographing focusing correction and image processing method and device, aiming at overcoming the difficulty of obstacles in photographing and image splicing.
In a first aspect, an embodiment of the present invention provides a distance-based photographing focus correction and image processing method, including:
acquiring shooting information of at least two first images, wherein the at least two first images are images shot by a terminal with at least two cameras at the same time, the focal length of each first image is the focal length after focusing correction according to the distance between each part of object and the camera in the process of pre-shooting, and the shooting information comprises the distance between each part of object in the first image and the corresponding camera;
determining obstacles and shot objects in each first image according to the distance between each part of object and the corresponding camera;
and splicing at least two first images according to the distance between the shot object at the edge of the obstacle in one first image and the corresponding camera and the distance between the shot object in other first images and the corresponding camera to obtain a second image, wherein no obstacle exists in the second image.
In one possible design, the determining, in each of the first images, an obstacle and a subject according to a distance between each of the objects and a corresponding camera includes:
determining target objects which are positioned on the same plane and have a distance with the cameras smaller than the distance between surrounding objects and the cameras according to the distance between each part of object and the corresponding camera;
and determining obstacles in the first image according to the target object, and taking the image between the obstacles in the first image as a shot object.
In another possible design, the stitching processing, according to the distance between the object at the edge of the obstacle in one of the first images and the corresponding camera and the distance between each part of the object in the other first images and the corresponding camera, the two first images to obtain a second image includes:
acquiring a difference value between a distance between a shot object at the edge of an obstacle in one of the first images and the corresponding camera and a distance between the shot object in the other first images and the corresponding camera;
acquiring target parts in other first images corresponding to distances of which the distance difference is smaller than a preset difference;
and carrying out splicing processing according to the shot object at the edge of the obstacle in one of the first images and the target part in the other first images to obtain a second image.
In another possible design, after the at least two first images are stitched to obtain a second image, the method further includes:
and storing and controlling the terminal to display the second image.
In another possible design, before acquiring the shooting information of each of the two first images, the method further includes:
controlling at least two cameras of the terminal to shoot a current scene according to a shooting instruction triggered by a user to obtain at least two first images;
processing each first image to obtain the distance between each part of object in the first image and the corresponding camera;
and generating and storing the shooting information according to the distance between each part of object in the first image and the corresponding camera.
In another possible design, before controlling at least two cameras of the terminal to shoot a current scene according to a shooting instruction triggered by a user to obtain the at least two first images, the method further includes:
controlling at least two cameras of the terminal to pre-shoot a current scene according to a pre-shooting instruction triggered by a user to obtain at least two third images;
processing the image of each third image to obtain the distance between each part of object in the third image and the corresponding camera;
determining obstacles in the third image according to the distance between each part of object and the corresponding camera;
and controlling each camera of the terminal to focus on the shot object between the obstacles.
In another possible design, after controlling at least two cameras of the terminal to shoot a current scene and obtaining the at least two first images, the method further includes:
and performing associated storage on at least two first images.
In a second aspect, an embodiment of the present invention provides a distance-based photographing focus correction and image processing apparatus, including:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring respective shooting information of at least two first images, the at least two first images are images shot by a terminal with at least two cameras at the same time, the focal length of each first image is the focal length after focusing correction is carried out according to the distance between each part of object and the camera in the pre-shooting process, and the shooting information comprises the distance between each part of object in the first image and the corresponding camera;
the determining module is used for determining obstacles and shot objects in each first image according to the distance between each part of object and the corresponding camera;
and the splicing module is used for splicing the two first images according to the distance between the shot object at the edge of the obstacle in one of the first images and the corresponding camera and the distance between the shot object in the other first images and the corresponding camera to obtain a second image, wherein the second image does not have the obstacle.
In one possible design, the determining module is specifically configured to:
determining target objects which are positioned on the same plane and have a distance with the cameras smaller than the distance between surrounding objects and the cameras according to the distance between each part of object and the corresponding camera;
and determining obstacles in the first image according to the target object, and taking the image between the obstacles in the first image as a shot object.
In another possible design, the splicing module is specifically configured to:
acquiring a difference value between a distance between a shot object at the edge of an obstacle in one of the first images and the corresponding camera and a distance between the shot object in the other first images and the corresponding camera;
acquiring target parts in other first images corresponding to distances of which the distance difference is smaller than a preset difference;
and carrying out splicing processing according to the shot object at the edge of the obstacle in one of the first images and the target part in the other first images to obtain a second image.
In yet another possible design, the stitching module is further configured to:
and after the at least two first images are spliced to obtain a second image, storing and controlling the terminal to display the second image.
In yet another possible design, the method further includes: a shooting module;
the shooting module is used for: before the shooting information of the at least two first images is obtained, controlling at least two cameras of the terminal to shoot a current scene according to a shooting instruction triggered by a user to obtain the at least two first images;
processing each first image to obtain the distance between each part of object in the first image and the corresponding camera;
and generating and storing the shooting information according to the distance between each part of object in the first image and the corresponding camera.
In a further possible embodiment, the camera module is further configured to: controlling at least two cameras of the terminal to pre-shoot a current scene according to a pre-shooting instruction triggered by a user to obtain at least two third images;
processing the image of each third image to obtain the distance between each part of object in the third image and the corresponding camera;
determining obstacles in the third image according to the distance between each part of object and the corresponding camera;
and controlling each camera of the terminal to focus on the shot object between the obstacles.
In a further possible embodiment, the camera module is further configured to: and controlling at least two cameras of the terminal to shoot the current scene, and performing associated storage on at least two first images after the at least two first images are obtained.
In a third aspect, an embodiment of the present invention provides a distance-based photographing focus correction and image processing apparatus, including: a memory, a processor and a computer program, the computer program being stored in the memory, the processor running the computer program to perform the distance based photographing focus correction and image processing method as described above in the first aspect and possible designs of the first aspect.
In a fourth aspect, embodiments of the present invention provide a storage medium comprising a computer program that, when executed, is configured to perform the distance-based photographing focus modification and image processing method as set forth in the first aspect and possible designs of the first aspect.
In the method, the respective shooting information of at least two first images is acquired, the at least two first images are images shot by a terminal with at least two cameras at the same time, and the shooting information includes the distance between each part of an object in the first images and the corresponding camera, so that the embodiment can shoot not only a static object but also a dynamic object, and an obstacle and a shot object are determined in the first images according to the distance between each part of the object and the corresponding camera; and splicing at least two first images according to the distance between the shot object at the edge of the obstacle in one first image and the corresponding camera and the distance between the shot object in other first images and the corresponding camera to obtain a second image, wherein the second image obtained through the splicing process has no obstacle, so that an attractive image can be obtained.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a terminal provided in the present invention;
FIG. 2 is a first flowchart of a distance-based image processing method according to the present invention;
FIG. 3 is a second flowchart of a distance-based image processing method according to the present invention;
FIG. 4A is a schematic diagram of a first image provided by the present invention;
FIG. 4B is a schematic diagram of another first image provided by the present invention;
FIG. 5 is a flowchart of a method for distance-based focus correction for photography in accordance with the present invention;
fig. 6 is a schematic structural diagram of a distance-based photographing focus correction and image processing apparatus according to an embodiment of the present invention;
fig. 7 is a hardware configuration diagram of a distance-based photographing focus correction and image processing apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to solve the problem that an attractive image cannot be obtained due to obstruction of an obstacle, the embodiment is applied to equipment with at least two camera capturing modules, two images of the same scene are captured at the same time, and the two images are spliced to obtain an image without the obstacle. The method of the embodiment can be applied to static scenes and can be applied to shooting dynamic scenes.
The device with two or more than two camera modules may be a device with technologies such as dual cameras, wide-angle and long-focus matching dual cameras, single camera and dual pixels, or a device with multiple cameras, and the present embodiment does not particularly limit the number of cameras of the device, and may be two or more than two. The device can be a mobile phone, a tablet, a camera and the like. For example, fig. 1 is a schematic structural diagram of a terminal provided in the present invention. The present embodiment will be described by taking an example in which the terminal 10 has two cameras. As shown in fig. 1, the terminal 10 has two cameras, a camera 11 and a camera 12, respectively. The arrangement of the cameras 11 and 12 is not particularly limited in this embodiment, and they may be arranged horizontally or vertically. In this embodiment, the terminal shown in fig. 1 is taken as an example, and the distance-based image processing method provided in this embodiment is described in detail. Those skilled in the art can understand that the implementation manner of the multiple cameras is similar, and the detailed description of the embodiment is omitted here.
Fig. 2 is a first flowchart of a distance-based image processing method according to the present invention. As shown in fig. 2, the method includes:
s201, acquiring shooting information of at least two first images, wherein the at least two first images are images shot by a terminal with at least two cameras at the same time, the focal length of each first image is the focal length after focusing correction is carried out according to the distance between each part of object and the camera in the pre-shooting process, and the shooting information comprises the distance between each part of object in the first image and the corresponding camera.
The at least two first images of the embodiment are images captured by a terminal with at least two cameras at the same time. Specifically, the first images may be at least two first images currently captured by the terminal, or at least two first images captured and stored in advance.
Those skilled in the art understand that when at least two first images are captured through the terminal, pre-capturing may be performed first, an obstacle and a captured object are obtained according to a distance between each part of the object and the camera, and then focus correction is performed on a focal length, so that the focal length is aligned to the captured object, that is, the focal length of each first image in this embodiment is the focal length after focus correction.
Further, the terminal can also acquire shooting information in the process of shooting at least two first images, wherein the shooting information comprises the distance between each part of object in each first image and the corresponding camera. The distance measuring sensor can be installed on each camera, the distance measuring sensor can measure the distance between each camera and each part of objects in the current scene, the distance measuring sensor can be an infrared sensor or an ultrasonic sensor, and the like.
The object in this embodiment may be a part of a scene, an animal, or the like, that is, the scene, the animal, or the like is divided into a plurality of parts, and a distance between each part and the camera is obtained. The present embodiment does not particularly limit the granularity of each part division.
S202, determining obstacles and shot objects in each first image according to the distance between each part of object and the corresponding camera.
Since the obstacle is shielded in front of the object, the distance between the obstacle and the camera is smaller than the distance between the object and the camera, and thus the obstacle and the object can be determined in the first image according to the distance.
S203, according to the distance between the shot object at the edge of the obstacle in one of the first images and the corresponding camera and the distances between the shot object in the other first images and the corresponding camera, splicing at least two first images to obtain a second image, wherein the second image does not have the obstacle.
Specifically, the obstacles in another first image may be replaced by the object in at least one first image by using a fixed-point positioning technique or the like to perform stitching, so as to obtain a second image without obstacles.
Those skilled in the art can understand that the embodiment is also applicable to video recording, and only a plurality of first images need to be spliced into a continuous-time video.
In the method, the respective shooting information of at least two first images is acquired, the at least two first images are images shot by a terminal with at least two cameras at the same time, and the shooting information includes the distance between each part of an object in the first images and the corresponding camera, so that the embodiment can shoot not only a static object but also a dynamic object, and an obstacle and a shot object are determined in the first images according to the distance between each part of the object and the corresponding camera; and splicing at least two first images according to the distance between the shot object at the edge of the obstacle in one first image and the corresponding camera and the distance between the shot object in other first images and the corresponding camera to obtain a second image, wherein the second image obtained through the splicing process has no obstacle, so that an attractive image can be obtained.
Fig. 3 is a second flowchart of the distance-based image processing method provided by the present invention, as shown in fig. 3, the method includes:
s301, acquiring shooting information of at least two first images, wherein the at least two first images are images shot by a terminal with at least two cameras at the same time, and the shooting information comprises distances between objects in the first images and the corresponding cameras;
s302, determining target objects which are located on the same plane and have a distance with the cameras smaller than the distance between surrounding objects and the cameras according to the distance between each part of object and the corresponding camera;
s303, determining obstacles in the first image according to the target object, and taking the image between the obstacles in the first image as a shot object;
s304, acquiring a difference value between the distance between the shot object at the edge of the obstacle in one of the first images and the corresponding camera and the distance between the shot object in the other first images and the corresponding camera;
s305, acquiring other target parts in the first image corresponding to the distance with the distance difference smaller than the preset difference;
s306, splicing the shot object at the edge of the obstacle in one of the first images and the target part in the other first images to obtain a second image.
S301 in fig. 3 is similar to S201 in fig. 2, and this embodiment is not described herein again.
In S302 and S303, a target object, which is an obstacle in the first image and is located in the same plane and whose distance from the camera is smaller than the distance from the surrounding object to the camera, may be determined according to the distance between each part of the object and the corresponding camera, and the image between the obstacles is taken as the subject.
Specifically, since the obstacle is located in front of the object to be shot, when the object is continuous and located on the same plane and close to the camera, the object can be determined to be the obstacle, and the object between the obstacles is the object to be shot.
For example, fig. 4A is a schematic diagram of a first image provided by the present invention, and fig. 4B is a schematic diagram of another first image provided by the present invention. As shown in fig. 4A and 4B, a continuous mesh structure is recognized and is an obstacle in one plane, and the scene in the middle of the mesh is located behind the mesh.
In the stitching process, the embodiment takes two first images as an example for detailed description. The second image is obtained by splicing the shot object at the edge of the obstacle in one first image and the target part in the other first image. Those skilled in the art can understand that for 3 first images, the object at the edge of the obstacle in one of the first images and the target portion in the other two first images can be stitched, and for more first images, the implementation manner is similar, and details of this embodiment are not repeated here.
The target part is a part, which is located in other first images, of which the difference between the distance from the camera and the distance from the camera to the object at the edge of the obstacle in one of the first images is smaller than a preset difference.
In the stitching process, that is, in S304 to S306, a difference between a distance between the subject at the edge of the obstacle in one of the first images and the corresponding camera and a distance between the subject and the corresponding camera in the other first image is obtained. Referring to fig. 4A and fig. 4B, for example, taking the feather crown on the head of a peacock as an example, in fig. 4A, the distance between the feather crown a at the edge of the obstacle and the camera is obtained, in fig. 4B, the distance between each part of the object to be shot and the camera is obtained, then the difference between the two distances is obtained, and when the difference is smaller than the preset difference, the object corresponding to the two distances is obtained.
Specifically, when the difference is small, it is indicated as a similar area, and the two target objects corresponding to the two first images may be stitched, so as to obtain a second image. For example, when the pinna a in fig. 4A and the pinna B in fig. 4B are the objects, the two objects are merged to obtain the second image. After the second image is obtained, it may be stored and displayed to the user.
In the embodiment, the target objects which are located on the same plane and have a distance with the camera smaller than the distance between the surrounding objects and the camera are determined according to the distance between each part of the object and the corresponding camera; determining obstacles in the first images according to the target object, taking the images between the obstacles in the first images as shot objects, accurately determining the obstacles and the shot objects, and acquiring the difference value between the distance between the shot object at the edge of the obstacle in one of the first images and the corresponding camera and the distance between the shot object in the other first images and the corresponding camera; acquiring a target part corresponding to a distance with a distance difference smaller than a preset difference; and carrying out splicing processing according to the shot object at the edge of the obstacle in one of the first images and the target part in the other first images to obtain a second image, and realizing splicing quickly and accurately.
On the basis of the above embodiment, accurate focusing can be achieved based on the distance, and a detailed implementation process that the focal length of each first image is the focal length after focus correction according to the distance between each part of the object and the camera in the pre-shooting will be described below by using a specific embodiment.
FIG. 5 is a flowchart of a method for distance-based focus correction for photography according to the present invention. As shown in fig. 5, the method includes:
s501, controlling at least two cameras of the terminal to pre-shoot a current scene according to a pre-shooting instruction triggered by a user to obtain at least two third images;
s502, performing image processing on each third image to obtain the distance between each part of object in the third image and the corresponding camera;
s503, determining obstacles in the third image according to the distance between each part of object and the corresponding camera;
and S504, controlling each camera of the terminal to focus on the shot object between the obstacles.
S505, controlling at least two cameras of the terminal to shoot a current scene according to a shooting instruction triggered by a user to obtain at least two first images;
s506, performing image processing on each first image to obtain the distance between each part of object in the first image and the corresponding camera;
and S507, generating and storing the shooting information according to the distance between each part of object in the first image and the corresponding camera.
In a specific implementation process, after a user triggers a pre-shooting instruction through various operations, according to the pre-shooting instruction, at least two cameras of the control terminal pre-shoot a current scene to obtain at least two third images, and perform image processing on each third image, for example, various image processing techniques are combined with a ranging sensor to obtain distances between objects in the third images and the cameras shooting the objects, and determine an obstacle in the third image according to the distances, where a specific determination method may refer to the embodiment of fig. 3, and details are not repeated here.
After the shot object is determined, controlling each camera to focus on the shot object among the obstacles, controlling each camera of the terminal to shoot the current scene after a user triggers a shooting instruction, focusing the shot object at the moment, finally obtaining at least two first images, and performing image processing on each first image to obtain the distance between each part of object in the first image and the corresponding camera; and generating and storing shooting information according to the distance between each part of object in the first image and the corresponding camera, and optionally, performing associated storage on the at least two first images.
According to the embodiment, the terminal is focused on the shot object through pre-shooting, so that the problem that the camera is focused on the barrier and is difficult to repair in the later period due to the existence of the barrier is solved.
Fig. 6 is a schematic structural diagram of a distance-based photographing focus correction and image processing apparatus according to an embodiment of the present invention. As shown in fig. 6, the distance-based photographing focus correction and image processing apparatus 60 includes: an acquisition module 601, a determination module 602, and a splicing module 603. Optionally, a shooting module 604 is further included.
An obtaining module 601, configured to obtain respective shooting information of at least two first images, where the at least two first images are images shot by a terminal with at least two cameras at the same time, a focal length of each first image is a focal length obtained by performing focus correction according to a distance between each part of an object and a camera during pre-shooting, and the shooting information includes a distance between each part of the object in the first image and the corresponding camera;
a determining module 602, configured to determine an obstacle and a subject in each of the first images according to a distance between each of the objects and a corresponding camera;
a stitching module 603, configured to perform stitching processing on at least two first images according to a distance between a shot object at an edge of an obstacle in one of the first images and a corresponding camera and a distance between a shot object in the other first images and a corresponding camera, so as to obtain a second image, where no obstacle exists in the second image.
Optionally, the determining module 602 is specifically configured to:
determining target objects which are positioned on the same plane and have a distance with the cameras smaller than the distance between surrounding objects and the cameras according to the distance between each part of object and the corresponding camera;
and determining obstacles in the first image according to the target object, and taking the image between the obstacles in the first image as a shot object.
Optionally, the splicing module 603 is specifically configured to:
acquiring a difference value between a distance between a shot object at the edge of an obstacle in one of the first images and the corresponding camera and a distance between the shot object in the other first images and the corresponding camera;
acquiring target parts in other first images corresponding to distances of which the distance difference is smaller than a preset difference;
and carrying out splicing processing according to the shot object at the edge of the obstacle in one of the first images and the target part in the other first images to obtain a second image.
Optionally, the stitching module 603 is further configured to store and control the terminal to display a second image after the at least two first images are stitched to obtain the second image.
Optionally, the shooting module 604 is configured to control at least two cameras of the terminal to shoot a current scene according to a shooting instruction triggered by a user before the shooting information of each of the at least two first images is obtained, so as to obtain the at least two first images;
processing each first image to obtain the distance between each part of object in the first image and the corresponding camera;
and generating and storing the shooting information according to the distance between each part of object in the first image and the corresponding camera.
Optionally, the capturing module 604 is further configured to: controlling at least two cameras of the terminal to pre-shoot a current scene according to a pre-shooting instruction triggered by a user to obtain at least two third images;
processing the image of each third image to obtain the distance between each part of object in the third image and the corresponding camera;
determining obstacles in the third image according to the distance between each part of object and the corresponding camera;
and controlling each camera of the terminal to focus on the shot object between the obstacles.
Optionally, the capturing module 604 is further configured to: and controlling at least two cameras of the terminal to shoot the current scene, and performing associated storage on at least two first images after the at least two first images are obtained.
The apparatus of this embodiment may be configured to implement the technical solution of the foregoing method embodiment, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 7 is a hardware configuration diagram of a distance-based photographing focus correction and image processing apparatus according to an embodiment of the present invention. As shown in fig. 7, the distance-based photographing focus correction and image processing apparatus 70 includes: a memory 701 for storing a computer program;
a processor 702 for executing the computer program stored in the memory to implement the above-described method embodiments. Reference may be made in particular to the description relating to the method embodiments described above.
Alternatively, the memory 701 may be separate or integrated with the processor 702.
When the memory 701 is a device separate from the processor 702, the apparatus 70 may further include:
a bus 703 for connecting the memory 701 and the processor 702.
An embodiment of the present invention also provides a storage medium including a computer program for executing the distance-based photographing focus correction and image processing method as described above when the computer program is executed.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes computer programs for enabling a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other media capable of storing program codes.
It should be understood that the Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present application may be embodied directly in a hardware processor, or in a combination of the hardware and software modules in the processor.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.
Claims (9)
1. A distance-based photographing focus correction and image processing method is characterized by comprising the following steps:
acquiring shooting information of at least two first images, wherein the at least two first images are images shot by a terminal with at least two cameras at the same time, the focal length of each first image is the focal length after focusing correction according to the distance between each part of object and the camera in the process of pre-shooting, and the shooting information comprises the distance between each part of object in the first image and the corresponding camera;
determining obstacles and shot objects in each first image according to the distance between each part of object and the corresponding camera;
according to the distance between a shot object at the edge of an obstacle in one of the first images and the corresponding camera and the distances between the shot objects in the other first images and the corresponding cameras, splicing at least two first images to obtain a second image, wherein no obstacle exists in the second image;
the stitching processing is performed on the two first images according to the distance between the shot object at the edge of the obstacle in one of the first images and the corresponding camera and the distance between each part of the object in the other first images and the corresponding camera to obtain a second image, and the stitching processing includes:
acquiring a difference value between a distance between a shot object at the edge of an obstacle in one of the first images and the corresponding camera and a distance between the shot object in the other first images and the corresponding camera;
acquiring target parts in other first images corresponding to distances of which the distance difference is smaller than a preset difference;
and carrying out splicing processing according to the shot object at the edge of the obstacle in one of the first images and the target part in the other first images to obtain a second image.
2. The method according to claim 1, wherein the determining of the obstacle and the subject in each of the first images according to the distance between the object of each portion and the corresponding camera comprises:
determining target objects which are positioned on the same plane and have a distance with the cameras smaller than the distance between surrounding objects and the cameras according to the distance between each part of object and the corresponding camera;
and determining obstacles in the first image according to the target object, and taking the image between the obstacles in the first image as a shot object.
3. The method of claim 1, wherein after the stitching at least two of the first images to obtain a second image, the method further comprises:
and storing and controlling the terminal to display the second image.
4. The method according to claim 1, wherein before the obtaining of the shooting information of each of the two first images, the method further comprises:
controlling at least two cameras of the terminal to shoot a current scene according to a shooting instruction triggered by a user to obtain at least two first images;
processing each first image to obtain the distance between each part of object in the first image and the corresponding camera;
and generating and storing the shooting information according to the distance between each part of object in the first image and the corresponding camera.
5. The method according to claim 4, wherein before controlling at least two cameras of the terminal to capture the current scene according to the capturing instruction triggered by the user and obtaining the at least two first images, the method further comprises:
controlling at least two cameras of the terminal to pre-shoot a current scene according to a pre-shooting instruction triggered by a user to obtain at least two third images;
processing the image of each third image to obtain the distance between each part of object in the third image and the corresponding camera;
determining obstacles in the third image according to the distance between each part of object and the corresponding camera;
and controlling each camera of the terminal to focus on the shot object between the obstacles.
6. The method according to claim 4, wherein after controlling at least two cameras of the terminal to capture the current scene to obtain the at least two first images, the method further comprises:
and performing associated storage on at least two first images.
7. A distance-based photographing focus correction and image processing apparatus, comprising:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring respective shooting information of at least two first images, the at least two first images are images shot by a terminal with at least two cameras at the same time, the focal length of each first image is the focal length after focusing correction is carried out according to the distance between each part of object and the camera in the pre-shooting process, and the shooting information comprises the distance between each part of object in the first image and the corresponding camera;
the determining module is used for determining obstacles and shot objects in each first image according to the distance between each part of object and the corresponding camera;
the splicing module is used for splicing the two first images according to the distance between the shot object at the edge of the obstacle in one of the first images and the corresponding camera and the distance between the shot object in the other first images and the corresponding camera to obtain a second image, wherein the second image does not have the obstacle;
the splicing module is specifically configured to:
acquiring a difference value between a distance between a shot object at the edge of an obstacle in one of the first images and the corresponding camera and a distance between the shot object in the other first images and the corresponding camera;
acquiring target parts in other first images corresponding to distances of which the distance difference is smaller than a preset difference;
and carrying out splicing processing according to the shot object at the edge of the obstacle in one of the first images and the target part in the other first images to obtain a second image.
8. A distance-based photographing focus correction and image processing apparatus, comprising: a memory, a processor and a computer program stored in the memory, the processor running the computer program to perform the distance based photographing focus correction and image processing method as claimed in any one of claims 1 to 6 above.
9. A storage medium characterized in that it comprises a computer program which when executed is for performing the distance-based photographing focus correction and image processing method as claimed in any one of claims 1 to 6 above.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810596881.6A CN108924405B (en) | 2018-06-11 | 2018-06-11 | Photographing focus correction and image processing method and device based on distance |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810596881.6A CN108924405B (en) | 2018-06-11 | 2018-06-11 | Photographing focus correction and image processing method and device based on distance |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108924405A CN108924405A (en) | 2018-11-30 |
CN108924405B true CN108924405B (en) | 2020-01-21 |
Family
ID=64409791
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810596881.6A Expired - Fee Related CN108924405B (en) | 2018-06-11 | 2018-06-11 | Photographing focus correction and image processing method and device based on distance |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108924405B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109361874B (en) * | 2018-12-19 | 2021-05-14 | 维沃移动通信有限公司 | Photographing method and terminal |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2003063402A (en) * | 2001-08-27 | 2003-03-05 | Hitachi Ltd | Safety monitor device for platform in station |
JP2005095028A (en) * | 2003-09-24 | 2005-04-14 | Bab-Hitachi Machinery Co Ltd | Trapping fence |
CN103260009A (en) * | 2012-02-15 | 2013-08-21 | 株式会社日立制作所 | Image monitoring apparatus, monitoring system, and monitoring system configuration method |
CN104580882A (en) * | 2014-11-03 | 2015-04-29 | 宇龙计算机通信科技(深圳)有限公司 | Photographing method and device |
CN105516578A (en) * | 2014-09-25 | 2016-04-20 | 联想(北京)有限公司 | Image processing method and device and electronic equipment |
CN107437268A (en) * | 2017-07-31 | 2017-12-05 | 广东欧珀移动通信有限公司 | Photographic method, device, mobile terminal and computer-readable storage medium |
CN108093174A (en) * | 2017-12-15 | 2018-05-29 | 北京臻迪科技股份有限公司 | Patterning process, device and the photographing device of photographing device |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7348989B2 (en) * | 2003-03-07 | 2008-03-25 | Arch Vision, Inc. | Preparing digital images for display utilizing view-dependent texturing |
US20040183918A1 (en) * | 2003-03-20 | 2004-09-23 | Eastman Kodak Company | Producing enhanced photographic products from images captured at known picture sites |
GB2512621A (en) * | 2013-04-04 | 2014-10-08 | Sony Corp | A method and apparatus |
CN104965202B (en) * | 2015-06-18 | 2017-10-27 | 奇瑞汽车股份有限公司 | Obstacle detection method and device |
CN105678787A (en) * | 2016-02-03 | 2016-06-15 | 西南交通大学 | Heavy-duty lorry driving barrier detection and tracking method based on binocular fisheye camera |
-
2018
- 2018-06-11 CN CN201810596881.6A patent/CN108924405B/en not_active Expired - Fee Related
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2003063402A (en) * | 2001-08-27 | 2003-03-05 | Hitachi Ltd | Safety monitor device for platform in station |
JP2005095028A (en) * | 2003-09-24 | 2005-04-14 | Bab-Hitachi Machinery Co Ltd | Trapping fence |
CN103260009A (en) * | 2012-02-15 | 2013-08-21 | 株式会社日立制作所 | Image monitoring apparatus, monitoring system, and monitoring system configuration method |
CN105516578A (en) * | 2014-09-25 | 2016-04-20 | 联想(北京)有限公司 | Image processing method and device and electronic equipment |
CN104580882A (en) * | 2014-11-03 | 2015-04-29 | 宇龙计算机通信科技(深圳)有限公司 | Photographing method and device |
CN107437268A (en) * | 2017-07-31 | 2017-12-05 | 广东欧珀移动通信有限公司 | Photographic method, device, mobile terminal and computer-readable storage medium |
CN108093174A (en) * | 2017-12-15 | 2018-05-29 | 北京臻迪科技股份有限公司 | Patterning process, device and the photographing device of photographing device |
Also Published As
Publication number | Publication date |
---|---|
CN108924405A (en) | 2018-11-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6522708B2 (en) | Preview image display method and apparatus, and terminal | |
JP6388673B2 (en) | Mobile terminal and imaging method thereof | |
CN111726521B (en) | Photographing method and photographing device of terminal and terminal | |
EP3062513B1 (en) | Video apparatus and photography method thereof | |
CN108632536B (en) | Camera control method and device, terminal and storage medium | |
CN113973190A (en) | Video virtual background image processing method and device and computer equipment | |
US10297285B2 (en) | Video data processing method and electronic apparatus | |
CN109688321B (en) | Electronic equipment, image display method thereof and device with storage function | |
JP2019533957A (en) | Photography method for terminal and terminal | |
CN104486544B (en) | The image pickup method and device of a kind of distant view photograph | |
CN108924405B (en) | Photographing focus correction and image processing method and device based on distance | |
CN105467741B (en) | A kind of panorama photographic method and terminal | |
US11190670B2 (en) | Method and a system for processing images based a tracked subject | |
JP6483661B2 (en) | Imaging control apparatus, imaging control method, and program | |
CN111279352B (en) | Three-dimensional information acquisition system through pitching exercise and camera parameter calculation method | |
CN114143429B (en) | Image shooting method, device, electronic equipment and computer readable storage medium | |
CN112887606B (en) | Shooting method and device and electronic equipment | |
CN111654620B (en) | Shooting method and device | |
JP2013085239A (en) | Imaging apparatus | |
CN109582811B (en) | Image processing method, image processing device, electronic equipment and computer readable storage medium | |
KR101567668B1 (en) | Smartphones camera apparatus for generating video signal by multi-focus and method thereof | |
CN111586281B (en) | Scene processing method and device | |
KR102368825B1 (en) | Method and apparatus for outputting video having additional object | |
JP2013153321A (en) | Imaging apparatus, imaging method, and program | |
CN107948522B (en) | Method, device, terminal and storage medium for selecting shot person head portrait by camera |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20200121 Termination date: 20200611 |
|
CF01 | Termination of patent right due to non-payment of annual fee |