Backscattered image and transmission image matching method and device, equipment and storage medium
Patent Information
- Application Number
- CN202610067270.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-19
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2046-01-19
AI Technical Summary
[0005]有鉴于此,本发明提供了一种背散射图像与透射图像匹配方法、装置、设备及存储介质,以解决背散射图像与透射图像无法有效匹配的问题
[0013]本发明提供的一种背散射图像与透射图像匹配方法,基于形状上下文相似度的轮廓匹配方法,并通过最小化上下文相似度代价和改进的最近邻匹配算法实现最优匹配,能够有效解决形状变换和噪声干扰问题,提高了图像匹配的鲁棒性和精度。
Smart Images

Figure CN122066746B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of security inspection and identification technology, specifically to a method, apparatus, device, and storage medium for matching backscattered images and transmitted images. Background Technology
[0002] Currently, X-ray security inspection machines mainly consist of a radiation source module and a detection data acquisition module. The main function of the radiation source module is to generate an X-ray beam, while the detection data acquisition module is responsible for collecting data after X-ray irradiation and generating images. During this process, due to differences in the positions of the radiation source and detection module, different imaging methods, and differences in acquisition time, there will be differences in position, size, and shape between the transmitted image and the backscattered image.
[0003] In practice, the workflow of an X-ray security inspection machine is usually as follows: the transmission module is responsible for acquiring the transmission image generated when the item passes through the transmission channel section; the backscatter module is responsible for acquiring the backscatter image generated when the item passes through the backscatter channel section. Backscattering is mainly for organic materials.
[0004] Because the two types of images were captured at different times, and the positions, sizes, and data of the images' targets also differ, directly matching these two images presents several technical challenges when analyzing and comparing them. For example, how to overcome positional and dimensional deviations during the imaging process while ensuring image matching accuracy, and how to achieve effective matching of the two images, is a problem that urgently needs to be solved. Summary of the Invention
[0005] In view of this, the present invention provides a method, apparatus, device and storage medium for matching backscattered images and transmitted images, so as to solve the problem that backscattered images and transmitted images cannot be effectively matched.
[0006] In a first aspect, the present invention provides a method for matching backscattered images with transmitted images, the method comprising: The transmission and backscatter images of the object under inspection within the scanning area are acquired, and the transmission and backscatter images are segmented to obtain the transmission and backscatter image contours of the target object. Uniform sampling is performed on the contours of the transmitted image and the backscattered image to obtain the sampling points of the transmitted image contour and the backscattered image contour. Based on shape context similarity and an improved nearest neighbor matching algorithm, the correct matching point pairs of the transmission image contour sampling points and the backscatter image contour sampling points are calculated. Based on the correct matching point pairs, the transmission image contour and the backscatter image contour of the target object are fuzzy matched to obtain the fuzzy matching result. The area scaling ratio and particle offset are calculated based on the contours of the transmitted image and the backscattered image, and the fuzzy matching results are then calibrated using the area scaling ratio and particle offset.
[0007] This invention provides a backscattered image and transmission image matching method that significantly improves the matching accuracy and computational efficiency between backscattered and transmission images through image segmentation, contour sampling, and shape context similarity matching. By removing irrelevant data and interference information, errors in the matching process are reduced, ensuring accurate target alignment. Uniform sampling of the contours in both the transmission and backscattered images reduces the randomness of matching feature selection. Shape context similarity is used to accurately describe the overall and local features of the contours, and a reasonable cost function improves the accuracy of the similarity description between the transmission and backscattered contours. An improved nearest neighbor matching algorithm is used to consider both global and local contour features, stably obtaining matching point pairs and accurate affine transformation matrices. Simultaneously, scaling and offset calculations address the issue of different sizes and positions of the same target in the transmission and backscattered images, ensuring the applicability and robustness of the method. This enables accurate correspondence between target objects in the transmission and backscattered images, achieving effective registration of the two images, avoiding matching errors, and solving the problem of ineffective matching between backscattered and transmission images.
[0008] In one optional implementation, image segmentation is performed on the transmitted image and the backscattered image to obtain the transmitted image contour and the backscattered image contour of the target object, including: Instance segmentation is performed on the transmission image and backscattered image respectively to obtain the instance segmentation result of each object in the inspected object; Based on the instance segmentation results, target objects smaller than the confidence threshold are removed to obtain the correct target objects; the target objects include the contour, bounding box, and confidence score. Based on the outline and bounding box of the target object, the target object region is cropped to obtain the transmission image outline and backscatter image outline of the target object, respectively.
[0009] The present invention provides a backscattered image and transmission image matching method, which uses an image segmentation algorithm to accurately extract the contour of the target object in the transmission image and the backscattered image, and generates the bounding rectangle of the target object. This method can effectively remove background interference and retain only the target object region, providing high-quality input data for subsequent matching.
[0010] In an optional implementation, the backscattered image to transmission image matching method further includes, before uniformly sampling the transmission image contour and the backscattered image contour: Preprocessing is performed on the contours of the transmitted image and the backscattered image, including contour area filtering, contour merging, binarization, line width adjustment, and image processing.
[0011] The present invention provides a backscattered image and a transmission image matching method, which performs preprocessing on the contours of the transmission image and the backscattered image respectively, including contour area screening, contour merging, binarization and line width adjustment, to remove irrelevant data and interference information, reduce errors in the matching process, ensure accurate target alignment, optimize contour quality, improve matching accuracy and accelerate the calculation process.
[0012] In one alternative implementation, the correct matching point pairs of the transmission image contour sampling points and the backscattered image contour sampling points are calculated based on shape context similarity and an improved nearest neighbor matching algorithm, including: Calculate the first shape context histogram of the contour sampling points in the transmission image and the second shape context histogram of the contour sampling points in the backscattered image, respectively; Calculate the context similarity cost based on the first shape context histogram and the second shape context histogram; An improved nearest neighbor matching algorithm is adopted to calculate the correct matching point pairs between the contour sampling points of the transmission image and the contour sampling points of the backscattered image by minimizing the context similarity cost.
[0013] This invention provides a backscattered image and transmission image matching method, which is a contour matching method based on shape context similarity. It achieves optimal matching by minimizing the context similarity cost and using an improved nearest neighbor matching algorithm. This method can effectively solve the problems of shape transformation and noise interference, and improve the robustness and accuracy of image matching.
[0014] In one optional implementation, calculating a first shape context histogram of the contour sampling points in the transmission image and a second shape context histogram of the contour sampling points in the backscattered image, respectively, includes: Select any one of the transmission image contour sampling points as the first reference point. With the first reference point as the center, draw concentric circles at logarithmic intervals within a preset radius area. Divide each concentric circle into a preset number of angular sectors. Calculate the first position vector from the first reference point to other transmission image contour sampling points, and project the distance of the first position vector onto the corresponding concentric circle area. Project the angle of the first position vector onto the corresponding angular sector. Count the number of vector points in each sector to generate the first histogram of the first reference point. Repeat the first histogram generation step for all transmission image contour sampling points, calculate the first histogram of all transmission image contour sampling points, and merge them by row or column to obtain the first shape context histogram of the transmission image contour. Choose any backscattered image contour sampling point as the second reference point. With the second reference point as the center, draw concentric circles at logarithmic intervals within a preset radius area. Divide each concentric circle into a preset number of angular sectors. Calculate the second position vector from the second reference point to other backscattered image contour sampling points, and project the distance of the second position vector onto the corresponding concentric circle area. Project the angle of the second position vector onto the corresponding angular sector. Count the number of vector points in each sector to generate the second histogram of the second reference point. Repeat the above steps for all backscattered image contour sampling points, calculate the second histogram of all backscattered image contour sampling points, and merge them by row or column to obtain the second shape context histogram of the backscattered image contour.
[0015] In one optional implementation, the context similarity cost is calculated based on the first shape context histogram and the second shape context histogram, including: Choose any one of the context histograms of the contour sampling point in the transmission image as the first reference point, and choose any one of the context histograms of the contour sampling point in the backscattered image as the second reference point. Calculate the context histogram similarity cost between the first and second reference points. Repeat the step of generating the second histogram for all reference points, calculate the context histogram similarity cost for all reference points, and merge all context histogram similarity costs to obtain the context similarity cost matrix of the histogram. Use the context similarity cost matrix as the context similarity cost.
[0016] In one optional implementation, an improved nearest neighbor matching algorithm is employed to calculate the correct matching point pairs between the contour sampling points of the transmitted image and the contour sampling points of the backscattered image by minimizing the context similarity cost, including: An improved nearest neighbor matching algorithm is used to find the backscattered image contour sampling point with the minimum similarity cost for each transmission image contour sampling point, and generate the corresponding matching point pair. The process of generating matching point pairs is repeated until all transmission image contour sampling points are matched, thereby obtaining the set of all correct matching point pairs.
[0017] In one optional implementation, a fuzzy matching is performed on the transmission image contour and backscattered image contour of the target object based on the correct matching points to obtain a fuzzy matching result, including: Based on the correctly matched feature point pairs, the affine transformation matrix for fuzzy matching is calculated; based on the affine transformation matrix, the backscattered image contour is subjected to affine transformation; the fuzzy matching of the transmitted image contour after the affine transformation of the target object and the backscattered image contour is performed to generate the fuzzy matching result.
[0018] In one optional implementation, calculating the area scaling ratio and particle offset based on the transmitted image contour and the backscattered image contour includes: The area ratio is calculated based on the contours of the transmitted image and the backscattered image to obtain the area scaling ratio. The particle points of the fuzzy matching results are calculated based on the contours of the transmitted image and the backscattered image, respectively, and the particle offset is calculated based on the particle points of the fuzzy matching results.
[0019] The present invention provides a method for matching backscattered and transmitted images. By calculating the area ratio of the contours of the transmitted image and the backscattered image, the area scaling ratio of the image is obtained. At the same time, by calculating the mass offset of the target object, the offset of the target position is accurately obtained, thereby providing an accurate reference value for actual calculation.
[0020] In a second aspect, the present invention provides a backscattered image and transmission image matching device, the device comprising: The image segmentation module is used to acquire the transmission image and backscatter image of the object under inspection within the scanning area, and to perform image segmentation on the transmission image and backscatter image to obtain the transmission image contour and backscatter image contour of the target object. The contour sampling module is used to uniformly sample the contours of the transmitted image and the backscattered image to obtain the contour sampling points of the transmitted image and the backscattered image. The contour matching module is used to calculate the correct matching point pairs between the contour sampling points of the transmission image and the contour sampling points of the backscatter image based on shape context similarity and an improved nearest neighbor matching algorithm. Based on the correct matching point pairs, the contour of the transmission image and the contour of the backscatter image of the target object are fuzzy matched to obtain the fuzzy matching result. The offset scaling calculation module is used to calculate the area scaling ratio and particle offset based on the contours of the transmitted image and the backscattered image, and to perform actual mapping calibration on the fuzzy matching results based on the area scaling ratio and particle offset.
[0021] Thirdly, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the backscattered image and transmission image matching method of the first aspect or any corresponding embodiment described above.
[0022] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to perform the backscattered image and transmission image matching method of the first aspect or any corresponding embodiment thereof.
[0023] Fifthly, the present invention provides a computer program product, including computer instructions for causing a computer to execute the backscattered image and transmission image matching method of the first aspect or any corresponding embodiment thereof. Attached Figure Description
[0024] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0025] Figure 1 This is a schematic flowchart of a backscattered image and transmission image matching method according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating another backscattered image and transmission image matching method according to an embodiment of the present invention; Figure 3 This is a flowchart illustrating another backscattered image and transmission image matching method according to an embodiment of the present invention; Figure 4(a) is a schematic diagram of the transmission image outline according to an embodiment of the present invention; Figure 4(b) is a schematic diagram of the backscattered image contour according to an embodiment of the present invention; Figure 5 This is a schematic diagram of matching the contours of a transmitted image and a backscattered image according to an embodiment of the present invention; Figure 6 This is a flowchart illustrating another backscattered image and transmission image matching method according to an embodiment of the present invention; Figure 7 This is a structural block diagram of a backscattered image and transmitted image matching device according to an embodiment of the present invention; Figure 8 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0027] Backscatter imaging and transmission imaging have different sensitivities in X-ray security inspections, providing valuable information for different types of materials. Transmission imaging images based on the absorption characteristics of X-rays by materials, making it more sensitive to materials with higher atomic numbers. Backscatter imaging relies primarily on the scattering characteristics of X-rays by materials, reflecting their density and atomic number distribution. Compared to transmission imaging, backscatter imaging is particularly sensitive to materials with low atomic numbers, such as organic matter, explosives, and liquids.
[0028] In X-ray security inspections, combining transmission and backscattered images allows for more comprehensive detection of different types of items. This is particularly beneficial when detecting complex security targets (such as explosives, metals, and liquids), improving accuracy and efficiency. Effective matching of backscattered and transmission images is a current challenge. Due to differences in imaging principles, imaging time, and the position of various modules, transmission and backscattered images exhibit significant differences in their image content. These differences include inconsistencies in the position, size, and shape of the target object, making direct comparison and analysis challenging. Therefore, this invention provides a method for matching backscattered and transmission images, accurately corresponding target objects in both images and achieving effective registration of the two types of images.
[0029] According to an embodiment of the present invention, a method for matching backscattered images and transmission images is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0030] This embodiment provides a method for matching backscattered images and transmitted images, which can be used in the aforementioned computer equipment. Figure 1 This is a flowchart of a backscattered image and transmitted image matching method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps: Step S101: Obtain the transmission image and backscatter image of the object under inspection within the scanning area, and perform image segmentation on the transmission image and backscatter image to obtain the transmission image contour and backscatter image contour of the target object.
[0031] Specifically, X-ray transmission technology is used to obtain the transmission image of the object under inspection within the scanning area, and Compton backscattering technology is used to obtain the backscattered image of the object under inspection within the scanning area. For specific methods of scanning and image acquisition, please refer to relevant mature technologies, which will not be elaborated here.
[0032] Image segmentation algorithms are used to segment the transmitted and backscattered images, obtaining the transmitted and backscattered image contours of the target object. These image segmentation algorithms include threshold-based, edge-based, region-based, energy-based, and deep learning-based algorithms. The specific algorithm chosen depends on the specific circumstances and is not specifically defined here.
[0033] Step S102: Uniformly sample the contours of the transmitted image and the backscattered image to obtain the sampling points of the transmitted image contour and the sampling points of the backscattered image contour.
[0034] Specifically, uniform sampling refers to the process of dividing a two-dimensional continuous image into M×N networks by dividing the two-dimensional continuous image plane into M×N networks at equal intervals in the x and y directions, and making the position of the center point of each network correspond to a pair of Cartesian coordinates (i,j) represented by integers.
[0035] The original transmission image contour and backscatter image contour are processed by uniform sampling to obtain transmission image contour sampling points and backscatter image contour sampling points. By reducing the number of contour points, the matching operation speed is accelerated, while the main morphological features of the contour are preserved, resulting in n transmission image contour sampling points and m backscatter image contour sampling points, which lay the foundation for subsequent steps.
[0036] Step S103: Based on shape context similarity and an improved nearest neighbor matching algorithm, calculate the correct matching point pairs of the transmission image contour sampling points and the backscatter image contour sampling points. Based on the correct matching point pairs, perform fuzzy matching on the transmission image contour and the backscatter image contour of the target object to obtain the fuzzy matching result.
[0037] Specifically, Shape Context is a feature description method used for shape matching and object recognition. It reflects the distribution of these sampling points on a shape contour by sampling points on that contour and describing the shape features using a histogram in log-polar coordinates. Shape Context calculates the distribution of the contour, obtaining the distribution of the entire shape relative to a given point. For each point, the result is an M×N histogram. To calculate the matching between two points, a cost function is used to calculate the similarity between their histograms.
[0038] Sampling point similarity calculation: This measures the similarity between feature points. Methods for calculating similarity cost include, but are not limited to, the following: Euclidean distance, shape context comparison, mutual information, shape comparison, correlation comparison, chi-square comparison, Patacharian coefficient, cross-entropy comparison (cross-entropy), and Earth Movement Distance (EMD) similarity measure. Each calculation method is explained in detail below: Euclidean distance, based on the straight-line distance in Euclidean space, is used to measure the geometric distance between two points.
[0039] Shape context comparison is a histogram-based method for measuring shape similarity, often combined with shape context features to calculate similarity.
[0040] Mutual information (MI) measures the correlation between two shape feature distributions; a higher value indicates a stronger similarity.
[0041] Correlation, derived from the correlation coefficient in statistics, is used to measure the linear relationship between two distributions and can assess the degree of similarity and correlation.
[0042] Chi-square comparison measures the degree of deviation between observed and theoretical values; the smaller the value, the more similar the distributions.
[0043] The Bhattacharyya coefficient is an index that calculates the similarity of distribution shapes and is sensitive to changes in the shape of the distribution.
[0044] Cross-entropy is used to measure the difference between the predicted probability distribution and the true probability distribution.
[0045] Earth Mover's Distance (EMD) calculates the minimum cost to transform one distribution into another; the smaller the cost, the more similar the distribution.
[0046] Context matching algorithms combine multiple matching algorithms to improve accuracy, including but not limited to the following: The Nearest Neighbor Matching (NNM) algorithm uses a greedy algorithm to achieve local matching and quickly find neighboring pairs.
[0047] The Hungarian Algorithm is used to solve the bipartite graph matching problem by minimizing the global matching cost.
[0048] The Random Sample Consensus (RANSAC) algorithm improves the robustness of matching by eliminating noisy data through random sampling and model fitting.
[0049] By combining nearest neighbor matching and the Hungarian algorithm to form an improved nearest neighbor matching algorithm, which takes into account both local and global optimization, higher-precision shape context matching is achieved, thereby completing the fuzzy matching of the transmission image contour and the backscattered image contour of the target object.
[0050] Step S104: Calculate the area scaling ratio and particle offset based on the transmission image contour and the backscattered image contour, and perform actual mapping calibration on the fuzzy matching result based on the area scaling ratio and particle offset.
[0051] Specifically, in actual calculations, due to the different sizes and viewing angles of the transmitted image and the backscattered image, the outline area of the same object in the transmitted image is different from that in the backscattered image, so it is necessary to calculate the area scaling ratio.
[0052] Particle offset refers to the change in position of a particle due to external forces during its motion. In physics, offset is usually used to describe the distance a particle moves in a specific direction. In this embodiment, the particle offset refers to the offset of the particle in the transmission image contour and the particle in the backscattered image contour of the target object along the x-axis and y-axis coordinates, respectively.
[0053] The fuzzy matching results are mapped to the actual area scaling ratio and particle offset to accurately calibrate the fuzzy matching results and achieve accurate matching.
[0054] The backscattered image and transmission image matching method provided in this embodiment significantly improves the matching accuracy and computational efficiency between backscattered and transmission images through image segmentation, uniform contour sampling, shape context similarity, and an improved nearest neighbor matching method. Uniform sampling of the contours of both the transmission and backscattered images reduces the randomness of matching feature selection and ensures accurate target alignment. Shape context similarity accurately describes the overall and local shapes of the contours, and Euclidean distance cost reduces computational load while improving similarity description accuracy. The improved nearest neighbor matching algorithm considers both global and local features, stably obtaining matching point pairs and accurate affine transformation matrices. Furthermore, scaling and offset calculations effectively address the issue of different sizes and positions of the same target in the transmission and backscattered images, ensuring the applicability and robustness of the method. This enables accurate correspondence between target objects in the transmission and backscattered images, achieving effective registration of the two images, avoiding matching errors, and solving the problem of ineffective matching between backscattered and transmission images.
[0055] This embodiment provides a method for matching backscattered images and transmitted images, which can be used in the aforementioned computer equipment. Figure 2This is a flowchart of a backscattered image and transmitted image matching method according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps: Step S201: Obtain the transmission image and backscatter image of the object under inspection within the scanning area, and perform image segmentation on the transmission image and backscatter image to obtain the transmission image contour and backscatter image contour of the target object.
[0056] Specifically, the image acquisition module (based on X-ray transmission technology and Compton backscattering technology) acquires transmission and backscattered images of the object under inspection within the scanning area. First, image segmentation is performed on both the transmission and backscattered images. The goal of image segmentation is to extract the contours of the target objects in the images and obtain the confidence level and category information for each target object. For both the transmission and backscattered images, their categories are set as background and object, respectively. Due to the morphological differences between the images, the transmission and backscattered images need to be processed separately.
[0057] The above step S201 includes: Step S2011: Perform instance segmentation on the transmission image and backscattered image respectively to obtain the instance segmentation result of each object in the inspected object.
[0058] Specifically, instance segmentation algorithms are applied to both the transmitted and backscattered images. Instance segmentation distinguishes objects from the background, separates each individual object in the image, generates a corresponding segmentation mask, and ensures that the output is an independent contour of each object.
[0059] Step S2012: Based on the instance segmentation results, remove target objects that are less than the confidence threshold to obtain the correct target objects; the target objects include the contour, bounding box and confidence score.
[0060] Specifically, the contour, bounding box, and confidence information of each object are extracted from the instance segmentation results, and high-confidence target objects are selected. The confidence score measures the reliability of the instance segmentation results; objects with low confidence scores are discarded to ensure the accuracy of the final result.
[0061] Step S2013: Based on the outline and bounding box of the target object, the target object region is cropped to obtain the transmission image outline and backscatter image outline of the target object.
[0062] Specifically, the target object region is cropped based on the object's contour and bounding box, generating the target object's transmission image contour and backscatter image contour. The cropping operation effectively removes background and irrelevant information, preserving the effective area of the target object, which facilitates subsequent analysis and processing. The generated contour results include the target object's position, shape features, and confidence information. The cropped transmission image contour and backscatter image contour are shown in Figure 4(a) and Figure 4(b), respectively.
[0063] Step S202 involves preprocessing the contours of the transmitted image and the backscattered image by performing contour area filtering, contour merging, binarization, line width adjustment, and image processing.
[0064] Specifically, after image segmentation, effective target contours are first selected based on area thresholds to remove small-area interference information. Then, all contours in the target object's transmission image and all contours in the target object's backscattered image are merged into a single entity for unified subsequent analysis. The merged contours undergo binarization, linewidth adjustment, and image processing to ensure that the contours completely cover the target object's area without any missing parts or noise.
[0065] Step S203 involves uniformly sampling the contours of the transmitted image and the backscattered image to obtain sampling points for the transmitted image contour and the backscattered image contour. For details, please refer to step S102 of the embodiment shown in Figure 1, which will not be repeated here.
[0066] Step S204: Based on shape context similarity and an improved nearest neighbor matching algorithm, calculate the correct matching point pairs between the contour sampling points of the transmission image and the contour sampling points of the backscattered image. Based on these correct matching point pairs, perform fuzzy matching on the contours of the transmission image and the backscattered image of the target object to obtain the fuzzy matching result. See details below. Figure 1 Step S103 of the illustrated embodiment will not be described again here.
[0067] Step S205 involves calculating the area scaling ratio and particle offset based on the contours of the transmitted and backscattered images, and then performing actual mapping calibration on the fuzzy matching results based on these ratios. For more details, please refer to [link to relevant content]. Figure 1 Step S104 of the illustrated embodiment will not be described again here.
[0068] The backscattered image and transmission image matching method provided in this embodiment utilizes an image segmentation algorithm to accurately extract the target object contours from both the transmission and backscattered images, and generates the bounding rectangle of the target object. This effectively removes background interference, retaining only the target object region, providing high-quality input data for subsequent matching. Preprocessing of the transmission and backscattered image contours involves contour area filtering, contour merging, binarization, and linewidth adjustment, respectively. This removes irrelevant data and interference information, reduces errors in the matching process, ensures accurate target alignment, optimizes contour quality, improves matching accuracy, and accelerates the calculation process.
[0069] This embodiment provides a method for matching backscattered images and transmitted images, which can be used in the aforementioned computer equipment. Figure 3 This is a flowchart of a backscattered image and transmitted image matching method according to an embodiment of the present invention, such as... Figure 3 As shown, the process includes the following steps: Step S301: Acquire the transmission image and backscatter image of the object under inspection within the scanning area, and perform image segmentation on the transmission image and backscatter image to obtain the transmission image contour and backscatter image contour of the target object. For details, please refer to [link to relevant documentation]. Figure 2 Step S201 of the illustrated embodiment will not be described again here.
[0070] Step S302 involves uniformly sampling the contours of the transmitted image and the backscattered image to obtain sampling points for the transmitted image contour and the backscattered image contour. For details, please refer to [link to relevant documentation]. Figure 2 Step S203 of the illustrated embodiment will not be described again here.
[0071] Step S303: Calculate the correct matching point pairs of the transmission image contour sampling points and the backscatter image contour sampling points based on shape context similarity and an improved nearest neighbor matching algorithm. Based on the correct matching point pairs, perform fuzzy matching on the transmission image contour and the backscatter image contour of the target object to obtain the fuzzy matching result.
[0072] Specifically, step S303 includes: Step S3031: Calculate the first shape context histogram of the contour sampling points in the transmission image and the second shape context histogram of the contour sampling points in the backscattered image, respectively.
[0073] In some optional implementations, step S3031 above includes: Step a1: Select any transmission image contour sampling point as the first reference point. Using the first reference point as the center, draw concentric circles at logarithmic intervals within a preset radius area. Divide each concentric circle into a preset number of angular sectors. Calculate the first position vector from the first reference point to other transmission image contour sampling points besides the first reference point, and project the distance of the first position vector onto the corresponding concentric circle area. Project the angle of the first position vector onto the corresponding angular sector. Count the number of vector points in each sector to generate the first histogram of the first reference point. Repeat the first histogram generation step for all transmission image contour sampling points, calculate the first histogram of all transmission image contour sampling points, and merge them by row or column to obtain the first shape context histogram of the transmission image contour.
[0074] Step a2: Select any backscattered image contour sampling point as the second reference point. Using this point as the center, draw concentric circles at logarithmic intervals within a preset radius area. Divide each concentric circle into a preset number of angular sectors. Calculate the second position vector from the second reference point to other backscattered image contour sampling points, and project the distance of the second position vector onto the corresponding concentric circle area. Project the angle of the second position vector onto the corresponding angular sector. Count the number of vector points in each sector to generate the second histogram of the second reference point. Repeat the step of generating the second histogram for all backscattered image contour sampling points, calculate the second histogram of all backscattered image contour sampling points, and merge them by row or column to obtain the second shape context histogram of the backscattered image contour.
[0075] Specifically, after processing the contours of the transmitted image and the backscattered image, two discrete sets of sampled points can be obtained. , . , These represent the contour sampling point set of the transmitted image and the contour sampling point set of the backscattered image, respectively.
[0076] First, calculate the shape context of the contour sampling points in the transmission image, choosing any point... As a reference point, and then using the reference point Using R as the center, construct concentric circles at logarithmic intervals within a radius region.
[0077] (1); in: , For the first k The radius of the concentric circles; The minimum radius can typically be set to 0 or the distance from the reference point to the nearest sampling point. The maximum radius is typically set to the distance from the reference point to the farthest sampling point. This represents the total number of concentric circles.
[0078] Then, the circumference is divided into sections, with each concentric circle divided into... M If there are angular sectors, then the 360 degrees of the circumference are divided into equal parts. M Each angle interval (each angle sector has an angle of 360° / M ). Combination N concentric circles and M Each angle sector can be used to obtain N M Each angle sector.
[0079] For reference point Calculate the distance from the reference point to other sampling points. position vector The position vector distance Projected to N A concentric circular region, vector angle Project onto M angular sectors and store the distance and angle values in a [database name]. N × M The histogram represents the distribution of sampling points around each reference point.
[0080] Then, the histograms of all reference points are merged by row or column to form an n×(n) array for n sampling points. 1) A matrix, where each row or column represents the shape context distribution between a reference point and the other n-1 points, i.e., the first shape context histogram of the transmission image contour. .
[0081] Second shape context histogram of backscattered image contour The first shape context histogram of the obtained transmission image contour The calculation steps are the same, and will not be repeated here.
[0082] Step S3032: Calculate the context similarity cost based on the first shape context histogram and the second shape context histogram.
[0083] In an optional implementation, step S3032 includes: Choose any one of the context histograms of the contour sampling point in the transmission image as the first reference point, and choose any one of the context histograms of the contour sampling point in the backscattered image as the second reference point. Calculate the context histogram similarity cost between the first and second reference points. Repeat the step of calculating the context histogram similarity cost for all reference points, calculate the context histogram similarity cost for all reference points, and merge all context histogram similarity costs to obtain the context similarity cost matrix of the histogram. Use the context similarity cost matrix as the context similarity cost.
[0084] The formula for the context similarity cost matrix is as follows: (2); The Euclidean distance is used as the similarity cost function, and the specific calculation is as follows: First shape context histogram of contour sampling points in the transmission image The second shape context histogram of the backscattered image contour sampling points ,in and These are sampling points on the contour of the transmitted image and sampling points on the contour of the backscattered image. The L2 distance (i.e., Euclidean distance) is calculated according to the following cost formula: (3); Where A represents the profile of the transmission image, with a total of n sampling points, and B represents the profile of the backscattered image, with a total of m sampling points.
[0085] Calculate all and The shape context L2 distance between them is used to obtain a Similarity cost matrix ,in Representative sampling point and sampling points The L2 distance between the shape context histograms.
[0086] Optionally, the cost formula may also include shape context comparison cost, mutual information, correlation comparison, chi-square statistics, Bhattacharyya coefficient, cross-entropy, and EDM similarity measure. Among these: Cost of shape context comparison: (4); in, This is the first shape context histogram of the transmission image contour. This is the second shape context histogram of the backscattered image contour.
[0087] Mutual information: (5); in, The similarity between two contours. First shape context histogram of the transmission image contour The probability distribution after normalization The second shape context histogram of the backscattered image contour The probability distribution after normalization; The joint probability distribution is constructed by statistically analyzing each pair of points in the two context histograms. Then normalize to get the result.
[0088] Correlation comparison: (6); (7); (8); in, First shape context histogram of the transmission image contour exist The context histogram mean of a point. The second shape context histogram of the backscattered image contour exist The mean of the context histogram of the points.
[0089] Chip-side statistics: (9); Batachalya coefficient: (10); in, First shape context histogram of the transmission image contour The probability distribution after normalization The second shape context histogram of the backscattered image contour The probability distribution after normalization.
[0090] Cross-entropy: (11); in, First shape context histogram of the transmission image contour The probability distribution after normalization The second shape context histogram of the backscattered image contour The probability distribution after normalization.
[0091] EDM similarity metric: (12); in, First shape context histogram of the transmission image contour The probability distribution after normalization The second shape context histogram of the backscattered image contour The probability distribution after normalization. It is the flow rate from the i-th point of distribution P(x) to the j-th point of distribution Q(y). It is the distance between point i and point j, here we take the Euclidean distance L2. It is the total flow.
[0092] Step S3033: An improved nearest neighbor matching algorithm is used to calculate the correct matching point pairs between the contour sampling points of the transmission image and the contour sampling points of the backscattered image by minimizing the context similarity cost.
[0093] In some optional implementations, step S3033 above includes: Step b involves using an improved nearest neighbor matching algorithm to find the backscattered image contour sampling point with the minimum similarity cost for each transmission image contour sampling point, generating the corresponding matching point pair. This matching point pair generation step is repeated until all transmission image contour sampling points are matched, thereby obtaining a set of all correct matching point pairs.
[0094] Specifically, an improved nearest neighbor matching algorithm is used to sample each contour point of the transmission image. Find the backscattered image contour sampling points with the minimum similarity cost Generate corresponding matching point pairs : (13); Repeat the above process until all contour sampling points of the transmission image are matched, thereby obtaining a complete set of matching point pairs. : (14); Alternatively, the Hungarian Algorithm can be used to globally optimize the nearest neighbor matching results.
[0095] Specifically, construct the cost matrix for global optimization. By retaining the nearest neighbor matching pairs with lower costs, we obtain the globally optimal set of matching pairs. .
[0096] Alternatively, a Random Sample Consensus (RANSAC) algorithm can be used to remove erroneous matches. Specifically, a subset of randomly sampled matching pairs is used. Fit an affine transformation model T and calculate the residuals of point pairs. By eliminating residuals The outer points are used to ultimately retain the correct set of inner points. : (15); Step S3034: Based on the correctly matched feature point pairs, calculate the affine transformation matrix for fuzzy matching; based on the affine transformation matrix, perform an affine transformation on the backscattered image contour; perform fuzzy matching between the affine transformed transmission image contour of the target object and the backscattered image contour to generate a fuzzy matching result.
[0097] Specifically, using the set of matching point pairs M' (M' can be...) or or Calculate the affine transformation matrix Then, an affine transformation is performed on the backscattered image contour B to obtain the transformed backscattered image contour. : (16); Compare the transmitted image contour with the transformed backscattered image contour Perform fuzzy matching, such as Figure 5 As shown, the fuzzy matching result is obtained.
[0098] Step S304: Calculate the area scaling ratio and particle offset based on the transmission image contour and the backscattered image contour, and perform actual mapping calibration on the fuzzy matching result based on the area scaling ratio and particle offset.
[0099] Specifically, step S304 includes: Step S3041: Calculate the area ratio based on the contour of the transmitted image and the contour of the backscattered image to obtain the area scaling ratio.
[0100] Specifically, the area scaling ratio is calculated using the following formula: (17); in, The area of the transmitted image contour; The area of the backscattered image contour; This represents the area scaling ratio between the transmitted image contour and the backscattered image contour.
[0101] Step S3042: Calculate the mass points of the fuzzy matching results based on the contours of the transmitted image and the backscattered image, and calculate the mass point offset based on the mass points of the fuzzy matching results.
[0102] Specifically, the mass points of the contour are calculated using the obtained contour of two corresponding points (i.e., a matching point pair). The mass points are calculated using the following formula: , (18); in, For the first i A pair of matching points x and y Coordinates; N' is the total number of matching point pairs.
[0103] The two particles are respectively ( , )and( , To calculate the particle offset in the x and y coordinates, the particle offset is calculated using the following formula: (19); in, This is the offset of the target object's centroid on the x-axis; This represents the offset of the centroid of the target image on the y-axis.
[0104] The backscattered image and transmission image matching method provided in this embodiment, based on shape context similarity, achieves optimal matching by minimizing the Euclidean distance cost and using an improved nearest neighbor matching algorithm. This method considers both global and local contour features, effectively reducing the interference of deformation and noise, and improving the robustness and accuracy of image matching. By calculating the area ratio and particle offset of the contours in the transmission and backscattered images, the method effectively solves the problem of different sizes and positions of the same target in the transmission and backscattered images, achieving effective registration of the transmission and backscattered images.
[0105] As one or more specific application embodiments of the present invention, combined with Figure 6 The backscattered image and transmission image matching process provided by this invention is described in general as follows: Image segmentation is performed on both the transmitted image and the backscattered image to extract the contours of the target object. The segmented contours are preprocessed, including merging, binarization, and scaling and offset calculations. Uniform sampling is performed on the binarized contours. Contour context similarity is extracted based on the sampling points, and an improved nearest neighbor matching algorithm is used to calculate the fuzzy matching results between the contour sampling points of the transmitted image and the backscattered image. The matching mapping of the backscattered contours is completed by combining the fuzzy matching results with the offset and scaling.
[0106] The flowchart of a backscattered image and transmission image matching method provided in this embodiment is as follows: Figure 6 As shown, the specific steps are as follows: The image acquisition module (based on X-ray transmission technology and Compton backscattering technology) acquires transmission and backscattered images of the object under inspection within the scanning area. First, image segmentation is performed on both the transmission and backscattered images to extract the target object contour and bounding box confidence level, and targets with higher confidence levels are selected and retained. Because the transmission and backscattered images have significant morphological differences, image segmentation is performed on both images separately.
[0107] The specific operating steps are as follows: 1. Image segmentation: Instance segmentation algorithms are applied to both the transmitted image and the backscattered image.
[0108] 2. Target Filtering: Based on the image segmentation results, targets with low confidence are removed, including their contours, bounding boxes, and confidence scores. Only targets with high confidence scores are retained. The effective target regions are then cropped based on the bounding boxes, and the contours, bounding box boundaries, and confidence scores of each target object are output.
[0109] 3. Contour preprocessing: Since the segmented targets may be disconnected, have small contour interference, or have nested contours, further processing is required.
[0110] First, useless small outlines are filtered out based on an area threshold to remove interfering information. Then, all outlines of the target object are binarized and merged into a single whole. The line width of the binarized outlines is adjusted to ensure that all parts of the target are included.
[0111] 4. Contour sampling: Uniform sampling is performed on the preprocessed binarized contour to obtain two sets of discrete sampling points. , . , These represent the contour sampling point set of the transmitted image and the contour sampling point set of the backscattered image, respectively.
[0112] 5. Contour matching: Based on shape context similarity and an improved nearest neighbor matching algorithm, fuzzy matching results can be obtained. For details, please refer to step S303, which will not be repeated here.
[0113] 6. Offset scaling calculation: The translation and scaling parameters are calculated based on the contours of the transmitted image and the backscattered image. See step S304 for details, which will not be repeated here.
[0114] The backscattered image and transmission image matching method provided in this embodiment significantly improves the matching accuracy and computational efficiency between backscattered and transmission images through precise image segmentation, contour sampling, and shape context similarity matching. By removing irrelevant data and interference information, errors in the matching process are reduced, ensuring accurate target alignment. Uniform sampling of the contours of both the transmission and backscattered images reduces the randomness of matching feature selection. Shape context similarity is used to accurately describe the overall and local features of the contours, and a reasonable cost function is used to improve the accuracy of the similarity description between the transmission and backscattered contours. An improved nearest neighbor matching method optimizes the matching effect, taking into account both global and local contour features, stably obtaining matching point pairs, and obtaining accurate affine transformation matrices. This effectively reduces the interference problems of shape transformation and noise. At the same time, scaling and offset calculations effectively solve the problem of different sizes and positions of the same target in the transmission and backscattered images, ensuring the applicability and robustness of the method. Overall, this method has high accuracy, computational efficiency, and system stability, and is suitable for image matching tasks in various complex scenarios.
[0115] This embodiment also provides a backscattered image and transmission image matching device, which is used to implement the above embodiments and preferred embodiments, and will not be repeated as already described. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0116] This embodiment provides a backscattered image and transmission image matching device, such as... Figure 7 As shown, it includes: The image segmentation module 701 is used to acquire the transmission image and backscatter image of the object under inspection within the scanning area, and to perform image segmentation on the transmission image and backscatter image to obtain the transmission image contour and backscatter image contour of the target object.
[0117] The contour sampling module 702 is used to uniformly sample the contours of the transmission image and the backscattered image to obtain the contour sampling points of the transmission image and the backscattered image.
[0118] The contour matching module 703 is used to calculate matching point pairs between the contour sampling points of the transmission image and the contour sampling points of the backscattered image based on shape context similarity and an improved nearest neighbor matching algorithm. Based on the correct matching point pairs, the contour of the transmission image and the contour of the backscattered image of the target object are fuzzy matched to obtain the fuzzy matching result.
[0119] The offset scaling calculation module 704 is used to calculate the area scaling ratio and particle offset based on the contour of the transmitted image and the contour of the backscattered image, and to perform actual mapping calibration on the fuzzy matching results based on the area scaling ratio and particle offset.
[0120] In some alternative implementations, the image segmentation module 701 includes: The instance segmentation unit is used to perform instance segmentation on the transmission image and the backscattered image respectively, so as to obtain the instance segmentation result of each object in the inspected object.
[0121] The target object filtering unit is used to remove target objects with a confidence threshold based on the instance segmentation results, so as to obtain the correct target objects; the target objects include the contour, the bounding box, and the confidence score.
[0122] In some alternative embodiments, the backscattered image and transmitted image matching device further includes: The contour preprocessing module is used to perform preprocessing on the contours of the transmitted image and the backscattered image, including contour area filtering, contour merging, binarization, line width adjustment, and image processing.
[0123] In some alternative implementations, the contour matching module 703 includes: The shape context histogram calculation unit is used to calculate the first shape context histogram of the contour sampling points of the transmission image and the second shape context histogram of the contour sampling points of the backscattered image, respectively.
[0124] The similarity cost calculation unit is used to calculate the similarity cost of shape context based on the first shape context histogram and the second shape context histogram.
[0125] The contour matching unit is used to compute the correct matching point pairs of contour sampling points in the transmission image and the backscattered image by employing an improved nearest neighbor matching algorithm and minimizing the context similarity cost.
[0126] In some alternative implementations, the shape context histogram calculation unit includes: The first shape context histogram calculation subunit is used to select any transmission image contour sampling point as the first reference point, and draw concentric circles with the first reference point as the center within a preset radius area at logarithmic intervals; divide each concentric circle into a preset number of angular sectors; calculate the first position vector from the first reference point to other transmission image contour sampling points, and project the distance of the first position vector onto the corresponding concentric circle area, and project the angle of the first position vector onto the corresponding angular sector; count the number of vector points in each sector to generate the first histogram of the first reference point; repeat the first histogram generation step for all transmission image contour sampling points, calculate the first histogram of all transmission image contour sampling points, and merge them by row or column to obtain the first shape context histogram of the transmission image contour.
[0127] The second shape context histogram calculation subunit is used to select any backscattered image contour sampling point as the second reference point, and draw concentric circles with the second reference point as the center within a preset radius region at logarithmic intervals; divide each concentric circle into a preset number of angular sectors; calculate the second position vector from the second reference point to other backscattered image contour sampling points, and project the distance of the second position vector onto the corresponding concentric circle region, and project the angle of the second position vector onto the corresponding angular sector; count the number of vector points in each sector to generate the second histogram of the second reference point; repeat the second histogram generation step for all backscattered image contour sampling points, calculate the second histogram of all backscattered image contour sampling points, and merge them by row or column to obtain the second shape context histogram of the backscattered image contour.
[0128] In some optional implementations, the similarity cost calculation unit includes: The similarity cost calculation subunit arbitrately selects the context histogram of a contour sampling point in the transmission image as the first reference point and the context histogram of a contour sampling point in the backscattered image as the second reference point, and calculates the context histogram similarity cost of the first and second reference points. The process of calculating the context histogram similarity cost is repeated for all reference points, and the context histogram similarity costs of all reference points are merged to obtain the context similarity cost matrix of the histogram. The context similarity cost matrix is used as the context similarity cost.
[0129] In some alternative implementations, the contour matching unit includes: The matching point pair calculation subunit is used to find the backscattered image contour sampling point with the minimum similarity cost for each transmission image contour sampling point using an improved nearest neighbor matching algorithm, and generate the corresponding matching point pair; the matching point generation step is repeated until all transmission image contour sampling points are matched, thereby obtaining the set of all correct matching point pairs.
[0130] In some alternative implementations, the contour matching module 703 further includes: The affine transformation and fuzzy matching unit is used to calculate the affine transformation matrix for fuzzy matching based on the correctly matched feature point pairs; perform affine transformation on the backscattered image contour based on the affine transformation matrix; and perform fuzzy matching between the affine transformed transmission image contour of the target object and the backscattered image contour to generate the fuzzy matching result.
[0131] In some alternative implementations, the offset scaling calculation module 704 includes: The area scaling ratio calculation unit is used to calculate the area ratio based on the contours of the transmitted image and the backscattered image to obtain the area scaling ratio.
[0132] The particle offset calculation unit is used to calculate the particle of the fuzzy matching result based on the contour of the transmitted image and the contour of the backscattered image, and to calculate the particle offset based on the particle of the fuzzy matching result.
[0133] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0134] In this embodiment, the backscattered image and transmission image matching device is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0135] This invention also provides a computer device having the above-described features. Figure 7 The backscattered image and transmitted image matching device shown.
[0136] Please see Figure 8 , Figure 8 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 8As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 8 Take a processor 10 as an example.
[0137] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0138] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.
[0139] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0140] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0141] The computer device also includes an input device 30 and an output device 40. The processor 10, memory 20, input device 30, and output device 40 can be connected via a bus or other means. Figure 8 Taking the example of a connection between China and Israel via a bus.
[0142] Input device 30 can receive input numerical or character information, and generate key signal inputs related to user settings and function control of the computer device, such as a touchscreen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc. Output device 40 may include display devices, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibration motors). The aforementioned display devices include, but are not limited to, liquid crystal displays, light-emitting diodes, displays, and plasma displays. In some alternative embodiments, the display device may be a touchscreen.
[0143] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
[0144] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0145] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method for matching backscattered images with transmitted images, characterized in that, The method includes: The transmission image and backscatter image of the object under inspection within the scanning area are acquired, and the transmission image and backscatter image are segmented to obtain the transmission image contour and backscatter image contour of the target object. Uniform sampling is performed on the transmitted image contour and the backscattered image contour to obtain the transmitted image contour sampling points and the backscattered image contour sampling points. Based on shape context similarity and an improved nearest neighbor matching algorithm, the correct matching point pairs of the transmission image contour sampling points and the backscatter image contour sampling points are calculated. Based on the correct matching point pairs, the transmission image contour and the backscatter image contour of the target object are fuzzy matched to obtain the fuzzy matching result. The algorithm for calculating the correct matching point pairs between the contour sampling points of the transmission image and the contour sampling points of the backscattered image, based on shape context similarity and an improved nearest neighbor matching algorithm, includes: Calculate the first shape context histogram of the contour sampling points in the transmission image and the second shape context histogram of the contour sampling points in the backscattered image, respectively; Calculate the context similarity cost based on the first shape context histogram and the second shape context histogram; An improved nearest neighbor matching algorithm is adopted to calculate the correct matching point pairs between the contour sampling points of the transmission image and the contour sampling points of the backscattered image by minimizing the context similarity cost; The calculation of the first shape context histogram of the contour sampling points in the transmission image and the second shape context histogram of the contour sampling points in the backscattered image, respectively, includes: Select any one of the transmission image contour sampling points as the first reference point. With the first reference point as the center, draw concentric circles at logarithmic intervals within a preset radius area. Divide each concentric circle into a preset number of angular sectors. Calculate the first position vector from the first reference point to other transmission image contour sampling points besides the first reference point, and project the distance of the first position vector onto the corresponding concentric circle area, and project the angle of the first position vector onto the corresponding angular sector. Count the number of vector points in each sector to generate the first histogram of the first reference point. Repeat the first histogram generation step for all transmission image contour sampling points, calculate the first histogram of all transmission image contour sampling points, and merge them by row or column to obtain the first shape context histogram of the transmission image contour. Select any backscattered image contour sampling point as the second reference point. With the second reference point as the center, draw concentric circles at logarithmic intervals within a preset radius area. Divide each concentric circle into a preset number of angular sectors. Calculate the first position vector from the second reference point to other backscattered image contour sampling points, and project the distance of the vector onto the corresponding concentric circle area. Project the angle of the vector onto the corresponding angular sector. Count the number of vector points in each sector to generate a second histogram for the second reference point. Repeat the second histogram generation step for all backscattered image contour sampling points, calculate the second histogram for all backscattered image contour sampling points, and merge them by row or column to obtain a second shape context histogram of the backscattered image contour. The calculation of context similarity cost based on the first shape context histogram and the second shape context histogram includes: Choose any one of the context histograms of the contour sampling point in the transmission image as the first reference point, and choose any one of the context histograms of the contour sampling point in the backscattered image as the second reference point. Calculate the context histogram similarity cost between the first and second reference points. Repeat the step of calculating the context histogram similarity cost for all reference points, calculate the context histogram similarity cost for all reference points, and merge all context histogram similarity costs to obtain the context similarity cost matrix of the histogram. Use the context similarity cost matrix as the context similarity cost. The area scaling ratio and particle offset are calculated based on the contours of the transmitted image and the backscattered image, and the fuzzy matching result is then calibrated by actual mapping based on the area scaling ratio and particle offset.
2. The method according to claim 1, characterized in that, Image segmentation is performed on the transmitted image and backscattered image to obtain the transmitted image contour and backscattered image contour of the target object, including: Instance segmentation is performed on the transmitted image and the backscattered image respectively to obtain the instance segmentation result of each object in the inspected object; Based on the instance segmentation results, target objects smaller than the confidence threshold are removed to obtain the correct target objects; the target objects include contours, bounding boxes, and confidence scores. Based on the outline and bounding box of the target object, the target object region is cropped to obtain the transmission image outline and backscatter image outline of the target object, respectively.
3. The method according to claim 1, characterized in that, Before uniformly sampling the transmitted image contour and the backscattered image contour, the method further includes: The transmitted image contour and the backscattered image contour are respectively subjected to contour area filtering, contour merging, binarization, line width adjustment and image processing preprocessing.
4. The method according to claim 1, characterized in that, The improved nearest neighbor matching algorithm calculates the correct matching point pairs between the contour sampling points of the transmission image and the contour sampling points of the backscattered image by minimizing the context similarity cost, including: An improved nearest neighbor matching algorithm is used to find the backscattered image contour sampling point with the minimum similarity cost for each transmission image contour sampling point, and generate the corresponding matching point pair; the step of generating matching point pairs is repeated until all transmission image contour sampling points are matched, thereby obtaining the set of all correct matching point pairs.
5. The method according to claim 1, characterized in that, The step of performing fuzzy matching on the transmission image contour and backscattered image contour of the target object based on the correct matching point pair to obtain the fuzzy matching result includes: Calculate the affine transformation matrix for fuzzy matching based on correctly matched feature point pairs; Affine transformation of the backscattered image contour based on the affine transformation matrix; The fuzzy matching results are generated by performing fuzzy matching on the contours of the transmitted image and the backscattered image after the affine transformation of the target object.
6. The method according to claim 1, characterized in that, Calculate the area scaling ratio and particle offset based on the contours of the transmitted image and the backscattered image, including: The area ratio is calculated based on the transmitted image contour and the backscattered image contour to obtain the area scaling ratio. The particle points of the fuzzy matching results are calculated based on the contours of the transmitted image and the backscattered image, respectively, and the particle offset is calculated based on the particle points of the fuzzy matching results.
7. A backscattered image and transmitted image matching device, characterized in that, The apparatus used in the backscattered image and transmission image matching method according to any one of claims 1 to 6 comprises: The image segmentation module is used to acquire the transmission image and backscatter image of the object under inspection within the scanning area, and to perform image segmentation on the transmission image and backscatter image to obtain the transmission image contour and backscatter image contour of the target object. The contour sampling module is used to uniformly sample the contour of the transmitted image and the contour of the backscattered image to obtain the contour sampling points of the transmitted image and the contour sampling points of the backscattered image. The contour matching module is used to calculate the correct matching point pairs between the contour sampling points of the transmission image and the contour sampling points of the backscatter image based on shape context similarity and an improved nearest neighbor matching algorithm. Based on the correct matching point pairs, the contour of the transmission image and the contour of the backscatter image of the target object are fuzzy matched to obtain the fuzzy matching result. The offset scaling calculation module is used to calculate the area scaling ratio and particle offset based on the transmission image contour and the backscattered image contour, and to perform actual mapping calibration on the fuzzy matching result based on the area scaling ratio and particle offset.
8. A computer device, characterized in that, include: A memory and a processor are communicatively connected, the memory storing computer instructions, and the processor executing the computer instructions to perform the backscattered image and transmission image matching method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the backscattered image and transmission image matching method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Intelligent method for fusing X-ray dual-energy transmission with Compton backscatter images
CN101696947A
Heterologous image accurate matching method
CN110097093A