1. Field of the Invention
The present invention relates to the configuration of two-dimensional code which can be detected from an image, and to a method and device for detecting two-dimensional code from an image.
2. Description of the Related Art
A two-dimensional code, in which a two-dimensional region is sectioned according to a certain rule and information is expressed by the brightness/darkness of each of the section regions, is known. Normally, such code is captured with a camera, the two-dimensional code is distinguished and detected from the background, and information is read out based on the brightness of each sectioned region appropriated therein. Various forms of two-dimensional code are known as conventional art, and the two-dimensional code shown in FIGS. 9 and 10 is a type thereof. This two-dimensional code will hereafter be referred to as “two-dimensional code 1”.
The two-dimensional code has an external shape of a square which is darker than a bright background, and the interior thereof starting from a predetermined spacing from the frame is divided into small squares, thus expressing bits by the brightness/darkness of the squares.
Also, in the field of mixed reality wherein a virtual space is displayed so as to be merged with real space, square markers disposed in the real space are used as a way to estimate the position and orientation of cameras in the real space. The demand for positioning multiple square markers in real space has brought about a proposal for square markers each of which have individual ID information within the square so as to enable each square to be identified uniquely. Examples of the method disclosed in X. Zhang, S. Fronz, N. Navab: “Visual Marker Detection and Decoding in AR systems: A Comparative Study,” Proc. of International Symposium on Mixed and Augmented Reality (ISMAR' 02) 2002 (hereinafter “Zhang et al.”) include the marker 1 shown in FIG. 12 and the marker 2 shown in FIG. 13.
The marker 1 is of a configuration wherein a large square of which the interior is sectioned into small squares, and several small squares along one side of the large square, are arranged. The structure of the interior of the large square is the same as that of the two-dimensional code 1 in the above-described related art, the interior being equally divided into small squares with a certain spacing between the outer frame of the square and the interior thereof. Bits can be represented by the brightness/darkness of each in the squares on the interior. The marker 1 also has a region of small squares on the outside of the large square, which is used for determining the reference side of the square, that is to say the direction of rotation of the square. Also, in addition to the direction of rotation, other types of information can be represented by the relative position between the small squares positioned outside as to the large square, and the number thereof.
The marker 2 is the same as described in Zhang et al. and the two-dimensional code 1 and marker 1 described above regarding the fact that the shape is a square which is darker than a bright background. The point that differs is the shape of the regions for assigning bits within the square; with this marker, circular regions are used. However, the fact remains that regions are appropriated as to the interior region of a square, with a certain spacing between the outer frame of the square and the interior thereof, albeit circles.
The two-dimensional code 1, marker 1, and marker 2, described as related art, are each based on the same technique of having an external shape of a square which is darker than a bright background, and the interior thereof starting from a predetermined spacing from the frame is equally divided into sections, thus expressing bits by the brightness/darkness of the sectioned regions.
Now, the predetermined spacing between the square which is the outer shape, and the interior region thereof, is set so as to be the same as or larger than the size of each of the sectioned regions into which the interior has been sectioned for the purpose of carrying information. The case of the two-dimensional code 1, for example, will be described with reference to FIG. 11. The symbol d1 in FIG. 11 represents the spacing provided between the outer shape square and the interior bit region. On the other hand, d2 represents the length of one side of each of the interior bit squares. As can be understood from this drawing, d1 is set so as to be longer than d2. Also, the marker 1 will be described in the same way with reference to FIG. 14. As with the case above, d1 in FIG. 14 represents the spacing provided between the outer shape square and the interior bit region, and d2 represents the length of one side of each of the interior bit squares. In the case of the marker 1, d1 and d2 are equal. Hereinafter, the two-dimensional code 1, marker 1, and marker 2 will be collectively referred to as “two-dimensional code”.
As can be understood so far, with the two-dimensional code of the related art, the relationship between the spacing d1 between the outer shape square and the interior bit region, and the length d2 of one side of each of the interior bit squares, is d1≧d2.
With the two-dimensional code of the related art, there is a discrepancy between the minimum size of the two-dimensional code at which the outer shape can be recognized, and the minimum size of the two-dimensional code at which the inner bit region can be read. That is to say, the sizes d1 and d2 have not been optimized.
Accordingly, there has been the problem that while the square outer shape of the two-dimensional code can be recognized, the interior bits could not be read out with a high degree of accuracy. From the opposite perspective, with the minimum size at which the interior bits can be read out, the space between the outer frame and the interior region that is necessary for recognizing the outer shape is excessively great, meaning that the area of the two-dimensional code in the image is too great.