Dual-energy x-ray image automatic registration method, device and equipment
By correcting the horizontal compression distortion of high-energy images using piecewise linear regression and the RANSAC algorithm, the problem of image geometric misalignment in industrial point light source dual-energy imaging systems is solved, improving the accuracy of material classification and the automation level of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CENT SOUTH UNIV
- Filing Date
- 2026-07-01
- Publication Date
- 2026-07-31
AI Technical Summary
In industrial point light source dual-energy imaging systems with ultra-wide field of view, there is a severe geometric misalignment and distortion between high-energy and low-energy images, which leads to a decrease in the accuracy of subsequent material classification, especially in copper ore classification tasks.
Piecewise linear regression and robust fitting algorithms (such as RANSAC) are used to automatically detect inflection points in images, calculate the horizontal compression of high-energy images relative to low-energy images, and achieve automatic image registration through pixel remapping and black filling to correct geometric distortion of high-energy images.
It achieves efficient and real-time automatic image registration, improving the accuracy of material classification, especially in the classification accuracy of copper ore waste rock in photoelectric sorting, and reducing system complexity and maintenance costs.
Smart Images

Figure CN122492779A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus and equipment for automatic registration of dual-energy X-ray images for photoelectric sorting. Background Technology
[0002] Dual-energy X-ray transmission imaging (DEXA) is one of the core technologies in modern photoelectric sorting of ores and industrial non-destructive testing. By acquiring attenuation images of objects at two different energy levels (high energy and low energy), it can effectively distinguish substances with different effective atomic numbers and densities. In the mining industry, this technology is a key means to achieve precise ore sorting and improve resource utilization.
[0003] In practical dual-energy X-ray imaging systems, regardless of whether a dual-layer detector or a fast kilovolt peak (kVp) switching scheme is used, geometric misregistration is a common problem between high-energy (HE) and low-energy (LE) images. This poses a key challenge affecting the accuracy of subsequent material classification. However, in a large number of laboratory studies and existing literature, the geometric misregistration problem of dual-energy images is usually ignored due to the small image size.
[0004] However, in practice, during an in-depth analysis of photoelectric sorting machines in real industrial mining scenarios, the invention team first clearly pointed out and systematically revealed a serious problem that has long existed but has been generally overlooked: in industrial sites where economic efficiency is pursued, in order to maximize throughput, sorting equipment needs to image a large number of ores in a very short time. This forces the imaging system to adopt a linear array scanning mode with an ultra-large field of view (there are usually dozens of ores of uneven size scattered on a long strip of material conveyor belt).
[0005] Currently, most dual-energy X-ray imaging devices use point source X-ray sources (cone beam or fan beam). This geometry determines that X-rays propagate diverge from a single point into space. When rays pass through minerals at different horizontal positions, their path length and incident angle vary significantly. Simultaneously, the physical stacking of dual-energy detectors (such as dual-layer detectors) in the vertical direction places the high-energy and low-energy detector layers in different spatial planes. Since the rays emitted from the point source are incident at different angles, the projected positions on different detector layers naturally exhibit a horizontal offset that varies with the angle. This offset is smaller at the center of the field of view (where the rays are approximately perpendicularly incident) and increases sharply at the edges of the field of view (where the ray tilt angle is large).
[0006] The inventors of this application conducted experiments using data collected from industrial sites and found that the performance was insufficient for actual copper ore classification tasks. Therefore, the inventors conducted a detailed observation of the dataset and discovered a geometric misregistration problem caused by the extremely large field of view in industrial settings. This pixel offset is typically only ten to twenty pixels on either side of a 4864×1200 image, and is easily overlooked under normal circumstances. Figure 3 The comparison images used for registration typically require careful observation and magnification to detect errors. However, such errors are very significant for fine-grained classification tasks like copper ore waste classification using deep learning. Without registration, the model will fail to learn the correct high and low energy spectrum correspondences in subsequent learning.
[0007] In summary, this application explicitly points out for the first time that in an industrial point-source dual-energy imaging system with an ultra-wide field of view, the geometric misalignment between high-energy and low-energy images is not a simple overall translation, but rather a "horizontal stretching / compression" effect that gradually intensifies from the image center outwards. Specifically, objects on the left side of the high-energy image are further to the left than the same object in the low-energy image, and objects on the right side are further to the right. If this distortion is not corrected, it will directly lead to severe artifacts in subsequent core processing steps such as dual-energy subtraction and energy spectrum analysis, thereby significantly reducing the accuracy of photoelectric sorting analysis and decision-making steps (such as the classification of low-grade copper ore and waste rock). Summary of the Invention
[0008] This application proposes an automatic registration method, apparatus, and device for dual-energy spectral X-ray images for photoelectric sorting, which can solve one of the problems existing in the background art.
[0009] To achieve the above objectives, this application adopts the following technical solution:
[0010] Firstly, an automatic registration method for dual-energy spectral X-ray images for photoelectric sorting is provided, including:
[0011] In the offline calibration stage, several pairs of high-energy and low-energy calibration images are obtained. Ore target location pairs are extracted from these pairs, each pair including the horizontal coordinates of the ore in the high-energy and low-energy calibration images. A fitting method is used, treating the entire range of horizontal coordinates as an independent variable interval. In the fitting process, inflection points in the data are automatically detected, and independent models are used to fit the data on both sides of the inflection point. The parameters of the models describe the amount of compression required between the high-energy and low-energy calibration images at each horizontal coordinate position.
[0012] During the online application phase, the image to be registered in the high-energy image-low-energy image pair to be registered is processed using the compression amount to obtain the corrected image.
[0013] In one possible design approach of the first aspect, the fitting method employs a sorted linear regression method, corresponding to a distortion model. for:
[0014] in, The horizontal coordinate is... This represents the central region of the image, which has not been stretched or compressed. and These are the left and right boundaries of the central region of the image, respectively. Represents the left side of the image. Represents the right side of the image. and These represent the slope and intercept of the left region of the image, respectively. and These represent the slope and intercept of the right-hand region of the image, respectively.
[0015] In one possible design of the first aspect, the method further includes: using a robust image segmentation algorithm SAM to extract a set of corresponding ore target location pairs from the calibration high-energy image and the calibration low-energy image, respectively.
[0016] In one possible design approach of the first aspect, during the piecewise linear regression process, the Random Sample Consensus (RANSAC) algorithm is introduced to obtain a linear model with a sufficient number of inliers, and the parameters of the linear model are determined using the inliers of this satisfactory linear model.
[0017] In one possible design approach of the first aspect, the process of the random sample consensus algorithm specifically includes:
[0018] A minimum subset is randomly selected from the initial matching point set extracted by the image segmentation algorithm, and a temporary linear model is constructed using this minimum subset.
[0019] Model iteration: Calculate the residuals of other matching points in the initial matching point set (excluding the minimum subset) to the temporary linear model. Mark the points with residuals less than a preset threshold as interior points and update the temporary linear model until the temporary linear model with the most interior points is selected as the candidate model for this segment.
[0020] The parameters of the final linear model are recalculated using all interior points of the candidate model.
[0021] In one possible design of the first aspect, the image to be registered in the high-energy image-low-energy image pair to be registered is processed using the compression amount, specifically as follows:
[0022] For a pixel column with horizontal coordinate x in the high-energy image to be registered, the new horizontal coordinate to be placed in the corrected high-energy image is the original horizontal coordinate in the high-energy image to be registered multiplied by a scaling factor, where the scaling factor corresponds to the compression amount.
[0023] In one possible design of the first aspect, processing the image to be registered in the high-energy image-low-energy image pair using the compression amount further includes:
[0024] After correction, black pixels with a grayscale value of 0 are automatically filled on both sides of the high-energy image. The width of the fill is calculated based on the extreme values of the piecewise linear function at the left and right endpoints to ensure that the final corrected high-energy image is the same size as the low-energy image to be registered.
[0025] In one possible design of the first aspect, processing the image to be registered in the high-energy image-low-energy image pair using the compression amount further includes:
[0026] Using bilinear interpolation, pixel sampling and remapping are performed on the high-energy image to be registered based on the new horizontal coordinates in the corrected high-energy image, generating the corrected high-energy image that is geometrically aligned with the low-energy image to be registered.
[0027] In a second aspect, an automatic registration device for dual-energy spectral X-ray images for photoelectric sorting is provided, comprising one or more functional units or modules for performing the method as described in any possible implementation of the first aspect.
[0028] Thirdly, an electronic device is provided, comprising: a processor, and a memory coupled to the processor, the memory for storing a computer program; the processor for executing the computer program stored in the memory such that the electronic device performs the method as described in any possible implementation of the first aspect.
[0029] Based on the above technical solution, and considering that the horizontal stretching distortion of the same dual-energy X-ray imaging device under a fixed geometric structure is deterministic and repetitive, images with representative ore distributions are used. Through a robust fitting process, the distortion parameter model of the device in the horizontal direction is calculated. For all dual-energy images produced by the device, this pre-calculated parameter is directly used to perform a one-time horizontal pixel remapping of the high-energy image, and black pixels are filled on both sides to maintain the same size as the low-energy image, thereby achieving efficient and real-time geometric registration. Attached Figure Description
[0030] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0031] Figure 1 This application provides a processing method based on offline parameter calibration and online rapid correction.
[0032] Figure 2 This is a schematic diagram of piecewise fitting provided in an embodiment of this application;
[0033] Figure 3 This is a comparison image of the registered images described in the background technique. Detailed Implementation
[0034] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0035] It should be noted that although functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification and the above-mentioned figures are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0036] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0037] Existing technologies generally fail to recognize or ignore the specific distortion of "horizontal stretching" that exists in industrial photoelectric sorting, and therefore there are no dedicated correction methods for this problem. This embodiment raises this issue for the first time and provides a solution.
[0038] like Figure 1As shown, this embodiment proposes a processing method based on offline parameter calibration and online rapid correction. It aims to correct the horizontal geometric distortion between high-energy and low-energy images in a dual-energy X-ray imaging system without any hardware modifications, calibration phantoms, manual interaction, or pre-training. The core basis is that the horizontal stretching distortion of the same dual-energy X-ray imaging device under a fixed geometry is deterministic and repetitive. Therefore, only a few images with representative mineral distributions are needed to calculate the horizontal distortion parameter model of the device using the robust fitting process proposed in this embodiment. Subsequently, for all dual-energy images produced by the device, this pre-calculated parameter set is directly used to perform a one-time horizontal pixel remapping of the high-energy image, and black pixels are filled on both sides to maintain the same size as the low-energy image, thereby achieving efficient and real-time geometric registration.
[0039] The entire process is divided into two stages: offline calibration and online application.
[0040] (1) Offline calibration stage (executed once per device, using some representative images)
[0041] Step 1: Image Acquisition and Target Segmentation
[0042] Sufficient pairs of typical dual-energy images (high-energy image HE and low-energy image LE) covering the distribution of ore at different horizontal positions in the field of view were selected. A robust image segmentation algorithm (SAM) was used to extract a pair of corresponding ore target locations from each HE and LE image. The position of each target was represented by its centroid coordinates (x, y). Experimental tests showed that the residual offset in the vertical direction was typically less than one pixel, and its impact on subsequent classification was negligible; therefore, only the horizontal coordinates were used for subsequent calculations.
[0043] Step 2: Establish the mapping relationship between horizontal offset and position.
[0044] For each pair of matched ore targets, let its horizontal coordinate in the LE image be... The horizontal coordinate in the HE image is Then the horizontal offset at that position is - .
[0045] This embodiment does not perform any manual division of the field of view. Instead, it uses a piecewise linear regression method to allow the model to automatically learn the shape of the distortion function from the data.
[0046] Let the horizontal coordinate of a point on the high-energy spectrum image be x. The required horizontal offset for correction (low-energy spectrum coordinate minus high-energy spectrum coordinate) is: The model divides the image into three regions along the X-axis:
[0047] Left region (x < C) L )
[0048] Where: C L It is the left boundary of the central region (center_left), m L It is the slope of the fitted line on the left.
[0049] The corresponding compression ratio is:
[0050] New width after compression = original width × scale L .
[0051] Central area (C) L ≤x≤C R )
[0052] This means that the region is considered to be neither stretched nor compressed, and pixels are directly copied.
[0053] Right side region (x>C) R )
[0054] Where: C R It is the right boundary of the central region (center_right), m R It is the slope of the fitted line on the right.
[0055] The corresponding compression ratio is:
[0056] C L and C R The method for determining the breakpoint is a grid search with width penalty: first, roughly find a continuous region with an offset of almost zero as the initial zero plateau, then draw a straight line on the left and right sides of this region (use RANSAC to remove outrageous mismatch points), and then try different left and right boundaries one by one near the initial breakpoint. The combination that minimizes the overall prediction error is selected. At the same time, the case where the width of the zero plateau is less than 200 pixels is penalized to prevent the central region from being compressed too narrow.
[0057] The specific approach of piecewise linear regression is as follows: the entire horizontal coordinate range is treated as a single independent variable interval. During the fitting process, inflection points in the data are automatically detected, and independent linear models are applied to both sides of each inflection point. We perform a fitting process. The correction process we are pursuing is... The final distortion model It is a continuous function consisting of multiple linear segments.
[0058] This processing method avoids the subjectivity and inaccuracy of manually dividing intervals and can automatically adapt to the actual distortion patterns under different equipment and operating conditions.
[0059] Step 3: Robust model fitting based on RANSAC algorithm
[0060] Due to factors such as image segmentation errors, noise, or ore adhesion, there may be erroneous matching points (outside points) in the matching point set. After segmenting the original dataset of the image in the previous step, we obtain the segmentation results of several ores in the image, including the location information of the segmentation bounding boxes. We use this segmentation bounding box location information to calculate the intersection-over-union ratio (IoU). If the IoU is greater than 90, then the segmentation results on the high and low energy spectra correspond to the same ore. In order to fit an effective piecewise function, but because the segmentation sometimes has certain errors (specifically, there may be two ores with slight overlap, but due to the inconsistency between the high and low energy spectrum images, and the difference in color, etc., the high energy spectrum image may have two ores in the segmentation box, while the low energy spectrum has only one, so the calculated IoU meets the condition for matching, but the actual positions are very different), it affects the fitting of the subsequent model. Therefore, in step three, some points need to be filtered out. Our piecewise function only needs to learn the left and right parts, so this RANSAC fitting is to filter the matching points of the left and right parts separately, and then fit the function. The RANSAC algorithm is introduced into the piecewise linear regression process for processing, such as Figure 2 As shown:
[0061] (a) Randomly select a minimum subset (50%) from all matching points and fit a temporary linear model.
[0062] (ii) Calculate the residuals of all other points to the model, and mark points whose residuals are less than a preset threshold (usually set to 2 pixels) as inliers. Here, "other points" refers to all remaining matching points other than the currently randomly selected minimum subset (50% of the matching points). That is, in each iteration, after fitting a temporary linear model with the randomly selected subset, the model is applied to all points that were not selected, and the residuals of these points to the model are calculated to determine whether they are inliers.
[0063] (iii) Repeat the above process a fixed number of times (200 times) and select the model with the most interior points as the candidate model for the segment.
[0064] (iv) Recalculate the final linear model parameters using all interior points of the candidate model.
[0065] The combination of RANSAC and piecewise linear regression is done automatically: the algorithm simultaneously identifies the breakpoint locations in the data and the linear model parameters on each segment during the iteration process, and finally outputs a complete piecewise linear function f(x).
[0066] Piecewise linear regression is a regression analysis method in statistics used to handle piecewise linear relationships between variables. Its core principle is to divide the data into intervals by inflection points, fit an independent linear relationship to each interval, and then integrate them into a unified model using dummy variables. When the relationship between the dependent and explanatory variables changes at a critical point (inflection point)—before the critical point there is a linear trend, and after the critical point there is a different linear trend—piecewise linear regression can be used to model this relationship.
[0067] RANSAC (Random Sample Consensus) is an iterative method for robustly estimating mathematical model parameters from datasets containing a large number of outliers (noise / outliers).
[0068] At this point, the offline calibration phase is complete. The output is the device's unique, fixed distortion parameters—namely, the slope *a* and intercept *b* of the piecewise linear function *f(x)* in each interval. These parameters describe the amount of compression required for the high-energy image relative to the low-energy image at each horizontal position. *Scale* (compression ratio) = 1 + *a*, where *a* is the value of *m* in the image. l and m r b is a constant term, independent of the compression ratio. The fit of the function can be observed by observing b. Ideally, b should be 0, and the fitting function is ∆x=m×x.
[0069] (2) Online application stage (correction of each new image)
[0070] Step 4: Fast Image Correction and Remapping
[0071] For each high-energy image subsequently acquired by the device, the following operations can be performed directly using the pre-calibrated piecewise linear offset function f(x):
[0072] (a) Calculating the compression mapping: For a pixel column with horizontal coordinate x in the HE image, its new horizontal coordinate in the corrected image should be the original coordinate multiplied by the scaling factor. Since f(x) is linear in different intervals and its slope is usually not 0, this is essentially a piecewise linear compression of the HE image. The goal of the correction is to make the geometry of the corrected image aligned with the LE image.
[0073] (ii) Size Alignment and Black Filling: After the above mapping, the effective pixel area width of the corrected image is usually smaller than the width of the original LE image (because edge pixels are compressed inward). To ensure that the corrected high-energy image and low-energy image have exactly the same size for subsequent pixel-by-pixel dual-energy analysis, this embodiment automatically fills the left and right sides of the remapped image with black pixels (grayscale value of 0). The width of the fill is calculated based on the extreme values of the piecewise linear function at the left and right endpoints, ensuring that the final image is strictly consistent with the LE image size.
[0074] The filling operation is to facilitate subsequent segmentation, allowing the two energy spectra to be segmented simultaneously using the segmentation position result of a single energy spectrum.
[0075] The padding step is performed after image compression and registration, based on subsequent calculations of the compression coefficient. Specifically, it involves padding the unregistered high-energy spectra at the image boundaries according to the calculated compression scale. Multiplying these results in a new registration image boundary width, meaning the left and right portions are compressed towards the center. However, without padding, subsequent segmentation based solely on the position of a single energy spectrum will lead to mismatched ore pixels, making correction difficult. Therefore, padding with a certain width is necessary. One of the pixels is simply for alignment purposes; choosing black is just to make it more noticeable when displayed. For example, if there were originally 1000 columns on the left, and after compression with a scale of 0.98, it needs to be shortened to 980 columns, then 20 columns on the left need to be filled.
[0076] (iii) Pixel remapping: Using bilinear interpolation, based on x new The coordinates are used to perform pixel sampling and remapping on the original HE image to generate a corrected high-energy image that is geometrically aligned with the LE image.
[0077] Pixel remapping is essentially sampling the position of the corresponding position on the new image (compressed towards the center) on the old image.
[0078] Digital images are composed of discrete pixel grids. When a new coordinate (e.g., x) is calculated... new When the value is 100.7, this point falls between the pixels in columns 100 and 101 of the original image. We cannot simply "cut" out half a pixel out of thin air, so we must estimate the gray value of this "virtual position" based on the gray values of the surrounding pixels.
[0079] The bilinear interpolation method is as follows: find four pixels adjacent to the original target position (top left, top right, bottom left, bottom right), perform two linear interpolations in the horizontal direction, and then perform one linear interpolation in the vertical direction.
[0080] The above embodiments have the following breakthroughs:
[0081] (1) Original problem focus: For the first time, it clearly pointed out and proposed a special solution for the specific distortion of "horizontal stretching" caused by ultra-large field of view imaging in real industrial optoelectronic sorting scenarios, filling the technical gap in this sub-field.
[0082] (2) Calibration-free, fully automated pure software solution: The entire calibration process is fully automated, requiring no hardware modifications, additional calibration phantoms, or manual interaction. Compared to traditional methods that rely on offline calibration, this embodiment significantly reduces system complexity and maintenance costs, and can adaptively correct dynamic distortions.
[0083] (3) High robustness of RANSAC piecewise linear fitting: The innovative combination of RANSAC algorithm with piecewise linear model effectively eliminates abnormal matching points caused by practical problems such as difficulty in ore image segmentation and target adhesion, and significantly improves the model fitting accuracy and stability under noise and error environment.
[0084] (4) Zero coupling with existing hardware: This embodiment is a pure software post-processing solution that can be seamlessly integrated into any existing dual-energy X-ray photoelectric sorting system as an independent module without any hardware modification, enabling rapid and low-cost deployment and promotion.
[0085] Table 1 Performance Evaluation (Before Correction)
[0086] Table 2 Performance Evaluation (Corrected)
[0087] Table 1 shows the performance evaluation of the classification task on the uncorrected dual-energy X-ray low-grade copper ore dataset, and Table 2 shows the performance evaluation on the corrected dataset. This is a binary image classification task, distinguishing between low-grade copper ore and waste rock. The comparison method uses some classic classification networks. We use these networks to extract features from both high-energy and low-energy spectral images, then fuse the features, and finally input them into the classification head. It can be seen that the performance of these classic image classification methods is significantly improved after dataset processing. For models with already strong basic performance, the performance improvement is even more pronounced.
[0088] Other alternatives:
[0089] 1. Alternative segmentation algorithms: In addition to using traditional image processing algorithms (such as Otsu thresholding and watershed) in step (1), the ore target segmentation method can also be replaced by a deep learning-based segmentation network (such as U-Net and Mask R-CNN) to obtain more accurate segmentation results in complex scenes.
[0090] 2. Alternatives to Distortion Models: Piecewise linear fitting is an effective and simple method for handling distortion. Alternatively, higher-order polynomial functions (such as quadratic or cubic polynomials) or spline functions (such as B-splines) can be used to globally fit the horizontal offset across the entire field of view, potentially yielding a simpler model when the distortion is very smooth.
[0091] 3. Replacement of robust estimation methods: The residual threshold and inlier judgment criteria in the RANSAC algorithm can be adaptively adjusted according to the resolution and segmentation accuracy of the actual image, or other robust estimation methods (such as the M estimator) can be used to replace RANSAC to achieve similar outlier removal effects.
[0092] 4. Alternative for the calibration reference image: The above scheme uses the LE image as a reference to calibrate the HE image. As an alternative, the HE image can be used as a reference to calculate and correct the LE image in reverse, or both images can be corrected to an intermediate geometric position.
[0093] This application also provides an electronic device, including: a processor, and a memory coupled to the processor, the memory being used to store a computer program; the processor being used to execute the computer program stored in the memory, so that the electronic device performs the method as described in any of the above embodiments.
[0094] Electronic devices can be computing devices such as desktop computers, laptops, handheld computers, and cloud servers. These electronic devices may include, but are not limited to, processors and memory.
[0095] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the electronic device, connecting various parts of the device via various interfaces and lines.
[0096] The memory can be used to store the computer program, and the processor implements various functions of the electronic device by running or executing the computer program stored in the memory and calling the data stored in the memory.
[0097] The memory may primarily include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function, etc.; the data storage area may store data created based on the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0098] This application also provides a storage medium, which is a computer-readable storage medium. The computer program is stored in the computer-readable storage medium, and when executed by a processor, the computer program can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.
[0099] This application also provides a computer program product, including: a computer program or instructions that, when the computer program or instructions are run on a computer, cause the computer to perform any of the above possible implementation methods.
[0100] The above description is the preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications are also considered to be within the scope of protection of this application.
Claims
1. An automatic registration method for dual-energy spectral X-ray images, characterized in that, include: In the offline calibration stage, several pairs of high-energy and low-energy calibration images are obtained. Ore target location pairs are extracted from these pairs, each pair including the horizontal coordinates of the ore in the high-energy and low-energy calibration images. A fitting method is used, treating the entire range of horizontal coordinates as an independent variable interval. In the fitting process, inflection points in the data are automatically detected, and independent models are used to fit the data on both sides of the inflection point. The parameters of the models describe the amount of compression required between the high-energy and low-energy calibration images at each horizontal coordinate position. During the online application phase, the image to be registered in the high-energy image-low-energy image pair to be registered is processed using the compression amount to obtain the corrected image.
2. The method as described in claim 1, characterized in that, The fitting method used is a sorted linear regression method, and its corresponding distortion model for: in, The horizontal coordinate is... This represents the central region of the image, which has not been stretched or compressed. and These are the left and right boundaries of the central region of the image, respectively. Represents the left side of the image. Represents the right side of the image. and These represent the slope and intercept of the left region of the image, respectively. and These represent the slope and intercept of the right-hand region of the image, respectively.
3. The method as described in claim 2, characterized in that, The method further includes: using a robust image segmentation algorithm SAM to extract a set of corresponding ore target location pairs from the calibration high-energy image and the calibration low-energy image respectively.
4. The method as described in claim 3, characterized in that, In the piecewise linear regression process, the Random Sample Consensus (RANSAC) algorithm is introduced to obtain a linear model with a sufficient number of interior points, and the parameters of the linear model are determined by the interior points of this linear model.
5. The method as described in claim 4, characterized in that, The specific process of the random sample consensus algorithm includes: A minimum subset is randomly selected from the initial matching point set extracted by the image segmentation algorithm, and a temporary linear model is constructed using this minimum subset. Model iteration: Calculate the residuals of other matching points in the initial matching point set (excluding the minimum subset) to the temporary linear model. Mark the points with residuals less than a preset threshold as interior points and update the temporary linear model until the temporary linear model with the most interior points is selected as the candidate model for this segment. The parameters of the final linear model are recalculated using all interior points of the candidate model.
6. The method as described in claim 1, characterized in that, The compression amount is used to process the image to be registered in the high-energy image-low-energy image pair, specifically as follows: For a pixel column with horizontal coordinate x in the high-energy image to be registered, the new horizontal coordinate to be placed in the corrected high-energy image is the original horizontal coordinate in the high-energy image to be registered multiplied by a scaling factor, where the scaling factor corresponds to the compression amount.
7. The method as described in claim 6, characterized in that, The method of processing the image to be registered in the high-energy image-low-energy image pair using the compression amount also includes: After correction, black pixels with a grayscale value of 0 are automatically filled on both sides of the high-energy image. The width of the fill is calculated based on the extreme values of the piecewise linear function at the left and right endpoints to ensure that the final corrected high-energy image is the same size as the low-energy image to be registered.
8. The method as described in claim 7, characterized in that, The method of processing the image to be registered in the high-energy image-low-energy image pair using the compression amount also includes: Using bilinear interpolation, pixel sampling and remapping are performed on the high-energy image to be registered based on the new horizontal coordinates in the corrected high-energy image, generating the corrected high-energy image that is geometrically aligned with the low-energy image to be registered.
9. An automatic registration device for dual-energy spectral X-ray images, characterized in that, It includes one or more functional units or modules for performing the method of any one of claims 1-8.
10. An electronic device, characterized in that, The electronic device includes: a processor, and a memory coupled to the processor. The memory is used to store computer programs; The processor is configured to execute the computer program stored in the memory to cause the electronic device to perform the method as described in any one of claims 1-8.