Method and device for capturing images
By acquiring and adjusting the position of the camera voice coil motor and acquiring two clear images in the camera focus display screen, the problems of long focus time and unclear images in the prior art are solved, and fast focus and efficient shooting are achieved.
Patent Information
- Application Number
- CN202010603432.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-29
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2040-09-07
AI Technical Summary
When the existing VCM motor cameras achieve 2 times of focus, they need to scan point by point based on the contrast focus principle, resulting in a long focus time, especially when shooting inclined planes, the image is unclear due to the shallow depth of field.
By acquiring the first image collected at the first position of the display screen in the camera focus view frame, and adjusting the position of the voice coil motor of the camera based on the preset position adjustment information of the preset voice coil motor, the camera's voice coil motor is focused on the second position in the display screen, and the second image is obtained. Then, based on the two images, images with clear first and second positions are generated.
Fast focus is achieved, and no need to focus the display screen in the view frame twice, shortening the focus time and improving the focus efficiency and shooting efficiency.
Smart Images

Figure CN113938596B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of computer technology, and more particularly to a method and device for capturing images. Background Art
[0002] Ordinary VCM motor cameras need to achieve two focusing, based on the principle of contrast focusing, point-by-point scanning is required, and the focusing time is relatively long. When using a camera to shoot an inclined plane at a close distance, when the tilt angle is large, due to the shallow depth of field of the close-range camera, the inclined surface being photographed is at different depths of field, and one image cannot be clear. You can focus twice on the inclined surface near and far, shoot two images, obtain clear images near and far, and then synthesize a clear image. Because it takes a long time to complete the two focusing based on the principle of contrast focusing, it takes a long time to complete the two focusing based on the principle of contrast focusing. Summary of the invention
[0003] The embodiments of the present disclosure provide a method and device for capturing an image.
[0004] In a first aspect, an embodiment of the present disclosure provides a method for capturing an image, the method comprising: acquiring a first image captured by a first position of a display screen in a focus viewfinder of a camera; adjusting the position of a voice coil motor of the camera based on pre-acquired position adjustment information of a preset voice coil motor so that the camera focuses on a second position in the display screen, and acquiring a second image captured by focusing on the second position, wherein the position adjustment information of the preset voice coil motor includes movement data of the preset voice coil motor when the focus position moves from a first position in the display screen to a second position; based on the first image and the second image, generating clear images of the first position and the second position.
[0005] In some embodiments, the pre-acquired position adjustment information of a preset voice coil motor includes: movement data of the preset voice coil motor when a focus position corresponding to at least one preset step parameter of the preset voice coil motor moves from a first position in a display screen to a second position; and based on the pre-acquired position adjustment information of the preset voice coil motor, adjusting the position of the voice coil motor of the camera so that the camera focuses on the second position in the display screen, including: acquiring the step parameters of the voice coil motor of the camera, and determining the position adjustment information of the voice coil motor of the camera based on a proportional relationship between the step parameters of the voice coil motor of the camera and the preset step parameters, and the movement data corresponding to the preset parameters.
[0006] In some embodiments, the position adjustment information of the preset voice coil motor is obtained by: obtaining first position data of the preset voice coil motor when it is at a first position in the camera focus display screen; controlling the movement of the preset voice coil motor and determining the focus position in the display screen corresponding to the preset voice coil motor when it moves to each preset position, taking the position data when the voice coil motor moves to a second position in the focus display screen as the second position data, and determining the position adjustment information of the preset voice coil motor based on the first position data and the second position data.
[0007] In some embodiments, determining a focus position in a display screen corresponding to a preset voice coil motor when it moves to each preset position includes: determining the clarity of a second position in an image captured when the preset voice coil motor moves to each preset position, and determining whether the focus position in the display screen corresponding to the preset voice coil motor when it moves to each preset position is the second position based on the clarity of the second position.
[0008] In some embodiments, the display image in the viewfinder includes an inclined image; and the first position and the second position are respectively a position relatively close to the camera and a position relatively far from the camera in the inclined surface of the display image.
[0009] In a second aspect, an embodiment of the present disclosure provides a device for capturing an image, the device comprising: a first acquisition unit, configured to acquire a first image captured by a camera focusing on a first position of a display screen in a viewfinder; a second acquisition unit, configured to adjust the position of a voice coil motor of the camera based on pre-acquired position adjustment information of a preset voice coil motor so that the camera focuses on a second position in the display screen, and acquire a second image captured by focusing on the second position, wherein the position adjustment information of the preset voice coil motor includes movement data of the preset voice coil motor when the focus position moves from a first position in the display screen to a second position; and a generation unit, configured to generate clear images of the first position and the second position based on the first image and the second image.
[0010] In some embodiments, the pre-acquired position adjustment information of a preset voice coil motor includes: movement data of the preset voice coil motor when a focus position corresponding to at least one preset step parameter of the preset voice coil motor moves from a first position in a display screen to a second position; and a second acquisition unit is further configured to: acquire the step parameters of the voice coil motor of the camera, and determine the position adjustment information of the voice coil motor of the camera based on a proportional relationship between the step parameters of the voice coil motor of the camera and the preset step parameters, and the movement data corresponding to the preset parameters.
[0011] In some embodiments, the position adjustment information of the preset voice coil motor is obtained by: obtaining first position data of the preset voice coil motor when it is at a first position in the camera focus display screen; controlling the movement of the preset voice coil motor and determining the focus position in the display screen corresponding to the preset voice coil motor when it moves to each preset position, taking the position data when the voice coil motor moves to a second position in the focus display screen as the second position data, and determining the position adjustment information of the preset voice coil motor based on the first position data and the second position data.
[0012] In some embodiments, determining a focus position in a display screen corresponding to a preset voice coil motor when it moves to each preset position includes: determining the clarity of a second position in an image captured when the preset voice coil motor moves to each preset position, and determining whether the focus position in the display screen corresponding to the preset voice coil motor when it moves to each preset position is the second position based on the clarity of the second position.
[0013] In some embodiments, the display image in the viewfinder includes an inclined image; and the first position and the second position are respectively a position relatively close to the camera and a position relatively far from the camera in the inclined surface of the display image.
[0014] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising: one or more processors; a storage device on which one or more programs are stored; when the one or more programs are executed by one or more processors, the one or more processors implement the method for capturing images as described in any embodiment of the first aspect.
[0015] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method for capturing an image as described in any embodiment of the first aspect.
[0016] The method and device for shooting images provided by the embodiments of the present disclosure first obtain a first image captured by a camera at a first position of a display screen in a focus viewfinder, then adjust the position of the voice coil motor of the camera so that the camera focuses on a second position in the display screen based on position adjustment information of preset voice coil motor movement data that is first obtained, obtain the second position data of the voice coil motor that needs to be adjusted to focus on the second position of the display screen, and obtain a second image captured by focusing on the second position, wherein the position adjustment information of the preset voice coil motor includes the movement data of the preset voice coil motor when the focus position moves from the first position in the display screen to the second position, and finally, based on the first image and the second image, obtain and generate clear images of the first position and the second position, thereby realizing fast focusing, and there is no need to perform two focusing operations on the display screen in the viewfinder respectively, thereby shortening the focusing time and improving the focusing efficiency and shooting efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Other features, objects and advantages of the present disclosure will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0018] Figure 1 is a flowchart of an embodiment of a method for capturing an image according to an embodiment of the present disclosure;
[0019] Figure 2 is a schematic diagram of an application scenario of the method for capturing images according to an embodiment of the present disclosure;
[0020] Figure 3 is an exemplary flow chart of obtaining position adjustment information of a preset voice coil motor according to an embodiment of the present disclosure;
[0021] Figure 4 is a structural schematic diagram of an embodiment of a device for capturing images according to an embodiment of the present disclosure;
[0022] Figure 5 It is a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure. DETAILED DESCRIPTION
[0023] The present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant disclosure, rather than to limit the disclosure. It is also necessary to explain that, for ease of description, only the parts related to the relevant disclosure are shown in the accompanying drawings.
[0024] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0025] Continue to refer Figure 1 , shows a process 100 of an embodiment of a method for capturing an image according to the present disclosure. The method for capturing an image comprises the following steps:
[0026] Step 110, obtaining a first image captured at a first position of a display image in a focus frame of a camera.
[0027] In this step, the execution entity on which the method for capturing images is running may display a viewfinder on the screen, in which the picture captured by the camera may be displayed. The displayed picture in the viewfinder may include a picture corresponding to the first position and a picture corresponding to the second position. For example, the picture corresponding to the first position may be the upper half of the picture in the viewfinder, and the picture corresponding to the second position may be the lower half of the picture in the viewfinder.
[0028] Optionally, the picture displayed in the viewfinder may include an inclined picture, or pictures at different positions, wherein the first position and the second position of the picture displayed in the viewfinder are respectively a position relatively close to the camera and a position relatively far from the camera in the inclined surface of the picture.
[0029] The execution subject displays the display image in the viewfinder on the screen, receives a click operation performed by the user on the first position in the display image, and controls the voice coil motor to move continuously based on the contrast focus principle, so that the camera focuses on the first position of the display image in the viewfinder, and the display image at the first position is clear. Based on the camera focusing on the first position, the execution subject obtains a first image captured by the camera focusing on the first position, and the first image includes an image image that is clear at the first position but blurred at the second position.
[0030] Step 120 , based on the pre-acquired position adjustment information of the preset voice coil motor, adjust the position of the voice coil motor of the camera so that the camera focuses on a second position in the display image, and obtain a second image captured by focusing on the second position.
[0031] In this step, after the execution subject obtains the first image with a clear first position in the display screen, the position adjustment information of the preset voice coil motor is obtained in advance. The position adjustment information can be used to adjust the position of the preset voice coil motor. The camera focuses on different positions by adjusting the position of the preset voice coil motor. The position adjustment information of the preset voice coil motor includes the movement data of the preset voice coil motor when the focus position moves from the first position in the display screen to the second position. After the execution subject obtains the position adjustment information of the preset voice coil motor, the position of the voice coil motor of the camera is adjusted according to the position adjustment information so that the camera focuses on the second position in the display screen, and then the second image captured by focusing on the second position is obtained, and the second image includes an image screen where the second position is clear but the first position is blurred.
[0032] In some optional implementations of this embodiment, the pre-acquired position adjustment information of the preset voice coil motor includes: movement data of the preset voice coil motor when the focus position corresponding to at least one preset step parameter of the preset voice coil motor moves from a first position in the display screen to a second position. The above-mentioned execution subject can obtain the step parameter of the voice coil motor of the camera, and determine the position adjustment information of the voice coil motor of the camera based on the proportional relationship between the step parameter of the voice coil motor of the camera and the preset step parameter, and the preset parameter corresponds to the movement data.
[0033] Specifically, the execution subject stores the position adjustment information of the preset voice coil motor in advance, and may store at least one preset step parameter, each of which corresponds to a movement data, and the movement data may be the movement data of the preset voice coil motor when the camera focus position moves from the first position in the display screen to the second position. The movement data corresponding to the preset voice coil motor may be at least one code value, and each voice coil motor is burned with its own step parameter, and the step parameter represents each code value, and the voice coil motor can output the corresponding movement step.
[0034] The execution subject can obtain the step length parameters of the voice coil motor of the camera and the preset step length parameters of the preset voice coil motor by local reading or detection, and then the execution subject can calculate the proportional relationship between the step length parameters of the voice coil motor of the camera and the preset step length parameters. The execution subject can obtain the position adjustment information of the voice coil motor of the camera based on the calculated proportional relationship and the movement data corresponding to the preset parameters.
[0035] As an example, the terminal can pre-store a preset step parameter and a movement code value corresponding to the preset step parameter locally. The terminal can adjust the preset voice coil motor according to the movement code value, and adjust the preset voice coil motor so that the camera focus position moves from the first position in the display screen to the second position. The terminal detects the voice coil motor of the camera to obtain the step parameter of the voice coil motor of the camera, compares the step parameter of the voice coil motor of the camera with the preset step parameter, obtains the ratio of the step parameter of the voice coil motor of the camera to the preset step parameter, and multiplies the ratio with the movement code value corresponding to the preset step parameter to obtain the movement code value of the voice coil motor of the camera as the position adjustment information.
[0036] In this implementation, based on the pre-acquired position adjustment information of the preset voice coil motor and the step size parameter of the voice coil motor, the movement data corresponding to different voice coil motors can be automatically acquired, thereby improving the flexibility and autonomy of the movement of the voice coil motor.
[0037] Step 130 , generating clear images of the first position and the second position based on the first image and the second image.
[0038] In this step, the execution entity obtains a first image in which the first position is clear but the second position is blurred, and a second image in which the first position is blurred but the second position is clear, and synthesizes the first image and the second image through image synthesis technology to obtain an image in which the first position and the second position are clear.
[0039] Continue to refer Figure 2 , Figure 2 FIG. 1 is a schematic diagram of an application scenario of the method for capturing an image according to this embodiment. Figure 2 In the application scenario, the terminal 201 captures the external image through the camera and displays the display image in the viewfinder through the screen. The display image includes the upper half and the lower half, and the camera cannot focus on the upper half and the lower half at the same time. The terminal 201 receives the user's click operation on the upper half of the viewfinder, controls the voice coil motor of the camera to move so that the camera focuses on the upper half of the display image. The terminal 201 receives the shooting operation performed by the user, obtains the first image 202 captured by the camera focusing on the upper half of the display image, and the upper half of the first image 202 is clear but the lower half is blurred. When the terminal 201 reads the pre-acquired focus position and moves from the first position in the display image to the second position, the movement data of the preset voice coil motor is preset, and the movement data that the voice coil motor of the camera needs to move is obtained according to the preset movement data of the voice coil motor, and then the position of the voice coil motor of the camera is adjusted so that the camera focuses on the lower half of the display image, and the second image 203 captured by the camera focusing on the lower half of the display image is obtained, and the lower half of the second image 203 is clear but the lower half is blurred. Finally, the terminal 201 synthesizes the first image 202 and the second image 203 to generate an image 204 with clear upper and lower halves, and displays the image 204 on the screen of the terminal 201 .
[0040] The method for shooting images provided by the embodiments of the present disclosure first obtains a first image captured by a camera at a first position of a display screen in a focus viewfinder, adjusts the position of a voice coil motor of the camera so that the camera focuses on a second position in the display screen based on position adjustment information of preset voice coil motor movement data that is obtained in advance, obtains the second position data of the voice coil motor that needs to be adjusted to focus on the second position of the display screen, and obtains a second image captured by focusing on the second position, wherein the position adjustment information of the preset voice coil motor includes the movement data of the preset voice coil motor when the focus position moves from the first position in the display screen to the second position, and based on the first image and the second image, generates clear images of the first position and the second position, thereby realizing fast focusing, eliminating the need to perform two focusing operations on the display screen in the viewfinder, thereby shortening the focusing time and improving the focusing efficiency and shooting efficiency.
[0041] In some optional implementations of this embodiment, the position adjustment information of the preset voice coil motor may be obtained according to the following process 300:
[0042] Step 310 , obtaining first position data of a preset voice coil motor at a first position in a camera focus display image.
[0043] In this step, the execution subject may train the preset voice coil motor and use the preset voice coil motor to drive the camera so that the camera can focus on the first position of the displayed image in the viewfinder. When the camera focuses on the first position in the displayed image, the execution subject obtains the first position data of the preset voice coil motor, which may be step data representing the step length that the preset voice coil motor needs to move, such as a code value.
[0044] Step 320, controlling the movement of the preset voice coil motor and determining the focus position in the display image corresponding to the preset voice coil motor when it moves to each preset position, taking the position data when the voice coil motor moves to the second position in the focus display image as the second position data, and determining the position adjustment information of the preset voice coil motor based on the first position data and the second position data.
[0045] In this step, based on the first position in the camera focus display screen, after the execution subject obtains the first position data, based on the first position data, the preset voice coil motor is controlled to move continuously to different preset positions. For example, the preset voice coil motor is controlled to move different code values based on the first position data, so that the preset voice coil motor reaches the preset position corresponding to each code value. The execution subject determines the focus position of the camera in the display screen when the preset voice coil motor moves to each preset position. The execution subject determines that it is a focus position of the second position in the display screen by judging each focus position, and uses the position data corresponding to the focus position as the second position data, and determines the difference between the second position data and the first position data as the position adjustment information of the preset voice coil motor.
[0046] As an example, after the terminal obtains the first position data, based on the first position data, the preset voice coil motor is controlled to move by 1 code value to obtain the first focus position of the camera at this time, and then the terminal continues to control the preset voice coil motor to move by 1 code value. At this time, the position of the preset voice coil motor differs by 2 code values relative to the first position data, and the second focus position of the camera at this time is obtained. Then the terminal continues to control the preset voice coil motor to move by 1 code value. At this time, the position of the preset voice coil motor differs by 3 code values relative to the first position data, and the third focus position of the camera is obtained. The terminal can compare the first focus position, the second focus position, and the third focus position, and determine from the first focus position, the second focus position, and the third focus position that the third focus position is the second position in the focus display screen, then the position data corresponding to the third focus position, that is, the position data corresponding to the movement of 3 code values based on the first position data, is used as the second position data. At the same time, the terminal can obtain that the second position data of the preset voice coil motor differs by 3 code values relative to the first position data, and the obtained 3 code values are determined as the position adjustment information of the preset voice coil motor.
[0047] In this implementation, by controlling the preset voice coil motor to move to different preset positions, the camera can focus on different positions in the display image, and the position adjustment information of the preset voice coil motor when the camera focuses on the preset position can be determined from multiple position information, making the position adjustment information more accurate.
[0048] In some optional implementations of the present embodiment, the above-mentioned execution subject determines the focus position in the display picture corresponding to the preset voice coil motor when it moves to each preset position, which is implemented based on the following steps: the above-mentioned execution subject determines the clarity of the second position in the image captured when the preset voice coil motor moves to each preset position, and determines whether the focus position in the display picture corresponding to the preset voice coil motor when it moves to each preset position is the second position based on the clarity of the second position.
[0049] Specifically, the execution subject controls the preset voice coil motor to move continuously to different preset positions based on the first position data, and obtains images captured after the camera focuses at each preset position to obtain multiple images. For example, the execution subject controls the preset voice coil motor to move different code values based on the first position data. After moving the code value once, the camera focuses on a certain position in the display screen, and obtains the image captured at a certain position in the display screen when the camera focuses, thereby obtaining multiple images captured by the preset voice coil motor when it moves to each preset position. The above-mentioned execution entity can evaluate the clarity of the multiple acquired images through an image clarity evaluation algorithm, or input the multiple acquired images into an image clarity evaluation model for clarity evaluation to obtain the clarity of the second position in each image, and then analyze the clarity of the second position in each image to determine whether the second position in each image is the focus position of the second position in the focus display screen. For example, the clarity of the second position in each image is analyzed, and the image with the highest clarity is determined from the clarity of the second position in each image, and the second position in the image is determined as the focus position of the second position in the focus display screen.
[0050] As an example, after the terminal obtains the first position data, based on the first position data, the terminal first controls the preset voice coil motor to move by 1 code value, controls the preset voice coil motor to move to the first preset position, so that the camera focuses on the first preset position in the display screen, and the terminal obtains the first preset image captured at the first preset position in the display screen; then the terminal continues to control the preset voice coil motor to move by 1 code value, controls the preset voice coil motor to move to the second preset position, so that the camera focuses on the second preset position in the display screen, at this time, the position of the preset voice coil motor differs by 2 code values relative to the first position data, and the terminal obtains the second preset image captured at the second preset position in the display screen; then the terminal continues to control the preset voice coil motor to move by 1 code value, controls the preset voice coil motor to move to the third preset position, so that the camera focuses on the third preset position in the display screen, at this time, the position of the preset voice coil motor differs by 3 code values relative to the first position data, and the terminal obtains the third preset image captured at the third preset position in the display screen. The terminal can evaluate the clarity of the first preset image, the second preset image, and the third preset image through an image clarity evaluation algorithm to obtain a first clarity of the second position in the first preset image, a second clarity of the second position in the second preset image, and a third clarity of the second position in the third preset image. The terminal sorts the first clarity, the second clarity, and the third clarity to determine the clarity with the highest clarity, and determines that the focus position in the display screen corresponding to the image with the highest clarity is the second position in the display screen.
[0051] In this implementation, the focus position in the display screen is judged by comparing the clarity of the second position in multiple images, so that the judgment of the focus position in each image is more accurate, and thus the focus position in the display screen determined based on the focus position in the image is more accurate.
[0052] Further references Figure 4 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a device for photographing an image. Figure 1 The method embodiments shown correspond.
[0053] like Figure 4 As shown, the device 400 for shooting images in this embodiment may include: a first acquisition unit 410, configured to acquire a first image captured by focusing the camera on a first position of a display screen in a viewfinder; a second acquisition unit 420, configured to adjust the position of the voice coil motor of the camera based on pre-acquired position adjustment information of a preset voice coil motor so that the camera focuses on a second position in the display screen, and acquire a second image captured by focusing on the second position, wherein the position adjustment information of the preset voice coil motor includes movement data of the preset voice coil motor when the focus position moves from a first position in the display screen to a second position; and a generation unit 430, configured to generate clear images of the first position and the second position based on the first image and the second image.
[0054] In some optional implementations of the present embodiment, the pre-acquired position adjustment information of the preset voice coil motor includes: movement data of the preset voice coil motor when the focus position corresponding to at least one preset step parameter of the preset voice coil motor moves from a first position in the display screen to a second position; and the second acquisition unit 420 is further configured to: acquire the step parameters of the voice coil motor of the camera, and determine the position adjustment information of the voice coil motor of the camera based on the proportional relationship between the step parameters of the voice coil motor of the camera and the preset step parameters, and the movement data corresponding to the preset parameters.
[0055] In some optional implementations of the present embodiment, the position adjustment information of the preset voice coil motor is obtained in the following manner: obtaining first position data of the preset voice coil motor when it is at a first position in a camera focus display screen; controlling the movement of the preset voice coil motor and determining the focus position in the display screen corresponding to the preset voice coil motor when it moves to each preset position, taking the position data when the voice coil motor moves to a second position in the focus display screen as second position data, and determining the position adjustment information of the preset voice coil motor based on the first position data and the second position data.
[0056] In some optional implementations of the present embodiment, determining the focus position in the display image corresponding to the preset voice coil motor when it moves to each preset position includes: determining the clarity of the second position in the image captured when the preset voice coil motor moves to each preset position, and determining whether the focus position in the display image corresponding to the preset voice coil motor when it moves to each preset position is the second position based on the clarity of the second position.
[0057] In some optional implementations of this embodiment, the display image in the viewfinder includes an inclined image; and the first position and the second position are respectively a position relatively close to the camera and a position relatively far from the camera in the inclined surface of the display image.
[0058] The device provided by the above-mentioned embodiment of the present disclosure first obtains a first image captured by a camera at a first position of a display screen in a focus viewfinder, adjusts the position of the voice coil motor of the camera so that the camera focuses on a second position in the display screen based on the position adjustment information of the preset voice coil motor movement data that is first obtained, obtains the second position data of the voice coil motor that needs to be adjusted to focus on the second position of the display screen, and obtains a second image captured by focusing on the second position, wherein the position adjustment information of the preset voice coil motor includes the movement data of the preset voice coil motor when the focus position moves from the first position in the display screen to the second position, and based on the first image and the second image, obtains and generates clear images of the first position and the second position, thereby realizing fast focusing, and there is no need to perform two focusing operations on the display screen in the viewfinder respectively, thereby shortening the focusing time and improving the focusing efficiency and shooting efficiency.
[0059] like Figure 5 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0060] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 5 Each block shown in the figure may represent one device, or may represent multiple devices as required.
[0061] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0062] It should be noted that the computer-readable medium of the embodiment of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the embodiment of the present disclosure, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device. In the embodiment of the present disclosure, the computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0063] The computer-readable medium may be included in the electronic device; or it may exist independently without being assembled into the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains a first image captured by the camera focusing on the first position of the display screen in the viewfinder; based on the position adjustment information of the preset voice coil motor obtained in advance, adjusts the position of the voice coil motor of the camera so that the camera focuses on the second position in the display screen, and obtains the second image captured by focusing on the second position, wherein the position adjustment information of the preset voice coil motor includes the movement data of the preset voice coil motor when the focus position moves from the first position in the display screen to the second position; based on the first image and the second image, generates clear images of the first position and the second position.
[0064] Computer program code for performing the operations of the embodiments of the present disclosure may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet).
[0065] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0066] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The units described may also be set in a processor, for example, may be described as: a processor includes a first acquisition unit, a second acquisition unit and a generation unit. The names of these units do not constitute limitations on the units themselves in certain circumstances, for example, the first acquisition unit may also be described as "a unit for acquiring a first image captured at a first position of a display screen in a camera focus viewfinder".
[0067] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the embodiments of the present disclosure (but not limited to) to form a technical solution.
Claims
1. A method for capturing an image, comprising: Acquire a first image captured by focusing the camera on a first position of a display image in a viewfinder; the display image in the viewfinder includes a tilted image; Based on the pre-acquired position adjustment information of the preset voice coil motor, the position of the voice coil motor of the camera is adjusted so that the camera focuses on a second position in the display image, and a second image captured by focusing on the second position is acquired; the first position and the second position are respectively a position relatively close to the camera and a position relatively far from the camera in the inclined surface in the display image, the image corresponding to the first position is the upper half of the image in the viewfinder, and the image corresponding to the second position is the lower half of the image in the viewfinder; Performing image synthesis on the first image and the second image to generate clear images at the first position and the second position; The pre-acquired position adjustment information of the preset voice coil motor includes: movement data of the preset voice coil motor corresponding to at least one preset step length parameter of the preset voice coil motor when the focus position moves from a first position in the display image to a second position; The adjusting the position of the voice coil motor of the camera based on the pre-acquired position adjustment information of the preset voice coil motor so that the camera focuses on the second position in the display image includes: The step length parameter of the voice coil motor of the camera is obtained, and the position adjustment information of the voice coil motor of the camera is determined based on the proportional relationship between the step length parameter of the voice coil motor of the camera and the preset step length parameter, and the preset step length parameter corresponds to the movement data.
2. The method according to claim 1, wherein: The position adjustment information of the preset voice coil motor is obtained by: Acquire first position data of the preset voice coil motor when it is at a first position in a camera focus display image; Control the movement of the preset voice coil motor and determine the focus position in the display screen corresponding to the preset voice coil motor when it moves to each preset position, use the position data when the voice coil motor moves to the second position in the focus display screen as the second position data, and determine the position adjustment information of the preset voice coil motor based on the first position data and the second position data.
3. The method according to claim 2, wherein: The determining of the focus position in the display image corresponding to the preset voice coil motor when the preset voice coil motor moves to each preset position includes: Determine the clarity of the second position in the image captured when the preset voice coil motor moves to each preset position, and determine whether the focus position in the display picture corresponding to the preset voice coil motor when it moves to each preset position is the second position based on the clarity of the second position.
4. A device for capturing an image, comprising: A first acquisition unit is configured to acquire a first image captured at a first position of a display screen in a focus viewfinder of a camera; The picture displayed in the viewfinder includes a tilted picture; A second acquisition unit is configured to adjust the position of the voice coil motor of the camera based on the position adjustment information of the preset voice coil motor acquired in advance so that the camera focuses on a second position in the display image, and acquire a second image captured by focusing on the second position, wherein the first position and the second position are respectively a position relatively close to the camera and a position relatively far from the camera in the inclined surface in the display image; A generating unit, configured to perform image synthesis on the first image and the second image to generate an image with a clear first position and a clear second position; The picture corresponding to the first position is the upper half of the picture in the viewfinder, and the picture corresponding to the second position is the lower half of the picture in the viewfinder; The pre-acquired position adjustment information of the preset voice coil motor includes: movement data of the preset voice coil motor corresponding to at least one preset step length parameter of the preset voice coil motor when the focus position moves from a first position in the display image to a second position; as well as The second acquisition unit is further configured to: acquire the step parameters of the voice coil motor of the camera, and determine the position adjustment information of the voice coil motor of the camera based on the proportional relationship between the step parameters of the voice coil motor of the camera and the preset step parameters, and the preset step parameters corresponding to the movement data.
5. The device according to claim 4, wherein: The position adjustment information of the preset voice coil motor is obtained by: Acquire first position data of the preset voice coil motor when it is at a first position in a camera focus display image; Control the movement of the preset voice coil motor and determine the focus position in the display screen corresponding to the preset voice coil motor when it moves to each preset position, use the position data when the voice coil motor moves to the second position in the focus display screen as the second position data, and determine the position adjustment information of the preset voice coil motor based on the first position data and the second position data.
6. The device according to claim 5, wherein: The determining of the focus position in the display image corresponding to the preset voice coil motor when the preset voice coil motor moves to each preset position includes: Determine the clarity of the second position in the image captured when the preset voice coil motor moves to each preset position, and determine whether the focus position in the display picture corresponding to the preset voice coil motor when it moves to each preset position is the second position based on the clarity of the second position.
7. An electronic device comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method according to any one of claims 1 to 3.
8. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Method and device of image collection
CN103188434A
Method for generating different focal lengths of same scene by using continuous movement of motor and terminal
CN104506767A
Lens automatic focusing method
CN105163036A