CN115826838A - Gesture recognition method and related equipment - Google Patents
Gesture recognition method and related equipment Download PDFInfo
- Publication number
- CN115826838A CN115826838A CN202211420887.0A CN202211420887A CN115826838A CN 115826838 A CN115826838 A CN 115826838A CN 202211420887 A CN202211420887 A CN 202211420887A CN 115826838 A CN115826838 A CN 115826838A
- Authority
- CN
- China
- Prior art keywords
- touch
- physical
- point
- value
- touch screen
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- User Interface Of Digital Computer (AREA)
Abstract
本申请提供一种手势识别方法及相关设备。所述方法包括:获取对触摸屏的触摸点的个数,根据所述触摸点的个数,获取触摸点的像素数据;根据所述触摸点的个数、所述触摸点的像素数据、获取的触摸屏的物理参数和获取的触摸屏的分辨率,计算得到所述触摸点的物理数据;根据所述触摸点的物理数据与预设阈值,得到所述触摸点对应的手势。本申请实施例通过获取到的像素数据以及触摸屏的物理数据和分辨率,计算得出触摸点的物理数据,有效将像素数据转化为实际物理数据,进一步的,利用物理数据对触摸手势进行进一步的识别,有效解决了设置单一像素阈值识别手势不准确的问题,防止在判断手势时出现较大误差,有效提升了触摸手势识别的准确率。
The present application provides a gesture recognition method and related equipment. The method includes: acquiring the number of touch points on the touch screen, and acquiring pixel data of the touch points according to the number of touch points; The physical parameters of the touch screen and the acquired resolution of the touch screen are calculated to obtain the physical data of the touch point; according to the physical data of the touch point and a preset threshold, the gesture corresponding to the touch point is obtained. The embodiment of the present application calculates the physical data of the touch point through the obtained pixel data and the physical data and resolution of the touch screen, and effectively converts the pixel data into actual physical data. Further, the physical data is used to further perform touch gesture Recognition effectively solves the problem of inaccurate recognition of gestures by setting a single pixel threshold, prevents large errors in judging gestures, and effectively improves the accuracy of touch gesture recognition.
Description
技术领域technical field
本申请涉及手势识别技术领域,尤其涉及一种手势识别方法及相关设备。The present application relates to the technical field of gesture recognition, in particular to a gesture recognition method and related equipment.
背景技术Background technique
在使用触摸屏时,手势操作对于用户来说非常方便。手势是否形成的判断一般是通过分析用户多指移动轨迹和速度以及接触面积等信息进行的,由于应用软件获取到用户触控数据是基于像素值的,因此手势一般是基于像素值进行处理判断的。但在基于像素值进行手势判断时,就需要设置以像素为单位的判断条件,而触摸屏可以设置不同的分辨率,并且触摸屏屏本身也有多种尺寸,这就会导致同样的手指操作,在不同的分辨率或不同尺寸的触摸屏上得到的像素值不同,进行手势判断时,就容易出现像素值误差过大,导致有些手势无法触发或者被误触发的情况。Gesture operation is very convenient for users when using a touch screen. The judgment of whether a gesture is formed is generally carried out by analyzing information such as the trajectory and speed of the user's multiple fingers, and the contact area. Since the user's touch data obtained by the application software is based on pixel values, gestures are generally processed and judged based on pixel values. . However, when judging gestures based on pixel values, it is necessary to set the judgment conditions in units of pixels, and the touch screen can be set to different resolutions, and the touch screen itself also has a variety of sizes, which will lead to the same finger operation, in different The pixel values obtained on touch screens with different resolutions or different sizes are different. When performing gesture judgment, the pixel value error is prone to be too large, resulting in situations where some gestures cannot be triggered or are triggered by mistake.
发明内容Contents of the invention
有鉴于此,本申请的目的在于提出一种手势识别方法及相关设备。In view of this, the purpose of this application is to propose a gesture recognition method and related equipment.
基于上述目的,本申请提供了一种手势识别方法,包括:Based on the above purpose, the application provides a gesture recognition method, including:
获取对触摸屏的触摸点的个数,根据所述触摸点的个数,获取触摸点的像素数据;Obtain the number of touch points on the touch screen, and obtain pixel data of the touch points according to the number of touch points;
根据所述触摸点的个数、所述触摸点的像素数据、获取的触摸屏的物理参数和获取的触摸屏的分辨率,计算得到所述触摸点的物理数据;Calculate and obtain the physical data of the touch points according to the number of the touch points, the pixel data of the touch points, the acquired physical parameters of the touch screen, and the acquired resolution of the touch screen;
根据所述触摸点的物理数据与预设阈值,得到所述触摸点对应的手势。A gesture corresponding to the touch point is obtained according to the physical data of the touch point and a preset threshold.
在一种可能的实现方式中,所述触摸点的个数为一,所述触摸点的像素数据包括:所述触摸点的触摸面积的最大像素宽度值、所述触摸点的触摸面积的最大像素高度值。In a possible implementation manner, the number of the touch point is one, and the pixel data of the touch point includes: the maximum pixel width value of the touch area of the touch point, the maximum value of the touch area of the touch point Pixel height value.
在一种可能的实现方式中,所述触摸屏的物理参数包括:所述触摸屏的物理宽度值和所述触摸屏的物理高度值;In a possible implementation manner, the physical parameters of the touch screen include: a physical width value of the touch screen and a physical height value of the touch screen;
所述触摸屏的分辨率包括:所述触摸屏的分辨率宽度和所述触摸屏的分辨率高度;The resolution of the touch screen includes: the resolution width of the touch screen and the resolution height of the touch screen;
所述触摸点的物理数据包括:所述触摸点的物理最大宽度值和所述触摸点的物理最大高度值;The physical data of the touch point includes: a physical maximum width value of the touch point and a physical maximum height value of the touch point;
所述根据所述触摸点的个数、所述触摸点的像素数据、获取的触摸屏的物理参数和获取的触摸屏的分辨率,计算得到所述触摸点的物理数据,包括:The calculation of the physical data of the touch points according to the number of the touch points, the pixel data of the touch points, the obtained physical parameters of the touch screen and the obtained resolution of the touch screen includes:
根据所述触摸点的触摸面积的最大像素宽度值、所述触摸屏的物理宽度值和所述触摸屏的分辨率宽度,计算得到所述触摸点的物理最大宽度值;Calculate the physical maximum width value of the touch point according to the maximum pixel width value of the touch area of the touch point, the physical width value of the touch screen, and the resolution width of the touch screen;
根据所述触摸面积的最大像素高度值、所述触摸屏的物理高度值和所述触摸屏的分辨率高度,计算得到所述触摸点的物理最大高度值。The physical maximum height value of the touch point is calculated according to the maximum pixel height value of the touch area, the physical height value of the touch screen, and the resolution height of the touch screen.
在一种可能的实现方式中,所述触摸点的个数大于一,所述触摸点的像素数据包括:所述触摸点的中心像素点的像素横坐标值和所述触摸点的中心像素点的像素纵坐标值;所述中心像素点位于所述触摸点对应的触摸面积的中心点。In a possible implementation manner, the number of the touch points is greater than one, and the pixel data of the touch points includes: the pixel abscissa value of the central pixel of the touch point and the central pixel of the touch point The pixel ordinate value; the center pixel point is located at the center point of the touch area corresponding to the touch point.
在一种可能的实现方式中,所述触摸屏的物理参数包括:所述触摸屏的物理宽度值和所述触摸屏的物理高度值;In a possible implementation manner, the physical parameters of the touch screen include: a physical width value of the touch screen and a physical height value of the touch screen;
所述触摸屏的分辨率包括:所述触摸屏的分辨率宽度和所述触摸屏的分辨率高度;The resolution of the touch screen includes: the resolution width of the touch screen and the resolution height of the touch screen;
所述触摸点的物理数据包括所述触摸点的物理横坐标值和所述触摸点的物理纵坐标值;The physical data of the touch point includes a physical abscissa value of the touch point and a physical ordinate value of the touch point;
其中,所述根据所述触摸点的个数、所述触摸点的像素数据、获取的触摸屏的物理参数和获取的触摸屏的分辨率,计算得到所述触摸点的物理数据,包括:Wherein, the calculation of the physical data of the touch points according to the number of the touch points, the pixel data of the touch points, the obtained physical parameters of the touch screen and the obtained resolution of the touch screen includes:
根据所述触摸点的中心像素点的像素横坐标值、所述触摸屏的物理宽度值和所述触摸屏的分辨率宽度,计算得到所述触摸点的物理横坐标值;Calculate the physical abscissa value of the touch point according to the pixel abscissa value of the central pixel point of the touch point, the physical width value of the touch screen, and the resolution width of the touch screen;
根据所述触摸点的中心像素点的像素纵坐标值、所述触摸屏的物理高度值和所述触摸屏的分辨率高度,计算得到所述触摸点的物理纵坐标值;Calculate the physical ordinate value of the touch point according to the pixel ordinate value of the central pixel point of the touch point, the physical height value of the touch screen, and the resolution height of the touch screen;
在一种可能的实现方式中,所述触摸点对应的手势包括:手背擦除、正常书写和细笔书写;所述预设阈值包括:第一阈值和第二阈值;所述第二阈值小于所述第一阈值;In a possible implementation manner, the gestures corresponding to the touch point include: erasing on the back of the hand, normal writing, and writing with a fine pen; the preset threshold includes: a first threshold and a second threshold; the second threshold is less than said first threshold;
其中,所述根据所述触摸点的物理数据与预设阈值,得到所述触摸点对应的手势,包括:Wherein, the obtaining the gesture corresponding to the touch point according to the physical data of the touch point and a preset threshold includes:
任一所述触摸点的物理数据大于所述第一阈值时,得到所述触摸点对应的手势为手背擦除;When the physical data of any of the touch points is greater than the first threshold, it is obtained that the gesture corresponding to the touch point is erasing the back of the hand;
所有所述触摸点的物理数据小于所述第一阈值且任一所述触摸点的物理数据大于所述第二阈值时,得到所述触摸点对应的手势为正常书写;When the physical data of all the touch points is less than the first threshold and the physical data of any of the touch points is greater than the second threshold, it is obtained that the gesture corresponding to the touch point is normal writing;
所有所述触摸点的物理数据均小于所述第二阈值时,得到所述触摸点对应的手势为细笔书写。When the physical data of all the touch points are smaller than the second threshold, it is obtained that the gesture corresponding to the touch point is writing with a fine pen.
在一种可能的实现方式中,所述触摸点对应的手势包括:两指缩放旋转、两指平移和五指擦除;所述预设阈值包括:第三阈值和第四阈值;将所述触摸点的物理横坐标和所述触摸点的物理纵坐标作为所述触摸点的物理坐标;In a possible implementation manner, the gestures corresponding to the touch point include: zooming and rotating with two fingers, panning with two fingers, and erasing with five fingers; the preset thresholds include: a third threshold and a fourth threshold; The physical abscissa of the point and the physical ordinate of the touch point are used as the physical coordinates of the touch point;
其中,所述根据所述触摸点的物理数据与预设阈值,得到所述触摸点对应的手势,包括:Wherein, the obtaining the gesture corresponding to the touch point according to the physical data of the touch point and a preset threshold includes:
所述触摸点的个数为二时,计算两个所述触摸点的第一物理间距;When the number of the touch points is two, calculate the first physical distance between the two touch points;
所述第一物理间距大于所述第三阈值时,得到所述触摸点对应的手势为两指缩放旋转;When the first physical distance is greater than the third threshold, the gesture corresponding to the touch point is two-finger zooming and rotating;
所述第一物理间距小于所述第三阈值时,得到所述触摸点对应的手势为两指平移;When the first physical distance is smaller than the third threshold, it is obtained that the gesture corresponding to the touch point is two-finger translation;
所述触摸点的个数为五时,计算每两个相邻触摸点的物理坐标间的第二物理间距;When the number of the touch points is five, calculate the second physical distance between the physical coordinates of every two adjacent touch points;
所有所述第二物理间距均小于所述第四阈值时,得到所述触摸点对应的手势为五指擦除。When all the second physical distances are smaller than the fourth threshold, it is obtained that the gesture corresponding to the touch point is five-finger erasing.
在一种可能的实现方式中,所述预设阈值能够根据所述物理数据自动调节。In a possible implementation manner, the preset threshold can be automatically adjusted according to the physical data.
基于同一发明构思,本申请实施例还提供了一种手势识别装置,包括:Based on the same inventive concept, the embodiment of the present application also provides a gesture recognition device, including:
获取模块,被配置为获取对触摸屏的触摸点的个数,根据所述触摸点的个数,获取触摸点的像素数据;An acquisition module configured to acquire the number of touch points on the touch screen, and acquire pixel data of the touch points according to the number of touch points;
计算模块,被配置为根据所述触摸点的个数、所述触摸点的像素数据、获取的触摸屏的物理参数和获取的触摸屏的分辨率,计算得到所述触摸点的物理数据;The calculation module is configured to calculate the physical data of the touch points according to the number of the touch points, the pixel data of the touch points, the acquired physical parameters of the touch screen and the acquired resolution of the touch screen;
判断模块,被配置为根据所述触摸点的物理数据与预设阈值,得到所述触摸点对应的手势。The judging module is configured to obtain the gesture corresponding to the touch point according to the physical data of the touch point and a preset threshold.
在一种可能的实现方式中,所述触摸点的个数为一,所述触摸点的像素数据包括:所述触摸点的触摸面积的最大像素宽度值、所述触摸点的触摸面积的最大像素高度值。In a possible implementation manner, the number of the touch point is one, and the pixel data of the touch point includes: the maximum pixel width value of the touch area of the touch point, the maximum value of the touch area of the touch point Pixel height value.
在一种可能的实现方式中,所述触摸屏的物理参数包括:所述触摸屏的物理参数包括:所述触摸屏的物理宽度值和所述触摸屏的物理高度值;In a possible implementation manner, the physical parameters of the touch screen include: the physical parameters of the touch screen include: a physical width value of the touch screen and a physical height value of the touch screen;
所述触摸屏的分辨率包括:所述触摸屏的分辨率宽度和所述触摸屏的分辨率高度;The resolution of the touch screen includes: the resolution width of the touch screen and the resolution height of the touch screen;
所述触摸点的物理数据包括:所述触摸点的物理最大宽度值和所述触摸点的物理最大高度值;The physical data of the touch point includes: a physical maximum width value of the touch point and a physical maximum height value of the touch point;
所述计算模块进一步被配置为:The computing module is further configured to:
根据所述触摸点的触摸面积的最大像素宽度值、所述触摸屏的物理宽度值和所述触摸屏的分辨率宽度,计算得到所述触摸点的物理最大宽度值;Calculate the physical maximum width value of the touch point according to the maximum pixel width value of the touch area of the touch point, the physical width value of the touch screen, and the resolution width of the touch screen;
根据所述触摸面积的最大像素高度值、所述触摸屏的物理高度值和所述触摸屏的分辨率高度,计算得到所述触摸点的物理最大高度值。The physical maximum height value of the touch point is calculated according to the maximum pixel height value of the touch area, the physical height value of the touch screen, and the resolution height of the touch screen.
在一种可能的实现方式中,所述触摸点的个数大于一,所述触摸点的像素数据包括:所述触摸点的中心像素点的像素横坐标值和所述触摸点的中心像素点的像素纵坐标值;所述中心像素点位于所述触摸点对应的触摸面积的中心点。In a possible implementation manner, the number of the touch points is greater than one, and the pixel data of the touch points includes: the pixel abscissa value of the central pixel of the touch point and the central pixel of the touch point The pixel ordinate value; the center pixel point is located at the center point of the touch area corresponding to the touch point.
在一种可能的实现方式中,In one possible implementation,
所述触摸屏的物理参数包括:所述触摸屏的物理宽度值和所述触摸屏的物理高度值;The physical parameters of the touch screen include: the physical width value of the touch screen and the physical height value of the touch screen;
所述触摸屏的分辨率包括:所述触摸屏的分辨率宽度和所述触摸屏的分辨率高度;The resolution of the touch screen includes: the resolution width of the touch screen and the resolution height of the touch screen;
所述触摸点的物理数据包括所述触摸点的物理横坐标值和所述触摸点的物理纵坐标值;The physical data of the touch point includes a physical abscissa value of the touch point and a physical ordinate value of the touch point;
所述计算模块进一步被配置为:The computing module is further configured to:
根据所述触摸点的中心像素点的像素横坐标值、所述触摸屏的物理宽度值和所述触摸屏的分辨率宽度,计算得到所述触摸点的物理横坐标值;Calculate the physical abscissa value of the touch point according to the pixel abscissa value of the central pixel point of the touch point, the physical width value of the touch screen, and the resolution width of the touch screen;
根据所述触摸点的中心像素点的像素纵坐标值、所述触摸屏的物理高度值和所述触摸屏的分辨率高度,计算得到所述触摸点的物理纵坐标值;Calculate the physical ordinate value of the touch point according to the pixel ordinate value of the central pixel point of the touch point, the physical height value of the touch screen, and the resolution height of the touch screen;
在一种可能的实现方式中,所述触摸点对应的手势包括:手背擦除、正常书写和细笔书写;所述预设阈值包括:第一阈值和第二阈值;所述第二阈值小于所述第一阈值;In a possible implementation manner, the gestures corresponding to the touch point include: erasing on the back of the hand, normal writing, and writing with a fine pen; the preset threshold includes: a first threshold and a second threshold; the second threshold is less than said first threshold;
所述判断模块进一步被配置为:The judging module is further configured to:
任一所述触摸点的物理数据大于所述第一阈值时,得到所述触摸点对应的手势为手背擦除;When the physical data of any of the touch points is greater than the first threshold, it is obtained that the gesture corresponding to the touch point is erasing the back of the hand;
所有所述触摸点的物理数据小于所述第一阈值且任一所述触摸点的物理数据大于所述第二阈值时,得到所述触摸点对应的手势为正常书写;When the physical data of all the touch points is less than the first threshold and the physical data of any of the touch points is greater than the second threshold, it is obtained that the gesture corresponding to the touch point is normal writing;
所有所述触摸点的物理数据均小于所述第二阈值时,得到所述触摸点对应的手势为细笔书写。When the physical data of all the touch points are smaller than the second threshold, it is obtained that the gesture corresponding to the touch point is writing with a fine pen.
在一种可能的实现方式中,所述触摸点对应的手势包括:两指缩放旋转、两指平移和五指擦除;所述预设阈值包括:第三阈值和第四阈值;将所述触摸点的物理横坐标和所述触摸点的物理纵坐标作为所述触摸点的物理坐标;In a possible implementation manner, the gestures corresponding to the touch point include: zooming and rotating with two fingers, panning with two fingers, and erasing with five fingers; the preset thresholds include: a third threshold and a fourth threshold; The physical abscissa of the point and the physical ordinate of the touch point are used as the physical coordinates of the touch point;
所述判断模块进一步被配置为:The judging module is further configured to:
所述触摸点的个数为二时,计算两个所述触摸点的第一物理间距;When the number of the touch points is two, calculate the first physical distance between the two touch points;
所述第一物理间距大于所述第三阈值时,得到所述触摸点对应的手势为两指缩放旋转;When the first physical distance is greater than the third threshold, the gesture corresponding to the touch point is two-finger zooming and rotating;
所述第一物理间距小于所述第三阈值时,得到所述触摸点对应的手势为两指平移;When the first physical distance is smaller than the third threshold, it is obtained that the gesture corresponding to the touch point is two-finger translation;
所述触摸点的个数为五时,计算每两个相邻触摸点的物理坐标间的第二物理间距;When the number of the touch points is five, calculate the second physical distance between the physical coordinates of every two adjacent touch points;
所有所述第二物理间距均小于所述第四阈值时,得到所述触摸点对应的手势为五指擦除。When all the second physical distances are smaller than the fourth threshold, it is obtained that the gesture corresponding to the touch point is five-finger erasing.
在一种可能的实现方式中,所述预设阈值能够根据所述物理数据自动调节。In a possible implementation manner, the preset threshold can be automatically adjusted according to the physical data.
基于同一发明构思,本申请实施例还提供了一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如上述任意一项所述的手势识别方法。Based on the same inventive concept, an embodiment of the present application also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and operable on the processor. When the processor executes the program, the above-mentioned Any one of the gesture recognition methods.
从上面所述可以看出,本申请提供的手势识别方法及相关设备,获取对触摸屏的触摸点的个数,根据所述触摸点的个数,获取触摸点的像素数据;根据所述触摸点的个数、所述触摸点的像素数据、获取的触摸屏的物理参数和获取的触摸屏的分辨率,计算得到所述触摸点的物理数据;根据所述触摸点的物理数据与预设阈值,得到所述触摸点对应的手势。本申请有效将触摸动作对应的像素数据转化为实际的物理数据,再利用实际的物理数据对触摸动作对应的手势做进一步的识别,有效防止在判断手势时出现较大误差,有效提升了对于手势的判断精度。As can be seen from the above, the gesture recognition method and related equipment provided by the present application obtain the number of touch points on the touch screen, and obtain the pixel data of the touch points according to the number of the touch points; The number of the touch point, the pixel data of the touch point, the acquired physical parameters of the touch screen and the resolution of the acquired touch screen are calculated to obtain the physical data of the touch point; according to the physical data of the touch point and the preset threshold value, the obtained The gesture corresponding to the touch point. This application effectively converts the pixel data corresponding to the touch action into actual physical data, and then uses the actual physical data to further identify the gesture corresponding to the touch action, effectively preventing large errors in judging gestures, and effectively improving the accuracy of gestures. judgment accuracy.
附图说明Description of drawings
为了更清楚地说明本申请或相关技术中的技术方案,下面将对实施例或相关技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the present application or related technologies, the following will briefly introduce the accompanying drawings that need to be used in the description of the embodiments or related technologies. Obviously, the accompanying drawings in the following description are only for this application Embodiments, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.
图1为本申请实施例的手势识别方法流程图;FIG. 1 is a flowchart of a gesture recognition method according to an embodiment of the present application;
图2为本申请实施例的手势识别装置示意图;FIG. 2 is a schematic diagram of a gesture recognition device according to an embodiment of the present application;
图3为本申请实施例的电子设备结构示意图。FIG. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
具体实施方式Detailed ways
为使本申请的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本申请进一步详细说明。In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings.
需要说明的是,除非另外定义,本申请实施例使用的技术术语或者科学术语应当为本申请所属领域内具有一般技能的人士所理解的通常意义。本申请实施例中使用的“第一”、“第二”以及类似的词语并不表示任何顺序、数量或者重要性,而只是用来区分不同的组成部分。“包括”或者“包含”等类似的词语意指出现该词前面的元件或者物件涵盖出现在该词后面列举的元件或者物件及其等同,而不排除其他元件或者物件。“连接”或者“相连”等类似的词语并非限定于物理的或者机械的连接,而是可以包括电性的连接,不管是直接的还是间接的。“上”、“下”、“左”、“右”等仅用于表示相对位置关系,当被描述对象的绝对位置改变后,则该相对位置关系也可能相应地改变。It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application shall have the usual meanings understood by those skilled in the art to which the present application belongs. "First", "second" and similar words used in the embodiments of the present application do not indicate any order, quantity or importance, but are only used to distinguish different components. "Comprising" or "comprising" and similar words mean that the elements or items appearing before the word include the elements or items listed after the word and their equivalents, without excluding other elements or items. Words such as "connected" or "connected" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "Down", "Left", "Right" and so on are only used to indicate the relative positional relationship. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
如背景技术部分所述,相关技术中的手势识别的技术方案,一般是基于像素值来识别的,但在基于像素值进行手势判断时,就需要设置以像素为单位的判断条件,而由于触摸屏可以设置不同的分辨率,并且触摸屏其本身也具有多种尺寸,这就会导致,在相同的手指操作情况之下,在不同的分辨率或不同尺寸的触摸屏上最终响应的像素值不同,这就会导致在后续根据上述响应出的像素值对手势进行判断时,出现像素值误差过大的情况,导致无法识别正确的手势。As mentioned in the background technology section, the technical solutions of gesture recognition in the related art are generally recognized based on pixel values, but when performing gesture judgment based on pixel values, it is necessary to set judgment conditions in units of pixels, and because the touch screen Different resolutions can be set, and the touch screen itself has multiple sizes, which will lead to different pixel values in the final response on touch screens with different resolutions or different sizes under the same finger operation. As a result, when the gesture is subsequently judged based on the pixel value of the above response, the error of the pixel value is too large, resulting in the inability to recognize the correct gesture.
综合上述考虑,本申请实施例提出一种手势识别方法,根据获取的对触摸屏的触摸点的个数,获取得到像素数据;根据所述像素数据、获取的触摸屏的物理参数和获取的触摸屏的分辨率,计算得到对应的所述触摸点的物理数据;根据所述物理数据与预设阈值的大小关系,得到所述触摸点对应的手势,从而能够有效的将在不同尺寸不同分辨率的触摸屏上的触摸动作所对应的像素值,以实际的物理尺寸来度量,基于该实际的物理尺寸,可以对触摸动作进行精确的判断,以精确识别出其所对应的手势。Based on the above considerations, the embodiment of the present application proposes a gesture recognition method, which obtains pixel data according to the obtained number of touch points on the touch screen; according to the pixel data, the obtained physical parameters of the touch screen and the obtained resolution of the touch screen rate, and calculate the corresponding physical data of the touch point; according to the size relationship between the physical data and the preset threshold, the gesture corresponding to the touch point can be obtained, so that the gesture can be effectively displayed on touch screens with different sizes and different resolutions. The pixel value corresponding to the touch action is measured by the actual physical size. Based on the actual physical size, the touch action can be accurately judged to accurately identify the corresponding gesture.
以下,通过具体的实施例来说明本申请实施例的技术方案。The technical solutions of the embodiments of the present application are described below through specific embodiments.
参考图1,本申请实施例的手势识别方法,包括以下步骤:With reference to Fig. 1, the gesture recognition method of the embodiment of the present application comprises the following steps:
步骤S101,获取对触摸屏的触摸点的个数,根据所述触摸点的个数,获取触摸点的像素数据;Step S101, obtaining the number of touch points on the touch screen, and obtaining pixel data of the touch points according to the number of touch points;
步骤S102,根据所述触摸点的个数、所述触摸点的像素数据、获取的触摸屏的物理参数和获取的触摸屏的分辨率,计算得到所述触摸点的物理数据;Step S102, calculating the physical data of the touch points according to the number of the touch points, the pixel data of the touch points, the acquired physical parameters of the touch screen and the acquired resolution of the touch screen;
步骤S103,根据所述触摸点的物理数据与预设阈值,得到所述触摸点对应的手势。Step S103, according to the physical data of the touch point and the preset threshold, the gesture corresponding to the touch point is obtained.
针对步骤S101,首先获取触摸屏的物理参数和触摸屏的分辨率,之后应当获取对触摸屏的触摸点的个数,对应的获取该触摸点对应的像素数据。For step S101 , first obtain the physical parameters of the touch screen and the resolution of the touch screen, and then obtain the number of touch points on the touch screen, and correspondingly obtain the pixel data corresponding to the touch points.
下述以触摸点的个数为一时为例,该触摸点对应的像素数据为触摸面积的最大像素宽度值和最大像素高度值。在一般情况下,用户使用手指或手背对触摸屏进行触摸时,形成的触摸面积为不规则图形,因此直接取该不规则图形的最大像素宽度和最大像素高度,在保证准确性的情况下,有效节省了二次计算的步骤。In the following, when the number of touch points is one as an example, the pixel data corresponding to the touch point is the maximum pixel width value and maximum pixel height value of the touch area. In general, when the user touches the touch screen with a finger or the back of the hand, the touch area formed is an irregular figure, so the maximum pixel width and maximum pixel height of the irregular figure are directly taken, and the accuracy is guaranteed. The steps of secondary calculation are saved.
进一步的,针对步骤S102,根据前述获取到的触摸屏的物理参数和触摸屏的分辨率,结合触摸点的像素数据,计算得到该触摸点的物理数据。具体的,获取到的触摸屏的物理参数包括触摸屏的物理宽度值和物理高度值,触摸屏的分辨率包括触摸屏的分辨率宽度和触摸屏的分辨率高度。进一步的,根据上述的触摸面积的最大宽度值、触摸屏的物理宽度值和触摸屏的分辨率宽度,计算得到触摸点的物理宽度值,触摸点的物理宽度值即触摸点对应的触摸面积的实际物理尺寸。Further, for step S102, the physical data of the touch point is calculated according to the acquired physical parameters of the touch screen and the resolution of the touch screen, combined with the pixel data of the touch point. Specifically, the acquired physical parameters of the touch screen include a physical width value and a physical height value of the touch screen, and the resolution of the touch screen includes a resolution width of the touch screen and a resolution height of the touch screen. Further, according to the above-mentioned maximum width value of the touch area, the physical width value of the touch screen and the resolution width of the touch screen, the physical width value of the touch point is calculated, and the physical width value of the touch point is the actual physical width value of the touch area corresponding to the touch point. size.
具体的,通过下述公式计算所述触摸点的物理宽度值:Specifically, the physical width value of the touch point is calculated by the following formula:
其中,Wp表示触摸点的物理宽度值,Pw表示最大像素宽度值,Ws表示触摸屏的物理宽度值,Dw表示触摸屏的分辨率宽度值。Wherein, W p represents the physical width value of the touch point, P w represents the maximum pixel width value, W s represents the physical width value of the touch screen, and D w represents the resolution width value of the touch screen.
进一步的,根据上述的触摸面积的最大像素高度值、触摸屏的物理高度值和触摸屏的分辨率高度,计算得到触摸点的物理高度值,触摸点的物理高度值即触摸点对应的触摸面积的实际物理尺寸。Further, according to the above-mentioned maximum pixel height value of the touch area, the physical height value of the touch screen, and the resolution height of the touch screen, the physical height value of the touch point is calculated, and the physical height value of the touch point is the actual touch area corresponding to the touch point. physical size.
具体的,通过下述公式计算所述触摸点的物理高度值:Specifically, the physical height value of the touch point is calculated by the following formula:
其中,Hp表示触摸点的物理高度值,Ph表示最大像素高度值,Hs表示触摸屏的物理高度值,Dh表示触摸屏的分辨率高度值。Among them, H p represents the physical height value of the touch point, Ph represents the maximum pixel height value, H s represents the physical height value of the touch screen, and D h represents the resolution height value of the touch screen.
当获取到上述触摸点的物理宽度值和触摸点的物理高度值后,进一步的,针对步骤S103,需要根据所述触摸点的物理数据与预设阈值,得到所述触摸点对应的手势。上述触摸点的物理数据在本实施例中为触摸点对应的触摸面积的物理宽度值和物理高度值,预设阈值包括第一阈值和第二阈值,第二阈值小于第一阈值。After the physical width value and the physical height value of the touch point are acquired, further, for step S103, it is necessary to obtain the gesture corresponding to the touch point according to the physical data of the touch point and a preset threshold. In this embodiment, the physical data of the touch point is the physical width value and the physical height value of the touch area corresponding to the touch point, and the preset threshold value includes a first threshold value and a second threshold value, and the second threshold value is smaller than the first threshold value.
具体的,当触摸点的物理宽度值和触摸点的物理高度值中的任意一个值大于第一阈值时,得到该触摸点对应的手势为手背擦除,当触摸点的物理宽度值和触摸点的物理高度值均小于第一阈值且触摸点的物理宽度值和触摸点的物理高度值中的任意一个大于第二阈值时,得到该触摸点对应的手势操作是正常书写,当触摸点的物理宽度值和触摸点的物理高度值均小于第二阈值时,得到该触摸点对应的手势操作是细笔书写。Specifically, when any one of the physical width value of the touch point and the physical height value of the touch point is greater than the first threshold, the gesture corresponding to the touch point is obtained as the back of the hand, and when the physical width value of the touch point and the touch point When the physical height value of the touch point is less than the first threshold and any one of the physical width value of the touch point and the physical height value of the touch point is greater than the second threshold value, it is obtained that the gesture operation corresponding to the touch point is normal writing. When both the width value and the physical height value of the touch point are smaller than the second threshold, it is obtained that the gesture operation corresponding to the touch point is writing with a fine pen.
需要注意的是,上述实施例中涉及的第一阈值和第二阈值可以根据需求自行设定,且也可以在用户的使用过程中进行自动调节,具体的自动调节的技术方案本领域技术人员应当可以根据本领域技术进行适应性调整后实现,故在此不再赘述。It should be noted that the first threshold and the second threshold involved in the above embodiments can be set according to requirements, and can also be automatically adjusted during the user's use. The specific automatic adjustment technical solution should be understood by those skilled in the art It can be implemented after adaptive adjustment according to the technology in the art, so details will not be repeated here.
在一可选的实施例中,触摸屏的大小为60英寸,对应的触摸屏的物理宽度值为1328毫米,触摸屏的物理高度值为747毫米,触摸屏的分辨率为3840*2160,对应的触摸屏的分辨率宽度值为3840像素,触摸屏的分辨率高度值为2160像素,预设的第一阈值为40毫米,第二阈值为5毫米。此时触摸点的个数为一,获取该触摸点对应的接触面积的最大像素高度值为144像素,最大像素宽度值为160像素,对应的,求得该触摸点的物理高度值为49.8毫米,触摸点的物理宽度值为55.2毫米,进一步的,判断后可知前述求得的触摸点的物理高度值和触摸点的物理宽度值均大于40毫米,可知,手势为手背擦除。In an optional embodiment, the size of the touch screen is 60 inches, the corresponding physical width of the touch screen is 1328 mm, the physical height of the touch screen is 747 mm, the resolution of the touch screen is 3840*2160, and the resolution of the corresponding touch screen The resolution width value is 3840 pixels, the resolution height value of the touch screen is 2160 pixels, the preset first threshold value is 40 mm, and the second threshold value is 5 mm. At this time, the number of touch points is one, and the maximum pixel height value of the contact area corresponding to the touch point is 144 pixels, and the maximum pixel width value is 160 pixels. Correspondingly, the physical height value of the touch point is 49.8 mm , the physical width value of the touch point is 55.2 mm. Further, after the judgment, it can be seen that the above-mentioned obtained physical height value and physical width value of the touch point are both greater than 40 mm. It can be seen that the gesture is erasing the back of the hand.
在另一可选的实施例中,在同一触摸条件下,将触摸屏的大小改为96英寸,对应的触摸屏的物理宽度值为2162毫米,触摸屏的物理高度值为1217毫米,触摸屏的分辨率为1920*1080,对应的触摸屏的分辨率宽度为1920,分辨率高度为1080。获取的该触摸点对应的接触面积的最大像素高度值为44像素,最大像素宽度值为49像素,与上述实施例进行对比可见,在触摸屏的实际物理尺寸和分辨率大小不同的情况下,同一手势对应的像素值的变化非常大,显而易见的,利用像素值对手势进行判断会引入很大的误差,而利用本申请的技术方案,将像素值转化为实际的物理尺寸,无论触摸屏的大小和像素值如何变化,实际触摸面积的物理尺寸都不会变化,有效的降低了手势识别的误差。In another optional embodiment, under the same touch condition, the size of the touch screen is changed to 96 inches, the corresponding physical width value of the touch screen is 2162 mm, the physical height value of the touch screen is 1217 mm, and the resolution of the touch screen is 1920*1080, the corresponding touch screen resolution width is 1920, resolution height is 1080. The obtained maximum pixel height value of the contact area corresponding to the touch point is 44 pixels, and the maximum pixel width value is 49 pixels. Compared with the above-mentioned embodiment, it can be seen that when the actual physical size and resolution of the touch screen are different, the same The change of the pixel value corresponding to the gesture is very large. Obviously, using the pixel value to judge the gesture will introduce a large error, but using the technical solution of this application, the pixel value is converted into the actual physical size, regardless of the size and size of the touch screen. No matter how the pixel value changes, the physical size of the actual touch area will not change, which effectively reduces the error of gesture recognition.
需要注意的是,上述实施例仅本实施例仅以触摸点为一点时的一部分手势作为示例,本领域技术人员可以无疑义的将本申请的技术方案应用于触摸点为单点时的其他手势识别,识别过程中对于该触摸点从像素数据转换到物理数据的步骤可以与上述步骤相同,本领域技术人员也可以自行设置阈值以限制其他手势的识别情况。It should be noted that, the above-mentioned embodiment only uses a part of the gesture when the touch point is a single point as an example in this embodiment, and those skilled in the art can undoubtedly apply the technical solution of this application to other gestures when the touch point is a single point Recognition, the step of converting the touch point from pixel data to physical data in the recognition process can be the same as the above steps, and those skilled in the art can also set thresholds by themselves to limit the recognition of other gestures.
在一可选的实施例中,以触摸点的个数为二为例,在上述已经获取触摸屏的物理参数和触摸屏的分辨率的基础之上,获取每一个上述两个触摸点的中心像素点的像素坐标值,触摸点的中心像素位于触摸点对应的触摸面积的中心点,即将触摸面积高度方向上的中线和触摸面积宽度方向上的中线的交点,记为中心像素点。上述中心像素点的像素坐标值包括中心像素点的像素横坐标值和中心像素点的像素纵坐标值,在求得中心像素点的像素坐标值后,根据中心像素点的像素横坐标值、触摸屏的物理宽度值和所述触摸屏的分辨率宽度,计算得到触摸点的物理横坐标值。In an optional embodiment, taking the number of touch points as two as an example, on the basis of the physical parameters of the touch screen and the resolution of the touch screen that have been obtained above, the center pixel of each of the above two touch points is obtained The pixel coordinate value of the touch point, the center pixel of the touch point is located at the center point of the touch area corresponding to the touch point, that is, the intersection of the center line in the height direction of the touch area and the center line in the width direction of the touch area is recorded as the center pixel point. The pixel coordinate value of the above-mentioned center pixel point comprises the pixel abscissa value of the center pixel point and the pixel ordinate value of the center pixel point. After obtaining the pixel coordinate value of the center pixel point, according to the pixel abscissa value of the center pixel point, the touch screen The physical width value of the touch screen and the resolution width of the touch screen are calculated to obtain the physical abscissa value of the touch point.
具体的,通过下式计算所述触摸点的物理横坐标值:Specifically, the physical abscissa value of the touch point is calculated by the following formula:
其中,X表示触摸点的物理横坐标值,Px表示中心像素点的像素横坐标值,Ws表示触摸屏的物理宽度值,Dw表示触摸屏的分辨率宽度值。Wherein, X represents the physical abscissa value of the touch point, P x represents the pixel abscissa value of the central pixel point, W s represents the physical width value of the touch screen, and D w represents the resolution width value of the touch screen.
进一步的,根据所述中心像素点的像素纵坐标值、所述触摸屏的物理高度值和所述触摸屏的分辨率高度,计算得到所述触摸点的物理纵坐标值。Further, the physical ordinate value of the touch point is calculated according to the pixel ordinate value of the central pixel point, the physical height value of the touch screen, and the resolution height of the touch screen.
具体的,通过下式计算所述触摸点的物理纵坐标值:Specifically, the physical ordinate value of the touch point is calculated by the following formula:
其中,Y表示触摸点的物理纵坐标值,Py表示中心像素点的像素纵坐标值,Hs表示触摸屏的物理高度值,Dh表示触摸屏的分辨率高度值。Wherein, Y represents the physical ordinate value of the touch point, P y represents the pixel ordinate value of the central pixel point, H s represents the physical height value of the touch screen, and D h represents the resolution height value of the touch screen.
在求得两个触摸点对应的物理坐标值后,计算两个触摸点之间的第一物理间距,预设阈值为第三阈值。可以采用任意方法计算第一物理间距,所谓的第一物理间距即两个触摸点对应的中心像素点之间的直线距离,具体计算过程在此不再赘述,本领域技术人员应当知晓。进一步的,判断该第一物理间距与第三阈值之间的大小关系,一般而言,做平移操作时,两指的距离较近,做缩放旋转操作时,两指的距离较远,故当第一物理间距大于第三阈值时,得到触摸点对应的手势为两指缩放旋转,当第一物理间距小于第三阈值时,得到触摸点对应的手势为两指平移。After the physical coordinate values corresponding to the two touch points are obtained, the first physical distance between the two touch points is calculated, and the preset threshold is the third threshold. Any method can be used to calculate the first physical distance. The so-called first physical distance is the linear distance between the central pixels corresponding to two touch points. The specific calculation process will not be repeated here, and those skilled in the art should know it. Further, the size relationship between the first physical distance and the third threshold is judged. Generally speaking, when performing translation operations, the distance between the two fingers is relatively short, and when performing zoom and rotation operations, the distance between the two fingers is relatively long, so when When the first physical distance is greater than the third threshold, the gesture corresponding to the touch point is two-finger zooming and rotation; when the first physical distance is smaller than the third threshold, the gesture corresponding to the touch point is two-finger translation.
同样的,如上述实施例中需要注意的一样,本实施例仅以触摸点为两点时的一部分手势作为示例,本领域技术人员可以无疑义的将本申请的技术方案应用于触摸点为两点时的其他手势识别,识别过程中对于该触摸点从像素数据转换到物理数据的步骤可以与上述步骤相同,本领域技术人员也可以自行设置阈值以限制其他手势的识别情况,根据本申请实施例对其他手势的阈值进行适应性的改动并不需要付出创造性的劳动,故在此不再赘述。Similarly, as noted in the above embodiments, this embodiment only takes a part of gestures when the touch points are two points as an example, and those skilled in the art can undoubtedly apply the technical solution of the application to two touch points. For other gesture recognition when pointing, the step of converting the touch point from pixel data to physical data in the recognition process can be the same as the above steps, and those skilled in the art can also set the threshold by themselves to limit the recognition of other gestures, according to the implementation of this application For example, adapting the thresholds of other gestures does not require creative efforts, so details will not be repeated here.
在一可选的实施例中,以触摸点的个数为五为例,在上述已经获取触摸屏的物理参数和触摸屏的分辨率的基础之上,获取每一个上述五个触摸点的中心像素点的像素坐标值,触摸点的中心像素点位于触摸点对应的触摸面积的中心点,即将触摸面积高度方向上的中线和触摸面积宽度方向上的中线的交点,记为中心像素点。上述中心像素点的像素坐标值包括中心像素点的像素横坐标值和中心像素点的像素纵坐标值,在求得中心像素点的像素坐标值后,根据中心像素点的像素横坐标值、触摸屏的物理宽度值和所述触摸屏的分辨率宽度,计算得到触摸点的物理横坐标值。In an optional embodiment, taking the number of touch points as five as an example, on the basis of the physical parameters of the touch screen and the resolution of the touch screen that have been obtained above, the central pixel of each of the above five touch points is obtained The pixel coordinate value of the touch point, the center pixel of the touch point is located at the center of the touch area corresponding to the touch point, that is, the intersection of the center line in the height direction of the touch area and the center line in the width direction of the touch area is recorded as the center pixel point. The pixel coordinate value of the above-mentioned center pixel point comprises the pixel abscissa value of the center pixel point and the pixel ordinate value of the center pixel point. After obtaining the pixel coordinate value of the center pixel point, according to the pixel abscissa value of the center pixel point, the touch screen The physical width value of the touch screen and the resolution width of the touch screen are calculated to obtain the physical abscissa value of the touch point.
具体的,通过下式计算所述触摸点的物理横坐标值:Specifically, the physical abscissa value of the touch point is calculated by the following formula:
其中,X表示触摸点的物理横坐标值,Px表示中心像素点的像素横坐标值,Ws表示触摸屏的物理宽度值,Dw表示触摸屏的分辨率宽度值。Wherein, X represents the physical abscissa value of the touch point, P x represents the pixel abscissa value of the central pixel point, W s represents the physical width value of the touch screen, and D w represents the resolution width value of the touch screen.
进一步的,根据所述中心像素点的像素纵坐标值、所述触摸屏的物理高度值和所述触摸屏的分辨率高度,计算得到所述触摸点的物理纵坐标值。Further, the physical ordinate value of the touch point is calculated according to the pixel ordinate value of the central pixel point, the physical height value of the touch screen, and the resolution height of the touch screen.
具体的,通过下式计算所述触摸点的物理纵坐标值:Specifically, the physical ordinate value of the touch point is calculated by the following formula:
其中,Y表示触摸点的物理纵坐标值,Py表示中心像素点的像素纵坐标值,Hs表示触摸屏的物理高度值,Dh表示触摸屏的分辨率高度值。Wherein, Y represents the physical ordinate value of the touch point, P y represents the pixel ordinate value of the central pixel point, H s represents the physical height value of the touch screen, and D h represents the resolution height value of the touch screen.
在求得五个触摸点对应的物理坐标值后,计算五个触摸点中,每两个触摸点之间的第二物理间距,预设阈值为第四阈值。可以采用任意方法计算第二物理间距,所谓的第二物理间距即五个触摸点中每两个触摸点对应的两个中心像素点之间的直线距离,具体计算过程在此不再赘述,本领域技术人员应当知晓。进一步的,判断该第二物理间距与第四阈值之间的大小关系,一般而言,考虑到有时候会有多人同时操作大屏,如果五个手指是不同的人在大屏不同区域在书写,需要不触发五指擦除手势,一般如果五个手指是不同的人在大屏不同区域书写的话,至少存在两个手指之间的距离会较大。故当任意一个第二物理间距大于第四阈值时,得到触摸点对应的手势为书写操作,当所有的第二物理间距小于第四阈值时,得到触摸点对应的手势为五指擦除。在一般情况下,第四阈值会设置为200毫米,当然的,本领域人员应当无疑义的知晓,上述第四阈值可以自行调整。After obtaining the physical coordinate values corresponding to the five touch points, calculate the second physical distance between every two touch points among the five touch points, and the preset threshold is the fourth threshold. Any method can be used to calculate the second physical distance. The so-called second physical distance is the straight-line distance between the two center pixels corresponding to every two touch points among the five touch points. The specific calculation process will not be repeated here. Those skilled in the art should know. Further, judge the size relationship between the second physical distance and the fourth threshold. Generally speaking, considering that sometimes there will be multiple people operating the large screen at the same time, if the five fingers are different people in different areas of the large screen For writing, it is necessary not to trigger the five-finger erasing gesture. Generally, if the five fingers are written by different people in different areas of the large screen, there will be a large distance between at least two fingers. Therefore, when any second physical distance is greater than the fourth threshold, the gesture corresponding to the touch point is a writing operation; when all the second physical distances are smaller than the fourth threshold, the gesture corresponding to the touch point is five-finger erasing. In general, the fourth threshold is set to 200 millimeters. Of course, those skilled in the art should undoubtedly know that the above fourth threshold can be adjusted by themselves.
同样的,如上述实施例中需要注意的一样,本实施例仅以触摸点为五点时的一部分手势作为示例,本领域技术人员可以无疑义的将本申请的技术方案应用于触摸点为五点时的其他手势识别,识别过程中对于该触摸点从触摸点的像素数据转换到触摸点的物理数据的步骤可以与上述步骤相同,本领域技术人员也可以自行设置阈值以限制其他手势的识别情况,根据本申请实施例对其他手势的阈值进行适应性的改动并不需要付出创造性的劳动,故在此不再赘述。Similarly, as noted in the above embodiments, this embodiment only takes a part of gestures when the touch points are five points as an example, and those skilled in the art can undoubtedly apply the technical solution of this application to five touch points. For other gesture recognition when pointing, the step of converting the touch point from the pixel data of the touch point to the physical data of the touch point in the recognition process can be the same as the above steps, and those skilled in the art can also set the threshold by themselves to limit the recognition of other gestures In some cases, adaptive changes to the thresholds of other gestures according to the embodiment of the present application do not require creative efforts, so details are not described here.
通过上述实施例可以看出,本申请实施例所述的手势识别方法,通过获取到的触摸点的像素数据以及触摸屏的物理数据和分辨率,计算得出触摸点的物理数据,有效将触摸点的像素数据转化为像素点的实际物理数据,进一步的,利用像素点的物理数据对触摸手势进行进一步的识别,有效解决了像素数据在不同尺寸大屏和不同分辨率下的差异问题,防止在不同大小的屏幕以及具有不同分辨率的屏幕中,判断手势时出现较大误差,有效提升了对于手势的判断精度。It can be seen from the above-mentioned embodiments that the gesture recognition method described in the embodiment of the present application calculates the physical data of the touch point through the acquired pixel data of the touch point and the physical data and resolution of the touch screen, and effectively converts the touch point The pixel data of the pixel is converted into the actual physical data of the pixel. Further, the physical data of the pixel is used to further identify the touch gesture, which effectively solves the problem of the difference of the pixel data in different sizes of large screens and different resolutions. On screens of different sizes and screens with different resolutions, large errors occur when judging gestures, which effectively improves the accuracy of judging gestures.
需要说明的是,本申请实施例的方法可以由单个设备执行,例如一台计算机或服务器等。本实施例的方法也可以应用于分布式场景下,由多台设备相互配合来完成。在这种分布式场景的情况下,这多台设备中的一台设备可以只执行本申请实施例的方法中的某一个或多个步骤,这多台设备相互之间会进行交互以完成所述的方法。It should be noted that the method in the embodiment of the present application may be executed by a single device, such as a computer or a server. The method of this embodiment can also be applied in a distributed scenario, and is completed by cooperation of multiple devices. In the case of such a distributed scenario, one of the multiple devices may only perform one or more steps in the method of the embodiment of the present application, and the multiple devices will interact with each other to complete all described method.
需要说明的是,上述对本申请的一些实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于上述实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。It should be noted that some embodiments of the present application are described above. Other implementations are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in an order different from those in the above-described embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. Multitasking and parallel processing are also possible or may be advantageous in certain embodiments.
基于同一发明构思,与上述任意实施例方法相对应的,本申请还提供了一种手势识别装置。Based on the same inventive concept, the present application further provides a gesture recognition device corresponding to the method in any of the above embodiments.
参考图2,所述手势识别装置,包括:Referring to Fig. 2, the gesture recognition device includes:
获取模块21,被配置为获取对触摸屏的触摸点的个数,根据所述触摸点的个数,获取触摸点的像素数据;The acquiring
计算模块22,被配置为根据所述触摸点的个数、所述触摸点的像素数据、获取的触摸屏的物理参数和获取的触摸屏的分辨率,计算得到所述触摸点的物理数据;The
判断模块23,被配置为根据所述触摸点的物理数据与预设阈值,得到所述触摸点对应的手势。The judging
在一种可能的实现方式中,所述触摸点的个数为一,所述触摸点的像素数据包括:所述触摸点的触摸面积的最大像素宽度值、所述触摸点的触摸面积的最大像素高度值。In a possible implementation manner, the number of the touch point is one, and the pixel data of the touch point includes: the maximum pixel width value of the touch area of the touch point, the maximum value of the touch area of the touch point Pixel height value.
在一种可能的实现方式中,所述触摸屏的物理参数包括:所述触摸屏的物理宽度值和所述触摸屏的物理高度值;In a possible implementation manner, the physical parameters of the touch screen include: a physical width value of the touch screen and a physical height value of the touch screen;
所述触摸屏的分辨率包括:所述触摸屏的分辨率宽度和所述触摸屏的分辨率高度;The resolution of the touch screen includes: the resolution width of the touch screen and the resolution height of the touch screen;
所述触摸点的物理数据包括:所述触摸点的物理最大宽度值和所述触摸点的物理最大高度值;The physical data of the touch point includes: a physical maximum width value of the touch point and a physical maximum height value of the touch point;
所述计算模块进一步被配置为:The computing module is further configured to:
根据所述触摸点的触摸面积的最大像素宽度值、所述触摸屏的物理宽度值和所述触摸屏的分辨率宽度,计算得到所述触摸点的物理最大宽度值;Calculate the physical maximum width value of the touch point according to the maximum pixel width value of the touch area of the touch point, the physical width value of the touch screen, and the resolution width of the touch screen;
根据所述触摸面积的最大像素高度值、所述触摸屏的物理高度值和所述触摸屏的分辨率高度,计算得到所述触摸点的物理最大高度值。The physical maximum height value of the touch point is calculated according to the maximum pixel height value of the touch area, the physical height value of the touch screen, and the resolution height of the touch screen.
在一种可能的实现方式中,所述触摸点的个数大于一,所述触摸点的像素数据包括:所述触摸点的中心像素点的像素横坐标值和所述触摸点的中心像素点的像素纵坐标值;所述中心像素点位于所述触摸点对应的触摸面积的中心点。In a possible implementation manner, the number of the touch points is greater than one, and the pixel data of the touch points includes: the pixel abscissa value of the central pixel of the touch point and the central pixel of the touch point The pixel ordinate value; the center pixel point is located at the center point of the touch area corresponding to the touch point.
在一种可能的实现方式中,所述触摸屏的物理参数包括:所述触摸屏的物理宽度值和所述触摸屏的物理高度值;In a possible implementation manner, the physical parameters of the touch screen include: a physical width value of the touch screen and a physical height value of the touch screen;
所述触摸屏的分辨率包括:所述触摸屏的分辨率宽度和所述触摸屏的分辨率高度;The resolution of the touch screen includes: the resolution width of the touch screen and the resolution height of the touch screen;
所述触摸点的物理数据包括所述触摸点的物理横坐标值和所述触摸点的物理纵坐标值;The physical data of the touch point includes a physical abscissa value of the touch point and a physical ordinate value of the touch point;
所述计算模块进一步被配置为:The computing module is further configured to:
根据所述触摸点的中心像素点的像素横坐标值、所述触摸屏的物理宽度值和所述触摸屏的分辨率宽度,计算得到所述触摸点的物理横坐标值;Calculate the physical abscissa value of the touch point according to the pixel abscissa value of the central pixel point of the touch point, the physical width value of the touch screen, and the resolution width of the touch screen;
根据所述触摸点的中心像素点的像素纵坐标值、所述触摸屏的物理高度值和所述触摸屏的分辨率高度,计算得到所述触摸点的物理纵坐标值;Calculate the physical ordinate value of the touch point according to the pixel ordinate value of the central pixel point of the touch point, the physical height value of the touch screen, and the resolution height of the touch screen;
在一种可能的实现方式中,所述触摸点对应的手势包括:手背擦除、正常书写和细笔书写;所述预设阈值包括:第一阈值和第二阈值;所述第二阈值小于所述第一阈值;In a possible implementation manner, the gestures corresponding to the touch point include: erasing on the back of the hand, normal writing, and writing with a fine pen; the preset threshold includes: a first threshold and a second threshold; the second threshold is less than said first threshold;
所述判断模块进一步被配置为:The judging module is further configured to:
任一所述触摸点的物理数据大于所述第一阈值时,得到所述触摸点对应的手势为手背擦除;When the physical data of any of the touch points is greater than the first threshold, it is obtained that the gesture corresponding to the touch point is erasing the back of the hand;
所有所述触摸点的物理数据小于所述第一阈值且任一所述触摸点的物理数据大于所述第二阈值时,得到所述触摸点对应的手势为正常书写;When the physical data of all the touch points is less than the first threshold and the physical data of any of the touch points is greater than the second threshold, it is obtained that the gesture corresponding to the touch point is normal writing;
所有所述触摸点的物理数据均小于所述第二阈值时,得到所述触摸点对应的手势为细笔书写。When the physical data of all the touch points are smaller than the second threshold, it is obtained that the gesture corresponding to the touch point is writing with a fine pen.
在一种可能的实现方式中,所述触摸点对应的手势包括:两指缩放旋转、两指平移和五指擦除;所述预设阈值包括:第三阈值和第四阈值;将所述触摸点的物理横坐标和所述触摸点的物理纵坐标作为所述触摸点的物理坐标;In a possible implementation manner, the gestures corresponding to the touch point include: zooming and rotating with two fingers, panning with two fingers, and erasing with five fingers; the preset thresholds include: a third threshold and a fourth threshold; The physical abscissa of the point and the physical ordinate of the touch point are used as the physical coordinates of the touch point;
所述判断模块进一步被配置为:The judging module is further configured to:
所述触摸点的个数为二时,计算两个所述触摸点的第一物理间距;When the number of the touch points is two, calculate the first physical distance between the two touch points;
所述第一物理间距大于所述第三阈值时,得到所述触摸点对应的手势为两指缩放旋转;When the first physical distance is greater than the third threshold, the gesture corresponding to the touch point is two-finger zooming and rotating;
所述第一物理间距小于所述第三阈值时,得到所述触摸点对应的手势为两指平移;When the first physical distance is smaller than the third threshold, it is obtained that the gesture corresponding to the touch point is two-finger translation;
所述触摸点的个数为五时,计算每两个相邻触摸点的物理坐标间的第二物理间距;When the number of the touch points is five, calculate the second physical distance between the physical coordinates of every two adjacent touch points;
所有所述第二物理间距均小于所述第四阈值时,得到所述触摸点对应的手势为五指擦除。When all the second physical distances are smaller than the fourth threshold, it is obtained that the gesture corresponding to the touch point is five-finger erasing.
在一种可能的实现方式中,所述预设阈值能够根据所述物理数据自动调节。In a possible implementation manner, the preset threshold can be automatically adjusted according to the physical data.
为了描述的方便,描述以上装置时以功能分为各种模块分别描述。当然,在实施本申请时可以把各模块的功能在同一个或多个软件和/或硬件中实现。For the convenience of description, when describing the above devices, functions are divided into various modules and described separately. Of course, when implementing the present application, the functions of each module can be realized in one or more pieces of software and/or hardware.
上述实施例的装置用于实现前述任一实施例中相应的手势识别方法,并且具有相应的方法实施例的有益效果,在此不再赘述。The devices in the above embodiments are used to implement the corresponding gesture recognition method in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, so details are not repeated here.
基于同一发明构思,与上述任意实施例方法相对应的,本申请还提供了一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现上任意一实施例所述的手势识别方法。Based on the same inventive concept, and corresponding to the method in any of the above embodiments, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and operable on the processor, the processor The gesture recognition method described in any one of the above embodiments is realized when the program is executed.
图3示出了本实施例所提供的一种更为具体的电子设备硬件结构示意图,该设备可以包括:处理器1010、存储器1020、输入/输出接口1030、通信接口1040和总线1050。其中处理器1010、存储器1020、输入/输出接口1030和通信接口1040通过总线1050实现彼此之间在设备内部的通信连接。FIG. 3 shows a schematic diagram of a more specific hardware structure of an electronic device provided by this embodiment. The device may include: a
处理器1010可以采用通用的CPU(Central Processing Unit,中央处理器)、微处理器、应用专用集成电路(Application Specific Integrated Circuit,ASIC)、或者一个或多个集成电路等方式实现,用于执行相关程序,以实现本说明书实施例所提供的技术方案。The
存储器1020可以采用ROM(Read Only Memory,只读存储器)、RAM(Random AccessMemory,随机存取存储器)、静态存储设备,动态存储设备等形式实现。存储器1020可以存储操作系统和其他应用程序,在通过软件或者固件来实现本说明书实施例所提供的技术方案时,相关的程序代码保存在存储器1020中,并由处理器1010来调用执行。The
输入/输出接口1030用于连接输入/输出模块,以实现信息输入及输出。输入输出/模块可以作为组件配置在设备中(图中未示出),也可以外接于设备以提供相应功能。其中输入设备可以包括键盘、鼠标、触摸屏、麦克风、各类传感器等,输出设备可以包括显示器、扬声器、振动器、指示灯等。The input/
通信接口1040用于连接通信模块(图中未示出),以实现本设备与其他设备的通信交互。其中通信模块可以通过有线方式(例如USB、网线等)实现通信,也可以通过无线方式(例如移动网络、WIFI、蓝牙等)实现通信。The
总线1050包括一通路,在设备的各个组件(例如处理器1010、存储器1020、输入/输出接口1030和通信接口1040)之间传输信息。
需要说明的是,尽管上述设备仅示出了处理器1010、存储器1020、输入/输出接口1030、通信接口1040以及总线1050,但是在具体实施过程中,该设备还可以包括实现正常运行所必需的其他组件。此外,本领域的技术人员可以理解的是,上述设备中也可以仅包含实现本说明书实施例方案所必需的组件,而不必包含图中所示的全部组件。It should be noted that although the above device only shows the
上述实施例的电子设备用于实现前述任一实施例中相应的手势识别方法,并且具有相应的方法实施例的有益效果,在此不再赘述。The electronic device in the foregoing embodiments is used to implement the corresponding gesture recognition method in any of the preceding embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
所属领域的普通技术人员应当理解:以上任何实施例的讨论仅为示例性的,并非旨在暗示本申请的范围(包括权利要求)被限于这些例子;在本申请的思路下,以上实施例或者不同实施例中的技术特征之间也可以进行组合,步骤可以以任意顺序实现,并存在如上所述的本申请实施例的不同方面的许多其它变化,为了简明它们没有在细节中提供。Those of ordinary skill in the art should understand that: the discussion of any of the above embodiments is exemplary only, and is not intended to imply that the scope of the application (including claims) is limited to these examples; under the thinking of the application, the above embodiments or Combinations of technical features in different embodiments are also possible, steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the application as described above, which are not provided in detail for the sake of brevity.
另外,为简化说明和讨论,并且为了不会使本申请实施例难以理解,在所提供的附图中可以示出或可以不示出与集成电路(IC)芯片和其它部件的公知的电源/接地连接。此外,可以以框图的形式示出装置,以便避免使本申请实施例难以理解,并且这也考虑了以下事实,即关于这些框图装置的实施方式的细节是高度取决于将要实施本申请实施例的平台的(即,这些细节应当完全处于本领域技术人员的理解范围内)。在阐述了具体细节(例如,电路)以描述本申请的示例性实施例的情况下,对本领域技术人员来说显而易见的是,可以在没有这些具体细节的情况下或者这些具体细节有变化的情况下实施本申请实施例。因此,这些描述应被认为是说明性的而不是限制性的。In addition, for simplicity of illustration and discussion, and so as not to obscure the embodiments of the present application, well-known power/connections associated with integrated circuit (IC) chips and other components may or may not be shown in the provided figures. ground connection. Furthermore, devices may be shown in block diagram form in order to avoid obscuring the embodiments of the present application, and this also takes into account the fact that details regarding the implementation of these block diagram devices are highly dependent on the implementation of the embodiments of the present application to be implemented. platform (ie, the details should be well within the purview of those skilled in the art). Where specific details (eg, circuits) have been set forth to describe exemplary embodiments of the present application, it will be apparent to those skilled in the art that other embodiments may be implemented without or with variations from these specific details. Implement the embodiment of the present application below. Accordingly, these descriptions should be regarded as illustrative rather than restrictive.
尽管已经结合了本申请的具体实施例对本申请进行了描述,但是根据前面的描述,这些实施例的很多替换、修改和变型对本领域普通技术人员来说将是显而易见的。例如,其它存储器架构(例如,动态RAM(DRAM))可以使用所讨论的实施例。Although the application has been described in conjunction with specific embodiments thereof, many alternatives, modifications and variations of those embodiments will be apparent to those of ordinary skill in the art from the foregoing description. For example, other memory architectures such as dynamic RAM (DRAM) may use the discussed embodiments.
本申请实施例旨在涵盖落入所附权利要求的宽泛范围之内的所有这样的替换、修改和变型。因此,凡在本申请实施例的精神和原则之内,所做的任何省略、修改、等同替换、改进等,均应包含在本申请的保护范围之内。The embodiments of the present application are intended to embrace all such alternatives, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent replacements, improvements, etc. within the spirit and principles of the embodiments of the present application shall be included within the protection scope of the present application.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211420887.0A CN115826838A (en) | 2022-11-11 | 2022-11-11 | Gesture recognition method and related equipment |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211420887.0A CN115826838A (en) | 2022-11-11 | 2022-11-11 | Gesture recognition method and related equipment |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN115826838A true CN115826838A (en) | 2023-03-21 |
Family
ID=85527975
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211420887.0A Pending CN115826838A (en) | 2022-11-11 | 2022-11-11 | Gesture recognition method and related equipment |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115826838A (en) |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104714675A (en) * | 2013-12-13 | 2015-06-17 | 华为终端有限公司 | Gesture recognition method and device |
| US20170185212A1 (en) * | 2015-12-24 | 2017-06-29 | Samsung Electronics Co., Ltd. | Method and apparatus for processing touch events |
| CN107807781A (en) * | 2017-09-28 | 2018-03-16 | 广州视源电子科技股份有限公司 | Gesture erasing identification method and device and electronic equipment |
| US20180349014A1 (en) * | 2017-06-06 | 2018-12-06 | Polycom, Inc. | Detecting erasure gestures in an electronic presentation system |
-
2022
- 2022-11-11 CN CN202211420887.0A patent/CN115826838A/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104714675A (en) * | 2013-12-13 | 2015-06-17 | 华为终端有限公司 | Gesture recognition method and device |
| US20170185212A1 (en) * | 2015-12-24 | 2017-06-29 | Samsung Electronics Co., Ltd. | Method and apparatus for processing touch events |
| US20180349014A1 (en) * | 2017-06-06 | 2018-12-06 | Polycom, Inc. | Detecting erasure gestures in an electronic presentation system |
| CN107807781A (en) * | 2017-09-28 | 2018-03-16 | 广州视源电子科技股份有限公司 | Gesture erasing identification method and device and electronic equipment |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US9612675B2 (en) | Emulating pressure sensitivity on multi-touch devices | |
| CN105807997B (en) | A kind of touch screen sensitivity regulation method and device | |
| TWI556142B (en) | Navigation trace calibrating method and related optical navigation device | |
| US20150193037A1 (en) | Input Apparatus | |
| CN104714637B (en) | Polygonal gesture detection and interaction method, device and computer program product | |
| WO2019223461A1 (en) | Touch detection method and computer-readable storage medium | |
| WO2020238435A1 (en) | Touch position recognition method and detection apparatus, touch-control apparatus and storage medium | |
| JPWO2012111194A1 (en) | Input device, input method, and program | |
| US10514802B2 (en) | Method for controlling display of touchscreen, and mobile device | |
| CN114360047A (en) | Hand-lifting gesture recognition method and device, electronic equipment and storage medium | |
| CN114170620B (en) | Palm position determination method, device, electronic device and storage medium | |
| CN104598228A (en) | Measuring method of size of object | |
| CN108228057A (en) | A kind of modification method, device and the touch screen of touch-control inflection point | |
| CN111880676B (en) | Partition touch control method and device, electronic equipment and storage medium | |
| CN112181263A (en) | Touch screen drawing operation response method, device and computing device | |
| CN104252306A (en) | Pen touch display method | |
| CN106598422B (en) | hybrid control method, control system and electronic equipment | |
| CN106569716A (en) | One-hand operation and control method and control system | |
| CN115826838A (en) | Gesture recognition method and related equipment | |
| CN110187144A (en) | Acceleration transducer calibration method and device | |
| US20190371277A1 (en) | Processing method for character stroke and related device | |
| CN116027956A (en) | Handwriting display method, device, equipment and storage medium | |
| CN115471852A (en) | Touch recognition method, touch device, storage medium and computer device | |
| CN108132753A (en) | A kind of recognition methods, device and the terminal device of user gesture operation | |
| JP5471286B2 (en) | Touch panel pointing position calculation device, touch panel device, electronic device including the same, touch panel pointing position calculation method and program |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |