Device screen horizontal calibration method and apparatus, electronic device, and program product

By generating and correcting horizontal calibration lines based on the device's three-dimensional coordinates, the problem of inaccurate calibration caused by device screen jitter in AR navigation was solved, achieving more stable and accurate device screen calibration and improving the display effect of AR navigation.

CN115526950BActive Publication Date: 2026-05-29ALIBABA INNOVATION PRIVATE LIMITED

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ALIBABA INNOVATION PRIVATE LIMITED
Filing Date
2021-06-25
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In AR navigation, the device screen calibration lines flicker and become uneven due to shaking or swaying, making accurate calibration difficult, especially on uneven roads, when the vehicle is accelerating, decelerating, or turning.

Method used

By acquiring the device's three-dimensional coordinates, a horizontal calibration line is generated. Based on magnetic and accelerometer data, the slope and offset of the calibration line are calculated. The system checks whether the calibration line meets preset conditions and adaptively corrects the calibration line to ensure stability and accuracy.

Benefits of technology

It improves the display and navigation quality of AR navigation, ensures the accuracy and stability of the horizontal calibration line, and avoids flickering and unevenness of the device screen during fast-response display.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115526950B_ABST
    Figure CN115526950B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure disclose a device screen horizontal calibration method and device, electronic device and program product, the method comprises: obtaining the three-dimensional coordinates of the device; generating a horizontal calibration line on the device screen based on the three-dimensional coordinates of the device; detecting whether the horizontal calibration line meets the preset condition, when the horizontal calibration line meets the preset condition, completing the horizontal calibration of the device screen. The technical scheme can effectively guarantee the accuracy and stability of the horizontal calibration line, thereby improving the display quality and navigation quality of AR navigation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of image processing technology, specifically to a device screen horizontal calibration method, apparatus, electronic device, and program product. Background Technology

[0002] With social development and advancements in computer vision technology, AR navigation technology is becoming increasingly widespread. AR navigation is an augmented reality navigation technology that directly presents 3D navigation guidance in real-time within captured real-world road images, providing users with a more intuitive route, direction, and lane-level real-world navigation experience. When activating AR navigation, users need to fix their device (such as a mobile phone) to match the horizon. However, users may encounter the following problems when calibrating their phone's position: If the device is fixed on a stand, when encountering uneven road sections, or when the vehicle accelerates, decelerates, or turns, the device's screen calibration lines may suddenly shake and fail to calibrate; if the device is held in the user's hand, there may be significant swaying, causing the device's screen calibration lines to flicker and become uneven during rapid display responses. Summary of the Invention

[0003] This disclosure provides a device screen horizontal calibration method, apparatus, electronic device, and program product.

[0004] In a first aspect, this disclosure provides a method for calibrating the horizontal orientation of a device screen.

[0005] Specifically, the device screen horizontal calibration method includes:

[0006] Obtain the device's three-dimensional coordinates;

[0007] A horizontal calibration line is generated on the device screen based on the device's three-dimensional coordinates.

[0008] The horizontal calibration line is checked to see if it meets the preset conditions. When the horizontal calibration line meets the preset conditions, the horizontal calibration of the device screen is completed.

[0009] In conjunction with the first aspect, the first implementation of the present disclosure further includes:

[0010] In response to the detection of a change in device pose, new three-dimensional coordinates of the device are obtained, and a new horizontal calibration line is generated based on the new three-dimensional coordinates of the device.

[0011] Based on the positional relationship between the new horizontal calibration line and the existing horizontal calibration line, determine whether the horizontal calibration line needs to be corrected.

[0012] In conjunction with the first aspect and the first implementation of the first aspect, in the second implementation of the first aspect of this disclosure, determining whether the horizontal calibration line needs to be corrected based on the positional relationship between the new horizontal calibration line and the existing horizontal calibration line includes:

[0013] Calculate the pixel difference between the new horizontal calibration line and the corresponding endpoint of the horizontal calibration line;

[0014] When the pixel difference is less than a preset pixel threshold, the horizontal calibration line is retained;

[0015] When the pixel difference is greater than or equal to the preset pixel threshold, the new horizontal calibration line is used to replace the original horizontal calibration line.

[0016] In conjunction with the first aspect and the above-described implementations of the first aspect, in the third implementation of the first aspect of this disclosure, obtaining the three-dimensional coordinates of the device includes:

[0017] Acquire the magnetic field sensing data and acceleration sensing data of the device;

[0018] The three-dimensional coordinates of the device are calculated based on the magnetic force sensing data and acceleration sensing data.

[0019] In conjunction with the first aspect and the above-described implementations of the first aspect, in the fourth implementation of the first aspect of this disclosure, the generation of a horizontal calibration line on the device screen based on the three-dimensional coordinates of the device includes:

[0020] The slope of the horizontal calibration line is calculated based on the three-dimensional coordinates of the device.

[0021] The offset of the horizontal calibration line is calculated based on the three-dimensional coordinates of the device and the height of the device screen.

[0022] The pixel coordinates of the two endpoints of the horizontal calibration line are calculated based on the slope of the horizontal calibration line, the offset of the horizontal calibration line, and the width of the device screen.

[0023] The horizontal calibration line is drawn in the pixel area of ​​the device screen located between the two endpoint pixel coordinates.

[0024] In conjunction with the first aspect and the above-described implementations of the first aspect, in the fifth implementation of the first aspect of this disclosure, the step of calculating the pixel coordinates of the two endpoints of the horizontal calibration line based on the slope of the horizontal calibration line, the offset of the horizontal calibration line, and the width of the device screen includes:

[0025] Set the horizontal coordinate of the first endpoint of the horizontal calibration line to 0, and set the vertical coordinate to the integer value of the difference between the offset and the device screen width multiplied by the slope divided by 2.

[0026] Set the horizontal coordinate of the second endpoint of the horizontal calibration line to the device screen width, and set the vertical coordinate to the integer value of the sum of the offset, the device screen width multiplied by the slope, and 2.

[0027] In conjunction with the first aspect and the above-described implementation methods of the first aspect, in the sixth implementation method of the first aspect of this disclosure, the preset conditions include: the horizontal calibration line is located in a preset screen calibration area and the duration reaches a preset duration threshold.

[0028] In conjunction with the first aspect and the above-described implementation methods of the first aspect, in the seventh implementation method of the first aspect of this disclosure, the preset screen calibration area is an area obtained by extending a preset number of pixels upwards and downwards, with the horizontal line at the center of the screen as the baseline.

[0029] Secondly, this disclosure provides a device screen horizontal calibration apparatus.

[0030] Specifically, the device screen horizontal calibration device includes:

[0031] The acquisition module is configured to acquire the three-dimensional coordinates of the device.

[0032] The generation module is configured to generate a horizontal calibration line on the device screen based on the three-dimensional coordinates of the device.

[0033] The calibration module is configured to detect whether the horizontal calibration line meets preset conditions, and when the horizontal calibration line meets the preset conditions, the horizontal calibration of the device screen is completed.

[0034] In conjunction with the second aspect, the first implementation of the second aspect of this disclosure further includes:

[0035] The correction module is configured to, in response to detecting a change in device pose, acquire new 3D coordinates of the device and generate a new horizontal calibration line based on the new 3D coordinates of the device.

[0036] Based on the positional relationship between the new horizontal calibration line and the existing horizontal calibration line, determine whether the horizontal calibration line needs to be corrected.

[0037] In conjunction with the second aspect and the first implementation of the second aspect, in the second implementation of the present disclosure, the part of determining whether the horizontal calibration line needs to be corrected based on the positional relationship between the new horizontal calibration line and the existing horizontal calibration line is configured as follows:

[0038] Calculate the pixel difference between the new horizontal calibration line and the corresponding endpoint of the horizontal calibration line;

[0039] When the pixel difference is less than a preset pixel threshold, the horizontal calibration line is retained;

[0040] When the pixel difference is greater than or equal to the preset pixel threshold, the new horizontal calibration line is used to replace the original horizontal calibration line.

[0041] In conjunction with the second aspect and the above-described implementation methods of the second aspect, in the third implementation method of the second aspect of this disclosure, the acquisition module is configured as follows:

[0042] Acquire the magnetic field sensing data and acceleration sensing data of the device;

[0043] The three-dimensional coordinates of the device are calculated based on the magnetic force sensing data and acceleration sensing data.

[0044] In conjunction with the second aspect and the above-described implementations of the second aspect, in the fourth implementation of the second aspect of this disclosure, the generation module is configured as follows:

[0045] The slope of the horizontal calibration line is calculated based on the three-dimensional coordinates of the device.

[0046] The offset of the horizontal calibration line is calculated based on the three-dimensional coordinates of the device and the height of the device screen.

[0047] The pixel coordinates of the two endpoints of the horizontal calibration line are calculated based on the slope of the horizontal calibration line, the offset of the horizontal calibration line, and the width of the device screen.

[0048] The horizontal calibration line is drawn in the pixel area of ​​the device screen located between the two endpoint pixel coordinates.

[0049] In conjunction with the second aspect and the above-described implementations of the second aspect, in the fifth implementation of the second aspect of this disclosure, the portion of the calculation of the pixel coordinates of the two endpoints of the horizontal calibration line based on the slope of the horizontal calibration line, the offset of the horizontal calibration line, and the device screen width is configured as follows:

[0050] Set the horizontal coordinate of the first endpoint of the horizontal calibration line to 0, and set the vertical coordinate to the integer value of the difference between the offset and the device screen width multiplied by the slope divided by 2.

[0051] Set the horizontal coordinate of the second endpoint of the horizontal calibration line to the device screen width, and set the vertical coordinate to the integer value of the sum of the offset, the device screen width multiplied by the slope, and 2.

[0052] In conjunction with the second aspect and the above-described implementation methods of the second aspect, in the sixth implementation method of the second aspect of this disclosure, the preset conditions include: the horizontal calibration line is located in a preset screen calibration area and the duration reaches a preset duration threshold.

[0053] In conjunction with the second aspect and the above-described implementation methods of the second aspect, in the seventh implementation method of the second aspect of this disclosure, the preset screen calibration area is an area obtained by extending a preset number of pixels upwards and downwards, with the horizontal line at the center of the screen as the baseline.

[0054] Thirdly, embodiments of this disclosure provide an electronic device, including a memory and a processor. The memory stores one or more computer instructions that support a device screen level calibration device in performing the aforementioned device screen level calibration method. The processor is configured to execute the computer instructions stored in the memory. The device screen level calibration device may also include a communication interface for communicating with other devices or communication networks.

[0055] Fourthly, embodiments of this disclosure provide a computer-readable storage medium for storing computer instructions used by a device screen level calibration apparatus, including computer instructions for performing the aforementioned device screen level calibration method in connection with the device screen level calibration apparatus.

[0056] Fifthly, embodiments of this disclosure provide a computer program product, including a computer program / instructions, wherein when the computer program / instructions are executed by a processor, they implement the method steps of the above-described device screen horizontal calibration method.

[0057] The technical solutions provided in this disclosure may have the following beneficial effects:

[0058] The above technical solution generates a precise horizontal calibration line based on the device's three-dimensional coordinates and adaptively corrects the horizontal calibration line to achieve horizontal calibration of the device screen. This technical solution can effectively ensure the accuracy and stability of the horizontal calibration line, thereby improving the display and navigation quality of AR navigation.

[0059] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the embodiments of this disclosure. Attached Figure Description

[0060] Other features, objects, and advantages of embodiments of this disclosure will become more apparent from the following detailed description of non-limiting implementations, taken in conjunction with the accompanying drawings. In the drawings:

[0061] Figure 1 A flowchart illustrating a device screen horizontal calibration method according to an embodiment of the present disclosure is shown.

[0062] Figure 2 A schematic diagram showing a preset screen calibration area according to an embodiment of the present disclosure;

[0063] Figure 3A structural block diagram of a device screen horizontal calibration apparatus according to an embodiment of the present disclosure is shown.

[0064] Figure 4 A structural block diagram of a device screen horizontal calibration apparatus according to an embodiment of the present disclosure is shown.

[0065] Figure 5 This is a schematic diagram of the structure of a computer system suitable for implementing a device screen horizontal calibration method according to an embodiment of the present disclosure. Detailed Implementation

[0066] Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings to enable those skilled in the art to readily implement them. Furthermore, for clarity, portions unrelated to the description of the exemplary embodiments have been omitted from the drawings.

[0067] In embodiments disclosed herein, it should be understood that terms such as “comprising” or “having” are intended to indicate the presence of features, numbers, steps, behaviors, components, portions or combinations thereof disclosed herein, and are not intended to exclude the possibility that one or more other features, numbers, steps, behaviors, components, portions or combinations thereof are present or added.

[0068] It should also be noted that, unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other. The embodiments of this disclosure will now be described in detail with reference to the accompanying drawings and examples.

[0069] The technical solution provided in this disclosure generates a precise horizontal calibration line based on the device's three-dimensional coordinates and adaptively corrects the horizontal calibration line to achieve horizontal calibration of the device screen. This technical solution can effectively ensure the accuracy and stability of the horizontal calibration line, thereby improving the display and navigation quality of AR navigation.

[0070] Figure 1 A flowchart illustrating a device screen horizontal calibration method according to an embodiment of the present disclosure is shown, as follows: Figure 1 As shown, the device screen horizontal calibration method includes the following steps S101-S103:

[0071] In step S101, the three-dimensional coordinates of the device are obtained;

[0072] In step S102, a horizontal calibration line is generated on the device screen based on the three-dimensional coordinates of the device;

[0073] In step S103, it is detected whether the horizontal calibration line meets the preset conditions. When the horizontal calibration line meets the preset conditions, the horizontal calibration of the device screen is completed.

[0074] As mentioned above, with social development and advancements in computer vision technology, AR navigation technology is becoming increasingly widespread. AR navigation is an augmented reality navigation technology that directly presents 3D navigation guidance in real-time within captured real-world road images, providing users with a more intuitive route, direction, and lane-level real-world navigation experience. When activating AR navigation, users need to fix their device (such as a mobile phone) to match the horizon. However, users may encounter the following problems when calibrating their phone's position: If the device is fixed on a bracket, when encountering uneven road sections, or when the vehicle accelerates, decelerates, or turns, the device's screen calibration lines may fail to calibrate due to sudden shaking; if the device is held in the user's hand, there may be significant swaying, causing the device's screen calibration lines to flicker and become uneven during rapid display response.

[0075] In view of the above problems, this embodiment proposes a device screen horizontal calibration method. This method generates a precise horizontal calibration line based on the device's three-dimensional coordinates and adaptively corrects the horizontal calibration line to achieve horizontal calibration of the device screen. This technical solution can effectively ensure the accuracy and stability of the horizontal calibration line, thereby improving the display and navigation quality of AR navigation.

[0076] In one embodiment of this disclosure, the device screen horizontal calibration method is applicable to computers, computing devices, electronic devices, etc., that perform device screen horizontal calibration.

[0077] In one embodiment of this disclosure, the device refers to a mobile device, electronic device, or other device that is capable of AR navigation and has a display screen.

[0078] In one embodiment of this disclosure, the horizontal calibration line refers to a horizontal orientation comparison line displayed on the device screen, used to characterize whether the device screen is in a horizontal position. The horizontal calibration line can be generated based on the three-dimensional coordinates of the device, which refer to the three-dimensional physical coordinates of the device and are related to the pose of the device. Therefore, if the pose of the device changes, the horizontal calibration line will change accordingly.

[0079] In the above implementation, the three-dimensional coordinates of the device are first obtained, then a horizontal calibration line is generated on the device screen based on the three-dimensional coordinates of the device, and finally it is detected whether the horizontal calibration line meets the preset conditions. If the horizontal calibration line meets the preset conditions, the horizontal calibration of the device screen can be achieved.

[0080] In one embodiment of this disclosure, step S101, namely the step of obtaining the three-dimensional coordinates of the device, may include the following steps:

[0081] Acquire the magnetic field sensing data and acceleration sensing data of the device;

[0082] The three-dimensional coordinates of the device are calculated based on the magnetic force sensing data and acceleration sensing data.

[0083] In this embodiment, the three-dimensional coordinates of the device are calculated using the magnetic field sensing data and acceleration sensing data of the device. Calculating three-dimensional coordinates based on the magnetic field sensing data and acceleration sensing data of the device is prior art and will not be described further in this disclosure.

[0084] In one embodiment of this disclosure, step S102, namely the step of generating a horizontal calibration line on the device screen based on the three-dimensional coordinates of the device, may include the following steps:

[0085] The slope of the horizontal calibration line is calculated based on the three-dimensional coordinates of the device.

[0086] The offset of the horizontal calibration line is calculated based on the three-dimensional coordinates of the device and the height of the device screen.

[0087] The pixel coordinates of the two endpoints of the horizontal calibration line are calculated based on the slope of the horizontal calibration line, the offset of the horizontal calibration line, and the width of the device screen.

[0088] The horizontal calibration line is drawn in the pixel area of ​​the device screen located between the two endpoint pixel coordinates.

[0089] In this embodiment, a precise horizontal calibration line is generated on the device screen based on the three-dimensional coordinates of the device.

[0090] Specifically:

[0091] First, the slope of the horizontal calibration line is calculated based on the three-dimensional coordinates of the device. Assuming the three-dimensional coordinates of the device are represented as (x, y, z), the slope of the horizontal calibration line can be calculated using the following formula:

[0092] k = tan(x * 2 * π / 360);

[0093] Where k represents the slope of the horizontal calibration line, and tan(.) refers to the tan function.

[0094] Then, based on the three-dimensional coordinates of the device and the height of the device screen, the offset of the horizontal calibration line is calculated. The offset of the horizontal calibration line refers to the pixel difference between the intersection of the horizontal calibration line and the left edge line of the device screen and the bottom edge line of the device screen; that is, the offset of the horizontal calibration line in the y-axis direction, with the bottom edge line of the device screen as the x-axis and the left edge line of the device screen as the y-axis. The offset of the horizontal calibration line can be calculated using the following formula:

[0095] b=(mHeight / 2)*(1+((y-90) / 60));

[0096] Where b represents the offset of the horizontal calibration line, and mHeight represents the height of the device screen. It should be noted that the device screen can be placed horizontally or vertically. If the device screen is placed horizontally, the height of the device screen refers to the length in the narrower direction, and the width of the device screen refers to the length in the wider direction. Similarly, if the device screen is placed vertically, the height of the device screen refers to the length in the wider direction, and the width of the device screen refers to the length in the narrower direction.

[0097] Then, the pixel coordinates of the two ends of the horizontal calibration line are calculated based on the slope of the horizontal calibration line, the offset of the horizontal calibration line, and the width of the device screen.

[0098] For example, the horizontal coordinate of the first endpoint of the horizontal calibration line can be set to 0, and the vertical coordinate can be set to the integer value of the difference between the offset and the device screen width multiplied by the slope divided by 2, i.e.: int(b-mwidth*k / 2); the horizontal coordinate of the second endpoint of the horizontal calibration line can be set to the device screen width mwidth, and the vertical coordinate can be set to the integer value of the sum of the offset and the device screen width multiplied by the slope divided by 2, i.e.: int(b+mwidth*k / 2).

[0099] In one embodiment of this disclosure, the step of calculating the pixel coordinates of the two endpoints of the horizontal calibration line based on the slope of the horizontal calibration line, the offset of the horizontal calibration line, and the device screen width may include the following steps:

[0100] Set the horizontal coordinate of the first endpoint of the horizontal calibration line to 0, and set the vertical coordinate to the integer value of the difference between the offset and the device screen width multiplied by the slope divided by 2.

[0101] Set the horizontal coordinate of the second endpoint of the horizontal calibration line to the device screen width, and set the vertical coordinate to the integer value of the sum of the offset, the device screen width multiplied by the slope, and 2.

[0102] Finally, the horizontal calibration line is drawn by filling the pixel area of ​​the device screen between the endpoint pixel coordinates of the first and second endpoints with pixels.

[0103] In one embodiment of this disclosure, the preset conditions may include the following: the horizontal calibration line is located within a preset screen calibration area and the duration reaches a preset duration threshold. When the horizontal calibration line is located within the preset screen calibration area for a certain duration, the horizontal calibration line can be considered relatively accurate and stable. Alternatively, the slope of the horizontal calibration line is 0, and the offset is equal to half the screen height, i.e., the horizontal calibration line coincides with the screen center horizontal line. The preset screen calibration area refers to a pre-set area used to evaluate the horizontal calibration degree of the horizontal calibration line. In one embodiment of this disclosure, the preset screen calibration area is an area obtained by extending a preset number of pixels upwards and downwards from the screen center horizontal line as a baseline. The preset number of pixels is related to the resolution of the device screen; the higher the resolution of the device screen, the larger the preset number of pixels, and the lower the resolution of the device screen, the smaller the preset number of pixels. Furthermore, the preset number of pixels may also be related to the device screen height. The duration can be set according to the needs of the actual application, such as 3 seconds, 5 seconds, etc. A schematic diagram of the preset screen calibration area according to an embodiment of this disclosure is shown below. Figure 2 As shown.

[0104] In one embodiment of this disclosure, the method may further include the following steps:

[0105] In response to the detection of a change in device pose, new three-dimensional coordinates of the device are obtained, and a new horizontal calibration line is generated based on the new three-dimensional coordinates of the device.

[0106] Based on the positional relationship between the new horizontal calibration line and the existing horizontal calibration line, determine whether the horizontal calibration line needs to be corrected.

[0107] Considering that the device's pose may change due to user actions or vibrations in the environment, and that the horizontal calibration line will change accordingly if the device's pose changes, to effectively ensure the accuracy and stability of the horizontal calibration line, and to prevent it from failing to calibrate due to sudden jitter or flickering / unsmoothness during rapid display response when the device's pose changes, the change in the horizontal angular directrix should be robust when the device's pose changes slightly, and adapt to the change in the horizontal angular directrix when the device's pose changes drastically. In other words, when a change in device pose is detected, new three-dimensional coordinates of the device are obtained, and a new horizontal calibration line can be generated based on these new coordinates. Then, the positional relationship between the new horizontal calibration line and the existing horizontal calibration line can be used to determine whether the existing horizontal calibration line needs correction.

[0108] Specifically, when determining whether the horizontal calibration line needs correction based on its positional relationship with the existing horizontal calibration line, the pixel difference between the new horizontal calibration line and the corresponding endpoints of the existing horizontal calibration line is first calculated. For example, the pixel difference between the left endpoint of the new horizontal calibration line and the left endpoint of the existing horizontal calibration line, or the pixel difference between the right endpoint of the new horizontal calibration line and the right endpoint of the existing horizontal calibration line. Then, the pixel difference is compared with a preset pixel threshold. If the pixel difference is less than the preset pixel threshold, it indicates that the device jitter is small and can be considered an abnormal jitter, so no correction is needed for the horizontal calibration line. Therefore, the new horizontal calibration line can be discarded, and the existing horizontal calibration line can be retained. If the pixel difference is greater than or equal to the preset pixel threshold, it indicates that the device jitter is large and the horizontal calibration line needs to be corrected. That is, the new horizontal calibration line needs to be used to replace the existing horizontal calibration line. The preset pixel threshold can be set according to the needs of the actual application, for example, it can be set to 40 pixels.

[0109] That is, in one embodiment of this disclosure, the step of correcting the horizontal calibration line based on the positional relationship between the new horizontal calibration line and the existing horizontal calibration line may include the following steps:

[0110] Calculate the pixel difference between the new horizontal calibration line and the corresponding endpoint of the horizontal calibration line;

[0111] When the pixel difference is less than a preset pixel threshold, the horizontal calibration line is retained;

[0112] When the pixel difference is greater than or equal to the preset pixel threshold, the new horizontal calibration line is used to replace the original horizontal calibration line.

[0113] In one embodiment of this disclosure, when replacing the existing horizontal calibration line with the new one, to ensure a smoother replacement, a preset drawing frame rate can be used to draw the new horizontal calibration line within a preset smoothing buffer time. The preset drawing frame rate and preset smoothing buffer time can be set according to the needs of the actual application; for example, the preset drawing frame rate can be set to 40 frames per second, and the preset smoothing buffer time can be set to 0.3 seconds. If an updated horizontal calibration line that needs to replace the previous one is generated within the preset smoothing buffer time, the latest horizontal calibration line can be drawn directly, and so on.

[0114] In one embodiment of this disclosure, in order to enhance the replacement effect of the horizontal calibration line and optimize the replacement experience, a smooth drawing method can also be adopted when drawing the new horizontal calibration line. That is, taking each pixel of the replaced horizontal calibration line as the starting point and the corresponding pixel of the new horizontal calibration line as the ending point, the process pixels between the starting point and the ending point are also drawn instantaneously. However, when drawing the process pixels instantaneously, the process pixels are only displayed instantaneously, that is, the process pixels are only displayed for a short time, such as 0.01 seconds, and then the display is canceled. Finally, they will be displayed for a long time on each pixel corresponding to the new horizontal calibration line.

[0115] The following are embodiments of the apparatus disclosed herein, which can be used to execute embodiments of the method disclosed herein.

[0116] Figure 3 This diagram illustrates a structural block diagram of a device screen level calibration apparatus according to an embodiment of the present disclosure. This apparatus can be implemented as part or all of an electronic device through software, hardware, or a combination of both. Figure 3 As shown, the device screen horizontal calibration device includes:

[0117] The acquisition module 301 is configured to acquire the three-dimensional coordinates of the device.

[0118] Generation module 302 is configured to generate a horizontal calibration line on the device screen based on the three-dimensional coordinates of the device;

[0119] The calibration module 303 is configured to detect whether the horizontal calibration line meets preset conditions, and when the horizontal calibration line meets the preset conditions, the horizontal calibration of the device screen is completed.

[0120] As mentioned above, with social development and advancements in computer vision technology, AR navigation technology is becoming increasingly widespread. AR navigation is an augmented reality navigation technology that directly presents 3D navigation guidance in real-time within captured real-world road images, providing users with a more intuitive route, direction, and lane-level real-world navigation experience. When activating AR navigation, users need to fix their device (such as a mobile phone) to match the horizon. However, users may encounter the following problems when calibrating their phone's position: If the device is fixed on a bracket, when encountering uneven road sections, or when the vehicle accelerates, decelerates, or turns, the device's screen calibration lines may fail to calibrate due to sudden shaking; if the device is held in the user's hand, there may be significant swaying, causing the device's screen calibration lines to flicker and become uneven during rapid display response.

[0121] In view of the above problems, this embodiment proposes a device screen horizontal calibration device. This device generates a precise horizontal calibration line based on the device's three-dimensional coordinates and adaptively corrects the horizontal calibration line to achieve horizontal calibration of the device screen. This technical solution can effectively ensure the accuracy and stability of the horizontal calibration line, thereby improving the display quality and navigation quality of AR navigation.

[0122] In one embodiment of this disclosure, the device screen horizontal calibration device can be a computer, computing device, electronic device, etc., that performs device screen horizontal calibration.

[0123] In one embodiment of this disclosure, the device refers to a mobile device, electronic device, or other device that is capable of AR navigation and has a display screen.

[0124] In one embodiment of this disclosure, the horizontal calibration line refers to a horizontal orientation comparison line displayed on the device screen, used to characterize whether the device screen is in a horizontal position. The horizontal calibration line can be generated based on the three-dimensional coordinates of the device, which refer to the three-dimensional physical coordinates of the device and are related to the pose of the device. Therefore, if the pose of the device changes, the horizontal calibration line will change accordingly.

[0125] In the above implementation, the three-dimensional coordinates of the device are first obtained, then a horizontal calibration line is generated on the device screen based on the three-dimensional coordinates of the device, and finally it is detected whether the horizontal calibration line meets the preset conditions. If the horizontal calibration line meets the preset conditions, the horizontal calibration of the device screen can be achieved.

[0126] In one embodiment of this disclosure, the acquisition module 301 may be configured as follows:

[0127] Acquire the magnetic field sensing data and acceleration sensing data of the device;

[0128] The three-dimensional coordinates of the device are calculated based on the magnetic force sensing data and acceleration sensing data.

[0129] In this embodiment, the three-dimensional coordinates of the device are calculated using the magnetic field sensing data and acceleration sensing data of the device. Calculating three-dimensional coordinates based on the magnetic field sensing data and acceleration sensing data of the device is prior art and will not be described further in this disclosure.

[0130] In one embodiment of this disclosure, the generation module 302 may be configured as follows:

[0131] The slope of the horizontal calibration line is calculated based on the three-dimensional coordinates of the device.

[0132] The offset of the horizontal calibration line is calculated based on the three-dimensional coordinates of the device and the height of the device screen.

[0133] The pixel coordinates of the two endpoints of the horizontal calibration line are calculated based on the slope of the horizontal calibration line, the offset of the horizontal calibration line, and the width of the device screen.

[0134] The horizontal calibration line is drawn in the pixel area of ​​the device screen located between the two endpoint pixel coordinates.

[0135] In this embodiment, a precise horizontal calibration line is generated on the device screen based on the three-dimensional coordinates of the device.

[0136] Specifically:

[0137] First, the slope of the horizontal calibration line is calculated based on the three-dimensional coordinates of the device. Assuming the three-dimensional coordinates of the device are represented as (x, y, z), the slope of the horizontal calibration line can be calculated using the following formula:

[0138] k = tan(x * 2 * π / 360);

[0139] Where k represents the slope of the horizontal calibration line, and tan(.) refers to the tan function.

[0140] Then, based on the three-dimensional coordinates of the device and the height of the device screen, the offset of the horizontal calibration line is calculated. The offset of the horizontal calibration line refers to the pixel difference between the intersection of the horizontal calibration line and the left edge line of the device screen and the bottom edge line of the device screen; that is, the offset of the horizontal calibration line in the y-axis direction, with the bottom edge line of the device screen as the x-axis and the left edge line of the device screen as the y-axis. The offset of the horizontal calibration line can be calculated using the following formula:

[0141] b=(mHeight / 2)*(1+((y-90) / 60));

[0142] Where b represents the offset of the horizontal calibration line, and mHeight represents the height of the device screen. It should be noted that the device screen can be placed horizontally or vertically. If the device screen is placed horizontally, the height of the device screen refers to the length in the narrower direction, and the width of the device screen refers to the length in the wider direction. Similarly, if the device screen is placed vertically, the height of the device screen refers to the length in the wider direction, and the width of the device screen refers to the length in the narrower direction.

[0143] Then, the pixel coordinates of the two ends of the horizontal calibration line are calculated based on the slope of the horizontal calibration line, the offset of the horizontal calibration line, and the width of the device screen.

[0144] For example, the horizontal coordinate of the first endpoint of the horizontal calibration line can be set to 0, and the vertical coordinate can be set to the integer value of the difference between the offset and the device screen width multiplied by the slope divided by 2, i.e.: int(b-mwidth*k / 2); the horizontal coordinate of the second endpoint of the horizontal calibration line can be set to the device screen width mwidth, and the vertical coordinate can be set to the integer value of the sum of the offset and the device screen width multiplied by the slope divided by 2, i.e.: int(b+mwidth*k / 2).

[0145] In one embodiment of this disclosure, the portion of the calculation of the pixel coordinates of the two endpoints of the horizontal calibration line based on the slope of the horizontal calibration line, the offset of the horizontal calibration line, and the device screen width can be configured as follows:

[0146] Set the horizontal coordinate of the first endpoint of the horizontal calibration line to 0, and set the vertical coordinate to the integer value of the difference between the offset and the device screen width multiplied by the slope divided by 2.

[0147] Set the horizontal coordinate of the second endpoint of the horizontal calibration line to the device screen width, and set the vertical coordinate to the integer value of the sum of the offset, the device screen width multiplied by the slope, and 2.

[0148] Finally, the horizontal calibration line is drawn by filling the pixel area of ​​the device screen between the endpoint pixel coordinates of the first and second endpoints with pixels.

[0149] In one embodiment of this disclosure, the preset conditions may include the following: the horizontal calibration line is located within a preset screen calibration area and the duration reaches a preset duration threshold. When the horizontal calibration line is located within the preset screen calibration area for a certain duration, the horizontal calibration line can be considered relatively accurate and stable. Alternatively, the slope of the horizontal calibration line is 0, and the offset is equal to half the screen height, i.e., the horizontal calibration line coincides with the screen center horizontal line. The preset screen calibration area refers to a pre-set area used to evaluate the horizontal calibration degree of the horizontal calibration line. In one embodiment of this disclosure, the preset screen calibration area is an area obtained by extending a preset number of pixels upwards and downwards from the screen center horizontal line as a baseline. The preset number of pixels is related to the resolution of the device screen; the higher the resolution of the device screen, the larger the preset number of pixels, and the lower the resolution of the device screen, the smaller the preset number of pixels. Furthermore, the preset number of pixels may also be related to the device screen height. The duration can be set according to the needs of the actual application, such as 3 seconds, 5 seconds, etc. A schematic diagram of the preset screen calibration area according to an embodiment of this disclosure is shown below. Figure 2 As shown.

[0150] In one embodiment of this disclosure, the apparatus may further include:

[0151] The correction module is configured to, in response to detecting a change in device pose, acquire new 3D coordinates of the device and generate a new horizontal calibration line based on the new 3D coordinates of the device.

[0152] Based on the positional relationship between the new horizontal calibration line and the existing horizontal calibration line, determine whether the horizontal calibration line needs to be corrected.

[0153] Considering that the device's pose may change due to user actions or vibrations in the environment, and that the horizontal calibration line will change accordingly if the device's pose changes, in order to effectively ensure the accuracy and stability of the horizontal calibration line, and to prevent it from failing to calibrate due to sudden jitter or flickering / unsmoothness during rapid response displays when the device's pose changes, the change in the horizontal angular directrix should be robust when the device's pose changes slightly, and should adapt to the change in the horizontal angular directrix when the device's pose changes drastically. In other words, when a change in device pose is detected, new three-dimensional coordinates of the device are obtained, and a new horizontal calibration line can be generated based on these new coordinates. Then, the positional relationship between the new horizontal calibration line and the existing horizontal calibration line can be used to determine whether the existing horizontal calibration line needs to be corrected.

[0154] Specifically, when determining whether the horizontal calibration line needs correction based on its positional relationship with the existing horizontal calibration line, the pixel difference between the new horizontal calibration line and the corresponding endpoints of the existing horizontal calibration line is first calculated. For example, the pixel difference between the left endpoint of the new horizontal calibration line and the left endpoint of the existing horizontal calibration line, or the pixel difference between the right endpoint of the new horizontal calibration line and the right endpoint of the existing horizontal calibration line. Then, the pixel difference is compared with a preset pixel threshold. If the pixel difference is less than the preset pixel threshold, it indicates that the device jitter is small and can be considered an abnormal jitter, so no correction is needed for the horizontal calibration line. Therefore, the new horizontal calibration line can be discarded, and the existing horizontal calibration line can be retained. If the pixel difference is greater than or equal to the preset pixel threshold, it indicates that the device jitter is large and the horizontal calibration line needs to be corrected. That is, the new horizontal calibration line needs to be used to replace the existing horizontal calibration line. The preset pixel threshold can be set according to the needs of the actual application, for example, it can be set to 40 pixels.

[0155] That is, in one embodiment of this disclosure, the part that corrects the horizontal calibration line based on the positional relationship between the new horizontal calibration line and the existing horizontal calibration line can be configured as follows:

[0156] Calculate the pixel difference between the new horizontal calibration line and the corresponding endpoint of the horizontal calibration line;

[0157] When the pixel difference is less than a preset pixel threshold, the horizontal calibration line is retained;

[0158] When the pixel difference is greater than or equal to the preset pixel threshold, the new horizontal calibration line is used to replace the original horizontal calibration line.

[0159] In one embodiment of this disclosure, when replacing the existing horizontal calibration line with the new one, to ensure a smoother replacement, a preset drawing frame rate can be used to draw the new horizontal calibration line within a preset smoothing buffer time. The preset drawing frame rate and preset smoothing buffer time can be set according to the needs of the actual application; for example, the preset drawing frame rate can be set to 40 frames per second, and the preset smoothing buffer time can be set to 0.3 seconds. If an updated horizontal calibration line that needs to replace the previous one is generated within the preset smoothing buffer time, the latest horizontal calibration line can be drawn directly, and so on.

[0160] In one embodiment of this disclosure, in order to enhance the replacement effect of the horizontal calibration line and optimize the replacement experience, a smooth drawing method can also be adopted when drawing the new horizontal calibration line. That is, taking each pixel of the replaced horizontal calibration line as the starting point and the corresponding pixel of the new horizontal calibration line as the ending point, the process pixels between the starting point and the ending point are also drawn instantaneously. However, when drawing the process pixels instantaneously, the process pixels are only displayed instantaneously, that is, the process pixels are only displayed for a short time, such as 0.01 seconds, and then the display is canceled. Finally, they will be displayed for a long time on each pixel corresponding to the new horizontal calibration line.

[0161] This disclosure also discloses a navigation service, wherein, based on the aforementioned device screen level calibration method, a device screen level calibration result is obtained, and based on the device screen level calibration result, navigation guidance service for a corresponding scenario is provided to the navigated object. The corresponding scenario is one or more combinations of AR navigation, elevated road navigation, or main and auxiliary road navigation.

[0162] This disclosure also discloses an electronic device. Figure 4 This diagram illustrates a structural block diagram of an electronic device according to an embodiment of the present disclosure, such as... Figure 4As shown, the electronic device 400 includes a memory 401 and a processor 402; wherein,

[0163] The memory 401 is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor 402 to implement the above method steps.

[0164] Figure 5 This is a schematic diagram of the structure of a computer system suitable for implementing a device screen horizontal calibration method according to an embodiment of the present disclosure.

[0165] like Figure 5 As shown, the computer system 500 includes a processing unit 501, which can execute various processes described above based on a program stored in a read-only memory (ROM) 502 or a program loaded from a storage section 508 into a random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the system 500. The processing unit 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0166] The following components are connected to I / O interface 505: an input section 506 including a keyboard, mouse, etc.; an output section 507 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to I / O interface 505 as needed. A removable medium 511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 510 as needed so that computer programs read from it can be installed into storage section 508 as needed. The processing unit 501 can be implemented as a CPU, GPU, TPU, FPGA, NPU, etc.

[0167] In particular, according to embodiments of this disclosure, the methods described above can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program tangibly contained on a readable medium thereof, the computer program containing program code for performing the device screen level calibration method. In such embodiments, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511.

[0168] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0169] The units or modules described in the embodiments of this disclosure can be implemented in software or hardware. The described units or modules can also be located in a processor, and the names of these units or modules do not necessarily constitute a limitation on the unit or module itself.

[0170] In another aspect, embodiments of this disclosure also provide a computer-readable storage medium, which may be a computer-readable storage medium included in the apparatus described in the above embodiments; or it may be a standalone computer-readable storage medium not assembled into a device. The computer-readable storage medium stores one or more programs, which are used by one or more processors to perform the methods described in embodiments of this disclosure.

[0171] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.

Claims

1. A method for calibrating the horizontal orientation of a device screen, comprising: Obtain the device's three-dimensional coordinates; The slope of the horizontal calibration line is calculated based on the three-dimensional coordinates of the device. The offset of the horizontal calibration line is calculated based on the three-dimensional coordinates of the device and the height of the device screen. The pixel coordinates of the two endpoints of the horizontal calibration line are calculated based on the slope of the horizontal calibration line, the offset of the horizontal calibration line, and the width of the device screen. The horizontal calibration line is drawn in the pixel area of ​​the device screen located between the two endpoint pixel coordinates; The horizontal calibration line is checked to see if it meets the preset conditions. When the horizontal calibration line meets the preset conditions, the horizontal calibration of the device screen is completed.

2. The method according to claim 1, further comprising: In response to the detection of a change in device pose, new three-dimensional coordinates of the device are obtained, and a new horizontal calibration line is generated based on the new three-dimensional coordinates of the device. Based on the positional relationship between the new horizontal calibration line and the existing horizontal calibration line, determine whether the horizontal calibration line needs to be corrected.

3. The method according to claim 2, wherein determining whether the horizontal calibration line needs to be corrected based on the positional relationship between the new horizontal calibration line and the existing horizontal calibration line comprises: Calculate the pixel difference between the new horizontal calibration line and the corresponding endpoint of the horizontal calibration line; When the pixel difference is less than a preset pixel threshold, the horizontal calibration line is retained; When the pixel difference is greater than or equal to the preset pixel threshold, the new horizontal calibration line is used to replace the original horizontal calibration line.

4. The method according to any one of claims 1-3, wherein obtaining the three-dimensional coordinates of the device comprises: Acquire the magnetic field sensing data and acceleration sensing data of the device; The three-dimensional coordinates of the device are calculated based on the magnetic force sensing data and acceleration sensing data.

5. The method according to claim 1, wherein calculating the pixel coordinates of the two endpoints of the horizontal calibration line based on the slope of the horizontal calibration line, the offset of the horizontal calibration line, and the device screen width includes: Set the horizontal coordinate of the first endpoint of the horizontal calibration line to 0, and set the vertical coordinate to the integer value of the difference between the offset and the device screen width multiplied by the slope divided by 2. Set the horizontal coordinate of the second endpoint of the horizontal calibration line to the device screen width, and set the vertical coordinate to the integer value of the sum of the offset, the device screen width multiplied by the slope, and 2.

6. The method according to any one of claims 1-5, wherein the preset conditions include: The horizontal calibration line is located in the preset screen calibration area and its duration reaches the preset duration threshold.

7. The method according to claim 6, wherein the preset screen calibration area is an area obtained by extending a preset number of pixels upwards and downwards, with the horizontal line at the center of the screen as the baseline.

8. A device screen horizontal calibration apparatus, comprising: The acquisition module is configured to acquire the three-dimensional coordinates of the device. The generation module is configured to calculate the slope of the horizontal calibration line based on the three-dimensional coordinates of the device; calculate the offset of the horizontal calibration line based on the three-dimensional coordinates of the device and the height of the device screen; calculate the pixel coordinates of the two endpoints of the horizontal calibration line based on the slope of the horizontal calibration line, the offset of the horizontal calibration line and the width of the device screen; and draw the horizontal calibration line in the pixel area of ​​the device screen located between the two endpoint pixel coordinates. The calibration module is configured to detect whether the horizontal calibration line meets preset conditions, and when the horizontal calibration line meets the preset conditions, the horizontal calibration of the device screen is completed.

9. A computer program product comprising a computer program / instructions, wherein, When the computer program / instructions are executed by the processor, they implement the steps of the method described in any one of claims 1-7.