Casting defect detection method and casting defect detection device
The method converts X-ray image pixels to colors based on brightness gradient angles, creating distinguishable patterns for precise casting defect detection, overcoming conventional detection limitations.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- TOYOTA PRODN ENG CORP
- Filing Date
- 2025-01-16
- Publication Date
- 2026-07-29
AI Technical Summary
Conventional X-ray image analysis methods struggle to accurately detect casting defects due to brightness similarities with the surrounding area or surface texture, leading to missed detections.
A method and apparatus that utilize X-ray images by calculating brightness gradient angles and converting pixels to colors based on these angles, generating a detection image with distinguishable patterns for casting defects, enabling precise detection through color and pattern recognition.
Highly accurate detection of casting defects by distinguishing them from surrounding areas and surface variations, enhancing precision in defect identification.
Smart Images

Figure 2026122845000001_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to a method and apparatus for detecting casting defects using X-ray images of castings.
Background Art
[0002] Conventionally, techniques for detecting casting defects generated during casting using X-ray images of castings are known. When a casting produced by pouring metal or resin into a mold has casting defects such as cavities or bubbles, the casting defects appear brighter than the surrounding area on an X-ray image obtained by transmitting X-rays and imaging. By utilizing this contrast, portions with high brightness on the X-ray image of the casting can be detected as casting defects. For example, Patent Document 1 discloses a technique for detecting casting defects based on the luminance difference by comparing an X-ray image of a casting with a master image of a component without casting defects.
[0003] If a threshold value is set based on the luminance difference between a casting defect appearing in an X-ray image of a casting and its surrounding area, portions with luminance higher than the threshold value can be detected as casting defects. Even when an area with a different luminance from other areas is included in the X-ray image due to the shape of the casting, by performing an adaptive threshold processing for setting a local threshold value corresponding to the area, portions with luminance higher than the set threshold value can be detected as casting defects.
Prior Art Documents
Patent Documents
[0004]
Patent Document 1
Summary of the Invention
Problems to be Solved by the Invention
[0005] However, even when applying the above-mentioned conventional techniques, there are cases where casting defects cannot be detected. For example, if areas with high brightness similar to the casting defects appear on the X-ray image due to the shape of the region containing the casting defect or the surface texture, it becomes difficult to detect the casting defect based on the brightness difference between the casting defect and the surrounding area.
[0006] This disclosure has been made in view of the problems of the prior art described above, and one of its purposes is to provide a method and apparatus for detecting casting defects that can detect casting defects with high precision using X-ray images of castings. [Means for solving the problem]
[0007] The method for detecting casting defects according to this disclosure is a method for detecting casting defects using an X-ray image of a casting, and includes: an acquisition step of acquiring an X-ray image of a casting; a calculation step of calculating a brightness gradient angle indicating the direction in which brightness changes for each pixel of the X-ray image; a generation step of generating a detection image in which each pixel of the X-ray image is colored with a color corresponding to the brightness gradient angle based on coloring information that associates the brightness gradient angle with a plurality of different colors; and a detection step of searching the detection image for a feature region consisting of the color and pattern obtained when each pixel forming a casting defect on the X-ray image is colored based on the coloring information, and detecting the feature region as a casting defect included in the X-ray image.
[0008] In the above configuration, the color information may be set such that when a casting defect that appears in a substantially circular shape with brightness changing radially from the center on the X-ray image and the surrounding area of the casting defect are colored, the characteristic area corresponding to the casting defect shows a color and pattern that is distinguishable from the surrounding area of the casting defect.
[0009] In the above configuration, the image obtained by coloring the casting defects based on the color information may be an image in which the color of the pixel corresponding to the radius of the substantially circular shape differs depending on the angle viewed from the center of the substantially circular shape.
[0010] In the above configuration, the color of the pixel corresponding to the radius of the approximately circular shape may change in a gradient manner depending on the angle viewed from the center of the approximately circular shape.
[0011] In the above configuration, the image obtained by coloring the casting defects based on the color information may be an image in which the angle viewed from the center of the substantially circular shape is divided into multiple angular ranges, and adjacent angular ranges have different colors.
[0012] The casting defect detection device according to this disclosure is a casting defect detection device that uses an X-ray image of a casting to detect a casting defect, and comprises an acquisition unit that acquires an X-ray image of a casting, and a detection unit that searches for a feature region consisting of the color and pattern obtained when each pixel forming the casting defect is colored based on the color information, on a detection image generated by coloring each pixel of the X-ray image with a color corresponding to the brightness gradient angle, based on color information that associates a brightness gradient angle indicating the direction in which brightness changes with each of a plurality of different colors, and detects the feature region as a casting defect included in the X-ray image. [Effects of the Invention]
[0013] According to the casting defect detection method and casting defect detection apparatus described herein, casting defects occurring in a casting can be detected with high accuracy by utilizing an X-ray image obtained by transmitting X-rays through the casting. [Brief explanation of the drawing]
[0014] [Figure 1] Figure 1 is a schematic diagram illustrating the principle of the casting defect detection method according to this embodiment. [Figure 2] Figure 2 is a flowchart showing an example of the process for detecting casting defects. [Figure 3] Figure 3 illustrates an example of a pixel transformation process that converts pixels in an X-ray image into colored pixels. [Figure 4] Figure 4 illustrates an example of a casting defect and a background image of the casting defect that appear when an X-ray image is colorized. [Figure 5]Figure 5 shows an example of another image obtained by coloring the cast defects in the X-ray image based on color information. [Modes for carrying out the invention]
[0015] Hereinafter, embodiments of the casting defect detection method and casting defect detection apparatus according to this disclosure will be described with reference to the attached drawings. Figure 1 is a schematic diagram illustrating the principle overview of the casting defect detection method according to this embodiment. As shown in Figure 1, X-rays are irradiated from the X-ray irradiation device 10 onto the casting product 100 to be examined for the presence or absence of casting defects. The imaging device 20 receives the X-rays that have passed through the casting product 100 and captures an X-ray image (X-ray transmission image) of the casting product 100.
[0016] The casting defect detection device 1 acquires an X-ray image 200 of the casting 100 captured by the imaging device 20 (A). The casting defect detection device 1 may acquire the X-ray image 200 output by the imaging device 20 in real time, or it may acquire the X-ray image 200 stored in a storage device after imaging by the imaging device 20. The configuration of the casting defect detection device is not particularly limited as long as the casting defect detection method described in this embodiment can be executed. For example, a computer device equipped with a storage unit, a control unit and a communication unit may be used as the casting defect detection device 1.
[0017] The casting defect detection device 1 detects casting defects using a grayscale X-ray image 200. Before the casting defect detection device 1 performs the process of detecting casting defects, it may perform pre-processing image processing such as noise removal and contrast adjustment from the X-ray image 200.
[0018] The casting defect detection device 1 obtains the angle of the luminance gradient in the X-ray image 200 of the casting 100, and generates a detection image for casting defects with color conversion according to the angle (B). A color detection image is generated from the grayscale X-ray image 200. As shown in FIG. 1, the horizontal direction (left-right direction in the drawing) of each image is defined as the X-axis, the vertical direction (up-down direction in the drawing) is defined as the Y-axis, and the angle in the positive X-axis direction (right direction in the drawing) is defined as 0 degrees, and the description will continue assuming that the angle increases counterclockwise. For a circular image, the center of the circular shape may be used as the origin for the description.
[0019] Since the X-ray image 200 is a grayscale image, the luminance value of each pixel corresponds to the pixel value. The casting defect detection device 1 calculates a luminance gradient indicating the change in pixel value in the X-axis direction and a luminance gradient indicating the change in pixel value in the Y-axis direction at each pixel position forming the casting 100 shown in the X-ray image 200. The casting defect detection device 1 calculates the arctangent of the luminance gradient in the X-axis direction and the luminance gradient in the Y-axis direction as the luminance gradient angle, and executes a process of generating a color detection image from the X-ray image 200 based on the luminance gradient angle.
[0020] For example, as shown in FIG. 1, the casting defect detection device 1 converts the pixel 301 with a luminance gradient angle of 0 degrees (α = 0 degrees) into a red pixel 401, and converts the pixel 302 with a luminance gradient angle of 90 degrees (α = 90 degrees) into a yellow pixel 402, and performs a coloring process in which pixels with a luminance gradient angle between 0 and 90 degrees are gradually changed in color from red to yellow according to the angle. Similarly, the casting defect detection device 1 also executes a process of color conversion so that the pixels with a luminance gradient angle between 90 degrees and 360 degrees have colors corresponding to the angle, that is, a process of coloring the pixels.
[0021] For example, the casting defect detection device 1 makes a pixel composed of the luminance value of the X-ray image 200 into a color pixel having R (red), G (green), and B (blue) pixel values, and changes the color of each pixel by changing the R, G, and B pixel values according to the luminance gradient angle of each pixel. However, the method of color conversion is not particularly limited, and it may be an embodiment executed using other color spaces such as HSV.
[0022] On the X-ray image 200, the casting defects in the casting 100 appear as circular shapes, with high brightness in the center and decreasing brightness as the distance from the center increases. Therefore, by converting each pixel 301, 302... to pixels 401, 402... of different colors according to the brightness gradient angle, the image of the casting defects 310 can be transformed into a color image 410 with characteristic colors and patterns, as shown in Figure 1.
[0023] Specifically, the X-ray image of the casting defect 310 is a roughly circular image in which the brightness decreases radially from the approximate center. Therefore, the image 410, in which each pixel is colored with multiple different colors according to the brightness gradient angle, becomes a characteristic roughly circular image in which the color changes depending on the angle viewed from the center.
[0024] For example, if each pixel forming the casting cavity 310 is colored while gradually changing color according to the brightness gradient angle from 0 to 360 degrees, the color image 410 will be a circular image in which the color gradually changes depending on the angle viewed from the center. For example, it will be a circular color image in which the color changes in a gradient manner depending on the angle viewed from the center.
[0025] Furthermore, for example, if we divide the range from 0 to 360 degrees, like a color wheel, into multiple angular ranges and assign different colors to each, and color each pixel with the color of the angular range corresponding to the brightness gradient angle, then the color image 410 will be a color image in which a circular shape is divided into each angular range and colored differently.
[0026] Note that the pixels 301, 302, 401, 402 and the roughly circular casting defect 310 shown in Figure 1 are schematic representations and do not limit their size or brightness gradient. Furthermore, the images of pixels 401 and 402, obtained by coloring each of pixels 301 and 302 based on the brightness gradient angle, become monochrome color images, while the image 410 obtained by coloring the casting defect 310 becomes a color image containing multiple colors, although it is shown as a grayscale image in Figure 1.
[0027] The casting defect detection device 1 generates a detection image by coloring each pixel of the X-ray image 200 of the casting 100 based on the brightness gradient angle, and detects casting defects based on the color and pattern that appear in the detection image (C). Image 200a shown in Figure 1 is a color image of a portion of the X-ray image 200 after each pixel has been colored based on the brightness gradient angle. In other words, image 200a shows a portion of the detection image generated by color-converting the X-ray image 200.
[0028] The colors and patterns that appear in image 200a (detection image) vary depending on the shape and surface of the casting 100. On the other hand, if a casting defect 510 is visible in image 200a, the image of the casting defect 510 will not be affected by the surrounding shape or surface, and will have a characteristic color and pattern as shown in image 410. Although Figure 1 is shown as a monochrome image, image 200a is actually a color image, and many areas on the image are regions where pixels of various colors are mixed due to the surface, etc., while the casting defect 510 is a characteristic roughly circular image with a color that differs depending on the angle viewed from the center.
[0029] The casting defect detection device 1 detects casting defects 510 in the X-ray image 200 by searching for characteristic regions that exhibit characteristic colors and patterns, such as casting defects 510, on a detection image generated by coloring the X-ray image 200 according to the brightness gradient angle of each pixel.
[0030] For example, a template image of a colored casting defect showing characteristic colors and patterns, such as image 410 in Figure 1, can be prepared in advance, and casting defects included in the detection image can be detected by template matching. Alternatively, for example, casting defects can be detected by using machine learning or AI techniques to search for feature regions showing characteristic colors and patterns, such as image 410, on the detection image.
[0031] The casting defect detection device 1 outputs the casting defect detection result (E). The method of outputting the detection result is not particularly limited, but for example, on a black and white binary image 600 corresponding to the X-ray image 200, the casting defect 510 may be shown in white or black, and the other areas may be shown in the opposite black or white. The detection result may be displayed on the display unit of the casting defect detection device 1, for example, or it may be output from the casting defect detection device 1 to an external device via the communication unit and displayed on the display unit of the external device.
[0032] In the example shown in Figure 1, a method for detecting casting defects was explained using an image in which the casting defects appear brighter than the surrounding area. However, it goes without saying that an image in which the brightness and darkness of the image are inverted and the casting defects appear darker than the surrounding area may also be used. In this case as well, as described above, a color conversion based on the brightness gradient angle can be performed to generate a detection image and detect the casting defects.
[0033] Next, a specific example of the casting defect detection process performed by the casting defect detection device 1 will be explained. Figure 2 is a flowchart showing an example of the casting defect detection process flow. First, the casting defect detection device 1 acquires an X-ray image of the casting (step S1).
[0034] The casting defect detection device 1 performs preprocessing of the acquired X-ray image as needed (step S2). For example, preprocessing such as removing noise from the X-ray image using a low-pass filter, smoothing filter, median filter, etc., adjusting the contrast of the X-ray image, and extracting a partial region image from the X-ray image showing the area to be detected as a casting defect is performed as needed. If preprocessing is performed, the following processing is performed on the processed X-ray image.
[0035] The casting defect detection device 1 selects an arbitrary pixel to form an X-ray image (step S3). The casting defect detection device 1 calculates the brightness gradient Vx in the X direction of the selected pixel (step S4) and also calculates the brightness gradient Vy in the Y direction of this pixel (step S5).
[0036] The casting defect detection device 1 calculates the brightness gradients Vx and Vy by applying a differential operator to the brightness gradient of each pixel in a grayscale X-ray image. For example, a first-order differential operator such as Sobel or Roberts, or a second-order differential operator, can be used as the differential operator. For example, for each pixel, the brightness gradient Vx in the X direction is calculated by applying the Sobel differential operator in the X direction, and the brightness gradient Vy in the Y direction is calculated by applying the Sobel differential operator in the Y direction.
[0037] The casting defect detection device 1 calculates the brightness gradient angle α (step S6). The brightness gradient angle α can be calculated as the arctangent (arctan) of the ratio (Vy / Vx) of the brightness gradient Vx in the X direction and the brightness gradient Vy in the Y direction.
[0038] The casting defect detection device 1 performs a pixel transformation process (step S7) that colors each pixel forming a grayscale X-ray image based on the brightness gradient angle α. The pixel transformation may be performed by preparing a function in advance that takes the brightness gradient angle α as an input value and outputs the R, G, and B pixel values of each pixel, and using that function, or by preparing a transformation table in advance that associates the brightness gradient angle with the R, G, and B pixel values, and performing the transformation based on the transformation table. This process corresponds to the color transformation process described in Figure 1. As described in Figure 1, the pixel transformation process colors each pixel of the X-ray image with one of several different colors according to the brightness gradient angle α, and a color detection image is generated from the X-ray image.
[0039] While there are unprocessed pixels (Step S8: No), the casting defect detection device 1 selects the next pixel (Step S9) and repeatedly executes the processes in Steps S4 to S7. Once all pixels have been processed (Step S8: Yes), the casting defect detection device 1 detects casting defects on the detection image generated by the pixel conversion (Step S10). The casting defect detection process is performed on the detection image, in which each pixel of the grayscale X-ray image has been converted into a color pixel according to the brightness gradient angle. After completing the casting defect detection process, the casting defect detection device 1 outputs the detection result (Step S11) and terminates the process.
[0040] Figure 3 illustrates an example of a pixel transformation process that converts pixels in an X-ray image into colored pixels. For example, as shown in Figure 3(a), pixels are colored based on a color map (color information) that shows the correspondence between the brightness gradient angle α and color. Specifically, the casting defect detection device 1 converts each pixel forming the X-ray image into a colored pixel having R, G, and B pixel values that correspond to the brightness gradient angle α, as shown in Figure 3(b).
[0041] In the color map examples shown in Figures 3(a) and (b), when the luminance gradient angle α is between 0 and 90 degrees, the color of each pixel gradually changes from red to yellow-green according to the angle. When the luminance gradient angle α is between 90 and 180 degrees, the color of each pixel gradually changes from yellow-green to light blue according to the angle. When the luminance gradient angle α is between 180 and 270 degrees, the color of each pixel gradually changes from light blue to purple according to the angle. When the luminance gradient angle α is between 270 and 360 degrees, the color of each pixel gradually changes from purple to red according to the angle.
[0042] Based on the color information shown in Figures 3(a) and (b), when each pixel forming a casting defect in an X-ray image is color-transformed based on the brightness gradient angle α, the resulting image, as shown in Figure 3(c), will have different colors for pixels corresponding to the radius of the circular shape, depending on the angle viewed from the center of the circle. Specifically, the color gradually changes from red to yellow-green when the brightness gradient angle α is between 0 and 90 degrees, from yellow-green to light blue between 90 and 180 degrees, from light blue to purple between 180 and 270 degrees, and from purple to red between 270 and 360 degrees. In other words, the color of the pixels forming the radius changes in a gradient manner depending on the angle viewed from the center, resulting in a circular color image. In this embodiment, the angle viewed from the center refers to the angle around the origin on the XY plane, with the center of the circle as the origin and the positive X-axis direction being 0 degrees, as shown in Figure 3(c).
[0043] Figure 4 illustrates an example of images showing casting defects and the background of casting defects that appear when X-ray images are colorized. As described above, on the detection image generated by coloring each pixel of the X-ray image based on predetermined color information, casting defects contained in the X-ray image appear as images showing characteristic colors and patterns, as shown in Figure 3(c).
[0044] Even when the background of the casting defect in the detection image consists of various images with different colors and patterns depending on the shape and surface of the casting around the defect, the detection image remains capable of detecting the defect without being obscured by the background, as shown in Figure 4(a). Even when the background of the casting defect consists of images with different brightness gradient directions, as shown in Figure 4(b), the detection image remains capable of detecting the defect without being obscured by the background.
[0045] Therefore, the casting defect detection device 1 can detect casting defects by performing a template matching process that searches the detection image using, for example, the image shown in Figure 3(c) as a template image. Alternatively, the casting defect detection device 1 can also detect casting defects by using machine learning or AI to perform a process that searches the detection image for feature regions exhibiting the characteristic color and pattern shown in Figure 3(c).
[0046] Thus, the casting defect detection device 1 utilizes the fact that images of casting defects in X-ray images are approximately circular in shape, with high brightness in the center and decreasing brightness towards the periphery. It then performs pixel conversion processing based on color information set to change color according to the brightness gradient angle, coloring each pixel to generate an image for detecting casting defects. On the color detection image, the casting defects appear as approximately circular regions exhibiting characteristic colors and patterns. The casting defect detection device 1 can detect casting defects by searching for characteristic regions indicating casting defects on the detection image, and can identify the location and size of casting defects that have occurred in the casting.
[0047] In this embodiment, an example was described in which, when each pixel forming a grayscale X-ray image is converted into a pixel of a color corresponding to the brightness gradient angle at each pixel position based on color information, the casting defect becomes a circular region with a gradient of color. If the casting defect takes on a shape that exhibits a characteristic color or pattern on the detection image in which each pixel is colored, the method of pixel conversion based on color information is not limited to the method described above.
[0048] Figure 5 shows an example of another image obtained by coloring casting defects in an X-ray image based on color information. Figure 5 shows an example in which the colored image of the casting defects is divided into multiple angular ranges as viewed from the center of the circle, and adjacent angular ranges are colored in different colors. The color information may be set so that a predetermined angular range on the colored detection image is filled with a single color, as shown in Figure 5(a). Figure 5(a) shows an example in which two angular ranges, 90 to 180 degrees and 270 to 360 degrees, are filled with a single color, but the color information may be set so that there are three or more angular ranges to be filled, as shown in Figure 5(b), or it may be set so that each angular range is filled with a different color, as shown in Figure 5(c). The color information may be set so that the color changes in a gradient manner in at least one angular range.
[0049] The images shown in this embodiment are schematic images provided to illustrate the processes performed by the casting defect detection device 1, and do not limit the content of the images. Similarly, the converted colors in the process of converting each pixel of a grayscale X-ray image into color pixels are illustrative examples, and the conversion may be carried out in a manner different from the example described above.
[0050] The configuration of the casting defect detection device 1 shown in this embodiment is functionally schematic, and the configuration of the casting defect detection device 1 is not physically limited to this configuration. The form of distribution and integration of the device is not limited to the example described above, and all or part of it can be configured by functionally or physically distributing and integrating it in any unit according to various loads and usage conditions. For example, the casting defect detection device 1 may include an acquisition unit that acquires an X-ray image of the casting and a detection unit that detects casting defects based on a detection image generated from the X-ray image as described above. The detection unit may be divided into a luminance gradient calculation unit that calculates the luminance gradient of each pixel, a luminance gradient angle calculation unit that calculates the luminance gradient angle, a detection image generation unit that generates a detection image in which each pixel is colored according to the luminance gradient angle based on color information, a detection processing unit that performs casting defect detection processing using the detection image, an image processing unit that generates an output image showing the image preprocessing and the casting defect detection result, etc. The casting defect detection device 1 may also be configured as a plurality of devices, such as a terminal and a server device.
[0051] While embodiments of the casting defect detection method and casting defect detection apparatus according to this disclosure have been described above with reference to the drawings, the configuration and operation of the casting defect detection apparatus 1 are not limited to the above embodiments, and may be implemented in various forms with improvements, changes, and modifications based on the knowledge of those skilled in the art, without departing from the spirit of the invention. [Industrial applicability]
[0052] As described above, the casting defect detection method and casting defect detection apparatus according to this disclosure are useful for detecting casting defects with high accuracy using X-ray images of castings. [Explanation of Symbols]
[0053] 1. Casting defect detection device 10 X-ray irradiation device 20 Imaging device
Claims
1. A method for detecting casting defects using X-ray images of a casting, The acquisition process involves obtaining X-ray images of the castings, A calculation step for each pixel of the aforementioned X-ray image, which involves calculating the brightness gradient angle indicating the direction in which the brightness changes, A generation step of generating a detection image in which each pixel of the X-ray image is colored according to the brightness gradient angle based on color information that associates the brightness gradient angle with each of several different colors, A detection step involves searching for a feature region consisting of color and pattern obtained when each pixel forming a casting defect on the X-ray image is colored based on the color information, and detecting the feature region as a casting defect included in the X-ray image. A method for detecting casting defects, characterized by including the following:
2. The casting defect detection method according to claim 1, characterized in that when the color information is colored, the casting defect that appears in a substantially circular shape on the X-ray image with brightness changing radially from the center and the surrounding area of the casting defect, the characteristic area corresponding to the casting defect shows a color and pattern that is distinguishable from the surrounding area of the casting defect.
3. The casting defect detection method according to claim 2, characterized in that the image obtained by coloring the casting defects based on the color information is such that the color of the pixels corresponding to the radius of the substantially circular shape differs depending on the angle viewed from the center of the substantially circular shape.
4. The casting defect detection method according to claim 3, characterized in that the color of the pixel corresponding to the radius of the substantially circular shape changes in a gradient manner according to the angle viewed from the center of the substantially circular shape.
5. The casting defect detection method according to claim 2, characterized in that the image obtained by coloring the casting defects based on the color information is divided into multiple angular ranges as viewed from the center of a substantially circular shape, and the colors of adjacent angular ranges are different.
6. A casting defect detection device that detects casting defects using X-ray images of castings, An acquisition unit for acquiring X-ray images of castings, A detection unit searches for a feature region consisting of the color and pattern obtained when each pixel forming the casting defect is colored based on the color information obtained when each pixel forming the casting defect is colored based on the color information, based on color information that associates the brightness gradient angle indicating the direction in which brightness changes with each of several different colors, and detects the feature region as a casting defect included in the X-ray image. A casting defect detection device characterized by comprising the following features.