A dot pen inclination detection method, system and electronic device

Through the square micromap unit taken by the camera on the dot matrix pen, the inclination angle of the dot matrix pen is calculated, which solves the problem of high production cost of dot matrix pen in the prior art, and realizes accurate inclination detection without additional detection elements, reducing the cost and Power consumption.

CN114459434BActive Publication Date: 2024-11-12QINGDAO SMART EDUCATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210106049.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-28
Publication Date
2024-11-12
Estimated Expiration
2042-01-28

AI Technical Summary

Technical Problem

The existing dot matrix pens require additional micromechanical acceleration sensors to detect inclination, resulting in higher production costs.

Method used

The square micromap unit taken by the camera on the dot matrix pen detects the distance between each corner point and the center of the square area, calculates the rotation angle of the micromap unit along the Z axis, X axis and Y axis, and then determines the inclination angle of the dot matrix pen.

Benefits of technology

The inclination of the dot-matrix pen can be accurately detected without adding other inclination detection elements, reducing production costs and reducing the power consumption of the dot-matrix pen.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114459434B_ABST
    Figure CN114459434B_ABST
Patent Text Reader

Abstract

The present invention relates to a dot matrix pen inclination detection method, system, electronic device and computer readable storage medium, wherein the method comprises: detecting a square area composed of micro-image units to obtain the distance from each corner point to the center of the square area; determining the first rotation angle of the micro-image unit along the Z axis according to the length from each corner point to the center of the square area; determining the second rotation angle of the micro-image unit along the X axis according to the first rotation angle; determining the third rotation angle of the micro-image unit along the Y axis according to the first rotation angle and the second rotation angle; determining the inclination of the dot matrix pen according to the second rotation angle and the third rotation angle. The present invention calculates the inclination angle of the dot matrix pen by using the micro-image units photographed by the camera on the dot matrix pen, so that the dot matrix pen does not need to be attached with other inclination detection elements, and the inclination angle of the dot matrix pen can be obtained, which greatly saves the production cost of the dot matrix pen.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of dot matrix pen inclination detection, and in particular to a dot matrix pen inclination detection method, system, electronic equipment and computer-readable storage medium. Background Art

[0002] The existing dot matrix pen uses a camera to collect the code points laid on the paper in advance, and extracts the coordinate information of the code points through a certain algorithm to restore the writing handwriting. The camera is a miniature camera installed at the tip of the pen. The image unit of the dot code requires a high printing resolution of the paper. The optical path requirements of the miniature camera are relatively strict. Under the existing technical conditions, the distance between the camera and the paper surface is required to remain basically unchanged, and the error does not exceed 2 mm. When using a dot matrix pen as a touch input, there are two ways. One way is that the dot matrix pen moves on the printed medium with the dot code, and the obtained coordinates are transmitted to the display device by wireless or wired means, and then the movement and action of the cursor are displayed; the other way is to directly display the writing or control interface with the dot code on the display, and the dot matrix pen can be directly touched on the display screen.

[0003] In the application field where the dot matrix pen is used for touch operation, it is sometimes necessary to sense the tilt angle of the pen and the medium in order to simulate the real writing and drawing scene. Simulating this scene can bring a better user experience. For example, in the field of education, it is necessary to understand the pen-holding posture of students; or in the field of painting, it is used to simulate the tilt angle of the brush. In painting software such as PHOTOSHOP, different tilt angles can cause corresponding changes in the brush, and so on.

[0004] Currently, the existing dot matrix pen generally detects the tilt angle between the dot matrix pen and the medium by adding other tilt detection elements (such as micro-mechanical acceleration sensors), but such a detection method will lead to an increase in the production cost of the dot matrix pen. Summary of the invention

[0005] To solve the above problems, an object of the embodiments of the present invention is to provide a method, system and electronic device for detecting the inclination angle of a dot matrix pen, so as to solve the problem of high manufacturing cost of the dot matrix pen.

[0006] A dot pen inclination detection method, comprising:

[0007] Step 1: Get the square micro-image unit captured by the camera on the dot matrix pen;

[0008] Step 2: Detect the square area composed of micro-image units and obtain the distance from each corner point to the center of the square area;

[0009] Step 3: Determine the first rotation angle of the micro-image unit along the Z axis according to the length from each corner point to the center of the square area;

[0010] Step 4: Determine a second rotation angle of the micro-image unit along the X-axis according to the first rotation angle;

[0011] Step 5: Determine a third rotation angle of the micro-image unit along the Y axis according to the first rotation angle and the second rotation angle;

[0012] Step 6: Determine the inclination angle of the dot matrix pen according to the second rotation angle and the third rotation angle.

[0013] Preferably, the step 3: determining the first rotation angle of the micro-image unit along the Z axis according to the diagonal length of the square area comprises:

[0014] Using the formula:

[0015]

[0016]

[0017] Determine the first rotation angle of the micro-image unit along the Z axis; wherein α represents the first rotation angle, r1=l1 / l3, r2=l2 / l4, l1 represents the distance from the first corner point of the square area to the center of the square area, l2 represents the distance from the second corner point of the square area to the center of the square area, l3 represents the distance from the third corner point of the square area to the center of the square area, and l4 represents the distance from the fourth corner point of the square area to the center of the square area.

[0018] Preferably, the step 4: determining the second rotation angle of the micro-image unit along the X-axis according to the first rotation angle comprises:

[0019] Using the formula:

[0020]

[0021]

[0022] Determine the second rotation angle of the micro-image unit along the X-axis; wherein θ represents the second rotation angle, u represents the distance from the lens to the micro-image unit, and L represents the original side length of the square area formed by the micro-image units.

[0023] Preferably, the step 4: determining the second rotation angle of the micro-image unit along the X-axis according to the first rotation angle comprises:

[0024] Using the formula:

[0025]

[0026]

[0027] Determine the second rotation angle of the micro-image unit along the X-axis; wherein θ represents the second rotation angle, u represents the distance from the lens to the micro-image unit, and L represents the original side length of the square area formed by the micro-image units.

[0028] Preferably, when photographing a square micro-image unit, the object distance and the image distance are both equal to twice the focal length.

[0029] The present invention also provides a dot matrix pen inclination detection system, comprising:

[0030] A micro-image unit acquisition module is used to acquire a square micro-image unit photographed by a camera on a dot matrix pen;

[0031] An image processing module is used to detect the square area composed of micro-image units and obtain the distance from each corner point to the center of the square area;

[0032] A first rotation angle calculation module, used to determine a first rotation angle of the micro-image unit along the Z axis according to the length from each corner point to the center of the square area;

[0033] A second rotation angle calculation module, used to determine a second rotation angle of the micro-image unit along the X-axis according to the first rotation angle;

[0034] A third rotation angle determination module, used to determine a third rotation angle of the micro-image unit along the Y axis according to the first rotation angle and the second rotation angle;

[0035] The inclination angle determination module is used to determine the inclination angle of the dot matrix pen according to the second rotation angle and the third rotation angle.

[0036] Preferably, the first rotation angle calculation module includes:

[0037] Using the formula:

[0038]

[0039]

[0040] Determine the first rotation angle of the micro-image unit along the Z axis; wherein α represents the first rotation angle, r1=l1 / l3, r2=l2 / l4, l1 represents the distance from the first corner point of the square area to the center of the square area, l2 represents the distance from the second corner point of the square area to the center of the square area, l3 represents the distance from the third corner point of the square area to the center of the square area, and l4 represents the distance from the fourth corner point of the square area to the center of the square area.

[0041] Preferably, the second rotation angle calculation module comprises:

[0042] Using the formula:

[0043]

[0044]

[0045] Determine the second rotation angle of the micro-image unit along the X-axis; wherein θ represents the second rotation angle, u represents the distance from the lens to the micro-image unit, and L represents the original side length of the square area formed by the micro-image units.

[0046] Preferably, the second rotation angle calculation module comprises:

[0047] Using the formula:

[0048]

[0049]

[0050] Determine the second rotation angle of the micro-image unit along the X-axis; wherein θ represents the second rotation angle, u represents the distance from the lens to the micro-image unit, and L represents the original side length of the square area formed by the micro-image units.

[0051] The present invention also provides an electronic device, comprising a bus, a transceiver, a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the transceiver, the memory and the processor are connected via the bus, and the computer program implements the steps in the above-mentioned method for detecting the inclination angle of a dot matrix pen when the computer program is executed by the processor.

[0052] The present invention also provides a computer-readable storage medium on which a computer program is stored, characterized in that when the computer program is executed by a processor, the steps in the above-mentioned dot matrix pen inclination detection method are implemented.

[0053] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:

[0054] The present invention relates to a dot matrix pen inclination detection method, system, electronic device and computer readable storage medium, wherein the method comprises: detecting a square area composed of micro-image units to obtain the distance from each corner point to the center of the square area; determining the first rotation angle of the micro-image unit along the Z axis according to the length from each corner point to the center of the square area; determining the second rotation angle of the micro-image unit along the X axis according to the first rotation angle; determining the third rotation angle of the micro-image unit along the Y axis according to the first rotation angle and the second rotation angle; determining the inclination of the dot matrix pen according to the second rotation angle and the third rotation angle. The present invention calculates the inclination angle of the dot matrix pen by using the micro-image units photographed by the camera on the dot matrix pen, so that the dot matrix pen does not need to be attached with other inclination detection elements, and the inclination angle of the dot matrix pen can be obtained, which greatly saves the production cost of the dot matrix pen.

[0055] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0057] Figure 1 The imaging principle diagram of the dot pen camera provided by the present invention;

[0058] Figure 2 A schematic diagram of oblique imaging of an object provided by the present invention;

[0059] Figure 3 A schematic diagram of the three-dimensional imaging principle of the dot code medium provided by the present invention;

[0060] Figure 4 The schematic diagram of line segment imaging provided by the present invention;

[0061] Figure 5 A flow chart of a dot pen inclination detection method in an embodiment of the present invention;

[0062] Figure 6 This is a schematic diagram of the dot pen inclination angle detection method in the embodiment provided by the present invention. DETAILED DESCRIPTION

[0063] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the present invention.

[0064] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0065] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0066] The object of the present invention is to provide a method, system and electronic device for detecting the inclination angle of a dot matrix pen, aiming to solve the problem of high manufacturing cost of the existing dot matrix pen.

[0067] The present invention uses the size of the tangential distortion of the micro-image unit image captured by the camera on the dot matrix pen to calculate the size of the inclination angle formed by the dot matrix pen and the surface of the writing medium. In order to facilitate the understanding of the present invention, before introducing a dot matrix pen inclination detection method proposed in an embodiment of the present invention, the present invention first introduces the generation mechanism of tangential distortion.

[0068] See also Figure 1-2 , the imaging object is on the right side of the lens, which are SA / SB / SC respectively, and the image sensor is on the left side of the lens, and the images formed by them are AA' / BB' / CC' respectively. If SA and SB are the dot code medium surfaces of the dot matrix pen, the results of (b) and (c) are obtained after imaging respectively. It can be seen that since the lens is not parallel to the medium surface, the image formed has tangential distortion. When the focal length of the object being photographed is comparable to the size of the object, this tangential distortion will be more obvious. The present invention uses this tangential distortion to calculate the size of the inclination angle.

[0069] See also Figure 3 , where (a) is the dot pen camera facing the medium, sampling a square area. When facing, the image is shown as (a'). When the pen is tilted along the x-axis, according to Figure 2 Analysis will result in image (b'); in actual use, the pen will also rotate along its own longitudinal axis, corresponding to the medium rotating along the z-axis, as shown in Figure (c), and image (c') will be obtained accordingly. Therefore, by rotating relative to the two axes, the tilt angle of the pen on the medium can be simulated. In fact, it is also equivalent for the medium to rotate only relative to the X and Y axes. For example, when the pen rotates along the Y axis, it is equivalent to the medium first rotating in one direction along the Z axis and then rotating along the X axis. The resulting image is completely consistent in terms of distortion. The present invention adopts the rotation of the X and Z axes in order to more clearly describe the relationship between the distortion size and the tilt angle, and the Z axis of the spatial rectangular coordinate system constructed by the present invention is consistent with the shooting direction of the dot matrix pen.

[0070] Please refer to Figure 4 , the straight line segment is placed at 2 times the focal length in front of the lens. For the convenience of description, its image size is AA' itself, and the X-axis is perpendicular to the outside. When the line segment rotates around the X-axis by an angle θ, the image obtained is BB', where O is the midpoint of AA', the length is 2l (the length of the two line segments), and the distance of SO is u, then the following relationship can be obtained:

[0071]

[0072]

[0073]

[0074] According to the above (1)-(3), the rotation angle of the straight line segment l can be calculated.

[0075] The following is a description of a dot pen inclination detection method provided by the present invention:

[0076] See also Figure 5-6 , a dot pen inclination detection method, comprising:

[0077] Step 1: Get the square micro-image unit captured by the camera on the dot matrix pen;

[0078] It should be noted that the object distance and image distance of the lens are both near 2 times the focal length, which can produce image distortion that is beneficial to tilt angle detection when the dot matrix pen is tilted.

[0079] Step 2: Detect the square area composed of micro-image units and obtain the distance from each corner point to the center of the square area;

[0080] Step 3: Determine the first rotation angle of the micro-image unit along the Z axis according to the length from each corner point to the center of the square area;

[0081] Furthermore, step 3 includes:

[0082] Using the formula:

[0083]

[0084]

[0085] Determine the first rotation angle of the micro-image unit along the Z axis; wherein α represents the first rotation angle, r1=l1 / l3, r2=l2 / l4, l1 represents the distance from the first corner point of the square area to the center of the square area, l2 represents the distance from the second corner point of the square area to the center of the square area, l3 represents the distance from the third corner point of the square area to the center of the square area, and l4 represents the distance from the fourth corner point of the square area to the center of the square area.

[0086] Step 4: Determine a second rotation angle of the micro-image unit along the X-axis according to the first rotation angle;

[0087] In this embodiment of the present invention, step 4 includes:

[0088] Using the formula:

[0089]

[0090]

[0091] Determine the second rotation angle of the micro-image unit along the X-axis; wherein θ represents the second rotation angle, u represents the distance from the lens to the micro-image unit, and L represents the original side length of the square area formed by the micro-image units.

[0092] It should be noted that the present invention can also adopt the formula:

[0093]

[0094]

[0095] Determine the second rotation angle of the micro-image unit along the X-axis; wherein θ represents the second rotation angle, u represents the distance from the lens to the micro-image unit, and L represents the original side length of the square area formed by the micro-image units.

[0096] Step 5: Determine a third rotation angle of the micro-image unit along the Y axis according to the first rotation angle and the second rotation angle;

[0097] Step 6: Determine the inclination angle of the dot matrix pen according to the second rotation angle and the third rotation angle.

[0098] The present invention will be further described below in conjunction with specific embodiments:

[0099] refer to Figure 6 In order to quantitatively analyze the relationship between tangential distortion and tilt angle, the camera captures a square area each time, where the number of micro-image units contained in the square area is a square number, for example, 4, 9 or 16. The size of this square area can be selected to be 4-20 square millimeters, the focal length of the camera can be 6 mm, and the image distance is about 2 times the focal length, so that a better distortion effect can be achieved.

[0100] The square EFGH represents the captured square area. In order to express the distortion size, its diagonal is connected, with the center point being point O and the length of the diagonal being 2L. Figure 6 (a) shown.

[0101] For the sake of simplicity of analysis, the change of the square area is divided into two steps. The first step is to rotate along the X-axis direction, such as Figure 6 As shown in (b), the image obtained is Figure 6 (b), l1 / l3=l2 / l4=IO / JO. If the angle of rotation is θ, then relations (1) and (2) are satisfied.

[0102] In the second step, the square area is rotated around its center by an angle α, such as Figure 6 (c) Then the image formed by the lens is Figure 6 (d) To analyze its distortion, project the corner points E, F, G, and H onto the axis in sequence, and then we can deduce that: Figure 6 The ratio of l1 / l3 in (d) is Figure 6 (c) The ratios of the two line segments IO and JO after distortion are equal.

[0103] Let r1=l1 / l3, r2=l2 / l4.

[0104] According to formula (1) and the relationship between the projections of each corner point on the axis, we can get the following equation (4) for corner points E and G and their connecting line:

[0105] For the corner points F and H, and their connecting lines, the formula (5)

[0106] According to (4) and (5), we can get:

[0107]

[0108] In the formula,

[0109] Since R is a known quantity, the value of θ can be obtained by substituting equation (6) into equation (4) or (5).

[0110] In actual use, it is also necessary to convert the angle values ​​of rotation along the X-axis and Z-axis into the angle values ​​of rotation along the X-axis and Y-axis, which can be easily achieved using spatial spherical coordinates. No further explanation will be given here.

[0111] The implementation steps of the algorithm of the present invention are as follows:

[0112] 1. Take 4, 9 or 16 micro-image units;

[0113] 2. Image processing: detect the square area composed of micro-image units and obtain the four corner points of the square area;

[0114] 3. Calculate the distances l1, l2, l3, l4;

[0115] 4. Calculate the rotation angle α along the Z axis;

[0116] 5. Calculate the rotation angle θ along the X axis;

[0117] 6. Calculate the inclination angle in the X and Y directions and And report it to the system; further, using the relationship between spherical coordinates and rectangular coordinates, we can get:

[0118]

[0119]

[0120] The present invention calculates the tilt angle of the dot matrix pen by utilizing the square area composed of micro-image units photographed by a camera on the dot matrix pen, so that the dot matrix pen does not need to be equipped with other tilt angle detection elements to obtain the tilt angle of the dot matrix pen, which not only reduces the power consumption of the dot matrix pen, but also greatly saves the production cost of the dot matrix pen.

[0121] The present invention also provides a dot matrix pen inclination detection system, comprising:

[0122] A micro-image unit acquisition module is used to acquire a square micro-image unit photographed by a camera on a dot matrix pen;

[0123] An image processing module is used to detect the square area composed of micro-image units and obtain the distance from each corner point to the center of the square area;

[0124] A first rotation angle calculation module, used to determine a first rotation angle of the micro-image unit along the Z axis according to the length from each corner point to the center of the square area;

[0125] A second rotation angle calculation module, used to determine a second rotation angle of the micro-image unit along the X-axis according to the first rotation angle;

[0126] A third rotation angle determination module, used to determine a third rotation angle of the micro-image unit along the Y axis according to the first rotation angle and the second rotation angle;

[0127] The inclination angle determination module is used to determine the inclination angle of the dot matrix pen according to the second rotation angle and the third rotation angle.

[0128] Preferably, the first rotation angle calculation module includes:

[0129] Using the formula:

[0130]

[0131]

[0132] Determine the first rotation angle of the micro-image unit along the Z axis; wherein α represents the first rotation angle, r1=l1 / l3, r2=l2 / l4, l1 represents the distance from the first corner point of the square area to the center of the square area, l2 represents the distance from the second corner point of the square area to the center of the square area, l3 represents the distance from the third corner point of the square area to the center of the square area, and l4 represents the distance from the fourth corner point of the square area to the center of the square area.

[0133] Preferably, the second rotation angle calculation module includes:

[0134] Using the formula:

[0135]

[0136]

[0137] Determine the second rotation angle of the micro-image unit along the X-axis; wherein θ represents the second rotation angle, u represents the distance from the lens to the micro-image unit, and L represents the original side length of the square area formed by the micro-image units.

[0138] Preferably, the second rotation angle calculation module includes:

[0139] Using the formula:

[0140]

[0141]

[0142] Determine the second rotation angle of the micro-image unit along the X-axis; wherein θ represents the second rotation angle, u represents the distance from the lens to the micro-image unit, and L represents the original side length of the square area formed by the micro-image units.

[0143] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:

[0144] The present invention calculates the tilt angle of the dot matrix pen by using the micro-image unit photographed by the camera on the dot matrix pen, so that the dot matrix pen does not need to be equipped with other tilt angle detection elements to obtain the tilt angle of the dot matrix pen, which not only reduces the power consumption of the dot matrix pen, but also greatly saves the production cost of the dot matrix pen.

[0145] An embodiment of the present invention further provides an electronic device, including a bus, a transceiver, a memory, a processor, and a computer program stored in the memory and executable on the processor. The transceiver, the memory, and the processor are respectively connected via a bus. When the computer program is executed by the processor, each process of the above-mentioned embodiment of a dot matrix pen inclination angle detection method is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0146] In addition, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned dot matrix pen inclination detection method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0147] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technical solution that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A method for detecting the inclination angle of a dot pen, characterized in that: include: Step 1: Get the square micro-image unit captured by the camera on the dot matrix pen; Step 2: Detect the square area composed of micro-image units and obtain the distance from each corner point to the center of the square area; Step 3: Determine the first rotation angle of the micro-image unit along the Z axis according to the length from each corner point to the center of the square area; The step 3: determining the first rotation angle of the micro-image unit along the Z axis according to the length from each corner point to the center of the square area, comprises: Using the formula: Determine the first rotation angle of the micro-image unit along the Z axis; wherein α represents the first rotation angle, r1=l1 / l3, r2=l2 / l4, l1 represents the distance from the first corner point of the square area to the center of the square area, l2 represents the distance from the second corner point of the square area to the center of the square area, l3 represents the distance from the third corner point of the square area to the center of the square area, and l4 represents the distance from the fourth corner point of the square area to the center of the square area; Step 4: Determine a second rotation angle of the micro-image unit along the X-axis according to the first rotation angle; The step 4: determining a second rotation angle of the micro-image unit along the X-axis according to the first rotation angle comprises: Using the formula: Determine a second rotation angle of the micro-image unit along the X-axis; wherein θ represents the second rotation angle, u represents the distance from the lens to the micro-image unit, and L represents the original side length of the square area formed by the micro-image units; Step 5: Determine the inclination angle of the micro-image unit along the X-axis and the Y-axis according to the first rotation angle and the second rotation angle; include: Calculate the rotation angle α along the Z axis; Calculate the rotation angle θ along the X axis; Calculate the inclination of the dot pen in the X and Y directions and And report it to the system; further, using the relationship between spherical coordinates and rectangular coordinates, we can get:

2. A dot pen inclination detection method according to claim 1, characterized in that: When shooting square micro-image units, the object distance and image distance are both equal to 2 times the focal length.

3. An electronic device, comprising a bus, a transceiver, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the transceiver, the memory, and the processor are connected via the bus, wherein: When the computer program is executed by the processor, the steps of the dot matrix pen inclination detection method according to any one of claims 1 to 2 are implemented.

4. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps in the dot matrix pen inclination detection method according to any one of claims 1 to 2 are implemented.