Folding angle calculation method, device, electronic device and storage medium

The image of the folding terminal is obtained through the camera module and the folding angle is calculated, which solves the problem of low accuracy caused by the inertial sensor, and achieves higher accuracy and stable folding angle detection.

CN113313758BActive Publication Date: 2024-12-20VIVO MOBILE COMM CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202110594917.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-28
Publication Date
2024-12-20
Estimated Expiration
2041-05-28

AI Technical Summary

Technical Problem

The existing method of folding angle calculation of folding terminals relies on inertial sensors and is susceptible to external environments, resulting in low calculation accuracy and unreliable results.

Method used

The image of the folding terminal is obtained through the camera module, and the correlation between the reference image and the actual image is used to calculate the folding angle, avoid relying on sensor data and improve calculation accuracy.

Benefits of technology

It improves the calculation accuracy of folding angle, reduces external environmental interference, and provides more reliable folding angle detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113313758B_ABST
    Figure CN113313758B_ABST
Patent Text Reader

Abstract

The present application discloses a folding angle calculation method, device, electronic device and storage medium, which belongs to the field of terminal computing. The method comprises: obtaining a first image of a target object on a first folding body in a camera module, wherein the camera module is located on a second folding body; calculating the folding angle of the folding terminal according to a reference image and the first image; wherein the reference image is a second image of the target object on the first folding body in the camera module when the folding terminal is folded at a preset angle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of terminal technology, and specifically relates to a folding angle calculation method, device, electronic device and storage medium. Background Art

[0002] With the continuous development of electronic devices, foldable terminals are increasingly recognized as an innovative form of electronic devices. In the application of foldable terminals, the folding angle is an important data. Many applications rely on the folding angle to perform some unique logic. For example, if the angle is detected to be book mode, split screen processing is performed.

[0003] At present, most methods for calculating the folding angle of foldable terminals are calculated through inertial measurement unit (IMU), that is, two inertial sensors are placed on both sides of the foldable terminal, and the folding angle is calculated through the acceleration data of the two inertial sensors. The defect of this method is that the inertial sensor is easily affected by the external environment, which ultimately affects the calculation results and has low accuracy. For example, when the user is walking, the acceleration data of the inertial sensor will change dramatically, resulting in the calculation results based on the acceleration data being unreliable. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a folding angle calculation method, device, electronic device and storage medium, which can solve the problems of low folding angle calculation accuracy and unreliable calculation results in related technologies.

[0005] In a first aspect, an embodiment of the present application provides a method for calculating a folding angle, the method comprising:

[0006] Acquire a first image of a target object on the first folding body in a camera module, wherein the camera module is located on the second folding body;

[0007] Calculating a folding angle of the foldable terminal according to the reference image and the first image;

[0008] The reference image is a second image of the target object on the first folding body in the camera module when the folding terminal is folded at a preset angle.

[0009] In a second aspect, an embodiment of the present application provides a folding angle calculation device, comprising:

[0010] An acquisition unit, used for acquiring a first image of a target object on the first folding body in a camera module, wherein the camera module is located on the second folding body;

[0011] a calculation unit, configured to calculate a folding angle of the foldable terminal according to a reference image and the first image;

[0012] The reference image is a second image of the target object on the first folding body in the camera module when the folding terminal is folded at a preset angle.

[0013] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the folding angle calculation method as described in the first aspect.

[0014] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the folding angle calculation method described in the first aspect are implemented.

[0015] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the folding angle calculation method as described in the first aspect.

[0016] In an embodiment of the present application, a first image of a target object on a first folding body is obtained in a camera module, and a folding angle of the folding terminal is calculated based on a reference image and the first image. The calculation of the folding angle is related to the image of the target object in the camera module and does not depend on sensor data. This improves the calculation accuracy of the folding angle and makes it less susceptible to the influence of the external environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 A schematic diagram of a flow chart of a folding angle calculation method provided in an embodiment of the present application;

[0018] Figure 2 A schematic diagram of calculating the folding angle of a foldable terminal using a camera module provided in an embodiment of the present application;

[0019] Figure 3 A schematic diagram of calculating a folding angle when the target object provided in an embodiment of the present application is an edge of the first folding body away from the connection axis;

[0020] Figure 4 A schematic diagram of calculating a folding angle when the target object provided in an embodiment of the present application is an icon displayed on a first folding body;

[0021] Figure 5 A schematic diagram of the structure of a folding angle calculation device provided in an embodiment of the present application;

[0022] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0023] Figure 7 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application. DETAILED DESCRIPTION

[0024] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0025] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0026] In the embodiments of the present application, the term "plurality" refers to two or more than two, and other quantifiers are similar.

[0027] The following is a detailed description of the folding angle calculation method provided in the embodiment of the present application through some embodiments and their application scenarios in conjunction with the accompanying drawings. The folding angle calculation method provided in the embodiment of the present application is executed by an electronic device, and the electronic device mentioned in the embodiment of the present application includes but is not limited to mobile phones, tablet computers, computers, wearable devices, etc.

[0028] The folding angle calculation method provided in the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in combination with the accompanying drawings.

[0029] Figure 1 Schematic diagram of the flow of the folding angle calculation method provided in the embodiment of the present application. Figure 1 As shown, the folding angle calculation method includes:

[0030] Step 100: Acquire a first image of a target object on a first folding body in a camera module.

[0031] The foldable terminal includes a first foldable body and a second foldable body. It should be noted that the first foldable body and the second foldable body are different bodies.

[0032] Wherein, the camera module is located on the second folding body.

[0033] Optionally, the second folding body of the folding terminal is provided with a camera module to meet the needs of video calls, and the camera module is relatively powerful, and in addition to taking clear photos, it also has other rich functions, such as ultra-wide angle, etc. The embodiment of the present application proposes a method for calculating a folding angle using a camera module.

[0034] In one embodiment, the camera module is a front camera.

[0035] Acquiring a first image of the target object on the first foldable body in the camera module may be understood as acquiring a first image obtained by photographing the target object on the first foldable body by the camera module.

[0036] The target object is located in the first folding body.

[0037] In one embodiment, when the foldable terminal is in a folded state, an image of a target object on a first foldable body is acquired in a camera module, and the image is a first image.

[0038] The target object is located in the first folding body.

[0039] It can be understood that the first image of the target object in the camera module will change with different folding angles.

[0040] Step 101: Calculate a folding angle of the foldable terminal according to a reference image and the first image.

[0041] The reference image is a second image of the target object on the first folding body in the camera module when the folding terminal is folded at a preset angle.

[0042] Optionally, the reference image is obtained in advance. The preset angle is preset, such as 30 degrees, 45 degrees, 60 degrees, etc., which are convenient for calculation.

[0043] Optionally, the foldable terminal calculates a folding angle of the foldable terminal based on an association relationship between the reference image and the first image.

[0044] In an embodiment of the present application, a first image of a target object on a first folding body is obtained in a camera module, and a folding angle of the folding terminal is calculated based on a reference image and the first image. The calculation of the folding angle is related to the image of the target object in the camera module and does not depend on sensor data. This improves the calculation accuracy of the folding angle and makes it less susceptible to the influence of the external environment.

[0045] Optionally, the target object is an edge of the first folding body away from the connection axis or an icon displayed on the first folding body.

[0046] The connecting axis refers to the connecting axis of the foldable terminal used to connect the first foldable body and the second foldable body. When the folding angle of the foldable terminal is different, the imaging position of the edge of the first foldable body away from the connecting axis in the camera module will change. This principle can be used to calculate the folding angle without being affected by the external environment.

[0047] Optionally, the target object may also be an icon displayed on the first folding body, such as a battery icon, a signal icon, a time icon, etc. When the folding angle of the folding terminal is different, the imaging area of ​​the icon displayed on the first folding body in the camera module will change. This principle can be used to calculate the folding angle without being affected by the external environment.

[0048] Optionally, when the target object is an edge of the first folding body away from the connection axis, acquiring a first image of the target object on the first folding body in the camera module includes:

[0049] When the first folding body is located within the imaging range of the camera module, acquiring a first image of an edge of the first folding body away from the connecting axis in the camera module;

[0050] Specifically, since the angle of the camera module after opening the ultra-wide angle is limited, when calculating the folding angle based on the camera module, it is necessary to satisfy that the first folding body is located within the imaging range of the camera module.

[0051] If the first folding body is located within the imaging range of the camera module, calculation is started. In one embodiment, a first image of an edge of the first folding body away from the connection axis in the camera module is acquired.

[0052] Optionally, calculating the folding angle of the foldable terminal according to the reference image and the first image includes:

[0053] Respectively acquiring first position information of the edge in the reference image and second position information of the edge in the first image;

[0054] A folding angle of the folding terminal is calculated according to the upper and lower side lengths of the first folding body, the first position information, the second position information, and the preset angle.

[0055] Optionally, edge detection and other algorithms are used to respectively obtain first position information of the edge in the reference image and second position information of the edge in the first image.

[0056] Furthermore, the folding angle of the folding terminal is calculated according to the upper and lower side lengths of the first folding body, the first position information, the second position information and the preset angle.

[0057] Figure 2 A schematic diagram of calculating the folding angle of a foldable terminal using a camera module provided in an embodiment of the present application.

[0058] The preset angle is 45 degrees. Figure 3 A schematic diagram of calculating the folding angle when the target object provided in the embodiment of the present application is the edge of the first folding body away from the connection axis. The reference image and the first image have the same size. Assume that the position of the left edge of the first folding body in the reference image at 45 degrees is first calibrated as Figure 3 The dotted line position shown in , according to which the first position information can be obtained, the position of the left edge of the first folding body in the first image when the angle α is unknown is Figure 3 The solid line position shown in FIG. 1 can obtain the second position information based on the solid line position and the first side, and can obtain the second position information based on the first position information and the second position information. Figure 3 The distance between the solid line and the dotted line is L, that is, the difference in imaging distance in the left edge camera module group of the first folding body is L, and the length of the upper and lower sides of the first folding body is M.

[0059] Optionally, the calculating the folding angle of the foldable terminal according to the upper and lower side lengths of the first foldable body, the first position information, the second position information and the preset angle includes:

[0060] The folding angle of the folding terminal is calculated using a first formula according to the upper and lower side lengths of the first folding body, the first position information, the second position information and the preset angle, wherein the first formula is:

[0061] α=θ+arccos(L / M+cosθ)

[0062] Among them, α is the folding angle, θ is the preset angle, L is the difference in imaging distance obtained according to the first position information and the second position information, and M is the length of the upper and lower sides of the first folding body.

[0063] In an embodiment of the present application, a first image of an edge of the first folding body away from the connecting axis is obtained in the camera module, and the folding angle of the folding terminal is calculated based on the first position information of the edge of the first folding body away from the connecting axis in the reference image and the second position information of the edge of the first folding body away from the connecting axis in the first image. The calculation is simple and easy to implement, and the calculation accuracy of the folding angle can be effectively improved.

[0064] Optionally, when the target object is an icon displayed on the first foldable body, acquiring a first image of the target object on the first foldable body in the camera module includes:

[0065] When the first foldable body is located within the imaging range of the camera module, acquiring a first image of the icon displayed on the first foldable body in the camera module;

[0066] Specifically, since the angle of the camera module after opening the ultra-wide angle is limited, when calculating the folding angle based on the camera module, it is necessary to satisfy that the first folding body is located within the imaging range of the camera module.

[0067] If the first foldable body is located within the imaging range of the camera module, calculation is started. In one implementation, a first image of an icon displayed on the first foldable body in the camera module is acquired.

[0068] Optionally, calculating the folding angle of the foldable terminal according to the reference image and the first image includes:

[0069] Respectively acquiring a first area of ​​the icon in the reference image and a second area of ​​the icon in the first image;

[0070] A folding angle of the foldable terminal is calculated according to the preset angle, the first area, and the second area.

[0071] Figure 4 A schematic diagram of calculating a folding angle when the target object provided in an embodiment of the present application is an icon displayed on a first folding body. Figure 4 The middle icon is a battery icon, and since the battery icon is approximately rectangular, the area of ​​the battery icon is relatively easy to obtain. The first area of ​​the icon in the reference image and the second area of ​​the icon in the first image can be calculated by an image processing method.

[0072] Furthermore, the folding angle may be calculated according to the first area of ​​the battery icon in the reference image and the second area of ​​the battery icon in the first image corresponding to the preset angle.

[0073] Optionally, the calculating the folding angle of the foldable terminal according to the preset angle, the first area, and the second area includes:

[0074] According to the preset angle, the first area, and the second area, the folding angle of the folding terminal is calculated using Formula 2, where Formula 2 is:

[0075] α=arccos(cosθ*S θ / S α )

[0076] Wherein, α is the folding angle, θ is the preset angle, S θ is the first area, Sα is the second area.

[0077] In an embodiment of the present application, a first image of an icon displayed on a first folding body is obtained in a camera module, and the folding angle of the folding terminal is calculated based on a first area of ​​the icon in a reference image and a second area of ​​the icon in the first image. The calculation is simple and easy to implement, and the calculation accuracy of the folding angle can be effectively improved.

[0078] Optionally, before acquiring a first image of the target object on the first foldable body in the camera module, the method further includes:

[0079] When it is detected that the foldable terminal is in a folded state or a request for calculating a folding angle is received, the camera module is started.

[0080] It is understandable that if it is detected that the folding terminal is in a folded state or a request to calculate the folding angle is received, the camera module is started and the folding angle is calculated by acquiring an image of the target object in the camera module.

[0081] It should be noted that the folding angle calculation method provided in the embodiment of the present application can be executed by a folding angle calculation device, or a control module in the folding angle calculation device for executing the folding angle calculation method. In the embodiment of the present application, the folding angle calculation device provided in the embodiment of the present application is described by taking the folding angle calculation method executed by the folding angle calculation device as an example.

[0082] Figure 5 This is a schematic diagram of the structure of the folding angle calculation device provided in the embodiment of the present application. Figure 5 As shown, the device comprises:

[0083] An acquisition unit 510 is used to acquire a first image of a target object on the first folding body in a camera module, wherein the camera module is located on the second folding body;

[0084] A calculation unit 520, configured to calculate a folding angle of the foldable terminal according to a reference image and the first image;

[0085] The reference image is a second image of the target object on the first folding body in the camera module when the folding terminal is folded at a preset angle.

[0086] In an embodiment of the present application, a first image of a target object on a first folding body is obtained in a camera module, and a folding angle of the folding terminal is calculated based on a reference image and the first image. The calculation of the folding angle is related to the image of the target object in the camera module, which improves the calculation accuracy of the folding angle and is not easily affected by the external environment.

[0087] Optionally, the target object is an edge of the first folding body away from the connection axis or an icon displayed on the first folding body.

[0088] Optionally, when the target object is an edge of the first folding body away from the connection axis, the acquisition unit is used to:

[0089] When the first folding body is located within the imaging range of the camera module, acquiring a first image of an edge of the first folding body away from the connecting axis in the camera module;

[0090] The computing unit is used for:

[0091] Respectively acquiring first position information of the edge in the reference image and second position information of the edge in the first image;

[0092] A folding angle of the folding terminal is calculated according to the upper and lower side lengths of the first folding body, the first position information, the second position information, and the preset angle.

[0093] In an embodiment of the present application, a first image of an edge of the first folding body away from the connecting axis is obtained in the camera module, and the folding angle of the folding terminal is calculated based on the first position information of the edge of the first folding body away from the connecting axis in the reference image and the second position information of the edge of the first folding body away from the connecting axis in the first image. The calculation is simple and easy to implement, and the calculation accuracy of the folding angle can be effectively improved.

[0094] Optionally, when the target object is an icon displayed on the first folding body, the acquiring unit is used to:

[0095] When the first foldable body is located within the imaging range of the camera module, acquiring a first image of the icon displayed on the first foldable body in the camera module;

[0096] The computing unit is used for:

[0097] Respectively acquiring a first area of ​​the icon in the reference image and a second area of ​​the icon in the first image;

[0098] A folding angle of the foldable terminal is calculated according to the preset angle, the first area, and the second area.

[0099] In an embodiment of the present application, a first image of an icon displayed on a first folding body is obtained in a camera module, and the folding angle of the folding terminal is calculated based on a first area of ​​the icon in a reference image and a second area of ​​the icon in the first image. The calculation is simple and easy to implement, and the calculation accuracy of the folding angle can be effectively improved.

[0100] Optionally, it also includes:

[0101] The starting unit is used to start the camera module when it is detected that the foldable terminal is in a folded state or a request for calculating a folding angle is received.

[0102] The folding angle calculation device in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0103] The folding angle calculation device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0104] The folding angle calculation device provided in the embodiment of the present application can achieve Figures 1 to 4 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0105] Alternatively, if Figure 6 As shown, an embodiment of the present application also provides an electronic device 600, including a processor 601, a memory 602, and a program or instruction stored in the memory 602 and executable on the processor 601. When the program or instruction is executed by the processor 601, each process of the above-mentioned folding angle calculation method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0106] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0107] Figure 7 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0108] The electronic device 700 includes but is not limited to: a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709, and a processor 710.

[0109] Those skilled in the art will appreciate that the electronic device 700 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 710 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 7 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0110] The processor 710 is used to obtain a first image of a target object on the first folding body in a camera module, wherein the camera module is located on the second folding body;

[0111] Calculating a folding angle of the foldable terminal according to the reference image and the first image;

[0112] The reference image is a second image of the target object on the first folding body in the camera module when the folding terminal is folded at a preset angle.

[0113] In an embodiment of the present application, a first image of a target object on a first folding body is obtained in a camera module, and a folding angle of the folding terminal is calculated based on a reference image and the first image. The calculation of the folding angle is related to the image of the target object in the camera module and does not depend on sensor data. This improves the calculation accuracy of the folding angle and makes it less susceptible to the influence of the external environment.

[0114] Optionally, the target object is an edge of the first folding body away from the connection axis or an icon displayed on the first folding body.

[0115] Optionally, when the target object is an edge of the first folding body away from the connection axis, acquiring a first image of the target object on the first folding body in the camera module includes:

[0116] When the first folding body is located within the imaging range of the camera module, acquiring a first image of an edge of the first folding body away from the connecting axis in the camera module;

[0117] The calculating the folding angle of the foldable terminal according to the reference image and the first image includes:

[0118] Respectively acquiring first position information of the edge in the reference image and second position information of the edge in the first image;

[0119] A folding angle of the folding terminal is calculated according to the upper and lower side lengths of the first folding body, the first position information, the second position information, and the preset angle.

[0120] In an embodiment of the present application, a first image of an edge of a first folding body away from a connecting axis in a camera module is obtained when the folding terminal is in a folded state, and the folding angle of the folding terminal is calculated based on first position information of the edge of the first folding body away from the connecting axis in a reference image and second position information of the edge of the first folding body away from the connecting axis in the first image. The calculation is simple and easy to implement, and the calculation accuracy of the folding angle can be effectively improved.

[0121] Optionally, when the target object is an icon displayed on the first foldable body, acquiring a first image of the target object on the first foldable body in the camera module includes:

[0122] When the first foldable body is located within the imaging range of the camera module, acquiring a first image of the icon displayed on the first foldable body in the camera module;

[0123] The calculating the folding angle of the foldable terminal according to the reference image and the first image includes:

[0124] Respectively acquiring a first area of ​​the icon in the reference image and a second area of ​​the icon in the first image;

[0125] A folding angle of the foldable terminal is calculated according to the preset angle, the first area, and the second area.

[0126] In an embodiment of the present application, a first image of an icon displayed on a first folding body is obtained in a camera module, and the folding angle of the folding terminal is calculated based on a first area of ​​the icon in a reference image and a second area of ​​the icon in the first image. The calculation is simple and easy to implement, and the calculation accuracy of the folding angle can be effectively improved.

[0127] Optionally, the processor 710 is further configured to:

[0128] When it is detected that the foldable terminal is in a folded state or a request for calculating a folding angle is received, the camera module is started.

[0129] It should be understood that in the embodiment of the present application, the input unit 704 may include a graphics processor (Graphics Processing Unit, GPU) 7041 and a microphone 7042, and the graphics processor 7041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 706 may include a display panel 7061, and the display panel 7061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 707 includes a touch panel 7071 and other input devices 7072. The touch panel 7071 is also called a touch screen. The touch panel 7071 may include two parts: a touch detection device and a touch controller. Other input devices 7072 may include but are not limited to a physical keyboard, a function key (such as a volume control button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here. The memory 709 can be used to store software programs and various data, including but not limited to applications and operating systems. The processor 710 can integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and applications, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 710.

[0130] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned folding angle calculation method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0131] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0132] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned folding angle calculation method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0133] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0134] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises one..." does not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be noted that the scope of the method and device in the embodiment of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0135] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0136] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A folding angle calculation method, characterized in that: include: Acquire a first image of a target object on the first folding body in a camera module, wherein the camera module is located on the second folding body; Calculating a folding angle of the foldable terminal according to the reference image and the first image; Wherein, the reference image is a second image of the target object on the first folding body in the camera module when the folding terminal is folded at a preset angle; Wherein, the target object is an edge of the first folding body away from the connection axis or an icon displayed on the first folding body; Wherein, in a case where the target object is an edge of the first folding body away from the connection axis, acquiring a first image of the target object on the first folding body in the camera module includes: When the first folding body is located within the imaging range of the camera module, acquiring a first image of an edge of the first folding body away from the connecting axis in the camera module; The calculating the folding angle of the foldable terminal according to the reference image and the first image includes: Respectively acquiring first position information of the edge in the reference image and second position information of the edge in the first image; Calculating a folding angle of the foldable terminal according to the upper and lower side lengths of the first foldable body, the first position information, the second position information, and the preset angle; Wherein, in a case where the target object is an icon displayed on the first foldable body, acquiring a first image of the target object on the first foldable body in the camera module includes: When the first foldable body is located within the imaging range of the camera module, acquiring a first image of the icon displayed on the first foldable body in the camera module; The calculating the folding angle of the foldable terminal according to the reference image and the first image includes: Respectively acquiring a first area of ​​the icon in the reference image and a second area of ​​the icon in the first image; A folding angle of the foldable terminal is calculated according to the preset angle, the first area, and the second area.

2. The folding angle calculation method according to claim 1, characterized in that: Before obtaining a first image of the target object on the first foldable body in the camera module, the method further includes: When it is detected that the foldable terminal is in a folded state or a request for calculating a folding angle is received, the camera module is started.

3. A folding angle calculation device, characterized in that: include: An acquisition unit, used for acquiring a first image of a target object on the first folding body in a camera module, wherein the camera module is located on the second folding body; a calculation unit, configured to calculate a folding angle of the foldable terminal according to a reference image and the first image; Wherein, the reference image is a second image of the target object on the first folding body in the camera module when the folding terminal is folded at a preset angle; Wherein, the target object is an edge of the first folding body away from the connection axis or an icon displayed on the first folding body; Wherein, when the target object is an edge of the first folding body away from the connecting axis, the acquiring unit is used to: When the first folding body is located within the imaging range of the camera module, acquiring a first image of an edge of the first folding body away from the connecting axis in the camera module; The computing unit is used for: Respectively acquiring first position information of the edge in the reference image and second position information of the edge in the first image; Calculating a folding angle of the foldable terminal according to the upper and lower side lengths of the first foldable body, the first position information, the second position information, and the preset angle; Wherein, when the target object is an icon displayed on the first folding body, the acquisition unit is used to: When the first foldable body is located within the imaging range of the camera module, acquiring a first image of the icon displayed on the first foldable body in the camera module; The computing unit is used for: Respectively acquiring a first area of ​​the icon in the reference image and a second area of ​​the icon in the first image; A folding angle of the foldable terminal is calculated according to the preset angle, the first area, and the second area.

4. The folding angle calculation device according to claim 3, characterized in that: Also includes: The starting unit is used to start the camera module when it is detected that the foldable terminal is in a folded state or a request for calculating a folding angle is received.

5. An electronic device, characterized in that: It includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the folding angle calculation method as described in any one of claims 1 to 2.

6. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the folding angle calculation method as described in any one of claims 1-2 are implemented.

Citation Information

Patent Citations

  • Folding angle adjusting method and device and foldable terminal

    CN110162138A

  • Angle sensor calibration method and device, terminal and storage medium

    CN110360972A

  • Electronic equipment and folding angle detection method

    CN111045487A

  • Folding angle determination method, folding equipment and electronic equipment

    CN112304252A

  • Device and method for measuring angles of a work

    US5329597A