CN112738397A - Shooting method, shooting device, electronic equipment and readable storage medium - Google Patents

Shooting method, shooting device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN112738397A
CN112738397A CN202011591554.5A CN202011591554A CN112738397A CN 112738397 A CN112738397 A CN 112738397A CN 202011591554 A CN202011591554 A CN 202011591554A CN 112738397 A CN112738397 A CN 112738397A
Authority
CN
China
Prior art keywords
area
camera
target
ratio
shooting
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.)
Pending
Application number
CN202011591554.5A
Other languages
Chinese (zh)
Inventor
李玺
曾柏泉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Hangzhou Co Ltd
Original Assignee
Vivo Mobile Communication Hangzhou Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Hangzhou Co Ltd filed Critical Vivo Mobile Communication Hangzhou Co Ltd
Priority to CN202011591554.5A priority Critical patent/CN112738397A/en
Publication of CN112738397A publication Critical patent/CN112738397A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/69Control of means for changing angle of the field of view, e.g. optical zoom objectives or electronic zooming
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/61Control of cameras or camera modules based on recognised objects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders

Abstract

The application discloses a shooting method, a shooting device, electronic equipment and a readable storage medium, and belongs to the field of photography. The method comprises the following steps: acquiring a first area of an initial region of interest (ROI) in a shooting preview interface and an initial zooming magnification of the shooting preview interface; acquiring a second area of a real-time ROI of a shooting preview interface under the condition that the relative position of a target moving object relative to a target camera is changed; adjusting the real-time zooming magnification of the shooting preview interface according to the ratio of the first area to the second area and the initial zooming magnification so as to enable the first proportion to be the same as the second proportion; the first proportion is the proportion of the target moving object in the shooting preview interface after the relative position changes, and the second proportion is the proportion of the target moving object in the shooting preview interface before the relative position changes. By the method and the device, the problem that in the prior art, if the size of a moving object in a shooting picture is to be kept constant, a user needs to manually switch the magnification is solved.

Description

Shooting method, shooting device, electronic equipment and readable storage medium
Technical Field
The application belongs to the field of camera shooting, and particularly relates to a shooting method, a shooting device, electronic equipment and a readable storage medium.
Background
At present, when a user shoots a moving object, shooting is generally carried out by the same camera. Therefore, the user needs to continuously adjust the zoom ratio of the display image, and manually increase the zoom ratio of the image according to the distance between the object and the mobile phone, so as to achieve the purpose that the object is clearly visible in the display image, and maintain the size of the moving object in the shooting image to be constant. However, the manual operation of switching the magnification is complicated.
Disclosure of Invention
An object of the embodiments of the present application is to provide a shooting method, an apparatus, an electronic device, and a readable storage medium, which can solve the problem in the prior art that if the size of a moving object in a shooting picture is to be maintained constant, a user needs to manually switch the magnification.
In order to solve the technical problem, the present application is implemented as follows:
in a first aspect, an embodiment of the present application provides a shooting method, including: acquiring a first area of an initial region of interest (ROI) in a shooting preview interface and an initial zooming magnification of the shooting preview interface, wherein the ROI comprises a target moving object; under the condition that the relative position of the target moving object relative to a target camera is changed, acquiring a second area of a real-time ROI of the shooting preview interface, wherein the real-time ROI comprises the target moving object; adjusting the real-time zooming magnification of the shooting preview interface according to the ratio of the first area to the second area and the initial zooming magnification so as to enable the first proportion to be the same as the second proportion; wherein the first proportion is the proportion of the target moving object in the shooting preview interface after the relative position is changed, and the second proportion is the proportion of the target moving object in the shooting preview interface before the relative position is changed; the target camera is a camera which collects the preview picture of the target moving object at present.
In a second aspect, an embodiment of the present application provides a shooting apparatus, including: the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a first area of an initial region of interest (ROI) in a shooting preview interface and an initial zooming magnification of the shooting preview interface, and the ROI comprises a target moving object; the second acquisition module is used for acquiring a second area of a real-time ROI of the shooting preview interface under the condition that the relative position of the target moving object relative to the target camera is changed, wherein the real-time ROI comprises the target moving object; the adjusting module is used for adjusting the real-time zooming magnification of the shooting preview interface according to the ratio of the first area to the second area and the initial zooming magnification so as to enable the first proportion to be the same as the second proportion; wherein the first proportion is the proportion of the target moving object in the shooting preview interface after the relative position is changed, and the second proportion is the proportion of the target moving object in the shooting preview interface before the relative position is changed; the target camera is a camera which collects the preview picture of the target moving object at present.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instructions stored on the memory and executable on the processor, and when executed by the processor, the program or instructions implement the steps of the method according to the first aspect.
In a fourth aspect, embodiments of the present application provide a readable storage medium, on which a program or instructions are stored, which when executed by a processor implement the steps of the method according to the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to execute a program or instructions to implement the method according to the first aspect.
In the embodiment of the application, the zoom ratio of the real-time shooting preview interface is adjusted according to the ratio of the first area of the initial ROI of the target moving object before moving to the second area of the real-time ROI after moving and the initial zoom ratio before moving, so that the proportional movement of the moving object in the shooting preview interface is the same before and after moving, namely the size of the target moving object before and after moving in the shooting preview interface is constant.
Drawings
FIG. 1 is a flow chart of a shooting method according to an embodiment of the present application;
FIG. 2 is a display diagram of a shooting preview interface according to an embodiment of the present application;
FIG. 3 is a schematic diagram illustrating relative movement of a target moving object further away from a terminal according to an embodiment of the present application;
FIG. 4 is a schematic diagram illustrating relative movement of a target moving object approaching a terminal according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a photographing apparatus according to an embodiment of the present application;
FIG. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 7 is a second schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. 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 application.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
The shooting method provided by the embodiment of the present application is described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
The embodiment of the application provides a shooting method, as shown in fig. 1, the method includes the steps of:
step 102, acquiring a first area of an initial Region of Interest (ROI) in a shooting preview interface and an initial zooming magnification of the shooting preview interface, wherein the ROI comprises a target moving object;
in machine vision and image processing, a region to be processed is defined as a box, a circle, an ellipse, an irregular polygon, or the like from an image to be processed, and is referred to as an ROI. In the application, the area may be a frame, a circle, an ellipse, or an irregular polygon outlined by the user through touch operation on the terminal preview interface, or the ROI including the target moving object may be automatically determined by the terminal after the user determines the target moving object at the terminal.
In addition, in a specific application scenario, a zoom magnification, for example, 1X, 2X; wherein, 1X indicates that the current shooting preview interface is not enlarged or reduced, that is, the size of the actual picture, and 2X is enlarged by one time relative to 1X.
104, acquiring a second area of the real-time ROI of the shooting preview interface after the relative position of the target moving object relative to the target camera is changed;
step 106, adjusting the zoom ratio of the real-time shooting preview interface according to the ratio of the first area to the second area and the initial zoom ratio so as to enable the first ratio to be consistent with the second ratio;
the first proportion is the proportion of the target moving object in the shooting preview interface after the relative position changes, and the second proportion is the proportion of the moving object in the shooting preview interface before the relative position changes; the target camera is a camera for currently acquiring a preview picture of a target moving object.
Through steps 102 to 106 of the embodiment of the present application, the zoom ratio of the real-time shooting preview interface is adjusted according to the ratio of the first area of the initial ROI of the target moving object before moving to the second area of the real-time ROI after moving, and the initial zoom ratio before moving, so that the proportional movement of the moving object in the shooting preview interface is the same before and after moving, that is, the size of the target moving object before and after moving in the shooting preview interface is constant, thus, in the present application, the zoom ratio of the real-time shooting preview interface can be automatically adjusted according to the ratio of the first area of the initial ROI to the second area of the real-time ROI after moving, the adjustment process does not need to be manually performed by a user, the tedious operation of manually adjusting the zoom ratio of the preview interface is avoided, and therefore, the problem that in the prior art, if the size of the moving object in the shooting image is to be kept constant is solved, the user is required to manually switch the multiplying power.
In an optional implementation manner of the embodiment of the present application, the manner of acquiring the initial region of interest ROI in the terminal shooting preview interface, which is referred to in step 102 in the embodiment of the present application, may be manually determined by a human, for example, a regular or irregular region is determined in the shooting preview interface by taking the target moving object as a center through a touch operation; specifically, if the user wants the background of the target moving object to be richer, the ROI area may be appropriately increased, and if only the ROI of the target moving object is acquired without wanting more background pictures, the moving object may be included only in the ROI area as much as possible through the touch operation. Furthermore, the initial ROI area may be a predefined area, i.e. a regular area centered on the moving object, such as a circle or rectangle, is automatically determined. In addition, when the target moving object in the initial ROI and the target moving object in the real-time ROI are the same object, and for example, when the player a in a certain basketball game is shot, the target moving object in the ROI in the terminal preview screen is the player a before and after the switching camera, that is, the target moving object in the initial ROI is the player a, and when the relative position of the target moving object to the target camera changes, the target moving object in the real-time ROI is still the player a.
In an optional implementation manner of the embodiment of the present application, the initial ROI is an image region including a target moving object in a preview image captured by the first camera, and therefore, for a manner that the zoom ratio of the live-view preview interface is adjusted according to the ratio of the first area to the second area and the initial zoom ratio in the above step 106 so that the first ratio is consistent with the second ratio, the method further may include:
step 1061, calculating a ratio of the first area to the second area to obtain a first ratio;
step 1062, calculating a second ratio of the initial zoom ratio to the first ratio to obtain a real-time zoom ratio;
step 1063, adjusting the focal length of the first camera according to the real-time zoom ratio;
and step 1064, adjusting the real-time zooming magnification of the shooting preview interface according to the adjusted focal length, so that the first proportion is the same as the second proportion.
As can be seen from the above steps 1061 and 1064, the real-time zoom ratio can be determined according to the ratio of the first area of the initial ROI to the second area of the real-time ROI. The purpose of determining the real-time zooming magnification is to adjust the focal length so as to switch to a proper focal length to shoot the target moving object, the focal length adjusting mode can be to switch different cameras to adjust the focal length, or to perform and adjust different focal lengths of the same camera, and the zooming magnification of the real-time preview interface is adjusted through the adjustment of the focal length so as to maintain the relatively constant of the target moving object on the shooting preview interface.
If the camera of the terminal in the embodiment of the present application has only one first camera, after adjusting the real-time zoom magnification of the shooting preview interface according to the ratio of the first area to the second area and the initial zoom magnification, the method in the embodiment of the present application further includes:
and 108, recording a first target video and outputting the first target video through the first camera after the focal length is adjusted under the condition that the variation value of the relative position of the target moving object and the target camera in a preset time period is smaller than a preset threshold value, or shooting a first target image and outputting the first target image.
Therefore, the shooting method provided by the embodiment of the application is applied to a scene that the terminal only has one camera, and under the condition that the preset condition is met, the zoom ratio of the current shooting preview interface can be adjusted in real time, the first camera with the focus adjusted can be used for recording or shooting, and a user does not need to judge whether the recording or shooting can be carried out.
If the terminal in the embodiment of the present application has multiple cameras, in an optional implementation manner of the embodiment of the present application, after adjusting the real-time zoom magnification of the shooting preview interface according to the ratio of the first area to the second area and the initial zoom magnification involved in step 106, the method in the embodiment of the present application may further include:
and 110, recording a second target video through the second camera under the condition that the change value of the relative position of the target moving object and the target camera in a preset time period is smaller than a preset threshold value, outputting the second target video or shooting a second target image, and outputting the second target image.
Therefore, the shooting method provided by the embodiment of the application is applied to a scene that a terminal has a plurality of cameras, and under the condition that the preset condition is met, the zoom ratio of the current shooting preview interface can be adjusted in real time, the switched cameras can be adjusted to record or shoot, and a user does not need to judge whether to switch the cameras or not and whether to record or shoot after switching.
It should be noted that, in a specific application scenario, switching of the camera may be performed based on the following factors: 1) under the condition of the same zoom magnification, the definition of the wide-angle lens is different from that of the telephoto lens, for example, the picture displayed by the telephoto lens under 2X is clearer. 2) The brightness and the sensitivity of different sensors are different, and the quality of an image is influenced. 3) The distance is different between different cameras, when the lens is close to the object, the lens with large focal length is difficult to focus, and the lens with small focal length can focus. Thus, the camera to be finally used can be determined based on the above-described factors. For example, as shown in fig. 2, when the target moving object moves into the 2x camera screen, the camera corresponding to 2x is switched to shoot, and when the target moving object moves out of the 2x screen, the camera corresponding to 1x can be switched back again to shoot.
The following explains a scene in which the photographing method of the embodiment of the present application is applied to a terminal with a plurality of cameras as an example, as shown in fig. 3, the terminal photographs a moving object a along the direction of C-C', if the target moving object a moves more and more away from the terminal, after the target moving object A moves from the point a to the point b and stops at a certain moment, the ratio of the first area of the initial ROI to the second area of the real-time ROI is 5, i.e. the ROI is reduced by a factor of 5 after the motion of the target moving object a, and, likewise, the real-time zoom magnification should be increased by a factor of 5, if the initial zoom magnification is 0.5X, the current actual zoom magnification is 2.5X, and the camera is switched to the camera corresponding to 2.5X to shoot the image, so that the size of the target moving object a in the photographing preview interface (e.g., enlarged view B of the photographing preview interface in fig. 3) is kept relatively constant. In addition, as shown in fig. 4, the terminal photographs the moving object a along the direction C-C', if the target moving object a moves closer to the terminal, after the target moving object moves from the point a to the point B at a certain time and stops, the ratio of the first area of the initial ROI to the second area of the real-time ROI is 0.5, that is, the ROI is reduced by 0.5 times after the target moving object a, similarly, the real-time zoom magnification should be reduced by 0.5 times, and if the initial zoom magnification is 2X, the current actual zoom magnification is 1X, the camera is switched to the camera corresponding to 2.5X to photograph the target moving object a by switching the camera, so that the size of the target moving object a in the photographing preview interface (such as the enlarged view B of the photographing preview interface in fig. 4) is kept relatively constant. That is to say, under the condition that the target moving object is farther and farther from the terminal, the zoom ratio of the real-time shooting preview interface is correspondingly adjusted to be larger so as to maintain the size of the moving object in the shooting preview interface to be constant, and if the moving object is closer and closer to the terminal, the zoom ratio of the real-time shooting preview interface is correspondingly adjusted to be smaller so as to maintain the size of the moving object in the shooting preview interface to be constant, and the user does not need to manually adjust the zoom ratio.
As for the step 110, in the scenario where the terminal has multiple cameras and shoots a basketball scene, the user a needs to record the playing process of the player B (target moving object) in the game, the user a tracks and shoots the player B through the cameras of the terminal, in a certain attack round, the player B is an attacking party, in a half-field attack process, the motion amplitude is relatively small, i.e., one attack is completed within a certain range within 6s, the change of the position of the player B relative to the cameras within the first 2s is less than 1m, so that after 2s, the terminal of the user a determines that the shooting process of the player B within the next time can be recorded, i.e., within the next 4s, the terminal of the player a records the whole attack process of the player B with the adjusted focal length by switching the cameras, 4s of video data are recorded; alternatively, the terminal of user a determines that the shooting of the image can be made for the attack process of player B in the next time. Therefore, by the embodiment of the application, the target moving object of the shooting preview interface can be automatically recorded or shot after the zoom ratio of the real-time shooting preview interface is adjusted, and a user does not need to judge when the video can be recorded or the image can be shot.
In this embodiment of the present application, the terminal has a plurality of cameras, the shooting preview interface includes a first preview image acquired by the first camera, and when the first preview image includes the initial ROI, the acquiring the second area of the real-time ROI of the shooting preview interface, which is involved in step 102 of the embodiment of the present application, includes:
step 1021, updating the content displayed in the shooting preview interface into a second preview image acquired by a second camera; wherein the second preview image includes the real-time ROI;
step 1022, obtain a first area of the real-time ROI in the second preview image.
Therefore, when the shooting method of the embodiment of the application is applied to a scene with a plurality of cameras at a terminal, the current preview interface needs to be updated while the cameras are switched, that is, the current shooting preview interface is switched to the second preview interface of the second camera, and the first area of the real-time ROI in the second preview interface of the second camera is obtained, that is, the zoom ratio of the preview interface is automatically adjusted.
Based on the switching of the camera, after acquiring the first area of the initial region of interest ROI in the terminal shooting preview interface and the initial zoom magnification of the shooting preview interface, the method of the embodiment of the present application further includes:
step 112, controlling the first camera to start recording a third video or shooting a second image;
step 114, after adjusting the real-time zoom ratio of the shooting preview interface according to the ratio of the first area to the second area and the initial zoom ratio, controlling a second camera to start recording a fourth video or shooting a fourth image;
and step 116, outputting the third video or the shot second image recorded by the first camera, and outputting the fourth video or the shot fourth image recorded by the second camera.
Through the above steps 112 to 116, the cameras before and after adjusting the focal length can be started to record videos or shoot images. For the steps 112 to 116, in the case that the shooting method of the embodiment of the present application is applied to a terminal having multiple cameras and shooting a basketball scene, the user a needs to record the playing process of the player B in the game, the user a tracks and shoots the player B through the cameras of the terminal, after the user a starts shooting by the cameras of the terminal, the initially started first camera records a video or shoots an image according to the current focal length, in a certain attack round after a period of time, the player B is an attack party, in the half-scene attack process, the amplitude of the movement is relatively small, that is, one attack is completed within a certain range within 6s, the position change of the player B relative to the camera within the first 2s is less than 1m, therefore, after 2s, the terminal of the user a determines that the attack process of the player B within the next time can be recorded, in the next 4s, the terminal of the user a records the whole attack process of the player B through the switched camera (second camera), and records 4s of video data; alternatively, the terminal of user a determines that the shooting of the image can be made for the attack process of player B in the next time. Therefore, through the implementation mode of the application, videos can be recorded or images can be shot through the two cameras before and after the focal length is adjusted, and finally the videos and/or images shot with two different focal lengths can be obtained, namely, a complete video in the whole recording process can be obtained, and the videos recorded after the zoom magnification is adjusted after the cameras are switched can also be obtained.
In an optional implementation manner of the embodiment of the present application, the method of the embodiment of the present application may further include:
step 11, before the relative position of the moving object relative to the target camera changes, acquiring a first distance value of the moving object relative to the target camera;
and step 12, acquiring a second distance value of the moving object relative to the target camera after the relative position of the moving object relative to the target camera is changed.
Step 13, calculating a third ratio of the first area to the second area before adjusting the real-time zooming magnification of the shooting preview interface according to the ratio of the first area to the second area and the initial zooming magnification;
step 14, calculating a fourth ratio of the first distance value to the second distance value;
step 15, calculating an average value of the third ratio and the fourth ratio;
and step 16, calculating a fifth ratio of the initial zoom ratio to the average value to obtain the real-time zoom ratio.
It should be noted that the above-mentioned distance value may be acquired by a laser ranging camera device provided in the terminal. In addition, since the ratio of the first area of the initial ROI to the second area of the real-time ROI may cause an error in the result due to the influence of the actual environment, through the above steps 11 to 16, the real-time zoom ratio of the shooting preview interface may be determined by the ratio of the distance value before and after the target moving object moves relative to the target camera and the average value of the ratio of the first area to the second area, which may reduce the error caused by the environment or the operation to a certain extent.
In an optional implementation manner of the embodiment of the present application, the method of the embodiment of the present application may further include:
and step 118, displaying prompt information on a shooting preview interface in the process of changing the relative position of the target moving object relative to the target camera, wherein the prompt information is used for prompting the moving direction of the moving object relative to the terminal.
That is to say, in the embodiment of the present application, since the target moving object moves relative to the target camera, the user needs to be prompted about the moving direction of the target moving object to prevent the target moving object from moving outside the shooting preview screen, so that the user can be timely prompted to adjust the orientation of the terminal through the prompt information, for example, to prompt to move leftward, prompt to move rightward, and so on, to ensure that the movement is always in the shooting preview interface.
The following exemplifies the present application with reference to specific embodiments of the present application;
embodiment 1, in which the zoom ratio of the real-time preview interface is adjusted only by the ratio of the first area of the initial ROI to the second area of the real-time ROI and the initial zoom ratio, so that the first ratio is consistent with the second ratio, the method for automatically focusing on and shooting the moving object includes:
step 201, after starting to click a video recording control, acquiring an initial ROI and an initial zoom ratio (zoom ratio) of a current shooting preview interface; wherein, the ROI comprises a target moving object;
step 202, saving the first area of the initial ROI, and determining the real-time scaling of the current shooting preview interface according to the proportion of the first area of the initial ROI to the second area of the returned real-time ROI under the condition that the target moving object continuously moves far;
that is, according to the ratio of the first area to the second area and the initial scaling factor, the real-time scaling ratio can be obtained; for example, if the initial zoom magnification is 0.6X, the target moving object is farther and farther from the terminal, and the zoom scale is 10 times at a certain time, i.e., the second area of the real-time ROI is reduced by 10 times with respect to the first area of the initial ROI, so it is required that the shooting preview interface, i.e., the real-time zoom magnification, should be 1.6X.
Step 203, switching the camera according to the obtained real-time zooming magnification;
and step 204, automatically adjusting the zooming ratio of the real-time display picture according to the obtained zooming ratio, so that the moving object keeps a relatively constant size.
In embodiment 2, based on the above embodiment 1, the embodiment further determines a real-time zoom ratio by combining a distance value between the moving object and the terminal, and the method for shooting the moving object by automatically focusing on and focusing includes:
step 301, after the user clicks the video recording control, the user can manually determine the area to be selected;
the user can select a fixed point by double clicking, and then the user realizes the stretching effect by clicking the point and moving to the lower right corner so as to determine the display frame of the self-selection stretching, namely the area needing to be selected.
Step 302, after the selected area is determined, starting a laser ranging camera;
step 303, acquiring a first area and an initial zoom magnification of a corresponding initial ROI according to a detection area selected by a user; at this time, it is also possible to select a video that retains both the original video and the auto zoom as needed.
And step 304, returning the first area and the continuously changed distance value of the real-time ROI of the current shooting preview interface in the process of continuously moving the target moving object.
Step 305, combining the initial ROI and the real-time ROI, and the initial distance value and the real-time distance value to determine a real-time zooming ratio;
because the real-time scaling factor is determined by combining the initial ROI and the real-time ROI as well as the initial distance value and the real-time distance value, errors caused by environment or other operations are avoided to a certain extent, namely the real-time scaling factor is relatively accurate.
Step 306, switching the cameras according to the real-time zooming magnification;
if the user selects to keep the original video before, the wide angle and the telephoto lens need to be kept open all the time, the shooting preview interface displays an automatic zooming picture, namely a tele-display picture, and the actual zooming ratio is uploaded at the same time, for example, the wide angle records based on the zooming ratio of 1X, and the telephoto records based on the zooming ratio of 2X or higher;
therefore, the zooming ratio of the real-time display picture is automatically adjusted according to the obtained real-time zooming ratio, so that the target moving object keeps a relatively constant size. In a specific application scene, if the wide angle is recorded based on a zoom magnification of 1X, and the tele is recorded based on a magnification of 2X or higher, one segment is a video recorded by the main shooting of 1X, and the other segment is a video recorded by the tele of 2X or above, so that a user obtains an original video and also obtains a video recorded by automatic zooming.
In this specific embodiment, when the target moving object starts to move to the left or right of the shooting preview interface, a corresponding prompt (for example, please move the mobile phone to the right) may be made on the shooting preview interface according to the movement trend to continue tracking the object, so as to avoid the object moving out of the range of the shooting preview interface.
In addition, when the automatic zooming function is not needed, the automatic zooming function is not needed when the screen is double-clicked again, at this time, the zooming magnification ratio can be manually controlled, and after the video recording control is clicked again, the recording is finished, and then the two recorded videos are returned.
It can be seen that, according to the specific embodiment 2, after a moving object is detected, the corresponding laser ranging camera is turned on, the returned distance information is combined with the size of the initial object in the display image, the zoom ratio is automatically switched, and the camera is switched according to the zoom ratio, so that the automatic zooming process is realized, the complexity of manual operation is avoided, and the original video and the zoomed video can be obtained.
In the shooting method provided by the embodiment of the present application, the execution subject may be a shooting device, or a control module in the shooting device for executing the shooting method. The embodiment of the present application takes an example in which a shooting device executes a shooting method, and the shooting device provided in the embodiment of the present application is described.
The present application provides a photographing apparatus, as shown in fig. 5, the apparatus including:
the first obtaining module 52 is configured to obtain a first area of an initial region of interest ROI in the shooting preview interface and an initial zoom ratio of the shooting preview interface, where the ROI includes a target moving object;
a second obtaining module 54, configured to obtain a second area of a real-time ROI of the shooting preview interface when a relative position of the target moving object with respect to the target camera changes, where the real-time ROI includes the target moving object;
the adjusting module 56 is configured to adjust a real-time zooming ratio of the shooting preview interface according to a ratio of the first area to the second area and the initial zooming ratio, so that the first ratio is the same as the second ratio;
the first proportion is the proportion of the target moving object in the shooting preview interface after the relative position changes, and the second proportion is the proportion of the target moving object in the shooting preview interface before the relative position changes; the target camera is a camera for currently acquiring a preview picture of a target moving object.
Through the device of the embodiment of the application, the zoom ratio of the real-time shooting preview interface is adjusted according to the ratio of the first area of the initial ROI of the target moving object before moving to the second area of the real-time ROI after moving and the initial zoom ratio before moving so that the moving object is identical before and after proportional movement in the shooting preview interface, namely the size of the target moving object before and after moving in the shooting preview interface is constant, thus the zoom ratio of the real-time shooting preview interface can be automatically adjusted through the ratio of the first area of the initial ROI to the second area of the real-time ROI after moving in the application, the adjustment process does not need to be manually adjusted by a user, the complicated operation of manually adjusting the zoom ratio of the preview interface is avoided, and the problem that in the prior art, if the size of the moving object in the shooting picture is kept constant is solved, the user is required to manually switch the multiplying power.
In an optional implementation manner of the embodiment of the present application, the manner of acquiring the initial region of interest ROI in the terminal shooting preview interface referred to in the embodiment of the present application may be manually determined by a human, for example, a regular or irregular region is determined in the shooting preview interface by using a target moving object as a center through a touch operation; specifically, if the user wants the background of the target moving object to be richer, the ROI area may be appropriately increased, and if only the ROI of the target moving object is acquired without wanting more background pictures, the moving object may be included only in the ROI area as much as possible through the touch operation. Furthermore, the initial ROI area may be a predefined area, i.e. a regular area centered on the moving object, such as a circle or rectangle, is automatically determined. In addition, when the target moving object in the initial ROI and the target moving object in the real-time ROI are the same object, and for example, when the player a in a certain basketball game is shot, the target moving object in the ROI in the terminal preview screen is the player a before and after the switching camera, that is, the target moving object in the initial ROI is the player a, and when the relative position of the target moving object to the target camera changes, the target moving object in the real-time ROI is still the player a.
In an optional implementation manner of the embodiment of the present application, the initial ROI is an image region including a target moving object in a preview image acquired by the first camera; the adjusting module 56 in the embodiment of the present application may further include: the first calculating unit is used for calculating the ratio of the first area to the second area to obtain a first ratio; the second calculating unit is used for calculating a second ratio of the initial zooming magnification to the first ratio to obtain a real-time zooming magnification; the first adjusting unit is used for adjusting the focal length of the first camera according to the real-time zooming magnification; and the second adjusting unit is used for adjusting the real-time zooming magnification of the shooting preview interface according to the adjusted focal length so as to enable the first proportion to be the same as the second proportion.
It can be seen that, in the embodiment of the present application, the real-time zoom ratio may be determined according to a ratio of a first area of the initial ROI to a second area of the real-time ROI. The purpose of determining the real-time zooming magnification is to adjust the focal length so as to switch to a proper focal length to shoot the target moving object, the focal length adjusting mode can be to switch different cameras to adjust the focal length, or to perform and adjust different focal lengths of the same camera, and the zooming magnification of the real-time preview interface is adjusted through the adjustment of the focal length so as to maintain the relatively constant of the target moving object on the shooting preview interface.
In an optional implementation manner of the embodiment of the present application, the apparatus of the embodiment of the present application may further include: and the first processing module is used for recording a first target video and outputting the first target video or shooting a first target image and outputting the first target image through the first camera after the focal length is adjusted under the condition that the change value of the relative position of the target moving object and the target camera in a preset time period is smaller than a preset threshold value after the real-time zooming ratio of the shooting preview interface is adjusted according to the ratio of the first area to the second area and the initial zooming ratio.
Therefore, the shooting method provided by the embodiment of the application is applied to a scene that the terminal only has one camera, and under the condition that the preset condition is met, the zoom ratio of the current shooting preview interface can be adjusted in real time, the first camera with the focus adjusted can be used for recording or shooting, and a user does not need to judge whether the recording or shooting can be carried out.
If the terminal in the embodiment of the present application has multiple cameras, in an optional implementation manner of the embodiment of the present application, the apparatus in the embodiment of the present application may further include: and the second processing module is used for recording a second target video through the second camera under the condition that the change value of the relative position of the target moving object and the target camera in a preset time period is smaller than a preset threshold value after the real-time zooming ratio of the shooting preview interface is adjusted according to the ratio of the first area to the second area and the initial zooming ratio, outputting the second target video or shooting a second target image, and outputting the second target image.
Therefore, the shooting method provided by the embodiment of the application is applied to a scene that a terminal has a plurality of cameras, and under the condition that the preset condition is met, the zoom ratio of the current shooting preview interface can be adjusted in real time, the switched cameras can be adjusted to record or shoot, and a user does not need to judge whether to switch the cameras or not and whether to record or shoot after switching.
It should be noted that, in a specific application scenario, switching of the camera may be performed based on the following factors: 1) under the condition of the same zoom magnification, the definition of the wide-angle lens is different from that of the telephoto lens, for example, the picture displayed by the telephoto lens under 2X is clearer. 2) The brightness and the sensitivity of different sensors are different, and the quality of an image is influenced. 3) The distance is different between different cameras, when the lens is close to the object, the lens with large focal length is difficult to focus, and the lens with small focal length can focus. Thus, the camera to be finally used can be determined based on the above-described factors. For example, as shown in fig. 2, when the target moving object moves into the 2x camera screen, the camera corresponding to 2x is switched to shoot, and when the target moving object moves out of the 2x screen, the camera corresponding to 1x can be switched back again to shoot.
As shown in fig. 3, if the target moving object moves farther and farther away from the terminal, after the target moving object moves from point a to point b and stops at a certain time, the ratio of the first area of the initial ROI to the second area of the real-time ROI is 5, that is, the ROI is reduced by 5 times after the target moving object moves, similarly, the real-time zoom magnification should be increased by 5 times, and if the initial zoom magnification is 0.5X, the current actual zoom magnification is 2.5X, and by switching the cameras, the camera corresponding to 2.5X is switched to shoot the target moving object, so that the size of the target moving object in the preview shooting interface is kept relatively constant. In addition, as shown in fig. 4, if the target moving object moves closer to the terminal, after the target moving object moves from the point a to the point b at a certain time and stops, the ratio of the first area of the initial ROI to the second area of the real-time ROI is 0.5, that is, the ROI is reduced by 0.5 times after the target moving object moves, similarly, the real-time zoom magnification should be reduced by 0.5 times, if the initial zoom magnification is 2X, the current actual zoom magnification is 1X, and by switching the cameras, the cameras corresponding to 2.5X are switched to shoot the target moving object, so that the size of the target moving object in the shooting preview interface is kept relatively constant. That is to say, under the condition that the target moving object is farther and farther from the terminal, the zoom ratio of the real-time shooting preview interface is correspondingly adjusted to be larger so as to maintain the size of the moving object in the shooting preview interface to be constant, and if the moving object is closer and closer to the terminal, the zoom ratio of the real-time shooting preview interface is correspondingly adjusted to be smaller so as to maintain the size of the moving object in the shooting preview interface to be constant, and the user does not need to manually adjust the zoom ratio.
In contrast, in the shooting method of the embodiment of the present application, which is applied to a terminal having multiple cameras and shooting a basketball scene, a user a needs to record a match process of a player B (target moving object) in the match, the user a tracks and shoots the player B through the cameras of the terminal, the player B is an attacking party in a certain attack round, the motion amplitude is relatively small in a half-field attack process, that is, an attack is completed within a certain range within 6s, the change in position of the player B relative to the cameras within the first 2s is less than 1m, so that after 2s, the terminal of the user a determines that the attack process of the player B in the next time can be recorded, that is, within the next 4s, the terminal of the user a records the entire attack process of the player B with the adjusted focal distance by switching the cameras, 4s of video data are recorded; alternatively, the terminal of user a determines that the shooting of the image can be made for the attack process of player B in the next time. Therefore, by the embodiment of the application, the target moving object of the shooting preview interface can be automatically recorded or shot after the zoom ratio of the real-time shooting preview interface is adjusted, and a user does not need to judge when the video can be recorded or the image can be shot.
In this embodiment of the present application, the terminal has a plurality of cameras, and the shooting preview interface includes a first preview image acquired by the first camera, and in a case that the first preview image includes the initial ROI, the second obtaining module 54 of this embodiment of the present application further may include: the updating unit is used for updating the content displayed in the shooting preview interface into a second preview image acquired by a second camera; wherein the second preview image includes a real-time ROI; and the acquisition unit is used for acquiring the first area of the real-time ROI in the second preview image.
Therefore, when the shooting method of the embodiment of the application is applied to a scene with a plurality of cameras at a terminal, the current preview interface needs to be updated while the cameras are switched, that is, the current shooting preview interface is switched to the second preview interface of the second camera, and the first area of the real-time ROI in the second preview interface of the second camera is obtained, that is, the zoom ratio of the preview interface is automatically adjusted.
Based on the switching of the cameras, the apparatus in the embodiment of the present application may further include:
the first control module is used for controlling the first camera to start recording a third video or shooting a second image after acquiring a first area of an initial region of interest (ROI) in a terminal shooting preview interface and an initial zoom ratio of the shooting preview interface;
the second control module is used for controlling the second camera to start recording a fourth video or shooting a fourth image after adjusting the real-time zooming ratio of the shooting preview interface according to the ratio of the first area to the second area and the initial zooming ratio;
and the output module is used for outputting the third video or the shot second image recorded by the first camera and outputting the fourth video or the shot fourth image recorded by the second camera.
Therefore, in the embodiment of the application, the cameras before and after the focal length is adjusted can be started to record videos or shoot images. In contrast, when the shooting method of the embodiment of the application is applied to a terminal which has a plurality of cameras and shoots a basketball scene, a user a needs to record the match process of a player B in the match, the user a tracks and shoots the player B through the camera of the terminal, after the user a starts shooting of the camera of the terminal, the initially started first camera records a video or shoots an image according to a current focal length, the player B is an attack party in a certain attack turn after a period of time, during a half-field attack process, the motion amplitude of the user a is relatively small, namely, the attack is completed within a certain range within 6s, the change of the position of the player B relative to the camera in the first 2s is less than 1m, therefore, after 2s, the terminal of the user a determines that the attack process of the player B within the next time can be recorded, in the next 4s, the terminal of the user a records the whole attack process of the player B through the switched camera (second camera), and records 4s of video data; alternatively, the terminal of user a determines that the shooting of the image can be made for the attack process of player B in the next time. Therefore, through the implementation mode of the application, videos can be recorded or images can be shot through the two cameras before and after the focal length is adjusted, and finally the videos and/or images shot with two different focal lengths can be obtained, namely, a complete video in the whole recording process can be obtained, and the videos recorded after the zoom magnification is adjusted after the cameras are switched can also be obtained.
The shooting device in the embodiment of the present application may be a device, or may be a component, an integrated circuit, or a chip in a terminal. The device can be mobile electronic equipment or non-mobile electronic equipment. By way of example, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and the non-mobile electronic device may be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine or a self-service machine, and the like, and the embodiments of the present application are not particularly limited.
The photographing apparatus in the embodiment of the present application may be an apparatus having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.
The shooting device provided in the embodiment of the present application can implement each process implemented in the method embodiment of fig. 1, and is not described here again to avoid repetition.
Optionally, as shown in fig. 6, an electronic device 600 is further provided in this embodiment of the present application, and includes a processor 601, a memory 602, and a program or an instruction stored in the memory 602 and executable on the processor 601, where the program or the instruction is executed by the processor 601 to implement each process of the foregoing shooting method embodiment, and can achieve the same technical effect, and no further description is provided here to avoid repetition.
It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic device and the non-mobile electronic device described above.
Fig. 7 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
The electronic device 700 includes, but is not limited to: a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709, and a processor 710.
Those skilled in the art will appreciate that the electronic device 700 may also include a power supply (e.g., a battery) for powering the various components, and the power supply may be logically coupled to the processor 710 via a power management system, such that the functions of managing charging, discharging, and power consumption may be performed via the power management system. The electronic device structure shown in fig. 7 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those in fig. 7, or combine some components, or arrange different components, and thus, the description thereof is omitted.
The processor 710 is configured to acquire a first area of an initial region of interest ROI in a shooting preview interface and an initial zoom ratio of the shooting preview interface, where the ROI includes a target moving object; under the condition that the relative position of the target moving object relative to the target camera is changed, acquiring a second area of a real-time ROI of a shooting preview interface, wherein the real-time ROI comprises the target moving object; adjusting the real-time zooming magnification of the shooting preview interface according to the ratio of the first area to the second area and the initial zooming magnification so as to enable the first proportion to be the same as the second proportion;
the first proportion is the proportion of the target moving object in the shooting preview interface after the relative position changes, and the second proportion is the proportion of the target moving object in the shooting preview interface before the relative position changes; the target camera is a camera for currently acquiring a preview picture of a target moving object.
Through the electronic equipment, the scaling factor of the real-time shooting preview interface is adjusted according to the ratio of the first area of the initial ROI of the target moving object before moving and the second area of the real-time ROI after moving and the initial scaling factor before moving so that the moving object is identical before and after proportional movement in the shooting preview interface, namely the size of the target moving object in the shooting preview interface before and after moving is constant, and therefore the electronic equipment is visible.
The processor 710 is configured to calculate a ratio of the first area to the second area to obtain a first ratio; calculating a second ratio of the initial scaling factor to the first ratio to obtain a real-time scaling factor; adjusting the focal length of the first camera according to the real-time zooming ratio; and adjusting the real-time zooming magnification of the shooting preview interface according to the adjusted focal length so as to enable the first proportion to be the same as the second proportion.
It can be seen that the real-time zoom factor can be determined according to a ratio of a first area of the initial ROI to a second area of the real-time ROI. The purpose of determining the real-time zooming magnification is to adjust the focal length so as to switch to a proper focal length to shoot the target moving object, the focal length adjusting mode can be to switch different cameras to adjust the focal length, or to perform and adjust different focal lengths of the same camera, and the zooming magnification of the real-time preview interface is adjusted through the adjustment of the focal length so as to maintain the relatively constant of the target moving object on the shooting preview interface.
The processor 710 is further configured to record a first target video and output the first target video by adjusting the first camera after the focal length and output the first target video, or shoot a first target image and output the first target image, under the condition that a variation value of a relative position of the target moving object and the target camera within a preset time period is smaller than a preset threshold.
The processor 710 is further configured to record a second target video through the second camera and output the second target video or capture a second target image and output a second target image when a variation value of a relative position of the target moving object and the target camera within a preset time period is smaller than a preset threshold.
Under the condition that the preset conditions are met, the zoom ratio of the current shooting preview interface can be adjusted in real time, recording or shooting can be performed through the first camera adjusting the focal length, and a user does not need to judge whether recording or shooting can be performed. In addition, because the focus of a camera has the limitation, then can be through a plurality of terminals of terminal overall arrangement, through the focus that switches different cameras so that the shooting effect is better.
The processor 710 is further configured to update the content displayed in the shooting preview interface to a second preview image acquired by a second camera; wherein the second preview image includes a real-time ROI; a first area of the real-time ROI in the second preview image is acquired.
Therefore, if a plurality of cameras exist, the current preview interface needs to be updated while the cameras are switched, that is, the current shooting preview interface is switched to the second preview interface of the second camera, and the first area of the real-time ROI in the second preview interface of the second camera is acquired.
The processor 710 is further configured to control the first camera to start recording a third video or shooting a second image; after the real-time zooming magnification of the shooting preview interface is adjusted according to the ratio of the first area to the second area and the initial zooming magnification, the method further comprises the following steps: controlling a second camera to start recording a fourth video or shooting a fourth image; and outputting a third video or a shot second image recorded by the first camera, and outputting a fourth video or a shot fourth image recorded by the second camera.
That is to say, can record the video or the shooting of image through two cameras before and after the focus of adjustment, can obtain the video and/or the image that two kinds of different focuses were shot at last, promote terminal shooting function, improve user's shooting experience.
The processor 710 is further configured to obtain a first distance value of the target moving object relative to the target camera before the relative position of the target moving object relative to the target camera changes; after the relative position of the target moving object relative to the target camera is changed, acquiring a second distance value of the target moving object relative to the target camera; calculating a third ratio of the first area to the second area before adjusting the real-time zooming magnification of the shooting preview interface according to the ratio of the first area to the second area and the initial zooming magnification; calculating a fourth ratio of the first distance value to the second distance value; calculating the average value of the third ratio and the fourth ratio; and calculating a fifth ratio of the initial zooming magnification to the average value to obtain the real-time zooming magnification.
Therefore, the real-time zooming ratio of the shooting preview interface can be determined through the ratio of the distance values of the target moving object before and after moving relative to the target camera and the average value of the ratio of the first area to the second area, errors caused by environment or operation can be reduced to a certain extent, and therefore after the ratio of the distance values of the target moving object after changing relative positions relative to the target camera is combined, the real-time zooming ratio can be determined more accurately, the focusing focal length of the moving object can be adjusted more accurately, namely, the camera can be selected more accurately or adjusted.
It should be understood that, in the embodiment of the present application, the input Unit 704 may include a Graphics Processing Unit (GPU) 7041 and a microphone 7042, and the Graphics processor 7041 processes image data of a still picture or a video obtained by an image capturing device (e.g., a camera device) in a video capturing mode or an image capturing mode. The display unit 706 may include a display panel 7061, and the display panel 7061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 707 includes a touch panel 7071 and other input devices 7072. The touch panel 7071 is also referred to as a touch screen. The touch panel 7071 may include two parts of a touch detection device and a touch controller. Other input devices 7072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein. Memory 709 may be used to store software programs as well as various data, including but not limited to applications and operating systems. Processor 710 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 710.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the foregoing shooting method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and so on.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction to implement each process of the above shooting method embodiment, and can achieve the same technical effect, and the details are not repeated here to avoid repetition.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (15)

1. A photographing method, characterized by comprising:
acquiring a first area of an initial region of interest (ROI) in a shooting preview interface and an initial zooming magnification of the shooting preview interface, wherein the ROI comprises a target moving object;
under the condition that the relative position of the target moving object relative to a target camera is changed, acquiring a second area of a real-time ROI of the shooting preview interface, wherein the real-time ROI comprises the target moving object;
adjusting the real-time zooming magnification of the shooting preview interface according to the ratio of the first area to the second area and the initial zooming magnification so as to enable the first proportion to be the same as the second proportion;
wherein the first proportion is the proportion of the target moving object in the shooting preview interface after the relative position is changed, and the second proportion is the proportion of the target moving object in the shooting preview interface before the relative position is changed; the target camera is a camera which collects the preview picture of the target moving object at present.
2. The method of claim 1, wherein the initial ROI is an image region including a target moving object in a preview image acquired by a first camera;
the adjusting the real-time zooming magnification of the shooting preview interface according to the ratio of the first area to the second area and the initial zooming magnification to make the first ratio consistent with the second ratio comprises:
calculating the ratio of the first area to the second area to obtain a first ratio;
calculating a second ratio of the initial scaling factor to the first ratio to obtain the real-time scaling factor;
adjusting the focal length of the first camera according to the real-time zooming ratio;
and adjusting the real-time zooming magnification of the shooting preview interface according to the adjusted focal length so as to enable the first proportion to be the same as the second proportion.
3. The method of claim 2, wherein after adjusting the real-time zoom magnification of the preview interface according to the ratio of the first area to the second area and the initial zoom magnification, the method further comprises:
under the condition that the variation value of the relative position of the target moving object and the target camera in a preset time period is smaller than a preset threshold value, recording a first target video through the first camera after the focal length is adjusted, and outputting the first target video, or shooting a first target image and outputting the first target image.
4. The method of claim 3, wherein after adjusting the real-time zoom magnification of the preview interface according to the ratio of the first area to the second area and the initial zoom magnification, the method further comprises:
and under the condition that the change value of the relative position of the target moving object and the target camera in a preset time period is smaller than a preset threshold value, recording a second target video through a second camera, outputting the second target video or shooting a second target image, and outputting the second target image.
5. The method of claim 1, wherein the capture preview interface comprises a first preview image captured by a first camera; the first preview image includes the initial ROI;
the obtaining of the second area of the real-time ROI of the preview interface includes:
updating the content displayed in the shooting preview interface into a second preview image acquired by a second camera; wherein the second preview image includes the real-time ROI;
a first area of the real-time ROI in the second preview image is obtained.
6. The method according to claim 5, wherein after the obtaining of the first area of the initial region of interest ROI in the terminal shooting preview interface and the initial zoom magnification of the shooting preview interface, the method further comprises:
controlling the first camera to start recording a third video or shooting a second image;
after the real-time zooming magnification of the shooting preview interface is adjusted according to the ratio of the first area to the second area and the initial zooming magnification, the method further includes:
controlling a second camera to start recording a fourth video or shooting a fourth image;
and outputting the third video or the shot second image recorded by the first camera, and outputting the fourth video or the shot fourth image recorded by the second camera.
7. The method of claim 1, further comprising:
before the relative position of the target moving object relative to a target camera changes, acquiring a first distance value of the target moving object relative to the target camera;
after the relative position of the target moving object relative to the target camera is changed, acquiring a second distance value of the target moving object relative to the target camera;
before the adjusting the real-time zoom magnification of the shooting preview interface according to the ratio of the first area to the second area and the initial zoom magnification, the method further includes:
calculating a third ratio of the first area to the second area;
calculating a fourth ratio of the first distance value to the second distance value;
calculating an average of the third ratio and the fourth ratio;
and calculating a fifth ratio of the initial zooming magnification to the average value to obtain the real-time zooming magnification.
8. A camera, comprising:
the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a first area of an initial region of interest (ROI) in a shooting preview interface and an initial zooming magnification of the shooting preview interface, and the ROI comprises a target moving object;
the second acquisition module is used for acquiring a second area of a real-time ROI of the shooting preview interface under the condition that the relative position of the target moving object relative to the target camera is changed, wherein the real-time ROI comprises the target moving object;
the adjusting module is used for adjusting the real-time zooming magnification of the shooting preview interface according to the ratio of the first area to the second area and the initial zooming magnification so as to enable the first proportion to be the same as the second proportion;
wherein the first proportion is the proportion of the target moving object in the shooting preview interface after the relative position is changed, and the second proportion is the proportion of the target moving object in the shooting preview interface before the relative position is changed; the target camera is a camera which collects the preview picture of the target moving object at present.
9. The apparatus of claim 8, wherein the initial ROI is an image region including a target moving object in a preview image captured by the first camera; the adjustment module includes:
the first calculating unit is used for calculating the ratio of the first area to the second area to obtain a first ratio;
the second calculating unit is used for calculating a second ratio of the initial zooming magnification to the first ratio to obtain the real-time zooming magnification;
the first adjusting unit is used for adjusting the focal length of the first camera according to the real-time zooming magnification;
and the second adjusting unit is used for adjusting the real-time zooming magnification of the shooting preview interface according to the adjusted focal length so as to enable the first proportion to be the same as the second proportion.
10. The apparatus of claim 9, further comprising:
and the first processing module is used for recording a first target video and outputting the first target video or shooting a first target image and outputting the first target image through the first camera after the focal length is adjusted under the condition that the change value of the relative position of the target moving object and the target camera in a preset time period is smaller than a preset threshold value after the real-time zooming ratio of the shooting preview interface is adjusted according to the ratio of the first area to the second area and the initial zooming ratio.
11. The apparatus of claim 10, further comprising:
and the second processing module is used for recording a second target video through the second camera under the condition that the change value of the relative position of the target moving object and the target camera in a preset time period is smaller than a preset threshold value after the real-time zooming ratio of the shooting preview interface is adjusted according to the ratio of the first area to the second area and the initial zooming ratio, outputting the second target video or shooting a second target image, and outputting the second target image.
12. The apparatus of claim 8, wherein the capture preview interface comprises a first preview image captured by a first camera; the first preview image includes the initial ROI; the second acquisition module includes:
the updating unit is used for updating the content displayed in the shooting preview interface into a second preview image acquired by a second camera; wherein the second preview image includes the real-time ROI;
an obtaining unit, configured to obtain a first area of the real-time ROI in the second preview image.
13. The apparatus of claim 12, further comprising:
the first control module is used for controlling the first camera to start recording a third video or shooting a second image after acquiring a first area of an initial region of interest (ROI) in a terminal shooting preview interface and an initial zooming rate of the shooting preview interface;
the second control module is used for controlling the second camera to start recording a fourth video or shooting a fourth image after adjusting the real-time zooming ratio of the shooting preview interface according to the ratio of the first area to the second area and the initial zooming ratio;
and the output module is used for outputting the third video or the shot second image recorded by the first camera and outputting the fourth video or the shot fourth image recorded by the second camera.
14. An electronic device comprising a processor, a memory and a program or instructions stored on the memory and executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the photographing method according to any one of claims 1 to 7.
15. A readable storage medium, characterized in that the readable storage medium stores thereon a program or instructions which, when executed by a processor, implement the steps of the photographing method according to any one of claims 1 to 7.
CN202011591554.5A 2020-12-29 2020-12-29 Shooting method, shooting device, electronic equipment and readable storage medium Pending CN112738397A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011591554.5A CN112738397A (en) 2020-12-29 2020-12-29 Shooting method, shooting device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011591554.5A CN112738397A (en) 2020-12-29 2020-12-29 Shooting method, shooting device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN112738397A true CN112738397A (en) 2021-04-30

Family

ID=75607592

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011591554.5A Pending CN112738397A (en) 2020-12-29 2020-12-29 Shooting method, shooting device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN112738397A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112598571A (en) * 2019-11-27 2021-04-02 中兴通讯股份有限公司 Image scaling method, device, terminal and storage medium
CN113573157A (en) * 2021-07-23 2021-10-29 维沃移动通信(杭州)有限公司 Video recording method, video recording device, electronic equipment and readable storage medium
CN114025183A (en) * 2021-10-09 2022-02-08 浙江大华技术股份有限公司 Live broadcast method, device, equipment, system and storage medium
WO2024017175A1 (en) * 2022-07-22 2024-01-25 维沃移动通信有限公司 Photographing preview method and apparatus, and electronic device and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030123069A1 (en) * 2001-12-31 2003-07-03 Nokia Corporation Method and device for forming an image in an electronic device
CN104717427A (en) * 2015-03-06 2015-06-17 广东欧珀移动通信有限公司 Automatic zooming method and device and mobile terminal
CN106161941A (en) * 2016-07-29 2016-11-23 深圳众思科技有限公司 Dual camera chases after burnt method, device and terminal automatically
CN107277360A (en) * 2017-07-17 2017-10-20 惠州Tcl移动通信有限公司 A kind of dual camera switching carries out method, mobile terminal and the storage device of zoom
CN109005348A (en) * 2018-08-22 2018-12-14 Oppo广东移动通信有限公司 The control method of electronic device and electronic device
CN109361865A (en) * 2018-11-21 2019-02-19 维沃移动通信(杭州)有限公司 A kind of image pickup method and terminal
CN111225144A (en) * 2020-01-13 2020-06-02 上海摩象网络科技有限公司 Video shooting method and device, electronic equipment and computer storage medium
CN111316630A (en) * 2018-11-28 2020-06-19 深圳市大疆创新科技有限公司 Handheld holder and shooting control method thereof

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030123069A1 (en) * 2001-12-31 2003-07-03 Nokia Corporation Method and device for forming an image in an electronic device
CN104717427A (en) * 2015-03-06 2015-06-17 广东欧珀移动通信有限公司 Automatic zooming method and device and mobile terminal
CN106161941A (en) * 2016-07-29 2016-11-23 深圳众思科技有限公司 Dual camera chases after burnt method, device and terminal automatically
CN107277360A (en) * 2017-07-17 2017-10-20 惠州Tcl移动通信有限公司 A kind of dual camera switching carries out method, mobile terminal and the storage device of zoom
CN109005348A (en) * 2018-08-22 2018-12-14 Oppo广东移动通信有限公司 The control method of electronic device and electronic device
CN109361865A (en) * 2018-11-21 2019-02-19 维沃移动通信(杭州)有限公司 A kind of image pickup method and terminal
CN111316630A (en) * 2018-11-28 2020-06-19 深圳市大疆创新科技有限公司 Handheld holder and shooting control method thereof
CN111225144A (en) * 2020-01-13 2020-06-02 上海摩象网络科技有限公司 Video shooting method and device, electronic equipment and computer storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112598571A (en) * 2019-11-27 2021-04-02 中兴通讯股份有限公司 Image scaling method, device, terminal and storage medium
CN113573157A (en) * 2021-07-23 2021-10-29 维沃移动通信(杭州)有限公司 Video recording method, video recording device, electronic equipment and readable storage medium
CN113573157B (en) * 2021-07-23 2023-09-12 维沃移动通信(杭州)有限公司 Video recording method, video recording device, electronic apparatus, and readable storage medium
CN114025183A (en) * 2021-10-09 2022-02-08 浙江大华技术股份有限公司 Live broadcast method, device, equipment, system and storage medium
WO2024017175A1 (en) * 2022-07-22 2024-01-25 维沃移动通信有限公司 Photographing preview method and apparatus, and electronic device and storage medium

Similar Documents

Publication Publication Date Title
US9699389B2 (en) Image displaying apparatus and image displaying method
CN112738397A (en) Shooting method, shooting device, electronic equipment and readable storage medium
CN112714255B (en) Shooting method and device, electronic equipment and readable storage medium
CN112954199B (en) Video recording method and device
CN112637500B (en) Image processing method and device
CN112954214B (en) Shooting method, shooting device, electronic equipment and storage medium
WO2022089284A1 (en) Photographing processing method and apparatus, electronic device, and readable storage medium
CN112887617B (en) Shooting method and device and electronic equipment
CN112333382B (en) Shooting method and device and electronic equipment
CN112532808A (en) Image processing method and device and electronic equipment
CN112887609A (en) Shooting method, shooting device, electronic equipment and storage medium
CN114422692B (en) Video recording method and device and electronic equipment
CN113866782A (en) Image processing method and device and electronic equipment
CN113747067A (en) Photographing method and device, electronic equipment and storage medium
CN115379118B (en) Camera switching method and device, electronic equipment and readable storage medium
CN116188343A (en) Image fusion method and device, electronic equipment, chip and medium
CN112653841B (en) Shooting method and device and electronic equipment
CN115499589A (en) Shooting method, shooting device, electronic equipment and medium
CN113891018A (en) Shooting method and device and electronic equipment
CN114245018A (en) Image shooting method and device
CN112367464A (en) Image output method and device and electronic equipment
CN113873160B (en) Image processing method, device, electronic equipment and computer storage medium
CN112312024A (en) Photographing processing method and device and storage medium
CN114157810B (en) Shooting method, shooting device, electronic equipment and medium
WO2022001733A1 (en) Method and device for displaying photographing object, storage medium, and terminal

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
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20210430

WD01 Invention patent application deemed withdrawn after publication