Invention content
The object of the present invention is to provide a kind of decoding method based on coded markings, can realize in embedded substrate
Information carries out effective encoding and decoding.
To achieve the above object, in a first aspect, the present invention provides a kind of coding method based on coded markings, the side
Method includes:
The first coded markings are generated, deviate the direction of displacement of predeterminated position to each using multiple first coded markings
Position is encoded, and position code is obtained;
The second coded markings are generated, the displacement that predeterminated position is deviateed using multigroup second coded markings believes content
Breath is encoded, and information code is obtained;
Second coded markings described in every group include the second quantity coded markings, and second quantity is more than described first and counts
Amount;
The position code and described information code are overlapped processing and generate combinational code, to realize the coding of item of information.
Further, the method further includes:
Repeated encoding is carried out to the same described information item using multigroup second coded markings.
Further, described information item includes multiple elements, utilizes at least two institute of the second coded markings pair described in every group
Element is stated to be encoded.
Further, described information item includes multiple elements, each element of second coded markings pair into
Row coding.
Further, described information item includes one in address information, substrate layout information, encryption information, access information
Item is multinomial.
Second aspect, the present invention provides a kind of coding/decoding method based on coded markings, the method includes:
The coded graphics information of item of information is obtained, includes the first coded markings and the second coding in the coded graphics information
Label;
The coded graphics information is parsed, the first coded markings and the second coded markings are extracted;
Determine that first coded markings deviate the direction of displacement of predeterminated position;
Determine that second coded markings deviate the displacement of predeterminated position;
The position of described information item is decoded according to first coded markings and the direction of displacement;
The content information of described information item is decoded according to second coded markings and the displacement.
Further, described information item includes at least two elements, and the method further includes:Identify the first coding mark
Remember the element of corresponding item of information.
Further, the method further includes:
The direction of displacement for deviateing predeterminated position using first coded markings identifies that first coded markings are corresponding
The element of item of information.
Further, identify that the element of the corresponding item of information of first coded markings specifically includes:
Using the replacement Treatment of the first coded markings between continuous group in multigroup first coded markings to described first
The element of the corresponding item of information of coded markings is identified.
Further, the method further includes:The position letter of stroke is determined according to the coded graphics information of stroke in substrate
Breath and content information.
Decoding method provided in an embodiment of the present invention based on coded markings, utilizes the position of coded markings and predeterminated position
It moves and encoding and decoding is carried out to the information in embedded substrate, to realize the information process- of hand-written notes.
Specific implementation mode
Below by drawings and examples, technical scheme of the present invention will be described in further detail.
Executive agent in technical solution of the present invention is the digital pen with Image Acquisition and processing function.
Fig. 1 is the schematic diagram of information code provided in an embodiment of the present invention, which can be covered in the position code in substrate
On, it is combined or is embedded into the position code with the position code, to generate combinational code.The information code may include that patch is layered on substrate
Multiple units 6 on the surface of (such as paper) 1.The code can have fixed position relative to position code (not shown in figure 1),
Thus, it is supposed that the size of unit from position code it is known that can then determine the current list that the digital pen moved on combinational code detects
The unit coordinate of member.Each unit can encode same segment information using multiple coded markings in each unit.Therefore, each
Unit encodes item of information.Item of information may include multiple information item elements.In the example depicted in fig. 1, item of information can be
12 elements for being 1-12 comprising number in unit 6.Each element can be encoded with one or more coded markings.Item of information
It may include binary data, each of the binary data is encoded with a coded markings in information code.Each information
Therefore item element can represent one or more data bit.
The current location of pen is determined using position code, so that it may determine the active cell that pen is seen using cell size.
In addition, position code, cell size and the information on how to use coded markings to encode item of information can be used, really
Determine the quantity for each item of information coded markings that pen is seen and corresponding information item element.
User can make one or more strokes 7 on document 1.Stroke can be registered as spatially and interim relevant
The sequence of position.Pen can have contact detector, contact detector detection to be lifted when pen is placed in substrate and then from substrate
At the time of rising.The position recorded between " pen is put down " and next " pen lifts " can be defined as stroke.
While making stroke 7, digital pen is usually moved across multiple units 6.But the visual field of pen may not be big
Enough to make pen that can record a complete information code unit in single image.In the example of fig. 1, in stroke 7 period pen
Each image 8 of capture will only include a pair of of information element.But when pen moves, capture is included into the difference in different units
The other image 8 of information element, and will finally record all elements 1-12 of item of information.Pass through what is generated from different units
The information of element decodes the item of information that coding is repeated in the unit of information code.
Can be any letter with the available information space encoding in unit in the item of information of the unit interior coding of information code
Breath.It can be with right and wrong position data.It for example can be address instruction, such as the e-mail address or text of the creator of document
The URL that be sent to of shelves, or that the application program for receiving information from substrate can be helped correctly to handle is information with substrate cloth
The related information of office, either can be used for the encryption information such as encryption key for encrypting the stroke recorded from base portion or can quilt
Access information item for the use of base portion to be confined to specific pen.
The position code of information code cover it can be any kind of position to the absolute position encoder on surface
Code.Single symbolic coding can be used in each position, and according to the quantity of the position encoded by the position code, the single symbol may be quite
It is complicated.Selectively, each position can use two or more less complex codings.Each symbol is only to two possibility wherein
The position code of one of value coding simplest symbol can be used.In the case, symbol merely has to tool there are two recognizable
State.
Be layered in substrate in addition, position code can paste, to each position by being only used for this position encoded one or
Multiple coded markings codings.Selectively, position code " can float ", to which any part region of the predefined size of position code can
Define a position.In the case, for can be additionally used in another one at least part in a position encoded symbol
The coding set.
Exemplary illustration hereafter can be used for the specific position code of combinational code, the combinational code is to position instruction and one or more
The message segment of a reproduction encodes.
The position code is based on number sequence, which is hereinafter referred to as difference sequence.With properties, i.e., the difference sequence has
If it is rendered as the arbitrary portion sequence with predetermined length, such as has the partial sequence there are five difference, then this partial order
It is listed in the position for always having in the difference sequence and being unambiguously specified.In other words, only occur once in difference sequence, and
And it therefore can be used for location determination.Sequence with this attribute is known as DeBruijn sequences.More precisely, difference sequence edge
The X-axis and Y-axis " RUN " of position code.
Apply the physical location code in substrate to be made of coded markings 22, according to the label relative to predeterminated position 23 or
The position of optical grating point, the label can have there are four different value 0-3.As shown in Fig. 2, each symbol is circular point shape, and on edge
One of four different directions are relative to 23 shift length 24 of predeterminated position.Predeterminated position 23 is located at visible or invisible or virtual optical
The point of intersection between grid stroke 21 in grid or grid.It is determined by the direction of displacement by the value of symbolic coding.Each symbol 0-3 can
Be converted into for being encoded to X-coordinate position and another position for being encoded to Y coordinate, that is, be converted into position it is even (0,
0), (0,1), (1,0) and (1,1).Therefore, it can individually be encoded with Y-direction in X direction, but using X and Y phases
Same coded markings coding.
Optionally, distance 24 is not less than about the 1/8 of the distance between two adjacent grid strokes 21 and no more than big
About 1/4, preferably about 1/6.Each position is encoded with 6X6 coded markings, which can be converted into for the position
The 6X6 bit matrix of the 6X6 bit matrix for the x coordinate set and the Y coordinate for the position.If it is considered that x bit matrix, then the matrix can
It is divided into six row, six positions of each column.Each bit sequence by row constitutes a partial order in the main Number Sequence of cycle of 63 bit lengths
Row, the main Number Sequence have with properties, i.e., if selecting length for the partial sequence of 6 positions, the partial sequence is in the master
There is the position being unambiguously specified in Number Sequence.Therefore, six row are converted into six positional numbers or sequential value, correspond to master
Six positions in Number Sequence.Between this six positional numbers, in adjacent five differences of internal formation, it is poor that these differences are constituted
The partial sequence of Number Sequence, and therefore there is the position being unambiguously specified in the difference sequence, therefore there is quilt along x-axis
Clearly determining position.For specific x coordinate, positional number will change according to Y coordinate.On the other hand, difference is sat identical with Y
Mark it is unrelated because positional number always changes according to main Number Sequence, and the main Number Sequence in entire position encoded pattern in row
Circulating repetition.
Therefore, six rows in Y bit matrix define six positional numbers in main Number Sequence.This six positional numbers define
Five differences, the difference constitute the partial sequence of difference sequence and have the position being unambiguously specified along Y-axis.
Information code can be interlocked in position code or with position code and be covered in position code by being superimposed on, and is being superimposed upon
In the case of in position code, message segment is encoded by the coded markings for being gone back in position code for being encoded to position, with position
In the case of setting code staggeredly, position code and information code encode position and information using different coded markings.Can also it think
The combination being superimposed to alternation sum.In the case, some coded markings in combinational code are compiled for position encoded and information
Code, some coded markings are only used for position encoded and some coded markings are only used for information coding.
Information code can be covered on the entire scope of the position code in substrate or only on part of it and be set on code in place.
Information code and position code can be in substrates by similar and different ground encoding of graphs.It is used if it is position code and information code different
Coded markings, such as when code interlocks, the graphical representation of the coded markings of information code and the coded markings of position code can be mutual
It is independent.
For example different size of point of identical graphic parameter can be used to compile the different value of coded markings for the two codes
Code.Alternatively, different parameters can be used in code.The oblique line differently rotated can be used to encode different values for information code,
And point of different shapes can be used to encode different value for position code.
If information code and position code share some coded markings, the same parameter of coded markings can be used for letter
Cease the value of code and the value coding of position code.Selectively, different parameters can be used.In the first scenario, the value of position code and
The various combination of the value of information code can be encoded with the different size or symbol of coded markings along the displacement of different directions.
In the case of two kinds, the value of position code can be encoded with the direction of displacement of point, and the value of information code can by with the different colours of point or
Color intensity encodes.
The symbol of combination position and information code can be divided into multiple groups according to scheduled rule.Each group may include predetermined number
Amount belongs to the symbol of position code and the symbol for belonging to information code of predetermined quantity.Assuming that in the presence of make associated symbol position i.e. by position
The position algorithm associated with the specific coding of information code label in the substrate of code determination is set, what which any can be contemplated that
Mode is formed.Coded markings may be logically divided into the unit that patch is layered on combinational code.Unit can be defined as the coherence area in combinational code
Domain, wherein same example code of all information encoding indicias to item of information.The size and shape of unit can be in different base
Between and changed according to the message segment that will be encoded in the information code.
It, can be in substrate as the optional selection method for making mark position mark with the specific coding of information code associated algorithm
It is upper use pictorial symbolization unit, such as in substrate additional marking or belong to position code and/or information code label specific spy
Levy marking unit.
As described above, every group of coded markings may include the coding mark more than the coded markings that can be seen in its visual field than pen
Note.All groups can encode same message segment, or can be encoded to less amount of different message segments.In the later case, it solves
Decoding apparatus is required to distinguish which group encodes first information section, the second message segment of which group pair coding etc..
Illustrate an example of the specific implementation for applying the combinational code in substrate such as paper, Fig. 4 below in reference to Fig. 4
Schematically show the sub-fraction of combinational code.All symbols 22 in Fig. 4 are consequently belonging to position code for position encoded.
These symbols also deviate corresponding predeterminated position 23 along any one of four direction direction, and the predeterminated position 23 is by grid stroke
Or the intersection point of grid lines 21 limits.
Information code is superimposed upon in position code, is also used for position encoded coded markings to which information code can be used.
In this example, information code is used for every a coded markings in position code since the upper left corner.In Fig. 4, point 22i belongs to
Information code and position code, and point 22p only belongs to position code.Position is by the change of the direction of displacement with the coded markings for belonging to position code
Change coding.The size of displacement 24p is identical for all four directions.Item of information is by the displacement with the coded markings for belonging to information code
The variation of degree encodes.In this example, each information encoding indicia or from predeterminated position offset normally distance 24p with " 0 "
Coding, or twice of normal distance 24i is deviated to be encoded to " 1 " from predeterminated position.
It hereafter, will be with reference to above-mentioned digital pen and above-mentioned example combinational code explanation for decoded example of combinational code
Property embodiment.
When using digital pen in the substrate with combinational code, contact sensor detection pen tip in digital pen by by
Time in substrate, and the camera arrangement in digital pen is triggered to capture the figure of the subregion of the combinational code in its visual field
As.Camera continues to capture image, until contact sensor 206 detects that pen is lifted from substrate.Camera arrangement 206 captures
A series of images constitute combinational code different piece region a series of coded graphics.
The decoding of combinational code in this series of coded graphics can be in the decoder module of digital pen or in another electronics
It is executed in the decoder module of device, coded graphics is passed to another electronic device from pen.Coded graphics can be as being captured
Ground is passed in the form of more or less being handled.Decoding can selectively divide between digital pen and another device
Match, to the decoded first part of digital pen execution, another device executes second part.
In the first step of the decoding process of decoder module, the position of the image of pen capture is determined.The position of the above-mentioned type
The decoding of code may include following steps, position the coded markings in the image, and grating is made to coordinate the coded markings, determine coding mark
Note leaves the direction of displacement of the predeterminated position defined by grid stroke intersection point, and the displacement calculating position based on the coded markings.
It should be noted that not necessarily by calculating from position code calculating position.The position code can be additionally used in by making to be captured
Image coded markings with it is expected that the expression of the position code in specific region residing for this matches, or by making to receive
Coded graphics in coded markings matched with the coded graphics being previously received determine position, to set up relative position.
When the position of the coded markings in image is determined and the x-y position of coded markings in image is decoded
When, the part for the information code seen in the image can be decoded.For decoding, deposited using two associated with decoder module
Store up buffer.The size of each storage buffer is identical as the message segment in information code interior coding, i.e., is 128 in this example
Position.Hereafter, storage buffer is referred to as accumulator buffer acc and contributor's buffer cono for belonging to the image of information code
Interior each coded markings execute following steps:
1) the distance between center and associated grid intersection point of calculation code label offs.
2) integer x in the same manner as described above, is calculatedi, integer yiWith integer bit_number.
3) P, x are usedi, yiPermuted_bit_number is calculated with bit_number.
4) with offs update accumulator buffers acc:
Acc [permuted_bit_number] +=offs.
5) with 1 update contributor's buffer con:
Con [permuted_bit_number] +=1.
Then, the corresponding displacement of the different data codes of accumulator buffer accumulation information code, and contributor's buffer with
The number that the certain bits of track information code are seen by pen.
When handling all images as already described above, offset that all information item elements are calculated:
Offset [n]=acc [n]/con [n], wherein n are the indexes between 1 and 128.If the con's of any information item element
Value is 0, then this means that not having this information item element in this stroke.
Alternatively, contributor's buffer can not have to 1 update, but marked with the correlative coding of reflection information code
The value of the reliability of observation updates.Coded markings close to image edge can for example be given smaller weight, this is because should
Coding by projection distortion by larger being influenced.
If using error correction mechanism when being encoded to combinational code, decoding process uses identical error correction mechanism, with detection
And correction error and/or omit position.
The above-mentioned processing of coded graphics obtain being formed in one or more strokes during, i.e. in one or more electronics strokes
A series of positions of the coded graphics of movement of the pen in substrate.It can also obtain by partially or completely decoded item of information.
In the final step, decoding process can make the item of information associated with electronics stroke.As described above, being obtained by position code
The each position obtained can be converted into the local location on page instruction and the page.Stroke be typically denoted as the page instruction and
A series of local locations.In this way, pen is able to know that writes stroke on which page.When item of information is decoded, decoding process
It can check whether item of information is decoded and associated with current page.If it is, decoding process can arbitrarily check with
The consistency by turn of the item of information stored in the past.If the position data of current information item and the position data of pervious item of information are enough
It is similar, then it then can assemble the position data of different strokes.In this way, the possibility that item of information is correctly decoded can be increased.On the contrary, such as
The position data of the decoded item of information of fruit are entirely different, then this instruction is write on two different pages, and decodes
Journey can take suitable operation.
If decoding process may determine the stroke on the different pages of multi-page document and belong on all pages and have
There is the same document of identical information code, then it can come never to collect about data with all strokes on the page using this fact
The information of item, to increase the possibility that item of information is correctly decoded.Decoding process may have access to following information, i.e., the information indicates page
The specific group in face will not represent different documents, and only occur from multi-page document.Decoding process can also or it is optional
Compare with selecting as described above by never with the information digit evidence of the stroke decoding of the page, and the similitude based on data makes pass
In the hypothesis of the connection page.
Therefore, the signal of decoding process or the addressable cell size about the message code in specific webpage.
Optionally, decoding process can parallelly execute decoding for different cell sizes.It is received when comparing from different strokes
The information digit of collection according to when, the cell size for coding will be evident.
Fig. 5 is the flow chart of the coding method provided in an embodiment of the present invention based on coded markings.As shown, of the invention
The coding method based on coded markings of embodiment includes:
Step 510, the first coded markings are generated, the displacement side of predeterminated position is deviateed using multiple first coded markings
It is encoded to each position, obtains position code.
Step 520, the second coded markings are generated, the displacement of predeterminated position is deviateed using multigroup second coded markings
Content information is encoded, information code is obtained.
Wherein, the second coded markings described in every group include the second quantity coded markings, and second quantity is more than described
First quantity.
Step 530, the position code is superimposed upon on described information code and generates combinational code;
Step 540, item of information is encoded using the combinational code.
In addition, the method further includes:
Repeated encoding is carried out to the same described information item using multigroup second coded markings.
Wherein, item of information includes multiple elements, and the method further includes:Utilize every group of second coded markings pair at least two
Element is encoded.Element of each second coded markings pair encodes.
Item of information further includes one or more in address information, substrate layout information, encryption information, access information.
Specific implementation process in above step is described in detail in foregoing embodiments, no longer superfluous herein
It states.
Fig. 6 is the flow chart of the coding/decoding method provided in an embodiment of the present invention based on coded markings.As shown in figure 5, this hair
The coding/decoding method based on coded markings of bright embodiment includes:
Step 610, obtain the coded graphics information of item of information, in the coded graphics information comprising the first coded markings and
Second coded markings;
Step 620, the coded graphics information is parsed, extracts the first coded markings and the second coded markings;
Step 630, determine that first coded markings deviate the direction of displacement of predeterminated position;
Step 640, determine that second coded markings deviate the displacement of predeterminated position;
Step 650, the position of described information item is decoded according to first coded markings and the direction of displacement;
Step 660, the content information of described information item is solved according to second coded markings and the displacement
Code.
Wherein, item of information includes at least two elements, and the method further includes:Identify the corresponding information of the first coded markings
The element of item.Specifically, the direction of displacement for deviateing predeterminated position using the first coded markings identifies that the first coded markings are corresponding
The element of item of information.
Identify that the element of the corresponding item of information of the first coded markings specifically includes:
It is encoded using the replacement Treatment pair first of the first coded markings between continuous group in multigroup first coded markings
The element of corresponding item of information is marked to be identified.
In addition, the method further includes:According to the coded graphics information of stroke in substrate determine stroke location information and
Content information.
Specific implementation process in above step is described in detail in foregoing embodiments, no longer superfluous herein
It states.
Decoding method provided in an embodiment of the present invention based on coded markings, utilizes different coded markings and default position
The displacement set carries out encoding and decoding to the information in embedded substrate, to realize the information process- of hand-written notes.
Professional should further appreciate that, described in conjunction with the examples disclosed in the embodiments of the present disclosure
Unit and algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, hard in order to clearly demonstrate
The interchangeability of part and software generally describes each exemplary composition and step according to function in the above description.
These functions are implemented in hardware or software actually, depend on the specific application and design constraint of technical solution.
Professional technician can use different methods to achieve the described function each specific application, but this realization
It should not be considered as beyond the scope of the present invention.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can use hardware, processor to execute
The combination of software module or the two is implemented.Software module can be placed in random access memory (RAM), memory, read-only memory
(ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technical field
In any other form of storage medium well known to interior.
Above-described specific implementation mode has carried out further the purpose of the present invention, technical solution and advantageous effect
It is described in detail, it should be understood that the foregoing is merely the specific implementation mode of the present invention, is not intended to limit the present invention
Protection domain, all within the spirits and principles of the present invention, any modification, equivalent substitution, improvement and etc. done should all include
Within protection scope of the present invention.