CN112710684B - Sensor gray level correction method and device and foreign matter detector - Google Patents

Sensor gray level correction method and device and foreign matter detector Download PDF

Info

Publication number
CN112710684B
CN112710684B CN201911027080.9A CN201911027080A CN112710684B CN 112710684 B CN112710684 B CN 112710684B CN 201911027080 A CN201911027080 A CN 201911027080A CN 112710684 B CN112710684 B CN 112710684B
Authority
CN
China
Prior art keywords
gray value
illumination intensity
target
value
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.)
Active
Application number
CN201911027080.9A
Other languages
Chinese (zh)
Other versions
CN112710684A (en
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.)
Hefei Meyer Optoelectronic Technology Inc
Original Assignee
Hefei Meyer Optoelectronic Technology Inc
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 Hefei Meyer Optoelectronic Technology Inc filed Critical Hefei Meyer Optoelectronic Technology Inc
Priority to CN201911027080.9A priority Critical patent/CN112710684B/en
Publication of CN112710684A publication Critical patent/CN112710684A/en
Application granted granted Critical
Publication of CN112710684B publication Critical patent/CN112710684B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N23/00Investigating or analysing materials by the use of wave or particle radiation, e.g. X-rays or neutrons, not covered by groups G01N3/00 – G01N17/00, G01N21/00 or G01N22/00
    • G01N23/02Investigating or analysing materials by the use of wave or particle radiation, e.g. X-rays or neutrons, not covered by groups G01N3/00 – G01N17/00, G01N21/00 or G01N22/00 by transmitting the radiation through the material
    • G01N23/06Investigating or analysing materials by the use of wave or particle radiation, e.g. X-rays or neutrons, not covered by groups G01N3/00 – G01N17/00, G01N21/00 or G01N22/00 by transmitting the radiation through the material and measuring the absorption
    • G01N23/18Investigating the presence of flaws defects or foreign matter
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N23/00Investigating or analysing materials by the use of wave or particle radiation, e.g. X-rays or neutrons, not covered by groups G01N3/00 – G01N17/00, G01N21/00 or G01N22/00
    • G01N23/02Investigating or analysing materials by the use of wave or particle radiation, e.g. X-rays or neutrons, not covered by groups G01N3/00 – G01N17/00, G01N21/00 or G01N22/00 by transmitting the radiation through the material
    • G01N23/04Investigating or analysing materials by the use of wave or particle radiation, e.g. X-rays or neutrons, not covered by groups G01N3/00 – G01N17/00, G01N21/00 or G01N22/00 by transmitting the radiation through the material and forming images of the material

Landscapes

  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • General Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Analysing Materials By The Use Of Radiation (AREA)
  • Transforming Light Signals Into Electric Signals (AREA)

Abstract

The invention provides a sensor gray scale correction method, a sensor gray scale correction device and a foreign matter detector, wherein the method comprises the following steps: acquiring the current temperature of a sensor to be corrected; acquiring a first gray value to be corrected output by a sensor to be corrected; determining a target dark level gray value according to the current temperature and a pre-stored first mapping relation; and performing dark level correction on the first gray value according to the target dark level gray value. In the use process of the X-ray imaging system, the dark level gray value of the sensor at the corresponding temperature is selected according to the change of the working temperature of the sensor, so that the dark level correction process of the sensor is more accurate, and the phenomenon that the image formed by splicing the sensors is striped can be reduced or even eliminated.

Description

Sensor gray level correction method and device and foreign matter detector
Technical Field
The invention relates to the technical field of X-ray imaging, in particular to a sensor gray scale correction method and device and a foreign matter detector.
Background
In the related art, an X-ray imaging system includes an X-ray source, a background, and a plurality of X-ray sensors, each of which includes a scintillator, a photosensitive unit, a conversion circuit, and an acquisition circuit. The scintillator is used for converting X-rays into visible light, the photosensitive unit is used for converting the visible light into charges, the conversion circuit is used for converting the charges into voltage, and the acquisition circuit is used for converting analog signals into digital signals.
Due to the process limitations of the scintillator, the light sensing unit, and the circuitry, there will be some differences in dark levels among the X-ray sensors. In order to eliminate the imaging problem caused by the difference between the sensors, the prior imaging system performs dark level correction on the gray scale value of the X-ray sensor during the use process, that is, the gray scale value output by the sensor needs to be subtracted by a fixed dark level correction value.
However, X-ray imaging systems are often used in pipeline online detection applications, which usually operate continuously for a long time, and after the X-ray imaging systems are used for a while, the temperature of the equipment rises, which causes the dark level correction value of the sensor to change, and thus the material image still has some stripes after the gray level of the sensor is corrected by using the conventional method. As shown in fig. 1, fig. 1 is an image formed by imaging and splicing a background, a first material and a second material by a plurality of sensors, the background, the first material and the second material are sequentially arranged from left to right, a plurality of areas which are obviously distinguished from top to bottom of the image correspond to images formed by the plurality of sensors, stripes are formed among the images formed by the plurality of sensors, and specifically, the stripe phenomenon of a material part is more obvious relative to the background part.
Disclosure of Invention
The invention aims to provide a method and a device for correcting the gray scale of an X-ray sensor, which are used for reducing the phenomenon that the image formed by splicing each X-ray sensor has stripes.
In a first aspect, an embodiment of the present invention provides a sensor grayscale correction method for correcting a grayscale of each sensor of an X-ray imaging system, where the method includes:
acquiring the current temperature of a sensor to be corrected;
acquiring a first gray value to be corrected output by the sensor to be corrected;
determining a target dark level gray value according to the current temperature and a pre-stored first mapping relation, wherein the first mapping relation is a corresponding relation between a plurality of dark level gray values and a plurality of temperatures;
and carrying out dark level correction on the first gray value according to the target dark level gray value.
Optionally, the first mapping relationship is obtained as follows:
determining the working temperature range of the sensor to be corrected;
simulating the working temperature of the sensor to be corrected by using a constant temperature box within the working temperature range;
under the conditions of a preset background and no illumination, aiming at different working temperatures, the gray value output by the sensor to be corrected is a dark level gray value corresponding to the corresponding temperature;
and taking the obtained corresponding relation between the temperature and the dark level gray value as the first mapping relation.
Optionally, the step of determining the target dark level gray value according to the current temperature and a pre-stored first mapping relationship includes:
determining a temperature closest to the current temperature from the plurality of temperatures of the first mapping;
and taking the dark level gray value corresponding to the temperature determined in the first mapping relation as a target dark level gray value.
Optionally, the method further includes:
and performing white balance correction on a second gray value, wherein the second gray value is obtained by performing dark level correction on the first gray value according to the determined dark level gray value.
Optionally, the step of performing white balance correction on the second gray scale value includes:
determining a target white balance correction coefficient according to the second gray scale value and a pre-stored second mapping relation, wherein the second mapping relation is a corresponding relation between a plurality of gray scale values and a plurality of white balance correction coefficients, and the plurality of gray scale values are gray scale values output by the sensor to be corrected under a preset background and different X-ray intensities;
and performing white balance correction on the second gray value according to the target white balance correction coefficient.
Optionally, the method further includes:
acquiring gray value differences of two sides of an imaging joint of adjacent sensors;
judging whether the gray value difference is larger than a preset threshold value,
if yes, updating the pre-stored second mapping relation.
Optionally, the step of updating the pre-stored second mapping relationship includes:
adjusting the illumination intensity of the X-ray source within a preset illumination intensity range;
acquiring a third gray value output by the sensor to be corrected under a preset background and the adjusted illumination intensity;
determining a target correction value corresponding to the adjusted illumination intensity according to a third mapping relation between the pre-stored illumination intensity and the target correction value;
calculating a white balance correction coefficient according to a third gray value and a target correction value corresponding to the adjusted illumination intensity and the target dark level gray value;
returning to the step of adjusting the illumination intensity of the X-ray source within the preset illumination intensity range until a plurality of third gray values and a plurality of corresponding target correction values are obtained;
and updating a pre-stored second mapping relation by using the corresponding relation between the plurality of third gray values and the plurality of target correction values.
Optionally, the step of calculating a white balance correction coefficient according to the third gray value and the target correction value corresponding to the adjusted illumination intensity and the target dark level gray value includes:
the white balance correction coefficient F is calculated according to the following formula:
F=D n /(C n -A)
wherein, C n A third gray value corresponding to the adjusted illumination intensity, D n And A is a target dark level gray value corresponding to the adjusted illumination intensity.
Optionally, the third mapping relationship between the illumination intensity and the target correction value is a linear relationship.
Optionally, adjusting the illumination intensity of the X-ray source within the preset illumination intensity range includes:
and adjusting the illumination intensity of the X-ray source to the maximum value from the minimum value of a preset illumination intensity range at intervals in sequence, or adjusting the illumination intensity of the X-ray source to the minimum value from the maximum value of the preset illumination intensity range at intervals in sequence.
Optionally, the determining a target white balance correction coefficient according to the second gray value and the second mapping relationship includes:
determining a gray value closest to the second gray value from the plurality of gray values in the second mapping;
and taking the white balance correction coefficient corresponding to the determined gray value in the second mapping relation as a target white balance correction coefficient.
In a second aspect, an embodiment of the present invention provides a sensor gray scale correction apparatus for correcting gray scales of each sensor of an X-ray imaging system, the apparatus including:
the first acquisition module is used for acquiring the current temperature of the sensor to be corrected;
the second acquisition module is used for acquiring a first gray value to be corrected output by the sensor to be corrected;
the determining module is used for determining a target dark level gray value according to the current temperature and a pre-stored first mapping relation, wherein the first mapping relation is a corresponding relation between a plurality of dark level gray values and a plurality of temperatures;
and the dark level correction module is used for carrying out dark level correction on the first gray value according to the target dark level gray value.
In a third aspect, an embodiment of the present invention provides a foreign object detection machine, including an X-ray imaging system and an image processing unit;
the image processing unit includes: a memory and a processor;
the memory is used for storing programs; the processor is configured to execute the program stored in the memory to implement any of the above method steps for gray scale correction of each sensor of an X-ray imaging system.
The embodiment of the invention provides a sensor gray scale correction method, which is used for correcting the gray scale of each sensor of an X-ray imaging system, and comprises the following steps: acquiring the current temperature of a sensor to be corrected; acquiring a first gray value to be corrected output by the sensor to be corrected; determining a target dark level gray value according to the current temperature and a pre-stored first mapping relation, wherein the first mapping relation is a corresponding relation between a plurality of dark level gray values and a plurality of temperatures; and carrying out dark level correction on the first gray value according to the target dark level gray value. In the use process of the X-ray imaging system, the dark level gray value of the sensor at the corresponding temperature is selected according to the change of the working temperature of the sensor, so that the dark level correction process of the sensor is more accurate, and the phenomenon that the image formed by splicing the sensors is striped can be reduced or even eliminated.
Drawings
The foregoing and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is an image obtained when a sensor gradation is corrected in the related art;
fig. 2 is a schematic flowchart of a method for calibrating a sensor gray scale according to an embodiment of the present invention;
fig. 3 is an image obtained when the sensor gray scale is corrected by using the sensor gray scale correction method provided by the embodiment of the invention;
fig. 4 is a schematic structural diagram of a sensor gray scale correction apparatus according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
Introduction to related art: the dark level correction of the sensor gradation value may be performed by subtracting a dark level gradation value, which is a gradation value of each sensor output acquired without any X-ray irradiation, from the gradation value. The X-ray imaging system images an object to be imaged, obtains a grey-white perspective view, and can be applied to the field of foreign matter detection so as to detect foreign matters in the object to be imaged based on the perspective view. Specifically, the method can be applied to the fields of security inspection, food inspection, tire inspection, ore inspection and the like, such as a security inspection machine, a coarse cereal inspection machine, a nut inspection machine, a fish inspection machine and the like. Of course, the application field of the X-ray imaging system is not specifically limited in the embodiments of the present invention.
Referring to fig. 2, a sensor gray scale correction method according to an embodiment of the present invention is used for correcting gray scales of each sensor of an X-ray imaging system, and it should be noted that, correcting gray scales of each sensor of the X-ray imaging system may refer to correcting gray scales of each sensor that needs to be corrected in the X-ray imaging system, for example, the X-ray imaging system includes 10 sensors, but in practical applications, the 10 sensors may be all turned on for use or may be partially turned on for use, and the sensor that needs to be corrected may be the turned on sensor. The process of correcting the different sensor grayscales can be performed synchronously or asynchronously, for example, asynchronous correction can be performed sequentially according to the position sequence of the sensors.
In the following embodiments, the present invention will be described in detail by taking an image processing unit of an X-ray detection apparatus as an execution main body and correcting the gray scale of each X-ray sensor as an example, where the image processing unit may be an upper computer or a lower computer. The predetermined background and X-ray sources referred to herein may be the same as the background and light sources, respectively, employed by the X-ray imaging system in imaging.
Referring to fig. 2, an embodiment of the present invention provides a sensor gray scale correction method for correcting gray scales of each X-ray sensor of an X-ray imaging system, including:
s101, acquiring the current temperature of the sensor to be corrected.
A temperature sensor is arranged at a position close to an X-ray sensor of the X-ray imaging system and is used for detecting the ambient temperature, namely the working temperature, of the sensor of the X-ray imaging system. The temperature sensor can detect the ambient temperature of the X-ray sensor in real time, and can also intermittently detect the ambient temperature of the sensor at preset time intervals.
S102, acquiring a first gray value to be corrected output by the sensor to be corrected.
The first gray value is a gray value to be corrected, which is output by the X-ray imaging system in the using process, and specifically, the first gray value may be a gray value output when a preset background is imaged, or a gray value output when an object to be imaged is imaged.
S103, determining a target dark level gray value according to the current temperature and a pre-stored first mapping relation, wherein the first mapping relation is a corresponding relation between a plurality of dark level gray values and a plurality of temperatures.
This step can be implemented in the following way:
(1) and determining the temperature closest to the current temperature from the plurality of temperatures of the first mapping relation.
(2) And taking the dark level gray value corresponding to the temperature determined in the first mapping relation as a target dark level gray value.
The plurality of temperatures in the first mapping table may be discrete, and one of the plurality of temperatures in the first mapping table that is closest to the current temperature has a dark level correction value corresponding to the current temperature, which is the target dark level correction value.
The first mapping relation is pre-stored locally, and is obtained according to the following modes:
(1) and determining the working temperature range of the sensor to be corrected.
The working temperature range of the sensor to be corrected can be determined by the limit working temperature of the sensor, and can also be determined by the minimum working temperature and the maximum working temperature which can be applied to the sensor in the actual working of a certain region.
(2) And simulating the working temperature of the sensor to be corrected by using a constant temperature box within the working temperature range.
In an embodiment of the present invention, each of the operating temperatures to be adjusted may be determined according to the gray scale value output by the sensor, and if the difference between the temperature values output by the sensors corresponding to two adjacent operating temperatures is large, one operating temperature may be set between the two operating temperatures.
(3) And under the conditions of presetting a background and no illumination, aiming at different working temperatures, the gray value output by the sensor to be corrected is the dark level gray value corresponding to the corresponding temperature. At different temperatures, dark level gray scale values of multiple sensors can be acquired.
(4) And taking the obtained corresponding relation between the temperature and the dark level gray value as the first mapping relation.
Specifically, the X-ray imaging system may be placed in a thermostat for simulating an operating temperature of the X-ray imaging system, and in actual operation, the operating temperature of the X-ray imaging system refers to a temperature under the influence of heat generated by the X-ray sensor itself and heat generated by other components in the corresponding device. Determining the minimum value and the maximum value of the working temperature of the X-ray imaging system according to the environment in which the X-ray imaging system is used, adjusting the working temperature of the X-ray imaging system between the minimum value and the maximum value, closing an X-ray source, and obtaining the gray value output by the X-ray sensor as the dark level gray value of the corresponding sensor. Acquiring dark level gray values of a plurality of sensors at different temperatures, and taking the corresponding relation between the temperatures and the dark level gray values as a first mapping relation.
And S104, performing dark level correction on the first gray value according to the target dark level gray value.
In the use process of the X-ray imaging system, the dark level gray value of the sensor at the corresponding temperature is selected according to the change of the working temperature of the sensor, so that the dark level correction process of the sensor is more accurate, and the phenomenon that the image formed by splicing the sensors is striped can be reduced or even eliminated.
In an implementation manner of the embodiment of the present invention, the method for correcting the sensor gray scale may further include: and performing white balance correction on a second gray value, wherein the second gray value is obtained by performing dark level correction on the first gray value according to the determined dark level gray value.
Firstly, dark level correction is carried out on the gray value output by the sensor, and then white balance correction is carried out on the result after the dark level correction, namely, the gray value of the dark level is subtracted from the gray value of the sensor to be corrected, and then the result is multiplied by a white balance correction coefficient. And performing dark level correction on the first gray value to obtain a second gray value, and performing white balance correction on the second gray value, namely subtracting the dark level gray value of the sensor from the gray value of the sensor to obtain the second gray value, and multiplying the second gray value by a white balance correction coefficient. In this step, the second gray scale value may be subjected to white balance correction using a fixed white balance correction coefficient, and of course, the second gray scale value may be dynamically corrected by adaptively adjusting the white balance correction coefficient using different white balance correction coefficients set according to different illumination intensities.
In one implementation of the embodiment of the present invention, the white balance correction coefficient may be obtained as follows: the gray value of the sensor under the preset background, namely under the condition of the fixed uniform background, is obtained first, and then the gray value of the dark level is subtracted by the gray value of the sensor under the uniform background through dividing the preset correction target value, so that the white balance correction coefficient of each sensor can be obtained. Assuming that the gray value of the sensor, i.e., the gray value of the dark level without any X-ray irradiation is a, the gray value of the sensor in the fixed uniform background is C, and the correction target value is D, then D/(C-a) is the white balance correction coefficient of the sensor.
Since the sensitivity curve of the X-ray sensor is not theoretically linear and the non-linear differences of the sensitivities of the sensors are different, the X-ray sensor may have some stripes after the dark level correction and the white balance correction. In order to further reduce the phenomenon of streaking of the image formed by splicing the sensors, in an implementation manner of the embodiment of the present invention, the step of performing white balance correction on the second gray scale value in the following manner may include:
(1) determining a target white balance correction coefficient according to a second gray value and a pre-stored second mapping relation, wherein the second mapping relation is a corresponding relation between a plurality of gray values and the plurality of white balance correction coefficients, and the plurality of gray values are gray values output by the sensor to be corrected under the preset background and different X-ray illumination intensities; specifically, a gray value closest to the second gray value is determined from the plurality of gray values in the second mapping relation; and taking the white balance correction coefficient corresponding to the gray value determined in the second mapping relation as a target white balance correction coefficient.
(2) And performing white balance correction on the second gray value according to the target white balance correction coefficient.
The proper white balance correction coefficient is adaptively selected through the gray value to be corrected and a first mapping relation, the first mapping relation is determined according to the response of the sensor to different illuminations, and the white balance correction coefficient under fixed illumination has pertinence and accuracy, so that the gray value of the sensor is corrected in a dynamic white balance correction mode after the first gray value is subjected to dark level, the result is more accurate, and the stripe phenomenon in imaging can be greatly reduced and even eliminated.
In an implementation manner of the embodiment of the present invention, the method for correcting the sensor gray scale may further include:
(1) and acquiring the gray value difference of two sides of the imaging joint of the adjacent sensors.
The gray value difference can reflect the obvious degree of the stripe in the imaging to a certain extent, and reflects the imaging quality. In an embodiment of the present invention, the gray value difference may be any one of the following gray value differences of pixel points at corresponding positions in the first pixel row close to the seam on both sides: minimum, average, or maximum. For example, in two adjacent first pixel rows, the pixels in the upper row from left to right are a1, a2, and A3, and the pixels in the lower row from left to right are B1, B2, and B3, then the average of the gray value differences of a1 and B1, a2 and B3, and A3 and B3 may be used as the gray value difference in this step. Of course, in other embodiments, when calculating the gray value difference, more pixel points near the seam may also be considered, such as an average value, a maximum value, or a minimum value of the gray value differences of more pixel points, or a difference of the average gray values of more pixel points, which may be specifically set according to the actual requirement for the quality of the image, and is not specifically limited herein.
(2) And judging whether the gray value difference is larger than a preset threshold value or not.
The preset threshold value here is set mainly according to the actual demand for image quality, and may be set to a small value if the demand for quality is high, or to a large value otherwise.
(3) And if so, updating the pre-stored second mapping relation.
When a large difference between the gray values at the two sides of the joint is detected, the second mapping relation can be obtained again to update the originally prestored second mapping relation, so that the influence of the aging of the sensor on the correction result can be greatly reduced or even eliminated.
Wherein, the step of updating the pre-stored second mapping relation comprises:
(1) adjusting the illumination intensity of the X-ray source within a preset illumination intensity range; specifically, the illumination intensity of the X-ray source is adjusted to the maximum value at intervals in sequence from the minimum value of the preset illumination intensity range, or the illumination intensity of the X-ray source is adjusted to the minimum value at intervals in sequence from the maximum value of the preset illumination intensity range, and the illumination intensity is adjusted according to a certain sequence, so that the efficiency can be improved, the damage to the light source can be reduced, and the service life of the light source is prolonged. The preset illumination intensity range is 0-B, and the illumination intensity adjusted in the range is preset, for example, from 0, the illumination intensity to be adjusted is set every predetermined value, and of course, the illumination intensity can be set randomly.
(2) And acquiring a third gray value output by the sensor to be corrected under the preset background and the adjusted illumination intensity. In this case there is no object to be imaged, there is a pre-set background, and the illumination intensity is the value to which the current X-ray source is adjusted.
(3) Determining a target correction value corresponding to the adjusted illumination intensity according to a third mapping relation between the prestored illumination intensity and the target correction value; and the third mapping relation between the illumination intensity and the target correction value is a linear relation. The second mapping relationship between the illumination intensity and the target correction value is a linear relationship. For example, the illumination intensity ranges from 0-B, the target correction values range from 0-D, the corresponding target correction value is 0 when the illumination intensity is 0, the target correction value is D when the illumination intensity is B, and the illumination intensity is B n When the target correction value is
Figure BDA0002248999810000091
I.e. the third mapping relationship.
(4) And calculating a white balance correction coefficient according to the third gray value and the target correction value corresponding to the adjusted illumination intensity and the target dark level gray value.
(5) And returning to the step of adjusting the illumination intensity of the X-ray source within the preset illumination intensity range until a plurality of third gray values and a plurality of corresponding target correction values are obtained.
(6) And updating a pre-stored second mapping relation by utilizing the corresponding relation between the plurality of third gray values and the plurality of target correction values.
In an implementation manner of the embodiment of the present invention, the step of calculating the white balance correction coefficient according to the third gray value corresponding to the adjusted illumination intensity, the target correction value, and the target dark level gray value includes:
the white balance correction coefficient F is calculated according to the following formula:
F=D n /(C n -A)
wherein, C n A third gray value corresponding to the adjusted illumination intensity, D n And A is a target dark level gray value corresponding to the adjusted illumination intensity.
Referring to fig. 3, the image obtained by correcting the sensor gray scale according to the present invention significantly reduces the streak phenomenon and eliminates the streak phenomenon to some extent, compared to the image shown in fig. 1.
Based on the same inventive concept as the method embodiment, an embodiment of the present invention provides a sensor gray scale correction apparatus for correcting gray scales of each sensor of an X-ray imaging system, and with reference to fig. 4, the apparatus includes:
a first obtaining module 61, configured to obtain a current temperature of the sensor to be corrected;
a second obtaining module 62, configured to obtain a first gray scale value to be corrected output by the sensor to be corrected;
the determining module 63 is configured to determine a target dark level gray value according to a current temperature and a pre-stored first mapping relationship, where the first mapping relationship is a correspondence relationship between a plurality of dark level gray values and a plurality of temperatures;
and the dark level correction module 64 is configured to perform dark level correction on the first gray value according to the target dark level gray value.
Determining the minimum value and the maximum value of the working temperature of the X-ray imaging system according to the environment in which the X-ray imaging system is used, adjusting the working temperature of the X-ray imaging system between the minimum value and the maximum value, closing an X-ray source, and obtaining the gray value output by the X-ray sensor as the dark level gray value of the corresponding sensor.
The first mapping relation is obtained as follows:
determining the working temperature range of the sensor to be corrected;
simulating the working temperature of the sensor to be corrected by using a constant temperature box within the working temperature range;
under the conditions of a preset background and no illumination, aiming at different working temperatures, the gray value output by the sensor to be corrected is a dark level gray value corresponding to the corresponding temperature;
and taking the obtained corresponding relation between the temperature and the dark level gray value as the first mapping relation.
The determining module 63 is specifically configured to:
determining a temperature closest to the current temperature from the plurality of temperatures of the first mapping;
and taking the dark level gray value corresponding to the temperature determined in the first mapping relation as a target dark level gray value.
The device also includes:
and the white balance correction module is used for carrying out white balance correction on a second gray value, wherein the second gray value is obtained by carrying out dark level correction on the first gray value according to the determined dark level gray value.
The white balance correction module is specifically configured to:
determining a target white balance correction coefficient according to the second gray scale value and a pre-stored second mapping relation, wherein the second mapping relation is a corresponding relation between a plurality of gray scale values and a plurality of white balance correction coefficients, and the plurality of gray scale values are gray scale values output by the sensor to be corrected under a preset background and different X-ray intensities;
and performing white balance correction on the second gray value according to the target white balance correction coefficient.
The device also includes:
the gray value difference acquisition module is used for acquiring the gray value difference of two sides of the imaging joint of the adjacent sensors;
a judging module for judging whether the gray value difference is larger than a preset threshold value,
and the updating module is used for updating the pre-stored second mapping relation when the judgment result of the judging module is yes.
The update module is specifically configured to:
adjusting the illumination intensity of the X-ray source within a preset illumination intensity range;
acquiring a third gray value output by the sensor to be corrected under a preset background and the adjusted illumination intensity;
determining a target correction value corresponding to the adjusted illumination intensity according to a third mapping relation between the pre-stored illumination intensity and the target correction value; wherein the third mapping relationship between the illumination intensity and the target correction value is a linear relationship.
Calculating a white balance correction coefficient according to a third gray value and a target correction value corresponding to the adjusted illumination intensity and the target dark level gray value;
returning to the step of adjusting the illumination intensity of the X-ray source within the preset illumination intensity range until a plurality of third gray values and a plurality of corresponding target correction values are obtained;
and updating a pre-stored second mapping relation by using the corresponding relation between the plurality of third gray values and the plurality of target correction values.
The updating module calculates a white balance correction coefficient according to a third gray value and a target correction value corresponding to the adjusted illumination intensity and the target dark level gray value, and comprises the following steps:
the white balance correction coefficient F is calculated according to the following formula:
F=D n /(C n -A)
wherein, C n A third gray value corresponding to the adjusted illumination intensity, D n And A is a target dark level gray value corresponding to the adjusted illumination intensity.
The white balance correction module determines a target white balance correction coefficient according to the second gray value and the second mapping relation, and includes: determining a gray value closest to the second gray value from the plurality of gray values in the second mapping; and taking the white balance correction coefficient corresponding to the determined gray value in the second mapping relation as a target white balance correction coefficient.
Based on the same inventive concept as the method embodiment, the embodiment of the invention provides a foreign matter detector, which comprises an X-ray imaging system and an image processing unit;
the image processing unit includes: a memory and a processor;
the memory is used for storing programs; the processor is configured to execute the program stored in the memory to perform the following steps for gray scale correction of each sensor of the X-ray imaging system:
acquiring the current temperature of a sensor to be corrected;
acquiring a first gray value to be corrected output by a sensor to be corrected;
determining a target dark level gray value according to the current temperature and a pre-stored first mapping relation, wherein the first mapping relation is a corresponding relation between a plurality of dark level gray values and a plurality of temperatures;
and performing dark level correction on the first gray value according to the target dark level gray value.
Determining the minimum value and the maximum value of the working temperature of the X-ray imaging system according to the environment in which the X-ray imaging system is used, adjusting the working temperature of the X-ray imaging system between the minimum value and the maximum value, closing an X-ray source, and obtaining the gray value output by the X-ray sensor as the dark level gray value of the corresponding sensor.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.

Claims (10)

1. A sensor gamma correction method for correcting the gamma of each sensor of an X-ray imaging system, the method comprising:
acquiring the current temperature of a sensor to be corrected;
acquiring a first gray value to be corrected output by the sensor to be corrected;
determining a target dark level gray value according to the current temperature and a pre-stored first mapping relation, wherein the first mapping relation is a corresponding relation between a plurality of dark level gray values and a plurality of temperatures; under the conditions of a preset background and no illumination, aiming at different working temperatures, the gray value output by the sensor to be corrected is a dark level gray value corresponding to the corresponding temperature;
performing dark level correction on the first gray value according to the target dark level gray value; the method further comprises the following steps:
performing white balance correction on a second gray value, wherein the second gray value is obtained by performing dark level correction on the first gray value according to the determined dark level gray value;
the step of performing white balance correction on the second gray scale value includes:
determining a target white balance correction coefficient according to the second gray scale value and a pre-stored second mapping relation, wherein the second mapping relation is a corresponding relation between a plurality of gray scale values and a plurality of white balance correction coefficients, and the plurality of gray scale values are gray scale values output by the sensor to be corrected under a preset background and different X-ray intensities;
performing white balance correction on the second gray value according to the target white balance correction coefficient;
the second mapping relationship may be obtained as follows:
(1) adjusting the illumination intensity of the X-ray source within a preset illumination intensity range;
(2) acquiring a third gray value output by the sensor to be corrected under the preset background and the adjusted illumination intensity;
(3) and according to the third mapping relation between the pre-stored illumination intensity and the target correction value
Figure FDA0003695200710000011
Determining a target correction value corresponding to the adjusted illumination intensity, wherein D n Is a target correction value, B n The light intensity is set as the illumination intensity, B is the preset maximum illumination intensity, and D is the preset maximum target correction value;
(4) calculating a white balance correction coefficient according to the third gray value and the target correction value corresponding to the adjusted illumination intensity and the target dark level gray value; the white balance correction coefficient F is calculated according to the following formula:
F=D n /(C n -A)
wherein, C n A third gray value corresponding to the adjusted illumination intensity, D n A target correction value corresponding to the adjusted illumination intensity, wherein A is a target dark level gray value;
(5) returning to the step of adjusting the illumination intensity of the X-ray source within the preset illumination intensity range until a plurality of third gray values and a plurality of corresponding white balance correction coefficients are obtained;
(6) and using the corresponding relation between the plurality of third gray values and the plurality of white balance correction coefficients as a pre-stored second mapping relation.
2. The method of claim 1, wherein the first mapping relationship is obtained as follows:
determining the working temperature range of the sensor to be corrected;
simulating the working temperature of the sensor to be corrected by using a constant temperature box within the working temperature range;
under the conditions of a preset background and no illumination, aiming at different working temperatures, the gray value output by the sensor to be corrected is a dark level gray value corresponding to the corresponding temperature;
and taking the obtained corresponding relation between the temperature and the dark level gray value as the first mapping relation.
3. The method according to claim 1, wherein the step of determining the target dark level gray-level value according to the current temperature and a pre-stored first mapping relationship comprises:
determining a temperature closest to the current temperature from the plurality of temperatures of the first mapping;
and taking the dark level gray value corresponding to the temperature determined in the first mapping relation as a target dark level gray value.
4. The method of claim 1, further comprising:
acquiring gray value differences of two sides of an imaging joint of adjacent sensors;
judging whether the gray value difference is larger than a preset threshold value,
if yes, updating the pre-stored second mapping relation.
5. The method according to claim 4, wherein the step of updating the pre-stored second mapping relationship comprises:
adjusting the illumination intensity of the X-ray source within a preset illumination intensity range;
acquiring a third gray value output by the sensor to be corrected under a preset background and the adjusted illumination intensity;
determining a target correction value corresponding to the adjusted illumination intensity according to a third mapping relation between the pre-stored illumination intensity and the target correction value;
calculating a white balance correction coefficient according to a third gray value and a target correction value corresponding to the adjusted illumination intensity and the target dark level gray value;
returning to the step of adjusting the illumination intensity of the X-ray source within the preset illumination intensity range until a plurality of third gray values and a plurality of corresponding white balance correction coefficients are obtained;
and updating a pre-stored second mapping relation by using the corresponding relation between the plurality of third gray values and the plurality of white balance correction coefficients.
6. The method according to claim 5, wherein the step of calculating a white balance correction coefficient according to the third gray scale value corresponding to the adjusted illumination intensity and the target correction value, and the target dark level gray scale value comprises:
the white balance correction coefficient F is calculated according to the following formula:
F=D n /(C n -A)
wherein, C n A third gray value corresponding to the adjusted illumination intensity, D n And A is a target dark level gray value corresponding to the adjusted illumination intensity.
7. The method of claim 6, wherein the third mapping of illumination intensity to target correction value is linear.
8. The method according to claim 1, wherein determining a target white balance correction factor according to the second gray value and the second mapping relationship comprises:
determining a gray value closest to the second gray value from the plurality of gray values in the second mapping;
and taking the white balance correction coefficient corresponding to the determined gray value in the second mapping relation as a target white balance correction coefficient.
9. A sensor gamma correction apparatus for correcting the gamma of each sensor of an X-ray imaging system, the apparatus comprising:
the first acquisition module is used for acquiring the current temperature of the sensor to be corrected;
the second acquisition module is used for acquiring a first gray value to be corrected output by the sensor to be corrected;
the determining module is used for determining a target dark level gray value according to the current temperature and a pre-stored first mapping relation, wherein the first mapping relation is a corresponding relation between a plurality of dark level gray values and a plurality of temperatures; under the conditions of a preset background and no illumination, aiming at different working temperatures, the gray value output by the sensor to be corrected is a dark level gray value corresponding to the corresponding temperature;
the dark level correction module is used for carrying out dark level correction on the first gray value according to the target dark level gray value;
the device also includes:
the white balance correction module is used for carrying out white balance correction on a second gray value, wherein the second gray value is obtained by carrying out dark level correction on the first gray value according to the determined dark level gray value;
the white balance correction module is specifically configured to:
determining a target white balance correction coefficient according to the second gray scale value and a pre-stored second mapping relation, wherein the second mapping relation is a corresponding relation between a plurality of gray scale values and a plurality of white balance correction coefficients, and the plurality of gray scale values are gray scale values output by the sensor to be corrected under a preset background and different X-ray intensities; performing white balance correction on the second gray value according to the target white balance correction coefficient;
the second mapping relationship may be obtained as follows:
(1) adjusting the illumination intensity of the X-ray source within a preset illumination intensity range;
(2) acquiring a third gray value output by the sensor to be corrected under the preset background and the adjusted illumination intensity;
(3) and according to the third mapping relation between the pre-stored illumination intensity and the target correction value
Figure FDA0003695200710000041
Determining a target correction value corresponding to the adjusted illumination intensity, wherein D n Is a target correction value, B n The light intensity is set as the illumination intensity, B is the preset maximum illumination intensity, and D is the preset maximum target correction value;
(4) calculating a white balance correction coefficient according to the third gray value and the target correction value corresponding to the adjusted illumination intensity and the target dark level gray value; the white balance correction coefficient F is calculated according to the following formula:
F=D n /(C n -A)
wherein, C n A third gray value corresponding to the adjusted illumination intensity, D n A target correction value corresponding to the adjusted illumination intensity, wherein A is a target dark level gray value;
(5) returning to the step of adjusting the illumination intensity of the X-ray source within the preset illumination intensity range until a plurality of third gray values and a plurality of corresponding white balance correction coefficients are obtained;
(6) and using the corresponding relation between the plurality of third gray values and the plurality of white balance correction coefficients as a pre-stored second mapping relation.
10. A foreign matter detector is characterized by comprising an X-ray imaging system and an image processing unit;
the image processing unit includes: a memory and a processor;
the memory is used for storing programs; the processor is configured to execute the program stored in the memory to perform the method steps of any of claims 1-8 to correct for each sensor gray scale of the X-ray imaging system.
CN201911027080.9A 2019-10-27 2019-10-27 Sensor gray level correction method and device and foreign matter detector Active CN112710684B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911027080.9A CN112710684B (en) 2019-10-27 2019-10-27 Sensor gray level correction method and device and foreign matter detector

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911027080.9A CN112710684B (en) 2019-10-27 2019-10-27 Sensor gray level correction method and device and foreign matter detector

Publications (2)

Publication Number Publication Date
CN112710684A CN112710684A (en) 2021-04-27
CN112710684B true CN112710684B (en) 2022-08-09

Family

ID=75541599

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911027080.9A Active CN112710684B (en) 2019-10-27 2019-10-27 Sensor gray level correction method and device and foreign matter detector

Country Status (1)

Country Link
CN (1) CN112710684B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104333717A (en) * 2014-07-31 2015-02-04 吉林省福斯匹克科技有限责任公司 Algorithm used for black level correction of CMOS (Complementary Metal Oxide Semiconductor) image sensor and system thereof
CN106204498A (en) * 2016-07-22 2016-12-07 上海联影医疗科技有限公司 Method for correcting image and device

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011030383A1 (en) * 2009-09-10 2011-03-17 株式会社 東芝 Image processing device
JP5395614B2 (en) * 2009-10-23 2014-01-22 パナソニック株式会社 X-ray inspection equipment
CN103108107A (en) * 2013-03-05 2013-05-15 广州广电运通金融电子股份有限公司 Image processing device and image data correcting method thereof
JP6789845B2 (en) * 2017-02-22 2020-11-25 三菱電機株式会社 White balance adjustment method, method of manufacturing a display device with white balance adjustment, white balance adjustment device and display device
CN107835337A (en) * 2017-10-11 2018-03-23 北京中科慧眼科技有限公司 Black and white area array CCD camera method for correcting flat field and system
CN110109174B (en) * 2018-02-01 2024-01-23 上海西门子医疗器械有限公司 Drift correction method, device and system for flat panel detector and storage medium
CN108510462A (en) * 2018-04-12 2018-09-07 福州英迪格成像技术有限公司 A kind of method and terminal of the exposure response of correction camera
CN108918559B (en) * 2018-07-28 2021-08-17 北京纳米维景科技有限公司 X-ray image detector for realizing image self-correction and method thereof
CN109561292A (en) * 2018-12-26 2019-04-02 凌云光技术集团有限责任公司 A kind of white balancing treatment method and device for camera system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104333717A (en) * 2014-07-31 2015-02-04 吉林省福斯匹克科技有限责任公司 Algorithm used for black level correction of CMOS (Complementary Metal Oxide Semiconductor) image sensor and system thereof
CN106204498A (en) * 2016-07-22 2016-12-07 上海联影医疗科技有限公司 Method for correcting image and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
一种实时CIS暗电流校正方法及系统实现;孙权等;《光电子.激光》;20130115;第24卷(第01期);第21-27页 *

Also Published As

Publication number Publication date
CN112710684A (en) 2021-04-27

Similar Documents

Publication Publication Date Title
KR100407158B1 (en) Method for correcting time variant defect in thermal image system
US7733391B2 (en) Method and system for black-level correction on digital image data
CN108775958B (en) Brightness measuring and calibrating method and device based on light sensor and electronic equipment
JP4127698B2 (en) X-ray inspection equipment
US6919568B2 (en) Method and apparatus for identifying composite defective pixel map
CN109655234B (en) Automatic testing method for camera
JP4127699B2 (en) Density data conversion method and apparatus, and X-ray inspection system
CN107233082B (en) Infrared thermal imaging detection system
US7391925B2 (en) System and method for estimating noise using measurement based parametric fitting non-uniformity correction
US6854885B2 (en) Method for the correction of unequal conversion characteristics of image sensors
JP2001141832A (en) System for correcting amplifier offset and gain for x-ray imaging panel
CN112710684B (en) Sensor gray level correction method and device and foreign matter detector
JP2009224971A (en) Image processing device
US20050253812A1 (en) Optical mouse with shade compensation and its shade compensation method
JP4921058B2 (en) Imaging apparatus and control method thereof
JP7118148B2 (en) Film thickness measuring device and correction method
JP3989777B2 (en) X-ray fluoroscopy system
CN112710685B (en) X-ray sensor gray scale correction method and device and X-ray foreign matter detector
US20200018652A1 (en) Method for processing an image
CN116074495A (en) Storage method, detection and correction method and device for dead pixel of image sensor
CN113884188B (en) Temperature detection method and device and electronic equipment
CN110503646B (en) Image processing method and device
KR101450259B1 (en) Apparatus for correcting time variant defect of infrared detector
KR101092207B1 (en) Method and Apparatus for Correcting Balance of Digital Radiation Detection Image having Nonlinear Response Characteristics
KR100423061B1 (en) Method for detecting defect in thermal image system

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
GR01 Patent grant
GR01 Patent grant