This application is based on and claims priority under 35 USC 119 from Japanese Patent Application No. 2016-109383 filed May 31, 2016.
The present invention relates to a non-transitory computer readable medium and an information processing apparatus.
According to an aspect of the invention, there is provided a non-transitory computer readable medium storing a program causing a computer to execute a process. The process includes: generating a first path which represents positions on a medium specified by a digital pen; obtaining a second path which represents positions on the medium specified by the digital pen and which satisfies a predetermined condition; obtaining information for specifying an area on the medium, the area having a predetermined positional relationship with the second path; and erasing the first path in accordance with a positional relationship between the area and the first path.
An exemplary embodiment of the present invention will be described in detail based on the following figures, wherein:
The digital pen 20 is an input device used by a user to input information. In this example, the digital pen 20 has the following two functions. A first function is a function of attaching or fixing a pigment, a dye, or an ink containing thereof onto the medium 10. A second function is a function of outputting information indicating a path (strokes) generated by moving the digital pen 20 on the medium 10 while keeping the tip of the digital pen 20 in contact with the surface of the medium 10. Hereinafter, such a path may also be called “strokes” and the information indicating the path may also be called “stroke information”. To achieve the second function, the digital pen 20 reads coded images formed on the medium 10 and generates stroke information by using the read coded images.
The irradiating unit 22 applies light (for example, infrared) when reading a coded image from the medium 10. The light is applied to an imaging range R on the medium 10. The imaging device 25 captures an image represented by light applied from the irradiating unit 22 and reflected by the medium 10 at a predetermined frame rate (for example, 60 frames per second (fps)). An image obtained by the imaging device 25 is called a “captured image”.
The pressure sensor 23 detects the writing pressure, more specifically, the pressure acting on the refill 24. The refill 24 has a function of attaching or fixing a pigment, a dye, or an ink containing thereof onto the medium 10 and a function of transferring the pressure applied to the tip of the digital pen 20 to the pressure sensor 23. To achieve the first function, the refill 24 is configured to store an ink therein and discharge the ink in accordance with the movement of the tip of the digital pen 20. The refill 24 is configured as in the tip of a ballpoint pen, for example.
The controller 21 controls the elements of the digital pen 20. The controller 21 includes a signal processing circuit 211, a drive circuit 212, and a timer 213. The timer 213 generates time information indicating the current time and outputs the generated time information. The signal processing circuit 211 includes a processor for performing signal processing for the digital pen 20. For example, the signal processing circuit 211 analyzes a captured image. More specifically, the signal processing circuit 211 decodes information indicated by coded images included in a captured image so as to extract identification information and position information. The drive circuit 212 controls the driving of the irradiating unit 22. For example, the drive circuit 212 controls the timing at which the irradiating unit 22 applies light to the medium 10. More specifically, when the pressure sensor 23 is detecting the pressure acting on the refill 24, the drive circuit 212 causes the irradiating unit 22 to apply light to the medium 10.
The memory 26 stores identification information and position information extracted by the signal processing circuit 211 and time information output from the timer 213. The input-and-output unit 27 is an interface for sending and receiving data with other devices via a wired or wireless medium. In this example, the input-and-output unit 27 particularly sends identification information, position information, and time information to the information processing apparatus 30 as stroke information.
The battery 28 is, for example, a storage battery, and supplies power for driving the digital pen 20 to the individual elements. The memory 29 stores identification information concerning the digital pen 20.
In this example, when the writing pressure detected by the pressure sensor 23 exceeds a predetermined threshold, the controller 21 starts to read identification information and position information and to obtain time information from the timer 213. The controller 21 continues reading identification information and position information at predetermined regular time intervals until the pressure detected by the pressure sensor 23 is reduced to the predetermined threshold. When the detected pressure is reduced to the predetermined threshold (that is, when the tip of the digital pen 20 is separated from the medium 10), the controller 21 stores in the memory 26 plural pairs of identification information and position information and time information read and obtained during a period from when the controller 21 starts to read and obtain the information until when the controller 21 finishes reading and obtaining the information. The identification information, position information, and time information are stored as a set of stroke information. In this case, as the time information, the reading start time of each of the plural items of position information is obtained. In the memory 26, identification information and position information are stored in the units of strokes, and time information indicating the reading start time of each stroke is stored. “Stroke” refers to a path through which the tip of the digital pen 20 moves on the medium 10 during a period from when the tip starts to contact the medium 10 until when the tip is separated from the medium 10.
The CPU 31 is a processor executing various operations. The main storage device 32 includes a read only memory (ROM) and a random access memory (RAM). The auxiliary storage device 33 is a non-volatile storage device storing programs and data, and includes a hard disk drive (HDD) or a solid state drive (SSD), for example. The CPU 31 uses the RAM as a work area and executes a program stored in the ROM or the auxiliary storage device 33.
The communication unit 34 is an interface for communicating with other devices. In this example, the communication unit 34 particularly receives stroke information from the digital pen 20. The input device 35 is used by a user to input instructions or information into the CPU 31. The input device 35 includes at least one of a keyboard, a touchscreen, and a microphone. The display 36 is used for displaying information, and includes a liquid crystal display (LCD), for example.
” are written as the name of the operator in charge of the operations in the field F1 of the form. These characters are written by a path (an example of a first path) of the digital pen 20.
In the related art, writing data corresponding to a path overlapping the strikethrough is erased. In the example shown in ”, it does not cover the left-edge stroke of the character “
”. The character “
” is constituted by three strokes, and data concerning each stroke is individually stored. According to this strikethrough, the left-edge stroke of the character “
” is not erased and the data concerning this stroke remains.
” is erased by the strikethrough shown in
”. However, the strikethrough is incompletely drawn, and data concerning part of the path (stroke STR1p) is not erased and remains. In this manner, the strikethrough may become incomplete due to the reasons, such as the user moves the digital pen 20 too quickly, the initial writing pressure is too weak, and there is a considerable delay in starting to read position information upon detecting by the pressure sensor 23 that the writing pressure exceeds a threshold. The digital pen system 1 of this exemplary embodiment addresses such an issue.
The stroke obtaining unit 301 obtains stroke information in the writing mode from the digital pen 20. The generator 302 generates data (writing data) concerning image objects corresponding to the stroke information obtained by the stroke obtaining unit 301. The storage unit 303 stores the writing data generated by the generator 302. The strikethrough obtaining unit 304 (an example of a first obtaining unit) obtains stroke information in the erasing mode from the digital pen 20. The area information obtaining unit 305 (an example of a second obtaining unit) obtains information for specifying areas on the medium 10 (for example, fields F1 through F8 in
In this exemplary embodiment, a program for processing stroke information (hereinafter called a “digital pen program”) is stored in the auxiliary storage device 33 of the information processing apparatus 30. As a result of the CPU 31 executing this digital pen program, the functions shown in
In step S101, the stroke obtaining unit 301 obtains stroke information in the writing mode from the digital pen 20. Then, in step S102, the generator 302 generates writing data from the obtained stroke information. The writing data indicates a path of the digital pen 20 in the writing mode. In step S103, the storage unit 303 stores the generated writing data. The writing data is stored for each stroke, for example. Alternatively, two or more strokes may be grouped and stored as a set of writing data.
In step S104, the strikethrough obtaining unit 304 obtains stroke information in the erasing mode from the digital pen 20. In step S105, the generator 302 generates strikethrough data from the obtained stroke information. The strikethrough data indicates a path of the digital pen 20 in the erasing mode. In step S106, the storage unit 303 stores the generated strikethrough data. The strikethrough data is stored for each stroke, for example. Alternatively, two or more strokes may be grouped and stored as a set of strikethrough data.
In step S107, the area information obtaining unit 305 obtains area information concerning the areas on the medium 10. The area information is used for specifying areas (fields F1 through F8 in
In step S109, the determining unit 306 determines whether to erase the writing data. More specifically, the determining unit 306 refers to the information stored in the storage unit 303, and then specifies an area having a predetermined positional relationship (a predetermined condition) with the strikethrough as a subject area among the plural areas indicated by the area information. In this example, the predetermined condition is a condition that the subject area overlaps the strikethrough, that is, the strikethrough is at least partially contained in this area. In the example in
In step S110, the determining unit 306 specifies, as data to be erased, writing data concerning all strokes having a predetermined positional relationship (a predetermined condition) with the subject area specified in step S109 among the items of writing data stored in the storage unit 303. The predetermined condition is, for example, a condition that at least part of each of the strokes is contained in the subject area. In step S111, the determining unit 306 supplies information for identifying the writing data specified as the data to be erased to the erasing unit 307.
In step S112, the erasing unit 307 performs processing on the subject data specified as the data to be erased so that the subject data can be distinguished from the other items of data which will not be erased. More specifically, the erasing unit 307 performs processing for erasing the subject data from the storage unit 303, for example. Alternatively, the erasing unit 307 may store a flag indicating that the subject data will be erased in the storage unit 303.
In step S113, the output unit 308 outputs the writing data stored in the storage unit 303. For example, the output unit 308 displays an image in accordance with the writing data. In this image, strokes to be erased are not included. Alternatively, strokes to be erased are displayed in a different color, for example, so that they can be distinguished from strokes which will not be erased.
” are erased, as shown in
The order of steps of the processing is not restricted to that discussed above. For example, steps S107 and S108 may be executed prior to step S104 or S101.
A second operation example will now be described below. In the second operation example, at least one of areas in a form includes plural sub-areas (sub-fields). Sub-areas are defined by area information. The area including sub-areas may be called a “principal area” so that it can be distinguished from sub-areas. Concerning the principal area including sub-areas, a determination as to whether writing data will be erased is made for each sub-area.
In step S201, the determining unit 306 specifies one subject principal area from among one or more principal areas (hereinafter called “subject principal area candidates”) having a positional relationship with strikethrough that satisfies a predetermined condition. The subject principal area is sequentially specified from the subject principal area candidates in accordance with a predetermined order.
In step S202, the determining unit 306 determines whether sub-areas are defined in the subject principal area. This determination is made based on area information. If it is determined that sub-areas are defined (YES in step S202), the determining unit 306 proceeds to step S203. If it is determined that sub-areas are not defined (NO in step S202), the determining unit 306 proceeds to step S207.
In step S203, the determining unit 306 specifies one subject sub-area from among plural sub-areas contained in the subject principal area. The subject sub-area is sequentially specified according to a predetermined order.
In step S204, the determining unit 306 determines whether the positional relationship between the subject sub-area and the strikethrough satisfies a predetermined condition. In this example, the predetermined condition is a condition that the subject sub-area overlaps the strikethrough, that is, the strikethrough is at least partially contained in the subject sub-area. If it is determined that the positional relationship satisfies the predetermined condition (YES in step S204), the determining unit 306 proceeds to step S205. If it is determined that the positional relationship does not satisfy the predetermined condition (NO in step S204), the determining unit 306 proceeds to step S206.
In step S205, the determining unit 306 specifies, as data to be erased, items of writing data concerning all strokes included in the subject sub-area among the strokes indicated by the items of writing data stored in the storage unit 303. A stroke included in the subject sub-area is a stroke which is at least partially included in the subject sub-area.
In step S206, the determining unit 306 determines whether all sub-areas included in the subject principal area have been processed. If all the sub-areas have been processed (YES in step S206), the determining unit 306 proceeds to step S209. If a sub-area that has not been processed is found (NO in step S206), the determining unit 306 returns to step S203. In step S203, the subject sub-area is updated, and steps S204 through S206 are executed on the new subject sub-area.
In step S207, the determining unit 306 determines whether the positional relationship between the subject principal area and the strikethrough satisfies a predetermined condition. In this example, the predetermined condition is a condition that the subject principal area overlaps the strikethrough, that is, the strikethrough is at least partially contained in the subject principal area. If it is determined that the positional relationship satisfies the predetermined condition (YES in step S207), the determining unit 306 proceeds to step S208. If it is determined that the positional relationship does not satisfy the predetermined condition (NO in step S207), the determining unit 306 proceeds to step S209.
In step S208, the determining unit 306 specifies, as data to be erased, items of writing data concerning all strokes included in the subject principal area among the strokes indicated by the items of writing data stored in the storage unit 303. A stroke included in the subject principal area is a stroke which is at least partially included in the subject principal area.
In step S209, the determining unit 306 determines whether all subject principal area candidates have been processed. If a principal area that has not been processed is found (NO in step S209), the determining unit 306 returns to step S201. In step S201, the subject principal area is updated, and steps S202 through S209 are executed on the new subject principal area. If all the principal area candidates have been processed (YES in step S209), the determining unit 306 completes the processing.
A third operation example will now be described below. In the third operation example, as well as in the second operation example, sub-areas are used. However, sub-areas in the third operation example are not defined by area information, but are determined according to writing data. More specifically, character recognition processing is performed on strokes indicated by writing data, and a circumscribed rectangle obtained for each recognized character is used as a sub-area.
In step S301, the character recognition unit 309 performs character recognition processing on an image indicated by a new item of writing data. The character recognition processing includes processing for dividing a set of strokes into units that are estimated to be characters, that is, processing for dividing a set of strokes into individual characters. As a result, circumscribed rectangles are obtained for the individual characters. The storage unit 303 stores information for specifying the position and the size of the circumscribed rectangle of each character (hereinafter called “rectangle information”).
In step S302, the area information obtaining unit 305 reads the rectangle information stored in the storage unit 303. In step S303, the area information obtaining unit 305 specifies a principal area that overlaps the rectangle indicated by the rectangle information. In step S304, the area information obtaining unit 305 stores this rectangle information as information for specifying sub-areas included in this principal area in the storage unit 303.
Character recognition processing may not be necessarily started in response to the generation of a new item of writing data. Instead, character recognition processing may automatically be started at regular time intervals.
The present invention is not restricted to the above-described exemplary embodiment, and various modifications may be made. Some modified examples will be described below, and two or more of the following modified examples may be combined.
The condition concerning the positional relationship used for specifying a subject area corresponding to strikethrough (hereinafter called a “first condition”) in step S109 and the condition concerning the positional relationship used for determining strokes to be erased from the subject area (hereinafter called a “second condition”) in step S110 are not restricted to the conditions discussed in the above-described exemplary embodiment. For example, the first condition may be a condition that the distance from the subject area to the strikethrough is equal to or smaller than a predetermined threshold. The second condition may be a condition that the distance from a stroke to the subject area is equal to or smaller than a predetermined threshold.
In the above-described exemplary embodiment, after writing data indicating the first path is generated, part of this writing data is erased according to the second path. Alternatively, the information processing apparatus 30 may perform: (1) obtaining stroke information indicating the first path and the second path; (2) specifying an area on the medium 10 that has a predetermined positional relationship with the second path; (3) generating writing data indicating the first path which does not overlap this specified area; and (4) outputting the generated writing data.
In the third operation example, instead of performing character recognition processing, processing for calculating a circumscribed polygon for a set of strokes may be performed. In this case, a set of strokes may not necessarily be a linguistically meaningful unit, and instead, a predetermined number of strokes may be grouped and a circumscribed polygon for this group of strokes may be calculated.
The relationships between the functions and hardware elements in the digital pen system 1 are not restricted to those discussed in the above-described exemplary embodiment. The hardware configurations of the digital pen 20 and the information processing apparatus 30 are only examples. At least some of the functional elements shown in
The program executed by the CPU 31 may be provided as a result of being stored in a storage medium such as an optical disc, a magnetic disk, and a semiconductor memory, or being downloaded via a communication network such as the Internet. This program may not necessarily include all the steps shown in
The foregoing description of the exemplary embodiment of the present invention has been provided for the purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise forms disclosed. Obviously, many modifications and variations will be apparent to practitioners skilled in the art. The embodiment was chosen and described in order to best explain the principles of the invention and its practical applications, thereby enabling others skilled in the art to understand the invention for various embodiments and with the various modifications as are suited to the particular use contemplated. It is intended that the scope of the invention be defined by the following claims and their equivalents.
| Number | Date | Country | Kind |
|---|---|---|---|
| 2016-109383 | May 2016 | JP | national |