Encoding and decoding method for microdot matrix

An encoding and decoding method for a microdot matrix includes the steps of: forming a plurality of microdots by encoding based on Reflected Gray Codes in a data region included in each of a plurality of microdot blocks included in a microdot matrix, wherein the microdots corresponding to lower order bits of the Reflected Gray Codes are formed as the outmost microdots in the data region; scanning the microdot matrix to fetch an image and recognizing a microdot group in the date region of each microdot block in the image; and decoding a corresponded coordinate of the image on the microdot matrix according to the microdot block to which the microdot group containing lower order bits of the Reflected Gray Codes belongs.

CROSS REFERENCE TO RELATED APPLICATION

This application claims the priority benefit of Taiwan Patent Application Serial Number 098107613, filed on Mar. 10, 2009, the full disclosure of which is incorporated herein by reference.

BACKGROUND

1. Field of the Invention

This invention generally relates to an encoding and decoding method and, more particularly, to an encoding and decoding method for a microdot matrix.

2. Description of the Related Art

Please refer toFIG. 1, it shows a conventional handwriting recognition system including a read/write medium91and a scanning device92. A microdot matrix, which includes a plurality of visually negligible position codes911, is formed on the read/write medium91.

Please refer toFIGS. 2aand2b, each position code911generally includes a header region9111and a data region9112, wherein microdots9113distributed with different combinations and permutations are formed in the data region9112of every position codes911whereas microdots9113distributed in a fixed combination and permutation are formed in the header region9111of every position codes911. InFIG. 2b, the microdots9113included in the position code911shown inFIG. 2aare replaced by the binary bits, i.e. positions with a microdot9113therein are replaced with the binary bit “1” and positions without a microdot9113therein are replaced with the binary bit “0”.

The scanning device92has an image sensor921for fetching images of the position codes911. In this manner, a user may utilize the scanning device92to write on the read/write medium91, and a processing unit will compare the image of the data region9112of the position code911fetched by the image sensor921with a data base so as to recognize a current position and motion of the scanning device92. However, the conventional handwriting recognition system has at least following problems: (1) A large memory space is required to store all position codes911on a microdot matrix for being compared with the fetched images by a processing unit; and (2) The image sensor921has to fetch an image including at least one complete position code911at any moment for image comparison, and thus the image sensor921requires a larger sensor array. However, these system requirements will increase the system cost of a handwriting recognition system.

Accordingly, the present invention provides an encoding and decoding method for a microdot matrix that performs the encoding and decoding based on Reflected Gray Codes so as to reduce system requirements and to eliminate the position ambiguity during decoding process.

SUMMARY

The present invention provides an encoding and decoding method for a microdot matrix that encodes and decodes a microdot matrix based on Reflected Gray Codes and the microdots corresponding to lower order bits of the Reflected Gray Codes are formed together as the outmost microdots in the microdot block thereby reducing the ambiguity generated during decoding.

The present invention further provides an encoding and decoding method for a microdot matrix that encodes and decodes a microdot matrix based on Reflected Gray Codes so as to simplify the decoding procedure.

The present invention provides an encoding method for a microdot matrix including: forming a plurality of microdots by encoding based on Reflected Gray Codes in a data region included in each of a plurality of microdot blocks included in a microdot matrix, wherein the microdots corresponding to lower order bits of the Reflected Gray Codes are formed as the outmost microdots in the data region.

The present invention further provides a decoding method for a microdot matrix. The microdot matrix includes a plurality of microdot blocks each including a header region and a date region. A plurality of microdots are formed by encoding based on Reflected Gray Codes in the date region to generate at least one direction coordinate code. The decoding method includes the steps of: scanning the microdot matrix to fetch an image; recognizing whether the image contains a complete direction coordinate code; determining a coordinate of the image on the microdot matrix by decoding the direction coordinate code when the image contains a complete direction coordinate code; and performing the following steps when the image does not contain a complete direction coordinate code: dividing the image into a plurality of microdot groups according to the header region of each microdot block; forming the microdot groups belonging to identical direction coordinate code in two adjacent columns as an afore-arranged coordinate code according to the header region of each microdot block; switching positions of the microdot groups belonging to different microdot blocks in the afore-arranged coordinate code to form an after-arranged coordinate code; and determining a coordinate of the image on the microdot matrix according to the after-arranged coordinate code.

The present invention further provides a decoding method for a microdot matrix. The microdot matrix includes a plurality of microdot blocks each including a header region and a data region. A plurality of microdots are formed by encoding based on Reflected Gray Codes in the date region to generate at least one direction coordinate code. The microdots corresponding to lower order bits of the Reflected Gray Codes are formed as the outmost microdots in the direction coordinate code. The decoding method includes the steps of: scanning the microdot matrix to fetch an image; recognizing whether the image contains a complete direction coordinate code; determining a coordinate of the image on the microdot matrix by decoding the direction coordinate code when the image contains a complete direction coordinate code; and performing the following steps when the image dose not contain a complete direction coordinate code: dividing the image into a plurality of microdot groups according to the header region of each microdot block; and using the direction coordinate code of the microdot block to which the microdot group including lower order bits of the Reflected Gray Codes belongs as a coordinate of the image on the microdot matrix.

The present invention further provides a decoding method for a microdot matrix. The microdot matrix includes a plurality of microdot blocks. A plurality of microdots are formed by encoding based on Reflected Gray Codes in a data region included in the microdot block, and the microdots corresponding to lower order bits of the Reflected Gray Codes are formed as the outmost microdots in the data region. The decoding method includes the steps of: scanning the microdot matrix to fetch an image and recognizing a microdot group in the date region of each microdot block in the image; and decoding a coordinate of the image on the microdot matrix according to the microdot block to which the microdot group containing lower order bits of the Reflected Gray Codes belongs.

The present invention further provides an encoding and decoding method for a microdot matrix including the steps of: forming a plurality of microdots by encoding based on Reflected Gray Codes in a data region included in each of a plurality of microdot blocks included in a microdot matrix, wherein the microdots corresponding to lower order bits of the Reflected Gray Codes are formed as the outmost microdots in the data region; scanning the microdot matrix to fetch an image and recognizing a microdot group in the date region of each microdot block in the image; and decoding a coordinate of the image on the microdot matrix according to the microdot block to which the microdot group containing lower order bits of the Reflected Gray Codes belongs.

The encoding and decoding method for a microdot matrix of the present invention performs the encoding and decoding of position codes based on the regular pattern of the Reflected Gray Codes, such that it is not necessary to incorporate a memory to record all position codes on a read/write medium. Furthermore, the microdots corresponding to lower order bits of the Reflected Gray Codes are formed as the outmost microdots in the data region so as to reduce the position ambiguity during decoding, and the position ambiguity during decoding may be eliminated by checking a balancing bit in the header region. In the present invention, it is able to further determine several position scales according to a distance between a center of the image fetched by the image sensor and a center of the microdot block to which the decoded image belongs so as to increase the position resolution of the decoding method for a microdot matrix.

DETAILED DESCRIPTION OF THE EMBODIMENT

First, the properties and generating method of a set of Reflected Gray Code will be illustrated. Please refer toFIG. 3, it shows a generating method of a 4-bit Gray code. Basic properties of Reflected Gray Code include: (1) Reflected Gray Codes corresponding to two consecutive inter values differ in only one bit, i.e. the hamming distance between two consecutive Reflected Gray Codes is 1; one of the two consecutive Reflected Gray Codes is an odd Reflected Gray Code and the other is an even Reflected Gray Code, wherein an odd Reflected Gray Code includes an odd number of bits1whereas an even Reflected Gray Code includes an even number of bits1; (2) While incrementing a value of an even Reflected Gray Code by 1 to generate an odd Reflected Gray Code having the incremented value, the odd Reflected Gray Code can be generated only by changing the least significant bit of the even Reflected Gray Code; and (3) While incrementing a value of an odd Reflected Gray Code by 1 to generate an even Reflected Gray Code having the incremented value, the even Reflected Gray Code can be generated only by changing the next-to-left bit of the bit1rightmost in the odd Reflected Gray Code. In order to clearly show the reflective properties in Reflected Gray Codes inFIG. 3, a plurality of horizontal lines are shown to divide the Reflected Gray Codes into different sets; wherein each horizontal line inFIG. 3serves as a virtual mirror for symmetric Reflected Gray Codes located at the upper and lower sides thereof, and two symmetric Reflected Gray Codes merely differ in the leftmost bit1of one of the symmetric Reflected Gray Codes. Note that the above virtual mirror should be known for those who skilled in related art of Reflected Gray Code and thus details will not be repeated herein. In addition, a person skilled in the art can generate a N-bit Reflected Gray Code according to the same process, e.g. 8-bit Gray code.

Please refer toFIGS. 4 to 5, they schematically show a microdot block10and a microdot matrix M according to an embodiment of the present invention. A plurality of microdot blocks10are distributed on a read/write medium3to form the microdot matrix M (as shown inFIG. 5), and each microdot block10is for indicating a different coordinate on the microdot matrix M. The microdot block10includes a header region11and a data region12, wherein an arbitrary shape of a microdot13, for example, but not limited to, rectangular microdot, circular microdot, triangular microdot, minus sign microdot or plus sign microdot, may be formed at positions showing digital bit “1” in the header region11and the data region12; whereas positions showing digital bit “0” may be blank. However, the above arrangement may be reversed, i.e. positions showing digital bit “1” may be blank while an arbitrary shape of microdot13may be formed at positions showing digital bit “0”. In addition to representing digital bits “1” and “0” by the presence and absence of the microdots13, the digital bits “1” and “0” may also be represented by different sizes, shapes or locations of the microdot13. That is, any method that can form two distinguishable microdots13is not apart from the scope of the present invention.

The header region11of each microdot block10includes header microdots131distributed in a fixed combination and permutation and a balancing microdot132representing a coordinate value of different directions, wherein the balancing microdot132is for coordinate correction and it may not be implemented132according to different embodiments. The data region12of every microdot blocks10includes microdots13formed as a matrix and with different combinations and permutations for recognition. In this manner, it is able to recognize the coordinate or the position of each microdot block10on the microdot matrix M according to the distribution of the microdots13formed in the data region12. In this embodiment, the data region12includes an X-coordinate code GnXand a Y-coordinate code GnY, wherein the X-coordinate code GnXis formed by a 8-bit Reflected Gray Codes x0˜x7, and x0represents the least significant bit of the X-coordinate code GnXwhile x7represents the highest significant bit of the X-coordinate code GnX; the Y-coordinate code GmYis also formed by a 8-bit Reflected Gray Codes y0˜y7, and y0represents the least significant bit of the Y-coordinate code GmYwhile y7represents the highest significant bit of the Y-coordinate code GmY. In this embodiment, a microdot13may be formed at the positions representing the digital bit “1” of the Reflected Gray Code while the positions representing the digital bit “0” of the Reflected Gray Code may be blank. The X-coordinate code GnXrepresents the nth coordinate along the X-coordinate axis on the microdot matrix M while the Y-coordinate code GmYrepresents the mth coordinate along the Y-coordinate axis on the microdot matrix M, wherein the X-coordinate axis is perpendicular to the Y-coordinate axis. In other embodiment, the X-coordinate code GnXand the Y-coordinate code GmYmay be formed by the Reflected Gray Codes having other number of bits, e.g. 16-bit or 32-bit Reflected Gray Codes, according to the size of the microdot matrix M.

Please refer toFIG. 5again, it shows a schematic diagram of a microdot matrix M formed by using the microdot blocks10shown inFIG. 4. It should be understood that, in order to clearly show the characteristics of the microdot block10inFIG. 5, the size of every microdot blocks10and a distance between microdot blocks10are enlarged. In actual implementation, the microdot blocks10are formed closely with each other and the size of the microdot blocks10is small enough to be visually neglected. On the microdot matrix M, the X-coordinate codes GnXof the microdot block10may be sequentially arranged from left to right or right to left (i.e. X-coordinate direction) while the Y-coordinate codes GmYmay be arranged sequentially from up to down or down to up (i.e. Y-coordinate direction), wherein the “sequential arrangement” described herein is to arrange the XY coordinate codes in a sequence of G0, G1, G2. . . as shown inFIG. 3. For example as shown inFIG. 5, in the most upper-left microdot block10on the microdot matrix M, the X-coordinate code is arranged as G0X(“00000000”) and the Y-coordinate code is arranged as G0Y(“00000000”), i.e. the coordinate of the most upper-left microdot block10on the microdot matrix M is arranged as (0,0). In the arrangement along the X-coordinate axis, the Gray code G1, which is consecutive to the Gray code G0(as shown inFIG. 3), is arranged at the right hand side of the microdot block10with a coordinate (0,0), and thus the X-coordinate code of the microdot block10with a coordinate (1,0) is arranged as G1X(“00000001”). Since the position of the microdot block10with the coordinate (1,0) is not changed along the Y-coordinate axis, the Y-coordinate code thereof is still arranged as G0Y(“00000000”). Following this rule, the X-coordinate codes and the Y-coordinate codes of the microdot blocks10may be sequentially arranged along the right direction ofFIG. 5(i.e. X-coordinate axis direction). In the arrangement along the Y-coordinate axis, the Gray code G1, which is consecutive to the Gray code G0, is arranged below the microdot block10with the coordinate (0,0), and thus the Y-coordinate code of the microdot block10with a coordinate (0,1) is arranged as G1Y(“00000001”). Since the position of the microdot block10with the coordinate (0,1) is not changed along the X-coordinate axis, the X-coordinate code thereof is still arranged as G0X(“00000000”). Following this rule, the X-coordinate codes and the Y-coordinate codes of the microdot blocks10may be sequentially arranged along the downward direction ofFIG. 5(i.e. Y-coordinate axis direction). In this manner, a plane coordinate system can be formed and each microdot block10in the plane coordinate system has an individual coordinate (n,m). Accordingly, when an image sensor21of a scanning device20fetches the complete image of each microdot block10, a processing unit (not shown) may recognize the coordinate (n,m) of the current image fetched by the scanning device20on the microdot matrix M according to the X-coordinate code GnXand the Y-coordinate code GmY, and recognizes the motion of the scanning device20according to successive images fetched by the scanning device20.

The header microdots131in the header region11of every microdot blocks10are distributed in a fixed combination and permutation inside the header region11. The balancing microdot132may be formed at the last position of the first row of the header region11every other column of the microdot matrix M for the coordinate correction along the X-coordinate axis, or at the last position of the first column of the header region11every other row of the microdot matrix M for the coordinate correction along the Y-coordinate axis, wherein the header microdots131and the balancing microdot132may have different patterns. As shown inFIG. 5, the X-coordinate codes G0X, G2X, G4X. . . all include a balancing microdot132while the Y-coordinate codes G1Y. . . also include a balancing microdot132. However, the balancing microdot132may be formed in other ways, e.g. it may be formed at different corners or locations of the same position in the header region11of every microdot blocks10for simultaneously representing coordinate bits in two directions.

However, most of the images of the microdot matrix M fetched by the scanning device20may not contain a complete microdot block10. The present invention also can recognize the coordinate of the image currently fetched by the scanning device20on the microdot matrix M according to a partial image of each microdot block10.

The method to decode an image including a part of the microdots13of a plurality of microdot blocks10fetched by the image sensor21of the scanning device20will be illustrated hereinafter. Please refer toFIG. 6a, it shows four adjacent microdot blocks10and an image I, which includes a part of the microdots13of four microdot blocks10, fetched by the image sensor21. According to the Reflected Gray Codes shown inFIG. 3, it can be appreciated that, the coordinates of the microdot blocks10are respectively (G3X, G5Y), (G4X, G5Y), (G3X, G6Y) and (G4X, G6Y), wherein square microdots13are used to represent the digital bit “1” in the header region11of each microdot block10while the digital bits “1” and “0” are used to represent the coding of the date region12. It should be appreciated that, the vertical dash line V and the horizontal dash line H shown inFIG. 6aare only for illustratively indicating the region of every microdot blocks10, and the dash lines V and H will not be shown on the read-write medium3in actual implementation. In addition, for simplifying the drawing, the numerals of the microdot10, the header region11and the data region12are omitted inFIG. 6a.

During decoding, at first a processing unit (not shown) will recognize different regions to which every microdot groups belong according to the header region11of each microdot block10. For example inFIG. 6a, the image I includes four microdot groups A, B, C and D, and the microdot groups A and B belong to the Y-coordinate code and the microdot groups C and D belong to the X-coordinate code, wherein the microdot groups A and B refer to an afore-rearranged Y-coordinate code while the microdot groups C and D refer to an afore-rearranged X-coordinate code.

Next, please refer toFIG. 6b, it shows a schematic diagram of the decoding procedure performed by a processing unit according to the image I shown inFIG. 6a. In the X-coordinate code, positions of the microdot groups C and D are switched to generate an after-arranged X-coordinate code “00000110” that can be recognized as G4Xafter decoding. In the Y-coordinate code, positions of the microdot groups A and B are switched to generate an after-arranged Y-coordinate code “00000111” that will be recognized as G5Yafter decoding. Finally the current coordinate of the image I fetched by the scanning device20may be recognized as (4,5) on the microdot matrix M. In this manner, in the encoding and deciding method for a microdot matrix of the present invention, since the Reflected Gray Codes have a varying regularity, it is not necessary to use a storage device to record large amounts of information of the position codes. It is able to recognize the coordinate of the image fetched by the image sensor21of the scanning device20on the microdot matrix M only by using an algorithm. Furthermore, the decoding method for a microdot matrix of the present invention may also recognize a plurality of incomplete microdot blocks10and perform coordinate recognition.

In the illustrations ofFIGS. 6aand6b, the image sensor21fetches a quarter of the microdots13of four microdot blocks10to perform decoding. When the image sensor21fetches different numbers of microdots13from the data region12of different microdot blocks10, the aforementioned method also can be used to perform decoding. Please refer toFIG. 7a, it schematically shows that the image I shown inFIG. 6amoves a distance of one microdot13toward left-upper direction, and the image is referred as I′ herein. Similarly, the image I′ can be divided into four microdot groups A′, B′, C′ and D′ according to the header region11of each microdot block10. The microdot group A′ includes nine microdots13that are consisted of an X-coordinate microdot group AX′ and a Y-coordinate microdot group AY′. The microdot group B′ includes three microdots13that are consisted of an X-coordinate microdot group BX′ and a Y-coordinate microdot group BY′. The microdot group C′ includes three microdots13all belonging to Y-coordinate code. The microdot group D′ includes one microdot13belonging to Y-coordinate code.

Please refer toFIG. 7b, it shows a schematic diagram of the decoding procedure performed by a processing unit according to the image I′ shown inFIG. 7a. In the X-coordinate code, at first the microdot groups C′ and D′ are recognized to belong to the first row of the X-coordinate code according to the header region11of the microdot blocks10. Therefore, after recognition, the arrangement of the microdot groups A′, B′, C′ and D′ will be rearranged to become the one shown in the lower part ofFIG. 7b, i.e. the afore-arranged coordinate codes. Next, following the aforementioned method, positions of the microdot groups D′, BX′ and positions of the microdot groups C′, AX′ in the X-coordinate core are switched to generate an after-arranged X-coordinate code “00000010” that will be recognized as G3Xafter decoding. In the Y-coordinate code, a position of the microdot group BY′ and a position of the microdot group AY′ are switched to generate an after-arranged Y-coordinate code “00000111” that will be recognized as G5Xafter decoding. Finally, the current coordinate of the image I′ fetched by the image sensor20may be recognized as (3,5) on the microdot matrix M. In addition, if the image sensor21fetches four different microdot groups, the above method still can be used to perform decoding process.

In another embodiment, the image sensor21may only fetch two vertically adjacent microdot blocks10and at this moment the coordinate can be recognized directly according to the X-coordinate code and the Y-coordinate code. For example, please refer toFIG. 8a, it shows a schematic diagram of an image I″ fetched by the image sensor21, wherein the image I″ includes a microdot group A″ and a microdot group C″. According to the header region11of every microdot blocks10fetched, it is able to recognize that the microdot group A″ includes an X-coordinate microdot group AX″ and a Y-coordinate microdot group AY″. According to the header region11of every microdot blocks10fetched, it is able to recognize that the microdot group C″ belongs to the first row of the X-coordinate code, and thus the image I″ includes a complete X-coordinate code that is consisted of the microdot groups C″ and AX″. In this manner, the X-coordinate code can be rearranged as “00000010” that will be recognized as G3Xafter decoding. Similarly, since the image I″ includes a complete Y-coordinate code, i.e. the microdot group AY″, the Y-coordinate code can be directly rearranged as “00000111” that that will be recognized as G5Yafter decoding.

In another embodiment, the image sensor21may only fetch two horizontally adjacent microdot blocks10. At this moment, the XY coordinates also can be obtained by using similar method.

Please refer toFIG. 8b, in another embodiment the image sensor21fetches an image I′″ that includes a microdot group A′″ and a microdot group C′″. At this moment, since the image I′″ includes a complete X-coordinate code, i.e. the microdot group A′″, and a complete Y-coordinate code, i.e. the microdot group C′″, it is able to directly recognize that the X-coordinate code is G3Xand the Y-coordinate code is G5Y.

Furthermore, in order to increase the accuracy of position recognition, in the encoding and decoding method for a microdot matrix of the present invention, three scales may further be divided between two adjacent microdot coordinates on the microdot matrix M according to a distance between the center of the image I and the coordinate of the microdot matrix M to which the image I belongs. The defining method will be explained according toFIG. 9, which shows a schematic diagram of the images of different position codes13fetched by the image sensor21. For simplification, the explanation will be made only in the X direction and the division method in the Y direction is similar to that in the X direction. InFIG. 9, it is assumed that the center of the microdot block10with a coordinate (3,5) is P(3,5) and the center of the microdot block10with a coordinate (4,5) is P(4,5). When the image sensor21fetches an image I1, the X-coordinate code can be rearranged according to the above method as “00000010”, and thus the coordinate of the image I1is recognized as (3,5). At this moment, a coordinate scale may be determined according to a distance between the center C1of the image I1and the point P(3,5). When the image sensor21fetches an image I2, the X-coordinate code can be rearranged according to the above method as “00000110”, and thus the coordinate of the image I1is recognized as (4,5). At this moment, another coordinate scale may be determined according to a distance between the center C2of the image I2and the point P(4,5). When the image sensor21fetches an image I3, the X-coordinate code can be rearranged according to the above method as “00000110”, and thus the coordinate of the image I3is recognized as (4,5). At this moment, another coordinate scale can further be determined according to a distance between the center C3of the image I3and the point P(4,5). In this manner, the accuracy of position recognition during decoding can be increased.

Please refer toFIG. 10, it shows a flow chart of the decoding method for a microdot matrix according to an embodiment of the present invention including the steps of: scanning the microdot matrix to fetch an image (Step S1); recognizing whether the image contains a complete direction coordinate code (Step S2); if yes, determining a coordinate of the image on the microdot matrix by decoding the direction coordinate code (Step S3); if not, dividing the image into a plurality of microdot groups according to the header region of each microdot block (Step S4); forming the microdot groups belonging to identical direction coordinate code in two adjacent columns as an afore-arranged coordinate code according to the header region of each microdot block (step S5); switching positions of the microdot groups belonging to different microdot blocks in the afore-arranged coordinate code to form an after-arranged coordinate code (step S6); and determining a coordinate of the image on the microdot matrix according to the after-arranged coordinate code (step S7); wherein the step S7further includes: determining a plurality of coordinate scales between two adjacent microdot blocks according to a distance between a center of the image and the coordinate determined.

The present invention further provides an encoding and decoding method for a microdot matrix. Please refer toFIGS. 11aand11b, the microdot matrix M′ in accordance with another embodiment of the present invention also includes a plurality of microdot blocks10arranged as a matrix on a read/write medium3. Each microdot block10also includes a header region11and a data region12. The data region also includes an X-coordinate code GnX′and a Y-coordinate code GmY′. The difference between this embodiment and the previous embodiment is that, in this embodiment the microdots13corresponding to lower order bits of the Reflected Gray Codes in the X-coordinate code GnX′are formed as the outmost microdots along the X-coordinate axis of the X-coordinate code GnX′, i.e. the leftmost or the rightmost positions in the figure; and the microdots13corresponding to lower order bits of the Reflected Gray Codes in the Y-coordinate code GmY′are formed as the outmost microdots along the Y-coordinate axis of the Y-coordinate code GmY′, i.e. the uppermost or the lowermost positions in the figure, as shown inFIG. 11b. The reason to form the microdots13in this way is that the change frequency of lower order bits in the Reflected Gray Codes (i.e. changing from “0” to “1” or from “1” to “0”) is much higher than that of higher order bits. In order to lower the position ambiguity during decoding, in the present embodiment the lower order bits having higher change frequency are formed as the outmost microdots along the X-coordinate axis in the X-coordinate code or along the Y-coordinate axis in the Y-coordinate code. Therefore, when the image sensor21fetches a partial image of a microdot block10, the lower order bits of an X-coordinate code or a Y-coordinate code can be fetched. During decoding, the position coordinate of the image is determined as the X-coordinate code or the Y-coordinate code to which the microdot groups including lower order bits of the Reflected Gray Codes belong.

For example inFIG. 12, the image sensor21fetches an image I′ including the microdot groups A′, B′, C′ and D′, wherein in the X-coordinate codes x0˜x7, since the microdot group B′ includes lower order bits x0˜x2of the Reflected Gray Codes, the X-coordinate of the image I′ will be recognized as belonging to the microdot block10in the right column; in the Y-coordinate codes y0˜y7, since the microdot group A′ includes lower order bits y0˜y3of the Reflected Gray Codes, the Y-coordinate of the image I′ will be recognized as belonging to the microdot block10in the upper row. In this embodiment, at last the coordinate of the image I′ is recognized as belonging to the right-upper microdot block10. In addition, in the decoding method for a microdot matrix in accordance with the present invention, a plurality of coordinate scales may be divided between two adjacent microdot blocks, as shown inFIG. 10, according to a distance between the center of the image and the coordinate to which the image belongs, and the division method was illustrated above and details will not be repeated herein.

Therefore, the decoding method for a microdot matrix in accordance with an alternative embodiment of the present invention as shown inFIG. 13including the steps of: scanning the microdot matrix to fetch an image (Step S1); recognizing whether the image contains a complete direction coordinate code (Step S2); if yes, determining a coordinate of the image on the microdot matrix by decoding the direction coordinate code (Step S3); if not, dividing the image into a plurality of microdot groups according to the header region of each microdot block (Step S4); and using the direction coordinate code of the microdot block to which the microdot group containing lower order bits of the Reflected Gray Codes belongs as a coordinate of the image on the microdot matrix (Step S8); wherein the Step S8further includes: determining a plurality of position scales between two adjacent microdot blocks according to a distance between a center of the image and the coordinate determined. In another embodiment, in order to correct the decoded coordinate, the decoding method for a microdot matrix of the present invention further includes the step of: correcting the direction coordinate code by using the balancing microdot.

In addition, although the directions of a two-dimensional axis of the images I and I′ fetched by the image sensor21are consistent with that of the microdot matrices M and M′ in the above embodiments, the decoding process still can be performed by using the above decoding method for a microdot matrix of the present invention when an angle included between two-dimensional axes of the images I, I′ and two-dimensional axes of the microdot matrices M, M′ is larger than 0 degree and smaller than 180 degree. The decoding methods were illustrated above and details will not be repeated herein.

In addition, in this embodiment the distribution of the microdots13in the data region12is not limited toFIG. 10b. In the X-coordinate codes, the microdots13corresponding to lower order bits of the Reflected Gray Codes are formed as the outmost microdots along the X direction and the microdots13corresponding to higher order bits of the Reflected Gray Codes may be formed arbitrarily in the X-coordinate codes. In the Y-coordinate codes, the microdots13corresponding to lower order bits of the Reflected Gray Codes are formed as the outmost microdots along the Y direction and the microdots13corresponding to higher order bits of the Reflected Gray Codes may be disposed arbitrarily in the Y-coordinate codes. For example as shown inFIGS. 14a˜14c, a direction of the X-coordinate axis is defined in the left-right direction in the figure and a direction of the Y-coordinate axis is defined in the up-down direction in the figure. However, the coordinate axes may be defined according to different embodiments in actual implementation. The microdots13are formed as a matrix in the X-coordinate code region and the Y-coordinate code region.

As mentioned above, as the image fetched by the image sensor of a conventional handwriting recognition system has to contain a complete position code, a larger sensor array is required and the system needs a storage device to record all position codes. Therefore, the conventional handwriting recognition system has higher system cost. The present invention encodes and decodes a microdot matrix by using the Reflected Gray Codes and the decoding of the microdot matrix can be performed according to the fixed varying regularity of the Reflected Gray Codes so as to reduce the system cost. In addition, the encoding and decoding method for a microdot matrix of the present invention can further divide finer coordinate scales according to a distance between the center of the fetched image and the coordinate of the image so as to increase the position accuracy during decoding process.

Although the invention has been explained in relation to its preferred embodiment, it is not used to limit the invention. It is to be understood that many other possible modifications and variations can be made by those skilled in the art without departing from the spirit and scope of the invention as hereinafter claimed.