Determination device, determination system, determination method, program, and storage medium

By adjusting the comparison between pixel values ​​and thresholds, the problem of insufficient judgment accuracy when judging whether items in the image is qualified or not is solved, achieving higher judgment accuracy and more accurate item classification.

CN118742919APending Publication Date: 2024-10-01KK TOSHIBA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202280091958.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2022-02-18
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

When the conventional technology determines whether an item captured in an image is qualified or not, the determination accuracy is insufficient, and it is easy to mistakenly determine that qualified products are unqualified or unqualified products are qualified.

Method used

By comparing pixel values ​​based on multiple pixel units with multiple thresholds, the thresholds are adjusted until all qualified product images are judged to be qualified, ensuring the accuracy of the judgment. Specific methods include setting an initial threshold, determining whether items are qualified based on the characteristics of the abnormal pixel area, relaxing the threshold when some items are judged to be unqualified, and repeating adjustments until all items are judged to be qualified.

Benefits of technology

It improves the accuracy of judging whether the items in the image are qualified or not, and reduces the possibility of misjudgment of qualified products as unqualified and unqualified products as qualified.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118742919A_ABST
    Figure CN118742919A_ABST
Patent Text Reader

Abstract

A determination device according to an embodiment determines whether or not an article captured in an image including a plurality of pixel units is qualified on the basis of each comparison between pixel values of the plurality of pixel units and a plurality of threshold values. The determination device executes a first process for setting each of a plurality of threshold values as an initial value. The determination device executes a second process that determines, on the basis of a plurality of threshold values, whether or not an article captured in at least a portion of the plurality of qualified product images is qualified. The determination device executes a third process that widens at least a portion of the plurality of thresholds when it is determined that an article captured in one or more of the plurality of qualified product images is unqualified. The determination device repeats the second processing and the third processing to adjust the plurality of threshold values until the article in each of the plurality of qualified product images is determined to be a qualified product in the second processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to a determination device, a determination system, a determination method, a program, and a storage medium. Background Art

[0002] There is a technology for determining whether an article captured in an image is acceptable or not. Regarding this technology, it is required to improve the determination accuracy.

[0003] Prior art literature

[0004] Patent Literature

[0005] Patent Document 1: Japanese Patent Application Publication No. 2013-224833 Summary of the invention

[0006] Technical problem to be solved by the invention

[0007] The technical problem to be solved by the present invention is to provide a determination device, a determination system, a determination method, a program and a storage medium capable of improving determination accuracy.

[0008] Means for solving technical problems

[0009] The determination device of the embodiment determines whether an item captured in an image containing a plurality of pixel units is qualified or not based on respective comparisons between pixel values ​​of a plurality of pixel units and a plurality of threshold values. The determination device performs a first process of setting the plurality of threshold values ​​to initial values, respectively. The determination device also performs a second process of determining whether an item captured in at least a portion of a plurality of qualified product images is qualified or not based on the plurality of threshold values. The determination device also performs a third process of relaxing at least a portion of the plurality of threshold values ​​when the item captured in at least one of the plurality of qualified product images is determined to be unqualified. The determination device repeats the second process and the third process to adjust the plurality of threshold values ​​until the item in each of the plurality of qualified product images is determined to be qualified in the second process. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 It is a schematic diagram showing the structure of the determination system according to the embodiment.

[0011] Figure 2 This is a flowchart showing the inspection process of the determination device according to the embodiment.

[0012] Figure 3 This is an image used to illustrate the inspection process.

[0013] Figure 4 This is an image used to illustrate the inspection process.

[0014] Figure 5 This is a flowchart showing a method for adjusting a threshold value of a determination device according to an embodiment.

[0015] Figure 6 This is a flowchart showing another adjustment method of the determination device according to the embodiment.

[0016] Figure 7 This is a flowchart showing another adjustment method of the determination device according to the embodiment.

[0017] Figure 8 It is a schematic diagram showing an output example from the determination device according to the embodiment.

[0018] Fig. 9 It is a schematic diagram showing the hardware structure. DETAILED DESCRIPTION

[0019] Hereinafter, each embodiment of the present invention will be described with reference to the drawings. In the present specification and each drawing, the same reference numerals are given to the same elements as those already described, and detailed descriptions thereof are appropriately omitted.

[0020] Figure 1 It is a schematic diagram showing the structure of the determination system according to the embodiment.

[0021] like Figure 1 As shown, the determination system 1 of the embodiment includes a determination device 10, an input device 11, a display device 12, a storage device 20, and an imaging device 30. The determination system 1 of the embodiment can be used for appearance inspection of articles.

[0022] The camera device 30 photographs the object A to be inspected and obtains an image. The camera device 30 stores the obtained image in the storage device 20. The camera device 30 obtains a static image of the object A. The camera device 30 can also obtain a dynamic image and cut out a static image from the dynamic image. The direction of photographing the object A is appropriately set to obtain an image suitable for inspection. For example, a plurality of objects A are transported in sequence by the conveying device 40. The camera device 30 is fixed and photographs the plurality of objects A being transported in sequence.

[0023] The determination device 10 obtains the image stored in the storage device 20. Alternatively, the image may be directly sent from the imaging device 30 to the determination device 10. The determination device 10 determines whether the article A captured in the image is acceptable or not. The input device 11 is used by the user to input data to the determination device 10. The display device 12 displays the data output from the determination device 10 in a manner that the user can visually confirm.

[0024] Figure 2 This is a flowchart showing the inspection process of the determination device according to the embodiment.

[0025] The determination device 10 accesses the storage device 20 to obtain an image (step S1). An image includes a plurality of pixel units arranged in the X direction and the Y direction. For example, a pixel unit is composed of one pixel. Alternatively, a pixel unit may be composed of two or more adjacent pixels.

[0026] The determination device 10 accesses the storage device 20 and obtains a plurality of threshold values ​​(step S2). The plurality of threshold values ​​are used to respectively determine whether a plurality of pixel units are normal. A threshold value is set for one pixel unit. Specifically, as a threshold value, an upper limit and a lower limit of the pixel value are set. Usually, the pixel value is an arbitrary integer from 0 to 255. As the upper limit and the lower limit, an arbitrary integer from 0 to 255 is set respectively. When the pixel value is between the lower limit and the upper limit, the pixel unit having the pixel value is determined to be normal. When the pixel value deviates from the lower limit and the upper limit, the pixel unit having the pixel value is determined to be abnormal.

[0027] When a pixel unit is composed of one pixel, the pixel value of the one pixel can be used as the pixel value of the one pixel unit. When a pixel unit is composed of two or more pixels, the average of the pixel values ​​of the two or more pixels can be used as the pixel value of the one pixel unit.

[0028] The determination device 10 compares a plurality of pixel values ​​in the image with a plurality of threshold values, respectively, and extracts an abnormal pixel unit (a first abnormal pixel unit) that deviates from the threshold value (step S3). The determination device 10 estimates an abnormal region (a first abnormal region) based on the extracted abnormal pixel unit (step S4). For example, in the estimation of the abnormal region, noise removal, expansion, contraction, and labeling are performed. Through these processes, a block (particle) of an abnormal pixel unit is generated and identified. The determination device 10 estimates the particle of the abnormal pixel unit as an abnormal region.

[0029] The determination device 10 determines whether the article captured in the image is acceptable or not based on the feature of the abnormal region (step S5). As the feature, at least one selected from the area of ​​the abnormal region, the shape of the abnormal region, and the distribution of pixel values ​​in the abnormal region is used.

[0030] When the area is used as a feature, a threshold value for the area is set in advance. The area is represented by the number of pixels included in the abnormal region. When the area of ​​the abnormal region exceeds the threshold value, the determination device 10 determines that the article is defective.

[0031] As the shape, for example, the aspect ratio is used. The aspect ratio is the ratio of the length in the major axis direction to the length in the minor axis direction. The major axis direction is a direction parallel to the longest line segment obtained by connecting any two points on the outer edge of the particle. The minor axis direction is perpendicular to the major axis direction. When the shape is used as a feature, a threshold value for the aspect ratio is set in advance. The relationship between the aspect ratio and the threshold value is set according to the article. For example, when the quality of the article to be inspected is poor and the aspect ratio of the abnormal area tends to increase, the determination device 10 determines the article as unqualified when the aspect ratio exceeds the threshold value.

[0032] As the distribution, for example, the ratio of the number of pixel units below the lower limit threshold to the number of pixel units in the abnormal area (first ratio), the ratio of the number of pixel units exceeding the upper limit threshold to the number of pixel units in the abnormal area (second ratio), etc. are used. When the distribution is used as a feature, a first threshold for the first ratio and a second threshold for the second ratio are respectively set in advance. The determination device 10 determines that the article is unqualified when the first ratio exceeds the first threshold or when the second ratio exceeds the second threshold.

[0033] The determination device 10 outputs the determination result (step S6). For example, the determination device 10 stores the determination result in the storage device 20. The determination device 10 may also associate the image used for determination with the determination result and store it in the storage device 20. The image may also show the extracted abnormal pixel unit or the estimated abnormal area. The determination device 10 may also display the determination result and the image on the display device 12.

[0034] Figure 3 (a)~ Figure 3 (c) and Figure 4 (a)~ Figure 4 (c) is an image for explaining the inspection process.

[0035] Here, a case where one pixel unit is composed of one pixel will be described. Figure 3 (a) shows an image IM1 obtained by photographing the object A1. Figure 3 (b) and Figure 3 (c) is an image showing the threshold value of each pixel set for inspection. Specifically, Figure 3 The image IM2 shown in (b) shows the upper limit of the threshold value of each pixel. Figure 3 The image IM3 shown in (c) represents the lower limit of the threshold value of each pixel. When any pixel of the image IM1 is brighter than the pixel of the same coordinate in the image IM2, or darker than the pixel of the same coordinate in the image IM3, the pixel in the image IM1 is judged to be abnormal. In this example, the object A1 photographed in the image IM1 is judged to be a qualified product.

[0036] Figure 4 (a) shows an image IM4 obtained by photographing article A2. A portion of article A2 is darker than article A1. The determination device 10 extracts abnormal pixels from a plurality of pixels using a plurality of threshold values. Figure 4 The image IM5 shown in (b) shows the extracted abnormal pixels. Figure 4 In the example of (b), particles P1 to P6 of abnormal pixels are extracted.

[0037] The determination device 10 estimates the abnormal region based on particles P1 to P6. For example, particles P5 and P6 disappear by noise removal and shrinkage. Particles P1 to P4 are combined with each other by expansion. Thus, Figure 4 The image IM6 shown in (c) of FIG. 1 shows a particle P7 including an abnormal pixel. The determination device 10 estimates the particle P7 as an abnormal region. The determination device 10 determines whether the article A2 is acceptable or not based on the features of the estimated abnormal region.

[0038] In order to accurately determine whether an article captured in an image is acceptable or not, it is preferable to appropriately set a plurality of threshold values.

[0039] Figure 5 This is a flowchart showing a method for adjusting a threshold value of a determination device according to an embodiment.

[0040] First, the determination device 10 obtains a plurality of qualified product images (step S10). The plurality of qualified product images are prepared by the user. The qualified product images are images that the user determines to be images of items of good quality. The determination device 10 sets a plurality of thresholds as initial values ​​(step S11, first processing). At this time, a strict value is set as the threshold. Specifically, in the determination of the pass or fail of an item based on a plurality of thresholds, a plurality of thresholds are set so that an item captured in at least one qualified product image is determined to be unqualified. It is also possible to set a plurality of thresholds so that all items captured in a plurality of qualified product images are determined to be unqualified.

[0041] The determination device 10 uses a plurality of threshold values ​​to determine whether the article captured in the qualified product image is qualified or not (step S12). Step S12 is an example of the second process or the first determination process. Figure 2 The processing of the flowchart shown. In the following, for the sake of convenience, the image of a qualified product in which the captured object is judged to be unqualified is also referred to as an image of a qualified product judged to be unqualified. The image of a qualified product in which the captured object is judged to be qualified is also referred to as an image of a qualified product judged to be qualified. The determination device 10 determines whether there is a qualified product image judged to be unqualified in the determination of the qualified product image (step S13). In the first step S12, since the threshold is strictly set, at least one qualified product image is judged to be unqualified.

[0042] In the case where there is a qualified product image that is judged as unqualified, the determination device 10 relaxes at least a portion of the threshold value (step S14). Step S14 is an example of the third process or relaxation process. By relaxing the threshold value, it is difficult for the items photographed in the qualified product image to be judged as unqualified. Specifically, in the relaxation of the threshold value, one or two selected from the increase of the upper limit and the decrease of the lower limit are performed. When at least a portion of the threshold value is relaxed, the determination device 10 executes step S12 again.

[0043] Steps S12 to S14 are repeated until all the conforming product images are judged as conforming in step S12. If there is no conforming product image judged as unconforming in step S13, the judging device 10 ends the processing. The adjustment of the plurality of threshold values ​​is completed.

[0044] Afterwards, the inspection process is performed using the adjusted multiple threshold values. During the inspection, the inspection image of the object to be inspected is subjected to Figure 2 The process of the flowchart shown in the figure is performed. Thus, the pass or fail of the article in the inspection image is determined. For example, for an article determined to be pass, the inspection is pass. For an article determined to be fail, the inspection is fail.

[0045] Advantages of the embodiment will be described.

[0046] For example, in the past, the threshold was set based on the average value and the dispersion. According to this method, the accuracy of the determination can be improved, and the threshold can be easily set. On the other hand, when this method is used, not all of the prepared qualified product images are necessarily determined to be qualified. Therefore, in actual inspection, it is possible that some qualified products are mistakenly determined to be unqualified.

[0047] In response to the above technical problems, there is a method of using an image of a qualified product to readjust the threshold when a qualified product is mistakenly judged as unqualified. For example, in the readjustment, the image of the qualified product is added to the pre-prepared image of the qualified product, and the average value and dispersion are recalculated. The threshold is set based on the new average value and dispersion. However, even if an image is added to readjust the threshold, the impact on the threshold is small. In particular, the more qualified product images are used in setting the threshold as the inspection continues, the smaller the impact of one image on the threshold. Therefore, when a false detection occurs, it is not actually easy to adjust the threshold again to eliminate the false detection.

[0048] In view of these technical problems, in an embodiment, the determination device 10 repeats determination and relaxation of the threshold value, thereby adjusting the threshold value until each qualified product image is determined to be qualified. According to an embodiment, multiple threshold values ​​are set so that all qualified product images are determined to be qualified. Thus, in actual inspection, the possibility of misjudging a qualified product as unqualified can be reduced.

[0049] In addition, in an embodiment, in a determination based on a plurality of threshold values ​​that are respectively set as initial values, an item captured in at least one of a plurality of qualified product images is determined to be unqualified. That is, the initial value is strictly set so that even if it is a qualified product image, the item captured in the qualified product image is also determined to be unqualified. For this initial value, at least a portion of the thresholds are relaxed until each qualified product image is determined to be qualified. According to an embodiment, it is possible to suppress the threshold from becoming too loose. Thus, in actual inspections, the possibility of misjudging a unqualified product as qualified can be reduced.

[0050] According to the embodiment, a plurality of threshold values ​​can be adjusted more appropriately, and the accuracy of determining whether an article captured in an image is acceptable or not can be improved.

[0051] The processing of the determination device 10 will be described in detail below.

[0052] The initial value for the threshold can be a pre-set fixed value or can be set based on an average value and a dispersion. The average value is calculated by averaging the pixel values ​​at the same coordinates of multiple qualified product images. As the dispersion, the standard deviation, variance or mean deviation of the pixel values ​​at the same coordinates in multiple qualified product images can be used. In order to strictly set the initial value, the dispersion is set smaller. For example, when using the average value μ and the standard deviation σ, typically (μ-3σ) and (μ+3σ) are set as thresholds. In contrast, in an embodiment, (μ-σ) and (μ+σ) are set as thresholds. By using the average value and the dispersion in setting the initial value, the number of repetitions of steps S12 to S14 required to adjust the threshold can be reduced compared to the case where the initial value is fixed.

[0053] In setting the initial value, multiple defective product images may also be used. After setting multiple thresholds as initial values, the determination device 10 determines whether the items photographed in the multiple defective product images are qualified or not. When all defective product images are determined to be unqualified, the determination device 10 accepts the set initial values. When any defective product image is determined to be qualified, the determination device 10 reduces all thresholds by a predetermined amount. That is, the determination device 10 reduces the upper limit of the pixel value by a predetermined amount, or increases the lower limit of the pixel value by a predetermined amount. The determination device 10 may also only reduce the threshold for pixel units that are not determined to be abnormal.

[0054] In step S12, the determination device 10 may exclude the qualified product images that have been determined to be qualified in the past repeated processing from the objects to be determined. Even if the qualified product images are determined to be qualified once, they are also determined to be qualified in the subsequent determination processing. By excluding the qualified product images that are determined to be qualified from the objects, the amount of calculation required for the repetition of steps S12 to S14 can be reduced.

[0055] Figure 6 This is a flowchart showing another adjustment method of the determination device according to the embodiment.

[0056] In step S12, the determination device 10 may determine whether all the prepared qualified product images are qualified or not, or may determine whether only a part of the qualified product images are qualified or not. Figure 6 As shown, after step S11, the determination device 10 intentionally or randomly selects a predetermined number of qualified product images from a plurality of qualified product images (step S12a). The determination device 10 executes step S12 on the selected qualified product images. If there are qualified product images that are determined to be unqualified in step S12, the determination device 10 executes step S14. If it is determined in step S12 that all the selected qualified product images are qualified, the determination device 10 determines whether all the prepared qualified product images are selected (step S12b). In the case where there are qualified product images that have not yet been selected, the determination device 10 executes step S12a again. At this time, the determination device 10 excludes the qualified product images that have been determined to be qualified once from the selected objects.

[0057] If only a portion of the qualified product images are judged as qualified in step S12 once, the amount of calculation required for adjusting the threshold can be reduced. On the other hand, if step S14 is performed based on the judgment results of only a portion of the qualified product images, some thresholds may be relaxed more than necessary.

[0058] As an example, in the initial step S12a, the first qualified product image with relatively few abnormal pixel units is selected. In step S12, the first qualified product image is judged as unqualified. Based on the first qualified product image, step S14 is executed, and a few thresholds are relaxed. In the subsequent step S12b, the second qualified product image with relatively many abnormal pixel units is selected. In step S12, the second qualified product image is judged as unqualified. Based on the second qualified product image, step S14 is executed, and multiple thresholds are relaxed. In this example, after a few thresholds are relaxed, multiple thresholds are further relaxed.

[0059] In contrast, when all qualified product images are selected and the plurality of thresholds are relaxed based on the second qualified product image, the few thresholds may not be relaxed. Therefore, in order to suppress excessive relaxation of the threshold and improve the determination accuracy, it is preferred to determine whether all qualified product images are qualified in step S12 once, and adjust the threshold based on the determination result.

[0060] For example, when relaxing the threshold, the determination device 10 extracts all abnormal pixel units from the qualified product images determined as unqualified in step S12, and relaxes the threshold for these abnormal pixel units. Specifically, when the number of qualified product images determined as unqualified is two or more, the determination device 10 obtains the sum set of abnormal pixel units in these qualified product images. The determination device 10 relaxes the threshold for the abnormal pixel units included in the sum set. According to this method, the threshold can be effectively relaxed, and the amount of calculation required for adjusting the threshold can be reduced.

[0061] When relaxing the threshold, the determination device 10 may also select a portion of qualified product images based on the abnormal area from the qualified product images determined as unqualified in step S12. The determination device 10 relaxes the threshold for the abnormal pixel unit in the selected qualified product image. As an example, the determination device 10 selects the qualified product image with the largest area of ​​the abnormal area. The determination device 10 relaxes the threshold for the abnormal pixel unit in the selected qualified product image. According to this method, the threshold can be suppressed from being excessively relaxed, and the accuracy of qualified or unqualified determination can be improved.

[0062] The pixel units for which the threshold can be relaxed can be limited in advance by the user. In step S14, the determination device 10 relaxes the threshold for the pixel units that are not restricted. It is also possible to set a relaxed limit for at least a portion of the thresholds. For example, a limit on the upper limit of the threshold or a limit on the lower limit of the threshold is set. In step S14, the threshold that reaches the limit is not relaxed. By setting limits on the pixel units or thresholds, it is possible to prevent the determination from becoming too loose for the pixel units that are intended to be strictly determined to determine whether there is an abnormality.

[0063] For example, the size of the relaxed threshold is set by the user in advance. When relaxing the threshold, the determination device 10 adds the user's set value to the upper limit of the pixel value and subtracts the set value from the lower limit of the pixel value. As a result, the range between the lower limit and the upper limit is expanded, and the threshold is relaxed.

[0064] The size of the relaxed threshold value may also be determined based on one or two selected from the pixel value of the corresponding pixel unit and the area of ​​the set of pixel units whose threshold value is relaxed. For example, the larger the difference between the pixel value and the threshold value, the greater the threshold value is relaxed. The larger the area of ​​the set of pixel units whose threshold value is relaxed, the greater the threshold value is relaxed. Thus, the time required to adjust multiple threshold values ​​can be shortened.

[0065] Figure 7 This is a flowchart showing another adjustment method of the determination device according to the embodiment.

[0066] The determination device 10 can also use the defective product image to determine whether the multiple thresholds are appropriate. Figure 7 As shown, the determination device 10 obtains a plurality of images of good products and a plurality of images of bad products (step S10a). The plurality of images of bad products are prepared by the user. The bad product images are images that the user has determined to be images of products of poor quality.

[0067] Then, the determination device 10 executes steps S12 to S14. After step S14, the determination device 10 uses multiple thresholds to determine whether the items photographed in each unqualified image are qualified (step S15). Step S15 is an example of the fourth process or the second determination process. The determination device 10 determines whether the ratio of the number of unqualified product images determined to be qualified to the number of prepared unqualified product images is less than a specified ratio (step S16). The specified ratio can also be set to zero. That is, when even one unqualified product image is determined to be qualified, the ratio becomes above the specified ratio.

[0068] The pass or fail of the article photographed in the defective product image is determined in the same manner as the pass or fail of the article photographed in the qualified product image. That is, the determination device 10 compares the multiple pixel values ​​in the defective product image with the multiple thresholds respectively, and extracts the abnormal pixel units (second abnormal pixel units) that deviate from the thresholds. The determination device 10 infers the abnormal area (second abnormal area) based on the extracted abnormal pixel units. The determination device 10 determines the pass or fail of the article photographed in the defective product image based on the characteristics of the abnormal area.

[0069] When the articles photographed in the plurality of defective product images are judged to be qualified in a predetermined ratio or more, the judging device 10 stops the repeated processing (step S17). The judging device 10 may also notify the user of the termination of the repeated processing. For example, the judging device 10 notifies the user by displaying on the display device 12, sending data to a specific terminal device, etc.

[0070] The fact that a defective product image is judged as qualified indicates that at least part of the threshold is excessively relaxed. If these thresholds are used for actual inspection, a defective product may be mistakenly judged as a qualified product. By terminating repeated processing, useless calculations can be avoided.

[0071] The determination device 10 notifies the user, thereby prompting the user to pay attention. The reason why the threshold is too loose can be that defective product images are mixed with the good product images prepared by the user. By notifying, the user can be prompted to check whether the threshold adjustment method is defective.

[0072] In addition, Figure 7 In the flowchart shown, step S15 may also be performed before step S14. For example, step S15 may also be performed simultaneously with step S12. When step S15 is performed simultaneously with step S12, step S16 may also be performed after steps S12 and S15 and before step S13.

[0073] Figure 8 (a) and Figure 8 (b) is a schematic diagram showing an output example from the determination device according to the embodiment.

[0074] For example, the determination device 10 displays Figure 8 Table T shown in (a) and Figure 8 Graph C shown in (b) of FIG. In Table T, the rows represent the number of images of qualified products (OK) and the number of images of unqualified products (NG) prepared in advance. The columns represent the number of images judged as qualified and the number of images judged as unqualified. In this example, 18 images of qualified products are prepared and 5 images of unqualified products are prepared. In the judgment, 5 images are judged as qualified and 18 images are judged as unqualified. Compared with the actual number of unqualified product images, the number of images judged as unqualified is large, so it can be seen that some thresholds are still strict.

[0075] In Figure C, the horizontal axis represents Figure 5 The number of repetitions of steps S12 to S14 in the flowchart shown. The vertical axis is a value representing the characteristic of the abnormal region. The curve OK represents a first value, which represents the characteristic of the first abnormal region inferred from the qualified product image. The curve NG represents a second value, which represents the second value of the characteristic of the second abnormal region inferred from the unqualified product image. The curve TH represents the threshold value for the first value and the second value. For example, as the first value and the second value, the area of ​​the abnormal region, the aspect ratio of the abnormal region, the first ratio or the second ratio can be used.

[0076] As described above, the determination device 10 repeatedly executes a processing group including determining whether an item (first item) captured in a qualified product image is qualified (first determination processing), determining whether an item (second item) captured in a failed product image is qualified (second determination processing), and relaxing at least a portion of the threshold value when the first item is determined to be failed (relaxation processing). Whenever the determination device 10 executes the processing group, the first value, the second value, and the threshold value are displayed on the display device 12.

[0077] exist Figure 8In the example (b), the value of the vertical axis is the area of ​​the abnormal region. Curve OK represents the area of ​​the largest abnormal region among the abnormal regions estimated using multiple qualified product images. Curve NG represents the area of ​​the smallest abnormal region among the abnormal regions estimated using multiple unqualified product images. Curve TH represents the threshold value for the area of ​​the abnormal region. In order to judge the unqualified product images as unqualified while judging the qualified product images as qualified, it is necessary to adjust multiple thresholds when curve NG exceeds curve TH so that curve OK is lower than curve TH.

[0078] from Figure 8 As shown in (b), the area value of the curve OK decreases as the number of repetitions increases, and the curve TH approaches the curve OK. In addition, the decrease in the curve OK is greater than the decrease in the curve NG. This indicates that the threshold value can be relaxed while the state of judging the defective product image as defective remains unchanged. Figure 8 Table T of (a) represents Figure 8 Information when the thirty-first repetition process is completed in Figure C of (b).

[0079] Figure 8 (a) and Figure 8 The data shown in (b) can also be updated in real time as the number of repetitions increases. For example, the determination device 10 saves the graph C and the table T at each number of repetitions in the storage device 20. Alternatively, the determination device 10 can also display one or two selected from the graph C and the table T on the display device 12. Thus, the user can easily understand to what extent the adjustment of the threshold has progressed and whether the adjustment of the threshold has progressed appropriately.

[0080] Fig. 9 It is a schematic diagram showing the hardware structure.

[0081] For example, the determination device 10 is a computer, and has a read only memory (ROM) 10a, a random access memory (RAM) 10b, a central processing unit (CPU) 10c, and a hard disk drive (HDD) 10d.

[0082] The ROM 10a stores a program for controlling the operation of the computer. The ROM 10a stores a program necessary for causing the computer to realize the above-mentioned processing.

[0083] RAM10b functions as a storage area for expanding the program stored in ROM10a. CPU10c includes a processing circuit. CPU10c reads the control program stored in ROM10a and controls the operation of the computer according to the control program. In addition, CPU10c expands various data obtained by the operation of the computer in RAM10b. HDD10d stores data required for the processing of the determination device 10 and data obtained by the processing. HDD10d can also be used as Figure 1 The storage device 20 shown functions.

[0084] The determination device 10 may include an embedded multimedia card (eMMC), a solid state drive (SSD), a solid state hybrid drive (SSHD), or the like instead of the HDD 10 d.

[0085] The input device 11 includes, for example, at least one selected from a mouse, a keyboard, a microphone (voice input), and a touch panel. The display device 12 includes, for example, at least one selected from a monitor and a projector. A device having the functions of both the input device 11 and the display device 12, such as a touch panel, may also be used.

[0086] According to the determination device, determination system or determination method described above, multiple thresholds can be set more appropriately, and the determination accuracy can be improved. In addition, the same effect can be obtained by using a program for causing a computer to operate as a determination device.

[0087] The processing of the above-mentioned various data can be recorded as a program that can be executed by a computer on a disk (floppy disk and hard disk, etc.), an optical disk (CD-ROM, CD-R, CD-RW, DVD-ROM, DVD±R, DVD±RW, etc.), a semiconductor memory or other recording media.

[0088] For example, the information recorded in the recording medium can be read by a computer (or embedded system). In the recording medium, the recording format (storage format) is arbitrary. For example, the computer reads out a program from the recording medium and causes the CPU to execute instructions recorded in the program based on the program. In the computer, the acquisition (or reading) of the program can also be performed through a network.

[0089] Several embodiments of the present invention are illustrated above, but these embodiments are presented as examples and are not intended to limit the scope of the invention. These new embodiments can be implemented in various other ways, and various omissions, substitutions, changes, etc. can be made without departing from the scope of the main purpose of the invention. These embodiments and their modifications are included in the scope and main purpose of the invention, and are included in the invention described in the claims and the scope of their equivalents. In addition, the above-mentioned embodiments can be implemented in combination with each other.

Claims

1. A determination device for determining whether an object captured in an image containing a plurality of pixel units is acceptable or not based on respective comparisons between pixel values ​​of a plurality of pixel units and a plurality of threshold values, the determination device performing the following processing: A first process is to set the plurality of thresholds to initial values ​​respectively; A second process of determining whether an article captured in at least a portion of the plurality of qualified product images is qualified or not based on the plurality of threshold values; as well as The third processing is to relax at least a part of the plurality of threshold values ​​when the article photographed in at least one of the plurality of images of qualified products is determined to be unqualified. The determination device adjusts the plurality of threshold values ​​by repeatedly performing the second process and the third process until the article in each of the plurality of conforming article images is determined to be a conforming article in the second process.

2. The determination device according to claim 1, wherein: In the determination based on the plurality of threshold values ​​respectively set as the initial values, the article captured in at least one of the plurality of conforming product images is determined to be defective.

3. The determination device according to claim 1 or 2, wherein: In the second processing, for the at least a portion of the plurality of qualified product images, one or more abnormal pixel units that are out of the threshold value are extracted from the plurality of pixel units, respectively. In the third process, at least a part of the one or more threshold values ​​for the one or more abnormal pixel units is relaxed.

4. The determination device according to any one of claims 1 to 3, wherein: In the first process, an average value and a dispersion of the pixel values ​​among the plurality of conforming product images are calculated for each pixel unit, and the initial value is set based on the average value and the dispersion.

5. The determination device according to any one of claims 1 to 4, wherein: In the second processing, the following processing is performed on at least a portion of the plurality of qualified product images: extracting abnormal pixel units that deviate from the threshold value from the plurality of pixel units respectively; estimating an abnormal area based on the abnormal pixel unit; and The qualification of the article is determined based on the characteristics of the abnormal area.

6. The determination device according to claim 5, wherein: The following processing is performed in the third process: Selecting the qualified product image with the largest abnormal region; and The threshold value for the abnormal pixel unit in the one conforming product image is relaxed.

7. The determination device according to claim 5 or 6, wherein: The feature of the abnormal region is at least one selected from an area of ​​the abnormal region, a shape of the abnormal region, and a distribution of the pixel values ​​in the abnormal region.

8. The determination device according to any one of claims 1 to 7, wherein: In the repetition of the second process and the third process, the second process is not executed for the conforming product image in which the article determined to be conforming is captured.

9. The determination device according to any one of claims 1 to 8, wherein: The determination device further performs a fourth process of determining whether the articles captured in the plurality of defective article images are qualified or not based on the plurality of threshold values. The determination device repeats the second process, the third process, and the fourth process, If it is determined in the fourth process that the articles captured in defective product images having a predetermined ratio or more of the plurality of defective product images are acceptable, the repeated process is stopped.

10. The determination device according to claim 9, wherein: In the first process, the initial value for each of the plurality of threshold values ​​is set so that each of the articles captured in the plurality of defective article images is determined to be defective.

11. The determination device according to any one of claims 1 to 10, wherein: The determination device further executes an inspection process for determining whether an article captured in the inspection image is acceptable or not using the adjusted plurality of threshold values.

12. A determination device that compares each pixel value with a threshold value to determine whether an object captured in an image is acceptable or not. After setting the multiple thresholds so that the items photographed in the qualified product image are judged as unqualified, the judgment device repeats the judgment on the qualified product image and the relaxation of at least part of the multiple thresholds so that the items photographed in the qualified product image are judged as qualified products.

13. A determination device for determining whether an object captured in an image including a plurality of pixel units is acceptable or not based on comparisons between pixel values ​​of a plurality of pixel units and a plurality of threshold values, The determination device repeatedly executes a processing group including a first determination process, a second determination process, and a relaxation process after setting the plurality of thresholds to initial values, In the first determination process, for a qualified product image of a first article, the plurality of thresholds are used to estimate a first abnormal region, and the pass or fail of the first article is determined based on the features of the first abnormal region. In the second determination process, for the defective product image of the second article, the plurality of thresholds are used to estimate the second abnormal area, and the pass / fail of the second article is determined based on the features of the second abnormal area. In the relaxation process, when the first article is determined to be unqualified, at least a part of the plurality of thresholds is relaxed. The determination device causes a display device to display a first value indicating a feature of the first abnormal region, a second value indicating a feature of the second abnormal region, and threshold values ​​for the first value and the second value each time the processing group is executed.

14. The determination device according to claim 13, wherein: In the first determination process, for each of the plurality of qualified product images, a first abnormal pixel unit that deviates from the threshold is extracted from a plurality of pixel units, and the first abnormal region is estimated based on the first abnormal pixel unit. In the second determination process, for each of the plurality of defective product images, a second abnormal pixel unit that deviates from the threshold is extracted from a plurality of pixel units, and the second abnormal region is estimated based on the second abnormal pixel unit. The determination device causes the display device to display the area of ​​the largest first abnormal region among the plurality of first abnormal regions as the first value, and to display the area of ​​the smallest second abnormal region among the plurality of second abnormal regions as the second value.

15. A determination system comprising: The determination device according to any one of claims 1 to 14; and Camera device.

16. A determination method, wherein a computer determines whether an object captured in an image including a plurality of pixel units is acceptable or not based on respective comparisons between pixel values ​​of a plurality of pixel units and a plurality of threshold values, The determination method enables the computer to execute: A first process is to set the plurality of thresholds to initial values ​​respectively; A second process of determining whether an item captured in at least a portion of the plurality of qualified product images is qualified or not based on the plurality of threshold values; as well as The third process is to relax at least a part of the plurality of threshold values ​​when the article photographed in at least one of the plurality of qualified product images is determined to be unqualified. The plurality of threshold values ​​are adjusted by causing the computer to repeatedly perform the second process and the third process until the articles in each of the plurality of conforming article images are determined to be conforming articles in the second process.

17. A program for causing a computer to determine whether an article captured in an image including a plurality of pixel units is acceptable or not based on comparisons between pixel values ​​of the plurality of pixel units and a plurality of threshold values, The program causes the computer to execute: A first process is to set the plurality of thresholds to initial values ​​respectively; A second process of determining whether an item captured in at least a portion of the plurality of qualified product images is qualified or not based on the plurality of threshold values; as well as The third process is to relax at least a part of the plurality of threshold values ​​when the article photographed in at least one of the plurality of qualified product images is determined to be unqualified. The plurality of threshold values ​​are adjusted by causing the computer to repeatedly perform the second process and the third process until the articles in each of the plurality of conforming article images are determined to be conforming articles in the second process.

18. A storage medium storing the program according to claim 17.