图形绘制方法、电子设备及计算机存储介质Graphic drawing method, electronic equipment and computer storage medium
相关申请的交叉引用Cross-references to related applications
本申请要求于2020年6月2日提交的发明名称为“图形绘制方法、电子设备及计算机存储介质”的中国专利申请第202010489740.1号的优先权,该申请的公开通过引用被全部结合于此。This application claims the priority of the Chinese Patent Application No. 202010489740.1 with the title of "Graphic Drawing Method, Electronic Equipment and Computer Storage Medium" filed on June 2, 2020, the disclosure of which is incorporated herein by reference in its entirety.
技术领域Technical field
本申请涉及计算机技术领域。更具体地,涉及一种图形绘制方法、电子设备及计算机存储介质。This application relates to the field of computer technology. More specifically, it relates to a graphics drawing method, an electronic device and a computer storage medium.
背景技术Background technique
随着无纸化办公、智能化办公相关设备和方案的进步,很多会议场景都在使用智能交互的电子白板设备来取代传统的白板,能够极大地提高工作和会议效率。用户可以在利用电子白板设备的触摸屏在电子白板应用的界面上进行书写、绘画等操作。其中,对于标准图形的快捷绘制方式,通常是在例如电子白板应用的界面上的侧边栏中提供模板图形控件,响应于用户对侧边栏中的模板图形控件的触摸操作而展开包括例如直线、矩形、三角形、梯形、圆等各种标准图型标识的菜单列表,供用户选择,但这种方式每次都在固定位置、以固定的顺序展示所有的标准图型标识,操作不便,效率不高。With the progress of paperless office and intelligent office related equipment and solutions, many meeting scenarios are using intelligent interactive whiteboard equipment to replace traditional whiteboards, which can greatly improve the efficiency of work and meetings. The user can use the touch screen of the electronic whiteboard device to perform operations such as writing and drawing on the interface of the electronic whiteboard application. Among them, for the shortcut drawing of standard graphics, the template graphics control is usually provided in the sidebar on the interface of the electronic whiteboard application. In response to the user's touch operation on the template graphics control in the sidebar, the expansion includes, for example, a straight line. , Rectangle, triangle, trapezoid, circle and other standard graphic logo menu list for users to choose, but this method displays all standard graphic logos in a fixed position and in a fixed order every time, which is inconvenient and efficient. not tall.
发明内容Summary of the invention
本申请第一方面提供了一种图形绘制方法,应用于具有触摸屏的终端中,该方法包括:The first aspect of the present application provides a graphics drawing method, which is applied to a terminal with a touch screen, and the method includes:
获取在触摸屏输入的多个轨迹点;Obtain multiple track points entered on the touch screen;
根据各轨迹点的输入时刻和坐标确定属于同一图形的轨迹点;Determine the trajectory points belonging to the same graph according to the input time and coordinates of each trajectory point;
根据所述属于同一图形的轨迹点的坐标,确定属于同一图形的轨迹点形成的轨迹包含的轨迹偏移量所对应的坐标系角度区间;According to the coordinates of the track points belonging to the same graph, determine the coordinate system angle interval corresponding to the track offset included in the track formed by the track points belonging to the same graph;
在所述轨迹包含的轨迹偏移量所对应的坐标系角度区间符合预设规则时确定推荐的图形。The recommended figure is determined when the angle interval of the coordinate system corresponding to the trajectory offset included in the trajectory meets a preset rule.
通过本申请提供的图形绘制方法,终端可基于轨迹包含的偏移量所对应的坐标系角度区间,实时地对用户触摸绘制的图形进行识别,从而可实时地推荐符合用户绘制意图的标准图形,具有操作便捷、实时性强、绘制效率高等优点,提升了绘图的交互体验。其中,基于轨迹包含的偏移量所对应的坐标系角度区间对用户触摸绘制的图形进行识别,可实现不需用户输入的绘制轨迹非常规范且严格地连续,也能够准确识别出绘制的图形,保证了本申请提供的图形绘制方法的有效性和适用性。Through the graphic drawing method provided in this application, the terminal can recognize the graphic drawn by the user touch in real time based on the angle interval of the coordinate system corresponding to the offset included in the trajectory, so that standard graphics that meet the user’s drawing intention can be recommended in real time. It has the advantages of convenient operation, strong real-time performance, and high drawing efficiency, which improves the interactive experience of drawing. Among them, based on the coordinate system angle interval corresponding to the offset contained in the trajectory, the user touches and draws the figure to be recognized, which can realize the drawing trajectory without user input is very standardized and strictly continuous, and can also accurately identify the drawn figure. The validity and applicability of the graphics drawing method provided in this application are guaranteed.
在一种可能的实现方式中,所述根据各轨迹点的输入时刻和坐标确定属于同一图形的轨迹点包括:In a possible implementation manner, the determining the trajectory points belonging to the same graph according to the input time and coordinates of each trajectory point includes:
将连续的多个轨迹点确定为属于同一图形;并将与所述连续的多个轨迹点中任一轨 迹点的坐标距离小于预设的第一距离阈值,且与所述连续的多个轨迹点中最后一个轨迹点的输入时刻的时间间距小于预设的时间阈值的轨迹点,与所述连续的多个轨迹点确定为属于同一图形。Determine the consecutive multiple trajectory points as belonging to the same graph; and set the coordinate distance to any one of the multiple consecutive trajectory points to be less than the preset first distance threshold, and to the consecutive multiple trajectories A track point whose time interval between the input moment of the last track point in the points is less than a preset time threshold is determined to belong to the same graph as the multiple consecutive track points.
由此,使得在用户两笔甚至多笔绘制一个图形时,对应的绘制轨迹也能够被正确识别是否属于同一图形,或者说使得本申请提供的图像绘制方法可适用于用户两笔甚至多笔绘制一个图形的情况,即绘制一个图形时出现一定程度的轨迹坐标不连续的偏差。As a result, when the user draws a figure with two or even multiple pens, the corresponding drawing track can also be correctly identified whether it belongs to the same figure, or the image drawing method provided in this application is suitable for the user to draw with two or even multiple pens. In the case of a graph, there is a certain degree of discontinuous deviation of the track coordinates when drawing a graph.
在一种可能的实现方式中,根据所述属于同一图形的轨迹点的坐标,确定属于同一图形的轨迹点形成的轨迹包含的轨迹偏移量所对应的坐标系角度区间包括:In a possible implementation manner, according to the coordinates of the trajectory points belonging to the same graphic, determining the coordinate system angle interval corresponding to the trajectory offset included in the trajectory formed by the trajectory points belonging to the same graphic includes:
根据所述属于同一图形的轨迹点中的相邻轨迹点的坐标确定相邻轨迹点偏移量,根据所述相邻轨迹点偏移量确定属于同一图形的轨迹点形成的轨迹包含的轨迹偏移量。Determine the offset of adjacent track points according to the coordinates of the adjacent track points in the track points belonging to the same graph, and determine the track offset included in the track formed by the track points belonging to the same graph according to the offset of the adjacent track points. Shift amount.
在一种可能的实现方式中,在所述根据所述属于同一图形的轨迹点中的相邻轨迹点的坐标确定相邻轨迹点偏移量之前,还包括:In a possible implementation manner, before the determining the offset of adjacent track points according to the coordinates of adjacent track points among the track points belonging to the same graph, the method further includes:
对于第N+1轨迹点与第N轨迹点形成的相邻轨迹点,若第N+1轨迹点与第N轨迹点之间的距离小于第二距离阈值,则用第N+2轨迹点取代第N+1轨迹点作为第N轨迹点的相邻轨迹点。For the adjacent trajectory point formed by the N+1th trajectory point and the Nth trajectory point, if the distance between the N+1th trajectory point and the Nth trajectory point is less than the second distance threshold, replace it with the N+2th trajectory point The N+1th trajectory point is regarded as the adjacent trajectory point of the Nth trajectory point.
由此,可通过筛除坐标密集的轨迹点,在不影响偏移量计算准确性的同时,减少不必要的计算量,提升图形识别效率。As a result, by filtering out track points with dense coordinates, without affecting the accuracy of the offset calculation, unnecessary calculations can be reduced, and the efficiency of pattern recognition can be improved.
在一种可能的实现方式中,所述根据所述相邻轨迹点偏移量确定属于同一图形的轨迹点形成的轨迹包含的轨迹偏移量包括:In a possible implementation manner, the determining, according to the offset of adjacent track points, the track offset included in the track formed by the track points belonging to the same graph includes:
将连续的且处于同一坐标系角度区间的相邻轨迹点偏移量合并为一个处于该坐标系角度区间的轨迹偏移量。Combine consecutive adjacent track point offsets in the same coordinate system angle interval into one track offset in the coordinate system angle interval.
由此,可实现对连续的、处于同于同一坐标系角度区间的偏移量进行去冗余,提升图形识别效率。As a result, it is possible to achieve de-redundancy of continuous offsets that are in the same angular interval of the same coordinate system, and improve the efficiency of pattern recognition.
在一种可能的实现方式中,所述坐标系角度区间包括:In a possible implementation manner, the angle interval of the coordinate system includes:
与X轴正半轴夹角±45°内的第一角度区间、与Y轴正半轴夹角±45°内的第二角度区间、与X轴负半轴夹角±45°内的第三角度区间和与Y轴负半轴夹角±45°内的第四角度区间。The first angle interval within ±45° with the positive half axis of the X axis, the second angle interval within ±45° with the positive half axis of the Y axis, and the first angle interval within ±45° of the included angle with the negative half axis of the X axis The third angle interval and the fourth angle interval within ±45° of the negative half axis of the Y axis.
此坐标系角度区间的划分方式,可在保证基于轨迹包含的偏移量所对应的坐标系角度区间对用户触摸绘制的图形进行识别的准确性的同时,保证在用户输入的绘制轨迹出现一定的偏差或者出现间断时本申请提供的图形绘制方法的有效性和适用性。This method of dividing the angle interval of the coordinate system can ensure the accuracy of the recognition of the graphics drawn by the user touch based on the angle interval of the coordinate system corresponding to the offset contained in the trajectory, while ensuring that a certain amount of trace appears in the drawn trajectory input by the user. The validity and applicability of the graphics drawing method provided in this application when deviations or discontinuities occur.
在一种可能的实现方式中,所述在所述轨迹包含的轨迹偏移量所对应的坐标系角度区间符合预设规则时确定推荐的图形包括:In a possible implementation manner, the determining the recommended graphics when the angle interval of the coordinate system corresponding to the track offset included in the track meets a preset rule includes:
在所述轨迹仅包含处于一个坐标系角度区间的轨迹偏移量时,确定推荐的图形为直线;When the trajectory only includes the trajectory offset in an angular interval of the coordinate system, determining that the recommended figure is a straight line;
在所述轨迹包含两个处于相邻的两个坐标系角度区间的轨迹偏移量时,确定推荐的图形包括矩形、三角形、梯形中的至少一个;When the trajectory includes two trajectory offsets in two adjacent angle intervals of the coordinate system, determining that the recommended figure includes at least one of a rectangle, a triangle, and a trapezoid;
在所述轨迹包含两个或三个处于相对的两个坐标系角度区间的轨迹偏移量时,确定推荐的图形为三角形;When the trajectory includes two or three trajectory offsets in the angle interval of two opposite coordinate systems, determining that the recommended figure is a triangle;
在所述轨迹包含三个依次处于顺时针方向或逆时针方向排序的相邻的三个坐标系角 度区间的轨迹偏移量时,确定推荐的图形包括圆形、椭圆形、矩形、三角形、梯形中的至少一个。When the trajectory includes three trajectory offsets of three adjacent coordinate system angle intervals sorted in a clockwise or counterclockwise direction, it is determined that the recommended graphics include a circle, an ellipse, a rectangle, a triangle, and a trapezoid. At least one of them.
由此,本申请提供的图形绘制方法涵盖了多种常用的标准图形,且可在用户完整绘制完成完整的图形之前,准确地实时推荐出符合用户绘制意图的标准图形。Therefore, the graphics drawing method provided in this application covers a variety of commonly used standard graphics, and can accurately and real-time recommend standard graphics that meet the user's drawing intention before the user completes the complete drawing.
在一种可能的实现方式中,在所述显示模板控件之后,还包括:In a possible implementation manner, after the template control is displayed, the method further includes:
响应于对所述标识的第一操作,以所述属于同一图形的轨迹点中第1个轨迹点的坐标为基准坐标,显示所述标识对应的图形。In response to the first operation on the mark, the coordinate of the first track point among the track points belonging to the same graph is used as the reference coordinate, and the graph corresponding to the mark is displayed.
在一种可能的实现方式中,所述显示模板控件包括:In a possible implementation manner, the display template control includes:
在属于同一图形的轨迹点形成的轨迹对应的位置显示模板控件。The template control is displayed at the position corresponding to the trajectory formed by the trajectory points belonging to the same graph.
由此,可对应用户输入绘制轨迹的位置调整推荐图形的标识的显示位置,使得用户操作更加便捷,特别是对于例如具有55寸以上触摸屏的电子白板设备等大屏终端而言。As a result, the display position of the identification of the recommended graphic can be adjusted corresponding to the position of the user input to draw the trajectory, making user operations more convenient, especially for large-screen terminals such as electronic whiteboard devices with a touch screen of 55 inches or more.
在一种可能的实现方式中,在所述显示模板控件之后,还包括:In a possible implementation manner, after the template control is displayed, the method further includes:
若属于同一图形的轨迹点形成的轨迹的长度大于预设长度阈值,则停止显示所述模板控件。If the length of the trajectory formed by the trajectory points belonging to the same graph is greater than the preset length threshold, then stop displaying the template control.
本申请第二方面提供了一种电子设备,包括:处理器、存储器和触摸屏,所述存储器、所述触摸屏与所述处理器耦合,所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,所述计算机指令当被所述处理器执行时,使得所述电子设备执行如上所述的图形绘制方法。A second aspect of the present application provides an electronic device, including: a processor, a memory, and a touch screen, the memory, the touch screen are coupled with the processor, and the memory is used to store computer program code, the computer program code It includes computer instructions that, when executed by the processor, cause the electronic device to execute the graphics drawing method as described above.
本申请第三方面提供了一种计算机存储介质,包括计算机指令,当所述计算机指令在终端上运行时,使得所述终端执行如上所述的图形绘制方法。A third aspect of the present application provides a computer storage medium, including computer instructions, which, when the computer instructions run on a terminal, cause the terminal to execute the above-mentioned graphics drawing method.
附图说明Description of the drawings
下面结合附图对本申请的具体实施方式作进一步详细的说明。The specific implementation of the present application will be described in further detail below in conjunction with the accompanying drawings.
图1示出本申请实施例提供的一种电子设备的结构示意图一。FIG. 1 shows a first structural diagram of an electronic device provided by an embodiment of the present application.
图2示出本申请实施例提供的一种电子设备的结构示意图二。FIG. 2 shows a second structural diagram of an electronic device provided by an embodiment of the present application.
图3示出本申请实施例提供的图形绘制方法的流程示意图。FIG. 3 shows a schematic flowchart of a graph drawing method provided by an embodiment of the present application.
图4示出本申请实施例提供的一电子设备的用户界面示意图。Fig. 4 shows a schematic diagram of a user interface of an electronic device provided by an embodiment of the present application.
图5示出一种坐标系角度区间的划分方式的示意图。Fig. 5 shows a schematic diagram of a division method of the angle interval of the coordinate system.
图6示出本申请实施例提供的又一电子设备的用户界面示意图。FIG. 6 shows a schematic diagram of a user interface of another electronic device provided by an embodiment of the present application.
图7示出本申请实施例提供的又一电子设备的用户界面示意图。FIG. 7 shows a schematic diagram of a user interface of another electronic device provided by an embodiment of the present application.
图8示出本申请实施例提供的又一电子设备的用户界面示意图。FIG. 8 shows a schematic diagram of a user interface of another electronic device provided by an embodiment of the present application.
图9示出本申请实施例提供的又一电子设备的用户界面示意图。FIG. 9 shows a schematic diagram of a user interface of another electronic device provided by an embodiment of the present application.
图10示出本申请实施例提供的又一电子设备的用户界面示意图。FIG. 10 shows a schematic diagram of a user interface of another electronic device provided by an embodiment of the present application.
图11示出本申请实施例提供的又一电子设备的用户界面示意图。FIG. 11 shows a schematic diagram of a user interface of another electronic device provided by an embodiment of the present application.
图12示出本申请实施例提供的一种电子设备的结构示意图三。FIG. 12 shows a third structural diagram of an electronic device provided by an embodiment of the present application.
具体实施方式detailed description
为了更清楚地说明本申请,下面结合实施例和附图对本申请做进一步的说明。附图中相似的部件以相同的附图标记进行表示。本领域技术人员应当理解,下面所具体描述 的内容是说明性的而非限制性的,不应以此限制本申请的保护范围。In order to explain the application more clearly, the application will be further explained below in conjunction with embodiments and drawings. Similar components in the drawings are denoted by the same reference numerals. Those skilled in the art should understand that the content specifically described below is illustrative rather than restrictive, and should not be used to limit the scope of protection of this application.
在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。In the description of the embodiments of the present application, unless otherwise specified, "/" means or, for example, A/B can mean A or B; "and/or" in this document is only an association describing the associated object Relationship, which means that there can be three kinds of relationships, for example, A and/or B, which can mean: A alone exists, A and B exist at the same time, and B exists alone.
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本申请实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。Hereinafter, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined with "first" and "second" may explicitly or implicitly include one or more of these features. In the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。In the embodiments of the present application, words such as "exemplary" or "for example" are used as examples, illustrations, or illustrations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferable or advantageous than other embodiments or design solutions. To be precise, words such as "exemplary" or "for example" are used to present related concepts in a specific manner.
示例性的,本申请中的电子设备可以为电子白板设备、智能电视、手机、平板电脑、个人计算机(personal computer,PC)、个人数字助理(personal digital assistant,PDA)、智能手表、上网本、可穿戴电子设备、增强现实技术(augmented reality,AR)设备、虚拟现实(virtual reality,VR)设备、车载设备、智能汽车、机器人等,本申请对该电子设备的具体形式不做特殊限制。Exemplarily, the electronic device in this application may be an electronic whiteboard device, a smart TV, a mobile phone, a tablet computer, a personal computer (PC), a personal digital assistant (PDA), a smart watch, a netbook, a computer Wearable electronic devices, augmented reality (AR) devices, virtual reality (VR) devices, in-vehicle devices, smart cars, robots, etc., this application does not impose special restrictions on the specific forms of the electronic devices.
图1示出了电子设备100的结构示意图。FIG. 1 shows a schematic diagram of the structure of an electronic device 100.
电子设备100包括存储器110和处理器120。应当理解的是,图1所示的电子设备100的组件只是示例性的,而非限制性的,根据实际应用需要,该电子设备100还可以具有其他组件。例如,该笔迹处理装置100可以采用Windows、Android等操作系统。The electronic device 100 includes a memory 110 and a processor 120. It should be understood that the components of the electronic device 100 shown in FIG. 1 are only exemplary and not restrictive. According to actual application requirements, the electronic device 100 may also have other components. For example, the handwriting processing device 100 may use operating systems such as Windows and Android.
例如,存储器110用于非暂时性存储计算机可读指令;处理器120用于运行计算机可读指令。For example, the memory 110 is used for non-transitory storage of computer readable instructions; the processor 120 is used for running computer readable instructions.
例如,如图1所示,电子设备100还可以包括触控装置130。触控装置130被配置为获取对应于在触控装置130的工作表面上的触摸操作。例如,触控装置130可以包括电子笔、触摸屏、鼠标、触摸板、交互白板等任意的具有触控功能的等输入装置。例如,该触摸屏可以为电容式触摸屏,例如自容式触摸屏或互容式触摸屏,还可以为电阻式触摸屏、表面声波式触摸屏、红外式触摸屏等。For example, as shown in FIG. 1, the electronic device 100 may further include a touch device 130. The touch device 130 is configured to obtain a touch operation corresponding to the work surface of the touch device 130. For example, the touch device 130 may include any input device with a touch function, such as an electronic pen, a touch screen, a mouse, a touch pad, and an interactive whiteboard. For example, the touch screen may be a capacitive touch screen, such as a self-capacitive touch screen or a mutual-capacitive touch screen, and may also be a resistive touch screen, a surface acoustic wave touch screen, an infrared touch screen, and the like.
例如,触控装置130可以包括触摸传感器以及控制器(例如驱动IC),该控制器接收触摸传感器采集的电信号,将该电信号处理后得到触摸信号并提供给处理器等以用于进一步处理。本申请的实施例对触控装置130的类型、结构以及通信方式等不作限制。触控装置130包括具有一定面积的工作表面,用户可以用手指直接在触控装置130的工作表面上进行绘画/书写,也可以利用主动式触控笔或被动式触控笔在触控装置130的工作表面上进行绘画/书写,本申请的实施例对此不作限制。这里,工作表面是指用于检测用户的触摸操作的表面,例如触控装置130的触摸表面。For example, the touch device 130 may include a touch sensor and a controller (for example, a driver IC). The controller receives the electrical signal collected by the touch sensor, processes the electrical signal to obtain a touch signal, and provides the touch signal to the processor for further processing. . The embodiment of the present application does not limit the type, structure, and communication mode of the touch device 130. The touch device 130 includes a working surface with a certain area. The user can draw/write directly on the working surface of the touch device 130 with a finger, or use an active stylus or a passive stylus on the work surface of the touch device 130. Drawing/writing on the work surface is not limited in the embodiment of the present application. Here, the working surface refers to a surface used to detect a user's touch operation, such as the touch surface of the touch device 130.
例如,如图1所示,笔迹处理装置100还可以包括显示装置140。显示装置140被配置为显示各交互界面。例如,显示装置140可以包括显示屏、投影仪等显示装置。该显示装置140的显示屏例如为LCD显示屏、OLED显示屏、QLED显示屏、投影部件、VR头戴式显示设备(例如VR头盔、VR眼镜)、AR显示设备等,本申请的实施例对此不作限制。For example, as shown in FIG. 1, the handwriting processing device 100 may further include a display device 140. The display device 140 is configured to display various interactive interfaces. For example, the display device 140 may include a display device such as a display screen and a projector. The display screen of the display device 140 is, for example, an LCD display screen, an OLED display screen, a QLED display screen, a projection component, a VR head-mounted display device (such as a VR helmet, VR glasses), an AR display device, etc. This is not restricted.
例如,在一些实施例中,触控装置130和显示装置140可以集成为例如触控显示屏,从而既具有触控功能又具有显示功能。For example, in some embodiments, the touch device 130 and the display device 140 may be integrated into, for example, a touch screen, so as to have both touch function and display function.
例如,存储器110和处理器120可以集成在触控显示屏中,又例如,存储器110和处理器120也可以集成在云端服务器中。For example, the memory 110 and the processor 120 may be integrated in a touch display screen. For another example, the memory 110 and the processor 120 may also be integrated in a cloud server.
例如,电子设备100还可以包括通信模块,通信模块用于实现电子设备100与其他电子设备之间的通信,例如,当电子设备100应用于会议室时,通信模块可以将交互界面传输至远程参加会议的用户的手机或平板电脑内,从而用户的手机或平板电脑可以显示并存储交互界面。For example, the electronic device 100 may also include a communication module. The communication module is used to implement communication between the electronic device 100 and other electronic devices. For example, when the electronic device 100 is used in a conference room, the communication module may transmit an interactive interface to a remote participant. In the mobile phone or tablet computer of the user of the meeting, the user's mobile phone or tablet computer can display and store the interactive interface.
例如,处理器120可以控制电子设备100中的其它组件以执行期望的功能。处理器120可以是中央处理单元(CPU)、张量处理器(TPU)等具有数据处理能力和/或程序执行能力的器件。中央处理元(CPU)可以为X86或ARM架构等。For example, the processor 120 may control other components in the electronic device 100 to perform desired functions. The processor 120 may be a central processing unit (CPU), a tensor processor (TPU), or other devices with data processing capabilities and/or program execution capabilities. The central processing unit (CPU) can be an X86 or ARM architecture.
例如,存储器110可以包括一个或多个计算机程序产品的任意组合,计算机程序产品可以包括各种形式的计算机可读存储介质,例如易失性存储器和/或非易失性存储器。易失性存储器例如可以包括随机存取存储器(RAM)和/或高速缓冲存储器(cache)等。非易失性存储器例如可以包括只读存储器(ROM)、硬盘、可擦除可编程只读存储器(EPROM)、便携式紧致盘只读存储器(CD-ROM)、USB存储器、闪存等。在所述计算机可读存储介质上可以存储一个或多个计算机可读指令,处理器120可以运行所述计算机可读指令,以实现电子设备100的各种功能。For example, the memory 110 may include any combination of one or more computer program products, and the computer program products may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. Volatile memory may include random access memory (RAM) and/or cache memory (cache), for example. Non-volatile memory may include, for example, read only memory (ROM), hard disk, erasable programmable read only memory (EPROM), portable compact disk read only memory (CD-ROM), USB memory, flash memory, etc. One or more computer-readable instructions may be stored on the computer-readable storage medium, and the processor 120 may execute the computer-readable instructions to implement various functions of the electronic device 100.
例如,存储器110、存储器120、触控装置130和显示装置140等组件之间可以通过网络进行通信。网络可以包括无线网络、有线网络、和/或无线网络和有线网络的任意组合。网络可以包括局域网、互联网、电信网、基于互联网和/或电信网的物联网(Internet of Things)、和/或以上网络的任意组合等。有线网络例如可以采用双绞线、同轴电缆或光纤传输等方式进行通信,无线网络例如可以采用3G/4G/5G移动通信网络、蓝牙、Zigbee或者WiFi等通信方式。本申请对网络的类型和功能在此不作限制。For example, components such as the storage 110, the storage 120, the touch device 130, and the display device 140 may communicate through a network. The network may include a wireless network, a wired network, and/or any combination of a wireless network and a wired network. The network may include a local area network, the Internet, a telecommunications network, the Internet of Things (Internet of Things) based on the Internet and/or a telecommunications network, and/or any combination of the above networks, and so on. The wired network may, for example, use twisted pair, coaxial cable, or optical fiber transmission for communication, and the wireless network may use, for example, a 3G/4G/5G mobile communication network, Bluetooth, Zigbee, or WiFi. This application does not limit the types and functions of the network.
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiment of the present application takes an Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100 by way of example.
图2示出了本申请实施例的电子设备100的软件结构框图。FIG. 2 shows a block diagram of the software structure of the electronic device 100 according to an embodiment of the present application.
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层、应用程序框架层、安卓运行时(Android runtime)和系统库以及内核层。The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Communication between layers through software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, the application layer, the application framework layer, the Android runtime, the system library, and the kernel layer.
应用程序层可以包括一系列应用程序包。如图2所示,应用程序包可以包括电子白板应用、图库、视频播放器,还可包括相机、日历、通话、地图、导航、WLAN、蓝牙、音乐等应用程序。The application layer can include a series of application packages. As shown in Figure 2, the application package can include an electronic whiteboard application, a gallery, a video player, and can also include applications such as camera, calendar, call, map, navigation, WLAN, Bluetooth, and music.
在本申请的一些实施例中,电子白板应用可以提供电子设备与用户进行交互的界面,例如:让用户设置标准图形的类别、设置标准图形的初始尺寸、设置模板控件显示的标识的类型等。In some embodiments of the present application, the electronic whiteboard application may provide an interface for the electronic device to interact with the user, for example, allowing the user to set the type of standard graphics, set the initial size of the standard graphics, and set the type of logo displayed by the template control.
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
如图2所示,应用程序框架层可以包括窗口管理器、内容提供器、视图系统、资源管理器、通知管理器等。As shown in Figure 2, the application framework layer can include a window manager, a content provider, a view system, a resource manager, a notification manager, and so on.
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏、锁定屏幕、截取屏幕等。The window manager is used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, take a screenshot, etc.
在本申请的一些实施例中,窗口管理器可具体为窗口管理服务(WindowManagerService,WMS),该WMS存放有当前屏幕中显示的各个应用窗口的信息,例如:当前屏幕中显示的应用窗口的数量等信息。In some embodiments of the present application, the window manager may specifically be a window management service (WindowManagerService, WMS), and the WMS stores information of each application window displayed on the current screen, for example: the number of application windows displayed on the current screen And other information.
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频、图像、音频、拨打和接听的电话、浏览历史和书签、电话簿等。The content provider is used to store and retrieve data and make these data accessible to applications. The data may include videos, images, audios, phone calls made and received, browsing history and bookmarks, phone book, etc.
视图系统包括可视控件,例如显示文字的控件、显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。The view system includes visual controls, such as controls that display text, controls that display pictures, and so on. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface that includes a short message notification icon may include a view that displays text and a view that displays pictures.
资源管理器为应用程序提供各种资源,比如本地化字符串、图标、图片、布局文件、视频文件等等。The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音、电子设备振动、指示灯闪烁等。The notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and it can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify that the download is complete, message reminders, and so on. The notification manager can also be a notification that appears in the status bar at the top of the system in the form of a chart or a scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, text messages are prompted in the status bar, prompt sounds, electronic devices vibrate, and indicator lights flash.
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。Android Runtime includes core libraries and virtual machines. Android runtime is responsible for the scheduling and management of the Android system.
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。The core library consists of two parts: one part is the function function that the java language needs to call, and the other part is the core library of Android.
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理、堆栈管理、线程管理、安全和异常的管理以及垃圾回收等功能。The application layer and the application framework layer run in a virtual machine. The virtual machine executes the java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
系统库可以包括多个功能模块。例如:表面管理器(surface manager)、媒体库(MediaLibraries)、二维图形引擎(例如:SGL)、三维图形处理库(例如:OpenGL ES)等。The system library can include multiple functional modules. For example: surface manager (surface manager), media library (MediaLibraries), two-dimensional graphics engine (for example: SGL), three-dimensional graphics processing library (for example: OpenGL ES), etc.
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了二维和3D图层的融合。The surface manager is used to manage the display subsystem and provides a combination of 2D and 3D layers for multiple applications.
媒体库支持多种常用的音频、视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4、H.264、MP3、AAC、AMR、JPG、PNG等。The media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
三维图形处理库用于实现三维图形绘图、图像渲染、合成和图层处理等。The 3D graphics processing library is used to realize 3D graphics drawing, image rendering, synthesis and layer processing.
二维图形引擎是二维绘图的绘图引擎。The two-dimensional graphics engine is a graphics engine for two-dimensional graphics.
内核层是硬件和软件之间的层。内核层包含显示驱动、摄像头驱动、音频驱动、传感器驱动等。The kernel layer is the layer between hardware and software. The kernel layer includes display driver, camera driver, audio driver, sensor driver, etc.
以下实施例中所涉及的技术方案均可以在具有上述硬件架构和软件架构的电子设备100中实现。The technical solutions involved in the following embodiments can all be implemented in the electronic device 100 having the above-mentioned hardware architecture and software architecture.
以下,以电子设备100是电子白板设备为例,结合附图对本申请实施例提供的技术 方案进行详细说明。电子白板设备可以具有各种尺寸的触摸屏。例如,电子白板设备具有55寸以上触摸屏。Hereinafter, taking the electronic device 100 as an electronic whiteboard device as an example, the technical solutions provided by the embodiments of the present application will be described in detail with reference to the accompanying drawings. The electronic whiteboard device can have various sizes of touch screens. For example, an electronic whiteboard device has a touch screen of more than 55 inches.
在本申请提供的图形绘制方法中,用户在进入电子白板设备的电子白板后,可通过在触摸屏上用手指或主动笔等设备输入想要绘制的图形,在输入的过程中,电子白板设备根据已获取的轨迹点进行推荐图形的实时显示,以供用户选择。其中,电子白板应用的主要功能为响应用户通过手指或主动笔等设备的输入操作,进行图形绘制、文字呈现并显示在屏幕上,一般作为会议用软件。可理解的是,电子白板应用仅是用于举例说明和解释本申请,并不用于限制本申请,本申请提供的图形绘制方法也可应用于其他具有图形绘制功能的应用程序。In the graphics drawing method provided in this application, after entering the electronic whiteboard of the electronic whiteboard device, the user can input the graphics he wants to draw on the touch screen with a finger or active pen on the touch screen. During the input process, the electronic whiteboard device The acquired trajectory points are displayed in real time for the recommended graphics for the user to choose. Among them, the main function of the electronic whiteboard application is to respond to the user's input operations through devices such as fingers or active pens, drawing graphics, presenting text, and displaying them on the screen, and is generally used as conference software. It is understandable that the electronic whiteboard application is only used to illustrate and explain this application, and is not used to limit this application. The graphics drawing method provided in this application can also be applied to other applications with graphics drawing functions.
如图3所示,本申请实施例提供的图形绘制方法,应用于具有触摸屏的终端中,该方法包括如下步骤:As shown in FIG. 3, the graph drawing method provided by the embodiment of the present application is applied to a terminal with a touch screen, and the method includes the following steps:
S10、获取在触摸屏输入的多个轨迹点。S10. Acquire multiple track points input on the touch screen.
示例性的,在电子白板设备100开机后,其显示的桌面界面为显示各应用程序的图标,响应于用户对电子白板应用程序图标的例如手指触摸点击的触摸操作,电子白板设备100显示如图4所示的电子白板应用程序的界面。图4所示的电子白板应用程序的界面包括位于左上角的操作栏和位于右下角的导航栏,其中,操作栏包括指针、画笔、橡皮等用于绘图/书写的控件,导航栏包括后退键和主屏幕键,后退键用于返回上一界面或撤销上一操作,主屏幕键用于返回桌面界面。除操作栏和导航栏之外,界面的大部分区域为绘图/书写输入区,用户在触摸屏上用手指或主动笔等设备进行绘图/书写时,电子白板设备100获取轨迹点。Exemplarily, after the electronic whiteboard device 100 is turned on, its displayed desktop interface displays icons of various applications. In response to the user's touch operation of the electronic whiteboard application icons, such as a finger tap, the electronic whiteboard device 100 displays as shown in the figure 4 shows the interface of the electronic whiteboard application. The interface of the electronic whiteboard application shown in Figure 4 includes an operation bar in the upper left corner and a navigation bar in the lower right corner. The operation bar includes pointers, pens, erasers and other controls for drawing/writing, and the navigation bar includes the back button. And the home screen key, the back key is used to return to the previous interface or cancel the last operation, the home screen key is used to return to the desktop interface. Except for the operation bar and the navigation bar, most areas of the interface are drawing/writing input areas. When the user draws/writes with a finger or active pen on the touch screen, the electronic whiteboard device 100 obtains the track points.
在一些实施例中,触摸屏本身可以基于硬件(例如触控电路、采样电路等)和软件(例如,相关的程序算法)等获取用户在触摸屏上用手指或主动笔等设备输入的轨迹点,本申请包括但不限于此。In some embodiments, the touch screen itself can obtain the track points input by the user with a finger or active pen on the touch screen based on hardware (for example, touch circuit, sampling circuit, etc.) and software (for example, related program algorithms). Applications include but are not limited to this.
S20、根据各轨迹点的输入时刻和坐标确定属于同一图形的轨迹点。S20: Determine the trajectory points belonging to the same graph according to the input time and coordinates of each trajectory point.
在一些实施例中,步骤S20包括:In some embodiments, step S20 includes:
将连续的多个轨迹点确定为属于同一图形;并将与所述连续的多个轨迹点中任一轨迹点的坐标距离小于预设的第一距离阈值,且与所述连续的多个轨迹点中最后一个轨迹点的输入时刻的时间间距小于预设的时间阈值的轨迹点,与所述连续的多个轨迹点确定为属于同一图形。Determine the consecutive multiple trajectory points as belonging to the same graph; and set the coordinate distance to any one of the multiple consecutive trajectory points to be less than the preset first distance threshold, and to the consecutive multiple trajectories A track point whose time interval between the input moment of the last track point in the points is less than a preset time threshold is determined to belong to the same graph as the multiple consecutive track points.
示例性的,如图4所示的电子白板应用程序的界面中,用户输入的轨迹点形成的轨迹是两条分别由连续的轨迹点形成的轨迹,包括先由上至下画出的一条大致竖直轨迹和后由左至右画出的一条大致水平轨迹。Exemplarily, in the interface of the electronic whiteboard application program shown in Fig. 4, the trajectory formed by the trajectory points input by the user is two trajectories formed by successive trajectory points, including a rough line drawn from top to bottom. A vertical trajectory and a roughly horizontal trajectory drawn from left to right.
在判断各轨迹点是否属于同一图形时:When judging whether each track point belongs to the same graph:
首先,由于大致竖直轨迹中的轨迹点是连续的,因此,判定大致竖直轨迹中的轨迹点属于同一图形,设为图型A;First, since the track points in the roughly vertical trajectory are continuous, it is determined that the trajectory points in the roughly vertical trajectory belong to the same graph, and set it as pattern A;
然后,在获取到大致水平轨迹中的第1个轨迹点(最左侧轨迹点)时,进行如下两个条件的判断:(1)大致竖直轨迹中的每一轨迹点中是否存在与大致水平轨迹中的第1个轨迹点的坐标距离小于例如设置为200像素距离的第一距离阈值的轨迹点;(2)设大致竖直轨迹包括N个轨迹点,则大致水平轨迹中的第1个轨迹点的输入时刻t
2,1与大致竖 直轨迹中的第N个轨迹点(即,大致竖直轨迹中的最后一个轨迹点)的输入时刻t
1,N之间的时间间距△T=t
2,1-t
1,N是否小于设置为例如1秒(s)~3秒(s)之间的时间阈值。若以上两个条件(1)和(2)都成立,则将大致水平轨迹中的第1个轨迹点与大致竖直轨迹中的轨迹点判定为属于同一图形,即大致水平轨迹中的第1个轨迹点也属于图形A;若以上两个条件(1)和(2)中至少有一个不成立,则将大致水平轨迹中的第1个轨迹点与大致竖直轨迹中的轨迹点判定为不属于同一图形,即大致水平轨迹中的第1个轨迹点属于新的图形B;
Then, when the first trajectory point (the leftmost trajectory point) in the roughly horizontal trajectory is obtained, the following two conditions are judged: (1) Whether each trajectory point in the roughly vertical trajectory exists and roughly The coordinate distance of the first trajectory point in the horizontal trajectory is smaller than the trajectory point whose first distance threshold is set as 200 pixels distance; input track points in time t N-2,1 track points substantially vertical trajectory (i.e., the last track point substantially vertical trajectory) an input time between time t 1, N spacing △ T =t 2,1 -t 1, whether N is less than a time threshold set between, for example, 1 second (s) to 3 seconds (s). If the above two conditions (1) and (2) are both true, the first track point in the roughly horizontal trajectory and the trajectory point in the roughly vertical trajectory are judged to belong to the same graph, that is, the first trajectory point in the roughly horizontal trajectory The trajectory points also belong to graph A; if at least one of the above two conditions (1) and (2) is not true, the first trajectory point in the roughly horizontal trajectory and the trajectory point in the roughly vertical trajectory are judged as not Belong to the same graph, that is, the first track point in the roughly horizontal track belongs to the new graph B;
接着,以大致水平轨迹中的第1个轨迹点属于图形A为例,由于大致水平轨迹中的轨迹点是连续的,因此,判定大致水平轨迹中的轨迹点属于同一图形,即,大致水平轨迹中的轨迹点都属于图形A;Next, take the first trajectory point in the roughly horizontal trajectory as an example. Since the trajectory points in the roughly horizontal trajectory are continuous, it is determined that the trajectory points in the roughly horizontal trajectory belong to the same figure, that is, roughly horizontal trajectory. The track points in all belong to graph A;
最终,确定图4所示的界面中,用户输入的大致竖直轨迹和大致水平轨迹所包含的所有轨迹点都属于同一图形(都属于图形A)。Finally, it is determined that in the interface shown in FIG. 4, all the track points included in the roughly vertical trajectory and roughly horizontal trajectory input by the user belong to the same figure (all belong to figure A).
可见,本申请实施例提供的绘制图形方法,使得在用户两笔甚至多笔绘制一个图形时,对应的绘制轨迹也能够被正确识别为是否属于同一图形,或者说本申请实施例提供的绘制图形方法可适用于用户两笔甚至多笔绘制一个图形的情况,即使得绘制一个图形时出现一定程度的轨迹坐标不连续的偏差可以被接受,这样,大大提升了本申请实施例提供的绘制图形方法的有效性和适用性。It can be seen that the method for drawing graphics provided by the embodiments of the present application enables the corresponding drawing trajectory to be correctly identified as belonging to the same graphic when the user draws a graphic with two strokes or even multiple pens, or the drawing graphics provided by the embodiments of the present application The method can be applied to the situation where the user draws a figure with two or even multiple strokes, that is, a certain degree of discontinuous deviation of the track coordinates when drawing a figure can be accepted, thus greatly improving the drawing method provided by the embodiment of the application Validity and applicability.
S30、根据所述属于同一图形的轨迹点的坐标,确定属于同一图形的轨迹点形成的轨迹包含的轨迹偏移量所对应的坐标系角度区间。S30: According to the coordinates of the track points belonging to the same graph, determine the coordinate system angle interval corresponding to the track offset included in the track formed by the track points belonging to the same graph.
如图5所示,在一些实施例中,所述坐标系角度区间包括:As shown in FIG. 5, in some embodiments, the angle interval of the coordinate system includes:
与X轴正半轴夹角±45°内的第一角度区间51、与Y轴正半轴夹角±45°内的第二角度区间52、与X轴负半轴夹角±45°内的第三角度区间53和与Y轴负半轴夹角±45°内的第四角度区间54。The first angle interval 51 within ±45° with the positive half axis of the X axis, the second angle interval 52 within ±45° with the positive half axis of the Y axis, and within ±45° the included angle with the negative half axis of the X axis The third angle interval 53 and the fourth angle interval 54 within ±45° of the negative half axis of the Y axis.
此坐标系角度区间的划分方式,可在后续保证基于轨迹包含的偏移量所对应的坐标系角度区间对用户触摸绘制的图形进行识别的准确性的同时,保证在用户输入的绘制轨迹出现一定的偏差或者出现间断时本申请提供的图形绘制方法的有效性和适用性。This method of dividing the angle interval of the coordinate system can ensure the accuracy of recognizing the graphics drawn by the user touch based on the angle interval of the coordinate system corresponding to the offset contained in the trajectory. The validity and applicability of the graphic drawing method provided by this application when the deviation or discontinuity occurs.
除上述将360°角度区间等分为四个角度区间的坐标系角度区间划分方式外,本实施例中,也可采用其他方式划分坐标系角度区间:In addition to the foregoing coordinate system angle interval division method in which the 360° angle interval is equally divided into four angle intervals, in this embodiment, other methods may also be used to divide the coordinate system angle interval:
例如,采用将360°角度区间等分为八个角度区间的坐标系角度区间划分方式,即,坐标系角度区间包括:与X轴正半轴夹角±22.5°内的角度区间A、与X轴正半轴夹角+22.5°至+67.5°内的角度区间B、与Y轴正半轴夹角±22.5°内的角度区间C、与X轴负半轴夹角+22.5°至+67.5°内的角度区间D、与X轴负半轴夹角±22.5°内的角度区间E、与X轴负半轴夹角-67.5°至-22.5°内的角度区间F、与Y轴负半轴夹角±22.5°内的角度区间F和与与X轴正半轴夹角-67.5°至-22.5°内的角度区间G。For example, a coordinate system angle interval division method that divides the 360° angle interval into eight angle intervals is adopted, that is, the coordinate system angle interval includes: the angle interval A within ±22.5° of the positive half axis of the X axis, and X The included angle between the positive semi-axis of the axis is +22.5° to +67.5°, the angle interval B within the included angle of the positive axis of the Y axis is ±22.5°, and the included angle of the negative axis of the X axis is within +22.5° to +67.5 The angle interval D within °, the angle interval E within ±22.5° with the negative half axis of the X axis, the angle interval F within the negative half axis of the X axis from -67.5° to -22.5°, and the negative half of the Y axis The angle interval F within ±22.5° of the axis included angle and the angle interval G within the range of -67.5° to -22.5° with the positive half axis of the X axis.
再例如,也可采用不等分的方式划分360°角度区间。For another example, it is also possible to divide the 360° angular interval in an unequal division manner.
上述坐标系角度区间划分方式不能视为对本申请的限定,可基于对精度和有效性等方面的需求设置合适的划分方式。其中,坐标系角度区间划分的越细,即,每一坐标系角度区间涵盖的角度范围越小,则后续基于轨迹包含的偏移量所对应的坐标系角度区间对用户触摸绘制的图形进行识别的精度越高、可适应更加复杂的图形,但是可接受的用 户输入的绘制轨迹的偏差越小。The above-mentioned division method of the angle interval of the coordinate system cannot be regarded as a limitation of the present application, and an appropriate division method can be set based on the requirements for accuracy and effectiveness. Among them, the finer the division of the coordinate system angle interval, that is, the smaller the angle range covered by each coordinate system angle interval, the subsequent recognition of the graphics drawn by the user based on the coordinate system angle interval corresponding to the offset included in the trajectory The higher the accuracy, the more complex graphics can be adapted, but the smaller the deviation of the trajectory drawn by the acceptable user input.
在一些实施例中,步骤S30包括:In some embodiments, step S30 includes:
根据所述属于同一图形的轨迹点中的相邻轨迹点的坐标确定相邻轨迹点偏移量,根据所述相邻轨迹点偏移量确定属于同一图形的轨迹点形成的轨迹包含的轨迹偏移量。所述相邻轨迹点偏移量可以包括在第一方向(例如图5所示的X轴方向)上的偏移量和在第二方向(例如图5所示的Y轴方向)上的偏移量(例如在相应方向上的正负偏移值),其中第一方向与第二方向正交。Determine the offset of adjacent track points according to the coordinates of the adjacent track points in the track points belonging to the same graph, and determine the track offset included in the track formed by the track points belonging to the same graph according to the offset of the adjacent track points. Shift amount. The offset of the adjacent track points may include an offset in the first direction (for example, the X-axis direction shown in FIG. 5) and an offset in the second direction (for example, the Y-axis direction shown in FIG. 5). The amount of displacement (for example, the positive and negative offset values in the corresponding direction), where the first direction is orthogonal to the second direction.
进一步,在一些实施例中,在所述根据所述属于同一图形的轨迹点中的相邻轨迹点的坐标确定相邻轨迹点偏移量之前,还包括:Further, in some embodiments, before determining the offset of adjacent track points according to the coordinates of adjacent track points among the track points belonging to the same graph, the method further includes:
对于第N+1轨迹点与第N轨迹点形成的相邻轨迹点,若第N+1轨迹点与第N轨迹点之间的距离小于第二距离阈值,则用第N+2轨迹点取代第N+1轨迹点作为第N轨迹点的相邻轨迹点。For the adjacent trajectory point formed by the N+1th trajectory point and the Nth trajectory point, if the distance between the N+1th trajectory point and the Nth trajectory point is less than the second distance threshold, replace it with the N+2th trajectory point The N+1th trajectory point is regarded as the adjacent trajectory point of the Nth trajectory point.
由此,可通过筛除坐标密集的轨迹点,在不影响偏移量计算准确性的同时,减少不必要的计算量,提升图形识别效率。As a result, by filtering out track points with dense coordinates, without affecting the accuracy of the offset calculation, unnecessary calculations can be reduced, and the efficiency of pattern recognition can be improved.
示例性的,轨迹点是否密集可以相邻轨迹点之间的欧式距离为判断条件,例如,对于第N+1轨迹点与第N轨迹点形成的相邻轨迹点,若坐标为(x
N+1,y
N+1)的第N+1轨迹点与坐标为(x
N,y
N)的第N轨迹点之间的距离
小于例如设置为5像素距离的第二距离阈值,则第N+1轨迹点被忽略不计或者说舍弃,用第N+2轨迹点取代第N+1轨迹点作为第N轨迹点的相邻轨迹点。可理解的是,对于此时出现的第N+2轨迹点与第N轨迹点形成的相邻轨迹点,还可以继续依据第二距离阈值进行判断,以此类推直至出现与第N轨迹点之间的距离大于等于第二距离阈值的轨迹点,即,自第N+1轨迹点起,依次判断各轨迹点与第N轨迹点之间的距离是否大于等于第二距离阈值,将第一个满足条件的轨迹点作为第N轨迹点的相邻轨迹点,并舍弃第N轨迹点与所述第一个满足条件的轨迹点之间的轨迹点。
Exemplarily, whether the track points are dense can be determined by the Euclidean distance between adjacent track points. For example, for the adjacent track points formed by the N+1th track point and the Nth track point, if the coordinates are (x N+ 1 , the distance between the N+1th trajectory point of y N+1 ) and the Nth trajectory point with coordinates (x N , y N) If it is less than the second distance threshold set as 5 pixels distance, for example, the N+1th trajectory point is ignored or discarded, and the N+1th trajectory point is replaced by the N+2th trajectory point as the adjacent trajectory of the Nth trajectory point point. It is understandable that for the adjacent trajectory points formed by the N+2th trajectory point and the Nth trajectory point appearing at this time, the judgment can also be continued based on the second distance threshold, and so on until there is a difference between the Nth trajectory point and the Nth trajectory point. The distance between the trajectory points is greater than or equal to the second distance threshold, that is, starting from the N+1 trajectory point, it is determined whether the distance between each trajectory point and the Nth trajectory point is greater than or equal to the second distance threshold, and the first The trajectory point that meets the condition is regarded as the adjacent trajectory point of the Nth trajectory point, and the trajectory point between the Nth trajectory point and the first trajectory point that meets the condition is discarded.
进一步,在一些实施例中,所述根据所述相邻轨迹点偏移量确定属于同一图形的轨迹点形成的轨迹包含的轨迹偏移量包括:Further, in some embodiments, the determining the track offset included in the track formed by the track points belonging to the same graph according to the offset of the adjacent track points includes:
将连续的且处于同一坐标系角度区间的相邻轨迹点偏移量合并为一个处于该坐标系角度区间的轨迹偏移量。Combine consecutive adjacent track point offsets in the same coordinate system angle interval into one track offset in the coordinate system angle interval.
由此,可实现对连续的、处于同于同一坐标系角度区间的偏移量进行去冗余,提升图形识别效率。As a result, it is possible to achieve de-redundancy of continuous offsets that are in the same angular interval of the same coordinate system, and improve the efficiency of pattern recognition.
在一个具体示例中,确定属于同一图形的轨迹点形成的轨迹包含的轨迹偏移量所对应的坐标系角度区间包括:In a specific example, determining the coordinate system angle interval corresponding to the trajectory offset included in the trajectory formed by the trajectory points belonging to the same graph includes:
首先,对于属于同一图形的轨迹点形成的轨迹中的由连续轨迹点形成的至少一个连续轨迹(例如图4所示的图形A的轨迹包括两个连续轨迹,分别是图4中的大致竖直轨迹和大致水平轨迹),计算连续轨迹包含的每一对相邻轨迹点之间的偏移量,例如,对于第N+1轨迹点与第N轨迹点形成的相邻轨迹点,坐标为(x
N+1,y
N+1)的第N+1轨迹点与坐标为(x
N,y
N)的第N轨迹点之间的偏移量为(d
x,d
y),其中,X轴方向上的偏移量d
x=(x
N+1-x
N),Y轴方向上的偏移量d
y=(y
N+1-y
N)。
First of all, for at least one continuous trajectory formed by continuous trajectory points among trajectories formed by trajectory points belonging to the same pattern (for example, the trajectory of pattern A shown in FIG. 4 includes two continuous trajectories, which are roughly vertical in FIG. Trajectory and roughly horizontal trajectory), calculate the offset between each pair of adjacent trajectory points included in the continuous trajectory, for example, for the adjacent trajectory point formed by the N+1th trajectory point and the Nth trajectory point, the coordinates are ( The offset between the N+1th trajectory point of x N+1 , y N+1 ) and the Nth trajectory point with coordinates (x N , y N ) is (d x , d y ), where X The offset in the axis direction d x =(x N+1 -x N ), the offset in the Y axis direction d y =(y N+1 -y N ).
然后,对相邻轨迹点之间的偏移量进行重赋值及偏移量的坐标系角度区间映射。Then, the offset between adjacent track points is re-assigned and the offset is mapped to the angle interval of the coordinate system.
接续前述示例,以如图5所示的将360°角度区间等分为四个角度区间的坐标系角度区间划分方式为例,对于得到的相邻轨迹点之间的偏移量,可通过比较d
x与d
y的大小及取值的正负来进行坐标系角度区间映射与重新赋值标记,如表1所示。
Continuing the previous example, taking the coordinate system angle interval division method that divides the 360° angle interval into four angle intervals as shown in Figure 5 as an example, the obtained offset between adjacent track points can be compared The magnitudes of d x and d y and the positive and negative values are used for the coordinate system angle interval mapping and re-assignment mark, as shown in Table 1.
表1Table 1
重赋值后的偏移量可以表示相邻轨迹点之间的偏离量所对应的坐标系角度区间(或者说相邻轨迹点之间的偏离量的斜率所处的坐标系角度区间),这可以反映出用户输入的绘制轨迹的走势,考虑到用户手写输入的绘制轨迹通常不能绝对地规范,以直线为例,用户绘制直线时通常绘制轨迹不会完全笔直,因此,一小段连续坐标间偏移量取值不可能完全相同,但从实际应用角度考虑,不是每个相邻轨迹点偏移量在后续进行图形识别时都有被计算、统计的必要,因此可对连续的且同坐标系角度区间的斜率进行去冗余,使其表示这段时间内轨迹保持在一个坐标系角度区间中,只计算一次即可。去冗余的策略是顺序计算,只要偏移量中取值为0的同为d
x或者d
y,且另一个偏移量同为正数或者负数,则可将d
x、d
y对应相加,如果下一个偏移量与当前偏移量取0项或者正负不一样,则保存当前偏移量,从下一个偏移量开始计算与之相似的偏移量,在遇到与之不同的偏移量之前,将已相加得到的偏移量记录保存,即可就能得到简化后的偏移量,作为一个轨迹偏移量。依据简化后的偏移量的0值和正负值即可判断用户输入的绘制轨迹的斜率变化,即图形的走势或者说特征,从而可识别是何种图形。上述基于重赋值进行合并相邻轨迹点偏移量以去冗余的过程是一种实现方式,不应被视为对本实施例的限制。
The offset after re-assignment can represent the angle interval of the coordinate system corresponding to the deviation between adjacent track points (or the angle interval of the coordinate system where the slope of the deviation between adjacent track points is located), which can be Reflects the trend of the drawn trajectory input by the user. Considering that the drawn trajectory of the user's handwriting input is usually not absolutely standardized. Take a straight line as an example. When the user draws a straight line, the drawn trajectory is usually not completely straight. Therefore, a small segment of continuous coordinates is offset. The value of the measurement can not be exactly the same, but from the perspective of practical application, not every adjacent track point offset is necessary to be calculated and counted in the subsequent graphic recognition, so it can be used for continuous and same coordinate system angles. The slope of the interval is de-redundant, so that it indicates that the trajectory remains in an angle interval of the coordinate system during this period, and it is only calculated once. The strategy of de-redundancy is to calculate sequentially. As long as the offset value of 0 is the same as d x or d y , and the other offset is the same positive or negative number, then d x and d y can be corresponded to each other. Plus, if the next offset is 0 or different from the current offset, the current offset is saved, and the similar offset is calculated from the next offset. Before different offsets, record and save the offsets that have been added, and then the simplified offsets can be obtained as a track offset. Based on the 0 value and the positive and negative values of the simplified offset, the change in the slope of the drawing trajectory input by the user, that is, the trend or characteristic of the graph, can be judged, so that the graph can be identified. The foregoing process of merging the offsets of adjacent track points based on re-assignment to eliminate redundancy is an implementation manner, and should not be regarded as a limitation of this embodiment.
S40、在所述轨迹包含的轨迹偏移量所对应的坐标系角度区间符合预设规则时确定推荐的图形。S40: Determine a recommended graph when the angle interval of the coordinate system corresponding to the track offset included in the track meets a preset rule.
该方法还可以包括显示模板控件,所述模板控件包括所述推荐的图形的标识。The method may further include displaying a template control, the template control including an identification of the recommended graphic.
在一种可能的实现方式中,在坐标系角度区间采用如图5所示的划分方式的情况下,所述在所述轨迹包含的轨迹偏移量所对应的坐标系角度区间符合预设规则时确定推荐的图形包括:In a possible implementation manner, when the coordinate system angle interval is divided as shown in FIG. 5, the coordinate system angle interval corresponding to the trajectory offset included in the trajectory conforms to a preset rule When determining the recommended graphics include:
在所述轨迹仅包含处于一个坐标系角度区间的轨迹偏移量时,确定推荐的图形为直线;When the trajectory only includes the trajectory offset in an angular interval of the coordinate system, determining that the recommended figure is a straight line;
在所述轨迹包含两个处于相邻的两个坐标系角度区间的轨迹偏移量时,确定推荐的 图形包括矩形、三角形、梯形中的至少一个;When the trajectory includes two trajectory offsets in the angular intervals of two adjacent coordinate systems, it is determined that the recommended figure includes at least one of a rectangle, a triangle, and a trapezoid;
在所述轨迹包含两个或三个处于相对的两个坐标系角度区间的轨迹偏移量时,确定推荐的图形为三角形;When the trajectory includes two or three trajectory offsets in the angle interval of two opposite coordinate systems, determining that the recommended figure is a triangle;
在所述轨迹包含三个依次处于顺时针方向或逆时针方向排序的相邻的三个坐标系角度区间的轨迹偏移量时,确定推荐的图形包括圆形、椭圆形、矩形、三角形、梯形中的至少一个。When the trajectory includes three trajectory offsets of three adjacent coordinate system angle intervals sorted in a clockwise or counterclockwise direction, it is determined that the recommended graphics include a circle, an ellipse, a rectangle, a triangle, and a trapezoid. At least one of them.
由此,本申请提供的图形绘制方法涵盖了多种常用的标准图形,且可在用户完整绘制完成完整的图形之前,准确地实时推荐出符合用户绘制意图的标准图形。Therefore, the graphics drawing method provided in this application covers a variety of commonly used standard graphics, and can accurately and real-time recommend standard graphics that meet the user's drawing intention before the user completes the complete drawing.
可理解的是,本申请实施例提供的图形绘制方法能够识别的图形不仅限于上述列出的直线、圆形、椭圆形、矩形、三角形、梯形,还包括平行四边形、五边形、六边形,在此不一一列出,仅给出常用的图形的识别规则。另外,在坐标系角度区间划分方式改变的情况下,对可通过对预设规则的设计,使得本申请实施例提供的图形绘制方法能够识别出图形,其中,在坐标系角度区间划分的更细的情况下,还可识别出直角三角形、等腰三角形等更为细分的图形。It is understandable that the graphics that can be recognized by the graphics drawing method provided in the embodiments of the present application are not limited to the straight lines, circles, ellipses, rectangles, triangles, and trapezoids listed above, but also include parallelograms, pentagons, and hexagons. , I will not list them one by one here, only the recognition rules of commonly used graphics are given. In addition, in the case where the division method of the angle interval of the coordinate system is changed, the design of the preset rules can be used to enable the graph drawing method provided in the embodiment of the present application to recognize the graph. Among them, the angle interval of the coordinate system is more finely divided. In the case of, it can also identify more subdivided graphics such as right-angled triangles and isosceles triangles.
在一种可能的实现方式中,在所述显示模板控件之后,还包括:In a possible implementation manner, after the template control is displayed, the method further includes:
响应于对所述标识的第一操作,以所述属于同一图形的轨迹点中第1个轨迹点的坐标为基准坐标,显示所述标识对应的图形。In response to the first operation on the mark, the coordinate of the first track point among the track points belonging to the same graph is used as the reference coordinate, and the graph corresponding to the mark is displayed.
在一种可能的实现方式中,所述显示模板控件包括:In a possible implementation manner, the display template control includes:
在属于同一图形的轨迹点形成的轨迹对应的位置显示模板控件。The template control is displayed at the position corresponding to the trajectory formed by the trajectory points belonging to the same graph.
由此,可对应用户输入绘制轨迹的位置调整推荐图形的标识的显示位置,使得用户操作更加便捷,特别是对于例如具有55寸以上触摸屏的电子白板设备等大屏终端而言。As a result, the display position of the identification of the recommended graphic can be adjusted corresponding to the position of the user input to draw the trajectory, making user operations more convenient, especially for large-screen terminals such as electronic whiteboard devices with a touch screen of 55 inches or more.
在一种可能的实现方式中,在所述显示模板控件之后,还包括:In a possible implementation manner, after the template control is displayed, the method further includes:
若属于同一图形的轨迹点形成的轨迹的长度大于预设长度阈值,则停止显示所述模板控件。If the length of the trajectory formed by the trajectory points belonging to the same graph is greater than the preset length threshold, then stop displaying the template control.
在一个具体示例中,在通过步骤S30得到属于同一图形的轨迹点形成的轨迹包含的轨迹偏移量所对应的坐标系角度区间后,进行图形识别以确定推荐的图形,并进行推荐的过程例如:In a specific example, after obtaining the coordinate system angle interval corresponding to the track offset included in the track formed by the track points belonging to the same pattern through step S30, pattern recognition is performed to determine the recommended pattern, and the recommended process is performed, for example :
例如,在如图6所示的电子白板应用程序的界面中,用户先由上至下画出一段大致竖直轨迹,电子白板设备100获取到用户输入的绘制轨迹并经过步骤S10-S30确定该轨迹仅包含对应第四角度区间的一个轨迹偏移量,此时,基于前述“在所述轨迹仅包含处于一个坐标系角度区间的轨迹偏移量时,确定推荐的图形为直线”,确定推荐的图形为直线,如图6所示的界面,显示模板控件61,模板控件61中显示文字标识“直线”(可理解的是,也可利用直线的例如缩略图图形的图形标识代替文字标识,或同时显示图形标识和文字标识)。For example, in the interface of the electronic whiteboard application program as shown in FIG. 6, the user first draws a roughly vertical track from top to bottom, and the electronic whiteboard device 100 obtains the drawing track input by the user and determines the trajectory through steps S10-S30. The trajectory contains only one trajectory offset corresponding to the fourth angle interval. At this time, based on the aforementioned "when the trajectory only contains the trajectory offset in one coordinate system angle interval, determine the recommended figure as a straight line", the recommendation is determined The graphic is a straight line. As shown in Fig. 6, the template control 61 is displayed, and the text logo "straight line" is displayed in the template control 61. Or display the graphic logo and text logo at the same time).
之后:after:
示例情况一、若用户对图6所示的界面中的文字标识“直线”施加例如手指触摸点击的触摸操作,则电子白板设备100响应于该操作,显示如图7所示的界面,即,关闭显示模板控件并以上述“用户由上至下画出的一段大致竖直轨迹”的第1个轨迹点为起点显示一条标准直线,用户可通过拖拽操作等操作方式调整该标准直线的长度等参数;Example situation 1: If the user applies a touch operation such as a finger touch to the text mark "straight line" in the interface shown in FIG. 6, the electronic whiteboard device 100 responds to the operation and displays the interface as shown in FIG. 7, that is, Close the display template control and display a standard straight line starting from the first trajectory point of the above "a section of roughly vertical trajectory drawn by the user from top to bottom". The user can adjust the length of the standard straight line by dragging and other operations. Other parameters;
示例情况二、若用户在由上至下画出一段大致竖直轨迹之后的例如1秒(s)的时间阈值限定的时间间隔内,又由左至右画出一段大致水平轨迹,其中,大致水平轨迹的第1个轨迹点与先画出的大致竖直轨迹的前几个轨迹点中的某一个或几个的距离小于例如200像素距离的第一距离阈值,电子白板设备100获取到用户输入的绘制轨迹并经过步骤S10-S30,在确定大致水平轨迹与先获取到的大致竖直轨迹属于同一图形后,确定该图型的两条轨迹包含对应第四角度区间和第一角度区间的两个轨迹偏移量,此时,基于前述“在所述轨迹包含两个处于相邻的两个坐标系角度区间的轨迹偏移量时,确定推荐的图形包括矩形、三角形、梯形中的至少一个”,确定推荐的图形为矩形、三角形、梯形中的至少一个,如图8所示的界面,显示模板控件81,模板控件81中显示文字标识“矩形”和“三角形”。若用户对图8所示的界面中的文字标识“矩形”施加例如手指触摸点击的触摸操作,则电子白板设备100响应于该操作,显示如图9所示的界面,即,关闭显示模板控件并以上述“用户由上至下画出一条大致竖直轨迹”的第1个轨迹点为左上顶点显示一个标准矩形,用户可通过拖拽操作等操作方式调整该标准矩形的长、宽等参数;Example case 2: If the user draws a roughly horizontal trace from left to right within a time interval defined by a time threshold of, for example, 1 second (s) after drawing a roughly vertical trace from top to bottom, where roughly The distance between the first trajectory point of the horizontal trajectory and one or more of the first few trajectory points of the roughly vertical trajectory drawn first is less than the first distance threshold, such as a distance of 200 pixels, and the electronic whiteboard device 100 obtains the user After the input drawn trajectory has gone through steps S10-S30, after it is determined that the roughly horizontal trajectory and the roughly vertical trajectory acquired first belong to the same figure, it is determined that the two trajectories of the figure type include the corresponding fourth angle interval and the first angle interval. Two trajectory offsets. At this time, based on the aforementioned "when the trajectory includes two trajectory offsets in the angle intervals of two adjacent coordinate systems, it is determined that the recommended graphics include at least one of a rectangle, a triangle, and a trapezoid. One", it is determined that the recommended graphic is at least one of a rectangle, a triangle, and a trapezoid. The interface shown in FIG. 8 displays a template control 81, and the template control 81 displays the text labels "rectangle" and "triangle". If the user applies a touch operation such as a finger touch click to the text mark "rectangle" in the interface shown in FIG. 8, the electronic whiteboard device 100 displays the interface shown in FIG. 9 in response to the operation, that is, closes the display template control And with the first track point of the above "the user draws a roughly vertical track from top to bottom" as the upper left vertex, a standard rectangle is displayed, and the user can adjust the length and width of the standard rectangle through drag operations and other operations. ;
示例情况三、若用户先由上至下画出一段大致竖直轨迹后继续画该轨迹直至该轨迹的长度大于例如1000像素距离的长度阈值,则关闭模板控件61。Example situation 3: If the user first draws a substantially vertical track from top to bottom and then continues to draw the track until the track length is greater than the length threshold of, for example, a distance of 1000 pixels, the template control 61 is closed.
再例如,在如图10所示的电子白板应用程序的界面中,用户逆时针画出一段弧形轨迹,电子白板设备100获取到用户输入的绘制轨迹并经过步骤S10-S30确定该轨迹包含依次排列的对应第三角度区间、第四角度区间和第一角度区间的三个轨迹偏移量,此时,基于前述“在所述轨迹包含三个依次处于顺时针方向或逆时针方向排序的相邻的三个坐标系角度区间的轨迹偏移量时,确定推荐的图形包括圆形、椭圆形、矩形、三角形、梯形中的至少一个”,确定推荐的图形为圆形、椭圆形、矩形、三角形、梯形中的至少一个”,如图10所示的界面,显示模板控件101,模板控件101中显示文字标识“圆形”,可见,用户仅画出对应大致半圆的弧形时即可推荐出圆形。之后,若用户对图10所示的界面中的文字标识“圆形”施加例如手指触摸点击的触摸操作,则电子白板设备100响应于该操作,显示如图11所示的界面,即,关闭显示模板控件并以上述“用户由上至下画出的一段弧形轨迹”的第1个轨迹点为上方切点显示一个标准圆形,用户可通过拖拽操作等操作方式调整该标准圆形的直径等参数。For another example, in the interface of the electronic whiteboard application program shown in FIG. 10, the user draws an arc-shaped trajectory counterclockwise, and the electronic whiteboard device 100 obtains the drawing trajectory input by the user and determines that the trajectory contains successive steps S10-S30. The three trajectory offsets corresponding to the third angle interval, the fourth angle interval, and the first angle interval are arranged. At this time, based on the aforementioned "the trajectory includes three phases ordered in a clockwise or counterclockwise direction. When determining the trajectory offset of the three adjacent coordinate system angle intervals, determine that the recommended graphics include at least one of a circle, an ellipse, a rectangle, a triangle, and a trapezoid", and determine that the recommended graphics are a circle, an ellipse, a rectangle, At least one of triangle and trapezoid", as shown in Figure 10, the template control 101 is displayed, and the text logo "circle" is displayed in the template control 101. It can be seen that the user can recommend it only when the user draws an arc corresponding to a roughly semicircle. After that, if the user applies a touch operation such as a finger touch to the text mark "circle" in the interface shown in FIG. 10, the electronic whiteboard device 100 responds to the operation and displays the interface as shown in FIG. 11 , That is, close the display template control and display a standard circle with the first trajectory point of the above "a segment of arc trajectory drawn by the user from top to bottom" as the upper tangent point, which can be adjusted by the user through drag operations and other operations The diameter of the standard circle and other parameters.
综上所述,本申请实施例提供的图形绘制方法,电子白板设备100可基于轨迹包含的偏移量所对应的坐标系角度区间,实时地对用户触摸绘制的图形进行识别,从而可实时地推荐符合用户绘制意图的标准图形,具有操作便捷、实时性强、绘制效率高等优点,提升了绘图的交互体验。其中,基于轨迹包含的偏移量所对应的坐标系角度区间对用户触摸绘制的图形进行识别,可实现不需用户输入的绘制轨迹非常规范且严格地连续,也能够准确识别出绘制的图形,保证了本申请实施例提供的图形绘制方法的有效性和适用性。In summary, in the graphics drawing method provided by the embodiments of the present application, the electronic whiteboard device 100 can recognize the graphics drawn by the user's touch in real time based on the angle interval of the coordinate system corresponding to the offset included in the trajectory. Recommend standard graphics that meet the user's drawing intention, which has the advantages of convenient operation, strong real-time performance, and high drawing efficiency, which improves the interactive experience of drawing. Among them, based on the coordinate system angle interval corresponding to the offset contained in the trajectory, the user touches and draws the figure to be recognized, which can realize the drawing trajectory without user input is very standardized and strictly continuous, and can also accurately identify the drawn figure. The validity and applicability of the graphics drawing method provided in the embodiments of the present application are guaranteed.
本申请实施例还提供一种芯片系统,如图12所示,该芯片系统包括至少一个处理器1201和至少一个接口电路1202。处理器1201和接口电路1202可通过线路互联。例如,接口电路1202可用于从其它装置(例如移动终端100的存储器)接收信号。又例如,接口电路1202可用于向其它装置(例如处理器1201)发送信号。示例性的,接口电路1202可读取存储器中存储的指令,并将该指令发送给处理器1201。当所述指令被处理器1201 执行时,可使得电子设备执行上述实施例中的电子设备100(比如,电子白板设备)执行的各个步骤。当然,该芯片系统还可以包含其他分立器件,本申请实施例对此不作具体限定。An embodiment of the present application also provides a chip system. As shown in FIG. 12, the chip system includes at least one processor 1201 and at least one interface circuit 1202. The processor 1201 and the interface circuit 1202 may be interconnected by wires. For example, the interface circuit 1202 may be used to receive signals from other devices (such as the memory of the mobile terminal 100). For another example, the interface circuit 1202 may be used to send signals to other devices (such as the processor 1201). Exemplarily, the interface circuit 1202 can read instructions stored in the memory, and send the instructions to the processor 1201. When the instructions are executed by the processor 1201, the electronic device can be made to execute the various steps executed by the electronic device 100 (for example, an electronic whiteboard device) in the foregoing embodiment. Of course, the chip system may also include other discrete devices, which are not specifically limited in the embodiment of the present application.
可以理解的是,上述终端等为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请实施例能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明实施例的范围。It can be understood that, in order to realize the above-mentioned functions, the above-mentioned terminal and the like include hardware structures and/or software modules corresponding to each function. Those skilled in the art should easily realize that in combination with the units and algorithm steps of the examples described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software-driven hardware depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered as going beyond the scope of the embodiments of the present invention.
本申请实施例可以根据上述方法示例对上述终端等进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本发明实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。The embodiment of the present application may divide the above-mentioned terminal and the like into functional modules according to the above method examples. For example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The above-mentioned integrated modules can be implemented in the form of hardware or software function modules. It should be noted that the division of modules in the embodiment of the present invention is illustrative, and is only a logical function division, and there may be other division methods in actual implementation.
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of the description, only the division of the above-mentioned functional modules is used for illustration. In practical applications, the above-mentioned functions can be allocated according to needs. It is completed by different functional modules, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. For the specific working process of the above-described system, device, and unit, reference may be made to the corresponding process in the foregoing method embodiment, which is not repeated here.
在本申请实施例各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。The functional units in the various embodiments of the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对相关技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:快闪存储器、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application are essentially or the part that contributes to related technologies, or all or part of the technical solutions can be embodied in the form of software products, and the computer software products are stored in a storage medium. It includes several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk and other media that can store program codes.
显然,本申请的上述实施例仅仅是为清楚地说明本申请所作的举例,而并非是对本申请的实施方式的限定,对于本领域的普通技术人员来说,在上述说明的基础上还可以做出其它不同形式的变化或变动,这里无法对所有的实施方式予以穷举,凡是属于本申请的技术方案所引伸出的显而易见的变化或变动仍处于本申请的保护范围之列。Obviously, the above-mentioned embodiments of this application are merely examples to clearly illustrate this application, and are not meant to limit the implementation of this application. For those of ordinary skill in the art, they can also do on the basis of the above description. Other changes or changes in different forms cannot be exhaustively listed here. Any obvious changes or changes derived from the technical solutions of this application are still within the scope of protection of this application.