Touch-control recognition method and apparatus, and electronic device
By setting two signal thresholds in infrared touch technology, the problem of insufficient accuracy in the recognition of small objects in the prior art is solved, and higher recognition accuracy and user experience are achieved.
Patent Information
- Application Number
- PCT/CN2024/089471
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-09-06
- Filing Date
- 2024-04-24
- Publication Date
- 2025-03-13
AI Technical Summary
The existing infrared touch technology is insufficient in identifying small objects, which can easily lead to disconnection or pen connection, affecting the user experience.
By setting two signal thresholds (first signal threshold and second signal threshold), a smaller first signal threshold is used when judging touch operations, and a larger second signal threshold is used when identifying touch points to improve recognition accuracy and accuracy.
It improves the accuracy of touch recognition and the accuracy of touch point recognition, reduces the phenomenon of disconnection and stroke connection, and improves the user experience.
Smart Images

Figure CN2024089471_13032025_PF_FP_ABST
Abstract
Description
Touch recognition method and device, and electronic equipment
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to Chinese patent application No. 202311156955.1 filed on September 6, 2023, the entire contents of which are incorporated herein by reference. Technical Field
[0003] The present application relates to the field of touch technology, and more particularly to a touch recognition method and device, and an electronic device. Background Art
[0004] With the development of touch technology, people’s requirements for the accuracy and experience of touch recognition are getting higher and higher. The basic implementation principle of current infrared touch is to cover the touch screen with transmitters and receivers all around (or on both sides). During the scanning process, if there is an object blocking the screen, the receiver’s received signal will drop. By judging the difference between the signal received by the receiver and the preset threshold, it is determined which infrared rays are blocking lines and which are non-blocking lines, and then touch recognition is performed. However, if the preset threshold is set too low, some small objects such as styluses will block the light to a limited extent, and the signal drop is small. Some blocking lines cannot be recognized, resulting in too few or no blocking lines, causing the recognition algorithm to be unable to accurately calculate the touch point, ultimately leading to line breakage. If the preset threshold is set too high, it is easy for the touch object to be detected as a blocking line when it is far away from the surface of the touch panel. At this time, the recognition algorithm has already calculated the touch point, making the user feel that writing has been done before touching, reducing the experience, and it is easy to produce continuous strokes during the writing process.
[0005] Summary of the Invention
[0006] Based on the above situation, the main purpose of this application is to provide a touch recognition method and device, and electronic equipment, which can improve the accuracy of touch recognition and the precision of touch point recognition, and enhance the user experience.
[0007] To achieve the above objectives, the technical solutions adopted in this application are as follows:
[0008] A first aspect of the present application provides a touch recognition method, comprising:
[0009] Determination step: obtaining a current signal value of each infrared signal line in the current frame, and comparing the current signal value of each infrared signal line with its corresponding first signal threshold and second signal threshold, wherein each infrared signal line corresponds to a first signal threshold and a second signal threshold, and the first signal threshold corresponding to the same infrared signal line is smaller than the second signal threshold;
[0010] Identification steps: If there is an infrared signal line whose current signal value is less than the first signal threshold, it is considered that a touch operation has occurred in the current frame, and touch point identification is performed based on the infrared signal line whose current signal value is less than the second signal threshold; if all current signal values are greater than or equal to the first signal threshold, it is considered that no touch operation has occurred in the current frame, and touch point identification is not performed.
[0011] Optionally, the first signal threshold and the second signal threshold are determined according to the background value of the corresponding infrared signal line; the background value is determined according to the signal value when the infrared signal line is not blocked.
[0012] Optionally, before obtaining the current signal value of each infrared signal line in the current frame, an initialization step is further included, and the initialization step includes:
[0013] Collecting multiple frames of collected signal values when each infrared signal line is not blocked, and determining the background value corresponding to the infrared signal line based on the multiple frames of collected signal values corresponding to the same infrared signal line;
[0014] The corresponding first signal threshold and second signal threshold are determined according to the background value of each infrared signal ray.
[0015] Optionally, for the same infrared signal line, the method for determining the first signal threshold and the second signal threshold according to the background value thereof includes:
[0016] When the background value is less than a first background threshold, the first signal threshold and the second signal threshold are both set to 0;
[0017] When the background value is greater than or equal to the first background threshold, the first signal threshold and the second signal threshold are each determined according to a ratio thereof to the background value and / or a fixed difference therebetween.
[0018] Optionally, when the background value is greater than or equal to the first background threshold and less than a second background threshold, the first signal threshold is the product of the background value and a first proportion, and the second signal threshold is the product of the background value and a second proportion;
[0019] When the background value is greater than or equal to the second background threshold, the first signal threshold is the difference between the background value and the preset target value, and the second signal threshold is the product of the background value and the third ratio;
[0020] Among them, the first proportion is smaller than the second proportion, and the second proportion is smaller than the third proportion.
[0021] Optionally, the first background threshold and the second background threshold are determined according to the preset target value;
[0022] The first background threshold is half of a preset target value; the second background threshold is the preset target value;
[0023] The preset target value corresponding to each infrared signal line is 1 / 2 to 3 / 4 of its corresponding maximum theoretical signal value.
[0024] Optionally, the determining step includes:
[0025] Obtain the current signal value of each infrared signal line in the current frame, and compare the current signal value of each infrared signal line with the corresponding first signal threshold and second signal threshold in turn.
[0026] The identification step comprises:
[0027] If the current signal value of the infrared signal line is less than the first signal threshold, the infrared signal line is considered to be an obstruction line, and the touch identification is increased by 1, and the number of obstruction lines is increased by 1;
[0028] If the signal value of the infrared signal line is greater than or equal to the first signal threshold and less than the second signal threshold, the infrared signal line is considered to be an occlusion line, the touch identifier remains unchanged, and the number of occlusion lines is increased by 1;
[0029] If the signal value of the infrared signal line is greater than or equal to the second signal threshold, the infrared signal line is considered to be a non-blocking line, and the number of touch marks and blocking lines remains unchanged;
[0030] The number of touch markers and occlusion lines is initially set to 0;
[0031] If the touch flag is greater than 0, touch point identification is performed based on all occlusion lines;
[0032] If the touch flag is equal to 0, no touch point recognition is performed.
[0033] Optionally, the determining step includes:
[0034] Obtain the current signal value of each infrared signal line in the current frame, and compare the current signal value of each infrared signal line with the corresponding first signal threshold value in turn.
[0035] When an infrared signal line with a current signal value less than the first signal threshold appears, the current signal values of all the infrared signal lines are compared with the second signal threshold, and the first sub-step is executed;
[0036] If all current signal values are greater than or equal to the first signal threshold, executing the second sub-step;
[0037] The identification step comprises:
[0038] The first sub-step: considering that a touch operation occurs in the current frame, and performing touch point identification based on the infrared signal line whose current signal value is less than the second signal threshold;
[0039] Second sub-step: It is considered that no touch operation occurs in the current frame, and touch point recognition is not performed.
[0040] A second aspect of the present application provides a touch recognition device, comprising:
[0041] A judgment module is configured to obtain a current signal value of each infrared signal line in a current frame, and compare the current signal value of each infrared signal line with its corresponding first signal threshold and second signal threshold, wherein each infrared signal line corresponds to a first signal threshold and a second signal threshold, respectively, and the first signal threshold corresponding to the same infrared signal is smaller than the second signal threshold;
[0042] Identification module: connected to the judgment module signal, configured to: if there is an infrared signal line whose current signal value is less than the first signal threshold, it is considered that a touch operation has occurred in the current frame, and touch point identification is performed based on the infrared signal line whose current signal value is less than the second signal threshold; if all current signal values are greater than or equal to the first signal threshold, it is considered that no touch operation has occurred in the current frame, and touch point identification is not performed.
[0043] A third aspect of the present application provides an electronic device, including a touch screen, wherein the touch screen can execute any of the touch recognition methods described above.
[0044] A fourth aspect of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the touch recognition methods described above.
[0045] The touch recognition method of the present application sets two first signal thresholds and second signal thresholds of different sizes, and determines whether a touch operation has been performed by using the smaller first signal threshold, and uses all infrared signal lines that are smaller than the larger second signal threshold for touch point recognition. In this way, even if a thinner touch object, such as a thinner stylus, blocks some infrared signal lines, its blocking effect on light is weak, and only a very small number of infrared signal lines have small signal values. Although some infrared signal lines are blocked, their signal value decreases at a low rate, that is, the signal value is still relatively large. The present application can determine that a touch has occurred by using the smaller first signal threshold. When identifying touch points, since the number of blocked lines that are smaller than the first signal threshold is small, the present application can also increase the number of blocked lines by using the larger second signal threshold, that is, those blocked lines that actually cause blockage but have a smaller drop in signal value are also used for touch point recognition. Therefore, the present application can not only recognize The obstruction of infrared signal lines by thinner touch objects also improves the recognition rate and recognition accuracy of small touch objects; when the distance between the touch object and the touch screen surface is large, even if it can block part of the infrared signal lines, its blocking effect on light is still relatively weak, and the corresponding signal value decrease of these blocked infrared signal lines is small, that is, the signal value is still relatively high. The present application can avoid being recognized as a touch operation too early due to the presence of these blocked infrared rays at a long distance through a smaller first signal threshold. It can only be recognized as a touch operation when it is at a small distance from the touch screen surface, thereby avoiding continuous strokes during touch writing; and when it is judged as a touch operation through the first signal threshold, touch point recognition is performed through all infrared signal lines with signal values less than the second signal threshold, which can increase the number of blocked infrared signal lines for touch point recognition as much as possible, thereby improving the accuracy of touch point recognition, making the handwriting fuller when applied to touch writing, and thus improving the user experience.
[0046] Other beneficial effects of the present application will be explained through the introduction of specific technical features and technical solutions in the specific implementation methods. Through the introduction of these technical features and technical solutions, those skilled in the art should be able to understand the beneficial technical effects brought about by the technical features and technical solutions. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The following describes the optional implementation of the present application with reference to the accompanying drawings, wherein:
[0048] FIG1 is a flow chart of an optional implementation of the touch recognition method of the present application;
[0049] FIG2 is a system block diagram of an optional implementation of the touch recognition device of the present application. DETAILED DESCRIPTION
[0050] The present application is described below based on examples, but the present application is not limited to these examples. In the detailed description of the present application below, some specific details are described in detail. In order to avoid obscuring the essence of the present application, well-known methods, processes, procedures, and components are not described in detail.
[0051] Furthermore, persons of ordinary skill in the art will appreciate that the figures provided herein are for illustration purposes only and are not necessarily drawn to scale.
[0052] Unless the context clearly requires otherwise, throughout the specification and claims, the words "include," "comprising," and similar words should be construed in an inclusive sense rather than an exclusive or exhaustive sense; that is, in the sense of "including but not limited to."
[0053] In the description of this application, it should be understood that the terms "first", "second", etc. are used for descriptive purposes only and should not be understood to indicate or imply relative importance. In addition, in the description of this application, unless otherwise specified, "plurality" means two or more.
[0054] The present application provides a touch recognition method for a touch screen, such as an electronic device with a touch screen, wherein an infrared transmitter and an infrared receiver are provided on the frame of the touch screen. The infrared transmitter and the infrared receiver can be specifically arranged on all four sides of the frame, or only on two opposite or adjacent sides of the frame. Regardless of the arrangement, the infrared transmitter and the infrared receiver can be arranged alternately in the same frame, or only the infrared transmitter or the infrared receiver can be arranged in the same frame; of course, the infrared transmitter and the infrared receiver can also be arranged only on a single side of the frame.
[0055] As shown in FIG1 , the touch recognition method includes:
[0056] S100 judgment step: obtain the current signal value of each infrared signal line in the current frame, and compare the current signal value of each infrared signal line with the size of its corresponding first signal threshold and second signal threshold, wherein each infrared signal line corresponds to a first signal threshold and a second signal threshold, respectively, and the first signal threshold corresponding to the same infrared signal line is smaller than the second signal threshold, that is, an infrared signal line has a first signal threshold and a second signal threshold, and the current signal value of the infrared signal line obtained in real time is compared with the first signal threshold and the second signal threshold of the infrared signal line.
[0057] S200 Identification step: If there is an infrared signal line whose current signal value is less than the first signal threshold, it is considered that a touch operation has occurred in the current frame, and touch point identification is performed based on the infrared signal line whose current signal value is less than the second signal threshold; if all current signal values are greater than or equal to the first signal threshold, it is considered that no touch operation has occurred in the current frame, and touch point identification is not performed.
[0058] The above-mentioned touch recognition method sets two first signal thresholds and second signal thresholds of different sizes. The smaller first signal threshold is used to determine whether a touch operation has been performed, while all infrared signal lines with a signal value less than the larger second signal threshold are used for touch point identification. In this way, even a thin touch object, such as a thin stylus, can be identified by the larger second signal threshold as blocking the infrared signal lines, thereby improving the recognition rate and recognition accuracy of small touch objects. When the touch object is at a large distance from the touch screen surface, the smaller first signal threshold can also prevent premature recognition as a touch operation. Only when the distance from the touch screen surface is small can the touch operation be recognized as a touch operation, thereby avoiding the occurrence of continuous strokes during touch writing. Moreover, when a touch operation is determined by the first signal threshold, all infrared signal lines with a signal value less than the second signal threshold are used for touch point identification. This can maximize the number of infrared signal lines used for touch point identification, thereby improving the accuracy of touch point identification. When applied to touch writing, the handwriting is made fuller, thereby improving the user experience.
[0059] In actual applications, in the above touch recognition method, when obtaining the current signal value of each infrared signal line in the current frame, all infrared signal lines can be judged first, that is, first determine whether each infrared signal line is considered to be a touch operation and record the touch identifier, and whether it is an occlusion line and record the number of occlusion lines, and then determine the touch operation and identify the touch point based on the touch identifier and the number of occlusion lines. Specifically,
[0060] The judgment step S100 includes:
[0061] Obtain the current signal value of each infrared signal line in the current frame, and compare the current signal value of each infrared signal line with its corresponding first signal threshold and second signal threshold in turn.
[0062] S200 identification steps include:
[0063] If the current signal value of the infrared signal line is less than the first signal threshold, the infrared signal line is considered to be an obstruction line, and the touch identification number is increased by 1 and the number of obstruction lines is increased by 1;
[0064] If the signal value of the infrared signal line is greater than or equal to the first signal threshold and less than the second signal threshold, the infrared signal line is considered to be an occlusion line, the touch identifier remains unchanged, and the number of occlusion lines is increased by 1;
[0065] If the signal value of the infrared signal line is greater than or equal to the second signal threshold, the infrared signal line is considered to be a non-blocking line, and the number of touch marks and blocking lines remains unchanged;
[0066] Among them, the number of touch markers and occlusion lines is initially set to 0;
[0067] If the touch flag is greater than 0, the touch point is identified based on all occlusion lines;
[0068] If the touch ID is equal to 0, no touch point recognition is performed.
[0069] This approach can make the entire touch recognition process clearer and simpler, and improve the accuracy of touch recognition and the precision of touch point recognition.
[0070] In another embodiment, the specific steps in the judgment step and the identification step may be performed alternately, such as first judging whether each infrared signal line is less than the first signal threshold. As long as it is judged that the current signal value of one infrared signal line is less than the first signal threshold, it is considered that a touch operation exists in the current frame. Then, all infrared signal lines are judged whether they are less than the second signal threshold. Then, touch point identification is performed based on all infrared signal lines whose current signal values are less than the second signal threshold. If the current signal values of all infrared signal lines are greater than or equal to the first signal threshold, it is considered that no touch operation exists in the current frame, and there is no need to judge whether each current signal value is less than the second signal threshold. Specifically,
[0071] The judgment step S100 includes:
[0072] Obtaining a current signal value of each infrared signal line in a current frame, and sequentially comparing the current signal value of each infrared signal line with its corresponding first signal threshold;
[0073] When an infrared signal line with a current signal value less than the first signal threshold appears, the current signal values of all infrared signal lines are compared with the second signal threshold, and the first sub-step is executed;
[0074] If all current signal values are greater than or equal to the first signal threshold, executing the second sub-step;
[0075] S200 identification steps include:
[0076] The first sub-step: considering that a touch operation has occurred in the current frame, and performing touch point identification based on all infrared signal lines whose current signal values are less than a second signal threshold;
[0077] Second sub-step: It is considered that no touch operation occurs in the current frame, and touch point recognition is not performed, and therefore, there is no need to compare with the second signal threshold.
[0078] The first and second signal thresholds can be set fixed values. In an optional embodiment of the present application, the first and second signal thresholds are determined based on the background values of their corresponding infrared signal lines, where the background value is the signal value when the infrared signal line is not obstructed. In other words, for this infrared signal line, the signal value collected when the infrared signal line is not obstructed is used as the background value. Associating the first and second signal thresholds with their corresponding background values can more appropriately set the first and second signal thresholds, thereby improving the accuracy of touch operation judgment, more accurately identifying the truly obstructed infrared signal line, and improving the recognition accuracy of touch recognition points.
[0079] The background value of each infrared signal line can be determined by collecting the signal value of each infrared signal line. Specifically, it can be determined by collecting a scanning frame, of course, a scanning frame when the touch screen is not blocked, and obtaining the required signal value of each infrared signal line from the scanning frame as the collected signal value, and using the collected signal value as the background value.
[0080] In an optional embodiment of the present application, a method for determining the background value of each infrared signal line includes:
[0081] Collect multiple frames of signal values when the infrared signal line is not blocked;
[0082] The average value of the multiple collected signal values is used as the background value of the infrared signal line, or the minimum collected signal value among the multiple collected signal values is used as the background value.
[0083] In actual operation, multiple scanning frames can be captured when the touch screen is not obstructed. Each scanning frame includes the collected signal values corresponding to multiple infrared signal lines. For each infrared signal line, the following steps are performed: multiple collected signal values corresponding to the same infrared signal line are obtained from these scanning frames, and then these collected signal values are averaged as the background value of the infrared signal line, or the smallest collected signal value among these collected signal values is directly selected as the background value of the infrared signal line. Using this method, the first signal threshold and the second signal threshold can be set more accurately, further improving the accuracy of touch operation judgment and touch point recognition, increasing the fullness of written lines, and enhancing the user experience.
[0084] The above-mentioned background values can be collected in advance, such as being stored on the touch screen before the electronic device leaves the factory. In an optional implementation of the present application, the background value is set when the touch operation is started. This method can avoid the problem of deviations between the signal values of each infrared signal line and those at the factory caused by actual use, such as the problem that the loss of the infrared transmitter and the infrared receiver is inconsistent with that at the factory after the electronic device has been used for a period of time, or the problem that the power in actual use is different from that at the factory. Therefore, the initialization step during use makes the first signal threshold and the second signal threshold used at the time more reasonable, thereby improving the accuracy of touch operation judgment and touch point recognition. Specifically, an initialization step is added before performing the S100 judgment step, and the initialization step includes:
[0085] Collecting multiple frames of collected signal values when each infrared signal line is not blocked, and determining the background value corresponding to the infrared signal line based on the multiple frames of collected signal values corresponding to the same infrared signal line;
[0086] The corresponding first signal threshold and second signal threshold are determined according to the background value of each infrared signal ray.
[0087] In the above-mentioned embodiments, when determining the background value, the multi-frame acquisition signal values collected can optionally be continuous multi-frame acquisition signal values. This can shorten the time for determining the background value as much as possible. In particular, in the embodiment where the background value is determined through an initialization step when the touch operation is started, the initialization time can be shortened as much as possible, thereby improving the touch operation experience. Of course, discontinuous signal frames can also be used to determine the background value. It should be noted that in the embodiment where the background value is stored in advance, the touch recognition method can also include an initialization step. In this case, there is no need to re-determine the background value in the initialization step.
[0088] In the above embodiments, for the same infrared signal line, the first signal threshold and the second signal threshold are less than the background value. Specifically, the first signal threshold and the second signal threshold can each be a percentage of the background value (i.e., the product of the background value and the percentage), or a fixed difference between the first signal threshold and the background value (i.e., the difference between the background value and a fixed difference), or a combination of the above two methods, i.e., a percentage of the background value minus or plus a fixed value. For example, the first signal threshold can be 20% of the background value, and the second signal threshold can be 40% of the background value. In other words, the first signal threshold and the second signal threshold can each be determined using one of the above three methods, i.e., the same method can be selected for both, or different methods can be selected for each.
[0089] The first signal threshold and the second signal threshold may also be set in different ways according to the background value being in different ranges.
[0090] In one embodiment, the first signal threshold and the second signal threshold are determined based on the background value only when the background value is within a predetermined background threshold range. This approach can prevent the background value from being too low, which can lead to unsatisfactory performance due to unstable operation of many infrared emitters. Specifically, for the same infrared signal line, the method for determining the first signal threshold and the second signal threshold based on its background value includes:
[0091] When the background value B 实 When the value is less than the first background threshold B1, the first signal threshold and the second signal threshold are both set to 0;
[0092] When the background value B 实 When the background value is greater than or equal to the first background threshold B1, the first signal threshold and the second signal threshold are determined according to their respective proportions to the background value (i.e., the percentage of the background value mentioned above) and / or their fixed difference from the background value (i.e., the fixed difference from the background value mentioned above). 实 When the first signal threshold value is greater than or equal to the first background threshold value B1, the first signal threshold value and the second signal threshold value can each be determined by selecting one of the above methods. The two can select the same method or different methods.
[0093] In some embodiments, when the background value B 实 When the threshold is greater than or equal to the first background threshold B1, the first signal threshold and the second signal threshold can be set in the same manner as above. Within this range, the first signal threshold can be a value and the second signal threshold can be set to a value. For example, the first signal threshold can be a value of the background value ratio. 实 The product of a certain ratio, the second signal threshold is the background value B 实 and the product of another proportion; for example, the first signal threshold is in the form of a proportion of the background value, and the second signal threshold is in the form of a fixed difference from the background value; of course, the first signal threshold and the second signal threshold can also be a combination of any other two of the above methods, which will not be listed here one by one.
[0094] In some other embodiments, a second background threshold may be added, and the first signal threshold and the second signal threshold may be determined based on the background value and the second background threshold. Different setting methods may be selected based on the different ranges of the first signal threshold and the second signal threshold set for the background value. Alternatively, the same setting method may be selected, but different proportions or differences may be selected within the same method based on the different ranges of the background value, or both the proportions and the differences may be different, wherein the second background threshold is greater than the first background threshold. In an optional embodiment of the present application,
[0095] When the background value B 实When the signal level is greater than or equal to the first background threshold B1 and less than the second background threshold B2, the first signal threshold is the background value B 实 The product of the first ratio and the second signal threshold is the background value B 实 The product of the second proportion;
[0096] When the background value B 实 When the first signal threshold is greater than or equal to the second background threshold B2, the first signal threshold is the background value B 实 The difference between the preset target value and the second signal threshold is the background value B 实 The product of the third proportion.
[0097] Among them, the first proportion is smaller than the second proportion, and the second proportion is smaller than the third proportion.
[0098] This subdivision method can make the settings of the first signal threshold and the second signal threshold more accurate, further improve the recognition accuracy of small touch objects, reduce the distance for touch recognition, increase the fullness of written lines, and enhance the touch experience.
[0099] Specifically, the first proportion, the second proportion, and the third proportion can be set according to a fixed method, such as the second proportion is twice the first proportion, and the third proportion is three times the second proportion, such as the first proportion is 0.15, the second proportion is 0.3, and the third proportion is 0.9. Of course, the first proportion, the second proportion, and the third proportion can also be set according to actual conditions or empirical values, and this application does not impose any specific limitations.
[0100] The first and second background thresholds can be set empirically. In an optional embodiment of the present application, the first and second background thresholds are determined based on the preset target value. In other words, associating the first and second background thresholds with the preset target value allows for more accurate setting of the first and second background thresholds, thereby preventing excessively high background values from making it difficult to identify a touch operation even if a touch object blocks the infrared signal line. This improves the accuracy of touch operation recognition and the precision of touch point recognition.
[0101] Specifically, the first and second background thresholds are set based on different percentages of a preset target value. Alternatively, they can be set based on a fixed difference from the preset target value. The specific percentages and fixed values are not specifically limited in this application. In one optional embodiment, the first background threshold is half the preset target value, and the second background threshold is the preset target value. This setting can further improve the accuracy of touch operation recognition and the precision of touch point recognition.
[0102] The above-mentioned preset target value can be considered as an ideal value of the actual collected signal value of the corresponding infrared signal line when acquiring the background value. That is to say, in the process of collecting the background value of the infrared signal line, the collected signal values obtained are located near this preset target value, and the actual collected signal value is less than the preset target value. In actual application, the preset target value can be set first, and the first background threshold and the second background threshold are determined according to the preset target value. The preset target value is within the theoretical signal value range of the corresponding infrared signal line and can be determined based on experience or the maximum theoretical value of the corresponding infrared signal line signal. Optionally, the preset target value corresponding to each infrared signal line is 1 / 2 to 34 of the corresponding maximum theoretical signal value. For example, when the maximum theoretical signal value is 255, the preset target value can be set to a value between 128 and 190, such as 160. Because if the background value is too high, the signal value is likely to be saturated. That is to say, if the power of the infrared transmitter is too strong, even if there is an object blocking it, the drop in the signal value may be very small, so it is difficult to be identified as an obstruction of the signal line. By setting a preset signal value and using the above-mentioned first background threshold and second background threshold to set the first signal threshold and the second signal threshold, the above-mentioned problem can be avoided well, and the influence of the unstable working state of the infrared transmitter on the touch operation recognition accuracy and the touch point recognition accuracy can be avoided as much as possible.
[0103] This application also provides a touch writing method, including:
[0104] Performing touch recognition according to the touch recognition method described in any one of the above embodiments to obtain touch points;
[0105] Writing is displayed according to the obtained touch points.
[0106] This touch writing method can accurately obtain each track during the writing process, make the handwriting fuller, and improve the user experience.
[0107] The present application further provides a touch recognition device, which can be used to execute the touch recognition method described in any of the above embodiments. As shown in FIG2 , the touch recognition device includes:
[0108] The judgment module 10 is configured to obtain a current signal value of each infrared signal line in the current frame, and compare the current signal value of each infrared signal line with its corresponding first signal threshold and second signal threshold, wherein each infrared signal line corresponds to a first signal threshold and a second signal threshold, and the first signal threshold corresponding to the same infrared signal is smaller than the second signal threshold;
[0109] Identification module 20: Signal-connected to judgment module 10, configured to, if there is an infrared signal line whose current signal value is less than a first signal threshold, deem that a touch operation has occurred in the current frame, and perform touch point identification based on the infrared signal line whose current signal value is less than a second signal threshold; if all current signal values are greater than or equal to the first signal threshold, deem that no touch has occurred in the current frame, and no touch point identification is performed.
[0110] In one embodiment, the judgment module 10 can be specifically configured to: obtain the current signal value of each infrared signal line in the current frame, and sequentially compare the current signal value of each infrared signal line with its corresponding first signal threshold and second signal threshold. If the current signal value of the infrared signal line is less than the first signal threshold, the infrared signal line is considered to be an obstruction line, and the touch identifier is increased by 1, and the number of obstruction lines is increased by 1. If the signal value of the infrared signal line is greater than or equal to the first signal threshold and less than the second signal threshold, the infrared signal line is considered to be an obstruction line, the touch identifier remains unchanged, and the number of obstruction lines is increased by 1. If the signal value of the infrared signal line is greater than or equal to the second signal threshold, the infrared signal line is considered to be a non-obstruction line, and the touch identifier and the number of obstruction lines remain unchanged. The touch identifier and the number of obstruction lines are initially set to 0. Accordingly, the recognition module is specifically configured to: if the touch identifier is greater than 0, touch point recognition is performed based on the obstruction line; if the touch identifier is equal to 0, touch point recognition is not performed.
[0111] In another embodiment, the judgment module 10 is configured to: obtain the current signal value of each infrared signal line in the current frame, compare the current signal value of each infrared signal line with the size of its corresponding first signal threshold in turn, and compare the current signal values of all the infrared signal lines with the size of the second signal threshold; the identification module 20 is configured to: when an infrared signal line with a current signal value less than the first signal threshold appears, then perform touch point identification based on the infrared signal line with a current signal value less than the second signal threshold; if all current signal values are greater than or equal to the first signal threshold, it is considered that no touch operation has occurred in the current frame, and touch point identification is not performed.
[0112] In an optional embodiment, the touch recognition device also includes an initialization module, which is signal-connected to the judgment module 10 and is configured so that the first signal threshold and the second signal threshold are determined according to the background value of the corresponding infrared signal line; wherein the background value is the signal value when the infrared signal line is not blocked.
[0113] The initialization module can also be configured to: collect multiple frames of collected signal values when the infrared signal line is not blocked; use the average of multiple collected signal values as the background value of the infrared signal line, or use the smallest collected signal value among the multiple collected signal values as the background value.
[0114] In another embodiment, the initialization module is configured as follows: before obtaining the current signal value of each infrared signal line in the current frame, collect the collected signal values of each infrared signal line when it is not blocked for multiple frames, and determine the background value corresponding to the infrared signal line based on the multiple frames of collected signal values corresponding to the same infrared signal line; determine the corresponding first signal threshold and second signal threshold based on the background value of each infrared signal line.
[0115] In another embodiment, the initialization module is configured as follows: when the background value is less than the first background threshold, the first signal threshold and the second signal threshold are both set to 0; when the background value is greater than or equal to the first background threshold, the first signal threshold and the second signal threshold are determined according to a ratio method with the background value, a fixed difference method with the background value, or a combination of the first two methods.
[0116] Furthermore, the initialization module is configured as follows: when the background value is greater than or equal to the first background threshold and less than the second background threshold, the first signal threshold is the product of the background value and the first proportion, and the second signal threshold is the product of the background value and the second proportion; when the background value is greater than or equal to the second background threshold, the first signal threshold is the difference between the background value and the preset target value, and the second signal threshold is the product of the background value and the third proportion; wherein the first proportion is less than the second proportion, and the second proportion is less than the third proportion.
[0117] Among them, the initialization module can be further configured as: the first background threshold and the second background threshold are determined according to the preset target value; the first background threshold is half of the preset target value; the second background threshold is the preset target value; the preset target value corresponding to each infrared signal line is 1 / 2 to 3 / 4 of its corresponding maximum theoretical signal value.
[0118] It should be noted that various settings in the configuration of each module in the above touch recognition device can refer to the description of the above touch recognition method, and will not be described in detail here.
[0119] The present application also provides an electronic device, which may include an interactive large screen or an electronic whiteboard. Specifically, the electronic device includes a touch screen, which is capable of executing the touch recognition method described in any of the above embodiments, or executing the touch writing method described above. Specifically, the touch screen may include the touch recognition device described in any of the above embodiments.
[0120] In addition, the present application also relates to a computer-readable storage medium, which stores a computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the touch recognition method described in any of the previous embodiments, or execute the touch writing method described in any of the above embodiments.
[0121] It should be noted that the computer-readable storage medium described in the embodiments of the present disclosure is not limited to the embodiments given above, and can also be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the embodiments of the present disclosure, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or device.
[0122] It will be understood by those skilled in the art that, under the premise of no conflict, the above-mentioned optional solutions can be freely combined and superimposed. Among them, the flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or part of the code, and the module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. The numbering of each step in this article is only for the convenience of description and reference, and is not used to limit the order of execution. The specific execution order is determined by the technology itself, and those skilled in the art can determine various allowable and reasonable orders based on the technology itself.
[0123] It should be noted that the use of step numbers (letters or numbers) in this application to refer to certain specific method steps is solely for the purpose of descriptive convenience and brevity, and is in no way intended to limit the order of these method steps. Those skilled in the art will understand that the order of the relevant method steps should be determined by the technology itself and should not be unduly limited by the presence of step numbers. Those skilled in the art can determine various permissible and reasonable step orders based on the technology itself.
[0124] Those skilled in the art will appreciate that, provided there is no conflict, the aforementioned options may be freely combined and superimposed.
[0125] It should be understood that the above-mentioned embodiments are merely illustrative and not restrictive. Without departing from the basic principles of the present application, various obvious or equivalent modifications or substitutions that can be made by those skilled in the art to the above-mentioned details will be included in the scope of the claims of the present application.
Claims
1. A touch recognition method, comprising: Determination step: obtaining the current signal value of each infrared signal line in the current frame, and comparing the current signal value of each infrared signal line with the first signal threshold and the second signal threshold corresponding thereto, wherein each infrared signal line corresponds to the first signal threshold and the second signal threshold, respectively, and the first signal threshold corresponding to the same infrared signal line is smaller than the second signal threshold; Identification steps: If there is an infrared signal line whose current signal value is less than the first signal threshold, it is considered that a touch operation occurs in the current frame, and touch point identification is performed based on the infrared signal line whose current signal value is less than the second signal threshold; if all current signal values are greater than or equal to the first signal threshold, it is considered that no touch operation occurs in the current frame, and touch point identification is not performed.
2. The touch recognition method according to claim 1, wherein: The first signal threshold and the second signal threshold are determined according to the background value of the corresponding infrared signal line; the background value is determined according to the signal value when the infrared signal line is not blocked.
3. The touch recognition method according to claim 2, further comprising an initialization step before obtaining the current signal value of each infrared signal line in the current frame, wherein the initialization step comprises: Collecting the collected signal values of multiple frames when each infrared signal line is not blocked, and determining the background value corresponding to the infrared signal line according to the multiple frames of collected signal values corresponding to the same infrared signal line; The corresponding first signal threshold and second signal threshold are determined according to the background value of each infrared signal line.
4. The touch recognition method according to claim 2, wherein: For the same infrared signal line, the method for determining the corresponding first signal threshold and second signal threshold according to the background value corresponding to the same infrared signal line includes: When the background value is less than a first background threshold, the first signal threshold and the second signal threshold are both set to 0; When the background value is greater than or equal to the first background threshold, the first signal threshold and the second signal threshold are each determined according to a ratio of the first signal threshold to the background value and / or a fixed difference between the first signal threshold and the second signal threshold.
5. The touch recognition method according to claim 4, wherein: When the background value is greater than or equal to the first background threshold and less than the second background threshold, the first signal threshold is the product of the background value and the first ratio, and the second signal threshold is the product of the background value and the first ratio. The product of the background value and the second proportion; When the background value is greater than or equal to the second background threshold, the first signal threshold is the difference between the background value and the preset target value, and the second signal threshold is the product of the background value and the third proportion; Among them, the first proportion is smaller than the second proportion, and the second proportion is smaller than the third proportion.
6. The touch recognition method according to claim 5, wherein: The first background threshold and the second background threshold are determined according to the preset target value; The first background threshold is half of the preset target value; The second background threshold is the preset target value; The preset target value corresponding to each infrared signal line is 1 / 2 to 3 / 4 of its corresponding maximum theoretical signal value.
7. The touch recognition method according to any one of claims 1 to 6, wherein: The judging step comprises: Obtain the current signal value of each infrared signal line in the current frame, and compare the current signal value of each infrared signal line with the corresponding first signal threshold and second signal threshold in turn. The identification step comprises: If the current signal value of the infrared signal line is less than the first signal threshold, the infrared signal line is considered to be a blocking line, and the touch identification is increased by 1, and the number of blocking lines is increased by 1; If the signal value of the infrared signal line is greater than or equal to the first signal threshold and less than the second signal threshold, the infrared signal line is considered to be an occlusion line, the touch identifier remains unchanged, and the number of occlusion lines is increased by 1; If the signal value of the infrared signal line is greater than or equal to the second signal threshold, the infrared signal line is considered to be a non-blocking line, and the number of touch marks and blocking lines remains unchanged; The number of touch marks and occlusion lines is initially set to 0; If the touch flag is greater than 0, touch point identification is performed based on all occlusion lines; If the touch flag is equal to 0, no touch point recognition is performed.
8. The touch recognition method according to any one of claims 1 to 6, wherein: The judging step comprises: Obtain the current signal value of each infrared signal line in the current frame, and compare the current signal value of each infrared signal line with the corresponding first signal threshold value in turn, When an infrared signal line with a current signal value less than the first signal threshold appears, the current signal values of all the infrared signal lines are compared with the second signal threshold, and the first sub-step is executed; If all current signal values are greater than or equal to the first signal threshold, executing the second sub-step; The identification step comprises: The first sub-step: considering that a touch operation occurs in the current frame, and performing touch point recognition according to the infrared signal line whose current signal value is less than the second signal threshold; Second sub-step: consider that no touch operation occurs in the current frame and do not perform touch point recognition.
9. A touch recognition device, comprising: A judgment module: configured to obtain the current signal value of each infrared signal line in the current frame, and compare the current signal value of each infrared signal line with the first signal threshold and the second signal threshold corresponding thereto, wherein each infrared signal line corresponds to the first signal threshold and the second signal threshold, respectively, and the first signal threshold corresponding to the same infrared signal is smaller than the second signal threshold; Identification module: connected to the judgment module signal, and configured to, if there is an infrared signal line whose current signal value is less than the first signal threshold, it is considered that a touch operation has occurred in the current frame, and touch point identification is performed based on the infrared signal line whose current signal value is less than the second signal threshold; if all current signal values are greater than or equal to the first signal threshold, it is considered that no touch operation has occurred in the current frame, and touch point identification is not performed.
10. The touch recognition device according to claim 9, wherein: The judgment module is specifically configured as follows: Obtaining a current signal value of each infrared signal line in a current frame, and sequentially comparing the current signal value of each infrared signal line with its corresponding first signal threshold and second signal threshold; If the current signal value of the infrared signal line is less than the first signal threshold, the infrared signal line is considered to be a blocking line, and the touch identification is increased by 1, and the number of blocking lines is increased by 1; If the signal value of the infrared signal line is greater than or equal to the first signal threshold and less than the second signal threshold, the infrared signal line is considered to be an occlusion line, the touch identifier remains unchanged, and the number of occlusion lines is increased by 1; If the signal value of the infrared signal line is greater than or equal to the second signal threshold, the infrared signal line is considered to be a non-blocking line, and the number of touch marks and blocking lines remains unchanged; The number of touch marks and occlusion lines is initially set to 0; The identification module is specifically configured as follows: If the touch flag is greater than 0, touch point identification is performed based on all occlusion lines; If the touch flag is equal to 0, no touch point recognition is performed.
11. The touch recognition device according to claim 9, wherein: The judgment module is specifically configured as follows: Obtain the current signal value of each infrared signal line in the current frame, and compare the current signal value of each infrared signal line in turn. The current signal value and the corresponding first signal threshold value, and the current signal value of all the infrared signal rays are compared with the second signal threshold value; The identification module is specifically configured as follows: When an infrared signal line whose current signal value is less than the first signal threshold value appears, touch point recognition is performed according to an infrared signal line whose current signal value is less than the second signal threshold value; If all current signal values are greater than or equal to the first signal threshold, it is considered that no touch operation occurs in the current frame, and touch point recognition is not performed.
12. The touch recognition device according to claim 9, further comprising an initialization module; The initialization module is signal-connected to the judgment module, and is configured such that the first signal threshold and the second signal threshold are determined according to the corresponding background value of the infrared signal line; the background value is the signal value when the infrared signal line is not blocked.
13. The touch recognition device according to claim 12, wherein: The initialization module is also configured as: Before obtaining the current signal value of each infrared signal line in the current frame, collect the collected signal values of each infrared signal line in multiple frames when they are not blocked, and determine the background value corresponding to the infrared signal line according to the multiple frames of collected signal values corresponding to the same infrared signal line; The corresponding first signal threshold and second signal threshold are determined according to the background value of each infrared signal line.
14. The touch recognition device according to claim 12, wherein: The initialization module is also configured as: When the background value is less than a first background threshold, the first signal threshold and the second signal threshold are both set to 0; When the background value is greater than or equal to the first background threshold, the first signal threshold and the second signal threshold are each determined according to a ratio of the first signal threshold to the background value and / or a fixed difference between the first signal threshold and the second signal threshold.
15. The touch recognition device according to claim 12, wherein: The initialization module is also configured as: When the background value is greater than or equal to the first background threshold and less than the second background threshold, the first signal threshold is the product of the background value and the first proportion, and the second signal threshold is the product of the background value and the second proportion; When the background value is greater than or equal to the second background threshold, the first signal threshold is the difference between the background value and the preset target value, and the second signal threshold is the product of the background value and the third proportion; Among them, the first proportion is smaller than the second proportion, and the second proportion is smaller than the third proportion.
16. The touch recognition device according to claim 12, wherein: The initialization module is also configured as: The first background threshold and the second background threshold are determined according to the preset target value; The first background threshold is half of the preset target value; the second background threshold is the preset target value; The preset target value corresponding to each infrared signal line is 1 / 2 to 3 / 4 of its corresponding maximum theoretical signal value.
17. An electronic device, comprising a touch screen, characterized in that: The touch screen can execute the touch recognition method described in any one of claims 1-8.
18. A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the touch recognition method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Scanning method and device for infrared touch screen
CN106020566A
Touch recognition method, device and equipment and interactive smart tablet
CN114967983A
Touch handwriting generation method and device, electronic equipment and storage medium
CN115793893A
Control method of optical touch screen, optical touch screen and storage medium
CN116243816A
Touch identification method and device and electronic equipment
CN117032497A