CN114170181A - Foreign matter detection image generation method and device, and precision detection method and device - Google Patents

Foreign matter detection image generation method and device, and precision detection method and device Download PDF

Info

Publication number
CN114170181A
CN114170181A CN202111485339.1A CN202111485339A CN114170181A CN 114170181 A CN114170181 A CN 114170181A CN 202111485339 A CN202111485339 A CN 202111485339A CN 114170181 A CN114170181 A CN 114170181A
Authority
CN
China
Prior art keywords
foreign matter
image
foreign
simulated
gray
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111485339.1A
Other languages
Chinese (zh)
Inventor
朱鹏
孔庆水
黄慧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Weixian Testing Equipment Co ltd
Original Assignee
Shanghai Weixian Testing Equipment Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Weixian Testing Equipment Co ltd filed Critical Shanghai Weixian Testing Equipment Co ltd
Priority to CN202111485339.1A priority Critical patent/CN114170181A/en
Publication of CN114170181A publication Critical patent/CN114170181A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10116X-ray image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Quality & Reliability (AREA)
  • Geometry (AREA)
  • Analysing Materials By The Use Of Radiation (AREA)

Abstract

The invention provides a foreign matter detection image generation method and device, and a foreign matter precision detection method and device; the foreign matter detection image generation method comprises the following steps: receiving a foreign matter attribute setting instruction; setting basic attributes of the simulated foreign matters according to the foreign matter attribute setting instruction; acquiring the intensity of a current X-ray source; acquiring simulation gray data of each simulation foreign matter based on a prestored X-ray foreign matter image gray database according to the basic attribute of each simulation foreign matter and the intensity of the current X-ray source; receiving a gray image of an object to be detected under the detection scanning of a current X-ray source; and superposing the simulated foreign matters on the gray level image of the object to be detected according to the basic attributes and the simulated gray level data of the simulated foreign matters to generate a foreign matter detection image. By the foreign matter detection image generation method, the foreign matter detection image can be rapidly obtained and is used for detecting the foreign matter detection precision of equipment, and the foreign matter detection precision of the equipment is detected without adopting a mode of manually delivering test pieces for many times.

Description

Foreign matter detection image generation method and device, and precision detection method and device
Technical Field
The present invention relates to the field of detection, and in particular, to a method and an apparatus for generating a foreign object detection image, and a method and an apparatus for detecting accuracy.
Background
At present, the X-ray technology is widely applied in the field of on-line detection of industrial production lines, and the structure and the state of the interior of a product can be clearly seen through an X-ray transmission image, so that possible foreign matters or defects of the product can be found. Taking a food production line as an example, when metal, ceramic plates, glass plates, stones or the like are mixed in bagged or bulk food, imaging is carried out through X-ray scanning, then the images are identified through an image processing program, and when foreign matters are found, the equipment can automatically remove products containing the foreign matters.
To better balance the sensitivity of the detection equipment, the detection equipment is verified using test cards containing various sizes and various types of foreign matter. Such as stainless steel balls, stainless steel wires, ceramic balls, resin balls, rubber balls, and aluminum balls produced by the japan society for inspection machines (JIMA), a test card containing foreign matter of one or more sizes. During testing, the product and the test card are put into a detection channel together, the detection equipment can find the foreign matters in the test card through the X-ray images of the product and the test card, and the foreign matters with different sizes found and positioned in the images are the detection sensitivity of the X-ray detection equipment to the product.
In a flow production line, products continuously pass through a detection device. In order to ensure that the state of the detection equipment is normal, production personnel throw in a test card into the production line at irregular time, and check whether the detection equipment normally finds the foreign matters, whether the sensitivity of the foreign matter identification has deviation, and whether an alarm and a removing device are normal. The checking mechanism is used for checking that the equipment normally operates, and if the foreign matter identification sensitivity is normal and the alarming and removing device normally operates, the detection equipment normally operates; if the foreign matter identification sensitivity is reduced or even no foreign matter is found, or the software detects the foreign matter but the alarm device and the removing device do not work, the detection equipment is indicated to have a fault, the production line must be stopped immediately to overhaul the faulty equipment, and the product in the period of time is recovered and detected again by normal equipment.
The existing foreign matter test card has the following problems:
1. the material type, size and quantity of the foreign matters are completely determined by the test cards, and in order to ensure the consistency of the test cards, the material and size of the foreign matters in each test card must have high purity and high precision, so that the manufacturing cost is high, and general customers cannot easily prepare all types of foreign matter test cards.
2. When the foreign object test cards are superposed at different positions of the detected object, the detection accuracy may be slightly different. For example, when the foreign matter test card is overlapped on a rice dumpling, the detection precision of the foreign matter at the thickest part of the rice dumpling is obviously lower than that of the outer package part. The existing test card only has a few foreign matters, and can be placed at different positions of an object to be tested to measure the precision of the different positions through multiple tests, so that accurate results can be obtained through multiple measurements and statistics, and the workload is increased.
3. If a plurality of foreign matter test cards are placed for a plurality of times, secondary pollution can be caused to the tested objects, the problem of bulk food is particularly troublesome, and the bulk food needs to be cleaned even after each test.
Disclosure of Invention
In order to overcome at least one technical defect, the application discloses a method and a device for generating a foreign object detection image, and a method and a device for detecting the accuracy of a foreign object. Specifically, the invention is realized by the following technologies:
in a first aspect, the present invention provides a method for generating a foreign object detection image, including: receiving a foreign matter attribute setting instruction; setting basic attributes of the simulated foreign matters according to the foreign matter attribute setting instruction; acquiring the intensity of a current X-ray source; acquiring simulation gray data of each simulation foreign matter based on a prestored X-ray foreign matter image gray database according to the basic attribute of each simulation foreign matter and the intensity of the current X-ray source; receiving a gray image of an object to be detected under the detection scanning of a current X-ray source; and superposing the simulated foreign matters on the gray level image of the object to be detected according to the basic attributes and the simulated gray level data of the simulated foreign matters to generate a foreign matter detection image.
In some embodiments, the foreign object detection image is generated by superimposing each simulated foreign object on the gray image of the object to be detected according to the basic attribute and the simulated gray data of each simulated foreign object; the method specifically comprises the following steps: generating a gray image of the simulated foreign matter test card according to the basic attribute and the simulated gray data of each simulated foreign matter; the resolution ratio of the gray level image of the simulated foreign matter test card is the same as that of the gray level image of the object to be detected; and superposing the gray level image of the simulated foreign matter test card and the gray level image of the object to be detected to generate a foreign matter detection image.
In some embodiments, the basic attributes of each simulated foreign object include: simulating the type, the number, the position, the form and the size of the foreign matters; acquiring gray data of each simulated foreign object based on a pre-stored X-ray foreign object image gray database according to the basic attribute of each simulated foreign object and the intensity of the current X-ray source, and specifically comprising the following steps: acquiring thickness data of each part of each simulated foreign body according to the shape and size data of each simulated foreign body; and searching and acquiring the simulation gray data of each part of each simulation foreign matter from a pre-stored X-ray foreign matter image gray database according to the type of each simulation foreign matter, the thickness data of each part and the intensity of the current X-ray source.
In some embodiments, the gray image of the simulated foreign matter test card is superposed with the gray image of the object to be detected to generate a foreign matter detection image; the method specifically comprises the following steps:
superposing the gray level image of the object to be detected and the gray level image of the simulated foreign matter test card pixel by pixel, and calculating to obtain a foreign matter detection image through the following formula:
R(x,y)=F(x,y)+T(x,y)-B(x,y);
f (x, y) is the actual gray value of a pixel point of a coordinate point (x, y) on the gray image of the object to be detected; t (x, y) is the simulation gray value of the pixel point of the coordinate point (x, y) on the gray image of the simulation foreign matter test card; b (X, y) is the gray value of the unshielded X-ray imaging; and R (x, y) is the gray value of the pixel point of the coordinate point (x, y) on the foreign matter detection image after the gray image of the object to be detected and the gray image of the simulated foreign matter test card are superposed.
In a second aspect, the present application discloses an apparatus for generating a foreign object detection image, comprising: the information receiving module is used for receiving a foreign matter attribute setting instruction; the foreign matter setting module is used for setting the basic attribute of each simulated foreign matter according to the foreign matter attribute setting instruction; the intensity acquisition module is used for acquiring the intensity of the current X-ray source; the gray level acquisition module is used for acquiring the simulation gray level data of each simulation foreign matter based on a prestored X-ray foreign matter image gray level database according to the basic attribute of each simulation foreign matter and the intensity of the current X-ray source; the information receiving module is also used for receiving a gray image of the object to be detected under the current X-ray source detection scanning; and the image generation module is used for superposing the simulated foreign matters on the gray level image of the object to be detected according to the basic attributes and the simulated gray level data of the simulated foreign matters to generate a foreign matter detection image.
In some embodiments, the image generation module specifically includes: the test card image generation submodule is used for generating a gray level image of the simulated foreign matter test card according to the basic attribute and the simulated gray level data of each simulated foreign matter; the resolution ratio of the gray level image of the simulated foreign matter test card is the same as that of the gray level image of the object to be detected; and the superposition generation submodule is used for superposing the gray level image of the simulated foreign matter test card and the gray level image of the object to be detected to generate a foreign matter detection image.
In some embodiments, the basic attributes of each simulated foreign object include: simulating the type, the number, the position, the form and the size of the foreign matters; the gray level obtaining module specifically comprises: the thickness acquisition submodule is used for acquiring the thickness data of each part of each simulated foreign body according to the shape and size data of each simulated foreign body; and the gray level searching submodule is used for searching and acquiring the simulation gray level data of each part of each simulation foreign matter from a pre-stored X-ray foreign matter image gray level database according to the type of each simulation foreign matter, the thickness data of each part and the intensity of the current X-ray source.
In some embodiments, the superposition generation sub-module specifically includes: the calculation unit is used for superposing the gray level image of the object to be detected and the gray level image of the simulated foreign matter test card pixel by pixel, and calculating to obtain a foreign matter detection image through the following formula:
R(x,y)=F(x,y)+T(x,y)-B(x,y);
f (x, y) is the actual gray value of a pixel point of a coordinate point (x, y) on the gray image of the object to be detected; t (x, y) is the simulation gray value of the pixel point of the coordinate point (x, y) on the gray image of the simulation foreign matter test card; b (X, y) is the gray value of the unshielded X-ray imaging; and R (x, y) is the gray value of the pixel point of the coordinate point (x, y) on the foreign matter detection image after the gray image of the object to be detected and the gray image of the simulated foreign matter test card are superposed.
In a third aspect, the present application discloses a foreign object accuracy detection method, including: when the precision of detecting foreign matters needs to be verified, acquiring a gray image of an object to be detected under the current X-ray source detection scanning; calling a gray image of a simulated foreign body test card acquired in advance; the gray level image of the simulated foreign matter test card is generated according to the set basic attribute of each simulated foreign matter, the current X-ray source intensity and a pre-stored X-ray image gray level database; superposing the gray level image of the simulated foreign matter test card and the gray level image of the object to be detected to generate a foreign matter detection image; and carrying out foreign matter detection and identification on the foreign matter detection image by adopting a preset foreign matter identification algorithm model, and determining the precision of detecting the foreign matter.
In some embodiments, the step of acquiring a gray scale image of the simulated foreign object test card; the method specifically comprises the following steps: receiving a foreign matter attribute setting instruction; setting the type, the number, the position, the form and the size of the foreign matters on the simulated foreign matter test card according to the foreign matter attribute setting instruction; acquiring thickness data of each part of each foreign matter according to the form and the size of each foreign matter on the simulated foreign matter test card; obtaining a foreign matter thickness map of the simulated foreign matter test card according to the number and the position of the foreign matters on the simulated foreign matter test card and the corresponding thickness data of each part of each foreign matter; the foreign matter thickness map is used for indicating the distribution of various types of foreign matters on the simulated foreign matter test card and the thickness data corresponding to each part of each foreign matter; and the resolution of the foreign matter thickness map is the same as that of the foreign matter detection image; converting the foreign matter thickness map of the simulated foreign matter test card into a foreign matter gray map of the simulated foreign matter test card according to the set intensity of the X-ray source and a pre-stored X-ray foreign matter image gray database; the intensity of the set X-ray source is the same as the intensity of the current X-ray source.
In some embodiments, the foreign object detection and identification of the foreign object detection image is performed by using a preset foreign object identification algorithm model, so as to determine the accuracy of detecting the foreign object; the method specifically comprises the following steps: detecting foreign matters in the foreign matter detection image through a preset foreign matter identification algorithm model, and detecting the quantity and the positions of the foreign matters in the foreign matter detection image; and according to the detected number and position of the foreign matters on the foreign matter detection image, and in combination with the number and position of the foreign matters set on the simulated foreign matter test card, obtaining the number of false reports and the number of false reports of the foreign matter detection, and obtaining the precision of the foreign matter detection.
In some embodiments, the gray image of the simulated foreign matter test card is superposed with the gray image of the object to be detected to generate a foreign matter detection image; the method specifically comprises the following steps: and (3) carrying out superposition calculation on the gray level image of the simulated foreign matter test card and the gray level image of the object to be detected to obtain a foreign matter detection image by the following formula:
R(x,y)=F(x,y)+T(x,y)-B(x,y);
f (x, y) is the actual gray value of a pixel point of a coordinate point (x, y) on the gray image of the object to be detected; t (x, y) is the simulation gray value of the pixel point of the coordinate point (x, y) on the gray image of the simulation foreign matter test card; b (X, y) is the gray value of the unshielded X-ray imaging; and R (x, y) is the gray value of the pixel point of the coordinate point (x, y) on the foreign matter detection image after the gray image of the object to be detected and the gray image of the simulated foreign matter test card are superposed.
In some embodiments, 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 measured is d1The thickness of the foreign matters in the simulated foreign matter test card is d2(ii) a The fixed absorption coefficients corresponding to the object to be measured and the foreign matter are respectively mu1And mu2;I0(x, y) represents the initial ray intensity without occlusion at coordinate point (x, y).
In a fourth aspect, the present application discloses a foreign object accuracy detection device, including: the scanning module is used for acquiring a gray image of the object to be detected under the current X-ray source detection scanning when the precision of detecting the foreign matters needs to be verified; the calling module is used for calling a pre-acquired gray level image of the simulated foreign body test card; the gray level image of the simulated foreign matter test card is generated according to the set basic attribute of each simulated foreign matter, the current X-ray source intensity and a pre-stored X-ray image gray level database; the image superposition module is used for superposing the gray level image of the simulated foreign matter test card and the gray level image of the object to be detected to generate a foreign matter detection image; and the detection and identification module is used for detecting and identifying the foreign matters in the foreign matter detection image by adopting a preset foreign matter identification algorithm model and determining the precision of detecting the foreign matters.
In some embodiments, the foreign object accuracy detection apparatus of the present application further includes: the simulated foreign matter acquisition module is used for acquiring a gray image of the simulated foreign matter test card; the simulated foreign matter acquisition module specifically comprises: the instruction receiving submodule is used for receiving a foreign matter attribute setting instruction; the setting submodule is used for setting the type, the number, the position, the form and the size of the foreign matters on the simulated foreign matter test card according to the foreign matter attribute setting instruction; the thickness acquisition submodule is used for acquiring thickness data of each part of each foreign body according to the form and the size of each foreign body on the simulated foreign body test card; the thickness map generation submodule is used for obtaining a foreign matter thickness map of the simulated foreign matter test card according to the number and the positions of the foreign matters on the simulated foreign matter test card and the corresponding thickness data of each part of each foreign matter; the foreign matter thickness map is used for indicating the distribution of various types of foreign matters on the simulated foreign matter test card and the thickness data corresponding to each part of each foreign matter; and the resolution of the foreign matter thickness map is the same as that of the foreign matter detection image; the degree map generation submodule is used for converting the foreign matter thickness map of the simulated foreign matter test card into a foreign matter gray scale map of the simulated foreign matter test card according to the set intensity of the X-ray source and a pre-stored X-ray foreign matter image gray scale database; the intensity of the set X-ray source is the same as the intensity of the current X-ray source.
In some embodiments, the detection and identification module specifically includes: the detection submodule is used for detecting foreign matters in the foreign matter detection image through a preset foreign matter recognition algorithm model, and detecting the quantity and the positions of the foreign matters in the foreign matter detection image; the verification submodule is used for acquiring the number of false reports and the number of false reports of the foreign object detection according to the number and the position of the detected foreign objects on the foreign object detection image and by combining the number and the position of the foreign objects set on the simulated foreign object test card, so that the accuracy of the foreign object detection is obtained; and/or
The image superposition module specifically comprises: the superposition calculation submodule is used for carrying out superposition calculation on the gray level image of the simulated foreign matter test card and the gray level image of the object to be detected through the following formula to obtain a foreign matter detection image:
R(x,y)=F(x,y)+T(x,y)-B(x,y);
f (x, y) is the actual gray value of a pixel point of a coordinate point (x, y) on the gray image of the object to be detected; t (x, y) is the simulation gray value of the pixel point of the coordinate point (x, y) on the gray image of the simulation foreign matter test card; b (X, y) is the gray value of the unshielded X-ray imaging; and R (x, y) is the gray value of the pixel point of the coordinate point (x, y) on the foreign matter detection image after the gray image of the object to be detected and the gray image of the simulated foreign matter test card are superposed.
In a final aspect, the present application further provides a foreign object detection apparatus, which is provided with the foreign object detection image generation device of the present application.
By adopting the method and the device for generating the foreign matter detection image, the foreign matter detection image can be obtained regularly in a software processing mode directly, and then the foreign matter detection image is provided for the foreign matter detection equipment to carry out corresponding detection, so that the precision of the foreign matter detection equipment is verified. Need not the artifical precision that comes the verification check out test set of delivering of carrying out actual foreign matter test piece, the cost of labor has been saved greatly, in addition because the scheme of this embodiment need not to adopt actual foreign matter test piece, therefore the producer also need not to prepare the different size of various different grade type foreign matter test piece and tests, therefore, the testing cost has also been reduced, and there is not the problem that the foreign matter test piece loses, and can be according to the actual demand, the foreign matter that obtains the different grade type sneaks into the foreign matter detection image of waiting to examine the thing, subsequent foreign matter precision detection of being convenient for.
By adopting the foreign matter precision detection method or device, the X-ray image generated by the foreign matter detection image generation method can be detected through the preset foreign matter recognition algorithm model, the detection result of the foreign matter detection device is verified, and as the user can set the basic attributes of the foreign matter according to the requirement, such as the type, size, quantity, position and the like of the foreign matter, the precision of the foreign matter test card at all positions can be measured at one time, so that the time and the labor are saved. In addition, the foreign matter precision detection method can be regularly adopted, precision verification is regularly carried out on the foreign matter detection equipment, and normal work of the foreign matter detection equipment is guaranteed.
Drawings
The above features, technical features, advantages and implementations of an image generation method and apparatus for foreign object detection, a foreign object accuracy detection method and apparatus will be further described in detail below with reference to the accompanying drawings.
FIG. 1 is a schematic diagram of one embodiment of a foreign object image generation method in the present invention;
FIG. 2 is a schematic view of an embodiment of a foreign object image generating apparatus according to the present invention;
FIG. 3 is a schematic diagram of one embodiment of a foreign object accuracy detection method of the present invention;
FIG. 4 is a schematic view of an embodiment of a foreign object accuracy detecting apparatus according to the present invention;
FIG. 5 is a schematic diagram of a gray scale image of an analog test strip according to the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
For the sake of simplicity, the drawings only schematically show the parts relevant to the present invention, and they do not represent the actual structure as a product. In addition, in order to make the drawings concise and understandable, components having the same structure or function in some of the drawings are only schematically illustrated or only labeled. In this document, "one" means not only "only one" but also a case of "more than one".
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
In addition, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not intended to indicate or imply relative importance.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following description will be made with reference to the accompanying drawings. It is obvious that the drawings in the following description are only some examples of the invention, and that for a person skilled in the art, other drawings and embodiments can be derived from them without inventive effort.
In one embodiment, the present invention provides a method for generating a foreign object detection image, as shown in fig. 1, including:
s101 receives a foreign matter attribute setting instruction.
S102, setting basic attributes of the simulated foreign matters according to the foreign matter attribute setting instruction.
Specifically, setting the basic attribute of the simulated foreign object test card refers to setting the basic attribute of the foreign object in software, wherein the basic attribute includes the type, size (different sizes, and different corresponding thickness data), number, and the like of the foreign object.
The user can set for the foreign matter type, size, quantity, thickness, the position etc. of simulation foreign matter by oneself according to the demand, for example, if the foreign matter detection image of these two kinds of types of ceramic foreign matter and glass foreign matter of wanting to acquire mainly, then just can set for these two kinds of foreign matter types in advance, basic data such as corresponding size, quantity, position.
S103, acquiring the intensity of the current X-ray source.
Specifically, the intensity of the X-ray source used by the X-ray detection device may also be different when the detected object is different, and the final imaged image may also be different when the intensity of the X-ray source is different. Therefore, before the detection, the intensity of the current X-ray source, that is, the intensity of the X-ray source when the object to be detected is detected, needs to be obtained first to ensure that the received X-ray source intensity is the same when the subsequent images are synthesized or superimposed, that is, the detection environment is the same.
S104, acquiring the simulation gray data of each simulation foreign matter based on a pre-stored X-ray foreign matter image gray database according to the basic attribute of each simulation foreign matter and the intensity of the current X-ray source.
The pre-stored X-ray foreign matter image gray database is an X-ray foreign matter image gray database which is established according to the image gray values of foreign matters with different types and different thicknesses under the scanning of X-ray sources with different intensities. Specifically, the intensity of the radiation source and the basic attribute of the foreign matter can be searched in a pre-stored X-ray foreign matter image gray scale database, and analog gray scale data of a foreign matter image theoretically obtained by scanning and detecting the intensity of the radiation source for the foreign matter with the basic attribute is obtained. The basic attribute of the foreign matter refers to some attributes related to the foreign matter itself, such as the type of the foreign matter, and different types of foreign matters have different absorptance for X-rays, and even if the foreign matters are of the same type, the density of the foreign matters is different, and further the absorptance for X-rays is different, so that the subsequent corresponding gray scale data are different. Further, the size and shape of the foreign object, for example, a sphere, the diameter of the sphere, etc., determine the thickness of the foreign object at each position of the foreign object, and if the thickness of the spherical foreign object is different at each position, the X-ray absorptance at each position is also different, and therefore, the analog gray scale data corresponding to each position of the foreign object is also different under the scanning of the same X-ray source.
Illustratively, an X-ray image gray database is established in advance using the thickness of various foreign matters, the high voltage value of the X-ray source (i.e., the intensity of the X-ray source) and the types of the foreign matters, for example, and each table in the database corresponds to each type of the foreign matters. Taking 2.7g/cm3 as an example, after scanning and imaging under the radiation source intensity of 30kv, the gray value of the ceramic spherical foreign body at the position with the thickness of 0.1mm is t (30,0.1), and the gray value of the image at the position with the thickness of 0.2mm is t (30, 0.2.) the following table is obtained through experiments:
Figure BDA0003396297120000101
similarly, an image gray scale data table of other types of foreign matters can be obtained, such as an image gray scale data table of a glass foreign matter, an image gray scale data table of a stainless steel foreign matter and the like, and the image gray scale data tables of the various types of foreign matters form an image gray scale database of the foreign matters, so that subsequent searching is facilitated.
S105, receiving a gray image of the object to be detected under the current X-ray source detection scanning.
S106, according to the basic attributes and the analog gray data of the analog foreign matters, the analog foreign matters are superposed on the gray image of the object to be detected to generate a foreign matter detection image.
Specifically, after the gray image of the object to be detected is obtained, the foreign object can be superimposed on the gray image of the object to be detected according to the basic attribute and the analog gray data of each analog foreign object, so as to obtain a foreign object detection image.
The method of superimposing may also be various, for example, a gray image of the simulated foreign object test card is generated according to the basic attribute of each simulated foreign object and the corresponding simulated gray data, and then the image of the simulated foreign object test card is superimposed with the gray image of the object to be detected. Or directly selecting the positions (one or more) for adding the foreign matters on the gray image of the object to be detected instead of generating the gray image of the simulated foreign matter test card, directly adding the simulated foreign matters on the positions according to the acquired basic attributes and the simulated gray data of the simulated foreign matters, calculating the gray data corresponding to the position area after adding the foreign matters on each position, and finally generating the foreign matter detection image.
By adopting the method for generating the foreign matter detection image, the foreign matter detection image can be obtained regularly in a software processing mode directly, and then the foreign matter detection image is provided for the foreign matter detection equipment to carry out corresponding detection, so that the precision of the foreign matter detection equipment is verified. Need not the artifical precision that comes the verification check out test set of delivering of carrying out actual foreign matter test piece, the cost of labor has been saved greatly, in addition because the scheme of this embodiment need not to adopt actual foreign matter test piece, therefore the producer also need not to prepare the different size of various different grade type foreign matter test piece and tests, therefore, the testing cost has also been reduced, and there is not the problem that the foreign matter test piece loses, and can be according to the actual demand, the foreign matter that obtains the different grade type sneaks into the foreign matter detection image of waiting to examine the thing, subsequent foreign matter precision detection of being convenient for.
On the other hand, by adopting the method for generating the foreign object detection image of the embodiment, a large number of different foreign object detection images can be obtained in a short time, so that a large number of samples can be provided for training the foreign object detection recognition model. In a traditional mode, a large number of detection images of the test strip and the detection object under X-ray scanning may need to be obtained actually through repeated large number of actual operations, and the scheme of the embodiment does not need to be obtained through manual delivery scanning, but can be directly obtained through the scheme of the embodiment, and according to different trained foreign matter identification models, the required foreign matter detection image can be obtained in a targeted manner to serve as a sample.
In an embodiment, based on the above embodiment, parts of the embodiment that are the same as the above embodiment are not repeated, and the embodiment provides a method for generating a foreign object detection image, where:
superposing the simulated foreign matters on the gray level image of the object to be detected according to the basic attributes and the simulated gray level data of the simulated foreign matters to generate a foreign matter detection image; the method specifically comprises the following steps:
generating a gray image of the simulated foreign matter test card according to the basic attribute and the simulated gray data of each simulated foreign matter; the gray level image of the simulated foreign matter test card has the same resolution as that of the gray level image of the object to be detected.
And superposing the gray level image of the simulated foreign matter test card and the gray level image of the object to be detected to generate a foreign matter detection image.
Specifically, the object to be detected is sent into a detection channel to be subjected to X-ray scanning, so that a gray image of the object to be detected can be generated, and after the gray image of the object to be detected is obtained, a gray image of a simulated foreign matter test card can be superposed to calculate and generate a target image; of course, the resolution of the gray image of the object to be detected and the gray image of the simulated foreign object test card are the same.
In an embodiment, based on the above embodiment, parts of the embodiment that are the same as the above embodiment are not repeated, and the embodiment provides a method for generating a foreign object detection image, where:
the basic attributes of each simulated foreign body include: simulating the type, number, location, form, and size of the foreign object.
Acquiring gray data of each simulated foreign object based on a pre-stored X-ray foreign object image gray database according to the basic attribute of each simulated foreign object and the intensity of the current X-ray source, and specifically comprising the following steps:
and acquiring thickness data of each part of each simulated foreign body according to the shape and size data of each simulated foreign body.
Specifically, a foreign matter thickness map of the simulated foreign matter test card with the specified resolution is obtained based on the set basic attributes of the simulated foreign matter test card.
Wherein the basic attributes include period, category, number, size and location. The foreign matter comprises 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.
And each pixel point in the foreign matter thickness graph is the foreign matter thickness of the corresponding position of the pixel point.
Illustratively, the type, size and number of the foreign matters are set in software, a specific foreign matter thickness map with the same resolution is obtained according to the resolution of the X-ray image of the detected object, and each pixel point represents the thickness of the foreign matters at the position. If the spot has no foreign matter, the spot has a foreign matter thickness of 0, i.e., a blank. If there is a foreign object at this point, the thickness is greatest at the center and the thickness data decreases in sequence near the edges.
And searching and acquiring the simulation gray data of each part of each simulation foreign matter from a pre-stored X-ray foreign matter image gray database according to the type of each simulation foreign matter, the thickness data of each part and the intensity of the current X-ray source.
In an embodiment, based on the above embodiment, parts of the embodiment that are the same as the above embodiment are not repeated, and the embodiment provides a method for generating a foreign object detection image, where:
superposing the gray level image of the simulated foreign matter test card and the gray level image of the object to be detected to generate a foreign matter detection image; the method specifically comprises the following steps:
superposing the gray level image of the object to be detected and the gray level image of the simulated foreign matter test card pixel by pixel, and calculating to obtain a foreign matter detection image through the following formula:
R(x,y)=F(x,y)+T(x,y)-B(x,y);
f (x, y) is the actual gray value of a pixel point of a coordinate point (x, y) on the gray image of the object to be detected; t (x, y) is the simulation gray value of the pixel point of the coordinate point (x, y) on the gray image of the simulation foreign matter test card; b (X, y) is the gray value of the unshielded X-ray imaging; and R (x, y) is the gray value of the pixel point of the coordinate point (x, y) on the foreign matter detection image after the gray image of the object to be detected and the gray image of the simulated foreign matter test card are superposed.
Exemplarily, the pixel superposition of the image of the object to be detected and the simulated foreign object test card to obtain the target image includes:
at a 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, the fixed absorption coefficients corresponding to the object to be tested and the foreign matter are respectively mu 1 and mu 2, and then the initial energy is I0The intensity of the X-ray after penetrating through the object to be measured and the foreign matter is respectively as follows:
Figure BDA0003396297120000131
Figure BDA0003396297120000132
wherein the content of the first and second substances,
Figure BDA0003396297120000133
is an initial energy of I0The X-ray of (2) passing through the object to be measuredStrength;
Figure BDA0003396297120000134
is an initial energy of I0The intensity of the X-ray after passing through the foreign matter.
The ray intensity after passing through the object to be detected and the foreign body in sequence is as follows:
Figure BDA0003396297120000135
wherein the content of the first and second substances,
Figure BDA0003396297120000136
is an initial energy of I0The intensity of the X-ray after penetrating the object to be measured and the foreign matter.
The ray intensity is expressed as image gray scale after X-ray imaging:
F(x,y)=ln(Id1(x,y))=ln(I0(x,y))-μ1d1
T(x,y)=ln(Id2(x,y))=ln(I0(x,y))-μ2d2
R(x,y)=ln(Id12(x,y))=ln(I0(x,y))-(μ1d12d2);
R(x,y)=ln(Id12(x,y))=ln(Id1(x,y))+ln(Id2(x,y))-ln(I0(x,y));
R(x,y)=F(x,y)+T(x,y)-B(x,y);
f (x, y) is the actual gray value of a pixel point of a coordinate point (x, y) on the image of the object to be detected; t (x, y) is the simulated gray value of the simulated foreign matter test card and the pixel point of the coordinate point (x, y) on the image; b (X, y) is the gray value of the unshielded X-ray image; and R (x, y) is a target image obtained by superposing the image of the object to be detected and the image of the simulated foreign body test card.
An embodiment of the present invention provides a foreign object detection image generation device, as shown in fig. 2, including:
the information receiving module 101 is configured to receive a foreign object attribute setting instruction.
And the foreign matter setting module 102 is configured to set a basic attribute of each simulated foreign matter according to the foreign matter attribute setting instruction.
Specifically, setting the basic attribute of the simulated foreign object test card refers to setting the basic attribute of the foreign object in software, wherein the basic attribute includes the type, size (different sizes, and different corresponding thickness data), number, and the like of the foreign object.
And the intensity acquisition module 103 is used for acquiring the intensity of the current X-ray source.
Specifically, the intensities of the X-ray sources used by the X-ray detection device may also be different when the detected objects are different, and before detection, the current intensity of the X-ray source, that is, the intensity of the X-ray source when the detected object is detected, needs to be obtained first to ensure that the subsequently synthesized or superimposed gray-scale image is obtained under the condition of the X-ray sources with the same intensity.
A gray scale obtaining module 104, configured to obtain, according to the basic attribute of each simulated foreign object and the intensity of the current X-ray source, simulated gray scale data of each simulated foreign object based on a pre-stored X-ray foreign object image gray scale database.
The pre-stored X-ray foreign matter image gray database is an X-ray foreign matter image gray database which is established according to the image gray values of foreign matters with different types and different thicknesses under the scanning of X-ray sources with different intensities. Specifically, reference may be made to the foregoing embodiment of the method for generating a foreign object detection image, and details are not repeated here. The information receiving module 101 is further configured to receive a gray image of the object to be detected under the current detection scan of the X-ray source.
And an image generation module 105, configured to superimpose the simulated foreign objects on the gray image of the object to be detected according to the basic attributes and the simulated gray data of the simulated foreign objects to generate a foreign object detection image.
Specifically, after the gray image of the object to be detected is obtained, the foreign object can be superimposed on the gray image of the object to be detected according to the basic attribute and the analog gray data of each analog foreign object, so as to obtain a foreign object detection image. The embodiments of the superposition may also be varied, and reference may be made to the preceding method embodiments. Illustratively, basic attributes of the simulated foreign body test card are set, and corresponding simulated foreign body test card gray level images are calculated and generated based on the X-ray image gray level database in combination with the intensity of the current X-ray source. And after the gray level image of the object to be detected is obtained, superposing the gray level image of the object to be detected and the gray level image of the simulated foreign matter test card, and calculating to obtain a target image.
In this embodiment, a foreign object detection image is obtained by generating a simulated test piece image by calculation, correcting the test piece image according to the object image at the corresponding position, and superimposing the corrected test piece image and the object image.
In one embodiment, the image generation module specifically includes:
the test card image generation submodule is used for generating a gray level image of the simulated foreign matter test card according to the basic attribute and the simulated gray level data of each simulated foreign matter; the gray level image of the simulated foreign matter test card has the same resolution as that of the gray level image of the object to be detected.
And the superposition generation submodule is used for superposing the gray level image of the simulated foreign matter test card and the gray level image of the object to be detected to generate a foreign matter detection image.
Specifically, the object to be detected is sent into a detection channel to be subjected to X-ray scanning, so that a gray image of the object to be detected can be generated, and after the gray image of the object to be detected is obtained, a gray image of a simulated foreign matter test card can be superposed to calculate and generate a target image; of course, the resolution of the gray image of the object to be detected and the gray image of the simulated foreign object test card are the same.
In one embodiment, the basic attributes of each simulated alien material include: simulating the type, number, location, form, and size of the foreign object.
The gray level obtaining module specifically comprises:
and the thickness acquisition submodule is used for acquiring the thickness data of each part of each simulated foreign body according to the form and size data of each simulated foreign body.
And the gray level searching submodule is used for searching and acquiring the simulation gray level data of each part of each simulation foreign matter from a pre-stored X-ray foreign matter image gray level database according to the type of each simulation foreign matter, the thickness data of each part and the intensity of the current X-ray source.
Specifically, a foreign matter thickness map of the simulated foreign matter test card with the specified resolution is obtained based on the set basic attributes of the simulated foreign matter test card.
Wherein the basic attributes include period, category, number, size and location. The foreign matter comprises 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.
And each pixel point in the foreign matter thickness graph is the foreign matter thickness of the corresponding position of the pixel point.
Illustratively, the type, size and number of the foreign matters are set in software, a specific foreign matter thickness map with the same resolution is obtained according to the resolution of the X-ray image of the detected object, and each pixel point represents the thickness of the foreign matters at the position. If the spot has no foreign matter, the spot has a foreign matter thickness of 0, i.e., a blank. If there is a foreign object at this point, the thickness is greatest at the center and the thickness data decreases in sequence near the edges.
And searching and acquiring the simulation gray data of each part of each simulation foreign matter from a pre-stored X-ray foreign matter image gray database according to the type of each simulation foreign matter, the thickness data of each part and the intensity of the current X-ray source.
In one embodiment, the superposition generation sub-module specifically includes:
the calculation unit is used for superposing the gray level image of the object to be detected and the gray level image of the simulated foreign matter test card pixel by pixel, and calculating to obtain a foreign matter detection image through the following formula:
R(x,y)=F(x,y)+T(x,y)-B(x,y);
f (x, y) is the actual gray value of a pixel point of a coordinate point (x, y) on the gray image of the object to be detected; t (x, y) is the simulation gray value of the pixel point of the coordinate point (x, y) on the gray image of the simulation foreign matter test card; b (X, y) is the gray value of the unshielded X-ray imaging; and R (x, y) is the gray value of the pixel point of the coordinate point (x, y) on the foreign matter detection image after the gray image of the object to be detected and the gray image of the simulated foreign matter test card are superposed.
Exemplarily, the pixel superposition of the image of the object to be detected and the simulated foreign object test card to obtain the target image includes:
at a 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, the fixed absorption coefficients corresponding to the object to be tested and the foreign matter are respectively mu 1 and mu 2, and then the initial energy is I0The intensity of the X-ray after penetrating through the object to be measured and the foreign matter is respectively as follows:
Figure BDA0003396297120000161
Figure BDA0003396297120000162
wherein the content of the first and second substances,
Figure BDA0003396297120000163
is an initial energy of I0The intensity of the X-ray transmitted through the object to be detected;
Figure BDA0003396297120000164
is an initial energy of I0The intensity of the X-ray after passing through the foreign matter.
The ray intensity after passing through the object to be detected and the foreign body in sequence is as follows:
Figure BDA0003396297120000165
wherein the content of the first and second substances,
Figure BDA0003396297120000166
is an initial energy of I0The intensity of the X-ray after penetrating the object to be measured and the foreign matter.
The ray intensity is expressed as image gray scale after X-ray imaging:
F(x,y)=ln(Id1(x,y))=ln(I0(x,y))-μ1d1
T(x,y)=ln(Id2(x,y))=ln(I0(x,y))-μ2d2
R(x,y)=ln(Id12(x,y))=ln(I0(x,y))-(μ1d12d2);
R(x,y)=ln(Id12(x,y))=ln(Id1(x,y))+ln(Id2(x,y))-ln(I0(x,y));
R(x,y)=F(x,y)+T(x,y)-B(x,y);
f (x, y) is the actual gray value of a pixel point of a coordinate point (x, y) on the image of the object to be detected; t (x, y) is the simulated gray value of the simulated foreign matter test card and the pixel point of the coordinate point (x, y) on the image; b (X, y) is the gray value of the unshielded X-ray image; and R (x, y) is a target image obtained by superposing the image of the object to be detected and the image of the simulated foreign body test card.
The present invention provides a foreign object accuracy detection method, as shown in fig. 3, including:
s201, when the precision of foreign matter detection needs to be verified, a gray image of the object to be detected under the current X-ray source detection scanning is obtained.
S202, a gray image of a simulated foreign matter test card acquired in advance is called; the gray image of the simulated foreign body test card is generated according to the set basic attribute of each simulated foreign body, the current X-ray source intensity and a pre-stored X-ray image gray database.
The X-ray image gray database is established by the X-ray image gray database of different types of foreign matters according to the image gray values of the foreign matters with different types and different thicknesses under the scanning of the X-ray sources with different intensities. Specifically, for example, different thicknesses of foreign matters and corresponding high voltage values of the X-ray source are utilized to establish a corresponding X-ray image gray database; wherein, the foreign matter comprises 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. Of course, it is also possible to use other shapes than spherical, such as square, cylindrical, or even irregular.
Illustratively, the thickness of various foreign matters and the high-voltage value of the X-ray source are used in advance to establish an X-ray image gray-scale database, and each table in the database corresponds to each foreign matter type.
Taking 2.7g/cm3 as an example of the ceramic foreign body, the following table is obtained through experiments:
2.7g/cm3ceramic material 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 ray source t(50,0.1) t(50,0.2) t(50,0.3) t(50,0.4) t(50,0.5)
60kv radiation source t(60,0.1) t(60,0.2) t(60,0.3) t(60,0.4) t(60,0.5)
S203, overlapping the gray level image of the simulated foreign matter test card with the gray level image of the object to be detected to generate a foreign matter detection image.
S204, carrying out foreign matter detection and identification on the foreign matter detection image by adopting a preset foreign matter identification algorithm model, and determining the precision of detecting the foreign matter. Specifically, the preset foreign matter identification algorithm model is a foreign matter identification algorithm model currently used for detecting the object to be detected.
The target image obtained by superimposing in step S203 is a gray image containing a foreign object and a sample, and is actually equivalent to a gray image obtained by simulating the detection of the sample containing a foreign object by X-ray scanning. However, the foreign matter test card does not need to be placed on the object to be detected each time to verify the detection precision, but only the foreign matter test card image is generated in a simulation mode through the mode, and the gray level image of the foreign matter test card is superposed on the gray level image of the object to be detected through a superposition calculation mode, so that a result image (namely a target image) of the true object to be detected image superposed simulation test card image is obtained under the intensity of the X ray set in advance.
Meanwhile, the number and the positions of the simulated foreign body test cards are predicted, so that the number of false reports and missing reports of foreign body detection can be verified by comparing the results of the foreign body detection algorithm.
In the prior art, aiming at three problems in the background art, the current methods in the industry include: 1. foreign body test card manufacturers need to strictly control the precision and purity of each small foreign body in the card, so that the consistency of the test card is ensured. 2. The user needs to buy several foreign body test cards, so as to obtain the detection precision of various foreign body types. 3. And the foreign matter test card is placed at different positions for testing for a plurality of times in each test, so that the detection precision of each different position is obtained. 4. All test cards are cleaned periodically to ensure that no secondary contamination is generated by the test cards. It is known that the prior art does not have a particularly good way to deal with the problems of the background art.
In this embodiment, the simulated test piece image is generated by calculation, corrected according to the object image at the corresponding position, and then superimposed, and the accuracy of the foreign object detection is verified by comparing with the foreign object detection algorithm.
In one embodiment, the step of acquiring a gray image of the simulated foreign object test card; the method specifically comprises the following steps:
and receiving a foreign matter attribute setting instruction.
And setting the type, the number, the position, the form and the size of the foreign matters on the simulated foreign matter test card according to the foreign matter attribute setting instruction.
Specifically, setting the basic attribute of the simulated foreign object test card refers to setting the basic attribute of the foreign object in software, wherein the basic attribute includes the type, size (different sizes, and different corresponding thickness data), number, and the like of the foreign object.
Because the user can set for foreign matter type, size, quantity, thickness, position etc. on the simulation foreign matter test card by oneself, the user can set up the foreign matter of same type or different grade type in a plurality of positions like this, for example evenly sets up 18 ceramic ball foreign matters not of uniform size on the simulation foreign matter test card. Then, by combining the intensity of the X-ray source set in the front, the gray value corresponding to each part of the 18 ceramic balls can be found by combining the attributes (such as size and thickness) of the 18 ceramic ball foreign matters under the condition of searching the current X-ray intensity in the ceramic foreign matter gray image data table, and finally, the corresponding ceramic foreign matter test card gray image can be obtained by combining the set positions of the 18 ceramic foreign matters, so that the foreign matter detection precision of each position can be measured at one time in the following process.
And acquiring thickness data of each part of each foreign matter according to the form and the size of each foreign matter on the simulated foreign matter test card.
Specifically, a foreign matter thickness map of the simulated foreign matter test card with the specified resolution is obtained based on the set basic attributes of the simulated foreign matter test card.
Wherein the basic attributes include period, category, number, size and location. The foreign matter comprises 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.
And each pixel point in the foreign matter thickness graph is the foreign matter thickness of the corresponding position of the pixel point.
Illustratively, the type, size and number of the foreign matters are set in software, a specific foreign matter thickness map with the same resolution is obtained according to the resolution of the X-ray image of the detected object, and each pixel point represents the thickness of the foreign matters at the position. If the spot has no foreign matter, the spot has a foreign matter thickness of 0, i.e., a blank. If there is a foreign object at this point, the thickness is greatest at the center and the thickness data decreases in sequence near the edges.
Obtaining a foreign matter thickness map of the simulated foreign matter test card according to the number and the position of the foreign matters on the simulated foreign matter test card and the corresponding thickness data of each part of each foreign matter; the foreign matter thickness map is used for indicating the distribution of various types of foreign matters on the simulated foreign matter test card and the thickness data corresponding to each part of each foreign matter; and the resolution of the foreign object thickness map is the same as the resolution of the foreign object detection image.
Converting the foreign matter thickness map of the simulated foreign matter test card into a foreign matter gray map of the simulated foreign matter test card according to the set intensity of the X-ray source and a pre-stored X-ray foreign matter image gray database; the intensity of the set X-ray source is the same as the intensity of the current X-ray source.
In one embodiment, the foreign object detection and identification is performed on the foreign object detection image by using a preset foreign object identification algorithm model, so as to determine the accuracy of detecting the foreign object; the method specifically comprises the following steps:
and carrying out foreign matter detection on the foreign matter detection image through a preset foreign matter recognition algorithm model, and detecting the quantity and the position of the foreign matters on the foreign matter detection image.
And according to the detected number and position of the foreign matters on the foreign matter detection image, and in combination with the number and position of the foreign matters set on the simulated foreign matter test card, obtaining the number of false reports and the number of false reports of the foreign matter detection, and obtaining the precision of the foreign matter detection.
In one embodiment, the gray image of the simulated foreign matter test card is superposed with the gray image of the object to be detected to generate a foreign matter detection image; the method specifically comprises the following steps:
and (3) carrying out superposition calculation on the gray level image of the simulated foreign matter test card and the gray level image of the object to be detected to obtain a foreign matter detection image by the following formula:
R(x,y)=F(x,y)+T(x,y)-B(x,y);
f (x, y) is the actual gray value of a pixel point of a coordinate point (x, y) on the gray image of the object to be detected; t (x, y) is the simulation gray value of the pixel point of the coordinate point (x, y) on the gray image of the simulation foreign matter test card; b (X, y) is the gray value of the unshielded X-ray imaging; and R (x, y) is the gray value of the pixel point of the coordinate point (x, y) on the foreign matter detection image after the gray image of the object to be detected and the gray image of the simulated foreign matter test card are superposed.
In one embodiment, 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 measured is d1The thickness of the foreign matters in the simulated foreign matter test card is d2(ii) a The fixed absorption coefficients corresponding to the object to be measured and the foreign matter are respectively mu1And mu2;I0(x, y) represents the initial ray intensity without occlusion at coordinate point (x, y).
Exemplarily, the pixel superposition of the image of the object to be detected and the simulated foreign object test card to obtain the target image includes:
at the coordinate point (x, y), the thickness of the object to be measured isd1, 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 respectively mu 1 and mu 2, and the initial energy is I0The intensity of the X-ray after penetrating through the object to be measured and the foreign matter is respectively as follows:
Figure BDA0003396297120000201
Figure BDA0003396297120000202
wherein the content of the first and second substances,
Figure BDA0003396297120000211
is an initial energy of I0The intensity of the X-ray transmitted through the object to be detected;
Figure BDA0003396297120000212
is an initial energy of I0The intensity of the X-ray after passing through the foreign matter.
The ray intensity after passing through the object to be detected and the foreign body in sequence is as follows:
Figure BDA0003396297120000213
wherein the content of the first and second substances,
Figure BDA0003396297120000214
is an initial energy of I0The intensity of the X-ray after penetrating the object to be measured and the foreign matter.
The ray intensity is expressed as image gray scale after X-ray imaging:
F(x,y)=ln(Id1(x,y))=ln(I0(x,y))-μ1d1
T(x,y)=ln(Id2(x,y))=ln(I0(x,y))-μ2d2
R(x,y)=ln(Id12(x,y))=ln(I0(x,y))-(μ1d12d2);
R(x,y)=ln(Id12(x,y))=ln(Id1(x,y))+ln(Id2(x,y))-ln(I0(x,y));
R(x,y)=F(x,y)+T(x,y)-B(x,y);
f (x, y) is the actual gray value of a pixel point of a coordinate point (x, y) on the image of the object to be detected; t (x, y) is the simulated gray value of the simulated foreign matter test card and the pixel point of the coordinate point (x, y) on the image; b (X, y) is the gray value of the unshielded X-ray image; and R (x, y) is a target image obtained by superposing the image of the object to be detected and the image of the simulated foreign body test card.
Based on the same technical concept, the present invention further provides a foreign object precision detection apparatus corresponding to the above-mentioned foreign object precision detection method, specifically, as shown in fig. 4, the foreign object precision detection apparatus of the present embodiment includes:
the scanning module 201 is configured to obtain a gray image of the object to be detected under the current X-ray source detection scanning when the accuracy of detecting the foreign object needs to be verified.
The calling module 202 is used for calling a pre-acquired gray level image of the simulated foreign matter test card; the gray image of the simulated foreign body test card is generated according to the set basic attribute of each simulated foreign body, the current X-ray source intensity and a pre-stored X-ray image gray database.
And the image superposition module 203 is used for superposing the gray level image of the simulated foreign matter test card and the gray level image of the object to be detected to generate a foreign matter detection image.
And the detection and identification module 204 is configured to perform foreign object detection and identification on the foreign object detection image by using a preset foreign object identification algorithm model, and determine the precision of detecting the foreign object.
In one embodiment, further comprising:
the simulated foreign matter acquisition module is used for acquiring a gray image of the simulated foreign matter test card; the simulated foreign matter acquisition module specifically comprises:
and the instruction receiving submodule is used for receiving the foreign matter attribute setting instruction.
And the setting submodule is used for setting the type, the number, the position, the form and the size of the foreign matters on the simulated foreign matter test card according to the foreign matter attribute setting instruction.
And the thickness acquisition submodule is used for acquiring the thickness data of each part of each foreign matter according to the form and the size of each foreign matter on the simulated foreign matter test card.
The thickness map generation submodule is used for obtaining a foreign matter thickness map of the simulated foreign matter test card according to the number and the positions of the foreign matters on the simulated foreign matter test card and the corresponding thickness data of each part of each foreign matter; the foreign matter thickness map is used for indicating the distribution of various types of foreign matters on the simulated foreign matter test card and the thickness data corresponding to each part of each foreign matter; and the resolution of the foreign object thickness map is the same as the resolution of the foreign object detection image.
The gray scale map generation submodule is used for converting the foreign matter thickness map of the simulated foreign matter test card into a foreign matter gray scale map of the simulated foreign matter test card according to the set intensity of the X-ray source and a pre-stored X-ray foreign matter image gray scale database; the intensity of the set X-ray source is the same as the intensity of the current X-ray source.
In one embodiment, the detection and identification module specifically includes:
and the detection submodule is used for detecting the foreign matters in the foreign matter detection image through a preset foreign matter recognition algorithm model, and detecting the quantity and the positions of the foreign matters in the foreign matter detection image.
The verification submodule is used for acquiring the number of false reports and the number of false reports of the foreign object detection according to the number and the position of the detected foreign objects on the foreign object detection image and by combining the number and the position of the foreign objects set on the simulated foreign object test card, so that the accuracy of the foreign object detection is obtained; and/or
The image superposition module specifically comprises:
the superposition calculation submodule is used for carrying out superposition calculation on the gray level image of the simulated foreign matter test card and the gray level image of the object to be detected through the following formula to obtain a foreign matter detection image:
R(x,y)=F(x,y)+T(x,y)-B(x,y);
f (x, y) is the actual gray value of a pixel point of a coordinate point (x, y) on the gray image of the object to be detected; t (x, y) is the simulation gray value of the pixel point of the coordinate point (x, y) on the gray image of the simulation foreign matter test card; b (X, y) is the gray value of the unshielded X-ray imaging; and R (x, y) is the gray value of the pixel point of the coordinate point (x, y) on the foreign matter detection image after the gray image of the object to be detected and the gray image of the simulated foreign matter test card are superposed.
In this embodiment, the apparatus may apply the above-mentioned method for detecting the foreign object precision, and the same parts are not repeated, and the simulated test piece image is generated by calculation by the apparatus, and is corrected and superimposed according to the detected object image at the corresponding position. And verifying the foreign matter detection precision by comparing with a foreign matter detection algorithm.
Finally, the present application also provides a foreign object detection apparatus including the image generation device for foreign object detection of any of the above embodiments. After the foreign matter detection equipment comprises the image generation device for foreign matter detection, a corresponding foreign matter detection image can be obtained according to the requirement of a user and used for subsequent foreign matter detection precision verification, or the foreign matter detection image can be used as an image sample and used for training a foreign matter identification model.
In another embodiment, the foreign object detection apparatus provided by the present application includes the foreign object accuracy detection device provided in any one of the above embodiments. After the foreign matter detection equipment comprises the image generation device for foreign matter detection, the corresponding foreign matter detection image can be generated at regular time according to the requirement of a user, the current foreign matter identification algorithm model is adopted to identify the foreign matter detection image, and then the detection precision of the foreign matter detection equipment is verified.
In an embodiment, the foreign object precision detection apparatus provided in this embodiment performs the foreign object precision verification by using the foreign object precision detection method of this application, and includes:
1. the thickness of various foreign matters and the high-voltage value of an X-ray source are used in advance to establish an X-ray image gray database, and each table in the database corresponds to each foreign matter type.
And 2, setting the type, size and number of the foreign matters in software, and obtaining a specific foreign matter thickness map with the same resolution according to the resolution of the X-ray image of the detected object, wherein each pixel point represents the thickness of the foreign matters at the position. If the spot has no foreign matter, the spot has a foreign matter thickness of 0, i.e., a blank. If there is a foreign object at this point, the thickness is greatest at the center and the thickness data decreases in sequence near the edges.
And 3, generating a specific foreign matter image gray scale map according to the current X-ray source parameters and the specific foreign matter thickness map. And (3) converting the thickness data of each point into gray data by searching the ray source parameters and the thickness data of the database generated in the step (1), and if the ray source parameters or the thicknesses are not in the table, performing interpolation calculation by using the nearest point to obtain corresponding gray data.
Taking an X-ray image of the object with 100 × 100 pixels as an example, if 9 pieces of ceramic ball foreign matter are needed, a gray scale image of the simulation test piece as shown in fig. 5 can be obtained according to the above steps 1-3.
4. Superposing the detected object image and the simulation test piece image pixel by pixel, wherein the superposed data comprises the following data: real images of the detected object, simulated test piece images under the same ray energy and ray energy data. The principle of superposition of these three data is derived as follows:
assuming that at (x, y) the thickness of the food portion is d1, the thickness of the foreign body portion is d2, and the fixed absorption coefficients associated with the food and foreign bodies are μ 1 and μ 2, respectively, the initial energy is I0The intensity of the X-ray after penetrating through the two substances is respectively as follows:
Figure BDA0003396297120000241
Figure BDA0003396297120000242
the ray intensity after passing through the two in sequence is:
Figure BDA0003396297120000243
the intensity of the radiation after passing through different substances is represented as the gray level of the image after X-ray imaging:
F(x,y)=ln(Id1(x,y))=ln(I0(x,y))-μ1d1
T(x,y)=ln(Id2(x,y))=ln(I0(x,y))-μ2d2
R(x,y)=ln(Id12(x,y))=ln(I0(x,y))-(μ1d12d2)
therefore, the method comprises the following steps: r (x, y) ═ ln (I)d12(x,y))=ln(Id1(x,y))+ln(Id2(x,y))-ln(I0(x,y))
Therefore, the method comprises the following steps: r (x, y) ═ F (x, y) + T (x, y) -B (x, y)
F (x, y) is the actual gray scale value of the pixel point with coordinates (x, y) on the object image.
And T (x, y) is the simulation gray value of the pixel point with the coordinate (x, y) on the test piece image.
B (x, y) is the gray value for direct imaging of the unshielded rays.
And R (x, y) is the final superposition result of the object image and the simulation test piece image.
The result image of the real detected object image superposed with the simulation test card image under a certain specific ray energy can be obtained by the method.
5. And detecting the X-ray image with the simulated foreign body test card by using a foreign body detection algorithm, and verifying the detection result of the test piece. Therefore, the accuracy of the foreign matter test card at all positions can be tested at one time.
6. The number and the positions of the simulated foreign body test cards are predicted, so that the number of false reports and false reports of foreign body detection can be verified by comparing the results of the foreign body detection algorithm.
The type, the number, the size and the position of foreign matters in the simulation test card can be randomly set, wherein the position of the foreign matters has two setting methods:
1. according to the uniform distribution of the detected object images, for example, the detected object images are 1000 × 1000 pixels, 100 foreign objects need to be inserted, and each foreign object small graph is uniformly distributed in the detected object images in a distribution mode of 10 × 10, so that the average foreign object detection accuracy of the current detected object images can be obtained.
2. The user arbitrarily specifies the distribution position of the foreign matter thumbnail, and thus the foreign matter detection accuracy for detecting a specific position is achieved.
The steps of timing automatic checking detection precision in actual production are as follows:
1. and setting the currently detected ray energy and the foreign matter recognition algorithm model.
2. And setting the period, the type, the quantity, the size and the position of the test card inserted in the timing simulation mode, and calculating and generating a corresponding test card image by using a preset database in combination with the current ray energy.
3. Detection is initiated.
4. And in the detection, the image of the actual object to be detected is generated in real time according to the calculation method, and the image inserted into the test card is simulated in a superposition mode, so that whether the detection precision is changed or not is automatically checked.
5. If the foreign matter detection result has abnormal missing report and false report quantity, the equipment automatically gives an alarm.
In this embodiment, a simulated test piece image is generated by calculation, and is corrected and superimposed according to the object image at the corresponding position. And verifying the foreign matter detection precision by comparing with a foreign matter detection algorithm.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of program modules is illustrated, and in practical applications, the above-described distribution of functions may be performed by different program modules, that is, the internal structure of the apparatus may be divided into different program units or modules to perform all or part of the above-described functions. Each program module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one processing unit, and the integrated unit may be implemented in a form of hardware, or may be implemented in a form of software program unit. In addition, the specific names of the program modules are only used for distinguishing the program modules from one another, and are not used for limiting the protection scope of the application.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or recited in detail in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely exemplary, and the division of the modules or units is merely an example of a logical division, and there may be other divisions when the actual implementation is performed, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
It should be noted that the above embodiments can be freely combined as necessary. The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (17)

1. A foreign object detection image generation method, comprising:
receiving a foreign matter attribute setting instruction;
setting basic attributes of the simulated foreign matters according to the foreign matter attribute setting instruction;
acquiring the intensity of a current X-ray source;
acquiring simulation gray data of each simulation foreign matter based on a prestored X-ray foreign matter image gray database according to the basic attribute of each simulation foreign matter and the intensity of the current X-ray source;
receiving a gray image of an object to be detected under the detection scanning of a current X-ray source;
and superposing the simulated foreign matters on the gray level image of the object to be detected according to the basic attributes and the simulated gray level data of the simulated foreign matters to generate a foreign matter detection image.
2. The method for generating a foreign object detection image according to claim 1, wherein the foreign object detection image is generated by superimposing each simulated foreign object on the gray image of the object based on the basic attribute and the simulated gray data of each simulated foreign object; the method specifically comprises the following steps:
generating a gray image of the simulated foreign matter test card according to the basic attribute and the simulated gray data of each simulated foreign matter; the resolution ratio of the gray level image of the simulated foreign matter test card is the same as that of the gray level image of the object to be detected;
and superposing the gray level image of the simulated foreign matter test card and the gray level image of the object to be detected to generate a foreign matter detection image.
3. The foreign object detection image generation method according to claim 1 or 2, wherein the basic attribute of each simulated foreign object includes: simulating the type, the number, the position, the form and the size of the foreign matters;
acquiring gray data of each simulated foreign object based on a pre-stored X-ray foreign object image gray database according to the basic attribute of each simulated foreign object and the intensity of the current X-ray source, and specifically comprising the following steps:
acquiring thickness data of each part of each simulated foreign body according to the shape and size data of each simulated foreign body;
and searching and acquiring the simulation gray data of each part of each simulation foreign matter from a pre-stored X-ray foreign matter image gray database according to the type of each simulation foreign matter, the thickness data of each part and the intensity of the current X-ray source.
4. The method for generating a foreign object detection image according to claim 2, wherein the foreign object detection image is generated by superimposing a gray image of the simulated foreign object test card and a gray image of the object to be inspected; the method specifically comprises the following steps:
superposing the gray level image of the object to be detected and the gray level image of the simulated foreign matter test card pixel by pixel, and calculating to obtain a foreign matter detection image through the following formula:
R(x,y)=F(x,y)+T(x,y)-B(x,y);
f (x, y) is the actual gray value of a pixel point of a coordinate point (x, y) on the gray image of the object to be detected; t (x, y) is the simulation gray value of the pixel point of the coordinate point (x, y) on the gray image of the simulation foreign matter test card; b (X, y) is the gray value of the unshielded X-ray imaging; and R (x, y) is the gray value of the pixel point of the coordinate point (x, y) on the foreign matter detection image after the gray image of the object to be detected and the gray image of the simulated foreign matter test card are superposed.
5. An apparatus for generating a foreign object detection image, comprising:
the information receiving module is used for receiving a foreign matter attribute setting instruction;
the foreign matter setting module is used for setting the basic attribute of each simulated foreign matter according to the foreign matter attribute setting instruction;
the intensity acquisition module is used for acquiring the intensity of the current X-ray source;
the gray level acquisition module is used for acquiring the simulation gray level data of each simulation foreign matter based on a prestored X-ray foreign matter image gray level database according to the basic attribute of each simulation foreign matter and the intensity of the current X-ray source;
the information receiving module is also used for receiving a gray image of the object to be detected under the current X-ray source detection scanning;
and the image generation module is used for superposing the simulated foreign matters on the gray level image of the object to be detected according to the basic attributes and the simulated gray level data of the simulated foreign matters to generate a foreign matter detection image.
6. The apparatus for generating a foreign object detection image according to claim 5, wherein the image generation module specifically includes:
the test card image generation submodule is used for generating a gray level image of the simulated foreign matter test card according to the basic attribute and the simulated gray level data of each simulated foreign matter; the resolution ratio of the gray level image of the simulated foreign matter test card is the same as that of the gray level image of the object to be detected;
and the superposition generation submodule is used for superposing the gray level image of the simulated foreign matter test card and the gray level image of the object to be detected to generate a foreign matter detection image.
7. The apparatus according to claim 5 or 6, wherein the basic attribute of each simulated foreign object includes: simulating the type, the number, the position, the form and the size of the foreign matters;
the gray level obtaining module specifically comprises:
the thickness acquisition submodule is used for acquiring the thickness data of each part of each simulated foreign body according to the shape and size data of each simulated foreign body;
and the gray level searching submodule is used for searching and acquiring the simulation gray level data of each part of each simulation foreign matter from a pre-stored X-ray foreign matter image gray level database according to the type of each simulation foreign matter, the thickness data of each part and the intensity of the current X-ray source.
8. The apparatus for generating a foreign object detection image according to claim 6, wherein the superimposition generation submodule specifically includes:
the calculation unit is used for superposing the gray level image of the object to be detected and the gray level image of the simulated foreign matter test card pixel by pixel, and calculating to obtain a foreign matter detection image through the following formula:
R(x,y)=F(x,y)+T(x,y)-B(x,y);
f (x, y) is the actual gray value of a pixel point of a coordinate point (x, y) on the gray image of the object to be detected; t (x, y) is the simulation gray value of the pixel point of the coordinate point (x, y) on the gray image of the simulation foreign matter test card; b (X, y) is the gray value of the unshielded X-ray imaging; and R (x, y) is the gray value of the pixel point of the coordinate point (x, y) on the foreign matter detection image after the gray image of the object to be detected and the gray image of the simulated foreign matter test card are superposed.
9. A foreign object accuracy detection method is characterized by comprising the following steps:
when the precision of detecting foreign matters needs to be verified, acquiring a gray image of an object to be detected under the current X-ray source detection scanning;
calling a gray image of a simulated foreign body test card acquired in advance; the gray level image of the simulated foreign matter test card is generated according to the set basic attribute of each simulated foreign matter, the current X-ray source intensity and a pre-stored X-ray image gray level database;
superposing the gray level image of the simulated foreign matter test card and the gray level image of the object to be detected to generate a foreign matter detection image;
and carrying out foreign matter detection and identification on the foreign matter detection image by adopting a preset foreign matter identification algorithm model, and determining the precision of detecting the foreign matter.
10. The foreign matter accuracy detection method according to claim 9, characterized by comprising a step of acquiring a gray image of the simulated foreign matter test card; the method specifically comprises the following steps:
receiving a foreign matter attribute setting instruction;
setting the type, the number, the position, the form and the size of the foreign matters on the simulated foreign matter test card according to the foreign matter attribute setting instruction;
acquiring thickness data of each part of each foreign matter according to the form and the size of each foreign matter on the simulated foreign matter test card;
obtaining a foreign matter thickness map of the simulated foreign matter test card according to the number and the position of the foreign matters on the simulated foreign matter test card and the corresponding thickness data of each part of each foreign matter; the foreign matter thickness map is used for indicating the distribution of various types of foreign matters on the simulated foreign matter test card and the thickness data corresponding to each part of each foreign matter; and the resolution of the foreign matter thickness map is the same as that of the foreign matter detection image;
converting the foreign matter thickness map of the simulated foreign matter test card into a foreign matter gray map of the simulated foreign matter test card according to the set intensity of the X-ray source and a pre-stored X-ray foreign matter image gray database; the intensity of the set 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, wherein the foreign matter detection recognition is performed on the foreign matter detection image by using a preset foreign matter recognition algorithm model to determine the precision of detecting the foreign matter; the method specifically comprises the following steps:
detecting foreign matters in the foreign matter detection image through a preset foreign matter identification algorithm model, and detecting the quantity and the positions of the foreign matters in the foreign matter detection image;
and according to the detected number and position of the foreign matters on the foreign matter detection image, and in combination with the number and position of the foreign matters set on the simulated foreign matter test card, obtaining the number of false reports and the number of false reports of the foreign matter detection, and obtaining the precision of the foreign matter detection.
12. The foreign matter accuracy detection method according to claim 9, characterized in that the gray image of the simulated foreign matter test card is superimposed with the gray image of the object to be inspected to generate a foreign matter detection image; the method specifically comprises the following steps:
and (3) carrying out superposition calculation on the gray level image of the simulated foreign matter test card and the gray level image of the object to be detected to obtain a foreign matter detection image by the following formula:
R(x,y)=F(x,y)+T(x,y)-B(x,y);
f (x, y) is the actual gray value of a pixel point of a coordinate point (x, y) on the gray image of the object to be detected; t (x, y) is the simulation gray value of the pixel point of the coordinate point (x, y) on the gray image of the simulation foreign matter test card; b (X, y) is the gray value of the unshielded X-ray imaging; and R (x, y) is the gray value of the pixel point of the coordinate point (x, y) on the foreign matter detection image after the gray image of the object to be detected and the gray image of the simulated foreign matter test card are superposed.
13. The foreign matter accuracy detection method according to claim 12, wherein 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 measured is d1The thickness of the foreign matters in the simulated foreign matter test card is d2(ii) a The fixed absorption coefficients corresponding to the object to be measured and the foreign matter are respectively mu1And mu2;I0(x, y) represents the initial ray intensity without occlusion at coordinate point (x, y).
14. A foreign matter accuracy detection device, characterized by comprising:
the scanning module is used for acquiring a gray image of the object to be detected under the current X-ray source detection scanning when the precision of detecting the foreign matters needs to be verified;
the calling module is used for calling a pre-acquired gray level image of the simulated foreign body test card; the gray level image of the simulated foreign matter test card is generated according to the set basic attribute of each simulated foreign matter, the current X-ray source intensity and a pre-stored X-ray image gray level database;
the image superposition module is used for superposing the gray level image of the simulated foreign matter test card and the gray level image of the object to be detected to generate a foreign matter detection image;
and the detection and identification module is used for detecting and identifying the foreign matters in the foreign matter detection image by adopting a preset foreign matter identification algorithm model and determining the precision of detecting the foreign matters.
15. The foreign object accuracy detection device according to claim 14, further comprising:
the simulated foreign matter acquisition module is used for acquiring a gray image of the simulated foreign matter test card; the simulated foreign matter acquisition module specifically comprises:
the instruction receiving submodule is used for receiving a foreign matter attribute setting instruction;
the setting submodule is used for setting the type, the number, the position, the form and the size of the foreign matters on the simulated foreign matter test card according to the foreign matter attribute setting instruction;
the thickness acquisition submodule is used for acquiring thickness data of each part of each foreign body according to the form and the size of each foreign body on the simulated foreign body test card;
the thickness map generation submodule is used for obtaining a foreign matter thickness map of the simulated foreign matter test card according to the number and the positions of the foreign matters on the simulated foreign matter test card and the corresponding thickness data of each part of each foreign matter; the foreign matter thickness map is used for indicating the distribution of various types of foreign matters on the simulated foreign matter test card and the thickness data corresponding to each part of each foreign matter; and the resolution of the foreign matter thickness map is the same as that of the foreign matter detection image;
the gray scale map generation submodule is used for converting the foreign matter thickness map of the simulated foreign matter test card into a foreign matter gray scale map of the simulated foreign matter test card according to the set intensity of the X-ray source and a pre-stored X-ray foreign matter image gray scale database; the intensity of the set X-ray source is the same as the intensity of the current X-ray source.
16. The foreign object accuracy detection device according to claim 14, wherein the detection identification module specifically includes:
the detection submodule is used for detecting foreign matters in the foreign matter detection image through a preset foreign matter recognition algorithm model, and detecting the quantity and the positions of the foreign matters in the foreign matter detection image;
the verification submodule is used for acquiring the number of false reports and the number of false reports of the foreign object detection according to the number and the position of the detected foreign objects on the foreign object detection image and by combining the number and the position of the foreign objects set on the simulated foreign object test card, so that the accuracy of the foreign object detection is obtained; and/or
The image superposition module specifically comprises:
the superposition calculation submodule is used for carrying out superposition calculation on the gray level image of the simulated foreign matter test card and the gray level image of the object to be detected through the following formula to obtain a foreign matter detection image:
R(x,y)=F(x,y)+T(x,y)-B(x,y);
f (x, y) is the actual gray value of a pixel point of a coordinate point (x, y) on the gray image of the object to be detected; t (x, y) is the simulation gray value of the pixel point of the coordinate point (x, y) on the gray image of the simulation foreign matter test card; b (X, y) is the gray value of the unshielded X-ray imaging; and R (x, y) is the gray value of the pixel point of the coordinate point (x, y) on the foreign matter detection image after the gray image of the object to be detected and the gray image of the simulated foreign matter test card are superposed.
17. A foreign object detection apparatus characterized by comprising the foreign object detection image generation device according to any one of claims 5 to 8.
CN202111485339.1A 2021-12-07 2021-12-07 Foreign matter detection image generation method and device, and precision detection method and device Pending CN114170181A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111485339.1A CN114170181A (en) 2021-12-07 2021-12-07 Foreign matter detection image generation method and device, and precision detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111485339.1A CN114170181A (en) 2021-12-07 2021-12-07 Foreign matter detection image generation method and device, and precision detection method and device

Publications (1)

Publication Number Publication Date
CN114170181A true CN114170181A (en) 2022-03-11

Family

ID=80483828

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111485339.1A Pending CN114170181A (en) 2021-12-07 2021-12-07 Foreign matter detection image generation method and device, and precision detection method and device

Country Status (1)

Country Link
CN (1) CN114170181A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024041263A1 (en) * 2022-08-23 2024-02-29 上海微现检测设备有限公司 Method and apparatus for detecting foreign objects in bulk material, and x-ray machine foreign object detection equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024041263A1 (en) * 2022-08-23 2024-02-29 上海微现检测设备有限公司 Method and apparatus for detecting foreign objects in bulk material, and x-ray machine foreign object detection equipment

Similar Documents

Publication Publication Date Title
CN110579479A (en) PCB maintenance system and maintenance method based on false point defect detection
TWI684000B (en) Method of generating an examination recipe and system thereof
US8019040B2 (en) X-ray inspection device and production system
CN108416817B (en) Automatic residual image correction coefficient obtaining method
CN114170181A (en) Foreign matter detection image generation method and device, and precision detection method and device
CN106667512A (en) Geometric correction method of X-ray imaging equipment and breast tomography equipment
CN110133014B (en) Method and system for detecting internal defects of chip
CN113109240B (en) Method and system for determining imperfect grains of grains implemented by computer
CN110261392A (en) Quality determining method, device, electronic equipment and system
JP2007183231A (en) Method for processing eddy current flaw detection signal
WO2020079694A1 (en) Optimizing defect detection in an automatic visual inspection process
CN115266731A (en) Method for detecting qualified production of O-shaped sealing ring
CN112415027A (en) Basalt fiber blended coated fabric detection method and device and electronic equipment
TWI429900B (en) A method of detecting a bright spot defect and a threshold value generating method and the device thereof
CN105678739A (en) Resolution test method for three-dimensional image of cone beam CT system
EP2802863B1 (en) Automatic standards inspection
US20020030187A1 (en) Method of evaluating critical locations on a semiconductor apparatus pattern
Carmignato et al. Preliminary results of the ‘CT Audit’project: First international intercomparison of computed tomography systems for dimensional metrology
CN104997525A (en) Apparatus and method for selecting key parts of digital radiographic image equipment
JPH11219997A (en) Electronic device check system and manufacture of electronic device
Reuter et al. Influence of detector misalignments on different geometrical and dimensional measurands using a dedicated test specimen
JP2638121B2 (en) Surface defect inspection equipment
JPH10281913A (en) Method and device for processing imbalanced data
Wohlgemuth et al. Acceptance and reverification testing for industrial computed tomography–a simulative study on geometrical misalignments
JP2023051102A (en) Image inspection method, and image inspection device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination