Computer vision-based immunochromatographic test strip image recognition method and system
By constructing a spatial geometric model to quantify and correct the deformation of the immunochromatographic test strip, the problems of positioning deviation and signal error caused by the deformation of the test strip during the reaction process were solved, and high-precision detection results were achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- FOURTH PEOPLES HOSPITAL OF SHAANXI PROVINCE
- Filing Date
- 2026-03-18
- Publication Date
- 2026-06-16
AI Technical Summary
Existing technologies cannot effectively quantify and correct the three-dimensional physical deformation of immunochromatographic test strips during the reaction process, leading to deviations in the positioning of the detection line and control line areas, signal extraction errors, reduced accuracy of kinetic curve fitting, and impact on the repeatability and accuracy of test results.
By constructing a spatial geometric model and utilizing non-collinear spatial reference points on the test strip, the degree of deformation is quantified and three-dimensional correction is performed. The signal intensity of the detection line and control line regions is extracted, and a correction model is established to correct the detection line signal, thereby improving quantitative accuracy.
It enables precise quantification and correction of test strip deformation, improves the positioning accuracy of the test line and control line areas, enhances the repeatability and accuracy of test results, and meets the needs of high-precision real-time testing.
Smart Images

Figure CN122222976A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision and biological detection technology, and in particular to an image recognition method and system for immunochromatographic test strips based on computer vision. Background Technology
[0002] Immunochromatographic test strips have been widely used in clinical point-of-care testing, food safety screening, and rapid monitoring of environmental pollutants due to their advantages of speed, convenience, and low cost. With the development of computer vision and intelligent detection technologies, image recognition-based quantitative reading systems for test strips are gradually replacing traditional manual visual interpretation. By acquiring reaction images of the test strips, extracting signals from the test line and control line, and fitting reaction kinetic curves, digital quantitative analysis of the analytes can be achieved.
[0003] Existing image recognition methods generally suffer from the following technical shortcomings: they cannot quantify and correct the three-dimensional physical deformation of the test strip during the reaction process. In actual testing scenarios, test strips are prone to warping, tilting, and local deformation due to factors such as substrate stress, temperature and humidity changes, assembly gaps, or sample wetting. This results in the imaging plane not being perpendicular to the camera's optical axis, and the mapping relationship between pixel coordinates and physical coordinates deviating from the standard state. The pixel position shift and grayscale distortion caused by three-dimensional deformation will cause positioning deviations in the detection line and control line areas, as well as signal extraction errors, directly reducing the fitting accuracy of the kinetic curve. Moreover, the systematic deviation caused by deformation cannot be easily compensated by the control line signal, causing distortion of the quantitative model between kinetic characteristic parameters and analyte concentration, ultimately leading to poor repeatability and insufficient quantitative accuracy in concentration calculation results.
[0004] In summary, most existing technologies still lack a three-dimensional geometric quantization model based on spatial reference points, which makes it impossible to eliminate the influence of deformation on signals and dynamic parameters at the physical level, and thus makes it difficult to meet the needs of high-precision quantitative detection. Summary of the Invention
[0005] This invention provides a computer vision-based image recognition method and system for immunochromatographic test strips. By constructing a spatial geometric model to quantify deformation, three-dimensional correction can be achieved, improving the quantitative accuracy and repeatability of test strip detection and meeting the needs of high-precision real-time detection.
[0006] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows: A first aspect is a computer vision-based image recognition method for immunochromatographic test strips, the method comprising: During the immune reaction of the immunochromatographic test strip, the original images of the test strip are collected at multiple preset time points; The original image is preprocessed to obtain a preprocessed image; at least three non-collinear spatial reference points are located in the preprocessed image, wherein the spatial reference points are corner points automatically extracted from the test strip through image features; Based on the two-dimensional pixel coordinates of the spatial reference point in the original image and its corresponding preset three-dimensional physical coordinates, a spatial triangular pyramid geometric model is constructed; the volume characteristic value of the spatial triangular pyramid geometric model is calculated, and the volume characteristic value is used to quantify the degree of physical deformation of the test strip at the current imaging moment; The preprocessed image is then subjected to three-dimensional spatial correction based on the volume feature values to obtain a corrected image. The calibration image is segmented to extract the detection line region and the quality control line region; the detection line signal intensity and quality control line signal intensity at the corresponding time points of the detection line region and the quality control line region are calculated respectively. Reaction kinetic curves are constructed based on the signal intensities of the detection line and the quality control line at all times, and kinetic characteristic parameters are extracted from the constructed reaction kinetic curves. A calibration model is established based on the extracted kinetic characteristic parameters and the signal intensity of the quality control line; the calibration line signal intensity is obtained according to the calibration model; the calibration line signal intensity is compared with a preset threshold to obtain the concentration value of the analyte.
[0007] Secondly, a computer vision-based image recognition system for immunochromatographic test strips includes: The image acquisition module is used to acquire the original images of the test strip at multiple preset time points during the immune reaction process of the immunochromatographic test strip; The preprocessing and reference point localization module is used to preprocess the original image to obtain a preprocessed image; and to locate at least three non-collinear spatial reference points in the preprocessed image, wherein the spatial reference points are corner points automatically extracted from the test strip through image features; The spatial geometric modeling and deformation quantification module is used to construct a spatial triangular pyramid geometric model based on the two-dimensional pixel coordinates of the spatial reference point in the original image and its corresponding preset three-dimensional physical coordinates; and to calculate the volume characteristic value of the spatial triangular pyramid geometric model, wherein the volume characteristic value is used to quantify the degree of physical deformation of the test strip at the current imaging moment. A three-dimensional spatial correction module is used to perform three-dimensional spatial correction on the preprocessed image based on the volume feature values to obtain a corrected image. The signal region extraction and intensity calculation module is used to segment the calibration image, extract the detection line region and the quality control line region, and calculate the detection line signal intensity and quality control line signal intensity at the corresponding time points of the detection line region and the quality control line region, respectively. The curve construction and feature extraction module is used to construct reaction kinetic curves based on the signal intensity of the detection line and the signal intensity of the quality control line at all times, and to extract kinetic feature parameters from the constructed reaction kinetic curves. The signal correction and concentration calculation module is used to establish a correction model based on the extracted kinetic characteristic parameters and the signal intensity of the quality control line; obtain the corrected detection line signal intensity based on the correction model; and compare the corrected detection line signal intensity with a preset threshold to obtain the concentration value of the analyte.
[0008] The above-described solution of the present invention has at least the following beneficial effects: Because it employs techniques such as locating non-collinear spatial reference points in preprocessed images and constructing a spatial triangular pyramid geometric model based on the two-dimensional pixel coordinates of the reference points and preset three-dimensional physical coordinates, it overcomes the core technical problem that existing technologies cannot quantify and correct the three-dimensional physical deformation generated during the test strip reaction process. Because it employs techniques such as calculating the volume characteristic value of the spatial triangular pyramid to quantify the deformation and constructing an inverse transformation matrix based on this volume characteristic value for three-dimensional spatial correction, it overcomes the problems of detection line and control line region positioning deviation and signal extraction error caused by three-dimensional deformation. Because it employs techniques such as establishing a correction model based on dynamic characteristic parameters and control line signal intensity, correcting the detection line signal intensity, and comparing it with a preset threshold, it overcomes the problem of quantitative model distortion caused by deformation, thereby improving the quantitative accuracy and repeatability of the test strip detection, achieving accurate quantitative analysis of the analyte, and meeting the high-precision detection needs in scenarios such as clinical point-of-care testing and food safety screening. Attached Figure Description
[0009] Figure 1 This is a schematic flowchart of an immunochromatographic test strip image recognition method based on computer vision provided in an embodiment of the present invention.
[0010] Figure 2 This is a schematic diagram of an immunochromatographic test strip image recognition system based on computer vision provided in an embodiment of the present invention. Detailed Implementation
[0011] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0012] like Figure 1 As shown, embodiments of the present invention propose a computer vision-based image recognition method for immunochromatographic test strips, the method comprising the following steps: Step 1: During the immune reaction of the immunochromatographic test strip, the original images of the test strip are collected at multiple preset time points; Step 2: Preprocess the original image to obtain a preprocessed image; locate at least three non-collinear spatial reference points in the preprocessed image, wherein the spatial reference points are corner points automatically extracted from the test strip through image features; Step 3: Based on the two-dimensional pixel coordinates of the spatial reference point in the original image and its corresponding preset three-dimensional physical coordinates, construct a spatial triangular pyramid geometric model; calculate the volume feature value of the spatial triangular pyramid geometric model, which is used to quantify the degree of physical deformation of the test strip at the current imaging moment; Step 4: Perform three-dimensional spatial correction on the preprocessed image based on the volume feature values to obtain the corrected image; Step 5: Segment the calibration image and extract the detection line region and the quality control line region; calculate the detection line signal intensity and the quality control line signal intensity at the corresponding time points of the detection line region and the quality control line region, respectively; Step 6: Construct reaction kinetic curves based on the signal intensity of the detection line and the signal intensity of the quality control line at all times, and extract kinetic characteristic parameters from the constructed reaction kinetic curves; Step 7: Establish a calibration model based on the extracted kinetic characteristic parameters and the quality control line signal intensity; obtain the calibrated detection line signal intensity according to the calibration model; compare the calibrated detection line signal intensity with a preset threshold to obtain the concentration value of the analyte.
[0013] In this embodiment of the invention, the original image of the test strip can be dynamically acquired during the immune reaction, ensuring the capture of signal changes throughout the entire reaction process. By locating non-collinear spatial reference points and constructing a spatial triangular pyramidal geometric model, the degree of three-dimensional physical deformation of the test strip can be accurately quantified. Based on volume characteristic values, three-dimensional spatial correction is performed to effectively eliminate image distortion caused by deformation and improve the positioning accuracy of the detection line and control line areas. The signal intensity of the detection line and control line is accurately extracted, a reaction kinetic curve is constructed, and characteristic parameters are extracted, providing a reliable basis for quantitative analysis. By combining the kinetic characteristic parameters and the signal intensity of the control line to establish a correction model, the deviation of the detection line signal can be corrected, improving the accuracy and repeatability of the analyte concentration calculation, meeting the needs of high-precision real-time detection, and adapting to various application scenarios such as clinical and food safety.
[0014] In a preferred embodiment of the present invention, step 1 above may include: Step 1.1: Based on the kinetic characteristics of the immune response, multiple collection time points are pre-set to obtain a preset time point sequence. This includes: determining the type of immunochromatographic test strip used in this test, the specific type of analyte, and the inherent kinetic characteristics of the immune reaction between the analyte and the antigen / antibody on the test strip, including the initiation delay time of the immune reaction, the signal rise rate, the time to reach reaction equilibrium, and the duration of equilibrium maintenance; considering the requirements of high-precision quantitative detection, determining the complete time interval from the initiation of the immune reaction to its complete stabilization, typically set to 10 to 20 minutes, with the specific duration fine-tuned according to the concentration range of the analyte and the characteristics of the test strip substrate; within this time interval, a principle of dense collection in the early stage and sparse collection in the later stage is adopted to divide the collection time, taking into account both the rapid signal change in the early stage and the stable signal in the later stage, avoiding missed key nodes or redundant collection; specifically, the first 3 minutes after the immune reaction starts is the rapid signal rise phase, with a collection time point set every 30 seconds; the 3rd to 10th minutes is the slow signal rise phase, with a collection time point set every 1 minute; and from the 10th minute to the reaction equilibrium stage, a collection time point is set every 2 minutes. All the pre-set collection times are arranged in order from morning to night, and the specific time node of each time is marked (accurate to the second), forming a complete and directly executable preset time point sequence. This ensures comprehensive coverage of the entire process of immune response initiation, rise, and stabilization, providing complete time-series data support for the construction of kinetic curves.
[0015] Step 1.2: After the immune reaction is initiated, the image acquisition device is triggered at each preset time point according to the preset time sequence to acquire the original image of the test strip at the current moment. Specifically, this includes: before image acquisition, adjusting and calibrating the image acquisition-related parameters, and reasonably setting the imaging-related parameters to avoid problems such as blurriness, excessive brightness, excessive darkness, or color distortion in the original image due to improper parameter settings; placing the immunochromatographic test strip according to the specifications to ensure that the detection area and quality control area of the test strip are completely in the center of the imaging field of view, while ensuring that the imaging angle of the test strip meets the set standard, reducing initial imaging deviation, and reducing the processing difficulty of the three-dimensional spatial correction stage; adding the sample to be tested to the sample addition area of the test strip according to the specified dose, and immediately starting the timing process and simultaneously triggering the execution of the preset time sequence at the moment the sample addition is completed, ensuring that the timing and sequence execution are completely synchronized and avoiding timing deviations.
[0016] When the timing reaches a specific moment in the preset time sequence, the image acquisition action is immediately triggered. The transmission delay of the trigger signal is strictly controlled to ensure that the acquisition time corresponds precisely to the preset time point, avoiding the impact of timing deviation on the capture of the reaction signal. Multiple frames of raw images are acquired at each preset time point to avoid the adverse effects of accidental factors such as light fluctuations and slight displacement of the test strip on image quality, thereby improving the stability of image acquisition. After acquisition, the system automatically selects the effective raw images with high clarity, no obvious noise, and no shadow occlusion as the images to be processed at that time point. The image acquisition operation is completed sequentially for all preset time points to ensure that high-quality raw images that meet the requirements of subsequent processing are obtained at each time point.
[0017] Step 1.3 involves saving the original images acquired at each preset time point along with the corresponding time point, resulting in multiple original images with time tags. Specifically, this includes: assigning a unique time tag to each valid original image selected at each preset time point, using the format of detection date + detection batch + time point sequence number + specific acquisition time to ensure that each original image has a unique tag and avoid confusion between images from different time points and different detection samples; ensuring a strict one-to-one correspondence between the time tag and the acquisition time of the original image, clearly indicating the specific acquisition seconds for the image, facilitating quick tracing of the immune response stage corresponding to each image in subsequent processing, and ensuring that the temporal logic is not confused; storing the original images with unique time tags in a designated storage area using a common image format to ensure that the subsequent image preprocessing module can read them correctly; and establishing an association index between the time tags and image data, with index information including key information such as the time tag, image storage path, and acquisition time. In subsequent processing, the original image at the corresponding time can be quickly retrieved through the time tag, forming a complete, clearly tagged, and easily accessible set of original images.
[0018] In a preferred embodiment of the present invention, step 2 above may include: Step 2.1: Perform corner detection on the preprocessed image to identify candidate corners with drastic grayscale changes, obtaining an initial corner set. Specifically, this involves: performing corner detection on the preprocessed image obtained after preprocessing; traversing each pixel position row by row and column by column; selecting a 3×3 local image neighborhood centered on the currently traversed pixel; this neighborhood covers the current pixel and its eight surrounding adjacent pixels to ensure comprehensive capture of grayscale changes around the current pixel; and calculating the grayscale values of the current pixel in both the horizontal and vertical directions within this 3×3 local neighborhood. The grayscale gradient values are as follows: The horizontal gradient value is obtained by subtracting the grayscale value of the left neighboring pixel from the grayscale value of the right neighboring pixel of the current pixel. If there is no neighboring pixel on the left, the difference between the grayscale value of the current pixel and the grayscale value of the right neighboring pixel is taken. If there is no neighboring pixel on the right, the difference between the grayscale value of the left neighboring pixel and the grayscale value of the current pixel is taken. The vertical gradient value is obtained by subtracting the grayscale value of the top neighboring pixel from the grayscale value of the bottom neighboring pixel of the current pixel. If there is no neighboring pixel above, the difference between the grayscale value of the current pixel and the grayscale value of the bottom neighboring pixel is taken. If there is no neighboring pixel below, the difference between the grayscale value of the top neighboring pixel and the grayscale value of the current pixel is taken.
[0019] After calculating the horizontal and vertical gradient values, the intensity of grayscale change at the pixel location is further calculated. The intensity of grayscale change is obtained by adding the squares of the horizontal and vertical gradient values and taking the square root. At the same time, the gradient direction at the pixel location is recorded. The gradient direction is determined by the ratio of the horizontal to the vertical gradient values, reflecting the specific direction of the grayscale change. Then, a preset grayscale change intensity threshold is set. This threshold is pre-set based on the overall grayscale distribution, noise level, and characteristics of the test strip image in the preprocessed image. The calculated grayscale change intensity is compared with this preset threshold. At the same time, it is determined whether the gradient direction has obvious abrupt changes, that is, the gradient direction of the current pixel differs significantly from the gradient directions of the eight surrounding pixels, and the difference exceeds the preset direction difference threshold.
[0020] Pixel locations that meet the above two conditions are marked as candidate corner points. These candidate corner points are areas in the image with the most dramatic gray-level changes, often corresponding to the edges and corners of the test strip, structural junctions, etc. The gray-level changes between adjacent pixels are significantly greater than in other areas of the image, and the gradient features are stable. They are not easily affected by slight noise or uniform gray-level areas remaining after preprocessing, and have clear boundary recognition and positional stability. All candidate corner points that meet the corner point determination conditions are recorded one by one. The recorded content includes the pixel coordinates, gray-level change intensity, and gradient direction of each candidate corner point. All recorded candidate corner points are summarized to form a complete initial corner point set containing multiple candidate corner points, providing a sufficient and reliable source of basic data for subsequent corner point screening, optimization, and spatial reference point extraction.
[0021] Step 2.2: Obtain the physical structural features of the test strip. Based on the physical structural features of the test strip, preset the region of interest (ROI) for the corner points. Simultaneously, select candidate corner points located within the ROI from the initial set of corner points to obtain the filtered set of corner points. Specifically, this includes: obtaining the corresponding physical structural features of the immunochromatographic test strip based on preset parameters in a standard flat state. This includes the overall length, width, thickness, and other dimensional parameters of the test strip; the contour shape of the test strip edge; the relative positional relationship between the edge and the detection area and the quality control area; the distribution range and spacing of the detection area and the quality control area; and the orientation of the test strip's structural boundaries. This ensures that the obtained physical structural features can completely and accurately reflect the physical structure of the test strip. The standard geometric shape of the test strip; based on these physical structural features, and combined with the mapping ratio between the pixel size of the preprocessed image and the actual physical size, a region of interest (ROI) is defined in the preprocessed image. The ROI refers to a specific region around the structural features of the test strip, specifically used to extract stable corner points. The specific range is centered on the edge corners, structural joints, and the perimeter boundaries of the detection area and quality control area of the test strip, and is distributed in an irregular polygon or rectangle, completely covering the positions on the test strip where stable corner points are likely to be generated. At the same time, it strictly avoids the image background area, noise interference area, and blank areas on the test strip without structural features, ensuring that the corner points in the ROI are highly correlated with the structure of the test strip.
[0022] After delineation, the pixel coordinates of each candidate corner point in the initial corner point set are read. The coordinates of each candidate corner point are compared with the coordinate range of the delineated region of interest (ROI) to determine whether the horizontal and vertical coordinates of the candidate corner point are within the ROI coordinate range. Candidate corner points whose coordinates are outside the ROI are identified as interference or invalid corner points and are directly eliminated. These corner points mostly come from the image background, noise, or areas outside the test strip and do not have the value of representing the spatial position of the test strip. For candidate corner points whose coordinates are inside the ROI, it is further determined whether they are close to the structural features of the test strip. Valid corner points that are highly correlated with the edges, corners, and structural boundaries of the test strip are retained, while redundant corner points that are in the ROI but have no obvious structural correlation are eliminated. Finally, all retained valid corner points are integrated and key information such as the pixel coordinates and grayscale change intensity of each valid corner point are recorded to form a more reliable and more correlated corner point set with the structure of the test strip.
[0023] Step 2.3: Perform sub-pixel localization on each corner point in the filtered corner point set to obtain the sub-pixel level coordinates of each corner point. Specifically, for each corner point in the filtered corner point set, first read the pixel level coordinates of the corner point, and then select a 5×5 local image region centered on the pixel coordinates of the corner point. Selecting a local region of this size can not only fully cover the gray-scale distribution information around the corner point, but also avoid introducing too much interference from irrelevant regions, ensuring the relevance of subsequent gray-scale analysis. Within the 5×5 local image region, the grayscale values are first smoothed to eliminate the influence of slight residual noise after preprocessing on the grayscale distribution, making the grayscale changes in the local region more consistent with the real structural features. During the smoothing process, the grayscale value of each pixel in the local region is adjusted, taking into account the influence of its own grayscale value and the grayscale values of surrounding pixels, avoiding excessive smoothing that would lead to grayscale feature distortion. After the smoothing process is completed, the grayscale distribution in the local region is analyzed in detail. By analyzing the grayscale difference between each pixel and the central corner point, the rules and trends of grayscale changes are determined. Based on the grayscale distribution rules, the position of the central corner point is fitted and optimized.
[0024] During the fitting and optimization process, based on the gray-level distribution of local regions, a quadratic polynomial interpolation method is used to construct the relationship between gray-level and coordinates. The specific fitting formula is as follows: in, The coordinates of the local area are grayscale value at that location The coefficients are polynomial fitting coefficients, obtained by fitting the coordinates of all pixels and their corresponding gray values within a 5×5 local region using the least squares method. After obtaining all fitting coefficients, the quadratic polynomial is then calculated... u direction and v The partial derivative in the direction and set it equal to 0, that is... ; Solving the two partial derivative equations simultaneously yields the following result. This refers to the sub-pixel coordinates of the corner point, which are accurate to the fractional part of the pixel. This compensates for the limitation of pixel-level positioning, which can only determine the pixel position of the corner point, thus improving the corner point coordinate accuracy from pixel-level to sub-pixel-level. Grayscale function right u The partial derivative of the direction describes the gray level in... u Rate of change of direction; It is a grayscale function right v The partial derivative of the direction describes the gray level in... v Rate of change of direction.
[0025] After optimization, the obtained sub-pixel coordinates are verified to determine whether the location corresponding to the coordinates is still the location with the most drastic grayscale change in the local area. If it does not meet the requirements, the size of the local area or the fitting parameters are readjusted, and optimization is performed again until accurate and stable sub-pixel coordinates are obtained. Finally, the above operation is performed on each corner point in the selected corner point set to obtain accurate and stable sub-pixel coordinates for each corner point, completely eliminating the coordinate deviation caused by pixel-level positioning, and providing high-precision coordinate data support for the subsequent selection of spatial reference points and spatial geometric modeling.
[0026] Step 2.4: From the corner points with obtained sub-pixel level coordinates, select at least three non-collinear corner points as spatial reference points, thus obtaining at least three spatial reference points. Specifically, this includes: reading the detailed coordinate information of all corner points with obtained sub-pixel level coordinates, recording the x-coordinate and y-coordinate of each corner point (both with sub-pixel level precision), and reviewing the grayscale change intensity, gradient direction, and other features of each corner point in the filtered corner point set to provide a reference for subsequent corner point selection; then, performing geometric relationship judgment on all corner points with sub-pixel level coordinates, focusing on collinearity detection. During the detection process, randomly select any three corner points as a group, and let the sub-pixel level coordinates of these three corner points be... Based on the coordinates of these three corner points, the equation of the line is constructed as follows: in, Let G be the coordinates of any point on the line, and let the equation of the line be the coordinates of the first two corner points. Determine, used to determine the third corner point Is it located on the straight line? (The third corner point is also considered.) coordinates Substituting into the above straight line equation, if the equation holds true, then the three corner points are determined to be collinear and are excluded; if the equation does not hold true, then the three corner points are determined to be non-collinear and the combination of corner points is retained.
[0027] After collinearity detection, corner points with uniform geometric distribution and strong positional stability are further screened from all non-collinear corner point combinations. Screening criteria include: relatively uniform spacing between corner points to avoid overly concentrated or dispersed corner points; high grayscale intensity and stable gradient direction to ensure that corner points are not prone to positional shift during subsequent imaging, thus stably representing the spatial position of the test strip; and corner points located in different structural regions of the test strip, corresponding to different edge corners or structural junctions, ensuring that the selected corner points comprehensively reflect the overall spatial morphology of the test strip. After completion, select at least three non-collinear corner points that meet the above requirements, prioritizing the selection of three corner points. If the stability of the three corner points is insufficient or the geometric distribution is not reasonable enough, select four or more non-collinear corner points to ensure that the selected corner points can meet the requirements of subsequent spatial triangular pyramid geometric model construction. Finally, determine these selected corner points as spatial reference points used for subsequent spatial modeling and deformation calculation, and record the sub-pixel level coordinates of each spatial reference point, the corresponding test strip structure position, and other information, thereby obtaining at least three spatial reference points that can accurately characterize the spatial position of the test strip and meet the requirements of three-dimensional spatial correction.
[0028] In a preferred embodiment of the present invention, step 3 above may include: Step 3.1: Obtain the three-dimensional physical coordinates of each spatial reference point pre-calibrated during the test strip design phase. These three-dimensional physical coordinates are established based on the standard plane of the test strip. Establish a mapping relationship between the two-dimensional pixel coordinates of each spatial reference point and its corresponding three-dimensional physical coordinates to obtain at least three sets of corresponding two-dimensional and three-dimensional points. Specifically, this includes: calling a pre-set test strip design parameter library. This parameter library was established during the test strip R&D and design phase and contains all structural parameters for different models and testing applications of test strips. It includes the three-dimensional physical coordinate calibration data for each spatial reference point, and all calibration data has undergone multiple verification and calibration processes to ensure accuracy. The accuracy meets the high-precision detection requirements of this invention; from the parameter library, each spatial reference point of the test strip used for the current test is accurately read, and the three-dimensional physical coordinates are pre-calibrated in the standard flat state of the test strip. These three-dimensional physical coordinates are established with the standard flat plane of the test strip as the reference. The reference plane is selected as the middle plane when the test strip has not undergone any deformation. The origin of the coordinates is set at the structural corner of the upper left corner of the test strip. The three coordinate axes correspond to the length, width and thickness directions of the test strip, respectively. It can accurately reflect the true positional relationship of each spatial reference point on the test strip body, and is not affected by factors such as test strip deformation and camera angle changes during the imaging process.
[0029] The process begins by reading the corresponding two-dimensional pixel coordinates of each determined spatial reference point in the current preprocessed image. These coordinates are at sub-pixel precision to eliminate deviations caused by pixel-level positioning. The two-dimensional pixel coordinates of each spatial reference point are then matched one-to-one with the three-dimensional physical coordinates calibrated during the design phase. Specifically, each spatial reference point is assigned a unique identifier, identical to the identifier used during the three-dimensional physical coordinate calibration in the test strip design phase. This identifier includes the test strip's structural location corresponding to the spatial reference point, such as the upper left corner, lower right corner, or control line edge. Then, each spatial reference point is read... The system identifies the identifier and accurately matches its sub-pixel-level two-dimensional pixel coordinates in the preprocessed image with its corresponding three-dimensional physical coordinates in the design parameter library. This ensures that one identifier corresponds to only one set of two-dimensional and three-dimensional coordinates, avoiding mismatches. After matching, the system verifies the correlation of each set of correspondences. By comparing the structural features of the spatial reference points, such as the intensity of grayscale changes and gradient direction, with the feature records from the design stage, the system confirms that the spatial reference point corresponding to the two-dimensional pixel coordinates and the spatial reference point corresponding to the three-dimensional physical coordinates are at the same structural location. This eliminates anomalies where the identifiers are consistent but the actual structural locations do not match, ensuring the uniqueness and accuracy of the matching.
[0030] After matching is completed, the validity of each set of two-dimensional and three-dimensional corresponding points is verified. It is checked whether the two-dimensional pixel coordinates are within the valid area of the preprocessed image and whether the three-dimensional physical coordinates conform to the design size range of the test strip. If there are corresponding points with coordinates outside the reasonable range or abnormal matching logic, they are promptly removed and rematched. Finally, at least three sets of complete, accurate and valid two-dimensional and three-dimensional corresponding points are obtained. Each set of corresponding points contains the sub-pixel level two-dimensional pixel coordinates of a spatial reference point and its corresponding three-dimensional physical coordinates in the design stage. This provides a reliable and accurate data foundation for the calculation of the spatial position and attitude parameters of the test strip and coordinate transformation in subsequent steps, ensuring the accuracy of the calculation results.
[0031] Step 3.2: Based on the obtained at least three sets of two-dimensional and three-dimensional corresponding points, calculate the spatial position and attitude parameters of the test strip relative to the camera coordinate system at the current imaging moment; based on the spatial position and attitude parameters, transform the three-dimensional physical coordinates of the at least three spatial reference points to a unified camera coordinate system to obtain the actual position coordinates of the at least three spatial reference points in three-dimensional space. Specifically, this includes: based on the obtained at least three sets of two-dimensional and three-dimensional corresponding points, using a preset spatial geometry solution method. This method is a dedicated spatial pose solution method optimized based on the classic PnP (Perspective-n-Point) algorithm combined with the improved pinhole camera imaging principle for the detection scenario of immunochromatographic test strips. It is specifically adapted to the characteristics of thin test strips that are prone to slight deformation due to sample immersion / environmental factors. Compared with the traditional PnP algorithm, it adds a deformation compensation factor preprocessing step, which can filter the interference of local small deformations of the test strip on coordinate matching, while simplifying redundant iterative steps and taking into account both the solution accuracy and the real-time requirements of the grassroots detection scenario.
[0032] The specific solution process is as follows: Import the fixed intrinsic parameter data after the camera's factory calibration, including core parameters such as the camera's focal length, image principal point coordinates, and distortion coefficients in the pixel coordinate system. These parameters are the basis for establishing the mapping between two-dimensional pixel coordinates and three-dimensional spatial coordinates, and have been pre-stored and can be directly called. Substitute the coordinate data of each set of corresponding two-dimensional and three-dimensional points in step 3.1 into the preset spatial geometry solution method. With minimizing the reprojection error of the two-dimensional pixel coordinates as the core objective, first use the built-in initial value estimation module of the method to calculate the offset between the center of the three-dimensional physical coordinates of the spatial reference point and the center of the two-dimensional pixel coordinates, and obtain the initial value of the three-dimensional translation of the test strip relative to the camera coordinate system. At the same time, analyze the tilt trend of the two-dimensional distribution of the reference point. The relative angles between each reference point are used to determine the initial values of the rotation angles around the X, Y, and Z axes of the camera coordinate system. Then, the iterative optimization module in the method is started. In each iteration, the current translation and rotation angle parameters are used to calculate the predicted two-dimensional pixel coordinates corresponding to the three-dimensional physical coordinates of the reference points through the improved pinhole camera projection logic built into the preset spatial geometry solution method. The pixel-level error between the predicted coordinates and the actual sub-pixel level coordinates is compared. If the error does not reach the preset threshold, such as reprojection error < 0.1 pixels, the translation and rotation angles are finely adjusted according to the error feedback direction. The iteration is repeated until the error meets the requirements. Finally, the spatial position and attitude parameters of the test strip relative to the camera coordinate system at the current imaging moment are accurately calculated.
[0033] The spatial position parameters mainly include the three-dimensional translation of the test strip in the camera coordinate system, corresponding to the X, Y, and Z axes of the camera coordinate system, respectively. These parameters describe the overall translation distance of the test strip relative to the optical center of the camera. The translation is calculated based on the two-dimensional and three-dimensional correspondence of the spatial reference point, combined with the camera's imaging parameters, to ensure that the calculation results accurately reflect the actual spatial position of the test strip. The attitude parameters mainly include the three rotation angles (α, β, γ) of the test strip in the camera coordinate system, corresponding to the rotation angles around the X-axis (pitch angle), Y-axis (yaw angle), and Z-axis (roll angle) of the camera coordinate system, respectively. These parameters describe the tilt and flipping state of the test strip in three-dimensional space. For example, local warping of the test strip due to sample wetting will be reflected in the change of the pitch angle around the X-axis, and slight tilting during placement will be reflected in the change of the roll angle around the Z-axis. These parameters together constitute a description of the three-dimensional spatial state of the test strip at the current imaging moment. This accurately reflects the actual placement of the test strip in three-dimensional space, providing core parameter support for subsequent coordinate transformation. After obtaining precise spatial position and attitude parameters, the camera coordinate system is used as a unified reference. This reference is consistent with the coordinate system of the spatial triangular pyramid geometric model in step 3.3, ensuring that all parameters and coordinates are based on the same reference system and eliminating errors caused by multi-coordinate system transformation. According to the set coordinate transformation rules, the three-dimensional physical coordinates of each spatial reference point under the standard plane of the test strip are transformed to the camera coordinate system one by one. The specific transformation process is as follows: first, the three-dimensional physical coordinates are rotated based on the rotation angle to correct the directional deviation caused by the tilt and flip of the test strip; then, the rotated coordinates are translated based on the three-dimensional translation amount to correct the deviation caused by the overall positional offset of the test strip. By completing the coordinate adjustment in the order of rotation followed by translation, the positional deviation caused by the deformation of the test strip and the imaging angle is effectively corrected.
[0034] After the conversion is completed, the actual position coordinates of each spatial reference point in the three-dimensional space under the camera coordinate system are verified to check whether the coordinate values are within a reasonable spatial range of the camera's field of view. For example, the Z-axis coordinate must be greater than the minimum focusing distance of the camera and less than the maximum detection distance. Then, the relative distances and angles between different spatial reference points are verified to be consistent with the structural parameters in the design stage of the test strip. The error must be controlled within 0.5% of the design size. If there are cases where the coordinates are outside the reasonable range or the relative position relationship is abnormal, it is judged as a coordinate abnormality. The iteration threshold for solving the spatial position and attitude parameters needs to be adjusted back, and the preset spatial geometry solution method is called again to calculate the parameters and perform coordinate transformation until the actual position coordinates of all spatial reference points are accurate. Finally, the actual position coordinates of each spatial reference point in three-dimensional space can truly and accurately reflect the spatial position of the reference point at the current imaging moment, effectively eliminating the position deviation caused by the deformation of the test strip itself and the imaging angle, and providing high-precision vertex coordinate data for the construction of the spatial triangular pyramid geometric model.
[0035] Step 3.3 involves constructing a spatial triangular pyramid geometric model using the three-dimensional spatial coordinates of at least three spatial reference points as vertices. Specifically, this model is derived from the classic pinhole camera imaging geometric model and has been specifically improved to suit the characteristics of immunochromatographic test strips. Traditional pinhole models focus only on the projection mapping between single-point pixels and three-dimensional spatial points, while this invention extends this to a triangular pyramid framework centered on the structural feature points of the test strip. This better adapts to high-frequency application scenarios of test strips, such as clinical point-of-care testing, rapid food safety screening, and on-site detection of veterinary drug residues, accurately addressing the detection needs of thin test strips that are prone to local warping and edge bending due to sample wetting and changes in environmental temperature and humidity. In constructing the spatial triangular pyramid geometric model, the core vertices of the model are first determined: the three-dimensional spatial coordinates of at least three spatial reference points in the camera coordinate system are used as the base vertices of the triangular pyramid. Priority is given to selecting the upper left corner, lower right corner, and edge of the control line of the test strip—three reference points with strong structural recognizability. These three vertices correspond to different functional areas of the test strip, comprehensively covering the main planar range of the strip and effectively avoiding deformation deviations caused by vertex concentration. Simultaneously, the three-dimensional coordinates of the camera's optical center in a unified camera coordinate system are read and determined as the apex of a spatial triangular pyramid. This apex position corresponds perfectly to the physical optical center of the camera during actual imaging, ensuring a close physical connection between the geometric model and the actual imaging system, laying the foundation for accurate model calculations.
[0036] Once the vertices are determined, the geometric structure of the model begins to be built: the cone apex (camera optical center) is connected to each of the three vertices of the base face in space, forming three edges; then, the three vertices of the base face are connected in pairs to form the base triangles of the triangular pyramid. This results in a closed spatial triangular pyramid geometric structure consisting of 4 triangular faces (3 lateral faces + 1 base), 6 edges, and 4 vertices. During the construction process, basic geometric parameters such as the length of each edge, the area of each lateral triangle, and the centroid coordinates of the base triangle are recorded simultaneously. These parameters are the core basis for subsequent volume feature value calculations and deformation transformations, and the accuracy and completeness of the records must be ensured. Simultaneously, the coordinate system of the entire model is anchored to the camera coordinate system, ensuring that all vertex coordinates, edge lengths, face areas, and other parameters are calculated based on the same benchmark. This completely eliminates errors caused by multi-coordinate system transformations and adapts to the actual needs of different detection scenarios where the camera position is fixed or requires minor adjustments. For example, in scenarios where the testing platform in a primary healthcare institution has limited space and the camera position needs minor adjustments, the stability and accuracy of the model can still be guaranteed.
[0037] After the model is built, it needs to be trained and optimized to accurately adapt to the detection requirements of test strips under different deformation states. This involves constructing a training dataset, collecting test strip sample data from different application scenarios, covering typical deformation states such as sample overload leading to central warping in clinical testing, edge bending due to moisture in food safety screening, and slight shrinkage of test strips under low temperatures. For each deformation state, at least 50 sets of test strip images and corresponding 3D physical coordinate data are collected to construct a labeled dataset containing 2D pixel coordinates, 3D physical coordinates, and actual deformation, ensuring the dataset comprehensively covers possible deformation situations in actual testing. Next, model parameters are initialized. The initial parameters of the constructed spatial triangular pyramid geometric model, such as initial edge lengths and initial vertex spacing, are set as standard parameters for a test strip without deformation. The volume of the triangular pyramid of a test strip in a standard flat state is used as a benchmark for subsequent deformation scaling, ensuring a clear comparative basis for model training.
[0038] In the iterative training and error correction phase, the 3D coordinates of spatial reference points from the labeled dataset are input into the model to calculate the deviation between the volume of the triangular pyramid output by the model and the volume corresponding to the actual deformation. The least squares method is used to adjust parameters such as edge length and relative vertex position in the model, gradually reducing the fitting error between the model's output volume feature values and the actual deformation. After each iteration, 10% of the test set data is selected to verify the model's accuracy. If the error exceeds a preset threshold (e.g., volume calculation error > 0.5%), the training sample size for the corresponding deformation type is increased, and iterative optimization is repeated until the model's volume calculation error is controlled within 0.5% in all typical deformation scenarios, ensuring that the model's calculation accuracy meets detection requirements. Finally, scenario adaptation optimization is performed, with specific adjustments made for the characteristics of different application scenarios. For example, for clinical point-of-care testing scenarios, the model's sensitivity to slight warping in the middle of the test strip is optimized to ensure the ability to capture subtle deformation changes; for large-scale food safety screening scenarios, the model's recognition accuracy for minor bends at the edges of the test strip is improved to ensure stability and accuracy during batch testing, ensuring that the model can stably output accurate geometric feature parameters in different scenarios.
[0039] This invention uses an improved pinhole camera imaging model to construct a spatial triangular pyramid geometric model, which has the following advantages: Compared with deep learning-based 3D reconstruction models, this geometric model has high computational efficiency, with model construction and parameter calculation for a single frame image taking less than 10ms, which can meet the needs of rapid imaging and processing at multiple time points during the immune reaction of the test strip; on the other hand, the model has strong robustness and is not affected by visual interference factors such as the printed pattern on the surface of the test strip and the color depth of the detection line, and can stably quantify the physical deformation of the test strip, which is especially suitable for grassroots testing scenarios where imaging conditions are limited and images are prone to noise, further improving the stability and reliability of the entire testing process.
[0040] In a preferred embodiment of the present invention, step 3 above may include: Step 3.4: Based on the three-dimensional spatial coordinates of the three spatial reference points constituting the spatial triangular pyramid geometric model in the camera coordinate system, calculate the three vectors formed by the three spatial reference points; determine the directed volume of the parallelepiped spanned by the three vectors through vector operations; take the absolute value of the directed volume and multiply it by a preset scaling factor to obtain the volume characteristic value of the spatial triangular pyramid geometric model. Specifically, this includes: selecting three stable spatial reference points for constructing the spatial triangular pyramid geometric model from multiple spatial reference points that have completed coordinate verification and are anomaly-free. The selection criteria are that the three reference points are all located in the non-detection area of the test strip, are not prone to local deformation due to sample wetting, and are not collinear, ensuring that they can stably span the spatial triangular pyramid structure; read the actual three-dimensional spatial position coordinates of these three spatial reference points in the camera coordinate system after precise verification, and record the three spatial reference points as follows: ,in Representing points respectively The coordinate values in the X, Y, and Z axes of the camera coordinate system. and Corresponding points and points The three-axis coordinate values are all retained to 6 decimal places to ensure calculation accuracy.
[0041] With point As the starting point of the common vector, respectively towards the point ,point And the camera optical center (the optical center coordinates in the camera coordinate system are (0...) , 0 , 0) Construct three independent spatial vectors, where the vectors point to the point. vector According to the formula Calculation, pointing to point vector According to the formula Calculate the vector pointing to the camera's optical center. According to the formula The calculation strictly preserves the original precision of the coordinate differences during the vector calculation process, without rounding; then, the directed volume of the parallelepiped spanned by these three vectors is calculated through the vector mixed product operation. Specifically, according to the mixed product formula Execution, first calculate the vector with vector The cross product of the vectors is used to obtain the intermediate vector, which is then combined with the vector... Performing a dot product, we finally obtain the directed volume. The sign of this volume is determined by the spatial orientation relationship of the three vectors, and its numerical value corresponds to the actual volume of the parallelepiped; finally, according to the formula... The volume characteristic values of the spatial triangular pyramid geometric model were calculated. ,in The preset proportional coefficient has a fixed value. Its core function is to convert the volume of a parallelepiped into the volume of its corresponding spatial triangular pyramid, since the volume of a spatial triangular pyramid is equal to the volume of its corresponding parallelepiped. .
[0042] Step 3.5: Compare the volume characteristic value of the spatial triangular pyramid geometric model with the pre-calibrated reference volume value to obtain the volume deviation, which includes the magnitude and direction of the deviation; wherein, the pre-calibrated reference volume value corresponds to the volume of the triangular pyramid formed by the same three spatial reference points under standard flat conditions of the test strip, specifically including: retrieving the pre-calibrated reference volume value stored in the parameter library. The calibration process for this reference volume value is completely consistent with the calculation process in step 3.4. Specifically, with the test strip in a standard, flat, and undeformed initial state, three spatial reference points, identical to those in step 3.4, are selected. Following the same vector construction, mixed product operation, and proportional coefficient conversion process, the spatial triangular pyramid volume characteristic value is calculated and used as the benchmark for deviation comparison. This benchmark volume value is periodically calibrated to ensure its stability and accuracy, avoiding benchmark deviations caused by equipment aging or environmental changes. Then, the calculated volume characteristic value of the spatial triangular pyramid geometric model at the current imaging moment is used... , and the retrieved reference volume value Perform point-to-point numerical comparison calculations according to the formula. Perform the difference calculation, retaining all decimal places to ensure the accuracy of the deviation; the final calculation result is... This is the volume deviation, where The absolute value directly represents the magnitude of the deviation between the current volume characteristic value and the reference volume value. The larger the absolute value, the greater the degree of deformation of the current test strip. The positive and negative signs indicate the direction of the deviation. A positive sign means that the current volume characteristic value is greater than the reference volume value, which corresponds to the increase in the volume of the spatial triangular pyramid caused by local warping, bulging and other deformation of the test strip. A negative sign means that the current volume characteristic value is less than the reference volume value, which corresponds to the decrease in the volume of the spatial triangular pyramid caused by indentation, shrinkage and other deformation of the test strip. This volume deviation includes both the magnitude and direction of the deviation, providing core data support for the subsequent quantification of the degree of deformation.
[0043] Step 3.6: Based on the magnitude and direction of the obtained volume deviation, generate a quantitative index characterizing the degree of deformation of the test strip at the current imaging moment. Specifically, this includes: determining the obtained volume deviation. The intrinsic correlation between the volume deviation and the actual deformation degree of the test strip, combined with the material characteristics of the test strip, the sample wetting pattern, and the influence of environmental factors, shows that the magnitude of the volume deviation is positively correlated with the overall deformation degree of the test strip, and the direction of deviation corresponds to the specific type of deformation (bulge or depression). Normalizing the volume deviation eliminates the influence of differences in the baseline volume value. Specifically, the obtained volume deviation... Compared with the reference volume value Substitute into the normalization formula The relative deformation rate was calculated. The relative deformation rate is presented as a percentage, which can intuitively reflect the proportion of the current deformation relative to the standard state, avoiding deformation deviations caused by different test strip specifications; a preset calibration coefficient is introduced. This coefficient is pre-calibrated based on parameters such as the material, thickness, and testing scenario of the test strip, with a value ranging from 0.8 to 1.2. It is used to standardize the dimensions and quantification levels of deformation quantification indicators, and to classify the relative deformation rate. Substitute into the formula Calculate and generate the final deformable index. The final deformable index The value is dimensionless. The larger the value, the greater the overall deformation of the test strip at the current imaging moment. It can objectively, accurately and stably characterize the overall deformation of the test strip caused by factors such as sample wetting, slight stress, and changes in environmental temperature and humidity, and provide a reliable deformation reference for the correction of test strip test results.
[0044] In a preferred embodiment of the present invention, step 4 above may include: Step 4.1: Obtain the calculated volume characteristic value and, in conjunction with the generated quantification index, determine the spatial deformation parameters of the test strip relative to the standard flat state at the current imaging moment. Specifically, this includes: calling the calculated volume characteristic value of the spatial triangular pyramid geometric model. The obtained volume deviation and the generated test strip strip variable index By combining the three-dimensional coordinate offset information of the three spatial reference points constituting the spatial triangular pyramid geometric model in the camera coordinate system, the specific meaning and relationship of each core parameter are first confirmed. The three-dimensional coordinate offset information of the three spatial reference points is obtained by calculating the point-to-point difference between the three-dimensional coordinates of the three reference points at the current imaging moment and the three-dimensional coordinates of the corresponding reference points under the standard flat state. The coordinate offset of each reference point includes the offset values in the X, Y and Z axes, which are used to reflect the position change of the reference point in space, and thus reflect the deformation of the corresponding area of the test strip.
[0045] The variation range of volume characteristic values, the positive and negative directions of volume deviation, and the magnitude of deformation index are correlated one-to-one with the actual deformation types of the test strip in space, such as warping, denting, tilting, and stretching. The specific correspondence is as follows: Volume deviation A positive value indicates that the volume of the current spatial triangular pyramid is larger than the standard state, corresponding to a bulge or warping deformation on the test strip; volume deviation. A negative value indicates that the volume of the current spatial triangular pyramid is smaller than the standard state, corresponding to a concave deformation of the test strip; deformation quantification index The higher the value, the more severe the deformation of the test strip. The smaller the value, the less severe the deformation; the change range of volume characteristic value is positively correlated with the degree of deformation, the greater the change range, the wider the deformation range.
[0046] The system begins executing the preset deformation mapping rules. These rules are a complete set of pre-defined judgment rules based on the material characteristics of the immunochromatographic test strip, the detection scenario, and common deformation types. These rules include deformation type judgment rules: [Settings would be inserted here]. The threshold for judgment is 1%. The relative deviation threshold is 0.5% (relative to the reference volume value). ),like and If the test strip is warped, it is determined that the test strip is deformed; if and If the test strip shows signs of indentation or deformation, then it is determined that the test strip has an indentation or deformation; if and If the test strip shows no significant deformation, further refinement of the deformation parameters is unnecessary; if... and If the test strip exhibits mixed deformation (warping or denting accompanied by slight tilting), the deformation direction is determined as follows: Based on the coordinate offsets of three spatial reference points, calculate the average offset of the three reference points along the Z-axis. If the average is positive, the test strip is warped or dented towards the camera; if the average is negative, the test strip is warped or dented away from the camera. Simultaneously, by comparing the differences in the offsets along the X and Y axes of the three reference points, determine the specific tilt direction of the warping or denting. If the X-axis offset of one reference point is significantly greater than the other two, the deformation direction is... The X-axis can be tilted in the positive or negative direction, and the same applies to the Y-axis. The deformation distribution area is determined by the following rules: The deformation distribution range is divided based on the coordinate offsets of the three reference points. If the offsets of the three reference points are similar and all relatively large, it indicates that the test strip as a whole has deformed, and the deformation distribution area covers the entire non-detection area of the test strip. If the offset of one reference point is significantly larger than the other two, it indicates that the deformation is concentrated in the area where that reference point is located, representing localized deformation. If the offsets of two reference points are relatively large and similar, it indicates that the deformation is distributed in a strip-like pattern, and the distribution area is the area of the test strip along the line connecting the two reference points. Fourth, the spatial attitude deviation determination rule involves calculating the overall average of the coordinate offsets of the three reference points. The X, Y, and Z-axis components of this average correspond to the attitude deviation of the entire test strip in the X, Y, and Z axes of the camera coordinate system, respectively, reflecting the deviation of the overall spatial position of the test strip relative to its standard state.
[0047] Next, a fusion analysis of geometric and numerical features is performed. The fusion analysis process strictly follows the logic of first determining, then refining, and finally integrating: first, based on the preset deformation mapping rules, combined with deformation quantification indicators... and volume deviation The initial determination of deformation type is completed, identifying whether the test strip is warped, dented, without deformation, or a combination of deformations. Cases without deformation are excluded, and only cases with significant deformation are analyzed further. Based on the deformation type determination, and combined with the coordinate offset information of three spatial reference points, the deformation direction is refined. By comparing the offset of each axis of the three reference points, the specific tilt direction and orientation of the deformation are determined. For example, is the warped deformation towards or away from the camera, is it accompanied by tilting in the X or Y axis, and is the approximate reference point near the center of the dented deformation? This is combined with volumetric characteristic values. The magnitude of the change and the offset distribution of the three reference points are used to refine the deformation distribution area, determine whether the deformation is overall deformation, local deformation or strip deformation, confirm the specific range of deformation distribution, define the approximate boundary of the deformation area, and ensure that subsequent correction can accurately cover the deformation area.
[0048] Comprehensive Deformation Indicators The numerical value and volume deviation The absolute value of the deformation and the overall offset of the three reference points are used to determine the deformation range. The determination of the deformation range, combined with the testing requirements of the test strip, is divided into three levels: slight, moderate, and severe. Deformation is classified as slight (between 1% and 3%), moderate (between 3% and 5%), and severe (greater than 5%). The deformation level is further adjusted based on the variation in volumetric characteristic values to ensure the judgment accurately reflects the actual deformation. The overall mean of the coordinate offsets of the three reference points is calculated to determine the spatial attitude offset of the test strip. This determines the overall offset of the test strip in the X, Y, and Z axes of the camera coordinate system. This offset reflects the overall spatial position shift of the test strip, distinguishing it from localized deformation, and provides a basis for attitude correction in the subsequent inverse transformation matrix construction.
[0049] Finally, all the information obtained from the above fusion analysis is integrated to form a spatial deformation parameter containing multi-dimensional information. This parameter specifically includes deformation type (warping, depression, mixed deformation), deformation amplitude level (slight, moderate, severe), deformation direction (direction, tilt direction), deformation distribution area (overall, local, strip, specific range), and spatial attitude offset (X, Y, Z axis offset).
[0050] Step 4.2: Based on the spatial deformation parameters, construct the inverse transformation matrix from the space where the current test strip is located to the space where the test strip is located under standard flat conditions. Specifically, this includes: using the output spatial deformation parameters as the core basis, first retrieving the verified spatial pose information of the test strip, such as the three-dimensional translation and three-dimensional rotation angle, and determining two core spatial definitions: the ideal space where the test strip is located under standard flat conditions without any deformation or pose shift is defined as the target space, which takes the geometric center of the test strip under standard flat conditions as its origin and follows the unified camera coordinate system rules mentioned above; the space where the test strip is located at the current imaging moment, where there is actual deformation and pose shift, is defined as the source space, which is completely aligned with the camera coordinate system to ensure that the coordinate system is unambiguous; based on the spatial deformation parameters... The spatial transformation relationship is constructed in stages based on different dimensional information in the data. All construction processes strictly follow the constraints between the camera coordinate system and the spatial reference point. The rotation compensation component is constructed as follows: for the tilt of the X, Y, and Z axes corresponding to the spatial attitude offset in the spatial deformation parameters, and the obtained three-dimensional rotation angle, the rotation compensation angle from the source space to the target space is calculated based on the standard rotation angle of the target space (all 0°). Rotation matrices of the X, Y, and Z axes are generated respectively. The X-axis rotation matrix is used to compensate for the tilt deformation of the test strip around the X-axis, the Y-axis rotation matrix is used to compensate for the tilt deformation around the Y-axis, and the Z-axis rotation matrix is used to compensate for the torsional deformation around the Z-axis. The construction of each rotation matrix is matched with the actual size of the test strip and the camera imaging ratio to ensure accurate angle compensation.
[0051] Construction of translation compensation components: Combining the three-dimensional translation amount from step 3.2 with the spatial attitude offset in the spatial deformation parameters, calculate the translation difference between the geometric center of the test strip in the source space and the standard geometric center in the target space, generating a translation matrix containing the X, Y, and Z axes. This matrix can offset the overall positional offset of the test strip in space, ensuring that the corrected geometric center of the test strip completely coincides with the standard state. Construction of deformation correction components: Based on the deformation type (warping, indentation, mixed deformation), deformation amplitude, and deformation direction in the spatial deformation parameters... For the distribution area, a deformation correction matrix is constructed in a targeted manner: if it is a warped deformation, the coordinate offset of three spatial reference points is used as anchor points to construct a nonlinear deformation compensation relationship in the reverse direction of the warping to gradually restore the flat shape of the test strip; if it is a concave deformation, the coordinate offset is gradually compensated outward from the center of the concavity to eliminate the spatial shape deviation caused by the concavity; if it is a mixed deformation, rotation and translation compensation are completed first, and then the deformation correction components are refined for the local warped / concave areas to ensure that different types of deformation can be accurately offset.
[0052] The three component matrices of rotation, translation, and deformation correction are multiplied sequentially according to the spatial geometric rules of rotation first, then translation, and finally deformation correction, and then uniformly normalized into a 4×4 homogeneous transformation matrix to adapt to pixel-spatial coordinate mapping and eliminate scale differences. The effectiveness of the matrix is verified by the source spatial coordinates of three spatial reference points. The deviation between the transformed coordinates and the standard coordinates is ≤0.5 pixels. The compensation coefficient is adjusted until the verification is passed. Finally, an inverse transformation matrix from the source space to the target space is generated. This matrix can accurately convert the deformation spatial coordinates of any point on the test strip into standard coordinates, and follows the constraints of the camera coordinate system and spatial reference points throughout the process, which is completely consistent with the geometric model and calculation logic mentioned above.
[0053] Step 4.3 involves remapping the pixel coordinates and interpolating the grayscale of the preprocessed image using an inverse transformation matrix to generate a corrected image free from distortion effects. Specifically, this includes: reading the preprocessed image after denoising, grayscale enhancement, distortion correction, and sub-pixel localization; extracting basic parameters such as image resolution and pixel size; establishing a mapping relationship between pixel coordinates and the camera coordinate system; traversing all pixels in the effective area of the test strip in the image; recording the original pixel coordinates; and converting them into source space three-dimensional coordinates using the camera intrinsic parameter matrix. X,Y,Z Substituting these coordinates into the constructed inverse transformation matrix, the standard three-dimensional coordinates of the target space are obtained. X',Y',Z'The coordinates are then converted back to standard pixel coordinates to form a full-image pixel coordinate remapping table. For pixels with non-integer coordinates after remapping, bilinear interpolation is used: the four nearest integer pixels around the coordinates are selected, and the average gray value is calculated according to the distance weight to supplement the gray value at that position to ensure gray value continuity. For pixels in key areas such as detection lines or quality control lines, additional neighborhood gray level smoothing is performed to avoid edge blurring. After completing all pixel remapping and interpolation, the image is reconstructed according to standard pixel coordinates, and gray level normalization (restoring the range from 0 to 255), edge enhancement and other post-processing are performed to verify the key indicators of the corrected image: the detection line position deviation is ≤1 pixel and the gray level variance is ≤10. Finally, a corrected image that completely eliminates the effects of warping, indentation and tilt is generated, which truly restores the standard shape of the test strip and provides a high-quality image foundation for detection and interpretation.
[0054] In a preferred embodiment of the present invention, step 5 above may include: Step 5.1: Obtain the calibration image corresponding to the current moment. Specifically, this includes: retrieving a calibration image that has passed quality verification. This image has completely eliminated the effects of deformation such as warping, denting, and tilting of the test strip, and can truly restore the standard shape of the test strip detection area. At the same time, read the imaging timestamp corresponding to the calibration image to confirm that it is the image at the current detection moment, eliminate the interference of historical calibration images, and ensure that the obtained calibration image corresponds completely to the current detection moment. This provides an accurate and effective image data source for image segmentation and signal strength calculation, and the unified terminology such as camera coordinate system and test strip detection area mentioned above is used throughout the process.
[0055] Step 5.2 involves segmenting the calibration image corresponding to the current moment to extract the first region of interest (ROI) where the detection line is located as the detection line region, and simultaneously extracting the second region of interest (ROI) where the control line is located as the control line region. Specifically, this includes: performing image segmentation processing on the calibration image at the current moment. The segmentation process is strictly based on the standard structural features of the test strip. First, the definitions of the relevant core regions and lines are determined: the detection line is the core line on the immunochromatographic test strip used to display the content of the target analyte in the sample, located in the middle of the detection area of the test strip, and its color intensity is positively correlated with the concentration of the target analyte; the control line is the baseline line on the test strip used to verify the effectiveness of the detection process, located on the side of the detection line near the sample dispensing end, and it will show color under normal detection conditions. If it does not show color, it indicates that the detection process is invalid.
[0056] The first region of interest (ROI) is a specific rectangular area used to select the detection line, slightly larger than the actual size of the detection line, capable of completely covering all pixels of the detection line while avoiding surrounding irrelevant pixels. The second region of interest (ROI) is a specific rectangular area used to select the control line, also with the same size as the first ROI, but its position corresponds to the range of the control line, ensuring complete coverage of the control line and no overlap with the first ROI. During segmentation, the overall outline of the test strip in the calibration image is determined, and interference from the image background area is eliminated by grayscale thresholding. Then, based on the preset standard position parameters of the detection line and control line on the test strip, the approximate distribution range of the detection line and control line is accurately located. For the detection line, the first ROI containing the detection line is accurately extracted from the calibration image using an adaptive threshold segmentation method, and this area is defined as the detection line region, ensuring that the region contains only the detection line pixels and does not contain background or other irrelevant areas. At the same time, the second ROI containing the control line is extracted using the same segmentation logic and method, and this is defined as the control line region. The boundary range of the two regions is confirmed and marked to ensure that the detection line region and the control line region do not overlap and are completely covered.
[0057] Step 5.3: Calculate the grayscale statistics of all pixels within the detection line area to obtain the current detection line signal strength; calculate the grayscale statistics of all pixels within the quality control line area to obtain the current quality control line signal strength. Specifically, this includes: for the extracted and marked detection line area, first confirm the pixel range of the area, traverse each pixel within the area, and read and record the grayscale value corresponding to each pixel. The grayscale value ranges from 0 to 255; the larger the value, the brighter the pixel, and the deeper the color of the corresponding test strip. During the traversal, noise pixel screening is performed simultaneously to exclude a small number of noise pixels that may exist in the area. The screening criteria are: the normal detection area of the test strip is pre-set. The grayscale value range (determined based on the grayscale statistics of the test strip under standard flat conditions) is used to identify pixels outside this range as abnormal noise pixels and remove them to avoid interference from noise pixels on the grayscale statistics. After removing abnormal pixels, the grayscale values of all valid pixels in the detection line area are collected, and statistical calculations are performed on these valid pixel grayscale values. The specific calculation process is as follows: the grayscale values of all valid pixels are added together and then divided by the total number of valid pixels to obtain the average grayscale value of the pixels in the detection line area. This average value is used as the detection line signal intensity at the current moment. The larger the signal intensity value, the more obvious the color development of the detection line, which indirectly reflects that the concentration of the target analyte in the sample may be higher.
[0058] The extracted control line region is processed using the same procedure as the detection line region. First, all pixels within the control line region are traversed and their grayscale values are recorded. Abnormal noise pixels are removed according to the same grayscale range standard. Then, the average grayscale value of the effective pixels within the control line region is calculated, and this average value is used as the control line signal strength at the current moment. The calculation standards and procedures for the two signal strengths are kept completely consistent, and the terminology used throughout is consistent with that of the previously mentioned correction image, detection line region, and control line region, ensuring that the calculation results of the detection line and control line signal strengths are accurate and comparable.
[0059] Step 5.4: For each preset time point of the original image, acquire the corresponding correction image for the currently processed preset time point, and perform image segmentation on the correction image to extract the detection line region and the control line region. Calculate the grayscale statistical values of the detection line region and the control line region to obtain the detection line signal intensity and control line signal intensity at the current preset time point, thereby obtaining the detection line signal intensity and control line signal intensity corresponding to all preset time points. Specifically, this includes: retrieving all preset time point parameters for this detection. These parameters are preset based on the reaction kinetics characteristics of the immunochromatographic test strip, covering key time nodes from the initial reaction stage to the stable reaction stage after sample addition, and all preset time points are arranged in chronological order; for each preset time point... The process involves sequentially retrieving the corresponding calibration images at each time point. These images have undergone a complete calibration process to eliminate the effects of deformation. For each calibration image at that time point, the image segmentation process in step 5.2 is repeated to accurately extract the detection line region and quality control line region at the corresponding time point, ensuring that the region extraction standard is completely consistent with the current time. The grayscale statistics method in step 5.3 is repeated to calculate the average grayscale value of the effective pixels in the detection line region and quality control line region at each preset time point, thereby obtaining the detection line signal intensity and quality control line signal intensity corresponding to that preset time point. After completing the calibration image processing, region extraction, and signal intensity calculation for all preset time points in sequence, all calculation results are compiled to form a complete dataset containing all preset time points and their corresponding detection line signal intensities and quality control line signal intensities.
[0060] In a preferred embodiment of the present invention, step 6 above may include: Step 6.1: Obtain the detection line signal intensity and quality control line signal intensity corresponding to all preset time points. Specifically, this includes: retrieving all data sets arranged in chronological order in step 5.4. This data set contains all preset time points, the detection line signal intensity corresponding to each preset time point, and the quality control line signal intensity. All signal intensity values have been processed by removing abnormal pixels and calculating the grayscale mean. The data source is a calibrated image that has undergone deformation correction. The data format is uniform and continuous. During the acquisition process, the data integrity is verified to confirm that there are no missing, disordered, or abnormal values that exceed a reasonable range, ensuring that the data used for curve construction is real, reliable, and accurate.
[0061] Step 6.2: Construct a detection line reaction kinetic curve using the preset time points as the x-axis and the corresponding detection line signal intensity as the y-axis; construct a quality control line reaction kinetic curve using the preset time points as the x-axis and the corresponding quality control line signal intensity as the y-axis. Specifically, this includes: using all qualified preset time points as the x-axis, with the x-axis unit set to minutes (min), and the value range consistent with the span of the preset time points, extending from the initial time point of 0 min after sample addition to the reaction stabilization time point, with uniformly distributed coordinate scales to ensure the accuracy and readability of the time axis; using the detection line signal intensity corresponding to each preset time point as the y-axis, with the y-axis unit being grayscale values (0 to 255), and the scale range adapting to the actual value range of the detection line signal intensity to ensure the curve... It can fully present the range of signal intensity changes. According to the time sequence, the time-detection line signal intensity coordinate points corresponding to each preset time point are accurately located in the calibration coordinate system one by one. After the positioning is completed, adjacent coordinate points are connected sequentially using linear interpolation to form a preliminary discrete curve. Then, the preliminary curve is Gaussian smoothed. During the smoothing process, the smoothing coefficient is strictly controlled to only eliminate signal fluctuations caused by noise during the detection process without changing the trend and key feature points of the original signal. Finally, the detection line response dynamics curve is constructed. This curve is a continuous and smooth discrete curve that can completely and realistically reflect the time-varying law of the detection line colorimetric response from the initial stage, rising stage to the stable stage. It clearly presents the characteristics of the detection line signal intensity increasing and tending to stabilize with the reaction time.
[0062] Using the same preset time points as the x-axis, sharing the same time axis with the detection line curve, and with completely consistent coordinate scale and units, the quality control line signal intensity corresponding to each preset time point is used as the y-axis. The y-axis unit and scale range are consistent with the detection line curve to ensure direct comparison between the two. The same coordinate positioning, linear connection, and Gaussian smoothing processing method as the detection line reaction kinetic curve are used to construct the quality control line reaction kinetic curve. This curve is also a continuous and smooth discrete curve, which can completely reflect the time change law of the colorimetric reaction of the quality control line. Due to the reaction characteristics of the quality control line, its curve usually shows a rapid rise to a stable value and then a long-term stable shape. The two curves use a unified coordinate scale, smoothing rules, and processing flow to ensure that the curve shape is realistic, the change trend is clear, and the signal intensity changes of the detection line and the quality control line can be directly compared, laying the foundation for the extraction of kinetic characteristic parameters.
[0063] Step 6.3: Extract the kinetic characteristic parameters of the detection line from the detection line reaction kinetic curve, and simultaneously extract the kinetic characteristic parameters of the quality control line reaction kinetic curve. Specifically, this includes: analyzing the constructed detection line reaction kinetic curve (a continuous and smooth discrete curve, with the horizontal axis representing reaction time and the vertical axis representing the detection line signal intensity, fully presenting the entire cycle of the colorimetric reaction) sequentially along the time axis from the initial stage to the stable stage, and extracting key kinetic characteristic parameters characterizing the reaction rate, stability, and final colorimetric intensity. Each parameter is extracted in a standardized and specific manner: the initial signal value is the detection line signal intensity at the first preset time point after sample addition (excluding abnormal fluctuations), reflecting the initial baseline level of the reaction; the maximum rising slope is the maximum value of the ratio of the signal intensity difference to the time difference between adjacent time points during the curve's rising phase, reflecting the fastest rate of the colorimetric reaction; the stable signal value is the average signal intensity at multiple time points after the curve enters the stable stage (signal fluctuation ≤ ±5% at 3 or more consecutive preset time points), which is positively correlated with the target analyte concentration; the time required for the signal to reach stability is the duration from the initial reaction to the curve entering the stable stage, reflecting the speed at which the reaction reaches stability.
[0064] Meanwhile, for the control line reaction kinetic curve, the same extraction rules and judgment criteria as the detection line are used to simultaneously extract the same type of control line kinetic characteristic parameters. The two types of parameters extracted correspond to the reaction characteristics of the detection line and the control line, respectively. The control line parameters are used to verify the detection effectiveness, while the detection line parameters reflect the reaction of the target analyte. The mutual correlation and verification provide accurate characteristic basis for quantitative calculation and detection result judgment.
[0065] In a preferred embodiment of the present invention, step 7 above may include: Step 7.1: Using the extracted quality control line kinetic characteristic parameters and the quality control line signal intensity as input variables, and the detection line signal intensity under standard conditions as output variables, a calibration model is established. Specifically, this includes: using the extracted quality control line kinetic characteristic parameters, including the initial signal value of the quality control line, the maximum rise slope, the signal value at the stable moment, the time required for the signal to reach stability, and the obtained quality control line signal intensity corresponding to each preset time point as model input variables; and using the ideal detection line signal intensity corresponding to the above input variables under standard detection environment (temperature 25℃±1℃, humidity 50%±5%) and standard test strip state (no deformation, reagent activity meets standards, within the expiration date) as output variables to construct and train the calibration model. This calibration model is derived from the multiple linear regression model architecture and is specifically improved for the detection scenario of the immunochromatographic test strip of this invention.
[0066] The specific model architecture is described as follows: The model adopts a lightweight linear regression structure. The input layer contains two types of core input units. The first type is the quality control line dynamic feature parameter input unit, which corresponds to four independent input nodes: the initial signal value of the quality control line, the maximum rise slope, the signal value at the stable moment, and the time required for the signal to reach stability. Each node receives its corresponding parameter separately and performs normalization preprocessing. The second type is the quality control line time series signal input unit, which corresponds to the signal intensity of the quality control line at all preset time points in step 5.4. The signal is input sequentially in chronological order and time-aligned. Feature fusion is then performed after the input layer. The fusion layer linearly fuses the parameters of the two types of input units and embeds a specially designed quality control line signal fluctuation compensation term to offset the interference of time-series signal fluctuations. The output of the fusion layer is connected to the linear regression layer, which converts the fused feature parameters into output values. The model architecture eliminates redundant input terms that are irrelevant to the test strip detection in traditional multiple linear regression, retaining only the core parameters related to the quality control line response characteristics and detection effectiveness. At the same time, the inter-layer mapping relationship is optimized to adapt to the linear correlation between signal intensity and analyte concentration in test strip detection, effectively avoiding correction deviations caused by interference from a single parameter.
[0067] The advantages of this improved multiple linear regression model are its simple structure, high computational efficiency, lack of complex computing resources, rapid signal correction, and high fitting accuracy. It can accurately capture the linear mapping relationship between control line parameters and standard test line signals, effectively eliminating test line signal deviations caused by non-target analyte factors such as environmental differences, test strip differences (uneven reagent activity, batch differences), and reaction rate differences (different sample wetting speeds). In the specific construction and training process, multiple sets of standard analyte samples with known concentrations were collected (covering negative, low concentration, medium concentration, and high concentration gradients, adapting to common immunochromatographic detection scenarios such as COVID-19 antigen and food safety contaminants). For each set of standard samples, the corresponding control line kinetic characteristic parameters, control line signal intensity at each time point, and ideal test line signal intensity under standard conditions were obtained according to the complete process of steps 1 to 6 of this invention. The model training dataset and validation dataset were constructed, with the training dataset accounting for 70% and the validation dataset accounting for 30%.
[0068] The input and output variables from the training dataset are substituted into the improved multiple linear regression model for parameter fitting. First, all input variables are normalized, mapping parameter values uniformly to the interval between 0 and 1 to avoid interference from parameters of different magnitudes on the fitting results. Then, the least squares method is used, aiming to minimize the mean square error between the model-predicted detection line signal intensity and the actual standard ideal detection line signal intensity. The weight coefficients of each input variable are gradually adjusted through iterative calculations. During the iteration process, the weight ratio of the signal value at the stable moment of the quality control line is optimized, with its weight coefficient set between 0.3 and 0.5, higher than other input parameters by 0.05 to 0. A weight range of 0.2 is used to ensure that this core parameter plays a dominant role in the correction results. At the same time, a signal fluctuation compensation term is added during the fitting process. The difference between the signal intensity of the quality control line at each preset time point and the signal value at the stable time of the quality control line is calculated one by one. Each difference is then multiplied by the corresponding time weighting coefficient. The closer the time is to the stable reaction stage, the larger the weighting coefficient is. Then, all the weighted differences are added together to obtain the overall fluctuation compensation value. Finally, the fluctuation compensation value is added to the result of multiplying each input variable by its corresponding weight, and they are used together in the numerical calculation of the model. This corrects the deviation caused by the fluctuation of the quality control line signal at different time points, so that the model output is more consistent with the actual detection law of the test strip.
[0069] During training, the fitting error is monitored in real time. The mean square error is calculated after each iteration. Training stops when the error is below a preset threshold of 3% for three consecutive iterations and no longer decreases significantly. Then, the validation dataset is substituted into the trained model to verify its effectiveness. If the output corrected detection line signal intensity deviates from the standard value by more than 5%, the weight coefficients of each input variable and the weighting coefficients of the fluctuation compensation term are adjusted back, and iterative training is repeated until the validation is successful. Finally, a complete calibration model is established, which can standardize and correct the detection line signal based on the relevant parameters of the quality control line measured in this invention, ensuring that the output detection line signal intensity can truly reflect the concentration of the analyte.
[0070] Step 7.2: Input the detection line dynamics feature parameters of the current sample into the calibration model, and obtain the calibrated detection line signal intensity through the calculation of the calibration model. Specifically, this includes: taking the detection line dynamics feature parameters extracted in step 6.3 of the current test sample, including the initial signal value of the detection line, the maximum rise slope of the detection line, the signal value at the stable moment of the detection line, and the time required for the detection line signal to reach stability, and uniformly normalizing them, mapping the values of each parameter to the interval between 0 and 1, so that their numerical range is completely consistent with the input standard during the training of the calibration model, and avoiding the influence of the calculation results due to the difference in parameter magnitude; then inputting the four standardized detection line dynamics feature parameters into the calibration model that has been constructed, double-validated by multiple sets of standard samples, and whose weight coefficients and fluctuation compensation rules have been fixed.
[0071] During model computation, a weighted operation is performed on the four standardized detection line dynamic characteristic parameters. Specifically, the initial signal value of the normalized detection line is set as follows: The corresponding weighting coefficient is The maximum rising slope of the normalized detection line is The corresponding weighting coefficient is The normalized signal value at the steady-state of the detection line is The corresponding weighting coefficient is The time required for the normalized detection line signal to reach stability is The corresponding weighting coefficient is If the base value for the weighted operation is F, then the weighted operation formula is: The weight coefficients of each parameter were determined by least squares fitting during model training and strictly satisfy the following conditions: The weighting coefficients corresponding to the signal values at the stable moment of the detection line. Its value ranges from 0.3 to 0.5, which is higher than the weighting coefficients of the other three parameters. , , The values range from 0.05 to 0.2 to ensure that the core parameters play a dominant role in the calculation results, which is consistent with the actual characteristic that the stable signal and the concentration of the analyte are most strongly correlated in the test strip detection.
[0072] The model combines the pre-learned mapping relationship between the quality control line and the standard test line, and calculates the above weighted base values. F The signal fluctuation compensation value of the quality control line determined in step 7.1 is superimposed to complete the time-series fluctuation correction. At the same time, the signal offset caused by non-target analyte factors such as environmental temperature and humidity fluctuations, batch differences of test strips, reaction rate, and residual deformation of test strips is automatically eliminated. Finally, the detection line signal intensity after complete correction and normalization is output. The corrected signal intensity has eliminated all systematic errors and non-specific interferences. The value is stable and accurate, and can truly and objectively reflect the actual reaction level of the analyte in the sample.
[0073] Step 7.3 compares the calibrated detection line signal intensity with the preset threshold to obtain the comparison result. Specifically, this includes: retrieving the output calibrated detection line signal intensity, and simultaneously reading the pre-calibrated and stored detection judgment threshold. This preset threshold is not a fixed single value, but is determined by repeatedly testing a large number of standard negative samples, standard positive samples, and multi-gradient concentration reference samples in a standard testing environment (temperature 25℃±1℃, humidity 50%±5%) and under standard test strip conditions for no less than 30 times, and statistically analyzing the critical values of all test results. It has uniqueness, stability, and high reliability, and can effectively distinguish between negative and positive samples, while taking into account both detection sensitivity and specificity.
[0074] The calibrated detection line signal intensity is compared point-to-point with the preset threshold for precise numerical values, retaining three decimal places of precision during the comparison to avoid misjudgment due to insufficient accuracy. The core comparison information of the two is recorded simultaneously to confirm whether the calibrated signal intensity is higher than, equal to, or lower than the preset threshold. At the same time, the difference between the calibrated signal intensity and the preset threshold, as well as the difference ratio, are calculated and recorded to form a complete comparison result that includes the comparison relationship, the difference value, and the difference ratio. This provides a direct basis for the qualitative determination of the analyte and an auxiliary reference for concentration interpolation during quantitative calculation, ensuring the accuracy of subsequent judgments and calculations.
[0075] Step 7.4: Determine the concentration value of the analyte based on the comparison results. This includes: based on the complete comparison results, combined with a preset standard concentration gradient reference table. This reference table was established during model training using multiple sets of standard samples with known concentrations, after a complete detection process, corresponding to the corrected detection line signal intensity. It covers the entire range of negative, low, medium, and high concentrations, and the signal intensity is positively correlated with the concentration. Qualitative judgment and quantitative calculation are performed simultaneously according to the positive correlation between the corrected signal intensity and the concentration of the analyte. If the corrected detection line signal intensity is higher than the preset threshold, the current sample is determined to be positive. At this time, based on the specific value of the corrected signal intensity, the two closest gradient concentrations and their corresponding signal intensities are found in the standard concentration gradient reference table. The precise concentration value of the analyte in the current sample is calculated using a linear interpolation method. At the same time, the confidence level corresponding to the concentration is marked, with a confidence level ≥ 95% to ensure the reliability of the calculation results. If the corrected detection line signal intensity is lower than or equal to the preset threshold, the current sample is determined to be negative, or the concentration of the analyte is lower than the minimum detection limit of this detection device. At this time, the detection limit range is marked to clearly indicate the boundary of the detection result.
[0076] Finally, by combining the qualitative judgment conclusion (positive or negative), the quantitative calculation value (if positive) or the detection limit description (if negative), and the confidence level indicator, a complete test result report is formed, outputting the accurate concentration value of the analyte in the current sample and related judgment information, providing an objective, accurate, and traceable final output for immunochromatographic detection, effectively meeting the core requirement of rapid and accurate detection in this invention.
[0077] like Figure 2 As shown, embodiments of the present invention also provide an immunochromatographic test strip image recognition system based on computer vision, comprising: The image acquisition module is used to acquire the original images of the test strip at multiple preset time points during the immune reaction process of the immunochromatographic test strip; The preprocessing and reference point localization module is used to preprocess the original image to obtain a preprocessed image; and to locate at least three non-collinear spatial reference points in the preprocessed image, wherein the spatial reference points are corner points automatically extracted from the test strip through image features; The spatial geometric modeling and deformation quantification module is used to construct a spatial triangular pyramid geometric model based on the two-dimensional pixel coordinates of the spatial reference point in the original image and its corresponding preset three-dimensional physical coordinates; and to calculate the volume characteristic value of the spatial triangular pyramid geometric model, wherein the volume characteristic value is used to quantify the degree of physical deformation of the test strip at the current imaging moment. A three-dimensional spatial correction module is used to perform three-dimensional spatial correction on the preprocessed image based on the volume feature values to obtain a corrected image. The signal region extraction and intensity calculation module is used to segment the calibration image, extract the detection line region and the quality control line region, and calculate the detection line signal intensity and quality control line signal intensity at the corresponding time points of the detection line region and the quality control line region, respectively. The curve construction and feature extraction module is used to construct reaction kinetic curves based on the signal intensity of the detection line and the signal intensity of the quality control line at all times, and to extract kinetic feature parameters from the constructed reaction kinetic curves. The signal correction and concentration calculation module is used to establish a correction model based on the extracted kinetic characteristic parameters and the signal intensity of the quality control line; obtain the corrected detection line signal intensity based on the correction model; and compare the corrected detection line signal intensity with a preset threshold to obtain the concentration value of the analyte.
[0078] It should be noted that this system is a system corresponding to the above method. All implementation methods in the above method embodiments are applicable to this embodiment and can achieve the same technical effect.
[0079] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A computer vision-based image recognition method for immunochromatographic test strips, characterized in that, The method includes: During the immune reaction of the immunochromatographic test strip, the original images of the test strip are collected at multiple preset time points; The original image is preprocessed to obtain a preprocessed image; at least three non-collinear spatial reference points are located in the preprocessed image, wherein the spatial reference points are corner points automatically extracted from the test strip through image features; Based on the two-dimensional pixel coordinates of the spatial reference point in the original image and its corresponding preset three-dimensional physical coordinates, a spatial triangular pyramid geometric model is constructed; the volume characteristic value of the spatial triangular pyramid geometric model is calculated, and the volume characteristic value is used to quantify the degree of physical deformation of the test strip at the current imaging moment; The preprocessed image is then subjected to three-dimensional spatial correction based on the volume feature values to obtain a corrected image. The calibration image is segmented to extract the detection line region and the quality control line region; the detection line signal intensity and quality control line signal intensity at the corresponding time points of the detection line region and the quality control line region are calculated respectively. Reaction kinetic curves are constructed based on the signal intensities of the detection line and the quality control line at all times, and kinetic characteristic parameters are extracted from the constructed reaction kinetic curves. A calibration model is established based on the extracted kinetic characteristic parameters and the signal intensity of the quality control line; the calibration line signal intensity is obtained according to the calibration model; the calibration line signal intensity is compared with a preset threshold to obtain the concentration value of the analyte.
2. The method for image recognition of immunochromatographic test strips based on computer vision according to claim 1, characterized in that, Locate at least three non-collinear spatial reference points in the preprocessed image. These spatial reference points are corner points automatically extracted from the test strip using image features, including: Corner detection is performed on the preprocessed image to identify candidate corners with drastic grayscale changes, thus obtaining an initial set of corners. The physical structural features of the test strip are obtained, and the region of interest of the corner points is preset based on the physical structural features of the test strip. At the same time, candidate corner points located in the region of interest are selected from the initial set of corner points to obtain the filtered set of corner points. Sub-pixel localization is performed on each corner point in the filtered corner point set to obtain the sub-pixel level coordinates of each corner point; From the corner points with sub-pixel level coordinates, select at least three non-collinear corner points as spatial reference points, thus obtaining at least three spatial reference points.
3. The method for image recognition of immunochromatographic test strips based on computer vision according to claim 2, characterized in that, Based on the two-dimensional pixel coordinates of the spatial reference point in the original image and its corresponding preset three-dimensional physical coordinates, a spatial triangular pyramid geometric model is constructed, including: The three-dimensional physical coordinates of each spatial reference point are pre-calibrated during the test strip design stage. The three-dimensional physical coordinates are established based on the standard plane of the test strip. The two-dimensional pixel coordinates of each spatial reference point are mapped to their corresponding three-dimensional physical coordinates to obtain at least three sets of two-dimensional and three-dimensional corresponding points. Based on at least three sets of corresponding two-dimensional and three-dimensional points, calculate the spatial position and attitude parameters of the test strip relative to the camera coordinate system at the current imaging time; based on the spatial position and attitude parameters, transform the three-dimensional physical coordinates of the at least three spatial reference points to a unified camera coordinate system to obtain the actual position coordinates of the at least three spatial reference points in three-dimensional space. A spatial triangular pyramid geometric model is constructed using the three-dimensional spatial coordinates of at least three spatial reference points as vertices.
4. The computer vision-based immunochromatographic test strip image recognition method according to claim 3, characterized in that, Calculate the volumetric characteristic value of the spatial trigonometric pyramid geometric model. This volumetric characteristic value is used to quantify the degree of physical deformation of the test strip at the current imaging moment, including: Based on the three-dimensional spatial coordinates of the three spatial reference points constituting the spatial triangular pyramid geometric model in the camera coordinate system, calculate the three vectors formed by the three spatial reference points; determine the directed volume of the parallelepiped spanned by the three vectors through vector operations; take the absolute value of the directed volume and multiply it by a preset scaling factor to obtain the volume characteristic value of the spatial triangular pyramid geometric model. The volume characteristic value of the spatial triangular pyramid geometric model is compared with the pre-calibrated reference volume value to obtain the volume deviation, which includes the magnitude and direction of the deviation; wherein, the pre-calibrated reference volume value corresponds to the volume of the triangular pyramid formed by the same three spatial reference points under standard flat conditions of the test strip; Based on the magnitude and direction of the obtained volume deviation, a quantitative index is generated to characterize the degree of deformation of the test strip at the current imaging moment.
5. The computer vision-based immunochromatographic test strip image recognition method according to claim 4, characterized in that, The preprocessed image is subjected to three-dimensional spatial correction based on the volume feature values to obtain a corrected image, including: The calculated volume characteristic value is obtained and combined with the generated quantitative index to determine the spatial deformation parameters of the test strip relative to the standard flat state at the current imaging time. Based on the spatial deformation parameters, construct an inverse transformation matrix from the space where the current test strip is located to the space where the test strip is located under standard flat conditions; The preprocessed image is remapped to pixel coordinates and interpolated to grayscale by using an inverse transformation matrix to generate a corrected image that eliminates the effects of deformation.
6. The method for image recognition of immunochromatographic test strips based on computer vision according to claim 5, characterized in that, The calibrated image is segmented to extract the detection line region and the quality control line region; Calculate the signal intensity of the detection line and the signal intensity of the control line at the corresponding times in the detection line region and the control line region, respectively, including: Obtain the corrected image corresponding to the current time. The corrected image corresponding to the current time is segmented to extract the first region of interest where the detection line is located as the detection line region, and the second region of interest where the quality control line is located as the quality control line region. Calculate the grayscale statistics of all pixels within the detection line area to obtain the detection line signal strength at the current time; calculate the grayscale statistics of all pixels within the quality control line area to obtain the quality control line signal strength at the current time. For each preset time point of the original image, a corrected image corresponding to the current preset time point is obtained, and the corrected image is segmented to extract the detection line region and the quality control line region. The grayscale statistical values of the detection line region and the quality control line region are calculated to obtain the detection line signal intensity and the quality control line signal intensity at the current preset time point, thereby obtaining the detection line signal intensity and the quality control line signal intensity corresponding to all preset time points.
7. The method for image recognition of immunochromatographic test strips based on computer vision according to claim 6, characterized in that, Reaction kinetic curves are constructed based on the signal intensities of the detection line and the control line at all time points. Kinetic characteristic parameters are extracted from these curves, including: The signal strength of the detection line and the signal strength of the quality control line corresponding to all preset time points are obtained; Using the preset time point as the abscissa and the corresponding detection line signal intensity as the ordinate, a detection line reaction kinetic curve is constructed; using the preset time point as the abscissa and the corresponding quality control line signal intensity as the ordinate, a quality control line reaction kinetic curve is constructed. The kinetic characteristic parameters of the detection line are extracted from the reaction kinetic curve of the detection line, and the kinetic characteristic parameters of the quality control line are extracted from the reaction kinetic curve of the quality control line.
8. The computer vision-based immunochromatographic test strip image recognition method according to claim 7, characterized in that, A calibration model is established based on the extracted kinetic characteristic parameters and the signal intensity of the quality control line; the calibration line signal intensity is obtained according to the calibration model. The calibrated detection line signal intensity is compared with a preset threshold to obtain the concentration value of the analyte, including: A calibration model is established using the extracted dynamic characteristic parameters of the quality control line and the signal intensity of the quality control line as input variables, and the signal intensity of the detection line under standard conditions as the output variable. The detection line dynamics characteristic parameters of the current sample are input into the calibration model, and the calibration model is used to calculate the calibration line signal intensity. The corrected detection line signal intensity is compared with a preset threshold to obtain the comparison result; The concentration of the analyte is determined based on the comparison results.
9. A computer vision-based image recognition system for immunochromatographic test strips, wherein the system implements the method as described in any one of claims 1 to 8, characterized in that, include: The image acquisition module is used to acquire the original images of the test strip at multiple preset time points during the immune reaction process of the immunochromatographic test strip; The preprocessing and reference point localization module is used to preprocess the original image to obtain a preprocessed image; and to locate at least three non-collinear spatial reference points in the preprocessed image, wherein the spatial reference points are corner points automatically extracted from the test strip through image features; The spatial geometric modeling and deformation quantification module is used to construct a spatial triangular pyramid geometric model based on the two-dimensional pixel coordinates of the spatial reference point in the original image and its corresponding preset three-dimensional physical coordinates; and to calculate the volume characteristic value of the spatial triangular pyramid geometric model, wherein the volume characteristic value is used to quantify the degree of physical deformation of the test strip at the current imaging moment. A three-dimensional spatial correction module is used to perform three-dimensional spatial correction on the preprocessed image based on the volume feature values to obtain a corrected image. The signal region extraction and intensity calculation module is used to segment the calibration image, extract the detection line region and the quality control line region, and calculate the detection line signal intensity and quality control line signal intensity at the corresponding time points of the detection line region and the quality control line region, respectively. The curve construction and feature extraction module is used to construct reaction kinetic curves based on the signal intensity of the detection line and the signal intensity of the quality control line at all times, and to extract kinetic feature parameters from the constructed reaction kinetic curves. The signal correction and concentration calculation module is used to establish a correction model based on the extracted kinetic characteristic parameters and the signal intensity of the quality control line; obtain the corrected detection line signal intensity based on the correction model; and compare the corrected detection line signal intensity with a preset threshold to obtain the concentration value of the analyte.