Binarized image generation method, defect inspection method, and program

The binary image generation method addresses noise-induced overdetection by using reference and overdetection reduction thresholds for accurate defect candidate area extraction, improving defect inspection accuracy.

JP2025151238APending Publication Date: 2025-10-09MITUTOYO CORP
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2024052566
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-03-27
Publication Date
2025-10-09

AI Technical Summary

Technical Problem

Images may contain noise due to uneven lighting or the image sensor mechanism, leading to overdetection of defects in low-brightness areas, resulting in false defect diagnoses.

Method used

A binary image generation method that calculates a reference value based on surrounding pixel brightness, sets a defect candidate area extraction threshold, and an overdetection reduction threshold to reduce noise influence, using these thresholds for accurate binarization.

Benefits of technology

Reduces overdetection of noise in defect candidate areas, enhancing the accuracy of defect inspections by generating a binary image that minimizes erroneous determinations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025151238000001_ABST
    Figure 2025151238000001_ABST
Patent Text Reader

Abstract

To provide a binarized image generation method capable of suppressing over-detection of noise when extracting defect-candidate regions.SOLUTION: A binarized image generation method that generates an image obtained by binarizing an image of a target object, executes: a reference value calculation step that, for each pixel of an image of the target object, calculates a reference value on the basis of luminance values of pixels in a neighborhood of the pixel; a defect candidate region extraction threshold calculation step that calculates a defect candidate region extraction threshold by multiplying the reference value by a constant; an over-detection reduction threshold setting step that sets an over-detection reduction threshold; and a threshold collation step that collates whether the luminance value of the pixel is not less than both the defect candidate region extraction threshold and the over-detection reduction threshold. After these steps, the method executes a binarized image generation step that generates a binarized image of the target object binarized in a region composed of pixels whose luminance value is not less than both thresholds and other regions.SELECTED DRAWING: Figure 6
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present invention relates to a binary image generation method, a defect inspection method, and a program used for inspecting defects on the surface of an object based on an image obtained by capturing an image of the object. [Background technology]

[0002] A vision measuring machine is a device that takes an image of a measurement object, analyzes the image, extracts a point cloud of edges contained in the image, and evaluates the distance, inclination, diameter, width, etc. of geometric shapes such as lines, circles, polygons, etc. that are approximated from the extracted point cloud of edges. In addition to evaluating such geometric shapes, modern vision measuring machines are equipped with algorithms that detect defects such as dirt on the workpiece, foreign matter inside the hole shape, minute chips, deformations, burrs, dirt, etc. on the workpiece, enabling defect inspection based on images (see, for example, Patent Document 1).

[0003] When performing defect inspection based on an image, for example, by utilizing the fact that pixels in defective areas have higher brightness than normal areas, a brightness threshold can be set and the image can be binarized, thereby extracting pixel areas exceeding the threshold as defective areas. Binarization can be performed using various techniques. For example, local thresholding, as disclosed in Non-Patent Document 1, is a technique in which a threshold for binarizing each pixel is determined for each pixel taking into account the brightness values ​​of surrounding pixels and applied to the pixel, thereby determining whether each pixel is 1 or 0. Local thresholding is an effective technique for appropriately setting the threshold for each pixel when the brightness of the entire image is not uniform. [Prior art documents] [Patent documents]

[0004] [Patent Document 1] Japanese Patent Publication No. 2020-071106 [Non-patent literature]

[0005] [Non-Patent Document 1] PKSahoo, S.Soltani, AKCWong and YCChen, “A Survey of Thresholding Techniques”, Computer Vision, Graphics, and Image Processing, Vol.41, Issue2, 1988, pp.233-260 Summary of the Invention [Problem to be solved by the invention]

[0006] Images may contain noise due to uneven lighting or the image sensor mechanism. When noise is present, even if the pixel's original brightness does not exceed the threshold, the noise can cause the pixel to exceed the threshold and appear in the binarized image along with the defective part, resulting in an overdetection, which can lead to a false defect diagnosis. This type of overdetection is particularly likely to occur in areas with low pixel brightness.

[0007] An object of the present invention is to provide a binary image generation method, a defect inspection method, and a program that can suppress overdetection of noise when extracting defect candidate areas. [Means for solving the problem]

[0008] The binary image generation method of the present invention is a binary image generation method for generating a binary image of an object, and includes the following steps: a reference value calculation step for calculating, for each pixel of the image of the object, a reference value, which is a brightness indicating the brightness around the pixel, based on the brightness values ​​of the pixels around the pixel; a defect candidate area extraction threshold calculation step for calculating a defect candidate area extraction threshold for extracting defect candidate areas by multiplying the reference value by a constant based on the characteristics of the defect; an overdetection reduction threshold setting step for setting an overdetection reduction threshold for reducing the effects of noise; and a threshold comparison step for comparing whether the brightness value of the pixel is equal to or greater than both the defect candidate area extraction threshold and the overdetection reduction threshold; and a binary image generation step for generating a binary image of the object in which areas consisting of pixels whose brightness values ​​are equal to or greater than both thresholds and other areas are binarized.

[0009] The object may be, for example, an object to be measured by an image measuring machine.

[0010] The reference value may be the average value of the luminance values ​​of the pixels surrounding the pixel.

[0011] The overdetection reduction threshold may be a constant value.

[0012] The defect inspection method of the present invention executes the binary image generation method of the present invention and a determination step of determining, as a defect candidate area, an area in the binary image consisting of pixels whose brightness values ​​are equal to or greater than both thresholds, calculating feature values ​​of the defect candidate area, and determining whether the defect candidate area is a defect area based on the feature values.

[0013] The binary image generating method of the present invention may be implemented by causing a computer to execute a program describing the binary image generating method.

[0014] The defect inspection method of the present invention may be implemented by causing a computer to execute a program describing the defect inspection method. [Effects of the Invention]

[0015] In the binary image generation method, defect inspection method, and program of the present invention, a defect candidate area extraction threshold obtained by multiplying a reference value indicating the brightness around a pixel by a constant is used as the threshold for binarizing an image, and in order to reduce overdetection of defect candidate areas due to noise, an overdetection reduction threshold is used as the binarization threshold in low-brightness areas to extract defect candidate areas. This makes it possible to generate a binary image in which overdetection of noise is reduced when extracting defect candidate areas, and by using the binary image generated in this way, it is also possible to reduce erroneous determinations in defect inspections based on the binary image. [Brief explanation of the drawings]

[0016] [Figure 1] FIG. 1 is a perspective view showing an example of the configuration of an image measuring instrument 1. [Figure 2] FIG. 2 is a schematic diagram showing the configuration of an imaging unit 120 together with a stage 100. [Figure 3] FIG. 2 is a block diagram showing the configuration of a position acquisition means 110. [Figure 4] FIG. 2 is a block diagram showing the configuration of a computer main body 141. [Figure 5] FIG. 10 is a diagram illustrating an example of a screen display. [Figure 6] FIG. 2 is a diagram showing a process flow of the defect inspection method of the present invention. [Figure 7] FIG. 10 is a diagram illustrating an example of the relationship between a binarization threshold value and a reference value. [Figure 8] FIG. 10 is a diagram showing an example of the relationship between a binarization threshold value, a reference value, and a defect candidate area extraction threshold value. [Figure 9] FIG. 10 is another diagram showing an example of the relationship between the binarization threshold and the reference value and the defect candidate area extraction threshold. [Figure 10] FIG. 10 is another diagram showing an example of the relationship between the binarization threshold and the reference value, the defect candidate area extraction threshold, and the overdetection reduction threshold. DETAILED DESCRIPTION OF THE INVENTION

[0017] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the following description, the same components will be designated by the same reference numerals, and the description of components that have already been described will be omitted as appropriate.

[0018] 1 is a perspective view showing an example of the configuration of an image measuring instrument 1. The image measuring instrument 1 includes a stage 100, a position acquisition means 110, an imaging unit 120, a remote box 130, and a computer system 140.

[0019] Stage 100 is placed so that its upper surface is horizontal, and a measurement target W is placed on this upper surface. At least the portion of the upper surface of stage 100 on which measurement target W is placed is made of a light-transmitting material such as glass. Stage 100 is driven by an X-axis drive motor and a Y-axis drive motor (not shown), and is movable in the X-axis and Y-axis directions parallel to the horizontal plane. Drive control signals for the drive motors of each axis are sent to the drive motors of each axis from a remote box 130 or a computer system 140 (described later).

[0020] FIG. 2 is a schematic diagram showing the configuration of the imaging unit 120 together with the stage 100. The imaging unit 120 includes an optical system 122, an imaging means 124, and a light source 126. The optical system 122 is configured as a telecentric optical system, for example, by combining multiple lenses and apertures. In a telecentric optical system, the chief ray can be considered parallel, so the dimensions of the captured image do not depend on the position in the Z-axis direction (height direction). This makes it suitable for measuring a measurement object W having undulations (e.g., steps, holes, etc.). When capturing an image of the measurement object W, the light source 126 irradiates light onto at least the portion of the measurement object W to be imaged under the control of the computer system 140. In this embodiment, the imaging unit 120 includes a light source 126a for epi-illumination, which irradiates the measurement object W with light from above (i.e., the imaging means 124 side) via the optical system 122, and a light source 126b for trans-illumination, which irradiates the measurement object W with light from below (i.e., the back side of the stage 100). The imaging means 124 is a two-dimensional image sensor such as a CCD or CMOS. An image of the measurement target W is formed on the light receiving surface of the imaging means 124 by the optical system 122. The imaging means 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, as well as at least an index indicating the order in which the images were captured. The imaging unit 120 transmits the image signal output by the imaging means 124 to the computer system 140. The computer system 140 and the imaging unit 120 are connected via a general-purpose communication standard such as USB (Universal Serial Bus). The imaging unit 120 also outputs a trigger signal to the latch means 118 upon completing the capture of one image (one frame).

[0021] The imaging unit 120 is driven by a Z-axis drive motor (not shown) and is movable in the Z-axis direction (i.e., the direction perpendicular to the upper surface of the stage 100). Focus adjustment is performed by adjusting the position of the imaging unit 120 in the Z-axis direction. A drive control signal for the Z-axis drive motor is provided from a remote box 130 or a computer system 140, which will be described later.

[0022] 3 is a block diagram showing the configuration of the position acquisition means 110. The position acquisition means 110 includes an X-axis encoder 112, a Y-axis encoder 114, a Z-axis encoder 116, and a latch means 118.

[0023] The X-axis encoder 112 measures and outputs the position coordinate of the stage 100 in the X-axis direction. The Y-axis encoder 114 measures and outputs the position coordinate of the stage 100 in the Y-axis direction. The Z-axis encoder 116 measures and outputs the position coordinate of the imaging unit 120 in the Z-axis direction. Each encoder is equipped with a scale with graduations and a scale reading unit that reads the graduations on the scale. The scale is attached to the movable part of the stage 100 or the imaging unit 120 along each axis. Meanwhile, the scale reading unit is located on the non-moving part.

[0024] The latch means 118 includes a counter 118a and a buffer 118b. When a trigger signal (e.g., a pulse signal) is supplied from the outside, the counter 118a increments its count value by 1. The value of the counter 118a is reset appropriately based on instructions from the computer system 140. The buffer 118b has storage areas with multiple addresses, and when a trigger signal is supplied, it latches and stores the output value of the encoder for each axis in a storage area with an address corresponding to the count value of the counter 118a. The trigger signal may be supplied, for example, from the imaging means 124 at the timing when capturing of one image is completed. The position coordinates of each axis held by the latch means 118 are associated with address values ​​(i.e., count values) and are appropriately input into the computer system 140. The computer system 140 and the latch means 118 are connected via a general-purpose communication standard such as USB (Universal Serial Bus). The image data and the position coordinates are each separately input into the computer system 140, but since the image data is assigned an index indicating the order of capture and the position coordinates are assigned a count value indicating the order of capture, even if they are input into the computer system 140 asynchronously, they can be associated after input.

[0025] Returning to FIG. 1 , the remote box 130 is an operation means for setting the positions of the stage 100 and the imaging unit 120, and transmits drive control signals to the X-axis drive motor, Y-axis drive motor, and Z-axis drive motor via wired or wireless communication in response to operations by the operator. The remote box 130 includes a joystick 132 and a jog shuttle 134. The joystick 132 is an operation input means for setting the position of the stage 100, and the remote box 130 transmits drive control signals for moving the stage 100 in the X-axis and Y-axis directions in response to the tilt direction of the joystick 132. The jog shuttle 134 is an operation input means for setting the position of the imaging unit 120 in the Z-axis direction, and the remote box 130 transmits drive control signals for moving the imaging unit 120 in the Z-axis direction in response to the rotation direction, rotation amount, rotation speed, etc. of the jog shuttle 134.

[0026] The computer system 140 includes a computer main body 141, a keyboard 142, a mouse 143, and a display 144. Fig. 4 is a block diagram showing the configuration of the computer main body 141. The computer main body 141 includes a CPU 40 which serves as the center of control, a storage unit 41, a work memory 42, interfaces (indicated as "IF" in Fig. 4) 43 and 44, and a display control unit 45 which controls the display on the display 144.

[0027] Operator instruction information entered from a keyboard 142 or a mouse 143 is input to the CPU 40 via an interface 43. The interface 44 is connected to the imaging unit 120 and the stage 100, and supplies various control signals from the CPU 40 to the imaging unit 120 and the stage 100, and receives various status information and measurement results from the imaging unit 120 and the stage 100 and inputs them to the CPU 40.

[0028] The display control unit 45 displays the image captured by the imaging unit 120 on the display 144. In addition to the image captured by the imaging unit 120, the display control unit 45 also displays on the display 144 an interface for inputting control instructions to the image measuring instrument 1, an interface for tools for analyzing the captured image, and the like.

[0029] The work memory 42 provides a working area for various processes of the CPU 40. The storage unit 41 is configured with, for example, a hard disk drive, RAM, etc., and stores programs executed by the CPU 40, image data captured by the imaging unit 120, etc.

[0030] The CPU 40 controls the imaging unit 120, the X-axis drive motor, the Y-axis drive motor, the Z-axis drive motor, etc. based on various input information via each interface, instructions from the operator, a measurement definition program (part program) stored in the memory unit 41, etc., and performs various processes such as setting the movement path of the imaging unit 120, adjusting the movement speed and exposure time, adjusting the light intensity of the light source 126, capturing a two-dimensional image using the imaging unit 120, image stitching processing for stitching together multiple partial images, and analyzing the entire image obtained by capturing the image.

[0031] Measurements performed using the above-described image measuring instrument 1 will be described below.

[0032] [Basic Image Measurement] First, the operator operates the joystick 132 or controls the computer system 140 to move the stage 100 so that the measurement object W is within the imaging field of view. Then, the Z-axis position of the imaging unit 120 is adjusted so that the measurement object W is in focus. After the focus is adjusted to the measurement object W, the imaging means 124 captures an image for measurement. At this time, the coordinates of the stage 100 output from the X-axis encoder 112 and the Y-axis encoder 114 along with the captured image are input into the computer system 140 and stored in the memory unit 41. Specifically, the imaging means 124 outputs a pulse that serves as a trigger signal to the latch means 118 when it completes capturing one image. The latch means 118 latches and holds the position coordinates of each axis at the rising transition of the pulse (i.e., approximately simultaneously with the completion of capturing the image). The computer system 140 captures the image signal from the imaging means 124 and also captures the position coordinates at the time the image was captured from the latch means 118, and stores them in association with each other.

[0033] The computer system 140 displays the obtained measurement image on the display 144 together with an interface of a measurement tool for analyzing the image. Fig. 5 is a diagram showing an example of a screen display. This screen display is displayed on the display 144 by a program (measurement application software) executed by the CPU 40 of the computer system 140.

[0034] As shown in Fig. 5, a main window MW is displayed on the display 144 when the program is executed. Furthermore, multiple windows (first window W1 to eighth window W8) are displayed within the main window MW. Menus and icons for various operations and settings are also displayed above the main window MW. Note that, although an example in which eight windows are displayed is shown in this embodiment, windows other than eight may be displayed as needed, and windows may be divided, merged, or omitted depending on their purpose. Furthermore, the layout of each window can be freely changed by the operator's operation.

[0035] The first window W1 displays an image WG of the measurement object W captured by the imaging unit 120. The operator can adjust the position of the image WG of the measurement object W displayed in the first window W1 by operating, for example, the mouse 143 or the joystick 132 of the remote box 130. The operator can also enlarge or reduce the image WG of the measurement object W by selecting an icon with the mouse 143, for example.

[0036] The second window W2 displays icons of measurement tools that can be selected by the operator. The measurement tool icons are provided corresponding to the designation methods for designating measurement points from the image WG of the measurement object W. Specific examples of measurement tools include a straight line edge detection tool and a circular edge detection tool.

[0037] The third window W3 displays icons of functions that can be selected by the operator. A function icon is provided for each measurement method. For example, there are methods for measuring the coordinates of a point, measuring the length of a line, measuring a circle, measuring an ellipse, measuring a square hole, measuring a slot, measuring pitch, and measuring the tolerance between two lines. In accordance with the operator's selection, the computer system 140 measures dimensions such as the length of a line, the distance between lines, and the diameter of a circle, and evaluates deviations (irregularities) from an ideal geometric shape, such as straightness, roundness, and parallelism.

[0038] The fourth window W4 displays guidance showing the operating procedures for the measurement.

[0039] The fifth window W5 displays various sliders for controlling the lighting irradiated from the imaging unit 120 onto the measurement object W. The operator can apply desired lighting to the measurement object W by operating these sliders.

[0040] The sixth window W6 displays the X and Y coordinate values ​​of the stage 100. The X and Y coordinate values ​​displayed in the sixth window W6 are the coordinates of the stage 100 in the X and Y directions relative to a predetermined origin.

[0041] The seventh window W7 displays the tolerance determination result, i.e., when a measurement method capable of determining tolerance is selected, the seventh window W7 displays the result.

[0042] The eighth window W8 displays the measurement results. That is, when a measurement method that obtains measurement results by a predetermined calculation is selected, the eighth window W8 displays the measurement results. Note that the details of the display of the tolerance judgment results in the seventh window W7 and the measurement results in the eighth window W8 are omitted from the illustration.

[0043] [Binarized image generation and defect inspection] In the image measuring instrument 1, the program (measurement application software) executed by the CPU 40 of the computer system 140 provides the function of generating a binary image from an image of the measurement object W and inspecting for defects that can be inspected from the binary image (hereinafter simply referred to as defect inspection), in addition to the basic image measurement described above. In the following description, unless there is a specific mention of the subject of processing, it should be understood that the subject is the program executed by the CPU 40 of the computer system 140.

[0044] The binary image generation method of the present invention is a binary image generation method for generating a binary image of a measurement object W, and as shown in Figure 6, executes a reference value calculation step (S1), a defect candidate area extraction threshold calculation step (S2), an overdetection reduction threshold setting step (S3), a threshold comparison step (S4), and a binary image generation step (S5).

[0045] Furthermore, the defect inspection method of the present invention is a defect inspection method that uses a binarized image of a measurement object W to inspect defects in the measurement object, and as shown in Figure 6, executes a reference value calculation step (S1), a defect candidate area extraction threshold calculation step (S2), an overdetection reduction threshold setting step (S3), a threshold comparison step (S4), a binarized image generation step (S5), and a judgment step (S6).

[0046] In the reference value calculation step (S1), a reference value, which is a luminance indicating the brightness of the periphery of a pixel, is calculated for each pixel in the image of the measurement target W based on the luminance values ​​of pixels surrounding the pixel. The reference value may be, for example, the average value of the luminance values ​​of pixels present in a certain range around the pixel.

[0047] In the defect candidate area extraction threshold calculation step (S2), a defect candidate area extraction threshold, which is a brightness value threshold for extracting a defect candidate area, is calculated by multiplying the reference value by a constant based on the characteristics of the defect.

[0048] FIG. 7 shows an example of the relationship between the binarization threshold, which is the threshold for binarizing pixels, and the reference value. Here, line L1 indicates that the binarization threshold is equal to the reference value. In other words, it shows the case where the reference value is used as the binarization threshold. In this case, pixel regions whose brightness values ​​are equal to or greater than the reference value and other pixel regions are binarized. Since pixel region A shown in FIG. 7 exceeds the binarization threshold, it is extracted as a defect candidate region. However, when the threshold is set in this way, even if the brightness should be significantly higher than the reference value according to the defect characteristics, regions like pixel region A, whose brightness is only slightly higher than the reference value, will be identified as defect candidate regions, resulting in a decrease in the efficiency of defect candidate narrowing and detection accuracy.

[0049] Therefore, in the defect candidate area extraction threshold calculation step (S2), a value obtained by multiplying the reference value by a constant based on the characteristics of the defect is calculated as the defect candidate area extraction threshold. Figure 8 is a diagram of Figure 7 to which a line L2 has been added, indicating the defect candidate area extraction threshold that satisfies the relationship: binarization threshold = defect candidate area extraction threshold = reference value × constant. In this way, by using a value obtained by multiplying the reference value by a constant based on the characteristics of the defect as the binarization threshold, it is possible to extract pixel areas that correspond to the characteristics of the defect, and to exclude areas such as pixel area A, which are only slightly higher than the reference value, from defect candidates, thereby achieving efficient and effective extraction of defect candidate areas.

[0050] In the overdetection reduction threshold setting step (S3), an overdetection reduction threshold for reducing the influence of noise is set.

[0051] FIG. 9 is a diagram of FIG. 8 to which pixel regions B and C, which inherently have luminance values ​​below the defect candidate region extraction threshold, have been added. However, actual images may contain noise N due to uneven illumination or the image sensor mechanism. In this case, in areas where the reference value is high in luminance, the difference D1 between the value of line L1 indicating the reference value and the value of line L2 indicating the defect candidate region extraction threshold is large, so even if noise N is added to the luminance of pixel region B, it does not reach the defect candidate region extraction threshold. In contrast, in areas where the reference value is low in luminance, the difference D2 between the value of line L1 and line L2 is small, so when noise N is added to the luminance of pixel region C, it exceeds the defect candidate region extraction threshold and is extracted as a defect candidate region, resulting in overdetection.

[0052] Therefore, in the overdetection reduction threshold setting step (S3), an overdetection reduction threshold is set whose reference value is greater than the defect candidate area extraction threshold in low-brightness areas to prevent such overdetection from occurring. Figure 10 is a diagram of Figure 9 to which a line L3 has been added, indicating an overdetection reduction threshold that satisfies the relationship: binarization threshold for low-brightness areas = overdetection reduction threshold > defect candidate area extraction threshold. The overdetection reduction threshold is set based on the magnitude of the expected noise.

[0053] For example, an optimal value (optimum line) may be identified and set by repeatedly generating binarized images while changing the overdetection reduction threshold (line L3). At this time, a constant value (slope of line L3=0) may be set, or line L3 may be set with a slope. When setting the overdetection reduction threshold experimentally in this way, step S3 may be executed independently of steps S1 and S2.

[0054] Alternatively, the value may be calculated and set based on a reference value. In this case, step S3 is executed after step S1.

[0055] In the threshold comparison step (S4), the brightness value of the pixel is compared to determine whether it is equal to or greater than both the defect candidate area extraction threshold and the overdetection reduction threshold. That is, the brightness value is compared using the bold line shown in Fig. 10 as the overall binarization threshold.

[0056] In the binary image generation step (S5), based on the result of comparing each pixel with the binary threshold value in step S4, a binary image of the object to be measured is generated, binarized into areas consisting of pixels whose brightness values ​​are equal to or greater than both threshold values ​​and other areas.

[0057] In the determination step (S6), an area consisting of pixels whose brightness values ​​are equal to or greater than both thresholds is determined as a defect candidate area, and the feature values ​​of the defect candidate area are calculated, and it is determined whether or not the defect candidate area is a defect area based on the feature values. Note that if there are multiple defect candidate areas in the two-dimensional image, a determination is made for each of them.

[0058] According to the binary image generation method, defect inspection method, and program of the present invention described above, a defect candidate area extraction threshold obtained by multiplying a reference value indicating the brightness around a pixel by a constant is used as the threshold for binarizing an image, and in order to reduce overdetection of defect candidate areas due to noise, an overdetection reduction threshold is used as the binarization threshold in low-brightness areas to extract defect candidate areas. This makes it possible to generate a binary image in which overdetection of noise is reduced when extracting defect candidate areas, and by using the binary image generated in this way, it is also possible to reduce erroneous determinations in defect inspections based on the binary image.

[0059] The present invention is not limited to the above-described embodiments. The above-described embodiments are merely illustrative, and any configuration substantially identical to the technical concept described in the claims of the present invention and achieving similar effects is encompassed within the technical scope of the present invention, even if components are added, deleted, or the design is modified. In other words, appropriate modifications are possible within the scope of the technical concept expressed in the present invention, and such modifications and improvements are also included within the technical scope of the present invention. For example, in the above-described embodiments, the image to be binarized is an image of a measurement object taken by an image measuring device. However, the object of the image may be any object within the scope of the present invention. [Explanation of symbols]

[0060] 1. Image measuring device 40 CPU 41 Storage section 42 Working Memory 43, 44 Interface 45 Display control unit 100 stages 110 Location acquisition means 112 X-axis encoder 114 Y-axis encoder 116 Z-axis encoder 118 Latching means 118a Counter 118b buffer 120 Imaging unit 122 Optical system 124 Imaging means 126, 126a, 126b light source 130 Remote Box 132 Joystick 134 Jog Shuttle 140 Computer Systems 141 Computer main body 142 keyboards 143 Mouse 144 displays A, B, C image area Difference between D1 and D2 values L1 Line indicating the reference value L2 Line indicating defect candidate area threshold L3 Line indicating overdetection reduction threshold N noise W Measurement object

Claims

1. A binary image generation method for generating a binary image of an object, comprising: For each pixel in the image of the object, a reference value calculation step of calculating a reference value, which is a luminance indicating brightness around a pixel, based on the luminance values ​​of pixels around the 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 the reference value by a constant based on the characteristics of the defect; an overdetection reduction threshold setting step of setting an overdetection reduction threshold for reducing the influence of noise; a threshold value comparison step of comparing whether or not the luminance value of the pixel is equal to or greater than both the defect candidate area extraction threshold value and the overdetection reduction threshold value; After executing a binary image generating step of generating a binary image of the object, binarized into an area consisting of pixels whose brightness values ​​are equal to or greater than both thresholds and an area other than the area; A binary image generation method that performs the above.

2. The binary image generating method according to claim 1 , wherein the object is a measurement object of an image measuring instrument.

3. 2. The binary image generating method according to claim 1, wherein the reference value is an average value of brightness values ​​of pixels surrounding the pixel.

4. The binary image generating method according to claim 1 , wherein the overdetection reduction threshold is a constant value.

5. A binary image generating method according to any one of claims 1 to 4, a determining step of determining, as a defect candidate area in the binarized image, an area made up of pixels having brightness values ​​equal to or greater than both thresholds, calculating a feature amount of the defect candidate area, and determining, based on the feature amount, whether or not the defect candidate area is a defect area; A defect inspection method to perform.

6. A program for causing a computer to execute the binary image generating method according to any one of claims 1 to 4.

7. 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