WO2013103032A1 - 画像検査装置の検査領域設定方法 - Google Patents

画像検査装置の検査領域設定方法 Download PDF

Info

Publication number
WO2013103032A1
WO2013103032A1 PCT/JP2012/071758 JP2012071758W WO2013103032A1 WO 2013103032 A1 WO2013103032 A1 WO 2013103032A1 JP 2012071758 W JP2012071758 W JP 2012071758W WO 2013103032 A1 WO2013103032 A1 WO 2013103032A1
Authority
WO
WIPO (PCT)
Prior art keywords
inspection
inspection area
image
region
user
Prior art date
Application number
PCT/JP2012/071758
Other languages
English (en)
French (fr)
Inventor
湊善久
柳川由紀子
Original Assignee
オムロン株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by オムロン株式会社 filed Critical オムロン株式会社
Priority to KR1020147015679A priority Critical patent/KR101626231B1/ko
Priority to EP12864252.7A priority patent/EP2801815B1/en
Priority to CN201280061701.5A priority patent/CN103988069B/zh
Priority to US14/363,340 priority patent/US9269134B2/en
Publication of WO2013103032A1 publication Critical patent/WO2013103032A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8806Specially adapted optical and illumination features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • G06T7/001Industrial image inspection using an image reference approach
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/12Edge-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/143Segmentation; Edge detection involving probabilistic approaches, e.g. Markov random field [MRF] modelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/174Segmentation; Edge detection involving the use of two or more images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2200/00Indexing scheme for image data processing or generation, in general
    • G06T2200/24Indexing scheme for image data processing or generation, in general involving graphical user interfaces [GUIs]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20076Probabilistic image processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20092Interactive image processing based on input by user
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30164Workpiece; Machine component

Definitions

  • the present invention relates to an image inspection apparatus that performs an appearance inspection using an image.
  • image inspection devices that perform visual inspections using images are widely used.
  • the basic configuration is to image the inspection object with an image sensor (camera), extract the part that will be the inspection area from the obtained image, By analyzing / evaluating the characteristics of the image in the inspection area, the target inspection (for example, good / bad determination, sorting, information acquisition, etc.) is performed.
  • an inspection region extraction method using binarization or color gamut extraction is known. That is, this is a method of extracting a pixel group corresponding to a preset luminance range or color gamut from an image and using the pixel group as an inspection region.
  • This technique is effective when the brightness or color contrast of the part (foreground) to be extracted as the inspection area and the other part (background) is high, for example, the article from the image of the article conveyed on the belt conveyor. It is used for processing to extract only the part. If this method is used, the above-mentioned problems such as dealing with complicated shapes and simplification of setting work are solved to some extent, but the following problems still remain.
  • the foreground part you want to extract as the inspection area is shaded by the influence of lighting, etc.
  • the foreground part is composed of various brightness or colors, or there are colors close to the foreground part in the background, binary It is difficult to accurately extract only the foreground part by conversion or color gamut extraction.
  • the inspection content has become more sophisticated and subdivided. For example, if you want to perform surface inspection only on one cutting surface of molded parts, or only one part on a printed circuit board on which many parts are mounted. In many cases, there is almost no color difference between the background and the foreground.
  • binarization and color gamut extraction are performed for each pixel of the image, it is easily affected by noise and lighting fluctuations. As a result, there is a problem that the inspection accuracy is lowered due to selection of pixels.
  • Patent Document 1 as a method for setting an inspection area, a method for setting the position and size of an inspection area from CAD data of a component to be inspected, and an inspection is performed by taking a difference between two images before and after component mounting. A method for recognizing a power region is disclosed. If these methods are used, it is possible to automatically set the inspection area, but these methods are limited in applicable objects and lack generality.
  • the present invention has been made in view of the above circumstances, and the object of the present invention is simple and high even if the object is a complicated shape or a special shape, or the foreground and background colors are misleading.
  • An object of the present invention is to provide a technique that makes it possible to set an inspection area with high accuracy.
  • the gist is to set the inspection area automatically or semi-automatically.
  • the present invention extracts a portion to be an inspection area from an original image obtained by photographing the inspection object as an inspection area image, and analyzes the inspection area image to inspect the inspection object.
  • the acquisition step and the computer for each candidate region for a plurality of candidate regions that are candidate solutions of the inspection region based on the color or luminance information of each pixel in the sample image and the edge information included in the sample image Pixel separation, which is the degree of color or luminance separation between the inside and outside of the region, and the degree of overlap between the contours of each candidate region and the edges in the sample image
  • An inspection region search step for obtaining an optimal solution of the inspection region from the plurality of candidate regions by evaluating both of the edge overlap degrees, and an image of the inspection region obtained by the computer in the inspection region search step
  • the setting time and the work load are greatly increased as compared with the case where the inspection area is manually input as in the conventional case. And can be applied to complex shapes and special shapes.
  • edge information is also used to comprehensively evaluate both color or luminance pixel separation between the inside and outside of the inspection area and edge overlap of the inspection area.
  • the extraction accuracy of the region can be improved as compared with conventional methods such as binarization and color gamut extraction.
  • the user can easily confirm whether or not a desired region is selected as the inspection region by looking at the inspection region displayed on the display device. If the inspection area is not appropriate, the recalculation result can be immediately confirmed on the screen while appropriately adjusting the parameters, so that it is easy to drive into the desired inspection area.
  • a balance parameter for adjusting the balance between the pixel separation degree and the edge overlap degree is input to the user as one of the parameters, and in the inspection area search step, the balance parameter input from the user is input. Accordingly, it is preferable to adjust the weight in evaluating the pixel separation degree and the edge overlap degree.
  • balance parameter adjustable by the user By making the balance parameter adjustable by the user in this way, a desired inspection area can be set easily and in a short time even for images for which it is difficult to automatically separate the foreground and the background.
  • the inspection area search step a value obtained by evaluating the foreground likeness of the color or luminance of each pixel inside the candidate area with respect to the representative color or representative luminance of the foreground, or each outside of the candidate area with respect to the representative color or representative luminance of the background It is preferable that the pixel separation degree is a value obtained by evaluating the background of pixel color or luminance, or a value obtained by combining both values.
  • the possibility of reaching an appropriate solution can be greatly increased. Note that when calculating a value that evaluates the foreground likelihood, all the pixels inside the candidate region may be used, or only some of the pixels may be used. Similarly, when calculating a value that evaluates the likelihood of background, all the pixels outside the candidate region may be used, or only some of the pixels may be used.
  • the weight of the pixel separation degree increases as the difference between the representative color or representative luminance of the foreground and the representative color or representative luminance of the background increases, and the weight of the edge overlap degree decreases as the difference decreases. It is preferable to adjust the weight when evaluating the pixel separation degree and the edge overlap degree so as to increase.
  • This configuration is not the user adjusting the balance parameter described above, but automatically adjusting it to an appropriate value. Thereby, even if there is no user assistance, the possibility of reaching an appropriate solution can be increased.
  • the parameter receiving step if the user inputs the representative color or the representative luminance of the foreground and / or background as one of the parameters, the possibility of reaching an appropriate solution can be further increased.
  • the sample image is displayed on a display device, the user is allowed to specify a portion to be a foreground or background on the displayed sample image, and the color or luminance of the specified portion is set. It is preferable to obtain the representative color or the representative luminance. According to this configuration, it is possible to easily and definitely specify the representative color and the representative luminance.
  • any parameters other than those described above may be given as long as they can affect the search for the optimum solution in the inspection region.
  • information indicating the characteristics of the inspection area shape, size, position in the image, texture, topology, adjacent elements, inclusion elements, etc. are given as parameters.
  • characteristics of the inspection area And the inspection area solution search may be performed so that the degree of similarity between the parameters and the characteristics given by these parameters is also high. In this way, by setting various characteristics of the inspection region as constraint conditions, the possibility of reaching an appropriate solution can be further increased.
  • the inspection area obtained in the inspection area search step is displayed on the display device, It is preferable to have an inspection area correction step of correcting the shape of the inspection area in accordance with the input correction instruction.
  • Various operation systems for correcting the inspection area can be considered.
  • all or part of the contour of the inspection area may be approximated by a path of a Bezier curve or a spline curve, and the path may be corrected by the user.
  • the outline of the inspection area can be easily corrected to a desired shape.
  • an operation system that allows a user to draw a free curve and synthesizes the free curve and the inspection area so that the free curve becomes a part of the outline of the inspection area, or a part of the outline of the inspection area to the user.
  • An operation system in which the section is designated and the contour of the designated section is replaced with a straight line or an arc, or an operation system in which a pixel designated by the user is added to or excluded from the inspection area is also preferable.
  • the present invention can also be regarded as an image inspection apparatus having at least one of the above-described means, or as an inspection area setting apparatus for an image inspection apparatus having at least one of the above-described means related to inspection area setting. You can also.
  • the present invention can also be understood as an image inspection method or an inspection region setting method for executing at least one of the above processes, a program for causing a computer to execute such a method, or a storage medium storing the program.
  • the present invention it is possible to easily and accurately set the inspection area even when the object has a complicated shape or special shape, or when the foreground and background colors are misleading.
  • the figure which shows the structure of an image inspection apparatus typically.
  • inspection processing. 6 is a flowchart showing a flow of processing for setting an inspection region using a setting tool 103;
  • Embodiments described below relate to an image inspection apparatus that performs an appearance inspection using an image, and more particularly, to an inspection area setting apparatus that supports an operation of setting an inspection area for an image inspection apparatus.
  • This image inspection apparatus is suitably used for applications in which a large number of articles are continuously or automatically inspected in an FA production line or the like.
  • the type of article to be inspected is not limited, but the image inspection apparatus according to the present embodiment performs inspection by extracting a predetermined inspection area from the original image captured by the image sensor. It is assumed that the position and shape of the are fixed.
  • the inspection area setting device of the present embodiment can be suitably applied to any inspection.
  • the inspection region setting device is mounted in the form of one function (setting tool) of the image inspection device, but the image inspection device and the inspection region setting device may be configured separately.
  • FIG. 1 schematically shows the configuration of the image inspection apparatus.
  • the image inspection apparatus 1 is a system that performs an appearance inspection of an inspection object 2 that is transported on a transport path.
  • the image inspection apparatus 1 includes hardware such as an apparatus main body 10, an image sensor 11, a display device 12, a storage device 13, and an input device 14.
  • the image sensor 11 is a device for taking a color or monochrome still image or moving image into the apparatus main body 10, and for example, a digital camera can be suitably used. However, when a special image (such as an X-ray image or a thermo image) other than a visible light image is used for inspection, a sensor that matches the image may be used.
  • the display device 12 is a device for displaying an image captured by the image sensor 11, an inspection result, a GUI screen related to inspection processing and setting processing, and for example, a liquid crystal display can be used.
  • the storage device 13 is a device that stores various setting information (inspection area definition information, inspection logic, etc.), inspection results, and the like that the image inspection apparatus 1 refers to in the inspection processing.
  • various setting information inspection area definition information, inspection logic, etc.
  • inspection results and the like that the image inspection apparatus 1 refers to in the inspection processing.
  • an HDD, SSD, flash memory, network storage Etc. are available.
  • the input device 14 is a device that is operated by a user to input an instruction to the device main body 10.
  • a mouse, a keyboard, a touch panel, a dedicated console, or the like can be used.
  • the apparatus main body 10 can be configured as a computer including a CPU (Central Processing Unit), a main storage (RAM), and an auxiliary storage (ROM, HDD, SSD, etc.) as hardware.
  • An inspection processing unit 101, an inspection region extraction unit 102, and a setting tool 103 are provided.
  • the inspection processing unit 101 and the inspection area extraction unit 102 are functions related to the inspection processing, and the setting tool 103 is a function that supports setting work by the user of setting information necessary for the inspection processing. These functions are realized by loading a computer program stored in the auxiliary storage device or the storage device 13 into the main storage device and executing it by the CPU. Note that FIG.
  • the apparatus main body 10 may be configured by a computer such as a personal computer or a slate type terminal, or may be configured by a dedicated chip or an on-board computer.
  • FIG. 2 is a flowchart showing a flow of the inspection process
  • FIG. 3 is a diagram for explaining an inspection region extraction process in the inspection process.
  • the flow of the inspection process will be described by taking as an example inspection (detection of scratches and color unevenness) of the panel surface of the casing component of the mobile phone.
  • step S20 the inspection object 2 is photographed by the image sensor 11, and the image data is taken into the apparatus main body 10.
  • the captured image (original image) is displayed on the display device 12 as necessary.
  • the upper part of FIG. 3 shows an example of the original image.
  • a case part 2 to be inspected is shown in the center of the original image, and a part of the case part adjacent to the conveyance path is shown on the left and right sides thereof.
  • the inspection area extraction unit 102 reads necessary setting information from the storage device 13.
  • the setting information includes at least inspection area definition information and inspection logic.
  • the inspection area definition information is information that defines the position / shape of the inspection area to be extracted from the original image.
  • the format of the inspection area definition information is arbitrary. For example, a bit mask in which the label is changed between the inside and outside of the inspection area, vector data in which the outline of the inspection area is expressed by a Bezier curve or a spline curve, or the like can be used.
  • the inspection logic is information that defines the content of the inspection process, and includes, for example, the type of feature amount used for inspection, the determination method, the parameter used in feature amount extraction and determination processing, the threshold value, and the like.
  • the inspection region extraction unit 102 extracts a portion to be an inspection region from the original image according to the inspection region definition information.
  • the middle part of FIG. 3 shows a state in which the inspection area (indicated by cross hatching) 30 defined by the inspection area definition information is superimposed on the original image. It can be seen that the inspection region 30 just overlaps the panel surface of the casing component 2.
  • the lower part of FIG. 3 shows a state in which an image of the portion of the inspection region 30 (inspection region image 31) is extracted from the original image.
  • the inspection area image 31 the conveyance path and adjacent components that have been shown around the casing component 2 are deleted. Further, the hinge part 20 and the button part 21 that are excluded from the target parts for the surface inspection are also deleted.
  • the inspection area image 31 obtained in this way is delivered to the inspection processing unit 101.
  • step S23 the inspection processing unit 101 extracts a necessary feature amount from the inspection region image 31 according to the inspection logic.
  • the color of each pixel of the inspection region image 31 and its average value are extracted as the feature amount for inspecting the surface for scratches and color unevenness.
  • step S24 the inspection processing unit 101 determines the presence or absence of scratches or color unevenness according to the inspection logic. For example, when a pixel group in which the color difference with respect to the average value obtained in step S23 exceeds a threshold value, the pixel group can be determined as a flaw or color unevenness.
  • step S25 the inspection processing unit 101 displays the inspection result on the display device 12 or records it in the storage device 13.
  • the inspection process for one inspection object 2 is completed.
  • the processing of steps S20 to S25 in FIG. 2 is repeated in synchronization with the timing at which the inspection object 2 is conveyed within the angle of view of the image sensor 11.
  • the inspection area image 31 includes a background portion or an extra portion (in the example of FIG. 3, the hinge portion 20 or the button portion 21), the pixel may become noise and reduce the inspection accuracy. This is because if the inspection area image 31 is smaller than the range to be inspected, there is a risk of inspection leakage. Therefore, in the image inspection apparatus 1 according to the present embodiment, a setting tool 103 for easily creating inspection area definition information for cutting out an accurate inspection area image is prepared.
  • FIG. 4 is a flowchart showing a flow of processing for setting an inspection region using the setting tool 103
  • FIG. 5 is a diagram showing an example of an inspection region setting screen.
  • the setting screen shown in FIG. In this setting screen, an image window 50, an image capture button 51, a foreground designation button 52, a background designation button 53, a priority adjustment slider 54, and a confirmation button 55 are provided. Operations such as button selection and slider movement can be performed using the input device 14. Note that this setting screen is merely an example, and any UI may be used as long as parameter input and inspection area confirmation described below can be performed.
  • the setting tool 103 captures a sample of the inspection object by the image sensor 11 (step S40).
  • a sample a non-defective inspection object (a housing part in the above example) is used, and it is preferable to perform imaging in the same state (relative position between the image sensor 11 and the sample, illumination, etc.) as in the actual inspection process. .
  • the obtained sample image data is taken into the apparatus main body 10.
  • the setting tool 103 may read sample image data from the auxiliary storage device or the storage device 13. .
  • the sample image acquired in step S40 is displayed in the image window 50 of the setting screen as shown in FIG. 5 (step S41).
  • step S42 the user inputs foreground and background representative colors (representative brightness in the case of a monochrome image).
  • the foreground refers to a portion to be extracted as an inspection region
  • the background refers to a portion other than the inspection region.
  • the user presses the foreground designation button 52 on the setting screen to enter the foreground designation mode, and then designates a portion to be the foreground on the sample image displayed in the image window 50. Since the designation here is for the purpose of picking up a representative color of the foreground, in the example of FIG. 5, a part of pixels or a group of pixels on the panel surface of the casing component may be appropriately selected.
  • the foreground includes a pattern, a shadow, or a greatly different portion of color
  • the background designation button 53 is pressed to switch to the background designation mode. Note that it is not essential to input the foreground and background representative colors. Only one of the foreground and the background may be input, or when the representative color is known or when the representative color can be automatically calculated from the color distribution of the sample image, step S42 may be omitted. .
  • the setting tool 103 separates (samples) the sample image into the foreground and the background based on the foreground / background representative colors specified in step S42, and selects the foreground portion as an inspection region.
  • the edge information included in the sample image is also used, and a plurality of candidate areas that are candidate solutions of the inspection area are between the foreground and the background (that is, The degree of color separation (called the pixel separation) between the inside and outside of the candidate area, and the degree of overlap between the foreground and background borders (that is, the outline of the candidate area) and the edges in the sample image (This is called edge overlap) is comprehensively evaluated to search for an optimal solution that increases both pixel separation and edge overlap. A detailed calculation method of the inspection area will be described later.
  • step S44 the inspection area calculated in step S43 is displayed on the image window 50 of the setting screen.
  • the user can confirm whether or not a desired area is selected as the inspection area by looking at the inspection area displayed on the setting screen. At this time, it is preferable to overlay and display the inspection area on the sample image, because comparison between the inspection object and the inspection area becomes easy.
  • the setting tool 103 waits for input from the user (step S45).
  • the confirm button 55 is pressed, the setting tool 103 generates inspection area definition information for the current inspection area and stores it in the storage device 13 (step S46).
  • the user can adjust the parameters by operating the foreground designation button 52, the background designation button 53, and the priority adjustment slider 54 (step S47). If the representative color of the foreground or the background is designated again, the evaluation of the pixel separation degree described above is affected. Further, when the priority between the color information and the edge information is changed by the priority adjustment slider 54, the balance (weight) at the time of evaluating the pixel separation degree and the edge overlap degree can be changed.
  • the setting tool 103 When receiving the input (change) of the parameter from the user, the setting tool 103 recalculates the optimal solution for the inspection area using the new parameter as a constraint condition, and displays the inspection area after the recalculation on the screen (step S47). ⁇ S43, S44). With such a function, it is possible to repeat the calculation of the inspection area until a desired result is obtained while appropriately adjusting the parameters.
  • FIG. 6 shows an example of the process of driving the inspection area by parameter adjustment.
  • the inspection area 30 obtained by the first calculation is shown in the upper part.
  • the hinge part 20 and the button part 21 of the housing part are also included in the inspection area 30, but here the hinge part 20 and the button are used for the purpose of inspecting the panel surface for scratches and color unevenness.
  • the part 21 is to be excluded from the examination area (see FIG. 3). Therefore, first, the user presses the background designation button 53 to switch to the background designation mode, and additionally designates the color of the button portion 21 in the sample image as the representative color of the background. As a result, the button portion 21 is removed from the inspection region 30 as in the image example shown in the middle.
  • the hinge portion 20 is dealt with by adjusting the balance parameter because the color difference from the panel surface is small. That is, paying attention to the edge generated at the step between the hinge portion 20 and the panel surface, the priority adjustment slider 54 increases the priority of the edge information. As a result, as in the image example shown in the lower part, the contour of the inspection region 30 is set at the edge between the hinge portion 20 and the part surface, and the desired inspection region 30 is formed.
  • the setting tool 103 comprehensively evaluates both the pixel separation degree between the foreground and the background and the edge overlap degree of the boundary between the foreground and the background, so that a candidate for the inspection region can be obtained.
  • This calculation can be regarded as an optimization problem that minimizes (or maximizes) an objective function including a function that evaluates pixel separation based on color information and a function that evaluates edge overlap based on edge information.
  • a method for solving the inspection region optimization problem using the graph cut algorithm will be described. Since the graph cut algorithm is a known technique (see Non-Patent Document 1), the description of the basic concept of the graph cut algorithm is omitted in this specification, and the following description focuses on the parts specific to this embodiment. Do.
  • an energy function is defined as the following equation as an objective function, and a solution L that minimizes the energy E when I is given is obtained.
  • I is a sample image
  • L is a label (that is, an inspection region) indicating whether it is foreground or background.
  • i and j are pixel indexes
  • is a pixel group in the image I
  • N is an adjacent pixel pair group in the image I.
  • li and lj are designated labels for pixels i and j, respectively. It is assumed that a label “1” is given for the foreground and “0” is given for the background.
  • the first term on the right side is called a data term and gives a constraint condition for the target pixel i.
  • the second term on the right-hand side is called a smoothing term and gives a constraint on the pixels i and j adjacent to each other.
  • is a balance parameter that determines the weight (balance) of the data term and the smoothing term.
  • the data term is defined by a function that evaluates pixel separation based on the color information described above.
  • the evaluation function U of the data term may be defined by the following formula.
  • the probability density function in the foreground likelihood the one estimated from the foreground representative color (for example, the color distribution of the foreground representative color approximated by a Gaussian mixture model) is used.
  • the probability density function in the background likelihood uses a value estimated from the background representative color (for example, a color distribution of the background representative color approximated by a Gaussian mixture model). That is, the data term represents the sum of the foreground likelihood of each foreground pixel and the background likelihood of each background pixel. The closer the foreground pixel color is to the foreground representative color, the closer the background pixel color is to the background representative color. The energy decreases, and conversely, the energy increases as the foreground pixel color moves away from the foreground representative color, and as the background pixel color moves away from the background representative color.
  • the smoothing term is defined by a function that evaluates the degree of edge overlap based on the edge information described above.
  • the evaluation function V of the smoothing term can be defined by the following equation.
  • Ii and Ij are pixel values (color or luminance) of the pixels i and j, respectively, and ⁇ is a coefficient.
  • ⁇ Ii ⁇ Ij ⁇ 2 represents a difference (distance) of pixel values in a predetermined color space, that is, the height of contrast between pixels.
  • the energy increases when the contrast of the pixels i and j is low, and the energy decreases when the contrast is high.
  • the portion where the contrast of adjacent pixels is high is a portion where the color or brightness in the image is greatly changed, that is, an edge portion in the image. That is, in the above formula, the energy decreases as the boundary between the foreground and the background (pixel pairs having different labels) overlaps the edge in the image.
  • the energy function described above has a global minimum solution when a certain mathematical condition (submodularity) is satisfied. Similarly, a global minimum solution can be obtained with constraints by adding terms satisfying submodularity. Note that a known search algorithm may be used for an efficient solution of the global minimum solution, and a detailed description thereof is omitted here.
  • “foreground representative color” and “background representative color” affect the value of the data item.
  • the “priority of color information and edge information” corresponds to the balance parameter ⁇ . That is, if the user increases the priority of color information, the value of parameter ⁇ is decreased to increase the weight of the data term, and if the user increases the priority of edge information, the value of parameter ⁇ is increased and smoothed. The term weight is increased. Note that the value of the parameter ⁇ can be automatically determined by a computer (setting tool 103).
  • the setting tool 103 calculates the difference between the foreground representative color and the background representative color, and when the difference is large, the value of the parameter ⁇ is decreased and the weight of the data term is increased. This is because if the difference between the foreground and background colors is clear, it can be estimated that the reliability of the data term is high. Conversely, when the difference between the foreground representative color and the background representative color is small, the value of the parameter ⁇ is increased and the weight of the smoothing term is increased. This is because when the difference between the foreground and background colors is not clear, the region division based on the edge information tends to give better results than the color information.
  • the initial value of the balance parameter ⁇ is automatically determined by the above method, and the balance parameter ⁇ (priority of color information and edge information) is adjusted by the user using the initial value as a starting point. This is because it can be expected that the higher the validity of the initial value, the more the number of trials and errors of the user can be reduced, and the workload for parameter adjustment can be reduced.
  • the sum of the foreground likelihood (foreground likelihood) of the foreground pixel and the background likelihood (background likelihood) of the background pixel is used as a data term.
  • a product of foreground-likeness and background-likeness, a weighted sum, a weighted product, a nonlinear function sum, a nonlinear function product, or the like may be used.
  • a monotonically increasing function may be used as the nonlinear function.
  • only the foreground or background evaluation can be used as the pixel separation degree.
  • Equation (2) a function that satisfies U (li
  • Equation (4) is a function that evaluates only the foreground quality.
  • foreground-likeness calculation may use all foreground pixels (that is, all pixels inside the candidate area) or only some foreground pixels.
  • all background pixels that is, all pixels outside the candidate area
  • only some of the background pixels may be used in calculating the background likelihood.
  • the calculation time can be shortened by excluding the pixels for which the label is determined from the calculation, or by using only the pixels within a predetermined distance from the outline of the candidate area for the calculation.
  • the function for evaluating the foreground quality or the background quality is not limited to the expression (2).
  • a likelihood ratio that is a ratio between the foreground likelihood and the background likelihood can be used as in the following equation.
  • the histogram of the pixel group designated as the foreground representative color by the user is directly used (without estimating the probability density function), and the foreground likelihood is evaluated based on the similarity of the color of each pixel to the foreground representative color histogram, or vice versa.
  • the background likelihood may be evaluated based on the degree of color difference of each pixel with respect to the foreground representative color histogram.
  • the background likelihood is evaluated based on the similarity to the histogram (background representative color histogram) of the pixel group designated as the background representative color by the user, or the foreground likelihood is evaluated based on the difference from the background representative color histogram. May be.
  • the similarity or dissimilarity between the foreground histogram obtained from the foreground pixel group of the candidate area and the background histogram obtained from the background pixel group, and the foreground representative color histogram or background representative color histogram is determined by a predetermined function or distance. You may calculate using a parameter
  • the three parameters of the foreground representative color, the background representative color, and the priority of the color information and the edge information have been described. Any parameter can be used.
  • industrial products are mainly used for visual inspection, there are cases in which the shape, texture, topology, elements adjacent to the inspection area, elements included in the inspection area, etc. are characteristic. Many.
  • the inspection object is set so that it fits within the angle of view when the image sensor is installed, the size of the portion serving as the inspection region and the position in the image can be predicted to some extent.
  • the shape information that represents the characteristics related to the shape of the inspection area is often the basic shape of the inspection area (circular, quadrilateral, triangular, star shape, etc.) and the characteristics of the outline (linear outline, round outline, jaggedness) Certainly can be used.
  • a UI for inputting shape information a list of basic shape templates and outline features may be displayed in a list, and the user may select a corresponding one from the list.
  • a basic shape template is designated, for example, the following expression may be inserted as a constraint condition.
  • li is a designated label of pixel i
  • ti is a label of a point corresponding to pixel i on the template.
  • T () represents affine transformation.
  • the above expression represents an operation of performing template matching on the candidate region while enlarging / reducing, rotating, and deforming the designated template, and calculating the minimum score. That is, by adding this constraint condition, the energy of the region having a shape close to the basic shape designated by the user is reduced, and the optimum solution is preferentially selected.
  • the jaggedness or smoothness is designated as the contour feature
  • the following expression may be inserted as a constraint condition.
  • S is a point on the contour of the foreground area
  • is a gradient angle of the contour
  • ⁇ / ⁇ S represents a change amount of the gradient angle along the contour of the foreground region
  • C is a constant indicating the jaggedness (smoothness) specified by the user, and the greater the jaggedness, the larger C, and the smoother, the smaller C.
  • the above equation is a function for evaluating whether or not the total value of the change amount of the gradient angle of the contour of the foreground region (representing the jaggedness of the contour) is close to the value C (representing the specified jaggedness). That is, by adding this constraint condition, a region having a contour feature close to the jaggedness specified by the user is preferentially selected as the optimum solution.
  • the size information representing the characteristics related to the size of the inspection region the area of the inspection region, the length and width, and the like can be used.
  • the following expression may be inserted as a constraint condition.
  • C is the area (number of pixels) of the foreground region designated by the user. Since the foreground label is 1 and the background label is 0, ⁇ li represents the total number of foreground pixels, that is, the area of the foreground region. Therefore, the above expression is a function for evaluating whether the area of the foreground region is close to the designated area C.
  • a region having a size close to the user-specified area is preferentially selected as the optimum solution.
  • the barycentric coordinates of the inspection region As the position information representing the feature related to the position of the inspection region in the image, the barycentric coordinates of the inspection region, the existence range of the inspection region (upper, lower, right, left, center,%) Can be used.
  • the barycentric coordinates are input as the position information, for example, the following expression may be inserted as a constraint condition.
  • w is the barycentric coordinate of the foreground area
  • C is the barycentric coordinate specified by the user.
  • the above expression is a function for evaluating whether or not the barycentric coordinates of the foreground region are close to the designated coordinates C.
  • a region having a center of gravity at a position close to user-specified coordinates is preferentially selected as the optimum solution.
  • texture information representing the characteristics related to the texture of the inspection region information representing the pattern, color shading, unevenness, material, etc. in the inspection region can be used.
  • various texture templates may be displayed in a list and the user may select a corresponding one from the list.
  • the following expression may be inserted as a constraint condition.
  • I is a sample image
  • E is a texture template designated by the user.
  • h 1 1 () represents a color histogram of the foreground pixels
  • f () is a function indicating the similarity of the histograms.
  • the above expression is a function for evaluating whether the color histogram of the foreground area in the sample image is similar to the color histogram of the designated texture.
  • the setting tool 103 can allow the user to arbitrarily select which of the priority of the color information and the edge information is given priority on the setting screen. For example, in the case of an image with many pseudo contours, such as a pattern included in the foreground or background, it is likely that better results will be obtained if color and brightness information is prioritized over edge information. In the case of images with similar colors, it is more likely that better results will be obtained if priority is given to edge information. It is very difficult to reach a correct answer completely automatically for such an image where it is difficult to separate the foreground and the background.
  • contour correction tool As an example of the inspection area correction function provided by the setting tool of the present embodiment, (1) contour correction tool, (2) contour drawing tool, (3) arc conversion tool, (4) straight line conversion tool, (5) Describes the draw tool. These tools may be activated, for example, from the setting screen of FIG.
  • the configuration of the image inspection apparatus, the operation of the inspection process, the operation of the automatic calculation (optimization) of the inspection area, and the like are the same as those in the first embodiment, and thus description thereof is omitted.
  • FIG. 7 is a diagram for explaining an operation example of the contour correction tool.
  • (A) shows an image of the inspection object (sample) 70
  • (b) shows an automatic calculation result of the inspection area 71. It is assumed that there is a deviation as shown in the figure between the contour of the inspection object 70 and the contour of the inspection region 71.
  • the contour correction tool When the user activates the contour correction tool, the contour correction tool first approximates the contour of the inspection area 71 with a path 72 of a Bezier curve or a spline curve, and displays the path 72 together with the control point 73 on the screen as shown in FIG. . At this time, the path 72 and the control point 73 are overlaid on the image of the inspection object 70.
  • the user can freely correct the shape of the path 72 by correcting, adding, or deleting the control point 73 using the input device 14.
  • the result corrected by the user is immediately reflected in the screen display. Therefore, the user can easily adjust the shape of the path 72 to the contour of the inspection area 71 while confirming on the screen.
  • (D) shows the path 72 after correction.
  • the contour correction tool converts the area surrounded by the path 72 into the inspection area 71. Thereby, the inspection area 71 having the shape intended by the user is obtained.
  • FIG. 8 is a diagram for explaining an operation example of the outline drawing tool.
  • (A) is an enlarged view of an image of the inspection object 70 and a part of the automatically calculated inspection area 71. Assume that the contour of the inspection object 70 and the contour of the inspection region 71 are shifted as shown in the figure.
  • the mode is switched to the contour drawing mode, and the free curve 74 can be drawn on the image using the input device 14.
  • the input device 14 For example, when a mouse is used as the input device 14, the trajectory of the movement of the mouse cursor between the press of the mouse button and the release is drawn as the free curve 74. If drawing of the free curve 74 fails, it is only necessary to exit from the contour drawing mode and start again from the beginning.
  • the contour drawing tool causes the free curve 74 and the inspection region 71 to be a part of the contour of the inspection region 71. And synthesize. (C) has shown the test
  • a method of combining the free curve 74 and the inspection area 71 is arbitrary. For example, a smoothing process may be applied to smooth the connecting portion between the free curve 74 and the contour of the inspection region 71 and the shape of the free curve 74.
  • the free curve 74 and the contour of the inspection region 71 may be joined at the closest point, or the free curve 74 and the contour of the inspection region 71 may be joined. May be interpolated so as to connect them smoothly.
  • FIG. 9 is a diagram for explaining an operation example of the arc conversion tool.
  • (A) is an enlarged view of an image of the inspection object 70 and a part of the automatically calculated inspection area 71. Assume that the contour of the inspection object 70 and the contour of the inspection region 71 are shifted as shown in the figure.
  • the input device 14 can be used to input an arc on the image.
  • the mouse cursor is moved as shown in (b), so that two points (1, 2) on the contour of the examination area 71 and a passing point (3) of the arc (3) Click the mouse at the three locations.
  • the points 1 and 2 are set as the start point and end point of the arc, and the arc passing through the point 3 is calculated and displayed as an overlay on the image.
  • the position of each point may be corrected or the arc input mode may be temporarily exited and the operation may be repeated from the beginning.
  • the arc is designated by the three points of the arc start point, end point, and passing point.
  • the arc may be input by other designation methods.
  • the arc conversion tool displays the outline of the section between the start point (1) and the end point (2) in the outline of the inspection area 71.
  • the arc and the contour of the inspection region 71 may be joined at the closest point, or the arc and the inspection region 71 may be joined. Interpolation may be performed so that the contour is smoothly connected.
  • FIG. 10 is a diagram for explaining an operation example of the line conversion tool.
  • (A) is an enlarged view of an image of the inspection object 70 and a part of the automatically calculated inspection area 71. Assume that the contour of the inspection object 70 and the contour of the inspection region 71 are shifted as shown in the figure.
  • the input device 14 can be used to input a straight line segment on the image.
  • the mouse cursor is moved and the mouse is clicked at two points (1, 2) on the contour of the inspection area 71 as shown in FIG. Then, a line segment with the points 1 and 2 as the start point and the end point is calculated and displayed as an overlay on the image. If the shape of the line segment is different from the intended shape, the position of each point may be corrected, or the operation may be restarted from the beginning after exiting the straight line input mode.
  • a straight line is designated by two points of a start point and an end point, but it is of course possible to input a straight line by other designation methods.
  • the straight line conversion tool displays the contour of the section between the start point (1) and the end point (2) in the contour of the inspection area 71. Replace with minutes.
  • the line segment and the contour of the inspection region 71 may be joined at the closest point, or the line segment and the inspection region may be joined. Interpolation may be performed so as to smoothly connect the 71 contours.
  • FIG. 11 is a diagram illustrating an operation example of the draw tool.
  • (A) is an enlarged view of an image of the inspection object 70 and a part of the automatically calculated inspection area 71. Since the drawing tool corrects the inspection area 71 in units of pixels, FIG. 11 shows a pixel grid for convenience of explanation. The contour of the inspection object 70 and the contour of the inspection area 71 are shifted as shown in the figure, and it is assumed that the inspection area 71 is too small in the upper part of the figure and the inspection area 71 is too large on the right side of the figure. .
  • the drawing mode is switched, and the input device 14 can be used to specify pixels to be added to the inspection area 71 on the image and to specify pixels to be deleted from the inspection area 71.
  • (B) shows how pixels are added to the inspection area. For example, when a mouse is used as the input device 14, an area (pixel group) to be added to the inspection area 71 by sequentially selecting pixels to be added or moving the mouse cursor while pressing a predetermined button. 75 can be specified.
  • (c) shows a state in which pixels are deleted from the inspection area.
  • the designation of the area (pixel group) 76 to be deleted from the inspection area 71 can also be performed in the same manner as the addition.
  • the configuration of the present embodiment described above by providing a function for reworking the shape of the inspection region, it is possible to supplement a difficult part by automatic extraction by a computer with the assistance of the user, and as a result, It is possible to obtain an optimal inspection area (that is, a shape desired by the user) in a short time.
  • the five correction functions (1) to (5) have been described.
  • the setting tool does not have to include all the correction functions. At least one of the correction functions may be provided.
  • the setting tool has other correction functions.
  • the above-described embodiments show specific examples of the present invention, and are not intended to limit the scope of the present invention to these specific examples.
  • color information of the image is used.
  • luminance information may be used instead of the color information.
  • the graph cut algorithm is used for optimization, but other methods such as a level set algorithm can also be used.
  • the inspection area can be calculated with high accuracy by using the color information (luminance information) and the edge information. Also in this case, it is preferable that the priority of color information (luminance information) and edge information can be changed by the user.
  • Image inspection device 2 Inspection object (casing part) 10: device main body, 11: image sensor, 12: display device, 13: storage device, 14: input device, 101: inspection processing unit, 102: inspection region extraction unit, 103: setting tool 20: hinge portion, 21: button Portion 30: Inspection area 31: Inspection area image 50: Image window 51: Image capture button 52: Foreground designation button 53: Background designation button 54: Priority adjustment slider 55: Confirm button 70: Inspection object Object 71: inspection area 72: pass 73: control point 74: free curve

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Quality & Reliability (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Analytical Chemistry (AREA)
  • Chemical & Material Sciences (AREA)
  • Biochemistry (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Probability & Statistics with Applications (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)
  • Length Measuring Devices By Optical Means (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

 画像検査装置に、検査対象物のサンプルを画像センサで撮影して得られたサンプル画像を用いて検査処理で用いる検査領域をあらかじめ設定する検査領域設定手段を設ける。検査領域設定手段は、サンプル画像における各ピクセルの色又は輝度の情報、及び、サンプル画像に含まれるエッジの情報に基づいて、検査領域の内側と外側の間での色又は輝度のピクセル分離度と、検査領域の輪郭とエッジとのエッジ重なり度の両方を評価することにより、検査領域の最適解を求める。また、検査領域設定手段は、ユーザから入力されたバランスパラメタに応じて、ピクセル分離度とエッジ重なり度を評価する際の重みを調整する。

Description

画像検査装置の検査領域設定方法
 本発明は、画像による外観検査を行う画像検査装置に関する。
 生産ラインにおける検査の自動化・省力化のために、画像による外観検査を行う画像検査装置が広く利用されている。外観検査の種類や手法には様々なものが存在するが、基本的な構成は、画像センサ(カメラ)で検査対象物を撮影し、得られた画像から検査領域となる部分を抽出し、その検査領域の部分の画像の特徴を解析・評価することで、目的の検査(例えば、良/不良の判定、仕分け、情報取得など)を行うというものである。
 この種の画像検査装置においては、検査処理を開始する前に、検査領域の設定などの準備作業を行う必要がある。一般的な装置では、検査領域を設定するための専用のツールが用意されており、ユーザはそのツールを使用して検査対象物や検査目的などに応じた適切な検査領域を自ら設定できるようになっている。しかしながら、従来のツールは、円・四角形などの単純図形又はその組み合わせで検査領域を定義する機能しか持ってない。したがって、検査対象物の形状が複雑もしくは特殊な場合には、検査対象物の輪郭に検査領域を正確に合わせることができないことがある。また単純図形の組み合わせで検査対象物の輪郭を表現できる場合であっても、組み合わせる図形の数が多くなると検査領域の設定に多大な時間と作業負担を要してしまう。近年では、多品種少量生産での効率向上のために段取り時間をできるだけ短縮したいというニーズが強く、検査領域の設定に手間がかかるのは望ましくない。しかしその一方で、製品形状の複雑化や検査内容の高度化・細分化に対応するため、また検査の精度や信頼性の向上のために、検査の対象とすべき部分のみに検査領域を正確に設定したいというニーズも強い。
 検査領域を自動で設定する手法としては、従来、二値化や色域抽出による検査領域抽出手法が知られている。つまり、画像の中から予め設定された輝度範囲もしくは色域に該当するピクセル群を抽出し、そのピクセル群を検査領域とする手法である。この手法は、検査領域として抽出したい部分(前景)とそれ以外の部分(背景)の輝度もしくは色のコントラストが高い場合には有効であり、例えば、ベルトコンベア上を搬送される物品の画像から物品部分のみを抽出する処理などに利用されている。この手法を用いれば上述した複雑な形状への対応、設定作業の簡単化といった課題はある程度解決されるが、依然として下記のような課題が残る。
 検査領域として抽出したい前景部分に照明などの影響による陰影があったり、前景部分が様々な輝度もしくは色で構成されていたり、背景の中に前景部分に近い色が存在していたりすると、二値化や色域抽出では前景部分のみを正確に抽出することは困難である。最近では、検査内容の高度化や細分化が進み、例えば成型加工部品における1つの切削面だけを対象とした表面検査を行いたいとか、多数の部品が実装されたプリント基板上の1つの部品だけを検査したいなど、背景と前景の色差がほとんど無いケースも現に多い。また、二値化や色域抽出は、画像のピクセル毎に行われるので、ノイズや照明変動の影響を受けやすく、抽出した検査領域の中にピクセルの抜けがあったり、逆に背景部分から飛び地のようにピクセルが選択されてしまったりして、検査精度を低下させるという問題もある。
 特許文献1には、検査領域の設定方法として、検査対象部品のCADデータから検査領域の位置や大きさを設定する方法、部品実装前と後の2枚の画像の差分をとることで検査すべき領域を認識する方法などが開示されている。これらの方法を使えば検査領域を自動で設定することが可能であるが、これらの方法は適用できる対象が限られてしまい、汎用性に欠ける。
特開2006-58284号公報
Y. Boykov and M.-P. Jolly: "Interactive Graph Cuts for Optimal Boundary & Region Segmentation of Objects in N-D images", ICCV2001, 01, p. 105 (2001).
 本発明は上記実情に鑑みてなされたものであり、その目的とするところは、複雑な形状や特殊な形状の対象の場合や、前景と背景の色が紛らわしい場合であっても、簡単かつ高精度に検査領域を設定することを可能にする技術を提供することにある。
 上記目的を達成するために、本発明では、検査対象物のサンプル画像に対し、色・輝度の情報とエッジの情報を総合的に評価することにより、検査領域の最適解を探索することで、自動もしくは半自動で検査領域を設定することを要旨とする。
 具体的には、本発明は、検査対象物を撮影して得られた元画像から検査領域とする部分を検査領域画像として抽出し、前記検査領域画像を解析することにより前記検査対象物の検査を行う画像検査装置に対して、前記検査領域を定義する検査領域定義情報を設定する検査領域設定方法であって、コンピュータが、検査対象物のサンプルを撮影して得られたサンプル画像を取得する取得ステップと、コンピュータが、前記サンプル画像における各ピクセルの色又は輝度の情報、及び、前記サンプル画像に含まれるエッジの情報に基づいて、検査領域の候補解である複数の候補領域について、各候補領域の内側と外側の間での色又は輝度の分離の度合いであるピクセル分離度と、各候補領域の輪郭と前記サンプル画像中のエッジとの重なりの度合いであるエッジ重なり度の両方を評価することにより、前記複数の候補領域の中から検査領域の最適解を求める検査領域探索ステップと、コンピュータが、前記検査領域探索ステップで求められた検査領域の画像内での位置及び形状を定義する検査領域定義情報を前記画像検査装置に対して設定する設定ステップと、を有する。
 この構成によれば、サンプル画像を用いた最適解探索により検査領域の位置及び形状が決められるため、従来のように単純図形で検査領域を手入力するのに比べ、設定時間及び作業負荷を大幅に軽減できると共に、複雑な形状や特殊な形状に対しても適用が可能である。また、色・輝度の情報に加えてエッジの情報も用い、検査領域の内側と外側の間での色又は輝度のピクセル分離度と検査領域の輪郭のエッジ重なり度の両方を総合的に評価することで、二値化や色域抽出といった従来手法に比べて、領域の抽出精度を向上することができる。
 コンピュータがユーザからパラメタの入力を受け付けるパラメタ受付ステップ、をさらに有しており、コンピュータが、前記パラメタ受付ステップでユーザからパラメタの入力を受け付ける毎に、入力されたパラメタを拘束条件として用いて前記検査領域探索ステップを実行することにより検査領域の最適解を再計算し、再計算された検査領域を表示装置に表示することが好ましい。
 この構成によれば、ユーザは表示装置に表示された検査領域を見ることで、所望の領域が検査領域として選ばれているかどうかを容易に確認することができる。そして、検査領域が適当でない場合には、パラメタを適宜調整しながら再計算結果を即座に画面上で確認することができるため、所望の検査領域に追い込んでいくことが容易にできる。
 前記パラメタ受付ステップでは、パラメタの一つとして、前記ピクセル分離度と前記エッジ重なり度のバランスを調整するためのバランスパラメタをユーザに入力させ、前記検査領域探索ステップでは、ユーザから入力されたバランスパラメタに応じて、前記ピクセル分離度と前記エッジ重なり度を評価する際の重みを調整することが好ましい。
 このようにバランスパラメタをユーザ調整可能とすることで、前景と背景の自動切り分けが難しい画像であっても、簡単に且つ短時間で所望の検査領域を設定できるようになる。
 前記検査領域探索ステップでは、前景の代表色又は代表輝度に対する候補領域の内側の各ピクセルの色又は輝度の前景らしさを評価した値、或いは、背景の代表色又は代表輝度に対する候補領域の外側の各ピクセルの色又は輝度の背景らしさを評価した値、或いは、その両方の値を総合した値を前記ピクセル分離度とすることが好ましい。
 この構成によれば、検査領域内のピクセルの前景らしさが高く、且つ、検査領域外のピクセルの背景らしさが高いほど、ピクセル分離度が高いという評価となる。このように前景や背景の代表となる色・輝度を定め、それらを基準として検査領域の探索を行うことにより、妥当な解に到達する可能性を格段に高めることができる。なお、前景らしさを評価した値を計算する際には、候補領域の内側の全ピクセルを用いてもよいし、一部のピクセルだけを用いてもよい。同様に、背景らしさを評価した値を計算する際には、候補領域の外側の全ピクセルを用いてもよいし、一部のピクセルだけを用いてもよい。
 前記検査領域探索ステップでは、前景の代表色又は代表輝度と背景の代表色又は代表輝度との差が大きいほど前記ピクセル分離度の重みが大きくなり、前記差が小さいほど前記エッジ重なり度の重みが大きくなるように、前記ピクセル分離度と前記エッジ重なり度を評価する際の重みを調整することが好ましい。
 この構成は、上述したバランスパラメタをユーザが調整するのではなく、自動で適切な値に調整するというものである。これにより、ユーザの補助が無い状態でも妥当な解に到達できる可能性を高めることができる。
 前記パラメタ受付ステップにおいて、パラメタの一つとして、前景若しくは背景若しくはその両方の代表色又は代表輝度をユーザに入力させるようにすると、妥当な解に到達する可能性をより一層高めることができる。
 このとき、前記パラメタ受付ステップでは、前記サンプル画像を表示装置に表示し、前記表示されたサンプル画像上で前景若しくは背景とすべき部分をユーザに指定させ、前記指定された部分の色又は輝度を前記代表色又は代表輝度として取得することが好ましい。この構成によれば、簡単に且つ間違いなく代表色や代表輝度を指定することができる。
 パラメタとしては、上述したものの他、検査領域の最適解探索に影響を及ぼし得るものであれば、どのようなパラメタを与えても良い。例えば、検査領域の形状、大きさ、画像内での位置、テクスチャ、トポロジ、隣接要素、内包要素などに関する特徴を表す情報をパラメタとして与え、ピクセル分離度とエッジ重なり度に加え、検査領域の特徴とこれらのパラメタで与えられた特徴との類似度合も高くなるように、検査領域の解探索を行えばよい。このように検査領域の各種特徴を拘束条件とすることで、妥当な解に到達する可能性をより一層高めることができる。
 パラメタの調整だけでは所望の検査領域に到達できない、又は、パラメタの試行錯誤に時間がかかる場合も想定されるため、前記検査領域探索ステップで求められた検査領域を表示装置に表示し、ユーザから入力される修正指示にしたがって検査領域の形状を修正する検査領域修正ステップを有していることが好ましい。このように検査領域の形状を修正可能とすることで、計算機による自動抽出では難しい部分をユーザの支援で補完することができ、結果として簡単かつ短時間に最適な検査領域を得ることが可能となる。
 検査領域を修正するための操作系には様々なものが考えられる。例えば、検査領域の輪郭の全部又は一部をベジェ曲線若しくはスプライン曲線のパスで近似し、前記パスをユーザに修正させるようにしてもよい。これにより、検査領域の輪郭を簡単に所望の形状に修正することができる。また、ユーザに自由曲線を描画させ、前記自由曲線が検査領域の輪郭の一部となるように前記自由曲線と検査領域とを合成するような操作系や、ユーザに検査領域の輪郭の一部の区間を指定させ、指定された区間の輪郭を直線又は円弧に置き換えるような操作系や、ユーザにより指定されたピクセルを検査領域に追加し、又は検査領域から除外するような操作系も好ましい。
 なお、本発明は、上記手段の少なくともいずれかを有する画像検査装置として捉えることもできるし、上記の検査領域設定に関わる手段の少なくともいずれかを有する画像検査装置のための検査領域設定装置として捉えることもできる。また本発明は、上記処理の少なくともいずれかを実行する画像検査方法もしくは検査領域設定方法、または、かかる方法をコンピュータに実行させるためのプログラムやこのプログラムを記録した記憶媒体として捉えることもできる。
 本発明によれば、複雑な形状や特殊な形状の対象の場合や、前景と背景の色が紛らわしい場合であっても、簡単かつ高精度に検査領域を設定することができる。
画像検査装置の構成を模式的に示す図。 検査処理の流れを示すフローチャート。 検査処理における検査領域の抽出過程を説明するための図。 設定ツール103を用いて検査領域を設定する処理の流れを示すフローチャート。 検査領域設定画面の一例を示す図。 パラメタ調整により検査領域を追い込んでいく過程の一例を示す図。 輪郭修正ツールの動作例を説明する図。 輪郭描画ツールの動作例を説明する図。 円弧変換ツールの動作例を説明する図。 直線変換ツールの動作例を説明する図。 ドローツールの動作例を説明する図。
 以下に図面を参照して本発明の好適な実施の形態について詳しく説明する。
 以下に述べる実施形態は、画像による外観検査を行う画像検査装置に関し、詳しくは、画像検査装置に対して検査領域を設定する作業を支援するための検査領域設定装置に関するものである。この画像検査装置は、FAの生産ラインなどにおいて多数の物品を自動もしくは半自動で連続的に検査する用途などに好適に利用されるものである。検査対象となる物品の種類は問わないが、本実施形態の画像検査装置では画像センサで撮像された元画像から予め決められた検査領域を抽出して検査を行うため、元画像中の検査領域の位置・形状が固定であることが前提となる。外観検査の目的や検査項目には様々なものが存在するが、本実施形態の検査領域設定装置はいずれの検査に対しても好適に適用することができる。なお本実施形態では、画像検査装置の一機能(設定ツール)という形で検査領域設定装置が実装されているが、画像検査装置と検査領域設定装置とを別々の構成としてもよい。
 <第1実施形態>
 (画像検査装置)
 図1は、画像検査装置の構成を模式的に示している。この画像検査装置1は、搬送路上を搬送される検査対象物2の外観検査を行うシステムである。
 図1に示すように、画像検査装置1は、装置本体10、画像センサ11、表示装置12、記憶装置13、入力装置14などのハードウエアから構成される。画像センサ11は、カラー又はモノクロの静止画像あるいは動画像を装置本体10に取り込むためのデバイスであり、例えばデジタルカメラを好適に用いることができる。ただし、可視光像以外の特殊な画像(X線画像、サーモ画像など)を検査に利用する場合には、その画像に合わせたセンサを用いればよい。表示装置12は、画像センサ11で取り込まれた画像、検査結果、検査処理や設定処理に関わるGUI画面を表示するためのデバイスであり、例えば液晶ディスプレイなどを用いることができる。記憶装置13は、画像検査装置1が検査処理において参照する各種の設定情報(検査領域定義情報、検査ロジックなど)や検査結果などを格納するデバイスであり、例えばHDD、SSD、フラッシュメモリ、ネットワークストレージなどを利用可能である。入力装置14は、ユーザが装置本体10に対し指示を入力するために操作するデバイスであり、例えばマウス、キーボード、タッチパネル、専用コンソールなどを利用可能である。
 装置本体10は、ハードウエアとして、CPU(中央演算処理装置)、主記憶装置(RAM)、補助記憶装置(ROM、HDD、SSDなど)を備えたコンピュータで構成することができ、その機能として、検査処理部101、検査領域抽出部102、設定ツール103を有している。検査処理部101と検査領域抽出部102が検査処理に関わる機能であり、設定ツール103は検査処理に必要な設定情報のユーザによる設定作業を支援する機能である。これらの機能は、補助記憶装置又は記憶装置13に格納されたコンピュータ・プログラムが主記憶装置にロードされ、CPUによって実行されることで実現される。なお、図1は装置構成の一例を示すものにすぎず、画像センサ11、表示装置12、記憶装置13、入力装置14の全部又は一部を装置本体10に一体化してもよい。なお装置本体10は、パーソナルコンピュータやスレート型端末のようなコンピュータで構成してもよいし、或いは、専用チップやオンボードコンピュータなどで構成することもできる。
 (検査処理)
 図2及び図3を参照して、画像検査装置1の検査処理に関わる動作を説明する。図2は、検査処理の流れを示すフローチャートであり、図3は、検査処理における検査領域の抽出過程を説明するための図である。ここでは、説明の便宜のため、携帯電話の筐体部品のパネル面の検査(キズ、色ムラの検出)を例に挙げて検査処理の流れを説明する。
 ステップS20では、画像センサ11によって検査対象物2が撮影され、画像データが装置本体10に取り込まれる。ここで取り込まれた画像(元画像)は必要に応じて表示装置12に表示される。図3の上段は元画像の一例を示している。元画像の中央に検査対象となる筐体部品2が写っており、その左右には搬送路上の隣にある筐体部品の一部が写り込んでいる。
 ステップS21では、検査領域抽出部102が、記憶装置13から必要な設定情報を読み込む。設定情報には、少なくとも検査領域定義情報と検査ロジックとが含まれる。検査領域定義情報とは、元画像から抽出すべき検査領域の位置・形状を定義する情報である。検査領域定義情報の形式は任意であり、例えば検査領域の内側と外側とでラベルを変えたビットマスクや、検査領域の輪郭をベジェ曲線やスプライン曲線で表現したベクタデータなどを用いることができる。検査ロジックとは、検査処理の内容を定義する情報であり、例えば、検査に用いる特徴量の種類、判定方法、特徴量抽出や判定処理で用いるパラメタや閾値などが該当する。
 ステップS22では、検査領域抽出部102が、検査領域定義情報にしたがって、元画像から検査領域とする部分を抽出する。図3の中段は、検査領域定義情報で定義された検査領域(クロスハッチングで示す)30を元画像に重ねた様子を示している。検査領域30がちょうど筐体部品2のパネル面の上に重なっていることがわかる。図3の下段は、元画像から検査領域30の部分の画像(検査領域画像31)を抽出した様子を示している。検査領域画像31では、筐体部品2のまわりに写っていた搬送経路や隣の部品が削除されている。また、表面検査の対象部位から除外される、ヒンジ部分20やボタン部分21も削除されている。このようにして得られた検査領域画像31は検査処理部101に引き渡される。
 ステップS23では、検査処理部101が、検査ロジックにしたがって、検査領域画像31から必要な特徴量を抽出する。本例では、表面のキズ・色ムラの検査を行うための特徴量として、検査領域画像31の各ピクセルの色とその平均値が抽出される。
 ステップS24では、検査処理部101が、検査ロジックにしたがって、キズ・色ムラの有無を判定する。例えば、ステップS23で得られた平均値に対する色差が閾値を超えるピクセル群が検出された場合に、そのピクセル群をキズあるいは色ムラと判定することができる。
 ステップS25では、検査処理部101が検査結果を表示装置12に表示したり、記憶装置13に記録する。以上で、1つの検査対象物2に対する検査処理が完了する。生産ラインにおいては、検査対象物2が画像センサ11の画角内に搬送されるタイミングと同期して、図2のステップS20~S25の処理が繰り返される。
 外観検査においては、検査の対象とすべきピクセルのみを過不足なく検査領域画像31として切り出すことが望ましい。検査領域画像31の中に背景部分や余計な部分(図3の例ではヒンジ部分20やボタン部分21)が含まれていたりするとそのピクセルがノイズとなり検査精度を低下させるおそれがあるし、逆に、検査領域画像31が検査の対象とすべき範囲よりも小さいと、検査の漏れを生じるおそれがあるからである。そこで本実施形態の画像検査装置1では、正確な検査領域画像を切り出すための検査領域定義情報を簡単に作成するための設定ツール103を用意している。
 (検査領域の設定処理)
 図4及び図5を参照して、設定ツール103の機能及び動作について説明する。図4は、設定ツール103を用いて検査領域を設定する処理の流れを示すフローチャートであり、図5は、検査領域設定画面の一例を示す図である。
 設定ツール103を起動すると、表示装置12に図5の設定画面が表示される。この設定画面には、画像ウィンドウ50、画像取込ボタン51、前景指定ボタン52、背景指定ボタン53、優先度調整スライダ54、確定ボタン55が設けられている。ボタンの選択やスライダの移動などの操作は入力装置14を利用して行うことができる。なおこの設定画面はあくまでも一例にすぎず、以下に述べるパラメタ入力や検査領域の確認などを行うことができればどのようなUIを用いてもよい。
 画像取込ボタン51が押されると、設定ツール103は画像センサ11によって検査対象物のサンプルを撮影する(ステップS40)。サンプルとしては良品の検査対象物(上記の例であれば筐体部品)を用い、実際の検査処理の場合と同じ状態(画像センサ11とサンプルの相対位置、照明など)で撮影を行うとよい。得られたサンプル画像データは装置本体10に取り込まれる。なお、事前に撮影されたサンプル画像が装置本体10の補助記憶装置や記憶装置13の中に存在する場合には、設定ツール103は補助記憶装置又は記憶装置13からサンプル画像のデータを読み込んでもよい。
 ステップS40で取得したサンプル画像は、図5に示すように、設定画面の画像ウィンドウ50に表示される(ステップS41)。
 ステップS42では、ユーザが前景と背景の代表色(モノクロ画像の場合は代表輝度)を入力する。前景とは、検査領域として抽出すべき部分を指し、背景とは、検査領域以外の部分を指す。前景の代表色を入力する場合、ユーザは、設定画面の前景指定ボタン52を押して前景指定モードにした後、画像ウィンドウ50に表示されたサンプル画像上で前景とすべき部分を指定する。ここでの指定は、前景の代表的な色をピックアップすることが目的なので、図5の例であれば、筐体部品のパネル面の一部のピクセル又はピクセル群を適当に選択すればよい。もし前景の中に模様、陰影、色の大きく異なる部分などが含まれている場合には、それらの色をできるだけ網羅するようにピクセル群を選択することが好ましい。背景の代表色を入力する場合は、背景指定ボタン53を押して背景指定モードに切り替えた後、同様の操作を行う。なお、前景と背景の代表色の入力は必須ではない。前景と背景のいずれか一方のみを入力してもよいし、代表色が既知の場合や、サンプル画像の色分布などから自動で代表色を算出できる場合には、ステップS42を省略してもよい。
 ステップS43では、設定ツール103は、ステップS42で指定された前景・背景の代表色に基づいて、サンプル画像を前景と背景に分離(セグメンテーション)し、その前景部分を検査領域として選ぶ。本実施形態においては、サンプル画像の各ピクセルの色の情報に加えて、サンプル画像に含まれるエッジの情報も用い、検査領域の候補解である複数の候補領域について、前景と背景の間(つまり候補領域の内側と外側の間)での色の分離の度合い(これをピクセル分離度と呼ぶ)と、前景と背景の境界(つまり候補領域の輪郭)とサンプル画像中のエッジとの重なりの度合い(これをエッジ重なり度と呼ぶ)の両方を総合的に評価し、ピクセル分離度とエッジ重なり度の両方を高くするような最適解を探索する。検査領域の詳しい計算方法については後述する。
 ステップS44では、ステップS43で計算された検査領域を設定画面の画像ウィンドウ50に表示する。ユーザは設定画面に表示された検査領域を見ることで、所望の領域が検査領域として選ばれているかどうかを確認することができる。このとき、サンプル画像の上に検査領域をオーバーレイ表示すると、検査対象物と検査領域との比較が容易になるので好ましい。
 その後、設定ツール103は、ユーザからの入力を待つ(ステップS45)。確定ボタン55が押された場合は、設定ツール103は、現在の検査領域について検査領域定義情報を生成し記憶装置13に格納する(ステップS46)。一方、画面表示されている検査領域が適当でない場合は、ユーザは、前景指定ボタン52、背景指定ボタン53、優先度調整スライダ54を操作してパラメタを調整することができる(ステップS47)。前景または背景の代表色を指定しなおすと、前述したピクセル分離度の評価に影響を与える。また優先度調整スライダ54で色情報とエッジ情報の間の優先度を変更すると、前述したピクセル分離度とエッジ重なり度を評価する際のバランス(重み)を変えることができる。設定ツール103は、ユーザからパラメタの入力(変更)を受け付けると、この新たなパラメタを拘束条件として用いて検査領域の最適解を再計算し、再計算後の検査領域を画面表示する(ステップS47→S43、S44)。このような機能により、パラメタを適宜調整しながら、所望の結果が得られるまで検査領域の計算を繰り返すことができる。
 図6は、パラメタ調整により検査領域を追い込んでいく過程の一例を示している。最初の計算で得られた検査領域30を上段に示す。最初の計算結果では、筐体部品のヒンジ部分20やボタン部分21も検査領域30に含まれているが、ここではパネル面のキズ・色ムラを検査することが目的のためヒンジ部分20とボタン部分21は検査領域から除外したい(図3参照)。そこでまず、ユーザは、背景指定ボタン53を押して背景指定モードに切り替え、サンプル画像中のボタン部分21の色を背景の代表色に追加指定する。これにより、中段に示す画像例のように、ボタン部分21が検査領域30から除かれる。次に、ヒンジ部分20に関しては、パネル面との色の差が小さいためバランスパラメタの調整で対処する。すなわち、ヒンジ部分20とパネル面との間の段差に生じたエッジに着目し、優先度調整スライダ54でエッジ情報の優先度を高くする。これにより、下段に示す画像例のように、ヒンジ部分20と部品表面とのエッジに検査領域30の輪郭が設定され、所望の検査領域30が形成される。
 (検査領域の計算)
 図4のステップS43の検査領域の計算方法について説明する。
 前述のように、本実施形態の設定ツール103では、前景と背景の間でのピクセル分離度と、前景と背景の境界のエッジ重なり度の両方を総合的に評価することにより、検査領域の候補解の中から最適解を求める。この計算は、色情報に基づくピクセル分離度を評価する関数とエッジ情報に基づくエッジ重なり度を評価する関数とを含む目的関数を最小化(もしくは最大化)する最適化問題として捉えることができる。以下、グラフカットアルゴリズムを用いて検査領域の最適化問題を解く手法について説明する。なお、グラフカットアルゴリズムは公知の手法であるため(非特許文献1参照)、本明細書ではグラフカットアルゴリズムの基本概念の説明は割愛し、以下では本実施形態に特有の部分を中心に説明を行う。
 グラフカットアルゴリズムでは、目的関数として下記式のようにエネルギー関数を定義し、Iが与えられたときにエネルギーEを最小化する解Lを求める。本例では、Iがサンプル画像であり、Lが前景か背景かを示すラベル(すなわち検査領域)である。
Figure JPOXMLDOC01-appb-M000001

 ここで、i,jはピクセルのインデックスであり、Ωは画像I中のピクセル群であり、Nは画像Iにおける隣接ピクセルペア群である。またli,ljはそれぞれピクセルi,jの指定ラベルである。前景の場合は「1」、背景の場合は「0」というラベルが与えられるものとする。右辺第1項はデータ項と呼ばれ、対象ピクセルiに関する拘束条件を与える。右辺第2項は平滑化項と呼ばれ、互いに隣接するピクセルi,jに関する拘束条件を与える。λは、データ項と平滑化項の重み(バランス)を決定するバランスパラメタである。
 データ項は、前述した色情報に基づくピクセル分離度を評価する関数で定義される。例えば、下記式によりデータ項の評価関数Uを定義するとよい。
Figure JPOXMLDOC01-appb-M000002
 ここで、-logp(I|li=1)は、前景代表色に対する前景ピクセル(前景ラベル「1」が付されたピクセル)の前景らしさを表す関数(対数尤度)であり、前景尤度と呼ぶ。前景尤度における確率密度関数は前景代表色から推定したもの(例えば前景代表色の色分布をガウス混合モデルで近似したもの)を用いる。一方、-logp(I|li=0)は、背景代表色に対する背景ピクセル(背景ラベル「0」が付されたピクセル)の背景らしさを表す関数(対数尤度)であり、背景尤度と呼ぶ。背景尤度における確率密度関数は背景代表色から推定したもの(例えば背景代表色の色分布をガウス混合モデルで近似したもの)を用いる。すなわち、データ項は各前景ピクセルの前景尤度と各背景ピクセルの背景尤度の総和を表しており、前景ピクセルの色が前景代表色に近いほど、また背景ピクセルの色が背景代表色に近いほど、エネルギーが小さくなり、逆に前景ピクセルの色が前景代表色から離れるほど、また背景ピクセルの色が背景代表色から離れるほど、エネルギーが大きくなる。
 平滑化項は、前述したエッジ情報に基づくエッジ重なり度を評価する関数で定義される。例えば、下記式により平滑化項の評価関数Vを定義することができる。
Figure JPOXMLDOC01-appb-M000003

 ここで、Ii,Ijはそれぞれピクセルi,jのピクセル値(色又は輝度)であり、βは係数である。∥Ii-Ij∥は、所定の色空間上でのピクセル値の差分(距離)、すなわちピクセル間のコントラストの高さを表している。
 上記式によれば、隣接するピクセルi,jのラベルが異なっている場合に、ピクセルi,jのコントラストが低いとエネルギーが大きくなり、コントラストが高いとエネルギーが小さくなる。隣接するピクセルのコントラストが高い部分は、画像中の色又は輝度が大きく変化している部分、つまり画像におけるエッジ部分である。すなわち、上記式は、前景と背景の境界(ラベルが異なっているピクセルペア)が画像中のエッジに重なっているほど、エネルギーが小さくなる。
 以上述べたエネルギー関数は、一定の数学的条件(submodularity)が満たされている場合には、大局的最小解が存在する。また、同様にsubmodularityを満たす項を付け加えて拘束条件付きで大局的最小解を求めることもできる。なお大局的最小解の効率的な解法については、公知の探索アルゴリズムを利用すればよいので、ここでは詳しい説明は省略する。
 前述した設定画面で調整可能なパラメタのうち「前景代表色」と「背景代表色」はデータ項の値に影響を及ぼすものである。また、「色情報とエッジ情報の優先度」は、バランスパラメタλに対応する。つまり、ユーザが色情報の優先度を大きくすると、パラメタλの値を小さくしてデータ項の重みを大きくし、ユーザがエッジ情報の優先度を大きくすると、パラメタλの値を大きくして平滑化項の重みを大きくするのである。なお、パラメタλの値については、計算機(設定ツール103)によって自動的に決定することもできる。例えば、設定ツール103が前景代表色と背景代表色との差を計算し、その差が大きいときにはパラメタλの値を小さくし、データ項の重みを大きくする。前景と背景の色の差が明確である場合は、データ項の信頼性が高いと推定できるからである。逆に、前景代表色と背景代表色の差が小さいときにはパラメタλの値を大きくし、平滑化項の重みを大きくする。前景と背景の色の差が明確でない場合は、色情報よりもエッジ情報に基づく領域分割のほうがよい結果が得られる傾向にあるからである。このようにバランスパラメタλを自動調整することで、ユーザの補助が無い状態でも妥当な解に到達できる可能性を高めることができる。好ましくは、バランスパラメタλの初期値を上記方法により自動で決定し、それを出発点としてユーザにバランスパラメタλ(色情報とエッジ情報の優先度)を調整させると良い。初期値の妥当性が高いほど、ユーザの試行錯誤の回数を減らすことができ、パラメタ調整にかかる作業負荷を軽減できると期待できるからである。
 なお、上述した式(2)では、前景ピクセルの前景らしさ(前景尤度)と背景ピクセルの背景らしさ(背景尤度)の総和をデータ項として用いたが、ピクセル分離度の評価関数はこれに限らない。例えば、前景らしさと背景らしさの積、重み付き和、重み付き積、非線形関数和、非線形関数積などを用いてもよい。なお非線形関数としては単調増加関数を用いるとよい。また、前景らしさと背景らしさの両方を評価するのではなく、前景らしさのみ、或いは、背景らしさのみを評価したものをピクセル分離度として用いることもできる。具体的には、式(2)において、li=0の場合(もしくはli=1の場合)にU(li|I)=0となるような関数を用いることができる。下記式(4)は、前景らしさのみを評価する関数である。
Figure JPOXMLDOC01-appb-M000004
 また、前景らしさの計算には、全ての前景ピクセル(つまり候補領域の内側の全てのピクセル)を用いてもよいし、一部の前景ピクセルだけを用いてもよい。同様に、背景らしさの計算についても、全ての背景ピクセル(つまり候補領域の外側の全てのピクセル)を用いてもよいし、一部の背景ピクセルだけを用いてもよい。例えば、ラベルが確定しているピクセルを計算から除外したり、候補領域の輪郭から所定距離内のピクセルだけを計算に用いたりすることにより、計算時間の短縮を図ることができる。
 また、前景らしさもしくは背景らしさを評価する関数は式(2)のものに限られない。例えば、下記式のように前景尤度と背景尤度の比である尤度比を用いることができる。
Figure JPOXMLDOC01-appb-M000005
 ユーザにより前景代表色として指定されたピクセル群のヒストグラムを直接用い(確率密度関数を推定することなく)、その前景代表色ヒストグラムに対する各ピクセルの色の類似度に基づき前景らしさを評価したり、逆に前景代表色ヒストグラムに対する各ピクセルの色の相違度に基づき背景らしさを評価したりしてもよい。同様に、ユーザにより背景代表色として指定されたピクセル群のヒストグラム(背景代表色ヒストグラム)に対する類似度に基づき背景らしさを評価したり、背景代表色ヒストグラムに対する相違度に基づき前景らしさを評価したりしてもよい。或いは、候補領域の前景ピクセル群から求めた前景ヒストグラムや背景ピクセル群から求めた背景ヒストグラムと、上記前景代表色ヒストグラムや背景代表色ヒストグラムとの間の類似度もしくは相違度を、所定の関数や距離指標を用いて計算してもよい。或いは、ピクセル群の色や輝度の情報からヒストグラムを近似したものを計算し、そのヒストグラムを近似したものを用いて類似度や相違度を計算してもよい。
 (追加的なパラメタ)
 上記例では、前景代表色、背景代表色、色情報とエッジ情報の優先度の3つのパラメタについて説明したが、これらの他にも、検査領域の最適解探索に影響を及ぼし得るものであれば、どのようなパラメタを用いて良い。例えば、外観検査の対象物としては工業製品が主であるため、検査領域となる部分の形状、テクスチャ、トポロジ、検査領域に隣接する要素、検査領域に内包される要素などに特徴があるケースが多い。また画像センサの設置に際し検査対象物がちょうど良く画角に収まるように設定されるため、検査領域となる部分の大きさや画像内での位置はある程度予測できる。それゆえ、このような検査領域の特徴を表す情報をパラメタとしてユーザに入力させ、そのパラメタで与えられた特徴と検査領域の特徴との類似度合を評価する拘束条件を目的関数の中に追加することで、妥当な検査領域が探索される可能性をより一層高めることができる。
 検査領域の形状に関する特徴を表す形状情報としては、検査領域の基本形状(円形、四角形、三角形、星形・・・)や、輪郭の特徴(直線的な外形、丸みのある外形、ギザギザが多い・・・)などを用いることができる。形状情報を入力するUIとしては、基本形状のテンプレートや輪郭の特徴をリスト表示し、その中から該当するものをユーザに選択させるとよい。基本形状のテンプレートが指定された場合には、例えば、拘束条件として下記式を挿入すればよい。
Figure JPOXMLDOC01-appb-M000006

 ここで、liはピクセルiの指定ラベルであり、tiはテンプレート上のピクセルiに対応する点のラベルである。T()はアフィン変換を表す。上記式は、指定されたテンプレートを拡大/縮小、回転、変形等しつつ候補領域に対してテンプレートマッチングを行い、最小スコアを計算する、という操作を表している。すなわち、この拘束条件を加えることにより、ユーザ指定の基本形状に近い形状をもつ領域の方がエネルギーが小さくなり、最適解として優先的に選ばれるようになる。
 また、輪郭の特徴としてギザギザ度合いもしくは滑らか度合いが指定された場合には、例えば、拘束条件として下記式を挿入すればよい。
Figure JPOXMLDOC01-appb-M000007

 ここで、Sは前景領域の輪郭上の点、θは輪郭の勾配角度であり、∂θ/∂Sは前景領域の輪郭に沿った勾配角度の変化量を表している。また、Cはユーザにより指定されたギザギザ度合い(滑らか度合い)を示す定数であり、ギザギザであるほどCは大きく、滑らかであるほどCは小さい値となる。上記式は、前景領域の輪郭の勾配角度の変化量の合計値(輪郭のギザギザ度合いを表す)が値C(指定されたギザギザ度合いを表す)に近いかどうか、を評価する関数である。すなわち、この拘束条件を加えることにより、ユーザ指定のギザギザ度合いに近い輪郭特徴をもつ領域の方が最適解として優先的に選ばれるようになる。
 検査領域の大きさに関する特徴を表す大きさ情報としては、検査領域の面積、縦横の長さなどを用いることができる。大きさ情報として面積が入力された場合には、例えば、拘束条件として下記式を挿入すればよい。
Figure JPOXMLDOC01-appb-M000008

 ここで、Cはユーザにより指定された前景領域の面積(ピクセル数)である。前景ラベルは1、背景ラベルは0ゆえ、Σliは前景ピクセルの総数、つまり前景領域の面積を表している。したがって、上記式は、前景領域の面積が指定された面積Cに近いかどうか、を評価する関数である。この拘束条件を加えることにより、ユーザ指定の面積に近い大きさの領域の方が最適解として優先的に選ばれるようになる。
 検査領域の画像内での位置に関する特徴を表す位置情報としては、検査領域の重心座標、検査領域の存在範囲(上、下、右、左、中央・・・)などを用いることができる。位置情報として重心座標が入力された場合には、例えば、拘束条件として下記式を挿入すればよい。
Figure JPOXMLDOC01-appb-M000009

 ここで、wは前景領域の重心座標であり、Cはユーザにより指定された重心座標である。上記式は、前景領域の重心座標が指定された座標Cに近いかどうか、を評価する関数である。この拘束条件を加えることにより、ユーザ指定の座標に近い位置に重心をもつ領域の方が最適解として優先的に選ばれるようになる。
 検査領域のテクスチャに関する特徴を表すテクスチャ情報としては、検査領域内の模様、色の濃淡、凹凸、素材などを表す情報を用いることができる。例えば、各種のテクスチャテンプレートをリスト表示し、その中から該当するものをユーザに選択させるとよい。テクスチャテンプレートが入力された場合には、例えば、拘束条件として下記式を挿入すればよい。
Figure JPOXMLDOC01-appb-M000010

 ここで、Iはサンプル画像であり、Eはユーザにより指定されたテクスチャテンプレートである。hl=1()は前景ピクセルの色ヒストグラムを表しており、f()はヒストグラムの類似度を示す関数である。つまり、上記式は、サンプル画像中の前景領域の色ヒストグラムが、指定されたテクスチャの色ヒストグラムに類似するかどうか、を評価する関数である。この拘束条件を加えることにより、ユーザ指定のテクスチャに類似したテクスチャをもつ領域の方が最適解として優先的に選ばれるようになる。
 (本実施形態の利点)
 以上述べた本実施形態の設定ツール103によれば、サンプル画像を用いた最適解探索により検査領域の位置及び形状が決められるため、従来のように単純図形で検査領域を手入力するのに比べ、設定時間及び作業負荷を大幅に軽減できると共に、複雑な形状や特殊な形状に対しても適用が可能である。また、色・輝度の情報に加えてエッジの情報も用い、検査領域の内側と外側の間での色又は輝度のピクセル分離度と検査領域の輪郭とエッジとのエッジ重なり度の両方を総合的に評価することで、二値化や色域抽出といった従来手法に比べて、領域の抽出精度を向上することができる。
 また、本実施形態の設定ツール103は、設定画面において、色情報とエッジ情報の優先度のいずれを優先させるかをユーザに任意に選ばせることができる。例えば、前景や背景の中に模様が含まれているなど疑似輪郭が多い画像の場合はエッジの情報よりも色・輝度の情報を優先したほうが良い結果が得られる可能性が高く、前景と背景の色が似ている画像の場合はエッジの情報を優先したほうが良い結果が得られる可能性が高い。このような前景と背景の切り分けが困難な画像に対して、完全自動で正解にたどり着くことは非常に困難である。その一方で、いずれを優先させるべきかはヒトであれば画像を見て容易に判断できるし、試行錯誤によりパラメタを追い込むことも容易である。したがって、上記構成のようにバランスパラメタを調整可能としたことにより、簡単に且つ短時間で所望の検査領域を設定できるようになる。
 <第2実施形態>
 次に本発明の第2実施形態について説明する。第1実施形態の設定ツールにおいては、前景・背景の代表色や色とエッジの優先度などのパラメタを調整することで、検査領域の追い込みを可能にしている。しかしながら、このようなパラメタの調整だけではユーザが意図する検査領域の形状に到達できない(多少の誤差が残る)可能性や、パラメタの試行錯誤に時間がかかる場合も想定される。そこで第2実施形態の設定ツールでは、計算により検査領域を求めた後に、その形状をユーザがインタラクティブに手直しできる検査領域修正機能を設けることとする。
 以下、本実施形態の設定ツールが提供する検査領域修正機能の一例として、(1)輪郭修正ツール、(2)輪郭描画ツール、(3)円弧変換ツール、(4)直線変換ツール、(5)ドローツールについて説明を行う。これらのツールは、例えば図5の設定画面から起動できるようにするとよい。なお画像検査装置の構成、検査処理の動作、検査領域の自動計算(最適化)の動作などは第1実施形態のものと同様のため、説明は省略する。
 (1)輪郭修正ツール
 図7は、輪郭修正ツールの動作例を説明する図である。(a)は検査対象物(サンプル)70の画像、(b)は検査領域71の自動計算結果を示している。検査対象物70の輪郭と検査領域71の輪郭に図で示すようなずれが生じているものと仮定する。
 ユーザが輪郭修正ツールを起動すると、輪郭修正ツールはまず検査領域71の輪郭をベジェ曲線もしくはスプライン曲線のパス72で近似し、(c)に示すように、パス72をコントロールポイント73とともに画面表示する。このとき、検査対象物70の画像の上にパス72及びコントロールポイント73がオーバーレイ表示される。ユーザは入力装置14を利用して、コントロールポイント73の修正、追加、削除を行うことで、パス72の形状を自由に修正することができる。ユーザにより修正された結果は即座に画面表示に反映される。したがって、ユーザは、画面で確認をしながら、パス72の形状を検査領域71の輪郭に容易に合わせこむことができる。(d)は修正後のパス72を示している。
 上記操作によりパス72の修正が完了した後、パスの確定をユーザが指示すると、輪郭修正ツールがパス72で囲まれた領域を検査領域71へ変換する。これにより、ユーザの意図した形状の検査領域71が得られる。
 (2)輪郭描画ツール
 図8は、輪郭描画ツールの動作例を説明する図である。(a)は検査対象物70の画像と自動計算された検査領域71の一部を拡大して示している。検査対象物70の輪郭と検査領域71の輪郭に図に示すようなずれが生じているものと仮定する。
 ユーザが輪郭描画ツールを起動すると、輪郭描画モードに切り替わり、入力装置14を用いて画像上に自由曲線74を描画できるようになる。例えば、入力装置14としてマウスを用いる場合には、マウスのボタン押下からリリースまでの間にマウスカーソルの移動した軌跡が自由曲線74として描画される。自由曲線74の描画に失敗した場合には、一旦輪郭描画モードから抜け、最初から操作をやり直せばよい。
 上記操作により自由曲線74の描画が完了した後、輪郭の確定をユーザが指示すると、輪郭描画ツールは、自由曲線74が検査領域71の輪郭の一部となるように自由曲線74と検査領域71とを合成する。(c)は合成後の検査領域71を示している。自由曲線74と検査領域71との合成手法は任意である。例えば、自由曲線74と検査領域71の輪郭との接続部分や、自由曲線74の形状を滑らかにするスムージング加工を施してもよい。また自由曲線74の端点が検査領域71の輪郭から離れている場合には、自由曲線74と検査領域71の輪郭とを最近接点で接合してもよいし、自由曲線74と検査領域71の輪郭とを滑らかに接続するよう補間を行ってもよい。以上の操作により、ユーザの意図した形状の検査領域71が得られる。
 (3)円弧変換ツール
 図9は、円弧変換ツールの動作例を説明する図である。(a)は検査対象物70の画像と自動計算された検査領域71の一部を拡大して示している。検査対象物70の輪郭と検査領域71の輪郭に図に示すようなずれが生じているものと仮定する。
 ユーザが円弧変換ツールを起動すると、円弧入力モードに切り替わり、入力装置14を用いて画像上に円弧を入力できるようになる。例えば、入力装置14としてマウスを用いる場合には、(b)に示すように、マウスカーソルを移動させて、検査領域71の輪郭上の2点(1,2)と円弧の通過点(3)の3箇所でマウスをクリックする。そうすると、点1,2を円弧の始点,終点とし、点3を通る円弧が計算され、画像上にオーバーレイ表示される。円弧の形状が意図したものと異なる場合は、各点の位置を修正するか、一旦円弧入力モードから抜け、最初から操作をやり直せばよい。なお本実施形態では円弧の始点・終点・通過点の3点により円弧を指定するようにしたが、もちろん他の指定方法により円弧の入力を行えるようにしてもよい。
 上記操作により円弧の指定が完了した後、円弧の確定をユーザが指示すると、円弧変換ツールは、検査領域71の輪郭のうち始点(1)と終点(2)の間の区間の輪郭を上記円弧に置き換える。このとき始点(1)もしくは終点(2)が検査領域71の輪郭から離れている場合には、円弧と検査領域71の輪郭とを最近接点で接合してもよいし、円弧と検査領域71の輪郭とを滑らかに接続するよう補間を行ってもよい。以上の操作により、検査領域71の一部の区間の輪郭を簡単に円弧に整形することができる。
 (4)直線変換ツール
 図10は、直線変換ツールの動作例を説明する図である。(a)は検査対象物70の画像と自動計算された検査領域71の一部を拡大して示している。検査対象物70の輪郭と検査領域71の輪郭に図に示すようなずれが生じているものと仮定する。
 ユーザが直線変換ツールを起動すると、直線入力モードに切り替わり、入力装置14を用いて画像上に直線分を入力できるようになる。例えば、入力装置14としてマウスを用いる場合には、(b)に示すように、マウスカーソルを移動させて、検査領域71の輪郭上の2点(1,2)でマウスをクリックする。そうすると、点1,2を始点,終点とする線分が計算され、画像上にオーバーレイ表示される。線分の形状が意図したものと異なる場合は、各点の位置を修正するか、一旦直線入力モードから抜け、最初から操作をやり直せばよい。なお本実施形態では始点・終点の2点により直線を指定するようにしたが、もちろん他の指定方法により直線の入力を行えるようにしてもよい。
 上記操作により直線の指定が完了した後、直線の確定をユーザが指示すると、直線変換ツールは、検査領域71の輪郭のうち始点(1)と終点(2)の間の区間の輪郭を上記線分に置き換える。このとき始点(1)もしくは終点(2)が検査領域71の輪郭から離れている場合には、線分と検査領域71の輪郭とを最近接点で接合してもよいし、線分と検査領域71の輪郭とを滑らかに接続するよう補間を行ってもよい。以上の操作により、検査領域71の一部の区間の輪郭を簡単に直線に整形することができる。
 (5)ドローツール
 図11は、ドローツールの動作例を説明する図である。(a)は検査対象物70の画像と自動計算された検査領域71の一部を拡大して示している。ドローツールではピクセル単位で検査領域71を修正するので、図11では説明の便宜のためにピクセルのグリッドを示している。検査対象物70の輪郭と検査領域71の輪郭には図に示すようなずれが生じており、図の上方では検査領域71が小さすぎ、図の右方では検査領域71が大きすぎると仮定する。
 ユーザがドローツールを起動すると、ドローモードに切り替わり、入力装置14を用いて画像上で検査領域71に追加するピクセルを指定したり、検査領域71から削除するピクセルを指定したりできるようになる。(b)は検査領域にピクセルを追加する様子を示している。例えば、入力装置14としてマウスを用いる場合には、追加するピクセルを順に選択したり、所定のボタンを押したままマウスカーソルを移動させたりすることで、検査領域71に追加する領域(ピクセル群)75を指定可能である。一方、(c)は検査領域からピクセルを削除する様子を示している。検査領域71から削除する領域(ピクセル群)76の指定も、追加の場合と同じように行うことができる。以上の操作により、ユーザの意図する形状の検査領域71が得られる。
 以上述べた本実施形態の構成によれば、検査領域の形状を手直しするための機能を設けたことにより、計算機による自動抽出では難しい部分をユーザの支援で補完することができ、結果として簡単かつ短時間に最適な(つまりユーザが望む形状の)検査領域を得ることが可能となる。なお、本実施形態では、(1)から(5)の5つの修正機能について説明したが、設定ツールはこの全ての修正機能を具備する必要はない。少なくともいずれかの修正機能を設けるだけでもよいし、逆に設定ツールが他の修正機能を具備することも好ましい。さらに、修正作業をする際に、図7~図11で示した作業画面をユーザが拡大/縮小できるようにし、効率的に作業を進めたり、精密な入力をやりやすくしたりすることも好ましい。
 上述した実施形態は本発明の一具体例を示したものであり、本発明の範囲をそれらの具体例に限定する趣旨のものではない。例えば、上記実施形態ではサンプル画像としてカラー画像を想定しているため、画像の色情報を利用したが、モノクロ画像を用いる場合には、色情報の代わりに輝度情報を用いればよい。また、上記実施形態では最適化にグラフカットアルゴリズムを利用したが、レベルセットアルゴリズムなどの他の方法を利用することもできる。他の方法の場合にも、色情報(輝度情報)とエッジ情報を利用することにより検査領域の高精度な算出が可能となる。またこの場合も、色情報(輝度情報)とエッジ情報の優先度をユーザにより変更できるようにすることが好ましい。
1:画像検査装置
2:検査対象物(筐体部品)
10:装置本体、11:画像センサ、12:表示装置、13:記憶装置、14:入力装置、101:検査処理部、102:検査領域抽出部、103:設定ツール
20:ヒンジ部分、21:ボタン部分
30:検査領域、31:検査領域画像
50:画像ウィンドウ、51:画像取込ボタン、52:前景指定ボタン、53:背景指定ボタン、54:優先度調整スライダ、55:確定ボタン
70:検査対象物、71:検査領域、72:パス、73:コントロールポイント、74:自由曲線

Claims (18)

  1.  検査対象物を撮影して得られた元画像から検査領域とする部分を検査領域画像として抽出し、前記検査領域画像を解析することにより前記検査対象物の検査を行う画像検査装置に対して、
     前記検査領域を定義する検査領域定義情報を設定する検査領域設定方法であって、
     コンピュータが、検査対象物のサンプルを撮影して得られたサンプル画像を取得する取得ステップと、
     コンピュータが、前記サンプル画像における各ピクセルの色又は輝度の情報、及び、前記サンプル画像に含まれるエッジの情報に基づいて、検査領域の候補解である複数の候補領域について、各候補領域の内側と外側の間での色又は輝度の分離の度合いであるピクセル分離度と、各候補領域の輪郭と前記サンプル画像中のエッジとの重なりの度合いであるエッジ重なり度の両方を評価することにより、前記複数の候補領域の中から検査領域の最適解を求める検査領域探索ステップと、
     コンピュータが、前記検査領域探索ステップで求められた検査領域の画像内での位置及び形状を定義する検査領域定義情報を前記画像検査装置に対して設定する設定ステップと、を有することを特徴とする検査領域設定方法。
  2.  コンピュータがユーザからパラメタの入力を受け付けるパラメタ受付ステップ、をさらに有しており、
     コンピュータが、前記パラメタ受付ステップでユーザからパラメタの入力を受け付ける毎に、入力されたパラメタを拘束条件として用いて前記検査領域探索ステップを実行することにより検査領域の最適解を再計算し、再計算された検査領域を表示装置に表示することを特徴とする請求項1に記載の検査領域設定方法。
  3.  前記パラメタ受付ステップでは、パラメタの一つとして、前記ピクセル分離度と前記エッジ重なり度のバランスを調整するためのバランスパラメタをユーザに入力させ、
     前記検査領域探索ステップでは、ユーザから入力されたバランスパラメタに応じて、前記ピクセル分離度と前記エッジ重なり度を評価する際の重みを調整することを特徴とする請求項2に記載の検査領域設定方法。
  4.  前記検査領域探索ステップでは、前景の代表色又は代表輝度に対する候補領域の内側の各ピクセルの色又は輝度の前景らしさを評価した値、或いは、背景の代表色又は代表輝度に対する候補領域の外側の各ピクセルの色又は輝度の背景らしさを評価した値、或いは、その両方の値を総合した値を前記ピクセル分離度とすることを特徴とする請求項2又は3に記載の検査領域設定方法。
  5.  前記検査領域探索ステップでは、前景の代表色又は代表輝度と背景の代表色又は代表輝度との差が大きいほど前記ピクセル分離度の重みが大きくなり、前記差が小さいほど前記エッジ重なり度の重みが大きくなるように、前記ピクセル分離度と前記エッジ重なり度を評価する際の重みを調整することを特徴とする請求項4に記載の検査領域設定方法。
  6.  前記パラメタ受付ステップでは、パラメタの一つとして、前景若しくは背景若しくはその両方の代表色又は代表輝度をユーザに入力させることを特徴とする請求項4又は5に記載の検査領域設定方法。
  7.  前記パラメタ受付ステップでは、前記サンプル画像を表示装置に表示し、前記表示されたサンプル画像上で前景若しくは背景とすべき部分をユーザに指定させ、前記指定された部分の色又は輝度を前記代表色又は代表輝度として取得することを特徴とする請求項6に記載の検査領域設定方法。
  8.  前記パラメタ受付ステップでは、パラメタの一つとして、検査領域の形状に関する特徴を表す形状情報をユーザに入力させ、
     前記検査領域探索ステップでは、前記ピクセル分離度と前記エッジ重なり度に加え、検査領域の形状と前記形状情報で表される形状との類似度合も高くなるように、検査領域の最適解が求められることを特徴とする請求項2~7のうちいずれか1項に記載の検査領域設定方法。
  9.  前記パラメタ受付ステップでは、パラメタの一つとして、検査領域の大きさに関する特徴を表す大きさ情報をユーザに入力させ、
     前記検査領域探索ステップでは、前記ピクセル分離度と前記エッジ重なり度に加え、検査領域の大きさと前記大きさ情報で表される大きさとの類似度合も高くなるように、検査領域の最適解が求められることを特徴とする請求項2~8のうちいずれか1項に記載の検査領域設定方法。
  10.  前記パラメタ受付ステップでは、パラメタの一つとして、検査領域の画像内での位置に関する特徴を表す位置情報をユーザに入力させ、
     前記検査領域探索ステップでは、前記ピクセル分離度と前記エッジ重なり度に加え、検査領域のサンプル画像内での位置と前記位置情報で表される位置との類似度合も高くなるように、検査領域の最適解が求められることを特徴とする請求項2~9のうちいずれか1項に記載の検査領域設定方法。
  11.  前記パラメタ受付ステップでは、パラメタの一つとして、検査領域内の画像のテクスチャに関する特徴を表すテクスチャ情報をユーザに入力させ、
     前記検査領域探索ステップでは、前記ピクセル分離度と前記エッジ重なり度に加え、検査領域内の画像のテクスチャと前記テクスチャ情報で表されるテクスチャとの類似度合も高くなるように、検査領域の最適解が求められることを特徴とする請求項2~10のうちいずれか1項に記載の検査領域設定方法。
  12.  コンピュータが、前記検査領域探索ステップで求められた検査領域を表示装置に表示し、ユーザから入力される修正指示にしたがって検査領域の形状を修正する、検査領域修正ステップをさらに有していることを特徴とする請求項1~11のうちいずれか1項に記載の検査領域設定方法。
  13.  前記検査領域修正ステップは、検査領域の輪郭の全部又は一部をベジェ曲線若しくはスプライン曲線のパスで近似し、前記パスをユーザに修正させるものであることを特徴とする請求項12に記載の検査領域設定方法。
  14.  前記検査領域修正ステップは、ユーザに自由曲線を描画させ、前記自由曲線が検査領域の輪郭の一部となるように前記自由曲線と検査領域とを合成するものであることを特徴とする請求項12又は13に記載の検査領域設定方法。
  15.  前記検査領域修正ステップは、ユーザに検査領域の輪郭の一部の区間を指定させ、指定された区間の輪郭を直線又は円弧に置き換えるものであることを特徴とする請求項12~14のうちいずれか1項に記載の検査領域設定方法。
  16.  前記検査領域修正ステップは、ユーザにより指定されたピクセルを検査領域に追加し、又は検査領域から除外するものであることを特徴とする請求項12~15のうちいずれか1項に記載の検査領域設定方法。
  17.  請求項1~16のうちいずれか1項に記載の検査領域設定方法の各ステップをコンピュータに実行させることを特徴とするプログラム。
  18.  検査対象物を撮影して得られた元画像から検査領域とする部分を検査領域画像として抽出し、前記検査領域画像を解析することにより前記検査対象物の検査を行う画像検査装置に対して、
     前記検査領域を定義する検査領域定義情報を設定する検査領域設定装置であって、
     検査対象物のサンプルを撮影して得られたサンプル画像を取得する取得手段と、
     前記サンプル画像における各ピクセルの色又は輝度の情報、及び、前記サンプル画像に含まれるエッジの情報に基づいて、検査領域の候補解である複数の候補領域について、各候補領域の内側と外側の間での色又は輝度の分離の度合いであるピクセル分離度と、各候補領域の輪郭と前記サンプル画像中のエッジとの重なりの度合いであるエッジ重なり度の両方を評価することにより、前記複数の候補領域の中から検査領域の最適解を求める検査領域探索手段と、
     前記検査領域探索手段で求められた検査領域の画像内での位置及び形状を定義する検査領域定義情報を前記画像検査装置に対して設定する設定手段と、を有することを特徴とする検査領域設定装置。
PCT/JP2012/071758 2012-01-05 2012-08-29 画像検査装置の検査領域設定方法 WO2013103032A1 (ja)

Priority Applications (4)

Application Number Priority Date Filing Date Title
KR1020147015679A KR101626231B1 (ko) 2012-01-05 2012-08-29 화상 검사 장치의 검사 영역 설정 방법
EP12864252.7A EP2801815B1 (en) 2012-01-05 2012-08-29 Inspection area setting method for image inspecting device
CN201280061701.5A CN103988069B (zh) 2012-01-05 2012-08-29 图像检查装置的检查区域设定方法
US14/363,340 US9269134B2 (en) 2012-01-05 2012-08-29 Inspection area setting method for image inspecting device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2012-000588 2012-01-05
JP2012000588A JP5874398B2 (ja) 2012-01-05 2012-01-05 画像検査装置の検査領域設定方法

Publications (1)

Publication Number Publication Date
WO2013103032A1 true WO2013103032A1 (ja) 2013-07-11

Family

ID=48745100

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2012/071758 WO2013103032A1 (ja) 2012-01-05 2012-08-29 画像検査装置の検査領域設定方法

Country Status (6)

Country Link
US (1) US9269134B2 (ja)
EP (1) EP2801815B1 (ja)
JP (1) JP5874398B2 (ja)
KR (1) KR101626231B1 (ja)
CN (1) CN103988069B (ja)
WO (1) WO2013103032A1 (ja)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112419298A (zh) * 2020-12-04 2021-02-26 中冶建筑研究总院(深圳)有限公司 一种螺栓节点板锈蚀检测方法、装置、设备及存储介质
CN112740271A (zh) * 2019-06-17 2021-04-30 大日本印刷株式会社 判定装置、判定装置的控制方法、判定系统、判定系统的控制方法以及程序

Families Citing this family (34)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5929238B2 (ja) * 2012-01-27 2016-06-01 オムロン株式会社 画像検査方法および画像検査装置
JP2014102685A (ja) * 2012-11-20 2014-06-05 Sony Corp 情報処理装置、情報処理方法及びプログラム
US9213896B2 (en) * 2013-03-05 2015-12-15 Mitsubishi Electric Research Laboratories, Inc. Method for detecting and tracking objects in image sequences of scenes acquired by a stationary camera
US9734797B2 (en) * 2013-08-06 2017-08-15 Crackle, Inc. Selectively adjusting display parameter of areas within user interface
JP6478492B2 (ja) * 2014-06-27 2019-03-06 キヤノン株式会社 画像処理装置およびその方法
WO2016021030A1 (ja) 2014-08-07 2016-02-11 株式会社ニコン X線装置および構造物の製造方法
CN107076684B (zh) 2014-09-02 2021-04-02 株式会社尼康 测量处理装置、测量处理方法和测量处理程序
JP6763301B2 (ja) * 2014-09-02 2020-09-30 株式会社ニコン 検査装置、検査方法、検査処理プログラムおよび構造物の製造方法
US10445612B2 (en) * 2015-10-26 2019-10-15 Canon Kabushiki Kaisha Information processing apparatus, information processing method, and storage medium
JP6333871B2 (ja) * 2016-02-25 2018-05-30 ファナック株式会社 入力画像から検出した対象物を表示する画像処理装置
CN109690625A (zh) * 2016-05-03 2019-04-26 莱尼电缆有限公司 用于操作员增强查看的采用颜色分段的视觉系统
CN106682693A (zh) * 2016-12-23 2017-05-17 浙江大学 一种用于塑料瓶瓶身重叠图像的识别方法
CN106846302B (zh) * 2016-12-30 2024-03-15 河南中烟工业有限责任公司 一种工具正确取件的检测方法及基于此方法的考核台
US10943374B2 (en) * 2017-02-03 2021-03-09 Microsoft Technology Licensing, Llc Reshaping objects on a canvas in a user interface
JP6894725B2 (ja) * 2017-03-09 2021-06-30 キヤノン株式会社 画像処理装置及びその制御方法、プログラム、記憶媒体
JP6864549B2 (ja) * 2017-05-09 2021-04-28 株式会社キーエンス 画像検査装置
JP6931552B2 (ja) * 2017-05-09 2021-09-08 株式会社キーエンス 画像検査装置
JP6919982B2 (ja) * 2017-05-09 2021-08-18 株式会社キーエンス 画像検査装置
SE541493C2 (en) * 2017-10-26 2019-10-15 Ivisys Aps System and method for optical inspection of an object
JP6693938B2 (ja) 2017-11-17 2020-05-13 ファナック株式会社 外観検査装置
CN109991232B (zh) * 2017-12-29 2022-02-15 上海微电子装备(集团)股份有限公司 芯片崩边缺陷检测方法
CN111630561B (zh) * 2018-01-17 2024-04-02 株式会社富士 图像处理用元件形状数据生成系统及图像处理用元件形状数据生成方法
JP2019185204A (ja) * 2018-04-04 2019-10-24 富士電機株式会社 画像処理装置、ロボットシステム、画像処理方法
IL260417B (en) 2018-07-04 2021-10-31 Tinyinspektor Ltd System and method for automatic visual inspection
JP7299002B2 (ja) 2018-08-23 2023-06-27 ファナック株式会社 判別装置及び機械学習方法
JP6795562B2 (ja) 2018-09-12 2020-12-02 ファナック株式会社 検査装置及び機械学習方法
JP6823025B2 (ja) 2018-09-12 2021-01-27 ファナック株式会社 検査装置及び機械学習方法
JP7214432B2 (ja) * 2018-10-22 2023-01-30 キヤノン株式会社 画像処理方法、画像処理プログラム、記録媒体、画像処理装置、生産システム、物品の製造方法
JP7166189B2 (ja) * 2019-02-15 2022-11-07 東京エレクトロン株式会社 画像生成装置、検査装置及び画像生成方法
EP4104100A4 (en) 2020-02-13 2024-01-10 Inspekto A M V Ltd USER INTERFACE DEVICE FOR AUTONOMOUS ARTIFICIAL VISION INSPECTION
TWI742733B (zh) * 2020-06-19 2021-10-11 倍利科技股份有限公司 圖像轉換方法
CN112351247A (zh) * 2020-10-16 2021-02-09 国电大渡河枕头坝发电有限公司 一种基于图像处理的水电厂内电光闪光检测方法
US20230011330A1 (en) * 2021-07-09 2023-01-12 At&T Intellectual Property I, L.P. Device condition determination
JP2023071276A (ja) * 2021-11-11 2023-05-23 日立Astemo株式会社 検査方法および検査装置

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09140397A (ja) * 1995-11-18 1997-06-03 Dennou Giken:Kk 1つの連結領域が示すコロニーの個数を識別する識別方法及びこれを用いたコロニー計数装置
JP2004354064A (ja) * 2003-05-27 2004-12-16 Hitachi High-Tech Electronics Engineering Co Ltd 光学系測定画像による磁気ヘッドの欠陥検査方法および欠陥検査装置
JP2006058284A (ja) 2004-07-21 2006-03-02 Omron Corp 基板検査用ウィンドウの設定条件の決定方法、基板検査方法、基板検査用の検査データ作成方法、および基板検査装置
JP2007509724A (ja) * 2003-11-03 2007-04-19 シーメンス コーポレイト リサーチ インコーポレイテツド 冠状血管可視化のためのレンダリング
JP2009500752A (ja) * 2005-07-01 2009-01-08 マイクロソフト コーポレーション ビデオオブジェクトのカットアンドペースト
JP2009080660A (ja) * 2007-09-26 2009-04-16 Rakuten Inc 物体領域抽出処理プログラム、物体領域抽出装置、および物体領域抽出方法
JP2009198514A (ja) * 2009-06-01 2009-09-03 Hitachi High-Technologies Corp パターン検査方法及びその装置
JP2011212301A (ja) * 2010-03-31 2011-10-27 Fujifilm Corp 投影画像生成装置および方法、並びにプログラム

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07280537A (ja) * 1994-04-11 1995-10-27 Sekisui Chem Co Ltd 撮像式検査方法および装置
US7130039B2 (en) 2002-04-18 2006-10-31 Kla-Tencor Technologies Corporation Simultaneous multi-spot inspection and imaging
JP2006038582A (ja) * 2004-07-26 2006-02-09 Dainippon Screen Mfg Co Ltd 画像の領域分割による欠陥の検出
JP2006260401A (ja) * 2005-03-18 2006-09-28 Toshiba Corp 画像処理装置、方法、およびプログラム
JP2009506339A (ja) 2005-08-30 2009-02-12 カムテック エルティーディー. 検査システム、及び基準フレームに基づいて欠陥を検査する方法
JP5159373B2 (ja) * 2008-03-06 2013-03-06 オリンパス株式会社 基板検査方法
CN101256156B (zh) * 2008-04-09 2011-06-08 西安电子科技大学 平板裂缝天线裂缝精密测量方法
JP5445452B2 (ja) * 2008-05-22 2014-03-19 凸版印刷株式会社 非検査領域制限検証方法及び修正方法、プログラム並びに装置
US7623229B1 (en) 2008-10-07 2009-11-24 Kla-Tencor Corporation Systems and methods for inspecting wafers
JP5353566B2 (ja) * 2009-08-31 2013-11-27 オムロン株式会社 画像処理装置および画像処理プログラム
JP5152231B2 (ja) * 2010-03-12 2013-02-27 オムロン株式会社 画像処理方法および画像処理装置
US20130329987A1 (en) * 2012-06-11 2013-12-12 Genesis Group Inc. Video segmentation method

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09140397A (ja) * 1995-11-18 1997-06-03 Dennou Giken:Kk 1つの連結領域が示すコロニーの個数を識別する識別方法及びこれを用いたコロニー計数装置
JP2004354064A (ja) * 2003-05-27 2004-12-16 Hitachi High-Tech Electronics Engineering Co Ltd 光学系測定画像による磁気ヘッドの欠陥検査方法および欠陥検査装置
JP2007509724A (ja) * 2003-11-03 2007-04-19 シーメンス コーポレイト リサーチ インコーポレイテツド 冠状血管可視化のためのレンダリング
JP2006058284A (ja) 2004-07-21 2006-03-02 Omron Corp 基板検査用ウィンドウの設定条件の決定方法、基板検査方法、基板検査用の検査データ作成方法、および基板検査装置
JP2009500752A (ja) * 2005-07-01 2009-01-08 マイクロソフト コーポレーション ビデオオブジェクトのカットアンドペースト
JP2009080660A (ja) * 2007-09-26 2009-04-16 Rakuten Inc 物体領域抽出処理プログラム、物体領域抽出装置、および物体領域抽出方法
JP2009198514A (ja) * 2009-06-01 2009-09-03 Hitachi High-Technologies Corp パターン検査方法及びその装置
JP2011212301A (ja) * 2010-03-31 2011-10-27 Fujifilm Corp 投影画像生成装置および方法、並びにプログラム

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Y. BOYKOV; M.-P. JOLLY: "Interactive Graph Cuts for Optimal Boundary & Region Segmentation of Objects in N-D images", ICCV2001, vol. 01, 2001, pages 105

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112740271A (zh) * 2019-06-17 2021-04-30 大日本印刷株式会社 判定装置、判定装置的控制方法、判定系统、判定系统的控制方法以及程序
CN112740271B (zh) * 2019-06-17 2024-04-26 大日本印刷株式会社 判定装置、判定装置的控制方法、判定系统、判定系统的控制方法以及介质
CN112419298A (zh) * 2020-12-04 2021-02-26 中冶建筑研究总院(深圳)有限公司 一种螺栓节点板锈蚀检测方法、装置、设备及存储介质
CN112419298B (zh) * 2020-12-04 2024-01-19 中冶建筑研究总院(深圳)有限公司 一种螺栓节点板锈蚀检测方法、装置、设备及存储介质

Also Published As

Publication number Publication date
JP2013140090A (ja) 2013-07-18
KR20140088220A (ko) 2014-07-09
EP2801815A4 (en) 2015-10-07
EP2801815A1 (en) 2014-11-12
KR101626231B1 (ko) 2016-05-31
CN103988069A (zh) 2014-08-13
CN103988069B (zh) 2016-10-05
EP2801815B1 (en) 2018-06-27
US20140314302A1 (en) 2014-10-23
JP5874398B2 (ja) 2016-03-02
US9269134B2 (en) 2016-02-23

Similar Documents

Publication Publication Date Title
JP5874398B2 (ja) 画像検査装置の検査領域設定方法
JP5929238B2 (ja) 画像検査方法および画像検査装置
US9892504B2 (en) Image inspection method and inspection region setting method
US10896493B2 (en) Intelligent identification of replacement regions for mixing and replacing of persons in group portraits
JP5546317B2 (ja) 外観検査装置、外観検査用識別器の生成装置及び外観検査用識別器生成方法ならびに外観検査用識別器生成用コンピュータプログラム
CN111833303B (zh) 产品的检测方法、装置、电子设备及存储介质
US8780223B2 (en) Automatic determination of compliance of a part with a reference drawing
US11222418B2 (en) System and method for automated surface assessment
US20210390282A1 (en) Training data increment method, electronic apparatus and computer-readable medium
JP7214432B2 (ja) 画像処理方法、画像処理プログラム、記録媒体、画像処理装置、生産システム、物品の製造方法
JP2023515520A (ja) ユーザ入力に基づいて生成された人工知能モデルを使用し、仮想欠陥画像を生成するためのコンピュータプログラム、方法、及び装置
JP6405124B2 (ja) 検査装置、検査方法およびプログラム
CN111696079A (zh) 一种基于多任务学习的表面缺陷检测方法
JP2015004641A (ja) ウエハ外観検査装置
JP6049052B2 (ja) ウエハ外観検査装置及びウエハ外観検査装置における感度しきい値設定方法
EP2691939B1 (en) Automatic determination of compliance of a part with a reference drawing
US9230309B2 (en) Image processing apparatus and image processing method with image inpainting
US20230394797A1 (en) Data creation system, learning system, estimation system, processing device, evaluation system, data creation method, and program
JP2022114462A (ja) 検査装置および検査方法
JP2014126388A (ja) 情報処理装置、その制御方法、及びプログラム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12864252

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 20147015679

Country of ref document: KR

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: 2012864252

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 14363340

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE