Touch area recognition method, system and electronic device for infrared touch screen
By determining the intersection and focus on the infrared touch screen and selecting the common focus and other focus in its adjacent areas, the touch area of larger contacts and smaller contacts is achieved at one time during multi-touch control. The problems of low computing efficiency and omissions in the prior art are improved, and the identification accuracy and user experience are improved.
Patent Information
- Application Number
- CN202111451053.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-01
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2041-12-01
AI Technical Summary
When existing infrared touch screens are multi-touch, smaller contacts are difficult to accurately extract, resulting in low computing efficiency and easy to miss. The existing methods require repeated calculations to adjust the threshold threshold.
By obtaining the scanning data of the infrared touch screen, determine the intersection and focus of each occlusion line, and select the common focus and other focus in its adjacent areas to extract the touch areas of larger and smaller contacts at one time. , avoid repeated calculations.
It improves the computing efficiency of touch area recognition, reduces the probability of missing smaller contacts, and improves the user experience and accuracy of infrared touch operation.
Smart Images

Figure CN114356130B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of touch control technology, and in particular to a touch area recognition method, system, electronic device and computer-readable storage medium for an infrared touch screen. Background Art
[0002] An infrared touch screen usually includes a number of infrared emitting units and a number of infrared receiving units and their driving circuits installed on the frames around the touch screen. Under the action of the driving circuit, each infrared emitting unit emits infrared rays in the direction of a plurality of pre-set infrared optical paths, and each infrared receiving unit receives the corresponding infrared rays, thereby forming an infrared optical network on the screen surface of the touch screen. When a touch-operated object (such as a finger) touches the screen surface, some infrared rays in the infrared optical network will be blocked, and the blocked infrared rays are the blocking lines. The infrared light signal parameters (such as luminous flux) received by the infrared receiving unit corresponding to the touch area will change. This change is converted into an electrical signal and compared with the electrical signal when there is no touch, so that the position of the touch area can be calculated, thereby realizing the touch screen operation.
[0003] The calculation of the touch point of the infrared touch screen has gone through a development process from one-touch to two-touch, and then to more-touch. Among them, multi-touch can make the form of touch screen operation more diverse, so that multiple users can enjoy the interactive experience together. Most of the existing touch area recognition methods of multi-touch select the area where several occlusion lines intersect as the touch area. In fact, due to the existence of multiple infrared light path directions, when there are multiple touch points, some of the areas where the occlusion lines intersect are not real touch areas. Therefore, it is necessary to set a threshold value to extract the intersection area of more than a certain number of occlusion lines as the touch area. In this way, larger touch points can be extracted, while smaller touch points (such as thin pens) cannot be extracted at the same time as larger touch points due to the small number of crossed occlusion lines. Therefore, it is necessary to determine whether all occlusion lines pass through the larger touch points after extracting the larger touch points. If there are still some occlusion lines that do not pass through the larger touch points, the threshold value is readjusted to extract the smaller touch points. This step (or called occlusion line back-calculation) is likely to require multiple repeated calculations, resulting in low calculation efficiency of touch point recognition. Summary of the invention
[0004] Based on the above situation, the main purpose of the present invention is to provide a touch area recognition method, system, electronic device and computer-readable storage medium for an infrared touch screen, which can extract the touch areas of larger touch points and smaller touch points at the same time during multi-touch, improve the computational efficiency of touch area recognition, and reduce the omission of smaller touch points.
[0005] To achieve the above purpose, the technical solution adopted by the present invention is as follows:
[0006] According to a first aspect of the present invention, a touch area recognition method for an infrared touch screen comprises the following steps:
[0007] Acquire all the blocking lines according to the scanning data of the infrared touch screen;
[0008] Select an occlusion line that has not been selected as the first occlusion line, determine all intersection points of the first occlusion line, the intersection points are points where the first occlusion line intersects with other occlusion lines, and determine the focus of the first occlusion line, the focus is the intersection point involving the largest number of occlusion lines among all the intersection points, and repeat the above operation until the focus of all the occlusion lines is obtained;
[0009] The focus with the largest number of occlusion lines belonging to the same time is selected as the common focus, other focuses are obtained in the adjacent area of the common focus, and the touch area is determined according to the other focuses and the common focus, and the above operation is repeated for the focuses of the remaining undetermined touch areas until all the touch areas are obtained.
[0010] Furthermore, the determining of all intersection points of the first occlusion lines comprises the following steps:
[0011] Convert all the blocking lines into a number of pixel points in the image corresponding to the infrared touch screen;
[0012] Select a pixel point that has not been selected from several pixel points of the first occlusion line as the first pixel point. If the first pixel point coincides with any pixel point of other occlusion lines, take the first pixel point as the intersection point of the first occlusion line. Repeat the above operation until all pixel points are judged.
[0013] Furthermore, the method of using the first pixel point as the intersection point of the first occlusion line further includes the following steps:
[0014] Setting the number of times the first pixel point overlaps with any pixel point of the other occlusion lines as a first mark value of the first pixel point;
[0015] Determining the focus of the first occlusion line comprises the following steps:
[0016] The pixel point with the maximum value of the first mark value is set as the focus of the first occlusion line.
[0017] Furthermore, the step of selecting the focus having the largest number of foci belonging to the occlusion lines at the same time as the common focus comprises the following steps:
[0018] Converting the focal points of all the blocking lines into a number of pixel points in the image corresponding to the infrared touch screen;
[0019] Selecting a pixel point that has not been selected from the plurality of pixel points as a second pixel point, setting the number of times the second pixel point is determined as a focus as a second label value of the second pixel point, and repeating the above operation until the second label values of all the pixel points are obtained;
[0020] The pixel point with the second mark value as the maximum value is set as the common focus.
[0021] Furthermore, obtaining other focal points in the vicinity of the common focal point comprises the following steps:
[0022] Converting the focal points of all the blocking lines into a number of pixel points in the image corresponding to the infrared touch screen;
[0023] The common focus is taken as the target and its neighboring pixel points are judged whether they are the focus, if so, the neighboring pixel points are incorporated into the target and the judgment is continued until all the neighboring pixel points of the target are not the focus;
[0024] The neighborhood pixel points are pixel points that are directly adjacent to the target, or pixel points that have no more than a preset number of pixel point vacancies between them and the target.
[0025] Furthermore, after determining the touch area according to the other focus and the common focus, the method further includes the following steps:
[0026] The contact point position of the touch area is calculated according to the positions of all focal points in the touch area.
[0027] Furthermore, the step of calculating the contact point position of the touch area according to the positions of all focal points in the touch area comprises the following steps:
[0028] Obtaining position information of pixel points corresponding to all focal points in the touch area according to the image corresponding to the infrared touch screen; the position information of each pixel point includes a horizontal position value and a vertical position value;
[0029] The average of the first horizontal position value of the pixel with the largest horizontal position value and the second horizontal position value of the pixel with the smallest horizontal position value is used as the horizontal position value of the touch point, and the average of the first vertical position value of the pixel with the largest vertical position value and the second vertical position value of the pixel with the smallest vertical position is used as the vertical position value of the touch point; or
[0030] The average value of the horizontal position values of all the pixels is used as the horizontal position value of the touch point position, and the average value of the vertical position values of all the pixels is used as the vertical position value of the touch point position.
[0031] According to a second aspect of the present invention, a touch area recognition system for an infrared touch screen comprises:
[0032] An acquisition unit, used for acquiring all the blocking lines according to the scanning data of the infrared touch screen;
[0033] A first processing unit is used to select an occlusion line that has not been selected as a first occlusion line, and to determine all intersection points of the first occlusion line, where the intersection point is a point where the first occlusion line intersects with other occlusion lines, and to determine a focus of the first occlusion line, where the focus is an intersection point involving the largest number of occlusion lines among all the intersection points, and to repeat the above operation until the focus of all the occlusion lines is obtained;
[0034] The second processing unit is used to select the focus with the largest number of focuses belonging to the occlusion lines at the same time as the common focus, and to obtain other focuses in the adjacent area of the common focus, and to determine the touch area based on the other focuses and the common focus, and to repeat the above operation for the focuses of the remaining undetermined touch areas until all the touch areas are obtained.
[0035] Furthermore, the first processing unit includes:
[0036] A first image module, used for converting all the blocking lines into a number of pixel points in the image corresponding to the infrared touch screen;
[0037] The first judgment module is used to select a pixel point that has not been selected from a number of pixel points of the first occlusion line as the first pixel point. If the first pixel point coincides with any pixel point of other occlusion lines, the first pixel point is used as the intersection point of the first occlusion line, and the above operation is repeated until the judgment of all pixel points is completed.
[0038] Furthermore, the first processing unit further includes:
[0039] A first calculation module, used for setting the number of times the first pixel point overlaps with any pixel point of the other occlusion lines as a first mark value of the first pixel point;
[0040] The second processing unit comprises:
[0041] The second calculation module is used to set the pixel point with the maximum value of the first mark value as the focus of the first occlusion line.
[0042] Furthermore, the second processing unit further includes:
[0043] A second image module, used for converting the focal points of all the blocking lines into a number of pixel points in the image corresponding to the infrared touch screen;
[0044] a second determination module, configured to select a pixel point that has not been selected from the plurality of pixel points as a second pixel point, set the number of times the second pixel point is determined as a focus as a second mark value of the second pixel point, and repeat the above operation until the second mark values of all the pixel points are obtained;
[0045] The third calculation module is used to set the pixel point with the second mark value as the maximum value as the common focus.
[0046] Furthermore, the second processing unit further includes:
[0047] A third judgment module is used to take the common focus as a target and judge whether its neighboring pixel points are the focus. If so, the neighboring pixel points are incorporated into the target and continue to judge until all the neighboring pixel points of the target are not the focus;
[0048] The neighborhood pixel points are pixel points that are directly adjacent to the target, or pixel points that have no more than a preset number of pixel point vacancies between them and the target.
[0049] Furthermore, the second processing unit further includes:
[0050] The fourth calculation module is used to calculate the touch point position of the touch area according to the positions of all the focal points in the touch area.
[0051] Furthermore, the fourth calculation module further includes:
[0052] The first component is used to obtain the position information of the pixel points corresponding to all the focal points in the touch area according to the image corresponding to the infrared touch screen; the position information of each pixel point includes a horizontal position value and a vertical position value;
[0053] a second component, for taking the average of the first horizontal position value of the pixel with the largest horizontal position value and the second horizontal position value of the pixel with the smallest horizontal position value as the horizontal position value of the touch point, and for taking the average of the first vertical position value of the pixel with the largest vertical position value and the second vertical position value of the pixel with the smallest vertical position as the vertical position value of the touch point; or
[0054] The average value of the horizontal position values of all the pixels is used as the horizontal position value of the touch point, and the average value of the vertical position values of all the pixels is used as the vertical position value of the touch point.
[0055] According to a third aspect of the present invention, an electronic device with an infrared touch screen includes a processor, a memory, and a computer program stored in the memory and running on the processor. When the computer program is executed by the processor, the touch area recognition method of the infrared touch screen as described in the first aspect above is implemented.
[0056] According to a fourth aspect of the present invention, a computer-readable storage medium stores a computer program, wherein the computer program is used to run to implement the touch area recognition method for the infrared touch screen as described in the first aspect.
[0057] The touch area recognition method of the infrared touch screen of the present invention obtains all the shielding lines according to the infrared scanning data of the infrared touch screen, and obtains the intersection point and focus of each shielding line respectively, and obtains the corresponding touch area by selecting the common focus and other focuses in the adjacent area of the common focus. Especially in the case of multi-point touch on the infrared touch screen, all the touch areas, that is, the touch areas of larger touch points and the touch areas of smaller touch points, can be obtained by sequentially confirming the common focus and other focuses in the adjacent area, without the need to first calculate the touch area of the larger touch point and then try to obtain the touch areas of other smaller touch points through the step of reverse calculation of the shielding lines. This can avoid repeated calculations, effectively improve the calculation efficiency of touch area recognition, and avoid missing smaller touch points as much as possible, reduce the problems of pen loss and inability to recognize of fine pens, help improve the accuracy of touch point recognition, and improve the user experience of infrared touch operation.
[0058] The touch area recognition system of the infrared touch screen of the present invention adopts the above-mentioned touch area recognition method of the infrared touch screen, which can effectively and quickly identify the touch area, especially in the case of multi-point touch, and can accurately obtain the touch areas of larger touch points and smaller touch points, avoiding the problem of multiple calculations required in the prior art due to the limitation of preset threshold settings.
[0059] The electronic device with an infrared touch screen and the computer-readable storage medium of the present invention both adopt the above-mentioned touch area recognition method of the infrared touch screen, which can effectively improve the calculation efficiency and accuracy of touch area recognition, thereby improving the user experience of infrared touch operation.
[0060] Other beneficial effects of the present invention will be explained in the specific implementation manner through the introduction of specific technical features and technical solutions. 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
[0061] The preferred implementation of the touch area recognition method of the infrared touch screen according to the present invention will be described below with reference to the accompanying drawings.
[0062] Figure 1 A schematic flow chart of a preferred implementation of a touch area recognition method for an infrared touch screen of the present invention;
[0063] Figure 2 A schematic diagram of the positions of the shielding line and two touch areas according to a preferred embodiment of the present invention;
[0064] Figure 3 A schematic diagram of pixel distribution in a touch area according to a preferred embodiment of the present invention;
[0065] Figure 4 Schematic diagram of the present invention taking a common focus as a target and judging whether its neighboring pixel point is a focus, wherein: Figure 4 a is a schematic diagram showing that the pixel point directly adjacent to the target is the focus; Figure 4 b is a schematic diagram showing that no more than a preset number of pixels are allowed to be the focus between the target and the target;
[0066] Figure 5 A schematic diagram of focus distribution of a preferred embodiment of the present invention;
[0067] Figure 6 The figure is a schematic diagram of a rectangular boundary of a touch area according to a preferred embodiment of the present invention.
[0068] Explanation of reference numerals: 1 infrared touch screen, 2 shielding line, 3 larger contact point, 4 smaller contact point. DETAILED DESCRIPTION
[0069] See also Figure 1 The present invention provides a touch area recognition method for an infrared touch screen, the method comprising the following steps:
[0070] S100, acquiring all blocking lines according to the scanning data of the infrared touch screen.
[0071] Among them, the infrared touch screen usually includes a number of infrared emitting units and a number of infrared receiving units and their driving circuits installed on the frames around the touch screen. Under the action of the driving circuit, each infrared emitting unit emits infrared rays in the direction of multiple pre-set infrared light paths, and each infrared receiving unit receives its corresponding infrared rays, thereby forming an infrared light network on the screen surface of the touch screen, and continuously scanning whether the infrared rays are blocked by objects to detect and locate the touch of the object. When the touch-operated object (such as a finger) touches the screen surface, some infrared rays in the infrared light network will be blocked. The blocked infrared rays are the blocking lines, and the infrared light signal parameters (such as luminous flux) received by the infrared receiving unit corresponding to the touch area will change. This change is converted into an electrical signal and compared with the electrical signal when there is no touch, so that the specific position and direction of each blocking line on the infrared touch screen can be calculated. See Figure 2 When the infrared touch screen 1 senses a larger touch point 3 and a smaller touch point 4, several shielding lines 2 pass through the larger touch point 3 and the smaller touch point 4 respectively.
[0072] S200, select an occlusion line that has not been selected as the first occlusion line, determine all the intersection points of the first occlusion line, the intersection points are the points where the first occlusion line intersects with other occlusion lines, and determine the focus of the first occlusion line, the focus is the intersection point involving the largest number of occlusion lines among all the intersection points, and repeat the above operation until the focus of all occlusion lines is obtained.
[0073] Among them, each occlusion line intersects with one or more other occlusion lines. When determining the intersection point and focus of each occlusion line, different occlusion lines are selected from all the occlusion lines in turn as the first occlusion line, and all the intersection points of the first occlusion line are determined. Then, from all the intersection points of the first occlusion line, the intersection point involving the largest number of intersecting occlusion lines is selected as the focus of the first occlusion line.
[0074] For example, all the occlusion lines, N in total, are obtained from step S100. When the occlusion lines are selected for the first time, none of the N occlusion lines have been selected before. Then, any one of the N occlusion lines is selected as the first occlusion line, and the intersection and focus of the first occlusion line are determined. When the occlusion lines are selected for the second time, any one of the remaining (N-1) occlusion lines is selected as the first occlusion line, and the intersection and focus of the first occlusion line are determined. According to the above method, any one of the occlusion lines (N-2), (N-3), ..., 1 occlusion lines is selected as the first occlusion line in turn, and the intersection and focus are determined, thereby obtaining the intersection and focus of each of the N occlusion lines.
[0075] It should be noted that, in some cases, if there are two or more intersections involving the largest number of occluding lines, one of the intersections can be selected as the focus by setting a judgment condition. For example, all the intersections of the first occlusion line are obtained by step S200, and first any one of the intersections is selected as the temporary focus, and the number of occlusion lines involved in the intersection is taken as the reference value; then any one of the remaining (D-1) intersections is selected, and the number of occlusion lines involved in the intersection is compared with the reference value, and the judgment condition is set as: when the number of occlusion lines involved in the intersection is greater than the reference value, the intersection is used as the temporary focus, and the reference value is updated to the number of occlusion lines involved in the intersection; according to the above method, until the comparison of all intersections is completed, the intersection corresponding to the temporary focus is finally determined as the focus of the first occlusion line, thus, only when the number of occlusion lines involved in the newly selected intersection is greater than the reference value, the temporary focus will be updated to the newly selected focus, if the values are equal, the temporary focus remains unchanged; or, the judgment condition is set as: when the intersection is greater than or equal to the reference value, thus, when the number of occlusion lines involved in the newly selected intersection is equal to the reference value, the temporary focus is updated to the newly selected intersection.
[0076] S300, select the focus with the largest number of occlusion lines as the common focus, obtain other focuses in the adjacent area of the common focus, and determine the touch area based on the other focuses and the common focus, and repeat the above operation for the focuses of the remaining undetermined touch areas until all touch areas are obtained.
[0077] The focus that has the largest number of occlusion lines simultaneously belongs to is the focus that has the largest number of occlusion lines passing through it.
[0078] The neighboring area of the common focus refers to an area of a certain size selected from the center of the common focus on the infrared touch screen. The size of this area is usually much smaller than the screen size of the infrared touch screen. The neighboring area is used as a search range to quickly obtain other focuses that are close to the common focus within this search range.
[0079] The touch area can be determined by connecting the other focal points and the common focal points in pairs to obtain a connected graph, and using the boundary of the connected graph as the boundary of the touch area, or by taking the other focal points and the common focal points as a set, setting a rectangle with horizontal and vertical sides to represent the boundary of the touch area, the horizontal side of the rectangle being the maximum horizontal spacing between the focal points in the set, and the vertical side of the rectangle being the maximum vertical spacing between the focal points in the set. The touch area is an area formed by the other focal points and the common focal points on the infrared touch screen that better reflects the actual touch position.
[0080] The remaining undetermined focus of the touch area refers to the focus of the touch area to which it belongs that has not been determined. If the focus of the touch area to which it belongs has been determined, this step is no longer performed.
[0081] For example, a total of P focuses are obtained by step S200. When the common focus is selected for the first time, the touch area has not been determined for the P focuses. Then, the focus with the largest number of occlusion lines belonging to the P focuses is selected as the common focus, and a total of Q other focuses (Q < P) are obtained in the adjacent area of the common focus. A touch area is determined based on the common focus and the Q other focuses. When the common focus is selected for the second time, it is selected from the remaining (PQ) focuses, and the touch area has not been determined for these (PQ) focuses. The focus with the largest number of occlusion lines belonging to the occlusion lines is selected as the common focus, and the next touch area is determined in the above manner until all touch areas are obtained.
[0082] Through the above steps, the intersection point where each occlusion line intersects the most with other occlusion lines is taken as the focus of each occlusion line. After obtaining the focuses of all occlusion lines, the focus involving the most occlusion lines is selected as the common focus, and the corresponding touch area is determined based on the common focus and other foci that are closer to it. In particular, multiple foci can be divided based on the positional relationship to identify the touch areas of larger contacts and smaller contacts. After obtaining the touch area of the larger contact, there is no need to perform the calculation process of back-calculating the occlusion lines and adjusting the threshold value for the touch area of the smaller contact, which significantly improves the calculation efficiency of touch area recognition and improves the accuracy of touch area recognition, which helps to improve the user experience during infrared touch operation.
[0083] As an optional embodiment, in step S200, determining all intersection points of the first occlusion lines includes the following steps:
[0084] S210: convert all the blocking lines into a number of pixel points in the image corresponding to the infrared touch screen.
[0085] Among them, the image corresponding to the infrared touch screen refers to the screen surface of the infrared touch screen directly forming a rectangular image according to the horizontal and vertical lengths of the actual screen, or scaling the horizontal and vertical lengths of the actual screen to form a rectangular image, and the rectangular image is composed of a number of pixels arranged in a matrix manner, which is usually referred to as the display resolution of the infrared touch screen. According to the scanning data of the infrared touch screen, when some infrared rays in the infrared light network are blocked, the infrared light signal received by the infrared receiving unit corresponding to the touch area on the infrared touch screen changes, thereby calculating the specific position of the blocking line on the infrared touch screen, and according to the above relationship between the infrared touch screen and the image, the corresponding number of pixels of the blocking line on the infrared touch screen can be converted accordingly.
[0086] S220, select one of the pixel points of the first occlusion line that has not been selected as the first pixel point. If the first pixel point coincides with any pixel point of other occlusion lines, take the first pixel point as the intersection point of the first occlusion line. Repeat the above operation until all the pixel points are judged.
[0087] It should be noted that the other occlusion lines refer to all occlusion lines except the first occlusion line. For example, the pixel points of N occlusion lines are obtained respectively in step S210, which can be specifically represented as L1, L2, ..., L N , L N A set of several pixels representing each occlusion line. The occlusion line corresponding to the set L1 is taken as the first occlusion line. L1 contains M pixels. When the pixels are selected for the first time, none of the M pixels have been selected before. Then any pixel is selected from the M pixels as the first pixel, and the first pixel is compared with the sets L2, ..., L N All the pixels in the set are compared in turn. If there are identical pixels, the first pixel is taken as an intersection of the first occlusion line. When selecting pixels for the second time, any pixel is selected from the remaining (M-1) pixels as the first pixel, and the first pixel is compared with the set L2, ..., L N All the pixels in the first occlusion line are compared in turn. If there are identical pixels, the first pixel is used as another intersection point of the first occlusion line. According to the above method, any pixel is selected from (M-2), (M-3), ..., 1 pixel as the first pixel, and it is determined whether it is an intersection point. Thus, the determination of all the pixels of the first occlusion line is completed, and all the intersection points of the first occlusion line are obtained.
[0088] Through the above steps, the screen of the infrared touch screen is converted into a corresponding image, and based on the pixelation processing of the image, the occlusion line can be described by a number of pixel points, and the several pixel points are judged in turn to determine all the intersections of each occlusion line.
[0089] As an alternative embodiment to the above embodiment, the coordinate data of the occluding lines on the screen are calculated according to the change of the infrared light signal of the infrared touch screen, so that the intersection point of each occluding line can be obtained by calculating the coordinate data and can be used for subsequent focus determination.
[0090] As an optional embodiment, in step S220, taking the first pixel point as the intersection point of the first occlusion line further includes the following steps:
[0091] S230: Set the number of times the first pixel point overlaps with any pixel point of other occlusion lines as a first mark value of the first pixel point.
[0092] See also Figure 3 In order to more intuitively display the different numerical values of the first mark values of different pixels, the first mark value is represented by the depth of color. The darker the color, the larger the first mark value of the pixel. The figure does not show all the pixels of each occlusion line, but only shows multiple pixels with higher first mark values related to the touch area.
[0093] In step S200, determining the focus of the first occlusion line includes the following steps:
[0094] S240: Set the pixel point with the maximum value of the first mark value as the focus of the first occlusion line.
[0095] In some cases, if there are two or more pixels with the maximum first mark value, one of the pixels can be selected as the focus by setting the judgment condition. For example, according to step S220, a total of X pixels as intersection points of the first occlusion line are obtained, and according to step S230, the first mark values of these X pixels are obtained respectively, which can be expressed as T1, T2, ..., T X , corresponding to these X pixels, first take the pixel corresponding to T1 as the temporary focus, and take T1 as the reference value C, then compare T2 with C, and set the judgment condition as: if T i >C (where i is a positive integer and 2≤i≤X) then C=T i The temporary focus is updated to the pixel point corresponding to Ti, and the above method is used to complete the focus on T3, T4, ..., T X The final C is used as the maximum mark value, and the temporary focus is determined as the focus of the first occlusion line.
[0096] Through the above steps, the pixel point on each occlusion line that intersects the most with other occlusion lines can be obtained, and the pixel point is used as the focus of the occlusion line. In this way, the pixel points related to the touch area can be identified, and the pixel points in the touch area of the smaller touch point will not be missed, thereby ensuring the accuracy of touch area identification.
[0097] As an optional embodiment, in step S300, selecting the focus with the largest number of simultaneously belonging to the occlusion lines as the common focus includes the following steps:
[0098] S310: converting the focal points of all the blocking lines into a number of pixel points in the image corresponding to the infrared touch screen.
[0099] The specific method of converting the focus into the pixel point in the image corresponding to the infrared touch screen can be referred to step S210.
[0100] S320, select a pixel point that has not been selected from a number of pixel points as the second pixel point, set the number of times the second pixel point is judged as the focus as the second mark value of the second pixel point, and repeat the above operation until the second mark values of all pixel points are obtained.
[0101] Among them, the second mark value is used as a judgment basis for determining the common focus. For example, a total of N focuses of N occlusion lines are obtained by step S310, and the N focuses are converted into P pixels in the image corresponding to the infrared touch screen. Generally speaking, N is less than P, that is, multiple focuses will correspond to one pixel; when the pixel is selected for the first time, the P pixels have not been selected, then any one pixel is selected from the P pixels as the second pixel, and the second pixel is corresponded to the N focuses, and the number of times the second pixel and the N focuses can correspond is set as the second mark value of the second pixel; when the pixel is selected for the second time, any one pixel is selected from the remaining (P-1) pixels as the second pixel, and the second mark value of the second pixel is obtained according to the above method. According to the above method, continue to select any one pixel from (P-2), (P-3), ..., 1 pixel as the second pixel, and obtain the corresponding second mark value, thereby obtaining the second mark value of all the pixels.
[0102] S330: Set the pixel point with the maximum second mark value as the common focus.
[0103] In some cases, if there are two or more pixels whose second mark value is the maximum value, one of the pixels can be selected as the common focus by setting a judgment condition. The specific method can be referred to step S240.
[0104] Through the above steps, the focus is converted into a pixel point in the image corresponding to the infrared touch screen, and the second mark value of each pixel point is determined according to the correspondence between the focus and the pixel point, thereby determining the pixel point closest to the touch area in positional relationship, and using it as a common focus for subsequent determination of other focal points and touch areas in the adjacent area. Such a calculation method is simple, efficient, and easy to implement, and can effectively improve the calculation efficiency of touch area recognition.
[0105] As an optional embodiment, in step S300, obtaining other focal points in the vicinity of the common focal point includes the following steps:
[0106] S340: converting the focal points of all the blocking lines into a number of pixel points in the image corresponding to the infrared touch screen.
[0107] The specific method of converting the focus into a pixel point in the image corresponding to the infrared touch screen may refer to step S210.
[0108] S350, taking the common focus as the target and determining whether its neighboring pixel points are the focus, if so, merging the neighboring pixel points into the target and continuing to determine until all the neighboring pixel points of the target are not the focus.
[0109] The neighborhood pixel points are pixel points that are directly adjacent to the target, or pixel points that have no more than a preset number of pixel point vacancies between them and the target.
[0110] For example, see Figure 4 , Figure 4 a and Figure 4 b consists of 5x5 pixels.
[0111] Specifically, see Figure 4 a, step S310 converts the focus of the occlusion line into the pixels R23, R32, R33, R34 and R44 in the figure (the pixels with gray marks in the figure), and steps S320 and S330 obtain that the pixel R33 is the common focus; according to the way that the neighborhood pixels are the pixels directly adjacent to the target, the pixels directly adjacent to the pixel R33 are the four pixels directly adjacent to it above, below, left and right, namely R23, R32, R34 and R43. First, take the pixel R33 as the target and perform pixel R23, R32, R34 and R43 on the pixels R33, R32, R34 and R43. The judgment result is that the pixels R23, R32, and R34 are the focus, and R43 is not the focus; the pixels R23, R32, and R34 are incorporated into the target and continue to be judged, and the judgment range is expanded to the pixels R13, R22, R24, R31, R35, R42, and R44, and the judgment result is that the pixel R44 is the focus, and the other pixels are not the focus; according to the above method, the pixel R44 is incorporated into the target and the neighboring pixels of the target are continued to be judged, and the judgment result is that the neighboring pixels of the target are not the focus, and this step ends. Thus, the other focal points in the neighboring area of the pixel R33 as the common focus are R23, R32, R34, and R44.
[0112] Specifically, see Figure 4b. Step S310 converts the focus of the occlusion line into the pixels R23, R32, R33, R34 and R53 in the figure (pixels with gray marks in the figure), and steps S320 and S330 obtain pixel R33 as the common focus; according to the method that the neighborhood pixel points are the pixel points with no more than a preset number of pixel gaps between them and the target, the preset number is set to 1 here, and the neighborhood pixel points of pixel R33 include R13, R23, R24, R31, R32, R34, R35, R43, and R53. These neighborhood pixel points are judged, and the judgment result is that the pixels R23, R32, R34, and R53 are the focus; the subsequent repeated steps are not repeated. Thus, the other focal points in the neighborhood area of the pixel R33 as the common focus are R23, R32, R34, and R53.
[0113] Through the above steps, other focal points are determined within a reasonable range near the common focal point, and all focal points belonging to the same touch area can be aggregated to determine the corresponding touch area. In particular, no more than a certain number of pixel gaps are allowed between the target and the neighboring pixel points, which can reduce the situation where the focal points that should belong to the same touch area are processed in different touch areas due to pixel calculation errors generated during image processing. At the same time, different touch areas with close distances can be isolated to avoid absorbing smaller touch points during the calculation process of larger touch points, effectively reducing the probability of problems such as fine pen loss or even failure to recognize. See Figure 5 ,The figure shows the focus distribution of the touch areas of larger and smaller touch points, and the pixels with color are the focus.
[0114] As an optional embodiment, in the step S300, after determining the touch area according to other focuses and the common focus, the following steps are further included:
[0115] S360: Calculate the contact point position of the touch area according to the positions of all focal points in the touch area.
[0116] Through the above steps, the contact point positions of the touch area can be used for various touch system applications of the infrared touch screen, especially in multi-point touch, the contact point positions of multiple touch areas obtained can facilitate subsequent calculation steps and processes.
[0117] Specifically, the area attribute of each focus can be identified to distinguish the touch area to which the focus belongs, so that all the obtained focuses can be easily distinguished and subsequently calculated. For example, see Figure 4a. From step S310 to step S350, it is obtained that other focal points in the vicinity of the pixel point R33 as the common focal point are R23, R32, R34, and R44. Thus, a touch area is determined according to the pixels R33, R23, R32, R34, and R44, and the regional attributes of the focal points corresponding to the pixels R33, R23, R32, R34, and R44 are marked. The marking method may be to assign a value to the regional attribute, such as 001. After the next touch area is obtained, the regional attributes of all focal points in the touch area may be assigned a value, such as 002, to distinguish them from the focal points with the regional attribute of 001.
[0118] Therefore, by marking the regional attributes of all the focuses within the touch area, on the one hand, it is possible to easily distinguish between the focuses that have been confirmed to belong to a certain touch area and the focuses that do not belong to any touch area. The focuses that have been processed and confirmed to belong to a certain touch area are no longer used as public focuses, thereby reducing the amount of calculation and significantly improving the calculation efficiency. On the other hand, it is also possible to distinguish the focuses belonging to different touch areas, which can facilitate the subsequent calculation of the contact point position.
[0119] As an optional embodiment, the step of calculating the contact point position of the touch area according to the positions of all focal points in the touch area includes step S400:
[0120] S410, obtaining the position information of the pixels corresponding to all the focal points in the touch area according to the image corresponding to the infrared touch screen; the position information of each pixel includes a horizontal position value and a vertical position value. The image corresponding to the infrared touch screen can refer to the description of step S210.
[0121] S420, taking the average of the first horizontal position value of the pixel with the largest horizontal position value and the second horizontal position value of the pixel with the smallest horizontal position value as the horizontal position value of the touch point, and taking the average of the first vertical position value of the pixel with the largest vertical position value and the second vertical position value of the pixel with the smallest vertical position as the vertical position value of the touch point; or
[0122] The average value of the horizontal position values of all the pixels is used as the horizontal position value of the touch point position, and the average value of the vertical position values of all the pixels is used as the vertical position value of the touch point position.
[0123] See also Figure 6, the boundary of each touch area in the figure is represented by a rectangle, and the touch point position of each touch area includes a horizontal position value and a vertical position value. The calculation of the horizontal position value of the touch point position can be the average of the horizontal position values of the two pixels with the largest horizontal spacing in the touch area. Similarly, the calculation of the vertical position value of the touch point position can be the average of the vertical position values of the two pixels with the largest vertical spacing in the touch area, which is the first method in the above step S420. This method is simpler to implement, and within a certain error tolerance range, it can significantly improve the efficiency of the touch point position calculation and effectively reduce the hardware configuration requirements.
[0124] Considering that the focus distribution in the touch area is not uniform, the touch point position may be determined according to the average value of the position information of all pixels in the touch area, that is, the second method in the above step S420.
[0125] In addition, the position information of each pixel point can be weighted according to the first mark value and / or the second mark value of the pixel point to obtain a weighted average value, or the weighted average value of the horizontal position value of the pixel point with the largest horizontal position value and the horizontal position values of the remaining other pixels can be used as the horizontal position value of the touch point position, and the weighted average value of the vertical position value of the pixel point with the largest vertical position value and the vertical position values of the remaining other pixels can be used as the vertical position value of the touch point position, for example, the horizontal position value of the pixel point with the largest horizontal position value is configured with a weight of P, and the horizontal position values of the remaining other pixels are configured with a weight of Q, and P> Q. The touch point position obtained in this way can be closer to the center position of the actual touch area, and is suitable for infrared touch applications that require higher calculation accuracy.
[0126] The present invention also provides a touch area recognition system for an infrared touch screen, the system comprising an acquisition unit, a first processing unit and a second processing unit.
[0127] The acquisition unit is used to acquire all the shielding lines according to the scanning data of the infrared touch screen.
[0128] The first processing unit is used to select an occlusion line that has not been selected as the first occlusion line, and to determine all intersection points of the first occlusion line, where the intersection points are points where the first occlusion line intersects with other occlusion lines, and to determine the focus of the first occlusion line, where the focus is the intersection point involving the largest number of occlusion lines among all the intersection points, and to repeat the above operations until the focus of all the occlusion lines is obtained.
[0129] The second processing unit is used to select the focus with the largest number of simultaneously belonging to the occlusion line as the common focus, and to obtain other focuses in the adjacent area of the common focus, and to determine the touch area according to the other focuses and the common focus, and to repeat the above operation for the focus of the remaining undetermined touch area until all the touch areas are obtained. Therefore, the touch area recognition system adopts the touch area recognition method of the infrared touch screen, which can quickly and accurately identify the touch areas of larger touch points and smaller touch points, avoiding the process of multiple calculations required in the prior art due to the problem of setting a preset threshold, thereby improving the calculation efficiency and accuracy of touch area recognition.
[0130] As an optional embodiment, the first processing unit includes a first image module and a first judgment module.
[0131] The first image module is used to convert all the blocking lines into a number of pixel points in the image corresponding to the infrared touch screen.
[0132] The first judgment module is used to select a pixel point that has not been selected from a number of pixel points of the first occlusion line as the first pixel point. If the first pixel point coincides with any pixel point of the other occlusion lines, the first pixel point is used as the intersection point of the first occlusion line, and the above operation is repeated until the judgment of all pixel points is completed.
[0133] Therefore, through the above module, each occlusion line is converted into a number of pixel points in the image corresponding to the infrared touch screen, and the pixel points on each occlusion line that intersect with other occlusion lines are used as the intersection points of the occlusion lines. In this way, the pixel points related to the touch area can be preliminarily identified, providing a data basis for the subsequent focus of the occlusion line, thereby ensuring the accuracy of touch area identification.
[0134] As an optional embodiment, the first processing unit further includes a first calculation module, and correspondingly, the second processing unit includes a second calculation module.
[0135] The first calculation module is used to set the number of times the first pixel point overlaps with any pixel point of the other occlusion lines as a first mark value of the first pixel point,
[0136] The second calculation module is used to set the pixel point with the maximum value of the first mark value as the focus of the first occlusion line.
[0137] Therefore, through the above module, the pixel point on each occlusion line that intersects the most with other occlusion lines can be used as the focus of the occlusion line, providing a data basis for the subsequent determination of the touch area, and can quickly and accurately identify the touch areas of larger and smaller contacts without repeated calculations for smaller contacts, effectively improving the computational efficiency of touch area recognition and positioning, and avoiding missing smaller contacts, which helps to improve the accuracy of touch area recognition.
[0138] As an optional embodiment, the second processing unit also includes a second image module, a second judgment module, and a third calculation module.
[0139] The second image module is used to convert the focal points of all the blocking lines into a number of pixel points in the image corresponding to the infrared touch screen.
[0140] The second judgment module is used to select a pixel point that has not been selected from the plurality of pixel points as a second pixel point, set the number of times the second pixel point is judged as the focus as the second mark value of the second pixel point, and repeat the above operation until the second mark values of all pixel points are obtained.
[0141] The third calculation module is used to set the pixel point with the maximum value of the second mark value as the common focus. Therefore, the pixel point in the touch area where the intersection of the occlusion lines is most concentrated is obtained through the above module as the common focus, which helps to improve the accuracy of touch area recognition, and the method steps are simple, efficient and easy to implement.
[0142] As an optional embodiment, the second processing unit also includes a third judgment module.
[0143] The third judgment module is used to take the common focus as the target and judge whether its neighboring pixel points are the focus. If so, the neighboring pixel points are incorporated into the target and continue to judge until all the neighboring pixel points of the target are not the focus; wherein, the neighboring pixel points are the pixel points directly adjacent to the target, or the pixel points with no more than a preset number of pixel gaps between the target and the common focus. Thus, through the above module, taking the common focus as the target, first find all the focal points around the common focus, then merge these newly obtained focal points into the target, and continue to find all the focal points in the surrounding area of the target, and expand the range outward in this way until the neighboring pixel points are not the focus, and then connect all the found focal points to form a touch area. It can be seen that regardless of the size of the touch points, the touch areas of all touch points can be identified. The calculation method is not only easy to implement, but also has high calculation efficiency, and can also avoid missing smaller touch points.
[0144] As an optional embodiment, the second processing unit also includes a fourth computing module.
[0145] The fourth calculation module is used to calculate the touch point position of the touch area according to the positions of all the focal points in the touch area.
[0146] Through the above modules, the contact point positions of the touch area can be used for various touch system applications of infrared touch screens, especially in multi-touch, the contact point positions of multiple touch areas obtained can facilitate subsequent calculation steps and processes.
[0147] As an optional embodiment, the fourth computing module also includes a first component and a second component.
[0148] The first component is used to obtain the position information of the pixel points corresponding to all the focal points in the touch area according to the image corresponding to the infrared touch screen, wherein the position information of each pixel point includes a horizontal position value and a vertical position value.
[0149] The second component is used to use the average of the first horizontal position value of the pixel with the largest horizontal position value and the second horizontal position value of the pixel with the smallest horizontal position value as the horizontal position value of the touch point, and to use the average of the first vertical position value of the pixel with the largest vertical position value and the second vertical position value of the pixel with the smallest vertical position as the vertical position value of the touch point; or,
[0150] The second component is used to take the average value of the horizontal position values of all the pixels as the horizontal position value of the touch point position, and to take the average value of the vertical position values of all the pixels as the vertical position value of the touch point position.
[0151] Therefore, through the above module, the contact point position of each touch area can be calculated according to actual needs, either by a relatively simple method of taking the average value of the position value data, or by taking the average value after weighted processing of the position value data. The contact point position obtained in this way is closer to the actual position information of the center of the touch area to meet higher calculation accuracy requirements.
[0152] The present invention also provides an electronic device with an infrared touch screen, comprising a processor, a memory, and a computer program stored in the memory and running on the processor, wherein when the computer program is executed by the processor, the touch area recognition method of the infrared touch screen as described in the above embodiment is implemented.
[0153] The present invention further provides a computer-readable storage medium on which a computer program is stored. The computer program is used to run to implement the touch area recognition method for the infrared touch screen described in the above embodiment.
[0154] Those skilled in the art will appreciate that, without conflict, the above-mentioned preferred solutions can be freely combined and superimposed.
[0155] It should be understood that the above-mentioned embodiments are merely illustrative and not restrictive. Without departing from the basic principles of the present invention, various obvious or equivalent modifications or substitutions that can be made by those skilled in the art to the above-mentioned details will all be included in the scope of the claims of the present invention.
Claims
1. A touch area recognition method for an infrared touch screen, characterized in that: The method comprises the following steps: Acquire all the blocking lines according to the scanning data of the infrared touch screen; Select an occlusion line that has not been selected as the first occlusion line, determine all intersection points of the first occlusion line, the intersection points are points where the first occlusion line intersects with other occlusion lines, and determine the focus of the first occlusion line, the focus is the intersection point involving the largest number of occlusion lines among all the intersection points, and repeat the above operation until the focus of all the occlusion lines is obtained; Select the focus with the largest number of simultaneously belonging to the occlusion line as the common focus, obtain other focuses in the adjacent area of the common focus, and determine the touch area according to the other focuses and the common focus, and repeat the above operation for the remaining focuses of the undetermined touch area until all the touch areas are obtained; Wherein, obtaining other focal points in the vicinity of the common focal point comprises the following steps: Convert the focus of all the blocking lines into several pixel points in the image corresponding to the infrared touch screen; take the common focus as the target and determine whether its neighboring pixel points are the focus, and if so, merge the neighboring pixel points into the target and continue to determine until all the neighboring pixel points of the target are not the focus; wherein the neighboring pixel points are pixel points directly adjacent to the target, or pixel points with no more than a preset number of pixel point vacancies between them and the target; Determining the touch area according to the other foci and the common foci includes: connecting the other foci and the common foci in pairs to obtain a connected graph, and using the boundary of the connected graph as the boundary of the touch area; or, taking the other foci and the common foci as a set, setting a rectangle with horizontal sides and vertical sides to represent the boundary of the touch area, wherein the horizontal side of the rectangle is the maximum horizontal spacing between the foci in the set, and the vertical side of the rectangle is the maximum vertical spacing between the foci in the set.
2. The touch area recognition method of the infrared touch screen according to claim 1, characterized in that: Determining all the intersection points of the first occlusion lines comprises the following steps: Convert all the blocking lines into a number of pixel points in the image corresponding to the infrared touch screen; Select a pixel point that has not been selected from several pixel points of the first occlusion line as the first pixel point. If the first pixel point coincides with any pixel point of other occlusion lines, take the first pixel point as the intersection point of the first occlusion line. Repeat the above operation until all pixel points are judged.
3. The touch area recognition method of the infrared touch screen according to claim 2, characterized in that: The step of using the first pixel point as the intersection point of the first occlusion line further comprises the following steps: Setting the number of times the first pixel point overlaps with any pixel point of the other occlusion lines as a first mark value of the first pixel point; Determining the focus of the first occlusion line comprises the following steps: The pixel point with the maximum value of the first mark value is set as the focus of the first occlusion line.
4. The touch area recognition method of the infrared touch screen according to claim 1, characterized in that: The step of selecting the focus with the largest number of points belonging to the occlusion lines at the same time as the common focus comprises the following steps: Converting the focal points of all the blocking lines into a number of pixel points in the image corresponding to the infrared touch screen; Selecting a pixel point that has not been selected from the plurality of pixel points as a second pixel point, setting the number of times the second pixel point is determined as a focus as a second label value of the second pixel point, and repeating the above operation until the second label values of all the pixel points are obtained; The pixel point with the second mark value as the maximum value is set as the common focus.
5. The touch area recognition method of an infrared touch screen according to any one of claims 1 to 4, characterized in that: After determining the touch area according to the other focus and the common focus, the following steps are further included: The contact point position of the touch area is calculated according to the positions of all focal points in the touch area.
6. The touch area recognition method of the infrared touch screen according to claim 5, characterized in that: The step of calculating the touch point position of the touch area according to the positions of all focal points in the touch area comprises: Obtaining position information of pixel points corresponding to all focal points in the touch area according to the image corresponding to the infrared touch screen; the position information of each pixel point includes a horizontal position value and a vertical position value; The average of the first horizontal position value of the pixel with the largest horizontal position value and the second horizontal position value of the pixel with the smallest horizontal position value is used as the horizontal position value of the touch point, and the average of the first vertical position value of the pixel with the largest vertical position value and the second vertical position value of the pixel with the smallest vertical position is used as the vertical position value of the touch point; or The average value of the horizontal position values of all the pixels is used as the horizontal position value of the touch point position, and the average value of the vertical position values of all the pixels is used as the vertical position value of the touch point position.
7. A touch area recognition system for an infrared touch screen, characterized in that: include: An acquisition unit, used for acquiring all the blocking lines according to the scanning data of the infrared touch screen; A first processing unit is used to select an occlusion line that has not been selected as a first occlusion line, and to determine all intersection points of the first occlusion line, where the intersection point is a point where the first occlusion line intersects with other occlusion lines, and to determine a focus of the first occlusion line, where the focus is an intersection point involving the largest number of occlusion lines among all the intersection points, and to repeat the above operation until the focus of all the occlusion lines is obtained; A second processing unit is used to select the focus having the largest number of simultaneously belonging to the occlusion line as a common focus, and to obtain other focuses in the vicinity of the common focus, and to determine the touch area according to the other focuses and the common focus, and to repeat the above operation for the remaining focuses of the undetermined touch area until all the touch areas are obtained; Wherein, obtaining other focal points in the vicinity of the common focal point comprises the following steps: Convert the focus of all the blocking lines into several pixel points in the image corresponding to the infrared touch screen; take the common focus as the target and determine whether its neighboring pixel points are the focus, and if so, merge the neighboring pixel points into the target and continue to determine until all the neighboring pixel points of the target are not the focus; wherein the neighboring pixel points are pixel points directly adjacent to the target, or pixel points with no more than a preset number of pixel point vacancies between them and the target; Determining the touch area according to the other foci and the common foci includes: connecting the other foci and the common foci in pairs to obtain a connected graph, and using the boundary of the connected graph as the boundary of the touch area; or, taking the other foci and the common foci as a set, setting a rectangle with horizontal sides and vertical sides to represent the boundary of the touch area, wherein the horizontal side of the rectangle is the maximum horizontal spacing between the foci in the set, and the vertical side of the rectangle is the maximum vertical spacing between the foci in the set.
8. An electronic device with an infrared touch screen, comprising a processor, a memory, and a computer program stored in the memory and running on the processor, characterized in that: When the computer program is executed by the processor, the touch area recognition method for the infrared touch screen according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: The computer program is used to run to implement the touch area recognition method for the infrared touch screen as described in any one of claims 1 to 6.
