IP Library › Granted Patent US 12,568,302
Granted Patent B2
US 12,568,302 · App. 18/686,672 · Granted Mar 3, 2026

Method and electronic device for switching from a first camera to a second camera based on a focus condition

Inventors: Guangyuan Li (Shenzhen, CN); Li Wang (Shenzhen, CN)
Assignee: HONOR DEVICE CO., LTD.
H04N23/632H04M1/72403H04N23/62H04N23/667H04N23/671H04N23/90H04M2250/52
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,568,302
App. No.
18/686,672
Granted
Mar 3, 2026
Kind
B2
Abstract

This application provides a camera switching method and an electronic device, and relates to the field of terminal technologies. An electronic device receives a first operation of a user. In a scenario in which an actual photographing distance is less than a first value, the electronic device displays a first interface in response to the first operation, where the first interface is used to display an image frame collected by the first camera, and the first value is a minimum focusing distance of a first camera. When the electronic device determines that a first condition is met, the electronic device displays a second interface, where the second interface is a preview framing interface used by the electronic device for photographing.

Claims (76)

1 . A camera switching method, applied to an electronic device, wherein the electronic device comprises a first camera and a second camera, and the method comprises:

receiving, by the electronic device, a first operation of a user;

in a scenario in which a photographing distance between the electronic device and a photographed object is less than a first value, displaying, by the electronic device, a first interface in response to the first operation, wherein the first interface is a preview framing interface used by the electronic device for photographing, the first interface is used to display an image frame captured by the first camera, and the first value is a minimum focusing distance of the first camera; and

displaying, by the electronic device, a second interface when the electronic device determines that a first condition is met, wherein the second interface is a preview framing interface used by the electronic device for photographing, the second interface is used to display an image frame captured by the second camera, and a minimum focusing distance of the second camera is less than the first value, wherein

the first condition comprises: a focusing status of the first camera is that focusing fails, and a sum of a defocus value of the first camera and a corresponding second value is less than a preset first threshold, wherein the second value is used to indicate a focus adjustment location of a lens in the first camera.

2 . The camera switching method according to claim 1 , wherein the method further comprises:

determining, during display of the second interface by the electronic device, that a second condition is met, wherein the second condition comprises: the focusing status of the first camera is that focusing succeeds, and an absolute defocus value of the first camera is less than a preset second threshold;

determining, by the electronic device, a predicted object distance corresponding to a voice coil motor (VCM) code of the first camera; and

when the predicted object distance is not less than the first value and is less than a third value, continuing, by the electronic device, to display the second interface, wherein the third value is a preset value.

3 . The camera switching method according to claim 1 , wherein the method further comprises:

determining, during display of the second interface by the electronic device, that a second condition is met, wherein the second condition comprises: the focusing status of the first camera is that focusing succeeds, and an absolute defocus value of the first camera is less than a preset second threshold;

determining, by the electronic device, a predicted object distance corresponding to a voice coil motor (VCM) code of the first camera; and

when the predicted object distance is greater than a third value, switching, by the electronic device, to display the first interface, wherein the third value is a preset value.

4 . The camera switching method according to claim 3 , wherein after the switching, by the electronic device, to display the first interface, the method further comprises:

disabling, by the electronic device, the second camera.

5 . The camera switching method according to claim 3 , wherein the method further comprises:

determining, during display of the first interface by the electronic device, that the second condition is met;

determining, by the electronic device, the predicted object distance corresponding to the VCM code of the first camera; and

when the predicted object distance is not less than a fourth value and is less than the third value, continuing, by the electronic device, to display the first interface, wherein the fourth value is a preset value greater than the first value.

6 . The camera switching method according to claim 5 , wherein the method further comprises:

determining, during display of the first interface by the electronic device, that the second condition is met;

determining, by the electronic device, the predicted object distance corresponding to the VCM code of the first camera; and

when the predicted object distance is less than the fourth value, switching, by the electronic device, to display the second interface.

7 . The camera switching method according to claim 1 , wherein before the displaying the second interface, the method further comprises:

collecting, by the electronic device, ambient lighting information; and

determining, by the electronic device, that the ambient lighting information is greater than a preset dark light threshold.

8 . The camera switching method according to claim 1 , wherein the second interface comprises a first identifier, the first identifier is used to remind that an image frame in the second interface is captured by the second camera, and the method further comprises:

receiving, by the electronic device during display of the second interface, a second operation performed by the user on the first identifier; and

switching, by the electronic device in response to the second operation, to display the first interface.

9 . The camera switching method according to claim 1 , wherein the method further comprises:

determining, during display of the second interface by the electronic device, that a third condition is not met, wherein the third condition comprises: the focusing status of the first camera is that focusing succeeds, an absolute defocus value of the first camera is less than a preset second threshold, and a predicted object distance corresponding to a voice coil motor (VCM) code of the first camera is less than a third value, wherein the third value is a preset value;

determining, by the electronic device, that a fourth condition is met, wherein the fourth condition comprises: a focusing status of the second camera is that focusing succeeds, an absolute defocus value of the second camera is less than the preset second threshold, and a predicted object distance corresponding to a VCM code of the second camera is less than the third value; and

continuing, by the electronic device, to display the second interface.

10 . The camera switching method according to claim 9 , wherein before the determining, by the electronic device, that a fourth condition is met, the method further comprises: determining, by the electronic device, that the VCM code of the second camera is trustworthy, wherein

a case in which the VCM code of the second camera is trustworthy comprises any one of the following:

the second camera is pre-marked with a trusted identifier; and

module information of the second camera indicates that the second camera is not a fixed-focus module and is not an open-loop module.

11 . The camera switching method according to claim 1 , wherein before the displaying, by the electronic device, a second interface, the method further comprises: enabling, by the electronic device, the second camera.

12 . An electronic device, comprising:

a first camera;

a second camera;

one or more processors; and

memory coupled to the processor, wherein the memory stores computer program code, the computer program code comprises computer instructions, and when the one or more processors execute the computer instructions, the electronic device is enabled to:

receive a first operation of a user;

in a scenario in which a photographing distance between the electronic device and a photographed object is less than a first value, display a first interface in response to the first operation, wherein the first interface is a preview framing interface used by the electronic device for photographing, the first interface is used to display an image frame captured by the first camera, and the first value is a minimum focusing distance of the first camera; and

display a second interface when the electronic device determines that a first condition is met, wherein the second interface is a preview framing interface used by the electronic device for photographing, the second interface is used to display an image frame captured by the second camera, and a minimum focusing distance of the second camera is less than the first value, wherein

the first condition comprises: a focusing status of the first camera is that focusing fails, and a sum of a defocus value of the first camera and a corresponding second value is less than a preset first threshold, wherein the second value is used to indicate a focus adjustment location of a lens in the first camera.

13 . The electronic device according to claim 12 , wherein when the one or more processors execute the computer instructions, the electronic device is enabled to:

determine, during display of the second interface by the electronic device, that a second condition is met, wherein the second condition comprises: the focusing status of the first camera is that focusing succeeds, and an absolute defocus value of the first camera is less than a preset second threshold;

determine a predicted object distance corresponding to a voice coil motor (VCM) code of the first camera; and

when the predicted object distance is not less than the first value and is less than a third value, continue to display the second interface, wherein the third value is a preset value.

14 . The electronic device according to claim 12 , wherein when the one or more processors execute the computer instructions, the electronic device is enabled to:

determine, during display of the second interface by the electronic device, that a second condition is met, wherein the second condition comprises: the focusing status of the first camera is that focusing succeeds, and an absolute defocus value of the first camera is less than a preset second threshold;

determine a predicted object distance corresponding to a voice coil motor (VCM) code of the first camera; and

when the predicted object distance is greater than a third value, switch to display the first interface, wherein the third value is a preset value.

15 . The electronic device according to claim 14 , wherein when the one or more processors execute the computer instructions, the electronic device is enabled to:

after switching to display the first interface, disable the second camera.

16 . The electronic device according to claim 14 , wherein when the one or more processors execute the computer instructions, the electronic device is enabled to:

determine, during display of the first interface by the electronic device, that the second condition is met;

determine the predicted object distance corresponding to the VCM code of the first camera; and

when the predicted object distance is not less than a fourth value and is less than the third value, continue to display the first interface, wherein the fourth value is a preset value greater than the first value.

17 . A non-transitory computer readable storage medium storing instructions that are executable by at least one processor, wherein when the instructions are executed by the at least one processor, an electronic device is enabled to:

receive a first operation of a user;

in a scenario in which a photographing distance between the electronic device and a photographed object is less than a first value, display a first interface in response to the first operation, wherein the first interface is a preview framing interface used by the electronic device for photographing, the first interface is used to display an image frame captured by a first camera of the electronic device, and the first value is a minimum focusing distance of the first camera; and

display a second interface when the electronic device determines that a first condition is met, wherein the second interface is a preview framing interface used by the electronic device for photographing, the second interface is used to display an image frame captured by a second camera of the electronic device, and a minimum focusing distance of the second camera is less than the first value, wherein

the first condition comprises: a focusing status of the first camera is that focusing fails, and a sum of a defocus value of the first camera and a corresponding second value is less than a preset first threshold, wherein the second value is used to indicate a focus adjustment location of a lens in the first camera.

18 . The non-transitory computer readable storage medium according to claim 17 , wherein when the instructions are executed by the at least one processor, the electronic device is enabled to:

determine, during display of the second interface by the electronic device, that a second condition is met, wherein the second condition comprises: the focusing status of the first camera is that focusing succeeds, and an absolute defocus value of the first camera is less than a preset second threshold;

determine a predicted object distance corresponding to a voice coil motor (VCM) code of the first camera; and

when the predicted object distance is not less than the first value and is less than a third value, continue to display the second interface, wherein the third value is a preset value.

19 . The non-transitory computer readable storage medium according to claim 17 , wherein when the instructions are executed by the at least one processor, the electronic device is enabled to:

determine, during display of the second interface by the electronic device, that a second condition is met, wherein the second condition comprises: the focusing status of the first camera is that focusing succeeds, and an absolute defocus value of the first camera is less than a preset second threshold;

determine a predicted object distance corresponding to a voice coil motor (VCM) code of the first camera; and

when the predicted object distance is greater than a third value, switch to display the first interface, wherein the third value is a preset value.

20 . The non-transitory computer readable storage medium according to claim 17 , wherein when the instructions are executed by the at least one processor, the electronic device is enabled to:

after switching to display the first interface, disable the second camera.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 27, 2024
From: LI, GUANGYUAN; WANG, LI
To: HONOR DEVICE CO., LTD.
Reel/Frame 066568/0581 →
Priority Claims (1)
CN 202210605721.X · May 30, 2022 · national
Continuity (1)
Related Publication 20250142202A1 · May 1, 2025
References Cited (23)
US 12010408B2 · Feng et al. · 2024 [cited by applicant]
US 20110157456A1 · Hongu · 2011 [cited by applicant]
US 20170208239A1 · Chien et al. · 2017 [cited by applicant]
US 20210321043A1 · Arora et al. · 2021 [cited by applicant]
US 20230224575A1 · Chenchen et al. · 2023 [cited by applicant]
US 20240056683A1 · Lin et al. · 2024 [cited by applicant]
CN 102111551A · 2011 [cited by applicant]
CN 106197366A · 2016 [cited by applicant]
CN 106506957A · 2017 [cited by applicant]
CN 110248081A · 2019 [cited by applicant]
CN 111654629A · 2020 [cited by applicant]
CN 112601008A · 2021 [cited by applicant]
CN 113099102A · 2021 [cited by applicant]
CN 113132620A · 2021 [cited by applicant]
CN 113556466A · 2021 [cited by applicant]
EP 2747413A1 · 2014 [cited by applicant]
EP 4030745A1 · 2022 [cited by applicant]
JP 2000231055A · 2000 [cited by applicant]
JP 2010217262A · 2010 [cited by applicant]
JP 2022006844A · 2022 [cited by applicant]
WO 2020073959A1 · 2020 [cited by applicant]
WO 2021000063A1 · 2021 [cited by applicant]
WO 2021185296A1 · 2021 [cited by applicant]