Shooting method, device and electronic equipment
Taking multiple images of different magnifications through an optical zoom lens and combining them solves the problem of low image quality caused by digital zoom in the existing technology, and improves the shooting quality and local resolution of electronic devices.
Patent Information
- Application Number
- CN202210191281.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-28
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2042-02-28
AI Technical Summary
When camera modules on existing electronic devices use digital zoom technology, the imaging details are blurred and the image quality is low. Especially when switching between close-up and distant views, the resulting image quality is low and the details are blurry.
Take multiple images through the optical zoom lens, including images with different magnifications, and combine the target area of the high-magnification image with the low-magnification image to improve the local resolution and image quality of the image.
It realizes image synthesis at different magnifications, improves the image quality of shooting and imaging, ensures that the content of the target area is clear, and avoids distortion during image scaling.
Smart Images

Figure CN114449174B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of photographing technology, and specifically relates to a photographing method, device and electronic equipment. Background Art
[0002] In order to meet users' needs for long-range and macro photography, most camera modules on current electronic devices use a combination of multiple fixed-focus lenses with different focal lengths, and use digital zoom technology to achieve the expansion of zoom ratios during photography. However, since digital zoom enlarges the pixel area within the short-focus image, the image details obtained by digital zoom are blurred and the image quality is low. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a shooting method, device and electronic device, which can solve the problem of low image quality of camera modules on electronic devices.
[0004] In a first aspect, an embodiment of the present application provides a shooting method, which is applied to an electronic device, wherein the electronic device is provided with an optical zoom lens, and the method includes:
[0005] Receive shooting input from the user;
[0006] In response to a shooting input, a plurality of images are shot through the optical zoom lens, wherein the plurality of images at least include a first image corresponding to a first magnification of the optical zoom lens and a second image corresponding to a second magnification of the optical zoom lens;
[0007] The target area of the second image is synthesized with the first image to obtain the target image, where the target area is the area in the first image that has the same object as the second image.
[0008] In a second aspect, an embodiment of the present application provides a photographing device, which is applied to an electronic device, and an optical zoom lens is provided on the electronic device, and the device includes:
[0009] A receiving module, used for receiving a user's shooting input;
[0010] A shooting module, configured to shoot a plurality of images through the optical zoom lens in response to a shooting input, wherein the plurality of images at least include a first image corresponding to a first magnification of the optical zoom lens and a second image corresponding to a second magnification of the optical zoom lens;
[0011] The output module is used to synthesize the target area corresponding to the second image with the first image to obtain the target image, where the target area is the area in the first image that has the same object as the second image.
[0012] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the shooting method described in the first aspect.
[0013] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the shooting method described in the first aspect are implemented.
[0014] 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 shooting method as described in the first aspect.
[0015] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the shooting method as described in the first aspect.
[0016] In an embodiment of the present application, after receiving a user's shooting input, the optical zoom lens of the electronic device shoots multiple images in response to the shooting input, wherein the multiple images include at least a first image corresponding to the first magnification of the optical zoom lens and a second image corresponding to the second magnification of the optical zoom lens, and the target area in the first image has the same object as the second image. Then the target area of the second image is synthesized with the first image to obtain the target image. Since the field of view of the optical zoom lens is different at different magnifications, but the image resolution obtained is the same, after synthesizing the target area of the second image with the first image, a target image with the same object as the first image and enhanced resolution of the local area can be obtained, ensuring that the local content in the target image is clear, thereby improving the image quality of the captured image. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a schematic diagram of digital zooming of a fixed-focus lens;
[0018] Figure 2 is a schematic structural diagram of an optical zoom lens in one embodiment of the present application;
[0019] Figure 3 is a flowchart of a shooting method in one embodiment of the present application;
[0020] Figure 4 is a display schematic diagram of a shooting interface in one embodiment of the present application;
[0021] Figure 5is a display schematic diagram of a shooting interface in another embodiment of the present application;
[0022] Figure 6 is a schematic diagram of optical zoom lens magnification in yet another embodiment of the present application;
[0023] Figure 7 is a display schematic diagram of a shooting interface in yet another embodiment of the present application;
[0024] Figure 8 is a schematic diagram of image synthesis in a specific example of the present application;
[0025] Fig. 9 is a schematic diagram of image synthesis in another specific example of the present application;
[0026] Fig.10 is a structural schematic diagram of a photographing device in another embodiment of the present application;
[0027] Fig.11 is a schematic diagram of the hardware structure of an electronic device in yet another embodiment of the present application;
[0028] Fig.12 It is a schematic diagram of the hardware structure of an electronic device in another embodiment of the present application. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0030] The terms "first", "second", etc. in the specification and claims of the present 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.
[0031] Currently, most electronic devices with camera modules use multiple fixed-focus lenses with different focal lengths, and use digital zoom technology to switch between close-up and long-range shooting. For example, Figure 15 fixed-focus lenses 100 with different focal lengths are shown in the figure. If the main camera is a lens 101 with a focal length of 1X (i.e., 1x magnification), and the secondary camera includes lenses (102, 103, 104, 105) with focal lengths of 0.5X, 2X, 5X, and 10X, then by switching the lenses, the zoom can be changed between the main camera 101 and the secondary camera (102, 103, 104, 105). However, in this technology, due to the limited number of lenses, if the user wants to shoot a focal length between the corresponding focal lengths of two fixed-focus lenses, the lens with a lower focal length is used to capture the picture and then the corresponding image is obtained through a digital magnification algorithm. For example Figure 1 In the example shown in , if an image with a 3X focal length is taken, the 2X lens 103 is used to capture the image and then enlarge it according to a certain ratio, which is equivalent to only enlarging the pixel area on the short-focus image, resulting in low image pixels and reduced resolution. In particular, when the imaged photo is partially enlarged for viewing, it will be found that the photo has obvious blurring. Therefore, the image quality obtained by the digital zoom technology is low and the details are blurred.
[0032] In order to solve the problems existing in the above-mentioned technology, the embodiments of the present application provide a shooting method, device and electronic device, which use an optical zoom lens on the electronic device to shoot multiple images corresponding to multiple magnifications, and replace the focus area in the lower magnification image with the higher magnification image and then synthesize them, so as to obtain a final image with enhanced resolution of the focus area, thereby improving the imaging effect of the final image.
[0033] The following is a detailed description of the shooting method provided in the embodiment of the present application through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0034] The shooting method in the embodiment of the present application can be applied to an electronic device, and the electronic device includes an optical zoom lens. Figure 2 As shown, the optical zoom lens 200 is a lens with a certain optical focal length, which is arranged in the camera module of the electronic device and may include two or more position-variable optical lenses 201. The optical zoom lens 200 may realize a multi-fold focal length continuously variable optical zoom under the drive of the drive motor 202.
[0035] Figure 3 FIG. 1 is a flow chart showing a method for photographing in an embodiment of the present application. Figure 3 As shown, the method may include S301 to S303:
[0036] S301. Receive user's shooting input;
[0037] S302. In response to a shooting input, multiple images are shot through the optical zoom lens, the multiple images at least including a first image corresponding to a first magnification of the optical zoom lens and a second image corresponding to a second magnification of the optical zoom lens, the first magnification being smaller than the second magnification.
[0038] The shooting input is an input used to enable the electronic device to perform a shooting operation, such as a click input on a shooting interface, a voice command input, etc.
[0039] Exemplary, reference Figure 4 As shown, the shooting interface 401 of the electronic device 400 may display some functional controls, such as a shooting key 402 for receiving shooting input, buttons (403, 404, 405) for switching between functions such as photo taking, video recording, and professional shooting, a control for turning on and off the flash function, and a control (such as a sliding bar control) 406 for allowing the user to select the optical zoom lens magnification, etc. The shooting interface 401 may also include a preview area 407 for displaying a preview image captured by the lens, etc.
[0040] For example, during the shooting process, the electronic device may configure a default lens magnification (such as 1x), or may select a variable magnification, such as 3x, through a corresponding control 406 of the shooting interface 401 .
[0041] After the user confirms the shooting magnification (which can be the default magnification or manually selected to change to another magnification), the optical zoom lens changes to the focal length position of the magnification, and focuses on capturing the corresponding physical scene, generating a corresponding clear preview image, which is displayed in the preview area 407 of the shooting interface.
[0042] The user can trigger the shooting operation through the above shooting input according to the preview picture displayed on the shooting interface of the electronic device.
[0043] In this embodiment, the electronic device responds to a shooting input and captures multiple images through an optical zoom lens, including at least a first image corresponding to a first magnification of the optical zoom lens and a second image corresponding to a second magnification of the optical zoom lens, wherein the first magnification is smaller than the second magnification.
[0044] For example, in response to a shooting input, the observed object is photographed at a default magnification (first magnification) to obtain a first image, and then the optical zoom lens is zoomed to a second magnification to photograph the observed object to obtain a second image.
[0045] According to the characteristics of the optical zoom lens, when the optical zoom lens is zoomed to different magnifications, the focal length is different and the field of view angle range is also different. However, the images captured by the optical zoom lens at any focal length have the same resolution. Therefore, in this embodiment, the first image and the second image have different field of view angles, but the same resolution.
[0046] S303. Synthesize the target area corresponding to the second image with the first image to obtain the target image, where the target area is the area in the first image that has the same object as the second image.
[0047] In this embodiment, after the user triggers the shooting operation, the electronic device uses the optical zoom lens to shoot multiple images corresponding to multiple magnifications. Among the multiple images, one image is used as a basic negative film. In this embodiment, the image that the user wants to shoot (such as the image at 1 magnification) can be used as the basic negative film, and the remaining images can be used as enhanced samples to enhance the resolution of the local area in the basic negative film.
[0048] During the shooting process, when the shooting position and angle of the electronic device remain unchanged, in the multiple images of the same observed object shot at different magnifications by the optical zoom lens, the center of the picture content presented in each image corresponds to the same position of the actual observed object. For example, when shooting a rabbit grazing on a meadow, at a magnification of 1, the lens focuses on the rabbit's head to shoot, and a first image is obtained. The picture content presented globally in the first image is a rabbit grazing on a meadow, and the content presented in the central area of the first image is the rabbit's head. When the shooting position and angle remain unchanged, the lens is zoomed to 3 times, the field of view angle range is reduced, and the lens will still focus on the rabbit's head for shooting, then the picture presented globally in the second image only includes the rabbit grazing, and the content presented in the central area of the second image is also the rabbit's head. Therefore, during the shooting process, the focus position of the object corresponding to each image is the same, and different shooting ranges (i.e., field angles) for the observed object are presented according to different magnifications. The object in at least a part of the area (i.e., the target area) in the low-magnification image is the same as the object in the global area of the high-magnification image. The object can be all objects contained in the shooting picture, such as the photographed object, foreground, background, etc.
[0049] In this way, a second image with a high magnification and a small field of view can cover or replace the target area in the first image with a low magnification and a large field of view. The resolution of the local area in the synthesized target image is higher than that of the peripheral area, thereby enhancing the resolution of the local area of the image and improving the image quality. After scaling the target image, the content of the target area on the target image can be ensured to be clear and the content is not distorted after the image is scaled.
[0050] In order to improve shooting flexibility and meet user needs, optionally, in an embodiment of the present application, a first control is provided in the shooting interface, and the first control is used to switch shooting modes, and the shooting modes include normal mode and enhanced mode. Among them, in normal mode, the user can shoot at the default magnification to obtain the corresponding image, and in enhanced mode, the user can obtain images corresponding to multiple target magnifications at the enhanced level by inputting the shooting input, and synthesize the multiple images to obtain an enhanced image with local image quality enhancement. Specifically, in this embodiment, after receiving the user's shooting input, step S302 responds to the shooting input and shoots multiple images through the optical zoom lens, which may include S3021~S3023:
[0051] S3021. In response to a photographing input, determine a zoom level of the optical zoom lens.
[0052] The zoom level is the zoom level of the optical zoom lens, and the zoom level is determined according to the user's enhancement level of the basic film resolution. For example, when the default zoom ratio of the lens is 1, the user wants to enhance the resolution of the central area of the 1-magnification basic film by 3 times, so that the resolution of the central area of the synthesized target image is 3 times that of the peripheral area. Correspondingly, the user's shooting input can be received through the first control of the interface to determine that the zoom level of the optical zoom lens is 3.
[0053] S3022. According to the zoom level, determine a plurality of target magnifications corresponding to the zoom level, the plurality of target magnifications including at least a first magnification and a second magnification;
[0054] S3023. According to the multiple target magnifications, capture multiple images corresponding to the multiple target magnifications.
[0055] In this embodiment, in the process of executing S3021 to S3022 to determine multiple target magnifications corresponding to the magnification level, the corresponding maximum magnification can be first determined according to the magnification level, and then based on the default magnification (i.e., the basic magnification) and the maximum magnification, a uniform interpolation calculation is performed to obtain one or more intermediate magnifications between the default magnification and the maximum magnification. For example, if the default magnification is 1 and the magnification level is 3, then the maximum magnification is 3, and the intermediate magnification obtained by interpolation calculation based on the default magnification and the maximum magnification is 2, and the 1 magnification, 2 magnification, and 3 magnification are all target magnifications. After determining the target magnification, execute S3023, and use the optical zoom lens to capture images corresponding to each target magnification to obtain multiple images with different field of view angles.
[0056] For example, if the zoom level is small, such as the base zoom is 1 and the zoom level is 2, no intermediate zoom may be set between the base zoom and the maximum zoom. At least two images are captured at the base zoom and the maximum zoom.
[0057] In some specific scenarios, the image enhancement function can be activated through the control on the interface, and then the user's shooting input is received to execute the above S3021 to S3023. Figure 5 As shown, the user Figure 5 The shooting interface 501 shown in (5a) jumps to the Figure 5 In the function extension interface 503 shown in (5b), input (such as clicking) to the first control 504 in the function extension interface 503 turns on or off the image enhancement mode, so that the user can shoot enhanced images or ordinary images according to actual needs, providing users with more choices.
[0058] In the enhancement mode, an enhanced image (ie, a target image) can be obtained through steps S3021 to S3023.
[0059] In order to obtain an image with enhanced image quality, optionally, in the embodiment of the present application, based on the optical zoom lens of the electronic device, during the process of shooting multiple images corresponding to multiple target magnifications through S3023, the lens can be controlled to change magnification to obtain multiple images with different magnifications. Specifically, S3023 may include:
[0060] According to the order of the multiple target magnifications, the optical zoom lens is controlled to change the magnification to the multiple target magnifications in sequence;
[0061] When the optical zoom lens is zoomed to each target magnification, at least one image is captured.
[0062] In this embodiment, multiple target magnifications are sorted, and according to the size order of the multiple target magnifications (such as from small to large), the optical zoom lens is controlled to change magnification to multiple target magnifications in sequence. Exemplarily, the target magnification includes a first magnification and a second magnification, and the first magnification is less than the second magnification. In this example, the first magnification can be a default magnification (such as 1 magnification) or a magnification selected by the user (such as 3 magnifications). When the optical zoom lens is at the first magnification, it captures the first image, and then controls the optical zoom lens to change magnification to the second magnification (such as 5 magnifications) to capture the second image, so that the resolution of each image obtained is the same, and after subsequent synthesis, the local image resolution is enhanced.
[0063] Specifically, during the shooting process, refer to Figure 6As shown, after determining each target magnification, the electronic device records the focal length position of the optical zoom lens at each target magnification. First, at the minimum target magnification of the optical zoom lens 601, that is, the first magnification (such as 1x), the focusing operation is completed for the current scene to ensure the clarity of the captured picture and take at least one image. Then, according to the second magnification (such as 10x), the drive motor drives the lens 601 to zoom to the corresponding focal length position to take the second image. Similarly, if the target magnification also includes a third magnification between the first magnification and the second magnification, the lens 601 is zoomed to the third magnification for shooting. The third magnification can be one or more magnifications. For example, the third magnification includes 2x, 4x, 6x and 8x. After shooting the first magnification (i.e. 1x), the lens 601 can be magnified to the focal length positions corresponding to 2x, 4x, 6x and 8x in sequence to shoot 2x images, 4x images, 6x images, 8x images, and then magnified to the second magnification (i.e. 10x) to shoot the second image.
[0064] In some specific examples, an interpolation calculation can be performed based on the basic magnification, the maximum magnification, and the zoom capability of the optical zoom lens to determine the intermediate magnification, so that the basic magnification, the intermediate magnification, and the maximum magnification form an enhanced sequence in ascending order, and then the focal length position corresponding to each magnification in the enhanced sequence is determined. For example, the user sets the zoom level to N, and the focal length of the basic magnification of the optical zoom lens is f Photograph The maximum focal length of this lens is f Max , then the focal length of the enhancement sequence corresponding to each target magnification can be expressed as Wherein, 1<k<N, k and N are both integers, and k represents the intermediate magnification in the enhancement sequence. After determining the focal length position corresponding to each target magnification of the enhancement sequence, the lens is controlled to change magnification in sequence, multiple images are captured, and synthesis is performed according to step S301 to obtain a target image enhanced in a local area.
[0065] In order to facilitate users to freely select the enhancement level according to their own needs, optionally, in the embodiment of the present application, reference Figure 7 As shown, in enhanced mode, the shooting interface 701 may display a control (hereinafter referred to as a "second control") 702 for the user to select the optical zoom lens zoom level, such as a sliding bar control. The zoom level (such as 2x, 2.5x, 5x, etc.) is displayed through the control 702, and the user's input is received through the second control 702 to determine the zoom level, and then determine the target magnification according to the zoom level. Since the optical zoom lens can continuously zoom within the focal length range, in some examples, the target magnification corresponding to the zoom level can be an integer magnification or a non-integer magnification.
[0066] In this embodiment, according to the determined multiple target magnifications, the optical zoom lens is controlled to change the magnification to the corresponding focal length position in sequence, automatically focus, capture the picture of the observed scene, and obtain multiple images. The picture focus position in each image has a corresponding relationship, such as being at the center of the image.
[0067] According to actual needs, the image shot at the default magnification can be directly used as the basic negative film, and the images shot at other target magnifications can be directly used as enhanced samples, and step S303 can be executed to perform image synthesis to quickly obtain the target image. Alternatively, the user can also select the enhanced sample film and the basic negative film from the multiple images shot (including the first image and the second image), and execute step S303 to synthesize them to meet the user's personalized shooting needs.
[0068] In the process of performing step S303 for synthesis, the field of view of the image can be sorted, such as from large to small. According to the order of the field of view of the image, the above-mentioned multiple images are successively superimposed and synthesized. In an optional example, the high-magnification image can be scaled to a size smaller than the low-magnification image, and then the scaled high-magnification image is superimposed on the low-magnification image for synthesis according to the correspondence between the objects contained in each image, so that the resolution of the local area of the synthesized image is enhanced, and the picture content presented by the original image (low-magnification image) is not changed. In other optional examples, the low-magnification image can also be enlarged to a size larger than the high-magnification image, and then the high-magnification image is superimposed on the enlarged low-magnification image for synthesis according to the correspondence between the objects contained in each image, so that the resolution of the local area of the synthesized image can also be enhanced, and the picture content presented by the original image (low-magnification image) is not changed.
[0069] Exemplarily, after obtaining the first image and the second image, step S303 synthesizes the target area corresponding to the second image with the first image to obtain the target image, which may specifically include S3031 to S3034:
[0070] S3031. stacking the first image and the second image in order of corresponding viewing angles;
[0071] S3032. Scale the second image according to the corresponding second magnification, so that the scaled second image is equal to the size of the target area, and the center of the scaled second image is aligned with the center of the target area, and the center of the target area is the center of the first image.
[0072] The second magnification is greater than the first magnification, so the field of view corresponding to the second image is smaller than that of the first image. Figure 8 As shown, the second image 801 is superimposed on the first image 802, and the centers of the two images are aligned.
[0073] Because when the shooting position and angle remain unchanged, the optical zoom lens performs axial movement when changing magnifications, and the focal position of the lens remains unchanged, the object contained in the global area of a high-magnification image is the same as the object contained in a certain area in the middle of another low-magnification image.
[0074] Therefore, based on the correspondence between the objects in the images, through step S3032, the second image is scaled according to the corresponding second magnification, such as scaling the 2-magnification image by 2 times. Because the object contained in the target area in the first image is the same as the object contained in the second image, that is, the field of view corresponding to the target area is actually the same as the second image, and the second image is shot by controlling the lens to change the magnification to the second magnification based on the first magnification, so the second image scaled according to the second magnification is equal to the size of the target area. The center of the scaled second image is aligned with the center of the target area, and when the scaled second image is superimposed on the first image, it can cover the target area.
[0075] S3033. Replace or cover the target area with the scaled second image;
[0076] S3034. Synthesize the scaled second image with the first image to obtain a target image.
[0077] The scaled second image is aligned with the center of the target area and is equal in size. Therefore, after the scaled second image replaces or covers the target area through S3033, the scaled second image is synthesized with the first image to obtain the target image without changing the object contained in the first image. Since the original target area is replaced by the second image, the pixel density of the local area is increased and the resolution is enhanced. In this way, when the target image is enlarged or reduced, the central area of the target area can also maintain good clarity.
[0078] Exemplary, reference Figure 8 , the second magnification is greater than the first magnification, and the field of view of the second image 801 (i.e., the enhanced sample) is smaller than that of the first image (i.e., the base film) 802. The second image 801 can be scaled to a certain size to cover or replace the target area 803 in the first image 802 that has the same object as the second image. After the synthesized target image is enlarged, the target area 803 actually displays the pixel resolution of the second image, thereby enhancing the first image. It should be understood that Figure 8 In the figure, the original images of the second image 801 and the first image 802 are both taken by continuously zooming in the optical zoom lens, and thus are equal-resolution images, and their size drawing schematically only represents the effect of the change in the field of view that can be captured in the actual scene shooting.
[0079] In this example, if the focal length corresponding to the first image is f1 and the focal length corresponding to the second image is f2, the resolution of the target image can be equivalently magnified by f2 / f1 times.
[0080] Optionally, before stacking the first image and the second image in order of corresponding viewing angles in step S3031, the method may further include:
[0081] In the case where the second image has a distorted region, the distorted region in the second image is cropped and / or corrected.
[0082] In the case where the second image has a distorted area, such as distortion, jaggedness, etc. at the edge of the image, the distorted area of the second image can be cropped, or the distorted area can be corrected and repaired using a preset algorithm and then synthesized to ensure that the splicing position of the first image and the second image after synthesis is complete.
[0083] In other examples, during the image synthesis process, the first image and the second image may be aligned and superimposed in the order of the field of view angle, and then the first image may be magnified at the second magnification so that the size of the target area is equal to that of the second image. Then, the target area of the magnified first image is covered or replaced, and the second image is synthesized with the magnified first image to obtain the target image.
[0084] In order to gradually enhance the local image quality and balance the resolution of the overall image, optionally, in an embodiment of the present application, in addition to the first image and the second image, the multiple images obtained through steps S301 to S302 may also include a third image, and the third image is an image corresponding to the third magnification of the optical zoom lens, and the third magnification is between the first magnification and the second magnification. In some examples, the third magnification may be one of the target magnifications determined through steps S3021 to S3022, and the third image is an image taken through S2023. In other examples, the third image may be an image obtained by interpolating the second image and the first image, so the magnification of the third image is between the first magnification and the second magnification.
[0085] Exemplarily, the third magnification, as an intermediate magnification, may be one magnification or multiple magnifications. Correspondingly, the third image, as an image of an intermediate magnification, may be one image or multiple images.
[0086] When the plurality of images include the third image, step S303 synthesizes the target area corresponding to the second image with the first image to obtain the target image, which may specifically include:
[0087] The first image, the third image and the second image are stacked in order according to the corresponding viewing angles;
[0088] The second image is scaled according to a second magnification, so that the scaled second image is equal in size to the target local area and is aligned with the center of the third image, and the target local area is an area in the third image that has the same object as the second image;
[0089] superimposing the scaled second image on the third image to form a combined image;
[0090] Scaling the combined image according to a third magnification, so that the scaled combined image is equal in size to the target area and aligned with the center of the target area, and the center of the target area is the center of the first image;
[0091] Using the combined image to replace or cover the target area;
[0092] The combined image is synthesized with the first image to obtain a target image.
[0093] In this embodiment, each image corresponding to a plurality of target magnifications is a photographic image of the same observed object, but due to different lens magnifications, the shooting field angle ranges are different, and the shooting ranges presented in the images are also different. The larger the magnification, the smaller the field angle, and the smaller the shooting range presented in the image. Therefore, when the plurality of images includes a third image corresponding to a third magnification, the reference Fig. 9 As shown, the magnification of the third image 903 is higher than that of the first image 901 and lower than that of the second image 902, and the field of view of the third image 903 is smaller than that of the first image 901 and larger than that of the second image 902. In order to ensure that the synthesized image is consistent with the original image, the images need to be synthesized one by one in the order of the field of view. Therefore, in this embodiment, according to the enhanced sequence relationship formed by the second magnification and the third magnification, the first image, the third image and the second image are first stacked in the order of the corresponding field of view sizes, and after stacking, the third image is located between the first image and the second image.
[0094] like Fig. 9 As shown, the first image 901 is an image taken at a first magnification and serves as a basic film; the second image 902 is an image taken at a second magnification, and the third image 903 is a transition image of an intermediate magnification. Each image (901, 902, 903) is taken by a continuous optical zoom lens and is an equal-resolution image. The size diagram only represents the shooting field of view picture effect of the corresponding actual scene presented in the image.
[0095] Then as Fig. 9As shown, the second image 902 with the largest magnification in the enhancement sequence is scaled according to the second magnification to be equal to the size of the target local area 9031, and the target local area is the area in the third image 903 that has the same object as the second image 902. The scaled second image 902 is aligned with the center of the third image 903. In this way, the image areas with the same object are aligned between the two aligned images. If all the images in the second image are the same as the images in the target local area in the third image, the second image can cover the target local area in the third image.
[0096] The scaled second image 902 corresponding to the target local area 9031 is superimposed on the third image 903 to form a combined image 904. The combined image 904 is then scaled according to the third magnification, and the scaled combined image 904 is equal in size to the target area 9011 of the first image 901, and the scaled combined image 904 is aligned with the center of the target area 9011, and the center of the target area is the center of the first image.
[0097] The scaled combined image 904 is then used to replace or cover the target area 9011 , and the scaled combined image 904 is synthesized with the first image 901 to obtain a target image 905 .
[0098] Because each frame of enhanced sample film maintains the resolution of the original camera, its resolution will be increased when the final target image is synthesized. The center of the target image maintains the original resolution, and the pixel density of the peripheral part is lower than that of the center. If the focal length of the base film is f1, the corresponding maximum focal length in the enhanced sample film is f2, and the resolution of the enhanced target image will be equivalent to f2 / f1 times. When the target image is not scaled, the resolution effect of the peripheral area in the image is equivalent to that of the basic film, but the clarity of the image details in the center is higher than that of the basic film. After the center part of the target image is partially enlarged, the middle part is the area replaced by the second image, so the clarity is higher than the image shot at the equivalent magnification, and there is no image blur after the target image is enlarged.
[0099] According to this embodiment, the image with the maximum magnification is first scaled to be equal to the size of the local area of the image with the intermediate magnification, and then scaled after forming a combined image, and the combined image is scaled as a whole to be equal to the size of the target area, and then the scaled combined image is synthesized with the first image. In this way, not only can the resolution of the two parts of the first image be enhanced, but also the object contained in the synthesized image and the first image can be ensured to be the same. Without changing the image content, the synthetic enhancement is achieved from the periphery to the middle area successively, and the local resolution of the image is improved, so that during the shooting process, the local resolution of the image finally obtained is high, and the problem of distortion when the target image is enlarged or reduced is avoided.
[0100] For example, if there are distorted areas in multiple images, such as areas with twisted edges or jagged edges, the images with distorted areas are eliminated, or the distorted areas in the images are cropped, or the distorted areas in the images are corrected and repaired using a preset algorithm to obtain images without distorted areas, which are then synthesized.
[0101] In the above embodiments, the first image is used as the base film, and the magnification is lower than that of the enhanced sample. The local resolution of the base film is optimized by the high-magnification enhanced sample. In other embodiments, the high-magnification image can be used as the base film, and the low-magnification image can be synthesized as the enhanced sample. The synthesis method is also that the high-magnification image corresponds to the target area of the low-magnification image, covers or replaces the target area of the low-magnification image, and is synthesized with the low-magnification image. In this way, the picture area of the base film can be expanded, and the middle area of the obtained target image maintains a higher resolution. After scaling, the clarity of the middle area can still be guaranteed, thereby achieving the expansion of the image picture range without reducing the original image resolution.
[0102] In order to gradually enhance the local image quality, balance the resolution of the overall image, and improve the shooting efficiency, in the embodiment of the present application, after shooting multiple images corresponding to multiple target magnifications according to multiple target magnifications, the method may further include:
[0103] An interpolation operation is performed according to the first image and the second image to obtain a third image corresponding to a third magnification of the optical zoom lens, where the third magnification is a magnification between the first magnification and the second magnification.
[0104] After obtaining the first image and the second image, an interpolation calculation can be performed according to a preset algorithm or a fitting algorithm to obtain a third image corresponding to the third magnification as an image of the intermediate magnification, so that the lens does not need to be zoomed and photographed, reducing the time consumed by hardware actions, thereby improving shooting efficiency. It should be understood that the two images used for the interpolation calculation of the third image need to be actually photographed by the optical zoom lens to ensure that the resolution of the third image is not distorted.
[0105] In an embodiment of the present application, after obtaining the third image by shooting or calculating, the second image and the third image can be used as enhanced samples and synthesized successively with the first image (basic negative) in the manner of synthesizing multiple images in the above embodiment to obtain a target image with locally enhanced image quality.
[0106] In the embodiment of the present application, during the shooting process, multiple images of the telephoto and short-focus lenses are directly shot and fused, and the near and distant views presented in the synthesized target image are both of high definition, and the visual effect is more delicate and realistic than the basic film, and a larger magnification effect is supported. The image in the magnified image is not blurred or distorted, and the image quality is high. In addition, the user operation is less during the shooting process, and the shooting is convenient and efficient.
[0107] It should be noted that the shooting method provided in the embodiment of the present application can be executed by a shooting device or a control module in the shooting device for executing the shooting method. In the embodiment of the present application, the shooting device provided in the embodiment of the present application is described by taking the shooting method executed by the shooting device as an example.
[0108] Fig.10 The structure diagram of the shooting device provided by the embodiment of the present application is shown in FIG. The device is applied to an electronic device having an optical zoom lens, such as Fig.10 As shown, the device comprises:
[0109] Receiving module 1001, used to receive shooting input from the user;
[0110] A shooting module 1002 is used to shoot a plurality of images through an optical zoom lens in response to a shooting input, wherein the plurality of images at least include a first image corresponding to a first magnification of the optical zoom lens and a second image corresponding to a second magnification of the optical zoom lens, wherein the first magnification is smaller than the second magnification;
[0111] The synthesis module 1003 is used to synthesize the target area corresponding to the second image with the first image to obtain the target image, where the target area is the area in the first image that has the same object as the second image.
[0112] The shooting input is an input used to enable the electronic device to perform a shooting operation, such as a click input on a shooting interface, a voice command input, etc.
[0113] For example, the electronic device shooting interface may display some functional controls, such as a shooting key for receiving shooting input, a button for switching between functions such as photo taking, video recording, and panoramic shooting, a control for turning on and off the flash function, and a control for allowing the user to select the optical zoom lens ratio (such as a sliding bar control), etc. The shooting interface may also include a preview area for displaying a preview image captured by the lens, etc.
[0114] For example, during the shooting process, the electronic device may configure a default lens magnification (such as 1x), or may select a variable magnification, such as 3x, through a corresponding control on the shooting interface.
[0115] After the user confirms the shooting magnification (it can be the default magnification or manually selected to change the magnification to another magnification), the optical zoom lens adjusts to the focal length position of the magnification, focuses on capturing the corresponding physical scene, and generates a corresponding clear preview image displayed in the preview area of the shooting interface.
[0116] The user can trigger the shooting operation through the above shooting input according to the preview picture displayed on the shooting interface of the electronic device.
[0117] In response to a shooting input, the electronic device shoots multiple images through an optical zoom lens, including at least a first image corresponding to a first magnification of the optical zoom lens and a second image corresponding to a second magnification of the optical zoom lens, wherein the first magnification is smaller than the second magnification.
[0118] According to the characteristics of the optical zoom lens, when the optical zoom lens is zoomed to different magnifications, the focal length is different and the field of view angle range is also different. However, the images captured by the optical zoom lens at any focal length have the same resolution. Therefore, in this embodiment, the first image and the second image have different field of view angles, but the same resolution.
[0119] In this embodiment, after the user triggers the shooting operation, the electronic device uses the optical zoom lens to shoot multiple images corresponding to multiple magnifications. Among the multiple images, one image is used as a basic negative film. In this embodiment, the image that the user wants to shoot (such as the image at 1 magnification) can be used as the basic negative film, and the remaining images can be used as enhanced samples to enhance the resolution of the local area in the basic negative film.
[0120] During the shooting process, when the shooting position and angle of the electronic device remain unchanged, in the multiple images of the same observed object shot at different magnifications through the optical zoom lens, the center of the picture content presented in each image corresponds to the same position of the actual observed object. Therefore, during the shooting process, the focus position of the object corresponding to each image is the same, and different shooting ranges (i.e., field angles) of the observed object are presented according to different magnifications. The object contained in at least a part of the area (i.e., the target area) in the low-magnification image is the same as the object contained in the global area of the high-magnification image. The object may be all objects contained in the shooting picture, such as the photographed object, foreground, background, etc.
[0121] In this way, a second image with a high magnification and a small field of view can cover or replace the target area in the first image with a low magnification and a large field of view. The resolution of the local area in the synthesized target image is higher than that of the peripheral area, thereby enhancing the resolution of the local area of the image and improving the image quality. After scaling the target image, the content of the target area on the target image can be ensured to be clear and the content is not distorted after the image is scaled.
[0122] In order to improve shooting flexibility and meet user needs, optionally, in the embodiment of the present application, a first control is provided in the shooting interface, and the first control is used to switch the shooting mode. The shooting mode includes a normal mode and an enhanced mode. In the normal mode, the user can shoot at the default magnification to obtain the corresponding image. In the enhanced mode, the user can input the shooting input to obtain images corresponding to multiple target magnifications at the enhanced level, and synthesize multiple images to obtain an enhanced image with local image quality enhancement. Specifically, the shooting module 1002 may specifically include:
[0123] A first determination submodule, for determining a zoom level of the optical zoom lens in response to a shooting input;
[0124] A second determination submodule is used to determine a plurality of target magnifications corresponding to the magnification level according to the magnification level, wherein the plurality of target magnifications include at least a first magnification and a second magnification;
[0125] The shooting submodule is used to shoot multiple images corresponding to multiple target magnifications according to multiple target magnifications.
[0126] The zoom level is the zoom level of the optical zoom lens, which is determined according to the user's enhancement level of the basic film resolution.
[0127] In this embodiment, in the process of determining multiple target magnifications corresponding to the variable magnification level, the corresponding maximum magnification can be first determined according to the variable magnification level, and then a uniform interpolation calculation is performed based on the default magnification (i.e., the basic magnification) and the maximum magnification to obtain one or more intermediate magnifications between the default magnification and the maximum magnification. After determining the target magnification, the image corresponding to each target magnification is captured by the optical zoom lens to obtain multiple images with different field of view angles.
[0128] For example, if the zoom level is small, such as the base zoom is 1 and the zoom level is 2, no intermediate zoom may be set between the base zoom and the maximum zoom. At least two images are captured at the base zoom and the maximum zoom.
[0129] In order to obtain an image with enhanced image quality, optionally, the embodiment of the present application is based on the optical zoom lens of the electronic device, and in the process of shooting multiple images corresponding to multiple target magnifications, multiple images with different magnifications can be obtained by controlling the zoom of the lens. Specifically, the shooting submodule may include:
[0130] A control unit, used for controlling the optical zoom lens to sequentially change the magnification to a plurality of target magnifications according to the order of the plurality of target magnifications;
[0131] The shooting unit is used to shoot at least one image when the optical zoom lens is zoomed to each target magnification.
[0132] In this embodiment, multiple target magnifications are sorted, and according to the size order of the multiple target magnifications (such as from small to large), the optical zoom lens is controlled to change magnification to multiple target magnifications in sequence. Exemplarily, the target magnification includes a first magnification and a second magnification, and the first magnification is less than the second magnification. In this example, the first magnification can be a default magnification (such as 1 magnification) or a magnification selected by the user (such as 3 magnifications). When the optical zoom lens is at the first magnification, it captures the first image, and then controls the optical zoom lens to change magnification to the second magnification (such as 5 magnifications) to capture the second image, so that the resolution of each image obtained is the same, and after subsequent synthesis, the local image resolution is enhanced.
[0133] Specifically, during the shooting process, after determining each target magnification, the electronic device records the focal length position of the optical zoom lens at each target magnification. First, at the smallest target magnification of the optical zoom lens, that is, the first magnification (such as 1x), the focusing operation is completed for the current scene to ensure the clarity of the captured picture and take at least one image. Then, according to the second magnification (such as 10x), the drive motor drives the lens 1 to zoom to the corresponding focal length position to take the second image. Similarly, if the target magnification also includes a third magnification between the first magnification and the second magnification, the lens is zoomed to the third magnification for shooting. The third magnification can be one or more magnifications.
[0134] In some specific examples, an interpolation calculation can be performed based on the basic magnification, the maximum magnification, and the zoom capability of the optical zoom lens to determine the intermediate magnification, so that the basic magnification, the intermediate magnification, and the maximum magnification form an enhanced sequence in ascending order, and then the focal length position corresponding to each magnification in the enhanced sequence is determined. For example, the user sets the zoom level to N, and the focal length of the basic magnification of the optical zoom lens is f Photograph The maximum focal length of this lens is f Max , then the focal length of the enhancement sequence corresponding to each target magnification can be expressed as Wherein, 1<k<N, k and N are both integers, and k represents the intermediate magnification in the enhancement sequence. After determining the focal length position corresponding to each target magnification of the enhancement sequence, the lens is controlled to change magnification in sequence, multiple images are taken, and the images are synthesized through the synthesis module to obtain the target image enhanced in the local area.
[0135] In order to facilitate users to freely select the enhancement level according to their own needs, optionally, in an embodiment of the present application, in the enhancement mode, the shooting interface can display a control (hereinafter referred to as the "second control") for the user to select the optical zoom lens zoom level, such as a sliding bar control. The zoom level is displayed through the control, and the user's input is received through the second control to determine the zoom level, and then the target magnification is determined according to the zoom level. Since the optical zoom lens can continuously zoom within the focal length range, in some examples, the target magnification corresponding to the zoom level can be an integer magnification or a non-integer magnification.
[0136] In this embodiment, according to the determined multiple target magnifications, the optical zoom lens is controlled to change the magnification to the corresponding focal length position in sequence, automatically focus, capture the picture of the observed scene, and obtain multiple images. The picture focus position in each image has a corresponding relationship, such as being at the center of the image.
[0137] According to actual needs, the image shot at the default magnification can be directly used as the basic negative film, and the images shot at other target magnifications can be directly used as enhanced samples, and the images are synthesized by the synthesis module 1003 to quickly obtain the target image. Alternatively, the user can also select the enhanced sample and the basic negative film from the multiple images (including the first image and the second image) shot, and synthesize them by the synthesis module 1003 to meet the user's personalized shooting needs.
[0138] In the process of performing image synthesis by the synthesis module 1003, the field of view of the image can be sorted, such as from large to small. According to the order of the field of view of the image, the above-mentioned multiple images are successively superimposed and synthesized. In an optional example, the high-magnification image can be scaled to a size smaller than the low-magnification image, and then the scaled high-magnification image is superimposed on the low-magnification image for synthesis according to the correspondence of the objects contained in each image, so that the local area resolution of the synthesized image is enhanced, and the screen content presented by the original image (low-magnification image) is not changed. In other optional examples, the low-magnification image can also be enlarged to a size larger than the high-magnification image, and then the high-magnification image is superimposed on the enlarged low-magnification image for synthesis according to the correspondence of the objects contained in each image, so that the local area resolution of the synthesized image can also be enhanced, and the screen content presented by the original image (low-magnification image) is not changed.
[0139] Exemplarily, the synthesis module 1003 may specifically include:
[0140] A first stacking submodule, used for stacking the first image and the second image in order of corresponding field angles;
[0141] The first scaling submodule is used to scale the second image according to the corresponding second magnification, so that the scaled second image is equal to the size of the target area, and the center of the scaled second image is aligned with the center of the target area, and the center of the target area is the center of the first image.
[0142] A first covering submodule is used to replace or cover the target area with the scaled second image;
[0143] The first synthesis submodule is used to synthesize the scaled second image with the first image to obtain a target image.
[0144] Because when the shooting position and angle remain unchanged, the optical zoom lens performs axial movement when changing magnifications, and the focal position of the lens remains unchanged, the object contained in the global area of a high-magnification image is the same as the object contained in a certain area in the middle of another low-magnification image.
[0145] Therefore, based on the correspondence between the objects in the images, the second image is scaled according to the corresponding second magnification. Because the object contained in the target area in the first image is the same as the object contained in the second image, it means that the field of view corresponding to the target area is actually the same as that of the second image, and the second image is shot by controlling the lens to change the magnification to the second magnification based on the first magnification, so the second image scaled according to the second magnification is equal to the size of the target area. The center of the scaled second image is aligned with the center of the target area, and when the scaled second image is superimposed on the first image, it can cover the target area.
[0146] The scaled second image is aligned with the center of the target area and is equal in size. After the scaled second image replaces or covers the target area, the scaled second image is synthesized with the first image to obtain the target image. The object contained in the first image does not change, but after the original target area is replaced by the second image, the pixel density of the local area increases and the resolution is enhanced. In this way, when the target image is enlarged or reduced, the central area of the target area can also maintain good clarity.
[0147] In this example, if the focal length corresponding to the first image is f1 and the focal length corresponding to the second image is f2, the resolution of the target image can be equivalently magnified by f2 / f1 times.
[0148] Optionally, the device may further include:
[0149] The correction module is used to crop and / or correct the distorted area in the second image when the second image has the distorted area.
[0150] In the case where the second image has a distorted area, such as distortion, jaggedness, etc. at the edge of the image, the distorted area of the second image can be cropped, or the distorted area can be corrected and repaired using a preset algorithm and then synthesized to ensure that the splicing position of the first image and the second image after synthesis is complete.
[0151] In other examples, during the image synthesis process, the synthesis module 1003 may also align and superimpose the first image and the second image in the order of the field of view angle, and then magnify the first image according to the second magnification so that the size of the target area is equal to that of the second image. Then, the target area of the enlarged first image is covered or replaced, and the second image is synthesized with the enlarged first image to obtain the target image.
[0152] In order to gradually enhance the local image quality of the image and balance the resolution of the overall image, optionally, in an embodiment of the present application, the multiple images include a first image, a second image, and a third image, and the third image is an image corresponding to the third magnification of the optical zoom lens, and the third magnification is between the first magnification and the second magnification. In some examples, the third magnification can be one of the above-mentioned target magnifications, and the third image is an image captured by the shooting submodule. In other examples, the third image can be an image obtained by interpolating the second image and the first image, so the magnification of the third image is between the first magnification and the second magnification.
[0153] Exemplarily, the third magnification, as an intermediate magnification, may be one magnification or multiple magnifications. Correspondingly, the third image, as an image of an intermediate magnification, may be one image or multiple images.
[0154] In some examples, the synthesis module 1003 may specifically include:
[0155] A second stacking submodule, used for stacking the first image, the third image and the second image in order of corresponding field angles;
[0156] A second scaling submodule is used to scale the second image according to a second magnification, so that the scaled second image is equal in size to the target local area and is aligned with the center of the third image, and the target local area is an area in the third image that has the same object as the second image;
[0157] forming a submodule, for superimposing the scaled second image on the third image to form a combined image;
[0158] A third scaling submodule is used to scale the combined image according to a third magnification, so that the scaled combined image is equal in size to the target area and is aligned with the center of the target area, and the center of the target area is the center of the first image;
[0159] A second covering submodule is used to replace or cover the target area using the combined image;
[0160] The second synthesis submodule is used to synthesize the combined image and the first image to obtain a target image.
[0161] Because each frame of enhanced sample film maintains the resolution of the original camera, its resolution will be increased when the final target image is synthesized. The center of the target image maintains the original resolution, and the pixel density of the peripheral part is lower than that of the center. If the focal length of the base film is f1, the corresponding maximum focal length in the enhanced sample film is f2, and the resolution of the enhanced target image will be equivalent to f2 / f1 times. When the target image is not scaled, the resolution effect of the peripheral area in the image is equivalent to that of the basic film, but the clarity of the image details in the center is higher than that of the basic film. After the center part of the target image is partially enlarged, the middle part is the area replaced by the second image, so the clarity is higher than the image shot at the equivalent magnification, and there is no image blur after the target image is enlarged.
[0162] According to this embodiment, the image with the maximum magnification is first scaled to be equal to the size of the local area of the image with the intermediate magnification, and then scaled after forming a combined image, and the combined image is scaled as a whole to be equal to the size of the target area, and then the scaled combined image is synthesized with the first image. In this way, not only can the resolution of the two parts of the first image be enhanced, but also the object contained in the synthesized image and the first image can be ensured to be the same. Without changing the image content, the synthetic enhancement is achieved from the periphery to the middle area successively, and the local resolution of the image is improved, so that during the shooting process, the local resolution of the image finally obtained is high, and the problem of distortion when the target image is enlarged or reduced is avoided.
[0163] In the above embodiments, the first image is used as the base film, and the magnification is lower than that of the enhanced sample. The local resolution of the base film is optimized by the high-magnification enhanced sample. In other embodiments, the high-magnification image can be used as the base film, and the low-magnification image can be synthesized as the enhanced sample. The synthesis method is also that the high-magnification image corresponds to the target area of the low-magnification image, covers or replaces the target area of the low-magnification image, and is synthesized with the low-magnification image. In this way, the picture area of the base film can be expanded, and the middle area of the obtained target image maintains a higher resolution. After scaling, the clarity of the middle area can still be guaranteed, thereby achieving the expansion of the image picture range without reducing the original image resolution.
[0164] In order to gradually enhance the local image quality, balance the resolution of the overall image, and improve the shooting efficiency, the device in the embodiment of the present application may further include:
[0165] The operation module is used to perform interpolation operation according to the first image and the second image to obtain a third image corresponding to a third magnification of the optical zoom lens, where the third magnification is a magnification between the first magnification and the second magnification.
[0166] After obtaining the first image and the second image, an interpolation calculation can be performed according to a preset algorithm or a fitting algorithm to obtain a third image corresponding to the third magnification as an image of the intermediate magnification, so that the lens does not need to be zoomed and photographed, reducing the time consumed by hardware actions, thereby improving shooting efficiency. It should be understood that the two images used for the interpolation calculation of the third image need to be actually photographed by the optical zoom lens to ensure that the resolution of the third image is not distorted.
[0167] In an embodiment of the present application, after obtaining the third image by shooting or calculating, the second image and the third image can be used as enhanced samples and synthesized successively with the first image (basic negative) in the manner of synthesizing multiple images in the above embodiment to obtain a target image with locally enhanced image quality.
[0168] In the embodiment of the present application, during the shooting process, multiple images of the telephoto and short-focus lenses are directly shot and fused, and the near and distant views presented in the synthesized target image are both of high definition, and the visual effect is more delicate and realistic than the basic film, and a larger magnification effect is supported. The image in the magnified image is not blurred or distorted, and the image quality is high. In addition, the user operation is less during the shooting process, and the shooting is convenient and efficient.
[0169] The photographing device in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, the mobile electronic device can 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. The non-mobile electronic device can 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 embodiment of the present application.
[0170] The shooting 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.
[0171] The shooting device provided in the embodiment of the present application can achieve Figures 1 to 9 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0172] Alternatively, if Fig.11 As shown, an embodiment of the present application also provides an electronic device 1100, including a processor 1101, a memory 1102, and a program or instruction stored in the memory 1102 and executable on the processor 1101. When the program or instruction is executed by the processor 1101, each process of the above-mentioned shooting method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0173] 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.
[0174] Fig.12 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0175] The electronic device 1200 includes but is not limited to: a radio frequency unit 1201, a network module 1202, an audio output unit 1203, an input unit 1204, a sensor 105, a display unit 1206, a user input unit 1207, an interface unit 1208, a memory 1209, and a processor 1210 and other components.
[0176] Those skilled in the art will appreciate that the electronic device 1200 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 1210 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Fig.12 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0177] The input unit 1204 may include a camera and a graphics processor, and the camera includes an optical zoom lens;
[0178] The user input unit 1207 is used to receive the user's shooting input;
[0179] an input unit 1204, configured to capture a plurality of images through the optical zoom lens in response to the capture input, wherein the plurality of images at least include a first image corresponding to a first magnification of the optical zoom lens and a second image corresponding to a second magnification of the optical zoom lens, wherein the first magnification is smaller than the second magnification;
[0180] The input unit 1204 is further configured to synthesize the target area corresponding to the second image with the first image through a graphics processor to obtain a target image, where the target area is an area in the first image having the same object as that in the second image.
[0181] Since during the shooting process, when the shooting position and angle of the electronic device remain unchanged, in the multiple images of the same observed object shot at different magnifications by the optical zoom lens, the center of the picture content presented in each image corresponds to the same position of the actual observed object. Therefore, during the shooting process, the focus position of the object corresponding to each image is the same, and different shooting ranges (i.e., field angles) of the observed object are presented according to different magnifications. The object in at least a part of the area (i.e., the target area) in the low-magnification image is the same as the object in the global area of the high-magnification image, and the object can be all objects contained in the shooting picture, such as the photographed object, foreground, background, etc.
[0182] In this way, a second image with a high magnification and a small field of view can cover or replace the target area in the first image with a low magnification and a large field of view. The resolution of the local area in the synthesized target image is higher than that of the peripheral area, thereby enhancing the resolution of the local area of the image and improving the image quality. After scaling the target image, the content of the target area on the target image can be ensured to be clear and the content is not distorted after the image is scaled.
[0183] In order to obtain an image with enhanced image quality, optionally, the processor 1210 is configured to:
[0184] In response to a capture input, determining a zoom level of the optical zoom lens;
[0185] According to the zoom level, determining a plurality of target magnifications corresponding to the zoom level, the plurality of target magnifications including at least a first magnification and a second magnification;
[0186] The input unit 1204 may be specifically configured to: capture multiple images corresponding to multiple target magnifications according to multiple target magnifications.
[0187] Exemplarily, the first magnification may be a default magnification or a magnification selected by a user. The first image is captured, and then the optical zoom lens is controlled to zoom to the second magnification to capture the second image, so that each image obtained has the same resolution, and local image enhancement is achieved after subsequent synthesis.
[0188] Optionally, the processor 1210 may be specifically configured to:
[0189] According to the order of the multiple target magnifications, the optical zoom lens is controlled to change the magnification to the multiple target magnifications in sequence;
[0190] The input unit 1204 may be specifically configured to capture at least one image when the optical zoom lens is zoomed to each target magnification.
[0191] In this embodiment, multiple target magnifications are sorted, and according to the size order of the multiple target magnifications (such as from small to large), the optical zoom lens is controlled to change magnification to multiple target magnifications in sequence. Exemplarily, the target magnification includes a first magnification and a second magnification, and the first magnification is less than the second magnification. In this example, the first magnification can be a default magnification (such as 1 magnification) or a magnification selected by the user (such as 3 magnifications). When the optical zoom lens is at the first magnification, it captures the first image, and then controls the optical zoom lens to change magnification to the second magnification (such as 5 magnifications) to capture the second image, so that the resolution of each image obtained is the same, and after subsequent synthesis, the local image resolution is enhanced.
[0192] Optionally, the input unit 1204 may also be specifically configured through a graphics processor to:
[0193] The first image and the second image are stacked in order of corresponding viewing angles;
[0194] Scaling the second image according to the corresponding second magnification, so that the scaled second image is equal to the size of the target area, and the center of the scaled second image is aligned with the center of the target area, and the center of the target area is the center of the first image;
[0195] Using the scaled second image to replace or cover the target area;
[0196] The scaled second image is synthesized with the first image to obtain a target image.
[0197] The center of the scaled second image is aligned with the center of the target area, and when the scaled second image is superimposed on the first image, the target area can be covered. The scaled second image is aligned with the center of the target area and has the same size, so after the scaled second image replaces or covers the target area, the scaled second image is synthesized with the first image to obtain the target image without changing the object contained in the first image, but after the original target area is replaced by the second image, the pixel density of the local area increases and the resolution is enhanced, so that when the target image is enlarged or reduced, the central area of the target area can also maintain good clarity.
[0198] In this way, if the focal length corresponding to the first image is f1 and the focal length corresponding to the second image is f2, the resolution of the target image can be equivalently magnified by f2 / f1 times.
[0199] Optionally, the input unit 1204 may also be specifically configured through a graphics processor to:
[0200] In the case where the second image has a distorted region, the distorted region in the second image is cropped and / or corrected.
[0201] In other examples, during the image synthesis process, the first image and the second image may be aligned and superimposed in the order of the field of view angle, and then the first image may be magnified at the second magnification so that the size of the target area is equal to that of the second image. Then, the target area of the magnified first image is covered or replaced, and the second image is synthesized with the magnified first image to obtain the target image.
[0202] Optionally, when the plurality of images include the third image, the input unit 1204 may further be configured to:
[0203] The first image, the third image and the second image are stacked in order according to the corresponding viewing angles;
[0204] The second image is scaled according to a second magnification, so that the scaled second image is equal in size to the target local area and is aligned with the center of the third image, and the target local area is an area in the third image that has the same object as the second image;
[0205] superimposing the scaled second image on the third image to form a combined image;
[0206] Scaling the combined image according to a third magnification, so that the scaled combined image is equal in size to the target area and aligned with the center of the target area, and the center of the target area is the center of the first image;
[0207] Using the combined image to replace or cover the target area;
[0208] The combined image is synthesized with the first image to obtain a target image.
[0209] According to this embodiment, the image with the maximum magnification is first scaled to be equal to the size of the local area of the image with the intermediate magnification, and then scaled after forming a combined image, and the combined image is scaled as a whole to be equal to the size of the target area, and then the scaled combined image is synthesized with the first image. In this way, not only can the resolution of the two parts of the first image be enhanced, but also the object contained in the synthesized image and the first image can be ensured to be the same. Without changing the image content, the synthetic enhancement is achieved from the periphery to the middle area successively, and the local resolution of the image is improved, so that during the shooting process, the local resolution of the image finally obtained is high, and the problem of distortion when the target image is enlarged or reduced is avoided.
[0210] It should be understood that in the embodiment of the present application, the input unit 1204 may include a graphics processor (Graphics Processing Unit, GPU) 12041 and a microphone, and the graphics processor 12041 processes the image data of the static picture or video obtained by the image capture device (such as camera 12042) in the video capture mode or the image capture mode. The display unit 1206 may include a display panel 12061, and the display panel 12061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 1207 includes a touch panel 12071 and other input devices 12072. The touch panel 12071 is also called a touch screen. The touch panel 12071 may include two parts: a touch detection device and a touch controller. Other input devices 12072 may include, but are not limited to, a physical keyboard, a function key (such as a volume control button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here. The memory 1209 can be used to store software programs and various data, including but not limited to applications and operating systems. The processor 1210 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 1210.
[0211] 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 shooting method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0212] 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.
[0213] 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 shooting method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0214] Furthermore, an embodiment of the present application further provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the various processes of the above-mentioned shooting method embodiment.
[0215] 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.
[0216] 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.
[0217] 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 computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0218] 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. A shooting method, applied to an electronic device, wherein the electronic device includes an optical zoom lens, characterized in that: The method comprises: Receive user's shooting input; In response to the shooting input, a plurality of images are shot through the optical zoom lens, wherein the plurality of images at least include a first image corresponding to a first magnification of the optical zoom lens and a second image corresponding to a second magnification of the optical zoom lens, wherein the first magnification is smaller than the second magnification; The target area corresponding to the second image is synthesized with the first image to obtain a target image, wherein the target area is an area in the first image having the same object as the second image; The plurality of images further include a third image corresponding to a third magnification, wherein the third magnification is a magnification between the first magnification and the second magnification; and synthesizing the second image corresponding to the target area with the first image to obtain the target image includes: stacking the first image, the third image and the second image in order of corresponding viewing angles; Scaling the second image at a second magnification, so that the scaled second image is equal in size to the target local area and is aligned with the center of the third image, and the target local area is an area in the third image that has the same object as the second image; superimposing the scaled second image on the third image to form a combined image; Scaling the combined image according to a third magnification, wherein the scaled combined image is equal in size to the target area and aligned with the center of the target area, and the center of the target area is the center of the first image; Using the scaled combined image to replace or cover the target area; The scaled combined image is synthesized with the first image to obtain the target image.
2. The method according to claim 1, characterized in that The method of capturing a plurality of images by using the optical zoom lens in response to the capturing input comprises: In response to the shooting input, determining a zoom level of the optical zoom lens; According to the zoom level, determining a plurality of target magnifications corresponding to the zoom level, the plurality of target magnifications including at least the first magnification and the second magnification; According to the plurality of target magnifications, the plurality of images corresponding to the plurality of target magnifications are captured.
3. The method according to claim 2, characterized in that The step of photographing the plurality of images corresponding to the plurality of target magnifications according to the plurality of target magnifications comprises: According to the order of the multiple target magnifications, controlling the optical zoom lens to sequentially change the magnification to the multiple target magnifications; When the optical zoom lens is zoomed to each target magnification, at least one image is captured.
4. The method according to claim 1, characterized in that: Before stacking the first image, the third image, and the second image in order of corresponding viewing angles, the method includes: In the case where the second image has a distorted area, the distorted area in the second image is cropped and / or corrected.
5. The method according to claim 2, characterized in that: After photographing the plurality of images corresponding to the plurality of target magnifications according to the plurality of target magnifications, the method further includes: An interpolation operation is performed according to the first image and the second image to obtain a third image corresponding to a third magnification of the optical zoom lens, where the third magnification is a magnification between the first magnification and the second magnification.
6. A photographing device, applied to an electronic device, wherein the electronic device includes an optical zoom lens, characterized in that: The device comprises: A receiving module, used for receiving a user's shooting input; a photographing module, configured to photograph a plurality of images through the optical zoom lens in response to the photographing input, wherein the plurality of images at least include a first image corresponding to a first magnification of the optical zoom lens and a second image corresponding to a second magnification of the optical zoom lens, wherein the first magnification is smaller than the second magnification; A synthesis module, used for synthesizing a target area corresponding to the second image with the first image to obtain a target image, wherein the target area is an area in the first image having the same object as the second image; The synthesis module specifically includes: A second stacking submodule, used for stacking the first image, the third image and the second image in order of corresponding field angles; A second scaling submodule is used to scale the second image according to a second magnification, so that the scaled second image is equal in size to the target local area and is aligned with the center of the third image, and the target local area is an area in the third image that has the same object as the second image; forming a submodule, for superimposing the scaled second image on the third image to form a combined image; A third scaling submodule is used to scale the combined image according to a third magnification, so that the scaled combined image is equal in size to the target area and is aligned with the center of the target area, and the center of the target area is the center of the first image; A second covering submodule is used to replace or cover the target area using the combined image; The second synthesis submodule is used to synthesize the combined image and the first image to obtain a target image.
7. An electronic device, characterized in that: The method comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the shooting method as described in any one of claims 1 to 5.
8. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the shooting method according to any one of claims 1 to 5 are implemented.
