Photographing method, electronic device and computer readable storage medium
By adjusting the focal length of the focus lens group and the rotation angle of the lens in the camera module, the problem of the smaller field of view and the focus is not on the same plane during telephoto shooting, and high-definition large field of view image stitching is achieved.
Patent Information
- Application Number
- CN202310884605.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-18
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2043-07-18
AI Technical Summary
During telephoto shooting, the camera's field of view angle becomes smaller, resulting in a decrease in shooting range. Since the focus is not on the same plane, the image of the edge field of view is not clear, which affects the clarity of the photo after stitching.
By obtaining the distance between the photographing object and the camera module, the corresponding shooting parameters are determined, including the target focal length and the target angle, the first adjustment mechanism is used to adjust the focal length of the focus lens group, and the second adjustment mechanism is used to adjust the rotation angle of the lens to ensure that the rotation angle of the lens and the focal length of the focus lens group meet the target parameters each time the shooting is taken, thereby shooting a clear sub-image.
The clarity of each sub-image is improved, and the clarity of the large field of view images after stitching is solved, the problem of unclear edge parts is shortened, and the focus time is shortened and shooting efficiency is improved.
Smart Images

Figure CN117714832B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of photography technology, and more particularly to a photography method, electronic device, and computer-readable storage medium. Background Technology
[0002] During telephoto shooting, the higher the zoom ratio, the smaller the field of view, and the smaller the range of objects that can be captured. To increase the shooting range, the camera can be rotated during shooting to capture multiple fields of view, and then the images from these multiple fields of view are stitched together to obtain an image with a large field of view. However, because the camera rotates, the focal points of the central field of view and the peripheral field of view are not on the same plane, resulting in blurry images of the peripheral fields of view, which in turn leads to blurry edges in the stitched image. Summary of the Invention
[0003] This application provides a photographing method, an electronic device, and a computer-readable storage medium, which solves the problem of unclear edge parts in large field-of-view images obtained by stitching together in the prior art.
[0004] To achieve the above objectives, this application adopts the following technical solution:
[0005] Firstly, a method for taking photos is provided, applied to an electronic device, the electronic device including a camera module, the camera module including a focusing lens group, a lens, a first adjustment mechanism, and a second adjustment mechanism, the method including:
[0006] Obtain the first distance between the subject being photographed and the camera module;
[0007] Determine N sets of shooting parameters corresponding to the first distance, where each set of shooting parameters includes the target focal length and the target angle, and N represents a positive integer;
[0008] The first adjustment mechanism is controlled to adjust the focal length of the focusing lens group, and the second adjustment mechanism is controlled to adjust the rotation angle of the lens. When the focal length of the focusing lens group is the k-th target focal length and the rotation angle of the lens is the k-th target angle, a sub-image is captured. When the rotation angle of the lens is the k-th target angle, the field of view of the camera module is the k-th field of view, and the k-th target focal length is the shooting focal length corresponding to the k-th field of view, k = 1, 2, 3...N.
[0009] The N sub-images are stitched together to obtain the image of the photographed object.
[0010] In the above embodiments, after determining the first distance between the subject and the camera module, the target focal length and target angle corresponding to the first distance are determined. Through the first and second adjustment mechanisms, the rotation angle of the lens is sequentially adjusted to the target angle, thereby making the field of view of the camera module the respective field of view. Simultaneously, the focal length of the focusing lens group is adjusted to the target focal length. Sub-images are obtained by taking pictures in each field of view. Since the target focal length is the shooting focal length of the corresponding field of view, the sharpness of each sub-image can be guaranteed, thereby improving the sharpness of the stitched image. Furthermore, because the electronic device first determines the target focal length and then adjusts the focal length of the focusing lens group to the target focal length, focusing can be completed in a shorter time, resulting in a sharper image without increasing the image capture time.
[0011] In one embodiment, determining the N sets of shooting parameters corresponding to the first distance includes:
[0012] Based on the calibration data stored in the electronic device, N sets of shooting parameters corresponding to the first distance are determined. By pre-storing the calibration data, the target focal length and target angle can be directly read, thereby directly adjusting the focal length of the focusing lens group to the first focal length and the rotation angle of the lens to the first angle, thus enabling focusing of the focusing lens group to be completed in a short time. Therefore, focusing can be achieved during continuous shooting of sub-images, ensuring the sharpness of the captured sub-images.
[0013] In one embodiment, before obtaining the first distance between the subject and the camera module, the method further includes:
[0014] Multiple sets of reference parameters are obtained. Each set of reference parameters includes a reference distance and multiple sets of correction parameters corresponding to the reference distance. Each set of correction parameters includes a reference angle and a reference focal length. The reference distance is the distance between the reference object and the camera module, and each reference angle corresponds to a field of view of the camera module. The calibration data is determined based on the multiple sets of reference parameters. Determining the calibration data by fitting multiple sets of reference parameters can improve the accuracy of the calibration data.
[0015] In one embodiment, the reference object is divided into multiple regions of equal size, and the reference angle is determined based on the location of each region. By equally dividing the reference object, the rotation angle of the lens can be controlled to change uniformly, improving the accuracy of the obtained calibration data.
[0016] In one embodiment, determining the calibration data based on multiple sets of reference parameters includes: determining the relationship between distance and angle, and the relationship between distance and focal length, based on the multiple sets of reference parameters; and determining the calibration data based on the relationship between distance and angle and the relationship between distance and focal length. By determining the calibration data through formula fitting, calibration data can be obtained under various fields of view and distance conditions, thus adapting to different shooting scenarios during subsequent image capture.
[0017] In one embodiment, controlling the first adjustment mechanism to adjust the focal length of the focusing lens group and controlling the second adjustment mechanism to adjust the rotation angle of the lens, and capturing a sub-image when the focal length of the focusing lens group is the k-th target focal length and the rotation angle of the lens is the k-th target angle, includes:
[0018] During the process of capturing the kth sub-image, the focal length and angle of the (k+1)th target are read.
[0019] After the kth sub-image is captured, the first adjustment mechanism is controlled to adjust the focal length of the focusing lens group, and the second adjustment mechanism is controlled to adjust the rotation angle of the lens, so that the focal length of the focusing lens group is the (k+1)th target focal length, and the rotation angle of the lens is the (k+1)th target angle.
[0020] Capture the (k+1)th sub-image.
[0021] In the above embodiments, by reading data during the capture of the previous sub-image and adjusting the rotation angle of the lens and the focal length of the focusing lens group within the inter-frame interval between two adjacent frames, the inter-frame interval of sub-image processing can be fully utilized to achieve angle and focal length adjustment, thereby improving the stability of the captured sub-image.
[0022] In one embodiment, controlling the first adjustment mechanism to adjust the focal length of the focusing lens group and controlling the second adjustment mechanism to adjust the rotation angle of the lens, and capturing a sub-image when the focal length of the focusing lens group is the k-th target focal length and the rotation angle of the lens is the k-th target angle, includes:
[0023] Determine the order of the N sets of shooting parameters based on the current rotation angle of the lens and / or the shooting scene;
[0024] According to the arrangement order, the first adjustment mechanism is controlled to adjust the focal length of the focusing lens group, and the second adjustment mechanism is controlled to adjust the rotation angle of the lens. When the focal length of the focusing lens group is the k-th target focal length and the rotation angle of the lens is the k-th target angle, a sub-image is captured.
[0025] In the above embodiments, by determining the order of the shooting parameters, the lens can be rotated in a preset rotation direction, or the focusing lens group can be focused in a preset adjustment direction, which can reduce the adjustment range of the lens and the focusing lens group each time and improve the stability of the sub-image shooting process.
[0026] In one embodiment, determining the N sets of shooting parameters corresponding to the first distance includes:
[0027] Obtain the first number of the sub-images;
[0028] Determine N sets of shooting parameters corresponding to the first distance and the first quantity.
[0029] In the above embodiments, determining the shooting parameters corresponding to the first distance and the first quantity can meet different shooting needs, thereby improving the user experience.
[0030] Secondly, a photographing device is provided for use in an electronic device, the electronic device including a camera module, the camera module including a focusing lens group, a lens, a first adjustment mechanism, and a second adjustment mechanism, the device comprising:
[0031] The acquisition module is used to acquire the first distance between the subject being photographed and the camera module;
[0032] The determining module is used to determine N sets of shooting parameters corresponding to the first distance, each set of shooting parameters including the target focal length and the target angle, where N represents a positive integer;
[0033] The control module is used to control the first adjustment mechanism to adjust the focal length of the focusing lens group and to control the second adjustment mechanism to adjust the rotation angle of the lens. When the focal length of the focusing lens group is the k-th target focal length and the rotation angle of the lens is the k-th target angle, a sub-image is captured. When the rotation angle of the lens is the k-th target angle, the field of view of the camera module is the k-th field of view, and the k-th target focal length is the shooting focal length corresponding to the k-th field of view, k = 1, 2, 3...N.
[0034] The stitching module is used to stitch together N sub-images to obtain an image of the photographed object.
[0035] In one embodiment, the determining module is specifically used for:
[0036] Based on the calibration data stored in the electronic device, N sets of shooting parameters corresponding to the first distance are determined.
[0037] In one embodiment, the determining module is further configured to:
[0038] Multiple sets of reference parameters are obtained. Each set of reference parameters includes a reference distance and multiple sets of correction parameters corresponding to the reference distance. Each set of correction parameters includes a reference angle and a reference focal length. The reference distance is the distance between the reference object and the camera module. Each reference angle corresponds to a field of view of the camera module.
[0039] The calibration data is determined based on multiple sets of reference parameters.
[0040] In one embodiment, the reference object is divided into multiple regions of the same size, and the reference angle is determined based on the location of each region.
[0041] In one embodiment, the determining module is further configured to:
[0042] The relationship between distance and angle, and the relationship between distance and focal length, are determined based on multiple sets of reference parameters.
[0043] The calibration data is determined based on the relationship between distance and angle, and the relationship between distance and focal length.
[0044] In one embodiment, the control module is specifically used for:
[0045] During the process of capturing the kth sub-image, the focal length and angle of the (k+1)th target are read.
[0046] After the kth sub-image is captured, the first adjustment mechanism is controlled to adjust the focal length of the focusing lens group, and the second adjustment mechanism is controlled to adjust the angle of the lens, so that the focal length of the focusing lens group is the (k+1)th target focal length, and the rotation angle of the lens is the (k+1)th target angle.
[0047] Capture the (k+1)th sub-image.
[0048] In one embodiment, the control module is specifically used for:
[0049] Determine the order of the N sets of shooting parameters based on the current rotation angle of the lens and / or the shooting scene;
[0050] According to the arrangement order, the first adjustment mechanism is controlled to adjust the focal length of the focusing lens group, and the second adjustment mechanism is controlled to adjust the rotation angle of the lens. When the focal length of the focusing lens group is the k-th target focal length and the rotation angle of the lens is the k-th target angle, a sub-image is captured.
[0051] In one embodiment, the control module is specifically used for:
[0052] Obtain the first number of the sub-images;
[0053] Determine N sets of shooting parameters corresponding to the first distance and the first quantity.
[0054] Thirdly, an electronic device is provided, including a processor for executing a computer program stored in a memory to implement the photographing method as described in the first aspect above.
[0055] Fourthly, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program, which, when executed by a processor, implements the photographing method as described in the first aspect above.
[0056] Fifthly, a chip is provided, the chip including a processor and a memory coupled together, the processor executing a computer program or instructions stored in the memory to implement the photographing method as described in the first aspect above.
[0057] Sixthly, a computer program product is provided that, when run on an electronic device, causes the electronic device to perform the photographing method described in the first aspect.
[0058] It is understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0059] Figure 1 A schematic diagram illustrating the principle of capturing wide-field-of-view images provided in an embodiment of this application;
[0060] Figure 2 This application provides an embodiment of an image obtained by taking pictures of various fields of view in a given scenario.
[0061] Figure 3 This application provides a large field-of-view image obtained by stitching together images in a given scene.
[0062] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0063] Figure 5 A schematic diagram illustrating the principle of lens rotation provided in an embodiment of this application;
[0064] Figure 6 A flowchart illustrating a photographing method provided in an embodiment of this application;
[0065] Figure 7 A schematic diagram of a reference object in a scenario provided by an embodiment of this application;
[0066] Figure 8 A schematic diagram illustrating a calibration method in a given scenario, as provided in an embodiment of this application;
[0067] Figure 9 This is a schematic diagram illustrating a data recording method in a given scenario, as provided in an embodiment of this application.
[0068] Figure 10 This application provides a scene diagram of capturing two adjacent frames of images according to an embodiment of the present application;
[0069] Figure 11 This is a software architecture diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0070] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0071] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of a described feature, integral, step, operation, element, and / or component, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof. It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0072] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrases "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."
[0073] To address the issue of a limited field of view when shooting with a telephoto lens, image stitching can be used to obtain a larger field of view. Specifically, the camera is rotated to capture multiple images with different fields of view, which are then stitched together to create the larger field of view image. However, the focal length varies depending on the camera's rotation angle. Using the same focal length for all fields of view can result in poor sharpness at the edges, thus affecting the overall sharpness of the stitched image.
[0074] Meanwhile, when the camera captures images of each field of view in sequence, the time interval between two adjacent frames is short, for example, the time interval is generally 5 to 10 ms. It is impossible to complete the focusing during the shooting process. Therefore, it is impossible to improve the clarity of the stitched image by adjusting the focus during the shooting process.
[0075] For example, such as Figure 1 As shown, in order for camera 11 to capture images with a large field of view, the electronic device needs to first control the camera to capture images of different fields of view, each field of view corresponding to a part of the object 12. The object is divided into multiple regions 13, with each field of view corresponding to one region 13. The images captured by the camera when its field of view is different for each region 13 are the images of each region 13. Based on the position of the object 12 (i.e., the object distance) and the field of view of camera 11, the position of the focus point of camera 11 after focusing for each field of view can be determined.
[0076] like Figure 1 As shown, when the object distance is the first set value, the focal points of the cameras 11 corresponding to each field of view form the first curved surface 14. When the object distance is the second set value, the focal points of the cameras 11 corresponding to each field of view form the second curved surface 15. It can be seen that the focal points of different fields of view of the cameras are not on the same plane. Therefore, using the same focal length to sequentially photograph multiple sub-objects will result in some sub-objects being photographed when the cameras 11 are not in focus, leading to low sharpness of the obtained sub-objects. Especially in close-up shooting scenarios, the curvature of the camera's focal plane (i.e., the curved surface formed by the focal points corresponding to each field of view) is greater, and the depth of focus is smaller. After focusing, even a small change in the field of view will cause a significant change in image sharpness. If focusing is not performed after adjusting the camera's field of view, the sharpness of the captured image will be even worse, and the quality of the stitched image will also be even worse.
[0077] For example, such as Figure 2 As shown, with the electronic device stationary, the camera is rotated to take sequential photos of the subject, resulting in images numbered 1-25. These 25 images correspond to 25 regions of the subject, arranged in a 5x5 grid, with each image representing a field of view. After capturing the images, the 25 images are stitched together to obtain the result shown below. Figure 3 The image shown is a stitched image. Because the camera did not focus when taking pictures of the edge of the subject, the image at the edge was not clear, resulting in low clarity and distortion of the edge parts of the stitched image. Therefore, after obtaining the stitched image, it is necessary to crop the image to obtain a usable image, which reduces the field of view of the stitched image and requires a large amount of computation.
[0078] Therefore, this application provides a photographing method. First, the target focal length and target angle of each group are determined based on a first distance from the subject. Then, the focal length of the focusing lens group is adjusted by a first adjustment mechanism, and the rotation angle of the lens is adjusted by a second adjustment mechanism. Sub-images are captured when the rotation angle of the lens is the target angle and the focusing lens group is at the target focal length. Since the first adjustment mechanism can directly adjust the focal length of the focusing lens group to the target focal length, the focusing time is short, and focusing can be completed during the capture of sub-images. Because the rotation angle of the lens corresponds to the field of view of the camera module, and the target focal length is the shooting focal length under the corresponding field of view, each sub-image is captured when focusing is complete, improving the clarity of each sub-image. Then, the sub-images are stitched together to obtain a high-resolution image.
[0079] The following is an exemplary description of the photographing method provided in this application.
[0080] The photographing method provided in this application is applied to electronic devices, which can be mobile phones, tablets, handheld computers, personal digital assistants (PDAs), augmented reality (AR) / virtual reality (VR) devices, media players, wearable devices, and other devices that can be held / operated with one hand. This application does not impose any special limitations on the specific form / type of the electronic device. The aforementioned electronic devices include, but are not limited to, those equipped with… Devices running Harmony OS or other operating systems.
[0081] Figure 4 A schematic diagram of the structure of the electronic device 100 is shown.
[0082] Electronic device 100 may include processor 110, external memory interface 120, internal memory 121, universal serial bus (USB) interface 130, charging management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0083] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0084] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.
[0085] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.
[0086] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0087] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0088] It is understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0089] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.
[0090] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0091] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.
[0092] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0093] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.
[0094] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.
[0095] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP can perform Fourier transforms on the frequency energy.
[0096] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0097] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.
[0098] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0099] Internal memory 121 can be used to store computer executable program code, which includes instructions. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 110 executes various functional applications and data processing of electronic device 100 by running instructions stored in internal memory 121 and / or instructions stored in memory located in the processor.
[0100] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.
[0101] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be disposed on display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the intensity of the touch operation based on pressure sensor 180A. Electronic device 100 can also calculate the touch position based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example, when a touch operation with an intensity less than a first pressure threshold is applied to the SMS application icon, a command to view an SMS is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the SMS application icon, a command to create a new SMS is executed.
[0102] The gyroscope sensor 180B can be used to determine the motion attitude of the electronic device 100. In some embodiments, the gyroscope sensor 180B can determine the angular velocity of the electronic device 100 about three axes (i.e., the x, y, and z axes). The gyroscope sensor 180B can be used for image stabilization. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the shake of the electronic device 100, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to counteract the shake of the electronic device 100 by moving in the opposite direction, thus achieving image stabilization. The gyroscope sensor 180B can also be used in navigation and motion-sensing game scenarios.
[0103] The 180E accelerometer can detect the magnitude of acceleration of electronic device 100 in various directions (typically three axes). When electronic device 100 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of electronic devices and applied to applications such as screen orientation switching and pedometers.
[0104] A distance sensor 180F is used to measure distance. Electronic device 100 can measure distance via infrared or laser. In some embodiments, during a shooting scene, electronic device 100 can utilize the distance sensor 180F to measure distance for rapid focusing.
[0105] The ambient light sensor 180L is used to sense the brightness of ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 based on the sensed ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also work with the proximity sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
[0106] Touch sensor 180K, also known as a "touch device," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touchscreen." Touch sensor 180K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be located on the surface of electronic device 100, in a different position than display screen 194.
[0107] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.
[0108] Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. For example, different vibration feedback effects can correspond to touch operations performed on different applications (such as taking photos, playing audio, etc.). Motor 191 can also correspond to different vibration feedback effects for touch operations performed on different areas of the display screen 194. Different application scenarios (such as time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.
[0109] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.
[0110] The following is a description of the camera module used in the photographing method of this application.
[0111] A camera module can be a front-facing camera or a rear-facing camera of an electronic device. The camera module includes a focusing lens group, a lens element, and a photoelectric sensor. The lens element can be a prism or a reflector, used to reflect incident light. For example, the lens element is a prism, which includes an incident surface, a reflecting surface, and an exiting surface. Light enters the prism from the incident surface, is reflected by the reflecting surface, and exits through the exiting surface. The light emitted through the exiting surface enters the focusing lens group, is focused and adjusted by the focusing lens group, and then reaches the photoelectric sensor. The photoelectric sensor receives the light and performs photoelectric conversion to form an image.
[0112] The camera module also includes a first adjustment mechanism, which may be a motor, used to adjust the position of the lens module in the focusing lens group, thereby adjusting the focal length of the focusing lens group, so that the camera module can shoot objects at different distances.
[0113] like Figure 5 As shown, the camera module also includes a lens carrier 51 and a second adjustment mechanism. The lens carrier 51 is externally connected to other structural components of the electronic device. The second adjustment mechanism is disposed within the lens carrier 51, and the lens 52 is connected to the second adjustment mechanism, thereby causing the second adjustment mechanism to drive the lens 52 to rotate, thus changing the position of the light-receiving area on the light-receiving surface. When the electronic device is stationary, by changing the rotation angle of the lens 52, the field of view of the camera module can be changed, thereby enabling the camera module to capture images with different fields of view.
[0114] In one embodiment, the second adjustment mechanism includes three drivers (e.g., three motors), all of which are communicatively connected to the processor and are used to drive the lens to rotate around axes P1, P2, and P3 respectively according to instructions from the processor. The three drivers can operate independently, simultaneously, or any two of the three drivers can operate at the same time.
[0115] During the camera module's image capture process, the processor controls one or more of the three drivers, which in turn rotates the lens. This allows the camera module to be adjusted to different shooting fields of view while the electronic device remains stationary, enabling continuous image capture from different angles. The electronic device then stitches together the images captured from these different shooting fields of view to obtain a large field-of-view image.
[0116] The following describes the specific implementation process of the photo-taking method provided in the embodiments of this application, based on the aforementioned camera module.
[0117] like Figure 6 As shown, an embodiment of this application provides a photographing method including:
[0118] S601: Obtain the first distance between the subject being photographed and the camera module.
[0119] Specifically, the electronic device can determine a first distance between the subject and the camera module based on detection information from a distance sensor on the device. Alternatively, the electronic device can determine the first distance using a Phase Detection Autofocus (PDAF) method. PDAF determines the focus offset value by measuring the distance between pixels and its changes. For example, in scenarios involving long-distance photography, the electronic device uses PDAF to determine the first distance; in scenarios involving close-up photography, the electronic device uses a distance sensor to determine the first distance.
[0120] S602: Determine N sets of shooting parameters corresponding to the first distance, each set of shooting parameters including the target focal length and the target angle, where N represents a positive integer.
[0121] Specifically, the electronic device can determine each set of shooting parameters based on a first distance and preset formulas, which are the relationships between distance and angle, and between distance and focal length. The electronic device can also retrieve the shooting parameters corresponding to the first distance from calibration data stored within it.
[0122] In this setup, a target angle corresponds to a field of view of the camera module. When the rotation angle of the lens is equal to the target angle, the focal length of the camera module is the target focal length within that field of view. To enable the camera module to capture images from multiple fields of view at the same distance, multiple target angles need to be determined, each target angle corresponding to a target focal length. N sets of shooting parameters correspond to N fields of view, and also to the N sub-images captured subsequently.
[0123] In order to obtain the shooting parameters corresponding to the first distance, the camera module needs to be calibrated in advance to obtain calibration data.
[0124] In one embodiment, the method for determining calibration data is as follows.
[0125] like Figure 7 As shown, the reference object 71 is divided into multiple regions 72, and each region 72 can have the same size. Figure 8As shown, the distance between the camera module 81 and the reference object 82 is adjusted to the first reference distance and recorded. Then, based on the position of each area of the reference object 82, the field of view of the camera module 81 is adjusted by adjusting the rotation angle of the lens, so that one area is within the field of view of the camera module. The first adjustment mechanism is controlled to adjust the focal length of the focusing lens group. After focusing is completed (i.e., when a clear image can be captured), the rotation angle of the lens (reference angle) and the focal length of the focusing lens group (reference focal length) are recorded, which are a set of correction parameters under the first reference distance. Using the same method, the second adjustment mechanism is controlled to adjust the rotation angle of the lens, so that each area is sequentially within the field of view of the camera module, and the first adjustment mechanism is controlled to adjust the focal length of the focusing lens group. After focusing is completed, the rotation angle and focal length corresponding to each area are recorded, thus obtaining each set of correction parameters under the first reference distance. Next, adjust the distance between the camera module and the reference object to the second reference distance and record it. Using the same method, adjust the rotation angle of the lens and the focal length of the focusing lens group, recording the rotation angle and focal length corresponding to each area. This yields the correction parameters for each set at the second reference distance. By analogy, multiple sets of correction parameters can be obtained for each reference distance. Each reference distance and its corresponding sets of correction parameters constitute a set of reference parameters.
[0126] For example, such as Figure 9 As shown, with the camera module's position unchanged, N reference distances correspond to positions 1, 2, 3...N, from the foreground to the background. At each reference distance, the correction parameters for each region of the reference object are recorded, resulting in multiple sets of correction parameters. The correction parameters corresponding to each reference distance are the reference parameters.
[0127] After obtaining the reference parameters, the reference distance and reference angle can be fitted to obtain the relationship between distance and angle, and the reference distance and reference focal length can be fitted to obtain the relationship between distance and focal length. There can be multiple relationships between distance and angle, with one relationship corresponding to one field of view. Similarly, there can be multiple relationships between distance and focal length, with each focal length corresponding to one angle. For example, if the reference object comprises 25 regions, corresponding to 25 shooting fields of view, for each field of view, there exists a relationship between distance and angle, and a relationship between distance and focal length.
[0128] Electronic devices can directly store formulas relating distance and angle, as well as distance and focal length. They can also set multiple reference distances with small intervals, such as a difference of 0.01mm between two adjacent reference distances. Then, based on the formulas relating distance and angle, and distance and focal length, the angle and focal length corresponding to each reference distance are determined, i.e., the correction parameters for each reference distance are determined. Subsequently, the electronic device stores the correction parameters corresponding to each reference distance in a data table according to the order of the reference distances or angles; the data in the data table is the calibration data. When taking a picture of the subject, the electronic device can use a lookup table method to determine multiple sets of shooting parameters corresponding to the first distance from the calibration data, thereby improving the efficiency of reading shooting parameters.
[0129] In one embodiment, calibration data can be stored in the electrically erasable programmable read-only memory (EEPROM) of the camera module. Alternatively, calibration data can be stored in the driver IC of the driver, thereby further improving the efficiency of reading shooting parameters.
[0130] In one embodiment, the electronic device may also store the storage address of the correction parameters corresponding to each reference distance. When taking a picture, after determining the first distance, the electronic device first determines the storage address corresponding to the first distance, and reads the shooting parameters corresponding to the first distance from the calibration data according to the storage address.
[0131] In one embodiment, when determining calibration data, the reference object is divided into multiple regions, the number of which can be preset, for example, a first number, with one region corresponding to one field of view. After data calibration, each reference distance corresponds to a first number of reference angles and a first number of reference focal lengths. When taking subsequent photos, the number of sub-images to be captured is also the first number. The electronic device then reads the first number of target focal lengths and the first number of target angles based on the first distance between the object being photographed and the camera module.
[0132] In another embodiment, when determining calibration data, multiple reference objects are used for calibration for the same reference distance, and each reference object is divided into different regions using different methods. For example, different reference objects are divided into P*Q regions, where P and Q represent the number of rows and columns, respectively, and both P and Q are integers greater than 0. P and Q can be equal or unequal, and "*" represents multiplication. For each reference object, the above method is used for calibration. Therefore, for each reference distance, the electronic device stores calibration data corresponding to the reference distance and the number of regions. When taking subsequent photos, the electronic device first obtains the first number of sub-images and determines N sets of shooting parameters corresponding to the first distance and the first number. The first number can be input by the user; for example, the user can select different first numbers based on actual shooting field of view requirements. When a larger field of view is needed, more sub-images are selected; when a smaller field of view is needed and higher image quality is required, fewer sub-images are selected. The initial number can also be determined by the electronic device based on a initial distance. For example, when shooting a subject at a distance, the initial number is greater than a preset value, while when shooting a subject at a closer distance, the initial number is less than a preset value. By setting different numbers of sub-images, different shooting needs of users can be accommodated.
[0133] S603: Control the first adjustment mechanism to adjust the focal length of the focusing lens group, and control the second adjustment mechanism to adjust the rotation angle of the lens. When the focal length of the focusing lens group is the k-th target focal length and the rotation angle of the lens is the k-th target angle, a sub-image is captured. When the rotation angle of the lens is the k-th target angle, the field of view of the camera module is the k-th field of view, and the k-th target focal length is the shooting focal length corresponding to the k-th field of view, k = 1, 2, 3...N.
[0134] Specifically, the k-th target focal length is any one of the N target focal lengths. The k-th target focal length and the k-th target angle are the k-th set of shooting parameters, corresponding to the shooting of the k-th field of view, and also corresponding to the k-th sub-image obtained by shooting. When the field of view of the camera module is the k-th field of view, the focal length after focusing is the shooting focal length, which is also the k-th target focal length.
[0135] Each set of shooting parameters corresponds one-to-one with the target focal length and target angle. After the electronic device reads the target focal length and target angle corresponding to the first distance, it controls the first and second adjustment mechanisms respectively to make the focal length of the focusing lens group the target focal length and the rotation angle of the lens the corresponding target angle. The resulting image is one of the sub-images. The first and second adjustment mechanisms work simultaneously, which can improve the angle adjustment efficiency and focusing efficiency, thereby improving the stability of each frame image.
[0136] In one embodiment, the electronic device can pre-read each set of target focal lengths and target angles corresponding to the first distance, and then control the first adjustment mechanism and the second adjustment mechanism respectively to make the focal length of the focusing lens group the target focal length in sequence, and the rotation angle of the lens in sequence the target angle. When the focusing lens group is the target focal length and the rotation angle of the lens is the corresponding target angle, the camera module takes a picture to obtain a sub-image.
[0137] In another embodiment, the electronic device can pre-determine the storage addresses of multiple sets of shooting parameters corresponding to the first distance. It first reads the first set of shooting parameters, then controls the first adjustment mechanism to adjust the focal length of the focusing lens group and the second adjustment mechanism to adjust the rotation angle of the lens, so that the focal length of the focusing lens group is the target focal length in the first set of shooting parameters, and the rotation angle of the lens is the target angle in the first set of shooting parameters. Then, it captures the first sub-image. During the capture of the first sub-image, the electronic device reads the second set of shooting parameters and captures the second sub-image using the same method. Then, it sequentially reads other shooting parameters and captures the corresponding sub-images. Specifically, during the capture of the k-th sub-image, the electronic device reads the (k+1)-th target focal length and the (k+1)-th target angle. After the k-th sub-image is captured, it controls the first adjustment mechanism to adjust the focal length of the focusing lens group and the second adjustment mechanism to adjust the angle of the lens, so that the focal length of the focusing lens group is the (k+1)-th target focal length and the rotation angle of the lens is the (k+1)-th target angle. Then, when the capture time for the (k+1)-th sub-image is reached, the (k+1)-th sub-image is captured.
[0138] Before the capture time of the (k+1)th sub-image is reached, the rotation angle of the lens is the target angle, and the focal length of the focusing lens group is the target focal length. That is, while the second adjustment mechanism is adjusting the rotation angle of the lens, the first adjustment mechanism also completes the focusing of the focusing lens group. This allows the camera module to complete the field of view adjustment and focusing in a shorter time and obtain a sub-image with higher clarity.
[0139] The second adjustment mechanism can be a motor. Due to the inertia of the lens rotation, the electronic device can issue a stop command after the motor has rotated for a preset time. The lens then rotates to a preset position under inertia, making the lens rotation angle the target angle. The first adjustment mechanism can also be a motor. After issuing a stop command to the first adjustment mechanism, the electronic device can also issue a stop command after the motor has operated for a preset time. The lens module in the focusing lens group then adjusts to a preset position under inertia, making the focal length of the focusing lens group the target focal length. This reduces the difference between the focal length of the focusing lens group and the target focal length, as well as the difference between the lens rotation angle and the target angle, thereby improving the clarity of the captured sub-image.
[0140] For example, such as Figure 10 As shown, the process of capturing one frame of an image includes a horizontal exposure process and a data reading process. The time taken for horizontal exposure, the time taken for data reading, and the inter-frame interval between two frames constitute the total processing time for one frame. After the horizontal exposure is completed, the electronic device reads the pixel data. During the pixel data reading process, the electronic device simultaneously reads the shooting parameters corresponding to the next frame. After the data reading is completed, the first adjustment mechanism is controlled to adjust the focal length of the focusing lens group, and the second adjustment mechanism is controlled to adjust the lens angle. The first and second adjustment mechanisms work simultaneously, and their adjustment time is synchronized with the inter-frame interval between two frames. That is, the first and second adjustment mechanisms are controlled to work during the inter-frame interval between two adjacent frames. When the second adjustment mechanism adjusts the rotation angle of the lens to the target angle, the first adjustment mechanism completes the focusing process of the focusing lens group under the field of view corresponding to the target angle. After the first and second adjustment mechanisms have completed their adjustments, the camera module begins to capture the next frame, that is, it begins the horizontal exposure process for the next frame.
[0141] Since the electronic device directly reads the calibration data to obtain the target focal length of the focusing lens group, the focal length of the focusing lens group can be directly adjusted to the target focal length through the first adjustment mechanism. Thus, the focal length adjustment can be achieved in a short time, that is, the focal length adjustment can be achieved within the inter-frame interval between two adjacent frames. Therefore, clear sub-images of different fields of view can be continuously captured without increasing the image shooting time.
[0142] In the above embodiments, by pre-storing calibration data, the first adjustment mechanism and the second adjustment mechanism are controlled to work simultaneously during the inter-frame interval of two adjacent frames, so that while the lens angle is rotated to the target angle, the focusing lens group completes focusing under the corresponding field of view. While the electronic device remains stationary, multiple sub-images of the field of view can be captured, and the clarity of each sub-image can be guaranteed.
[0143] After reading multiple sets of shooting parameters corresponding to the first distance, the electronic device needs to control the first adjustment mechanism to adjust the focal length of the focusing lens group according to each set of shooting parameters, and control the second adjustment mechanism to adjust the rotation angle of the lens. The electronic device can control the first adjustment mechanism to adjust the focal length of the focusing lens group sequentially according to the arrangement order of each target focal length, and control the second adjustment mechanism to adjust the rotation angle of the lens sequentially according to the arrangement order of each target angle.
[0144] In one embodiment, the electronic device, according to the storage order of the shooting parameters, first controls the second adjustment mechanism to adjust the rotation angle of the lens to the first target angle, and controls the first adjustment mechanism to adjust the focal length of the focusing lens group to the first target focal length. Then, according to the storage order of the shooting parameters, the electronic device controls the second adjustment mechanism to adjust the rotation angle of the lens to each target angle sequentially, while simultaneously controlling the first adjustment mechanism to adjust the focal length of the focusing lens group to each target focal length. When adjusting the rotation angle of the lens according to the storage order of the shooting parameters, the lens can rotate in a preset rotation direction. For example, during the lens rotation, the field of view of the camera module can rotate in a spiral or an S-shape. For instance, each target angle corresponds to a sub-image. During the shooting process, the electronic device rotates the lens in the preset rotation direction to sequentially obtain each row of sub-images. The electronic device can control the lens to first rotate clockwise to sequentially capture the first row of sub-images, then rotate counterclockwise to sequentially capture the second row of sub-images, i.e., the field of view of the camera module rotates in an S-shape until all sub-images are captured. During the lens rotation, the focal length of the focusing lens group is sequentially adjusted to the focal length required to capture the corresponding sub-image.
[0145] In another embodiment, the shooting parameters are stored in a fixed order. The electronic device determines the order of the shooting parameters based on the current angle of the lens and / or the shooting scene. It then reads the corresponding shooting parameters sequentially according to the order, controls the first adjustment mechanism to adjust the focal length of the focusing lens group, and controls the second adjustment mechanism to adjust the angle of the lens, so that the focal length of the focusing lens group is sequentially the target focal length, and the rotation angle of the lens is the corresponding target angle. Each sub-image is then captured sequentially. The shooting scene may include ambient light intensity, the subject being photographed, and the shooting distance.
[0146] For example, based on the current rotation angle of the lens, the electronic device first reads the target angle closest to the current lens angle and the corresponding target focal length. Then, based on the target angle and focal length, it adjusts the lens rotation angle and the focal length of the focusing lens group accordingly. Next, based on the target angle, the electronic device adjusts the lens rotation angle to the next target angle according to a preset rotation direction, simultaneously adjusting the focal length of the focusing lens group to the corresponding target focal length. For instance, based on the current lens rotation angle, adjusting the lens rotation angle to the closest target angle results in a sub-image in the first row and second column. The electronic device then adjusts the lens rotation angle according to the preset rotation direction and captures images sequentially, obtaining sub-images in the first row, third column, fourth column, and fifth column, and then the second row. After capturing the last row and last column of sub-images, the lens angle is adjusted again to capture the first row and first column of sub-images. Determining the order of shooting parameters based on the current lens angle, and thus determining the lens rotation direction, improves lens adjustment efficiency by controlling the lens rotation according to that direction.
[0147] For example, based on the current focal length of the focusing lens group, the electronic device first reads the target focal length and corresponding target angle closest to the current focal length. Then, it adjusts the focal length of the focusing lens group and the rotation angle of the lens elements accordingly. Next, the electronic device determines the next target focal length and corresponding target angle. During the focal length adjustment process based on each target focal length, the focal length of the focusing lens group gradually increases or decreases. This allows the focusing lens group to adjust the focal length in one direction and ensures that the rotation angle of the lens elements corresponds to the focal length of the focusing lens group. This improves the stability of the focusing lens group during focal length adjustment, thereby increasing the sharpness of the captured sub-image.
[0148] For example, based on the current ambient light level, if the electronic device is determined to first capture the central field of view of the subject, it will first read the target angle and focal length corresponding to the central field of view, and capture the corresponding sub-image. Then, it will read the target angle and focal length closest to the current target angle, and capture the corresponding sub-image, and so on. For instance, the camera module's field of view can rotate in a spiral pattern until all sub-images are captured. Determining the order of shooting parameters according to the shooting scene allows the shooting order of sub-images to match the scene, improving the quality of the subsequently stitched image.
[0149] S604: The sub-images are stitched together to obtain an image of the photographed object.
[0150] Specifically, such as Figure 2 and Figure 3As shown, the sub-images are stitched together according to the field of view corresponding to the sub-images or the shooting order of the sub-images. The stitched image is the image of the subject.
[0151] In one application scenario, when an electronic device opens its camera app, the preview interface displays the image of the current field of view; that is, the preview shows the image observed when the lens is rotated to the current angle. When the electronic device detects the user's selection to capture a wide field of view and the capture command, it reads calibration data and captures multiple sub-images of different fields of view within a preset time period. These sub-images are then stitched together, and the stitched image of the subject is displayed on the screen. This allows for continuous capture of different fields of view and stitching together of them to obtain a wide field of view image while the electronic device remains stationary.
[0152] In one embodiment, adjacent sub-images have overlapping regions. After obtaining each sub-image, the electronic device determines the overlapping regions in adjacent sub-images based on the pixel distribution in each sub-image. Then, based on the pixels of the overlapping regions in each sub-image, the grayscale of the overlapping regions is adjusted to obtain the pixel information of the overlapping regions, or only the pixel information of one overlapping region is retained, and then the other regions are stitched together to obtain the stitched image.
[0153] In one embodiment, after obtaining the sub-images, the electronic device first preprocesses the sub-images (e.g., blurring, noise reduction, scaling, cropping), and then stitches the preprocessed sub-images together, thereby improving the quality of the stitched image. Specifically, the electronic device can perform different preprocessing on the sub-images based on factors such as exposure parameters, the focal length of each sub-image, the first distance between the subject and the camera module, the subject itself, and ambient light levels.
[0154] In one embodiment, after the electronic device stitches the sub-images together, it scales the stitched image to obtain an image that is adapted to the display interface of the electronic device, which is the image of the subject being photographed.
[0155] In the above embodiments, after determining the first distance between the subject and the camera module, the electronic device determines the target focal length and target angle corresponding to the first distance. The second adjustment mechanism rotates the lens to the target angle, while the first adjustment mechanism adjusts the focal length of the focusing lens group to the target focal length. Because the electronic device adjusts the focal length of the focusing lens group and the rotation angle of the lens after determining each set of shooting parameters, it can quickly adjust these parameters and capture sub-images after adjustment. This ensures that each sub-image is captured after focusing, guaranteeing the clarity of each sub-image and thus improving the clarity of the stitched image of the subject.
[0156] In one embodiment, after storing calibration data, the electronic device can perform focus tracking shooting based on the calibration data. Specifically, the electronic device determines the focus target and adjusts the rotation angle of the lens through a second adjustment mechanism to place the focus target within the shooting field of view of the camera module. Simultaneously, based on the distance between the focus target and the camera module, the electronic device reads the focal length corresponding to the distance and rotation angle from the calibration data. While adjusting the rotation angle of the lens, the focal length of the focusing lens group is simultaneously adjusted, thereby reducing focusing time and achieving better shooting results.
[0157] In the above embodiments, the electronic device includes a camera module. The camera module is pre-calibrated to obtain calibration data. During subsequent photography, the first and second adjustment mechanisms of the camera module are controlled according to the calibration data to ensure that the rotation angle of the lens is the target angle and the focal length of the focusing lens group is the target focal length, thereby achieving shooting of multiple fields of view. Finally, the images captured from multiple fields of view are stitched together to obtain an image of the subject.
[0158] In other embodiments, the electronic device may also include two or more camera modules. Each camera module is pre-calibrated to obtain calibration data corresponding to each camera module. Each camera module is identical and can achieve different fields of view by controlling the rotation of its lenses, and each camera module captures a different field of view. In the calibration data, the same distance corresponds to two or more camera modules, and each camera module corresponds to multiple sets of shooting parameters. During subsequent image capture, given the distance to the subject, the rotation angle of the lenses and the focal length of the focusing lens group of each camera module are simultaneously adjusted according to the calibration data corresponding to each camera module, so that each camera module captures multiple fields of view, and each camera module captures a different field of view. After obtaining the images captured by each camera module, all the images captured by each camera module are stitched together according to the position corresponding to each field of view to obtain the image of the subject, thereby obtaining an image with a large field of view and satisfactory clarity.
[0159] In cases where the electronic device includes two or more camera modules, the device can choose to use only one camera module to capture images of multiple fields of view and then stitch them together, or it can choose to use multiple camera modules to capture images of multiple fields of view separately and then stitch them together. The electronic device reads the corresponding calibration parameters based on the camera module selected by the user and adjusts the field of view and shooting focal length of the corresponding camera module according to the calibration parameters.
[0160] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0161] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the invention uses the layered architecture Android system as an example to exemplify the software structure of electronic device 100.
[0162] Figure 11 This is a software structure block diagram of the electronic device 100 according to an embodiment of the present invention.
[0163] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.
[0164] The application layer can include a series of application packages.
[0165] like Figure 11 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS.
[0166] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0167] like Figure 11 As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
[0168] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.
[0169] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.
[0170] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.
[0171] The phone manager is used to provide communication functions for electronic device 100. For example, it manages call status (including connection and disconnection).
[0172] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0173] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.
[0174] The Android Runtime consists of core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
[0175] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.
[0176] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0177] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0178] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0179] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0180] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0181] A 2D graphics engine is a graphics engine for 2D drawing.
[0182] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.
[0183] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0184] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0185] In the embodiments provided in this application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings or direct couplings or communication connections may be through some interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0186] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0187] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0188] If an integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.
[0189] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0190] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A photographing method, characterized in that: Applied to an electronic device, the electronic device includes a camera module, the camera module includes a focus lens group, a lens, a first adjustment mechanism and a second adjustment mechanism, the method includes: Acquire a first distance between the photographed object and the camera module; Determine N groups of shooting parameters corresponding to the first distance, each group of shooting parameters includes a target focal length and a target angle, the target focal length and the target angle of each group of shooting parameters correspond one to one, and N represents a positive integer; one target angle corresponds to a field of view of the camera module, the N groups of shooting parameters corresponding to the first distance are determined according to calibration data stored in the electronic device, the calibration data is determined according to multiple groups of reference parameters, each group of reference parameters includes a reference distance and multiple groups of correction parameters corresponding to the reference distance, each group of correction parameters includes a reference angle and a reference focal length; the reference distance is the distance between a reference object and the camera module, each reference angle corresponds to a field of view of the camera module, and each reference focal length is the focal length after focusing is completed at each reference angle; Control the first adjustment mechanism to adjust the focal length of the focus lens group, and control the second adjustment mechanism to adjust the rotation angle of the lens at the same time, when the focal length of the focus lens group is the kth target focal length, and the rotation angle of the lens is the kth target angle, capture a sub-image; when the rotation angle of the lens is the kth target angle, the field of view of the camera module is the kth field of view, and the kth target focal length is the shooting focal length corresponding to the kth field of view, k=1, 2, 3...N; splicing the N sub-images to obtain an image of the photographed object; The controlling the first adjusting mechanism to adjust the focal length of the focusing lens group and the controlling the second adjusting mechanism to adjust the rotation angle of the lens at the same time, and capturing a sub-image when the focal length of the focusing lens group is the kth target focal length and the rotation angle of the lens is the kth target angle, comprises: In the process of capturing the kth sub-image, the k+1th target focal length and the k+1th target angle are read; After the k-th sub-image is captured, the first adjusting mechanism is controlled to adjust the focal length of the focus lens group, and the second adjusting mechanism is controlled to adjust the rotation angle of the lens, so that the focal length of the focus lens group is the k+1-th target focal length, and the rotation angle of the lens is the k+1-th target angle; Take the k+1th sub-image.
2. The method according to claim 1, characterized in that The reference object is divided into a plurality of regions of the same size, and the reference angle is determined according to the position of each region.
3. The method according to claim 1, characterized in that The step of determining the calibration data according to the plurality of groups of reference parameters comprises: Determine a relationship between distance and angle, and a relationship between distance and focal length according to the plurality of groups of reference parameters; The calibration data is determined according to a relationship between the distance and the angle and a relationship between the distance and the focal length.
4. The method according to claim 1, characterized in that: The controlling the first adjusting mechanism to adjust the focal length of the focusing lens group and the controlling the second adjusting mechanism to adjust the rotation angle of the lens, and capturing a sub-image when the focal length of the focusing lens group is a kth target focal length and the rotation angle of the lens is a kth target angle, comprises: Determining the arrangement order of the N groups of shooting parameters according to the current rotation angle of the lens and / or the shooting scene; According to the arrangement order, the first adjustment mechanism is controlled to adjust the focal length of the focusing lens group, and the second adjustment mechanism is controlled to adjust the rotation angle of the lens. When the focal length of the focusing lens group is the kth target focal length and the rotation angle of the lens is the kth target angle, a sub-image is captured.
5. The method according to claim 1, characterized in that The determining N groups of shooting parameters corresponding to the first distance includes: Acquire a first number of the sub-images; N groups of shooting parameters corresponding to the first distance and the first number are determined.
6. An electronic device, characterized in that: The method comprises a processor configured to execute a computer program stored in a memory to implement the method according to any one of claims 1 to 5.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Shooting method and electronic device
CN103873753A
Method, device and terminal for shooting pictures
CN104243828A
Space compound imaging method and system and ultrasonic imaging equipment
CN107967670A
Photographing method and device based on ultrasonic waves, electronic equipment and storage medium
CN112135034A