Shooting method and device, equipment and storage medium

By acquiring detection information of the subject and dynamically adjusting zoom and cropping, the problem of the subject being off-center or inconsistent in size when shooting moving objects is solved, thereby improving image stability and visual appeal and increasing the success rate of capturing images.

CN121531233APending Publication Date: 2026-02-13VIVO MOBILE COMM HANGZHOU CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511853669.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-09
Publication Date
2026-02-13

AI Technical Summary

Technical Problem

When shooting moving objects, the subject is prone to deviating from the center of the frame or being inconsistent in size, resulting in poor image composition and affecting the stability and visual appeal of the image. Existing technologies are unable to effectively solve this problem.

Method used

By acquiring detection information of the subject, including its position, distance, proportion, and offset, the zoom ratio and crop coordinates are dynamically adjusted to ensure that the subject remains in the ideal position in different frames.

Benefits of technology

It improves the composition and stability of images, allowing users to capture images that meet their expectations at any time, thus increasing the success rate of image capture.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121531233A_ABST
    Figure CN121531233A_ABST
Patent Text Reader

Abstract

The invention discloses a shooting method and device, equipment and a storage medium. Belongs to the technical field of image shooting. The method comprises the following steps: acquiring cutting coordinate information corresponding to an ith frame of image and detection information of a shooting main body in an (i + 1) th frame of original image; the detection information of the shooting main body comprises at least one of position information, shooting distance, distance credibility, picture ratio, position offset, motion speed and motion complexity of the shooting main body, and i is a positive integer; determining the zoom ratio corresponding to the (i + 1) th frame of image according to the detection information of the shooting main body; based on the cutting coordinate information corresponding to the ith frame of image and the zoom ratio corresponding to the (i + 1) th frame of image, cutting the (i + 1) th frame of original image to obtain the (i + 1) th frame of image; wherein the position of the shooting main body in the ith frame of image corresponds to the position of the shooting main body in the (i + 1) th frame of image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of image capture technology, specifically relating to a capture method, apparatus, device, and storage medium. Background Technology

[0002] In the field of image capture, the demand for processing video sequence images is increasing, especially when shooting dynamic scenes. Ensuring that the moving subject remains in the ideal position in each frame and achieving a reasonable zoom effect is a key issue in improving image quality.

[0003] However, when shooting moving objects, the subject may gradually deviate from the center of the frame or show inconsistent size changes in different frames as the object moves, affecting the composition of the image and resulting in poor stability and visual appeal of the content displayed on electronic devices, making it difficult to capture satisfactory images. Summary of the Invention

[0004] The purpose of this application is to provide a shooting method, apparatus, device, and storage medium that can improve the composition effect of images, thereby increasing the success rate of snapshots.

[0005] In a first aspect, embodiments of this application provide a shooting method, the method comprising: Obtain the cropping coordinate information corresponding to the i-th frame image, and the detection information of the subject in the (i+1)-th frame original image; the detection information of the subject includes at least one of the following: the position information of the subject, the shooting distance, the distance confidence, the screen ratio, the position offset, the motion speed, and the motion complexity, where i is a positive integer; Based on the detection information of the subject being photographed, determine the zoom ratio corresponding to the (i+1)th frame image; Based on the cropping coordinate information corresponding to the i-th frame image and the zoom ratio corresponding to the i+1-th frame image, the original i+1-th frame image is cropped to obtain the i+1-th frame image. The position of the subject in the i-th frame corresponds to the position of the subject in the (i+1)-th frame.

[0006] Secondly, embodiments of this application provide a shooting device, the device comprising: The acquisition module is used to acquire the cropping coordinate information corresponding to the i-th frame image and the detection information of the subject in the (i+1)-th frame original image. The detection information of the subject includes at least one of the following: the position information of the subject, the shooting distance, the distance confidence, the screen ratio, the position offset, the motion speed, and the motion complexity, where i is a positive integer. The determination module is used to determine the zoom ratio corresponding to the (i+1)th frame image based on the detection information of the subject being photographed. The processing module is used to crop the original image of the (i+1)th frame based on the cropping coordinate information corresponding to the i-th frame image and the zoom ratio corresponding to the (i+1)th frame image to obtain the (i+1)th frame image. The position of the subject in the i-th frame corresponds to the position of the subject in the (i+1)-th frame.

[0007] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions implementing the steps of the method as described in the first aspect when executed by the processor.

[0008] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, and when the program or instructions are executed by a processor, they implement the steps of the method as described in the first aspect.

[0009] Fifthly, embodiments of this application provide a chip, which includes a processor and a communication interface. The communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the method as described in the first aspect.

[0010] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the method as described in the first aspect.

[0011] In this embodiment, the cropping coordinate information corresponding to the i-th frame image and the detection information of the subject in the (i+1)-th original image are obtained. The detection information of the subject includes at least one of the following: the position information of the subject, the shooting distance, the distance confidence level, the screen ratio, the position offset, the motion speed, and the motion complexity, where i is a positive integer. Based on the detection information of the subject, the zoom ratio corresponding to the (i+1)-th frame image is determined. Based on the cropping coordinate information corresponding to the i-th frame image and the zoom ratio corresponding to the (i+1)-th frame image, the (i+1)-th original image is cropped to obtain the (i+1)-th frame image. The position of the subject in the i-th frame image corresponds to the position of the subject in the (i+1)-th frame image.

[0012] In this way, the zoom and cropping of the image can be dynamically adjusted according to the actual situation of the subject, ensuring that the position of the subject in the i-th frame corresponds to the position of the subject in the i+1-th frame, and both are in the ideal position. As a result, when the electronic device displays the above multi-frame images, the stability and visual appeal of the images are guaranteed, improving the composition effect of the images. Users can capture images that meet their expectations at any time, increasing the success rate of capturing images. Attached Figure Description

[0013] Figure 1This is a flowchart illustrating the shooting method provided in some embodiments of this application; Figure 2 These are schematic diagrams illustrating image cropping in some embodiments of the shooting method provided in this application; Figure 3 This is a schematic diagram of the preview interface in the shooting method provided in some embodiments of this application; Figure 4 This is a schematic flowchart of a scenario embodiment of the shooting method provided in some embodiments of this application; Figure 5 These are schematic diagrams of the imaging device provided in some embodiments of this application; Figure 6 These are schematic diagrams of the structure of electronic devices provided in some embodiments of this application; Figure 7 These are schematic diagrams of the hardware structure of electronic devices provided in some embodiments of this application. Detailed Implementation

[0014] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0015] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0016] When shooting moving objects, as the object moves, the subject may gradually deviate from the center of the frame or show inconsistent size changes in different frames. Users often need to manually track the subject to display the desired image on the electronic device's preview interface in order to capture the ideal image.

[0017] In related technologies, different photographic devices have proposed different solutions to eliminate or reduce the handheld movement that users have to perform for tracking and shooting. One is the automatic framing function offered by smartphones, which uses software focus tracking and software cropping, but does not support digital zoom. Another is the automatic framing function of professional mirrorless cameras, which supports automatic framing based on Artificial Intelligence (AI). It can automatically crop the frame during shooting to keep the subject in a prominent position, and even when the camera is mounted on a tripod, this function can continuously adjust the framing frame to smoothly track the subject. Yet another type is the pan-tilt camera. This type of camera has horizontal rotation (Pan), vertical rotation (Tilt), and lens zoom functions, enabling omnidirectional coverage and detail capture of the monitored area.

[0018] However, the inventors discovered that current technology has the following drawbacks: The automatic composition scheme of mobile phone cameras can only achieve composition of people at a basic optical magnification of 1x, and cannot adapt to zoom. This means that even if the subject is caught, its size in the preview screen will vary due to the subject's constant movement. When automatic zoom is not possible, photographers must divert their attention to adjusting the zoom level to accommodate the subject's distance, easily missing crucial moments and resulting in a low success rate for capturing fast-moving subjects. Adding a handheld gimbal to the phone would be costly in terms of both cost and usage, limiting the feasibility of this solution. Furthermore, current image cropping is typically a center-cropping scheme, limited by the field of view (FOV). The focus information for moving subjects always uses the region of interest (ROI) at the center of the frame as the input source. When the subject moves away from the center, the focus position must first be moved to the center of the next frame before center ROI cropping can be performed, and then focus calculations can be executed, resulting in low focus accuracy.

[0019] Therefore, embodiments of this application provide a shooting method, apparatus, device, and storage medium to solve the above problems.

[0020] The shooting method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.

[0021] Figure 1 This is a schematic flowchart of the shooting method provided in an embodiment of this application. The shooting method may include: Step 101: Obtain the cropping coordinate information corresponding to the i-th frame image, and the detection information of the subject in the (i+1)-th frame original image; the detection information of the subject includes at least one of the following: the position information of the subject, the shooting distance, the distance confidence, the screen ratio, the position offset, the motion speed, and the motion complexity, where i is a positive integer; In step 101, the electronic device can display the processed i-th frame image, which can be a cropped image based on the original i-th frame image. The cropping coordinate information corresponding to the i-th frame image can be obtained. The detection information of the subject in the (i+1)-th original frame image can also be obtained. It can be understood that, taking the i-th frame image as the image currently displayed on the preview interface of the electronic device as an example, the (i+1)-th original frame image is the original image of the next frame image to be displayed on the preview interface of the electronic device before processing.

[0022] The detection information for the subject can include its position, shooting distance, distance reliability, frame share, position offset, motion speed, and motion complexity. Position information refers to the coordinates of the detection box containing the subject. Shooting distance refers to the distance between the subject and the electronic device used for shooting. Distance reliability is a quantitative assessment of the reliability or uncertainty of the calculated or measured shooting distance. Frame share refers to the proportion of the area occupied by the subject within the entire image. Position offset refers to the change in the subject's position between consecutive frames. Motion speed refers to the rate at which the subject's position changes within the image over time. Motion complexity is a measure of the irregularity, randomness, or predictability of the subject's motion pattern.

[0023] The detection information of the subject being photographed can be obtained based on target tracking algorithms, laser autofocus, binocular parallax, time of flight (TOF), AI estimation, etc., and no specific limitations are made here.

[0024] Step 102: Determine the zoom ratio corresponding to the (i+1)th frame image based on the detection information of the subject being photographed.

[0025] In step 102, the zoom ratio corresponding to the (i+1)th frame can be determined based on the detection information of the subject and a pre-defined mapping relationship between the detection information and the zoom ratio. Alternatively, the detection information of the subject can be input into a pre-trained model to obtain the zoom ratio corresponding to the (i+1)th frame output by the model.

[0026] This allows for automatic zoom, zooming the image of the i-th frame to a suitable optical + digital zoom level that ensures both sharpness and detail of the subject while including an adequate amount of background information.

[0027] Step 103: Based on the cropping coordinate information corresponding to the i-th frame image and the zoom ratio corresponding to the i+1-th frame image, crop the original i+1-th frame image to obtain the i+1-th frame image. The position of the subject in the i-th frame corresponds to the position of the subject in the (i+1)-th frame.

[0028] In step 103, the cropping coordinate information corresponding to the i-th frame image can be transformed based on the zoom ratio corresponding to the i+1-th frame image to obtain the cropping coordinate information corresponding to the i+1-th frame image. Based on the cropping coordinate information corresponding to the i+1-th frame image, the original i+1-th frame image is cropped to obtain the i+1-th frame image that is finally displayed on the preview interface of the electronic device.

[0029] The position of the subject in the i-th frame corresponds to its position in the (i+1)-th frame. This position may refer to the user's desired ideal position of the subject in the image. For ease of understanding of the technical solution provided in this application, the position of the subject in the (i+1)-th frame will be referred to as the target position.

[0030] Understandably, after the focus-tracking algorithm identifies and locks onto the subject, the command sent to the optical image sensor may not be a center crop, but rather a dynamic adjustment of the image sensor's cropping window position, such as... Figure 2 As shown, the area around the subject can be automatically cropped from the original image 201 with the subject as the cropping target. After the cropped area 202 is processed by the image signal processor (ISP), a preview image 203 is obtained and presented in the preview interface, so that the subject in the preview image 203 is always located at the target position, that is, the position of the subject in the i-th frame image or the i+1-th frame image.

[0031] In some embodiments, the position of the subject in the (i+1)th frame is the center point region of the image. In other words, as... Figure 3 As shown, the preview image 301 displayed on the preview interface 300 of the electronic device has a subject 302 that can always be displayed in the center of the screen.

[0032] In this way, the center area of ​​the image is usually the focal point of the viewer's vision. Placing the subject in this area can make the image more balanced and attractive, which conforms to the visual habits of most users and improves the overall aesthetics and viewing experience of the image.

[0033] In some examples, the target location can be set in other areas of the image, such as the upper left or lower right. The specific composition can be set based on actual needs, and no specific limitations are made here.

[0034] In some embodiments, after obtaining the (i+1)th frame image, the method may further include: Display the (i+1)th frame image in the preview interface; In response to the first input to the preview interface, the (i+1)th frame image is captured to obtain the captured image.

[0035] In this embodiment, for the preview image displayed on the preview interface, i.e., the (i+1)th frame image, the user can click to capture the image and save the satisfactory image to the electronic device's photo album. This results in a better composition of the preview image, allowing the user to capture images that meet their expectations at any time, thus improving the success rate of capturing images.

[0036] In this embodiment, the shooting method obtains the cropping coordinate information corresponding to the i-th frame image and the detection information of the subject in the (i+1)-th original image. The detection information of the subject includes at least one of the following: the position information of the subject, shooting distance, distance confidence, screen ratio, position offset, motion speed, and motion complexity, where i is a positive integer. Based on the detection information of the subject, the zoom ratio corresponding to the (i+1)-th frame image is determined. Based on the cropping coordinate information corresponding to the i-th frame image and the zoom ratio corresponding to the (i+1)-th frame image, the (i+1)-th original image is cropped to obtain the (i+1)-th frame image. The position of the subject in the i-th frame image corresponds to the position of the subject in the (i+1)-th frame image.

[0037] In this way, the zoom and cropping of the image can be dynamically adjusted according to the actual situation of the subject, ensuring that the position of the subject in the i-th frame corresponds to the position of the subject in the i+1-th frame, and both are in the ideal position. As a result, when the electronic device displays the above multi-frame images, the stability and visual appeal of the images are guaranteed, improving the composition effect of the images. Users can capture images that meet their expectations at any time, increasing the success rate of capturing images.

[0038] In some embodiments, the detection information of the subject being photographed includes the position information of the subject being photographed; Based on the cropping coordinate information corresponding to the i-th frame image and the zoom ratio corresponding to the (i+1)-th frame image, the original (i+1)-th frame image is cropped to obtain the (i+1)-th frame image, which may include: Based on the cropping coordinate information corresponding to the i-th frame image and the zoom ratio corresponding to the (i+1)-th frame image, determine the cropping coordinate transformation relationship between the (i+1)-th frame image and the i-th frame image. Based on the location information and the cropping coordinate transformation relationship, the cropping coordinate information corresponding to the (i+1)th frame image is determined; Based on the cropping coordinate information corresponding to the (i+1)th frame image, the original (i+1)th frame image is cropped to obtain the (i+1)th frame image.

[0039] In this embodiment, the crop coordinate transformation relationship between the (i+1)th frame image and the i-th frame image can be determined based on the crop coordinate information corresponding to the i-th frame image and the zoom ratio corresponding to the (i+1)th frame image. The crop coordinate transformation relationship can be as shown in formula (1):

[0040] Among them, when the detection box coordinates of the subject are initialized, f(i+1) This refers to the cropping coordinates corresponding to the (i+1)th frame of the image. f(i) This refers to the cropping coordinates corresponding to the i-th frame image. zoom ratio The zoom level corresponds to the (i+1)th frame of the image.

[0041] The cropping coordinates of the (i+1)th frame can be calculated based on the position information of the subject and the cropping coordinate transformation relationship. It's understandable that the position of the subject in the (i+1)th frame may change compared to the original image in the i-th frame; in other words, the detection box coordinates of the subject are different in the original image. Therefore, the detection box coordinates of the subject can be initialized so that cropping can be based on the position information of the subject in the (i+1)th frame.

[0042] The cropping coordinate information corresponding to the (i+1)th frame image can be calculated by combining the formula (1) of the cropping coordinate transformation relationship.

[0043] Taking the cropping coordinate matrix object_Matrix=[startX, startY, endX, endY] corresponding to the i-th frame image as an example, calculate the cropping coordinate matrix corresponding to the (i+1)-th frame image, map the coordinate matrix into cropping coordinate information that the image sensor can understand, send the cropping coordinate information to the image sensor, realize non-center ROI cropping based on the detection box of the subject being captured, and obtain the (i+1)-th frame image.

[0044] It is possible to Figure 2 Taking the pixel stacking diagram in the image as an example, the specific mapping relationship is shown in Table 1: Table 1

[0045] In this way, by determining the cropping coordinate transformation relationship between the (i+1)th frame image and the i-th frame image, and combining it with the position information of the subject being photographed, the cropping coordinate information corresponding to the (i+1)th frame image can be accurately determined, thereby cropping the original (i+1)th frame image more precisely, ensuring that the subject being photographed is accurately located in the target position in the (i+1)th frame image, and improving the accuracy of image processing.

[0046] In some embodiments, the detection information of the subject being photographed includes the shooting distance of the subject, distance confidence level, screen occupancy, and positional offset from the target location; Based on the detection information of the subject being photographed, the zoom ratio corresponding to the (i+1)th frame image is determined, which may include: Determine the first zoom level based on the shooting distance; The second zoom ratio is determined based on the screen occupancy and positional offset. Based on distance reliability, the first zoom ratio and the second zoom ratio are weighted and fused to obtain the zoom ratio corresponding to the (i+1)th frame image.

[0047] In this embodiment, the first zoom ratio can be determined based on the distance. The first zoom ratio represents the desired physical zoom, aiming to maximize the desired proportion of the subject in the frame.

[0048] The formula for the first zoom ratio can be derived. A simplified linear formula can be obtained through a single calibration. The derivation process is as follows: The formula for the expected proportion can be shown in formula (2):

[0049] in, p_target For the expected percentage, S For the size of the subject being photographed, D The distance to the subject being photographed. f Focal length Hs This represents the image height.

[0050] Transforming formula (2) yields formula (3):

[0051] Converting formula (3) to zoom ratio, the formula for the first zoom ratio can be shown in formula (4):

[0052] in, Z_d This can be the first zoom level. S_hat For estimating the size of the subject being photographed, c1 It was obtained from a single calibration.

[0053] c1The calibration can be performed by first selecting a reference distance D0, and then using... S_hat The category prior enables the composition to achieve p_ target Record the zoom ratio Z0 at this time, then c1 = Z0 • S_hat / (D0 • p_target) .

[0054] The second zoom ratio can be calculated using the image occupancy and positional offset. This second zoom ratio characterizes the image frame correction zoom, which typically aims to dynamically adjust the zoom ratio based on image information such as the relative size and center offset of the target within the detection frame, so that the target appears at a more suitable size and position in the image.

[0055] For example, if the relative proportion of the subject is less than the desired proportion, it means the subject is too small in the frame, and the zoom ratio needs to be increased; conversely, if the relative proportion of the subject is greater than the desired proportion, the zoom ratio needs to be decreased. Taking the target position as the center area of ​​the image as an example, if the subject's offset from the center is large, it means the subject is off-center from the frame, and the zoom needs to be adjusted appropriately to bring the subject back to the vicinity of the center. The zoom ratio can be fine-tuned according to the direction and magnitude of the offset.

[0056] The aspect ratio adjustment coefficient and offset adjustment coefficient can be preset. Based on the difference between the aspect ratio and the desired aspect ratio, the aspect ratio adjustment amount is calculated. The offset adjustment amount is calculated based on the position offset. Finally, based on the aspect ratio adjustment coefficient and the offset adjustment coefficient, the aspect ratio adjustment amount and the offset adjustment amount are combined to calculate the second zoom ratio.

[0057] The first zoom level and the second zoom level can be weighted and fused based on distance confidence to obtain the zoom level corresponding to the (i+1)th frame image. For example, the weight values ​​corresponding to the first zoom level and the second zoom level can be determined according to distance confidence, and adaptive weighted fusion can be performed based on their respective weight values, with constraint and smoothing operations applied to output the final zoom level corresponding to the (i+1)th frame image.

[0058] Understandably, Kalman filtering can be used for constraint and smoothing operations. Kalman filtering can divide the system state into principal components and errors. Using Kalman filtering to predict errors will result in a higher approximation of the system and better performance. In the task of calculating the final zoom ratio of intelligent zoom, the predicted value can be closer to the measured value.

[0059] In this way, considering multiple factors such as the shooting distance of the subject, distance reliability, screen occupancy, and positional offset from the target location, the first and second zoom ratios are determined separately and then weighted and fused. This multi-factor comprehensive approach ensures that the determined zoom ratio better reflects the actual situation of the subject, dynamically adjusting based on the subject's distance, screen occupancy, and offset from the target location to achieve a more reasonable zoom effect, ensuring the subject appears at an appropriate size in consecutive image frames.

[0060] In some embodiments, the method may further include: Determine the user's preferred composition position from N composition positions; N is an integer greater than 1; Based on the user's preferred composition position, the position of the subject in the (i+1)th frame is determined.

[0061] In this embodiment, the user's preferred composition position can be determined from N composition positions. For example, a prompt can be displayed on the preview interface, which can indicate N composition positions, such as the center point, upper left, lower left, upper right, and lower right.

[0062] It can receive input from the user to select any composition position and use the user-selected composition position as the user's preferred composition position.

[0063] The position of the subject in the (i+1)th frame can be determined based on the user's preferred composition position. For example, if the user selects the upper left as the preferred composition position, then in subsequent image processing, the position of the subject in the cropped preview image can be positioned at the upper left of the preview image.

[0064] This satisfies the diverse needs of different users for image composition. Users can choose different composition positions according to their preferences, and the system then determines the position of the subject in the i+1th frame based on the user's preferences, which improves the personalization of image processing and enhances user participation and satisfaction.

[0065] In some embodiments, the detection information of the subject being photographed includes the shooting distance, movement speed, and movement complexity of the subject. Determining the position of the subject in the (i+1)th frame based on user-preferred composition can include: The position of the subject in the (i+1)th frame is determined based on the shooting distance, movement speed, movement complexity, and user-preferred composition position.

[0066] In this embodiment, the detection information of the subject may also include the relative distance between the subject and the electronic device, the movement speed of the subject, and the movement complexity of the subject.

[0067] The position of the subject in the (i+1)th frame, i.e., the target position, is determined by a combination of factors including the shooting distance, movement speed, movement complexity, and the user's preferred composition position. For example, the formula for calculating the target position can be shown in formula (5):

[0068] in, Golden_position For the target location, Distance For distance, preference To favor the composition position, Speed For the speed of movement, complexity Let be the motion complexity.

[0069] It is understood that the constant weight values ​​in the formula are only used as an example to illustrate the technical solutions provided in this application embodiment, and are not intended to limit the implementation of this application embodiment. The specific weight values ​​can be set based on actual needs, and are not limited here.

[0070] In this way, the position in the i+1th frame can be adjusted more flexibly according to the actual movement state and distance information of the subject being photographed, ensuring that the subject can be better tracked when photographing dynamic objects, so that the subject can be in a suitable position under different movement conditions, further improving the adaptability and stability of image processing.

[0071] To facilitate understanding of the shooting method provided in the above embodiments, the following describes the shooting method using a specific scenario embodiment. Figure 4 This is a schematic flowchart of a scenario embodiment of the shooting method provided in this application.

[0072] This scenario implementation example may specifically include the following steps: Step 401: In a telephoto composition scene of shooting moving objects, turn on Any Place Zoom (APZ) mode; Step 402: Prompt the user to select their preferred composition location; Step 403: Identify and lock the subject of the shooting using a focus tracking algorithm, and determine the zoom ratio based on the detection information of the subject of the shooting to achieve automatic zoom; Step 404: Based on the user's preferred composition position and the detection information of the subject being photographed, determine the target position of the subject in the image; Step 405: Start APZ cropping to obtain a preview image. The position of the subject in the preview image corresponds to the target position of the subject in the image. Step 406: In response to the shooting input, take a picture of the preview image and output the shooting result.

[0073] The shooting method provided in this application can be executed by a shooting device. This application uses an image processing method performed by a shooting device as an example to illustrate the shooting device provided in this application.

[0074] like Figure 5 As shown, the imaging device 500 provided in this application embodiment may include: The acquisition module 501 is used to acquire the cropping coordinate information corresponding to the i-th frame image and the detection information of the subject in the (i+1)-th frame original image. The detection information of the subject includes at least one of the following: the position information of the subject, the shooting distance, the distance confidence, the screen ratio, the position offset, the motion speed, and the motion complexity, where i is a positive integer. The determination module 502 is used to determine the zoom ratio corresponding to the (i+1)th frame image based on the detection information of the subject being photographed. Processing module 503 is used to crop the original image of frame i+1 based on the cropping coordinate information corresponding to frame i and the zoom ratio corresponding to frame i+1 to obtain the image of frame i+1. The position of the subject in the i-th frame corresponds to the position of the subject in the (i+1)-th frame.

[0075] In this way, the zoom and cropping of the image can be dynamically adjusted according to the actual situation of the subject, ensuring that the position of the subject in the i-th frame corresponds to the position of the subject in the i+1-th frame, and both are in the ideal position. As a result, when the electronic device displays the above multi-frame images, the stability and visual appeal of the images are guaranteed, improving the composition effect of the images. Users can capture images that meet their expectations at any time, increasing the success rate of capturing images.

[0076] In some embodiments, the detection information of the subject being photographed includes the position information of the subject being photographed; Processing module 503 can also be used for: Based on the cropping coordinate information corresponding to the i-th frame image and the zoom ratio corresponding to the (i+1)-th frame image, determine the cropping coordinate transformation relationship between the (i+1)-th frame image and the i-th frame image. Based on the location information and the cropping coordinate transformation relationship, the cropping coordinate information corresponding to the (i+1)th frame image is determined; Based on the cropping coordinate information corresponding to the (i+1)th frame image, the original (i+1)th frame image is cropped to obtain the (i+1)th frame image.

[0077] In this way, by determining the cropping coordinate transformation relationship between the (i+1)th frame image and the i-th frame image, and combining it with the position information of the subject being photographed, the cropping coordinate information corresponding to the (i+1)th frame image can be accurately determined, thereby cropping the original (i+1)th frame image more precisely, ensuring that the subject being photographed is accurately located in the target position in the (i+1)th frame image, and improving the accuracy of image processing.

[0078] In some embodiments, the detection information of the subject being photographed includes the shooting distance of the subject, distance confidence level, screen occupancy, and positional offset from the target location; The determination module can also be used for: Determine the first zoom level based on the shooting distance; The second zoom ratio is determined based on the screen occupancy and positional offset. Based on distance reliability, the first zoom ratio and the second zoom ratio are weighted and fused to obtain the zoom ratio corresponding to the (i+1)th frame image.

[0079] In this way, considering multiple factors such as the shooting distance of the subject, distance reliability, screen occupancy, and positional offset from the target location, the first and second zoom ratios are determined separately and then weighted and fused. This multi-factor comprehensive approach ensures that the determined zoom ratio better reflects the actual situation of the subject, dynamically adjusting based on the subject's distance, screen occupancy, and offset from the target location to achieve a more reasonable zoom effect, ensuring the subject appears at an appropriate size in different frames.

[0080] In some embodiments, the position of the subject in the (i+1)th frame can be the center point region of the image.

[0081] In this way, the center area of ​​the image is usually the focal point of the viewer's vision. Placing the subject in this area can make the image more balanced and attractive, which conforms to the visual habits of most users and improves the overall aesthetics and viewing experience of the image.

[0082] In some embodiments, the shooting device 500 may further include a composition position determination module, used for: Determine the user's preferred composition position from N composition positions; N is an integer greater than 1; Based on the user's preferred composition position, the position of the subject in the (i+1)th frame is determined.

[0083] This satisfies the diverse needs of different users for image composition. Users can choose different composition positions according to their preferences, and the system then determines the position of the subject in the i+1th frame based on the user's preferences, which improves the personalization of image processing and enhances user participation and satisfaction.

[0084] In some embodiments, the detection information of the subject being photographed includes the shooting distance, movement speed, and movement complexity of the subject. The composition position determination module can also be used for: The position of the subject in the (i+1)th frame is determined based on the shooting distance, movement speed, movement complexity, and user-preferred composition position.

[0085] In this way, the position of the subject in the (i+1)th frame can be adjusted more flexibly according to the actual movement state and distance information of the subject, ensuring that the subject can be better tracked when shooting dynamic objects, so that the subject can be in a suitable position under different movement conditions, further improving the adaptability and stability of image processing.

[0086] In some embodiments, the imaging device 500 may further include: The display module is used to display the (i+1)th frame image in the preview interface; The shooting module is used to capture the (i+1)th frame image in response to the first input to the preview interface, and obtain the captured image.

[0087] In this way, the composition of the preview image is better, and users can capture images that meet their expectations at any time, thus improving the success rate of capturing images.

[0088] The shooting device in this application embodiment can be an electronic device or a component of an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, handheld computer, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. The embodiments of this application do not specifically limit the scope.

[0089] The shooting device in this application embodiment can be a device with an operating system. The operating system can be Android, iOS, or other possible operating systems, and this application embodiment does not specifically limit it.

[0090] The imaging device provided in this application embodiment can achieve... Figures 1 to 4 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.

[0091] Optionally, such as Figure 6 As shown, this application embodiment also provides an electronic device 600, including a processor 601 and a memory 602. The memory 602 stores a program or instructions that can run on the processor 601. When the program or instructions are executed by the processor 601, they implement the various steps of the above-described shooting method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.

[0092] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.

[0093] Figure 7 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application.

[0094] The electronic device 700 includes, but is not limited to, components such as: radio frequency unit 701, network module 702, audio output unit 703, input unit 704, sensor 705, display unit 706, user input unit 707, interface unit 708, memory 709, and processor 710.

[0095] Those skilled in the art will understand that the electronic device 700 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 710 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 7 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.

[0096] The processor 710 can be used for: Obtain the cropping coordinate information corresponding to the i-th frame image, and the detection information of the subject in the (i+1)-th frame original image; the detection information of the subject includes at least one of the following: the position information of the subject, the shooting distance, the distance confidence, the screen ratio, the position offset, the motion speed, and the motion complexity, where i is a positive integer; Based on the detection information of the subject being photographed, determine the zoom ratio corresponding to the (i+1)th frame image; Based on the cropping coordinate information corresponding to the i-th frame image and the zoom ratio corresponding to the i+1-th frame image, the original i+1-th frame image is cropped to obtain the i+1-th frame image. The position of the subject in the i-th frame corresponds to the position of the subject in the (i+1)-th frame.

[0097] In this way, the zoom and cropping of the image can be dynamically adjusted according to the actual situation of the subject, ensuring that the position of the subject in the i-th frame corresponds to the position of the subject in the i+1-th frame, and both are in the ideal position. As a result, when the electronic device displays the above multi-frame images, the stability and visual appeal of the images are guaranteed, improving the composition effect of the images. Users can capture images that meet their expectations at any time, increasing the success rate of capturing images.

[0098] In some embodiments, the detection information of the subject being photographed includes the position information of the subject being photographed; The processor 710 can also be used for: Based on the cropping coordinate information corresponding to the i-th frame image and the zoom ratio corresponding to the (i+1)-th frame image, determine the cropping coordinate transformation relationship between the (i+1)-th frame image and the i-th frame image. Based on the location information and the cropping coordinate transformation relationship, the cropping coordinate information corresponding to the (i+1)th frame image is determined; Based on the cropping coordinate information corresponding to the (i+1)th frame image, the original (i+1)th frame image is cropped to obtain the (i+1)th frame image.

[0099] In this way, by determining the cropping coordinate transformation relationship between the (i+1)th frame image and the i-th frame image, and combining it with the position information of the subject being photographed, the cropping coordinate information corresponding to the (i+1)th frame image can be accurately determined, thereby cropping the original (i+1)th frame image more precisely, ensuring that the subject being photographed is accurately located in the target position in the (i+1)th frame image, and improving the accuracy of image processing.

[0100] In some embodiments, the detection information of the subject being photographed includes the shooting distance of the subject, distance confidence level, screen occupancy, and positional offset from the target location; The processor 710 can also be used for: Determine the first zoom level based on the shooting distance; The second zoom ratio is determined based on the screen occupancy and positional offset. Based on distance reliability, the first zoom ratio and the second zoom ratio are weighted and fused to obtain the zoom ratio corresponding to the (i+1)th frame image.

[0101] In this way, considering multiple factors such as the shooting distance of the subject, distance reliability, screen occupancy, and positional offset from the target location, the first and second zoom ratios are determined separately and then weighted and fused. This multi-factor comprehensive approach ensures that the determined zoom ratio better reflects the actual situation of the subject, dynamically adjusting based on the subject's distance, screen occupancy, and offset from the target location to achieve a more reasonable zoom effect, ensuring the subject appears at an appropriate size in different frames.

[0102] In some embodiments, the position of the subject in the (i+1)th frame can be the center point region of the image.

[0103] In this way, the center area of ​​the image is usually the focal point of the viewer's vision. Placing the subject in this area can make the image more balanced and attractive, which conforms to the visual habits of most users and improves the overall aesthetics and viewing experience of the image.

[0104] In some embodiments, the processor 710 can also be used for: Determine the user's preferred composition position from N composition positions; N is an integer greater than 1; Based on the user's preferred composition position, the position of the subject in the (i+1)th frame is determined.

[0105] This satisfies the diverse needs of different users for image composition. Users can choose different composition positions according to their preferences, and the system then determines the position of the subject in the i+1th frame based on the user's preferences, which improves the personalization of image processing and enhances user participation and satisfaction.

[0106] In some embodiments, the detection information of the subject being photographed includes the shooting distance, movement speed, and movement complexity of the subject. The processor 710 can also be used for: The position of the subject in the (i+1)th frame is determined based on the shooting distance, movement speed, movement complexity, and user-preferred composition position.

[0107] In this way, the position of the subject in the (i+1)th frame can be adjusted more flexibly according to the actual movement state and distance information of the subject, ensuring that the subject can be better tracked when shooting dynamic objects, so that the subject can be in a suitable position under different movement conditions, further improving the adaptability and stability of image processing.

[0108] In some embodiments, the processor 710 can also be used for: Display the (i+1)th frame image in the preview interface; In response to the first input to the preview interface, the (i+1)th frame image is captured to obtain the captured image.

[0109] In this way, the composition of the preview image is better, and users can capture images that meet their expectations at any time, thus improving the success rate of capturing images.

[0110] It should be understood that, in this embodiment, the input unit 704 may include a graphics processing unit (GPU) 7041 and a microphone 7042. The GPU 7041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 706 may include a display panel 7061, which 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 at least one of a touch panel 7071 and other input devices 7072. The touch panel 7071 is also called a touch screen. The touch panel 7071 may include a touch detection device and a touch controller. Other input devices 7072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.

[0111] The memory 709 can be used to store software programs and various data. The memory 709 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 709 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 709 in the embodiments of this application includes, but is not limited to, these and any other suitable types of memory.

[0112] Processor 710 may include one or more processing units; optionally, processor 710 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 710.

[0113] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described shooting method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0114] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0115] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described shooting method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0116] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0117] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the above-described shooting method embodiments, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0118] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0119] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0120] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A shooting method, characterized in that, The method includes: Obtain the cropping coordinate information corresponding to the i-th frame image, and the detection information of the subject in the (i+1)-th frame original image; the detection information of the subject includes at least one of the following: the position information of the subject, shooting distance, distance confidence, screen ratio, position offset, motion speed and motion complexity, where i is a positive integer; Based on the detection information of the subject being photographed, determine the zoom ratio corresponding to the (i+1)th frame image; Based on the cropping coordinate information corresponding to the i-th frame image and the zoom ratio corresponding to the (i+1)-th frame image, the original (i+1)-th frame image is cropped to obtain the (i+1)-th frame image. The position of the subject in the i-th frame corresponds to the position of the subject in the (i+1)-th frame.

2. The method according to claim 1, characterized in that, The detection information of the subject being photographed includes the position information of the subject being photographed; The step of cropping the original image of the (i+1)th frame based on the cropping coordinate information corresponding to the i-th frame image and the zoom ratio corresponding to the (i+1)-th frame image to obtain the (i+1)-th frame image includes: Based on the cropping coordinate information corresponding to the i-th frame image and the zoom ratio corresponding to the (i+1)-th frame image, the cropping coordinate transformation relationship between the (i+1)-th frame image and the i-th frame image is determined. Based on the location information and the cropping coordinate transformation relationship, the cropping coordinate information corresponding to the (i+1)th frame image is determined; Based on the cropping coordinate information corresponding to the (i+1)th frame image, the original (i+1)th frame image is cropped to obtain the (i+1)th frame image.

3. The method according to claim 1, characterized in that, The detection information of the subject being photographed includes the shooting distance, distance reliability, screen occupancy, and position offset of the subject being photographed. The step of determining the zoom ratio corresponding to the (i+1)th frame image based on the detection information of the subject being photographed includes: Determine the first zoom ratio based on the shooting distance; The second zoom ratio is determined based on the screen occupancy and the position offset. Based on the distance confidence level, the first zoom level and the second zoom level are weighted and fused to obtain the zoom level corresponding to the (i+1)th frame image.

4. The method according to claim 1, characterized in that, The position of the subject being photographed in the (i+1)th frame of the image is the center point region of the image.

5. The method according to claim 1, characterized in that, The method further includes: Determine the user's preferred composition position from N composition positions; N is an integer greater than 1; Based on the user's preferred composition position, the position of the subject in the (i+1)th frame image is determined.

6. The method according to claim 5, characterized in that, The detection information of the subject being photographed includes the shooting distance, movement speed, and movement complexity of the subject being photographed. Determining the position of the subject in the (i+1)th frame image based on the user's preferred composition position includes: Based on the shooting distance, the movement speed, the movement complexity, and the user's preferred composition position, the position of the shooting subject in the (i+1)th frame image is determined.

7. The method according to any one of claims 1 to 6, characterized in that, After obtaining the (i+1)th frame image, the method further includes: The i+1th frame image is displayed in the preview interface; In response to the first input to the preview interface, the (i+1)th frame image is captured to obtain the captured image.

8. A shooting device, characterized in that, The device includes: The acquisition module is used to acquire the cropping coordinate information corresponding to the i-th frame image and the detection information of the subject in the (i+1)-th frame original image; the detection information of the subject includes at least one of the following: the position information of the subject, the shooting distance, the distance confidence level, the screen ratio, the position offset, the motion speed, and the motion complexity, where i is a positive integer; The determination module is used to determine the zoom ratio corresponding to the (i+1)th frame image based on the detection information of the subject being photographed. The processing module is used to crop the original image of the (i+1)th frame based on the cropping coordinate information corresponding to the i-th frame image and the zoom ratio corresponding to the (i+1)th frame image to obtain the (i+1)th frame image. The position of the subject in the i-th frame corresponds to the position of the subject in the (i+1)-th frame.

9. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the method as described in any one of claims 1-7.

10. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the method as described in any one of claims 1-7.