A method for switching lenses, a camera device, and a storage medium.
By pre-storing the focus position relationship table for wide-angle and telephoto lenses, the problem of long focusing time for telephoto lenses in video conferencing is solved, enabling fast and smooth lens switching and improving the user experience.
Patent Information
- Application Number
- CN202310592360.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-23
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2043-05-23
AI Technical Summary
In existing technologies, telephoto lenses need to be constantly refocused when switching between close-ups in video conferencing, resulting in long adjustment times and affecting the smoothness of switching and user experience.
The system pre-stores a focus position relationship table for wide-angle and telephoto lenses. By determining the focus position of the telephoto lens based on the focus position of the wide-angle lens, the system can directly move to the focus position to focus, avoiding repeated adjustments.
With the pre-stored focus position relationship table, telephoto lenses can quickly focus, improving the smoothness of lens switching and user experience.
Smart Images

Figure CN119031242B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automatic camera focusing technology, and in particular to a lens switching method, camera device and storage medium. Background Technology
[0002] In video conferencing or similar scenarios, it's often necessary to show close-ups of a speaker and switch between close-ups of different speakers. To achieve this, current technology typically uses a wide-angle lens and a telephoto lens. The wide-angle lens performs initial focusing and displays a wide-angle image. When the speaker's direction is detected, the telephoto lens switches to that direction and performs global focusing, displaying a telephoto image. When a change in the speaker's direction is detected, the telephoto lens switches to the new speaker's direction and refocuses, displaying a telephoto image.
[0003] During this process, the telephoto lens needs to be constantly refocused, which takes a long time and is not conducive to multiple switching of close-up shots. Summary of the Invention
[0004] This application provides a lens switching method to solve the above-mentioned technical problems. The lens switching method is applied to switching between wide-angle lenses and telephoto lenses, and includes:
[0005] A pre-stored table showing the focus position relationship between the wide-angle lens and the telephoto lens;
[0006] The wide-angle lens is focused to obtain the first focus position and the first image.
[0007] The user was detected to be in the first direction;
[0008] When the telephoto lens is switched to the first direction, the wide-angle lens obtains a second image.
[0009] Determine whether the first screen and the second screen are the same;
[0010] In response to the first image being the same as the second image, the second focus position of the telephoto lens is obtained from the focus position relationship table based on the first image and the first focus position.
[0011] Move the telephoto lens to the second focusing position to obtain the user's third view.
[0012] The first screen includes the area of the user's first head region, and the second screen includes the area of the user's second head region.
[0013] When the area of the first head region is the same as the area of the second head region, the first image is the same as the second image.
[0014] The step of obtaining the focus position of the telephoto lens from the focus position relationship table based on the first image and the second image further includes:
[0015] In response to the difference between the first screen and the second screen, it is determined whether the area of the first head region is larger than the area of the second head region;
[0016] In response to the fact that the area of the first head region is larger than the area of the second head region, the telephoto lens is moved in the direction of expanding the area of the second head region until it reaches the third focusing position to acquire the third image.
[0017] The step of determining whether the area of the first head region is greater than the area of the second head region further includes:
[0018] In response to the fact that the area of the first head region is smaller than the area of the second head region, the telephoto lens is moved in the direction of reducing the area of the second head region until it reaches the third focusing position to obtain the third image.
[0019] The step of pre-storing the focus position relationship table of the wide-angle lens and the telephoto lens includes:
[0020] Adjust the wide-angle lens to the first focusing position to capture the first image;
[0021] Based on the first image, the telephoto lens is moved until the third image is obtained, at which point the telephoto lens is located at the second focusing position;
[0022] Multiple first images, multiple first focus positions, and multiple second focus positions are acquired, and the multiple first images, multiple first focus positions, and multiple second focus positions are matched one-to-one to form the focus position relationship table.
[0023] The step of moving the telephoto lens to the focusing position and acquiring the user's third view further includes:
[0024] In response to the detection that a second user is located in the second direction;
[0025] The telephoto lens is moved to the second direction, and a fourth image is obtained through the wide-angle lens; wherein, the fourth image includes the area of the third head region of the second user;
[0026] Determine whether the area of the third head region is within a preset threshold range of the area of the second head region;
[0027] In response to the fact that the area of the third head region exists within a preset threshold range of the area of the second head region, the telephoto lens moves to the second focusing position and acquires the fifth image.
[0028] The step of determining whether the area of the third head region is within a preset threshold range of the area of the second head region further includes:
[0029] In response to the fact that the area of the third head region does not exist within a preset threshold range of the area of the second head region, it is determined whether the area of the third head region is greater than the area of the first head region.
[0030] In response to the fact that the area of the third head region is larger than the area of the first head region, the telephoto lens is moved in the direction of reducing the area of the third head region until it reaches the fourth focusing position to obtain the fifth image.
[0031] The step of determining whether the area of the third head region is greater than the area of the first head region further includes:
[0032] In response to the fact that the area of the third head region is smaller than the area of the first head region, the telephoto lens is moved in the direction of expanding the area of the third head region until it reaches the fourth focusing position to obtain the fifth image.
[0033] The step of moving the telephoto lens to the focusing position to obtain a close-up image of the user further includes:
[0034] In response to detecting multiple users or not detecting any users;
[0035] The first image captured by the wide-angle lens is obtained.
[0036] The microphone detects a user whose sound exceeds a preset threshold in the first image and determines the user's direction as the first direction.
[0037] To address the aforementioned technical problems, this application also provides a camera device, including a wide-angle lens, a telephoto lens, and a microphone, to implement the method described above.
[0038] The camera device includes a processor and a memory. The memory stores control instructions, and the processor executes the control instructions to control the wide-angle lens, the telephoto lens, and the microphone to achieve the method described above.
[0039] To address the aforementioned technical problems, this application also provides a computer-readable storage medium storing control instructions that are executed by a processor to implement the method described above.
[0040] The beneficial effects of this application are as follows: Unlike existing technologies, the lens switching method of this application is applied to the switching between wide-angle and telephoto lenses. First, a focus position relationship table for the wide-angle and telephoto lenses is pre-stored. The wide-angle lens completes its first focus, reaches the first focus position, and obtains a first image. If the user is detected in a first direction, the telephoto lens is switched to that direction, while the wide-angle lens obtains a second image. It is then determined whether the first and second images are the same. If they are, the second focus position of the telephoto lens is obtained from the focus position relationship table based on the first image and the first focus position. The telephoto lens is then moved to the second focus position to obtain the user's third image. Through this method, a focus position relationship table for the wide-angle and telephoto lenses is pre-established. When the wide-angle lens reaches the first focus position, it is determined whether the focus plane of the wide-angle lens has changed before and after the telephoto lens moves. If it has not changed, the focus position of the telephoto lens is directly obtained from the focus position relationship table, eliminating the need for repeated adjustments. The telephoto lens can quickly focus and obtain the user's third image. Ensure smooth switching between telephoto lenses and improve the user experience of switching lenses. Attached Figure Description
[0041] Figure 1 This is a flowchart illustrating the first embodiment of the lens switching method of this application;
[0042] Figure 2 This is a flowchart illustrating the second embodiment of the lens switching method of this application;
[0043] Figure 3 This is a flowchart illustrating an embodiment of step S11 of this application;
[0044] Figure 4 This is a flowchart illustrating the third embodiment of the lens switching method of this application;
[0045] Figure 5 This is a flowchart illustrating the fourth embodiment of the lens switching method of this application;
[0046] Figure 6 This is a schematic diagram of the camera equipment provided in this application;
[0047] Figure 7 This is a schematic diagram of the structure of the computer-readable storage medium provided in this application.
[0048] Reference numerals: 1. Camera device; 11. Processor; 12. Memory; 2. Computer-readable storage medium; 21. Control instructions. Detailed Implementation
[0049] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0050] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0051] Please see Figure 1 , Figure 1 This is a flowchart illustrating the lens switching method of this application. The lens switching method of this application is applied to switching between wide-angle and telephoto lenses. The wide-angle lens is primarily used to capture the entire scene, while the telephoto lens is used to capture a specific area within the scene. Therefore, in multi-person video conferencing, the telephoto lens needs to continuously change its focus position to obtain close-up shots of different speakers. Additionally, the camera device of this application is also equipped with a microphone. The microphone is used to detect users in the environment where the camera device is located whose sound exceeds a preset threshold, determining that the user is currently speaking, and thus the telephoto lens provides a close-up of that user. The lens switching method provided by this application specifically includes the following steps:
[0052] S11: Pre-stored focus position relationship table.
[0053] In this embodiment, the camera device can obtain a focus position relationship table between the wide-angle lens and the telephoto lens in advance. The wide-angle lens has different focus positions for different focus planes, and the telephoto lens also has different focus positions for different focus planes. The different focus positions of the wide-angle lens and the telephoto lens on the same focus plane can be mapped one-to-one to generate a focus position relationship table between the wide-angle lens and the telephoto lens. Therefore, the camera device can find the focus position of the telephoto lens based on the focus plane and focus position of the wide-angle lens, or vice versa.
[0054] S12: Perform initial focusing on the wide-angle lens to obtain the initial focus position and the first image.
[0055] The first focusing of the wide-angle lens involves moving it to the focusing position, where the entire scene is clearest. This focusing position is recorded as the first focusing position, and the image captured by the wide-angle lens at this point is recorded as the first frame. The first frame is the clear image of the entire scene when the telephoto lens is stationary; it is the focusing plane corresponding to the first focusing position of the wide-angle lens.
[0056] S13: User detected in the first direction.
[0057] This method uses a directional sound pickup algorithm to detect the user's location. The directional sound pickup algorithm picks up the target signal in a noisy environment and detects the source of the target signal's propagation, thereby obtaining the direction of the target signal's propagation and achieving target localization.
[0058] In this embodiment, the microphone detects the user's voice, determines the direction of the sound in the environment that exceeds a preset threshold, and records it as the first direction. The user in the first direction is identified as the user who is speaking, thereby locating the user. That is, at this time, the user in the first direction is speaking, and it is necessary to switch to a close-up shot of the user who is speaking.
[0059] The preset threshold can be a sound decibel level set by the user. When the sound decibel level detected by the microphone exceeds the preset threshold, it is determined that the user is speaking and the microphone will track and locate the sound. When the sound decibel level detected by the microphone does not exceed the preset threshold, it is determined to be ambient noise and the microphone will not track it.
[0060] S14: The telephoto lens switches to the first direction, and the wide-angle lens obtains the second image.
[0061] Switch the telephoto lens to the first direction, which is the direction the user is in. The image displayed in the wide-angle lens will change according to the angle of the telephoto lens. After the telephoto lens angle changes, the wide-angle lens will obtain a new full-scene image, which is called the second image. The second image is the full-scene image after the telephoto lens moves in a certain direction.
[0062] S15: Determine whether the first screen and the second screen are the same.
[0063] In this embodiment, the first image is the full scene captured by the wide-angle lens when the telephoto lens is not moving, and the second image is the full scene captured by the wide-angle lens after the telephoto lens moves. It is determined whether the first image and the second image are the same, that is, whether the full scene image remains unchanged in the field of view captured by the wide-angle lens before and after the telephoto lens moves. Furthermore, it can be determined whether the focus plane of the wide-angle lens has changed at this time.
[0064] The first frame includes the area of the first user's head in the wide-angle lens, which is the area occupied by the first user in the wide-angle lens. The second frame includes the area of the first user's second head in the wide-angle lens. When the areas of the first and second head regions of the first user are equal, it can be determined that the first and second frames are the same. This indicates that the area occupied by the first user in the wide-angle lens frame did not change before and after the telephoto lens moved. In other words, the first focus position and focus plane of the wide-angle lens did not change at this time. That is, the focus position of the telephoto lens corresponding to the focus plane determined by the wide-angle lens before the telephoto lens moved is the same as the focus position of the telephoto lens after the telephoto lens moved.
[0065] When it is determined that the first screen and the second screen are equal, proceed to step S16.
[0066] S16: Based on the first focus position and the first image, obtain the second focus position of the telephoto lens.
[0067] In this embodiment, the first image is the image obtained by the wide-angle lens at the first focusing position and the corresponding focusing plane, and the second image is the image obtained by the wide-angle lens at the first focusing position after the telephoto lens has moved in the desired direction. Since the first and second images are identical, meaning the focusing plane of the wide-angle lens remains unchanged, the telephoto lens can directly move to the focusing position corresponding to the focusing plane determined by the wide-angle lens. At this time, the camera device obtains the second focusing position of the telephoto lens according to a pre-stored focusing position relationship table.
[0068] S17: Move the telephoto lens to the second focus position to capture the third image.
[0069] Based on the focus position of the telephoto lens obtained in step S16, the telephoto lens is moved directly to the second focus position for focusing, and at the same time, the telephoto lens acquires the third image, which is the clear close-up image of the user.
[0070] By using a pre-stored focus position relationship table of wide-angle and telephoto lenses in the camera device, when the first focus position and first plane of the wide-angle lens are obtained, the telephoto lens can directly obtain its own focus position at this time and move to the focus position to focus on the user. There is no need to repeatedly adjust the focus, saving the focus adjustment time of the telephoto lens, ensuring the smoothness of telephoto lens switching, and improving the user's experience of lens switching.
[0071] In practical applications, the preferred scenario in step S16 is that the first and second screens are the same. Under normal circumstances, the first and second screens are highly likely to be different. Please refer to [link / reference needed]. Figure 2 , Figure 2 This is a flowchart illustrating a second embodiment of the lens switching method of this application. When it is determined that the first frame and the second frame are different, the lens switching method of this application includes the following steps:
[0072] S21: The telephoto lens switches to the first direction, and the wide-angle lens obtains the second image.
[0073] S22: Determine whether the first screen and the second screen are the same.
[0074] The specific processes of steps S21 and S22 are the same as those of steps S14 and S15, so they will not be described in detail here. When the first screen and the second screen are different in step S22, the process proceeds to steps S23-S25.
[0075] S23: Determine whether the area of the first head region is greater than the area of the second head region.
[0076] The first frame includes the area of a first head region, and the second frame includes the area of a second head region. The head region area is the area occupied by the user in the frame captured by the wide-angle lens, and may include the height and width of the user's head, as well as the center position of the user's head. By comparing the head region areas of the same user in the first and second frames, the adjustment direction of the telephoto lens can be determined, allowing the telephoto lens to reach the focus position more quickly.
[0077] In this embodiment, if the area of the first head region is larger than the area of the second head region, it indicates that the image of the first user has been excessively magnified after the telephoto lens angle has been moved. At this time, the pixel area in the image is too large, affecting the smooth lines and shapes of the image, causing the image of the first user to be distorted and become blurry. Therefore, step S24 is performed to reduce the area of the displayed second head region.
[0078] If the area of the first head region is smaller than the area of the second head region, it means that the image of the first user is not large enough, the first user is at a distance from the focus plane, and the image is too small, so some details of the first user's image cannot be displayed. Therefore, step S25 is taken to enlarge the area of the second head region.
[0079] S24: The telephoto lens moves in the direction of reducing the area of the second head, reaches the third focus position, and captures the third image.
[0080] In this embodiment, in response to the fact that the area of the first head region is larger than the area of the second head region, the image of the first user in the wide-angle lens is too large and blurry. It is necessary to move the telephoto lens in the direction of reducing the area of the second head region of the first user until the telephoto lens reaches the focus position where a clear close-up image of the user is obtained, which is the third focus position. At this time, the telephoto lens obtains a clear close-up image of the user, which is recorded as the third image.
[0081] S25: The telephoto lens moves in the direction of expanding the area of the second head, reaches the third focus position, and captures the third image.
[0082] In this embodiment, in response to the fact that the area of the first head region is smaller than the area of the second head region, the image of the first user in the wide-angle lens is too small and the details cannot be fully presented. The telephoto lens needs to be moved in the direction of expanding the area of the second head region of the first user until the telephoto lens is moved to the focus position to obtain a clear close-up image of the user, which is the third focus position. At this time, the telephoto lens obtains a clear close-up image of the user, which is recorded as the third image.
[0083] In summary, after the telephoto lens changes direction, it needs to be refocused. If the first and second images are the same, the second focus position of the telephoto lens can be directly obtained through the focus position relationship table, allowing the telephoto lens to quickly complete focusing. If the first and second images are different, the area of the user's head region in the first and second images is compared. Based on the size relationship between the areas of the first and second head regions, the focus adjustment direction of the telephoto lens is determined, saving focus adjustment time.
[0084] In this embodiment, the camera device pre-obtains a focus position relationship table between the wide-angle lens and the telephoto lens to save focus adjustment time for the telephoto lens. For example... Figure 3 As shown, Figure 3 This is a flowchart illustrating an embodiment of step S11 of this application. Obtaining the focus position relationship table includes the following steps:
[0085] S31: Adjust the wide-angle lens to the first focus position and capture the first image.
[0086] In this embodiment, the position of the wide-angle lens is first adjusted to a position where it can capture a clear image of the entire scene. The adjusted position of the wide-angle lens is recorded as the first focus position, and the image captured at the first focus position is recorded as the first image. The first image is the focus plane corresponding to the wide-angle lens at the first focus position.
[0087] S32: The telephoto lens moves until it captures the third image. At this point, the telephoto lens is in the second focus position.
[0088] In this process, the telephoto lens moves back and forth relative to the wide-angle lens until it captures the third image, which is a clear close-up of the user's view. The position of the telephoto lens is designated as the second focus position. Therefore, when the wide-angle lens is at the first focus position, the telephoto lens at the second focus position can capture the third image.
[0089] S33: Acquire multiple first images, multiple first focus positions, and multiple second focus positions to form a focus position relationship table.
[0090] By adjusting the position of the wide-angle lens and the telephoto lens, multiple first images, multiple first focus positions, and multiple corresponding second focus positions can be obtained. By mapping the multiple first images, multiple first focus positions, and multiple corresponding second focus positions one by one, a focus position relationship table of the wide-angle lens and the telephoto lens can be formed.
[0091] In this embodiment, if the user requiring close-up shots changes, the telephoto lens needs to be moved and refocused. Please refer to [link to relevant documentation]. Figure 4 , Figure 4 This is a flowchart illustrating the third embodiment of the lens switching method of this application. The refocusing adjustment of the telephoto lens includes the following steps:
[0092] S41: A second user has been detected in the second direction.
[0093] In this embodiment, the microphone detects a change in the direction of sound exceeding a preset threshold in the environment, and then determines the direction of sound propagation to locate the second user. When the direction of sound propagation is detected to be the second direction, it is determined that the second user is located in the second direction.
[0094] S42: The telephoto lens moves to the second direction, and the wide-angle lens captures the fourth image.
[0095] The telephoto lens moves to the second direction, at which point the wide-angle lens captures the fourth frame after the telephoto lens has moved. This fourth frame includes the area of the second user's third head.
[0096] S43: Determine whether the area of the third head region is within the preset threshold range of the area of the second head region.
[0097] The preset threshold range can be determined based on the user's experience using the camera equipment. In other embodiments, it can also be determined based on the factory settings of the camera equipment. This application does not limit this.
[0098] Due to individual differences among users, the area of the head region on the same focusing plane may not be the same for different users. Therefore, if the area of a user's head region is within the preset threshold range of another user's head region area, it can be determined that the two users are on the same focusing plane.
[0099] If the area of the second user's head in the fourth frame is within the preset threshold range of the area of the first user's head in the second frame, it means that the two users exist on the same focal plane of the wide-angle lens before and after the telephoto lens moves. At this time, the settings of the telephoto lens in the second frame can be directly applied to the fourth frame, i.e., proceed to step S44.
[0100] S44: Move the telephoto lens to the second focus position to capture the fifth image.
[0101] Since the telephoto lens's focus position in the second frame is the second focus position, its focus position in the fourth frame should also be the second focus position. Moving the telephoto lens directly to the second focus position yields the fifth frame, which is the clear close-up of the second user.
[0102] In most cases, the area of the third head region does not exist within the preset threshold range of the area of the second head region, then proceed to steps S45-S47.
[0103] S45: Determine whether the area of the third head region is greater than the area of the first head region.
[0104] If the area of the third head region does not exist within the preset threshold range of the area of the second head region, it is determined whether the area of the third head region is greater than the area of the first head region, thereby determining the focus adjustment direction of the telephoto lens.
[0105] If it is determined that the area of the third head region is larger than the area of the first head region, then proceed to step S46.
[0106] If it is determined that the area of the third head region is smaller than the area of the first head region, then proceed to step S47.
[0107] S46: The telephoto lens moves in the direction of reducing the area of the third person's head until it reaches the fourth focus position, thus capturing the fifth image.
[0108] In response to the fact that the area of the third head region is larger than the area of the first head region, that is, when the focus position of the telephoto lens moves beyond the standard focus position of the telephoto lens in the focus position relationship table of the wide-angle lens in the fourth frame, it needs to move in the direction of reducing the area of the third head region until it reaches the focus position where the wide-angle lens can obtain a clear image of the user in the fourth frame, that is, the fourth focus position. At this time, the telephoto lens obtains a clear close-up image of the user, which is recorded as the fifth frame.
[0109] S47: The telephoto lens moves in the direction of expanding the area of the third person's head until it reaches the fourth focus position, thus capturing the fifth image.
[0110] In this embodiment, if the area of the third head region is smaller than the area of the first head region, that is, the focus position of the telephoto lens has not yet reached the standard focus position of the telephoto lens in the focus position relationship table of the wide-angle lens in the fourth frame, the telephoto lens needs to move further in the direction of expanding the area of the third head region until it reaches the focus position where the wide-angle lens can obtain a clear image of the user in the fourth frame, which is the fifth focus position. At this time, the telephoto lens obtains a clear close-up image of the user, which is recorded as the fifth frame.
[0111] By comparing the head area of two users, the focus adjustment of the telephoto lens after movement is simplified. When the area of the second user's head area is determined to be within a preset threshold range of the area of the first user's head area, the settings of the camera device when displaying the close-up of the first user are directly applied to the display of the close-up of the second user, allowing the telephoto lens to adjust focus in one step and achieve rapid switching. When the area of the second user's head area is determined to be within a preset threshold range of the first user's head area, the focus adjustment direction of the telephoto lens is determined by judging the size relationship between the head areas of the first and second users, enabling the telephoto lens to complete focusing in the shortest possible time. This method allows the telephoto lens to focus relatively quickly when switching to close-up shots of other users, improving the user experience.
[0112] Please see Figure 5 , Figure 5 This is a flowchart illustrating the fourth embodiment of the lens switching method of this application. The lens switching method provided in this application further includes the following steps:
[0113] S51: Multiple users detected or no users detected.
[0114] In this embodiment, if the microphone detects that there are multiple sounds in the environment exceeding the threshold and distributed in different directions, that is, multiple users are talking; or if it detects that there are no sounds in the environment exceeding the preset threshold, that is, no user is talking; and it is impossible to display a close-up image of one of the users, then proceed to step S52.
[0115] S52: Capture the first shot from the wide-angle lens.
[0116] Since it is not possible to show close-up shots of any one of the users at this time, the camera device captures the first shot from the wide-angle lens to show the entire scene.
[0117] The lens switching method of this application, by pre-storing a focus position relationship table for wide-angle and telephoto lenses, allows the telephoto lens to directly retrieve its second focus relationship from the focus position relationship table when the wide-angle lens determines the first focus position and the first frame, thus avoiding wasted focus adjustment time for the telephoto lens. After the telephoto lens moves in a certain direction, the area of the head region in the second frame captured by the wide-angle lens is compared with that in the first frame to determine the focus adjustment direction of the telephoto lens, saving focus adjustment time. After the microphone identifies the second user, the camera group compares the head region areas of the two users in the telephoto lens to determine the focus adjustment direction of the telephoto lens, enabling it to quickly reach the focus position and display the image. This allows the telephoto lens to quickly switch to close-up shots of the user, improving the user experience.
[0118] This application also provides a camera device, including a processor 11, a memory 12, a wide-angle lens, a telephoto lens, and a microphone (not shown), to implement the lens switching method described above.
[0119] Among them, such as Figure 6 As shown, Figure 6 This is a schematic diagram of the camera device provided in this application. The camera device 1 includes a processor 11 and a memory 12. The memory 12 stores control instructions, and the processor 11 executes the control instructions to control the wide-angle lens, the telephoto lens, and the microphone to implement the method described above.
[0120] In this embodiment, processor 11 may also be referred to as a CPU (Central Processing Unit). Processor 11 may be an integrated circuit chip with signal processing capabilities. Processor 11 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor may be a microprocessor, or processor 11 may be any conventional processor.
[0121] This application also provides a computer-readable storage medium; please continue reading. Figure 7 , Figure 7 This is a schematic diagram of the structure of the computer-readable storage medium provided in this application. The computer-readable storage medium 2 stores control instructions 21, which, when executed by the processor 11, are used to implement the pose estimation method of the above embodiments.
[0122] When the embodiments of this application are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0123] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for switching lenses, characterized in that, Applications for switching between wide-angle and telephoto lenses include: A pre-stored table showing the focus position relationship between the wide-angle lens and the telephoto lens; The wide-angle lens is focused to obtain the first focus position and the first image. The user was detected to be in the first direction; When the telephoto lens is switched to the first direction, the wide-angle lens obtains a second image. Determine whether the first screen and the second screen are the same; In response to the first image being the same as the second image, the second focus position of the telephoto lens is obtained from the focus position relationship table based on the first image and the first focus position. Move the telephoto lens to the second focusing position to obtain the user's third view.
2. The method according to claim 1, characterized in that, The first screen includes the area of the user's first head region, and the second screen includes the area of the user's second head region; When the area of the first head region is the same as the area of the second head region, the first image is the same as the second image.
3. The method according to claim 2, characterized in that, The step of obtaining the focus position of the telephoto lens from the focus position relationship table based on the first image and the second image further includes: In response to the difference between the first screen and the second screen, it is determined whether the area of the first head region is larger than the area of the second head region; In response to the fact that the area of the first head region is larger than the area of the second head region, the telephoto lens is moved in the direction of expanding the area of the second head region until it reaches the third focus position to acquire the third image.
4. The method according to claim 3, characterized in that, The step of determining whether the area of the first head region is greater than the area of the second head region further includes: In response to the fact that the area of the first head region is smaller than the area of the second head region, the telephoto lens is moved in the direction of reducing the area of the second head region until it reaches the third focusing position to obtain the third image.
5. The method according to claim 1, characterized in that, The step of pre-storing the focus position relationship table of the wide-angle lens and the telephoto lens includes: Adjust the wide-angle lens to the first focusing position to capture the first image; Based on the first image, the telephoto lens is moved until the third image is obtained, at which point the telephoto lens is located at the second focusing position; Multiple first images, multiple first focus positions, and multiple second focus positions are acquired, and the multiple first images, multiple first focus positions, and multiple second focus positions are matched one-to-one to form the focus position relationship table.
6. The method according to claim 2, characterized in that, After the step of moving the telephoto lens to the second focusing position and acquiring the user's third image, the method further includes: In response to the detection that a second user is located in the second direction; The telephoto lens is moved to the second direction, and a fourth image is obtained through the wide-angle lens; wherein, the fourth image includes the area of the third head region of the second user; Determine whether the area of the third head region is within a preset threshold range of the area of the second head region; In response to the fact that the area of the third head region exists within a preset threshold range of the area of the second head region, the telephoto lens moves to the second focusing position and acquires the fifth image.
7. The method according to claim 6, characterized in that, The step of determining whether the area of the third head region is within the preset threshold range of the area of the second head region further includes: In response to the fact that the area of the third head region does not exist within a preset threshold range of the area of the second head region, it is determined whether the area of the third head region is greater than the area of the first head region. In response to the fact that the area of the third head region is larger than the area of the first head region, the telephoto lens is moved in the direction of reducing the area of the third head region until it reaches the fourth focus position to obtain the fifth image.
8. The method according to claim 7, characterized in that, The step of determining whether the area of the third head region is greater than the area of the first head region further includes: In response to the fact that the area of the third head region is smaller than the area of the first head region, the telephoto lens is moved in the direction of expanding the area of the third head region until it reaches the fourth focusing position to obtain the fifth image.
9. The method according to claim 1, characterized in that, After the step of moving the telephoto lens to the second focusing position and acquiring the user's third image, the method further includes: In response to detecting multiple users or not detecting any users; The first image captured by the wide-angle lens is obtained.
10. The method according to claim 1, characterized in that, The microphone detects a user whose sound exceeds a preset threshold in the first image and determines the user's direction as the first direction.
11. A camera device, characterized in that, The camera device includes a wide-angle lens, a telephoto lens, and a microphone to implement the method as described in any one of claims 1-10.
12. The camera device according to claim 11, characterized in that, The camera device includes a processor and a memory, the memory storing control instructions, and the processor executing the control instructions to control the wide-angle lens, the telephoto lens, and the microphone to implement the method as described in any one of claims 1-10.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores control instructions that are executed by a processor to implement the method as described in any one of claims 1-10.
Citation Information
Patent Citations
Auxiliary light pattern projection device, camera, and camera system
JP2008170782A
Optical device
JP2016071219A