Image processing method, device and electronic equipment
By displaying the first target image and the second target image in the shooting preview interface of the mobile terminal, the problem of missing target objects during zoom shooting is solved, and the convenience and fun of the user during zooming is improved.
Patent Information
- Application Number
- CN202111163373.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-30
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2041-09-30
AI Technical Summary
During the zoom shooting process of the mobile terminal, when the telephoto camera is switched from the short-focus camera, it is easy to cause the target object to be lost in the picture.
By acquiring the first target image and the second target image, it is collected by the first camera and the second camera respectively, and displayed in the shooting preview interface. The focal length of the first camera is greater than or smaller than the focal length of the second camera, and the first target image is displayed. In the corresponding area of the second image, the user can view the zoom effect of the local area to avoid the loss of the target object.
It achieves the avoidance of target objects when shooting at zoom, improves the convenience and fun of users during zooming, and can display unzoned and zoomed images at the same time, helping users choose the appropriate focal length.
Smart Images

Figure CN113873159B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of image processing, and specifically relates to an image processing method, device and electronic equipment. Background Art
[0002] At present, the camera technology and image processing technology in mobile terminals are developing rapidly. Most mobile terminals are equipped with camera modules with multiple focal lengths, which greatly improves the zoom capability. Among them, cameras can be divided into telephoto cameras and short-focus cameras; telephoto cameras have a larger focal length and are suitable for shooting distant images, while short-focus cameras have a smaller focal length and are suitable for shooting close images. During the shooting process, if you switch from a short-focus camera to a telephoto camera, due to the small field of view of the telephoto camera, the target object in the shooting image is likely to be lost. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide an image processing method, device and electronic device, which can solve the problem of the target object being lost in the shooting picture when the user performs zoom shooting.
[0004] In order to solve the above technical problems, this application is implemented as follows:
[0005] In a first aspect, an embodiment of the present application provides an image processing method, comprising:
[0006] Acquire a first target image, where the first target image is an image of a first area in a first image, and the first image is an image captured by a first camera;
[0007] The second area of the second image displayed in the shooting preview interface displays the first target image, and the second image is an image captured by the second camera, wherein the focal length of the first camera is greater than or less than the focal length of the second camera, and the second area is an area corresponding to the first area.
[0008] In a second aspect, an embodiment of the present application provides an image processing device, including:
[0009] A first acquisition module, used to acquire a first target image, where the first target image is an image of a first area in a first image, and the first image is an image captured by a first camera;
[0010] A display module is used to display the first target image in a second area of the second image displayed in the shooting preview interface, where the second image is an image captured by a second camera, wherein the focal length of the first camera is greater than or less than the focal length of the second camera, and the second area is an area corresponding to the first area.
[0011] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory electrically connected to the processor, the memory storing a computer program, and the processor being used to call and execute the computer program from the memory to implement the method described in the first aspect.
[0012] In a fourth aspect, an embodiment of the present application provides a storage medium for storing a computer program, wherein the computer program can be executed by a processor to implement the method described in the first aspect.
[0013] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
[0014] In an embodiment of the present application, a first target image of a first area in a first image is first obtained, and then the first target image is displayed in the second area of the second image displayed in the shooting preview interface. Among them, the first image is an image captured by the first camera, the second image is an image captured by the second camera, and the focal length of the first camera is greater than or less than the focal length of the second camera, and the second area is an area corresponding to the first area. Since the first area and the second area are local areas in the first image and the second image, respectively, in this embodiment, the user can view the zoom effect of the local area in the shooting preview image (i.e., the second image), and then choose whether to zoom according to the zoom effect of the local area, thereby avoiding the situation where the target object is lost in the shooting picture when the user zooms; in addition, by displaying the target image captured by the first camera in the local area of the second image captured by the second camera, that is, a part of the unzoomed picture and a part of the zoomed picture can be displayed at the same time, so that it is convenient for the user to view the difference before and after the picture is zoomed, and enhance the fun of the user in zoom shooting. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 It is a flowchart of an image processing method provided by an embodiment of the present application;
[0016] Figure 2 This is a schematic diagram of an interface for shooting a picture provided by an embodiment of the present application;
[0017] Figure 3 This is one of the interface schematic diagrams of an image processing method provided by an embodiment of the present application;
[0018] Figure 4 This is one of the interface schematic diagrams of an image processing method provided by another embodiment of the present application;
[0019] Figure 5This is a second interface schematic diagram of an image processing method provided by another embodiment of the present application;
[0020] Figure 6 This is one of the flowchart diagrams of an image processing method provided by another embodiment of the present application;
[0021] Figure 7 This is a second flow chart of an image processing method provided by another embodiment of the present application;
[0022] Figure 8 is a schematic block diagram of an image processing device provided by an embodiment of the present application;
[0023] Fig. 9 It is a schematic block diagram of an electronic device provided by an embodiment of the present application.
[0024] Fig.10 It is a structural schematic diagram of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0025] The purpose of the embodiments of the present application is to provide an image processing method, device and electronic device, which can solve the problem of the target object being lost in the shooting picture when the user performs zoom shooting.
[0026] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0027] The terms "first", "second", etc. in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0028] The image processing method provided in the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0029] Figure 1 is a flowchart of an image processing method provided by an embodiment of the present application, such as Figure 1 As shown, the following steps S102-S104 are included:
[0030] S102, acquiring a first target image, wherein the first target image is an image of a first area in a first image, and the first image is an image captured by a first camera.
[0031] Optionally, the shape of the first area in the first image may be a regular shape or an irregular shape. The regular shape includes but is not limited to a rectangle, a circle or a square; the irregular shape may be a closed figure with an irregular outline.
[0032] S104, displaying the first target image in a second area of the second image displayed in the shooting preview interface, wherein the second image is an image captured by the second camera, the focal length of the first camera is greater than or less than the focal length of the second camera, and the second area is an area corresponding to the first area.
[0033] In this embodiment, the focal length of the first camera is greater than or less than the focal length of the second camera, that is, the zoom ratios of the first image and the second image are inconsistent. In various embodiments of the present application, telephoto cameras and short-focus cameras are relative. Specifically, if the focal length of the first camera is greater than the focal length of the second camera, then the first camera can be considered a telephoto camera relative to the second camera; similarly, the second camera can be considered a short-focus camera relative to the first camera. If the focal length of the first camera is less than the focal length of the second camera, then the first camera can be considered a short-focus camera relative to the second camera; similarly, the second camera can be considered a telephoto camera relative to the first camera.
[0034] When the first camera is a telephoto camera and the second camera is a short-focus camera, the first image captured by the first camera is a telephoto picture, and the second image captured by the second camera is a short-focus picture; when the first camera is a short-focus camera and the second camera is a telephoto camera, the first image captured by the first camera is a short-focus picture, and the second image captured by the second camera is a telephoto picture.
[0035] Figure 2 is a schematic diagram of a shooting preview interface provided according to an embodiment of the present application, such as Figure 2 As shown, in the left figure (a), a second image 22 is displayed on the shooting preview interface 21; in the right figure (b), a first target image 23 is displayed in the second area of the second image 22. The second area is exemplified as a rectangle.
[0036] In an embodiment of the present application, a first target image of a first area in a first image is first obtained, and then the first target image is displayed in the second area of the second image displayed in the shooting preview interface. Among them, the first image is an image captured by the first camera, the second image is an image captured by the second camera, and the focal length of the first camera is greater than or less than the focal length of the second camera, and the second area is an area corresponding to the first area. Since the first area and the second area are local areas in the first image and the second image, respectively, in this embodiment, the user can view the zoom effect of the local area in the shooting preview image (i.e., the second image), and then choose whether to zoom according to the zoom effect of the local area, thereby avoiding the situation where the target object is lost in the shooting picture when the user zooms; in addition, by displaying the target image captured by the first camera in the local area of the second image captured by the second camera, that is, a part of the unzoomed picture and a part of the zoomed picture can be displayed at the same time, so that it is convenient for the user to view the difference before and after the picture is zoomed, and enhance the fun of the user in zoom shooting.
[0037] The method of the embodiment of the present application will be further described below in conjunction with a specific embodiment. In one embodiment, the second area in the second image can be determined based on the following method: before acquiring the first target image, the second image displayed in the shooting preview interface is subjected to object recognition based on preset features to obtain the target object, and the image area where the target object is located is determined as the second area.
[0038] In this embodiment, the preset features are features corresponding to the preset target object. For example, when the target object is a face image, the preset features may include face features; when the target object is an object, the preset features may include object contour features.
[0039] by Figure 2 As an example, the second image shown in Figure 2 As can be seen from Figure (a), a face is displayed in the second image 22. If the face is used as the target feature, the area where the face is located can be determined by identifying the face features in the second image 22, and then the area where the face is located can be determined as the second area.
[0040] It should be noted that in the drawings of the following embodiments, the first camera is a telephoto camera and the second camera is a short-focus camera. For the case where the first camera is a short-focus camera and the second camera is a telephoto camera, the execution method is similar to that when the first camera is a telephoto camera and the second camera is a short-focus camera, so it will not be repeated.
[0041] In this embodiment, object recognition is performed on the second image displayed in the shooting preview interface based on preset features (such as facial features, object contour features, etc.) to obtain a target object (such as a facial image, an object image), and then the target object can be zoomed in to display the zoom processing effect of the target object to the user, which not only avoids the loss of the target object in the picture after the image zoom processing, but also can realize automatic recognition of the target object, thereby improving the convenience of zoom shooting.
[0042] In one embodiment, the second area in the second image may be determined based on the following method: before acquiring the first target image, receiving a first input from a user on the second image displayed in the shooting preview interface, and then obtaining the second area in response to the first input.
[0043] In this embodiment, there are multiple input methods for the first input, which can be determined according to actual usage requirements, and this embodiment of the present application does not limit this. This embodiment is illustrated by the following three methods:
[0044] Method 1: The first input is a click input, which may include a single-click input, a double-click input, or a click input of any number of touch points, etc. For example, the first input is a single-click input, and when a single-click input of the user to the second image displayed in the shooting preview interface is received, the second area is obtained in response to the single-click input.
[0045] Mode 2: If the first input is a voice command input by the user, the content of the voice command corresponding to the first input may be preset. For example, when the content of the voice command corresponding to the first input is received and recognized, the second area is obtained in response to the content of the voice command.
[0046] Mode 3: The first input is a specific gesture input by the user, such as any one of a single-click gesture, a sliding gesture, a dragging gesture, a pressure recognition gesture, a long-press gesture, an area change gesture, a double-press gesture, and a double-click gesture. For example, the first input is a sliding gesture, and when a sliding gesture of the user to the second image displayed in the shooting preview interface is received, the second area is obtained in response to the sliding gesture.
[0047] In this embodiment, the size information of the second area may be preset, and in response to the first input, the area in the second image that includes the first input position and meets the preset size may be determined as the second area.
[0048] Optionally, the second area is centered on the first input position. For example, the second area is a rectangle, the coordinates of the first input position are C2(a, b), and the preset size information of the second area may include a length L and a width W. When the user's first input is received, a second area centered on C2(a, b) and matching the length L and the width W can be determined from the second image according to the first input position and the preset size information.
[0049] Optionally, the second area includes the first input position but is not centered on the first input position. In this case, a first proportion of the target object (such as a face image, an object image, etc.) in the second image can be determined first, and then the second area is determined based on the first proportion.
[0050] In this embodiment, the first ratio may include the ratio of the target object to the area of the second image. The size of the second area is positively correlated with the first ratio of the target object to the second image. That is, the larger the first ratio of the target object to the second image, the larger the second area; the smaller the first ratio of the target object to the second image, the smaller the second area.
[0051] For example, a face detection algorithm is used to identify features of a face image in a second image, and contour information of the face image is obtained, and the area of the face image is calculated based on the features and contour information of the identified face image; then, a first ratio of the face image to the second image is obtained by calculating the ratio of the area of the face image to the total area of the second image; and then a second area in the second image is determined based on the determined first ratio.
[0052] In this embodiment, when the second image contains a target object such as a facial image, the second area can be determined based on the first ratio of the facial image to the second image, so that the zoomed facial image is displayed as completely as possible within the second area of the second image, thereby helping the user to obtain the complete zoomed facial image.
[0053] In one embodiment, after obtaining the second region according to the first input, the center point of the first region in the first image may be determined by following steps A1 to A2:
[0054] Step A1, obtaining a second center point of a second area.
[0055] Step A2: determining a first center point according to the camera parameters of the first camera and the second camera and the second center point, wherein the first center point is the center point of the first area in the first image.
[0056] In this step, the camera parameter may be the focal length corresponding to the camera. Since the sizes of image sensors corresponding to cameras with different focal lengths are different, it is necessary to determine the first center point corresponding to the second center point on the first image through the proportional relationship between the focal lengths corresponding to the first camera and the second camera respectively.
[0057] The first center point and the second center point can be represented by coordinates. Since the image sizes of the first image and the second image are not necessarily the same, the conversion relationship between the coordinate values in the two coordinate systems corresponding to the first image and the second image is related to the proportional relationship between the focal lengths corresponding to the first camera and the second camera, respectively, and the image size. For example, the first image is a rectangle of W*H (length*width), and the second image is a rectangle of w*h (length*width). The coordinates of the point on the second image are represented as (a,b), and the coordinates of the point corresponding to the point (a,b) on the first image are represented as (x,y). Two coordinate systems are established based on the size information of the first image and the second image, respectively, where W and w are the horizontal coordinate values on the corresponding coordinate systems, and H and h are the vertical coordinate values on the corresponding coordinate systems. Then, the coordinate values corresponding to the first image and the coordinate values corresponding to the second image should satisfy the following proportional relationship: x / W=a / w; y / H=b / h. Based on this proportional relationship, the coordinates (x,y) of the point corresponding to the point (a,b) on the first image can be determined, thereby realizing the determination of the corresponding point coordinates on the first image according to the point coordinates on the second image. Based on the above principle, a first center point corresponding to the second center point on the first image can be determined.
[0058] After the first center point is determined, the image of the first area in the first image may be cropped based on the first center point and the size of the second area, thereby obtaining the first target image.
[0059] In this embodiment, the first center point corresponding to the second center point on the first image is determined through the camera parameters of the first camera and the second camera and the second center point, and then the target image corresponding to the first area in the first image is cropped out according to the size information of the second area, so as to present the effect of the second image displayed in the second area being covered by the target image, so as to facilitate the user to compare the zoom effect of the target image after zoom processing.
[0060] In one embodiment, after the first target image is displayed in S104, the current first target image can be switched to a second target image in another area on the first image according to the second input. The switching of the target image can be performed in the following manner: receiving a second input from the user to the third area in the second image. In response to the second input, the second target image is acquired, and then the second target image is displayed in the third area, and the display of the first target image is canceled. The second target image is an image of the fourth area in the first image, and the fourth area is an area corresponding to the third area.
[0061] In this embodiment, the second input can be: a click input of the user on the second image, or a voice command input by the user, or a specific gesture input by the user. The specific input can be determined according to actual usage requirements, and the embodiment of the present application does not limit this.
[0062] In addition, the click input in the embodiments of the present application can be a single-click input, a double-click input, or a click input of any number of touch points, etc., and can also be a long press input or a short press input; the specific gesture in the embodiments of the present application can be any one of a single-click gesture, a sliding gesture, a drag gesture, a pressure recognition gesture, a long press gesture, an area change gesture, a double-press gesture, and a double-click gesture.
[0063] For example, the second input may be a double-click input in the click input. After the first target image is displayed, a double-click input of the user on the third area in the second image is received, and in response to the double-click input, a second target image in the fourth area in the first image is acquired.
[0064] For another example, the second input may be a drag gesture in a specific gesture input by the user. After the first target image is displayed, a drag gesture input by the user to the second area in the second image is received, an input position corresponding to the user's drag gesture is obtained in real time, and a fourth area in the first image is obtained according to the finally determined second input position, thereby obtaining the second target image in the fourth area.
[0065] Figure 3 is a schematic diagram of an interface of an image processing method provided in an embodiment of the present application, such as Figure 3 As shown, in the left figure (a), the second area of the second image 32 in the shooting preview interface 31 displays the first target image 33; in the right figure (b), the third area of the second image 32 in the shooting preview interface 31 displays the second target image 34. Before receiving the second input of the user to the second image 32, the shooting preview interface 31 displays the first target image 33 in the second area of the second image 32 as shown in the left figure (a); after the second target image 33 in the fourth area of the first image (not shown in the figure) is acquired in response to the second input of the user to the second image 32, the shooting preview interface 31 displays the second target image 34 in the third area of the second image 32 as shown in the right figure (b).
[0066] In this embodiment, by receiving the second input of the user on the second image, the zoom area in the second image can be smoothly switched, so that the user can quickly and smoothly change the zoom object during the zoom shooting process.
[0067] In one embodiment, after the first target image is displayed in S104, the user can trigger the display of the first image on the shooting preview interface through input, that is, display the complete zoom image. Optionally, the user performs a third input in the second area, and when the user's third input to the second area is received, the first image is displayed in the shooting preview interface in response to the third input. Thus, after the user previews the partial zoom screen, the user can trigger the display of the complete zoom screen, which not only ensures the integrity of the target object in the zoom screen, but also makes the display of the zoom screen smoother.
[0068] In this embodiment, the third input can be: a click input of the user on the second image, or a voice command input by the user, or a specific gesture input by the user. The specific input can be determined according to actual usage requirements, and the embodiment of the present application does not limit this.
[0069] Among them, the click input can be a single-click input, a double-click input, or any number of click inputs, etc., and can also be a long press input or a short press input; the specific gesture can be any one of a single-click gesture, a sliding gesture, a drag gesture, a pressure recognition gesture, a long press gesture, an area change gesture, a double-press gesture, and a double-click gesture.
[0070] by Figure 4 Taking the image of the shooting preview interface shown as an example, in the left figure (a), the second area in the second image 42 displays the first target image 43; in the right figure (b), the shooting preview interface 41 displays the complete first image 44. Assuming that the third input is a double-click input, after the first target image 43 is displayed in the second area of the second image 42, the shooting preview interface 41 is as shown in the left figure (a). If the complete first image 44 is to be displayed, the user can perform a double-click input on the second area (i.e., the area corresponding to the first target image 43). When the user's double-click input on the second area is received, the complete first image 44 is displayed as shown in Figure (b).
[0071] In this embodiment, by receiving the third input from the user in the second area, the second image currently covered by the target image can be quickly switched to the complete first image, that is, the complete zoom picture of the second image after zoom processing is presented to the user to achieve a smoother and more complete zoom effect.
[0072] In one embodiment, after the first target image is displayed, if the user wants to restore the original image, that is, to exit the display effect of the local zoom screen, a fourth input may be performed in the second image. When a fourth input of the user to an area other than the second area in the second image is received, the first target image is canceled from being displayed in the shooting preview interface in response to the fourth input.
[0073] In this embodiment, the fourth input can be a click input of the user on the second image, or a voice command input by the user, or a specific gesture input by the user. The specific input can be determined according to actual usage requirements, and the embodiment of the present application is not limited to this.
[0074] Among them, the click input in the embodiment of the present application can be a single-click input, a double-click input, or a click input of any number of touch points, etc., and can also be a long press input or a short press input; the specific gesture in the embodiment of the present application can be any one of a single-click gesture, a sliding gesture, a drag gesture, a pressure recognition gesture, a long press gesture, an area change gesture, a double-press gesture, and a double-click gesture.
[0075] by Figure 5 Taking the images on the shooting preview interface shown in FIG. 1 as an example, in the left figure (a), the second area of the second image 52 displays the first target image 53; in the right figure (b), the shooting preview interface 51 displays the complete second image 52. Assuming that the fourth input is a click input, after the first target image 53 is displayed in the second area of the second image 52, if the complete second image 52 is to be displayed, the user can click on an area other than the second area of the second image 52. When the user's click input on an area other than the second area of the second image 52 is received, the display of the first target image 53 is canceled to display the complete second image 52, as shown in FIG. Figure 5 As shown in the figure (b) on the right.
[0076] In this embodiment, by receiving the fourth input of the user in the non-second area in the second image, the second image currently covered by the target image can be quickly switched to the complete second image, thereby making the zoom cancellation process smoother.
[0077] In one embodiment, after receiving a first input from a user for a second image displayed in the shooting preview interface, a target zoom ratio may be determined according to input parameters of the first input, and then the first camera may be determined according to the target zoom ratio.
[0078] In this embodiment, for different input modes of the first input, input parameters corresponding to each input mode are determined, and then the target zoom ratio is determined according to the input parameters.
[0079] If the first input is a click input of the user on the second image, the zoom ratio may include 1.2 times, 1.5 times, and 1.75 times, then the input parameter may include the number of clicks and / or the number of touch points. For example, a click input of one touch point represents a zoom ratio of "zoom in", and a click input of two touch points represents a zoom ratio of "zoom out". A single click input of one touch point corresponds to a zoom ratio of 1.2 times; a double click input of one touch point corresponds to a zoom ratio of 1.5 times, and a triple click input of one touch point corresponds to a zoom ratio of 1.75 times; a single click input of two touch points may correspond to a zoom ratio of 1.2 times, a double click input corresponds to a zoom ratio of 1.5 times, and a triple click input corresponds to a zoom ratio of 1.75 times. When a single-click input of a touch point of the second image is received, the target zoom ratio is determined to be "zoom in" 1.2 times; when a double-click input of two touch points of the second image is received, the target zoom ratio is determined to be "zoom out" 1.5 times.
[0080] That is, if the number of touch points for click input is one, the input method corresponds to a target zoom ratio of an enlarged zoom ratio, and the first camera is a telephoto camera relative to the second camera; if the number of touch points in the input parameters of click input is two, the input method corresponds to a target zoom ratio of a reduced zoom ratio, and the first camera is a short-focus camera relative to the second camera.
[0081] If the first input is a voice command input by the user, the voice command content corresponding to the input parameter can be preset. For example, the voice command content corresponding to each target zoom ratio is preset, such as "zoom out 1.2 times", "zoom out 1.5 times", "zoom out 1.75 times", or "zoom in 1.2 times", "zoom in 1.5 times", "zoom in 1.75 times". That is, if the voice command content includes "zoom in", the first camera is a telephoto camera relative to the second camera; if the voice command content includes "zoom out", the first camera is a short-focus camera relative to the second camera.
[0082] If the first input is a specific gesture input by the user, such as a long press gesture, a sliding gesture, etc. For example, when the specific gesture input by the user is a long press gesture, the input parameter may be the pressing duration of the long press gesture, and then the target zoom ratio may be determined according to the pressing duration; wherein the target zoom ratio and the pressing duration of the long press gesture are positively correlated or negatively correlated. That is, if the target zoom ratio and the pressing duration of the long press gesture are positively correlated, the first camera is a telephoto camera; if the target zoom ratio and the pressing duration of the long press gesture are negatively correlated, the first camera is a short-focus camera.
[0083] In this embodiment, the target zoom ratio is determined according to the input parameters of the first input, and the target zoom ratio can be determined while determining the second area, which not only improves the smoothness and fluency of the zoom processing, but also simplifies the operation and brings convenience to the user.
[0084] In one embodiment, the target zoom ratio can be determined based on the input parameters of the first input, taking the case where the user's first input is a specific gesture and the specific gesture input by the user is a long press gesture as an example. Optionally, the target zoom ratio is determined according to the pressing duration of the long press gesture. If the pressing duration of the long press gesture exceeds a preset duration, a first image of the second image zoomed based on the target zoom ratio can be obtained, and then the first target image zoomed based on the position of the long press gesture and the target zoom ratio can be obtained. Based on this, if the target zoom ratio is positively correlated with the pressing duration of the long press gesture, the target zoom ratio increases with the increase of the pressing duration; if the target zoom ratio is negatively correlated with the pressing duration of the long press gesture, the target zoom ratio decreases with the increase of the pressing duration.
[0085] For example, the zoom ratio may include 1.2x, 1.5x, 1.75x, and 2x, and the default zoom ratio is 1.5x. If the zoom ratio and the press duration are positively correlated, the zoom ratio can be increased once for every 1 second increase in the press duration of the long press gesture. On the basis that the current zoom ratio is the default zoom ratio of 1.5x, the press duration increases by 1 second, and the zoom ratio increases to 1.75x; for another example, if the zoom ratio and the press duration are negatively correlated, the zoom ratio can be reduced once for every 1 second increase in the press duration of the long press gesture. On the basis that the current zoom ratio is the default zoom ratio of 1.5x, the press duration increases by 1 second, and the zoom ratio decreases to 1.2x.
[0086] In this embodiment, the zoom ratio is switched according to the pressing duration of the long press gesture, so that the user can quickly adjust to the target zoom ratio during zoom shooting, thereby improving convenience.
[0087] In one embodiment, when determining the target zoom ratio according to the input parameters of the first input, if the second image includes the target object, the first ratio of the target object to the second image and the position of the area where the target object is located in the second image are both input parameters of the first input. Taking the target object as a face image as an example, the target zoom ratio can be determined according to the following steps B1 to B2:
[0088] Step B1: if the position of the first input is within the region where the face image is located, determine a first ratio of the face image to the second image.
[0089] Optionally, features of the facial image in the second image are identified through a face detection algorithm, and contour information of the facial image is obtained, and the area of the facial image is calculated based on the features and contour information of the identified facial image; and then a first proportion of the facial image to the second image is obtained by calculating the ratio of the area of the facial image to the area of the second image.
[0090] Step B2, determining a target zoom ratio according to at least one of a first ratio of the face image to the second image and a position of the region where the face image is located in the second image.
[0091] In this step, in order to prevent the facial image from being incomplete after zoom processing, the target zoom ratio can be determined in real time according to the first ratio of the facial image to the second image. If the first ratio of the facial image to the second image is large, the target zoom ratio can be set to a smaller ratio; if the first ratio of the facial image to the second image is small, the target zoom ratio can be set to a larger ratio.
[0092] Optionally, the target zoom ratio can also be determined based on the position of the area where the face image is located in the second image. For example, if the area where the face image is located is the center of the second image, the target zoom ratio can be appropriately adjusted to a larger ratio; if the area where the face image is located is the edge of the second image, the target zoom ratio can be appropriately adjusted to a smaller ratio to avoid a larger target zoom ratio causing the face image at the edge that has been zoomed to be incomplete or lost in the picture.
[0093] In this embodiment, by considering the proportion of the facial image in the second image and the position of the area where the facial image is located in the second image, the target zoom ratio is adjusted in real time, so that the facial image after zoom processing can be displayed as completely as possible in the target image, avoiding the situation where the target image containing the complete facial image cannot be obtained.
[0094] Figure 6 is a flowchart of an image processing method provided by another embodiment of the present application, such as Figure 6 As shown, the method includes the following steps S601 to S612:
[0095] S601: Receive a first input from a user on a second image displayed in a shooting preview interface.
[0096] S602: Obtain a second region in response to the first input.
[0097] Among them, object recognition can be performed on the second image displayed in the shooting preview interface based on preset features to obtain the target object, and then the image area where the target object is located is determined as the second area; the size information of the second area can also be set in advance, and the area in the second image containing the first input position and the preset size can be determined as the second area.
[0098] S603: Determine a target zoom ratio according to the input parameter of the first input, and then determine a first camera according to the target zoom ratio.
[0099] Wherein, for different input modes of the first input, corresponding input parameters of each input mode are determined, and then the target zoom ratio is determined according to the input parameters. If the second image includes the target object, the first proportion of the target object in the second image and the area where the target object is located are both input parameters of the first input.
[0100] S604: Acquire a second center point of the second area.
[0101] S605: Determine the first center point according to the camera parameters of the first camera and the second camera and the second center point.
[0102] The first center point is the center point of the first area in the first image. The camera parameters include the focal length of the camera.
[0103] S606: Based on the first center point and the size of the second area, crop the image of the first area in the first image to obtain a first target image.
[0104] The first target image is an image of a first area in the first image, and the first image is an image captured by the first camera.
[0105] S607: Display the first target image in the second area of the second image displayed in the shooting preview interface.
[0106] The focal length of the first camera is greater than or less than the focal length of the second camera, and the second area is an area corresponding to the first area.
[0107] S608: Receive a second input from the user regarding the third area in the second image.
[0108] The third area is a local area of the second image except the second area.
[0109] S609: Acquire a second target image in response to the second input.
[0110] The second target image is an image of a fourth area in the first image, and the fourth area is an area on the first image corresponding to the third area.
[0111] S610: Display the second target image in the third area, and cancel display of the first target image.
[0112] S611, receiving a third input of the user on the second area.
[0113] S612: In response to the third input, display the first image in the shooting preview interface.
[0114] In this embodiment, the input modes corresponding to the first input, the second input and the third input have been described in detail in the above embodiments and will not be repeated here.
[0115] In an embodiment of the present application, by receiving the user's input of a local area other than the second area in the second image, the second area is switched to the third area, that is, the first area is switched to the fourth area. On the basis of displaying the second image, the target image can be switched in real time to determine that the target image contains the target zoom object, thereby improving the accuracy and operability of the zoom processing and facilitating the user to track the zoom effects of different local areas in the second image in real time.
[0116] In one embodiment, when the second image includes at least one target object, if the first input position is located in the area where one of the target objects on the second image is located, local zoom processing can be performed on the target object. In this embodiment, taking the target object as an example of a face image, Figure 7 is a flowchart of an image processing method provided by an embodiment of the present application, such as Figure 7 As shown, the method includes:
[0117] S701, receiving a first input from a user on a second image, wherein the second image includes a face image.
[0118] S702: If the first input position is located in the area where the face image is located, determine a first ratio of the face image to the second image.
[0119] In this step, the features of the face image in the short-focus picture can be identified by a face detection algorithm, and the contour information of the face image can be obtained to calculate the area of the face image, thereby obtaining a first ratio of the face image to the second image.
[0120] S703: Determine a target zoom ratio according to the first ratio and the position of the area where the face image is located in the second image.
[0121] In this step, in order to avoid the situation where the face image after zoom processing is incomplete, the target zoom ratio can be determined according to the first ratio of the face image to the second image, or according to the position of the area where the face image is located in the second image.
[0122] S704: Determine a first camera according to a first input position of a user on the second image and a target zoom ratio.
[0123] S705: Acquire a first target image through a first camera.
[0124] The first target image is a face image of a first area in the first image, and the first image is an image captured by the first camera. If the first camera is a telephoto camera relative to the second camera, the first target image is determined to be a telephoto image; if the first camera is a short-focus camera relative to the second camera, the first target image is determined to be a short-focus image.
[0125] S706: Display the first target image in a second area of the second image displayed in the shooting preview interface.
[0126] The second image is an image captured by the second camera, wherein the focal length of the first camera is greater than or less than the focal length of the second camera, and the second area is an area corresponding to the first area.
[0127] After this step, if a third input from the user on the second image is received, S707 is executed; if a fourth input from the user in an area outside the second area in the second image is received, S708 is executed.
[0128] S707, cancel the display of the first target image, and acquire and display the first image at the same time.
[0129] S708, cancel display of the first target image and display the complete second image at the same time.
[0130] In this embodiment, the input modes corresponding to the first input, the third input and the fourth input have been described in detail in the above embodiments and will not be repeated here.
[0131] According to the embodiment of the present application, when the target object included in the second image is a face image, the target zoom ratio is adjusted according to the proportion of the face image and the position of the area where the face image is located in the second image, and the second area is determined based on the first proportion of the face image to the second image, so that the face image after zoom processing is displayed as completely as possible in the target image, avoiding the situation where the target image containing the complete face image cannot be obtained, thereby enhancing the interest of zoom processing and image integrity. In addition, the user's input operation in different areas (second area and non-second area) can be received to achieve the effect of quickly switching to the complete first image or second image.
[0132] It should be noted that the image processing method provided in the embodiment of the present application can be executed by an image processing device or a control module in the image processing device for executing the image processing method. In the embodiment of the present application, the image processing device provided in the embodiment of the present application is described by taking the image processing device executing the image processing method as an example.
[0133] Figure 8 is a schematic block diagram of an image processing device provided by an embodiment of the present application. Figure 8 As shown, the device comprises:
[0134] A first acquisition module 810 is used to acquire a first target image, where the first target image is an image of a first area in a first image, and the first image is an image captured by a first camera;
[0135] Display module 820 is used to display the first target image in the second area of the second image displayed in the shooting preview interface, where the second image is an image captured by the second camera, wherein the focal length of the first camera is greater than or less than the focal length of the second camera, and the second area is an area corresponding to the first area.
[0136] In an embodiment of the present application, a first target image of a first area in a first image is first obtained, and then the first target image is displayed in the second area of the second image displayed in the shooting preview interface. Among them, the first image is an image captured by the first camera, the second image is an image captured by the second camera, and the focal length of the first camera is greater than or less than the focal length of the second camera, and the second area is an area corresponding to the first area. Since the first area and the second area are local areas in the first image and the second image, respectively, in this embodiment, the user can view the zoom effect of the local area in the shooting preview image (i.e., the second image), and then choose whether to zoom according to the zoom effect of the local area, thereby avoiding the situation where the target object is lost in the shooting picture when the user zooms; in addition, by displaying the target image captured by the first camera in the local area of the second image captured by the second camera, that is, a part of the unzoomed picture and a part of the zoomed picture can be displayed at the same time, so that it is convenient for the user to view the difference before and after the picture is zoomed, and enhance the fun of the user in zoom shooting.
[0137] In one embodiment, the apparatus further comprises:
[0138] A recognition module, used for performing object recognition on the second image displayed in the shooting preview interface based on preset features before acquiring the first target image, so as to obtain the target object;
[0139] The first determining module is used to determine the image area where the target object is located as the second area.
[0140] In this embodiment, by performing object recognition on the second image displayed in the shooting preview interface based on preset features, the target object is obtained, and then the target object can be zoomed in to display the zoom processing effect of the target object to the user. This not only avoids the situation where the target object is lost in the picture after the image zoom processing, but also achieves the effect of automatically identifying the second area, thereby improving the convenience of zoom shooting.
[0141] In one embodiment, the apparatus further comprises:
[0142] A first receiving module, used for receiving a first input from a user on a second image displayed in the shooting preview interface before acquiring the first target image;
[0143] A response module is used to obtain a second area in response to the first input.
[0144] In this embodiment, the second area is obtained in response to the first input, so that the target image is displayed in the second area of the second image, so that the user can see the zoom effect of the local area in the picture.
[0145] In one embodiment, the apparatus further comprises:
[0146] A second acquisition module, configured to acquire a second center point of the second area after the second area is obtained;
[0147] A second determining module, configured to determine a first center point according to camera parameters of the first camera and the second camera and the second center point, wherein the first center point is a center point of a first area in the first image;
[0148] The first acquisition module 810 includes:
[0149] A cropping unit is used to crop the image of the first area in the first image based on the first center point and the size of the second area to obtain the first target image.
[0150] In this embodiment, the first center point corresponding to the second center point on the first image is determined through the camera parameters of the first camera and the second camera and the second center point, and then the target image corresponding to the first area in the first image is cropped out according to the size information of the second area, so as to present the effect of the second image displayed in the second area being covered by the target image, so as to facilitate the user to compare the zoom effect of the target image after zoom processing.
[0151] In one embodiment, the apparatus further comprises:
[0152] a second receiving module, configured to receive a second input from a user on a third area in the second image after the first target image is displayed;
[0153] A third acquisition module, configured to acquire a second target image in response to the second input, where the second target image is an image of a fourth area in the first image, and the fourth area is an area corresponding to the third area;
[0154] The display module is used to display the second target image in the third area and cancel the display of the first target image.
[0155] In this embodiment, by receiving the second input of the user on the second image, the zoom area in the second image can be smoothly switched, so that the user can quickly and smoothly change the zoom object during the zoom shooting process.
[0156] In one embodiment, the apparatus further comprises:
[0157] a third receiving module, configured to receive a third input of the user on the second area after displaying the first target image;
[0158] A response and display module is used to display the first image in the shooting preview interface in response to the third input.
[0159] In this embodiment, by receiving the user's third input on the second image, the second image currently covered by the target image can be quickly switched to the complete first image, that is, the complete zoom picture of the second image after zoom processing is presented to the user to achieve a smoother and more complete zoom effect.
[0160] In one embodiment, the apparatus further comprises:
[0161] A third determining module is used for determining a target zoom ratio in response to a first input from a user for the second image displayed in the shooting preview interface and according to an input parameter of the first input after receiving the first input from the user;
[0162] A fourth determination module is used to determine the first camera according to the target zoom ratio.
[0163] In this embodiment, the target zoom ratio is determined according to the input parameters of the first input, and the target zoom ratio can be determined while determining the second area, which not only improves the smoothness and fluency of the zoom processing, but also simplifies the operation and brings convenience to the user.
[0164] An image processing device in an embodiment of the present application may be a device, or a component, integrated circuit, or chip in a terminal. The device may be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device may be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc., 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, etc., which is not specifically limited in the embodiments of the present application.
[0165] An image processing device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0166] The image processing device provided in the embodiment of the present application can achieve Figures 1 to 7 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0167] Alternatively, if Fig. 9 As shown, an embodiment of the present application also provides an electronic device 900, including a processor 901, a memory 902, and a program or instruction stored in the memory 902 and executable on the processor 901. When the program or instruction is executed by the processor 901, each process of the above-mentioned image processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0168] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0169] Fig.10 It is a structural schematic diagram of an electronic device provided in one embodiment of the present application.
[0170] The electronic device 1000 includes but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, a processor 1010, and a power supply 1011. Those skilled in the art will appreciate that Figure 8The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. In the embodiments of the present invention, the electronic device includes but is not limited to a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted terminal, a wearable device, and a pedometer.
[0171] The processor 1010 is configured to obtain a first target image, where the first target image is an image of a first area in a first image, and the first image is an image captured by a first camera;
[0172] Display unit 1006 is used to display the first target image in a second area of the second image displayed in the shooting preview interface, where the second image is an image captured by a second camera, wherein the focal length of the first camera is greater than or less than the focal length of the second camera, and the second area is an area corresponding to the first area.
[0173] In the embodiment of the present application, the first target image of the first area in the first image is first obtained, and then the first target image is displayed in the second area of the second image displayed in the shooting preview interface. Among them, the first image is an image captured by the first camera, the second image is an image captured by the second camera, and the focal length of the first camera is greater than or less than the focal length of the second camera, and the second area is an area corresponding to the first area. Since the first area and the second area are local areas in the first image and the second image respectively, the technical solution enables the user in this embodiment to view the zoom effect of the local area in the shooting preview image (i.e., the second image), and then choose whether to zoom according to the zoom effect of the local area, thereby avoiding the situation where the target object is lost in the shooting picture when the user zooms; in addition, by displaying the first target image captured by the first camera in the local area of the second image captured by the second camera, that is, a part of the unzoomed shooting preview picture and a part of the zoomed picture can be displayed at the same time, so that it is convenient for the user to view the difference before and after the picture of the local area in the shooting preview picture is zoomed, and the user's experience of zoom shooting is improved.
[0174] In one embodiment, before acquiring the first target image, the processor 1010 is further used to perform object recognition on the second image displayed in the shooting preview interface based on preset features to obtain the target object; and determine the image area where the target object is located as the second area.
[0175] In this embodiment, by performing object recognition on the second image displayed in the shooting preview interface based on preset features, the target object is obtained, and then the target object can be zoomed in to display the zoom processing effect of the target object to the user. This not only avoids the situation where the target object is lost in the picture after the image zoom processing, but also achieves the effect of automatically identifying the second area, thereby improving the convenience of zoom shooting.
[0176] In one embodiment, before acquiring the first target image, the user input unit 1007 is used to receive a first input from a user on the second image displayed in the shooting preview interface;
[0177] The processor 1010 is further configured to obtain a second area in response to the first input.
[0178] In this embodiment, the second area is obtained in response to the first input, so that the target image is displayed in the second area of the second image, so that the user can see the zoom effect of the local area in the picture.
[0179] In one embodiment, after obtaining the second area, the processor 1010 is also used to obtain a second center point of the second area; determine a first center point according to the camera parameters of the first camera and the second camera and the second center point, the first center point being the center point of the first area in the first image; and crop the image of the first area in the first image based on the first center point and the size of the second area to obtain the first target image.
[0180] In this embodiment, the first center point corresponding to the second center point on the first image is determined through the camera parameters of the first camera and the second camera and the second center point, and then the target image corresponding to the first area in the first image is cropped out according to the size information of the second area, so as to present the effect of the second image displayed in the second area being covered by the target image, so as to facilitate the user to compare the zoom effect of the target image after zoom processing.
[0181] In one embodiment, after displaying the first target image, the user input unit 1007 is further used to receive a second input from a user on a third area in the second image;
[0182] The processor 1010 is further configured to acquire a second target image in response to the second input, where the second target image is an image of a fourth area in the first image, and the fourth area is an area corresponding to the third area;
[0183] The display unit 1006 is further configured to display the second target image in the third area and cancel display of the first target image.
[0184] In this embodiment, by receiving the second input of the user on the second image, the zoom area in the second image can be smoothly switched, so that the user can quickly and smoothly change the zoom object during the zoom shooting process.
[0185] In one embodiment, after displaying the first target image, the user input unit 1007 is further used to receive a third input of the user on the second area;
[0186] The display unit 1006 is further configured to display the first image in the shooting preview interface in response to the third input.
[0187] In this embodiment, by receiving the user's third input on the second image, the second image currently covered by the target image can be quickly switched to the complete first image, that is, the complete zoom picture of the second image after zoom processing is presented to the user to achieve a smoother and more complete zoom effect.
[0188] In one embodiment, after receiving the first input from the user for the second image displayed in the shooting preview interface, the processor 1010 is also used to respond to the first input and determine the target zoom ratio according to the input parameters of the first input; and determine the first camera according to the target zoom ratio.
[0189] In this embodiment, the target zoom ratio is determined according to the input parameters of the first input, and the target zoom ratio can be determined while determining the second area, which not only improves the smoothness and fluency of the zoom processing, but also simplifies the operation and brings convenience to the user.
[0190] It should be understood that in the embodiment of the present invention, the radio frequency unit 1001 can be used for receiving and sending signals during information transmission or communication. Specifically, after receiving downlink data from the base station, it is sent to the processor 1010 for processing; in addition, uplink data is sent to the base station. Generally, the radio frequency unit 1001 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, the radio frequency unit 1001 can also communicate with the network and other devices through a wireless communication system.
[0191] The electronic device provides users with wireless broadband Internet access through the network module 1002, such as helping users to send and receive emails, browse web pages, and access streaming media.
[0192] The audio output unit 1003 can convert the audio data received by the RF unit 1001 or the network module 1002 or stored in the memory 1009 into an audio signal and output it as sound. Moreover, the audio output unit 1003 can also provide audio output related to a specific function performed by the electronic device 1000 (for example, a call signal reception sound, a message reception sound, etc.). The audio output unit 1003 includes a speaker, a buzzer, a receiver, etc.
[0193] The input unit 1004 is used to receive audio or video signals. The input unit 1004 may include a graphics processor (GPU) 10041 and a microphone 8042, and the graphics processor 8041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frame can be displayed on the display unit 806. The image frame processed by the graphics processor 10041 can be stored in the memory 1009 (or other storage medium) or sent via the radio frequency unit 1001 or the network module 1002. The microphone 10042 can receive sound and can process such sound into audio data. The processed audio data can be converted into a format output that can be sent to a mobile communication base station via the radio frequency unit 1001 in the case of a telephone call mode.
[0194] The electronic device 1000 also includes at least one sensor 1005, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 10061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 10061 and / or the backlight when the electronic device 1000 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary, which can be used to identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; the sensor 1005 can also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be repeated here.
[0195] The display unit 1006 is used to display information input by the user or information provided to the user. The display unit 1006 may include a display panel 10061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0196] The user input unit 1007 can be used to receive input digital or character information, and to generate key signal input related to user settings and function control of the electronic device. Specifically, the user input unit 1007 includes a touch panel 10071 and other input devices 10072. The touch panel 10071, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 10071 or near the touch panel 10071 using any suitable object or accessory such as a finger, stylus, etc.). The touch panel 10071 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the coordinates of the contact point, and then sends it to the processor 1010, receives the command sent by the processor 1010 and executes it. In addition, the touch panel 10071 can be implemented in various types such as resistive, capacitive, infrared and surface acoustic waves. In addition to the touch panel 10071, the user input unit 1007 may also include other input devices 10072. Specifically, other input devices 10072 may include but are not limited to physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which will not be repeated here.
[0197] Furthermore, the touch panel 10071 may be overlaid on the display panel 10061. When the touch panel 10071 detects a touch operation on or near it, it is transmitted to the processor 1010 to determine the type of touch event. Then, the processor 1010 provides corresponding visual output on the display panel 10061 according to the type of touch event. Fig.10 In the figure, the touch panel 10071 and the display panel 10061 are two independent components to realize the input and output functions of the electronic device. However, in some embodiments, the touch panel 10071 and the display panel 10061 can be integrated to realize the input and output functions of the electronic device, which is not limited here.
[0198] The interface unit 1008 is an interface for connecting an external device to the electronic device 1000. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 1008 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic device 1000 or may be used to transmit data between the electronic device 1000 and an external device.
[0199] The memory 1009 can be used to store software programs and various data. The memory 1009 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 1009 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0200] The processor 1010 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 1009 and calling data stored in the memory 1009, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. The processor 1010 may include one or more processing units; preferably, the processor 1010 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1010.
[0201] In addition, the electronic device 1000 includes some functional modules not shown, which will not be described in detail here.
[0202] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned image processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0203] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0204] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned image processing method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0205] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0206] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0207] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0208] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. An image processing method, It is characterized in that include: Acquire a first target image, where the first target image is an image of a first area in a first image, and the first image is an image captured by a first camera; The first target image is displayed in a second area of the second image displayed in the shooting preview interface, where the second image is an image captured by a second camera, wherein the focal length of the first camera is greater than the focal length of the second camera, and the second area is an area corresponding to the first area; receiving a second input from a user regarding a third area in the second image; In response to the second input, a second target image is acquired, where the second target image is an image of a fourth area in the first image, and the fourth area is an area corresponding to the third area; displaying the second target image in the third area, and canceling displaying the first target image; Before acquiring the first target image, the method further includes: receiving a first input from a user regarding a second image displayed in the shooting preview interface; In response to the first input, a second area is obtained, and a target zoom ratio is determined according to input parameters of the first input; Determining a first camera according to the target zoom ratio; wherein, for different input modes of the first input, input parameters corresponding to each input mode are determined; If the first input is a click input, the input parameter includes the number of clicks, and different numbers of clicks correspond to different zoom ratios; If the first input is a long press gesture input, the input parameter is the long press duration of the long press gesture, and the long press duration determines the target zoom ratio; After obtaining the second region, the method further includes: Obtaining a second center point of the second area; Determine a first center point according to the focal lengths corresponding to the first camera and the second camera and the second center point, where the first center point is the center point of a first area in the first image; The acquiring of the first target image comprises: Based on the first center point and the size of the second area, the image of the first area in the first image is cropped to obtain the first target image.
2. The image processing method according to claim 1, It is characterized in that Before acquiring the first target image, the method further includes: Performing object recognition on the second image displayed in the shooting preview interface based on preset features to obtain a target object; The image region where the target object is located is determined as the second region.
3. The image processing method according to claim 1, It is characterized in that After displaying the first target image, the method further includes: receiving a third input from a user on the second area; In response to the third input, the first image is displayed in the shooting preview interface.
4. An image processing device, It is characterized in that include: A first acquisition module, used to acquire a first target image, where the first target image is an image of a first area in a first image, and the first image is an image captured by a first camera; A display module, configured to display the first target image in a second area of a second image displayed in a shooting preview interface, wherein the second image is an image captured by a second camera, wherein the focal length of the first camera is greater than the focal length of the second camera, and the second area is an area corresponding to the first area; a second receiving module, configured to receive a second input from a user on a third area in the second image after the first target image is displayed; A third acquisition module, configured to acquire a second target image in response to the second input, where the second target image is an image of a fourth area in the first image, where the fourth area is an area corresponding to the third area; The display module is used to display the second target image in the third area and cancel the display of the first target image. A first receiving module, used for receiving a first input from a user on a second image displayed in the shooting preview interface before acquiring the first target image; A response module, configured to obtain a second area in response to the first input; A third determining module is used for determining a target zoom ratio according to an input parameter of the first input in response to receiving a first input from a user for the second image displayed in the shooting preview interface; a fourth determining module, configured to determine the first camera according to the target zoom ratio; The third determination module is further configured to determine input parameters corresponding to different input modes of the first input; If the first input is a click input, the input parameter includes the number of clicks, and different numbers of clicks correspond to different zoom ratios; If the first input is a long press gesture input, the input parameter is the long press duration of the long press gesture, and the long press duration determines the target zoom ratio; The device also includes: A second acquisition module, configured to acquire a second center point of the second area after the second area is obtained; A second determining module, configured to determine a first center point according to the focal lengths corresponding to the first camera and the second camera and the second center point, wherein the first center point is a center point of a first area in the first image; The first acquisition module includes: A cropping unit is used to crop the image of the first area in the first image based on the first center point and the size of the second area to obtain the first target image.
5. The device according to claim 4, It is characterized in that The device also includes: A recognition module, used for performing object recognition on the second image displayed in the shooting preview interface based on preset features before acquiring the first target image, so as to obtain the target object; The first determining module is used to determine the image area where the target object is located as the second area.
6. The device according to claim 4, It is characterized in that The device also includes: a third receiving module, configured to receive a third input of the user on the second area after displaying the first target image; A response and display module is used to display the first image in the shooting preview interface in response to the third input.
7. An electronic device, It is characterized in that It comprises a processor and a memory electrically connected to the processor, the memory stores a computer program, and the processor is used to call and execute the computer program from the memory to implement the image processing method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Zoom control method and apparatus
CN103108120A
Information processing method and electronic device
CN106993131A
Zooming photography method, mobile terminal and storage medium
CN108307111A
Shooting method, shooting device, storage medium and mobile terminal
CN111835973A
Auxiliary view finding method and device, terminal and storage medium
CN112911130A
