Foreign body detection image generation method and device, precision detection method and device

By generating foreign object detection images, the problem of high manufacturing cost and inconsistent detection accuracy of foreign object test cards is solved, and efficient and unified foreign object detection is achieved.

CN114170181BActive Publication Date: 2025-01-21SHANGHAI VIXDETECT INSPECTION EQUIP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111485339.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-07
Publication Date
2025-01-21
Estimated Expiration
2041-12-07

AI Technical Summary

Technical Problem

The existing foreign object test cards have high manufacturing costs and are inconvenient to use, and the detection accuracy varies in different locations, which increases the workload and possible secondary pollution.

Method used

By receiving the foreign body attribute setting instructions, the basic attributes of the simulated foreign body are set, and the simulated grayscale data is obtained based on the pre-stored X-ray foreign body image grayscale database, and the foreign body detection image is generated to realize the foreign body detection of the object to be inspected.

Benefits of technology

It reduces the manufacturing cost and usage complexity of the foreign body test card, improves the uniformity and consistency of detection accuracy, and reduces the workload and risk of secondary contamination.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114170181B_ABST
    Figure CN114170181B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for generating a foreign body detection image, and a method and device for detecting foreign body precision; wherein the method for generating a foreign body detection image includes: receiving a foreign body property setting instruction; setting the basic properties of each simulated foreign body according to the foreign body property setting instruction; obtaining the intensity of the current X-ray source; obtaining the simulated grayscale data of each simulated foreign body according to the basic properties of each simulated foreign body and the intensity of the current X-ray source, based on a pre-stored X-ray foreign body image grayscale database; receiving a grayscale image of the object to be detected under the current X-ray source detection scan; superimposing each simulated foreign body on the grayscale image of the object to be detected according to the basic properties of each simulated foreign body and the simulated grayscale data, to generate a foreign body detection image. Through the foreign body detection image generation method of the present application, a foreign body detection image can be quickly obtained for detecting the foreign body detection precision of the device, without the need to manually deliver test pieces multiple times to detect the foreign body detection precision of the device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of detection, and in particular to a method and device for generating a foreign body detection image, and a method and device for detecting an accuracy. Background Art

[0002] At present, X-ray technology is widely used in the field of online inspection of industrial production lines. Through X-ray transmission images, the internal structure and state of the product can be clearly seen, and possible foreign matter or product defects can be found. Taking the food production line as an example, when metal, ceramic pieces, glass pieces or stones are mixed in bagged or bulk food, X-ray scanning is used to generate images, and then the image processing program recognizes the image. When foreign matter is found, the equipment will automatically remove the product containing foreign matter.

[0003] In order to better measure the sensitivity of the detection equipment, the detection equipment is verified using test cards containing various sizes and types of foreign matter. For example, the test cards produced by the Japan Inspection Machinery Industry Association (JIMA) include stainless steel balls, stainless steel wires, ceramic balls, resin balls, rubber balls, and aluminum balls. One test card contains foreign matter of one or more sizes. During the test, the product and the test card are put into the detection channel together. The detection equipment should detect the foreign matter on the test card through the X-ray image of the product and the test card. The foreign matter of various sizes found and located in the image is the detection sensitivity of the X-ray detection equipment for this type of product.

[0004] In the assembly line, products are constantly passing through the testing equipment. In order to ensure that the testing equipment is in normal condition, production personnel occasionally put test cards into the production line to check whether the testing equipment can detect foreign objects normally, whether the sensitivity of foreign object recognition is biased, and whether the alarm and rejection devices are normal. This verification mechanism is used to check whether the equipment is operating normally. If the foreign object recognition sensitivity is normal and the alarm and rejection devices are working properly, the testing equipment is operating normally; if the foreign object recognition sensitivity is reduced or even no foreign objects are found, or the software detects foreign objects but the alarm and rejection devices do not work, it means that the testing equipment is faulty and the production line must be stopped immediately to repair the faulty equipment, and the products during this period must be recovered and retested with normal equipment.

[0005] At present, there are the following problems with the use of foreign body test cards:

[0006] 1. The material type, size and quantity of the foreign matter are completely determined by the test card. In order to ensure the consistency of the test card, the material and size of the foreign matter in each test card must be of high purity and high precision, which makes the manufacturing cost high. It is not easy for general customers to prepare all kinds of foreign matter test cards.

[0007] 2. When the foreign body test card is superimposed on different positions of the inspected object, the detection accuracy may be slightly different. For example, when the foreign body test card is superimposed on a zongzi, the foreign body detection accuracy at the thickest part of the zongzi will be significantly lower than that at the outer packaging part. The current test card only has a few foreign bodies, and the accuracy at different positions can only be measured through multiple tests, placed at different positions of the inspected object, and multiple measurements and statistics can obtain accurate results, which increases the workload.

[0008] 3. If you place multiple foreign body test cards multiple times, it is possible to cause secondary contamination to the object being tested. This problem is particularly troublesome for bulk food, and even cleaning is required after each test. Summary of the invention

[0009] In order to overcome at least one of the above technical defects, the present application discloses a method and device for generating a foreign body detection image, and a method and device for detecting foreign body accuracy. Specifically, the present invention is implemented by the following technologies:

[0010] In a first aspect, the present invention provides a method for generating a foreign body detection image, comprising: receiving a foreign body property setting instruction; setting the basic properties of each simulated foreign body according to the foreign body property setting instruction; obtaining the intensity of the current X-ray source; obtaining simulated grayscale data of each simulated foreign body according to the basic properties of each simulated foreign body and the intensity of the current X-ray source based on a pre-stored X-ray foreign body image grayscale database; receiving a grayscale image of an object to be inspected under the current X-ray source detection scan; superimposing each simulated foreign body on the grayscale image of the object to be inspected according to the basic properties of each simulated foreign body and the simulated grayscale data to generate a foreign body detection image.

[0011] In some embodiments, the simulated foreign objects are superimposed on the grayscale image of the object to be tested based on the basic properties and simulated grayscale data of each simulated foreign object to generate a foreign object detection image; specifically comprising: generating a grayscale image of a simulated foreign object test card based on the basic properties and simulated grayscale data of each simulated foreign object; the grayscale image of the simulated foreign object test card has the same resolution as the grayscale image of the object to be tested; and superimposing the grayscale image of the simulated foreign object test card with the grayscale image of the object to be tested to generate a foreign object detection image.

[0012] In some embodiments, the basic properties of each simulated foreign body include: the type, quantity, location, shape, and size of the simulated foreign body; according to the basic properties of each simulated foreign body and the intensity of the current X-ray source, based on a pre-stored X-ray foreign body image grayscale database, the grayscale data of each simulated foreign body is obtained, specifically including: according to the shape and size data of each simulated foreign body, the thickness data of each part of each simulated foreign body is obtained; according to the type of each simulated foreign body and the thickness data of each part, and the intensity of the current X-ray source, the simulated grayscale data of each part of each simulated foreign body is searched and obtained from the pre-stored X-ray foreign body image grayscale database.

[0013] In some embodiments, the grayscale image of the simulated foreign body test card is superimposed with the grayscale image of the object to be detected to generate a foreign body detection image; specifically comprising:

[0014] The grayscale image of the object to be tested and the grayscale image of the simulated foreign body test card are superimposed pixel by pixel, and the foreign body detection image is calculated by the following formula:

[0015] R(x,y)=F(x,y)+T(x,y)-B(x,y);

[0016] Among them, F(x,y) is the actual grayscale value of the pixel point at the coordinate point (x,y) on the grayscale image of the object to be inspected; T(x,y) is the simulated grayscale value of the pixel point at the coordinate point (x,y) on the grayscale image of the simulated foreign body test card; B(x,y) is the grayscale value of the unobstructed X-ray imaging; R(x,y) is the grayscale value of the pixel point at the coordinate point (x,y) on the foreign body detection image after the grayscale image of the object to be inspected and the grayscale image of the simulated foreign body test card are superimposed.

[0017] In the second aspect, the present application discloses a device for generating a foreign body detection image, comprising: an information receiving module for receiving a foreign body property setting instruction; a foreign body setting module for setting the basic properties of each simulated foreign body according to the foreign body property setting instruction; an intensity acquisition module for acquiring the intensity of the current X-ray source; a grayscale acquisition module for acquiring the simulated grayscale data of each simulated foreign body based on the basic properties of each simulated foreign body and the intensity of the current X-ray source and based on a pre-stored X-ray foreign body image grayscale database; the information receiving module is also used to receive a grayscale image of the object to be inspected under the current X-ray source detection scan; an image generation module is used to superimpose each simulated foreign body on the grayscale image of the object to be inspected according to the basic properties of each simulated foreign body and the simulated grayscale data to generate a foreign body detection image.

[0018] In some embodiments, the image generation module specifically includes: a test card image generation submodule, which is used to generate a grayscale image of a simulated foreign body test card based on the basic properties of each simulated foreign body and the simulated grayscale data; the grayscale image of the simulated foreign body test card has the same resolution as the grayscale image of the object to be tested; and an overlay generation submodule, which is used to overlay the grayscale image of the simulated foreign body test card with the grayscale image of the object to be tested to generate a foreign body detection image.

[0019] In some embodiments, the basic properties of each simulated foreign body include: the type, quantity, location, shape, and size of the simulated foreign body; the grayscale acquisition module specifically includes: a thickness acquisition submodule, which is used to obtain the thickness data of each part of each simulated foreign body according to the shape and size data of each simulated foreign body; a grayscale search submodule, which is used to search and obtain the simulated grayscale data of each part of each simulated foreign body from a pre-stored X-ray foreign body image grayscale database according to the type of each simulated foreign body and the thickness data of each part and the intensity of the current X-ray source.

[0020] In some embodiments, the superposition generation submodule specifically includes: a calculation unit, which is used to superimpose the grayscale image of the object to be detected and the grayscale image of the simulated foreign body test card pixel by pixel, and calculate the foreign body detection image by the following formula:

[0021] R(x,y)=F(x,y)+T(x,y)-B(x,y);

[0022] Among them, F(x,y) is the actual grayscale value of the pixel point at the coordinate point (x,y) on the grayscale image of the object to be inspected; T(x,y) is the simulated grayscale value of the pixel point at the coordinate point (x,y) on the grayscale image of the simulated foreign body test card; B(x,y) is the grayscale value of the unobstructed X-ray imaging; R(x,y) is the grayscale value of the pixel point at the coordinate point (x,y) on the foreign body detection image after the grayscale image of the object to be inspected and the grayscale image of the simulated foreign body test card are superimposed.

[0023] In the third aspect, the present application discloses a foreign body accuracy detection method, including: when it is necessary to verify the accuracy of foreign body detection, obtain a grayscale image of the object to be detected under the current X-ray source detection scan; call up a pre-acquired grayscale image of a simulated foreign body test card; the grayscale image of the simulated foreign body test card is generated according to the set basic properties of each simulated foreign body, the current X-ray source intensity, and a pre-stored X-ray image grayscale database; superimpose the grayscale image of the simulated foreign body test card with the grayscale image of the object to be detected to generate a foreign body detection image; use a preset foreign body recognition algorithm model to perform foreign body detection and recognition on the foreign body detection image to determine the accuracy of foreign body detection.

[0024] In some embodiments, the step of acquiring the grayscale image of the simulated foreign body test card specifically includes: receiving a foreign body property setting instruction; setting the type, quantity, position, shape and size of the foreign body on the simulated foreign body test card according to the foreign body property setting instruction; acquiring the thickness data of each part of each foreign body according to the shape and size of each foreign body on the simulated foreign body test card; obtaining the foreign body thickness map of the simulated foreign body test card according to the number and position of the foreign bodies on the simulated foreign body test card and the thickness data of each part of each corresponding foreign body; the foreign body thickness map is used to indicate the distribution of various types of foreign bodies on the simulated foreign body test card and the thickness data corresponding to each part of each foreign body; and the resolution of the foreign body thickness map is the same as the resolution of the foreign body detection image; according to the set X-ray source intensity and the pre-stored X-ray foreign body image grayscale database, the foreign body thickness map of the simulated foreign body test card is converted into the foreign body grayscale map of the simulated foreign body test card; the set X-ray source intensity is the same as the current X-ray source intensity.

[0025] In some embodiments, the foreign object detection image is subjected to foreign object detection and identification using a preset foreign object recognition algorithm model to determine the accuracy of detecting foreign objects; specifically, the foreign object detection image is subjected to foreign object detection using a preset foreign object recognition algorithm model to detect the number and position of foreign objects on the foreign object detection image; based on the detected number and position of foreign objects on the foreign object detection image, combined with the number and position of foreign objects set on the simulated foreign object test card, the number of missed reports and the number of false reports of foreign object detection are obtained to obtain the accuracy of the foreign object detection.

[0026] In some embodiments, the grayscale image of the simulated foreign body test card is superimposed with the grayscale image of the object to be tested to generate a foreign body detection image; specifically, the grayscale image of the simulated foreign body test card is superimposed and calculated with the grayscale image of the object to be tested by the following formula to obtain the foreign body detection image:

[0027] R(x,y)=F(x,y)+T(x,y)-B(x,y);

[0028] Among them, F(x,y) is the actual grayscale value of the pixel point at the coordinate point (x,y) on the grayscale image of the object to be inspected; T(x,y) is the simulated grayscale value of the pixel point at the coordinate point (x,y) on the grayscale image of the simulated foreign body test card; B(x,y) is the grayscale value of the unobstructed X-ray imaging; R(x,y) is the grayscale value of the pixel point at the coordinate point (x,y) on the foreign body detection image after the grayscale image of the object to be inspected and the grayscale image of the simulated foreign body test card are superimposed.

[0029] In some embodiments, in the formula R(x,y)=F(x,y)+T(x,y)-B(x,y),

[0030] F(x,y)=ln(I0(x,y))-μ1d1;

[0031] T(x,y)=ln(I0(x,y))-μ2d2;

[0032] B(x,y)=ln(I0(x,y));

[0033] Wherein: at the coordinate point (x, y), the thickness of the object to be tested is d1, and the thickness of the foreign matter in the simulated foreign matter test card is d2; the fixed absorption coefficients corresponding to the object to be tested and the foreign matter are μ1 and μ2 respectively; I0(x, y) represents the initial ray intensity without shielding at the coordinate point (x, y).

[0034] In a fourth aspect, the present application discloses a foreign body precision detection device, comprising: a scanning module, used to obtain a grayscale image of the object to be inspected under the current X-ray source detection scan when the accuracy of foreign body detection needs to be verified; a retrieving module, used to retrieve a pre-acquired grayscale image of a simulated foreign body test card; the grayscale image of the simulated foreign body test card is generated according to the set basic properties of each simulated foreign body, the current X-ray source intensity, and a pre-stored X-ray image grayscale database; an image overlay module, used to overlay the grayscale image of the simulated foreign body test card with the grayscale image of the object to be inspected to generate a foreign body detection image; a detection and recognition module, used to use a preset foreign body recognition algorithm model to perform foreign body detection and recognition on the foreign body detection image to determine the accuracy of foreign body detection.

[0035] In some embodiments, the foreign body precision detection device of the present application further includes: a simulated foreign body acquisition module, which is used to acquire a grayscale image of a simulated foreign body test card; the simulated foreign body acquisition module specifically includes: an instruction receiving submodule, which is used to receive a foreign body property setting instruction; a setting submodule, which is used to set the type, quantity, position, shape and size of the foreign body on the simulated foreign body test card according to the foreign body property setting instruction; a thickness acquisition submodule, which is used to acquire the thickness data of each part of each foreign body according to the shape and size of each foreign body on the simulated foreign body test card; a thickness map generation submodule, which is used to generate a thickness map according to the number of foreign bodies on the simulated foreign body test card. , position, and thickness data of each part of each corresponding foreign object to obtain a foreign object thickness map of the simulated foreign object test card; the foreign object thickness map is used to indicate the distribution of various types of foreign objects on the simulated foreign object test card, and the thickness data corresponding to each part of each foreign object; and the resolution of the foreign object thickness map is the same as the resolution of the foreign object detection image; a degree map generation submodule is used to convert the foreign object thickness map of the simulated foreign object test card into a foreign object grayscale map of the simulated foreign object test card according to the set X-ray source intensity and a pre-stored X-ray foreign object image grayscale database; the set X-ray source intensity is the same as the current X-ray source intensity.

[0036] In some embodiments, the detection and identification module specifically includes: a detection submodule, which is used to perform foreign object detection on the foreign object detection image through a preset foreign object recognition algorithm model, and detect the number and position of foreign objects on the foreign object detection image; a verification submodule, which is used to obtain the number of missed reports and the number of false alarms of foreign object detection based on the number and position of foreign objects detected on the foreign object detection image, combined with the number and position of foreign objects set on the simulated foreign object test card, to obtain the accuracy of the foreign object detection; and / or

[0037] The image superposition module specifically includes: a superposition calculation submodule, which is used to superimpose the grayscale image of the simulated foreign body test card and the grayscale image of the object to be detected by the following formula to obtain a foreign body detection image:

[0038] R(x,y)=F(x,y)+T(x,y)-B(x,y);

[0039] Among them, F(x,y) is the actual grayscale value of the pixel point at the coordinate point (x,y) on the grayscale image of the object to be inspected; T(x,y) is the simulated grayscale value of the pixel point at the coordinate point (x,y) on the grayscale image of the simulated foreign body test card; B(x,y) is the grayscale value of the unobstructed X-ray imaging; R(x,y) is the grayscale value of the pixel point at the coordinate point (x,y) on the foreign body detection image after the grayscale image of the object to be inspected and the grayscale image of the simulated foreign body test card are superimposed.

[0040] Finally, the present application also provides a foreign matter detection device, on which the foreign matter detection image generating device of the present application is provided.

[0041] By using the method or device for generating foreign body detection images of the present application, foreign body detection images can be obtained regularly by software processing, and then provided to the foreign body detection device for corresponding detection, thereby verifying the accuracy of the foreign body detection device. There is no need to manually deliver the actual foreign body test piece to verify the accuracy of the detection equipment, which greatly saves labor costs. In addition, since the solution of this embodiment does not require the use of actual foreign body test pieces, the manufacturer does not need to prepare various types and sizes of foreign body test pieces for testing, thereby reducing the testing cost, and there is no problem of foreign body test piece loss. Moreover, according to actual needs, foreign body detection images of different types of foreign bodies mixed into the object to be detected can be obtained, which is convenient for subsequent foreign body accuracy detection.

[0042] By adopting the foreign body precision detection method or device of the present application, the X-ray image generated by the foreign body detection image generation method of the present application can be detected through a preset foreign body recognition algorithm model to verify the detection result of the foreign body detection device. Since the user can set the basic properties of the foreign body according to the needs, such as the type, size, quantity, position, etc. of the foreign body, the accuracy of the foreign body test card at all positions can be measured at one time, saving time and effort. In addition, the foreign body precision detection method of the present application can be used regularly to regularly verify the accuracy of the foreign body detection device to ensure the normal operation of the foreign body detection device. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The following will explain the preferred implementation mode in a clear and understandable manner with reference to the accompanying drawings, and further explain the above-mentioned characteristics, technical features, advantages and implementation methods of an image generation method and device for foreign body detection, and a foreign body accuracy detection method and device.

[0044] Figure 1 is a schematic diagram of an embodiment of a method for generating a foreign body image in the present invention;

[0045] Figure 2 is a schematic diagram of an embodiment of a foreign body image generating device in the present invention;

[0046] Figure 3 is a schematic diagram of an embodiment of a foreign body precision detection method in the present invention;

[0047] Figure 4 is a schematic diagram of an embodiment of a foreign matter precision detection device in the present invention;

[0048] Figure 5 It is a schematic diagram of a grayscale image of a simulated test piece in the present invention. DETAILED DESCRIPTION

[0049] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0050] It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections.

[0051] In order to simplify the drawings, only the parts related to the present invention are schematically shown in each figure, and they do not represent the actual structure of the product. In addition, in order to simplify the drawings and facilitate understanding, in some figures, only one of the parts with the same structure or function is schematically drawn or marked. In this article, "one" not only means "only one", but also means "more than one".

[0052] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0053] In addition, in the description of the present application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the specific implementation methods of the present invention will be described below with reference to the accompanying drawings. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings and other implementation methods can be obtained based on these drawings without creative work.

[0055] In one embodiment, the present invention provides a method for generating a foreign body detection image, such as Figure 1 As shown, including:

[0056] S101 receives a foreign matter attribute setting instruction.

[0057] S102 sets the basic properties of each simulated foreign object according to the foreign object property setting instruction.

[0058] Specifically, setting the basic properties of the simulated foreign body test card refers to setting the basic properties of the foreign body in the software, wherein the basic properties include the type of foreign body, size (different sizes have different corresponding thickness data), quantity, etc.

[0059] Users can set the type, size, quantity, thickness, position, etc. of simulated foreign objects according to their needs. For example, if they mainly want to obtain foreign object detection images of ceramic foreign objects and glass foreign objects, they can set the basic data such as the corresponding size, quantity, position, etc. of these two foreign object types in advance.

[0060] S103 obtains the current intensity of the X-ray source.

[0061] Specifically, if the object to be inspected is different, the intensity of the X-ray source used by the X-ray inspection equipment may also be different, and if the intensity of the X-ray source is different, the final image may also be different. Therefore, before the inspection, it is necessary to obtain the intensity of the current X-ray source, that is, the intensity of the X-ray source when the object to be inspected is inspected, to ensure that the intensity of the X-ray source received is the same when the subsequent images are synthesized or superimposed, that is, the inspection environment is the same.

[0062] S104 acquires simulated grayscale data of each simulated foreign object according to basic properties of each simulated foreign object, the intensity of the current X-ray source, and based on a pre-stored X-ray foreign object image grayscale database.

[0063] Among them, the pre-stored X-ray foreign body image grayscale database is established based on the image grayscale values ​​of foreign bodies of different types and thicknesses under X-ray source scanning of different intensities, and the X-ray foreign body image grayscale database of different types of foreign bodies is established. Specifically, the intensity of the ray source and the basic properties of the foreign body can be searched in the pre-stored X-ray foreign body image grayscale database to obtain the simulated grayscale data of the foreign body image theoretically obtained under the scanning detection of the intensity of the ray source with the foreign body of the basic properties. The basic properties of the foreign body refer to some properties related to the foreign body itself, such as the type of foreign body. Different types of foreign bodies have different absorption rates of X-rays. Even if they are of the same type, they may have different densities and thus different absorption rates of X-rays, which may lead to different subsequent corresponding grayscale data. In addition, the size or shape of the foreign body, such as a sphere, the diameter of the sphere, etc., will determine the thickness of the foreign body at each position of the foreign body. The thickness of each position of the spherical foreign body is different, so the absorption rate of X-rays at each position will also be different. Therefore, under the scanning of the same X-ray source, the simulated grayscale data corresponding to each position of the foreign body is also different.

[0064] For example, the thickness of various foreign bodies, the high voltage value of the X-ray source (i.e., the intensity of the ray source), and the type of foreign body are used in advance to establish an X-ray image grayscale database, and each table in the database corresponds to each type of foreign body. Taking a 2.7g / cm3 ceramic spherical foreign body as an example, after scanning and imaging at a 30kv ray source intensity, the grayscale value of the 0.1mm thick part of the ceramic spherical foreign body is t(30,0.1), and the image grayscale value of the 0.2mm thick part is t(30,0.2)..., and the following table is obtained through experiments:

[0065]

[0066] Similarly, we can also obtain image grayscale data tables of other types of foreign objects, such as image grayscale data tables of glass foreign objects, image grayscale data tables of stainless steel foreign objects, etc. The image grayscale data tables of various types of foreign objects constitute an image grayscale database of foreign objects, which is convenient for subsequent searches.

[0067] S105 receives a grayscale image of the object to be inspected under the current X-ray source detection scan.

[0068] S106: superimposing each simulated foreign body on the grayscale image of the object to be inspected according to the basic properties of each simulated foreign body and the simulated grayscale data, so as to generate a foreign body detection image.

[0069] Specifically, after the grayscale image of the object to be inspected is obtained, the foreign objects may be superimposed on the grayscale image of the object to be inspected according to the basic properties of each simulated foreign object and the simulated grayscale data to obtain a foreign object detection image.

[0070] There are many ways to superimpose. For example, first generate a grayscale image of a simulated foreign body test card based on the basic properties of each simulated foreign body and the corresponding simulated grayscale data, and then superimpose the simulated foreign body test card image with the grayscale image of the object to be tested. Alternatively, instead of first generating a grayscale image of a simulated foreign body test card, directly select the location (one or more) to add the foreign body on the grayscale image of the object to be tested, and then add each simulated foreign body directly to each location based on the basic properties and simulated grayscale data of each simulated foreign body, calculate the grayscale data corresponding to the location area after adding the foreign body to each location, and finally generate a foreign body detection image.

[0071] By adopting the method for generating foreign body detection images of this embodiment, foreign body detection images can be obtained regularly by software processing, and then provided to the foreign body detection equipment for corresponding detection, so as to verify the accuracy of the foreign body detection equipment. There is no need to manually deliver the actual foreign body test piece to verify the accuracy of the detection equipment, which greatly saves labor costs. In addition, since the solution of this embodiment does not need to use the actual foreign body test piece, the manufacturer does not need to prepare various types and sizes of foreign body test pieces for testing, thus reducing the testing cost, and there is no problem of foreign body test piece loss. Moreover, according to actual needs, foreign body detection images of different types of foreign bodies mixed into the object to be detected can be obtained, which is convenient for subsequent foreign body accuracy detection.

[0072] On the other hand, by using the method for generating foreign body detection images of this embodiment, a large number of different foreign body detection images can be obtained in a short time, thereby providing a large number of samples for training the foreign body detection and recognition model. We all know that the training of the neural network model requires a large number of samples for training. In the traditional way, we may need to actually obtain a large number of detection images of the test piece and the detection object under X-ray scanning through a large number of repeated actual operations, but by using the solution of this embodiment, there is no need to manually perform delivery scanning to obtain, but can be directly obtained through the solution of this embodiment, and according to the different foreign body recognition models trained, the required foreign body detection images can be obtained as samples in a targeted manner.

[0073] In one embodiment, based on the above embodiment, the same parts as those in the above embodiment will not be described one by one in this embodiment. This embodiment provides a method for generating a foreign body detection image, wherein:

[0074] The method of superimposing each simulated foreign body on the grayscale image of the object to be inspected according to the basic properties of each simulated foreign body and the simulated grayscale data to generate a foreign body detection image specifically includes:

[0075] A grayscale image of a simulated foreign body test card is generated according to the basic properties of each simulated foreign body and the simulated grayscale data; the grayscale image of the simulated foreign body test card has the same resolution as the grayscale image of the object to be tested.

[0076] The grayscale image of the simulated foreign body test card is superimposed with the grayscale image of the object to be tested to generate a foreign body detection image.

[0077] Specifically, the object to be inspected is sent into the detection channel and subjected to X-ray scanning, which will generate a grayscale image of the object to be inspected. After the grayscale image of the object to be inspected is obtained, the grayscale image of the simulated foreign body test card can be superimposed to calculate and generate the target image; of course, the resolution of the grayscale image of the object to be inspected and the grayscale image of the simulated foreign body test card are the same.

[0078] In one embodiment, based on the above embodiment, the same parts as those in the above embodiment will not be described one by one in this embodiment. This embodiment provides a method for generating a foreign body detection image, wherein:

[0079] The basic attributes of each simulated foreign body include: type, quantity, position, shape, and size of the simulated foreign body.

[0080] According to the basic properties of each simulated foreign body and the intensity of the current X-ray source, based on a pre-stored X-ray foreign body image grayscale database, the grayscale data of each simulated foreign body is obtained, specifically including:

[0081] According to the shape and size data of each simulated foreign object, the thickness data of each part of each simulated foreign object is obtained.

[0082] Specifically, based on the set basic properties of the simulated foreign matter test card, a foreign matter thickness map of the simulated foreign matter test card with a specified resolution is obtained.

[0083] The basic attributes include period, type, quantity, size and position. The foreign matter includes any one or more of stainless steel ball foreign matter, stainless steel wire foreign matter, ceramic ball foreign matter, resin ball foreign matter, rubber ball foreign matter, glass ball foreign matter and aluminum ball foreign matter.

[0084] Each pixel point in the foreign matter thickness map is the foreign matter thickness at the position corresponding to the pixel point.

[0085] For example, the type, size and number of foreign matter are set in the software, and a specific foreign matter thickness map with the same resolution is obtained according to the resolution of the X-ray image of the object under test. Each pixel represents the thickness of the foreign matter at that location. If there is no foreign matter at that point, the foreign matter thickness at that point is 0, that is, blank. If there is a foreign matter at that point, the thickness at the center is the largest, and the thickness data decreases successively near the edge.

[0086] According to the type of each simulated foreign body and the thickness data of each part, and the intensity of the current X-ray source, the simulated grayscale data of each part of each simulated foreign body is searched and obtained from the pre-stored X-ray foreign body image grayscale database.

[0087] In one embodiment, based on the above embodiment, the same parts as those in the above embodiment will not be described one by one in this embodiment. This embodiment provides a method for generating a foreign body detection image, wherein:

[0088] The grayscale image of the simulated foreign body test card is superimposed with the grayscale image of the object to be tested to generate a foreign body detection image; specifically comprising:

[0089] The grayscale image of the object to be tested and the grayscale image of the simulated foreign body test card are superimposed pixel by pixel, and the foreign body detection image is calculated by the following formula:

[0090] R(x,y)=F(x,y)+T(x,y)-B(x,y);

[0091] Among them, F(x,y) is the actual grayscale value of the pixel point at the coordinate point (x,y) on the grayscale image of the object to be inspected; T(x,y) is the simulated grayscale value of the pixel point at the coordinate point (x,y) on the grayscale image of the simulated foreign body test card; B(x,y) is the grayscale value of the unobstructed X-ray imaging; R(x,y) is the grayscale value of the pixel point at the coordinate point (x,y) on the foreign body detection image after the grayscale image of the object to be inspected and the grayscale image of the simulated foreign body test card are superimposed.

[0092] Exemplarily, the pixel-superposition of the image of the object to be tested and the simulated foreign body test card to obtain the target image includes:

[0093] At the coordinate point (x, y), the thickness of the object to be tested is d1, the thickness of the foreign matter in the simulated foreign matter test card is d2, and the fixed absorption coefficients corresponding to the object to be tested and the foreign matter are μ1 and μ2 respectively. Then, the intensities of the X-ray with an initial energy of I0 after passing through the object to be tested and the foreign matter are respectively:

[0094]

[0095]

[0096] in, is the intensity of X-rays with an initial energy of I0 passing through the object to be tested; It is the intensity of X-rays with initial energy I0 after passing through the foreign matter.

[0097] The intensity of the radiation after passing through the object to be tested and the foreign matter in turn is:

[0098]

[0099] in, It is the intensity of X-rays with an initial energy of I0 after passing through the object to be tested and the foreign matter.

[0100] The ray intensity is expressed as the grayscale of the image after X-ray imaging:

[0101] F(x,y)=ln(I d1 (x,y))=ln(I0(x,y))-μ1d1;

[0102] T(x,y)=ln(I d2(x,y))=ln(I0(x,y))-μ2d2;

[0103] R(x,y)=ln(I d12 (x,y))=ln(I0(x,y))-(μ1d1+μ2d2);

[0104] R(x,y)=ln(I d12 (x,y))=ln(I d1 (x,y))+ln(I d2 (x,y))-ln(I0(x,y));

[0105] R(x,y)=F(x,y)+T(x,y)-B(x,y);

[0106] Among them, F(x,y) is the actual grayscale value of the pixel point at the coordinate point (x,y) on the image of the object to be inspected; T(x,y) is the simulated grayscale value of the pixel point at the coordinate point (x,y) on the simulated foreign body test card and image; B(x,y) is the grayscale value of the unobstructed X-ray imaging; R(x,y) is the target image after the image of the object to be inspected and the image of the simulated foreign body test card are superimposed.

[0107] The present invention provides a device for generating a foreign body detection image, for example Figure 2 As shown, including:

[0108] The information receiving module 101 is used to receive a foreign object attribute setting instruction.

[0109] The foreign body setting module 102 is used to set the basic properties of each simulated foreign body according to the foreign body property setting instruction.

[0110] Specifically, setting the basic properties of the simulated foreign body test card refers to setting the basic properties of the foreign body in the software, wherein the basic properties include the type of foreign body, size (different sizes have different corresponding thickness data), quantity, etc.

[0111] The intensity acquisition module 103 is used to acquire the intensity of the current X-ray source.

[0112] Specifically, the intensity of the X-ray source used by the X-ray detection equipment may be different if the object to be detected is different. Before detection, it is necessary to obtain the intensity of the current X-ray source, that is, the intensity of the X-ray source when detecting the object to be detected, to ensure that the subsequent synthesized or superimposed grayscale image is obtained under the same intensity X-ray source.

[0113] The grayscale acquisition module 104 is used to acquire the simulated grayscale data of each simulated foreign body according to the basic properties of each simulated foreign body, the intensity of the current X-ray source, and based on a pre-stored X-ray foreign body image grayscale database.

[0114] Among them, the pre-stored X-ray foreign body image grayscale database is based on the image grayscale values ​​of foreign bodies of different types and thicknesses under X-ray source scanning of different intensities, to establish an X-ray foreign body image grayscale database of different types of foreign bodies. Specifically, please refer to the above foreign body detection image generation method embodiment, which will not be repeated here. The information receiving module 101 is also used to receive the grayscale image of the object to be detected under the current X-ray source detection scan.

[0115] The image generation module 105 is used to superimpose the simulated foreign objects on the grayscale image of the object to be inspected according to the basic properties of the simulated foreign objects and the simulated grayscale data to generate a foreign object detection image.

[0116] Specifically, after obtaining the grayscale image of the object to be inspected, the foreign object can be superimposed on the grayscale image of the object to be inspected according to the basic properties of each simulated foreign object and the simulated grayscale data to obtain a foreign object detection image. The specific implementation methods of superposition can also be diverse, and reference can be made to the previous method embodiments. Exemplarily, the basic properties of the simulated foreign object test card are set, and the corresponding simulated foreign object test card grayscale image is calculated and generated based on the X-ray image grayscale database in combination with the intensity of the current X-ray source. After obtaining the grayscale image of the object to be inspected, the grayscale image of the object to be inspected and the grayscale image of the simulated foreign object test card are superimposed to calculate and obtain the target image.

[0117] In this embodiment, a simulated test piece image is generated by calculation, and is corrected and then superimposed according to the image of the object under test at the corresponding position to obtain a foreign matter detection image.

[0118] In one embodiment, the image generation module specifically includes:

[0119] The test card image generation submodule is used to generate a grayscale image of a simulated foreign body test card according to the basic properties of each simulated foreign body and the simulated grayscale data; the grayscale image of the simulated foreign body test card has the same resolution as the grayscale image of the object to be tested.

[0120] The superposition generation submodule is used to superimpose the grayscale image of the simulated foreign body test card with the grayscale image of the object to be detected to generate a foreign body detection image.

[0121] Specifically, the object to be inspected is sent into the detection channel and subjected to X-ray scanning, which will generate a grayscale image of the object to be inspected. After the grayscale image of the object to be inspected is obtained, the grayscale image of the simulated foreign body test card can be superimposed to calculate and generate the target image; of course, the resolution of the grayscale image of the object to be inspected and the grayscale image of the simulated foreign body test card are the same.

[0122] In one embodiment, the basic attributes of each simulated foreign body include: type, quantity, location, shape, and size of the simulated foreign body.

[0123] The grayscale acquisition module specifically includes:

[0124] The thickness acquisition submodule is used to acquire the thickness data of each part of each simulated foreign object according to the shape and size data of each simulated foreign object.

[0125] The grayscale search submodule is used to search and obtain the simulated grayscale data of each part of each simulated foreign body from the pre-stored X-ray foreign body image grayscale database according to the type of each simulated foreign body and the thickness data of each part and the intensity of the current X-ray source.

[0126] Specifically, based on the set basic properties of the simulated foreign body test card, a foreign body thickness map of the simulated foreign body test card with a specified resolution is obtained.

[0127] The basic attributes include period, type, quantity, size and position. The foreign matter includes any one or more of stainless steel ball foreign matter, stainless steel wire foreign matter, ceramic ball foreign matter, resin ball foreign matter, rubber ball foreign matter, glass ball foreign matter and aluminum ball foreign matter.

[0128] Each pixel point in the foreign matter thickness map is the foreign matter thickness at the position corresponding to the pixel point.

[0129] For example, the type, size and number of foreign matter are set in the software, and a specific foreign matter thickness map with the same resolution is obtained according to the resolution of the X-ray image of the object under test. Each pixel represents the thickness of the foreign matter at that location. If there is no foreign matter at that point, the foreign matter thickness at that point is 0, that is, blank. If there is a foreign matter at that point, the thickness at the center is the largest, and the thickness data decreases successively near the edge.

[0130] According to the type of each simulated foreign body and the thickness data of each part, and the intensity of the current X-ray source, the simulated grayscale data of each part of each simulated foreign body is searched and obtained from the pre-stored X-ray foreign body image grayscale database.

[0131] In one embodiment, the superposition generation submodule specifically includes:

[0132] The calculation unit is used to superimpose the grayscale image of the object to be detected and the grayscale image of the simulated foreign body test card pixel by pixel, and calculate the foreign body detection image by the following formula:

[0133] R(x,y)=F(x,y)+T(x,y)-B(x,y);

[0134] Among them, F(x,y) is the actual grayscale value of the pixel point at the coordinate point (x,y) on the grayscale image of the object to be inspected; T(x,y) is the simulated grayscale value of the pixel point at the coordinate point (x,y) on the grayscale image of the simulated foreign body test card; B(x,y) is the grayscale value of the unobstructed X-ray imaging; R(x,y) is the grayscale value of the pixel point at the coordinate point (x,y) on the foreign body detection image after the grayscale image of the object to be inspected and the grayscale image of the simulated foreign body test card are superimposed.

[0135] Exemplarily, the pixel-superposition of the image of the object to be tested and the simulated foreign body test card to obtain the target image includes:

[0136] At the coordinate point (x, y), the thickness of the object to be tested is d1, the thickness of the foreign matter in the simulated foreign matter test card is d2, and the fixed absorption coefficients corresponding to the object to be tested and the foreign matter are μ1 and μ2 respectively. Then, the intensities of the X-ray with an initial energy of I0 after passing through the object to be tested and the foreign matter are respectively:

[0137]

[0138]

[0139] in, is the intensity of X-rays with an initial energy of I0 passing through the object to be tested; It is the intensity of X-rays with an initial energy of I0 after passing through the foreign matter.

[0140] The intensity of the radiation after passing through the object to be tested and the foreign matter in turn is:

[0141]

[0142] in, It is the intensity of X-rays with an initial energy of I0 after passing through the object to be tested and the foreign matter.

[0143] The ray intensity is expressed as the grayscale of the image after X-ray imaging:

[0144] F(x,y)=ln(I d1 (x,y))=ln(I0(x,y))-μ1d1;

[0145] T(x,y)=ln(I d2 (x,y))=ln(I0(x,y))-μ2d2;

[0146] R(x,y)=ln(I d12 (x,y))=ln(I0(x,y))-(μ1d1+μ2d2);

[0147] R(x,y)=ln(I d12 (x,y))=ln(I d1 (x,y))+ln(I d2 (x,y))-ln(I0(x,y));

[0148] R(x,y)=F(x,y)+T(x,y)-B(x,y);

[0149] Among them, F(x,y) is the actual grayscale value of the pixel point at the coordinate point (x,y) on the image of the object to be inspected; T(x,y) is the simulated grayscale value of the pixel point at the coordinate point (x,y) on the simulated foreign body test card and image; B(x,y) is the grayscale value of the unobstructed X-ray imaging; R(x,y) is the target image after the image of the object to be inspected and the image of the simulated foreign body test card are superimposed.

[0150] The present invention provides a foreign body precision detection method, for example, Figure 3 As shown, including:

[0151] S201 When the accuracy of detecting foreign matter needs to be verified, a grayscale image of the object to be detected under the current X-ray source detection scan is obtained.

[0152] S202 retrieves a pre-acquired grayscale image of a simulated foreign body test card; the grayscale image of the simulated foreign body test card is generated based on the set basic properties of each simulated foreign body, the current X-ray source intensity, and a pre-stored X-ray image grayscale database.

[0153] The X-ray image grayscale database is established based on the image grayscale values ​​of foreign bodies of different types and thicknesses under X-ray source scanning of different intensities. Specifically, for example, the corresponding X-ray image grayscale database is established using the different thicknesses of foreign bodies and the corresponding X-ray source high voltage values; wherein the foreign bodies include stainless steel ball foreign bodies, stainless steel wire foreign bodies, ceramic ball foreign bodies, resin ball foreign bodies, rubber ball foreign bodies, glass ball foreign bodies and aluminum ball foreign bodies. Of course, the foreign bodies may not be spherical, but may be in other shapes, such as square, cylindrical, or even irregular shapes.

[0154] Exemplarily, the thickness of various foreign bodies and the high voltage value of the X-ray source are used in advance to establish an X-ray image grayscale database, and each table in the database corresponds to each type of foreign body.

[0155] Taking 2.7g / cm3 ceramic foreign matter as an example, the following table is obtained through experiments:

[0156] <![CDATA[2.7g / cm 3 Ceramics]]> 0.1mm thick 0.2mm thick 0.3mm thick 0.4mm thick 0.5mm thick … 30kv ray source t(30,0.1) t(30,0.2) t(30,0.3) t(30,0.4) t(30,0.5) 40kv ray source t(40,0.1) t(40,0.2) t(40,0.3) t(40,0.4) t(40,0.5) 50kv radiation source t(50,0.1) t(50,0.2) t(50,0.3) t(50,0.4) t(50,0.5) 60kv ray source t(60,0.1) t(60,0.2) t(60,0.3) t(60,0.4) t(60,0.5) …

[0157] S203: Superimpose the grayscale image of the simulated foreign body test card with the grayscale image of the object to be tested to generate a foreign body detection image.

[0158] S204 uses a preset foreign body recognition algorithm model to perform foreign body detection and recognition on the foreign body detection image to determine the accuracy of foreign body detection. Specifically, the preset foreign body recognition algorithm model is the foreign body recognition algorithm model currently used to detect the object to be detected.

[0159] The target image obtained by superimposing in step S203 is a grayscale image containing foreign matter and the object to be inspected, which is actually equivalent to a grayscale image formed after simulating the object to be inspected containing foreign matter through X-ray scanning. However, the present application does not need to put a foreign matter test card on the object to be inspected every time to verify the detection accuracy, but only needs to simulate and generate the foreign matter test card image in the above manner, and superimpose the grayscale image of the foreign matter test card on the grayscale image of the object to be inspected by superimposing calculation, so as to obtain a result image (i.e., a target image) of the real object to be inspected image superimposed with the simulated test card image under the previously set X-ray intensity.

[0160] At the same time, since the number and positions of the simulated foreign body test cards are known in advance, the number of missed alarms and false alarms of foreign body detection can be verified by comparing the results of the foreign body detection algorithm.

[0161] In the prior art, the current methods in the industry for the three problems in the background technology include: 1. Foreign matter test card manufacturers need to strictly control the accuracy and purity of each small foreign matter in the card to ensure the consistency of the test card. 2. Users need to buy several foreign matter test cards to obtain the detection accuracy of various types of foreign matter. 3. Each time the foreign matter test card is placed in different positions and tested several times, the detection accuracy of each different position is obtained. 4. All test cards are cleaned regularly to ensure that no secondary contamination caused by the test cards occurs. It can be seen that there is no particularly good method in the prior art to deal with the problems of the background technology.

[0162] In this embodiment, a simulated test piece image is generated by calculation, corrected and then superimposed according to the image of the object under test at the corresponding position, and the accuracy of foreign body detection is verified by comparing the foreign body detection algorithm.

[0163] In one embodiment, the step of acquiring the grayscale image of the simulated foreign body test card specifically includes:

[0164] Receive foreign body attribute setting instructions.

[0165] According to the foreign body property setting instruction, the type, quantity, position, shape and size of the foreign body on the simulated foreign body test card are set.

[0166] Specifically, setting the basic properties of the simulated foreign body test card refers to setting the basic properties of the foreign body in the software, wherein the basic properties include the type of foreign body, size (different sizes have different corresponding thickness data), quantity, etc.

[0167] Since the user can set the type, size, quantity, thickness, position, etc. of the foreign matter on the simulated foreign matter test card, the user can set the same or different types of foreign matter in multiple locations, such as evenly setting 18 ceramic ball foreign matters of different sizes on the simulated foreign matter test card. Then, combined with the intensity of the X-ray source set previously, the grayscale values ​​corresponding to each part of the 18 ceramic balls can be found in the ceramic foreign matter grayscale image data table under the condition of the current X-ray intensity, combined with the properties of the 18 ceramic ball foreign matters (such as size and thickness), and finally combined with the locations where the 18 ceramic foreign matters are set, the corresponding ceramic foreign matter test card grayscale image is obtained. In this way, the foreign matter detection accuracy of each position can be measured at one time in the future.

[0168] According to the shape and size of each foreign object on the simulated foreign object test card, the thickness data of each part of each foreign object is obtained.

[0169] Specifically, based on the set basic properties of the simulated foreign matter test card, a foreign matter thickness map of the simulated foreign matter test card with a specified resolution is obtained.

[0170] The basic attributes include period, type, quantity, size and position. The foreign matter includes any one or more of stainless steel ball foreign matter, stainless steel wire foreign matter, ceramic ball foreign matter, resin ball foreign matter, rubber ball foreign matter, glass ball foreign matter and aluminum ball foreign matter.

[0171] Each pixel point in the foreign matter thickness map is the foreign matter thickness at the position corresponding to the pixel point.

[0172] For example, the type, size and number of foreign matter are set in the software, and a specific foreign matter thickness map with the same resolution is obtained according to the resolution of the X-ray image of the object under test. Each pixel represents the thickness of the foreign matter at that location. If there is no foreign matter at that point, the foreign matter thickness at that point is 0, that is, blank. If there is a foreign matter at that point, the thickness at the center is the largest, and the thickness data decreases successively near the edge.

[0173] According to the number and position of foreign objects on the simulated foreign object test card, and the thickness data of each part of each corresponding foreign object, a foreign object thickness map of the simulated foreign object test card is obtained; the foreign object thickness map is used to indicate the distribution of various types of foreign objects on the simulated foreign object test card, and the thickness data corresponding to each part of each foreign object; and the resolution of the foreign object thickness map is the same as the resolution of the foreign object detection image.

[0174] According to the set intensity of the X-ray source and the pre-stored X-ray foreign body image grayscale database, the foreign body thickness map of the simulated foreign body test card is converted into the foreign body grayscale map of the simulated foreign body test card; the set intensity of the X-ray source is the same as the intensity of the current X-ray source.

[0175] In one embodiment, the method of using a preset foreign body recognition algorithm model to perform foreign body detection and recognition on the foreign body detection image to determine the accuracy of foreign body detection specifically includes:

[0176] The foreign object detection image is subjected to foreign object detection by using a preset foreign object recognition algorithm model to detect the number and position of foreign objects on the foreign object detection image.

[0177] According to the number and position of foreign objects detected on the foreign object detection image, combined with the number and position of foreign objects set on the simulated foreign object test card, the number of missed reports and the number of false alarms in foreign object detection are obtained to obtain the accuracy of the foreign object detection.

[0178] In one embodiment, the grayscale image of the simulated foreign body test card is superimposed with the grayscale image of the object to be detected to generate a foreign body detection image; specifically comprising:

[0179] The grayscale image of the simulated foreign body test card and the grayscale image of the object to be tested are superimposed and calculated by the following formula to obtain a foreign body detection image:

[0180] R(x,y)=F(x,y)+T(x,y)-B(x,y);

[0181] Among them, F(x,y) is the actual grayscale value of the pixel point at the coordinate point (x,y) on the grayscale image of the object to be inspected; T(x,y) is the simulated grayscale value of the pixel point at the coordinate point (x,y) on the grayscale image of the simulated foreign body test card; B(x,y) is the grayscale value of the unobstructed X-ray imaging; R(x,y) is the grayscale value of the pixel point at the coordinate point (x,y) on the foreign body detection image after the grayscale image of the object to be inspected and the grayscale image of the simulated foreign body test card are superimposed.

[0182] In one embodiment, in the formula R(x,y)=F(x,y)+T(x,y)-B(x,y),

[0183] F(x,y)=ln(I0(x,y))-μ1d1;

[0184] T(x,y)=ln(I0(x,y))-μ2d2;

[0185] B(x,y)=ln(I0(x,y));

[0186] Wherein: at the coordinate point (x, y), the thickness of the object to be tested is d1, and the thickness of the foreign matter in the simulated foreign matter test card is d2; the fixed absorption coefficients corresponding to the object to be tested and the foreign matter are μ1 and μ2 respectively; I0(x, y) represents the initial ray intensity without shielding at the coordinate point (x, y).

[0187] Exemplarily, the pixel-superposition of the image of the object to be tested and the simulated foreign body test card to obtain the target image includes:

[0188] At the coordinate point (x, y), the thickness of the object to be tested is d1, the thickness of the foreign matter in the simulated foreign matter test card is d2, and the fixed absorption coefficients corresponding to the object to be tested and the foreign matter are μ1 and μ2 respectively. Then, the intensities of the X-ray with an initial energy of I0 after passing through the object to be tested and the foreign matter are respectively:

[0189]

[0190]

[0191] in, is the intensity of X-rays with an initial energy of I0 passing through the object to be tested; It is the intensity of X-rays with initial energy I0 after passing through the foreign matter.

[0192] The intensity of the radiation after passing through the object to be tested and the foreign matter in turn is:

[0193]

[0194] in, It is the intensity of X-rays with an initial energy of I0 after passing through the object to be tested and the foreign matter.

[0195] The ray intensity is expressed as the grayscale of the image after X-ray imaging:

[0196] F(x,y)=ln(I d1 (x,y))=ln(I0(x,y))-μ1d1;

[0197] T(x,y)=ln(I d2 (x,y))=ln(I0(x,y))-μ2d2;

[0198] R(x,y)=ln(I d12 (x,y))=ln(I0(x,y))-(μ1d1+μ2d2);

[0199] R(x,y)=ln(I d12 (x,y))=ln(I d1(x,y))+ln(I d2 (x,y))-ln(I0(x,y));

[0200] R(x,y)=F(x,y)+T(x,y)-B(x,y);

[0201] Among them, F(x,y) is the actual grayscale value of the pixel point at the coordinate point (x,y) on the image of the object to be inspected; T(x,y) is the simulated grayscale value of the pixel point at the coordinate point (x,y) on the simulated foreign body test card and image; B(x,y) is the grayscale value of the unobstructed X-ray imaging; R(x,y) is the target image after the image of the object to be inspected and the image of the simulated foreign body test card are superimposed.

[0202] Based on the same technical concept, the present invention also provides a foreign body precision detection device, which corresponds to the foreign body precision detection method described above. Specifically, the foreign body precision detection device of this embodiment is as follows: Figure 4 As shown, including:

[0203] The scanning module 201 is used to obtain a grayscale image of the object to be detected under the current X-ray source detection scan when the accuracy of detecting foreign matter needs to be verified.

[0204] The retrieval module 202 is used to retrieve the pre-acquired grayscale image of the simulated foreign body test card; the grayscale image of the simulated foreign body test card is generated according to the set basic properties of each simulated foreign body, the current X-ray source intensity, and the pre-stored X-ray image grayscale database.

[0205] Image overlay module 203, for superimposing the grayscale image of the simulated foreign body test card with the grayscale image of the object to be tested to generate a foreign body detection image.

[0206] The detection and identification module 204 is used to use a preset foreign body identification algorithm model to perform foreign body detection and identification on the foreign body detection image to determine the accuracy of foreign body detection.

[0207] In one embodiment, it further includes:

[0208] The simulated foreign body acquisition module is used to acquire the grayscale image of the simulated foreign body test card; the simulated foreign body acquisition module specifically includes:

[0209] The instruction receiving submodule is used to receive the foreign body attribute setting instruction.

[0210] The setting submodule is used to set the type, quantity, position, shape and size of the foreign matter on the simulated foreign matter test card according to the foreign matter attribute setting instruction.

[0211] The thickness acquisition submodule is used to acquire the thickness data of each part of each foreign object according to the shape and size of each foreign object on the simulated foreign object test card.

[0212] The thickness map generating submodule is used to obtain the foreign body thickness map of the simulated foreign body test card according to the number and position of the foreign bodies on the simulated foreign body test card, and the thickness data of each part of each corresponding foreign body; the foreign body thickness map is used to indicate the distribution of various types of foreign bodies on the simulated foreign body test card, and the thickness data corresponding to each part of each foreign body; and the resolution of the foreign body thickness map is the same as the resolution of the foreign body detection image.

[0213] The grayscale image generation submodule is used to convert the foreign matter thickness map of the simulated foreign matter test card into the foreign matter grayscale map of the simulated foreign matter test card according to the set X-ray source intensity and the pre-stored X-ray foreign matter image grayscale database; the set X-ray source intensity is the same as the current X-ray source intensity.

[0214] In one embodiment, the detection and identification module specifically includes:

[0215] The detection submodule is used to perform foreign object detection on the foreign object detection image through a preset foreign object recognition algorithm model, and detect the number and position of foreign objects on the foreign object detection image.

[0216] A verification submodule, for obtaining the number of missed reports and the number of false reports of foreign object detection according to the number and positions of foreign objects detected on the foreign object detection image, combined with the number and positions of foreign objects set on the simulated foreign object test card, to obtain the accuracy of the foreign object detection; and / or

[0217] The image overlay module specifically includes:

[0218] The superposition calculation submodule is used to superimpose the grayscale image of the simulated foreign body test card and the grayscale image of the object to be detected to obtain a foreign body detection image by the following formula:

[0219] R(x,y)=F(x,y)+T(x,y)-B(x,y);

[0220] Among them, F(x,y) is the actual grayscale value of the pixel point at the coordinate point (x,y) on the grayscale image of the object to be inspected; T(x,y) is the simulated grayscale value of the pixel point at the coordinate point (x,y) on the grayscale image of the simulated foreign body test card; B(x,y) is the grayscale value of the unobstructed X-ray imaging; R(x,y) is the grayscale value of the pixel point at the coordinate point (x,y) on the foreign body detection image after the grayscale image of the object to be inspected and the grayscale image of the simulated foreign body test card are superimposed.

[0221] In this embodiment, the device can apply the above-mentioned foreign body precision detection method, and the same parts will not be repeated one by one. The device calculates and generates a simulated test piece image, and corrects and superimposes it according to the image of the object under test at the corresponding position. The accuracy of foreign body detection is verified by comparing the foreign body detection algorithm.

[0222] Finally, the present application also provides a foreign body detection device, which includes the image generation device for foreign body detection of any of the above embodiments. After the foreign body detection device includes the image generation device for foreign body detection, the corresponding foreign body detection image can be obtained according to the needs of the user for subsequent foreign body detection accuracy verification, or as an image sample for training a foreign body recognition model.

[0223] In another embodiment, the foreign body detection device provided by the present application includes the foreign body accuracy detection device provided by any of the above embodiments. After the foreign body detection device includes the image generation device for foreign body detection, it can generate corresponding foreign body detection images according to user needs, use the current foreign body recognition algorithm model to identify the foreign body detection image, and then verify the detection accuracy of the foreign body detection device.

[0224] In one embodiment, the foreign matter detection device provided in this embodiment adopts the foreign matter accuracy detection method of the present application to perform foreign matter accuracy verification, including the steps of:

[0225] 1. Use the thickness of various foreign bodies and the high voltage value of the X-ray source in advance to establish an X-ray image grayscale database, and each table in the database corresponds to each type of foreign body.

[0226] 2. Set the type, size and quantity of foreign matter in the software, and obtain a specific foreign matter thickness map with the same resolution according to the resolution of the X-ray image of the object being inspected. Each pixel represents the thickness of the foreign matter at that location. If there is no foreign matter at that point, the foreign matter thickness at that point is 0, that is, blank. If there is a foreign matter at that point, the thickness at the center is the largest, and the thickness data decreases in sequence near the edge.

[0227] 3. Generate a grayscale image of a specific foreign body based on the current X-ray source parameters and the specific foreign body thickness map. By searching the X-ray source parameters and thickness data in the database generated in step 1, the thickness data of each point is converted into grayscale data. If the X-ray source parameters or thickness are not in the table, the nearest point is used for interpolation calculation to obtain the corresponding grayscale data.

[0228] Taking a 100*100 pixel X-ray image of the object under test as an example, if 9 ceramic ball foreign bodies are required, according to the above steps 1-3, the following can be obtained: Figure 5 Grayscale image of the simulated test patch shown.

[0229] 4. The image of the object under test and the image of the simulated test piece are superimposed pixel by pixel. The superimposed data includes the following: the real image of the object under test, the image of the simulated test piece under the same ray energy, and the ray energy data. The superposition principle of these three data is derived as follows:

[0230] Assuming that at (x, y), the thickness of the food part is d1, the thickness of the foreign body part is d2, and the fixed absorption coefficients associated with the food and foreign body are μ1 and μ2 respectively, then the intensity of the X-ray with an initial energy of I0 after passing through the two substances is:

[0231]

[0232]

[0233] The intensity of the ray after passing through the two in turn is:

[0234]

[0235] The intensity of the rays after passing through different materials is expressed as the grayscale of the image after X-ray imaging:

[0236] F(x,y)=ln(I d1 (x,y))=ln(I0(x,y))-μ1d1

[0237] T(x,y)=ln(I d2 (x,y))=ln(I0(x,y))-μ2d2

[0238] R(x,y)=ln(I d12 (x,y))=ln(I0(x,y))-(μ1d1+μ2d2)

[0239] So: R(x,y)=ln(I d12 (x,y))=ln(I d1 (x,y))+ln(I d2 (x,y))-ln(I0(x,y))

[0240] Therefore: R(x,y)=F(x,y)+T(x,y)-B(x,y)

[0241] F(x,y) is the actual grayscale value of the pixel with coordinates (x,y) on the image of the object under test.

[0242] T(x,y) is the simulated grayscale value of the pixel with coordinates (x,y) on the test piece image.

[0243] B(x,y) is the gray value of the direct imaging of the unobstructed ray.

[0244] R(x,y) is the final superposition result of the image of the object under test and the image of the simulated test piece.

[0245] By using the above method, a result image can be obtained in which the real image of the object under test is superimposed on the image of the simulated test card under a certain ray energy.

[0246] 5. Use the foreign body detection algorithm to detect the X-ray image with the simulated foreign body test card to verify the test results of the test piece. In this way, the accuracy of the foreign body test card in all positions can be measured at one time.

[0247] 6. Since the number and position of the simulated foreign body test cards are known in advance, the number of missed alarms and false alarms of foreign body detection can be verified by comparing the results of the foreign body detection algorithm.

[0248] The type, quantity, size and position of foreign matter in the simulated test card can be set arbitrarily. There are two ways to set the position of foreign matter:

[0249] 1. Evenly distribute the images of the inspected object. For example, if the image of the inspected object is 1000*1000 pixels and 100 foreign objects need to be inserted, each foreign object image is evenly distributed in the inspected object image in a 10*10 distribution. In this way, the average foreign object detection accuracy of the current inspected object image can be obtained.

[0250] 2. The user can arbitrarily specify the distribution position of the foreign body thumbnail, which is used to detect the foreign body detection accuracy at a specific position.

[0251] The steps for automatic regular inspection of detection accuracy in actual production are as follows:

[0252] 1. Set the current detection radiation energy and foreign body recognition algorithm model.

[0253] 2. Set the period, type, quantity, size and position of the timed simulation test card insertion, combine the current ray energy, and use the preset database to calculate and generate the corresponding test card image.

[0254] 3. Start detection.

[0255] 4. During the test, the actual image of the object to be tested is generated in real time according to the above calculation method and superimposed with the image of the simulated inserted test card to automatically verify whether the test accuracy has changed.

[0256] 5. If there are abnormal numbers of missed and false alarms in the foreign object detection results, the device will automatically alarm.

[0257] In this embodiment, a simulated test piece image is generated by calculation, and is corrected and then superimposed according to the image of the object under test at the corresponding position. The accuracy of foreign body detection is verified by comparing the foreign body detection algorithm.

[0258] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned program modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program units or modules to complete all or part of the functions described above. The program modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into a processing unit, and the above-mentioned integrated unit can be implemented in the form of hardware or in the form of software program units. In addition, the specific names of the program modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application.

[0259] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0260] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed with hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0261] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. Exemplarily, the device embodiments described above are merely schematic. Exemplarily, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation. Exemplarily, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.

[0262] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0263] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0264] It should be noted that the above embodiments can be freely combined as needed. The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered as the protection scope of the present invention.

Claims

1. A method for generating a foreign body detection image, characterized in that: include: Receive foreign body attribute setting instructions; According to the foreign body property setting instruction, the basic properties of each simulated foreign body are set; Get the intensity of the current X-ray source; According to the basic properties of each simulated foreign body and the intensity of the current X-ray source, based on a pre-stored X-ray foreign body image grayscale database, obtaining simulated grayscale data of each simulated foreign body; Receive a grayscale image of the object to be inspected under the current X-ray source detection scan; According to the basic properties of each simulated foreign body and the simulated grayscale data, each simulated foreign body is superimposed on the grayscale image of the object to be inspected to generate a foreign body detection image.

2. The method for generating a foreign body detection image according to claim 1, characterized in that: The method of superimposing each simulated foreign body on the grayscale image of the object to be inspected according to the basic properties of each simulated foreign body and the simulated grayscale data to generate a foreign body detection image specifically includes: Generate a grayscale image of a simulated foreign body test card according to the basic properties of each simulated foreign body and the simulated grayscale data; the grayscale image of the simulated foreign body test card has the same resolution as the grayscale image of the object to be tested; The grayscale image of the simulated foreign body test card is superimposed with the grayscale image of the object to be tested to generate a foreign body detection image.

3. The method for generating a foreign body detection image according to claim 1 or 2, characterized in that: The basic attributes of each simulated foreign body include: type, quantity, location, shape, and size of the simulated foreign body; According to the basic properties of each simulated foreign body and the intensity of the current X-ray source, based on a pre-stored X-ray foreign body image grayscale database, the grayscale data of each simulated foreign body is obtained, specifically including: According to the shape and size data of each simulated foreign body, obtaining thickness data of each part of each simulated foreign body; According to the type of each simulated foreign body and the thickness data of each part, and the intensity of the current X-ray source, the simulated grayscale data of each part of each simulated foreign body is searched and obtained from the pre-stored X-ray foreign body image grayscale database.

4. The method for generating a foreign body detection image according to claim 2, characterized in that: The grayscale image of the simulated foreign body test card is superimposed with the grayscale image of the object to be tested to generate a foreign body detection image; specifically comprising: The grayscale image of the object to be tested and the grayscale image of the simulated foreign body test card are superimposed pixel by pixel, and the foreign body detection image is calculated by the following formula: R(x,y)=F(x,y)+T(x,y)-B(x,y); Among them, F(x, y) is the actual grayscale value of the pixel point at the coordinate point (x, y) on the grayscale image of the object to be tested; T(x, y) is the simulated grayscale value of the pixel point at the coordinate point (x, y) on the grayscale image of the simulated foreign body test card; B(x, y) is the grayscale value of the unobstructed X-ray imaging; R(x, y) is the grayscale value of the pixel point at the coordinate point (x, y) on the foreign body detection image after the grayscale image of the object to be tested and the grayscale image of the simulated foreign body test card are superimposed.

5. A device for generating a foreign body detection image, characterized in that: include: An information receiving module, used for receiving a foreign body attribute setting instruction; A foreign body setting module, used to set the basic properties of each simulated foreign body according to the foreign body property setting instruction; An intensity acquisition module, used to obtain the intensity of the current X-ray source; A grayscale acquisition module, configured to acquire simulated grayscale data of each simulated foreign body according to the basic properties of each simulated foreign body, the intensity of the current X-ray source, and based on a pre-stored X-ray foreign body image grayscale database; The information receiving module is also used to receive a grayscale image of the object to be inspected under the current X-ray source detection scan; The image generation module is used to superimpose the simulated foreign objects on the grayscale image of the object to be inspected according to the basic properties of the simulated foreign objects and the simulated grayscale data to generate a foreign object detection image.

6. The device for generating a foreign body detection image according to claim 5, characterized in that: The image generation module specifically includes: A test card image generation submodule, used to generate a grayscale image of a simulated foreign body test card according to the basic properties of each simulated foreign body and the simulated grayscale data; the grayscale image of the simulated foreign body test card has the same resolution as the grayscale image of the object to be tested; The superposition generation submodule is used to superimpose the grayscale image of the simulated foreign body test card with the grayscale image of the object to be detected to generate a foreign body detection image.

7. The device for generating a foreign body detection image according to claim 5 or 6, characterized in that: The basic attributes of each simulated foreign body include: type, quantity, location, shape, and size of the simulated foreign body; The grayscale acquisition module specifically includes: A thickness acquisition submodule, used for acquiring thickness data of each part of each simulated foreign object according to the shape and size data of each simulated foreign object; The grayscale search submodule is used to search and obtain the simulated grayscale data of each part of each simulated foreign body from the pre-stored X-ray foreign body image grayscale database according to the type of each simulated foreign body and the thickness data of each part and the intensity of the current X-ray source.

8. The device for generating a foreign body detection image according to claim 6, characterized in that: The superposition generation submodule specifically includes: The calculation unit is used to superimpose the grayscale image of the object to be detected and the grayscale image of the simulated foreign body test card pixel by pixel, and obtain the foreign body detection image by calculating the following formula: R(x,y)=F(x,y)+T(x,y)-B(x,y); Among them, F(x, y) is the actual grayscale value of the pixel point at the coordinate point (x, y) on the grayscale image of the object to be tested; T(x, y) is the simulated grayscale value of the pixel point at the coordinate point (x, y) on the grayscale image of the simulated foreign body test card; B(x, y) is the grayscale value of the unobstructed X-ray imaging; R(x, y) is the grayscale value of the pixel point at the coordinate point (x, y) on the foreign body detection image after the grayscale image of the object to be tested and the grayscale image of the simulated foreign body test card are superimposed.

9. A foreign body precision detection method, characterized in that: include: When the accuracy of detecting foreign objects needs to be verified, a grayscale image of the object to be detected under the current X-ray source detection scan is obtained; Retrieving a pre-acquired grayscale image of a simulated foreign body test card; the grayscale image of the simulated foreign body test card is generated according to the set basic properties of each simulated foreign body, the current X-ray source intensity, and a pre-stored X-ray image grayscale database; Superimposing the grayscale image of the simulated foreign body test card with the grayscale image of the object to be tested to generate a foreign body detection image; A preset foreign body recognition algorithm model is used to perform foreign body detection and recognition on the foreign body detection image to determine the accuracy of foreign body detection.

10. The foreign matter precision detection method according to claim 9, characterized in that: The step of acquiring the grayscale image of the simulated foreign body test card specifically comprises: Receive foreign body attribute setting instructions; According to the foreign body property setting instruction, the type, quantity, location, shape and size of the foreign body on the simulated foreign body test card are set; According to the shape and size of each foreign body on the simulated foreign body test card, obtaining thickness data of each part of each foreign body; According to the number and position of foreign objects on the simulated foreign object test card, and the thickness data of each part of each corresponding foreign object, a foreign object thickness map of the simulated foreign object test card is obtained; the foreign object thickness map is used to indicate the distribution of various types of foreign objects on the simulated foreign object test card, and the thickness data corresponding to each part of each foreign object; and the resolution of the foreign object thickness map is the same as the resolution of the foreign object detection image; According to the set intensity of the X-ray source and the pre-stored X-ray foreign body image grayscale database, the foreign body thickness map of the simulated foreign body test card is converted into the foreign body grayscale map of the simulated foreign body test card; the set intensity of the X-ray source is the same as the intensity of the current X-ray source.

11. The foreign matter precision detection method according to claim 9, characterized in that: The method of using a preset foreign body recognition algorithm model to perform foreign body detection and recognition on the foreign body detection image to determine the accuracy of foreign body detection specifically includes: Performing foreign object detection on the foreign object detection image by using a preset foreign object recognition algorithm model to detect the number and position of foreign objects on the foreign object detection image; According to the number and position of foreign objects detected on the foreign object detection image, combined with the number and position of foreign objects set on the simulated foreign object test card, the number of missed reports and the number of false alarms in foreign object detection are obtained to obtain the accuracy of the foreign object detection.

12. The foreign matter precision detection method according to claim 9, characterized in that: The grayscale image of the simulated foreign body test card is superimposed with the grayscale image of the object to be tested to generate a foreign body detection image; specifically comprising: The grayscale image of the simulated foreign body test card and the grayscale image of the object to be tested are superimposed and calculated by the following formula to obtain a foreign body detection image: R(x,y)=F(x,y)+T(x,y)-B(x,y); Among them, F(x, y) is the actual grayscale value of the pixel point at the coordinate point (x, y) on the grayscale image of the object to be tested; T(x, y) is the simulated grayscale value of the pixel point at the coordinate point (x, y) on the grayscale image of the simulated foreign body test card; B(x, y) is the grayscale value of the unobstructed X-ray imaging; R(x, y) is the grayscale value of the pixel point at the coordinate point (x, y) on the foreign body detection image after the grayscale image of the object to be tested and the grayscale image of the simulated foreign body test card are superimposed.

13. The foreign matter accuracy detection method according to claim 12, characterized in that: In the formula R(x, y)=F(x, y)+T(x, y)-B(x, y), F(x,y)=ln(I0(x,y))-μ1d1; T(x,y)=ln(I0(x,y))-μ2d2; B(x, y) = ln(I0(x, y)); Wherein: at the coordinate point (x, y), the thickness of the object to be tested is d1, and the thickness of the foreign matter in the simulated foreign matter test card is d2; the fixed absorption coefficients corresponding to the object to be tested and the foreign matter are μ1 and μ2 respectively; I0(x, y) represents the initial ray intensity without shielding at the coordinate point (x, y).

14. A foreign body precision detection device, characterized in that: include: The scanning module is used to obtain the grayscale image of the object to be inspected under the current X-ray source detection scan when the accuracy of foreign body detection needs to be verified; A retrieval module, used to retrieve a pre-acquired grayscale image of a simulated foreign body test card; the grayscale image of the simulated foreign body test card is generated according to the set basic properties of each simulated foreign body, the current X-ray source intensity, and a pre-stored X-ray image grayscale database; An image superposition module, used to superimpose the grayscale image of the simulated foreign body test card with the grayscale image of the object to be detected to generate a foreign body detection image; The detection and identification module is used to use a preset foreign body identification algorithm model to perform foreign body detection and identification on the foreign body detection image to determine the accuracy of foreign body detection.

15. The foreign matter precision detection device according to claim 14, characterized in that: Also includes: A simulated foreign body acquisition module is used to acquire a grayscale image of a simulated foreign body test card; The simulated foreign body acquisition module specifically includes: An instruction receiving submodule, used for receiving an instruction for setting a foreign object attribute; A setting submodule, used to set the type, quantity, position, shape and size of the foreign matter on the simulated foreign matter test card according to the foreign matter attribute setting instruction; A thickness acquisition submodule, used to acquire thickness data of each part of each foreign object according to the shape and size of each foreign object on the simulated foreign object test card; A thickness map generating submodule is used to obtain a foreign body thickness map of the simulated foreign body test card according to the number and position of foreign bodies on the simulated foreign body test card, and the thickness data of each part of each corresponding foreign body; the foreign body thickness map is used to indicate the distribution of various types of foreign bodies on the simulated foreign body test card, and the thickness data corresponding to each part of each foreign body; and the resolution of the foreign body thickness map is the same as the resolution of the foreign body detection image; The grayscale image generation submodule is used to convert the foreign matter thickness map of the simulated foreign matter test card into the foreign matter grayscale map of the simulated foreign matter test card according to the set X-ray source intensity and the pre-stored X-ray foreign matter image grayscale database; the set X-ray source intensity is the same as the current X-ray source intensity.

16. The foreign matter precision detection device according to claim 14, characterized in that: The detection and identification module specifically includes: A detection submodule, used to perform foreign object detection on the foreign object detection image by using a preset foreign object recognition algorithm model, and detect the number and position of foreign objects on the foreign object detection image; A verification submodule, for obtaining the number of missed reports and the number of false reports of foreign object detection according to the number and positions of foreign objects detected on the foreign object detection image, combined with the number and positions of foreign objects set on the simulated foreign object test card, to obtain the accuracy of the foreign object detection; and / or The image overlay module specifically includes: The superposition calculation submodule is used to superimpose the grayscale image of the simulated foreign body test card and the grayscale image of the object to be detected to obtain a foreign body detection image by the following formula: R(x,y)=F(x,y)+T(x,y)-B(x,y); Among them, F(x, y) is the actual grayscale value of the pixel point at the coordinate point (x, y) on the grayscale image of the object to be tested; T(x, y) is the simulated grayscale value of the pixel point at the coordinate point (x, y) on the grayscale image of the simulated foreign body test card; B(x, y) is the grayscale value of the unobstructed X-ray imaging; R(x, y) is the grayscale value of the pixel point at the coordinate point (x, y) on the foreign body detection image after the grayscale image of the object to be tested and the grayscale image of the simulated foreign body test card are superimposed.

17. A foreign body detection device, characterized in that: The invention comprises the foreign body detection image generating device as described in any one of claims 5 to 8.

Citation Information

Patent Citations

  • Method and x-ray inspection system, in particular for non-destructively inspecting objects

    US20160334535A1

  • Systems and Methods for Detecting Threats and Contraband in Cargo

    US20170242148A1