Inspection method, inspection apparatus, processing apparatus, and recording medium for detecting defects of a work

A robot operates according to predetermined path data, and changes a relative position between a work and an imaging apparatus. A processing unit makes the imaging apparatus pick up an image of the work, while changing the relative position between the work and the imaging apparatus, and acquires a plurality of images. The processing unit determines the relative position between the work and the imaging apparatus, at the time when having made the imaging apparatus pick up the image of the work. The processing unit detects a defect of the work from each of the plurality of images acquired during moving by the moving apparatus according to the predetermined path data, and identifies a position of the defect in the work, based on the relative position between the work and the imaging apparatus that has been calculated.

This application claims the benefit of Japanese Patent Application No. 2015-128713, filed Jun. 26, 2015, which is hereby incorporated by reference herein in its entirety.

BACKGROUND OF THE INVENTION

Field of the Invention

The present invention relates to an inspection method that picks up an image of a work while changing a relative position between the work and an imaging apparatus, and inspects the work, an inspection apparatus, a processing apparatus, and a recording medium.

Description of the Related Art

An inspection apparatus is known that picks up an image of a work, such as a product, in a production process by using an imaging apparatus that is represented by a camera, and inspects the work based on the picked-up image.

In such an inspection apparatus, an inspection apparatus for inspecting works that are represented by an exterior component of a product and have various shapes includes an inspection apparatus that picks up an image of the work while changing a relative position between the work and the imaging apparatus and a pose (hereafter referred to as a “position”). In order to inspect the work while changing the relative position between the work and the imaging apparatus and to inspect various works having various shapes, it is important that the inspection apparatus has a moving apparatus for moving both or either of the work and the imaging apparatus, and a processing apparatus that holds a three-dimensional shape of the work.

The inspection apparatus having such a structure relatively positions the work to the imaging apparatus so that the positions become inspecting positions that have been previously instructed before inspection, and makes the imaging apparatus pick up an image of the work (see Japanese Patent No. 4827744). For instance, the inspection apparatus positions the work on a work bench or the like, so that the work is positioned at a predetermined position and in a predetermined pose, moves the imaging apparatus, and makes the imaging apparatus pick up an image of the work. The inspection apparatus performs image processing for the image that has been picked up in such a state, and a system control apparatus associates the detected defect with the position on the work (see Japanese Patent Application Laid-Open No. 2005-31085).

In the inspection apparatus described in Japanese Patent No. 4827744, however, it is required that the relative position between the work and the imaging apparatus coincides with the previously instructed state. Because of this, when an error has occurred in the relative position between the work and the imaging apparatus, it is necessary for the inspection apparatus to correct an imaging position so that features of the picked-up image coincide with those of an image that is supposed when the image has been previously instructed, and to pick up the image again. When such a feedback operation has occurred, there has been a problem that a cycle time required for the inspection increases.

In addition, the inspection apparatus described in Japanese Patent Application Laid-Open No. 2005-31085 associates the detected defect with the position on the work, based on the previously instructed relative position between the work and the imaging apparatus, and accordingly, accurate positioning between the work and the imaging apparatus is required. Because of this, the inspection apparatus cannot operate at a high speed, and has had a problem that an inspection cycle time increases in order that the defect is associated with the position on the work.

Then, an object of the present invention is to increase a speed of an inspection of the work.

SUMMARY OF THE INVENTION

To achieve the above object, an aspect of the present invention provides an inspection method in which a processing unit controls imaging timing of an imaging apparatus that picks up an image of a work, controls an operation of a moving apparatus for moving at least one of the work and the imaging apparatus, and inspects the work based on an imaging result of the imaging apparatus. The inspection method comprises a moving process in which the processing unit makes the moving apparatus operate according to path data, and changes a relative position between the work and the imaging apparatus, an image acquiring process in which the processing unit makes the imaging apparatus pick up the image of the work, while changing the relative position between the work and the imaging apparatus in the moving process, and acquires a plurality of images, a position calculating process in which the processing unit determines the relative position between the work and the imaging apparatus, at the time when having made the imaging apparatus pick up the image of the work, and an identifying process in which the processing unit detects a defect of the work from each of the images, and identifies a position of the defect in the work, based on the relative position between the work and the imaging apparatus that has been calculated in the position calculating process.

The inspection method according to the present invention enables a high-speed inspection operation, and can accurately determine the position of the defect on the work. Therefore, the inspection method can accurately determine whether the work is a non-defective product or a defective product.

DESCRIPTION OF THE EMBODIMENTS

First Embodiment

FIG. 1is a schematic view illustrating an inspection apparatus according to a first embodiment of the present invention. An inspection apparatus100is an apparatus for inspecting an appearance of a work (inspection object) W. The inspection apparatus100includes: a light source102; and a robot103that is a moving apparatus that moves the work W. The inspection apparatus100also includes: a controlling apparatus (controlling unit)104that controls an operation of the robot103; a camera105that acts as an imaging apparatus; and an image processing apparatus200that is a processing apparatus (processing unit). The robot103is connected to the controlling apparatus104, and all of the controlling apparatus104, the camera105and the light source102are connected to the image processing apparatus200.

The light source102is an illumination apparatus that irradiates (illuminates) the work W with light. The light source102may be any light source, as long as the light source irradiates the work W with light having a light quantity necessary for image processing, for instance, an LED or a halogen lamp, and may also be any illumination, such as ring illumination or bar illumination. In addition, a diffuser panel, a lens, and the like may be arranged on a light-emitting surface side of the light source102.

The robot103is a multi-joint robot, and has a robot arm103A, and a robot hand103B which is attached on the robot arm103A. The robot arm103A is a vertical multi-joint robot arm, in the first embodiment. The robot hand103B has a plurality of fingers, and grasps the work W or releases the grasping by an opening/closing operation of these fingers.

A base end (fixed end) of the robot arm103A is fixed to an unillustrated structure, such as a trestle, and on the other end (free end) thereof, the robot hand103B is attached to the robot arm103A. The robot hand103B grasps the work W, and the robot arm103A operates, in other words, changes the pose of the robot103, and thereby can change the position and the pose (hereinafter referred to as “position”) of the work W. In other words, the work W can be grasped and moved by the robot103.

The camera105is a digital camera that receives light from the work W and generates data of a picked-up image. The camera105has an imaging lens105A, and an imaging device (solid imaging device)105B.

The imaging device105B is an area sensor, such as a CMOS image sensor or a CCD image sensor. The imaging lens105A is an objective lens unit that adjusts magnification, and adjusts the magnification so that the whole work W is imaged on an imaging device105B.

The image processing apparatus200performs image processing for the picked-up image that has been imaged by the camera105, and inspects the work W.

The light source102may be fixed or moved with respect to the camera105, but in the first embodiment, the camera105and the light source102are fixed to the trestle and other structures, and the relative position (including the pose) between the camera105and the light source102is fixed.

In addition, the relative position (including the pose) between the work W and the camera105is changed. In the first embodiment, the robot103moves the work W, and thereby changes the relative imaging position of the camera105with respect to the work W. In other words, the camera105, which is an imaging apparatus that acquires an image for inspection, and the light source102are installed independently from the work W.

Incidentally, in the first embodiment, the case will be described below in which the moving apparatus is the robot103, but the moving apparatus is not limited to the robot, and may be an apparatus other than the robot (for instance, a stage apparatus). In addition, the case will be described below in which the work W is moved with respect to the camera105, but the camera105may be moved with respect to the work W. In other words, the positions of the camera105and the work W may be relatively changed, and accordingly, the camera105may be moved, for instance, with the use of the robot103. In addition, the case is also acceptable in which the moving apparatus moves both of the camera105and the work W. In any case, the relative imaging position of the camera105with respect to the work W can be changed.

FIG. 2is a block diagram illustrating an image processing apparatus according to the first embodiment of the present invention. An image processing apparatus200has a CPU (Central Processing Unit)201that acts as a processing unit (arithmetic operation unit). The image processing apparatus200also has a ROM (Read Only Memory)202, a RAM (Random Access Memory)203, and a HDD (Hard Disk Drive)204, which act as storage units. The image processing apparatus200also has a recording disk drive205, and various types of interfaces211to214.

The ROM202, the RAM203, the HDD204, the recording disk drive205, and the various types of the interfaces211to214are connected to the CPU201through a bus210. The ROM202stores a basic program, such as a BIOS, therein. The RAM203is a storage apparatus that temporarily stores various data, such as an arithmetic processing result of the CPU201, therein.

The HDD204is a storage apparatus that stores the arithmetic processing result of the CPU201, various data that has been acquired from the outside, and the like, therein, and also records a program240therein for making the CPU201execute various arithmetic processing that are described below. The CPU201executes each process in an inspection method, based on the program240that is recorded (stored) in the HDD204.

The recording disk drive205can read out various data, a program, and the like, that are recorded in a recording disk241.

The light source102is connected to the interface211, and is turned on or turned off under the control of the CPU201.

The controlling apparatus104of the robot103is connected to the interface212, receives path data of the robot103from the CPU201, and controls the operation of the robot103that grasps the work W, according to the path data.

The camera105is connected to the interface213. The CPU201outputs a trigger signal to the camera105, and makes the camera105pick up the image at the timing at which the camera105has received the trigger signal. The camera105outputs the data of the picked-up image that is an imaging result, to the CPU201. The CPU201acquires data of the picked-up image from the camera105, subjects the picked-up image to image processing, and inspects the work W. In the first embodiment, the CPU201detects a defect, such as a flaw and dirt of the work W, and identifies a position of the defect on the work W, as the inspection of the work W.

An external storage apparatus120, such as a rewritable nonvolatile memory or an external HDD, can be connected to the interface214.

According to the above-described configuration, the CPU201of the image processing apparatus200controls the imaging timing of the camera105that picks up an image of the work W, and controls the operation of the robot103that moves the work W. In addition, the CPU201inspects the work W based on the imaging result of the camera105.

Incidentally, in the first embodiment, the case will be described below in which a recording medium that can be read by a computer is the HDD204, and the program240is stored in the HDD204, but the invention is not limited to the above case. The program240may be recorded in any recording medium as long as the recording medium can be read by the computer. For instance, the ROM202, the recording disk241, and the external storage apparatus120that are illustrated inFIG. 2, and the like, may be used as the recording medium for supplying the program240. Specific usable examples of the recording medium include a flexible disk, a hard disk, an optical disk, a magneto-optical disk, a CD-ROM, a CD-R, a magnetic tape, a nonvolatile memory, and a ROM.

FIG. 3is a flow chart illustrating an inspection preparation process that is performed before the inspection method according to the first embodiment of the present invention.

Firstly, the CPU201sets three-dimensional shape information of the work W before the inspection of the work W is performed (S21). Three-dimensional CAD information, or the like, can be used as the three-dimensional shape information of the work W. The CPU201converts the three-dimensional shape information (three-dimensional shape model) of the work W into a CAD application format, or a more versatile STL format, and then makes a storage unit, such as the HDD204of the image processing apparatus200, store the converted three-dimensional shape information of the work W, according to an instruction of a user.

Next, the CPU201sets an inspection region in which the inspection is actually performed based on the three-dimensional shape information of the work W, and a non-inspection region in which the inspection is not performed (S22), according to the instruction of the user. Specifically, the CPU201makes the storage unit, such as the HDD204of the image processing apparatus200, store the inspection region and the non-inspection region (data) of the work W, which have been input into the CPU201.

FIG. 4Ais an explanatory view illustrating one example of an inspection region and a non-inspection region that have been set based on three-dimensional shape information of the work W.FIG. 4Bis an explanatory view illustrating one example of the inspection region that has been set based on the three-dimensional shape information of the work W.FIG. 4Cis an explanatory view illustrating one example of the non-inspection region that has been set based on the three-dimensional shape information of the work W.

As is illustrated inFIG. 4A, the inspection region41and the non-inspection region42can be set as surface characteristics, based on the three-dimensional shape information (three-dimensional shape model)40of the work W. In addition, the CPU201can separately give the three-dimensional shape information41that shows the inspection region, as is illustrated inFIG. 4B, and the three-dimensional shape information42that shows the non-inspection region, as is illustrated inFIG. 4C, to the storage unit. When having separately given the inspection region and the non-inspection region, the CPU201separately sets which set region is preceded, and thereby can set even regions which overlap each other.

Incidentally, in the first embodiment, the case will be described below in which both of the inspection region and non-inspection region are set, but only the inspection region may be set. In this case, a region other than the inspection region shall be the non-inspection region.

Next, the CPU201sets a scanning path (path) of the robot103, which corresponds to the work W (S23). Specifically, the CPU201makes the storage unit, such as the HDD204of the image processing apparatus200, store the scanning path data (path data). At this time, the CPU201calculates the path of the robot103so that a positional relationship among the camera105, the light source102, and a surface (portion to be inspected) WA of the work W satisfy a condition necessary for inspection, by using the above-described three-dimensional shape information of the work W.

At this time, in the case in which the camera105and the light source102are installed on a same frame, or in the case in which, even though being installed on different frames, the camera105and the light source102cannot be relatively moved, the calculated inspection path is calculated against the frame. On the other hand, in the case in which the camera105and the light source102are installed on different frames and the light source102can be moved, the path of the light source102is independently calculated in the path calculation so as to satisfy the condition necessary for inspection.

FIG. 5is a flow chart of the inspection method according to the first embodiment of the present invention. In the inspection of the appearance of the work W, there exists such a universal request as to shorten the cycle time needed for the inspection. Then, firstly, the CPU201determines the relative position (including the pose) between the camera105and the work W at the time when the inspection starts (S31: measuring process and measuring processing). Specifically, the CPU201determines the relative position of the work W that is supported by the robot103with respect to the camera105, in the pose of the robot103, which corresponds to the starting point of the previously set path data. The relative position between the work W and the camera105at this time is referred to as an “initial relative position.”

Specifically, the CPU201extracts a feature point from the picked-up image of the work W, which has been picked up by the camera105, matches the extracted feature point with the three-dimensional shape information of the work W, and thereby determines the initial relative position. At this time, the CPU201considers the information on the position of the robot103, and thereby can accurately determine the initial relative position even for the work W having a plurality of similar feature points. Thereby, the inspection apparatus does not need to accurately position the work W with respect to the robot in a conventional manner, and can shorten the cycle time necessary for the inspection.

Before performing the calculation of the initial relative position, the CPU201needs to calibrate an inner parameter and an outer parameter for the camera105(imaging lens105A) and the robot103. This calibration is a process of acquiring the position and the pose of the camera105and the robot103in a global coordinate space, and information on the lens of the imaging lens105A, and is performed with the use of a plate that is called a calibration plate and of which the pattern arrangement and size are already known. Thereby, the positions and the poses of the camera105and the robot103in the global coordinate space are adjusted, and the information on the lens of the imaging lens105A can be acquired. For this reason, the subsequent calculations that include the step S31are enabled.

Incidentally, a case is described below in which the robot103is operated so that the robot103becomes the starting point of the path data, in the step S31, but the position is not limited to the starting point. The pose can be arbitrarily set, as long as the pose is a pose in which the camera105can pick up an image of the work W. Here, in the first embodiment, the image that has been acquired in the step S31may be an image that is not used in a subsequent inspection for the work W, and shall be referred to as an image for measuring, which is distinguished from the image for inspection. Specifically, in the step S31, the CPU201analyzes the image of the work W for measuring that has been picked up and provided by the camera105when the robot103has been set at the predetermined pose, and determines the relative position between the work W and the camera105, at the time when the image for measuring has been picked up.

Next, the CPU201operates the robot103according to the previously set path data in order to change the relative position between the camera105and the work W (S32: moving process and moving processing). In other words, the CPU201operates the robot103according to the path data, and changes the relative position between the work W and the camera105.

The CPU201makes the camera105pick up an image of the work W while relatively moving the work W with respect to the camera105, and acquires the image for inspection (S33: image acquiring process and image acquiring processing). In other words, the CPU201makes the camera105pick up an image of the work W while changing the relative position between the work W and the camera105in the step S32, and acquires the image. Incidentally, in the first embodiment, the operation of the robot103is continued even when the camera105picks up the image, but the operation of the robot103may be stopped at the imaging timing.

Next, the CPU201calculates the relative position between the camera105and the work W, at the timing at which the image for inspection is acquired, in other words, at the time when making the camera105pick up the image of the work W (S34: position calculating process and position calculating processing). For this purpose, in the first embodiment, the CPU201acquires the pose of the robot103, at the time when the image for inspection is acquired, specifically, a moving amount from the initial position (moving amount with respect to pose of robot103, at the time when image for measuring has been picked up), from the controlling apparatus104. Then, the CPU201calculates the relative position between the camera105and the work W at imaging, from the initial relative position that has been determined in the step S31, and the moving amount from the initial position of the robot103. Specifically, the CPU201analyzes the image for measuring, thereby determines the relative position of the work W to the camera105, and accordingly determines the relative position of the work W to the robot103(robot hand103B). The relative position between the robot hand103B of the robot103and the work W is constant, and accordingly the relative position of the work W to the camera105is determined from the pose of the robot103(robot arm103A) at the time when the pose of the robot103has been changed.

Thus, the CPU201determines the relative position between the work W and the camera105, at the time when the image that has been acquired in the step S33has been picked up, based on the initial relative position that has been determined in the step S31, and on the pose of the robot103, at the time when the work W has been imaged according to the path data. The pose of the robot103at this time may be determined to be a result that has been obtained from a detecting unit (unillustrated) that detects positions of j oints of the robot103, or may be determined to be an instruction value to be sent to each of the joints of the robot103. Therefore, the CPU201can determine the relative position between the camera105and the work W from the information sent from the robot103, even when being incapable of determining the relative position from the picked-up image for inspection.

Next, the CPU201calculates the inspection region that corresponds to a portion WA to be inspected of the work W and the non-inspection region other than the inspection region, in the image that has been acquired in the step S33(S35: inspection region calculating process and inspection region calculating processing). Specifically, the CPU201calculates the inspection region that corresponds to the portion WA to be inspected of the work W, in the image that has been acquired in the step S33, based on the relative position between the work W and the camera105.

The three-dimensional shape information of the work W, and the inspection region and the non-inspection region in the three-dimensional shape information are registered in the HDD204in the step S21and the step S22inFIG. 3. The CPU201calculates the inspection region and the non-inspection region in the image that has been acquired in the step S33, from the registered information and the relative position between the camera105and the work W, which has been calculated in the step S34. The CPU201can determine the inspection region and the non-inspection region in the image, by perspectively projecting the three-dimensional shape information onto a virtual surface that corresponds to the imaging device105B of the camera105.

The imaging lens105A has a peculiar lens distortion, and deviation occurs between the inspection region that has been calculated by the perspective projection and the inspection region in the image to be actually inspected, by the distortion. Because of this, in the first embodiment, the CPU201removes a distortion component from the acquired image, or removes the deviation originating in the lens distortion by adding the distortion component to the inspection region and the non-inspection region.

The inspection region that has been calculated in the step S35is determined to be a region on the image for inspection, and accordingly, the inspection region can be subjected to image processing such as filter processing and a computation between images, according to the surface state of the work W. In addition, at this time, it is possible not to explicitly subject the non-inspection region that has been calculated in the step S35to the image processing. Incidentally, in the first embodiment, the case has been described in which the non-inspection region is also calculated in the step S35, but only the inspection region may be configured to be calculated.

The CPU201subjects the inspection region that has been calculated in the step S35to the image processing, determines defect candidates, and extracts a defect from the defect candidates (S36). At this time, the CPU201calculates a feature amount of the defect (defect candidate). Specifically, the CPU201detects the defect on the inspection region in each of the images in the step S36.

Incidentally, the CPU201stores the image for inspection, which has been picked up in the step S33, the relative position between the work W and the camera105, which has been calculated in the step S34, and the feature amount of the defect, which has been extracted in the step S36, in the HDD204, in a state in which the above contents are associated with each other.

Next, the CPU201determines whether the change in the pose of the robot103has ended or not, in other words, whether the operation has been completed or not (S37). When the operation continues (S37: NO), the CPU201returns to the step S33again, and the imaging starts. When the operation is completed (S37: YES), the CPU201ends a loop, and performs a next step S38. By this loop operation, the CPU201acquires a plurality of images in the step S33, and calculates the inspection region and the non-inspection region in each of the images in the step S35.

The above-described step S33to step S37are executed at timing independent of the operation of the robot103, while the robot103operates. Because of this, in the imaging by the camera105, such an imaging speed needs to be set so that the camera105can pick up exhaustively an image of the whole region of the work W or the portion to be inspected. The imaging speed does not need to be the same imaging speed from the start to the end of the inspection, however, and can be changed according to the portion to be inspected. Thereby, an amount of data necessary for the inspection can be also reduced.

Next, the CPU201identifies which position on the work W corresponds to the position on the inspection image of the defect that has been detected in the step S36(S38: identifying process and identifying processing). Specifically, the CPU201first detects the defect of the work W from each of the images, in identifying processing (S36), and subsequently, identifies the position of the defect on the work W, based on the relative position between the work W and the camera105, which has been calculated in the step S34(S38). This identifying processing is executed with the use of a series of images for inspection, relative positions between the camera105and the work W, and feature amounts of the defects, which have been stored in the above-described loop.

The position in the camera coordinate system of the work W, at the time when the image for inspection has been picked up, is determined from the relative position between the camera105and the robot103. The conversion matrix that converts a robot coordinate system into a global coordinate system has been already acquired from the above-described external parameter.

FIG. 6is a schematic view for describing an identifying process of identifying the position of the defect in the first embodiment. As is illustrated inFIG. 6, assume a straight line that passes a principal point53of the imaging lens105A from the position of the defect51on the image that becomes the image for inspection, which has been detected on the image surface50. A coordinate system of the straight line is converted into the global coordinate system from a camera coordinate system. Also, as for the work W that is held through the robot coordinate system, the three-dimensional shape information (three-dimensional shape model) can be arranged in the global coordinate system by the conversion matrix. Next, an intersection of the straight line that passes through the principal point53of the camera105and the three-dimensional shape information that is arranged in the global coordinate system is determined, and thereby a defect position52on the work W is identified.

Finally, in the case of the works W having various shapes, it occurs that the determination of whether the work W is a non-defective product or a defective product varies depending on which position on the work W the defect that has actually occurred corresponds to. Then, when the position of the defect on the work W has been identified, the CPU201determines the work W as defect or non-defect, based on the position of the defect and the feature amount of the defect (S39).

As described above, the inspection method according to the first embodiment does not need to make the relative position between the work W and the camera105coincide with the previously instructed state, in other words, does not need to accurately position the work W to the robot103. Because of this, a high-speed inspection operation is enabled, and the position of the defect on the work W can be accurately determined. Therefore, the inspection method can accurately determine whether the work W is a non-defective product or a defective product.

Incidentally, the processing of the step S38does not need to wait for the end of the scanning of the robot103, and may also be performed between the step S36and the step S37. In addition, the processing in the step S34to the step S36may be performed after the CPU201has acquired the plurality of images from the camera105.

Second Embodiment

Next, an inspection method according to a second embodiment of the present invention will be described.FIG. 7is a flow chart illustrating the inspection method according to the second embodiment of the present invention. Incidentally, the configuration of the inspection apparatus of the second embodiment is similar to the configuration of the inspection apparatus of the first embodiment, and accordingly the description of the configuration of the inspection apparatus will be omitted. In the second embodiment, the content of the program that is stored in the image processing apparatus of the inspection apparatus is different from that in the first embodiment. Specifically, the inspection method of the second embodiment illustrated inFIG. 7is an inspection method in which a process (processing) of a step S60is added to the inspection method of the first embodiment illustrated inFIG. 5, and the steps (processes and processings) other than the step S60are similar to those in the first embodiment, and the description will be omitted.

When the relative position between the camera105and the work W that has been determined in the step S31is different from the case in which the scanning path (path) of the robot103has been set in the flow chart ofFIG. 3, it may also occur that the illumination condition necessary for the inspection with the light source102cannot be kept.

Because of this, in the step S60in the second embodiment, the CPU201corrects the path to such a path that the relative position between the camera105and the work W becomes equal to the position at the time when the path has been set (path re-setting process and path re-setting processing). In other words, prior to the step S32, the CPU201corrects the path data so that the work W passes through the predetermined path with respect to the camera105, in the moving process (in moving processing) of the step S32. Specifically, the CPU201corrects the path data based on the relative position between the work W and the camera105at the time when the robot103has been set at the predetermined pose. Here, the predetermined path is a given path in a three-dimensional space. In addition, the predetermined pose is a previously set particular pose, and is a pose that becomes a starting point in the path data before correction, in the second embodiment. Accordingly, the CPU201may correct the path data based on the relative position between the work W and the camera105, which has been determined in the step S31.

In the second embodiment, the path data is corrected (re-set) prior to the step S32, and accordingly, the controlling apparatus moves the work W so as to pass a path equal to that at the time when the path has been set. By moving the work W in this way, even in the case in which the initial position of the work W has deviated when the inspection has started, the inspection apparatus can perform an inspection equivalent to the inspection at the time when the scanning path has been set, and can enhance the inspection accuracy.

Third Embodiment

Next, an inspection method according to a third embodiment of the present invention will be described.FIG. 8is a flow chart illustrating the inspection method according to the third embodiment of the present invention. Incidentally, the configuration of the inspection apparatus of the third embodiment is similar to the configuration of the inspection apparatus of the first embodiment, and accordingly, the description of the configuration of the inspection apparatus will be omitted. In the third embodiment, the content of the program that is stored in the image processing apparatus of the inspection apparatus is different from that in the first embodiment. Specifically, the inspection method of the third embodiment illustrated inFIG. 8is a method in which a process (processing) in the step S31in the inspection method of the first embodiment illustrated inFIG. 5is omitted.

Then, the CPU201analyzes one image that has been acquired, for instance, in the first loop in the step S33, and determines the relative position between the work W and the camera105, at the time when this image has been picked up, in the step S34. This computation is similar to that in the step S31that has been described in the first embodiment. After the next loop, in the step S34, the CPU201determines the relative position between the work W and the camera105, at the time when the acquired image has been picked up, based on the relative position between the work W and the camera105, which has been determined in the first loop, and on the pose of the robot103according to the path data. This computation is similar to that in the step S34that has been described in the first embodiment.

Also, in the third embodiment, it becomes unnecessary to accurately position the work W to the robot103, similarly to the first embodiment. Because of this, a high-speed inspection operation is enabled, and the position of the defect on the work W can be accurately determined. Therefore, the inspection method can accurately determine whether the work W is a non-defective product or a defective product.

Incidentally, in the third embodiment, it is acceptable to add the steps S31and S60, and to re-set the path of the robot103, similarly to the second embodiment.

Fourth Embodiment

Next, an inspection method according to a fourth embodiment of the present invention will be described.FIG. 9is a flow chart illustrating the inspection method according to the fourth embodiment of the present invention. Incidentally, the configuration of the inspection apparatus of the fourth embodiment is similar to the configuration of the inspection apparatus of the first embodiment, and accordingly, the description of the configuration of the inspection apparatus will be omitted. In the fourth embodiment, the content of the program that is stored in the image processing apparatus of the inspection apparatus is different from that in the first embodiment. Specifically, in the inspection method of the fourth embodiment illustrated inFIG. 9, the process (processing) of the step S31in the inspection method of the first embodiment illustrated inFIG. 5is omitted, and furthermore, the CPU201executes steps S34to S36after the processing of the steps S33and S37, in other words, after having acquired the plurality of images.

Here, in the step S34, after having acquired the plurality of images, the CPU201determines the relative position between the work W and the camera105, at the time when the image has been picked up. If described in detail, the CPU201analyzes one image among the plurality of images, which is not limited to the first image, and determines the relative position between the work W and the camera105, at the time when this image has been picked up. This computation is similar to that in the step S31that has been described in the first embodiment. Then, the CPU201determines the relative position between the work W and the camera105, at the time when remaining images among the plurality of images have been picked up, based on the relative position between the work W and the camera105, at the time when the one image has been picked up, and based on the pose of the robot103according to the path data. The pose of the robot103at this time is a relative moving amount to the pose of the robot103, at the time when the one image among the plurality of images has been picked up. This computation is similar to that in the step S34that has been described in the first embodiment.

Incidentally, in the fourth embodiment, it is acceptable to add the steps S31and S60, and to re-set the path of the robot103, similarly to the second embodiment.

In addition, it is acceptable to determine the relative position between the work W and the camera105, at the time when the image has been picked up, for all of the images, by similar arithmetic processing to that in the step S31that has been described in the first embodiment. Specifically, in the calculating processing of the relative position between the camera105and the work W in the step S34inFIG. 5andFIG. 7in the first and second embodiments, the position of the work W can also be utilized, which has been detected from the picked-up image for inspection. In other words, the CPU201may analyze each of the plurality of images which the CPU201has acquired in the image acquiring process, and may determine the relative position between the work W and the camera105, in the step S34.

For this purpose, it is necessary to set feature points that can be matched with the three-dimensional shape information, in a plurality of positions (including poses) of the work W. The set feature points are matched with the picked-up inspection image, and thereby the position of the work W at imaging can be determined. By utilizing the position of the work W that has been determined in this way, the inspection method can further enhance the accuracy than the method of determining the relative position between the camera105and the work W only from the information of the robot103. Thereby, the calculation accuracy for the position of the defect on the inspection region and the work W is enhanced, and accordingly, the inspection method can more accurately determine whether the work W is a non-defective product or a defective product.

In addition, there may be mixed cases of the case in which the relative position between the work W and the camera105is determined from the pose of the robot103, and the case in which the relative position between the work W and the camera105is determined from the image for inspection. Therefore, even when the relative position between the work W and the camera105cannot be determined in all of the images for inspection, the relative position between the work W and the camera105can be determined from the pose of the robot103.

Incidentally, the present invention is not limited to the above-described embodiments, but can be variously modified within a technological idea of the present invention. In addition, in regard to the effects that have been described in the embodiments of the present invention, the most suitable effects that are created by the present invention are merely enumerated, and the effects according to the present invention are not limited to the effects that have been described in the embodiments of the present invention.

Other Embodiment(s)

In addition, in the above-described embodiments, the case has been described in which the robot arm is a vertical multi-joint robot arm, but the robot arm is not limited to the vertical multi-joint robot arm. The robot arm may be various robot arms, for instance, such as a horizontal multi-joint robot arm, a parallel link robot arm, and an orthogonal robot.

In addition, in the above-described embodiments, the case has been described in which the processing unit is the CPU201of the image processing apparatus200, but the processing unit is not limited to the CPU201. The processing unit may be a CPU of the controlling apparatus104, a CPU of another apparatus, or may be configured of a plurality of CPUs.