Focus setting selection device, surface defect inspection device, focus setting selection method, and surface defect inspection method
The focus setting selection device and method address the challenge of maintaining focus in surface defect inspection by quantitatively evaluating brightness variance, facilitating precise and automated defect detection.
Patent Information
- Application Number
- JP2023069813
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-04-21
- Publication Date
- 2024-10-31
AI Technical Summary
Conventional surface defect inspection devices face challenges in maintaining accurate focus during video capture due to changing positional relationships between the imaging means and the inspected surface, requiring manual adjustment of focus settings for each frame, which is time-consuming and complicates quantitative evaluation.
A focus setting selection device and method that quantitatively evaluates focus by creating edge extraction images, calculating brightness value variance for each frame, and selecting the focus setting with the largest variance to ensure precise and automatic focus adjustment.
Enables instantaneous and high-precision edge extraction for defect detection by selecting the appropriate focus setting, allowing for efficient and automated inspection of surfaces.
Smart Images

Figure 2024155236000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to a focus setting and selection device, a surface defect inspection device, a focus setting and selection method, and a surface defect inspection method that can be used, for example, when inspecting the condition of the paint on the surface of an automobile body. [Background technology]
[0002] Traditionally, in the process of painting automobile bodies, inspectors have visually inspected the painted surface. However, visual inspection by inspectors is a laborious job, and there is a risk of inspection errors or oversights due to individual variability. In addition, visual inspection by inspectors requires a lot of time, and labor costs are one of the factors that increase product production costs. For this reason, there is a demand for automation of visual inspection, and in recent years, development of surface defect inspection devices that can perform optical inspection automatically has been progressing.
[0003] For example, Patent Document 1 describes a surface defect inspection device that photographs the surface to be inspected with an imaging means while moving the imaging means and the surface to be inspected relatively, extracts defect candidates from the multiple images captured, and determines that the defect candidate is defective if the movement distance and movement angle of the defect candidate between at least two or more images captured at different times are within a reference movement distance and reference movement angle that are assumed to occur when a defect exists on the surface to be inspected. With this surface defect inspection device, inspection can be performed automatically by photographing the surface to be inspected. [Prior art documents] [Patent documents]
[0004] [Patent Document 1] JP 2020-118572 A [Non-patent literature]
[0005] [Non-Patent Document 1] Shinkawa et al., Surface Chemistry, Vol. 26, No. 10, pp. 623-628, 2005 Summary of the Invention [Problem to be solved by the invention]
[0006] However, in such a surface defect inspection device, when the painted surface of the automobile is photographed while the painted surface of the automobile and the photographing means are moved relative to each other, the positional relationship and situation between the photographing means and the painted surface change, so that the focus setting of the photographing means needs to be adjusted depending on the frame, and the focus cannot be achieved, and minute defective target areas cannot be accurately detected. Therefore, in the past, multiple videos photographed with different focus settings of the photographing means were visually checked, and the focus setting was adjusted for each frame. Therefore, it was not possible to quickly and quantitatively evaluate the focus for all frames of the photographed video and set the focus, which was troublesome and cumbersome. Note that many algorithms have been known as focus determination methods (see, for example, Non-Patent Document 1).
[0007] The present invention has been made in light of the above problems, and has an object to provide a focus setting selection device and a focus setting selection method that are capable of quantitatively evaluating focus, as well as a surface defect inspection device and a surface defect inspection method that use these. [Means for solving the problem]
[0008] The focus setting selection device of the present invention selects a focus setting according to the frame when a specified video is shot by an imaging means of an object, and is equipped with an edge extraction image creation means for creating an edge extraction image in which edges are extracted for each frame of a plurality of test videos obtained by repeatedly shooting a specified test video corresponding to the video shooting with different focus settings, a brightness value variance calculation means for calculating the variance of brightness values for each edge extraction image, and a selection means for comparing the variance of brightness values for each frame with different focus settings for each frame order, and selecting the focus setting of the frame with the largest variance as the setting for video shooting.
[0009] The surface defect inspection device of the present invention comprises an imaging means for imaging the surface to be inspected to obtain an inspection video, a moving means for relatively moving the imaging means and the surface to be inspected, a defect detection means for detecting defects from the inspection video obtained by imaging a predetermined inspection video with the imaging means while moving the imaging means and the surface to be inspected relatively by the moving means, and a focus setting selection means for selecting a focus setting according to the frame when imaging the inspection video with the imaging means, and the focus setting selection means comprises an edge extraction image creation means for creating an edge extraction image in which edges are extracted for each frame of a plurality of test videos obtained by repeatedly imaging a predetermined test video corresponding to the inspection video with different focus settings, a brightness value variance calculation means for calculating the variance of brightness values for each edge extraction image, and a selection means for comparing the variance of brightness values for each frame with different focus settings for each frame order, and selecting the focus setting of the frame with the largest variance as the setting for imaging the inspection video.
[0010] The focus setting selection method of the present invention selects a focus setting depending on the frame when shooting a specified video of an object with an imaging means, and includes a test video shooting procedure of repeatedly shooting a specified test video corresponding to the video shooting with different focus settings to obtain multiple test videos with different focus settings, an edge extraction image creation procedure of creating an edge extraction image for each frame of each test video by extracting edges, a brightness value variance calculation procedure of calculating the variance of brightness values for each edge extraction image, and a selection procedure of comparing the variance of brightness values for each frame with different focus settings for each frame order, and selecting the focus setting of the frame with the largest variance as the setting for shooting the video.
[0011] The surface defect inspection method of the present invention includes an inspection video capture procedure in which a predetermined inspection video is captured by the capture means while moving the surface to be inspected and the capture means relative to each other to obtain an inspection video, a defect detection procedure in which defects are detected from the inspection video obtained by the inspection video capture procedure, and a focus setting selection procedure in which a focus setting of the capture means in the inspection video capture procedure is selected according to the frame before the inspection video capture procedure, and the focus setting selection procedure includes a test video capture procedure in which a predetermined test video corresponding to the inspection video capture is repeatedly captured with different focus settings to obtain a plurality of test videos with different focus settings, an edge extraction image creation procedure in which an edge extraction image is created for each frame of each test video by extracting edges, a brightness value variance calculation procedure in which the brightness value variance is calculated for each edge extraction image, and a selection procedure in which the variance of the brightness value is compared for each frame with different focus settings for each frame order, and the focus setting of the frame with the largest variance is selected as the setting for capturing the inspection video. Effect of the Invention
[0012] According to the present invention, an edge extraction image is created for each frame of the test video, the variance of the brightness value is calculated, and the focus setting of the frame with the largest variance among the frames with different focus settings is selected as the setting for shooting the video for each frame, so that the focus can be quantitatively evaluated. Furthermore, according to the present invention, by using the brightness variance method, the variance of brightness of a focused image is large, and conversely, the variance of brightness of an unfocused image is small because the brightness fluctuation is small, so that edge extraction for each frame can be performed instantaneously and with high accuracy in order to detect minute defects on the surface to be inspected as in the present invention. Therefore, an appropriate focus setting can be easily and automatically set. [Brief description of the drawings]
[0013] [Figure 1] 1 is a diagram illustrating an overall configuration of a surface defect inspection device according to an embodiment of the present invention. [Diagram 2] 2 is a block diagram illustrating a configuration of a focus setting and selection unit illustrated in FIG. 1. [Diagram 3] FIG. 13 is a diagram illustrating an example of an edge extraction image. [Figure 4] FIG. 11 is a characteristic diagram showing the distribution of luminance values of an edge extraction image when in focus. [Diagram 5] FIG. 11 is a characteristic diagram showing the distribution of luminance values of an edge extraction image when the image is not in focus. [Figure 6] 2 is a block diagram showing a configuration of a defect detection unit shown in FIG. 1. [Figure 7] 11 is a diagram illustrating an example of a defect candidate extracted by a secondary extraction unit. FIG. [Figure 8] 1 is a diagram showing a procedure of a surface defect inspection method according to an embodiment of the present invention. [Figure 9] 9A to 9C are diagrams illustrating steps in the focus setting and selection procedure shown in FIG. 8. [Figure 10] 9A to 9C are diagrams illustrating steps in the defect detection procedure shown in FIG. 8. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0014] Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
[0015] [Surface defect inspection device] 1 shows the overall configuration of a surface defect inspection device 1 according to an embodiment of the present invention. This surface defect inspection device 1 detects defects present on the surface of an inspection target surface M, which may be, for example, a painted surface of an automobile body.
[0016] The surface defect inspection device 1 may, as necessary, include, for example, a light source 10 that irradiates light onto the surface M to be inspected, an imaging means 20 that images the surface M to be inspected to obtain an inspection video, a moving means 30 that moves the imaging means 20 and the surface M to be inspected relatively, a defect detection means 40 that detects defects from the inspection video obtained by having the imaging means 20 capture a predetermined inspection video while moving the imaging means 20 and the surface M to be inspected relatively using the moving means 30, a focus setting selection means 50 that selects the focus setting when capturing the inspection video by the imaging means 20 in accordance with the frame, and a display means 60 that displays the detection results by the defect detection means 40.
[0017] It is preferable to use a straight-tube lighting fixture, for example, a straight-tube fluorescent lamp, LED lighting, or laser light, as the light source 10, but the type of lighting is not limited to these, and since there are a wide variety of colors for the body of an automobile, it is preferable to use a white light source. It is preferable to arrange a plurality of light sources 10 with respect to the surface M to be inspected, for example, so that the surface M to be inspected can be observed from multiple directions.
[0018] The photographing means 20 has a camera 21 such as a CCD camera and can obtain a digital image. The camera 21 is arranged to photograph the surface M illuminated by the light source 10. Specifically, the camera 21 is arranged to face the light source 10 and is configured to photograph the reflected mirror image of the light source 10 and its surrounding area. In addition, it is preferable that the angle of the camera 21 is configured to be changeable according to the movement of the position of the surface M to be inspected relative to the camera 21. This is because if the angle of the camera 21 is fixed, the brightness value of the defect candidate may be low depending on the part of the surface M to be inspected, making it difficult to extract the defect candidate.
[0019] The moving means 30 moves at least one of the imaging means 20 and the surface M to be inspected, thereby moving the imaging means 20 and the surface M to be inspected relatively. For example, the imaging means 20 may be configured to transport the surface M to be inspected at a constant speed in one direction by a transporting means such as a conveyor, or the camera 21 of the imaging means 20 may be configured to move at a constant speed in one direction. Note that FIG. 1 shows a case where the surface M to be inspected is moved by a conveyor or the like.
[0020] The defect detection means 40 and the focus setting selection means 50 are configured, for example, by a computer, and are configured to detect defects by image processing. The specific configurations of the defect detection means 40 and the focus setting selection means 50 will be described later. The display means 60 is configured, for example, by a display or the like.
[0021] (Focus setting selection means) 2 shows the configuration of the focus setting selection means 50. This focus setting selection means 50 corresponds to a focus setting selection device according to one embodiment of the present invention. The focus setting selection means 50 has, as necessary, for example, an edge extraction image creation means 51, a brightness value variance calculation means 52, a selection means 53 that selects the focus setting with the best focus, and a focus setting storage means 54 that stores the focus setting selected by the selection means 53.
[0022] The edge extraction image creation means 51 creates edge extraction images in which edges are extracted for each frame of a plurality of test videos obtained by, for example, repeatedly performing a predetermined test video shooting corresponding to a predetermined inspection video shooting for obtaining an inspection video with different focus settings. The test videos are, for example, test videos shot with shooting conditions other than the focus setting corresponding to the inspection video shooting. For example, in the test video shooting, it is preferable that the shooting conditions such as the shooting means 20, the positional relationship between the shooting means 20 and the inspected surface M over time, and the frame rate are the same as those in the inspection video shooting.
[0023] The test video is also taken under the same conditions as those required for accurate shooting of the inspection video, and is used to identify the optimal focus setting. The test video is preferably obtained by performing test video shooting with a test pattern on the surface M to be inspected. This is to facilitate the selection of the focus setting with the best focus. The test pattern is not particularly limited, but may be, for example, a black and white checkered pattern. This is because edges can be easily extracted. For edge extraction, it is preferable to perform differentiation of the luminance difference in each frame, and extract pixels in which the luminance difference between adjacent pixels is equal to or greater than a specified value. FIG. 3 shows an example of an edge extraction image. FIG. 3 shows an edge extraction image of one frame of a test video in which a black and white checkered pattern is applied as a test pattern to the surface M to be inspected and test video shooting is performed. As shown in FIG. 3, in the edge extraction image, for example, the color boundary of the checkered pattern is extracted.
[0024] The brightness value variance calculation means 52 calculates the variance of brightness values for each edge extraction image created by the edge extraction image creation means 51, for example. Specifically, for example, it calculates how large the brightness difference of each pixel is from the average brightness value of the edge extraction image using Equation 1 and Equation 2. In Equation 1 and Equation 2, μ is the average brightness value of the edge extraction image, N is the number of pixels in the edge extraction image, P k is the brightness value of each pixel in the edge extracted image, and σ is the variance of the brightness values in the edge extracted image. When the image is in focus, the number of edges extracted increases, as shown in Figure 4, and the variance increases. When the image is not in focus, the number of edges extracted decreases, as shown in Figure 5, and the variance decreases.
[0025]
number
number
[0026] The selection means 53, for example, compares the variances of the luminance values calculated by the luminance value variance calculation means 52 for each frame with a different focus setting for each frame order, and selects the focus setting of the frame with the largest variance as the setting for shooting the test moving image. For example, the selection means 53 is preferably configured to compare the variances of the luminance values of each frame with the same electrical signal (hereinafter referred to as "time code") encoded by synchronizing image information and time information in each test moving image with different focus settings, and selects the focus setting of the frame with the largest variance as the setting for shooting the test moving image for that time code.
[0027] (Defect detection means) 6 shows the configuration of the defect detection means 40. The defect detection means 40 has a defect candidate extraction means 41 that extracts defect candidates from an inspection moving image obtained by, for example, photographing a predetermined inspection moving image with the photographing means 20 while relatively moving the photographing means 20 and the inspected surface M with the moving means 30, and a defect determination means 42 that determines whether the defect candidate extracted by the defect candidate extraction means 41 is a defect or not.
[0028] (Means for extracting defect candidates) It is preferable that the defect candidate extraction means 41 has an inspection video storage means 411, such as a memory, for storing an inspection video obtained by shooting a predetermined inspection video with the imaging means 20 while moving the imaging means 20 and the inspected surface M relative to each other, an inspection video preprocessing means 412 for preprocessing the inspection video shot by the imaging means 20, a division means 413 for dividing an area including the reflected mirror image of the light source 10 into multiple parts in the longitudinal direction for each frame of the inspection video preprocessed by the inspection video preprocessing means 41B, a primary extraction means 414 for performing binarization processing on the inspection video preprocessed by the inspection video preprocessing means 412 and extracting primary defect candidates for extracting defect candidates, a primary defect candidate storage means 415 for storing the primary defect candidates, a secondary extraction means 416 for extracting defect candidates from the primary defect candidates, and a defect candidate storage means 417 for storing the defect candidates.
[0029] The inspection moving image pre-processing means 412 converts, for example, each frame of the inspection moving image obtained by the photographing means 20 into a density image such as a grayscale image, cuts out the area of the inspection surface M, and reduces noise. Examples of noise reduction methods include a Gaussian filter and a median filter.
[0030] The division means 413 is preferably configured to cut out an area including one reflected mirror image of the light source 10 and its surrounding area for each frame of the inspection video preprocessed by the inspection video preprocessing means 412, and divide the reflected mirror image into multiple parts in the longitudinal direction. This is because the luminance differs between the center and the ends in the longitudinal direction of the reflected mirror image, and by dividing the image, binarization processing can be performed with high accuracy in the primary extraction means 414.
[0031] The primary extraction means 414 is configured to perform binarization processing for each image obtained by division by the division means 413, while sequentially changing the binarization threshold from the binarization reference value in one direction, compare the multiple binarized images obtained in the order of processing, and set the binarized image when the number of occurrences of defect candidate points becomes equal to or greater than the predetermined reference number from a state where the number of occurrences of defect candidate points is smaller than the predetermined reference number as a threshold image, or set the binarized image when the number of occurrences of defect candidate points becomes equal to or less than the predetermined reference number from a state where the number of occurrences of defect candidate points is larger than the predetermined reference number as a threshold image, and extract primary defect candidates from this threshold image. That is, the primary extraction means 414 automatically determines the binarization threshold based on the change in the number of occurrences of defect candidate points accompanying the change in the binarization threshold, and binarizes the image. It is preferable that the primary extraction means 414 performs binarization processing for each image divided by the division means 413, and extracts primary defect candidates.
[0032] The primary defect candidate storage means 415 is configured, for example, by a memory or the like, and is configured to store the barycentric coordinates of the primary defect candidates extracted by the primary extraction means 414.
[0033] The secondary extraction means 416 is configured to extract, for example, from among the primary defect candidates extracted by the primary extraction means 414 for each frame of the inspection video preprocessed by the inspection video preprocessing means 412, those in which the luminance difference between the luminance value of the primary defect candidate and the average luminance value of the surroundings of the primary defect candidate is equal to or greater than a predetermined luminance difference reference value as a defect candidate. Specifically, for example, the secondary extraction means 416 is configured to calculate the luminance difference between the luminance value of the coordinates of the primary defect candidate stored in the primary defect candidate storage means 415 and the average luminance value of the coordinates of the surroundings of the primary defect candidate, and extract the defect candidate if the luminance difference is equal to or greater than a predetermined luminance difference reference value. FIG. 7 shows an example of the defect candidate extracted by the secondary extraction means 416. In FIG. 7, the white dots surrounded by circles are defect candidates.
[0034] The secondary extraction means 416 is preferably configured to divide the area around the reflected mirror image of the light source 10 into multiple areas according to the distance from the reflected mirror image of the light source 10, and to set a luminance difference reference value for each of the multiple distance areas. Since the luminance difference between the luminance value of a primary defect candidate and the average luminance value around the primary defect candidate changes depending on the distance from the reflected mirror image of the light source 10, by setting a luminance difference reference value for each distance area, it is possible to extract defect candidates with higher accuracy.
[0035] The defect candidate storage means 417 is configured, for example, by a memory or the like, and is configured to store the time code and barycentric coordinates of the inspection moving image for the defect candidates extracted by the secondary extraction means 416.
[0036] (Defect determination means) The defect judgment means 42 includes, for example, a section shooting video storage means 421 such as a memory that stores a section shooting video captured by the photographing means 20 while moving the photographing means 20 and the section screen relatively by the moving means 30 for a section screen in which the inspected surface M is divided into a plurality of sections in a grid pattern and a reference point is set within at least one of the sections; a section information creation means 422 that creates section information from the section shooting video captured for the section screen in which the inspected surface M is divided into a plurality of sections in a grid pattern and a reference point is set within one of the sections; a section information storage means 423 that stores the section information created by the section information creation means 422; and a judgment means 424 that uses the section information created by the section information creation means 422 to judge whether or not a defect candidate extracted by the defect candidate extraction means 41 is a defect.
[0037] The section information creating means 422 is configured to, for example, detect section areas corresponding to each section of the section screen for each frame of the section photographed video stored in the section photographed video storage means 421, and create section information. The section photographed video used by the section information creating means 422 is, for example, photographed in the same manner as a predetermined inspection video shooting for obtaining the inspection video, so that each frame of the inspection video corresponds to each frame of the section photographed video. In addition, the section photographed video used by the section information creating means 422 is preferably photographed, for example, of a section screen in which the inspected surface M is divided into a grid shape by a black and white checkerboard pattern, and at least one section is marked with a circle or the like in a color other than black and white as a reference point.
[0038] Specifically, for example, the partition information creation means 422 is preferably configured to execute the steps of: detecting an image reference point corresponding to a reference point of the partition surface for each frame of the partition capture video, and detecting a reference partition area containing the image reference point based on this image reference point; determining an adjacent partition area inner point located in an adjacent partition area adjacent to the reference partition area based on this reference partition area, and detecting the adjacent partition area based on this adjacent partition area inner point; and determining another adjacent partition area inner point located in another adjacent partition area adjacent to this adjacent partition area, and detecting the other adjacent partition area based on this other adjacent partition area inner point.
[0039] The section information storage means 423 is preferably configured to store, as section information, for example, a time code of a section-captured video, coordinates of a section area, and a section area number corresponding to the section number of the section surface in association with each other.
[0040] The determination means 424 is preferably configured to detect partition areas in which defect candidates extracted by the defect candidate extraction means 41 exist, for example, using the partition information created by the partition information creation means 422, and determine that there is a defect when a defect candidate exists in a partition area corresponding to the same partition of the partition surface in a reference determination number or more of frames among the frames of the inspection video. The reference determination number for determining that there is a defect can be set arbitrarily to 2 or more, and is more preferably, for example, 3 or more.
[0041] [Surface defect inspection method] This surface defect inspection apparatus 1 is used, for example, as follows. Fig. 8 shows the procedure of a surface defect inspection method using the surface defect inspection apparatus 1. Fig. 9 shows each step in a focus setting selection procedure of the surface defect inspection method. Fig. 10 shows each step in a defect detection procedure of the surface defect inspection method.
[0042] This surface defect inspection method includes, as necessary, for example, an inspection video capture procedure (step S110) for capturing a predetermined inspection video by the imaging means 20 while moving the inspected surface M and the imaging means 20 relatively to obtain an inspection video, a defect detection procedure (step S120) for detecting defects from the inspection video captured by the inspection video capture procedure, a display procedure (step S130) for displaying the detection results, and a focus setting selection procedure (step S100) for selecting a focus setting of the imaging means 20 in the inspection video capture procedure according to a frame before the inspection video capture procedure. Note that the focus setting selection procedure corresponds to a focus setting selection method according to an embodiment of the present invention.
[0043] In the focus setting selection procedure (step S100), first, for example, a predetermined test video shooting corresponding to the inspection video shooting is repeatedly performed by changing the focus setting, and multiple test videos with different focus settings are obtained (step S101; test video shooting procedure). The test video shooting is performed, for example, by making the shooting conditions other than the focus setting correspond to the inspection video shooting. For example, it is preferable that the shooting conditions such as the positional relationship over time between the shooting means 20 and the surface M to be inspected and the frame rate are the same as those for the inspection video shooting. In addition, it is preferable to perform the test video shooting with a test pattern applied to the surface M to be inspected. For example, this can be achieved by attaching paper or cloth with the test pattern drawn on the surface M to be inspected. For example, a black and white checkered pattern can be given as the test pattern.
[0044] Next, for example, the edge extraction image creating means 51 creates an edge extraction image by extracting edges for each frame of each test moving image obtained in the test moving image shooting procedure (step S101) in Fig. 9 (step S102; edge extraction image creating procedure). For example, in each frame, the luminance difference is differentiated to extract pixels whose luminance difference between adjacent pixels is equal to or greater than a specified value (see Fig. 3). Next, for example, the luminance value distribution calculating means 52 calculates the variance of luminance values for each edge extraction image obtained in the edge extraction image creating means (step S102) using the above-mentioned formulas 1 and 2 (step S103; luminance value variance calculating procedure).
[0045] Next, for example, the selection means 53 compares the variances of the luminance values calculated in the luminance value variance calculation procedure for each frame with a different focus setting for each frame order, and selects the focus setting of the frame with the largest variance as the setting for shooting the inspection video (step S104; selection means). For example, in each test video with different focus settings, the variances of the luminance values of each frame with the same time code are compared, and the focus setting of the frame with the largest variance is selected as the setting for shooting the inspection video at that time code. The selected focus setting is stored, for example, in the focus setting storage means 54.
[0046] In the inspection video shooting procedure (step S110) of FIG. 8, for example, the imaging means 20 is set to the focus setting selected in the focus setting selection procedure (step S100) to shoot a predetermined inspection video. The focus setting is set, for example, for each frame. In the inspection video shooting, for example, it is preferable to irradiate light from the light source 10 and image the surface M to be inspected illuminated by the light source 10. Also, depending on the part of the surface M to be inspected, the angle of the camera 21 may be changed so that the brightness of defect candidates is increased in accordance with the movement of the position of the surface M to be inspected relative to the camera 21. The video shot by the imaging means 20 is stored in the inspection video image storage means 411.
[0047] In the defect detection procedure (step S120), first, for example, the inspection video preprocessing means 412 preprocesses the inspection video obtained in the inspection video shooting procedure (step S110) (step S121; inspection video preprocessing procedure). Next, for example, the division means 413 cuts out an area including one reflector image of the light source 10 and its surrounding area for each frame of the preprocessed inspection video, and divides it into multiple parts in the length direction of the reflector image (step S122; image division procedure).
[0048] Next, for example, the primary extraction means 414 performs binarization processing for each image divided by the image division procedure (step S122) to extract primary defect candidates (step S123; primary extraction procedure). Specifically, for example, for the preprocessed inspection video, binarization processing is performed sequentially for each image divided by the image division procedure (step S122) while sequentially changing the binarization threshold from the binarization reference value in one direction, and a plurality of binarized images obtained in the order of processing are compared, and a binarized image when the number of appearances of defect candidate points becomes equal to or greater than the predetermined reference number from a state where the number of appearances of defect candidate points becomes equal to or less than the predetermined reference number from a state where the number of appearances of defect candidate points becomes equal to or less than the predetermined reference number is set as a threshold image, and primary defect candidates are extracted from this threshold image. The primary defect candidates extracted by the primary extraction procedure (step S123) are stored in the primary defect candidate storage means 415.
[0049] Thereafter, for example, the secondary extraction means 416 extracts defect candidates from the primary defect candidates extracted by the primary extraction procedure (step S123) (step S124; secondary extraction procedure). Specifically, for example, for the preprocessed inspection video, for each image divided by the image division procedure (step S122), the luminance difference between the luminance value of the primary defect candidate and the average luminance value around the primary defect candidate is calculated, and if the luminance difference is equal to or greater than a predetermined luminance difference reference value, the defect candidate is extracted. The defect candidates extracted by the secondary extraction procedure (step S124) are stored in the defect candidate storage means 417.
[0050] After the defect candidates are extracted by the secondary extraction procedure (step S124), the judgment means 424 uses the partition information created by the partition information creation means 422 to detect the partition area in which the defect candidates extracted by the defect candidate extraction means 41 exist, and judges that there is a defect if a defect candidate exists in a partition area corresponding to the same partition of the partition surface in at least a reference judgment number of frames among the frames of the inspection video (step S125; judgment procedure).
[0051] The section information creating means 422 creates section information by detecting section areas corresponding to each section from section photographed images photographed in correspondence with the inspection video in the same manner as in photographing a predetermined inspection video for obtaining an inspection video, for example, for a section screen in which the inspected surface M is divided into a plurality of sections with reference points. The section information is stored in the section information storage means 423 in association with the time code of the section video, the coordinates of the section area, and the number of the section area corresponding to the section number of the section surface. The determination means 424 preferably corresponds, for example, the time code and the barycentric coordinates of the defect candidate extracted by the secondary extraction means 416 to the section information created by the section information creating means 422 (time code, coordinates of the section area, number of the section area corresponding to the section number of the section surface, etc.), and determines that the defect candidate exists in a reference determination number or more frames for the same section area number.
[0052] As described above, according to this embodiment, an edge extraction image is created for each frame of the test video, the variance of the brightness value is calculated, and the focus setting of the frame with the largest variance among the frames with different focus settings is selected for each frame order as the setting for video shooting, so that the focus can be quantitatively evaluated. Therefore, an appropriate focus setting can be easily and automatically set.
[0053] Although the present invention has been described above with reference to the embodiment, the present invention is not limited to the above embodiment and can be modified in various ways. For example, in the above embodiment, each component is specifically described, but it is not necessary to include all the components, and other components may be included.
[0054] Furthermore, in the above embodiment, the defect detection means 40 and the defect detection procedure (step S120) have been specifically described, but defect candidates may be extracted using other configurations and procedures.
[0055] Furthermore, in the above embodiments, a case has been described in which a focus setting selection device or a focus setting selection method is used in a surface defect inspection device or a surface defect inspection method, but the focus setting selection device and focus setting selection method of the present invention can be widely applied to cases in which a focus setting is selected according to a frame when a predetermined moving image is captured by an imaging means for an object.
[0056] In addition, while the above embodiment has been described specifically with reference to the case of inspecting the painted surface of an automobile body, the present invention is not limited to automobile bodies and can be applied to the surface inspection of other painted products as well. Furthermore, the present invention is not limited to painted surfaces and can be applied to the inspection of surfaces having reflective properties. [Explanation of symbols]
[0057] 1...surface defect inspection apparatus, 10...light source, 20...imaging means, 21...camera, 30...moving means, 40...defect detection means, 41...defect candidate extraction means, 411...inspection video storage means, 412...inspection video pre-processing means, 413...division means, 414...primary extraction means, 415...primary defect candidate storage means, 416...secondary extraction means, 417...defect candidate storage means, 42...defect judgment means, 421...section photographed image storage means, 422...section information creation means, 423...section information storage means, 424...judgment means, 50...focus setting selection means, 51...edge extraction image creation means, 52...brightness value variance calculation means, 53...selection means, 54...focus setting storage means, 60...display means, M...inspected surface
Claims
1. A focus setting selection device that selects a focus setting according to a frame when a predetermined moving image is captured by a photographing means for a target object, comprising: an edge extraction image creation means for creating an edge extraction image by extracting edges for each frame of a plurality of test videos obtained by repeatedly shooting predetermined test videos corresponding to the video shooting with different focus settings; a brightness value variance calculation means for calculating a brightness value variance for each of the edge extraction images; a selection means for comparing the variance of the luminance values for each frame with a different focus setting for each frame in order of frames, and selecting the focus setting of the frame with the largest variance as the setting for shooting the moving image; A focus setting selection device comprising:
2. An imaging means for imaging the surface to be inspected to obtain an inspection video; a moving means for relatively moving the imaging means and the surface to be inspected; a defect detection means for detecting defects from an inspection moving image obtained by taking a predetermined inspection moving image with the imaging means while the moving means moves the imaging means and the surface to be inspected relatively; a focus setting selection means for selecting a focus setting when the imaging means captures the inspection moving image in accordance with a frame, The focus setting and selection means includes: an edge extraction image creation means for creating an edge extraction image by extracting edges for each frame of a plurality of test videos obtained by repeatedly photographing a predetermined test video corresponding to the inspection video while changing a focus setting; a brightness value variance calculation means for calculating a brightness value variance for each of the edge extraction images; a selection means for comparing the variance of the luminance values for each frame with a different focus setting for each frame in order of frames, and selecting the focus setting of the frame with the largest variance as the setting for photographing the inspection moving image; A surface defect inspection device comprising:
3. 3. The surface defect inspection device according to claim 2, wherein the test video is obtained by recording the test video after a test pattern is applied to the surface to be inspected.
4. A focus setting selection method for selecting a focus setting according to a frame when a predetermined moving image is captured by an image capturing means for an object, comprising: a test video shooting procedure for repeatedly shooting a predetermined test video corresponding to the video shooting with different focus settings to obtain a plurality of test videos with different focus settings; an edge extraction image creation step of creating an edge extraction image by extracting edges for each frame of each of the test videos; a brightness value variance calculation step of calculating a brightness value variance for each of the edge extraction images; a selection step of comparing the variances of the luminance values for each frame with a different focus setting for each frame in frame order, and selecting the focus setting of the frame with the largest variance as the setting for shooting the moving image; 23. A method for selecting a focus setting comprising:
5. an inspection video capturing step of capturing a predetermined inspection video by the imaging means while moving the inspection surface and the imaging means relatively to obtain the inspection video; a defect detection step of detecting defects from the inspection video obtained by the inspection video shooting step; a focus setting selection step of selecting a focus setting of the imaging means in the inspection video shooting step according to a frame, before the inspection video shooting step; The focus setting selection step includes: a test video capture procedure for repeatedly capturing a predetermined test video corresponding to the inspection video capture with different focus settings to obtain a plurality of test videos with different focus settings; an edge extraction image creation step of creating an edge extraction image by extracting edges for each frame of each of the test videos; a brightness value variance calculation step of calculating a brightness value variance for each of the edge extraction images; a selection step of comparing the variances of the luminance values for each frame with a different focus setting for each frame in order of frames, and selecting the focus setting of the frame with the largest variance as the setting for photographing the inspection video; A surface defect inspection method comprising:
6. 6. The surface defect inspection method according to claim 5, wherein in the test moving image capturing step, a test pattern is applied to the surface to be inspected and the test moving image is captured.
Citation Information
Patent Citations
Inspection device of metal mold for Anti-glare treatment
JP2012145572A
Surface defect inspection device and surface defect inspection method
JP2020118572A
