技术领域technical field
本发明涉及模式识别技术,尤其涉及一种触摸源识别方法及系统。The invention relates to pattern recognition technology, in particular to a touch source recognition method and system.
背景技术Background technique
通过手指触摸输入是目前智能手机、平板电脑的主要输入方式。触摸屏是利用了人体的电流感应,用户和触摸屏表面形成以一个耦合电容,对于高频电流来说,电容是直接导体,于是手指从接触点吸走一个很小的电流,这个电流分从触摸屏的四角上的电极中流出,并且流经这四个电极的电流与手指到四角的距离成正比,控制器通过对这四个电流比例的精确计算,得出触摸点的位置。Finger touch input is currently the main input method for smartphones and tablet computers. The touch screen uses the current induction of the human body. The user and the surface of the touch screen form a coupling capacitor. For high-frequency currents, the capacitor is a direct conductor, so the finger absorbs a small current from the contact point, and this current is divided from the touch screen. The electrodes on the four corners flow out and the current flowing through these four electrodes is proportional to the distance from the finger to the four corners. The controller obtains the position of the touch point through accurate calculation of the four current ratios.
然而在通话过程中,脸颊、耳朵等其他物体误操作触摸屏按钮导致手机通话发生障碍,甚至通话意外中断等状况常有发生,如果便携设备能够将手指和其他常见触摸源,如脸颊、耳朵、手掌等区分开来,就可以通过忽略手指以外的触摸源的操作,以避免误触发生。甚至,智能便携设备可以对手指以外的触摸源进行的操作效果扩展出新的定义,使人机交互的方式更加丰富多样。However, during a call, misoperation of touch screen buttons by other objects such as cheeks and ears often leads to obstruction of mobile phone calls, and even accidental interruption of calls. By ignoring touch sources other than fingers, you can avoid false touches. Even, smart portable devices can expand new definitions of the operation effects of touch sources other than fingers, making the ways of human-computer interaction richer and more diverse.
目前,手持设备在通话过程中防止用户脸部等非手指触摸源进行误操作的主要解决办法是:使用一个接近传感器和红外发光管,判断用户头部与手机的距离,如果距离小于1~2cm,则锁定屏幕。但是,如果采用这种通过接近传感器和红外发光管的配合工作,使用一点上的距离来控制将手机锁屏和解锁,以防止发生通话中误触的方式,额外的元器件不但增加了手机的外观设计难度和生产成本,并且只在一点上进行采样,如果用户脸颊和屏幕并不平行,则很有可能未能引起屏幕锁定,进而发生误触,从而不能完全避免误触的发生。At present, the main solution for handheld devices to prevent misoperation by non-finger touch sources such as the user's face during a call is to use a proximity sensor and an infrared light-emitting tube to determine the distance between the user's head and the mobile phone. If the distance is less than 1-2cm , the screen is locked. However, if this method of working with the proximity sensor and the infrared light-emitting tube is used to control the locking and unlocking of the mobile phone with a distance of one point, to prevent accidental touches during a call, the additional components not only increase the The appearance design is difficult and the production cost is high, and the sampling is only done at one point. If the user's cheek is not parallel to the screen, it is very likely that the screen will not be locked, and then false touches will occur, so that the occurrence of false touches cannot be completely avoided.
另外,对于触摸源的辨别,申请号为200780049219.9的专利申请还提出一种解决方式:通过获得接近图像,分割接近图像以识别多个区块,确定这多个区块的每一个的短轴半径,如果一个区块的短轴半径值在第一指定阈值上则将该区块识别为大物体(例如脸颊),基于所识别的大物体控制触摸表面设备的操作。但是,该方案中区块分割依赖于分水岭算法的准确度,阈值的自定义依赖于实验中的经验性判断,从而这两个环节都存在着不鲁棒的因素,使该方法的识别准确率难以保证。In addition, for the identification of the touch source, the patent application No. 200780049219.9 also proposes a solution: by obtaining the proximity image, segmenting the proximity image to identify multiple blocks, and determining the minor axis radius of each of the multiple blocks , identifying a block as a large object (eg, a cheek) if the minor axis radius value of the block is above a first specified threshold, and controlling the operation of the touch surface device based on the identified large object. However, the block segmentation in this scheme depends on the accuracy of the watershed algorithm, and the customization of the threshold depends on the empirical judgment in the experiment, so there are unrobust factors in these two links, which makes the recognition accuracy of the method Difficult to guarantee.
发明内容Contents of the invention
有鉴于此,本发明的主要目的在于提供一种触摸源识别方法及系统,识别准确率较高,能够有效避免误触的发生,且设计难度和生产成本较低。In view of this, the main purpose of the present invention is to provide a touch source identification method and system, which have high recognition accuracy, can effectively avoid false touches, and have low design difficulty and production cost.
为达到上述目的,本发明的技术方案是这样实现的:In order to achieve the above object, technical solution of the present invention is achieved in that way:
一种触摸源识别方法,包括:A method for identifying a touch source, comprising:
获取感应图像;Get the sensing image;
根据所述感应图像,去除噪声并确定触摸源图像;removing noise and determining a touch source image according to the sensing image;
根据所述触摸源图像及预设的触摸源特征,确定触摸源的类型。The type of the touch source is determined according to the touch source image and the preset touch source feature.
所述根据所述感应图像,去除噪声并确定触摸源图像为:According to the sensing image, removing noise and determining the touch source image as:
确定感应图像中每个像素的像素值为该点处触摸源距触摸屏的距离;Determine the distance between the touch source and the touch screen at the point where the pixel value of each pixel in the sensing image is;
将感应图像中像素值小于预设的分割阈值的像素确定为前景像素,与所述前景像素相邻的像素确定为准前景像素,其他像素确定为背景像素;Determining pixels whose pixel values in the sensing image are smaller than a preset segmentation threshold as foreground pixels, determining pixels adjacent to the foreground pixels as quasi-foreground pixels, and determining other pixels as background pixels;
获取准前景像素的像素值及其相邻像素的像素值的中值,并将所述准前景像素的像素值修改为所述中值;Obtaining the median value of the pixel value of the quasi-foreground pixel and the pixel values of its adjacent pixels, and modifying the pixel value of the quasi-foreground pixel to the median value;
将像素值小于分割阈值的准前景像素确定为前景像素,像素值不小于分割阈值的准前景像素确定为背景像素,至此,所有前景像素组成触摸源图像。The quasi-foreground pixels whose pixel value is less than the segmentation threshold are determined as foreground pixels, and the quasi-foreground pixels whose pixel value is not less than the segmentation threshold are determined as background pixels. So far, all foreground pixels form the touch source image.
所述根据所述触摸源图像及预设的触摸源特征,确定触摸源的类型为:According to the touch source image and preset touch source features, determine the type of touch source as:
计算所述触摸源图像的七个Hu矩,并对所述触摸源图像进行骨骼化处理,获取目标骨架;Calculating seven Hu moments of the touch source image, and performing skeletal processing on the touch source image to obtain the target skeleton;
计算所述目标骨架的平均曲率;calculating the average curvature of the target skeleton;
对所述Hu矩和所述目标骨架的平均曲率,根据预设的阈值分别进行投票,将触摸源识别为投票值最高的类别。Voting is performed on the Hu moment and the average curvature of the target skeleton according to preset thresholds, and the touch source is identified as the category with the highest voting value.
所述对所述触摸源图像进行骨骼化处理,获取目标骨架为:The skeletonized processing is performed on the touch source image, and the target skeleton is obtained as follows:
a、将触摸源图像中各个像素的像素值记为该点处触摸源距触摸屏的距离的倒数;a, record the pixel value of each pixel in the touch source image as the reciprocal of the distance between the touch source at this point and the touch screen;
b、将与背景像素相邻的像素以及位于触摸屏边缘的非背景像素确定为轮廓像素;b. Determining pixels adjacent to the background pixels and non-background pixels located at the edge of the touch screen as contour pixels;
c、判断触摸源图像中是否只有轮廓像素,如果是,当前轮廓像素组成目标骨架;否则,执行步骤d;c. Determine whether there are only contour pixels in the touch source image, if so, the current contour pixels form the target skeleton; otherwise, perform step d;
d、遍历轮廓像素,取最小像素值,以每个轮廓像素的像素值减去所述最小像素值的值作为该轮廓像素新的像素值,新的像素值为零的轮廓像素确定为背景像素,之后返回步骤b。d. Traversing the contour pixels, taking the minimum pixel value, subtracting the value of the minimum pixel value from the pixel value of each contour pixel as the new pixel value of the contour pixel, and the contour pixel whose new pixel value is zero is determined as the background pixel , and then return to step b.
所述根据所述感应图像,去除噪声并确定触摸源图像之前,该方法还包括:Before removing noise and determining the touch source image according to the sensing image, the method further includes:
根据触摸源接触屏幕的面积和/或接触触摸屏边缘的长度,以及预设的决策树阈值进行决策树分类,以确定候选触摸源或排除部分或全部非目的触摸源,According to the area of the touch source touching the screen and/or the length of the edge of the touch screen, and the preset decision tree threshold, the decision tree classification is performed to determine candidate touch sources or exclude some or all non-intended touch sources,
其中,进行决策树分类,确定候选触摸源时,Among them, when performing decision tree classification to determine the candidate touch source,
所述根据所述触摸源图像及预设的触摸源特征,确定触摸源的类型为:根据所述触摸源图像及预设的所述候选触摸源对应的触摸源特征,确定触摸源的类型。The determining the type of the touch source according to the touch source image and the preset touch source feature includes: determining the touch source type according to the touch source image and the preset touch source feature corresponding to the candidate touch source.
一种触摸源识别系统,包括:感应图像获取模块、去噪及触摸源图像确定模块和触摸源类型确定模块;其中,A touch source identification system, comprising: a sensing image acquisition module, a denoising and touch source image determination module, and a touch source type determination module; wherein,
所述感应图像获取模块,用于获取感应图像;The sensing image acquisition module is used to acquire sensing images;
所述去噪及触摸源图像确定模块,用于根据所述感应图像,去除噪声并确定触摸源图像;The denoising and touch source image determination module is used to remove noise and determine the touch source image according to the sensing image;
所述触摸源类型确定模块,用于根据所述触摸源图像及预设的触摸源特征,确定触摸源的类型。The touch source type determining module is configured to determine the type of the touch source according to the touch source image and preset touch source features.
所述去噪及触摸源图像确定模块具体用于:The denoising and touch source image determination module is specifically used for:
确定感应图像中每个像素的像素值为该点处触摸源距触摸屏的距离;Determine the distance between the touch source and the touch screen at the point where the pixel value of each pixel in the sensing image is;
将感应图像中像素值小于预设的分割阈值的像素确定为前景像素,与所述前景像素相邻的像素确定为准前景像素,其他像素确定为背景像素;Determining pixels whose pixel values in the sensing image are smaller than a preset segmentation threshold as foreground pixels, determining pixels adjacent to the foreground pixels as quasi-foreground pixels, and determining other pixels as background pixels;
获取准前景像素的像素值及其相邻像素的像素值的中值,并将所述准前景像素的像素值修改为所述中值;Obtaining the median value of the pixel value of the quasi-foreground pixel and the pixel values of its adjacent pixels, and modifying the pixel value of the quasi-foreground pixel to the median value;
将像素值小于分割阈值的准前景像素确定为前景像素,像素值不小于分割阈值的准前景像素确定为背景像素,至此,所有前景像素组成触摸源图像。The quasi-foreground pixels whose pixel value is less than the segmentation threshold are determined as foreground pixels, and the quasi-foreground pixels whose pixel value is not less than the segmentation threshold are determined as background pixels. So far, all foreground pixels form the touch source image.
所述触摸源类型确定模块具体用于:The touch source type determination module is specifically used for:
计算所述触摸源图像的七个Hu矩,并对所述触摸源图像进行骨骼化处理,获取目标骨架;Calculating seven Hu moments of the touch source image, and performing skeletal processing on the touch source image to obtain the target skeleton;
计算所述目标骨架的平均曲率;calculating the average curvature of the target skeleton;
对所述Hu矩和所述目标骨架的平均曲率,根据预设的阈值分别进行投票,将触摸源识别为投票值最高的类别。Voting is performed on the Hu moment and the average curvature of the target skeleton according to preset thresholds, and the touch source is identified as the category with the highest voting value.
所述触摸源类型确定模块具体用于执行:The touch source type determination module is specifically used to perform:
a、将触摸源图像中各个像素的像素值记为该点处触摸源距触摸屏的距离的倒数;a, record the pixel value of each pixel in the touch source image as the reciprocal of the distance between the touch source at this point and the touch screen;
b、将与背景像素相邻的像素以及位于触摸屏边缘的非背景像素确定为轮廓像素;b. Determining pixels adjacent to the background pixels and non-background pixels located at the edge of the touch screen as contour pixels;
c、判断触摸源图像中是否只有轮廓像素,如果是,当前轮廓像素组成目标骨架;否则,执行步骤d;c. Determine whether there are only contour pixels in the touch source image, if so, the current contour pixels form the target skeleton; otherwise, perform step d;
d、遍历轮廓像素,取最小像素值,以每个轮廓像素的像素值减去所述最小像素值的值作为该轮廓像素新的像素值,新的像素值为零的轮廓像素确定为背景像素,之后返回步骤b。d. Traversing the contour pixels, taking the minimum pixel value, subtracting the value of the minimum pixel value from the pixel value of each contour pixel as the new pixel value of the contour pixel, and the contour pixel whose new pixel value is zero is determined as the background pixel , and then return to step b.
该系统还包括决策树分类模块,The system also includes a decision tree classification module,
所述决策树分类模块,用于在感应图像获取模块获取感应图像后,根据触摸源接触屏幕的面积和/或接触触摸屏边缘的长度,以及预设的决策树阈值进行决策树分类,以确定候选触摸源或排除部分或全部非目的触摸源,The decision tree classification module is used to perform decision tree classification according to the area of the touch source touching the screen and/or the length of the edge of the touch screen and the preset decision tree threshold after the sensing image acquisition module acquires the sensing image, so as to determine the candidate touch source or exclude some or all unintended touch sources,
其中,进行决策树分类,确定候选触摸源时,Among them, when performing decision tree classification to determine the candidate touch source,
所述根据所述触摸源图像及预设的触摸源特征,确定触摸源的类型为:根据所述触摸源图像及预设的所述候选触摸源对应的触摸源特征,确定触摸源的类型。The determining the type of the touch source according to the touch source image and the preset touch source feature includes: determining the touch source type according to the touch source image and the preset touch source feature corresponding to the candidate touch source.
本发明触摸源识别方法及系统,获取感应图像;根据所述感应图像,去除噪声并确定触摸源图像;根据所述触摸源图像及预设的触摸源特征,确定触摸源的类型。根据本发明所述的方案,能够使带有电容触摸屏的便携设备将手指和其他常见触摸源,如脸颊、耳朵、手掌等区分开,从而识别准确率较高,能够有效避免误触的发生,并且,本发明不需要使用接近传感器、红外发光管等额外的原件,从而设计难度和生产成本较低。The touch source identification method and system of the present invention acquires a sensing image; removes noise and determines the touch source image according to the sensing image; determines the type of the touch source according to the touch source image and preset touch source characteristics. According to the solution of the present invention, the portable device with a capacitive touch screen can distinguish fingers from other common touch sources, such as cheeks, ears, palms, etc., so that the recognition accuracy is high, and the occurrence of false touches can be effectively avoided. Moreover, the present invention does not need to use additional components such as proximity sensors and infrared light emitting tubes, so that the design difficulty and production cost are relatively low.
附图说明Description of drawings
图1为本发明一实施例一种触摸源识别方法流程示意图;FIG. 1 is a schematic flow chart of a touch source identification method according to an embodiment of the present invention;
图2为本发明一实施例获取的一感应图像示意图;Fig. 2 is a schematic diagram of a sensing image acquired by an embodiment of the present invention;
图3为本发明一实施例根据感应图像去除噪声并确定触摸源图像的详细流程示意图;Fig. 3 is a detailed flow diagram of removing noise and determining a touch source image according to an embodiment of the present invention;
图4为本发明一实施例中获取的前景像素及背景像素示意图;4 is a schematic diagram of foreground pixels and background pixels obtained in an embodiment of the present invention;
图5为本发明一实施例中基于图4进行处理后的像素示意图;FIG. 5 is a schematic diagram of pixels processed based on FIG. 4 in an embodiment of the present invention;
图6为本发明一实施例中基于图5进行处理后的像素示意图;FIG. 6 is a schematic diagram of pixels processed based on FIG. 5 in an embodiment of the present invention;
图7为本发明一实施例中根据触摸源图像及预设的触摸源特征,确定触摸源的类型的详细流程示意图;FIG. 7 is a schematic diagram of a detailed process for determining the type of a touch source according to the image of the touch source and the preset characteristics of the touch source in an embodiment of the present invention;
图8为本发明一实施例的整体流程示意图;Fig. 8 is a schematic diagram of the overall process of an embodiment of the present invention;
图9为常见感应图像示意图;Fig. 9 is a schematic diagram of a common sensing image;
图10为本发明一实施例中对触摸源图像进行骨骼化处理,获取目标骨架的详细流程示意图;FIG. 10 is a schematic diagram of a detailed flow chart of performing skeletal processing on a touch source image and obtaining a target skeleton in an embodiment of the present invention;
图11为本发明一实施例中的感应图像示意图;Fig. 11 is a schematic diagram of a sensing image in an embodiment of the present invention;
图12为本发明一实施例中经过步骤a和步骤b处理后的像素示意图;Fig. 12 is a schematic diagram of pixels processed by step a and step b in an embodiment of the present invention;
图13为本发明一实施例中基于图12进行一次迭代处理后获取的像素情况示意图;FIG. 13 is a schematic diagram of pixels obtained after an iterative process based on FIG. 12 in an embodiment of the present invention;
图14为本发明一实施例中基于图12进行多次迭代处理,直到触摸源图像中只有轮廓像素时获取的像素情况示意图;Fig. 14 is a schematic diagram of the pixel situation obtained when the touch source image only has outline pixels after multiple iterative processing based on Fig. 12 in an embodiment of the present invention;
图15为基于图12,采用传统骨骼化方法获取的像素情况示意图;FIG. 15 is a schematic diagram of pixels obtained by using a traditional skeletalization method based on FIG. 12;
图16为本发明另一实施例一种触摸源识别方法流程示意图;Fig. 16 is a schematic flowchart of a touch source identification method according to another embodiment of the present invention;
图17为本发明一实施例采用的决策树示意图;Fig. 17 is a schematic diagram of a decision tree adopted in an embodiment of the present invention;
图18为本发明一实施例一种触摸源识别系统结构示意图;Fig. 18 is a schematic structural diagram of a touch source identification system according to an embodiment of the present invention;
图19为本发明另一实施例一种触摸源识别系统结构示意图。Fig. 19 is a schematic structural diagram of a touch source identification system according to another embodiment of the present invention.
具体实施方式detailed description
本发明的基本思想是:获取感应图像;根据所述感应图像,去除噪声并确定触摸源图像;根据所述触摸源图像及预设的触摸源特征,确定触摸源的类型。The basic idea of the present invention is: acquire a sensing image; remove noise and determine the touch source image according to the sensing image; determine the type of the touch source according to the touch source image and preset touch source characteristics.
本发明实施例提出了一种触摸源识别方法,如图1所示,该方法包括:The embodiment of the present invention proposes a touch source identification method, as shown in Figure 1, the method includes:
步骤101:获取感应图像;Step 101: Acquire a sensing image;
这里,一般通过对触摸屏的二维阵列元件进行扫描,得到多个行电极和列电极交叉点的电容变化值,结合多个行电极和列电极交叉点的坐标值获取感应图像。例如,获取的感应图像如图2所示。Here, generally by scanning the two-dimensional array elements of the touch screen, the capacitance change values of intersections of multiple row electrodes and column electrodes are obtained, and combined with the coordinate values of multiple intersections of row electrodes and column electrodes to obtain a sensing image. For example, the acquired sensing image is shown in FIG. 2 .
步骤102:根据所述感应图像,去除噪声并确定触摸源图像;Step 102: Remove noise and determine a touch source image according to the sensing image;
为了之后对目标的识别,在本步骤需要对从感应图像提取触摸源部分,并对触摸屏的感应噪声进行去除。具体的,根据感应图像中各个像素的像素值(该点处触摸源距触摸屏的距离)去除噪声并确定触摸源图像。In order to identify the target later, in this step, it is necessary to extract the touch source part from the sensing image, and remove the sensing noise of the touch screen. Specifically, the noise is removed and the image of the touch source is determined according to the pixel value of each pixel in the sensing image (the distance between the touch source at this point and the touch screen).
步骤103:根据所述触摸源图像及预设的触摸源特征,确定触摸源的类型。Step 103: Determine the type of the touch source according to the touch source image and the preset touch source characteristics.
可选的,如图3所示,步骤102所述根据所述感应图像,去除噪声并确定触摸源图像包括:Optionally, as shown in FIG. 3 , removing noise and determining the touch source image according to the sensing image in step 102 includes:
步骤1021:确定感应图像中每个像素的像素值为该点处触摸源距触摸屏的距离;Step 1021: Determine the distance between the touch source and the touch screen at the point where the pixel value of each pixel in the sensing image is;
步骤1022:将感应图像中像素值小于预设的分割阈值的像素确定为前景像素,其他像素确定为背景像素;Step 1022: Determine the pixels whose pixel values are smaller than the preset segmentation threshold in the sensed image as foreground pixels, and determine other pixels as background pixels;
优选的,分割阈值为5毫米,采用这种方式能够保证重要的前景像素值保持原始值不变,在去除前景噪点方面做到更精细,相对于传统的形态学方法和滤波操作更满足在触摸屏上的要求。例如,本步骤获取的前景像素及背景像素如图4所示,图中的数值为各像素对应的像素值。Preferably, the segmentation threshold is 5 millimeters. This method can ensure that the important foreground pixel values remain unchanged from the original value, and it is more refined in removing foreground noise points. Compared with traditional morphological methods and filtering operations, it is more satisfactory on the touch screen. on request. For example, the foreground pixels and background pixels acquired in this step are shown in FIG. 4 , and the values in the figure are the pixel values corresponding to each pixel.
步骤1023:将与所述前景像素相邻的像素确定为准前景像素,获取准前景像素的像素值及其相邻像素的像素值的中值,并将所述准前景像素的像素值修改为所述中值;Step 1023: Determine the pixel adjacent to the foreground pixel as a quasi-foreground pixel, obtain the median value of the pixel value of the quasi-foreground pixel and the pixel values of its adjacent pixels, and modify the pixel value of the quasi-foreground pixel to said median value;
对于中值的获取,举例来说,如果准前景像素的像素值为5,该准前景像素的相邻像素的像素值分别为2、2、7、8,那么,对所述五个像素值按大小顺序排序为2、2、5、7、8,该序列的中间值5即为所述五个像素值的中值。基于图4,进行本步处理后的像素示意图如图5所示。For the acquisition of the median, for example, if the pixel value of the quasi-foreground pixel is 5, and the pixel values of the adjacent pixels of the quasi-foreground pixel are respectively 2, 2, 7, and 8, then, for the five pixel values The order of size is 2, 2, 5, 7, 8, and the middle value 5 of this sequence is the median value of the five pixel values. Based on FIG. 4 , a schematic diagram of pixels after this step of processing is shown in FIG. 5 .
步骤1024:将像素值小于分割阈值的准前景像素确定为前景像素,像素值不小于分割阈值的准前景像素确定为背景像素,至此,所有前景像素组成触摸源图像。Step 1024: Determine the quasi-foreground pixels whose pixel values are less than the segmentation threshold as foreground pixels, and determine the quasi-foreground pixels whose pixel values are not less than the segmentation threshold as background pixels. So far, all foreground pixels constitute the touch source image.
基于图5,进行本步处理后的像素示意图如图6所示。Based on FIG. 5 , a schematic diagram of pixels after this step of processing is shown in FIG. 6 .
可选的,如图7所示,步骤103所述根据所述触摸源图像及预设的触摸源特征,确定触摸源的类型包括:Optionally, as shown in FIG. 7, determining the type of the touch source according to the touch source image and the preset touch source characteristics in step 103 includes:
步骤1031:计算所述触摸源图像的七个Hu矩,并对所述触摸源图像进行骨骼化处理,获取目标骨架;Step 1031: Calculate seven Hu moments of the touch source image, and perform skeletal processing on the touch source image to obtain a target skeleton;
步骤1032:计算所述目标骨架的平均曲率;Step 1032: Calculate the average curvature of the target skeleton;
步骤1033:对所述Hu矩和所述目标骨架的平均曲率,根据预设的阈值分别进行投票,将触摸源识别为投票值最高的类别。Step 1033: Vote for the Hu moment and the average curvature of the target skeleton according to preset thresholds, and identify the touch source as the category with the highest voting value.
需要说明的是,本发明具有分类器训练和实时分类两个环节,整体流程如图8所示,其中,分类器训练环节是线下环节,训练一次即可。该环节使用特定的手指、耳朵、脸颊产生的感应图像(如图9所示的感应图像,其中第一排为手指感应图像,第二排为脸颊感应图像,第三排为耳朵感应图像),计算标准手指、耳朵、脸颊接触触摸屏时的Hu矩和曲率特征,目的是得到一组可以辨别常见触摸源的分类数据(即预设的阈值);实时环节为线上环节,目的是在用户使用触摸屏时,根据感应图像,使用已有的分类器,将手指触摸区分于其他物体接触触摸屏。该环节计算量较小,可以达到实时效率。It should be noted that the present invention has two links of classifier training and real-time classification, and the overall process is shown in Figure 8, wherein the classifier training link is an offline link, and only one training session is required. This link uses the sensing images generated by specific fingers, ears, and cheeks (the sensing images shown in Figure 9, wherein the first row is the finger sensing image, the second row is the cheek sensing image, and the third row is the ear sensing image), Calculate the Hu moment and curvature characteristics of standard fingers, ears, and cheeks when they touch the touch screen. The purpose is to obtain a set of classification data that can identify common touch sources (that is, the preset threshold); When touching the screen, according to the sensing image, the existing classifier is used to distinguish the finger touch from other objects touching the touch screen. The amount of calculation in this link is small, and real-time efficiency can be achieved.
可选的,如图10所示,步骤1031所述对所述触摸源图像进行骨骼化处理,获取目标骨架包括:Optionally, as shown in FIG. 10 , in step 1031, performing skeletal processing on the touch source image, and obtaining the target skeleton includes:
步骤a:将触摸源图像中各个像素的像素值记为该点处触摸源距触摸屏的距离的倒数;Step a: record the pixel value of each pixel in the touch source image as the reciprocal of the distance between the touch source at this point and the touch screen;
步骤b:将与背景像素相邻的像素以及位于触摸屏边缘的非背景像素确定为轮廓像素;Step b: determining the pixels adjacent to the background pixels and the non-background pixels located at the edge of the touch screen as contour pixels;
例如,图11所示的感应图像经步骤a和步骤b处理后的像素示意图如图 12所示,其中由于0的倒数不存在,所以标记为m。For example, the pixel schematic diagram of the sensed image shown in Figure 11 processed by step a and step b is shown in Figure 12, where the reciprocal of 0 does not exist, so it is marked as m.
步骤c:判断触摸源图像中是否只有轮廓像素,如果是,当前轮廓像素组成目标骨架;否则,执行步骤d;Step c: Determine whether there are only contour pixels in the touch source image, if yes, the current contour pixels form the target skeleton; otherwise, execute step d;
对于图12所示的像素结构,由于触摸源图像中除了轮廓像素之外,还包括前景像素,因此,执行步骤d。For the pixel structure shown in FIG. 12 , since the touch source image includes foreground pixels in addition to outline pixels, step d is performed.
步骤d:遍历轮廓像素,取最小像素值,以每个轮廓像素的像素值减去所述最小像素值的值作为该轮廓像素新的像素值,新的像素值为零的轮廓像素确定为背景像素,之后返回步骤b。Step d: Traversing the contour pixels, taking the minimum pixel value, subtracting the value of the minimum pixel value from the pixel value of each contour pixel as the new pixel value of the contour pixel, the contour pixel whose new pixel value is zero is determined as the background pixel, and then return to step b.
基于图12,进行一次迭代处理后获取的像素情况如图13所示,进行多次迭代处理,直到触摸源图像中只有轮廓像素时获取的像素情况如图14所示,其中,轮廓像素组成目标骨架。Based on Figure 12, the pixel situation obtained after one iterative processing is shown in Figure 13, and multiple iterations are performed until the pixel situation obtained when there are only outline pixels in the touch source image is shown in Figure 14, where the outline pixels form the target skeleton.
需要说明的是,本发明是采用改进的图像骨骼化是根据对象形状以及目标轮廓上对应像素值对目标约简,使结果能够体现对象与触摸屏的距离关系。传统的骨骼化是通过连续腐蚀操作,将二值图像中的对象约简为一组细骨骼,从而提取目标骨架。细骨骼仍保留原始对象形状的重要信息,基于图12,采用传统骨骼化方法获取的像素情况示意图如图15所示,可以看出,该方法不能满足本发明的要求。It should be noted that the present invention uses improved image skeletalization to reduce the target according to the object shape and the corresponding pixel value on the target outline, so that the result can reflect the distance relationship between the object and the touch screen. Traditional skeletalization is to reduce the object in the binary image to a set of thin bones through continuous erosion operation, so as to extract the target skeleton. The thin skeleton still retains the important information of the original object shape. Based on Fig. 12, the schematic diagram of the pixels obtained by using the traditional skeletalization method is shown in Fig. 15. It can be seen that this method cannot meet the requirements of the present invention.
本发明中,触摸源可以为手指、脸颊、耳朵、手掌、手肘等。In the present invention, the touch source may be fingers, cheeks, ears, palms, elbows and the like.
可选的,如图16所示,步骤102所述根据所述感应图像,去除噪声并确定触摸源图像之前,该方法还包括:Optionally, as shown in FIG. 16, before removing noise and determining the touch source image according to the sensing image in step 102, the method further includes:
步骤102’:根据触摸源接触屏幕的面积和/或接触触摸屏边缘的长度,以及预设的决策树阈值进行决策树分类,以确定候选触摸源或排除部分或全部非目的触摸源,确定候选触摸源或在触摸源可能为目的触摸源后,执行步骤102。Step 102': Carry out decision tree classification according to the touch source touch screen area and/or touch touch screen edge length, and the preset decision tree threshold, to determine candidate touch sources or exclude some or all non-intended touch sources, and determine candidate touch Step 102 is performed after the touch source or the touch source may be the destination touch source.
需要说明的是,进行决策树分类,确定候选触摸源时,所述根据所述触摸源图像及预设的触摸源特征,确定触摸源的类型为:根据所述触摸源图像及预设的所述候选触摸源对应的触摸源特征,确定触摸源的类型。It should be noted that, when performing decision tree classification to determine the candidate touch source, the determination of the type of the touch source according to the touch source image and the preset touch source features is: according to the touch source image and the preset touch source The touch source characteristics corresponding to the above candidate touch sources are determined to determine the type of the touch source.
可选的,本步骤所采用的决策树可以如图17所示,用于排除非目的触摸源。这里,决策树分类的意义是,1)能够快速识别一些非手指触摸源的触摸行为,进行排除;2)由于耳朵、手掌、脸颊等接触触摸屏时,感应图像可能只能获取它们的局部图像,那么就给后续的识别特征带来比较大的不确定性。决策树提取出触摸源在触摸屏区域内的小面积触摸行为,便于后续步骤的识别。Optionally, the decision tree used in this step may be as shown in FIG. 17 , which is used to exclude unintended touch sources. Here, the significance of decision tree classification is that 1) it can quickly identify some non-finger touch source touch behaviors and exclude them; 2) when the ears, palms, cheeks, etc. touch the touch screen, the sensing image may only obtain their partial images, Then it brings relatively large uncertainty to the subsequent identification features. The decision tree extracts the small-area touch behavior of the touch source in the touch screen area, which is convenient for the identification of subsequent steps.
基于上述方案,当触摸源靠近便携设备的电容触摸屏时,将触摸屏感测元件的二维阵列输出的信号视为感应图像。通过对感应图像的特征分析,使便携设备将手指和其他常见触摸源,如脸颊、耳朵、手掌等区分开,可以达到防止非手指误触的效果。并且,实时分类环节中只有简单的图像处理和形态学计算,计算量很小,对于目前智能手机的内存和计算能力,完全可以达到实时性能。Based on the above solution, when the touch source is close to the capacitive touch screen of the portable device, the signal output by the two-dimensional array of the sensing elements of the touch screen is regarded as a sensing image. Through the feature analysis of the sensing image, the portable device can distinguish fingers from other common touch sources, such as cheeks, ears, palms, etc., and can achieve the effect of preventing non-finger accidental touches. Moreover, in the real-time classification process, only simple image processing and morphological calculations are required, and the amount of calculation is very small. For the memory and computing power of the current smart phone, the real-time performance can be fully achieved.
需要说明的是,本发明可以广泛应用于带有电容触摸屏的智能便携设备上,如智能便携设备,包括手机、平板电脑等。通过本发明可以实现:辨别触摸源为合法触摸源时,允许触摸操作,否则将操作无效,由此避免了日常使用中的误触和误操作;当辨别触摸源为非法触摸源时,锁定屏幕并显示为最低亮度,节省智能设备电量;另外,本发明对未来智能设备扩展合法触摸源、丰富人机交互方式的定义极有帮助。It should be noted that the present invention can be widely applied to smart portable devices with capacitive touch screens, such as smart portable devices, including mobile phones and tablet computers. The present invention can achieve: when the touch source is identified as a legal touch source, the touch operation is allowed, otherwise the operation will be invalid, thereby avoiding false touches and misoperations in daily use; when the touch source is identified as an illegal touch source, the screen is locked And it is displayed at the lowest brightness, which saves the power of smart devices; in addition, the present invention is extremely helpful for future smart devices to expand legal touch sources and enrich the definition of human-computer interaction modes.
本发明实施例还相应地提出了一种触摸源识别系统,如图18所示,该系统包括:感应图像获取模块、去噪及触摸源图像确定模块和触摸源类型确定模块;其中,The embodiment of the present invention also correspondingly proposes a touch source identification system, as shown in FIG. 18 , the system includes: a sensing image acquisition module, a denoising and touch source image determination module, and a touch source type determination module; wherein,
所述感应图像获取模块,用于获取感应图像;The sensing image acquisition module is used to acquire sensing images;
所述去噪及触摸源图像确定模块,用于根据所述感应图像,去除噪声并确定触摸源图像;The denoising and touch source image determination module is used to remove noise and determine the touch source image according to the sensing image;
所述触摸源类型确定模块,用于根据所述触摸源图像及预设的触摸源特征,确定触摸源的类型。The touch source type determining module is configured to determine the type of the touch source according to the touch source image and preset touch source features.
可选的,所述去噪及触摸源图像确定模块具体用于:Optionally, the denoising and touch source image determination module is specifically used for:
确定感应图像中每个像素的像素值为该点处触摸源距触摸屏的距离;Determine the distance between the touch source and the touch screen at the point where the pixel value of each pixel in the sensing image is;
将感应图像中像素值小于预设的分割阈值的像素确定为前景像素,与所述前景像素相邻的像素确定为准前景像素,其他像素确定为背景像素;Determining pixels whose pixel values in the sensing image are smaller than a preset segmentation threshold as foreground pixels, determining pixels adjacent to the foreground pixels as quasi-foreground pixels, and determining other pixels as background pixels;
获取准前景像素的像素值及其相邻像素的像素值的中值,并将所述准前景像素的像素值修改为所述中值;Obtaining the median value of the pixel value of the quasi-foreground pixel and the pixel values of its adjacent pixels, and modifying the pixel value of the quasi-foreground pixel to the median value;
将像素值小于分割阈值的准前景像素确定为前景像素,像素值不小于分割阈值的准前景像素确定为背景像素,至此,所有前景像素组成触摸源图像。The quasi-foreground pixels whose pixel value is less than the segmentation threshold are determined as foreground pixels, and the quasi-foreground pixels whose pixel value is not less than the segmentation threshold are determined as background pixels. So far, all foreground pixels form the touch source image.
可选的,所述触摸源类型确定模块具体用于:Optionally, the touch source type determining module is specifically used for:
计算所述触摸源图像的七个Hu矩,并对所述触摸源图像进行骨骼化处理,获取目标骨架;Calculating seven Hu moments of the touch source image, and performing skeletal processing on the touch source image to obtain the target skeleton;
计算所述目标骨架的平均曲率;calculating the average curvature of the target skeleton;
对所述Hu矩和所述目标骨架的平均曲率,根据预设的阈值分别进行投票,将触摸源识别为投票值最高的类别。Voting is performed on the Hu moment and the average curvature of the target skeleton according to preset thresholds, and the touch source is identified as the category with the highest voting value.
可选的,所述触摸源类型确定模块具体用于执行:Optionally, the touch source type determination module is specifically configured to execute:
a、将触摸源图像中各个像素的像素值记为该点处触摸源距触摸屏的距离的倒数;a, record the pixel value of each pixel in the touch source image as the reciprocal of the distance between the touch source at this point and the touch screen;
b、将与背景像素相邻的像素以及位于触摸屏边缘的非背景像素确定为轮廓像素;b. Determining pixels adjacent to the background pixels and non-background pixels located at the edge of the touch screen as contour pixels;
c、判断触摸源图像中是否只有轮廓像素,如果是,当前轮廓像素组成目标骨架;否则,执行步骤d;c. Determine whether there are only contour pixels in the touch source image, if so, the current contour pixels form the target skeleton; otherwise, perform step d;
d、遍历轮廓像素,取最小像素值,以每个轮廓像素的像素值减去所述最小像素值的值作为该轮廓像素新的像素值,新的像素值为零的轮廓像素确定为背景像素,之后返回步骤b。d. Traversing the contour pixels, taking the minimum pixel value, subtracting the value of the minimum pixel value from the pixel value of each contour pixel as the new pixel value of the contour pixel, and the contour pixel whose new pixel value is zero is determined as the background pixel , and then return to step b.
可选的,如图19所示,该系统还包括决策树分类模块,Optionally, as shown in Figure 19, the system also includes a decision tree classification module,
所述决策树分类模块,用于在感应图像获取模块获取感应图像后,根据触摸源接触屏幕的面积和/或接触触摸屏边缘的长度,以及预设的决策树阈值进行决策树分类,以确定候选触摸源或排除部分或全部非目的触摸源,The decision tree classification module is used to perform decision tree classification according to the area of the touch source touching the screen and/or the length of the edge of the touch screen and the preset decision tree threshold after the sensing image acquisition module acquires the sensing image, so as to determine the candidate touch source or exclude some or all unintended touch sources,
其中,进行决策树分类,确定候选触摸源时,Among them, when performing decision tree classification to determine the candidate touch source,
所述根据所述触摸源图像及预设的触摸源特征,确定触摸源的类型为:根据所述触摸源图像及预设的所述候选触摸源对应的触摸源特征,确定触摸源的类型。The determining the type of the touch source according to the touch source image and the preset touch source feature includes: determining the touch source type according to the touch source image and the preset touch source feature corresponding to the candidate touch source.
总言之,本发明具备以下技术优点:In a word, the present invention has the following technical advantages:
1)通过决策树分类,快速识别一些非手指触摸源的触摸行为,立刻排除; 2)由于耳朵、手掌、脸颊等接触触摸屏时,感应图像可能只能获取它们的局部图像,那么就给后续的识别特征带来比较大的不确定性。决策树提取出触摸源在触摸屏区域内的小面积触摸行为,便于后续步骤的识别;1) Quickly identify some non-finger touch source touch behaviors through decision tree classification, and immediately exclude them; 2) When the ears, palms, cheeks, etc. touch the touch screen, the sensing image may only obtain their partial images, then give subsequent Identifying features brings relatively large uncertainties. The decision tree extracts the small-area touch behavior of the touch source in the touch screen area, which is convenient for the identification of subsequent steps;
2)通过改进的形态学计算方法,去除感应噪声并提取触摸源。该方法能够从感应图像提取触摸源部分,并对触摸屏的感应噪声进行去除,便于之后对目标的识别;2) Through the improved morphological calculation method, the induction noise is removed and the touch source is extracted. The method can extract the touch source part from the sensing image, and remove the sensing noise of the touch screen, so as to facilitate the identification of the target later;
3)改进的图像骨骼化,根据目标形状以及目标轮廓上对应像素值对目标约简,使结果能够体现对象与触摸屏的距离关系。并结合利用Hu矩和触摸源骨架曲率特征能够快速将手指和其他触摸源区分开。3) Improved image skeletalization, which reduces the target according to the target shape and the corresponding pixel value on the target outline, so that the result can reflect the distance relationship between the object and the touch screen. And combined use of the Hu moment and the curvature feature of the touch source skeleton can quickly distinguish the finger from other touch sources.
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201210541504.5ACN103870071B (en) | 2012-12-13 | 2012-12-13 | One kind touches source discrimination and system |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201210541504.5ACN103870071B (en) | 2012-12-13 | 2012-12-13 | One kind touches source discrimination and system |
| Publication Number | Publication Date |
|---|---|
| CN103870071A CN103870071A (en) | 2014-06-18 |
| CN103870071Btrue CN103870071B (en) | 2017-09-08 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201210541504.5AActiveCN103870071B (en) | 2012-12-13 | 2012-12-13 | One kind touches source discrimination and system |
| Country | Link |
|---|---|
| CN (1) | CN103870071B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104407793B (en)* | 2014-11-26 | 2018-03-13 | 深圳市华星光电技术有限公司 | Touch signal processing method and equipment |
| DE102016106860A1 (en)* | 2015-04-17 | 2016-11-10 | Ford Global Technologies, Llc | Proximity switch arrangement with signal drift suppression and method |
| CN108427932B (en)* | 2015-10-19 | 2021-07-02 | Oppo广东移动通信有限公司 | Fingerprint image recognition method and device |
| CN105260105B (en)* | 2015-10-19 | 2017-10-24 | 广东欧珀移动通信有限公司 | Display screen wake-up method, device and mobile terminal based on fingerprint sensor |
| CN105245716A (en)* | 2015-10-27 | 2016-01-13 | 青岛海信移动通信技术股份有限公司 | Method and mobile terminal for preventing from accidentally dialling |
| CN107808089A (en)* | 2017-11-21 | 2018-03-16 | 青岛海信移动通信技术股份有限公司 | A kind of fingerprint identification method, device and storage medium |
| EP3521983A1 (en)* | 2018-02-01 | 2019-08-07 | Qeexo, Co. | Classifying contacts or associations with a touch sensitive device |
| CN109032432A (en)* | 2018-07-17 | 2018-12-18 | 深圳市天英联合教育股份有限公司 | A kind of method, apparatus and terminal device of lettering pen category identification |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101464948A (en)* | 2009-01-14 | 2009-06-24 | 北京航空航天大学 | Object identification method for affine constant moment based on key point |
| CN101583924A (en)* | 2007-01-03 | 2009-11-18 | 苹果公司 | Multi-touch input discrimination |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7379562B2 (en)* | 2004-03-31 | 2008-05-27 | Microsoft Corporation | Determining connectedness and offset of 3D objects relative to an interactive surface |
| JP3729417B1 (en)* | 2004-09-07 | 2005-12-21 | ソニー株式会社 | Information processing apparatus and method, and program |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101583924A (en)* | 2007-01-03 | 2009-11-18 | 苹果公司 | Multi-touch input discrimination |
| CN101464948A (en)* | 2009-01-14 | 2009-06-24 | 北京航空航天大学 | Object identification method for affine constant moment based on key point |
| Publication number | Publication date |
|---|---|
| CN103870071A (en) | 2014-06-18 |
| Publication | Publication Date | Title |
|---|---|---|
| CN103870071B (en) | One kind touches source discrimination and system | |
| CN103984928B (en) | Finger gesture recognition methods based on depth image | |
| RU2711029C2 (en) | Touch classification | |
| JP5887775B2 (en) | Human computer interaction system, hand-to-hand pointing point positioning method, and finger gesture determination method | |
| US20130050076A1 (en) | Method of recognizing a control command based on finger motion and mobile device using the same | |
| CN107885327B (en) | A Fingertip Detection Method Based on Kinect Depth Information | |
| CN104978012B (en) | One kind points to exchange method, apparatus and system | |
| WO2018041250A1 (en) | Touch control operation identification method and apparatus | |
| CN106845384B (en) | A Gesture Recognition Method Based on Recursive Model | |
| TW201120681A (en) | Method and system for operating electric apparatus | |
| CN103598870A (en) | Optometry method based on depth-image gesture recognition | |
| KR101559502B1 (en) | Method and recording medium for contactless input interface with real-time hand pose recognition | |
| CN102402289A (en) | Gesture mouse recognition method based on machine vision | |
| CN106200971A (en) | Man-machine interactive system device based on gesture identification and operational approach | |
| CN104331193A (en) | Infrared precise multi-point touch platform | |
| CN110796033A (en) | A Static Gesture Recognition Method Based on Bounding Box Model | |
| CN101694694A (en) | Finger identification method used in interactive demonstration system | |
| CN106503619B (en) | Gesture recognition method based on BP neural network | |
| TW201317843A (en) | Virtual mouse driving apparatus and virtual mouse simulation method | |
| US10146375B2 (en) | Feature characterization from infrared radiation | |
| US20140369559A1 (en) | Image recognition method and image recognition system | |
| CN111160173A (en) | A robot-based gesture recognition method and robot | |
| KR101281461B1 (en) | Multi-touch input method and system using image analysis | |
| CN108255352B (en) | Multi-touch implementation method and system in projection interaction system | |
| CN102902421A (en) | Touch screen stroke thickness identification method and device |
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |