WO2016149941A1 - Drawing pen, electronic device and drawing method - Google Patents

Drawing pen, electronic device and drawing method Download PDF

Info

Publication number
WO2016149941A1
WO2016149941A1 PCT/CN2015/075133 CN2015075133W WO2016149941A1 WO 2016149941 A1 WO2016149941 A1 WO 2016149941A1 CN 2015075133 W CN2015075133 W CN 2015075133W WO 2016149941 A1 WO2016149941 A1 WO 2016149941A1
Authority
WO
WIPO (PCT)
Prior art keywords
coordinate
pressure data
pen
group
pressure
Prior art date
Application number
PCT/CN2015/075133
Other languages
French (fr)
Chinese (zh)
Inventor
陈磊
Original Assignee
华为技术有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2015/075133 priority Critical patent/WO2016149941A1/en
Priority to CN201580010175.3A priority patent/CN106471446B/en
Publication of WO2016149941A1 publication Critical patent/WO2016149941A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/033Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor
    • G06F3/0354Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor with detection of 2D relative movements between the device, or an operating part thereof, and a plane or surface, e.g. 2D mice, trackballs, pens or pucks

Definitions

  • Embodiments of the present invention relate to the field of computer graphics, and in particular, to a drawing pen, an electronic device, and a drawing method.
  • the functions of portable electronic devices are becoming more and more powerful.
  • the user can directly draw an image on the touch screen of the electronic device with a finger or a stylus.
  • the principle that the user directly performs image drawing on the touch screen is as follows: when the electronic device is in the image drawing state, the touch screen controller collects the contact information of the user on the touch screen, and reports the contact information collected successively to the electronic device.
  • the processor of the device the processor sequentially connects the coordinate points corresponding to the contact information reported by the touch screen controller in sequence through the lines, that is, the image drawn by the user on the touch screen can be obtained.
  • the frequency of reporting the contact information by the touch screen controller is limited by the refresh frequency of the touch screen, that is, each time the touch screen is refreshed, the touch screen controller can only report the contact information corresponding to one touch point, and the touch screen is
  • the refresh frequency is mostly 60 Hz, which causes the accuracy of the image drawn by the electronic device to be low, and the drawing effect is poor.
  • the embodiment of the present invention provides a drawing pen, Electronic equipment and drawing methods.
  • a drawing pen comprising: a pen head, a casing, at least three pressure sensors, a processor, and a transceiver;
  • the pen tip is semi-buried in the outer casing, the at least three pressure sensors are fixed inside the outer casing, and an angle between any two adjacent pressure sensors to a vertical line of a center line of the pen tip Less than 180°;
  • the processor is electrically connected to the at least three pressure sensors and the transceiver, respectively;
  • the processor is configured to acquire pressure data collected by the at least three pressure sensors according to a preset sampling frequency
  • the processor is further configured to control, according to the acquired pressure data, the transceiver to send drawing data to the electronic device, so that the electronic device draws an image according to the drawing data.
  • the housing is provided with a holding identifier for indicating a gripping manner of holding the painting pen.
  • the preset sampling frequency is greater than 60 Hz.
  • the drawing data is the pressure data.
  • the mapping data is N-1 intermediate The coordinates of the point, N ⁇ 2;
  • the processor is further configured to acquire coordinates of the N-1 intermediate points according to the pressure data by:
  • the processor controls the transceiver to receive first and second coordinates acquired and transmitted by the electronic device in real time, where the first coordinate and the second coordinate are drawings of the pen tip on the electronic device The coordinates of the two points that the region passes through;
  • the processor according to the first coordinate, the second coordinate, and the first N-1 group of N sets of pressure data sequentially acquired within a time period in which the first coordinate and the second coordinate are received
  • the pressure data calculates coordinates of the N-1 intermediate points that the pen tip sequentially passes between the first coordinate and the second coordinate.
  • the at least three pressure sensors are included in each of the first N-1 sets of pressure data The two largest pressure values collected and the respective directions of the two pressure values;
  • the processor is specifically configured to calculate coordinates of the N-1 intermediate points that the pen tip sequentially passes between the first coordinate and the second coordinate by:
  • the processor calculates a linear distance L between the first coordinate and the second coordinate and a connection direction a from the first coordinate to the second coordinate;
  • the processor is further configured to calculate, according to the two pressure values included in the i-th group of pressure data The drawing strength of the i-th group of pressure data;
  • the processor is further configured to control, by the transceiver, the drawing strength corresponding to the first N-1 group pressure data when the transceiver is collected to the electronic device.
  • an electronic device comprising: a processor, a memory, and a transceiver; wherein the memory is for storing a plurality of instructions, the instructions being configured to be executed by the processor ;
  • the processor is configured to control the transceiver to receive drawing data sent by a drawing pen;
  • the processor is configured to draw an image according to the drawing data.
  • the drawing data is pressure data collected by at least three pressure sensors in the drawing pen; when the processor draws an image according to the drawing data, the specific Used for:
  • first coordinate and a second coordinate where the first coordinate and the second coordinate are coordinates of two points that the pen tip of the drawing pen passes in the drawing area of the electronic device; according to the first coordinate And the second coordinate and the first N-1 of the N sets of pressure data sequentially acquired by the drawing pen within a time period in which the coordinate acquiring unit acquires the first coordinate and the second coordinate Group pressure data, calculating coordinates of N-1 intermediate points sequentially passing between the first coordinate and the second coordinate, N ⁇ 2; drawing the first coordinate, the N-1 The coordinates of the intermediate points and the coordinate images between the two coordinate points corresponding to each of the second coordinates.
  • the at least three pressure sensors are included in each of the first N-1 sets of pressure data The two largest pressure values collected and the respective directions of the two pressure values;
  • the processor calculates the pen tip sequentially between the first coordinate and the second coordinate When the coordinates of N-1 intermediate points have passed, they are specifically used to:
  • the processor is further configured to calculate, according to the two pressure values included in the i-th group pressure data Drawing force of the drawing pen when collecting the i-th group pressure data;
  • the processor is further configured to separately set two adjacent coordinate points of each group according to respective drawing strengths when the drawing pen collects each group of pressure data in the first N-1 group pressure data
  • An image attribute of the connected image the image attribute including at least one of a connection color and a connection thickness.
  • the drawing data is coordinates of N-1 intermediate points between the first coordinate and the second coordinate; the first coordinate and the second coordinate are Describe the coordinates of two points that the pen head passes in the drawing area of the electronic device;
  • the processor is configured to draw an image according to the drawing data by:
  • the processor draws a line image between the first coordinate, the coordinates of the N-1 intermediate points, and the coordinate points corresponding to the second coordinates, and the adjacent two coordinate points of each group.
  • the processor is further configured to control the transceiver to receive the pen sent by the pen Corresponding drawing force when collecting each group of pressure data in the front N-1 group pressure data;
  • the processor is further configured to separately set two adjacent coordinate points of each group according to respective drawing strengths when the drawing pen collects each group of pressure data in the first N-1 group pressure data
  • An image attribute of the connected image the image attribute including at least one of a connection color and a connection thickness.
  • a drawing method for use in a drawing pen, the method comprising:
  • the drawing data is the pressure data.
  • the drawing data is a coordinate of N-1 intermediate points, and N ⁇ 2; and the transmitting and receiving in the drawing pen is controlled according to the acquired pressure data.
  • the device sends the drawing data to the electronic device, including:
  • Controlling, by the transceiver, a first coordinate and a second coordinate that are acquired and sent by the electronic device in real time, where the first coordinate and the second coordinate are successively passed by the pen tip in a drawing area of the electronic device The coordinates of two points;
  • the at least three pressure sensors are included in each of the first N-1 group pressure data
  • the first N-1 group pressure data in the N sets of pressure data sequentially acquired within the time period is calculated by calculating the N-1 intermediate points of the pen head sequentially passing between the first coordinate and the second coordinate Coordinates, including:
  • the method further includes:
  • a drawing method for use in an electronic device, the method comprising:
  • An image is drawn based on the drawing data.
  • the drawing data is pressure data collected by at least three pressure sensors in the drawing pen;
  • the drawing an image according to the drawing data specifically includes:
  • first coordinate and the second coordinate are coordinates of two points that the pen tip of the drawing pen passes successively in the drawing area of the electronic device
  • the at least three pressure sensors are included in each group of the first N-1 group pressure data
  • the method further includes:
  • connection image And respectively setting an image of the connection image between the two adjacent coordinate points of each group according to the drawing strength corresponding to each group of pressure data in the first N-1 group pressure data of the drawing pen
  • image attribute including at least one of a connection color and a connection thickness.
  • the drawing data is a coordinate of N-1 intermediate points between the first coordinate and the second coordinate; the first coordinate and the second coordinate are Describe the coordinates of two points that the pen head passes in the drawing area of the electronic device;
  • the drawing an image according to the drawing data comprises:
  • the method further includes:
  • connection image And respectively setting an image of the connection image between the two adjacent coordinate points of each group according to the drawing strength corresponding to each group of pressure data in the first N-1 group pressure data of the drawing pen
  • image attribute including at least one of a connection color and a connection thickness.
  • Obtaining pressure data collected by the pressure sensor by setting at least three pressure sensors around the pen head in the drawing pen, and sending drawing data required for drawing to the electronic device according to the acquired pressure data, so that the electronic device draws according to the drawing data
  • the image because the frequency of the pressure data acquired by the pen is not limited by the screen refresh rate of the electronic device, can be much higher than 60 Hz, which can greatly improve the accuracy and drawing effect of the image drawn by the electronic device.
  • FIG. 1 is a schematic diagram of an implementation environment involved in a drawing method provided by some embodiments of the present invention.
  • FIG. 2 is a structural diagram of a drawing pen provided by an embodiment of the present invention.
  • FIG. 3 is a structural diagram of a drawing pen according to another embodiment of the present invention.
  • FIG. 4 is a schematic diagram of coordinate determination of an intermediate point according to another embodiment of the present invention.
  • FIG. 5 is a block diagram of an electronic device according to an embodiment of the present invention.
  • FIG. 6 is a block diagram of a drawing apparatus according to an embodiment of the present invention.
  • FIG. 7 is a flowchart of a method for drawing a method according to an embodiment of the present invention.
  • FIG. 8 is a flowchart of a method for drawing a method according to an embodiment of the present invention.
  • FIG. 9 is a flowchart of a method for drawing a method according to another embodiment of the present invention.
  • FIG. 10 is a flowchart of a method for drawing a method according to another embodiment of the present invention.
  • FIG. 1 is a schematic diagram showing an implementation environment involved in a drawing method provided by some embodiments of the present invention.
  • the implementation environment includes a drawing pen 110 and an electronic device 120.
  • the electronic device 120 may be a device such as a smart phone, a tablet computer, or an e-book reader.
  • the drawing pen 110 and the electronic device 120 are connected by wire or wirelessly.
  • a pressure sensor is disposed in the drawing pen, and the drawing pen collects pressure data received by the pressure sensor during the drawing process according to a certain sampling frequency, and calculates the drawing pen according to the pressure value and direction in the pressure data.
  • the electronic device draws an image according to the calculation result each time the movement data and the drawing force are collected.
  • the calculation process may be completed by a drawing pen, or may be completed by an electronic device, or may be completed by a drawing pen and an electronic device respectively. part of it.
  • the solution can greatly improve the drawing compared to the scheme of drawing directly in the touch screen. effect.
  • FIG. 2 shows a structural diagram of a drawing pen provided by an embodiment of the present invention.
  • the drawing pen may be the drawing pen 110 in the drawing system shown in Fig. 1, wherein the left half of Fig. 2 is a longitudinal sectional view of the drawing pen, and the right half is a longitudinal sectional view of the writing head and the pressure sensor portion.
  • the pen can include: a pen tip 210, a housing 220, at least three pressure sensors 230, a processor 240, and a transceiver 250;
  • the pen tip 210 is half buried in the outer casing 220, and the at least three pressure sensors 230 are fixed inside the outer casing 220, and any two adjacent pressure sensors are between the vertical lines of the center line of the pen tip 210.
  • the angle ⁇ is less than 180°;
  • the processor 240 is electrically connected to the at least three pressure sensors 230 and the transceiver 250 respectively;
  • the processor 240 is configured to acquire pressure data collected by the at least three pressure sensors 230 according to a preset sampling frequency
  • the processor 240 is further configured to control, according to the acquired pressure data, the transceiver 250 to send drawing data to the electronic device, so that the electronic device draws an image according to the drawing data.
  • the drawing pen acquires pressure data collected by the pressure sensor by setting at least three pressure sensors around the pen head in the drawing pen, and sends a drawing to the electronic device according to the acquired pressure data.
  • the required drawing data so that the electronic device draws an image according to the drawing data, because the frequency of the pressure data acquired by the drawing pen is not limited by the screen refresh rate of the electronic device, and can be much higher than 60 Hz, which can greatly improve the drawing of the image by the electronic device. Precision and rendering effects.
  • FIG. 3 shows a structural diagram of a drawing pen according to another embodiment of the present invention.
  • the drawing pen may be the drawing pen 110 in the drawing system shown in Fig. 1, wherein the left half of Fig. 3 is a longitudinal sectional view of the drawing pen, and the right half is a longitudinal sectional view of the writing head and the pressure sensor portion.
  • the pen can include: a pen tip 210, a housing 220, at least three pressure sensors 230, a processor 240, and a transceiver 250;
  • connection relationship between the pen tip 210, the outer casing 220, the at least three pressure sensors 230, the processor 240, and the transceiver 250 and the operation steps performed by the processor 20 are the same as those of the drawing pen shown in FIG. 2 above. The description in an embodiment is not described herein again.
  • the housing 220 is provided with a holding identifier 221, and the holding identifier 221 is used to refer to Show the grip form of the drawing pen.
  • the user can be instructed to hold the pen with a fixed hand grip form, for example, by adding a groove to the brush to inform the user of the manner of holding the object, thereby ensuring The grip form of the user and the corresponding direction of the sensor are the same every time the user holds the pen.
  • the preset sampling frequency is greater than 60 Hz.
  • the sampling frequency can theoretically be set very high, for example, the sampling frequency can be set to 1000 Hz.
  • the drawing data is a coordinate of N-1 intermediate points, and N ⁇ 2; the processor is further configured to acquire coordinates of the N-1 intermediate points according to the pressure data by: :
  • the processor 240 controls the transceiver to receive the first coordinate and the second coordinate acquired and sent by the electronic device in real time, where the first coordinate and the second coordinate are the writing head of the electronic device in the electronic device. The coordinates of the two points in the drawing area.
  • the drawing area of the electronic device may be a designated area in the touch screen of the electronic device, or the drawing area may also be a drawing area in the drawing board associated with the electronic device.
  • the touch screen or the drawing board can report the contact information to the electronic device, and the electronic device can acquire the coordinates of the two points that the pen tip slides in the drawing area, the electronic device. Each time a coordinate is acquired, the coordinates to be acquired are sent to the drawing pen in real time.
  • the processor 240 according to the first coordinate, the second coordinate, and the first N-1 of the N sets of pressure data sequentially acquired within a time period in which the first coordinate and the second coordinate are received
  • the group pressure data is used to calculate coordinates of N-1 intermediate points that the pen tip sequentially passes between the first coordinate and the second coordinate.
  • each set of pressure data in the front N-1 group pressure data includes a maximum of two pressure values collected by the at least three pressure sensors and a direction of each of the two pressure values.
  • each set of pressure data acquired by the processor contains two effective pressures. The force value and the direction of the two effective pressure values.
  • the drawing pen sends the coordinates of the determined N-1 intermediate points to the electronic device, and the electronic device can draw a sliding track between the two coordinates of the writing head.
  • the processor 340 is configured to calculate coordinates of the N-1 intermediate points that the pen tip sequentially passes between the first coordinate and the second coordinate by:
  • the processor calculates a linear distance L between the first coordinate and the second coordinate and a connection direction a from the first coordinate to the second coordinate;
  • FIG. 4 is a schematic diagram of coordinate determination of an intermediate point according to another embodiment of the present invention. taking the first coordinate as the coordinate A and the second coordinate as the coordinate B, where the coordinate B is newly received. Coordinate, coordinate A is the last received coordinate, and the drawing pen determines the coordinates of the intermediate point according to the two coordinates and the first N-1 group pressure data among the N sets of pressure data acquired between the received two coordinates, the method Can be as follows:
  • connection distance between the adjacent two intermediate points of each group is equal on the line connecting the coordinate A and the coordinate B, and the first set of pressure data is obtained when the writing head is at the coordinate A, and the Nth group is obtained.
  • the pressure data is in the coordinate B, there are N-1 intermediate points between the coordinate A and the coordinate B.
  • the connection between the adjacent two points in each group is The projection distance on the line between the coordinate A and the coordinate B is L/N.
  • the average value of the time difference may be measured in advance, and the average value of the time difference is estimated.
  • the relationship between the sampling periods of the drawing pen acquisition pressure data determines the pressure data corresponding to the received coordinates based on the relationship between the average value and the sampling period. For example, suppose the average value of the time difference is approximately equal to three sampling periods. That is, when the drawing pen receives the coordinate A, the drawing pen has collected three sets of pressure data after the electronic device acquires the coordinate A. At this time, the drawing pen can The coordinate A is determined as the coordinates of the point through which the pen tip passes when collecting the fourth group of pressure data in the existing pressure data, and the same set of pressure data corresponding to the coordinate B can also be determined.
  • the coordinates of the first intermediate point it can be calculated from the coordinate A according to the two pressure values included in the first group pressure data and the two pressure values included in the first group pressure data.
  • the movement direction b 1 of the writing head in the first group of pressure data; the angle ⁇ 1 between the connection direction a and the moving direction b 1 is calculated; the movement of the writing head between the collection of the first group of pressure data and the acquisition of the second group of pressure data is calculated.
  • the distance L 1 L * cos ⁇ 1 / N; the coordinates of the first intermediate point are calculated from the coordinates A, the moving directions b 1 and L 1 of the writing head.
  • connection distance between the adjacent two intermediate points of each group is equal on the connecting line between the coordinate A and the coordinate B.
  • the processor 340 is further configured to calculate a drawing strength when collecting the i-th group pressure data according to the two pressure values included in the i-th group pressure data;
  • the processor 340 is further configured to control, by the transceiver, the drawing strength corresponding to the first N-1 group of pressure data to be sent to the electronic device.
  • the drawing pen can also calculate the drawing strength when collecting each set of pressure data according to the value of the pressure data. Specifically, for example, if the two pressure values in the i-th group pressure data are F1 and F2, respectively, The drawing velocity F can be obtained by the following formula:
  • the thickness of the line between the i-1th intermediate point and the ith intermediate point or the depth of the color may be determined according to the drawing strength.
  • the drawing data is the pressure data.
  • the step of determining the coordinates of the N-1 intermediate points and the drawing force may also be performed by the electronic device, and the pen only sends the acquired pressure data to the electronic device in real time.
  • the foregoing embodiment of the present invention is described by taking only three pressure sensors as an example.
  • the number of pressure sensors can also be increased to improve accuracy and reliability.
  • four pressure sensors can be set, and The pressure sensors are distributed around the tip of the pen in a cross shape; or, in practical applications, in order to avoid the inability of the pen to work due to a partial pressure sensor failure, the pen can also be set with 6, 8, or 12 pressures. Sensors, etc.; alternatively, multiple sensor assemblies can be provided in the pen, each sensor component containing at least three pressure sensors, and when the pressure sensor of one sensor component fails, other sensor components can be used to collect pressure data.
  • the embodiment of the present invention does not limit the number of pressure sensors, as long as the collected pressure data can satisfy the calculation of the moving direction of the writing head and the drawing strength.
  • the drawing pen acquires pressure data collected by the pressure sensor by setting at least three pressure sensors around the pen head in the drawing pen, and sends a drawing to the electronic device according to the acquired pressure data.
  • the required drawing data so that the electronic device draws an image according to the drawing data, because the frequency of the pressure data acquired by the drawing pen is not limited by the screen refresh rate of the electronic device, and can be much higher than 60 Hz, which can greatly improve the drawing of the image by the electronic device. Precision and rendering effects.
  • the drawing pen provided by the embodiment of the present invention further calculates the drawing strength when collecting each group of pressure data according to the pressure value in the pressure data, and sends the drawing strength when collecting each group of pressure data to the electronic device,
  • the electronic device determines the thickness and color of the line according to the drawing strength, thereby further improving the drawing effect of the image.
  • FIG. 5 shows a block diagram of an electronic device according to an embodiment of the present invention.
  • the drawing pen may be the electronic device 120 in the drawing system shown in FIG. 1, and the electronic device may be a device such as a smart phone, a tablet computer, an e-book reader, or a personal computer.
  • the electronic device can include a bus 501, and a processor 502, a memory 503, and a transceiver 504 coupled to the bus.
  • the memory 503 is configured to store a plurality of instructions, the instructions being configured to be executed by the processor 502;
  • the processor 502 is configured to control the transceiver 504 to receive drawing data sent by a drawing pen;
  • the processor 502 is configured to draw an image according to the drawing data.
  • the drawing data is pressure data collected by at least three pressure sensors in the drawing pen; when the image is drawn according to the drawing data, the processor 502 is specifically configured to:
  • first coordinate and a second coordinate where the first coordinate and the second coordinate are coordinates of two points that the pen tip of the drawing pen passes in the drawing area of the electronic device; according to the first coordinate And the second coordinate and the first N-1 of the N sets of pressure data sequentially acquired by the drawing pen within a time period in which the coordinate acquiring unit acquires the first coordinate and the second coordinate Group pressure data, calculating coordinates of N-1 intermediate points sequentially passing between the first coordinate and the second coordinate, N ⁇ 2; drawing the first coordinate, the N-1 The coordinates of the intermediate points and the coordinate images between the two coordinate points corresponding to each of the second coordinates.
  • each set of pressure data of the first N-1 group pressure data includes a maximum two pressure values collected by the at least three pressure sensors and a direction of each of the two pressure values;
  • the processor 502 is specifically configured to: when calculating the coordinates of the N-1 intermediate points that the pen tip passes between the first coordinate and the second coordinate;
  • the method for determining the coordinates of the intermediate point between the two coordinates according to the pressure data is similar to the method for determining the coordinates of the intermediate point by the drawing pen in the embodiment shown in FIG. 3.
  • the drawing pen in the embodiment shown in FIG. 3.
  • the pressure data is sent to the electronic device by the drawing pen, wherein there is a time difference between the collection of the pressure data from the drawing pen and the receipt of the pressure data by the electronic device, that is, the electronic device acquires When the first coordinate or the second coordinate is reached, the pressure data corresponding to the acquired coordinates has not been received yet, so the average value of the time difference is also equal to three
  • the sample cycle is different from the description in the embodiment shown in FIG. 4, when the pressure data corresponding to the coordinates collected by the electronic device is determined, the electronic device may acquire the third group after the coordinate A is acquired.
  • the pressure data is determined as the pressure data corresponding to the coordinate A.
  • the third group of pressure data received after the acquisition of the coordinate B may be determined as the pressure data corresponding to the coordinate B.
  • the processor 502 is further configured to calculate, according to the two pressure values included in the i-th group pressure data, a drawing strength of the drawing pen when collecting the i-th group pressure data;
  • the processor 502 is further configured to separately set two adjacent coordinates of each group according to respective drawing strengths when the drawing pen collects each group of pressure data in the first N-1 group pressure data.
  • the method for calculating the drawing strength of the drawing pen when collecting each group of pressure data according to the pressure value included in the pressure data is similar to the method for calculating the drawing strength by the drawing pen in the corresponding embodiment of FIG. 3, and details are not described herein. .
  • the drawing data is coordinates of N-1 intermediate points between the first coordinate and the second coordinate;
  • the first coordinate and the second coordinate are the pen tip in the electronic device a coordinate of two points passing through the drawing area;
  • the processor 502 is configured to acquire and control the transceiver 504 to send the first coordinate and the second coordinate to the drawing pen in real time;
  • the processor 502 is configured to draw an image according to the drawing data by:
  • the processor 502 draws a line image of the first coordinate, the coordinates of the N-1 intermediate points, and the coordinate points corresponding to the second coordinate, and the adjacent two coordinate points of each group .
  • the processor 502 is further configured to control the transceiver 504 to receive the pen sent by the pen, and the pens respectively collect the pressure data of each group in the first N-1 group of pressure data. Corresponding drawing strength;
  • the processor 502 is further configured to separately set two adjacent coordinates of each group according to respective drawing strengths when the drawing pen collects each group of pressure data in the first N-1 group pressure data.
  • the electronic device provided by the embodiment of the present invention is disposed around the writing head in the drawing pen.
  • the at least three pressure sensors are disposed, and the electronic device receives the drawing data sent by the drawing pen according to the pressure data collected by the four pressure sensors, and the image is drawn according to the screen refresh rate of the electronic device. Far above 60Hz, it can greatly improve the accuracy and rendering effect of the image drawn by electronic devices.
  • the electronic device provided by the embodiment of the present invention further calculates the drawing strength when collecting each set of pressure data according to the pressure value in the pressure data, or obtains the drawing strength calculated by the drawing pen, and determines the thickness of the line according to the drawing strength. And color, further improving the image rendering effect.
  • FIG. 6 shows a block diagram of a drawing apparatus provided by an embodiment of the present invention.
  • the drawing device can be used in the electronic device 120 of the drawing system as shown in FIG.
  • the drawing device can include:
  • a drawing data receiving module 601 configured to receive drawing data sent by the drawing pen
  • the image drawing module 602 is configured to draw an image according to the drawing data.
  • the drawing data is pressure data collected by at least three pressure sensors in the drawing pen; when the image drawing module draws an image according to the drawing data, specifically:
  • first coordinate and the second coordinate are coordinates of two points that the pen tip of the drawing pen passes successively in the drawing area of the electronic device
  • the pen sets sequentially acquire N sets of pressure data.
  • each set of pressure data of the first N-1 group pressure data includes a maximum two pressure values collected by the at least three pressure sensors and a direction of each of the two pressure values;
  • the image drawing module is specifically configured to: when calculating coordinates of the N-1 intermediate points that the pen tip passes between the first coordinate and the second coordinate;
  • the method for determining the coordinates of the intermediate point between the two coordinates according to the pressure data is similar to the method for determining the coordinates of the intermediate point by the drawing pen in the embodiment shown in FIG. 3.
  • the drawing pen in the embodiment shown in FIG. 3.
  • the image drawing module 602 is further configured to calculate, according to the two pressure values included in the i-th group pressure data, a drawing strength of the drawing pen when collecting the i-th group pressure data;
  • the image drawing module 602 is further configured to separately set two adjacent groups according to respective drawing strengths when the drawing pen collects each group of pressure data in the first N-1 group pressure data.
  • the method for calculating the drawing strength of the drawing pen when collecting each group of pressure data according to the pressure value included in the pressure data is similar to the method for calculating the drawing strength by the drawing pen in the corresponding embodiment of FIG. 3, and details are not described herein. .
  • the drawing data is coordinates of N-1 intermediate points between the first coordinate and the second coordinate; the first coordinate and the second coordinate are drawings of the pen tip on the electronic device The coordinates of the two points that the region passes through;
  • the image drawing module 602 is configured to draw an image according to the drawing data by:
  • the image drawing module 602 is configured to draw the coordinates of the first coordinate, the coordinates of the N-1 intermediate points, and the corresponding coordinate points of the second coordinate, between two adjacent coordinate points of each group Wired image.
  • the device further includes: a drawing strength receiving module 603 and an attribute setting module 604:
  • the drawing strength receiving module 603 is configured to receive, according to the drawing pen, the drawing strength corresponding to each group of pressure data in the first N-1 group pressure data sent by the drawing pen;
  • the attribute setting module 604 is configured to separately set two adjacent coordinates of each group according to respective drawing strengths when the drawing pen collects each group of pressure data in the first N-1 group pressure data.
  • the drawing pen determines the coordinates of the intermediate point between the two coordinates according to the pressure data.
  • the specific steps of the method for calculating the drawing strength when collecting each set of pressure data please refer to the description in the embodiment shown in FIG. 3, and details are not described herein again.
  • the drawing apparatus provided by the embodiment of the present invention provides at least three pressure sensors around the writing head in the drawing pen, and the electronic device receives the drawing data sent by the drawing pen according to the pressure data collected by the four pressure sensors.
  • Image drawing because the frequency of the pressure data obtained by the pen is not limited by the screen refresh rate of the electronic device, it can be much higher than 60 Hz, which can greatly improve the accuracy and drawing effect of the image drawn by the electronic device.
  • the drawing device provided by the embodiment of the present invention further calculates the drawing strength when collecting each set of pressure data according to the pressure value in the pressure data, or obtains the drawing strength calculated by the drawing pen, and determines the thickness of the line according to the drawing strength. And color, further improving the image rendering effect.
  • FIG. 7 is a flowchart of a method for drawing a method according to an embodiment of the present invention.
  • This drawing method can be used in the drawing pen 110 of the drawing system shown in FIG.
  • the drawing method can include:
  • Step 701 Acquire pressure data collected by at least three pressure sensors in the drawing pen according to a preset sampling frequency.
  • Step 702 Control, according to the acquired pressure data, the transceiver in the drawing pen to send drawing data to the electronic device, so that the electronic device draws an image according to the drawing data.
  • the drawing method acquires pressure data collected by the pressure sensor by setting at least three pressure sensors around the pen head in the drawing pen, and sends a drawing to the electronic device according to the acquired pressure data.
  • the required drawing data so that the electronic device draws an image according to the drawing data, because the frequency of the pressure data acquired by the drawing pen is not limited by the screen refresh rate of the electronic device, and can be much higher than 60 Hz, which can greatly improve the drawing of the image by the electronic device. Precision and rendering effects.
  • FIG. 8 is a flowchart of a method for drawing a method according to an embodiment of the present invention.
  • the drawing method can be used in the electronic device 120 of the drawing system as shown in FIG.
  • the drawing method can include:
  • Step 801 Receive drawing data sent by the drawing pen, where the drawing data is that the drawing pen acquires pressure data collected by at least three pressure sensors in the drawing pen according to a preset sampling frequency, and sends the pressure data according to the pressure data.
  • Step 802 drawing an image according to the drawing data.
  • the drawing method provided by the embodiment of the present invention provides at least three pressure sensors around the writing head in the drawing pen, and the electronic device receives the drawing data sent by the drawing pen according to the pressure data collected by the four pressure sensors.
  • Image drawing because the frequency of the pressure data obtained by the pen is not limited by the screen refresh rate of the electronic device, it can be much higher than 60 Hz, which can greatly improve the accuracy and drawing effect of the image drawn by the electronic device.
  • FIG. 9 is a flowchart of a method for drawing a method according to another embodiment of the present invention.
  • This drawing method can be used in the drawing system as shown in FIG.
  • the step of calculating the coordinates of the intermediate point and drawing the velocity is performed by a pen, and the drawing method may include:
  • Step 901 The drawing pen acquires pressure data collected by at least three pressure sensors in the drawing pen according to a preset sampling frequency.
  • Step 902 The pen control transceiver receives the first coordinate and the second coordinate acquired and transmitted by the electronic device in real time.
  • the first coordinate and the second coordinate are coordinates of two points that the pen tip passes through in the drawing area of the electronic device.
  • Step 903 The pen is calculated according to the first coordinate, the second coordinate, and the first N-1 group pressure data in the N sets of pressure data sequentially acquired within the time period in which the first coordinate and the second coordinate are received.
  • each of the pressure data of the first N-1 group pressure data includes the maximum two pressure values collected by the at least three pressure sensors and the respective directions of the two pressure values; a linear distance L between a coordinate and the second coordinate and a connection direction a from the first coordinate to the second coordinate; according to the i-th group pressure data in the front N-1 group pressure data Calculating the moving direction b of the pen head when collecting the i-th group pressure data by calculating the direction of the two pressure values and the two pressure values included in the i-th group pressure data; calculating the connecting direction a and the moving direction b
  • Step 904 the pen controls the transceiver to transmit the coordinates of the N-1 intermediate points to the electronic device.
  • Step 905 The electronic device draws a line image of the first coordinate, the coordinates of the N-1 intermediate points, and the coordinate points corresponding to the second coordinates, and the adjacent two coordinate points of each group.
  • Step 906 The drawing pen controls the transceiver to send the corresponding drawing strength to the electronic device when collecting the pressure data of each group in the previous N-1 group pressure data.
  • the drawing pen can calculate the drawing strength when collecting the i-th group pressure data according to the two pressure values included in the i-th group pressure data.
  • Step 907 The electronic device respectively sets a connection image between the two adjacent coordinate points of each group according to the drawing strength corresponding to each group of pressure data in the first N-1 group pressure data.
  • Image attribute the image attribute includes at least one of a connection color and a connection thickness.
  • the drawing method acquires pressure data collected by the pressure sensor by setting at least three pressure sensors around the pen head in the drawing pen, and according to the acquired pressure data and the electronic device. Two coordinate points are calculated, and each intermediate point between the two coordinate points is calculated, and the electronic device draws an image according to the coordinates of the two coordinate points and each intermediate point, because the frequency of the pressure data acquired by the drawing pen is not affected by the screen of the electronic device.
  • the refresh rate limit can be much higher than 60 Hz, which can greatly improve the accuracy and drawing effect of the image drawn by the electronic device.
  • the drawing pen further calculates the drawing strength when collecting each group of pressure data according to the pressure value in the pressure data, and sends the drawing strength when collecting each group of pressure data to the electronic device.
  • the electronic device determines the thickness and color of the line according to the drawing strength, thereby further improving the drawing effect of the image.
  • FIG. 10 is a flowchart of a method for drawing a method according to another embodiment of the present invention.
  • This drawing method can be used in the drawing system as shown in FIG.
  • the step of calculating the coordinates of the intermediate point and drawing the velocity is performed by an electronic device, and the drawing method may include:
  • step 1001 the drawing pen acquires pressure data collected by at least three pressure sensors in the drawing pen according to a preset sampling frequency.
  • step 1002 the pen control transceiver transmits the pressure data to the electronic device.
  • Step 1003 The electronic device acquires the first coordinate and the second coordinate.
  • first coordinate and the second coordinate are the writing head of the drawing pen in a drawing area of the electronic device The coordinates of the two points passing through the domain.
  • Step 1004 The electronic device sequentially obtains the first N- of the N sets of pressure data according to the first coordinate, the second coordinate, and the time period during which the first coordinate and the second coordinate are acquired.
  • a set of pressure data is used to calculate the coordinates of the N-1 intermediate points that the pen head passes between the first coordinate and the second coordinate, N ⁇ 2.
  • each of the pressure data of the first N-1 group pressure data includes the maximum two pressure values collected by the at least three pressure sensors and the respective directions of the two pressure values.
  • the electronic device calculates a linear distance L between the first coordinate and the second coordinate and a connection direction a from the first coordinate to the second coordinate; according to the i-th in the front N-1 group pressure data
  • the method for determining the coordinates of the intermediate point between the two coordinates according to the pressure data is similar to the method for determining the coordinates of the intermediate point by the drawing pen in the embodiment shown in FIG. 3.
  • the drawing pen in the embodiment shown in FIG. 3.
  • Step 1005 The electronic device draws the first coordinate, the coordinates of the N-1 intermediate points, and the connection image between the two adjacent coordinate points in the coordinate points corresponding to the second coordinate.
  • Step 1006 The electronic device calculates, according to the pre-N-1 group pressure data, corresponding drawing strengths when the pens collect the pressure data of each group in the pre-N-1 group pressure data.
  • the electronic device may calculate the drawing strength of the pen when collecting the i-th group pressure data according to the two pressure values included in the i-th group pressure data.
  • the method for calculating the drawing strength of the drawing pen when collecting each group of pressure data according to the pressure value included in the pressure data is similar to the method for calculating the drawing strength by the drawing pen in the corresponding embodiment of FIG. 3, and details are not described herein. .
  • Step 1007 The electronic device separately sets a connection image between the two adjacent coordinate points of each group according to the drawing strength corresponding to each group of pressure data in the first N-1 group pressure data.
  • Image attribute the image attribute includes at least one of a connection color and a connection thickness.
  • the drawing method provided by the embodiment of the present invention provides at least three pressure sensors around the writing head in the drawing pen, and the electronic device receives the drawing data sent by the drawing pen according to the pressure data collected by the four pressure sensors.
  • Image drawing because the frequency of the pressure data obtained by the pen is not limited by the screen refresh rate of the electronic device, it can be much higher than 60 Hz, which can greatly improve the accuracy and drawing effect of the image drawn by the electronic device.
  • the drawing method provided by the embodiment of the present invention further calculates the drawing strength when collecting each set of pressure data according to the pressure value in the pressure data, or obtains the drawing strength calculated by the drawing pen, and determines the thickness of the line according to the drawing strength. And color, further improving the image rendering effect.
  • a person skilled in the art may understand that all or part of the steps of implementing the above embodiments may be completed by hardware, or may be instructed by a program to execute related hardware, and the program may be stored in a computer readable storage medium.
  • the storage medium mentioned may be a read only memory, a magnetic disk or an optical disk or the like.

Abstract

A drawing pen, an electronic device and a drawing method. The drawing pen (110) comprises: a pen head (210), a housing (220), at least three pressure sensors (230), a processor (240) and a transceiver (250). The pen head (210) is half buried within the housing (220), the at least three pressure sensors (230) are fixed inside the housing (220), and the angle between the vertical lines of any two adjacent pressure sensors (230) to a central line of the pen head (210) is greater than 180o. The at least three pressure sensors (230) are arranged around the pen head (210) in the drawing pen (110), pressure data collected by the pressure sensors is obtained, and drawing data required for drawing is sent to an electronic device (120) according to the obtained pressure data, so that the electronic device (120) draws an image according to the drawing data. Since the frequency with which the drawing pen (110) obtains the pressure data is not limited by the screen refresh rate of the electronic device (120), said frequency may be far higher than 60Hz, significantly improving the accuracy and drawing efficiency with which the electronic device draws an image.

Description

绘图笔、电子设备及绘图方法Drawing pen, electronic device and drawing method 技术领域Technical field
本发明实施例涉及计算机绘图领域,特别涉及一种绘图笔、电子设备及绘图方法。Embodiments of the present invention relate to the field of computer graphics, and in particular, to a drawing pen, an electronic device, and a drawing method.
背景技术Background technique
随着电子技术的不断发展,便携式电子设备的功能也越来越强大。比如,用户可以用手指或者触控笔在电子设备的触摸屏中直接进行图像绘制。With the continuous development of electronic technology, the functions of portable electronic devices are becoming more and more powerful. For example, the user can directly draw an image on the touch screen of the electronic device with a finger or a stylus.
在现有方案中,用户在触摸屏直接进行图像绘制的原理如下:电子设备在图像绘制状态下时,触摸屏控制器采集用户在触摸屏上的触点信息,并将先后采集的触点信息上报给电子设备的处理器,处理器将触摸屏控制器先后上报的触点信息所对应的各个坐标点依次通过线条相连接,即可以得到用户在触摸屏中绘制的图像。In the existing solution, the principle that the user directly performs image drawing on the touch screen is as follows: when the electronic device is in the image drawing state, the touch screen controller collects the contact information of the user on the touch screen, and reports the contact information collected successively to the electronic device. The processor of the device, the processor sequentially connects the coordinate points corresponding to the contact information reported by the touch screen controller in sequence through the lines, that is, the image drawn by the user on the touch screen can be obtained.
在上述现有方案中,触摸屏控制器上报触点信息的频率受限于触摸屏的刷新频率,即触摸屏每次刷新时,触摸屏控制器只能上报一个触控点对应的触点信息,而触摸屏的刷新频率大多为60Hz,导致电子设备绘制图像的精度偏低,绘制效果差。In the above existing solution, the frequency of reporting the contact information by the touch screen controller is limited by the refresh frequency of the touch screen, that is, each time the touch screen is refreshed, the touch screen controller can only report the contact information corresponding to one touch point, and the touch screen is The refresh frequency is mostly 60 Hz, which causes the accuracy of the image drawn by the electronic device to be low, and the drawing effect is poor.
发明内容Summary of the invention
为了解决现有技术中触摸屏控制器上报触点信息的频率受限于触摸屏的刷新频率,导致电子设备绘制图像的精度偏低,绘制效果差的问题,本发明实施例提供了一种绘图笔、电子设备及绘图方法。In order to solve the problem that the frequency of the touch screen controller reporting the contact information in the prior art is limited by the refresh frequency of the touch screen, the accuracy of the drawing of the electronic device is low, and the drawing effect is poor, the embodiment of the present invention provides a drawing pen, Electronic equipment and drawing methods.
第一方面,提供一种绘图笔,所述绘图笔包括:笔头、外壳、至少三个压力传感器、处理器以及收发器;In a first aspect, a drawing pen is provided, the drawing pen comprising: a pen head, a casing, at least three pressure sensors, a processor, and a transceiver;
所述笔头半埋于所述外壳中,所述至少三个压力传感器固定于所述外壳内部,且其中任意相邻的两个压力传感器到所述笔头的中心线的垂直线之间的夹角小于180°;The pen tip is semi-buried in the outer casing, the at least three pressure sensors are fixed inside the outer casing, and an angle between any two adjacent pressure sensors to a vertical line of a center line of the pen tip Less than 180°;
所述处理器分别与所述至少三个压力传感器和所述收发器电性相连; The processor is electrically connected to the at least three pressure sensors and the transceiver, respectively;
所述处理器,用于按照预设采样频率获取所述至少三个压力传感器采集到的压力数据;The processor is configured to acquire pressure data collected by the at least three pressure sensors according to a preset sampling frequency;
所述处理器,还用于根据获取到的所述压力数据,控制所述收发器向电子设备发送绘图数据,以便所述电子设备根据所述绘图数据绘制图像。The processor is further configured to control, according to the acquired pressure data, the transceiver to send drawing data to the electronic device, so that the electronic device draws an image according to the drawing data.
在第一方面的第一种可能实现方式中,所述外壳上设置有握持标识,所述握持标识用于指示握持所述绘画笔的手握形态。In a first possible implementation manner of the first aspect, the housing is provided with a holding identifier for indicating a gripping manner of holding the painting pen.
在第一方面的第二种可能实现方式中,所述预设采样频率大于60Hz。In a second possible implementation manner of the first aspect, the preset sampling frequency is greater than 60 Hz.
结合第一方面、第一方面的第一种可能实现方式或者第一方面的第二种可能实现方式,在第一方面的第三种可能实现方式中,所述绘图数据为所述压力数据。In conjunction with the first aspect, the first possible implementation of the first aspect, or the second possible implementation of the first aspect, in a third possible implementation of the first aspect, the drawing data is the pressure data.
结合第一方面、第一方面的第一种可能实现方式或者第一方面的第二种可能实现方式,在第一方面的第四种可能实现方式中,所述绘图数据为N-1个中间点的坐标,N≥2;In conjunction with the first aspect, the first possible implementation of the first aspect, or the second possible implementation of the first aspect, in a fourth possible implementation of the first aspect, the mapping data is N-1 intermediate The coordinates of the point, N ≥ 2;
所述处理器,还用于根据所述压力数据,通过以下方式获取所述N-1个中间点的坐标:The processor is further configured to acquire coordinates of the N-1 intermediate points according to the pressure data by:
所述处理器控制所述收发器先后接收所述电子设备实时获取并发送的第一坐标和第二坐标,所述第一坐标和所述第二坐标为所述笔头在所述电子设备的绘图区域先后经过的两点的坐标;The processor controls the transceiver to receive first and second coordinates acquired and transmitted by the electronic device in real time, where the first coordinate and the second coordinate are drawings of the pen tip on the electronic device The coordinates of the two points that the region passes through;
所述处理器根据所述第一坐标、所述第二坐标以及在接收到所述第一坐标和所述第二坐标的时间段之内依次获取的N组压力数据中的前N-1组压力数据计算所述笔头在所述第一坐标和所述第二坐标之间依次经过的所述N-1个中间点的坐标。The processor according to the first coordinate, the second coordinate, and the first N-1 group of N sets of pressure data sequentially acquired within a time period in which the first coordinate and the second coordinate are received The pressure data calculates coordinates of the N-1 intermediate points that the pen tip sequentially passes between the first coordinate and the second coordinate.
结合第一方面的第四种可能实现方式,在第一方面的第五种可能实现方式中,所述前N-1组压力数据中的每一组压力数据中包含所述至少三个压力传感器采集到的最大的两个压力数值以及所述两个压力数值各自的方向;In conjunction with the fourth possible implementation of the first aspect, in a fifth possible implementation of the first aspect, the at least three pressure sensors are included in each of the first N-1 sets of pressure data The two largest pressure values collected and the respective directions of the two pressure values;
所述处理器,具体用于通过以下方式计算所述笔头在所述第一坐标和所述第二坐标之间依次经过的所述N-1个中间点的坐标:The processor is specifically configured to calculate coordinates of the N-1 intermediate points that the pen tip sequentially passes between the first coordinate and the second coordinate by:
所述处理器计算所述第一坐标和所述第二坐标之间的直线距离L以及从所述第一坐标到所述第二坐标之间的连线方向a;The processor calculates a linear distance L between the first coordinate and the second coordinate and a connection direction a from the first coordinate to the second coordinate;
根据所述前N-1组压力数据中的第i组压力数据包含的两个压力数值以及所述第i组压力数据包含的两个压力数值各自的方向,计算在采集所述第i组 压力数据时,所述笔头的移动方向b;Calculating the ith group according to the two pressure values included in the i-th group pressure data of the pre-N-1 group pressure data and the respective pressure values of the two pressure values included in the ith group pressure data When the pressure data is, the moving direction b of the writing head;
计算所述连线方向a和所述移动方向b之间的夹角γ;Calculating an angle γ between the connecting direction a and the moving direction b;
根据所述直线距离L和所述夹角γ计算在采集第i组压力数据到采集第i+1组压力数据之间所述笔头移动的距离Li,Li=L*cosγ/N;Calculating, according to the linear distance L and the angle γ, a distance L i , L i = L* cos γ / N of the movement of the tip between collecting the i-th group pressure data to collecting the (i+1)-th pressure data;
根据第i-1个中间点的坐标、所述笔头的移动方向b以及所述笔头移动的距离Li计算第i个中间点的坐标;Calculating coordinates of the i-th intermediate point according to coordinates of the i-1th intermediate point, the moving direction b of the writing head, and the distance L i of the moving of the writing head;
其中,1≤i≤N-1;当i=1时,所述第i-1个中间点的坐标为所述第一坐标。Wherein, 1≤i≤N-1; when i=1, the coordinates of the i-1th intermediate point are the first coordinates.
结合第一方面的第五种可能实现方式,在第一方面的第六种可能实现方式中,所述处理器,还用于根据所述第i组压力数据包含的两个压力数值计算在采集所述第i组压力数据时的绘制力度;In conjunction with the fifth possible implementation of the first aspect, in a sixth possible implementation manner of the first aspect, the processor is further configured to calculate, according to the two pressure values included in the i-th group of pressure data The drawing strength of the i-th group of pressure data;
所述处理器,还用于控制所述收发器向所述电子设备发送采集所述前N-1组压力数据时分别对应的绘制力度。The processor is further configured to control, by the transceiver, the drawing strength corresponding to the first N-1 group pressure data when the transceiver is collected to the electronic device.
第二方面,提供一种电子设备,所述电子设备包括:处理器、存储器和收发器;其中,所述存储器用于存储若干个指令,所述若干个指令被配置成由所述处理器执行;In a second aspect, an electronic device is provided, the electronic device comprising: a processor, a memory, and a transceiver; wherein the memory is for storing a plurality of instructions, the instructions being configured to be executed by the processor ;
所述处理器,用于控制所述收发器接收绘图笔发送的绘图数据;The processor is configured to control the transceiver to receive drawing data sent by a drawing pen;
所述处理器,用于根据所述绘图数据绘制图像。The processor is configured to draw an image according to the drawing data.
在第二方面的第一种可能实现方式中,所述绘图数据为所述绘图笔中的至少三个压力传感器采集到的压力数据;所述处理器在根据所述绘图数据绘制图像时,具体用于:In a first possible implementation manner of the second aspect, the drawing data is pressure data collected by at least three pressure sensors in the drawing pen; when the processor draws an image according to the drawing data, the specific Used for:
获取第一坐标和第二坐标,所述第一坐标和所述第二坐标为所述绘图笔的笔头在所述电子设备的绘图区域中先后经过的两点的坐标;根据所述第一坐标、所述第二坐标以及在所述坐标获取单元获取到所述第一坐标和所述第二坐标的时间段之内,所述绘图笔依次获取到的N组压力数据中的前N-1组压力数据,计算所述笔头在所述第一坐标和所述第二坐标之间依次经过的N-1个中间点的坐标,N≥2;绘制所述第一坐标、所述N-1个中间点的坐标以及所述第二坐标各自对应的坐标点中,每组相邻的两个坐标点之间的连线图像。Obtaining a first coordinate and a second coordinate, where the first coordinate and the second coordinate are coordinates of two points that the pen tip of the drawing pen passes in the drawing area of the electronic device; according to the first coordinate And the second coordinate and the first N-1 of the N sets of pressure data sequentially acquired by the drawing pen within a time period in which the coordinate acquiring unit acquires the first coordinate and the second coordinate Group pressure data, calculating coordinates of N-1 intermediate points sequentially passing between the first coordinate and the second coordinate, N≥2; drawing the first coordinate, the N-1 The coordinates of the intermediate points and the coordinate images between the two coordinate points corresponding to each of the second coordinates.
结合第二方面的第一种可能实现方式,在第二方面的第二种可能实现方式中,所述前N-1组压力数据中的每一组压力数据中包含所述至少三个压力传感器采集到的最大的两个压力数值以及所述两个压力数值各自的方向;In conjunction with the first possible implementation of the second aspect, in a second possible implementation of the second aspect, the at least three pressure sensors are included in each of the first N-1 sets of pressure data The two largest pressure values collected and the respective directions of the two pressure values;
所述处理器在计算所述笔头在所述第一坐标和所述第二坐标之间依次经 过的N-1个中间点的坐标时,具体用于:The processor calculates the pen tip sequentially between the first coordinate and the second coordinate When the coordinates of N-1 intermediate points have passed, they are specifically used to:
计算所述第一坐标和所述第二坐标之间的直线距离L以及从所述第一坐标到所述第二坐标之间的连线方向a;根据所述前N-1组压力数据中的第i组压力数据包含的两个压力数值以及所述第i组压力数据包含的两个压力数值各自的方向,计算在采集所述第i组压力数据时,所述笔头的移动方向b;计算所述连线方向a和所述移动方向b之间的夹角γ;根据所述直线距离L和所述夹角γ计算在采集第i组压力数据到采集第i+1组压力数据之间所述笔头移动的距离Li,Li=L*cosγ/N;根据第i-1个中间点的坐标、所述笔头的移动方向b以及所述笔头移动的距离Li计算第i个中间点的坐标;Calculating a linear distance L between the first coordinate and the second coordinate and a connection direction a from the first coordinate to the second coordinate; according to the front N-1 group pressure data The pressure value included in the ith group pressure data and the direction of the two pressure values included in the ith group pressure data, and calculating the moving direction b of the pen tip when collecting the ith group pressure data; Calculating an angle γ between the connection direction a and the moving direction b; calculating the pressure data of the i-th group to collect the pressure data of the (i+1)th group according to the linear distance L and the angle γ The distance L i , L i = L * cos γ / N between the movements of the writing head; calculating the i-th according to the coordinates of the i-1th intermediate point, the moving direction b of the writing head, and the distance L i of the movement of the writing head The coordinates of the intermediate point;
其中,1≤i≤N-1;当i=1时,所述第i-1个中间点的坐标为所述第一坐标。Wherein, 1≤i≤N-1; when i=1, the coordinates of the i-1th intermediate point are the first coordinates.
结合第二方面的第二种可能实现方式,在第二方面的第三种可能实现方式中,所述处理器,还用于根据所述第i组压力数据包含的两个压力数值计算所述绘图笔在采集所述第i组压力数据时的绘制力度;In conjunction with the second possible implementation of the second aspect, in a third possible implementation of the second aspect, the processor is further configured to calculate, according to the two pressure values included in the i-th group pressure data Drawing force of the drawing pen when collecting the i-th group pressure data;
所述处理器,还用于根据所述绘图笔在采集所述前N-1组压力数据中的各组压力数据时分别对应的绘制力度,分别设置所述每组相邻的两个坐标点之间的连线图像的图像属性,所述图像属性包括连线颜色和连线粗细中的至少一种。The processor is further configured to separately set two adjacent coordinate points of each group according to respective drawing strengths when the drawing pen collects each group of pressure data in the first N-1 group pressure data An image attribute of the connected image, the image attribute including at least one of a connection color and a connection thickness.
在第二方面的第四种可能实现方式中,所述绘图数据为第一坐标和第二坐标之间的N-1个中间点的坐标;所述第一坐标和所述第二坐标为所述笔头在所述电子设备的绘图区域先后经过的两点的坐标;In a fourth possible implementation manner of the second aspect, the drawing data is coordinates of N-1 intermediate points between the first coordinate and the second coordinate; the first coordinate and the second coordinate are Describe the coordinates of two points that the pen head passes in the drawing area of the electronic device;
所述处理器,用于根据绘图数据,通过以下方式绘制图像:The processor is configured to draw an image according to the drawing data by:
所述处理器绘制所述第一坐标、所述N-1个中间点的坐标以及所述第二坐标各自对应的坐标点中,每组相邻的两个坐标点之间的连线图像。The processor draws a line image between the first coordinate, the coordinates of the N-1 intermediate points, and the coordinate points corresponding to the second coordinates, and the adjacent two coordinate points of each group.
结合第二方面的第四种可能实现方式,在第二方面的第五种可能实现方式中,所述处理器,还用于控制所述收发器接收所述绘图笔发送的,所述绘图笔在采集所述前N-1组压力数据中的各组压力数据时分别对应的绘制力度;In conjunction with the fourth possible implementation of the second aspect, in a fifth possible implementation manner of the second aspect, the processor is further configured to control the transceiver to receive the pen sent by the pen Corresponding drawing force when collecting each group of pressure data in the front N-1 group pressure data;
所述处理器,还用于根据所述绘图笔在采集所述前N-1组压力数据中的各组压力数据时分别对应的绘制力度,分别设置所述每组相邻的两个坐标点之间的连线图像的图像属性,所述图像属性包括连线颜色和连线粗细中的至少一种。The processor is further configured to separately set two adjacent coordinate points of each group according to respective drawing strengths when the drawing pen collects each group of pressure data in the first N-1 group pressure data An image attribute of the connected image, the image attribute including at least one of a connection color and a connection thickness.
第三方面,提供一种绘图方法,用于绘图笔中,所述方法包括: In a third aspect, a drawing method is provided for use in a drawing pen, the method comprising:
按照预设采样频率获取所述绘图笔中的至少三个压力传感器采集到的压力数据;Obtaining pressure data collected by at least three pressure sensors in the drawing pen according to a preset sampling frequency;
根据获取到的所述压力数据,控制所述绘图笔中的收发器向电子设备发送绘图数据,以便所述电子设备根据所述绘图数据绘制图像。And controlling, according to the acquired pressure data, the transceiver in the drawing pen to send drawing data to the electronic device, so that the electronic device draws an image according to the drawing data.
在第三方面的第一种可能实现方式中,所述绘图数据为所述压力数据。In a first possible implementation of the third aspect, the drawing data is the pressure data.
在第三方面的第二种可能实现方式中,所述绘图数据为N-1个中间点的坐标,N≥2;所述根据获取到的所述压力数据,控制所述绘图笔中的收发器向电子设备发送绘图数据,包括:In a second possible implementation manner of the third aspect, the drawing data is a coordinate of N-1 intermediate points, and N≥2; and the transmitting and receiving in the drawing pen is controlled according to the acquired pressure data. The device sends the drawing data to the electronic device, including:
控制所述收发器先后接收所述电子设备实时获取并发送的第一坐标和第二坐标,所述第一坐标和所述第二坐标为所述笔头在所述电子设备的绘图区域先后经过的两点的坐标;Controlling, by the transceiver, a first coordinate and a second coordinate that are acquired and sent by the electronic device in real time, where the first coordinate and the second coordinate are successively passed by the pen tip in a drawing area of the electronic device The coordinates of two points;
根据所述第一坐标、所述第二坐标以及在接收到所述第一坐标和所述第二坐标的时间段之内依次获取的N组压力数据中的前N-1组压力数据计算所述笔头在所述第一坐标和所述第二坐标之间依次经过的所述N-1个中间点的坐标,N≥2;Calculating the first N-1 group pressure data according to the first coordinate, the second coordinate, and the N sets of pressure data sequentially acquired within a time period in which the first coordinate and the second coordinate are received Describe the coordinates of the N-1 intermediate points that the pen head sequentially passes between the first coordinate and the second coordinate, N≥2;
控制所述收发器向所述电子设备发送所述N-1个中间点的坐标。Controlling the transceiver to transmit coordinates of the N-1 intermediate points to the electronic device.
结合第三方面的第二种可能实现方式,在第三方面的第三种可能实现方式中,所述前N-1组压力数据中的每一组压力数据中包含所述至少三个压力传感器采集到的最大的两个压力数值以及所述两个压力数值各自的方向;所述根据所述第一坐标、所述第二坐标以及在接收到所述第一坐标和所述第二坐标的时间段之内依次获取的N组压力数据中的前N-1组压力数据计算所述笔头在所述第一坐标和所述第二坐标之间依次经过的所述N-1个中间点的坐标,具体包括:With reference to the second possible implementation manner of the third aspect, in a third possible implementation manner of the third aspect, the at least three pressure sensors are included in each of the first N-1 group pressure data The two largest pressure values collected and the respective directions of the two pressure values; the according to the first coordinate, the second coordinate, and the receiving of the first coordinate and the second coordinate The first N-1 group pressure data in the N sets of pressure data sequentially acquired within the time period is calculated by calculating the N-1 intermediate points of the pen head sequentially passing between the first coordinate and the second coordinate Coordinates, including:
计算所述第一坐标和所述第二坐标之间的直线距离L以及从所述第一坐标到所述第二坐标之间的连线方向a;根据所述前N-1组压力数据中的第i组压力数据包含的两个压力数值以及所述第i组压力数据包含的两个压力数值各自的方向,计算在采集所述第i组压力数据时,所述笔头的移动方向b;计算所述连线方向a和所述移动方向b之间的夹角γ;根据所述直线距离L和所述夹角γ计算在采集第i组压力数据到采集第i+1组压力数据之间所述笔头移动的距离Li,Li=L*cosγ/N;根据第i-1个中间点的坐标、所述笔头的移动方向b以及所述笔头移动的距离Li计算第i个中间点的坐标;Calculating a linear distance L between the first coordinate and the second coordinate and a connection direction a from the first coordinate to the second coordinate; according to the front N-1 group pressure data The pressure value included in the ith group pressure data and the direction of the two pressure values included in the ith group pressure data, and calculating the moving direction b of the pen tip when collecting the ith group pressure data; Calculating an angle γ between the connection direction a and the moving direction b; calculating the pressure data of the i-th group to collect the pressure data of the (i+1)th group according to the linear distance L and the angle γ The distance L i , L i = L * cos γ / N between the movements of the writing head; calculating the i-th according to the coordinates of the i-1th intermediate point, the moving direction b of the writing head, and the distance L i of the movement of the writing head The coordinates of the intermediate point;
其中,1≤i≤N-1;当i=1时,所述第i-1个中间点的坐标为所述第一坐标。 Wherein, 1≤i≤N-1; when i=1, the coordinates of the i-1th intermediate point are the first coordinates.
结合第三方面的第三种可能实现方式,在第三方面的第四种可能实现方式中,所述方法还包括:In conjunction with the third possible implementation of the third aspect, in a fourth possible implementation manner of the third aspect, the method further includes:
根据所述第i组压力数据包含的两个压力数值计算在采集所述第i组压力数据时的绘制力度;Calculating a drawing strength when collecting the i-th group pressure data according to the two pressure values included in the i-th group pressure data;
控制所述收发器向所述电子设备发送采集所述前N-1组压力数据中的各组压力数据时分别对应的绘制力度。And controlling, by the transceiver, the drawing strength corresponding to each group of pressure data in the first N-1 group pressure data to be sent to the electronic device.
第四方面,提供一种绘图方法,用于电子设备中,所述方法包括:In a fourth aspect, a drawing method is provided for use in an electronic device, the method comprising:
接收绘图笔发送的绘图数据;Receiving drawing data sent by the drawing pen;
根据所述绘图数据绘制图像。An image is drawn based on the drawing data.
在第四方面的第一种可能实现方式中,所述绘图数据为所述绘图笔中的至少三个压力传感器采集到的压力数据;In a first possible implementation manner of the fourth aspect, the drawing data is pressure data collected by at least three pressure sensors in the drawing pen;
所述根据所述绘图数据绘制图像,具体包括:The drawing an image according to the drawing data specifically includes:
获取第一坐标和第二坐标,所述第一坐标和所述第二坐标为所述绘图笔的笔头在所述电子设备的绘图区域中先后经过的两点的坐标;Obtaining a first coordinate and a second coordinate, where the first coordinate and the second coordinate are coordinates of two points that the pen tip of the drawing pen passes successively in the drawing area of the electronic device;
根据所述第一坐标、所述第二坐标以及在获取到所述第一坐标和所述第二坐标的时间段之内,所述绘图笔依次获取到的N组压力数据中的前N-1组压力数据,计算所述笔头在所述第一坐标和所述第二坐标之间依次经过的N-1个中间点的坐标,N≥2;Determining the first N- of the N sets of pressure data sequentially acquired by the drawing pen according to the first coordinate, the second coordinate, and the time period during which the first coordinate and the second coordinate are acquired a set of pressure data, calculating the coordinates of the N-1 intermediate points that the pen tip passes between the first coordinate and the second coordinate, N≥2;
绘制所述第一坐标、所述N-1个中间点的坐标以及所述第二坐标各自对应的坐标点中,每组相邻的两个坐标点之间的连线图像。And drawing a line image of the first coordinate, the coordinates of the N-1 intermediate points, and the coordinate points corresponding to the second coordinates, and the adjacent two coordinate points of each group.
结合第四方面的第一种可能实现方式,在第四方面的第二种可能实现方式中,所述前N-1组压力数据中的每一组压力数据中包含所述至少三个压力传感器采集到的最大的两个压力数值以及所述两个压力数值各自的方向;所述计算所述笔头在所述第一坐标和所述第二坐标之间依次经过的N-1个中间点的坐标,具体包括:With reference to the first possible implementation manner of the fourth aspect, in a second possible implementation manner of the fourth aspect, the at least three pressure sensors are included in each group of the first N-1 group pressure data The two largest pressure values collected and the respective directions of the two pressure values; the calculating the N-1 intermediate points of the pen tip passing between the first coordinate and the second coordinate Coordinates, including:
计算所述第一坐标和所述第二坐标之间的直线距离L以及从所述第一坐标到所述第二坐标之间的连线方向a;根据所述前N-1组压力数据中的第i组压力数据包含的两个压力数值以及所述第i组压力数据包含的两个压力数值各自的方向,计算在采集所述第i组压力数据时,所述笔头的移动方向b;计算所述连线方向a和所述移动方向b之间的夹角γ;根据所述直线距离L和所述夹角γ计算在采集第i组压力数据到采集第i+1组压力数据之间所述笔头移动 的距离Li,Li=L*cosγ/N;根据第i-1个中间点的坐标、所述笔头的移动方向b以及所述笔头移动的距离Li计算第i个中间点的坐标;Calculating a linear distance L between the first coordinate and the second coordinate and a connection direction a from the first coordinate to the second coordinate; according to the front N-1 group pressure data The pressure value included in the ith group pressure data and the direction of the two pressure values included in the ith group pressure data, and calculating the moving direction b of the pen tip when collecting the ith group pressure data; Calculating an angle γ between the connection direction a and the moving direction b; calculating the pressure data of the i-th group to collect the pressure data of the (i+1)th group according to the linear distance L and the angle γ The distance L i , L i = L * cos γ / N between the movements of the writing head; calculating the i-th according to the coordinates of the i-1th intermediate point, the moving direction b of the writing head, and the distance L i of the movement of the writing head The coordinates of the intermediate point;
其中,1≤i≤N-1;当i=1时,所述第i-1个中间点的坐标为所述第一坐标。Wherein, 1≤i≤N-1; when i=1, the coordinates of the i-1th intermediate point are the first coordinates.
结合第四方面的第二种可能实现方式,在第四方面的第三种可能实现方式中,所述方法还包括:In conjunction with the second possible implementation of the fourth aspect, in a third possible implementation manner of the fourth aspect, the method further includes:
根据所述第i组压力数据包含的两个压力数值计算所述绘图笔在采集所述第i组压力数据时的绘制力度;Calculating a drawing strength of the drawing pen when collecting the i-th group pressure data according to two pressure values included in the i-th group pressure data;
根据所述绘图笔在采集所述前N-1组压力数据中的各组压力数据时分别对应的绘制力度,分别设置所述每组相邻的两个坐标点之间的连线图像的图像属性,所述图像属性包括连线颜色和连线粗细中的至少一种。And respectively setting an image of the connection image between the two adjacent coordinate points of each group according to the drawing strength corresponding to each group of pressure data in the first N-1 group pressure data of the drawing pen An attribute, the image attribute including at least one of a connection color and a connection thickness.
在第四方面的第四种可能实现方式中,所述绘图数据为第一坐标和第二坐标之间的N-1个中间点的坐标;所述第一坐标和所述第二坐标为所述笔头在所述电子设备的绘图区域先后经过的两点的坐标;In a fourth possible implementation manner of the fourth aspect, the drawing data is a coordinate of N-1 intermediate points between the first coordinate and the second coordinate; the first coordinate and the second coordinate are Describe the coordinates of two points that the pen head passes in the drawing area of the electronic device;
所述根据所述绘图数据绘制图像,包括:The drawing an image according to the drawing data comprises:
绘制所述第一坐标、所述N-1个中间点的坐标以及所述第二坐标各自对应的坐标点中,每组相邻的两个坐标点之间的连线图像。And drawing a line image of the first coordinate, the coordinates of the N-1 intermediate points, and the coordinate points corresponding to the second coordinates, and the adjacent two coordinate points of each group.
结合第四方面的第四种可能实现方式,在第四方面的第五种可能实现方式中,所述方法还包括:In conjunction with the fourth possible implementation of the fourth aspect, in a fifth possible implementation manner of the fourth aspect, the method further includes:
接收所述绘图笔发送的,所述绘图笔在采集所述前N-1组压力数据中的各组压力数据时分别对应的绘制力度;Receiving, by the drawing pen, the drawing strength corresponding to each group of pressure data in the first N-1 group pressure data sent by the drawing pen;
根据所述绘图笔在采集所述前N-1组压力数据中的各组压力数据时分别对应的绘制力度,分别设置所述每组相邻的两个坐标点之间的连线图像的图像属性,所述图像属性包括连线颜色和连线粗细中的至少一种。And respectively setting an image of the connection image between the two adjacent coordinate points of each group according to the drawing strength corresponding to each group of pressure data in the first N-1 group pressure data of the drawing pen An attribute, the image attribute including at least one of a connection color and a connection thickness.
本发明实施例提供的技术方案的有益效果是:The beneficial effects of the technical solutions provided by the embodiments of the present invention are:
通过在绘图笔中的笔头四周设置至少三个压力传感器,获取压力传感器采集到的压力数据,并根据获取到的压力数据向电子设备发送绘图所需的绘图数据,以便电子设备根据该绘图数据绘制图像,由于绘图笔获取压力数据的频率不受电子设备的屏幕刷新率限制,可以远高于60Hz,可以极大的提高电子设备绘制图像的精度和绘制效果。Obtaining pressure data collected by the pressure sensor by setting at least three pressure sensors around the pen head in the drawing pen, and sending drawing data required for drawing to the electronic device according to the acquired pressure data, so that the electronic device draws according to the drawing data The image, because the frequency of the pressure data acquired by the pen is not limited by the screen refresh rate of the electronic device, can be much higher than 60 Hz, which can greatly improve the accuracy and drawing effect of the image drawn by the electronic device.
附图说明 DRAWINGS
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the present invention. Other drawings may also be obtained from those of ordinary skill in the art in light of the inventive work.
图1是本发明部分实施例提供的绘图方法所涉及的实施环境的示意图;1 is a schematic diagram of an implementation environment involved in a drawing method provided by some embodiments of the present invention;
图2是本发明一个实施例提供的绘图笔的结构图;2 is a structural diagram of a drawing pen provided by an embodiment of the present invention;
图3是本发明另一实施例提供的绘图笔的结构图;3 is a structural diagram of a drawing pen according to another embodiment of the present invention;
图4是本发明另一实施例提供的中间点的坐标确定示意图;4 is a schematic diagram of coordinate determination of an intermediate point according to another embodiment of the present invention;
图5是本发明一个实施例提供的电子设备的框图;FIG. 5 is a block diagram of an electronic device according to an embodiment of the present invention; FIG.
图6是本发明一个实施例提供的绘图装置的框图;FIG. 6 is a block diagram of a drawing apparatus according to an embodiment of the present invention; FIG.
图7是本发明一个实施例提供的绘图方法的方法流程图;FIG. 7 is a flowchart of a method for drawing a method according to an embodiment of the present invention; FIG.
图8是本发明一个实施例提供的绘图方法的方法流程图;FIG. 8 is a flowchart of a method for drawing a method according to an embodiment of the present invention; FIG.
图9是本发明另一实施例提供的绘图方法的方法流程图;FIG. 9 is a flowchart of a method for drawing a method according to another embodiment of the present invention; FIG.
图10是本发明又一实施例提供的绘图方法的方法流程图。FIG. 10 is a flowchart of a method for drawing a method according to another embodiment of the present invention.
具体实施方式detailed description
为使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明实施方式作进一步地详细描述。The embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
请参考图1,其示出了本发明部分实施例提供的绘图方法所涉及的实施环境的示意图。如图1所示,该实施环境包括绘图笔110和电子设备120。Please refer to FIG. 1 , which is a schematic diagram showing an implementation environment involved in a drawing method provided by some embodiments of the present invention. As shown in FIG. 1, the implementation environment includes a drawing pen 110 and an electronic device 120.
其中,该电子设备120可以是智能手机、平板电脑、电子书阅读器等设备。绘图笔110和电子设备120之间通过有线或者无线方式进行连接。The electronic device 120 may be a device such as a smart phone, a tablet computer, or an e-book reader. The drawing pen 110 and the electronic device 120 are connected by wire or wirelessly.
本发明各个实施例所示的方案,在绘图笔中设置压力传感器,绘图笔按照一定的采样频率采集绘图过程中压力传感器受到的压力数据,根据该压力数据中的压力数值和方向来计算绘图笔在每次采集压力数据时的移动方向和绘制力度,电子设备根据计算结果进行图像绘制,该计算过程可以由绘图笔来完成,也可以由电子设备来完成,或者由绘图笔和电子设备分别完成其中的一部分。其中,绘图笔的采样频率越高,电子设备绘制的图像与绘图笔的移动轨迹越接近,由于绘图笔的采样频率不受电子设备屏幕刷新率的影响,因此,本发明各个实施例所示的方案相对于在触摸屏中直接绘图的方案,能够极大的提高绘图 效果。According to various embodiments of the present invention, a pressure sensor is disposed in the drawing pen, and the drawing pen collects pressure data received by the pressure sensor during the drawing process according to a certain sampling frequency, and calculates the drawing pen according to the pressure value and direction in the pressure data. The electronic device draws an image according to the calculation result each time the movement data and the drawing force are collected. The calculation process may be completed by a drawing pen, or may be completed by an electronic device, or may be completed by a drawing pen and an electronic device respectively. part of it. The higher the sampling frequency of the drawing pen, the closer the image drawn by the electronic device is to the moving trajectory of the drawing pen, and the sampling frequency of the drawing pen is not affected by the screen refresh rate of the electronic device, and therefore, the embodiments of the present invention are The solution can greatly improve the drawing compared to the scheme of drawing directly in the touch screen. effect.
请参考图2,其示出了本发明一个实施例提供的绘图笔的结构图。该绘图笔可以是图1所示的绘图系统中的绘图笔110,其中,图2左半部分为绘图笔的纵切面剖视图,右半部分为笔头与压力传感器部分的纵切面剖视图。如图2所示,该绘图笔可以包括:笔头210、外壳220、至少三个压力传感器230、处理器240以及收发器250;Please refer to FIG. 2, which shows a structural diagram of a drawing pen provided by an embodiment of the present invention. The drawing pen may be the drawing pen 110 in the drawing system shown in Fig. 1, wherein the left half of Fig. 2 is a longitudinal sectional view of the drawing pen, and the right half is a longitudinal sectional view of the writing head and the pressure sensor portion. As shown in FIG. 2, the pen can include: a pen tip 210, a housing 220, at least three pressure sensors 230, a processor 240, and a transceiver 250;
所述笔头210半埋于所述外壳220中,所述至少三个压力传感器230固定于所述外壳220内部,且其中任意相邻的两个压力传感器到笔头210的中心线的垂直线之间的夹角α小于180°;The pen tip 210 is half buried in the outer casing 220, and the at least three pressure sensors 230 are fixed inside the outer casing 220, and any two adjacent pressure sensors are between the vertical lines of the center line of the pen tip 210. The angle α is less than 180°;
所述处理器240分别与所述至少三个压力传感器230和所述收发器250电性相连;The processor 240 is electrically connected to the at least three pressure sensors 230 and the transceiver 250 respectively;
所述处理器240,用于按照预设采样频率获取所述至少三个压力传感器230采集到的压力数据;The processor 240 is configured to acquire pressure data collected by the at least three pressure sensors 230 according to a preset sampling frequency;
所述处理器240,还用于根据获取到的所述压力数据,控制所述收发器250向电子设备发送绘图数据,以便所述电子设备根据所述绘图数据绘制图像。The processor 240 is further configured to control, according to the acquired pressure data, the transceiver 250 to send drawing data to the electronic device, so that the electronic device draws an image according to the drawing data.
综上所述,本发明实施例提供的绘图笔,通过在绘图笔中的笔头四周设置至少三个压力传感器,获取压力传感器采集到的压力数据,并根据获取到的压力数据向电子设备发送绘图所需的绘图数据,以便电子设备根据该绘图数据绘制图像,由于绘图笔获取压力数据的频率不受电子设备的屏幕刷新率限制,可以远高于60Hz,可以极大的提高电子设备绘制图像的精度和绘制效果。In summary, the drawing pen provided by the embodiment of the present invention acquires pressure data collected by the pressure sensor by setting at least three pressure sensors around the pen head in the drawing pen, and sends a drawing to the electronic device according to the acquired pressure data. The required drawing data, so that the electronic device draws an image according to the drawing data, because the frequency of the pressure data acquired by the drawing pen is not limited by the screen refresh rate of the electronic device, and can be much higher than 60 Hz, which can greatly improve the drawing of the image by the electronic device. Precision and rendering effects.
基于上述图2所示的绘图笔,请参考图3,其示出了本发明另一实施例提供的绘图笔的结构图。该绘图笔可以是图1所示的绘图系统中的绘图笔110,其中,图3左半部分为绘图笔的纵切面剖视图,右半部分为笔头与压力传感器部分的纵切面剖视图。如图3所示,该绘图笔可以包括:笔头210、外壳220、至少三个压力传感器230、处理器240以及收发器250;Based on the above-described drawing pen shown in FIG. 2, please refer to FIG. 3, which shows a structural diagram of a drawing pen according to another embodiment of the present invention. The drawing pen may be the drawing pen 110 in the drawing system shown in Fig. 1, wherein the left half of Fig. 3 is a longitudinal sectional view of the drawing pen, and the right half is a longitudinal sectional view of the writing head and the pressure sensor portion. As shown in FIG. 3, the pen can include: a pen tip 210, a housing 220, at least three pressure sensors 230, a processor 240, and a transceiver 250;
其中,笔头210、外壳220、至少三个压力传感器230、处理器240以及收发器250之间的连接关系以及处理器20所执行的操作步骤与上述图2所示的绘图笔相同,详见上一实施例中的描述,此处不再赘述。The connection relationship between the pen tip 210, the outer casing 220, the at least three pressure sensors 230, the processor 240, and the transceiver 250 and the operation steps performed by the processor 20 are the same as those of the drawing pen shown in FIG. 2 above. The description in an embodiment is not described herein again.
可选的,所述外壳220上设置有握持标识221,所述握持标识221用于指 示握持所述绘画笔的手握形态。Optionally, the housing 220 is provided with a holding identifier 221, and the holding identifier 221 is used to refer to Show the grip form of the drawing pen.
为了保证压力传感器所感应的压力的方向为已知,可以指示用户采用固定的手握形态来持握绘图笔,例如,在画笔上增加凹槽,告知用户需要使用的持物方式,以此可以保证用户每次握笔的手握形态和传感器对应方向都是一致的。In order to ensure that the direction of the pressure sensed by the pressure sensor is known, the user can be instructed to hold the pen with a fixed hand grip form, for example, by adding a groove to the brush to inform the user of the manner of holding the object, thereby ensuring The grip form of the user and the corresponding direction of the sensor are the same every time the user holds the pen.
可选的,所述预设采样频率大于60Hz。Optionally, the preset sampling frequency is greater than 60 Hz.
由于绘图笔获取压力数据的频率不受电子设备的屏幕刷新率限制,理论上可以将采样频率设置的非常高,比如,可以将该采样频率设置为1000Hz。Since the frequency at which the pen obtains pressure data is not limited by the screen refresh rate of the electronic device, the sampling frequency can theoretically be set very high, for example, the sampling frequency can be set to 1000 Hz.
可选的,所述绘图数据为N-1个中间点的坐标,N≥2;所述处理器,还用于根据所述压力数据,通过以下方式获取所述N-1个中间点的坐标:Optionally, the drawing data is a coordinate of N-1 intermediate points, and N≥2; the processor is further configured to acquire coordinates of the N-1 intermediate points according to the pressure data by: :
所述处理器240控制所述收发器先后接收所述电子设备实时获取并发送的第一坐标和第二坐标,所述第一坐标和所述第二坐标为所述笔头在所述电子设备的绘图区域先后经过的两点的坐标。The processor 240 controls the transceiver to receive the first coordinate and the second coordinate acquired and sent by the electronic device in real time, where the first coordinate and the second coordinate are the writing head of the electronic device in the electronic device. The coordinates of the two points in the drawing area.
电子设备的绘图区域可以是电子设备的触摸屏中的指定区域,或者,该绘图区域也可以是与电子设备相关联的绘图板中的绘图区域。在绘图笔的笔头在该绘图区域滑动的过程中,触摸屏或绘图板可以向电子设备上报触点信息,电子设备以此来获取笔头在绘图区域中先后滑过的两个点的坐标,电子设备每获取一个坐标,即将获取到的坐标实时发送给绘图笔。The drawing area of the electronic device may be a designated area in the touch screen of the electronic device, or the drawing area may also be a drawing area in the drawing board associated with the electronic device. During the sliding of the pen tip of the drawing pen in the drawing area, the touch screen or the drawing board can report the contact information to the electronic device, and the electronic device can acquire the coordinates of the two points that the pen tip slides in the drawing area, the electronic device. Each time a coordinate is acquired, the coordinates to be acquired are sent to the drawing pen in real time.
所述处理器240根据所述第一坐标、所述第二坐标以及在接收到所述第一坐标和所述第二坐标的时间段之内依次获取的N组压力数据中的前N-1组压力数据,计算所述笔头在所述第一坐标和所述第二坐标之间依次经过的N-1个中间点的坐标。The processor 240 according to the first coordinate, the second coordinate, and the first N-1 of the N sets of pressure data sequentially acquired within a time period in which the first coordinate and the second coordinate are received The group pressure data is used to calculate coordinates of N-1 intermediate points that the pen tip sequentially passes between the first coordinate and the second coordinate.
可选的,所述前N-1组压力数据中的每一组压力数据中包含所述至少三个压力传感器采集到的最大的两个压力数值以及所述两个压力数值各自的方向。Optionally, each set of pressure data in the front N-1 group pressure data includes a maximum of two pressure values collected by the at least three pressure sensors and a direction of each of the two pressure values.
其中,三个压力传感器每次采集压力数据时,只有两个压力传感器可以采集到有效的压力数值,且这两个有效的压力数值必然是三个压力传感器采集到的压力数值中最大的两个数值,即使只有一个压力传感器采集到的压力数值不为0,其它两个压力传感器采集到的压力数值为0时,也可以认为这两个最大的数值中有一个是0,在默认用户按照所指示的固定手握形态来持握绘图笔的情况下,只需要对绘图笔中的三个压力传感器分别编号,即可以获知有效的压力数值的方向。相应的,处理器获取的每一组压力数据中均包含两个有效的压 力数值以及这两个有效的压力数值的方向。Among them, when three pressure sensors collect pressure data, only two pressure sensors can collect effective pressure values, and the two effective pressure values must be the two largest of the pressure values collected by the three pressure sensors. The value, even if only one pressure sensor collects the pressure value is not 0, the other two pressure sensors collect the pressure value is 0, it can be considered that one of the two largest values is 0, in the default user according to In the case of the indicated fixed grip style to hold the pen, only the three pressure sensors in the pen need to be numbered separately, that is, the direction of the effective pressure value can be known. Correspondingly, each set of pressure data acquired by the processor contains two effective pressures. The force value and the direction of the two effective pressure values.
绘图笔每接收到一个新的坐标,即获取从接收到上一个坐标到接收到该新的坐标之间,四个压力传感器采集到的前N-1组压力数据,根据这两个坐标和该前N-1组压力数据,即可以从上一个坐标可以,依次确定这两个坐标之间的N-1个中间点的坐标。绘图笔将确定的N-1个中间点的坐标发送给电子设备,电子设备即可以据以绘制出笔头在这两个坐标之间的滑动轨迹。Each time the pen receives a new coordinate, that is, the first N-1 group of pressure data collected by the four pressure sensors from the time the last coordinate is received to the time the new coordinate is received, according to the two coordinates and the The pre-N-1 group pressure data, that is, the coordinates of N-1 intermediate points between the two coordinates can be determined in turn from the previous coordinate. The drawing pen sends the coordinates of the determined N-1 intermediate points to the electronic device, and the electronic device can draw a sliding track between the two coordinates of the writing head.
可选的,所述处理器340,具体用于通过以下方式计算所述笔头在所述第一坐标和所述第二坐标之间依次经过的所述N-1个中间点的坐标:Optionally, the processor 340 is configured to calculate coordinates of the N-1 intermediate points that the pen tip sequentially passes between the first coordinate and the second coordinate by:
所述处理器计算所述第一坐标和所述第二坐标之间的直线距离L以及从所述第一坐标到所述第二坐标之间的连线方向a;The processor calculates a linear distance L between the first coordinate and the second coordinate and a connection direction a from the first coordinate to the second coordinate;
根据所述前N-1组压力数据中的第i组压力数据包含的两个压力数值以及所述第i组压力数据包含的两个压力数值各自的方向,计算在采集所述第i组压力数据时,所述笔头的移动方向b;Calculating the ith group pressure according to the two pressure values included in the i-th group pressure data of the pre-N-1 group pressure data and the respective pressure values of the two pressure values included in the ith group pressure data Data, the direction of movement of the pen head b;
计算所述连线方向a和所述移动方向b之间的夹角γ;Calculating an angle γ between the connecting direction a and the moving direction b;
根据所述直线距离L和所述夹角γ计算在采集第i组压力数据到采集第i+1组压力数据之间所述笔头移动的距离Li,Li=L*cosγ/N;Calculating, according to the linear distance L and the angle γ, a distance L i , L i = L* cos γ / N of the movement of the tip between collecting the i-th group pressure data to collecting the (i+1)-th pressure data;
根据第i-1个中间点的坐标、所述笔头的移动方向b以及所述笔头移动的距离Li计算第i个中间点的坐标;Calculating coordinates of the i-th intermediate point according to coordinates of the i-1th intermediate point, the moving direction b of the writing head, and the distance L i of the moving of the writing head;
其中,1≤i≤N;当i=1时,所述第i-1个中间点的坐标为所述第一坐标。Wherein, 1≤i≤N; when i=1, the coordinates of the i-1th intermediate point are the first coordinates.
请参考图4,其示出了本发明另一实施例示出的中间点的坐标确定示意图;以第一坐标为坐标A,第二坐标为坐标B为例,其中,坐标B为新接收到的坐标,坐标A为上一个接收到的坐标,绘图笔根据两个坐标以及在接收到两个坐标之间获取到的N组压力数据中的前N-1组压力数据确定中间点的坐标,方法可以具体如下:Please refer to FIG. 4 , which is a schematic diagram of coordinate determination of an intermediate point according to another embodiment of the present invention; taking the first coordinate as the coordinate A and the second coordinate as the coordinate B, where the coordinate B is newly received. Coordinate, coordinate A is the last received coordinate, and the drawing pen determines the coordinates of the intermediate point according to the two coordinates and the first N-1 group pressure data among the N sets of pressure data acquired between the received two coordinates, the method Can be as follows:
1)计算坐标A和坐标B之间的直线距离L,以及从坐标A到坐标B之间的连线方向a;1) Calculate the linear distance L between the coordinate A and the coordinate B, and the connection direction a from the coordinate A to the coordinate B;
2)假定每组相邻两个中间点之间的连线在坐标A和坐标B之间的连线上的投影距离相等,且获取第1组压力数据时笔头位于坐标A,获取第N组压力数据时笔头位于坐标B,坐标A和坐标B之间存在N-1个中间点,坐标A、坐标B以及N-1个中间点中,每组相邻两个点之间的连线在坐标A和坐标B之间的连线上的投影距离为L/N。 2) It is assumed that the connection distance between the adjacent two intermediate points of each group is equal on the line connecting the coordinate A and the coordinate B, and the first set of pressure data is obtained when the writing head is at the coordinate A, and the Nth group is obtained. When the pressure data is in the coordinate B, there are N-1 intermediate points between the coordinate A and the coordinate B. Among the coordinate A, the coordinate B and the N-1 intermediate points, the connection between the adjacent two points in each group is The projection distance on the line between the coordinate A and the coordinate B is L/N.
需要说明的是,从电子设备采集到一个坐标到绘图笔接收到该坐标之间存在一定的时间差,为了确保绘图的准确性,可以预先测量该时间差的平均值,预估该时间差的平均值与绘图笔采集压力数据的采样周期之间的关系,根据该平均值与采样周期之间的关系确定与接收到的坐标对应的压力数据。比如,假设时间差的平均值约等于三个采样周期,即当绘图笔接收到坐标A时,绘图笔已经在电子设备获取到坐标A之后又采集了三组压力数据,此时,绘图笔可以将坐标A确定为在采集已有的压力数据中的倒数第四组压力数据时笔头所经过的点的坐标,同理也可以确定坐标B对应的那一组压力数据。It should be noted that there is a certain time difference between the acquisition of a coordinate from the electronic device and the receipt of the coordinate by the drawing pen. In order to ensure the accuracy of the drawing, the average value of the time difference may be measured in advance, and the average value of the time difference is estimated. The relationship between the sampling periods of the drawing pen acquisition pressure data determines the pressure data corresponding to the received coordinates based on the relationship between the average value and the sampling period. For example, suppose the average value of the time difference is approximately equal to three sampling periods. That is, when the drawing pen receives the coordinate A, the drawing pen has collected three sets of pressure data after the electronic device acquires the coordinate A. At this time, the drawing pen can The coordinate A is determined as the coordinates of the point through which the pen tip passes when collecting the fourth group of pressure data in the existing pressure data, and the same set of pressure data corresponding to the coordinate B can also be determined.
3)在确定第1个中间点的坐标时,可以从坐标A出发,根据第1组压力数据包含的两个压力数值以及第1组压力数据包含的两个压力数值各自的方向,计算在采集第1组压力数据时笔头的移动方向b1;计算连线方向a和移动方向b1之间的夹角γ1;计算在采集第1组压力数据到采集第2组压力数据之间笔头移动的距离L1=L*cosγ1/N;根据坐标A、笔头的移动方向b1以及L1计算第1个中间点的坐标。3) When determining the coordinates of the first intermediate point, it can be calculated from the coordinate A according to the two pressure values included in the first group pressure data and the two pressure values included in the first group pressure data. The movement direction b 1 of the writing head in the first group of pressure data; the angle γ 1 between the connection direction a and the moving direction b 1 is calculated; the movement of the writing head between the collection of the first group of pressure data and the acquisition of the second group of pressure data is calculated. The distance L 1 = L * cos γ 1 / N; the coordinates of the first intermediate point are calculated from the coordinates A, the moving directions b 1 and L 1 of the writing head.
4)在确定第i个中间点的坐标时,可以从第i-1个中间点出发,根据第i组压力数据包含的两个压力数值以及第i组压力数据包含的两个压力数值各自的方向,计算在采集第i组压力数据时笔头的移动方向bi;计算连线方向a和移动方向bi之间的夹角γi;计算在采集第i组压力数据到采集第i+1组压力数据之间笔头移动的距离Li=L*cosγi/N;根据坐标A、笔头的移动方向bi以及Li计算第i个中间点的坐标。其中,2≤i≤N-1。4) When determining the coordinates of the i-th intermediate point, starting from the i-1th intermediate point, the two pressure values included in the i-th group pressure data and the two pressure values included in the i-th group pressure data are respectively direction, is calculated in the acquisition of pressure data group i B i of the moving direction of the tip; gamma] i the angle between the direction of a connection is calculated and the movement direction B i; i-th group in the acquisition of calculating pressure data to the acquisition of the i + 1 The distance of the movement of the pen between the group pressure data is L i = L * cos γ i / N; the coordinates of the i-th intermediate point are calculated from the coordinates A, the moving directions b i and L i of the pen tip. Where 2 ≤ i ≤ N-1.
需要说明的是,本发明实施例所示的方案以假定每组相邻两个中间点之间的连线在坐标A和坐标B之间的连线上的投影距离相等为例进行说明,在实际应用中,还可以有其它根据压力数据计算中间点的坐标的方法,比如,可以假定每两个中间点之间的距离相等。It should be noted that the solution shown in the embodiment of the present invention is described by taking as an example assuming that the connection distance between the adjacent two intermediate points of each group is equal on the connecting line between the coordinate A and the coordinate B. In practical applications, there may be other methods of calculating the coordinates of the intermediate point based on the pressure data. For example, it can be assumed that the distance between each two intermediate points is equal.
可选的,所述处理器340,还用于根据所述第i组压力数据包含的两个压力数值计算在采集所述第i组压力数据时的绘制力度;Optionally, the processor 340 is further configured to calculate a drawing strength when collecting the i-th group pressure data according to the two pressure values included in the i-th group pressure data;
所述处理器340,还用于控制所述收发器向所述电子设备发送采集所述前N-1组压力数据时分别对应的绘制力度。The processor 340 is further configured to control, by the transceiver, the drawing strength corresponding to the first N-1 group of pressure data to be sent to the electronic device.
在本发明实施例中,绘图笔还可以根据压力数据的数值计算采集每一组压力数据时的绘制力度,具体比如,第i组压力数据中的两个压力数值分别为F1和F2,则该绘制力度F可以按照下述公式获得: In the embodiment of the present invention, the drawing pen can also calculate the drawing strength when collecting each set of pressure data according to the value of the pressure data. Specifically, for example, if the two pressure values in the i-th group pressure data are F1 and F2, respectively, The drawing velocity F can be obtained by the following formula:
Figure PCTCN2015075133-appb-000001
Figure PCTCN2015075133-appb-000001
电子设备接收到该绘制力度时,即可以根据该绘制力度确定第i-1个中间点到第i个中间点之间的线条的粗细或者颜色的深浅等。When the electronic device receives the drawing strength, the thickness of the line between the i-1th intermediate point and the ith intermediate point or the depth of the color may be determined according to the drawing strength.
可选的,所述绘图数据为所述压力数据。Optionally, the drawing data is the pressure data.
在本发明实施例所示的方案中,确定N-1个中间点的坐标以及绘制力度的步骤也可以由电子设备来完成,绘图笔仅将获取到的压力数据实时发送给电子设备即可。In the solution shown in the embodiment of the present invention, the step of determining the coordinates of the N-1 intermediate points and the drawing force may also be performed by the electronic device, and the pen only sends the acquired pressure data to the electronic device in real time.
需要说明的是,本发明上述实施例仅以三个压力传感器为例进行说明,优选的,还可以增加压力传感器的数量以提高准确性和可靠性,比如,可以设置4个压力传感器,且4个压力传感器呈十字形分布在笔头的周围;或者,在实际应用中,为了避免因为部分压力传感器故障而导致绘图笔无法工作的情况发生,绘图笔中也可以设置6个、8个或者12压力传感器等;或者,也可以在绘图笔中设置多个传感器组件,每个传感器组件包含至少三个压力传感器,当一个传感器组件的压力传感器发生故障时,可以使用其它的传感器组件采集压力数据。本发明实施例对于压力传感器的数量不做限定,只要采集到的压力数据能够满足笔头的移动方向和绘制力度的计算即可。It should be noted that the foregoing embodiment of the present invention is described by taking only three pressure sensors as an example. Preferably, the number of pressure sensors can also be increased to improve accuracy and reliability. For example, four pressure sensors can be set, and The pressure sensors are distributed around the tip of the pen in a cross shape; or, in practical applications, in order to avoid the inability of the pen to work due to a partial pressure sensor failure, the pen can also be set with 6, 8, or 12 pressures. Sensors, etc.; alternatively, multiple sensor assemblies can be provided in the pen, each sensor component containing at least three pressure sensors, and when the pressure sensor of one sensor component fails, other sensor components can be used to collect pressure data. The embodiment of the present invention does not limit the number of pressure sensors, as long as the collected pressure data can satisfy the calculation of the moving direction of the writing head and the drawing strength.
综上所述,本发明实施例提供的绘图笔,通过在绘图笔中的笔头四周设置至少三个压力传感器,获取压力传感器采集到的压力数据,并根据获取到的压力数据向电子设备发送绘图所需的绘图数据,以便电子设备根据该绘图数据绘制图像,由于绘图笔获取压力数据的频率不受电子设备的屏幕刷新率限制,可以远高于60Hz,可以极大的提高电子设备绘制图像的精度和绘制效果。In summary, the drawing pen provided by the embodiment of the present invention acquires pressure data collected by the pressure sensor by setting at least three pressure sensors around the pen head in the drawing pen, and sends a drawing to the electronic device according to the acquired pressure data. The required drawing data, so that the electronic device draws an image according to the drawing data, because the frequency of the pressure data acquired by the drawing pen is not limited by the screen refresh rate of the electronic device, and can be much higher than 60 Hz, which can greatly improve the drawing of the image by the electronic device. Precision and rendering effects.
此外,本发明实施例提供的绘图笔,还根据压力数据中的压力数值计算在采集每一组压力数据时的绘制力度,并将采集每一组压力数据时的绘制力度发送给电子设备,由电子设备根据该绘制力度确定线条的粗细和颜色,进一步提高了图像的绘制效果。In addition, the drawing pen provided by the embodiment of the present invention further calculates the drawing strength when collecting each group of pressure data according to the pressure value in the pressure data, and sends the drawing strength when collecting each group of pressure data to the electronic device, The electronic device determines the thickness and color of the line according to the drawing strength, thereby further improving the drawing effect of the image.
请参考图5,其示出了本发明一个实施例提供的电子设备的框图。该绘图笔可以是图1所示的绘图系统中的电子设备120,该电子设备可以是智能手机、平板电脑、电子书阅读器或者个人电脑等设备。该电子设备可以包括:总线501,以及连接到所述总线的处理器502、存储器503、收发器504。其中,所述存储器503用于存储若干个指令,所述若干个指令被配置成由所述处理器502执行; Please refer to FIG. 5, which shows a block diagram of an electronic device according to an embodiment of the present invention. The drawing pen may be the electronic device 120 in the drawing system shown in FIG. 1, and the electronic device may be a device such as a smart phone, a tablet computer, an e-book reader, or a personal computer. The electronic device can include a bus 501, and a processor 502, a memory 503, and a transceiver 504 coupled to the bus. The memory 503 is configured to store a plurality of instructions, the instructions being configured to be executed by the processor 502;
所述处理器502,用于控制所述收发器504接收绘图笔发送的绘图数据;The processor 502 is configured to control the transceiver 504 to receive drawing data sent by a drawing pen;
所述处理器502,用于根据所述绘图数据绘制图像。The processor 502 is configured to draw an image according to the drawing data.
可选的,所述绘图数据为所述绘图笔中的至少三个压力传感器采集到的压力数据;所述处理器502在根据所述绘图数据绘制图像时,具体用于:Optionally, the drawing data is pressure data collected by at least three pressure sensors in the drawing pen; when the image is drawn according to the drawing data, the processor 502 is specifically configured to:
获取第一坐标和第二坐标,所述第一坐标和所述第二坐标为所述绘图笔的笔头在所述电子设备的绘图区域中先后经过的两点的坐标;根据所述第一坐标、所述第二坐标以及在所述坐标获取单元获取到所述第一坐标和所述第二坐标的时间段之内,所述绘图笔依次获取到的N组压力数据中的前N-1组压力数据,计算所述笔头在所述第一坐标和所述第二坐标之间依次经过的N-1个中间点的坐标,N≥2;绘制所述第一坐标、所述N-1个中间点的坐标以及所述第二坐标各自对应的坐标点中,每组相邻的两个坐标点之间的连线图像。Obtaining a first coordinate and a second coordinate, where the first coordinate and the second coordinate are coordinates of two points that the pen tip of the drawing pen passes in the drawing area of the electronic device; according to the first coordinate And the second coordinate and the first N-1 of the N sets of pressure data sequentially acquired by the drawing pen within a time period in which the coordinate acquiring unit acquires the first coordinate and the second coordinate Group pressure data, calculating coordinates of N-1 intermediate points sequentially passing between the first coordinate and the second coordinate, N≥2; drawing the first coordinate, the N-1 The coordinates of the intermediate points and the coordinate images between the two coordinate points corresponding to each of the second coordinates.
可选的,所述前N-1组压力数据中的每一组压力数据中包含所述至少三个压力传感器采集到的最大的两个压力数值以及所述两个压力数值各自的方向;Optionally, each set of pressure data of the first N-1 group pressure data includes a maximum two pressure values collected by the at least three pressure sensors and a direction of each of the two pressure values;
所述处理器502在计算所述笔头在所述第一坐标和所述第二坐标之间依次经过的N-1个中间点的坐标时,具体用于:The processor 502 is specifically configured to: when calculating the coordinates of the N-1 intermediate points that the pen tip passes between the first coordinate and the second coordinate;
计算所述第一坐标和所述第二坐标之间的直线距离L以及从所述第一坐标到所述第二坐标之间的连线方向a;根据所述前N-1组压力数据中的第i组压力数据包含的两个压力数值以及所述第i组压力数据包含的两个压力数值各自的方向,计算在采集所述第i组压力数据时,所述笔头的移动方向b;计算所述连线方向a和所述移动方向b之间的夹角γ;根据所述直线距离L和所述夹角γ计算在采集第i组压力数据到采集第i+1组压力数据之间所述笔头移动的距离Li,Li=L*cosγ/N;根据第i-1个中间点的坐标、所述笔头的移动方向b以及所述笔头移动的距离Li计算第i个中间点的坐标;Calculating a linear distance L between the first coordinate and the second coordinate and a connection direction a from the first coordinate to the second coordinate; according to the front N-1 group pressure data The pressure value included in the ith group pressure data and the direction of the two pressure values included in the ith group pressure data, and calculating the moving direction b of the pen tip when collecting the ith group pressure data; Calculating an angle γ between the connection direction a and the moving direction b; calculating the pressure data of the i-th group to collect the pressure data of the (i+1)th group according to the linear distance L and the angle γ The distance L i , L i = L * cos γ / N between the movements of the writing head; calculating the i-th according to the coordinates of the i-1th intermediate point, the moving direction b of the writing head, and the distance L i of the movement of the writing head The coordinates of the intermediate point;
其中,1≤i≤N-1;当i=1时,所述第i-1个中间点的坐标为所述第一坐标。Wherein, 1≤i≤N-1; when i=1, the coordinates of the i-1th intermediate point are the first coordinates.
其中,电子设备根据压力数据确定两个坐标之间的中间点的坐标的方法,与图3所示的实施例中绘图笔确定中间点的坐标的方法类似,具体请参考图4所对应的部分描述,此处不再赘述。The method for determining the coordinates of the intermediate point between the two coordinates according to the pressure data is similar to the method for determining the coordinates of the intermediate point by the drawing pen in the embodiment shown in FIG. 3. For details, please refer to the corresponding part of FIG. Description, no longer repeat here.
需要说明的是,本发明实施例所示的方案中,由绘图笔将压力数据发送给电子设备,其中从绘图笔采集到压力数据到电子设备接收到压力数据之间存在时间差,即电子设备获取到第一坐标或者第二坐标时,还未接收到与获取到的坐标对应的压力数据还未接收到,因此,同样以时间差的平均值约等于三个采 样周期为例,与图4所示实施例中的描述不同的是,在确定与电子设备采集到的坐标相对应的压力数据时,电子设备可以将获取到坐标A之后接收到的第三组压力数据确定为与坐标A对应的压力数据,同理也可以将获取到坐标B之后接收到的第三组压力数据确定为与坐标B对应的压力数据。It should be noted that, in the solution shown in the embodiment of the present invention, the pressure data is sent to the electronic device by the drawing pen, wherein there is a time difference between the collection of the pressure data from the drawing pen and the receipt of the pressure data by the electronic device, that is, the electronic device acquires When the first coordinate or the second coordinate is reached, the pressure data corresponding to the acquired coordinates has not been received yet, so the average value of the time difference is also equal to three For example, the sample cycle is different from the description in the embodiment shown in FIG. 4, when the pressure data corresponding to the coordinates collected by the electronic device is determined, the electronic device may acquire the third group after the coordinate A is acquired. The pressure data is determined as the pressure data corresponding to the coordinate A. Similarly, the third group of pressure data received after the acquisition of the coordinate B may be determined as the pressure data corresponding to the coordinate B.
可选的,所述处理器502,还用于根据所述第i组压力数据包含的两个压力数值计算所述绘图笔在采集所述第i组压力数据时的绘制力度;Optionally, the processor 502 is further configured to calculate, according to the two pressure values included in the i-th group pressure data, a drawing strength of the drawing pen when collecting the i-th group pressure data;
所述处理器502,还用于根据所述绘图笔在采集所述前N-1组压力数据中的各组压力数据时分别对应的绘制力度,分别设置所述每组相邻的两个坐标点之间的连线图像的图像属性,所述图像属性包括连线颜色和连线粗细中的至少一种。The processor 502 is further configured to separately set two adjacent coordinates of each group according to respective drawing strengths when the drawing pen collects each group of pressure data in the first N-1 group pressure data. An image attribute of the connected image between the points, the image attribute including at least one of a connection color and a connection thickness.
其中,电子设备根据压力数据中包含的压力数值计算绘图笔在采集每一组压力数据时的绘制力度的方法与图3对应实施例中绘图笔计算该绘制力度的方法类似,此处不再赘述。The method for calculating the drawing strength of the drawing pen when collecting each group of pressure data according to the pressure value included in the pressure data is similar to the method for calculating the drawing strength by the drawing pen in the corresponding embodiment of FIG. 3, and details are not described herein. .
可选的于,所述绘图数据为第一坐标和第二坐标之间的N-1个中间点的坐标;所述第一坐标和所述第二坐标为所述笔头在所述电子设备的绘图区域先后经过的两点的坐标;所述处理器502,用于实时获取并控制所述收发器504向所述绘图笔发送第一坐标和第二坐标;Optionally, the drawing data is coordinates of N-1 intermediate points between the first coordinate and the second coordinate; the first coordinate and the second coordinate are the pen tip in the electronic device a coordinate of two points passing through the drawing area; the processor 502 is configured to acquire and control the transceiver 504 to send the first coordinate and the second coordinate to the drawing pen in real time;
所述处理器502,用于根据绘图数据,通过以下方式绘制图像:The processor 502 is configured to draw an image according to the drawing data by:
所述处理器502绘制所述第一坐标、所述N-1个中间点的坐标以及所述第二坐标各自对应的坐标点中,每组相邻的两个坐标点之间的连线图像。The processor 502 draws a line image of the first coordinate, the coordinates of the N-1 intermediate points, and the coordinate points corresponding to the second coordinate, and the adjacent two coordinate points of each group .
可选的,所述处理器502,还用于控制所述收发器504接收所述绘图笔发送的,所述绘图笔在采集所述前N-1组压力数据中的各组压力数据时分别对应的绘制力度;Optionally, the processor 502 is further configured to control the transceiver 504 to receive the pen sent by the pen, and the pens respectively collect the pressure data of each group in the first N-1 group of pressure data. Corresponding drawing strength;
所述处理器502,还用于根据所述绘图笔在采集所述前N-1组压力数据中的各组压力数据时分别对应的绘制力度,分别设置所述每组相邻的两个坐标点之间的连线图像的图像属性,所述图像属性包括连线颜色和连线粗细中的至少一种。The processor 502 is further configured to separately set two adjacent coordinates of each group according to respective drawing strengths when the drawing pen collects each group of pressure data in the first N-1 group pressure data. An image attribute of the connected image between the points, the image attribute including at least one of a connection color and a connection thickness.
其中,绘图笔根据压力数据确定两个坐标之间的中间点的坐标的方法,以及绘图笔计算在采集每一组压力数据时的绘制力度的方法的具体步骤请参考图3所示的实施例中的描述,此处不再赘述。The method for determining the coordinates of the intermediate point between the two coordinates according to the pressure data, and the specific steps of the method for calculating the drawing strength of the drawing pen when collecting each set of pressure data, please refer to the embodiment shown in FIG. 3 . The description in the description will not be repeated here.
综上所述,本发明实施例提供的电子设备,通过在绘图笔中的笔头四周设 置至少三个压力传感器,电子设备接收绘图笔根据该四个压力传感器采集到的压力数据发送的绘图数据进行图像绘制,由于绘图笔获取压力数据的频率不受电子设备的屏幕刷新率限制,可以远高于60Hz,可以极大的提高电子设备绘制图像的精度和绘制效果。In summary, the electronic device provided by the embodiment of the present invention is disposed around the writing head in the drawing pen. The at least three pressure sensors are disposed, and the electronic device receives the drawing data sent by the drawing pen according to the pressure data collected by the four pressure sensors, and the image is drawn according to the screen refresh rate of the electronic device. Far above 60Hz, it can greatly improve the accuracy and rendering effect of the image drawn by electronic devices.
此外,本发明实施例提供的电子设备,还根据压力数据中的压力数值计算在采集每一组压力数据时的绘制力度,或者获取绘图笔计算出的绘制力度,根据该绘制力度确定线条的粗细和颜色,进一步提高了图像的绘制效果。In addition, the electronic device provided by the embodiment of the present invention further calculates the drawing strength when collecting each set of pressure data according to the pressure value in the pressure data, or obtains the drawing strength calculated by the drawing pen, and determines the thickness of the line according to the drawing strength. And color, further improving the image rendering effect.
请参考图6,其示出了本发明一个实施例提供的绘图装置的框图。该绘图装置可以用于如图1所示的绘图系统的电子设备120中。该绘图装置可以包括:Please refer to FIG. 6, which shows a block diagram of a drawing apparatus provided by an embodiment of the present invention. The drawing device can be used in the electronic device 120 of the drawing system as shown in FIG. The drawing device can include:
绘图数据接收模块601,用于接收绘图笔发送的绘图数据;a drawing data receiving module 601, configured to receive drawing data sent by the drawing pen;
图像绘制模块602,用于根据所述绘图数据绘制图像。The image drawing module 602 is configured to draw an image according to the drawing data.
可选的,所述绘图数据为所述绘图笔中的至少三个压力传感器采集到的压力数据;所述图像绘制模块在根据所述绘图数据绘制图像时,具体用于:Optionally, the drawing data is pressure data collected by at least three pressure sensors in the drawing pen; when the image drawing module draws an image according to the drawing data, specifically:
获取第一坐标和第二坐标,所述第一坐标和所述第二坐标为所述绘图笔的笔头在所述电子设备的绘图区域中先后经过的两点的坐标;Obtaining a first coordinate and a second coordinate, where the first coordinate and the second coordinate are coordinates of two points that the pen tip of the drawing pen passes successively in the drawing area of the electronic device;
根据所述第一坐标、所述第二坐标以及在所述坐标获取单元获取到所述第一坐标和所述第二坐标的时间段之内,所述绘图笔依次获取到的N组压力数据中的前N-1组压力数据,计算所述笔头在所述第一坐标和所述第二坐标之间依次经过的N-1个中间点的坐标,N≥2;And according to the first coordinate, the second coordinate, and the time period in which the coordinate acquiring unit acquires the first coordinate and the second coordinate, the pen sets sequentially acquire N sets of pressure data. The first N-1 group pressure data in the middle, calculating the coordinates of the N-1 intermediate points that the pen head sequentially passes between the first coordinate and the second coordinate, N≥2;
绘制所述第一坐标、所述N-1个中间点的坐标以及所述第二坐标各自对应的坐标点中,每组相邻的两个坐标点之间的连线图像。And drawing a line image of the first coordinate, the coordinates of the N-1 intermediate points, and the coordinate points corresponding to the second coordinates, and the adjacent two coordinate points of each group.
可选的,所述前N-1组压力数据中的每一组压力数据中包含所述至少三个压力传感器采集到的最大的两个压力数值以及所述两个压力数值各自的方向;Optionally, each set of pressure data of the first N-1 group pressure data includes a maximum two pressure values collected by the at least three pressure sensors and a direction of each of the two pressure values;
所述图像绘制模块在计算所述笔头在所述第一坐标和所述第二坐标之间依次经过的N-1个中间点的坐标时,具体用于:The image drawing module is specifically configured to: when calculating coordinates of the N-1 intermediate points that the pen tip passes between the first coordinate and the second coordinate;
计算所述第一坐标和所述第二坐标之间的直线距离L以及从所述第一坐标到所述第二坐标之间的连线方向a;根据所述前N-1组压力数据中的第i组压力数据包含的两个压力数值以及所述第i组压力数据包含的两个压力数值各自的方向,计算在采集所述第i组压力数据时,所述笔头的移动方向b;计算所述连线方向a和所述移动方向b之间的夹角γ;根据所述直线距离L和所述 夹角γ计算在采集第i组压力数据到采集第i+1组压力数据之间所述笔头移动的距离Li,Li=L*cosγ/N;根据第i-1个中间点的坐标、所述笔头的移动方向b以及所述笔头移动的距离Li计算第i个中间点的坐标;Calculating a linear distance L between the first coordinate and the second coordinate and a connection direction a from the first coordinate to the second coordinate; according to the front N-1 group pressure data The pressure value included in the ith group pressure data and the direction of the two pressure values included in the ith group pressure data, and calculating the moving direction b of the pen tip when collecting the ith group pressure data; Calculating an angle γ between the connection direction a and the moving direction b; calculating the pressure data of the i-th group to collect the pressure data of the (i+1)th group according to the linear distance L and the angle γ The distance L i , L i = L * cos γ / N between the movements of the writing head; calculating the i-th according to the coordinates of the i-1th intermediate point, the moving direction b of the writing head, and the distance L i of the movement of the writing head The coordinates of the intermediate point;
其中,1≤i≤N-1;当i=1时,所述第i-1个中间点的坐标为所述第一坐标。Wherein, 1≤i≤N-1; when i=1, the coordinates of the i-1th intermediate point are the first coordinates.
其中,电子设备根据压力数据确定两个坐标之间的中间点的坐标的方法,与图3所示的实施例中绘图笔确定中间点的坐标的方法类似,具体请参考图4所对应的部分描述,此处不再赘述。The method for determining the coordinates of the intermediate point between the two coordinates according to the pressure data is similar to the method for determining the coordinates of the intermediate point by the drawing pen in the embodiment shown in FIG. 3. For details, please refer to the corresponding part of FIG. Description, no longer repeat here.
可选的,所述图像绘制模块602,还用于根据所述第i组压力数据包含的两个压力数值计算所述绘图笔在采集所述第i组压力数据时的绘制力度;Optionally, the image drawing module 602 is further configured to calculate, according to the two pressure values included in the i-th group pressure data, a drawing strength of the drawing pen when collecting the i-th group pressure data;
所述图像绘制模块602,还用于根据所述绘图笔在采集所述前N-1组压力数据中的各组压力数据时分别对应的绘制力度,分别设置所述每组相邻的两个坐标点之间的连线图像的图像属性,所述图像属性包括连线颜色和连线粗细中的至少一种。The image drawing module 602 is further configured to separately set two adjacent groups according to respective drawing strengths when the drawing pen collects each group of pressure data in the first N-1 group pressure data. An image attribute of a line image between coordinate points, the image attribute including at least one of a connection color and a connection thickness.
其中,电子设备根据压力数据中包含的压力数值计算绘图笔在采集每一组压力数据时的绘制力度的方法与图3对应实施例中绘图笔计算该绘制力度的方法类似,此处不再赘述。The method for calculating the drawing strength of the drawing pen when collecting each group of pressure data according to the pressure value included in the pressure data is similar to the method for calculating the drawing strength by the drawing pen in the corresponding embodiment of FIG. 3, and details are not described herein. .
可选的,所述绘图数据为第一坐标和第二坐标之间的N-1个中间点的坐标;所述第一坐标和所述第二坐标为所述笔头在所述电子设备的绘图区域先后经过的两点的坐标;Optionally, the drawing data is coordinates of N-1 intermediate points between the first coordinate and the second coordinate; the first coordinate and the second coordinate are drawings of the pen tip on the electronic device The coordinates of the two points that the region passes through;
所述图像绘制模块602,用于根据绘图数据,通过以下方式绘制图像:The image drawing module 602 is configured to draw an image according to the drawing data by:
所述图像绘制模块602,用于绘制所述第一坐标、所述N-1个中间点的坐标以及所述第二坐标各自对应的坐标点中,每组相邻的两个坐标点之间的连线图像。The image drawing module 602 is configured to draw the coordinates of the first coordinate, the coordinates of the N-1 intermediate points, and the corresponding coordinate points of the second coordinate, between two adjacent coordinate points of each group Wired image.
可选的,所述装置还包括:绘制力度接收模块603以及属性设置模块604:Optionally, the device further includes: a drawing strength receiving module 603 and an attribute setting module 604:
绘制力度接收模块603,用于接收所述绘图笔发送的,所述绘图笔在采集所述前N-1组压力数据中的各组压力数据时分别对应的绘制力度;The drawing strength receiving module 603 is configured to receive, according to the drawing pen, the drawing strength corresponding to each group of pressure data in the first N-1 group pressure data sent by the drawing pen;
所述属性设置模块604,用于根据所述绘图笔在采集所述前N-1组压力数据中的各组压力数据时分别对应的绘制力度,分别设置所述每组相邻的两个坐标点之间的连线图像的图像属性,所述图像属性包括连线颜色和连线粗细中的至少一种。The attribute setting module 604 is configured to separately set two adjacent coordinates of each group according to respective drawing strengths when the drawing pen collects each group of pressure data in the first N-1 group pressure data. An image attribute of the connected image between the points, the image attribute including at least one of a connection color and a connection thickness.
其中,绘图笔根据压力数据确定两个坐标之间的中间点的坐标的方法,以 及绘图笔计算在采集每一组压力数据时的绘制力度的方法的具体步骤请参考图3所示的实施例中的描述,此处不再赘述。Wherein, the drawing pen determines the coordinates of the intermediate point between the two coordinates according to the pressure data, For the specific steps of the method for calculating the drawing strength when collecting each set of pressure data, please refer to the description in the embodiment shown in FIG. 3, and details are not described herein again.
综上所述,本发明实施例提供的绘图装置,通过在绘图笔中的笔头四周设置至少三个压力传感器,电子设备接收绘图笔根据该四个压力传感器采集到的压力数据发送的绘图数据进行图像绘制,由于绘图笔获取压力数据的频率不受电子设备的屏幕刷新率限制,可以远高于60Hz,可以极大的提高电子设备绘制图像的精度和绘制效果。In summary, the drawing apparatus provided by the embodiment of the present invention provides at least three pressure sensors around the writing head in the drawing pen, and the electronic device receives the drawing data sent by the drawing pen according to the pressure data collected by the four pressure sensors. Image drawing, because the frequency of the pressure data obtained by the pen is not limited by the screen refresh rate of the electronic device, it can be much higher than 60 Hz, which can greatly improve the accuracy and drawing effect of the image drawn by the electronic device.
此外,本发明实施例提供的绘图装置,还根据压力数据中的压力数值计算在采集每一组压力数据时的绘制力度,或者获取绘图笔计算出的绘制力度,根据该绘制力度确定线条的粗细和颜色,进一步提高了图像的绘制效果。In addition, the drawing device provided by the embodiment of the present invention further calculates the drawing strength when collecting each set of pressure data according to the pressure value in the pressure data, or obtains the drawing strength calculated by the drawing pen, and determines the thickness of the line according to the drawing strength. And color, further improving the image rendering effect.
请参考图7,其示出了本发明一个实施例提供的绘图方法的方法流程图。该绘图方法可以用于如图1所示的绘图系统的绘图笔110中。该绘图方法可以包括:Please refer to FIG. 7, which is a flowchart of a method for drawing a method according to an embodiment of the present invention. This drawing method can be used in the drawing pen 110 of the drawing system shown in FIG. The drawing method can include:
步骤701,按照预设采样频率获取该绘图笔中的至少三个压力传感器采集到的压力数据。Step 701: Acquire pressure data collected by at least three pressure sensors in the drawing pen according to a preset sampling frequency.
步骤702,根据获取到的该压力数据,控制该绘图笔中的收发器向电子设备发送绘图数据,以便该电子设备根据该绘图数据绘制图像。Step 702: Control, according to the acquired pressure data, the transceiver in the drawing pen to send drawing data to the electronic device, so that the electronic device draws an image according to the drawing data.
综上所述,本发明实施例提供的绘图方法,通过在绘图笔中的笔头四周设置至少三个压力传感器,获取压力传感器采集到的压力数据,并根据获取到的压力数据向电子设备发送绘图所需的绘图数据,以便电子设备根据该绘图数据绘制图像,由于绘图笔获取压力数据的频率不受电子设备的屏幕刷新率限制,可以远高于60Hz,可以极大的提高电子设备绘制图像的精度和绘制效果。In summary, the drawing method provided by the embodiment of the present invention acquires pressure data collected by the pressure sensor by setting at least three pressure sensors around the pen head in the drawing pen, and sends a drawing to the electronic device according to the acquired pressure data. The required drawing data, so that the electronic device draws an image according to the drawing data, because the frequency of the pressure data acquired by the drawing pen is not limited by the screen refresh rate of the electronic device, and can be much higher than 60 Hz, which can greatly improve the drawing of the image by the electronic device. Precision and rendering effects.
请参考图8,其示出了本发明一个实施例提供的绘图方法的方法流程图。该绘图方法可以用于如图1所示的绘图系统的电子设备120中。该绘图方法可以包括:Please refer to FIG. 8 , which is a flowchart of a method for drawing a method according to an embodiment of the present invention. The drawing method can be used in the electronic device 120 of the drawing system as shown in FIG. The drawing method can include:
步骤801,接收绘图笔发送的绘图数据,该绘图数据是该绘图笔按照预设采样频率获取该绘图笔中的至少三个压力传感器采集到的压力数据,并根据该压力数据发送的。Step 801: Receive drawing data sent by the drawing pen, where the drawing data is that the drawing pen acquires pressure data collected by at least three pressure sensors in the drawing pen according to a preset sampling frequency, and sends the pressure data according to the pressure data.
步骤802,根据该绘图数据绘制图像。 Step 802, drawing an image according to the drawing data.
综上所述,本发明实施例提供的绘图方法,通过在绘图笔中的笔头四周设置至少三个压力传感器,电子设备接收绘图笔根据该四个压力传感器采集到的压力数据发送的绘图数据进行图像绘制,由于绘图笔获取压力数据的频率不受电子设备的屏幕刷新率限制,可以远高于60Hz,可以极大的提高电子设备绘制图像的精度和绘制效果。In summary, the drawing method provided by the embodiment of the present invention provides at least three pressure sensors around the writing head in the drawing pen, and the electronic device receives the drawing data sent by the drawing pen according to the pressure data collected by the four pressure sensors. Image drawing, because the frequency of the pressure data obtained by the pen is not limited by the screen refresh rate of the electronic device, it can be much higher than 60 Hz, which can greatly improve the accuracy and drawing effect of the image drawn by the electronic device.
请参考图9,其示出了本发明另一实施例提供的绘图方法的方法流程图。该绘图方法可以用于如图1所示的绘图系统中。以计算中间点的坐标以及绘制力度的步骤由绘图笔执行为例,该绘图方法可以包括:Please refer to FIG. 9, which is a flowchart of a method for drawing a method according to another embodiment of the present invention. This drawing method can be used in the drawing system as shown in FIG. The step of calculating the coordinates of the intermediate point and drawing the velocity is performed by a pen, and the drawing method may include:
步骤901,绘图笔按照预设采样频率获取该绘图笔中的至少三个压力传感器采集到的压力数据。Step 901: The drawing pen acquires pressure data collected by at least three pressure sensors in the drawing pen according to a preset sampling frequency.
步骤902,绘图笔控制收发器先后接收该电子设备实时获取并发送的第一坐标和第二坐标。Step 902: The pen control transceiver receives the first coordinate and the second coordinate acquired and transmitted by the electronic device in real time.
其中,该第一坐标和该第二坐标为该笔头在该电子设备的绘图区域先后经过的两点的坐标。The first coordinate and the second coordinate are coordinates of two points that the pen tip passes through in the drawing area of the electronic device.
步骤903,绘图笔根据该第一坐标、该第二坐标以及在接收到该第一坐标和该第二坐标的时间段之内依次获取的N组压力数据中的前N-1组压力数据计算该笔头在该第一坐标和该第二坐标之间依次经过的N-1个中间点的坐标,N≥2。Step 903: The pen is calculated according to the first coordinate, the second coordinate, and the first N-1 group pressure data in the N sets of pressure data sequentially acquired within the time period in which the first coordinate and the second coordinate are received. The coordinates of the N-1 intermediate points that the pen head passes between the first coordinate and the second coordinate, N≥2.
具体的,该前N-1组压力数据中的每一组压力数据中包含该至少三个压力传感器采集到的最大的两个压力数值以及该两个压力数值各自的方向;绘图笔计算该第一坐标和该第二坐标之间的直线距离L以及从该第一坐标到该第二坐标之间的连线方向a;根据该前N-1组压力数据中的第i组压力数据包含的两个压力数值以及该第i组压力数据包含的两个压力数值各自的方向,计算在采集该第i组压力数据时,该笔头的移动方向b;计算该连线方向a和该移动方向b之间的夹角γ;根据该直线距离L和该夹角γ计算在采集第i组压力数据到采集第i+1组压力数据之间该笔头移动的距离Li,Li=L*cosγ/N;根据第i-1个中间点的坐标、该笔头的移动方向b以及该笔头移动的距离Li计算第i个中间点的坐标;Specifically, each of the pressure data of the first N-1 group pressure data includes the maximum two pressure values collected by the at least three pressure sensors and the respective directions of the two pressure values; a linear distance L between a coordinate and the second coordinate and a connection direction a from the first coordinate to the second coordinate; according to the i-th group pressure data in the front N-1 group pressure data Calculating the moving direction b of the pen head when collecting the i-th group pressure data by calculating the direction of the two pressure values and the two pressure values included in the i-th group pressure data; calculating the connecting direction a and the moving direction b The angle γ between the two; according to the straight line distance L and the angle γ, calculate the distance L i , L i = L * cos γ of the movement of the tip between the acquisition of the i-th group pressure data to the acquisition of the i+1th group of pressure data /N; calculating the coordinates of the i-th intermediate point according to the coordinates of the i-1th intermediate point, the moving direction b of the writing head, and the distance L i of the moving of the writing head;
其中,1≤i≤N-1;当i=1时,该第i-1个中间点的坐标为该第一坐标。Wherein, 1≤i≤N-1; when i=1, the coordinates of the i-1th intermediate point are the first coordinates.
步骤904,绘图笔控制该收发器向该电子设备发送该N-1个中间点的坐标。 Step 904, the pen controls the transceiver to transmit the coordinates of the N-1 intermediate points to the electronic device.
步骤905,电子设备绘制该第一坐标、该N-1个中间点的坐标以及该第二坐标各自对应的坐标点中,每组相邻的两个坐标点之间的连线图像。Step 905: The electronic device draws a line image of the first coordinate, the coordinates of the N-1 intermediate points, and the coordinate points corresponding to the second coordinates, and the adjacent two coordinate points of each group.
步骤906,绘图笔控制该收发器向该电子设备发送采集该前N-1组压力数据中的各组压力数据时分别对应的绘制力度。Step 906: The drawing pen controls the transceiver to send the corresponding drawing strength to the electronic device when collecting the pressure data of each group in the previous N-1 group pressure data.
具体的,绘图笔可以根据该第i组压力数据包含的两个压力数值计算在采集该第i组压力数据时的绘制力度。Specifically, the drawing pen can calculate the drawing strength when collecting the i-th group pressure data according to the two pressure values included in the i-th group pressure data.
步骤907,电子设备根据该绘图笔在采集该前N-1组压力数据中的各组压力数据时分别对应的绘制力度,分别设置该每组相邻的两个坐标点之间的连线图像的图像属性,图像属性包括连线颜色和连线粗细中的至少一种。Step 907: The electronic device respectively sets a connection image between the two adjacent coordinate points of each group according to the drawing strength corresponding to each group of pressure data in the first N-1 group pressure data. Image attribute, the image attribute includes at least one of a connection color and a connection thickness.
其中,绘图笔根据压力数据确定两个坐标之间的中间点的坐标的方法,以及绘图笔计算在采集每一组压力数据时的绘制力度的方法的具体步骤请参考图3所示的实施例中的描述,此处不再赘述。The method for determining the coordinates of the intermediate point between the two coordinates according to the pressure data, and the specific steps of the method for calculating the drawing strength of the drawing pen when collecting each set of pressure data, please refer to the embodiment shown in FIG. 3 . The description in the description will not be repeated here.
综上所述,本发明实施例提供的绘图方法,通过在绘图笔中的笔头四周设置至少三个压力传感器,获取压力传感器采集到的压力数据,并根据获取到的压力数据以及电子设备发送的两个坐标点,计算该两个坐标点之间的各个中间点,由电子设备根据这两个坐标点和各个中间点的坐标绘制图像,由于绘图笔获取压力数据的频率不受电子设备的屏幕刷新率限制,可以远高于60Hz,可以极大的提高电子设备绘制图像的精度和绘制效果。In summary, the drawing method provided by the embodiment of the present invention acquires pressure data collected by the pressure sensor by setting at least three pressure sensors around the pen head in the drawing pen, and according to the acquired pressure data and the electronic device. Two coordinate points are calculated, and each intermediate point between the two coordinate points is calculated, and the electronic device draws an image according to the coordinates of the two coordinate points and each intermediate point, because the frequency of the pressure data acquired by the drawing pen is not affected by the screen of the electronic device The refresh rate limit can be much higher than 60 Hz, which can greatly improve the accuracy and drawing effect of the image drawn by the electronic device.
此外,本发明实施例提供的绘图方法,绘图笔还根据压力数据中的压力数值计算在采集每一组压力数据时的绘制力度,并将采集每一组压力数据时的绘制力度发送给电子设备,由电子设备根据该绘制力度确定线条的粗细和颜色,进一步提高了图像的绘制效果。In addition, in the drawing method provided by the embodiment of the present invention, the drawing pen further calculates the drawing strength when collecting each group of pressure data according to the pressure value in the pressure data, and sends the drawing strength when collecting each group of pressure data to the electronic device. The electronic device determines the thickness and color of the line according to the drawing strength, thereby further improving the drawing effect of the image.
请参考图10,其示出了本发明又一实施例提供的绘图方法的方法流程图。该绘图方法可以用于如图1所示的绘图系统中。以计算中间点的坐标以及绘制力度的步骤由电子设备执行为例,该绘图方法可以包括:Please refer to FIG. 10, which is a flowchart of a method for drawing a method according to another embodiment of the present invention. This drawing method can be used in the drawing system as shown in FIG. The step of calculating the coordinates of the intermediate point and drawing the velocity is performed by an electronic device, and the drawing method may include:
步骤1001,绘图笔按照预设采样频率获取该绘图笔中的至少三个压力传感器采集到的压力数据。In step 1001, the drawing pen acquires pressure data collected by at least three pressure sensors in the drawing pen according to a preset sampling frequency.
步骤1002,绘图笔控制收发器向该电子设备发送该压力数据。In step 1002, the pen control transceiver transmits the pressure data to the electronic device.
步骤1003,电子设备获取第一坐标和第二坐标。Step 1003: The electronic device acquires the first coordinate and the second coordinate.
其中,该第一坐标和该第二坐标为该绘图笔的笔头在该电子设备的绘图区 域中先后经过的两点的坐标。Wherein the first coordinate and the second coordinate are the writing head of the drawing pen in a drawing area of the electronic device The coordinates of the two points passing through the domain.
步骤1004,电子设备根据该第一坐标、该第二坐标以及在获取到该第一坐标和该第二坐标的时间段之内,该绘图笔依次获取到的N组压力数据中的前N-1组压力数据,计算该笔头在该第一坐标和该第二坐标之间依次经过的N-1个中间点的坐标,N≥2。Step 1004: The electronic device sequentially obtains the first N- of the N sets of pressure data according to the first coordinate, the second coordinate, and the time period during which the first coordinate and the second coordinate are acquired. A set of pressure data is used to calculate the coordinates of the N-1 intermediate points that the pen head passes between the first coordinate and the second coordinate, N≥2.
具体的,该前N-1组压力数据中的每一组压力数据中包含该至少三个压力传感器采集到的最大的两个压力数值以及该两个压力数值各自的方向。电子设备计算该第一坐标和该第二坐标之间的直线距离L以及从该第一坐标到该第二坐标之间的连线方向a;根据该前N-1组压力数据中的第i组压力数据包含的两个压力数值以及该第i组压力数据包含的两个压力数值各自的方向,计算在采集该第i组压力数据时,该笔头的移动方向b;计算该连线方向a和该移动方向b之间的夹角γ;根据该直线距离L和该夹角γ计算在采集第i组压力数据到采集第i+1组压力数据之间该笔头移动的距离Li,Li=L*cosγ/N;根据第i-1个中间点的坐标、该笔头的移动方向b以及该笔头移动的距离Li计算第i个中间点的坐标;Specifically, each of the pressure data of the first N-1 group pressure data includes the maximum two pressure values collected by the at least three pressure sensors and the respective directions of the two pressure values. The electronic device calculates a linear distance L between the first coordinate and the second coordinate and a connection direction a from the first coordinate to the second coordinate; according to the i-th in the front N-1 group pressure data The two pressure values included in the group pressure data and the respective directions of the two pressure values included in the pressure data of the i-th group are calculated, and the moving direction b of the writing head is calculated when the pressure data of the i-th group is collected; calculating the connecting direction a And an angle γ between the movement direction b; calculating a distance L i , L of the movement of the tip between the collection of the i-th group pressure data to the acquisition of the (i+1)th group of pressure data according to the linear distance L and the angle γ i = L * cos γ / N; calculating the coordinates of the i-th intermediate point according to the coordinates of the i-1th intermediate point, the moving direction b of the writing head, and the distance L i of the moving of the writing head;
其中,1≤i≤N-1;当i=1时,该第i-1个中间点的坐标为该第一坐标。Wherein, 1≤i≤N-1; when i=1, the coordinates of the i-1th intermediate point are the first coordinates.
其中,电子设备根据压力数据确定两个坐标之间的中间点的坐标的方法,与图3所示的实施例中绘图笔确定中间点的坐标的方法类似,具体请参考图4所对应的部分描述,此处不再赘述。The method for determining the coordinates of the intermediate point between the two coordinates according to the pressure data is similar to the method for determining the coordinates of the intermediate point by the drawing pen in the embodiment shown in FIG. 3. For details, please refer to the corresponding part of FIG. Description, no longer repeat here.
步骤1005,电子设备绘制该第一坐标、该N-1个中间点的坐标以及该第二坐标各自对应的坐标点中,每组相邻的两个坐标点之间的连线图像。Step 1005: The electronic device draws the first coordinate, the coordinates of the N-1 intermediate points, and the connection image between the two adjacent coordinate points in the coordinate points corresponding to the second coordinate.
步骤1006,电子设备根据该前N-1组压力数据,计算绘图笔在采集该前N-1组压力数据中的各组压力数据时分别对应的绘制力度。Step 1006: The electronic device calculates, according to the pre-N-1 group pressure data, corresponding drawing strengths when the pens collect the pressure data of each group in the pre-N-1 group pressure data.
具体的,电子设备可以根据该第i组压力数据包含的两个压力数值计算该绘图笔在采集该第i组压力数据时的绘制力度。Specifically, the electronic device may calculate the drawing strength of the pen when collecting the i-th group pressure data according to the two pressure values included in the i-th group pressure data.
其中,电子设备根据压力数据中包含的压力数值计算绘图笔在采集每一组压力数据时的绘制力度的方法与图3对应实施例中绘图笔计算该绘制力度的方法类似,此处不再赘述。The method for calculating the drawing strength of the drawing pen when collecting each group of pressure data according to the pressure value included in the pressure data is similar to the method for calculating the drawing strength by the drawing pen in the corresponding embodiment of FIG. 3, and details are not described herein. .
步骤1007,电子设备根据该绘图笔在采集该前N-1组压力数据中的各组压力数据时分别对应的绘制力度,分别设置该每组相邻的两个坐标点之间的连线图像的图像属性,图像属性包括连线颜色和连线粗细中的至少一种。 Step 1007: The electronic device separately sets a connection image between the two adjacent coordinate points of each group according to the drawing strength corresponding to each group of pressure data in the first N-1 group pressure data. Image attribute, the image attribute includes at least one of a connection color and a connection thickness.
综上所述,本发明实施例提供的绘图方法,通过在绘图笔中的笔头四周设置至少三个压力传感器,电子设备接收绘图笔根据该四个压力传感器采集到的压力数据发送的绘图数据进行图像绘制,由于绘图笔获取压力数据的频率不受电子设备的屏幕刷新率限制,可以远高于60Hz,可以极大的提高电子设备绘制图像的精度和绘制效果。In summary, the drawing method provided by the embodiment of the present invention provides at least three pressure sensors around the writing head in the drawing pen, and the electronic device receives the drawing data sent by the drawing pen according to the pressure data collected by the four pressure sensors. Image drawing, because the frequency of the pressure data obtained by the pen is not limited by the screen refresh rate of the electronic device, it can be much higher than 60 Hz, which can greatly improve the accuracy and drawing effect of the image drawn by the electronic device.
此外,本发明实施例提供的绘图方法,还根据压力数据中的压力数值计算在采集每一组压力数据时的绘制力度,或者获取绘图笔计算出的绘制力度,根据该绘制力度确定线条的粗细和颜色,进一步提高了图像的绘制效果。In addition, the drawing method provided by the embodiment of the present invention further calculates the drawing strength when collecting each set of pressure data according to the pressure value in the pressure data, or obtains the drawing strength calculated by the drawing pen, and determines the thickness of the line according to the drawing strength. And color, further improving the image rendering effect.
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。A person skilled in the art may understand that all or part of the steps of implementing the above embodiments may be completed by hardware, or may be instructed by a program to execute related hardware, and the program may be stored in a computer readable storage medium. The storage medium mentioned may be a read only memory, a magnetic disk or an optical disk or the like.
以上所述仅为本发明的较佳实施例,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。 The above are only the preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalents, improvements, etc., which are within the spirit and scope of the present invention, should be included in the protection of the present invention. Within the scope.

Claims (24)

  1. 一种绘图笔,其特征在于,所述绘图笔包括:笔头、外壳、至少三个压力传感器、处理器以及收发器;A drawing pen, comprising: a pen head, a casing, at least three pressure sensors, a processor, and a transceiver;
    所述笔头半埋于所述外壳中,所述至少三个压力传感器固定于所述外壳内部,且其中任意相邻的两个压力传感器到所述笔头的中心线的垂直线之间的夹角小于180°;The pen tip is semi-buried in the outer casing, the at least three pressure sensors are fixed inside the outer casing, and an angle between any two adjacent pressure sensors to a vertical line of a center line of the pen tip Less than 180°;
    所述处理器分别与所述至少三个压力传感器和所述收发器电性相连;The processor is electrically connected to the at least three pressure sensors and the transceiver, respectively;
    所述处理器,用于按照预设采样频率获取所述至少三个压力传感器采集到的压力数据;The processor is configured to acquire pressure data collected by the at least three pressure sensors according to a preset sampling frequency;
    所述处理器,还用于根据获取到的所述压力数据,控制所述收发器向电子设备发送绘图数据,以便所述电子设备根据所述绘图数据绘制图像。The processor is further configured to control, according to the acquired pressure data, the transceiver to send drawing data to the electronic device, so that the electronic device draws an image according to the drawing data.
  2. 根据权利要求1所述的绘图笔,其特征在于,所述外壳上设置有握持标识,所述握持标识用于指示握持所述绘画笔的手握形态。The drawing pen according to claim 1, wherein the outer casing is provided with a gripping indicator for indicating a gripping style of holding the painting pen.
  3. 根据权利要求1所述的绘图笔,其特征在于,所述预设采样频率大于60Hz。The drawing pen of claim 1 wherein said predetermined sampling frequency is greater than 60 Hz.
  4. 根据权利要求1至3任一所述的绘图笔,其特征在于,所述绘图数据为所述压力数据。A drawing pen according to any one of claims 1 to 3, wherein said drawing data is said pressure data.
  5. 根据权利要求1至3任一所述的绘图笔,其特征在于,所述绘图数据为N-1个中间点的坐标,N≥2;The drawing pen according to any one of claims 1 to 3, wherein the drawing data is a coordinate of N-1 intermediate points, N≥2;
    所述处理器,还用于根据所述压力数据,通过以下方式获取所述N-1个中间点的坐标:The processor is further configured to acquire coordinates of the N-1 intermediate points according to the pressure data by:
    所述处理器控制所述收发器接收所述电子设备实时获取并发送的第一坐标和第二坐标,所述第一坐标和所述第二坐标为所述笔头在所述电子设备的绘图区域先后经过的两点的坐标;The processor controls the transceiver to receive first and second coordinates acquired and transmitted by the electronic device in real time, where the first coordinate and the second coordinate are the drawing area of the pen tip in the electronic device The coordinates of the two points passed successively;
    所述处理器根据所述第一坐标、所述第二坐标以及在接收到所述第一坐标和所述第二坐标的时间段之内依次获取的N组压力数据中的前N-1组压力数据,计算所述笔头在所述第一坐标和所述第二坐标之间依次经过的所述N-1个中间点的坐标。The processor according to the first coordinate, the second coordinate, and the first N-1 group of N sets of pressure data sequentially acquired within a time period in which the first coordinate and the second coordinate are received The pressure data calculates coordinates of the N-1 intermediate points that the pen tip sequentially passes between the first coordinate and the second coordinate.
  6. 根据权利要求5所述的绘图笔,其特征在于,所述前N-1组压力数据中的每一组压力数据中包含所述至少三个压力传感器采集到的最大的两个压力数值以及所述两个压力数值各自的方向; The drawing pen according to claim 5, wherein each of the first N-1 sets of pressure data includes a maximum of two pressure values collected by the at least three pressure sensors and Describe the respective directions of the two pressure values;
    所述处理器,具体用于通过以下方式计算所述笔头在所述第一坐标和所述第二坐标之间依次经过的所述N-1个中间点的坐标:The processor is specifically configured to calculate coordinates of the N-1 intermediate points that the pen tip sequentially passes between the first coordinate and the second coordinate by:
    所述处理器计算所述第一坐标和所述第二坐标之间的直线距离L以及从所述第一坐标到所述第二坐标之间的连线方向a;The processor calculates a linear distance L between the first coordinate and the second coordinate and a connection direction a from the first coordinate to the second coordinate;
    根据所述前N-1组压力数据中的第i组压力数据包含的两个压力数值以及所述第i组压力数据包含的两个压力数值各自的方向,计算在采集所述第i组压力数据时,所述笔头的移动方向b;Calculating the ith group pressure according to the two pressure values included in the i-th group pressure data of the pre-N-1 group pressure data and the respective pressure values of the two pressure values included in the ith group pressure data Data, the direction of movement of the pen head b;
    计算所述连线方向a和所述移动方向b之间的夹角γ;Calculating an angle γ between the connecting direction a and the moving direction b;
    根据所述直线距离L和所述夹角γ计算在采集第i组压力数据到采集第i+1组压力数据之间所述笔头移动的距离Li,Li=L*cosγ/N;Calculating, according to the linear distance L and the angle γ, a distance L i , L i = L* cos γ / N of the movement of the tip between collecting the i-th group pressure data to collecting the (i+1)-th pressure data;
    根据第i-1个中间点的坐标、所述笔头的移动方向b以及所述笔头移动的距离Li计算第i个中间点的坐标;Calculating coordinates of the i-th intermediate point according to coordinates of the i-1th intermediate point, the moving direction b of the writing head, and the distance L i of the moving of the writing head;
    其中,1≤i≤N-1;当i=1时,所述第i-1个中间点的坐标为所述第一坐标。Wherein, 1≤i≤N-1; when i=1, the coordinates of the i-1th intermediate point are the first coordinates.
  7. 根据权利要求6所述的绘图笔,其特征在于,A drawing pen according to claim 6, wherein
    所述处理器,还用于根据所述第i组压力数据包含的两个压力数值计算在采集所述第i组压力数据时的绘制力度;The processor is further configured to calculate a drawing strength when collecting the i-th group pressure data according to the two pressure values included in the i-th group pressure data;
    所述处理器,还用于控制所述收发器向所述电子设备发送采集所述前N-1组压力数据时分别对应的绘制力度。The processor is further configured to control, by the transceiver, the drawing strength corresponding to the first N-1 group pressure data when the transceiver is collected to the electronic device.
  8. 一种电子设备,其特征在于,所述电子设备包括:处理器、存储器和收发器;其中,所述存储器用于存储若干个指令,所述若干个指令被配置成由所述处理器执行;An electronic device, comprising: a processor, a memory, and a transceiver; wherein the memory is for storing a plurality of instructions, the instructions being configured to be executed by the processor;
    所述处理器,用于控制所述收发器接收绘图笔发送的绘图数据;The processor is configured to control the transceiver to receive drawing data sent by a drawing pen;
    所述处理器,用于根据所述绘图数据绘制图像。The processor is configured to draw an image according to the drawing data.
  9. 根据权利要求8所述的电子设备,其特征在于,所述绘图数据为所述绘图笔中的至少三个压力传感器采集到的压力数据;所述处理器在根据所述绘图数据绘制图像时,具体用于:The electronic device according to claim 8, wherein the drawing data is pressure data collected by at least three pressure sensors of the drawing pen; when the processor draws an image according to the drawing data, Specifically used for:
    获取第一坐标和第二坐标,所述第一坐标和所述第二坐标为所述绘图笔的笔头在所述电子设备的绘图区域中先后经过的两点的坐标;根据所述第一坐标、所述第二坐标以及在获取到所述第一坐标和所述第二坐标的时间段之内所述绘图笔依次获取到的N组压力数据中的前N-1组压力数据,计算所述笔头在所述第一坐标和所述第二坐标之间依次经过的N-1个中间点的坐标,N≥2; Obtaining a first coordinate and a second coordinate, where the first coordinate and the second coordinate are coordinates of two points that the pen tip of the drawing pen passes in the drawing area of the electronic device; according to the first coordinate And the second coordinate and the first N-1 group pressure data in the N sets of pressure data sequentially acquired by the drawing pen within a time period in which the first coordinate and the second coordinate are acquired, and the calculation unit Describe the coordinates of the N-1 intermediate points that the pen head passes between the first coordinate and the second coordinate, N≥2;
    绘制所述第一坐标、所述N-1个中间点的坐标以及所述第二坐标各自对应的坐标点中每组相邻的两个坐标点之间的连线图像。And drawing a line image between the first coordinate, the coordinates of the N-1 intermediate points, and two adjacent coordinate points of each of the coordinate points corresponding to the second coordinates.
  10. 根据权利要求9所述的电子设备,其特征在于,所述前N-1组压力数据中的每一组压力数据中包含所述至少三个压力传感器采集到的最大的两个压力数值以及所述两个压力数值各自的方向;The electronic device according to claim 9, wherein each of the first N-1 sets of pressure data includes a maximum of two pressure values collected by the at least three pressure sensors and Describe the respective directions of the two pressure values;
    所述处理器在计算所述笔头在所述第一坐标和所述第二坐标之间依次经过的N-1个中间点的坐标时,具体用于:The processor is specifically configured to: when calculating coordinates of the N-1 intermediate points that the pen tip passes between the first coordinate and the second coordinate;
    计算所述第一坐标和所述第二坐标之间的直线距离L以及从所述第一坐标到所述第二坐标之间的连线方向a;Calculating a linear distance L between the first coordinate and the second coordinate and a connection direction a from the first coordinate to the second coordinate;
    根据所述前N-1组压力数据中的第i组压力数据包含的两个压力数值以及所述第i组压力数据包含的两个压力数值各自的方向,计算在采集所述第i组压力数据时,所述笔头的移动方向b;Calculating the ith group pressure according to the two pressure values included in the i-th group pressure data of the pre-N-1 group pressure data and the respective pressure values of the two pressure values included in the ith group pressure data Data, the direction of movement of the pen head b;
    计算所述连线方向a和所述移动方向b之间的夹角γ;Calculating an angle γ between the connecting direction a and the moving direction b;
    根据所述直线距离L和所述夹角γ计算在采集第i组压力数据到采集第i+1组压力数据之间所述笔头移动的距离Li,Li=L*cosγ/N;Calculating, according to the linear distance L and the angle γ, a distance L i , L i = L* cos γ / N of the movement of the tip between collecting the i-th group pressure data to collecting the (i+1)-th pressure data;
    根据第i-1个中间点的坐标、所述笔头的移动方向b以及所述笔头移动的距离Li计算第i个中间点的坐标;Calculating coordinates of the i-th intermediate point according to coordinates of the i-1th intermediate point, the moving direction b of the writing head, and the distance L i of the moving of the writing head;
    其中,1≤i≤N-1;当i=1时,所述第i-1个中间点的坐标为所述第一坐标。Wherein, 1≤i≤N-1; when i=1, the coordinates of the i-1th intermediate point are the first coordinates.
  11. 根据权利要求10所述的电子设备,其特征在于,The electronic device according to claim 10, characterized in that
    所述处理器,还用于根据所述第i组压力数据包含的两个压力数值计算所述绘图笔在采集所述第i组压力数据时的绘制力度;The processor is further configured to calculate, according to the two pressure values included in the i-th group pressure data, a drawing strength of the drawing pen when collecting the i-th group pressure data;
    所述处理器,还用于根据所述绘图笔在采集所述前N-1组压力数据中的各组压力数据时分别对应的绘制力度,分别设置所述每组相邻的两个坐标点之间的连线图像的图像属性,所述图像属性包括连线颜色和连线粗细中的至少一种。The processor is further configured to separately set two adjacent coordinate points of each group according to respective drawing strengths when the drawing pen collects each group of pressure data in the first N-1 group pressure data An image attribute of the connected image, the image attribute including at least one of a connection color and a connection thickness.
  12. 根据权利要求8所述的电子设备,其特征在于,所述绘图数据为第一坐标和第二坐标之间的N-1个中间点的坐标;所述第一坐标和所述第二坐标为所述笔头在所述电子设备的绘图区域先后经过的两点的坐标;The electronic device according to claim 8, wherein the drawing data is coordinates of N-1 intermediate points between the first coordinate and the second coordinate; the first coordinate and the second coordinate are a coordinate of two points that the pen tip passes in the drawing area of the electronic device;
    所述处理器,用于根据绘图数据,通过以下方式绘制图像:The processor is configured to draw an image according to the drawing data by:
    所述处理器绘制所述第一坐标、所述N-1个中间点的坐标以及所述第二坐标各自对应的坐标点中每组相邻的两个坐标点之间的连线图像。The processor draws a line image between the first coordinate, the coordinates of the N-1 intermediate points, and the adjacent two coordinate points of each of the coordinate points corresponding to the second coordinate.
  13. 根据权利要求12所述的电子设备,其特征在于, The electronic device according to claim 12, wherein
    所述处理器,还用于控制所述收发器接收所述绘图笔发送的,所述绘图笔在采集所述前N-1组压力数据中的各组压力数据时分别对应的绘制力度;The processor is further configured to control, by the transceiver, a drawing strength corresponding to each group of pressure data sent by the drawing pen when collecting the pressure data of the first N-1 group of pressure data;
    所述处理器,还用于根据所述绘图笔在采集所述前N-1组压力数据中的各组压力数据时分别对应的绘制力度,分别设置所述每组相邻的两个坐标点之间的连线图像的图像属性,所述图像属性包括连线颜色和连线粗细中的至少一种。The processor is further configured to separately set two adjacent coordinate points of each group according to respective drawing strengths when the drawing pen collects each group of pressure data in the first N-1 group pressure data An image attribute of the connected image, the image attribute including at least one of a connection color and a connection thickness.
  14. 一种绘图方法,其特征在于,用于绘图笔中,所述方法包括:A drawing method, which is used in a drawing pen, the method comprising:
    按照预设采样频率获取所述绘图笔中的至少三个压力传感器采集到的压力数据;Obtaining pressure data collected by at least three pressure sensors in the drawing pen according to a preset sampling frequency;
    根据获取到的所述压力数据,控制所述绘图笔中的收发器向电子设备发送绘图数据,以便所述电子设备根据所述绘图数据绘制图像。And controlling, according to the acquired pressure data, the transceiver in the drawing pen to send drawing data to the electronic device, so that the electronic device draws an image according to the drawing data.
  15. 根据权利要求14所述的方法,其特征在于,所述绘图数据为所述压力数据。The method of claim 14 wherein said mapping data is said pressure data.
  16. 根据权利要求14所述的方法,其特征在于,所述绘图数据为N-1个中间点的坐标,N≥2;所述根据获取到的所述压力数据,控制所述绘图笔中的收发器向电子设备发送绘图数据,包括:The method according to claim 14, wherein the drawing data is a coordinate of N-1 intermediate points, N≥2; and the transmitting and receiving in the drawing pen is controlled according to the acquired pressure data. The device sends the drawing data to the electronic device, including:
    控制所述收发器先后接收所述电子设备实时获取并发送的第一坐标和第二坐标,所述第一坐标和所述第二坐标为所述笔头在所述电子设备的绘图区域先后经过的两点的坐标;Controlling, by the transceiver, a first coordinate and a second coordinate that are acquired and sent by the electronic device in real time, where the first coordinate and the second coordinate are successively passed by the pen tip in a drawing area of the electronic device The coordinates of two points;
    根据所述第一坐标、所述第二坐标以及在接收到所述第一坐标和所述第二坐标的时间段之内依次获取的N组压力数据中的前N-1组压力数据,计算所述笔头在所述第一坐标和所述第二坐标之间依次经过的所述N-1个中间点的坐标;Calculating based on the first coordinate, the second coordinate, and the first N-1 group pressure data in the N sets of pressure data sequentially acquired within a time period in which the first coordinate and the second coordinate are received a coordinate of the N-1 intermediate points sequentially passed between the first coordinate and the second coordinate;
    控制所述收发器向所述电子设备发送所述N-1个中间点的坐标。Controlling the transceiver to transmit coordinates of the N-1 intermediate points to the electronic device.
  17. 根据权利要求16所述的方法,其特征在于,所述前N-1组压力数据中的每一组压力数据中包含所述至少三个压力传感器采集到的最大的两个压力数值以及所述两个压力数值各自的方向;所述计算所述笔头在所述第一坐标和所述第二坐标之间依次经过的所述N-1个中间点的坐标,具体包括:The method according to claim 16, wherein each of said first N-1 sets of pressure data includes a maximum of two pressure values collected by said at least three pressure sensors and said The respective directions of the two pressure values; the calculating the coordinates of the N-1 intermediate points that the pen head sequentially passes between the first coordinate and the second coordinate, specifically including:
    计算所述第一坐标和所述第二坐标之间的直线距离L以及从所述第一坐标到所述第二坐标之间的连线方向a;Calculating a linear distance L between the first coordinate and the second coordinate and a connection direction a from the first coordinate to the second coordinate;
    根据所述前N-1组压力数据中的第i组压力数据包含的两个压力数值以及所述第i组压力数据包含的两个压力数值各自的方向,计算在采集所述第i组压力数据时,所述笔头的移动方向b; Calculating the ith group pressure according to the two pressure values included in the i-th group pressure data of the pre-N-1 group pressure data and the respective pressure values of the two pressure values included in the ith group pressure data Data, the direction of movement of the pen head b;
    计算所述连线方向a和所述移动方向b之间的夹角γ;Calculating an angle γ between the connecting direction a and the moving direction b;
    根据所述直线距离L和所述夹角γ计算在采集第i组压力数据到采集第i+1组压力数据之间所述笔头移动的距离Li,Li=L*cosγ/N;Calculating, according to the linear distance L and the angle γ, a distance L i , L i = L* cos γ / N of the movement of the tip between collecting the i-th group pressure data to collecting the (i+1)-th pressure data;
    根据第i-1个中间点的坐标、所述笔头的移动方向b以及所述笔头移动的距离Li计算第i个中间点的坐标;Calculating coordinates of the i-th intermediate point according to coordinates of the i-1th intermediate point, the moving direction b of the writing head, and the distance L i of the moving of the writing head;
    其中,1≤i≤N-1;当i=1时,所述第i-1个中间点的坐标为所述第一坐标。Wherein, 1≤i≤N-1; when i=1, the coordinates of the i-1th intermediate point are the first coordinates.
  18. 根据权利要求17所述的方法,其特征在于,所述方法还包括:The method of claim 17, wherein the method further comprises:
    根据所述第i组压力数据包含的两个压力数值计算在采集所述第i组压力数据时的绘制力度;Calculating a drawing strength when collecting the i-th group pressure data according to the two pressure values included in the i-th group pressure data;
    控制所述收发器向所述电子设备发送采集所述前N-1组压力数据中的各组压力数据时分别对应的绘制力度。And controlling, by the transceiver, the drawing strength corresponding to each group of pressure data in the first N-1 group pressure data to be sent to the electronic device.
  19. 一种绘图方法,其特征在于,用于电子设备中,所述方法包括:A drawing method, characterized in that, in an electronic device, the method comprises:
    接收绘图笔发送的绘图数据;Receiving drawing data sent by the drawing pen;
    根据所述绘图数据绘制图像。An image is drawn based on the drawing data.
  20. 根据权利要求19所述的方法,其特征在于,所述绘图数据为所述绘图笔中的至少三个压力传感器采集到的压力数据;The method according to claim 19, wherein said drawing data is pressure data collected by at least three pressure sensors in said drawing pen;
    所述根据所述绘图数据绘制图像,具体包括:The drawing an image according to the drawing data specifically includes:
    获取第一坐标和第二坐标,所述第一坐标和所述第二坐标为所述绘图笔的笔头在所述电子设备的绘图区域中先后经过的两点的坐标;Obtaining a first coordinate and a second coordinate, where the first coordinate and the second coordinate are coordinates of two points that the pen tip of the drawing pen passes successively in the drawing area of the electronic device;
    根据所述第一坐标、所述第二坐标以及在获取到所述第一坐标和所述第二坐标的时间段之内,所述绘图笔依次获取到的N组压力数据中的前N-1组压力数据,计算所述笔头在所述第一坐标和所述第二坐标之间依次经过的N-1个中间点的坐标,N≥2;Determining the first N- of the N sets of pressure data sequentially acquired by the drawing pen according to the first coordinate, the second coordinate, and the time period during which the first coordinate and the second coordinate are acquired a set of pressure data, calculating the coordinates of the N-1 intermediate points that the pen tip passes between the first coordinate and the second coordinate, N≥2;
    绘制所述第一坐标、所述N-1个中间点的坐标以及所述第二坐标各自对应的坐标点中,每组相邻的两个坐标点之间的连线图像。And drawing a line image of the first coordinate, the coordinates of the N-1 intermediate points, and the coordinate points corresponding to the second coordinates, and the adjacent two coordinate points of each group.
  21. 根据权利要求20所述的方法,其特征在于,所述前N-1组压力数据中的每一组压力数据中包含所述至少三个压力传感器采集到的最大的两个压力数值以及所述两个压力数值各自的方向;所述计算所述笔头在所述第一坐标和所述第二坐标之间依次经过的N-1个中间点的坐标,具体包括:The method according to claim 20, wherein each of said first N-1 sets of pressure data includes a maximum of two pressure values collected by said at least three pressure sensors and said The respective directions of the two pressure values; the calculating the coordinates of the N-1 intermediate points that the pen tip passes in sequence between the first coordinate and the second coordinate, specifically including:
    计算所述第一坐标和所述第二坐标之间的直线距离L以及从所述第一坐标到所述第二坐标之间的连线方向a; Calculating a linear distance L between the first coordinate and the second coordinate and a connection direction a from the first coordinate to the second coordinate;
    根据所述前N-1组压力数据中的第i组压力数据包含的两个压力数值以及所述第i组压力数据包含的两个压力数值各自的方向,计算在采集所述第i组压力数据时,所述笔头的移动方向b;Calculating the ith group pressure according to the two pressure values included in the i-th group pressure data of the pre-N-1 group pressure data and the respective pressure values of the two pressure values included in the ith group pressure data Data, the direction of movement of the pen head b;
    计算所述连线方向a和所述移动方向b之间的夹角γ;Calculating an angle γ between the connecting direction a and the moving direction b;
    根据所述直线距离L和所述夹角γ计算在采集第i组压力数据到采集第i+1组压力数据之间所述笔头移动的距离Li,Li=L*cosγ/N;Calculating, according to the linear distance L and the angle γ, a distance L i , L i = L* cos γ / N of the movement of the tip between collecting the i-th group pressure data to collecting the (i+1)-th pressure data;
    根据第i-1个中间点的坐标、所述笔头的移动方向b以及所述笔头移动的距离Li计算第i个中间点的坐标;Calculating coordinates of the i-th intermediate point according to coordinates of the i-1th intermediate point, the moving direction b of the writing head, and the distance L i of the moving of the writing head;
    其中,1≤i≤N-1;当i=1时,所述第i-1个中间点的坐标为所述第一坐标。Wherein, 1≤i≤N-1; when i=1, the coordinates of the i-1th intermediate point are the first coordinates.
  22. 根据权利要求21所述的方法,其特征在于,所述方法还包括:The method of claim 21, wherein the method further comprises:
    根据所述第i组压力数据包含的两个压力数值计算所述绘图笔在采集所述第i组压力数据时的绘制力度;Calculating a drawing strength of the drawing pen when collecting the i-th group pressure data according to two pressure values included in the i-th group pressure data;
    根据所述绘图笔在采集所述前N-1组压力数据中的各组压力数据时分别对应的绘制力度,分别设置所述每组相邻的两个坐标点之间的连线图像的图像属性,所述图像属性包括连线颜色和连线粗细中的至少一种。And respectively setting an image of the connection image between the two adjacent coordinate points of each group according to the drawing strength corresponding to each group of pressure data in the first N-1 group pressure data of the drawing pen An attribute, the image attribute including at least one of a connection color and a connection thickness.
  23. 根据权利要求19所述的方法,其特征在于,所述绘图数据为第一坐标和第二坐标之间的N-1个中间点的坐标;所述第一坐标和所述第二坐标为所述笔头在所述电子设备的绘图区域先后经过的两点的坐标;The method according to claim 19, wherein said drawing data is coordinates of N-1 intermediate points between the first coordinate and the second coordinate; said first coordinate and said second coordinate being Describe the coordinates of two points that the pen head passes in the drawing area of the electronic device;
    所述根据所述绘图数据绘制图像,包括:The drawing an image according to the drawing data comprises:
    绘制所述第一坐标、所述N-1个中间点的坐标以及所述第二坐标各自对应的坐标点中,每组相邻的两个坐标点之间的连线图像。And drawing a line image of the first coordinate, the coordinates of the N-1 intermediate points, and the coordinate points corresponding to the second coordinates, and the adjacent two coordinate points of each group.
  24. 根据权利要求23所述的方法,其特征在于,所述方法还包括:The method of claim 23, wherein the method further comprises:
    接收所述绘图笔发送的,所述绘图笔在采集所述前N-1组压力数据中的各组压力数据时分别对应的绘制力度;Receiving, by the drawing pen, the drawing strength corresponding to each group of pressure data in the first N-1 group pressure data sent by the drawing pen;
    根据所述绘图笔在采集所述前N-1组压力数据中的各组压力数据时分别对应的绘制力度,分别设置所述每组相邻的两个坐标点之间的连线图像的图像属性,所述图像属性包括连线颜色和连线粗细中的至少一种。 And respectively setting an image of the connection image between the two adjacent coordinate points of each group according to the drawing strength corresponding to each group of pressure data in the first N-1 group pressure data of the drawing pen An attribute, the image attribute including at least one of a connection color and a connection thickness.
PCT/CN2015/075133 2015-03-26 2015-03-26 Drawing pen, electronic device and drawing method WO2016149941A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2015/075133 WO2016149941A1 (en) 2015-03-26 2015-03-26 Drawing pen, electronic device and drawing method
CN201580010175.3A CN106471446B (en) 2015-03-26 2015-03-26 Drawing pen, electronic equipment and drawing practice

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/075133 WO2016149941A1 (en) 2015-03-26 2015-03-26 Drawing pen, electronic device and drawing method

Publications (1)

Publication Number Publication Date
WO2016149941A1 true WO2016149941A1 (en) 2016-09-29

Family

ID=56977732

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/075133 WO2016149941A1 (en) 2015-03-26 2015-03-26 Drawing pen, electronic device and drawing method

Country Status (2)

Country Link
CN (1) CN106471446B (en)
WO (1) WO2016149941A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108215585A (en) * 2018-02-13 2018-06-29 程瑞东 A kind of dynamics simulation writing device, method and intelligent writing pen
CN111612857A (en) * 2020-05-28 2020-09-01 北京学之途网络科技有限公司 Color obtaining method and device, electronic equipment and readable storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5475401A (en) * 1993-04-29 1995-12-12 International Business Machines, Inc. Architecture and method for communication of writing and erasing signals from a remote stylus to a digitizing display
GB2306669A (en) * 1995-11-01 1997-05-07 Ricoh Kk Manual entry interactive paper and electronic document handling and processing system
DE102005017936A1 (en) * 2005-04-18 2006-10-19 Fachhochschule Regensburg Fluidic peripheral input device for an electronic data processing device
JP2011164801A (en) * 2010-02-05 2011-08-25 Wacom Co Ltd Pointer, position detection apparatus and position detection method
CN102591486A (en) * 2011-01-14 2012-07-18 元太科技工业股份有限公司 Active electromagnetic pen
CN103729074A (en) * 2013-12-26 2014-04-16 三星电子(中国)研发中心 Device, system and method for recognizing handwritings
CN103809883A (en) * 2012-11-07 2014-05-21 联想(北京)有限公司 Input method, touch-control input pen and electronic device
US20140240298A1 (en) * 2013-02-25 2014-08-28 N-Trig Ltd. Stylus for a digitizer system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8797301B2 (en) * 2012-02-15 2014-08-05 Cypress Semiconductor Corporation Active stylus to host data transmitting method
US8913042B2 (en) * 2012-07-24 2014-12-16 Blackberry Limited Force sensing stylus

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5475401A (en) * 1993-04-29 1995-12-12 International Business Machines, Inc. Architecture and method for communication of writing and erasing signals from a remote stylus to a digitizing display
GB2306669A (en) * 1995-11-01 1997-05-07 Ricoh Kk Manual entry interactive paper and electronic document handling and processing system
DE102005017936A1 (en) * 2005-04-18 2006-10-19 Fachhochschule Regensburg Fluidic peripheral input device for an electronic data processing device
JP2011164801A (en) * 2010-02-05 2011-08-25 Wacom Co Ltd Pointer, position detection apparatus and position detection method
CN102591486A (en) * 2011-01-14 2012-07-18 元太科技工业股份有限公司 Active electromagnetic pen
CN103809883A (en) * 2012-11-07 2014-05-21 联想(北京)有限公司 Input method, touch-control input pen and electronic device
US20140240298A1 (en) * 2013-02-25 2014-08-28 N-Trig Ltd. Stylus for a digitizer system
CN103729074A (en) * 2013-12-26 2014-04-16 三星电子(中国)研发中心 Device, system and method for recognizing handwritings

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108215585A (en) * 2018-02-13 2018-06-29 程瑞东 A kind of dynamics simulation writing device, method and intelligent writing pen
CN108215585B (en) * 2018-02-13 2024-02-02 程瑞东 Dynamics simulation writing device and method and intelligent writing pen
CN111612857A (en) * 2020-05-28 2020-09-01 北京学之途网络科技有限公司 Color obtaining method and device, electronic equipment and readable storage medium
CN111612857B (en) * 2020-05-28 2024-03-26 北京明略昭辉科技有限公司 Color acquisition method and device, electronic equipment and readable storage medium

Also Published As

Publication number Publication date
CN106471446B (en) 2019-06-11
CN106471446A (en) 2017-03-01

Similar Documents

Publication Publication Date Title
CN103744541B (en) Lettering pen, electric terminal and writing system
JP6527307B2 (en) Motion recognition method using grasped object, device and system therefor
US11625841B2 (en) Localization and tracking method and platform, head-mounted display system, and computer-readable storage medium
US9122916B2 (en) Three dimensional fingertip tracking
US20190004622A1 (en) Systems, Methods, and Devices for Providing a Virtual Reality Whiteboard
CN101470548B (en) Method for measuring object dimension and angle through touch screen
KR102057531B1 (en) Mobile devices of transmitting and receiving data using gesture
TW201324235A (en) Gesture input method and system
CN102920451B (en) Method for measuring electrocardiogram in multi-point touch manner
CN104997514A (en) Rehabilitation assistance system
US20150339859A1 (en) Apparatus and method for navigating through volume image
US20150260750A1 (en) Electronic apparatus and program
US11853486B2 (en) Stylus and position calculation method
US20200387227A1 (en) Length Calibration for Computer Models of Users to Generate Inputs for Computer Systems
WO2016115881A1 (en) Handwriting recording device and handwriting recording method
CN106662923A (en) Information processing device, information processing method and program
WO2016149941A1 (en) Drawing pen, electronic device and drawing method
CN104598048A (en) Digital pen writing control method and system
CN111754571A (en) Gesture recognition method and device and storage medium thereof
CN103167079A (en) Mobile phone measuring system and method
Jo et al. Tracking and interaction based on hybrid sensing for virtual environments
CN104461009B (en) The measuring method and smart machine of object
US20130187890A1 (en) User interface apparatus and method for 3d space-touch using multiple imaging sensors
WO2015064991A2 (en) Smart device enabling non-contact operation control and non-contact operation control method using same
CN105468200A (en) Method and device for fingerprint touch control and fingerprint equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15885880

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15885880

Country of ref document: EP

Kind code of ref document: A1