The present invention relates to a medium recognition device that recognizes information on a rectangular medium and a method of recognizing a medium.
A well-known technique using a digital image for detecting and recognizing a straight line or a predetermined geometric shape defined by straight lines on a rectangular medium that serves as a processing target is the Hough transform, which is widely used in various industrial fields.
This method typically includes the steps of performing pre-processing, such as denoising and edge enhancement, on an image including a recognition target graphic, performing Hough transform on the extracted image pattern to obtain cumulative points, and then performing inverse Hough transform on the cumulative point having the maximum cumulative frequency, to determine a straight line in the image space (for example, refer to PTLs 1 and 2).
In the technique described in PTL 1, which detects the positional coordinates of a work positioned during a production process of a semiconductor device using Hough transform to correct the position, the maximum cumulative point is determined, unwanted patterns are eliminated, and then the straight line that serves as a reference is determined by inverse Hough transform, to achieve angle correction of the work.
In the technique described in PTL 2, Hough transform is used for calculating the shape feature of a polygonal shape to estimate a line segment constituting a portion of the periphery of an object. The number of points transformed to polar coordinates is counted, and the polar coordinates having high frequency are selected. The equation of a straight line is calculated by inverse Hough transform for each of the selected polar coordinates, and the rotation angle is detected.
[Patent Literature 1] Japanese Unexamined Patent Application Publication No. H11-97512
[Patent Literature 2] Japanese Unexamined Patent Application Publication No. 2010-79643
However, the techniques described in PTLs 1 and 2 determine the maximum cumulative point in the Hough space. Determining the maximum cumulative point in the Hough space in this way is determining the local maximum point in a two-dimensional space. This is usually difficult and the computational load is great because noise caused by unwanted patterns must be eliminated. Thus, high-speed processing requires the use of a high-performance processor. This causes the problem of increased cost.
Thus, in light to the problem described above, the present invention provides a medium recognition device and a method of recognizing a medium that can reduce the computational load.
To solve the above-described issues, a medium recognition device according to the present invention detects, in a digital image, a rotation angle on an image of a rectangular medium, refers to the detected rotation angle, and recognizes information on the rectangular medium, and the medium recognition device is characterized to include a projection generator generating a projection of a pixel value by luminance projection to each of a horizontal axis and a vertical axis of a target image; an end-point detector determining two end points of a projection pattern of a projection waveform for each of the projections to the horizontal axis and the vertical axis; an evaluated-value acquirer determining the distance between the two end points of the projection pattern of the projection waveform associated with the horizontal axis and the distance between the two end points of the projection pattern of the projection waveform associated with the vertical axis, and acquiring a predetermined evaluated value in association with data on the distances and a width and a height of the rectangular medium; and a rotation-angle determiner determining a rotation angle of the rectangular medium based on the evaluated value from the evaluated-value acquirer.
The present invention includes an end-point detector determining two end points of a projection pattern of a projection waveform for each of the projections to the horizontal axis and the vertical axis; an evaluated-value acquirer determining the distance between the two end points of the projection pattern of the projection waveform associated with the horizontal axis and the distance between the two end points of the projection pattern of the projection waveform associated with the vertical axis, and acquiring a predetermined evaluated value in association with data on the distances and a width and a height of the rectangular medium; and a rotation-angle determiner determining a rotation angle of the rectangular medium based on the evaluated value from the evaluated-value acquirer; and determines the rotation angle of the rectangular medium based on the evaluated value associated with the data on the distances of the projection waveform patterns and the width and height of the rectangular medium. Thus, unlike the past, the Hough transform is not used, and the computational load can be reduced. In other words, unlike the past, the local maximum does not have to be analytically extracted from a Hough transform matrix.
According to the present invention, it is preferred that the rotation-angle determiner retrieves an angle corresponding to an evaluated value from a preset reference table based on the evaluated value from the evaluated-value acquirer and determines the result to be the rotation angle of the rectangular medium.
With such a configuration, since the angle corresponding to the evaluated value is retrieved from the preset reference table, and the rotation angle of the rectangular medium is determined, the computational load can be reduced even more.
According to the present invention, it is preferred that the evaluated-value acquirer determines an evaluated value corresponding to the difference between a first value based on the width of the rectangular medium and the distance between the two end points of the projection pattern of the projection waveform associated with the horizontal axis and a second value based on the height of the rectangular medium and the distance between the two end points between the projection pattern of the projection waveform associated with the vertical axis.
With such a configuration, the evaluated value can be acquired with high precision.
According to the present invention, it is preferred that the evaluated-value acquirer determines a rotation angle in accordance with a ratio of a first evaluated value corresponding to the difference between a first value based on the width the rectangular medium and the distance between the two end points of the projection pattern of the projection waveform associated with the horizontal axis and a second value based on the height of the rectangular medium and the distance between the two end points of the projection pattern of the projection waveform associated with the vertical axis to a second evaluated value corresponding to the difference between a third value based on the height of the recognition target medium and the distance between the two end points of the projection pattern of the projection waveform associated with the horizontal axis and a fourth value based on the width of the recognition target medium and the distance between the two end points of the projection pattern of the projection waveform associated with the vertical axis, and the rotation-angle determiner determines a rotation angle of the medium to be the rotation angle determined based on the evaluated value by the evaluated-value acquirer.
With such a configuration, although the computational load is slightly high, the actual rotation angle can be acquired at high precision.
A method of processing an image according to the present invention, detects, in a digital image, a rotation angle on an image of a rectangular medium, and the method of processing an image is characterized to include a projection generating step comprising generating a projection of a pixel value by luminance projection to each of a horizontal axis and a vertical axis of a target image; an end-point detecting step determining two end points of a projection pattern of a projection waveform for each of the projections to the horizontal axis and the vertical axis; an evaluated value acquiring step determining the distance between the two end points of the projection pattern of the projection waveform associated with the horizontal axis and the distance between the two end points of the projection pattern of the projection waveform associated with the vertical axis, and acquiring a predetermined evaluated value in association with data on the distances and a width and a height of a recognition target medium; and a rotation angle determining step determining a rotation angle of the rectangular medium based on the evaluated value determined in the evaluated value acquiring step.
The present invention includes an end point detecting step determining two end points of a projection pattern of a projection waveform for each of the projections to the horizontal axis and the vertical axis; an evaluated value acquiring step determining the distance between the two end points of the projection pattern of the projection waveform associated with the horizontal axis and the distance between the two end points of the projection pattern of the projection waveform associated with the vertical axis, and acquiring a predetermined evaluated value in association with data on the distances and a width and a height of the rectangular medium; and a rotation angle determining step determining a rotation angle of the rectangular medium based on the evaluated value determined in the evaluated value acquiring step; and determines the rotation angle of the rectangular medium based on the evaluated value associated with the data on the distances of the projection waveform patterns and the width and height of the rectangular medium. Thus, unlike the past, the Hough transform is not used, and the computational load can be reduced. In other words, unlike the past, the local maximum does not have to be analytically extracted from a Hough transform matrix.
According to the present invention, it is preferred that the rotation angle determining step retrieves an angle corresponding to the evaluated value from a preset reference table based on the evaluated value in the evaluated value acquiring step and determines the result as the rotation angle of the rectangular medium.
With such a configuration, since the angle corresponding to the evaluated value is retrieved from the preset reference table, and the rotation angle of the rectangular medium is determined, the computational load can be reduced even more.
According to the present invention, it is preferred that the evaluated value acquiring step determines an evaluated value corresponding to the difference between a first value based on the width of the rectangular medium and the distance between the two end points of the projection pattern of the projection waveform associated with the horizontal axis and a second value based on the height of the rectangular medium and the distance between the two end points between the projection pattern of the projection waveform associated with the vertical axis.
With such a configuration, the evaluated value can be acquired with high precision.
According to the present invention, it is preferred that the evaluated value acquiring step determines a rotation angle in accordance with a ratio of a first evaluated value corresponding to the difference between a first value based on the width the rectangular medium and the distance between the two end points of the projection pattern of the projection waveform associated with the horizontal axis and a second value based on the height of the rectangular medium and the distance between the two end points of the projection pattern of the projection waveform associated with the vertical axis to a second evaluated value corresponding to the difference between a third value based on the height of the rectangular medium and the distance between the two end points of the projection pattern of the projection waveform associated with the horizontal axis and a fourth value based on the width of the rectangular medium and the distance between the two end points of the projection pattern of the projection waveform associated with the vertical axis, and the rotation angle determining step determines a rotation angle of the rectangular medium to be the rotation angle determined based on the evaluated value determined in the evaluated value acquiring step.
With such a configuration, although the computational load is slightly high, the actual rotation angle can be acquired at high precision.
According to the present invention, the medium recognition device and the method of recognizing a medium determine the rotation angle of a rectangular medium on the basis of an evaluated value associated with distance data of projection waveform patterns and the width and height of the rectangular medium. Thus, unlike the past, the Hough transform is not used, and the computational load can be reduced.
Embodiments of the present invention will now be described with reference to the drawings.
A medium recognition device 10 according to this embodiment detects, in a digital image, the rotation angle on an image of a rectangular medium 100, refers to the detected rotation angle, and recognizes information 110, such as characters or a barcode recorded on the rectangular medium 100.
The rectangular medium 100 is a typical card in accordance with JIS (hereinafter, referred to as “card”). The card 100 has a rectangular shape (a rectangle having a long side and a short side) and is, for example, a plastic card having a width (a) of 126 mm, a height (b) of 80 mm, and a thickness of 0.76 mm. Note that the rectangular medium is not limited to the card described above, and alternatively, may be a plastic card having, for example, a width of 86 mm, a height of 54 mm, and a thickness of 0.76 mm. Additionally, the medium is not limited to a card and alternatively may be an ID card, a passport book, or a driver's license. Note that in this embodiment, the width direction of the card 100 is X axis direction in
As illustrated in
The image reader 30 includes a solid-state image device (image sensor) using a photoelectric transducer that detects light and generates electric charges or a charge coupled device (CCD) image sensor, and an optical system (such as lenses) that guides incident light onto pixels regions of the image sensor (forms an image of an object). The image reader 30 is placed over the table 20 and captures a predetermined region including the entire card 100 irradiated with an illuminating light source 31. Note that the solid-state image device (image sensor) may be a complementary metal oxide semiconductor (CMOS) image sensor.
The A/D converter 40 converts the image including the card 100 captured by the image reader 30 to digital image data and stores the converted data to the image memory 50. Note that the function of the A/D converter 40 can be included in the image reader 30.
The image memory 50 records (stores) the image data of the digitized card 100 including the information 110, such as the OCR character string, captured by the image reader 30. The original image stored in the image memory 50 includes multiple pixels in the form of a matrix, more specifically, includes M rows of pixels in the X axis direction and N columns in the Y axis direction, although not illustrated. Each pixel has a pixel value (luminance value). In this embodiment, each pixel value is, for example, a value within the range of 0 to 255 in 8 bits. The closer to the black the pixel value gets, the smaller value it has. The closer to the white the pixel value gets, the larger value it has. Note that the image memory 50 may be any memory that can store image data, such as a RAM, an SDRAM, a DDRSDRAM, or a RDRAM.
The data processor 60 has a function of detecting, in a digital image, the rotation angle on an image of the card 100, referring to the detected rotation angle, and recognizing the information 110, such as characters or a barcode, recorded on the card 100. The data processor constitutes a portion of a CPU and other components that comprehensively control the image processor 10.
[Configuration and Function of Each Component of Data Processor 60]
The basic configuration and function of each Component of the data processor 60 will now be described.
The data processor 60 retrieves a multi-level image data (a gray-scaled image of multiple tones, e.g., 256 tones) from the image memory 50.
The data processor 60 includes an edge enhancer 610, a digitizer 620, a projection generator 630, an end-point detector 640, an evaluated-value acquirer 650, a rotation-angle determiner 660, an information recognizer 670, and an angle reference table RTBL.
Here, the process of detecting the rotation angle and the process of recognizing the information on the card 100 will be described as an example while taking the rectangle drawn on an image space, as illustrated in
Based on the above, the edge enhancer 610 performs edge enhancement to the 256-tone gray-scaled image data retrieved from the image memory 50, and the corresponding image is output to the digitizer 620.
The digitizer 620 performs digitization to the 256-tone gray-scaled image data retrieved from the image memory 50 and edge enhanced, and the corresponding image information is sent to, for example, the end-point detector 640. The digitizer 620 determines a threshold value through an appropriate method and converts the original multi-level gray-scaled image to a monochrome digital image.
The projection generator 630 generates a first projection prjX and a second projection prjY of a pixel value by luminance projection to the horizontal axis (X axis) and the vertical axis (Y axis) of the image IMG, as illustrated in
Here, the first projection prjX is derived by determining the average of the luminance value of each line in the direction orthogonal to the X axis. The second projection prjY is derived by determining the average of the luminance value of each line in the direction orthogonal to the Y axis.
In this embodiment, the first projection prjX has two points Xi on the left and right at which the output starts to increase: end points X1 (=30) and X2 (=184). The first projection prjX has a trapezoidal shape (trapezoidal pattern). The second projection prjY has two points Yi on the top and bottom at which the output starts to increase: end points Y1 (=20) and Y2 (=143). The second projection prjY has a trapezoidal shape (trapezoidal pattern).
The end-point detector 640 determines the two end points of the projection pattern of the projection waveform (projection profile) for each of the first projection prjX to the X axis (horizontal axis) and the second projection prjY to the Y axis (vertical axis). In this embodiment, the end-point detector 640 determines the two end points X1 (=30) and X2 (=184) for the first projection prjX, and the two end points Y1 (=20) and Y2 (=143) for the second projection prjY.
The evaluated-value acquirer 650 determines the distance W (=X2-X1) between the two end points X1 and X2 of the projection pattern of the projection waveform of the first projection prjX associated with the X axis (horizontal axis), and the distance H (Y2-Y1) between the two end points Y1 and Y2 of the projection pattern of the projection waveform of the second projection prjY associated with the Y axis (vertical axis), and acquires a predetermined evaluated value in association with the distance data W and H and the width a and height b of the recognition target medium 100.
The evaluated-value acquirer 650 determines an evaluated value corresponding to the difference (a·W−b·H) between a first value (a·W) based on the width a of the card 100 and the distance W between the two end points X1 and X2 of the projection pattern of the projection waveform of the first projection prjX associated with the X axis (horizontal axis) and a second value (b·H) based on the height b of the card 100 and the distance H between the two end points Y1 and Y2 of the projection pattern of the projection waveform of the second projection prjY associated with the Y axis (vertical axis). The evaluated-value acquirer 650 supplies the acquired evaluated value to the rotation-angle determiner 660.
The rotation-angle determiner 660 determines the rotation angle v(θ) of the card 100 on the basis of the evaluated value from the evaluated-value acquirer 650. The rotation-angle determiner 660 retrieves an angle corresponding to the evaluated value from the preset angle reference table RTBL on the basis of the evaluated value from the evaluated-value acquirer 650 and determines the result as the rotation angle of the card 100.
The information recognizer 670 refers to the rotation angle v(θ) determined by the rotation-angle determiner 660 and performs a recognition process of the information 110 on the card 100. For example, the information recognizer 670 corrects (adjusts) the tilt on an image of the information recording region 120 of the card 100 of the image data of
In such character recognition, separation positions between characters in a character string in the captured image are searched, and the characters are recognized.
The information recognizer 670 determines the character separation positions, for example, on the basis of a digital threshold value. After the character clipping ends, the circumscribed rectangular region (the coordinates of the top, bottom, left, and right) of characters that are the target of recognition are determined. Then, through characteristic extraction, the above-described circumscribed rectangular region is divided into a predetermined number of sub-regions, for example, one circumscribed rectangular region is divided into 5×5 regions, each of which is a sub-region. For each sub-region, the percentage of the number of black pixels to total number of pixels in the sub-region is determined, and a character vector having the percentage as a vector element is generated. Next, the determined character vector and the reference character vectors preliminarily determined for all characters used in the recording medium are compared, and the character corresponding to the vector having the highest similarity (for example, a normalized correlation coefficient) is set as a candidate character. Note that the reference character vectors are preliminarily stored, and when characteristics are compared, data on a character having high similarity is retrieved from the storage unit for characteristic comparison. Then, basically, the candidate character set through the characteristic comparison is recognized as the character used on the recording medium.
Here, the process carried out by the data processor 60 according to the first embodiment will be described with reference to
In the data processor 60, the 256-tone gray-scaled image data retrieved from the image memory 50 is subjected to edge enhancement at the end-point detector 640 (step ST1); the 256-tone gray-scaled image data retrieved from the image memory 50 and edge enhanced is digitized at the digitizer 620 (step ST2); and then the image information is sent to the end-point detector 640.
Next, the projection generator 630 generates the first projection prjX and the second projection prjY of a pixel value by luminance projection to the X axis (horizontal axis) and the Y axis (vertical axis) of the target image IMG, as illustrated in
The end-point detector 640 detects the two end points of the projection pattern of the projection waveform (projection profile) for each of the first projection prjX to the X axis (horizontal axis) and the second projection prjY to the Y axis (vertical axis) (step ST4). Points Xi at which the output value starts to increase are determined in the first projection prjX. As illustrated in
The evaluated-value acquirer 650 determines the distance W (=X2-X1) between the two end points X1 and X2 of the projection pattern of the projection waveform of the first projection prjX associated with the X axis (horizontal axis), and the distance H (Y2-Y1) between the two end points Y1 and Y2 of the projection pattern of the projection waveform of the second projection prjY associated with the Y axis (vertical axis), and acquires a predetermined evaluated value in association with the distance data W and H and the width a and height b of the card 100 (step ST5).
The evaluated-value acquirer 650 determines an evaluated value corresponding to the difference (a·W−b·H) between a first value (a·W) based on the width a of the card 100 and the distance W between the two end points X1 and X2 of the projection pattern of the projection waveform of the first projection prjX associated with the X axis (horizontal axis) and a second value (b·H) based on the height b of the recognition target medium 100 and the distance H between the two end points Y1 and Y2 of the projection pattern of the projection waveform of the second projection prjY associated with the Y axis (vertical axis).
The rotation-angle determiner 660 determines the rotation angle v(θ) of the card 100 on the basis of the evaluated value from the evaluated-value acquirer 650. The rotation-angle determiner 660 retrieves the angle corresponding to the evaluated value from the pre-set reference table RTBL on the basis of the evaluated value from the evaluated-value acquirer 650 (step ST6) and determines the result as the rotation angle of the medium (step ST7).
The evaluated-value acquirer 650 defines the length of the long side of the rectangle in the image as a and the length of the short side as b, as in
[Equations I]
W=X2−X1 (1)
H=Y2−Y1 (2)
from which the following equations are derived from a geometric view.
[Equations II]
W=a cos θ+b sin θ (3)
H=b cos θ+a sin θ (4)
Equations (3) and (4) are modified to obtain the following equation.
[Equation III]
(a2−b2)cos θ=aW−bH (5)
Thus, angle θ is determined from the following equation.
The following equation is derived from equations (3) and (4).
(a2−b2)sin θ=aH−bW [Equation V]
Thus, the angle θ can also be determined from the following equation.
Here, a=126, b=80, W=184−30=154, and H=143−20=123 are substituted into equation (7) to obtain θ=18.4.
The angle can be determined arithmetically by equation (7) or (6). However, in the first embodiment, the following angle determination process is carried out in consideration of installment to equipment because the calculation for tan-1 is high cost.
By substituting v(θ) into the left side of the equation (5), and calculating v(θ), which is a function of θ, at 10-degree increments, a numerical list, such as that below, is prepared and stored in the memory as the angle reference table RTBL.
Substituting the actual values of W and H into the right side of equation (5) derives:
aW−bH=8956
This value approximates v(20). Thus, the rotation angle is θ=20°. In other words, v(10)=(a2−b2)cos 10°=(1262−802)*0.98=9332. Thus, the determined value 8956 is closer to v(20)=8907 than v(10)=9332.
Since the performance of CPUs has dramatically improved, the rotation angle may be directly determined from cos-1. However, the method described above is an effective alternative when there are restrictions on the implementation condition.
Then, the information recognizer 670 refers to the rotation angle v(θ) determined by the rotation-angle determiner 660 and performs recognition of the information 110 on the card 100 (step ST8). For example, the information recognizer 670 corrects the tilt on an image of the information recording region 120 of the card 100 of the image data of
In this way, the data processor 60 includes a projection generator 630 that generates projections of a pixel value by luminance projection to the X axis (horizontal axis) and the vertical axis of a target image when detecting, in a digital image, the rotation angle on an image of a card 100; an end-point detector 640 that determines two end points of a trapezoidal pattern of a projection waveform of each of the projection to the X axis (horizontal axis) and the projection to the Y axis (vertical axis); an evaluated-value acquirer 650 that determines the distance W between the two end points of the trapezoidal pattern of the projection waveform associated with the X axis (horizontal axis) and the distance H of the two end points of the trapezoidal pattern associated with the Y axis (vertical axis) and acquires a predetermined evaluated value using the data on the distances and the width and height of the target medium; and a rotation-angle determiner 660 that retrieves an angle corresponding to the evaluated value from a preset reference table RTBL using the evaluated value as a key and determines the result as the rotation angle of the card 100. With such a configuration, the rotation angle of a card can be detected at a low cost with a computational load lower than that in the past, without using Hough transform for analytically extracting local maximums from a Hough transform matrix.
[Comprehensive Operation of Medium Recognition Device 10]
The comprehensive operation of the medium recognition device 10 according to the first embodiment will now be described with reference to
First, the card 100 is placed on the table 20 (step ST11).
In this state, the image reader 30 captures a predetermined region including the entire card 100 irradiated with the illuminating light source 31 (step ST12). Then, the A/D converter 40 converts the image including the card 100 captured by the image reader 30 to digital image data and stores the converted data to the image memory 50 (step ST13).
Then, the data processor 60 uses the digital image stored in the image memory 50 to detect the rotation angle on an image of the card 100 (step ST14).
The detection of the rotation angle is performed mainly through the following steps.
First, luminance projection is performed on the X axis (horizontal axis) and the Y axis (vertical axis) of the target image to form projections (projection generating step). Next, the two end points of each of the projection to the X axis (horizontal axis) and the projection to the vertical axis is determined (end point detecting step). Further, the distance W between the two end points associated with the X axis (horizontal axis) and the distance H between the two end points associated with the Y axis (vertical axis) are determined, and a predetermined evaluated value is acquired (calculated) using the data on the distances and the width and height of a predetermined target medium (evaluated value acquiring step). Finally, an angle corresponding to the evaluated value is retrieved from a preset reference table RTBL using the evaluated value as a key, and the result is determined to be the rotation angle of the medium (angle determining step).
Then, the data processor 60 refers to the detected rotation angle and recognizes the information 110, such as characters or a barcode, recorded on the card 100 (step ST15).
(Main Advantageous Effects of This Embodiment)
As described above, instead of analytically an extracting local maximum from a Hough transform matrix when detecting in a digital image, the rotation angle on an image of a card 100 that serves as a rectangular medium, the medium recognition device 10 includes a projection generator 630 that generates projections of a pixel value by luminance projection to the X axis (horizontal axis) and the Y axis (vertical axis) of a target image; an end-point detector 640 that determines two end points of a trapezoidal pattern of a projection waveform of each of the projection to the X axis (horizontal axis) and the projection to the Y axis (vertical axis); an evaluated-value acquirer 650 that determines the distance W between the two end points of the trapezoidal pattern of the projection waveform associated with the X axis (horizontal axis) and the distance H between the two end points of the trapezoidal pattern associated with the Y axis (vertical axis) and acquires a predetermined evaluated value using the data on the distances and the width and height of the card 100; and a rotation-angle determiner 660 that retrieves an angle corresponding to the evaluated value from a preset reference table RTBL using the evaluated value as a key and determines the result to be the rotation angle of the card 100.
Thus, the medium recognition device 10 can achieve the following advantageous effects.
The medium recognition device 10 can detect the rotation angle of the card 100 with a computational load lower than that in the past, without performing analytical extraction of a local maximum from a Hough transform matrix through Hough transform. In other words, the image processor 10 can detect the rotation angle of the card 100 in a shorter time with a cost lower than those in the past, without performing analytical extraction of a local maximum from a Hough transform matrix through Hough transform.
The rotation-angle determiner 660 retrieves an angle corresponding to the evaluated value from the preset reference table on the basis of the evaluated value from the evaluated-value acquirer 650 and determines the result to be the rotation angle of the card 100. This can further reduce the computational load. In other words, the computational load can be reduced, and an inexpensive processing system can be provided.
The evaluated-value acquirer 650 determines an evaluated value corresponding to the difference (a·W−b·H) between a first value (a·W) based on the width a of the card 100 and the distance W between the two end points X1 and X2 of the projection pattern of the projection waveform associated with the X axis (horizontal axis) and a second value (b·H) based on the height b of the card 100 and the distance H between the two end points Y1 and Y2 of the projection pattern of the projection waveform associated with the Y axis (vertical axis).
A data processor 60A according to the second embodiment differs from the data processor 60 according to the first embodiment in the following points.
In the data processor 60 according to the first embodiment, the rotation-angle determiner 660 retrieves an angle corresponding to the evaluated value from the preset reference table on the basis of the evaluated value from the evaluated-value acquirer 650 and determines the result to be the rotation angle of the card 100. In contrast, in the data processor 60A according to the second embodiment, an evaluated-value acquirer 650A determines a rotation angle v(θ) through calculation, and a rotation-angle determiner 660A determines the rotation angle that serves as the evaluated value determined by the evaluated-value acquirer 650A to be the rotation angle of the card 100.
The evaluated-value acquirer 650A determines, from the above-described equation (7) (the equation (7) below), the rotation angle in accordance with the ratio of a first evaluated value corresponding to the difference (a·W−b·H) between a first value (a·W) based on the width a of the card 100 and the distance W between the two end points X1 and X2 of the projection pattern of the projection waveform associated with the X axis (horizontal axis) and a second value (b·H) based on the height b of the card 100 and the distance H between the two end points Y1 and Y2 of the projection pattern of the projection waveform associated with the height b of the card 100 of the Y axis (vertical axis) to a second evaluated value corresponding to the difference between a third value (b·W) based on the height b of the recognition target medium 100 and the distance W between the two end points X1 and X2 of the projection pattern of the projection waveform associated with the X axis (horizontal axis) and a fourth value (a·H) based on the width a of the card 100 and the distance H between the two end points Y1 and Y2 of the projection pattern of the projection waveform associated with the Y axis (vertical axis).
According to the second embodiment, although the computational load is slightly high, the actual rotation angle can be acquired at high precision, and the speed of the rotation angle determination process can be increased.
The third embodiment differs from the first and second embodiments in the following points.
The target image of projection generation according to the first and second embodiments produces a white card 100 and a black background. In contrast, the target image of projection generation according to the third embodiment produces a black card 100 and a white background.
According to the second embodiment, even with such an image, a projection profile similar to that according to the first embodiment can be acquired, and the same advantageous effects as those according to the first and second embodiments can be achieved.
(Other Applications)
With the medium recognition device 10 according to this embodiment, a method of detecting angles of straight lines or geometric patterns using projections to the horizontal and vertical axes of an image, without the Hough transform, can be used alone or can be used to determine the approximate angle before searching for cumulative points in detecting straight lines and geometric pattern with the Hough transform.
In this way, the precision of detection of the rotation angle can be maintained high.
Note that the method described in detail above may be provided as a program corresponding to the above-described procedure and be executed by a computer such as a CPU. Further, such a program can be stored on a recording medium such as a semiconductor memory, a magnetic disk, an optical disk, etc., and be accessed by a computer in which the recording medium is loaded to execute the program.
| Number | Date | Country | Kind |
|---|---|---|---|
| 2016-192187 | Sep 2016 | JP | national |
| Filing Document | Filing Date | Country | Kind |
|---|---|---|---|
| PCT/JP2017/034184 | 9/22/2017 | WO | 00 |