Image inspection method and program

The image inspection method extracts and converts curved parts into rectangular images using polar expansion, addressing inefficiencies in conventional methods by enhancing precision and reducing processing time for complex-shaped products.

JP2024158740AActive Publication Date: 2024-11-08ANGLETRY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2023074229
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-04-28
Publication Date
2024-11-08
Estimated Expiration
2043-04-28

AI Technical Summary

Technical Problem

Conventional image inspection methods struggle with inefficient processing times and reduced accuracy when inspecting products with complex shapes, as they often include areas outside the region of interest, particularly when focusing on curved parts like ridges or corners, due to the use of rectangular images.

Method used

An image inspection method that extracts specific, curved parts from an image and converts them into a rectangular format using polar expansion techniques, aligning pixels perpendicular to the tangent of the observation area to enhance precision and efficiency.

Benefits of technology

Enables high-precision image processing by focusing only on the relevant areas of interest, reducing processing time and improving inspection accuracy for products with complex shapes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024158740000001_ABST
    Figure 2024158740000001_ABST
Patent Text Reader

Abstract

To provide an image inspection method that extracts only a specific part from an image that includes any curved part and converts it into a rectangular image.SOLUTION: An image inspection method that uses an image obtained by photographing an object to be inspected to determine the quality of the object to be inspected includes: a first step of setting a part to be observed at a desired part of the object to be inspected in the image; and a second step of acquiring, from each of consecutive pixels that make up the part to be observed, the pixel value of a straight line or a rectangle of a predetermined length extending in a predetermined direction. Preferably, the method further includes a third step of aligning acquired pixel values into a new rectangular image.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to an image inspection method and a program for determining the quality of an inspection object based on an image obtained by photographing the inspection object. [Background technology]

[0002] Image inspection of industrial products is aimed at detecting defects such as scratches and stains, and generally involves finding differences between images of the actual product and images of normal products. In recent years, a method has been widely used in which, for example, a normal image and a plurality of defective images are trained using deep learning or the like to determine the presence or absence of defects in an image of an object to be inspected. Machine learning methods such as the MT method (see Non-Patent Document 1) are also known, which train only information from a reference image to detect the presence or absence of defects in an object image. Furthermore, a classical method is also used in which a determination is made based on the magnitude of the difference between a binarized image and a normal image. In this specification, the collective term for these algorithms for determining the presence or absence of defects is referred to as an "inspection algorithm."

[0003] There are a variety of products that are subject to image inspection. For example, image inspection of die-cast products for automobile engines aims to automate visual inspection by humans, and requires inspection accuracy equal to or greater than that of visual inspection. Die-cast products are manufactured by pouring molten material such as aluminum into a mold and removing it from the mold after it has cooled. Products are visually inspected for the presence or absence of burrs, chips, or ripples, and the location of the defect is often determined by the type of defect. For example, burrs occur at the mold joints on the periphery of a die-cast product, while chips frequently occur at the corners and ridges of a die-cast product, so inspectors focus on these locations. In this way, inspectors generally focus on different locations and judgement criteria depending on the type of defect. Since the purpose of image inspection is to automate visual inspection by inspectors, it is desirable to set the optimal image location for each defect when performing image inspection and pass it to the inspection algorithm.

[0004] [Non-Patent Document 1] Masakazu Teshima et al., "Study on Visual Inspection Technology Using Mahalanobis-Taguchi System Method", Quality Engineering, Japan Society for Quality Engineering, October 1997, Vol. 5, No. 5, pp. 38-45 Summary of the Invention [Problem to be solved by the invention]

[0005] As described above, the location that should be focused on during inspection varies depending on the type of defect in the product. In particular, when the object to be inspected has a complex shape, it is desirable to focus the inspection on the location of interest (e.g., ridges, outer periphery) in order to perform the inspection efficiently. However, in conventional image inspection, the image taken for the inspection is rectangular, and therefore there is a disadvantage that the inspection image also includes locations other than the location of interest (e.g., when inspecting for chips in a ridge, the image also includes locations other than the ridge and the stand on which the object to be photographed is placed).

[0006] In addition, most existing inspection algorithms target rectangular images, so when the area of ​​interest includes a curved portion or the like, the inspection algorithm is applied using such a rectangular image as is, which means that inspection processing is performed on areas that include areas other than the target area, resulting in increased processing time and reduced inspection accuracy.

[0007] The present invention was developed under these circumstances, and aims to provide an image inspection method and program for extracting only specific areas from an image containing any curved portion and converting it into a rectangular image. [Means for solving the problem]

[0008] The images received by an inspection algorithm are typically a collection of pixels arranged in a grid of rows and columns, with the overall shape being a rectangle. The inventors came up with the idea that even if the area of ​​interest for inspection includes an arbitrary curved shape, if it were possible to extract only the part that needs to be observed along the curve and convert it into a rectangular image, it would be possible to perform image processing with high accuracy in a short time using existing inspection algorithms. A method called polar expansion is known as a technique for extracting non-rectangular parts from an image and transforming them into a rectangle. Polar expansion is a method in which the center and diameter of a circle identified from a target image are found, a number of straight lines are defined that connect the center of the circle with the outer periphery (circumference) in a radial manner, and the pixels on the straight lines are aligned to transform the image into a rectangle. In polar expansion, the center of the circle is greatly enlarged, but the outer periphery becomes a rectangular image, making it easy to apply inspection algorithms in a short time and with high accuracy. However, in the polar expansion, in image inspection of die-cast products and the like, it is not possible to extract specific locations (for example, outer periphery, corners, or ridges) where defects are likely to occur as rectangular images. As described in detail below, the present inventor proposes a method and a program for extracting only specific portions from an image including any curved portion and converting the portion into a rectangular image.

[0009] The image inspection method described in claim 1 for determining the quality of an object to be inspected using an image obtained by photographing the object to be inspected is characterized by comprising a first step of setting a portion requiring observation at a desired location of the object to be inspected in the image, and a second step of acquiring pixel values ​​of a straight line or rectangle of a predetermined length extending in a predetermined direction from each of consecutive pixels that constitute the portion requiring observation.

[0010] The image inspection method described in claim 2 is the image inspection method of claim 1, characterized in that the acquired pixel value is set in a direction perpendicular to the tangent of the part to be observed.

[0011] The image inspection method described in claim 3 is the image inspection method of claim 2, characterized in that the acquired pixel value is set perpendicular to the tangent to a virtual curve drawn by the moving average of the pixels.

[0012] The image inspection method described in claim 4 is the image inspection method of claim 2, characterized in that the acquired pixel value is set in a direction perpendicular to a straight line connecting pixels at a predetermined interval among the pixels.

[0013] The image inspection method described in claim 5 is characterized in that, in the image inspection method of claim 1, the acquired pixel value is set by translating the part to be observed a predetermined distance and connecting corresponding pixels before and after the translation.

[0014] The image inspection method described in claim 6 is characterized in that, in the image inspection method of any one of claims 1 to 5, it further comprises a third step of aligning the acquired pixel values ​​to a new rectangular image.

[0015] The image inspection program described in claim 7 for determining the quality of an object to be inspected using an image obtained by photographing the object to be inspected is characterized in that it causes a computer to execute the steps of setting a portion requiring observation at a desired location of the object to be inspected in the image and storing the portion in a memory device, and obtaining linear or rectangular pixel values ​​of a predetermined length extending in a predetermined direction from each of the consecutive pixels that make up the portion requiring observation, and storing the pixel values ​​in the memory device.

[0016] The image inspection program described in claim 8 is characterized in that, in the image inspection program of claim 7, the acquired pixel value is set in a direction perpendicular to the tangent of the part to be observed.

[0017] The image inspection program described in claim 9 is characterized in that, in the image inspection program of claim 8, the acquired pixel value is set perpendicular to the tangent to a virtual curve drawn by the moving average of the pixels.

[0018] The image inspection program described in claim 10 is characterized in that, in the image inspection program of claim 8, the acquired pixel value is set in a direction perpendicular to a straight line connecting pixels at a predetermined interval among the pixels.

[0019] The image inspection program described in claim 11 is characterized in that, in the image inspection program of claim 7, the acquired pixel value is set by translating the part to be observed a predetermined distance and connecting corresponding pixels before and after the translation.

[0020] The image inspection program described in claim 12 is characterized in that, in the image inspection program of any one of claims 7 to 11, the computer is further caused to execute a step of aligning the acquired pixel values ​​to a new rectangular image. Effect of the Invention

[0021] According to the image inspection method and program of the present invention, it is possible to extract specific areas from an image containing any curved portion and convert them into a rectangular image, making it possible to perform image processing with high accuracy in a short time using existing inspection algorithms. [Brief description of the drawings]

[0022] [Figure 1] FIG. 1 is a flow diagram of an image inspection method according to an embodiment of the present invention. [Diagram 2] FIG. 2(a) is a diagram showing a photographed image of a product, and FIG. 2(b) is a diagram showing various defects that may occur in the product. [Diagram 3] This is a diagram showing parts of the product that require observation. [Figure 4] FIG. 4(a) is a diagram showing the parts of the product that need to be observed, and FIG. 4(b) is a diagram showing the parts that need to be observed as pixels. [Diagram 5]Figure 5(a) is an enlarged view of area 5a in Figure 4(b), Figure 5(b) is a table showing the coordinate values ​​of pixel , Figure 5(c) is a diagram showing pixel <D>, and Figure 5(d) is a diagram showing line <E>. [Figure 6] FIG. 6(a) is a diagram showing the straight line <へ>, FIG. 6(b) is a diagram showing the straight line <へ> in pixels, and FIG. 6(c) is a diagram showing the aligned pixels that include the straight line <へ>. [Figure 7] FIG. 7(a) shows the straight line , FIG. 7(b) shows the straight line in pixels, and FIG. 7(c) shows the pixels aligned to include the straight line . [Figure 8] FIG. 13 shows the results of performing the second step on all pixels in the observation area. [Figure 9] FIG. 9(a) is a diagram in which pixels representing a line are arranged in a rectangle, and FIG. 9(b) is a diagram in which FIG. 9(a) is shown as pixels. [Figure 10] 10A shows the results of image inspection, with FIG. 10A showing a case where there is no chipping on the ridgeline, and FIG. 10B showing a case where there is a chipping on the ridgeline. [Figure 11] FIG. 11(a) is a diagram showing an image taken from directly above the product, and FIG. 11(b) is a diagram showing the results of applying the image inspection method of the present invention to FIG. 11(a). [Figure 12] FIG. 13 is a diagram showing another method for determining a tangent line. [Figure 13] FIG. 13(a) is a diagram showing yet another method for obtaining a straight line of a predetermined length, and FIG. 13(b) is a diagram for explaining a case in which the method of FIG. 13(a) cannot be applied. [Figure 14] 1A to 1C are various diagrams illustrating results obtained by the image inspection method of the present invention. [Figure 15] FIG. 13 is a diagram showing a technique for setting rectangles instead of vertical lines in the second step. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0023] Next, an image inspection method according to a preferred embodiment of the present invention will be described with reference to the drawings, taking an image inspection of a die-cast product (hereinafter referred to as "product") as an example. Fig. 1 is a flow chart of the image inspection method according to the preferred embodiment of the present invention.

[0024] FIG. 2(a) is a diagram showing a photographed image of product 10. The background of the photographed image is usually black, but in this example, because there is lighting above product 10, the background is displayed in dark gray, the top surface of product 10 is displayed in white, and the side of product 10 is displayed in light gray. When manufacturing the product, a male mold and a female mold (neither shown) that are clamped together under high pressure are prepared at the top and bottom, respectively. Molten material is poured into the space between the male mold and the female mold, and after the material has cooled, the hardened material is removed from the mold to obtain product 10. Therefore, the mold mating portion 10a is slightly visible.

[0025] FIG. 2(b) shows burrs 12, chips 14 on the ridges 10b, and flow lines 16 on the flat surfaces that occur during the manufacture of the product 10. Of these defects, burrs 12 tend to occur at the mating portion 10a when the clamping pressure between the male and female dies is insufficient or when the male and / or female dies are thermally deformed. Furthermore, chips 14 tend to occur at the ridges 10b and corners 10c of the product 10, and occur when the injection pressure of the molten material (hereinafter referred to as "molten metal") being poured is insufficient. Furthermore, flow lines 16 are defects that form unevenness in areas that should be flat, and tend to occur in areas where the flow of molten metal stagnates (for example, near the gate where molten metal flows into the mold, or where molten metal poured into the mold from multiple gates join).

[0026] 2(a) is obtained, and the ridge line 10b visible in the foreground is inspected for the presence or absence of chips 14. First, we will focus on only the area near the ridge line 10b in the image (the area enclosed by the dashed line in FIG. 3), and explain the procedure for making this area into a rectangular image.

[0027] (First Step) As a first step, as shown in Fig. 4(a), the technician sets a required observation portion A by using straight lines and / or curves near the ridgeline 10b that he or she thinks should be inspected. The setting method may be any method, such as directly drawing on the image with a mouse or a touch pen.

[0028] Figure 4(b) shows the part requiring observation A that has been set in this way. Part requiring observation A is a collection of continuous pixels, and in this example has a downwardly convex curved shape overall. Consider Cartesian coordinates with the upper left corner of part requiring observation A as the origin. This takes into consideration the fact that in image data, the upper left corner is generally the origin, with the rightward direction being the positive X-axis and the downward direction being the positive Y-axis.

[0029] For the purposes of the following description of the drawings, the following symbols are defined. Pixel number: i (in this example, i = 0 to 63; because there are two pixels vertically at X = 62) Total number of pixels: N (in this example, N=64) Pixel coordinates: (X i ,Y i ) Moving average parameter: p

[0030] The moving average parameter p is a parameter for calculating new coordinate values, which will be described later, and the moving average for a pixel number i of interest is given by the following equation. X´=(X i-p +X i-p+1 +···+X i +X i+1 +···+X i+p ) / (2p+1) Y´=(Y i-p +Y i-p+1 +···+Y i +Y i+1 +···+Y i+p ) / (2p+1) That is, for pixel number i of interest on observation required portion A, the average coordinate of p×2 pixels on both sides of the pixel and pixel number i itself is calculated.

[0031] (Second step) The second step enclosed by the dashed line in FIG. 1 will now be described. FIG. 5(a) shows an enlarged view of the area 5a indicated by the dashed line in FIG. 4(b). First, focus on pixel . The coordinates of pixel are (31, 21). If the moving average parameter p is set to 2, the coordinates including two adjacent pixels are as shown in FIG. 5(b). That is, the average coordinate value of pixel is (31, 20.6), and its position is indicated by a circle <ii> in FIG. 5(a).

[0032] Next, we focus on pixel <C>, which is located to the right of pixel . The coordinates of pixel <C> are (32,21). In the same way as for pixel , we find the average coordinate value of pixel <C>, (32,20.8), and show its position in Figure 5(c) as a circle <D>. Then, we set a line <E> connecting the center of and the center of <D> (Figure 5(d)). Line <E> can be considered as the tangent to the observation-required part A in pixel . Note that we connected the centers of the average coordinate values ​​of the adjacent pixels ( and <D>) rather than the centers of the adjacent pixels ( and <C>) in order to find a tangent that is as natural as possible.

[0033] Next, as shown in FIG. 6(a), a straight line <to> of length L is set, extending from the center of pixel in a direction almost perpendicular to the straight line <ho>. FIG. 6(b) shows the straight line <to> in pixels. In the example shown in this figure, the straight line <to> is a set of nine pixels including pixel (FIG. 6(b)). Note that in the example shown in FIG. 6(a), the straight line <to> is set below pixel (diagonally downward), but the setting direction of the straight line <to> is the direction in which a rectangular image is to be obtained. That is, in this example, the inspection target is the ridgeline portion 10b of the product 10, and a rectangular image of the portion located below the observation-required portion A in FIG. 4(b) is to be obtained, so the straight line <to> is set below pixel , not above it.

[0034] For pixel <Ha>, located to the right of pixel , a line <H> and a line <Ri> of length L extending almost perpendicular to the line <H> are set in the same manner as for pixel when determining the line <He> for pixel (Fig. 7(a)). More specifically, new coordinates are determined from the average coordinate value of pixel <Ha> and shown as a circle <D>. Next, new coordinates are determined from the average coordinate value of pixel <Ju>, located to the right of pixel <Ha> and shown as a circle <To>. Then, a line <H> connecting the centers of <D> and <To>, and a line <Ri> of length L extending from the center of pixel <Ha> in a direction almost perpendicular to the line <H> are set, just like the line <He>. The line <Ri> is a set that includes nine pixels including pixel <Ha> (Fig. 7(b)).

[0035] The above-mentioned process performed on pixels and <C> is performed on all pixels in the observation required portion A. In this manner, the luminance information (hereinafter referred to as "pixel value") of the pixels in the observation required portion A is obtained. The results are shown in Figure 8. In Figure 8, only the obtained straight line of length L is displayed. Note that for p=2 pixels located at both ends of the observation required portion A, the straight line of length L has not been obtained because it is not possible to calculate the moving average coordinates.

[0036] (Third Step) Next, in the third step, the pixels including the straight line of length L are aligned into a rectangle. Figure 6(c) is a diagram showing the aligned pixels including the straight line <へ> of length L (here, 9 pixels) obtained for pixel <イ>, and Figure 7(c) is a diagram showing the aligned pixels including the straight line <リ> of length L (similarly, 9 pixels) obtained for pixel <ハ>. Here, "align" means rearrangement of pixels in a row. In this way, the diagonal straight lines obtained for pixel <イ> and pixel <ハ> can be rearranged into a vertical row of pixels as <ル> and <ヲ>, respectively. When <ル> and <ヲ> are aligned, an image with a horizontal x vertical pixel count of 2 x 9 is obtained.

[0037] Fig. 9(a) shows the state where all the straight lines of length L are aligned, and Fig. 9(b) shows these as pixels. The part A to be observed is depicted using N pixels, and in this example, the moving average parameter p=2, resulting in image data of length L of (N-4) lines in the horizontal direction.

[0038] Through the above process, the area indicated by the dashed line in Fig. 3 has been converted into a rectangular image. For example, if the edge line 10b in Fig. 2 is normal, the resulting image will be a rectangular image as shown in Fig. 10(a), but if there is a chip 14 in the edge line 10b in Fig. 2, the resulting image will be an image as shown in Fig. 10(b).

[0039] Figure 11(a) is a diagram showing an image taken from directly above the product 10 to inspect for the presence or absence of burrs 12 on the outer periphery of the product 10. As in the case of inspecting for the presence or absence of chips 14 described above, by setting the areas requiring observation where the engineer in charge thinks they should be inspected and converting them into a rectangular image, if burrs 12 are present, an image like that shown in Figure 11(b) can be obtained.

[0040] Similarly, by converting the image into a rectangular image, the presence or absence of wrinkles 16 in the product 10 can be quickly and easily inspected for defects.

[0041] In the above embodiment, moving average coordinates obtained from the area to be observed A are used to obtain a straight line of a specified length that is approximately perpendicular to the tangent to the area to be observed A, but a straight line of a specified length may also be obtained using any other appropriate method.

[0042] For example, a straight line <H'> can be obtained by connecting the centers of p (here, two) pixels on either side of the pixel of interest, and a straight line extending approximately perpendicular to the straight line <H'> can be set as a straight line of a predetermined length (see Figure 12).

[0043] Also, for example, the set part to need observation may be translated a prescribed distance and a straight line of a prescribed length may be created by connecting corresponding pixels of the original part to need observation and the part to need observation after translation (Fig. 13(a)). This method is effective when the curvature of the part to need observation is small. It cannot be applied when the curvature of the part to need observation is large and the angle between both ends of the part to need observation is 180 degrees or more (Fig. 13(b)).

[0044] Fig. 14 shows various diagrams illustrating the results obtained by the image inspection method of the present invention. That is, Fig. 14(a) shows a case where a vertical line is drawn on the outside of a downward convex curve, Fig. 14(b) shows a case where multiple vertical lines can be drawn on an arbitrary curve and pixel values ​​on the vertical lines can be obtained, and Fig. 14(c) and Fig. 14(d) show cases where vertical lines are drawn on the inside and outside, respectively, of a diamond-shaped contour.

[0045] In the above embodiment, the method of obtaining a straight line of a predetermined length extending in a direction substantially perpendicular to the tangent of the observation-required portion A in the second step has been described, but a method of obtaining a rectangle may be used instead of obtaining such a straight line. In the example shown in Fig. 15, a rectangle of 5 pixels by length L is drawn, overlapping by one pixel.

[0046] The image inspection method of the present invention may be carried out using only steps 1 and 2, without using the third step of aligning pixels. Most existing inspection algorithms are configured to perform inspection on rectangular images, and in such cases, the third step is useful, but when using an inspection algorithm that can perform inspection without making the image rectangular, there is little need to perform the third step.

[0047] When applying the image inspection method of the present invention, positional deviation may occur in the captured normal image and the image of the inspection object, and in such a case, it is advisable to correct the positional deviation using a known method, such as a method of setting a mark as a reference point for positional correction in advance on the inspection object, or a method of calculating the correlation of brightness between images and correcting the position so as to maximize the correlation.

[0048] (Image Inspection Program) Next, a program for causing a computer to execute the above steps (steps 1 to 3) will be described. The computer on which this program is executed may be a general type having a CPU (Central Processing Unit), a memory, a storage device such as a hard disk, an input device such as a keyboard, a mouse, a touch pen, a display device, and an output device (none of which are shown), all connected together by a bus, or may be a microchip type processing device.

[0049] First, the portion to be observed input by the input device is stored in memory. Next, the coordinate average value of two adjacent pixels (e.g., pixels and <C> in FIG. 5(c)) among the consecutive pixels constituting the portion to be observed stored in memory is calculated by the CPU and stored in memory. A straight line connecting the centers of the coordinate average values ​​thus calculated (e.g., line <E> in FIG. 5(c)) is set and stored in memory. Next, a straight line <F> of length L extending from the center of pixel in a direction almost perpendicular to line <E> is set and stored in memory.

[0050] The above process is repeated for all the consecutive pixels that make up the portion to be observed, and the pixel values ​​of the portion to be observed are obtained. The obtained straight line of length L is stored in memory.

[0051] All the pixels representing the line of length L obtained in this way are aligned into a rectangle and stored in memory. Finally, the obtained data is input to the inspection algorithm from an output device or the like.

[0052] In the above embodiment, the coordinate average value is used to obtain a straight line of length L extending in a substantially vertical direction, but as in the image inspection method, pixels at a preset interval may be used, or a method of translating the part to be observed by a predetermined distance may be used. Also, if unnecessary, the step of arranging pixels into a rectangle may not be used.

[0053] In the above example, the data is stored in a memory. However, if the amount of data is large, the data is stored in a large-capacity storage device such as a hard disk.

[0054] The present invention is not limited to the above-described embodiments of the invention, and various modifications are possible within the scope of the invention described in the claims, and it goes without saying that these modifications are also included within the scope of the present invention.

[0055] For example, the above embodiment has been described in relation to image inspection of die-cast products, but the present invention can be applied to any inspection that requires visual inspection, such as inspection of semiconductor patterns. [Explanation of symbols]

[0056] 10 Products 10a Mold fitting part 10b Ridgeline 10c Corner 12. Bali 14 Chipped 16 Wrinkles A. Areas requiring observation

Claims

1. An image inspection method for determining whether an object to be inspected is good or bad using an image obtained by photographing the object to be inspected, comprising: A first step of setting a required observation portion at a desired location of the inspection object in the image; a second step of acquiring pixel values ​​of a line or a rectangle of a predetermined length extending in a predetermined direction from each of the consecutive pixels constituting the observation target portion; An image inspection method comprising:

2. 2. The image inspection method according to claim 1, wherein the acquired pixel values ​​are set in a direction perpendicular to a tangent line of the portion to be observed.

3. 3. The image inspection method according to claim 2, wherein the acquired pixel value is set in a direction perpendicular to a tangent to a virtual curve drawn by a moving average of the pixels.

4. 3. The image inspection method according to claim 2, wherein the acquired pixel value is set in a direction perpendicular to a straight line connecting pixels at a preset interval among the pixels.

5. 2. The image inspection method according to claim 1, wherein the acquired pixel value is set by translating the portion to be observed by a predetermined distance and connecting corresponding pixels before and after the translation.

6. 6. The image inspection method according to claim 1, further comprising a third step of aligning the acquired pixel values ​​to a new rectangular image.

7. An image inspection program for determining whether an object to be inspected is good or bad using an image obtained by photographing the object to be inspected, A step of setting a required observation portion at a desired location of the inspection object in the image and storing the portion in a storage device; obtaining pixel values ​​of a line or a rectangle of a predetermined length extending in a predetermined direction from each of the consecutive pixels constituting the observation portion, and storing the pixel values ​​in a storage device; An image inspection program for running on a computer.

8. 8. The image inspection program according to claim 7, wherein the acquired pixel value is set in a direction perpendicular to a tangent to the portion to be observed.

9. 9. The image inspection program according to claim 8, wherein the acquired pixel value is set in a direction perpendicular to a tangent to a virtual curve drawn by a moving average of the pixels.

10. 9. The image inspection program according to claim 8, wherein the acquired pixel value is set in a direction perpendicular to a straight line connecting pixels at a preset interval among the pixels.

11. The image inspection program according to claim 7, wherein the acquired pixel value is set by translating the portion to be observed by a predetermined distance and connecting corresponding pixels before and after the translation.

12. 12. The image inspection program according to claim 7, further comprising a step of aligning the acquired pixel values ​​to a new rectangular image.