[go: up one dir, main page]

CN115335688A - Image processing systems and computer programs - Google Patents

Image processing systems and computer programs Download PDF

Info

Publication number
CN115335688A
CN115335688A CN202080098821.7A CN202080098821A CN115335688A CN 115335688 A CN115335688 A CN 115335688A CN 202080098821 A CN202080098821 A CN 202080098821A CN 115335688 A CN115335688 A CN 115335688A
Authority
CN
China
Prior art keywords
image
pixel
value
differential
inspection
Prior art date
Legal status (The legal status 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 status listed.)
Withdrawn
Application number
CN202080098821.7A
Other languages
Chinese (zh)
Inventor
山田荣二
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nidec Corp
Original Assignee
Nidec Corp
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 Nidec Corp filed Critical Nidec Corp
Publication of CN115335688A publication Critical patent/CN115335688A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • 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

Landscapes

  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • General Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

The image processing system includes: a processor; a memory; and a storage device for storing data of at least one non-defective item differential image generated from at least one non-defective item image obtained by imaging a non-defective item. The processor executes the following processing according to the program: acquiring data of an inspection image obtained by imaging an object to be inspected; generating a differential image of the acquired inspection image; calculating a difference or a ratio between a pixel value of the generated differential image and a pixel value of the non-defective differential image for each pixel at the same position of the non-defective differential image and the generated differential image; and detecting, when the difference or the ratio is larger than a predetermined value, a pixel of the inspection image to which the difference or the ratio is given as a candidate of a pixel of an image including a defect of the object.

Description

图像处理系统和计算机程序Image processing system and computer program

技术领域technical field

本公开涉及图像处理系统和计算机程序。The present disclosure relates to image processing systems and computer programs.

背景技术Background technique

以往,利用对被检查物进行拍摄而获取的图像,进行对被检查物是否存在缺陷、即被检查物是否为合格品进行判定的外观检查。Conventionally, an appearance inspection for judging whether the inspected object has defects, that is, whether the inspected object is a good product or not, has been performed using images captured by photographing the inspected object.

例如,在日本特开2000-132684号公报中公开了能够与条纹图案区别地检测在具有条纹图案的被检查物的表面产生的缺陷的外观检查方法。在日本特开2000-132684号公报中,通过图像的微分处理检测条纹的边缘,着眼于检测出的边缘的紊乱,判定有无缺陷。For example, Japanese Patent Application Laid-Open No. 2000-132684 discloses an appearance inspection method capable of detecting defects generated on the surface of an object to be inspected having a stripe pattern differently from a stripe pattern. In Japanese Patent Application Laid-Open No. 2000-132684, the edge of a stripe is detected by differential processing of an image, and the presence or absence of a defect is determined focusing on the disorder of the detected edge.

在日本特开2000-329538号公报中公开了对图像实施微分处理,进而使用二值化阈值进行二值化来判定缺陷的方法。并且,在日本特开2000-329538号公报中,即使存在图像的不均匀性,通过按照每个规定的区域计算二值化阈值,也能够均匀地提高在整个摄像图像中提取缺陷的性能。Japanese Patent Application Laid-Open No. 2000-329538 discloses a method of performing differential processing on an image, and further performing binarization using a binarization threshold to determine a defect. In addition, in Japanese Patent Application Laid-Open No. 2000-329538, even if there is image non-uniformity, by calculating the binarization threshold for each predetermined region, it is possible to uniformly improve the performance of extracting defects in the entire captured image.

在日本特开2005-265661号公报中公开了从多个合格品图像组中按照每个像素确定合格品范围,进行合格与否判定的方法。Japanese Unexamined Patent Publication No. 2005-265661 discloses a method of specifying a range of good products for each pixel from among a plurality of good product image groups, and performing a pass/fail judgment.

现有技术文献prior art literature

专利文献patent documents

专利文献1:日本特开2000-132684号公报Patent Document 1: Japanese Patent Laid-Open No. 2000-132684

专利文献2:日本特开2000-329538号公报Patent Document 2: Japanese Patent Laid-Open No. 2000-329538

专利文献3:日本特开2005-265661号公报Patent Document 3: Japanese Patent Laid-Open No. 2005-265661

发明内容Contents of the invention

发明要解决的课题The problem to be solved by the invention

根据上述的任一技术,均无法检测出缺陷整体,而无法检测微分值低的像素或合格品范围内的像素。其结果为,有可能将缺陷判定为较小,或者分裂地判定为多个缺陷。According to any of the techniques described above, it is impossible to detect the entire defect, and it is impossible to detect pixels with low differential values or pixels within the range of good products. As a result, the defect may be determined to be small, or may be divided into a plurality of defects.

本公开的实施方式提供能够用于外观检查的新的图像处理系统和计算机程序。Embodiments of the present disclosure provide a new image processing system and computer program that can be used for visual inspection.

用于解决课题的手段means to solve the problem

在例示性的实施方式中,本公开的图像处理系统具有:处理器;存储器,其存储有控制所述处理器的动作的程序;以及存储装置,其保存有根据拍摄合格品而得的至少一张合格品图像而生成的至少一张合格品微分图像的数据,所述处理器按照所述程序而执行如下处理:获取拍摄所述被检查物而得的检查用图像的数据;生成获取到的所述检查用图像的微分图像;按照所述合格品微分图像和所生成的所述微分图像的相同的位置的每个像素,计算所生成的所述微分图像的像素值和所述合格品微分图像的像素值之差或之比;以及在所述差或所述比大于预先确定的情况下,检测赋予了所述差或所述比的所述检查用图像的像素作为包含所述被检查物的缺陷的像的像素的候选。In an exemplary embodiment, the image processing system of the present disclosure has: a processor; a memory storing a program for controlling the operation of the processor; and a storage device storing at least one The data of at least one differential image of a qualified product generated from one qualified product image, the processor performs the following processing according to the program: acquire the data of the inspection image obtained by shooting the inspected object; generate the acquired obtained A differential image of the inspection image; calculating the pixel value of the generated differential image and the differential image of the good product for each pixel at the same position in the differential image of the good product and the generated differential image. a difference or a ratio of pixel values of an image; and when the difference or the ratio is greater than predetermined, detecting the pixel of the inspection image to which the difference or the ratio is given as including the inspected Candidates for the pixels of the image of the object defect.

在例示性的实施方式中,本公开的计算机程序由图像处理系统的计算机来执行,其中,所述图像处理系统具有:作为所述计算机的处理器;存储器,其存储有控制所述处理器的动作的程序;以及存储装置,其保存有根据拍摄合格品而得的至少一张合格品图像而生成的至少一张合格品微分图像的数据,所述计算机程序使所述处理器执行如下处理:获取拍摄所述被检查物而得的检查用图像的数据;生成获取到的所述检查用图像的微分图像;按照所述合格品微分图像和所生成的所述微分图像的相同的位置的每个像素,计算所生成的所述微分图像的像素值和所述合格品微分图像的像素值之差或之比;以及在所述差或所述比大于预先确定的阈值的情况下,检测赋予了所述差或所述比的所述检查用图像的像素作为包含所述被检查物的缺陷的像的像素的候选。In an exemplary embodiment, the computer program of the present disclosure is executed by a computer of an image processing system, wherein the image processing system has: a processor as the computer; a memory storing information for controlling the processor; A program of action; and a storage device, which saves the data of at least one differential image of a qualified product generated according to at least one image of a qualified product obtained by shooting a qualified product, and the computer program causes the processor to perform the following processing: Acquiring data of an inspection image obtained by photographing the object to be inspected; generating a differential image of the acquired inspection image; pixels, calculate the difference or the ratio between the pixel value of the generated differential image and the pixel value of the qualified product differential image; and when the difference or the ratio is greater than a predetermined threshold, the detection award The pixel of the inspection image having the difference or the ratio is a candidate for a pixel of an image including a defect of the inspection object.

发明效果Invention effect

根据本公开的例示性的实施方式,能够适当地检测出缺陷的候选。According to the exemplary embodiment of the present disclosure, it is possible to appropriately detect candidates for defects.

附图说明Description of drawings

图1是示出具有图像处理系统100的本公开的外观检查系统1000的结构例的图。FIG. 1 is a diagram illustrating a configuration example of an appearance inspection system 1000 of the present disclosure including an image processing system 100 .

图2是主要示意性地示出图像处理系统100的结构例的图。FIG. 2 is a diagram mainly schematically showing a configuration example of the image processing system 100 .

图3是用于说明第1例的检测薄的划痕(线损伤)时的图像处理的流程的图。3 is a diagram for explaining the flow of image processing when detecting a thin scratch (line damage) in the first example.

图4是用于说明第2例的检测薄的划痕(线损伤)时的图像处理的流程的图。4 is a diagram for explaining the flow of image processing when detecting a thin scratch (line damage) in the second example.

图5是对比地示出原图像和进行了损伤的检测处理后的检测结果的图。FIG. 5 is a diagram showing a comparison between the original image and the detection result after the damage detection process is performed.

图6是示意性地示出线损伤的像素值的变化的图。FIG. 6 is a diagram schematically showing changes in pixel values of line damage.

图7A是用于说明第1例的微分图像的生成处理的图。FIG. 7A is a diagram for explaining the generation process of the differential image in the first example.

图7B是用于说明第2例的微分图像的生成处理的图。FIG. 7B is a diagram for explaining the generation process of the differential image in the second example.

图8是示出在本实施方式的图像处理系统100中进行的处理的过程的流程图。FIG. 8 is a flowchart showing the procedure of processing performed in the image processing system 100 of the present embodiment.

图9是用于说明本实施方式的检测结果的图。FIG. 9 is a diagram for explaining detection results of the present embodiment.

图10是用于说明合格品图像具有像素值的平缓的梯度的情况下的本实施方式的检测结果的图。FIG. 10 is a diagram for explaining detection results of the present embodiment when a good product image has a gentle gradient of pixel values.

图11是用于说明合格品图像具有像素值的陡峭的梯度和平缓的梯度的情况下的本实施方式的检测结果的图。FIG. 11 is a diagram for explaining detection results of the present embodiment when a good product image has a steep gradient and a gentle gradient of pixel values.

图12是用于说明用于抑制过度检测的又一方法的图。FIG. 12 is a diagram for explaining still another method for suppressing overdetection.

具体实施方式Detailed ways

以下,参照附图对本公开的外观检查系统的实施方式进行说明。在本说明书中,有时省略必要以上的详细说明。例如,有时省略已经众所周知的事项的详细说明、对实质上相同的结构的重复说明。这是为了避免以下的说明变得不必要地冗长,使本领域技术人员容易理解。另外,本发明人为了使本领域技术人员充分理解本公开而提供附图和以下的说明,并不意图通过这些来限定权利要求书所记载的主题。在以下的说明中,对相同或类似的构成要素标注相同的参照标号。Hereinafter, embodiments of the visual inspection system of the present disclosure will be described with reference to the drawings. In this specification, necessary detailed explanations may be omitted. For example, detailed descriptions of already well-known items and repeated descriptions of substantially the same configurations may be omitted. This is to prevent the following description from becoming unnecessarily lengthy and to facilitate understanding by those skilled in the art. In addition, the present inventors provide the drawings and the following description in order that those skilled in the art can fully understand the present disclosure, and do not intend to limit the subject matter described in the claims by these. In the following description, the same reference numerals are attached to the same or similar components.

本公开的图像处理系统例如能够适合用于工厂等制造现场中的物品或者部件的外观检查系统的预处理。以下,根据与外观检查系统的关系,对图像处理系统的结构进行说明。The image processing system of the present disclosure can be suitably used for, for example, preprocessing of an appearance inspection system for articles or components in a manufacturing site such as a factory. Hereinafter, the configuration of the image processing system will be described based on the relationship with the visual inspection system.

图1是示出具有图像处理系统100的本公开的外观检查系统1000的结构例的图。图2是主要示意性地示出图像处理系统100的结构例的图。FIG. 1 is a diagram illustrating a configuration example of an appearance inspection system 1000 of the present disclosure including an image processing system 100 . FIG. 2 is a diagram mainly schematically showing a configuration example of the image processing system 100 .

在图示的例子中,外观检查系统1000具有摄像装置30、图像处理系统100以及监视器130。图像处理系统100、输入装置120以及监视器130能够通过通用的数字计算机系统例如PC来实现。另外,摄像装置30可以是数码相机。摄像装置30通过未图示的有线的通信线缆或无线通信线路以能够通信的方式与图像处理系统100连接。监视器130通过未图示的有线的通信线缆以能够通信的方式与图像处理系统100连接。In the illustrated example, the appearance inspection system 1000 has an imaging device 30 , an image processing system 100 , and a monitor 130 . The image processing system 100, the input device 120, and the monitor 130 can be realized by a general-purpose digital computer system such as a PC. In addition, the imaging device 30 may be a digital camera. The imaging device 30 is communicably connected to the image processing system 100 via a wired communication cable or a wireless communication line (not shown). The monitor 130 is communicably connected to the image processing system 100 via a wired communication cable (not shown).

摄像装置30对被检查物进行拍摄,并将通过拍摄获取到的图像数据发送给图像处理系统100。图像处理系统100按照后述的过程,对从摄像装置30接收到的图像数据进行用于缺陷检测的“预处理”。通过预处理,判定构成图像数据的各像素是否能够成为包含被检查物的缺陷的像的像素的候选(缺陷像素候选)。该“预处理”是本实施方式的图像处理系统100的主要的处理。The imaging device 30 photographs the object to be inspected, and sends the image data obtained by photographing to the image processing system 100 . The image processing system 100 performs "preprocessing" for defect detection on the image data received from the imaging device 30 in accordance with a procedure described later. Through the preprocessing, it is determined whether or not each pixel constituting the image data can be a candidate for a pixel of an image including a defect of the object to be inspected (defective pixel candidate). This "preprocessing" is the main processing of the image processing system 100 of this embodiment.

利用所有的缺陷像素候选,之后从图像数据中提取缺陷。在外观检查系统1000中,根据连续存在的缺陷像素候选的大小和/或范围,判定是否存在缺陷。将所有的处理统称为“外观检查”。另外,本实施方式的图像处理系统100也可以进行检测出所有的缺陷像素候选之后的有无缺陷的判定处理。Using all defective pixel candidates, defects are then extracted from the image data. In the visual inspection system 1000, it is determined whether or not there is a defect based on the size and/or range of defective pixel candidates that continuously exist. All the processing is collectively referred to as "appearance inspection". In addition, the image processing system 100 of this embodiment may perform the determination process of the presence or absence of a defect after detecting all the defect pixel candidates.

参照图1,对在外观检查系统1000中进行的被检查物的外观检查的过程进行说明。被检查物是作为外观检查的对象的各种产品或部件等各种物品。以下,有时将被检查物称为“工件”。Referring to FIG. 1 , the procedure of the visual inspection of the object to be inspected by the visual inspection system 1000 will be described. The objects to be inspected are various items such as various products and parts that are the object of visual inspection. Hereinafter, the object to be inspected may be referred to as a "workpiece".

工件70放置在移送台62上,通过把持机构而固定于移送台62。工件70例如是硬盘驱动器的成品、组装有马达的硬盘驱动器的壳体等。The workpiece 70 is placed on the transfer table 62 and fixed to the transfer table 62 by a gripping mechanism. The workpiece 70 is, for example, a finished hard disk drive, a housing of a hard disk drive incorporating a motor, or the like.

移送台62能够在放置有工件70的状态下通过搬运台64在水平方向上移动。摄像装置30在搬运台64的上方由支承部件60支承,以使视野内包含搬运台64。摄像装置30进行视野内的工件70的摄像。工件70也可以被机器人臂把持而被置于摄像位置。另外,也可以是在进行拍摄时,光源(未图示)照亮工件70。The transfer table 62 can move in the horizontal direction by the transfer table 64 in a state where the workpiece 70 is placed. The imaging device 30 is supported by the support member 60 above the conveyance table 64 so that the conveyance table 64 is included in the field of view. The imaging device 30 images the workpiece 70 within the field of view. The workpiece 70 may also be held by a robot arm and placed at an imaging position. In addition, a light source (not shown) may illuminate the workpiece 70 at the time of imaging.

通过拍摄获取到的图像数据从摄像装置30发送到图像处理系统100。通过一次拍摄获取的图像的尺寸的一例是横1600像素、纵1200图像,另一例是横800像素、纵600图像。Image data acquired by shooting is sent from the imaging device 30 to the image processing system 100 . An example of the size of an image acquired by one shot is 1600 pixels in width and 1200 in height, and another example is 800 pixels in width and 600 in height.

接着,参照图2。Next, refer to FIG. 2 .

图像处理系统100具有运算电路10、存储器12、存储装置14以及图像处理电路16。构成要素彼此通过总线18以能够通信的方式连接。另外,图像处理系统100具有进行与摄像装置30的通信的接口装置22a、进行与输入装置120的通信的接口装置22b以及向监视器130输出影像数据的接口装置22c。接口装置22a的一例是影像输入端子或以太网端子。接口装置22b的一例是USB端子。接口装置22c的一例是HDMI(注册商标)端子。也可以代替这些例子,将其他端子用作接口装置22a~22c。另外,接口装置22a~22c也可以是用于进行无线通信的无线通信电路。作为这样的无线通信电路,例如已知有利用2.4GHz/5.2GHz/5.3GHz/5.6GHz等频率进行无线通信的遵照Wi-Fi(注册商标)标准的无线通信电路。The image processing system 100 has an arithmetic circuit 10 , a memory 12 , a storage device 14 , and an image processing circuit 16 . The constituent elements are communicably connected to each other via a bus 18 . In addition, the image processing system 100 includes an interface device 22 a for communicating with the imaging device 30 , an interface device 22 b for communicating with the input device 120 , and an interface device 22 c for outputting video data to the monitor 130 . An example of the interface device 22a is a video input terminal or an Ethernet terminal. An example of the interface device 22b is a USB terminal. An example of the interface device 22c is an HDMI (registered trademark) terminal. Instead of these examples, other terminals may be used as the interface devices 22a to 22c. In addition, the interface devices 22a to 22c may be wireless communication circuits for performing wireless communication. As such a wireless communication circuit, for example, a wireless communication circuit compliant with the Wi-Fi (registered trademark) standard that performs wireless communication using frequencies such as 2.4 GHz/5.2 GHz/5.3 GHz/5.6 GHz is known.

运算电路10例如可以是中央运算处理装置(CPU)或数字信号处理用处理器等集成电路(IC)芯片。存储器12保存有控制运算电路10的动作的计算机程序12p。The arithmetic circuit 10 may be, for example, an integrated circuit (IC) chip such as a central processing unit (CPU) or a processor for digital signal processing. The memory 12 stores a computer program 12p for controlling the operation of the arithmetic circuit 10 .

存储器12不需要是单一记录介质,可以是多个记录介质的集合。存储器12例如可以包含RAM等半导体易失性存储器和闪存ROM等半导体非易失性存储器。存储器12的至少一部分也可以是可拆卸的记录介质。The memory 12 does not need to be a single recording medium, but may be a collection of multiple recording media. The memory 12 may include, for example, semiconductor volatile memories such as RAM and semiconductor nonvolatile memories such as flash ROM. At least a part of the memory 12 may also be a removable recording medium.

存储装置14保存有至少一张合格品微分图像的数据。“合格品微分图像”是根据至少一张合格品图像(拍摄合格品而得的图像)生成的微分图像。微分图像的各像素值例如是合格品图像的至少两个像素的像素值的差分值。The storage device 14 stores data of at least one differential image of a qualified product. The "defective product differential image" is a differential image generated from at least one good product image (an image obtained by photographing a good product). Each pixel value of the differential image is, for example, a difference value between pixel values of at least two pixels of the non-defective image.

图像处理电路16可以是也被称为GPU(Graphics Processing Unit:图形处理单元)的集成电路(IC)芯片。图像处理电路16生成用于显示在监视器130上的图像数据。The image processing circuit 16 may be an integrated circuit (IC) chip also called a GPU (Graphics Processing Unit: Graphics Processing Unit). The image processing circuit 16 generates image data for display on the monitor 130 .

在本实施方式中,利用拍摄被检查物而得的检查用图像的微分图像和预先保存在存储装置14中的合格品微分图像,按照检查用图像的每个像素判定是否为包含被检查物的缺陷的像的像素的候选。另外,微分图像的导出方法在后面说明。In this embodiment, by using the differential image of the inspection image obtained by photographing the inspection object and the differential image of the good product stored in the storage device 14 in advance, it is determined whether or not the inspection image contains the inspection object for each pixel. Candidates for defective image pixels. In addition, the derivation method of the differential image will be described later.

摄像装置30是输出用于生成被检查对物的图像的数据的图像信号的装置。图像信号通过有线或无线而发送到运算电路10。摄像装置30的典型例是具有多个光电二极管呈矩阵状排列而得的CMOS图像传感器或CCD图像传感器等区域传感器的照相机。摄像装置30生成被检查物的彩色图像或单色图像的数据。摄像装置30能够使用外观检查用的各种照相机。The imaging device 30 is a device that outputs an image signal for generating image data of an object to be inspected. The image signal is sent to the arithmetic circuit 10 by wire or wirelessly. A typical example of the imaging device 30 is a camera including an area sensor such as a CMOS image sensor or a CCD image sensor in which a plurality of photodiodes are arranged in a matrix. The imaging device 30 generates data of a color image or a monochrome image of the object to be inspected. Various cameras for visual inspection can be used for the imaging device 30 .

输入装置120是接受来自用户的包含后述的阈值的指定的输入并提供给运算电路10的输入器件。输入装置120的一例是触摸面板、鼠标和/或键盘。The input device 120 is an input device that accepts an input from a user including designation of a threshold value described later and supplies it to the arithmetic circuit 10 . An example of the input device 120 is a touch panel, a mouse, and/or a keyboard.

监视器130是显示图像处理装置100执行的判别的结果、外观检查系统1000的外观检查结果等的装置。监视器130还能够显示由摄像装置30获取的图像。The monitor 130 is a device that displays the result of discrimination performed by the image processing device 100 , the result of the visual inspection by the visual inspection system 1000 , and the like. The monitor 130 is also capable of displaying images captured by the imaging device 30 .

监视器130和输入装置120不需要通过有线与运算电路10始终连接,也可以经由通信接口通过无线或者有线仅在必要时连接。监视器130和输入装置120的组合也可以由用户携带的终端装置或者智能手机来实现。The monitor 130 and the input device 120 do not always need to be connected to the arithmetic circuit 10 by wire, and may be connected by wireless or wire via a communication interface only when necessary. The combination of the monitor 130 and the input device 120 can also be realized by a terminal device or a smart phone carried by the user.

在本公开的例示性的实施方式的说明中,主要说明运算电路10执行图像处理的情况。然而,该图像处理也可以由运算电路10和图像处理电路16中的任一方执行。在本说明书中,有时将运算电路10和图像处理电路16统称为“处理器”。In the description of the exemplary embodiment of the present disclosure, the case where the arithmetic circuit 10 executes image processing will be mainly described. However, this image processing may be performed by either one of the arithmetic circuit 10 and the image processing circuit 16 . In this specification, the arithmetic circuit 10 and the image processing circuit 16 are sometimes collectively referred to as a "processor".

接着,参照图3至图6,对现有的外观检查中的具体的问题点和开发例示性的图像处理系统100的目的进行说明。Next, specific problems in conventional visual inspection and the purpose of developing an exemplary image processing system 100 will be described with reference to FIGS. 3 to 6 .

图3是用于说明第1例的检测薄的划痕(线损伤)时的图像处理的流程的图。按照箭头的顺序,从左上的图像(第1张)依次进行处理,得到右下的图像(第6张)。左上的图像(第1张)是由摄像装置获取的原图像。接着,得到对原图像施加了边缘强调滤波后的图像(第2张)。以下,依次进行损伤的检测处理(第3张)、膨胀处理和收缩处理(第4张)、标示处理(第5张)、线连结处理(第6张)。3 is a diagram for explaining the flow of image processing when detecting a thin scratch (line damage) in the first example. In the order of the arrows, the processing is performed sequentially from the upper left image (1st image) to obtain the lower right image (6th image). The image on the upper left (first image) is the original image captured by the camera. Next, an image (second image) obtained by applying an edge-enhancing filter to the original image. Next, damage detection processing (third sheet), expansion processing and contraction processing (fourth sheet), labeling processing (fifth sheet), and line connection processing (sixth sheet) are sequentially performed.

虽然人眼可以看到1条细长的线损伤,但在图像上实际上是不连续的。在第3张图像中,线损伤大致由9根线段(标签)的集合构成。将该状态记为“标签数:9”。Although the human eye can see a thin line of damage, it is actually discontinuous on the image. In the 3rd image, the line damage roughly consists of a collection of 9 line segments (labels). This state is described as "number of labels: 9".

在第4张图像中,线损伤大致由5条标签的集合构成(标签数:5)。在第5张图像中,对各线段分配编号。将分配编号的处理称为“标示处理”。In the 4th image, the line damage roughly consists of a set of 5 labels (number of labels: 5). In the fifth image, numbers are assigned to each line segment. The process of assigning a number is called "marking process".

在第6张图像中,连结3个标签并整合为1条标签。将该处理称为“线连结处理”。在线连结处理中,对各标签进行比较,在判定为多个标签构成1个线损伤(线缺陷)的情况下,将多个标签结合成1个标签。即,在第6张图像中判定为存在3条标签。在图中,示出了最长的标签的长度为9.43mm,标签的面积为1.66平方毫米。长度和面积的各值由图像处理系统100的运算电路10计算。In the 6th image, 3 tags are connected and integrated into 1 tag. This processing is called "line connection processing". In the line linking process, the tags are compared, and when it is determined that a plurality of tags constitute one thread damage (thread defect), the plurality of tags are combined into one tag. That is, it is determined that there are three tags in the sixth image. In the figure, it is shown that the length of the longest label is 9.43 mm and the area of the label is 1.66 square millimeters. Each value of the length and the area is calculated by the arithmetic circuit 10 of the image processing system 100 .

在标签的长度和/或面积超过预先确定的阈值的情况下,运算电路10判定为检测出的标签是线缺陷。即,判定原图像中包含线损伤。When the length and/or area of the label exceed a predetermined threshold, the arithmetic circuit 10 determines that the detected label is a line defect. That is, it is determined that the original image contains line damage.

另外,省略上述边缘强调滤波、损伤的检测处理、膨胀处理和收缩处理、标示处理以及线连结处理的进一步的具体内容及其说明。In addition, the further specific content and description of the above-mentioned edge enhancement filtering, damage detection processing, expansion processing and contraction processing, labeling processing, and line connection processing are omitted.

图4是用于说明第2例的检测薄的划痕(线损伤)时的图像处理的流程的图。记载以图3的例子为准。4 is a diagram for explaining the flow of image processing when detecting a thin scratch (line damage) in the second example. The description is based on the example in Figure 3.

进行了和与图3相关的第1例同样的处理的结果是,例如在第5张的标示处理中判定为存在无数个线段,而要分配非常多的编号。其结果为,在第6张图像中,虽然存在多个长度相对较短且面积相对较小的线损伤,但判定为不存在缺陷。因此,判定为在图4的原始图像中不包含缺陷。As a result of performing the same processing as in the first example related to FIG. 3 , for example, in the labeling processing of the fifth sheet, it is determined that there are an infinite number of line segments, and a very large number of numbers must be assigned. As a result, in the sixth image, although there were many line damages of relatively short length and relatively small area, it was determined that there was no defect. Therefore, it is determined that no defect is contained in the original image of FIG. 4 .

本发明人认为从原图像(第1张)到损伤的检测处理(第3张)的处理的结果对最终的有无缺陷的判定产生较大的影响。图5对比地示出原图像和进行了损伤的检测处理后的检测结果。若重新与看起来连续的上段的原图像进行比较,则在下段的损伤的检测处理后的图像中看起来存在不连续的多个损伤。因此,若通过下段的图像来认定损伤的长度,则不存在认定为缺陷这样的较长的损伤。参照图6,用像素值的观点对此时的线损伤进行说明。The inventors of the present invention believe that the results of the processing from the original image (first image) to the damage detection process (third image) have a large influence on the final determination of the presence or absence of defects. FIG. 5 shows a comparison between the original image and the detection result after the damage detection process is performed. When compared again with the original image in the upper stage which appears to be continuous, a plurality of discontinuous damages appear to exist in the image after the detection process of the damage in the lower stage. Therefore, if the length of the damage is identified from the image in the lower row, there is no longer damage that is identified as a defect. The line damage at this time will be described from the viewpoint of pixel values with reference to FIG. 6 .

图6示意性地示出线损伤的像素值的变化。横轴用像素数表示沿着线损伤的方向的线损伤的长度,纵轴用256级的灰度表示各像素的像素值。Fig. 6 schematically shows changes in pixel values of line damage. The horizontal axis represents the length of the line damage along the direction of the line damage by the number of pixels, and the vertical axis represents the pixel value of each pixel by 256 gray levels.

用实线包围比上限值(UL)大的像素值和比下限值(LL)小的像素值。这些是以像素为单位认定的缺陷的候选。由于缺陷的候选隔开距离而离散地存在,因此如上所述,在现有的外观检查中,整体上未被识别为1条缺陷。Pixel values larger than the upper limit value (UL) and pixel values smaller than the lower limit value (LL) are surrounded by solid lines. These are candidates for defects identified in units of pixels. Since candidates for defects exist discretely at a distance, as described above, in the conventional visual inspection, the overall defect was not recognized as one.

本发明人通过使用微分图像而检测本来不作为缺陷的候选的由虚线包围的合格品范围的像素组的一部分作为线伤,从而开发出能够适当地识别线损伤的存在的处理。The present inventors developed a process capable of appropriately identifying the presence of line damage by using a differential image to detect, as line damage, part of a pixel group in a non-defective product range surrounded by a dotted line that is not originally a defect candidate.

以下,首先说明生成微分图像的处理,然后说明利用了微分图像的处理。Hereinafter, first, the processing of generating a differential image will be described, and then the processing using the differential image will be described.

图7A是用于说明第1例的微分图像的生成处理的图。图7A的上段表示图像I,下段表示微分图像I’。将图像的从左到右的方向设为X坐标的正方向,将图像的从上到下的方向设为Y坐标的正方向。图像I典型地是原图像。FIG. 7A is a diagram for explaining the generation process of the differential image in the first example. The upper row of Fig. 7A shows the image I, and the lower row shows the differential image I'. The direction from left to right of the image is set as the positive direction of the X coordinate, and the direction from top to bottom of the image is set as the positive direction of the Y coordinate. Image I is typically an original image.

以下,示出在本申请说明书中使用的表现。“位置P”表示图像的任意的位置。“像素值”例如以256级的灰度表现。P(x,y):图像内的位置P的坐标,I(x,y):图像I的坐标(x,y)的像素的像素值,I’(x,y):微分图像I’的坐标(x,y)的像素的像素值,Ix(x,y):图像I的坐标(x,y)中的X方向的微分值,Iy(x,y):图像I的坐标(x,y)中的Y方向的微分值。The expressions used in the specification of this application are shown below. "Position P" represents an arbitrary position of the image. "Pixel value" is represented by, for example, 256-level grayscale. P(x, y): the coordinates of the position P within the image, I(x, y): the pixel value of the pixel at the coordinate (x, y) of the image I, I'(x, y): the differential image I' The pixel value of the pixel at the coordinates (x, y), I x (x, y): the differential value in the X direction in the coordinates (x, y) of the image I, I y (x, y): the coordinates of the image I ( The differential value in the Y direction in x, y).

如图7A的上段所示的那样,关注于位置P、+X方向的相邻的位置的像素Q以及+Y方向的相邻的位置的像素R。Q的坐标为(x+1,y),R的坐标为(x,y+1)。在第1例中,位置P处的X方向和Y方向的各微分值如下定义。As shown in the upper part of FIG. 7A , attention is paid to the position P, the pixel Q at the adjacent position in the +X direction, and the pixel R at the adjacent position in the +Y direction. The coordinates of Q are (x+1, y), and the coordinates of R are (x, y+1). In the first example, each differential value in the X direction and the Y direction at the position P is defined as follows.

【数学式1】【Mathematical formula 1】

Ix(x,y)=I(x+1,y)-I(x,y)I x (x, y) = I (x+1, y) - I (x, y)

Iy(x,y)=I(x,y+1)-I(x,y)I y (x, y) = I (x, y+1) - I (x, y)

即,X方向的微分值Ix(x,y)是位置Q的像素的像素值与位置P的像素的像素值的差分。Y方向的微分值Iy(x,y)是位置R的像素的像素值与位置P的像素的像素值的差分。另外,X方向的微分值能够用于图像I的Y方向的轮廓的检测。另外,Y方向的微分值能够用于X方向的轮廓的检测。That is, the differential value I x (x, y) in the X direction is the difference between the pixel value of the pixel at position Q and the pixel value of the pixel at position P. The differential value I y (x, y) in the Y direction is the difference between the pixel value of the pixel at position R and the pixel value of the pixel at position P. In addition, the differential value in the X direction can be used to detect the contour of the image I in the Y direction. In addition, the differential value in the Y direction can be used for detection of the contour in the X direction.

当通过数学式1得到各方向的微分值时,微分图像I’的位置(x,y)的像素值I’(x,y)通过数学式2得到。When the differential value in each direction is obtained by Mathematical Expression 1, the pixel value I'(x, y) of the position (x, y) of the differential image I' is obtained by Mathematical Expression 2.

【数学式2】【Mathematical formula 2】

Figure BDA0003854546650000081
Figure BDA0003854546650000081

通过使用上述的数学式2来求出所有的像素值I’(x,y),能够生成微分图像I’。另外,在本例中,图像I和图像I’的横向(X方向)的像素数和纵向(Y方向)的像素数是相同的。为了使图像I和图像I’的像素数一致,在微分图像I’的最外侧遍及整周地追加例如像素值为0的像素。The differential image I' can be generated by calculating all the pixel values I'(x, y) using the above-mentioned Mathematical Expression 2. In addition, in this example, the number of pixels in the horizontal direction (X direction) and the number of pixels in the vertical direction (Y direction) of the image I and the image I' are the same. In order to make the number of pixels of the image I and the image I' equal, pixels with a pixel value of 0, for example, are added over the entire periphery of the differential image I'.

图7B是用于说明第2例的微分图像的生成处理的图。图7B的上段表示图像I和内核K,下段表示微分图像I’。将图像的从左到右的方向设为X坐标的正方向,将图像的从上到下的方向设为Y坐标的正方向。图像I典型地是原图像。FIG. 7B is a diagram for explaining the generation process of the differential image in the second example. The upper row of Fig. 7B shows the image I and the kernel K, and the lower row shows the differential image I'. The direction from left to right of the image is set as the positive direction of the X coordinate, and the direction from top to bottom of the image is set as the positive direction of the Y coordinate. Image I is typically an original image.

在第2例中,使用输入图像I和内核K进行卷积运算。“内核”是用于卷积运算的系数的集合,是所谓的滤波器。卷积运算是以包含某个位置P的像素和包围该像素的多个(例如8个)相邻像素的区域L为对象来进行的。这样的运算也被称为空间滤波。In the second example, a convolution operation is performed using an input image I and a kernel K. A "kernel" is a collection of coefficients used in a convolution operation, a so-called filter. The convolution operation is performed on an area L including a pixel at a certain position P and a plurality of (for example, 8) adjacent pixels surrounding the pixel. Such operations are also known as spatial filtering.

为了简化说明,以如下方式给出输入图像I的区域L内的像素的像素值和内核K。To simplify the description, the pixel values of the pixels within the area L of the input image I and the kernel K are given as follows.

【数学式3】【Mathematical formula 3】

Figure BDA0003854546650000082
Figure BDA0003854546650000082

数学式3所示的输入图像I的(2,2)要素与位置P的像素对应。此时,以如下方式求出微分图像I’的位置P的像素的像素值。The (2, 2) element of the input image I shown in Mathematical Expression 3 corresponds to the pixel at the position P. At this time, the pixel value of the pixel at the position P of the differential image I' is obtained as follows.

【数学式4】【Mathematical formula 4】

I’(x,y)=(k1·a)+(k2·b)+(k3·c)+(k4·d)+(k5·e)+(k6·f)+(k7·g)+(k8·h)+)+(k9·i)I'(x,y)=(k1·a)+(k2·b)+(k3·c)+(k4·d)+(k5·e)+(k6·f)+(k7·g)+ (k8·h)+)+(k9·i)

在输入图像I的要素数更多的情况下,对位置P的像素的像素值和包围该像素的8个像素的像素值应用内核K。When the number of elements of the input image I is larger, the kernel K is applied to the pixel value of the pixel at the position P and the pixel values of the eight pixels surrounding the pixel.

在本实施方式中,采用所谓的微分滤波器作为内核K。在本实施方式中,求出图像I的坐标(x,y)处的X方向的微分值Ix(x,y)和图像I的坐标(x,y)处的Y方向的微分值Iy(x,y)。因此,内核K也使用用于求出X方向的微分值的内核Kx和用于求出Y方向的微分值的内核Ky。数学式5分别示出了普鲁伊特(Prewitt)滤波器的内核Kx和Ky作为一例。In this embodiment, a so-called differential filter is used as the kernel K. In this embodiment, the differential value I x (x, y) in the X direction at the coordinate (x, y) of the image I and the differential value I y in the Y direction at the coordinate (x, y) of the image I are obtained. (x, y). Therefore, the kernel K also uses a kernel Kx for obtaining a differential value in the X direction and a kernel Ky for obtaining a differential value in the Y direction. Mathematical Expression 5 respectively shows the kernels Kx and Ky of the Prewitt filter as an example.

【数学式5】【Mathematical formula 5】

Figure BDA0003854546650000091
Figure BDA0003854546650000091

根据数学式5可知,内核Ky是内核Kx的转置。普鲁伊特滤波器是对一次微分滤波施加平滑化处理的滤波器,是公知的。因此,省略各行或各列的处理的意义的说明。另外,普鲁伊特滤波器只不过是一例。也可以采用索贝尔(Sobel)滤波器等其他微分滤波器。According to Mathematical Formula 5, it can be seen that the kernel Ky is the transpose of the kernel Kx. The Pruitt filter is known as a filter that applies smoothing processing to primary differential filtering. Therefore, the description of the meaning of the processing of each row or each column is omitted. In addition, the Pruitt filter is only an example. Other differential filters such as Sobel filters may also be used.

作为数学式3的内核K,通过分别采用数学式5所示的内核Kx和Ky,能够求出图像I的坐标(x,y)处的X方向的微分值Ix(x,y)和图像I的坐标(x,y)处的Y方向的微分值Iy(x,y)。然后,与第1例同样地,通过使用上述的数学式2求出所有的像素值I’(x,y),能够生成微分图像I’。另外,在本例中,图像I和I’的横向(X方向)的像素数和纵向(Y方向)的像素数也是相同的。为了使图像I和图像I’的像素数一致,在微分图像I’的最外侧遍及整周地追加例如像素值为0的像素。As the kernel K of Mathematical Expression 3, by using the kernels Kx and Ky shown in Mathematical Expression 5, respectively, the differential value I x (x, y) and the image Ix in the X direction at the coordinates (x, y) of the image I can be obtained. The differential value I y (x, y) in the Y direction at the coordinate (x, y) of I. Then, similarly to the first example, the differential image I' can be generated by calculating all the pixel values I'(x, y) using the above-mentioned Mathematical Expression 2. In addition, in this example, the number of pixels in the horizontal direction (X direction) and the number of pixels in the vertical direction (Y direction) of the images I and I′ are also the same. In order to make the number of pixels of the image I and the image I′ the same, pixels with a pixel value of 0, for example, are added over the entire periphery of the differential image I′.

运算电路12在通过第1例或第2例等的方法而生成微分图像I’时,执行以下说明的本实施方式的处理。When the arithmetic circuit 12 generates the differential image I' by the method of the first example or the second example, it executes the processing of this embodiment described below.

图8是示出在本实施方式的图像处理系统100中进行的处理的过程的流程图。该处理由运算电路10执行。在执行处理之前,根据拍摄合格品而得的至少一张合格品图像而生成至少一张微分图像(以下称为“合格品微分图像”),并将生成的合格品微分图像的数据保存在存储装置14中。在利用多个合格品图像的情况下,只要根据多个合格品图像而生成它们的平均图像,求出平均图像的微分图像即可。或者,也可以根据多个合格品图像而分别生成微分图像,对得到的多个微分图像分别进行后述的处理。合格品图像可以包含1个合格品,也可以包含多个合格品。是否为合格品可以由人或外观检查系统1000来判断。合格品微分图像可以由运算电路10、图像处理电路16或未图示的计算机例如通过上述的第1例或第2例来制作。FIG. 8 is a flowchart showing the procedure of processing performed in the image processing system 100 of the present embodiment. This processing is executed by the arithmetic circuit 10 . Before executing the processing, at least one differential image (hereinafter referred to as "defective product differential image") is generated based on at least one good product image obtained by photographing a good product, and the data of the generated good product differential image is stored in the memory device 14. When using a plurality of good product images, it is only necessary to generate an average image of the plurality of good product images and obtain a differential image of the average image. Alternatively, a differential image may be generated from a plurality of good product images, and the processing described later may be performed on each of the obtained plurality of differential images. A qualified product image may include one qualified product or multiple qualified products. Whether it is a good product can be judged by a person or the appearance inspection system 1000 . The differential image of a good product can be created by the arithmetic circuit 10, the image processing circuit 16, or a computer not shown, for example, by the above-mentioned first example or second example.

在步骤S2中,运算电路10获取拍摄被检查物而得的检查用图像的数据。运算电路10能够从摄像装置30经由接口装置22a直接接受由摄像装置30拍摄到的检查用图像。或者,运算电路10也可以从存储装置14读出从摄像装置30发送并暂时保存在存储装置14中的检查用图像。或者,运算电路10也可以从摄像装置30经由网络获取保存在该网络上的存储装置(未图示)中的检查用图像。In step S2, the arithmetic circuit 10 acquires data of an inspection image obtained by imaging the object to be inspected. The arithmetic circuit 10 can directly receive an inspection image captured by the imaging device 30 from the imaging device 30 via the interface device 22a. Alternatively, the arithmetic circuit 10 may read out from the storage device 14 the inspection image transmitted from the imaging device 30 and temporarily stored in the storage device 14 . Alternatively, the arithmetic circuit 10 may acquire an inspection image stored in a storage device (not shown) on the network from the imaging device 30 via a network.

在步骤S4中,运算电路10生成获取到的检查用图像的微分图像。微分图像的制作方法例如可以利用上述的第1例或第2例的方法。In step S4, the arithmetic circuit 10 generates a differential image of the acquired inspection image. As a method for creating a differential image, for example, the method of the above-mentioned first example or second example can be used.

在步骤S6中,运算电路10按照合格品微分图像和所生成的微分图像的相同的位置的每个像素,计算所生成的微分图像的像素值和合格品微分图像的像素值之差或之比。该处理的意义在于,按照每个像素将合格品微分图像与检查用图像的微分图像背离何种程度进行数值化。差越接近0,或者比越接近1,则意味着存在于相同的位置的合格品微分图像的像素和检查用图像的微分图像的像素具有变化的程度相似的像素值。In step S6, the calculation circuit 10 calculates the difference or the ratio between the pixel value of the generated differential image and the pixel value of the non-defective differential image for each pixel at the same position of the differential image of the non-defective product and the generated differential image. . The significance of this processing is to digitize the degree of deviation between the differential image of the good product and the differential image of the inspection image for each pixel. The closer the difference is to 0, or the closer the ratio is to 1, it means that the pixels of the differential image of the non-defective product and the pixels of the differential image of the inspection image that exist at the same position have pixel values with similar degrees of variation.

在步骤S8中,运算电路10在计算出的差或比大于预先确定的阈值的情况下,检测赋予了差或比的检查用图像的像素作为包含被检查物的缺陷的像的像素的候选。在该处理中,在上述的差或比大于阈值的情况下,意味着两者的背离较大、即像素值的变化较大。因此,检测检查用图像的该像素作为包含缺陷的像的像素的候选。In step S8, when the calculated difference or ratio is greater than a predetermined threshold, the arithmetic circuit 10 detects the pixel of the inspection image to which the difference or ratio is given as a candidate for a pixel of an image including a defect of the inspection object. In this process, when the above-mentioned difference or ratio is larger than the threshold value, it means that the difference between the two is large, that is, the change in the pixel value is large. Therefore, the pixel of the inspection image is detected as a candidate for a pixel of an image including a defect.

针对检查用图像的微分图像的全部像素和合格品微分图像的全部像素,计算差或比,检测包含缺陷的像的像素的候选,由此完成图3和图4的到损伤的检测处理(第3张)为止的处理。之后,运算电路10只要进行图3和图4的其余的处理、例如膨胀处理和收缩处理(第4张)、标示处理(第5张)、线连结处理(第6张)即可。The difference or ratio is calculated for all the pixels of the differential image of the inspection image and all the pixels of the non-defective product differential image, and the candidate of the pixel of the image including a defect is detected, thereby completing the damage detection process in FIGS. 3 and 4 (p. 3) up to the processing. Thereafter, the arithmetic circuit 10 only needs to perform the rest of the processing shown in FIG. 3 and FIG. 4 , such as expansion processing and contraction processing (fourth sheet), labeling processing (fifth sheet), and line connection processing (sixth sheet).

图9是用于说明本实施方式的检测结果的图。图9的(a)示出了沿着线损伤的方向的检查用图像的像素值的变化。图9的(b)示出了沿着线损伤的方向的检查用图像的微分图像的像素值的变化的大小。另外,“变化”包含正的变化和负的变化,因此使用表示变化的绝对值的“变化的大小”来进行表示。FIG. 9 is a diagram for explaining detection results of the present embodiment. (a) of FIG. 9 shows changes in pixel values of the inspection image along the line damage direction. (b) of FIG. 9 shows the magnitude of change in the pixel value of the differential image of the inspection image along the line damage direction. In addition, since "change" includes a positive change and a negative change, it expresses using "the magnitude|size of a change" which shows the absolute value of a change.

合格品图像的像素值的变化停留在图9的(a)所示的“合格品范围”内的变化、即在上限值(UL)和下限值(LL)之间变化。通常来说,合格品图像的像素值的变化是缓慢的,能够假设为在“合格品范围”内不急剧地变化。因此,合格品微分图像的像素值的变化也是平缓的。为了简化说明,在图9的(a)中,在合格品图像的像素值与合格品范围的平均值一致的假设下,用虚线表示合格品图像的像素值。另外,在图9的(b)中,在上述假设下,合格品微分图像的像素值为0,因此用单点划线表示的像素值与横轴一致。The change in the pixel value of the good product image stays within the "defective product range" shown in (a) of FIG. 9 , that is, changes between the upper limit value (UL) and the lower limit value (LL). Generally speaking, the change of the pixel value of the good product image is slow, and it can be assumed that it does not change rapidly within the "defective product range". Therefore, the change in the pixel value of the differential image of the good product is also gentle. To simplify the description, in (a) of FIG. 9 , on the assumption that the pixel values of the non-defective product image coincide with the average value of the non-defective product range, the pixel values of the non-defective product image are indicated by dotted lines. In addition, in (b) of FIG. 9 , under the above assumption, the pixel value of the differential image of the good product is 0, so the pixel value indicated by the one-dot chain line coincides with the horizontal axis.

在图9的最上段示出了现有的检测方法的结果。在现有的处理中,图9的(b)中的由虚线50包围的像素组没有作为包含缺陷的像的像素的候选而被检测。然而,根据上述图8所示的处理,像素组50a、50b以及50c作为缺陷的候选而被检测。其结果为,通过检测具有比上限值(UL)大的像素值的像素组和具有比下限值(LL)小的像素值的像素组作为缺陷的候选,能够检测出以往没有被检测为缺陷的相对短的线损伤作为相对长的线损伤。其结果为,能够适当地检测出应该被检测为缺陷的线损伤。图9的(b)示出了构成线损伤的一系列的像素组的范围52。The results of the existing detection method are shown in the uppermost section of FIG. 9 . In the conventional processing, the pixel group surrounded by the dotted line 50 in (b) of FIG. 9 was not detected as a candidate for a pixel of an image including a defect. However, according to the processing shown in FIG. 8 described above, the pixel groups 50a, 50b, and 50c are detected as candidates for defects. As a result, by detecting a pixel group having a pixel value larger than the upper limit value (UL) and a pixel group having a pixel value smaller than the lower limit value (LL) as candidates for defects, it is possible to detect The relatively short line damage of the defect acts as the relatively long line damage. As a result, wire damage that should be detected as a defect can be appropriately detected. (b) of FIG. 9 shows a range 52 of a series of pixel groups constituting a line damage.

另外,运算电路10保持有预先确定的上限值(UL)和下限值(LL)。上限值和下限值能够根据像素的位置而变化,可以根据合格品图像的像素值来决定。以下,举出两个具体例。In addition, the arithmetic circuit 10 holds predetermined upper limit values (UL) and lower limit values (LL). The upper limit value and the lower limit value can be changed according to the position of the pixel, and can be determined according to the pixel value of the good product image. Two specific examples are given below.

作为第1具体例,在使用一张合格品图像的情况下,按照像素的每个位置确定第1上限值和所述第1下限值。上限值由(该像素的像素值)+(预先确定的值)决定。下限值由(该像素的像素值)-(预先确定的值)决定。As a first specific example, when one good product image is used, the first upper limit value and the first lower limit value are determined for each pixel position. The upper limit value is determined by (pixel value of the pixel)+(predetermined value). The lower limit value is determined by (pixel value of the pixel) - (predetermined value).

作为第2具体例,在使用多个合格品图像的情况下,按照像素的每个位置,上限值由(该像素的平均像素)+(k×σ)决定,下限值由(该像素的平均像素)-(k×σ)决定。“k”是预先确定的值,例如是3。“σ”是按照像素的每个位置计算出的像素值的标准偏差。这样的处理例如记载于日本特开平7-113758号公报、日本特开2013-224833号公报中。As a second specific example, in the case of using a plurality of good product images, for each position of a pixel, the upper limit value is determined by (the average pixel of the pixel)+(k×σ), and the lower limit value is determined by (the pixel The average pixel)-(k×σ) decision. "k" is a predetermined value, for example, 3. "σ" is the standard deviation of pixel values calculated for each position of the pixel. Such processing is described in, for example, JP-A-7-113758 and JP-A-2013-224833.

根据产品,即使是合格品,也可能存在因形状、照明光的照射方式等而像素值发生变化的区域。像素值的变化可以是平缓的,也可以是陡峭的情况。然而,根据上述方法,无论合格品图像的像素值的变化方式如何,都能够适当地检测检查用图像中存在的缺陷的候选。Depending on the product, even if it is a good product, there may be an area where the pixel value changes due to the shape, the irradiation method of the illumination light, etc. Changes in pixel values can be gradual or steep. However, according to the method described above, candidates for defects existing in the image for inspection can be appropriately detected regardless of how the pixel values of the good product image change.

图10是用于说明合格品图像具有像素值的平缓的梯度的情况下的本实施方式的检测结果的图。图10的(a)的虚线表示合格品图像的像素值,确认了一部分存在梯度。FIG. 10 is a diagram for explaining detection results of the present embodiment when a good product image has a gentle gradient of pixel values. The dotted line in (a) of FIG. 10 shows the pixel values of the non-defective product image, and it was confirmed that there is a gradient in some parts.

另一方面,被检查物的图像的像素值具有更大的梯度。如图10的(b)所示,在检查用图像的微分图像中,梯度被表示为微分图像的比较大的像素值。此时的合格品微分图像的像素值如单点划线所示那样更小。通过设置能够严格区别存在梯度的位置的合格品微分图像的像素值与检查用图像的微分图像的像素值之间的阈值,像素组50d作为缺陷的候选而被检测。与具有梯度的部分相对应的像素组50c也一并作为缺陷的候选而被检测。由此,能够适当地检测应该被检测为缺陷的线损伤。图10的(b)表示构成线损伤的一连串的像素组的范围52。On the other hand, the pixel values of the image of the object to be inspected have a larger gradient. As shown in (b) of FIG. 10 , in the differential image of the inspection image, the gradient is expressed as a relatively large pixel value of the differential image. The pixel value of the good product differential image at this time is smaller as indicated by the dashed-dotted line. The pixel group 50d is detected as a candidate for a defect by setting a threshold that can strictly distinguish between the pixel value of the differential image of the non-defective product and the pixel value of the differential image of the inspection image where the gradient exists. A pixel group 50c corresponding to a portion having a gradient is also detected together as a candidate for a defect. Accordingly, it is possible to appropriately detect wire damage that should be detected as a defect. (b) of FIG. 10 shows a range 52 of a series of pixel groups constituting a line damage.

图11是用于说明合格品图像具有像素值的陡峭的梯度和平缓的梯度的情况下的本实施方式的检测结果的图。关于平缓的梯度,如参照图10所说明的那样。FIG. 11 is a diagram for explaining detection results of the present embodiment when a good product image has a steep gradient and a gentle gradient of pixel values. The gentle gradient is as described with reference to FIG. 10 .

另一方面,合格品图像和检查用图像的像素值在位置S处急剧地变化。由于预先知道位置S处的陡峭的变化,因此从图11的(a)的横轴的左端朝向右侧,下限(LL)和合格品图像的平均值(A)被预先设定为零,直到位置S为止。然后,在经过了位置S之后,变更为比零大的给定的值。On the other hand, at the position S, the pixel values of the good product image and the inspection image change rapidly. Since the steep change at the position S is known in advance, from the left end of the horizontal axis of (a) of FIG. up to position S. Then, after passing the position S, it is changed to a predetermined value larger than zero.

在位置S处,合格品图像的像素值急剧变化,因此在该位置处,合格品微分图像的像素值也大幅变化(图11的(b)的单点划线)。At the position S, the pixel value of the nondefective product image changes rapidly, so the pixel value of the nondefective product differential image also greatly changes at this position (one-dot chain line in FIG. 11( b )).

在位置S处,在检查用图像中不存在缺陷的情况下,检查用图像的像素值也与合格品图像的像素值同样地变化。于是,合格品微分图像的像素值与检查用图像的微分图像的像素值取大致相同的值。因此,如果针对位置S附近的检查用图像的微分图像的像素和合格品微分图像的像素计算差或比,则差大致为零,或者比大致为1。如果仅观察检查用图像的微分图像的像素值,则会作为缺陷候选而进行检测。即,可能发生过度检测。然而,根据本实施方式的方法,由于通过与合格品微分图像的关系来检测缺陷候选,因此能够抑制过度检测。At the position S, when there is no defect in the inspection image, the pixel value of the inspection image changes similarly to the pixel value of the good product image. Then, the pixel values of the differential image of the good product and the pixel values of the differential image of the inspection image take substantially the same value. Therefore, when the difference or the ratio is calculated between the pixels of the differential image of the inspection image near the position S and the pixels of the non-defective differential image, the difference is approximately zero, or the ratio is approximately 1. If only the pixel values of the differential image of the inspection image are observed, they are detected as defect candidates. That is, overdetection may occur. However, according to the method of the present embodiment, since defect candidates are detected based on the relationship with the differential image of good products, overdetection can be suppressed.

如以上所说明的那样,根据本实施方式的方法,即使合格品图像存在平缓的梯度,即使有陡峭的存在,也能够根据检查用图像适当地按照每个像素检测缺陷候选。As described above, according to the method of the present embodiment, defect candidates can be appropriately detected for each pixel from the inspection image even if the non-defective product image has a gentle gradient or a steep gradient.

图12是用于说明用于抑制过度检测的又一方法的图。FIG. 12 is a diagram for explaining still another method for suppressing overdetection.

相对于由上限值和下限值规定的现有的合格品范围,能够设定比该范围窄的合格品范围(图12中的“缩窄的合格品范围”)。即,将规定现有的合格品范围的上限值称为“第1上限值”,将下限值称为“第1下限值”。运算电路10保持有小于第1上限值的第2上限值和大于第1下限值的第2下限值。运算电路10在图8的步骤S6中计算出的差或比大于预先确定的阈值的情况下,按照赋予了这样的差或比的检查用图像的每个像素进一步判定像素值是否小于第2下限值以及像素值是否大于第2上限值。然后,在像素值小于第2下限值的情况下或者像素值大于第2上限值的情况下,检测检查用图像的该像素作为包含缺陷的像的像素的候选。通过缩窄合格品范围,判定为是合格品的精度变高,抑制了过度检测。With respect to the existing good product range defined by the upper limit value and the lower limit value, it is possible to set a good product range narrower than the range (“narrowed good product range” in FIG. 12 ). That is, the upper limit that defines the range of conventional good products is called "first upper limit", and the lower limit is called "first lower limit". The arithmetic circuit 10 holds a second upper limit smaller than the first upper limit and a second lower limit larger than the first lower limit. When the difference or ratio calculated in step S6 of FIG. 8 is greater than a predetermined threshold value, the arithmetic circuit 10 further determines whether the pixel value is smaller than the second lower value for each pixel of the inspection image to which such a difference or ratio is assigned. Whether the limit value and the pixel value are greater than the second upper limit value. Then, when the pixel value is smaller than the second lower limit value or when the pixel value is larger than the second upper limit value, the pixel of the inspection image is detected as a candidate for a pixel of an image including a defect. By narrowing the range of good products, the accuracy of judging good products is high, and excessive detection is suppressed.

另外,也可以在通过合格品学习检测出的像素的周围m个像素范围内应用本实施方式的处理。由此,能够排除突发性地存在于远离的位置的小损伤等的影响。In addition, the processing of the present embodiment may be applied within a range of m pixels around a pixel detected by good product learning. In this way, it is possible to eliminate the influence of small damages that suddenly exist at distant positions.

在上述实施方式的说明中,作为缺陷而例示了线损伤,但也可以存在线损伤以外的其他缺陷、例如污垢、异物。另外,在图6、图9至图11中,利用沿着线损伤的像素值的变化对处理进行了说明,但例如也可以利用沿着X方向的像素值的变化。In the description of the above embodiment, wire damage was exemplified as a defect, but other defects other than the wire damage, such as dirt and foreign matter, may exist. In addition, in FIGS. 6 , 9 to 11 , the processing has been described using changes in pixel values along the line damage, but for example, changes in pixel values along the X direction may also be used.

产业上的可利用性Industrial availability

本公开的图像处理系统和计算机程序能够在工厂等制造现场中的物品或部件的外观检查系统中适当地利用。The image processing system and computer program of the present disclosure can be suitably used in a visual inspection system for articles or components in manufacturing sites such as factories.

标号说明Label description

10:运算电路;12:存储器;14:存储装置;16:图像处理电路;30:摄像装置;100:图像处理系统;1000:外观检查系统1000。10: arithmetic circuit; 12: memory; 14: storage device; 16: image processing circuit; 30: imaging device; 100: image processing system; 1000: appearance inspection system 1000.

Claims (8)

1. An image processing system having:
a processor;
a memory in which a program for controlling the operation of the processor is stored; and
a storage device for storing data of at least one non-defective product differential image generated based on at least one non-defective product image obtained by imaging a non-defective product,
the processor executes the following processing in accordance with the program:
acquiring data of an inspection image obtained by imaging the object to be inspected;
generating a differential image of the acquired image for inspection;
calculating a difference or a ratio between a pixel value of the generated differential image and a pixel value of the non-defective differential image for each pixel at the same position of the non-defective differential image and the generated differential image; and
when the difference or the ratio is larger than a predetermined value, a pixel of the inspection image to which the difference or the ratio is given is detected as a candidate of a pixel of an image including a defect of the inspection object.
2. The image processing system according to claim 1,
in the processing of generating the differential image, the differential image of the inspection image is generated by calculating a differential value of pixel values of at least two pixels adjacent to each other of the inspection image as each pixel value of the differential image, and in the processing of detecting, when the difference or the ratio is larger than the predetermined threshold value, one pixel of the at least two pixels of the inspection image to which the difference or the ratio is given is detected as the candidate.
3. The image processing system according to claim 2,
in the processing for calculation, a difference between a pixel value of the differential image and a pixel value of the non-defective differential image is calculated for each pixel.
4. The image processing system according to claim 2,
in the processing for calculation, a ratio of a pixel value of the differential image to a pixel value of the non-defective differential image is calculated for each pixel.
5. The image processing system according to any one of claims 1 to 4,
the processor maintains a 1 st upper value and a 1 st lower value of predetermined pixel values,
the processor determines, for each pixel of the inspection image, whether or not the pixel value is smaller than the 1 st lower limit value and whether or not the pixel value is larger than the 1 st upper limit value,
when the pixel value is smaller than the 1 st lower limit value or the pixel value is larger than the 1 st upper limit value, the processor detects a pixel of the inspection image having the pixel value as a candidate of a pixel of an image including a defect of the inspection object.
6. The image processing system according to claim 5,
the 1 st upper limit value and the 1 st lower limit value may be changed according to a position of a pixel, and the 1 st upper limit value and the 1 st lower limit value are determined according to a pixel value of the at least one non-defective image.
7. The image processing system according to claim 5 or 6,
the processor maintains a 2 nd upper limit value that is less than the 1 st upper limit value and a 2 nd lower limit value that is greater than the 1 st lower limit value,
the processor determines, for each pixel of the inspection image to which the difference or the ratio is given, whether or not the pixel value is smaller than the 2 nd lower limit value and whether or not the pixel value is larger than the 2 nd upper limit value, when the difference or the ratio is larger than the predetermined threshold value in the processing for detection,
when the pixel value is smaller than the 2 nd lower limit value or the pixel value is larger than the 2 nd upper limit value, the processor detects a pixel of the inspection image having the pixel value as a candidate of a pixel of an image including a defect of the inspection object.
8. A computer program to be executed by a computer of an image processing system, wherein,
the image processing system has:
a processor as the computer;
a memory in which a program for controlling the operation of the processor is stored; and
a storage device for storing data of at least one non-defective product differential image generated based on at least one non-defective product image obtained by imaging a non-defective product,
the computer program causes the processor to execute:
acquiring data of an inspection image obtained by imaging the object to be inspected;
generating a differential image of the acquired image for inspection;
calculating a difference or a ratio between a pixel value of the generated differential image and a pixel value of the non-defective differential image for each pixel at the same position of the non-defective differential image and the generated differential image; and
when the difference or the ratio is larger than a predetermined threshold value, a pixel of the inspection image to which the difference or the ratio is given is detected as a candidate of a pixel of an image including a defect of the inspection object.
CN202080098821.7A 2020-03-27 2020-10-02 Image processing systems and computer programs Withdrawn CN115335688A (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2020-057979 2020-03-27
JP2020057979 2020-03-27
PCT/JP2020/037633 WO2021192371A1 (en) 2020-03-27 2020-10-02 Image processing system and computer program

Publications (1)

Publication Number Publication Date
CN115335688A true CN115335688A (en) 2022-11-11

Family

ID=77890224

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202080098821.7A Withdrawn CN115335688A (en) 2020-03-27 2020-10-02 Image processing systems and computer programs

Country Status (2)

Country Link
CN (1) CN115335688A (en)
WO (1) WO2021192371A1 (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006208196A (en) * 2005-01-28 2006-08-10 Dainippon Printing Co Ltd Coating inspection device and method
JP2006284471A (en) * 2005-04-04 2006-10-19 Mitsubishi Electric Corp Pattern inspection method, pattern inspection device and pattern inspecting program
CN102132147A (en) * 2008-08-26 2011-07-20 夏普株式会社 Defect detecting apparatus, defect detecting method, defect detecting program, and computer-readable recording medium in which that program has been recorded
CN103674962A (en) * 2013-09-27 2014-03-26 北京中钞钞券设计制版有限公司 Printing plate quality detection system and method
JP2015206702A (en) * 2014-04-22 2015-11-19 キヤノン株式会社 Image inspection method and image inspection device
CN109146839A (en) * 2017-06-28 2019-01-04 东京威尔斯股份有限公司 Image processing method and defect detecting method
WO2019194064A1 (en) * 2018-04-02 2019-10-10 日本電産株式会社 Image processing device, image processing method, appearance inspection system, and appearance inspection method
US20190308300A1 (en) * 2016-06-15 2019-10-10 SCREEN Holdings Co., Ltd. Appearance inspection apparatus, surface treatment system, appearance inspection method, program and shot material replacement determination method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
NL1025332C2 (en) * 2004-01-27 2005-08-02 Heineken Tech Services Device and method for detecting contamination in a container.
JP4410635B2 (en) * 2004-08-17 2010-02-03 オプテックスエフエー株式会社 Image matching degree determination method and apparatus
JP6236204B2 (en) * 2013-01-04 2017-11-22 株式会社富士通アドバンストエンジニアリング Inspection apparatus and inspection method

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006208196A (en) * 2005-01-28 2006-08-10 Dainippon Printing Co Ltd Coating inspection device and method
JP2006284471A (en) * 2005-04-04 2006-10-19 Mitsubishi Electric Corp Pattern inspection method, pattern inspection device and pattern inspecting program
CN102132147A (en) * 2008-08-26 2011-07-20 夏普株式会社 Defect detecting apparatus, defect detecting method, defect detecting program, and computer-readable recording medium in which that program has been recorded
CN103674962A (en) * 2013-09-27 2014-03-26 北京中钞钞券设计制版有限公司 Printing plate quality detection system and method
JP2015206702A (en) * 2014-04-22 2015-11-19 キヤノン株式会社 Image inspection method and image inspection device
US20190308300A1 (en) * 2016-06-15 2019-10-10 SCREEN Holdings Co., Ltd. Appearance inspection apparatus, surface treatment system, appearance inspection method, program and shot material replacement determination method
CN109146839A (en) * 2017-06-28 2019-01-04 东京威尔斯股份有限公司 Image processing method and defect detecting method
WO2019194064A1 (en) * 2018-04-02 2019-10-10 日本電産株式会社 Image processing device, image processing method, appearance inspection system, and appearance inspection method

Also Published As

Publication number Publication date
WO2021192371A1 (en) 2021-09-30

Similar Documents

Publication Publication Date Title
CN111340752B (en) Screen detection method and device, electronic equipment and computer readable storage medium
JP4160258B2 (en) A new perceptual threshold determination for gradient-based local contour detection
US11386549B2 (en) Abnormality inspection device and abnormality inspection method
US10043090B2 (en) Information processing device, information processing method, computer-readable recording medium, and inspection system
TWI238366B (en) Image processing method for appearance inspection
JP7049983B2 (en) Object recognition device and object recognition method
JP6317725B2 (en) System and method for determining clutter in acquired images
US10713530B2 (en) Image processing apparatus, image processing method, and image processing program
JP2013224833A (en) Visual inspection device, visual inspection method and computer program
CN113469921B (en) Image defect repairing method, system, computer device and storage medium
WO2021192376A1 (en) Visual inspection system and computer program
CN111866501B (en) Camera module detection method and device, electronic equipment and medium
CN114283124B (en) A dirt detection method, device, equipment and storage medium
CN117152165B (en) Photosensitive chip defect detection method and device, storage medium and electronic equipment
CN112381765A (en) Equipment detection method, device, equipment and storage medium based on artificial intelligence
JP2019090643A (en) Inspection method, and inspection device
JP2006090921A (en) Visual examination device, threshold determining method visual examination method and program for functionalizing computer as visual examination device
JP5346304B2 (en) Appearance inspection apparatus, appearance inspection system, and appearance inspection method
JP2008014842A (en) Spot defect detection method and apparatus
Prabha et al. Defect detection of industrial products using image segmentation and saliency
CN115335688A (en) Image processing systems and computer programs
JP7414629B2 (en) Learning data processing device, learning device, learning data processing method, and program
JP2021148720A (en) Inspection system, learning device, learning program, learning method, inspection device, inspection program, and inspection method
US10134163B2 (en) Dynamic detection of an object framework in a mobile device captured image
JP2015042942A (en) Image processor, defect detection device, image processing method, program, and, recording medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication

Application publication date: 20221111

WW01 Invention patent application withdrawn after publication