Binarized image generation method, defect inspection method, and program
By setting multiple thresholds in the image to suppress the influence of noise, the problem of over-detection in the image is solved and the accuracy of defect inspection is improved.
Patent Information
- Application Number
- CN202510362740.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-03-27
- Filing Date
- 2025-03-26
- Publication Date
- 2025-09-30
AI Technical Summary
Over-detection caused by noise in the image due to uneven lighting or image sensor characteristics can easily misjudge defects, especially in low-brightness areas.
By calculating the brightness reference value around the target pixel, combining the defect characteristic constant and over-detection reduction threshold, multiple thresholds are set to generate a binary image and suppress the influence of noise.
It effectively suppresses over-detection caused by noise and improves the accuracy and reliability of defect inspection.
Smart Images

Figure CN120725908A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a binary image generation method, a defect inspection method, and a program for inspecting defects on the surface of an object based on an image obtained by capturing the object. Background Art
[0002] Vision measuring devices capture images of the object being measured, analyze the images, extract a point cloud of edges within the image, and evaluate the distance, inclination, diameter, width, and other parameters of geometric shapes (such as lines, circles, and polygons) approximated from the extracted edge point cloud. In addition to evaluating geometric shapes, recent vision measuring devices also utilize algorithms that detect defects such as contamination on the workpiece, foreign matter inside holes, minute workpiece chips, deformation, burrs, and contamination, enabling image-based defect inspection (see, for example, JP2020-071106).
[0003] When performing defect inspection based on an image, for example, by setting a threshold for the brightness value and binarizing the image based on the fact that the brightness value of the defective area is higher than that of the normal area, the pixel area exceeding the threshold can be extracted as the defective area. Binarization can be performed using various methods. For example, the local thresholding described in the non-patent literature (PK Sahoo, S. Soltani, AKC Wong and YC Chen, "A Survey of Thresholding Techniques", Computer Vision, Graphics and Image Processing, Vol. 41, No. 2, 1988, pp. 233-260) is a method for determining whether each pixel is 1 or 0 by considering the brightness values of the surrounding pixels to determine the threshold for binarization of each pixel and applying the threshold to the target pixel. Local thresholding is an effective method for appropriately setting the threshold for each pixel when the brightness of the entire image is uneven. Summary of the Invention
[0004] Problems to be solved by the present invention
[0005] Images can contain noise due to uneven lighting intensity or the characteristics of the image sensor. If noise is present, even if the actual brightness of a pixel does not exceed the threshold, it may cause the pixel to exceed the threshold and appear in the binarized image along with the defect area, resulting in overdetection and the risk of falsely identifying a defect. This overdetection is particularly prone to occur in areas with low pixel brightness.
[0006] An object of the present invention is to provide a binary image generation method, a defect inspection method, and a program that can suppress over-detection due to noise in the extraction of candidate defect areas.
[0007] Means of solving the problem
[0008] A binary image generation method according to one aspect of the present invention generates a binary image of an object. The binary image generation method performs, for each pixel in the image of the object, a reference value calculation step of calculating a reference value indicating the brightness of an area around a target pixel based on the brightness values of pixels around the target pixel; a defect candidate area extraction threshold calculation step of calculating a defect candidate area extraction threshold for extracting a defect candidate area by multiplying a specific constant based on the characteristics of the object defect by the reference value; an over-detection reduction threshold setting step of setting an over-detection reduction threshold for reducing the influence of noise; and a threshold comparison step of determining whether the brightness value of the target pixel is higher than both the defect candidate area extraction threshold and the over-detection reduction threshold, and then performing a binary image generation step of generating a binary image of the object, wherein the image is binarized into two areas: one area consisting of pixels having brightness values greater than or equal to two thresholds, and another area.
[0009] Effects of the present invention
[0010] In the binarized image generation method of the present invention, in addition to using a defect candidate extraction threshold value obtained by multiplying a reference value indicating the brightness of pixels surrounding a target pixel by a constant as the image binarization threshold, an overdetection reduction threshold value is also used as the binarization threshold in low-brightness areas to extract candidate defect areas in order to reduce overdetection of candidate defect areas due to noise. This allows the generation of a binarized image that suppresses overdetection due to noise when extracting candidate defect areas. Furthermore, the use of such a binarized image can also suppress misjudgments in defect inspections based on the binarized image. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 is a perspective view showing an example of the configuration of the vision measuring device 1 .
[0012] Figure 2 is a schematic diagram showing the configuration of the image capturing unit 120 and the stage 100 .
[0013] Figure 3 is a block diagram showing the configuration of the position acquisition unit 110 .
[0014] Figure 4 141 is a block diagram showing the configuration of the computer main body 141 .
[0015] Figure 5 An example of a view of a screen display is shown.
[0016] Figure 6 The process flow of the defect inspection method is shown.
[0017] Figure 7 An example of the relationship between the binarization threshold and the reference value is shown.
[0018] Figure 8 An example of the relationship among the binarization threshold, the reference value, and the defect candidate area extraction threshold is shown.
[0019] Figure 9 Another example of the relationship among the binarization threshold, the reference value, and the defect candidate region extraction threshold is shown.
[0020] Figure 10 Another example of the relationship among the binarization threshold, the reference value, the defect candidate area extraction threshold, and the over-detection reduction threshold is shown. DETAILED DESCRIPTION
[0021] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the following description, parts already described are denoted by the same reference numerals and their descriptions are omitted.
[0022] Figure 1 1 is a perspective view showing an example of the configuration of the vision measuring device 1. The vision measuring device includes a stage 100, a position acquisition unit 110, an image capture unit 120, a remote control box 130, and a computer system 140.
[0023] The stage 100 is arranged so that its upper surface is horizontal, and the object W to be measured is placed on its upper surface. At least a portion of the top surface of the stage 100, on which the object W to be measured is placed, is formed from a light-transmitting material such as glass. The stage 100 is driven by an X-axis drive motor and a Y-axis drive motor (not shown in the drawings) and can move in the X-axis and Y-axis directions parallel to the horizontal plane. Drive control signals for the drive motors of each axis are provided to the drive motors of each axis from the remote control box 130 and the computer system 140 described later.
[0024] Figure 2is a schematic diagram illustrating the configuration of the image capture unit 120 and stage 100. The image capture unit 120 includes an optical system 122, an image sensor 124, and a light source 126. The optical system 122 is composed, for example, of a telecentric optical system that combines multiple lenses and an aperture. In a telecentric optical system, the principal rays can be considered parallel, so the dimensions of the captured image do not depend on the position in the Z-axis direction (height direction). For this reason, the telecentric optical system is suitable for measuring objects W with irregularities (e.g., steps or holes). When capturing an image of the object W, the light source 126, under the control of the computer system 140, illuminates at least a portion of the object W to be imaged. In this embodiment, the light source 126a is provided for epi-illumination, illuminating the object W from above (i.e., from the image sensor 124 side) via the optical system 122, and the light source 126b is provided for trans-illumination, illuminating the object W from below (i.e., from the back side of the stage 100). The image sensor 124 is a two-dimensional image sensor such as a CCD or CMOS. An image of the object W to be measured is formed on the light-receiving surface of the image sensor 124 by the optical system 122. The image sensor 124 captures the formed image and outputs image data in a predetermined format. This image data includes information about the pixels that make up the image and an index indicating the order in which the images were captured. The image capture unit 120 transmits the image signal output by the image sensor 124 to the computer system 140. The computer system 140 and the image capture unit 120 are connected using a common communication standard such as USB (Universal Serial Bus). Furthermore, the image capture unit 120 outputs a trigger signal to the latch unit 118 upon completion of capture of one image (one frame).
[0025] Image capture unit 120 is driven by a Z-axis drive motor (not shown in the drawings) and is movable in the Z-axis direction (i.e., a direction perpendicular to the top surface of stage 100). Focus adjustment is performed by adjusting the Z-axis position of image capture unit 120. Drive control signals for the Z-axis drive motor are provided from remote control box 130 and computer system 140, described later.
[0026] Figure 3 2 is a block diagram showing the configuration of the position acquisition unit 110. The position acquisition unit 110 has an X-axis encoder 112, a Y-axis encoder 114, a Z-axis encoder 116, and a latch unit 118.
[0027] The X-axis encoder 112 measures and outputs the position coordinates in the X-axis direction of the stage 100. The Y-axis encoder 114 measures and outputs the position coordinates in the Y-axis direction of the stage 100. The Z-axis encoder 116 measures and outputs the position coordinates in the Z-axis direction of the image capture unit 120. Each encoder is equipped with a scale with a scale and a scale reader for reading the scale. The scale can be attached to the movable part of the stage 100 and the image capture unit 120 along each axis. On the other hand, the scale reader is placed on the immovable part.
[0028] The latch unit 118 includes a counter 118a and a buffer 118b. Counter 118a increments its count value by 1 when an external trigger signal (e.g., a pulse signal) is supplied. The value of counter 118a is appropriately reset based on instructions from the computer system 140. Buffer 118b has storage areas with multiple addresses. When a trigger signal is supplied, the encoder output value for each axis is latched and stored in the storage area at the address corresponding to the count value of counter 118a. The trigger signal may be supplied from the image sensor 124, for example, at the end of capturing an image. The position coordinates of each axis held by the latch unit 118 are associated with an address value (i.e., a count value) and appropriately retrieved into the computer system 140. The computer system 140 and latch unit 118 are connected using a common communication standard such as USB (Universal Serial Bus). The image data and the position coordinates are imported into the computer system 140 separately, but the image data is indexed to indicate the order in which the image data was captured, and the position coordinates are associated with the count values to indicate the order in which the position coordinates were captured, so that even if they are imported into the computer system 140 asynchronously, they can be associated after being imported.
[0029] return Figure 1 The remote control box 130 is an operating device for setting the position of the stage 100 and the image capture unit 120, and transmits drive control signals to the X-axis drive motor, the Y-axis drive motor, and the Z-axis drive motor via wired or wireless communication in response to an operator's operation. The remote control box 130 includes a joystick 132 and a slow speed adjuster 134. The joystick 132 is an input device for setting the position of the stage 100, and the remote control box 130 transmits drive control signals to move the stage 100 in the X-axis and Y-axis directions according to the tilt direction of the joystick 132. The slow speed adjuster 134 is an input device for setting the Z-axis position of the image capture unit 120, and the remote control box 130 transmits drive control signals to move the image capture unit 120 in the Z-axis direction according to the rotation direction, rotation amount, and rotation speed of the slow speed adjuster 134.
[0030] The computer system 140 includes a computer body 141 , a keyboard 142 , a mouse 143 and a display 144 . Figure 4 1 is a block diagram showing the configuration of a computer main body 141. The computer main body 141 includes a CPU 40 serving as a control center, a storage unit 41, a work memory 42, interfaces 43 and 44 ( Figure 4 ) and a display control unit 45 that controls the view on the display 144.
[0031] Operator instruction information input from the keyboard 142 or the mouse 143 is input to the CPU 40 via the interface 43. The interface 44 is connected to the image capture unit 120 and the stage 100, supplies various control signals from the CPU 40 to the image capture unit 120 and the stage 100, receives various status information and measurement results from the image capture unit 120 and the stage, and inputs them to the CPU 40.
[0032] The display control unit 45 causes the image captured by the image capture unit 120 to be displayed on the display 144. In addition, the display control unit 45 causes the display 144 to show the image captured by the image capture unit 120, as well as an interface for inputting control instructions to the vision measuring device 1 and an interface for a tool for analyzing the captured image.
[0033] The work memory 42 provides a work area for various types of processing by the CPU 40. The storage unit 41 is configured by, for example, a hard disk drive, a RAM, etc., and stores programs to be executed by the CPU 40, image data captured by the image capture unit 120, and other data.
[0034] Based on various types of information input via various interfaces, operator instructions, measurement definition programs (partial programs) stored in the storage unit 41, and the like, the CPU 40 performs various types of processing, including: control of the image capture unit 120, the X-axis drive motor, the Y-axis drive motor, and the Z-axis drive motor, etc., setting of the movement path of the image capture unit 120 and adjustment of the movement speed and exposure time, adjustment of the light intensity of the light source 126, image capture of a two-dimensional image by the image capture unit 120, image stitching processing of pasting a plurality of partial images together, and analysis of the overall image obtained by image capture, etc.
[0035] Hereinafter, measurement performed by using the vision measuring device 1 is explained.
[0036] (Basic image measurement)
[0037] First, the operator moves the stage 100 by operating the joystick 132 or through control by the computer system 140, bringing the measurement object W into the imaging field of view. The Z-axis position of the image capture unit 120 is then adjusted to bring the measurement object W into focus. After the measurement object W is in focus, the image sensor 124 is used to capture an image for measurement. At this point, the coordinates of the stage 100 output by the X-axis encoder 112 and the Y-axis encoder 114 are captured by the computer system 140 along with the captured image and stored in the storage unit 41. Specifically, when the image capture unit 124 completes capturing an image, a pulse is output as a trigger signal to the latch unit 118. The latch unit 118 latches and holds the position coordinates of each axis at the timing of the rising transition of the pulse (i.e., approximately simultaneously with the completion of image capture). The computer system 140 acquires the image signal from the image capture unit 124 and the position coordinates at the time of image capture from the latch unit 118, storing them in association with each other.
[0038] The computer system 140 displays the obtained image for measurement and an interface of a measurement tool for analyzing the image on a display 144 . Figure 5 An example of a view of a screen display is shown. This screen display is shown on the display 144 by a program (measurement application software) executed on the CPU 40 of the computer system 140 .
[0039] like Figure 5 As shown, when a program is executed, a main window MW is displayed on display 144. Multiple windows (windows W1 to W8) are also displayed within the main window MW. Menu icons, various operations, and settings are also displayed at the top of the main window MW. While this embodiment shows an example of eight windows, it is possible to display more than eight windows as needed, or to divide, integrate, or omit windows according to their purpose. The layout of each window can also be freely changed by the operator.
[0040] The first window W1 displays an image WG of the object W captured by the image capture unit 120. The operator can adjust the position of the image WG of the object W displayed in the first window W1 by, for example, operating the mouse 143 or the joystick 132 of the remote control box 130. Furthermore, the operator can also enlarge or reduce the image WG of the object W by, for example, selecting an icon with the mouse 143.
[0041] In the second window W2, icons of measurement tools that can be selected by the operator are displayed. The icons for the measurement tools are provided to correspond to the method of specifying a measurement point from the image WG of the measurement object W. Specific examples of the measurement tools include a straight edge detection tool, a circular edge detection tool, and the like.
[0042] In the third window W3, icons of functions that can be selected by the operator are displayed. These icons are assigned to each measurement method. For example, there are methods for measuring the coordinates of a single point, the length of a straight line, a circle, an ellipse, a square hole, a slotted hole, a spacing, and the tolerance between two lines. Based on the operator's selections, the computer system 140 performs measurements such as the length of a straight line, the distance between straight lines, and the diameter of a circle, as well as evaluations of deviations (errors) from the ideal geometric shape, such as straightness, circularity, and parallelism.
[0043] In the fourth window W4 , guidance showing an operating procedure for measurement is displayed.
[0044] In the fifth window W5 , various sliders are displayed for controlling illumination from the image capturing unit 120 to the object W to be measured. The operator can operate the sliders to irradiate the object W to be measured with desired illumination.
[0045] In the sixth window W6, the XY coordinate values of the stage 100 are displayed. The XY coordinate values displayed in the sixth window W6 are the X-axis coordinates and the Y-axis coordinates of the stage 100 relative to a predetermined coordinate origin.
[0046] The seventh window W7 displays the tolerance determination result. That is, when a measurement method capable of performing tolerance determination is selected, the determination result is displayed in the seventh window W7.
[0047] The eighth window W8 displays the measurement results. Specifically, when a measurement method that obtains measurement results through predetermined calculations is selected, the measurement results are displayed in the eighth window W8. Details of the tolerance determination results in the seventh window W7 and the measurement results in the eighth window W8 are omitted from the drawing.
[0048] (Binarized image generation and defect inspection)
[0049] In addition to the basic image measurement functions described above, the vision measuring device 1 also includes a program (measurement application software) executed by the CPU 40 of the computer system 140. The program generates a binary image from an image of the object W to be measured, and performs inspection for detectable defects based on the binary image (hereinafter referred to as "defect inspection"). In the following description, unless the subject of processing is specifically mentioned, it should be understood that the subject is the program executed by the CPU 40 of the computer system 140.
[0050] The binary image generation method of the present invention generates a binary image of an image of a measurement object W. The binary image generation method performs a reference value calculation step (S1), a defect candidate area extraction threshold calculation step (S2), an over-detection reduction threshold setting step (S3), a threshold comparison step (S4), and a binary image generation step (S5), as shown in FIG. Figure 6 shown.
[0051] In addition, the defect inspection method of the present invention uses a binary image of the object to be measured to inspect defects of the object to be measured W. Figure 6 As shown, the defect inspection method performs a reference value calculation step (S1), a defect candidate area extraction threshold calculation step (S2), an over-detection reduction threshold setting step (S3), a threshold comparison step (S4), a binarized image generation step (S5) and a judgment step (S6).
[0052] In the reference value calculation step (S1), for each pixel in the image of the measurement object W, a reference value indicating the brightness of the area around the target pixel is calculated based on the brightness values of the pixels surrounding the target pixel. The reference value may be, for example, the average brightness value of the pixels within a specific range around the target pixel.
[0053] In the defect candidate region extraction threshold calculation step ( S2 ), a defect candidate region extraction threshold is calculated by multiplying a specific constant based on the characteristics of the object defect by a reference value. The defect candidate region extraction threshold is a threshold of a brightness value for extracting a defect candidate region.
[0054] Figure 7 This figure shows an example of the relationship between the binarization threshold value, which is a threshold value for binarizing pixels, and the reference value. Here, line L1 indicates that the binarization threshold value is the reference value. In other words, it indicates the case where the reference value itself serves as the binarization threshold value. In this case, the image is binarized into two regions: one region consisting of pixels with brightness values greater than or equal to the two threshold values, and another region. Figure 7 Pixel region A shown here exceeds the binarization threshold, so it is extracted as a candidate defect region. However, with this threshold setting, even if the luminance must be significantly higher than the reference value due to defect characteristics, regions like pixel region A, which are only slightly higher than the reference value, will be identified as candidate defect regions. This results in a decrease in the efficiency of narrowing down candidate defects and a decrease in detection accuracy.
[0055] Therefore, in the defect candidate region extraction threshold value calculation step ( S2 ), a value obtained by multiplying a constant based on the characteristics of the defect by a reference value is calculated as the defect candidate region extraction threshold value. Figure 8 Show added to Figure 7Line L2 in the diagram shows the defect candidate extraction threshold, which satisfies the relationship: binarization threshold = defect candidate extraction threshold = reference value × constant. By setting the binarization threshold to a value obtained by multiplying the reference value by a constant based on the defect's characteristics, pixel regions corresponding to the defect's characteristics can be extracted while simultaneously excluding regions, such as pixel region A, that have values only slightly above the reference value from the defect candidates. This allows for efficient and effective defect candidate extraction.
[0056] In the over-detection reduction threshold value setting step ( S3 ), an over-detection reduction threshold value for reducing the influence of noise is set.
[0057] Figure 9 Show added to Figure 8 Pixel areas B and C initially have brightness that does not reach the defect candidate area extraction threshold. However, the actual image may include noise due to uneven light intensity or the characteristics of the image sensor. Here, in the area with high brightness, the difference D1 between the reference value line L1 and the defect candidate area extraction threshold line L2 is large, so even if the noise N is added to the brightness of pixel area B, the defect candidate area extraction threshold is not reached. In contrast, in the area with low reference values, the difference D2 between the value of line L1 and the value of line L2 is small, so when the noise N is added to the brightness of pixel area C, it exceeds the defect candidate area extraction threshold and is extracted as a defect candidate area, resulting in over-detection.
[0058] Therefore, in the over-detection reduction threshold setting step ( S3 ), in order to prevent such over-detection, in the low-luminance area, an over-detection reduction threshold that is larger than the defect candidate area extraction threshold is set. Figure 10 Shown is added to Figure 9 Line L3 indicates an over-detection reduction threshold that satisfies the relationship of binarization threshold for low luminance areas = over-detection reduction threshold > defect candidate area extraction threshold. The over-detection reduction threshold is set based on expected noise intensity.
[0059] For example, by repeatedly generating a binarized image while varying the overdetection reduction threshold (line L3), an optimal value (optimal line) can be identified and set. In this case, the overdetection reduction threshold can be set to a constant value (slope of line L3 = 0) or can be set to have a slope. When the overdetection reduction threshold is experimentally set in this manner, step S3 can be performed independently of steps S1 and S2.
[0060] Alternatively, the over-detection reduction threshold may be calculated and set based on a reference value. In this case, step S3 is performed after step S1.
[0061] In the threshold comparison step (S4), the brightness value of the target pixel is checked to see if it is above both the defect candidate extraction threshold and the over-detection reduction threshold. Figure 10 The thick line in the figure is used as the binarization threshold of the entire image to compare the brightness values.
[0062] In the binarized image generation step ( S5 ), a binarized image of the measurement object that has been binarized into two regions (one region consisting of pixels having brightness values higher than the two thresholds and another region) is generated based on the comparison result with the binarization threshold value of each pixel in step S4 .
[0063] In the determination step (S6), regions consisting of pixels with brightness values above two thresholds are considered candidate defect regions, and feature values for the candidate defect regions are calculated. Based on these feature values, a determination is made as to whether the candidate defect region is a defect region. If two or more candidate defect regions exist in the 2D image, a determination is made for each region.
[0064] According to the above-described binary image generation method of the present invention, in addition to using a defect candidate extraction threshold value obtained by multiplying a constant by a reference value indicating the brightness of pixels surrounding a target pixel as the image binarization threshold, an overdetection reduction threshold is used as the binarization threshold in low-brightness areas to reduce overdetection of candidate defect areas due to noise. This generates a binary image that suppresses overdetection due to noise when extracting candidate defect areas. Using this binary image also reduces misjudgments during defect inspection based on the binary image.
[0065] The present invention is not limited to the above embodiments. The above embodiments are examples, and any configuration that is substantially the same as the technical concept described in the claims of the present invention and produces similar effects is also included in the technical scope of the present invention, even if components are added, deleted, or modified. In other words, it is possible to make appropriate changes within the scope of the technical concept expressed in the present invention, and forms that have been modified and improved are also included in the technical scope of the present invention. For example, in the above embodiments, the image to be binarized is an image of an object to be measured by an image measuring device, but the subject of the image is arbitrary within the scope of the application of the present invention.
[0066] Regarding the embodiments including the above examples, the following appendix is further disclosed.
[0067] (Appendix 1) A binary image generation method for generating a binary image of an object, wherein:
[0068] The binary image generation method is performed for each pixel in the image of the object:
[0069] a reference value calculation step of calculating a reference value indicating the brightness of an area around the target pixel based on the brightness values of pixels around the target pixel;
[0070] a defect candidate area extraction threshold value calculation step of calculating a defect candidate area extraction threshold value for extracting a defect candidate area by multiplying a specific constant based on characteristics of an object defect by a reference value;
[0071] an over-detection reduction threshold value setting step of setting an over-detection reduction threshold value for reducing the influence of noise; and
[0072] a threshold comparison step of determining whether the brightness value of the target pixel is higher than both the defect candidate extraction threshold and the over-detection reduction threshold, and
[0073] Then, a binarized image generation step is performed to generate a binarized image of the object, wherein the image is binarized into two regions: one region consisting of pixels having brightness values greater than or equal to two threshold values and another region.
[0074] (Appendix 2) The binarized image generating method as described in Appendix 1, wherein the object is a measurement object of an image measuring device.
[0075] (Appendix 3) The binarized image generation method as described in Appendix 1, wherein the reference value is an average of the brightness values of pixels surrounding the target pixel.
[0076] (Appendix 4) A binarized image generation method as described in Appendix 1, wherein the over-detection reduction threshold is a constant value.
[0077] (Appendix 5) A defect inspection method, which performs:
[0078] A method for generating a binarized image as described in any one of Appendices 1 to 4; and
[0079] The step of calculating a feature value of a candidate defect area and determining whether the candidate defect area is a defect area based on the feature value, wherein an area consisting of pixels with brightness values above two thresholds is considered to be a candidate defect area.
[0080] (Appendix 6) A program for causing a computer to execute the binarized image generation method described in any one of Appendices 1 to 4, and a non-transitory recording medium having the program recorded thereon.
[0081] (Appendix 7) A program for causing a computer to execute the defect inspection method described in Appendix 5, and a non-transitory recording medium having the program recorded thereon.
Claims
1. A method for generating a binary image of an object, wherein: The binary image generation method performs, for each pixel in the image of the object: a reference value calculation step of calculating a reference value indicating the brightness of an area around a target pixel based on brightness values of pixels around the target pixel; a defect candidate area extraction threshold value calculation step of calculating a defect candidate area extraction threshold value for extracting a defect candidate area by multiplying a specific constant based on characteristics of an object defect by the reference value; an over-detection reduction threshold setting step of setting an over-detection reduction threshold for reducing the influence of noise; as well as a threshold comparison step of determining whether the brightness value of the target pixel is higher than both the defect candidate extraction threshold and the over-detection reduction threshold, and Then, a binarized image generating step is performed to generate a binarized image of the object, wherein the image is binarized into two regions: one region consisting of pixels having brightness values greater than or equal to two threshold values and another region.
2. The method for generating a binary image according to claim 1, wherein: The object is an object to be measured by a vision measuring device.
3. The method for generating a binary image according to claim 1, wherein: The reference value is an average of the brightness values of pixels surrounding the target pixel.
4. The method for generating a binary image according to claim 1, wherein: The overdetection reduction threshold is a constant value.
5. A defect inspection method, comprising: The binary image generation method according to any one of claims 1 to 4; and a determination step of calculating a feature value of a candidate defect area and determining whether the candidate defect area is a defect area based on the feature value, wherein: A region consisting of pixels whose brightness values are above two thresholds is considered as the candidate defect region. 6 . A non-transitory recording medium recording a program for causing a computer to execute the binarized image generating method according to claim 1 . 7 . A non-transitory recording medium recording a program for causing a computer to execute the defect inspection method according to claim 5 .
Citation Information
Patent Citations
Visual inspection method and program
JP2020071106A