A belt artifact processing method, device, electronic device and storage medium

By using a preset filter kernel sliding method in the X-ray security inspection machine, the belt artifact is determined based on the grayscale value of the target pixel point and grayscale correction is performed, which solves the artifact problem caused by belt roller offset and wear, and achieves fast and accurate artifact processing and improved imaging quality.

CN117314771BActive Publication Date: 2025-09-12HANGZHOU RAYIN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311139486.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-05
Publication Date
2025-09-12
Estimated Expiration
2043-09-05

AI Technical Summary

Technical Problem

Existing technologies are unable to effectively handle artifacts caused by belt roller offset and wear in X-ray security inspection machines. The pre-processing method cannot handle random offset artifacts, and the post-processing method causes the loss of main image information, making it difficult to meet real-time processing requirements.

Method used

The preset filter kernel sliding method is adopted to determine the belt artifact pixels based on the grayscale value of the target pixel point, and grayscale correction is performed to generate the security inspection image. The filter kernel includes multiple filter units and expansion units, which are set at intervals to reduce the amount of calculation.

Benefits of technology

Quickly and accurately process belt artifacts, improve the imaging quality of security inspection machines, stably solve belt artifact problems in common scenarios, and avoid misjudgments and missed detections.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117314771B_ABST
    Figure CN117314771B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a method, device, electronic device, and storage medium for processing belt artifacts. The electronic device can obtain the image data to be processed by the security inspection equipment for the inspected object; during the sliding process of the preset filter kernel, based on the grayscale value of the target pixel in the image data to be processed, determine whether each pixel in the image data to be processed is a belt artifact pixel; perform grayscale correction on the belt artifact pixel to generate a processed security inspection image corresponding to the inspected object. Since the grayscale values ​​of the pixels corresponding to the multiple filter units included in the filter kernel can more comprehensively reflect the characteristics of the multiple pixels corresponding to the filter kernel, determining the belt artifact pixel based on the grayscale value of the target pixel can avoid determining the pixel corresponding to the inspected object as a belt artifact pixel. In this way, the imaging quality of the security inspection machine can be improved, and the belt artifact problem in general scenarios can be stably solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a method, device, electronic device and storage medium for processing belt artifacts. Background Art

[0002] Currently, X-ray security inspection machines typically use linear array detectors arranged in an "L" shape, using a belt carrying an object to perform line scan imaging. Ideally, the detector module's correction parameters can be calculated using the detector's bright-field and dark-field templates, and the belt's impact on the inspection machine's imaging can be eliminated using bright-field and offset corrections. However, due to deviations in manufacturing and belt roller installation and commissioning, varying degrees of radial deviation of the belt during long-term rotation, and wear in localized areas such as the belt's edges during long-term operation, deviations in the bright-field and dark-field templates of local detector pixels can occur, ultimately creating random, continuous, and elongated artifacts during the image correction process.

[0003] To address belt artifacts, two common methods are pre-processing and post-processing. Pre-processing addresses the root cause of belt artifacts. Because previously saved bright-field and dark-field templates do not match the current data, updating the bright-field template immediately after each open source can effectively remove persistent belt artifacts caused by structural installation errors. Post-processing can use edge detection combined with morphological methods.

[0004] The aforementioned pre-processing approach is unable to address artifacts caused by the random radial offset of the belt rollers, and there is a risk of premature bright-field template updates due to inconsistent X-ray source performance, leading to even more severe artifacts. The aforementioned post-processing approach often results in significant loss of image data, leading to misidentification and omission of critical objects. Furthermore, in some low-resource environments, the computational time required often fails to meet real-time processing requirements. Consequently, current approaches to address belt artifacts are ineffective and difficult to reliably address in general scenarios. Summary of the Invention

[0005] The purpose of the embodiments of the present application is to provide a method, device, electronic device, and storage medium for processing belt artifacts to stably solve the belt artifact problem in common scenarios. The specific technical solution is as follows:

[0006] In a first aspect, an embodiment of the present application provides a method for processing belt artifacts, the method comprising:

[0007] Obtain image data to be processed by security inspection equipment for inspected objects;

[0008] During the sliding process of the preset filter kernel, determining whether each pixel in the image data to be processed is a belt artifact pixel based on the grayscale value of the target pixel in the image data to be processed, wherein the target pixel is a pixel corresponding to a plurality of filter units included in the preset filter kernel in the image data to be processed, and the preset filter kernel further includes an expansion unit, and the filter unit and the expansion unit are arranged at intervals;

[0009] Grayscale correction is performed on the belt artifact pixels to generate a processed security inspection image corresponding to the inspected object.

[0010] Optionally, the step of determining whether each pixel in the image data to be processed is a belt artifact pixel based on the grayscale value of the target pixel in the image data to be processed during the sliding process of the preset filter kernel includes:

[0011] According to the storage order of the image data to be processed in the memory, sliding the preset filter kernel with a fixed step size;

[0012] Each time the preset filter kernel is slid, determining whether the central target pixel is a belt artifact pixel based on the relationship between the central target pixel and the edge target pixel in the image data to be processed and the preset threshold conditions, and the number of other target pixels that meet the preset threshold conditions;

[0013] Among them, the central target pixel point is the pixel point corresponding to the central filter unit of the preset filter kernel, the edge target pixel point is the pixel point corresponding to the edge filter unit of the preset filter kernel, and the other target pixel points are the pixel points corresponding to the filter units other than the central filter unit and the edge filter unit.

[0014] Optionally, the step of determining whether the central target pixel is a belt artifact pixel based on the relationship between the central target pixel and the edge target pixel in the image data to be processed and the preset threshold conditions, and the number of other target pixels that meet the preset threshold conditions, includes:

[0015] Determine whether the grayscale value of the central target pixel is less than a preset grayscale value threshold;

[0016] If the grayscale value of the central target pixel is less than the preset grayscale value threshold, determining whether the grayscale values ​​of the other target pixels are less than the preset grayscale value threshold;

[0017] If the grayscale value of the other target pixel points is less than the preset grayscale value threshold, determining whether the number of target pixel points whose corresponding grayscale values ​​are less than the preset grayscale value threshold is not greater than a preset number;

[0018] If the number of target pixels whose corresponding grayscale values ​​are less than the preset grayscale value threshold is not greater than the preset number, determining whether the grayscale value of the edge target pixel is greater than the preset grayscale value threshold;

[0019] If the grayscale value of the edge target pixel is greater than the preset grayscale value threshold, the central target pixel is determined to be a belt artifact pixel.

[0020] Optionally, the number of the multiple filtering units included in the preset filter kernel and the length of the expansion unit are determined based on the length of the belt artifact to be detected, and the receptive field length of the preset filter kernel is greater than the length of the belt artifact to be detected.

[0021] Optionally, the number of the multiple filtering units included in the preset filtering core is 5, and the preset number is 2.

[0022] Optionally, the step of obtaining the image data to be processed of the inspected object by the security inspection equipment includes:

[0023] Obtaining a bright field template, a dark field template, and image data to be processed of the inspected object from the security inspection device, wherein the bright field template is the X-ray signal intensity collected by the detector when the X-ray source of the security inspection device is turned on and the conveyor belt is stationary, and the dark field template is the X-ray signal intensity collected by the detector when the X-ray source of the security inspection device is turned off and the conveyor belt is stationary;

[0024] Based on the bright field template, the dark field template and the image data to be processed, the grayscale value of the pixel point is calculated according to the following formula: n :

[0025] R n =Air n -Bk n

[0026]

[0027] Among them, Air n is the bright field template data, Bk n is the dark field template data, Scann n is the image data to be processed, Bk n is the dark field template data, R n is the bright field correction parameter, and Factor is the correction scaling factor.

[0028] Optionally, the step of performing grayscale correction on the belt artifact pixels to generate a processed security inspection image corresponding to the inspected object includes:

[0029] After determining all belt artifact pixels included in the image data to be processed, grayscale correction is performed on each belt artifact pixel to generate a processed security inspection image corresponding to the inspected object;

[0030] or

[0031] Acquire duplicate data that is completely identical to the image data to be processed;

[0032] determining, based on the belt artifact pixels detected in the image data to be processed, artifact pixels in the copied data corresponding to the belt artifact pixels in the image data to be processed;

[0033] Grayscale correction is performed on the artifact pixels in the copied data to generate a processed security inspection image corresponding to the inspected object.

[0034] In a second aspect, an embodiment of the present application provides a device for processing belt artifacts, the device comprising:

[0035] A data acquisition module is used to obtain the image data to be processed by the security inspection equipment for the inspected object;

[0036] a pixel determination module, configured to determine, during a sliding process of a preset filter kernel, whether each pixel in the image data to be processed is a belt artifact pixel based on a grayscale value of a target pixel in the image data to be processed, wherein the target pixel is a pixel corresponding to a plurality of filter units included in the preset filter kernel in the image data to be processed, and the preset filter kernel further includes a dilation unit, wherein the filter unit and the dilation unit are spaced apart;

[0037] The grayscale correction module is used to perform grayscale correction on the belt artifact pixels to generate a processed security inspection image corresponding to the inspected object.

[0038] Optionally, the pixel determination module includes:

[0039] A filter kernel sliding submodule, configured to slide a preset filter kernel with a fixed step size according to the storage order of the image data to be processed in the memory;

[0040] a pixel determination submodule, configured to determine whether the central target pixel is a belt artifact pixel based on a relationship between the central target pixel and the edge target pixel in the image data to be processed and a preset threshold condition, and the number of other target pixels that meet the preset threshold condition, each time the preset filter kernel is slid once;

[0041] Among them, the central target pixel point is the pixel point corresponding to the central filter unit of the preset filter kernel, the edge target pixel point is the pixel point corresponding to the edge filter unit of the preset filter kernel, and the other target pixel points are the pixel points corresponding to the filter units other than the central filter unit and the edge filter unit.

[0042] Optionally, the pixel determination submodule includes:

[0043] A central target pixel point determination unit, configured to determine whether the grayscale value of the central target pixel point is less than a preset grayscale value threshold;

[0044] Another target pixel point judgment unit is used to determine whether the grayscale value of the other target pixel points is less than the preset grayscale value threshold if the grayscale value of the central target pixel point is less than the preset grayscale value threshold;

[0045] a quantity determining unit, which determines whether the number of target pixels whose corresponding grayscale values ​​are smaller than the preset grayscale value threshold is not greater than a preset number if the grayscale value of the other target pixels is smaller than the preset grayscale value threshold;

[0046] an edge target pixel point judgment unit, configured to determine whether the grayscale value of the edge target pixel point is greater than the preset grayscale value threshold if the number of target pixels whose corresponding grayscale values ​​are less than the preset grayscale value threshold is not greater than the preset number;

[0047] The pixel determination unit is configured to determine that the central target pixel is a belt artifact pixel if the grayscale value of the edge target pixel is greater than the preset grayscale value threshold.

[0048] Optionally, the number of the multiple filtering units included in the preset filter kernel and the length of the expansion unit are determined based on the length of the belt artifact to be detected, and the receptive field length of the preset filter kernel is greater than the length of the belt artifact to be detected.

[0049] Optionally, the number of the multiple filtering units included in the preset filtering core is 5, and the preset number is 2.

[0050] Optionally, the data acquisition module includes:

[0051] A data acquisition submodule, configured to acquire a bright-field template and a dark-field template of the security inspection device, as well as image data to be processed of the inspected object, wherein the bright-field template is the X-ray signal intensity collected by the detector when the X-ray source of the security inspection device is turned on and the conveyor belt is stationary, and the dark-field template is the X-ray signal intensity collected by the detector when the X-ray source of the security inspection device is turned off and the conveyor belt is stationary;

[0052] Gray value calculation submodule, used to calculate the gray value of the pixel point Cali based on the bright field template, the dark field template and the image data to be processed according to the following formula n :

[0053] R n =Air n -Bk n

[0054]

[0055] Among them, Air n is the bright field template data, Bk n is the dark field template data, Scan n is the image data to be processed, Bk n is the dark field template data, R n is the bright field correction parameter, and Factor is the correction scaling factor.

[0056] Optionally, the grayscale correction module is used to perform grayscale correction on each belt artifact pixel after determining all belt artifact pixels included in the image data to be processed, so as to generate a security inspection image corresponding to the inspected object after processing; or, the grayscale correction module is used to: obtain copy data that is exactly the same as the image data to be processed; determine the artifact pixel points in the copy data corresponding to the belt artifact pixels in the image data to be processed based on the belt artifact pixels detected in the image data to be processed; perform grayscale correction on the artifact pixel points in the copy data, so as to generate a security inspection image corresponding to the inspected object after processing.

[0057] In a third aspect, an embodiment of the present application provides an electronic device, including:

[0058] Memory for storing computer programs;

[0059] The processor is configured to implement any of the methods described in the first aspect above when executing a program stored in the memory.

[0060] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements any of the methods described in the first aspect above.

[0061] Beneficial effects of the embodiments of the present application:

[0062] In the solution provided by the embodiment of the present application, the electronic device can obtain the image data to be processed by the security inspection device for the inspected object; during the sliding process of the preset filter kernel, based on the grayscale value of the target pixel in the image data to be processed, determine whether each pixel in the image data to be processed is a belt artifact pixel, wherein the target pixel is the pixel corresponding to the multiple filter units included in the preset filter kernel in the image data to be processed, and the preset filter kernel also includes an expansion unit, and the filter unit and the expansion unit are arranged at intervals, which can process more obvious belt artifacts without additionally increasing the amount of calculation; the belt artifact pixel is grayscale corrected to generate a security inspection image corresponding to the inspected object after processing. Since the grayscale values ​​of the pixels corresponding to the multiple filter units included in the filter kernel can more comprehensively reflect the characteristics of the multiple pixels corresponding to the filter kernel, determining the belt artifact pixel based on the grayscale value of the target pixel can avoid determining the pixel corresponding to the inspected object as a belt artifact pixel. This solution can quickly and accurately process belt artifacts, improve the imaging quality of the security inspection machine, and stably solve the belt artifact problem in general scenarios.

[0063] Of course, it is not necessary to achieve all the advantages described above at the same time when implementing any product or method of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other embodiments can also be obtained based on these drawings.

[0065] Figure 1 This is a cross-sectional view of security inspection equipment in current related technologies;

[0066] Figure 2 A schematic diagram of an image corresponding to an object under test generated using current relevant technologies;

[0067] Figure 3 A flowchart of a method for processing belt artifacts provided in an embodiment of the present application;

[0068] Figure 4 for Figure 3 A specific flow chart of step S302 in the embodiment shown;

[0069] Figure 5 This is a first schematic diagram of belt artifact detection provided by an embodiment of the present application;

[0070] Figure 6 A schematic diagram of a filter kernel including an expansion unit provided in an embodiment of the present application;

[0071] Figure 7 for Figure 4 A specific flow chart of step S402 in the embodiment shown;

[0072] Figure 8 Based on Figure 6 A schematic diagram of the filter kernel used to determine belt artifact pixels is shown;

[0073] FIG9( a ) is a second schematic diagram of belt artifact detection provided by an embodiment of the present application;

[0074] FIG9( b ) is a third schematic diagram of belt artifact detection provided by an embodiment of the present application;

[0075] Figure 10 A schematic diagram of an image corresponding to an object under inspection generated by the belt artifact processing method provided in an embodiment of the present application;

[0076] Figure 11 A schematic structural diagram of a belt artifact processing device provided in an embodiment of the present application;

[0077] Figure 12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0078] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field based on this application are within the scope of protection of this application.

[0079] In the current related technology, the cross-sectional view of the security inspection equipment can be as follows: Figure 1 As shown. Figure 1 The security inspection device shown in the figure places the object under inspection on the upper surface of belt 101. As the object moves along belt 101, radiation source 102 emits radiation. After passing through belt 101 and the object placed on it, the radiation is collected by detectors 103 in the L-shaped detector group. In this way, the grayscale value of each pixel in the image data can be determined based on the intensity of the X-ray signal collected by the detectors, and an image corresponding to the object under inspection can be generated.

[0080] Since the edge of the belt 101 is easily worn during long-term operation, when the detector area 104 collects rays passing through the edge of the belt 101, belt artifacts are easily formed in the image of the object being inspected.

[0081] Using current related technologies, a schematic diagram of the image corresponding to the object under test can be generated as follows: Figure 2 As shown in FIG. 2 , area 201 is where the belt artifact is located, and there is much noise in the image.

[0082] In order to stably solve the belt artifact problem in common scenarios, the embodiments of the present application provide a belt artifact processing method, device, electronic device, computer-readable storage medium, and computer program product. The following first introduces a belt artifact processing method provided by the embodiments of the present application.

[0083] The belt artifact processing method provided in the embodiments of the present application can be applied to any electronic device that needs to process belt artifacts, for example, subway security equipment, airport security equipment, etc., without specific limitation here. For the sake of clarity, it will be referred to as electronic equipment in this article.

[0084] like Figure 3 As shown, a method for processing belt artifacts, the method comprising:

[0085] S301, obtaining image data to be processed by the security inspection device for the inspected object;

[0086] S302, during a sliding process of a preset filter kernel, determining whether each pixel in the image data to be processed is a belt artifact pixel based on a grayscale value of a target pixel in the image data to be processed;

[0087] The target pixel point is a pixel point corresponding to a plurality of filter units included in the preset filter core in the image data to be processed, and the preset filter core further includes an expansion unit, and the filter unit and the expansion unit are arranged at intervals.

[0088] S303 , performing grayscale correction on the belt artifact pixels to generate a processed security inspection image corresponding to the inspected object.

[0089] It can be seen that in the embodiment of the present application, the electronic device can obtain the image data to be processed by the security inspection device for the inspected object; during the sliding process of the preset filter kernel, based on the grayscale value of the target pixel in the image data to be processed, determine whether each pixel in the image data to be processed is a belt artifact pixel, wherein the target pixel is the pixel corresponding to the multiple filter units included in the preset filter kernel in the image data to be processed, and the preset filter kernel also includes an expansion unit, and the filter unit and the expansion unit are arranged at intervals, which can process more obvious belt artifacts without increasing the amount of calculation; the belt artifact pixel is grayscale corrected to generate a security inspection image corresponding to the inspected object after processing. Since the grayscale values ​​of the pixels corresponding to the multiple filter units included in the filter kernel can more comprehensively reflect the characteristics of the multiple pixels corresponding to the filter kernel, the belt artifact pixel is determined based on the grayscale value of the target pixel, which can avoid determining the pixel corresponding to the inspected object as a belt artifact pixel. This solution can quickly and accurately process belt artifacts, improve the imaging quality of the security inspection machine, and stably solve the belt artifact problem in general scenarios.

[0090] The radiation source in the security inspection equipment emits X-rays. After the object under inspection is placed on the upper surface of the belt, it moves along the belt and enters the X-ray coverage area. This allows the X-rays to pass through the object and be detected by the multiple detectors in the detector group. The detectors can determine the grayscale values ​​of multiple pixels based on the intensity of the detected X-ray signals. In one embodiment, the X-ray signal intensity can be determined based on the number of photons in the X-ray signal detected by the detectors.

[0091] In step S301, the electronic device may obtain image data to be processed from the security inspection device for the inspected object. The image data to be processed includes grayscale values ​​of multiple pixels. For example, the image data to be processed may be scan strip data generated during the scanning and inspection process of the inspected object by the security inspection device.

[0092] To determine belt artifact pixels from a plurality of pixels included in the image data to be processed, a filter kernel may be pre-set before processing the belt artifacts. The filter kernel includes a plurality of filter units and an expansion unit, and the filter units and the expansion unit may be spaced apart.

[0093] Since belt artifacts typically appear as continuous low-grayscale pixels, and the number of continuous pixels included in belt artifacts is much smaller than the number of continuous pixels corresponding to the object being inspected, a sliding filter can be used to determine whether each pixel in the image data to be processed is a belt artifact pixel based on the grayscale value of the pixel corresponding to the filter unit in the image data to be processed, that is, to execute step S302. The target pixel can be the pixel corresponding to the filter unit in the image data to be processed.

[0094] The above method for determining belt artifact pixels reduces the computational effort required to determine belt artifact pixels because, among the pixels corresponding to the filter kernel, only the pixels corresponding to the filter unit are used to determine belt artifact pixels, rather than the pixels corresponding to the dilation unit.

[0095] Since the belt artifact will affect the display effect of the inspected object in the security inspection image, after determining the pixel points belonging to the belt artifact pixels, the electronic device can perform grayscale correction on the belt artifact pixels. For example, the grayscale value of the belt artifact pixel can be set to the grayscale value corresponding to white, and then generate a processed security inspection image corresponding to the inspected object, that is, execute step S303.

[0096] After determining one or more belt artifact pixels, the electronic device may perform grayscale correction on the determined belt artifact pixels. Alternatively, the electronic device may perform grayscale correction on all belt artifact pixels after determining all belt artifact pixels included in the image data to be processed. The following descriptions are provided for the above two situations:

[0097] In one embodiment, after determining one or more belt artifact pixels, the electronic device may perform grayscale correction on the determined belt artifact pixels. Specifically, the electronic device may obtain image data to be processed and duplicate data (or replicated data), which is identical to the image data to be processed. After the electronic device determines the belt artifact pixels from the image data to be processed, it may perform grayscale correction on the pixels in the duplicate data corresponding to the belt artifact pixels. This allows the image data being tested to be distinguished from the image data being grayscale corrected, preventing the grayscale-corrected pixels from affecting the accuracy of subsequent testing.

[0098] In another embodiment, after determining all belt artifact pixels included in the image data to be processed, the electronic device can perform grayscale correction on all belt artifact pixels. Since grayscale correction is performed after all belt artifact pixels are detected, the image data targeted by grayscale correction can be the image data to be processed or the duplicate data described in the above embodiment. Specifically, the grayscale correction can include grayscale value adjustment methods such as whitening.

[0099] That is, in an optional embodiment, the step of performing grayscale correction on the belt artifact pixels to generate a processed security inspection image corresponding to the inspected object may include:

[0100] After determining all belt artifact pixels included in the image data to be processed, grayscale correction is performed on each belt artifact pixel to generate a processed security inspection image corresponding to the inspected object;

[0101] or

[0102] Acquire duplicate data that is completely identical to the image data to be processed;

[0103] determining, based on the belt artifact pixels detected in the image data to be processed, artifact pixels in the copied data corresponding to the belt artifact pixels in the image data to be processed;

[0104] Grayscale correction is performed on the artifact pixels in the copied data to generate a processed security inspection image corresponding to the inspected object.

[0105] As can be seen, in this embodiment of the present application, since the grayscale values ​​of the pixels corresponding to the multiple filter units included in the filter kernel can more comprehensively reflect the characteristics of the multiple pixels corresponding to the filter kernel, determining the belt artifact pixel based on the grayscale value of the target pixel can avoid identifying the pixels corresponding to the inspected object as belt artifact pixels. This solution can quickly and accurately process belt artifacts, improve the imaging quality of security inspection machines, and stably solve the belt artifact problem in common scenarios.

[0106] As an implementation method of the present application, Figure 4 As shown, the step of determining whether each pixel in the image data to be processed is a belt artifact pixel based on the grayscale value of the target pixel in the image data to be processed during the sliding process of the preset filter kernel may include:

[0107] S401, sliding a preset filter kernel with a fixed step size according to the storage order of the image data to be processed in the memory;

[0108] Since adjacent pixels in the image data to be processed are stored continuously, to determine the belt artifact pixels in the image data to be processed, the electronic device can slide the preset filter kernel with a fixed step size according to the storage order of the image data to be processed in the memory. The fixed step size can be one pixel.

[0109] S402, each time the preset filter kernel is slid once, determining whether the central target pixel is a belt artifact pixel based on the relationship between the central target pixel and the edge target pixel in the image data to be processed and the preset threshold conditions, and the number of other target pixels that meet the preset threshold conditions;

[0110] Among them, the central target pixel point is the pixel point corresponding to the central filter unit of the preset filter kernel, the edge target pixel point is the pixel point corresponding to the edge filter unit of the preset filter kernel, and the other target pixel points are the pixel points corresponding to the filter units other than the central filter unit and the edge filter unit.

[0111] The embodiment of the present application further provides a filter kernel that does not include an expansion unit. The following describes a method for detecting belt artifact pixels using a filter kernel that does not include an expansion unit:

[0112] In this case, the filter kernel is composed of a series of filter units. Before identifying belt artifact pixels, the filter kernel can be pre-set. Specifically, since the filter kernel consists only of filter units, only the number of filter units, i.e., the length of the filter kernel, needs to be set.

[0113] The number of filter units described above can be set based on the length of the belt artifact to be detected. Since belt artifact pixels typically occupy multiple consecutive pixels, if the filter kernel length is equal to the length of the belt artifact to be detected, the electronic device will be unable to determine whether there are other consecutive pixels on either side of the pixel corresponding to the filter kernel, and may mistakenly identify the pixel corresponding to the object under test as a belt artifact pixel. Therefore, the filter kernel length should be at least greater than the length of the belt artifact to be detected.

[0114] After the filter kernel is set, the electronic device can slide the filter kernel with a fixed step size according to the order in which the image data to be processed is stored in the memory. Each time the filter kernel is slid, the electronic device can determine whether the central pixel corresponding to the central filter unit is a belt artifact pixel based on the relationship between the grayscale value of the central pixel corresponding to the central filter unit and a preset threshold condition, as well as the number of pixels corresponding to all filter units that meet the preset threshold condition. The preset threshold condition can be less than a preset grayscale value threshold.

[0115] Specifically, since the central pixel satisfies the preset threshold condition regardless of whether it is a belt artifact pixel or a pixel of the object being inspected, the electronic device can determine whether the grayscale value of the central pixel is less than the preset grayscale value threshold. If the grayscale value of the central pixel is less than the preset grayscale value threshold, it indicates that the multiple pixels corresponding to the filter kernel are likely pixels corresponding to belt artifacts or pixels corresponding to the object being inspected.

[0116] To determine whether multiple pixels correspond to belt artifacts, the electronic device may, when the grayscale value of the center pixel is less than a preset grayscale threshold, determine whether the number of corresponding pixels whose grayscale values ​​are less than the preset grayscale threshold is no greater than a preset number. The preset number may be equal to the maximum number of pixels included in the belt artifacts to be detected. For example, if the belt artifacts to be detected include 1 to 3 pixels, the preset number may be 3; if the belt artifacts to be detected include 1 to 5 pixels, the preset number may be 5.

[0117] If the number of pixel points whose corresponding grayscale values ​​are less than the preset grayscale value threshold is not greater than a preset number, the central pixel point may be determined as a belt artifact pixel.

[0118] Typically, belt artifacts occupy a continuous range of 1 to 6 pixels. For example, if the belt artifacts to be detected include 1 to 3 pixels, the filter kernel can be set to include five filter units, each of which is the same size as a pixel.

[0119] In this case, the schematic diagram for detecting belt artifacts consisting of less than 3 pixels can be as follows: Figure 5 As shown below. Figure 5 , the following explanations are given for the cases where the belt artifact is one pixel, two pixels, and three pixels:

[0120] For single-pixel belt artifacts or shot noise, there is only one situation in which the belt artifact pixel can be detected, that is, the pixel point corresponding to the central filter unit of the filter kernel is a single pixel point included in the belt artifact, that is, situation 1.

[0121] For two-pixel belt artifacts, there are two situations in which the belt artifact pixel can be detected, that is, the pixel point corresponding to the central filter unit of the filter kernel is a pixel point included in the belt artifact pixel, and the number of pixels less than the preset grayscale value threshold is two, namely situation 1 and situation 2.

[0122] For three-pixel belt artifacts, there are three situations in which the belt artifact pixels can be detected, that is, the pixel point corresponding to the central filter unit of the filter kernel is a pixel point included in the belt artifact pixel, and the number of pixels less than the preset grayscale value threshold is three, that is, situation 1 to situation 3.

[0123] Based on the concept of using continuous filter units to detect belt artifact pixels, it is necessary to limit the number of filter units on both sides of the central filter unit of the filter kernel to be equal, and the sum of the number of filter units on the central filter unit and the number of filter units on its side equals the maximum length of the belt artifact pixels to be detected. This shows that the number of filter units included in the filter kernel is odd, and if the maximum number of belt artifact pixels to be detected is n, the length of the filter kernel, that is, the number of filter units it includes, L = 2×(n / / 2+1)+1.

[0124] When the filter kernel does not include dilation units, the filter units in the filter kernel are continuous, and belt artifact pixels are typically six consecutive pixels. Therefore, a longer filter kernel eliminates more object pixels. Furthermore, since the filter kernel only includes filter units, it is necessary to determine whether all pixels corresponding to the filter kernel meet the preset threshold conditions, which is computationally intensive.

[0125] In order to solve the above-mentioned problem of elimination of pixels of the detected object and the large amount of calculation, an embodiment of the present application provides a filter kernel including a dilation unit.

[0126] In this case, the filter kernel includes a central filter unit, an edge filter unit, other filter units, and a dilation unit. Dilation units exist between the central filter unit and an adjacent non-central filter unit, between other filter units and adjacent edge filter units, and between adjacent other filter units. Among them, other filter units are filter units other than the central filter unit and the edge filter unit.

[0127] For example, the order of arrangement of the filter units and expansion units in the filter kernel can be: edge filter unit, expansion unit, other filter units, expansion unit, center filter unit, expansion unit, other filter units, expansion unit, edge filter unit; or it can be: edge filter unit, expansion unit, other filter units, expansion unit, other filter units, expansion unit, center filter unit, expansion unit, other filter units, expansion unit, other filter units, expansion unit, edge filter unit. Both are reasonable.

[0128] The schematic diagram of the filter kernel including the expansion unit provided in the embodiment of the present application can be as follows: Figure 6 As shown, the unit corresponding to P3 is the central filtering unit, the units corresponding to D1-D4 are the expansion units, the units corresponding to P2 and P4 are the other filtering units except the central filtering unit and the edge filtering unit, and the units corresponding to P1 and P5 are the edge filtering units.

[0129] When the central target pixel point corresponding to the central filter unit of the preset filter kernel is a belt artifact pixel, the central target pixel point meets the preset threshold condition, the edge target pixel point corresponding to the edge filter unit of the preset filter kernel does not meet the preset threshold condition, and among the other target pixel points corresponding to the filter units other than the central filter unit and the edge filter unit, the number that meets the preset threshold condition is not greater than the preset number.

[0130] Based on the conditions corresponding to the central target pixel, edge target pixels, and other target pixels in the case where the central target pixel is a belt artifact pixel, in step S402, each time the preset filter kernel is slid, the electronic device can determine whether the central target pixel is a belt artifact pixel based on the relationship between the central target pixel and edge target pixels in the image data to be processed and the preset threshold conditions, as well as the number of other target pixels that meet the preset threshold conditions.

[0131] As can be seen, in the embodiment of the present application, the electronic device slides a preset filter kernel at a fixed step size according to the order in which the image data to be processed is stored in the memory. Each time the preset filter kernel is slid, the electronic device determines whether the central target pixel in the image data to be processed is a belt artifact pixel based on the relationship between the central target pixel and the edge target pixel in the image data to be processed and the preset threshold conditions, as well as the number of other target pixels that meet the preset threshold conditions. The central target pixel is the pixel corresponding to the central filter unit of the preset filter kernel, the edge target pixel is the pixel corresponding to the edge filter unit of the preset filter kernel, and the other target pixels are the pixels corresponding to filter units other than the central filter unit and the edge filter unit. Since the central target pixel corresponding to the central filter unit of the preset filter kernel is a belt artifact pixel, the central target pixel meets the preset threshold conditions, while the edge target pixels corresponding to the edge filter units of the preset filter kernel do not meet the preset threshold conditions, and the number of other target pixels corresponding to filter units other than the central filter unit and the edge filter unit that meet the preset threshold conditions is no greater than a preset number. Therefore, the electronic device can determine whether the central target pixel is a belt artifact pixel based on the conditions corresponding to the central target pixel, the edge target pixels, and the other target pixels. This allows for the rapid and accurate identification of belt artifact pixels, while also preventing the identification of object pixels as belt artifact pixels. This also reduces the debugging standards and pressure on the transport belt module of security inspection equipment. Furthermore, because the filter sliding window direction aligns with the direction in which image data is stored in memory, a high CPU cache hit rate is ensured, resulting in processing speeds far faster than conventional morphological image processing algorithms. In the embodiments of this application, all thresholds involved can be reasonably set based on statistical experience or technical requirements.

[0132] As an implementation method of the present application, Figure 7 As shown, the step of determining whether the central target pixel is a belt artifact pixel based on the relationship between the central target pixel and the edge target pixel in the image data to be processed and the preset threshold conditions, and the number of other target pixels that meet the preset threshold conditions, may include:

[0133] S701, determining whether the grayscale value of the central target pixel is less than a preset grayscale value threshold; if the grayscale value of the central target pixel is less than the preset grayscale value threshold, executing step S702;

[0134] Since the grayscale value of the central target pixel is less than the preset grayscale value threshold, the multiple pixels corresponding to the preset filter kernel may be belt artifact pixels or pixels of the object being inspected. Therefore, the electronic device can determine whether the grayscale value of the central target pixel is less than the preset grayscale value threshold. If the grayscale value of the central target pixel is less than the preset grayscale value threshold, to further determine whether the multiple pixels corresponding to the preset filter kernel are belt artifact pixels, the electronic device can execute step S702.

[0135] The preset grayscale value threshold can be determined according to any method for determining a threshold, such as a global threshold, an Otus threshold, an iterative threshold, or the like.

[0136] In one embodiment, the preset grayscale value threshold can be determined based on a global threshold. Specifically, the electronic device can determine a grayscale histogram based on the grayscale values ​​corresponding to all pixels included in the image data to be processed, and then determine the preset grayscale value threshold based on the grayscale histogram.

[0137] For example, based on Figure 6 The schematic diagram of determining belt artifact pixels using the preset filter kernel shown can be as follows: Figure 8 As shown, the maximum number of belt artifact pixels to be detected is 4, that is, in this case, 1 to 4 consecutive pixels will be determined as belt artifact pixels.

[0138] The preset filter kernel is along Figure 8 The filter moves in the direction indicated by the arrow, with the length of the side of the unit pixel as the step size. If the belt artifact length is 4 pixels, then the preset filter kernel will slide 4 times, and the corresponding pixel conditions in the image data to be processed after each slide are Case 1 to Case 4 respectively.

[0139] Depend on Figure 8 It can be seen that in cases 1 to 4, the central target pixel is less than the preset grayscale value threshold. For cases 1 to 4, step S702 can be continued.

[0140] S702, determining whether the grayscale value of the other target pixel point is less than the preset grayscale value threshold; if the grayscale value of the other target pixel point is less than the preset grayscale value threshold, executing step S703;

[0141] Since the belt artifact pixels are usually multiple continuous pixels, after determining that the grayscale value of the central target pixel is less than the preset grayscale value threshold, the electronic device can determine whether the grayscale values ​​of other target pixels are less than the preset grayscale value threshold.

[0142] If the grayscale values ​​of other target pixels are less than the preset grayscale value threshold, it indicates that the central target pixel may be a belt artifact pixel. To further determine, the electronic device may execute step S703.

[0143] Continuing with the example in step S701, for cases 1 through 4, there are other target pixels whose grayscale values ​​are less than the preset grayscale threshold. These are the pixel corresponding to P4, the pixel corresponding to P4, the pixel corresponding to P2, and the pixel corresponding to P2. Therefore, for cases 1 through 4, step S703 can be continued.

[0144] S703, determining whether the number of target pixels whose grayscale values ​​are less than the preset grayscale value threshold is not greater than a preset number; if the number of target pixels whose grayscale values ​​are less than the preset grayscale value threshold is not greater than the preset number, executing step S704;

[0145] Because the number of belt artifact pixels is typically much smaller than the number of pixels in the object being inspected, the electronic device can determine whether the number of target pixels whose corresponding grayscale values ​​are less than a preset grayscale threshold is not greater than a preset number. If the number of target pixels whose corresponding grayscale values ​​are less than the preset grayscale threshold is not greater than the preset number, the central target pixel is likely a belt artifact pixel, and the process can proceed to step S704.

[0146] The preset number can be determined according to the length of the belt artifact to be detected, the number of other filter units, and the length of the expansion unit in the preset filter core.

[0147] Continuing with the example in step S702, if the preset number is 2, then in case 1, the target pixel points that are less than the preset grayscale value threshold are the pixel points corresponding to P3 and the pixel points corresponding to P4 respectively; in case 2, the target pixel points that are less than the preset grayscale value threshold are the pixel points corresponding to P3 and the pixel points corresponding to P4 respectively; in case 3, the target pixel points that are less than the preset grayscale value threshold are the pixel points corresponding to P2 and the pixel points corresponding to P3 respectively; in case 4, the target pixel points that are less than the preset grayscale value threshold are the pixel points corresponding to P2 and the pixel points corresponding to P3 respectively.

[0148] Since the number of target pixels whose corresponding grayscale values ​​are less than the preset grayscale value threshold in cases 1 to 4 is not greater than the preset number, step S704 may be continued for cases 1 to 4.

[0149] S704, determining whether the grayscale value of the edge target pixel is greater than the preset grayscale value threshold; if the grayscale value of the edge target pixel is greater than the preset grayscale value threshold, executing step S705;

[0150] Since in the preset filter kernel, the lengths of the filter units on each side of the central filter unit and the expansion unit are usually not less than the length of the belt artifact, the belt artifact in the image data to be processed cannot simultaneously satisfy the grayscale value of the central target pixel point being less than the preset grayscale value threshold and the grayscale value of the edge target pixel point being less than the preset grayscale value threshold.

[0151] The electronic device can determine whether the grayscale value of the edge target pixel is greater than a preset grayscale value threshold. If the grayscale value of the edge target pixel is greater than the preset grayscale value threshold, it indicates that the central target pixel is a belt artifact pixel. If the grayscale value of the edge target pixel is less than the preset grayscale value threshold, it indicates that the central target pixel is a pixel of the object under inspection.

[0152] Continuing with the example in step S703, since the grayscale values ​​of the edge target pixels in cases 1 to 4 are all greater than the preset grayscale value threshold, it can be determined that the central target pixels corresponding to cases 1 to 4 are all belt artifact pixels.

[0153] S705: Determine that the central target pixel is a belt artifact pixel.

[0154] When the grayscale value of the edge target pixel is greater than the preset grayscale value threshold, it means that multiple pixel points corresponding to the preset filter kernel are belt artifacts, and the electronic device can determine that the central target pixel is a belt artifact pixel.

[0155] In one embodiment, a predetermined function can be used to represent whether a pixel in the image data to be processed satisfies a preset threshold condition. The function's independent variables are the position identifier of the filter unit in the preset filter kernel and the identifier of the pixel in the image data to be processed corresponding to the filter unit. If the pixel satisfies the preset threshold condition, the function value of the predetermined function is 1; otherwise, the function value of the predetermined function is 0.

[0156] In this way, the relationship between the pixel point and the preset threshold condition can be converted into an addition operation, which can quickly and accurately determine whether the grayscale value of the pixel point meets the preset threshold condition, and the number of corresponding pixel points that meet the preset threshold condition.

[0157] by Figure 8 Taking the preset filter kernel and the data unit to be processed as an example, the preset threshold condition is that the grayscale value corresponding to the pixel point is less than the preset grayscale value threshold.

[0158] The grayscale value of the central target pixel corresponding to P3 is less than the preset grayscale value threshold, which can be expressed as: F(P3, Cali n )=1. Among them, P3 is the position identifier of the filter unit in the preset filter core, Cali n is the grayscale value of the central target pixel corresponding to P3.

[0159] Among the target pixels corresponding to P2-P3, the number of target pixels whose grayscale value is less than the preset grayscale value threshold is not greater than the preset number 2, which can be expressed as: F(P3, Cali n )+F(P2,Cali n-D2 )+F(P4,Cali n+D2 )≤2. Among them, Cali n-D2 Indicates the grayscale value of the target pixel corresponding to P2. n+D2 Indicates the grayscale value of the target pixel corresponding to P4.

[0160] The grayscale values ​​of the edge target pixels corresponding to P1 and P5 are greater than the preset grayscale value threshold, which can be expressed as: F(P1, Cali n-D1-D1 )+F(P5,Cali n+D1+D2 )=0. Among them, Cali n-D1-D2 Indicates the grayscale value of the edge target pixel corresponding to P1, Cali n+D1+D2 Indicates the grayscale value of the edge target pixel corresponding to P5.

[0161] It can be seen that in the embodiment of the present application, the electronic device can determine whether the grayscale value of the central target pixel is less than a preset grayscale value threshold; if the grayscale value of the central target pixel is less than the preset grayscale value threshold, determine whether the grayscale values ​​of other target pixels are less than the preset grayscale value threshold; determine whether the number of target pixels whose corresponding grayscale values ​​are less than the preset grayscale value threshold is not greater than a preset number; if the number of target pixels whose corresponding grayscale values ​​are less than the preset grayscale value threshold is not greater than a preset number, determine whether the grayscale values ​​of edge target pixels are greater than the preset grayscale value threshold; if the grayscale value of the edge target pixel is greater than the preset grayscale value threshold, determine that the central target pixel is a belt artifact pixel. The electronic device can determine whether the grayscale value of the central target pixel is less than the preset grayscale value threshold, and then determine whether the pixel corresponding to the preset filter kernel is likely to be a belt artifact. Since belt artifacts are typically multiple continuous pixels, and the number of belt artifact pixels is relatively small, when the grayscale value of the center target pixel is less than a preset grayscale value threshold, the electronic device can further determine whether the number of target pixels whose corresponding grayscale values ​​are less than the preset grayscale value threshold is greater than a preset number, and whether the grayscale values ​​of the edge target pixels are greater than the preset grayscale value threshold, to determine the number of continuous target pixels. Since the number of continuous pixels included in the object under inspection is typically much greater than the number of continuous pixels included in the belt artifact, the electronic device can quickly and accurately determine the belt artifact pixels and background noise without misjudging the object pixels as belt artifact pixels, thereby improving the processing effect of the belt artifact.

[0162] As an implementation method of an embodiment of the present application, the number of multiple filtering units included in the above-mentioned preset filter kernel and the length of the expansion unit are determined based on the length of the belt artifact to be detected, and the receptive field length of the preset filter kernel is greater than the length of the belt artifact to be detected.

[0163] To ensure that the preset filter kernel can detect the entire belt artifact, the receptive field length of the preset filter kernel can be greater than the length of the belt artifact to be detected. If the length of the belt artifact to be detected varies, the length of the expansion unit and the number of filter units can be set based on the length of the belt artifact to be detected. The receptive field length of the preset filter kernel is the actual total length of the preset filter kernel (the sum of the lengths of all filter units and the expansion unit).

[0164] That is, in the embodiment of the present application, the actual total length of the preset filter kernel is greater than the length of the belt artifact to be detected, and the filter units on both sides of the central filter unit are symmetrically arranged, wherein the length of each filter unit corresponds to one pixel unit, and the length of each expansion unit is reasonably determined according to the number of filter units and the actual total length of the preset filter kernel. The expansion unit is used to increase the receptive field length of the filter kernel and does not actually participate in the calculation; further optionally, except for the edge filter units on both sides of the central filter unit, the distance between other filter units that are farther away from the central filter unit can be greater than or equal to the length of the belt artifact to be detected. Figure 6 As shown, taking the preset filter kernel including 5 filter units and 4 expansion units as an example, in addition to satisfying the requirement that the actual total length of the preset filter kernel is greater than the length of the belt artifact to be detected, the length between the filter units P2 and P4 located on both sides of the central filter unit P3 can be equal to or greater than the length of the belt artifact to be detected.

[0165] In an embodiment of the present application, the more filtering units there are in the preset filter kernel, that is, the more pixels involved in the calculation, the more computational effort is consumed. Therefore, the number of filtering units in the preset filter kernel can be set to 5 to achieve a balance between filtering computational effort and artifact detection effect.

[0166] For example, the length of the belt artifact to be detected is 1 pixel to 6 pixels. Two preset filter kernels that can be used to detect the belt artifact are provided below, as shown in FIG9 (a) and FIG9 (b) respectively.

[0167] Figure 9(a) shows a schematic diagram of a preset filter kernel for detecting belt artifacts at six pixels. There are five filter units, P1 through P5. P3 is a center filter unit, P2 and P4 are other filter units, and P1 and P5 are edge filter units. There are four dilation units, D1 through D4, each with a length of two pixels.

[0168] In this case, the electronic device can determine whether the grayscale value of the central target pixel is less than the preset grayscale value threshold; if the grayscale value of the central target pixel is less than the preset grayscale value threshold, determine whether the grayscale values ​​of other target pixels are less than the preset grayscale value threshold. Further, determine whether the number of target pixels whose corresponding grayscale values ​​are less than the preset grayscale value threshold is not greater than 2. If the number of target pixels whose corresponding grayscale values ​​are less than the preset grayscale value threshold is not greater than 2, determine whether the grayscale value of the edge target pixel is greater than the preset grayscale value threshold. If the grayscale value of the edge target pixel is greater than the preset grayscale value threshold, determine that the central target pixel is a belt artifact pixel. Cases 1 to 6 are cases where 6 types of belt artifacts include 6 pixels. For these 6 cases, the electronic device can determine the central target pixel as a belt artifact pixel based on the above process.

[0169] Figure 9(b) shows another schematic diagram of a preset filter kernel for detecting belt artifacts at six pixels. There are seven filter units, P1 through P7. P4 is a center filter unit, P2, P3, P5, and P6 are other filter units, and P1 and P7 are edge filter units. There are six dilation units, D1 through D6, each with a length of one pixel.

[0170] In this case, the electronic device can determine whether the grayscale value of the central target pixel is less than the preset grayscale value threshold; if the grayscale value of the central target pixel is less than the preset grayscale value threshold, determine whether the grayscale values ​​of other target pixels are less than the preset grayscale value threshold. Further, determine whether the number of target pixels whose corresponding grayscale values ​​are less than the preset grayscale value threshold is not greater than 3. If the number of target pixels whose corresponding grayscale values ​​are less than the preset grayscale value threshold is not greater than 3, determine whether the grayscale value of the edge target pixel is greater than the preset grayscale value threshold. If the grayscale value of the edge target pixel is greater than the preset grayscale value threshold, determine that the central target pixel is a belt artifact pixel. Cases 1 to 6 are cases where 6 types of belt artifacts include 6 pixels. For these 6 cases, the electronic device can determine the central target pixel as a belt artifact pixel based on the above process.

[0171] Among the above two preset filter kernels for detecting belt artifacts of 6 pixel points, since the number of filter units included in the preset filter kernel shown in Figure 9(a) is small, the preset filter kernel shown in Figure 9(a) can improve the processing speed compared with the preset filter kernel shown in Figure 9(b).

[0172] As can be seen, in this embodiment of the present application, the number of filter units and the length of the expansion unit that can be included in the preset filter kernel are determined based on the length of the belt artifact to be detected, and the receptive field length of the preset filter kernel is greater than the length of the belt artifact to be detected. Because the number of filter units and the length of the expansion unit can be adjusted based on the length of the belt artifact to be detected and the required detection time, the preset filter kernel has strong generalization capabilities and can quickly and accurately determine belt artifact pixels.

[0173] As an implementation manner of an embodiment of the present application, the number of the multiple filtering units included in the above-mentioned preset filtering core may be 5, and the above-mentioned preset number may be 2.

[0174] When the number of filter units is 5, the filter units include 1 center filter unit, 2 other filter units, and 2 edge filter units. In this way, the length of the expansion unit can be changed according to the length of the belt artifact to be detected, so as to detect belt artifacts of different lengths.

[0175] When the number of filtering units is 5, in the above step of determining whether the number of target pixels whose corresponding grayscale values ​​are less than the preset grayscale value threshold is not greater than the preset number, the preset number may be 2. In this way, when the grayscale value of the central target pixel is less than the preset grayscale value threshold, only one other target pixel needs to have a grayscale value less than the preset grayscale value threshold to satisfy the condition that the number of target pixels whose corresponding grayscale values ​​are less than the preset grayscale value threshold is not greater than the preset number.

[0176] As can be seen, in this embodiment of the present application, the preset filter kernel includes five filter units, and the preset number is two. This small number of filter units reduces computational effort, allowing for quick and accurate determination of belt artifact pixels. This also improves the imaging quality of security inspection systems and provides a reliable solution to belt artifact issues in common scenarios.

[0177] As an implementation of an embodiment of the present application, the step of obtaining the image data to be processed by the security inspection device for the inspected object may include:

[0178] The electronic device can obtain the bright field template, dark field template and the image data to be processed of the inspected object of the security inspection equipment.

[0179] The bright field template is the X-ray signal intensity collected by the detector when the security inspection device's X-ray source is on and the conveyor belt is stationary. The dark field template is the X-ray signal intensity collected by the detector when the security inspection device's X-ray source is off and the conveyor belt is stationary. For the image data to be processed of the inspected object, the X-ray signal intensity collected by the detector is when the X-ray source is on and a package is passing through. For example, the preset time period can be 20ms-40ms.

[0180] The electronic device can calculate the grayscale value of the pixel point according to the following formula based on the bright field template, dark field template and the image data to be processed: n :

[0181] R n =Air n -Bk n

[0182]

[0183] Among them, Air n is the bright field template data, Bk n For dark field template data, Scan n is the image data to be processed, Bk n is the dark field template data, R nis the bright field correction parameter, and Factor is the correction scaling factor. The bright field correction parameter is the average value of the X-ray signal emitted by the ray source captured by the detector within a preset time period when the ray source is open and not overpacked.

[0184] The correction scaling factor can be determined based on the maximum quantization depth of the ADC (Analog to Digital Converter) of the detector in the security inspection device. For example, if the detector in the security inspection device is 16 bits, the correction scaling factor can be 65535.

[0185] In the above embodiment, the electronic device may set the grayscale value of the determined belt artifact pixel as the above correction scaling factor. n is the grayscale value of the pixel corresponding to the belt artifact pixel, then the electronic device can make Cali n =Factor, and then grayscale correction is performed on the pixel points corresponding to the belt artifact pixels.

[0186] It can be seen that in the embodiment of the present application, the electronic device can obtain the bright field template, dark field template and the image data to be processed of the security inspection device; based on the bright field template, dark field template and the image data to be processed, the grayscale value of the pixel point is calculated according to the following formula: n :R n =Air n -Bk n , Among them, Air n is the bright field template data, Bk n For dark field template data, Scan n is the image data to be processed, Bk n is the dark field template data, R n is the bright field correction parameter, and Factor is the correction scaling factor. This allows the electronic device to accurately calculate the grayscale value corresponding to each pixel, thereby improving the accuracy of belt artifact processing.

[0187] By applying the belt artifact processing method provided in the embodiment of the present application, the security inspection image corresponding to the inspected object generated can be as follows: Figure 10 As shown. Figure 2 By comparison, Figure 10 There is no background noise and belt artifacts.

[0188] It should be noted that in the technical solution of this application, the operations involved in obtaining, storing, using, processing, transmitting, providing and disclosing user personal information are all carried out with the user's authorization.

[0189] Corresponding to the above-mentioned method for processing belt artifacts, an embodiment of the present application further provides a device for processing belt artifacts. The device for processing belt artifacts provided in the embodiment of the present application is introduced below.

[0190] like Figure 11 As shown, a belt artifact processing device, the device comprising:

[0191] The data acquisition module 1101 is used to acquire the image data to be processed of the inspected object by the security inspection equipment;

[0192] a pixel determination module 1102 configured to determine, during a sliding process of a preset filter kernel, whether each pixel in the image data to be processed is a belt artifact pixel based on a grayscale value of a target pixel in the image data to be processed, wherein the target pixel is a pixel in the image data to be processed corresponding to a plurality of filter units included in the preset filter kernel, and the preset filter kernel further includes a dilation unit, wherein the filter unit and the dilation unit are spaced apart from each other;

[0193] The grayscale correction module 1103 is used to perform grayscale correction on the belt artifact pixels to generate a processed security inspection image corresponding to the inspected object.

[0194] It can be seen that in the embodiment of the present application, the electronic device can obtain the image data to be processed by the security inspection device for the inspected object; during the sliding process of the preset filter kernel, based on the grayscale value of the target pixel in the image data to be processed, determine whether each pixel in the image data to be processed is a belt artifact pixel, wherein the target pixel is the pixel corresponding to the multiple filter units included in the preset filter kernel in the image data to be processed, and the preset filter kernel also includes an expansion unit, and the filter unit and the expansion unit are arranged at intervals, which can process more obvious belt artifacts without increasing the amount of calculation; the belt artifact pixel is grayscale corrected to generate a security inspection image corresponding to the inspected object after processing. Since the grayscale values ​​of the pixels corresponding to the multiple filter units included in the filter kernel can more comprehensively reflect the characteristics of the multiple pixels corresponding to the filter kernel, the belt artifact pixel is determined based on the grayscale value of the target pixel, which can avoid determining the pixel corresponding to the inspected object as a belt artifact pixel. This solution can quickly and accurately process belt artifacts, improve the imaging quality of the security inspection machine, and stably solve the belt artifact problem in general scenarios.

[0195] As an implementation of the embodiment of the present application, the pixel determination module 1102 may include:

[0196] A filter kernel sliding submodule, configured to slide a preset filter kernel with a fixed step size according to the storage order of the image data to be processed in the memory;

[0197] a pixel determination submodule, configured to determine whether the central target pixel is a belt artifact pixel based on a relationship between the central target pixel and the edge target pixel in the image data to be processed and a preset threshold condition, and the number of other target pixels that meet the preset threshold condition, each time the preset filter kernel is slid once;

[0198] Among them, the central target pixel point is the pixel point corresponding to the central filter unit of the preset filter kernel, the edge target pixel point is the pixel point corresponding to the edge filter unit of the preset filter kernel, and the other target pixel points are the pixel points corresponding to the filter units other than the central filter unit and the edge filter unit.

[0199] As an implementation of an embodiment of the present application, the pixel determination submodule may include:

[0200] A central target pixel point determination unit, configured to determine whether the grayscale value of the central target pixel point is less than a preset grayscale value threshold;

[0201] Another target pixel point judgment unit is used to determine whether the grayscale value of the other target pixel points is less than the preset grayscale value threshold if the grayscale value of the central target pixel point is less than the preset grayscale value threshold;

[0202] a quantity determining unit, which determines whether the number of target pixels whose corresponding grayscale values ​​are smaller than the preset grayscale value threshold is not greater than a preset number if the grayscale value of the other target pixels is smaller than the preset grayscale value threshold;

[0203] an edge target pixel point judgment unit, configured to determine whether the grayscale value of the edge target pixel point is greater than the preset grayscale value threshold if the number of target pixels whose corresponding grayscale values ​​are less than the preset grayscale value threshold is not greater than the preset number;

[0204] The pixel determination unit is configured to determine that the central target pixel is a belt artifact pixel if the grayscale value of the edge target pixel is greater than the preset grayscale value threshold.

[0205] As an implementation method of an embodiment of the present application, the number of multiple filtering units included in the above-mentioned preset filter kernel and the length of the expansion unit are determined based on the length of the belt artifact to be detected, and the receptive field length of the preset filter kernel is greater than the length of the belt artifact to be detected.

[0206] As an implementation manner of an embodiment of the present application, the number of the multiple filtering units included in the above-mentioned preset filtering core is 5, and the preset number is 2.

[0207] As an implementation of the embodiment of the present application, the data acquisition module 1101 may include:

[0208] A data acquisition submodule, configured to acquire a bright-field template and a dark-field template of the security inspection device, as well as image data to be processed of the inspected object, wherein the bright-field template is the X-ray signal intensity collected by the detector when the X-ray source of the security inspection device is turned on and the conveyor belt is stationary, and the dark-field template is the X-ray signal intensity collected by the detector when the X-ray source of the security inspection device is turned off and the conveyor belt is stationary;

[0209] Gray value calculation submodule, used to calculate the gray value of the pixel point Cali based on the bright field template, the dark field template and the image data to be processed according to the following formula n :

[0210] R n =Air n -Bk n

[0211]

[0212] Among them, Air n is the bright field template data, Bk n is the dark field template data, Scan n is the image data to be processed, Bk n is the dark field template data, R n is the bright field correction parameter, and Factor is the correction scaling factor.

[0213] In one embodiment, the grayscale correction module 1103 is used to perform grayscale correction on each belt artifact pixel after determining all belt artifact pixels included in the image data to be processed, and generate a security inspection image corresponding to the inspected object after processing; or, the grayscale correction module 1103 is used to: obtain copy data that is exactly the same as the image data to be processed; based on the belt artifact pixels detected in the image data to be processed, determine the artifact pixels in the copy data corresponding to the belt artifact pixels in the image data to be processed; perform grayscale correction on the artifact pixels in the copy data, and generate a security inspection image corresponding to the inspected object after processing.

[0214] The present application also provides an electronic device, such as Figure 12 Shown, including:

[0215] Memory 1201, used for storing computer programs;

[0216] The processor 1202 is configured to implement the belt artifact processing method steps described in any of the above embodiments when executing the program stored in the memory 1201 .

[0217] Furthermore, the electronic device may further include a communication bus and / or a communication interface, and the processor 1202, the communication interface, and the memory 1201 communicate with each other via the communication bus.

[0218] It can be seen that in the embodiment of the present application, the electronic device can obtain the image data to be processed by the security inspection device for the inspected object; during the sliding process of the preset filter kernel, based on the grayscale value of the target pixel in the image data to be processed, determine whether each pixel in the image data to be processed is a belt artifact pixel, wherein the target pixel is the pixel corresponding to the multiple filter units included in the preset filter kernel in the image data to be processed, and the preset filter kernel also includes an expansion unit, and the filter unit and the expansion unit are arranged at intervals, which can process more obvious belt artifacts without increasing the amount of calculation; the belt artifact pixel is grayscale corrected to generate a security inspection image corresponding to the inspected object after processing. Since the grayscale values ​​of the pixels corresponding to the multiple filter units included in the filter kernel can more comprehensively reflect the characteristics of the multiple pixels corresponding to the filter kernel, the belt artifact pixel is determined based on the grayscale value of the target pixel, which can avoid determining the pixel corresponding to the inspected object as a belt artifact pixel. This solution can quickly and accurately process belt artifacts, improve the imaging quality of the security inspection machine, and stably solve the belt artifact problem in general scenarios.

[0219] The communication bus mentioned in the electronic device mentioned above may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is used in the figure, but this does not mean that there is only one bus or only one type of bus.

[0220] The communication interface is used for communication between the above electronic device and other devices.

[0221] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor.

[0222] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.

[0223] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned belt artifact processing methods are implemented.

[0224] In another embodiment provided by the present application, a computer program product including instructions is further provided, which, when executed on a computer, enables the computer to execute any one of the belt artifact processing methods in the above embodiments.

[0225] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a solid-state drive (SSD).

[0226] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.

[0227] Each embodiment in this specification is described in a related manner. Similar portions between the various embodiments can be referenced to each other. Each embodiment focuses on the differences between the other embodiments. In particular, since the apparatus, electronic device, computer-readable storage medium, and computer program product are generally similar to the method embodiments, their descriptions are relatively simple. For related portions, reference can be made to the descriptions of the method embodiments.

[0228] The above description is only a preferred embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application are included in the scope of protection of the present application.

Claims

1. A method for processing belt artifacts, characterized in that: The method comprises: Obtain image data to be processed by security inspection equipment for inspected objects; According to the storage order of the image data to be processed in the memory, sliding the preset filter kernel with a fixed step size; Each time the preset filter kernel is slid, whether the central target pixel is a belt artifact pixel is determined based on the relationship between the grayscale value of the central target pixel and the grayscale value of the edge target pixel in the image data to be processed and the preset threshold conditions, as well as the number of grayscale values ​​of other target pixels that satisfy the preset threshold conditions, wherein the preset filter kernel includes a filtering unit and an expansion unit, the filtering unit and the expansion unit are arranged at intervals, the central target pixel is a pixel corresponding to the central filtering unit of the preset filter kernel, the edge target pixel is a pixel corresponding to the edge filtering unit of the preset filter kernel, and the other target pixel is a pixel corresponding to filtering units other than the central filtering unit and the edge filtering unit; Grayscale correction is performed on the belt artifact pixels to generate a processed security inspection image corresponding to the inspected object.

2. The method according to claim 1, characterized in that The step of determining whether the central target pixel is a belt artifact pixel based on the relationship between the grayscale value of the central target pixel and the grayscale value of the edge target pixel in the image data to be processed and the preset threshold conditions, and the number of grayscale values ​​of other target pixels that meet the preset threshold conditions, includes: Determine whether the grayscale value of the central target pixel is less than a preset grayscale value threshold; If the grayscale value of the central target pixel is less than the preset grayscale value threshold, determining whether the grayscale values ​​of the other target pixels are less than the preset grayscale value threshold; If the grayscale value of the other target pixel points is less than the preset grayscale value threshold, determining whether the number of target pixel points whose corresponding grayscale values ​​are less than the preset grayscale value threshold is not greater than a preset number; If the number of target pixels whose corresponding grayscale values ​​are less than the preset grayscale value threshold is not greater than the preset number, determining whether the grayscale value of the edge target pixel is greater than the preset grayscale value threshold; If the grayscale value of the edge target pixel is greater than the preset grayscale value threshold, the central target pixel is determined to be a belt artifact pixel.

3. The method according to claim 1 or 2, characterized in that The number of the plurality of filter units included in the preset filter kernel and the length of the expansion unit are determined based on the length of the belt artifact to be detected, and the receptive field length of the preset filter kernel is greater than the length of the belt artifact to be detected.

4. The method according to claim 2, characterized in that The number of the multiple filtering units included in the preset filtering core is 5, and the preset number is 2.

5. The method according to claim 1 or 2, characterized in that The step of obtaining the image data to be processed by the security inspection device for the inspected object includes: Obtaining a bright field template, a dark field template, and image data to be processed of the inspected object from the security inspection device, wherein the bright field template is the X-ray signal intensity collected by the detector when the X-ray source of the security inspection device is turned on and the conveyor belt is stationary, and the dark field template is the X-ray signal intensity collected by the detector when the X-ray source of the security inspection device is turned off and the conveyor belt is stationary; Based on the bright field template, the dark field template and the image data to be processed, the grayscale value of the pixel point is calculated according to the following formula: n : R n =Air n -Bk n Among them, Air n is the bright field template data, Bk n is the dark field template data, Scan n is the image data to be processed, Bk n is the dark field template data, R n is the bright field correction parameter, and Factor is the correction scaling factor.

6. The method according to claim 1, characterized in that The step of performing grayscale correction on the belt artifact pixels to generate a processed security inspection image corresponding to the inspected object includes: After determining all belt artifact pixels included in the image data to be processed, grayscale correction is performed on each belt artifact pixel to generate a processed security inspection image corresponding to the inspected object; or Acquire duplicate data that is completely identical to the image data to be processed; determining, based on the belt artifact pixels detected in the image data to be processed, artifact pixels in the copied data corresponding to the belt artifact pixels in the image data to be processed; Grayscale correction is performed on the artifact pixels in the copied data to generate a processed security inspection image corresponding to the inspected object.

7. A belt artifact processing device, characterized in that: The device comprises: A data acquisition module is used to obtain the image data to be processed by the security inspection equipment for the inspected object; a pixel determination module, configured to determine, during a sliding process of a preset filter kernel, whether each pixel in the image data to be processed is a belt artifact pixel based on a grayscale value of a target pixel in the image data to be processed, wherein the target pixel is a pixel corresponding to a plurality of filter units included in the preset filter kernel in the image data to be processed, and the preset filter kernel further includes a dilation unit, wherein the filter unit and the dilation unit are spaced apart; A grayscale correction module, configured to perform grayscale correction on the belt artifact pixels to generate a processed security inspection image corresponding to the inspected object; The pixel determination module includes: A filter kernel sliding submodule, configured to slide a preset filter kernel with a fixed step size according to the storage order of the image data to be processed in the memory; a pixel determination submodule for determining whether the central target pixel is a belt artifact pixel based on a relationship between the grayscale value of the central target pixel and the grayscale value of the edge target pixel in the image data to be processed and a preset threshold condition, and the number of grayscale values ​​of other target pixels that meet the preset threshold condition, each time the preset filter kernel is slid once; Among them, the central target pixel point is the pixel point corresponding to the central filter unit of the preset filter kernel, the edge target pixel point is the pixel point corresponding to the edge filter unit of the preset filter kernel, and the other target pixel points are the pixel points corresponding to the filter units other than the central filter unit and the edge filter unit.

8. The device according to claim 7, characterized in that The pixel determination submodule includes: A central target pixel point determination unit, configured to determine whether the grayscale value of the central target pixel point is less than a preset grayscale value threshold; Another target pixel point judgment unit is used to determine whether the grayscale value of the other target pixel points is less than the preset grayscale value threshold if the grayscale value of the central target pixel point is less than the preset grayscale value threshold; a quantity determining unit, which determines whether the number of target pixels whose corresponding grayscale values ​​are smaller than the preset grayscale value threshold is not greater than a preset number if the grayscale value of the other target pixels is smaller than the preset grayscale value threshold; an edge target pixel point judgment unit, configured to determine whether the grayscale value of the edge target pixel point is greater than the preset grayscale value threshold if the number of target pixels whose corresponding grayscale values ​​are less than the preset grayscale value threshold is not greater than the preset number; a pixel determining unit, configured to determine that the central target pixel is a belt artifact pixel if the grayscale value of the edge target pixel is greater than the preset grayscale value threshold; The number of the plurality of filter units included in the preset filter kernel and the length of the expansion unit are determined based on the length of the belt artifact to be detected, and the receptive field length of the preset filter kernel is greater than the length of the belt artifact to be detected; The number of the plurality of filtering units included in the preset filtering core is 5, and the preset number is 2; The data acquisition module includes: A data acquisition submodule, configured to acquire a bright-field template and a dark-field template of the security inspection device, as well as image data to be processed of the inspected object, wherein the bright-field template is the X-ray signal intensity collected by the detector when the X-ray source of the security inspection device is turned on and the conveyor belt is stationary, and the dark-field template is the X-ray signal intensity collected by the detector when the X-ray source of the security inspection device is turned off and the conveyor belt is stationary; Gray value calculation submodule, used to calculate the gray value of the pixel point Cali based on the bright field template, the dark field template and the image data to be processed according to the following formula n : R n =Air n -Bk n Among them, Air n is the bright field template data, Bk n is the dark field template data, Scan n is the image data to be processed, Bk n is the dark field template data, R n is the bright field correction parameter, Factor is the correction scaling factor; The grayscale correction module is used to perform grayscale correction on each belt artifact pixel after determining all belt artifact pixels included in the image data to be processed, so as to generate a security inspection image corresponding to the inspected object after processing; or the grayscale correction module is used to: obtain copy data that is exactly the same as the image data to be processed; determine the artifact pixel points in the copy data corresponding to the belt artifact pixels in the image data to be processed based on the belt artifact pixels detected in the image data to be processed; perform grayscale correction on the artifact pixel points in the copy data, so as to generate a security inspection image corresponding to the inspected object after processing.

9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the method according to any one of claims 1 to 6 when executing a program stored in a memory.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Artifact correction method, computer equipment and readable storage medium

    CN115375787A

  • Surface defect detection method and device, storage medium and electronic equipment

    CN115439448A