The present application claims priority to and incorporates by reference the entire contents of Japanese Patent Application No. 2014-095086 filed in Japan on May 2, 2014.
1. Field of the Invention
The present invention relates to an image processing system, an image processing method, and a computer program product used for label inspection, appearance inspection, and the like.
2. Description of the Related Art
Inspection apparatuses using an imaging device such as a camera have recently been used for label inspection or appearance inspection in a factory and the like. Such apparatuses often employ pattern matching as a method for automatically performing the inspection.
In pattern matching, an image to be inspected, which is a captured image of an object to be inspected, and master pattern data prepared in advance are compared to determine a difference between features of the patterns for inspection.
If the imaging device is not fixed, the object to be inspected is not necessarily captured without a tilt with respect to the camera. Thus, a method of repeating tilt correction on the image to be inspected in an asymptotic manner and performing matching with the master pattern data for pattern matching has already been known.
Japanese Laid-open Patent Publication No. 2006-245726 describes a digital camera that corrects afterward an image captured by the camera in a tilted orientation. The digital camera described in Japanese Laid-open Patent Publication No. 2006-245726 includes imaging means having an imaging surface on which a plurality of photoelectric conversion elements are arranged, means for detecting an angle of the imaging surface with respect to a reference orientation, and processing means for correcting an image as much as the detected angle.
According to the conventional pattern matching method, the tilt of the image to be inspected is repeatedly corrected in an asymptotic manner, and matching is performed between the image to be inspected and the master pattern data each time the correction is repeated. The processing time for matching therefore increases as the tilt increases.
Since a relative tilt between the object to be inspected and the imaging device is unknown, there has been a problem that the number of repetitions before the determination of a matching failure is not predictable in advance and the number of repetitions increases.
The digital camera described in Japanese Laid-open Patent Publication No. 2006-245726 does not take account of the tilt of an object, but is predicated on that the object is not tilted. The foregoing problem therefore cannot be solved if the digital camera is used for the pattern matching.
Therefore, there is a need for an image processing system that are capable of performing tilt correction for pattern matching in a short time.
It is an object of the present invention to at least partially solve the problems in the conventional technology.
According to an embodiment, an image processing system includes an imaging device, an angle detecting unit, a relative angle calculating unit, and a relative angle correcting unit. The imaging device captures an image of an object to be inspected. The angle detecting unit detects an angle of the imaging device. The relative angle calculating unit calculates a relative angle between the object to be inspected and the imaging device. The relative angle correcting unit corrects a tilt indicated by the relative angle calculated by the relative angle calculating unit.
The above and other objects, features, advantages and technical and industrial significance of this invention will be better understood by reading the following detailed description of presently preferred embodiments of the invention, when considered in connection with the accompanying drawings.
A configuration of a first embodiment will be described with reference to
The tilt correction unit 110 includes an angle detecting unit 111 to detect a tilt of an imaging surface with respect to a reference position, and a correction calculation unit 112. The correction calculation unit 112 corrects the tilt as much as an angle detected by the angle detecting unit 111. Examples of the angle detecting unit 111 may include an acceleration sensor and a gyro sensor.
The image acquisition unit 120 includes an optical system 121, an imaging unit 122 including an array of optical conversion elements, and a preprocessing unit 123. The memory control unit 130 includes a memory controller 131 and a memory 132.
The determining unit 140 includes a pattern matching determining unit 141 and a determination display unit 142. The pattern matching determining unit 141 determines whether a processed image matches a master pattern.
A conventional image processing method will be described with reference to
For example, a method for pattern matching may include comparing the master pattern data 200A, i.e., a template with the captured image in units of one pixel while shifting the master pattern data 200A pixel by pixel.
A more efficient method for pattern matching is described in Japanese Laid-open Patent Publication No. 63-211474. More specifically, the method includes performing matching step by step by using a plurality of template areas having different sizes, and changing the resolutions of a template area and an input image so that the amounts of data processed in the respective steps become constant.
The foregoing pattern matching methods are just an example. The method for pattern matching according to the present embodiment is not limited to such methods. Any method may be employed as long as the method includes checking whether the captured image matches the master pattern data 200A, i.e., a template.
If the target image does not match the master pattern data (step S102, No), whether the number of times of correction so far exceeds a preset predetermined number of times of correction is initially checked (step S104). If the predetermined number of times of correction is exceeded (step S104, Yes), the correction is completed as the matching has failed (step S106).
If the number of times of correction does not exceed the predetermined number of times of correction (step S104, No), rotation and correction are performed further (step S105), followed by matching. For example, in the case of two-dimensional correction, the maximum number of times of rotation and correction is as many times as needed for a rotation of 360°.
Further, the tilt of the imaging device 300 that is not fixed with respect to the reference axis is obtained by the angle detecting unit 111. A relative tilt between the object machine 200 serving as the object to be inspected and the imaging device 300 is calculated from the foregoing two pieces of tilt information. The correction calculation unit 112 may have the function of the relative angle calculating unit.
As illustrated in
Note that as illustrated in
In a second embodiment, as illustrated in
Using this relative angle information, rotation in X-and Y-directions and trapezoidal distortion correction in a Z-axis direction can be performed to complete rough correction. This can reduce the processing time for a pattern match and determination time for a matching failure. A known method may be used as a trapezoidal distortion correction method.
For example, a method described in Japanese Laid-open Patent Publication No. 2011-33930 may be employed as the trapezoidal distortion correction method. In the method, the user presses up, down, left, and right buttons of a projector main body or the like to adjust distortion in a trapezoidal manner. A method in which the user presses the up, down, left, and right buttons to specify a desired vertex and adjust the position of the vertex among four vertexes of the image may be used. Such adjustments may be automatically performed.
For example, a program for performing image processing by the method used in the first embodiment may be installed in an image processing apparatus in advance as an image processing program. The image processing program may be installed in the image processing apparatus via a recording medium such as a CD-ROM or a transmission medium such as the Internet.
According to the present invention, an image processing system that performs tilt correction processing for pattern matching in a short time can be provided.
Although the invention has been described with respect to specific embodiments for a complete and clear disclosure, the appended claims are not to be thus limited but are to be construed as embodying all modifications and alternative constructions that may occur to one skilled in the art that fairly fall within the basic teaching herein set forth.
Number | Date | Country | Kind |
---|---|---|---|
2014-095086 | May 2014 | JP | national |