A test strip t / c line quantitative identification method and system based on a two-dimensional code
The quantitative identification method based on the T/C line of the test strip using QR codes solves the problems of accuracy and convenience of test strip interpretation under complex conditions. It achieves highly robust, multi-target simultaneous processing and easy-to-operate quantitative detection, and is suitable for mobile terminals and field applications.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING DEBAN CONSULTANCY CO LTD
- Filing Date
- 2026-03-03
- Publication Date
- 2026-06-02
AI Technical Summary
Existing test strip interpretation methods suffer from poor quantitative accuracy under complex shooting conditions, difficulty in multi-target detection, and insufficient robustness and ease of operation, making it difficult to achieve high-throughput batch testing and field applications.
A QR code-based quantitative identification method for the T/C line of test strips is adopted. Through image acquisition, geometric correction, grayscale projection and peak detection, combined with QR code enhancement detection and perspective correction technology, the method automatically identifies and calculates the T/C line ratio and provides visualized results.
It achieves highly robust quantitative detection under complex conditions, supports simultaneous processing of multiple targets, is easy to operate, provides visualized results, facilitates user verification, and is easy to integrate into mobile applications.
Smart Images

Figure CN122135012A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of quantitative analysis technology for test strips, and in particular to a quantitative identification method and system for the T / C lines of test strips based on QR codes. Background Technology
[0002] Rapid test strips for medical diagnostics, environmental monitoring, food safety, and other fields, such as immunochromatographic test strips, have the advantages of being easy to operate, fast, and inexpensive. They enable qualitative or semi-quantitative judgment of the target analyte by measuring the color or signal intensity changes of the detection line (T line) and the control line (C line).
[0003] Traditional test strip interpretation methods rely on human colorimetry or subjective interpretation, which are easily affected by factors such as personal experience and ambient lighting conditions. Furthermore, the interpretation results suffer from inherent defects such as strong subjectivity, poor consistency, and difficulty in precise quantification. To overcome the shortcomings of manual interpretation, those skilled in the art have proposed a test strip interpretation method based on mobile terminals. This method uses a mobile phone camera to capture images of the test strip and employs image analysis algorithms to automatically identify the T-line and C-line, thereby calculating their grayscale or color intensity ratios to achieve a more objective and quantitative analysis than human visual interpretation. However, existing test strip interpretation methods still have the following technical problems in practical applications: 1. Poor adaptability to complex shooting conditions: Most existing algorithms have strict requirements for shooting angle, distance, and uniformity of illumination. When there is perspective distortion or uneven illumination in the test strip image, it will lead to inaccurate positioning of the T / C line and distortion of gray value calculation, which will seriously affect the accuracy and repeatability of quantitative results. 2. Difficulty in multi-target detection and association: In batch detection or high-throughput screening scenarios, an image may contain multiple test strips, and each test strip may correspond to a unique QR code. Existing methods are usually unable to perform batch processing of multiple test strips in an information-based manner. 3. Insufficient robustness and universality: Some existing algorithms rely on fixed image segmentation thresholds or template matching. For test strips of different brands and batches, their background color, line width and contrast may vary, resulting in weak generalization ability of the algorithm and requiring frequent parameter adjustments or retraining. 4. Insufficient ease of operation: Some solutions require users to place the test strip on a specific bracket or calibration frame for shooting, or require strict focus and light adjustment, which increases the complexity of operation and limits the universality and field application of the technology. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention provides a method and system for quantitative identification of the T / C line of a test strip based on a QR code.
[0005] To provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not intended as a general commentary, nor is it intended to identify key / important components or to describe the scope of protection of these embodiments. Its sole purpose is to present some concepts in a simple form as a prelude to the detailed description that follows.
[0006] The present invention adopts the following technical solution: This invention provides a method for quantitative identification of the T / C line on a test strip based on a QR code, comprising: The mobile terminal captures images of the test strips printed with QR codes and uploads the captured raw images; The positions and decoding information of all QR codes in the original image are identified. Based on the identified QR code corner points, the perspective transformation matrix is calculated, and the original image is geometrically corrected to obtain a corrected image. In the corrected image, based on the preset relative positional relationship between the QR code and the color development area, the color development area of each test strip is located, and the color development area sub-image is extracted; For each color-developing sub-image, grayscale values are projected in the horizontal and vertical directions, and the boundaries of the color-developing areas and the positions of the C-line and T-line are located respectively using a peak detection algorithm; At the locations of lines C and T, calculate the average grayscale intensity within the regions of lines C and T, and calculate the T / C ratio = T value / C value T value C represents the average grayscale intensity within the T-line region. value This represents the average grayscale intensity within the C-line region.
[0007] Furthermore, the method for quantitative identification of the T / C line on a test strip based on a QR code is characterized by further including: outputting results, the results including: QR code information and the T / C ratio and T associated with the QR code information. value Absolute value, C value Absolute value.
[0008] Furthermore, the result also includes a result image, which is obtained through the following steps: On the color-coded sub-image, the identified T-line and C-line are marked with lines of different colors; Using the inverse of the perspective transformation matrix, the coordinates of the labeled sub-image are mapped back to the original image space; The labeled sub-images are merged into the corresponding positions in the original image to generate the labeled and visualized result image.
[0009] Furthermore, the original image captured by the mobile terminal includes at least one test strip, and each test strip includes at least one color development area associated with the QR code on the test strip.
[0010] Furthermore, the process of identifying the location and decoding information of all QR codes in the original image includes: The original image is subjected to image enhancement processing to generate multiple enhanced variant images; The enhanced variant image is input into the QR code detector for recognition. If not all targets are recognized, the original image is upsampled and the detected coordinates are mapped back to the original image scale. All recognition results are merged, deduplication is performed based on the decoded content, and all unique QR codes are sorted by spatial location; The image enhancement processing method is one or more of the following: contrast-limited adaptive histogram equalization, brightness and contrast adjustment, sharpening filtering, gamma correction, global histogram equalization, and adaptive threshold binarization.
[0011] Furthermore, the process of locating the color development area of each test strip includes: Using the specified corner point of the QR code in the corrected image as a reference, the estimated rectangular area of the color development zone of each test strip is calculated according to the preset offset. Within each of the estimated rectangular regions, the final selected rectangular regions are determined as the final color-coding regions using the connected component method combined with constraint rules. The constraint rules include: area filtering rules, aspect ratio filtering rules, and absolute height filtering rules.
[0012] Furthermore, the process of projecting grayscale values in the horizontal and vertical directions onto each of the color-developing sub-images and locating the boundaries of the color-developing areas and the positions of the C-line and T-line using a peak detection algorithm includes: Convert the colorimetric sub-image into a grayscale image; Calculate the average gray level of each column of pixels in the grayscale image to obtain the horizontal grayscale distribution curve, and calculate the average gray level of each row of pixels in the grayscale image to obtain the vertical grayscale distribution curve. The peak detection algorithm is used to locate the left and right boundaries of the color development area on the horizontal grayscale distribution curve, and to locate the vertical positions of the C-line and T-line on the vertical grayscale distribution curve.
[0013] Furthermore, the peak detection algorithm uses a Savitzky-Golay filter to smooth the horizontal grayscale distribution curve and the vertical grayscale distribution curve, uses an adjustable dynamic threshold parameter to detect peaks, and clusters the detected peaks, retaining the highest peak in each cluster as a valid peak. The left and right boundaries of the color rendering area refer to the selection of the peaks with the highest intensity located on the left and right sides of the center line from the effective peaks of the horizontal grayscale distribution curve, which are respectively used as the left and right boundary indices of the color rendering area. The vertical position of the C-line and T-line refers to determining the effective peak above the center as the C-line index and the effective peak below the center as the T-line index, based on the relative relationship between the detected peak and the vertical position of the center of the color area sub-image.
[0014] A QR code-based quantitative identification system for test strip T / C lines is provided, comprising: The image acquisition module is used to acquire the original image, which is obtained by capturing the image of the test strip with the QR code printed on it through a mobile terminal; The detection and correction module is used to identify the position and decoding information of all QR codes in the original image, calculate the perspective transformation matrix based on the identified QR code corner points, and perform geometric correction on the original image to obtain a corrected image. The color development area positioning module is used to locate the color development area of each test strip in the calibration image based on the preset relative positional relationship between the QR code and the color development area, and to extract the color development area sub-image. The analysis and detection module is used to project grayscale values in the horizontal and vertical directions onto each color area sub-image, and to locate the color area boundary and the positions of the C-line and T-line respectively through a peak detection algorithm; The ratio calculation module is used to calculate the average grayscale intensity within the C-line and T-line regions at the locations of the C-line and T-line, and to calculate the T / C ratio = T. value / C value T value C represents the average grayscale intensity within the T-line region. value This represents the average grayscale intensity within the C-line region.
[0015] Furthermore, the aforementioned QR code-based quantitative identification system for test strip T / C lines also includes: The visualization module is used to mark the identified T-line and C-line with lines of different colors on the sub-image of the color display area, and to map the coordinates of the marked sub-image back to the original image space using the inverse matrix of the perspective transformation matrix. The marked sub-image is then merged into the corresponding position in the original image to generate a visualized result image with annotations. The result output module is used to output results, which include: QR code information and the T / C ratio associated with the QR code information, T... value Absolute value, C value The absolute value, and the resulting image.
[0016] The beneficial effects of this invention are as follows: 1. High robustness: Through multi-strategy QR code enhancement detection, perspective correction, adaptive peak detection and other technologies, it effectively overcomes problems such as angle tilt, uneven lighting and blurry focus when shooting with mobile terminals; 2. Multi-target simultaneous processing: It can simultaneously identify multiple QR codes and corresponding test strips in an image, achieving high-throughput batch detection; 3. Easy to operate: The entire process is automated, requiring no professional operation or complex equipment. Users only need to take a photo with their mobile phone to obtain quantitative results; 4. Results Visualization: Provides intuitive image annotation output, facilitating user comparison and verification, and improving the credibility of the results; 5. Easy to integrate: It provides an identification interface in the form of an HTTP service, which can be easily integrated into mobile applications, web platforms or third-party systems. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating a quantitative identification method for T / C lines on test strips based on QR codes, according to the present invention. Detailed Implementation
[0019] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be understood that the described embodiments are merely some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0020] like Figure 1 As shown in some illustrative embodiments, a method for quantitative identification of the T / C line of a test strip based on a QR code is provided, comprising the following steps: 101: Image Acquisition.
[0021] The mobile terminal is used to capture images of the test strips printed with QR codes, and the captured raw images are uploaded to the data processing center.
[0022] The original image includes at least one test strip, each test strip is printed with a QR code, and each test strip includes at least one color development area associated with the QR code on the test strip. That is, the test strip has a QR code, which may correspond to one color development area or multiple color development areas.
[0023] The data processing center receives the original images uploaded by the mobile terminal through the HTTP API interface. After obtaining the original images, it adaptively enlarges the original images to improve the success rate of subsequent QR code detection.
[0024] 102: Preprocess the original image. Preprocessing refers to identifying the location and decoding information of all QR codes in the original image, i.e., performing QR code detection to obtain the recognition result.
[0025] Specifically, the process of identifying the location and decoding information of all QR codes in the original image includes the following steps: 1021: Global Image Enhancement: Performs image enhancement processing on the original image to generate multiple enhanced variant images.
[0026] The image enhancement processing methods include one or more of the following: contrast-limited adaptive histogram equalization (CLAHE), brightness and contrast adjustment, sharpening filtering, gamma correction, global histogram equalization, and adaptive threshold binarization.
[0027] 1022: Scale Space Search: Input all enhanced variant images generated in step 1021 into the QR code detector for recognition. If not all targets are recognized, i.e., if not all QR codes are recognized, then the original image is upsampled, i.e., the detection is repeated at a larger scale, and the detected coordinates are mapped back to the original image scale.
[0028] Among them, the QR code detector is the WeChatQRCode detector based on deep learning.
[0029] 1023: Gridded Region Compensation: If the QR codes are arranged in a regular grid pattern, the original image is divided into grids with overlapping regions, and each grid region is individually cropped, enhanced, and detected to locate QR codes missed in the global detection.
[0030] Steps 1021-1023 form an enhanced QR code detection pipeline. This pipeline adopts a cascaded enhancement strategy consisting of global image enhancement, scale space search, and gridded region compensation, which can cope with complex image conditions.
[0031] 1024: Result Fusion and Deduplication: Merge all detected recognition results, perform deduplication based on the decoded content, retain only the unique QR code in the decoded content, and discard duplicate detection results that are close in location and have the same content.
[0032] 1025: Spatial sorting, which involves sorting all unique QR codes according to their spatial location. Specifically, all unique QR codes are sorted according to the coordinates of the center point of their circumscribed rectangle, following a visual order from top to bottom and from left to right, providing a consistent order for subsequent logical association with the test strip.
[0033] 103: Perspective transformation and image correction based on QR codes to achieve image skew correction.
[0034] Specifically, the perspective transformation matrix is calculated based on the identified QR code corner points, and the original image is geometrically corrected to obtain the corrected image.
[0035] First, for each recognized QR code, extract the pixel coordinates of its four corner points; Then, the perspective transformation matrix is calculated. That is, taking the QR code area as the target, a square target area is defined, whose side length is equal to the maximum side length of the outer rectangle of the QR code, and the perspective transformation matrix M from the original disordered corner point to the standard square corner point is calculated.
[0036] Finally, full image correction and boundary processing: To prevent the content of the corrected image from being cropped, the new boundaries of the four corner points of the original image after transformation by matrix M are calculated. By calculating the minimum bounding rectangle of the transformed boundary and adjusting the transformation matrix accordingly (adding translation), a corrected image containing the complete content of the original image is generated. This step can eliminate geometric deformations such as tilt and rotation, and finally obtain the test strip image from the frontal view, i.e., the corrected image.
[0037] 104: Location and segmentation of the color development area of the test strip, that is, in the calibration image, based on the preset relative positional relationship between the QR code and the color development area, the color development area of each test strip is located, and the color development area sub-image containing the T line and the C line is extracted.
[0038] The preset relative position relationship between the QR code and the color display area is a known relative layout of the QR code and the color display area. For example, the number of test strips corresponding to each QR code can be set by configuring parameters.
[0039] Specifically, the process of locating the color development area of each test strip includes: 1041: Preliminary Localization Based on Geometric Relationships: Using the specified corner point (lower right corner of the QR code) in the calibration image as a reference, the estimated rectangular area of the color development zone of each test strip is calculated according to the preset offset. 1042: Fine-grained localization based on connected component analysis: Within each estimated rectangular region, the final selected rectangular region is determined as the final color area using the connected component method combined with constraint rules. The constraint rules include: area filtering rules, aspect ratio filtering rules, and absolute height filtering rules.
[0040] Specifically, within each estimated rectangular area, perform the following steps: Adaptive image binarization: Calculate the median image brightness within the estimated rectangular region and dynamically select the binarization threshold based on the brightness. For example, use a higher threshold for high brightness and a lower threshold for low brightness to enhance the contrast between the target and the background. Morphological post-processing: Selectively apply erosion (to remove noise from dark images) or dilation (to connect breakpoints in bright images) operations based on brightness. Contour discovery and filtering: Find the outer contours in the binary image and calculate the minimum bounding rectangle of each contour.
[0041] Heuristic rule filtering: A series of rules are applied to filter invalid contours, including: area filtering rules, which exclude regions with areas greater than the high threshold and less than the low threshold; aspect ratio filtering rules, which retain regions with a height-to-width ratio greater than the ratio threshold; and absolute height filtering rules, which retain regions with a height greater than the total height threshold of the image.
[0042] The rectangles selected at the end are the precise color development areas. Step 104 is highly adaptable to slight deformations, positional deviations, and uneven lighting of the test strips.
[0043] 105: Grayscale projection and peak detection are used to locate the T-line, C-line, and boundary.
[0044] For each color area sub-image, grayscale values are projected in the horizontal and vertical directions, and the boundaries of the color area and the positions of the C-line and T-line are located by peak detection algorithm.
[0045] Specifically, the steps include the following: 1051: Convert the colored area sub-image to a grayscale image; 1052: Bidirectional grayscale projection: Horizontal projection (X-axis): Calculate the average gray level of each column of pixels in the grayscale image (invert it so that dark lines appear as peaks) to obtain the horizontal grayscale distribution curve.
[0046] Vertical projection (Y-axis): Calculate the average gray level of each row of pixels in the grayscale image (and invert it) to obtain the vertical grayscale distribution curve.
[0047] 1053: Adaptive Peak Detection: The peak detection algorithm is used to locate the left and right boundaries of the color area on the horizontal grayscale distribution curve, and to locate the vertical positions of the C-line and T-line on the vertical grayscale distribution curve.
[0048] The peak detection algorithm analyzes two gray-scale distribution curves. The peak detection algorithm uses a Savitzky-Golay filter to smooth the horizontal and vertical gray-scale distribution curves and uses an adjustable dynamic threshold parameter to detect peaks. It can effectively distinguish noise from real signals and can detect potential peak positions even under weak signal and low contrast conditions.
[0049] The detected peaks are clustered, and the highest peak in each cluster is retained as the valid peak.
[0050] 1054: T-line, C-line, and boundary determination: From the effective peaks of the horizontal grayscale distribution curve, select the peaks with the highest intensity located on the left and right sides of the center line, and use them as the left and right boundary indices of the color development area, respectively.
[0051] From the effective peaks of the vertical grayscale distribution curve, they are divided according to their relationship with the vertical position of the region center: the strongest peak located within a certain range above the center is determined as the C-line index, and the strongest peak located within a certain range below the center is determined as the T-line index.
[0052] 106: Quantitative calculation of T / C value.
[0053] 1061: Gray intensity calculation: At the positions of the C-line and T-line, calculate the average gray intensity of the pixels within the C-line and T-line regions, and use 255 minus the original gray value as the color intensity.
[0054] Specifically, at the indexed positions of the T-line and C-line, the average gray intensity of all pixels on the T-line and C-line is calculated along the left and right boundaries of the color-coding area.
[0055] 1062: Quantitative ratio calculation: Calculate the T / C ratio = T value / C value T value C represents the average grayscale intensity within the T-line region. value The average gray intensity within the C-line region is used for quantitative analysis.
[0056] If the C line is not detected, the test strip is deemed invalid; if the T line is not detected, i.e., T / C=0, the target substance is deemed not detected.
[0057] 107: Results output and visualization.
[0058] The results include: QR code information and the T / C ratio associated with that QR code information, T value Absolute value, C value Absolute value, and the resulting image.
[0059] The resulting image was obtained through the following steps: 1071: Sub-image annotation: On the sub-image of the color display area, use lines of different colors to mark the identified T-line and C-line. For example, on the sub-image of the color display area, use green lines to draw the T-line and blue lines to draw the C-line. 1072: Inverse Coordinate Transformation: Using the inverse matrix of the perspective transformation matrix M calculated in step 103, the coordinates of the four corner points of the labeled sub-image rectangle are mapped back to the original image space. That is, the space of the corrected image is mapped back to the space of the original captured image in reverse, so as to keep the visualization of the result consistent with the original scene. 1073: Image Fusion: The labeled sub-images are fused to their corresponding positions in the original image to generate a labeled visualization result image. On the original image, based on the quadrilateral region obtained by inverse transformation, the sub-image labeled with T / C lines is pasted back to its corresponding position through perspective transformation fusion to generate the final visualization result image. The result image retains the original shooting background, only replacing the analysis area with the labeled corrected post-view.
[0060] The system receives image input via a RESTful API and outputs a hierarchical JSON data structure containing the decoded content of each QR code, as well as the T / C ratio and T value of each associated test strip. value Absolute value, C value It provides absolute values and also offers final visualized image data to help users verify the results.
[0061] This invention also provides a QR code-based quantitative identification system for the T / C line of a test strip, comprising: The image acquisition module is used to acquire the original image, which is obtained by capturing the image of the test strip with the QR code printed on it through a mobile terminal; The detection and correction module is used to identify the position and decoding information of all QR codes in the original image, calculate the perspective transformation matrix based on the identified QR code corner points, and perform geometric correction on the original image to obtain the corrected image. The color development area positioning module is used to locate the color development area of each test strip in the calibration image based on the preset relative positional relationship between the QR code and the color development area, and to extract the color development area sub-image. The analysis and detection module is used to project grayscale values in the horizontal and vertical directions for each color area sub-image, and to locate the boundaries of the color area and the positions of the C-line and T-line through the peak detection algorithm. The ratio calculation module is used to calculate the average grayscale intensity within the C-line and T-line regions at the locations of the C-line and T-line, and to calculate the T / C ratio = T. value / C value T value C represents the average grayscale intensity within the T-line region. valueThis represents the average grayscale intensity within the C-line region; The visualization module is used to mark the identified T-line and C-line on the sub-image of the color display area with lines of different colors. Using the inverse matrix of the perspective transformation matrix, the coordinates of the marked sub-image are mapped back to the original image space. The marked sub-image is then merged into the corresponding position in the original image to generate a visualized image with annotations. The result output module is used to output results, which include: QR code information and the T / C ratio associated with the QR code information, T... value Absolute value, C value Absolute value, and the resulting image.
[0062] This application provides a method for quantitative T / C line recognition of multiple test strips printed with QR codes using a mobile terminal, and quantitative T / C line recognition of targets corresponding to multiple test strips for one QR code. First, the image is preprocessed to achieve a high recognition rate of the QR code under complex lighting and shooting angles. Then, the test strips are externally corrected using the QR code, and the approximate position of each color area is estimated based on the relative position of the QR code and the color development area. Next, the approximate position of the color development area is further accurately estimated using the connected component method, and the area is cropped into a sub-image. The sub-image is then subjected to horizontal and vertical grayscale projection, and the boundaries of the color development area and the positions of the C and T lines are located using a peak detection algorithm. Finally, the grayscale ratio of the T and C lines is calculated based on the average grayscale values of the C and T lines. Furthermore, the C and T lines are drawn onto a rectangular sub-image, and the sub-image is reverse-corrected and pasted back onto the original image. This image and the T / C line ratio are output to the mobile terminal, facilitating verification by the mobile terminal user and improving the reliability of the results.
[0063] It is particularly suitable for scenarios with limited resources or rapid on-site screening, enabling low-cost and high-efficiency quantitative testing using widely available mobile terminals. Utilizing general-purpose mobile terminals, under normal ambient lighting conditions, it automatically adapts to differences in shooting angle and terminal model, robustly and simultaneously locating and identifying multiple test strips and associating them with QR code information. Ultimately, it outputs accurate and reliable T / C line quantitative results, thereby truly reducing the professional requirements for operators and improving the automation, digitization, and quantification levels of rapid testing technology.
[0064] Advantages of this invention: High robustness: Through multi-strategy QR code enhancement detection, perspective correction, adaptive peak detection and other technologies, it effectively overcomes problems such as angle tilt, uneven lighting and blurry focus when shooting with mobile terminals; Multi-target synchronous processing: It can simultaneously identify multiple QR codes and corresponding test strips in an image, achieving high-throughput batch detection; Easy to operate: The entire process is automated, requiring no professional operation or complex equipment. Users only need to take a photo with their mobile phone to obtain quantitative results. Results visualization: Provides intuitive image annotation output, making it easy for users to compare and verify, and improving the credibility of the results; Easy to integrate: It provides an identification interface in the form of an HTTP service, which can be easily integrated into mobile applications, web platforms or third-party systems.
[0065] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for quantitative identification of the T / C line on a test strip based on a QR code, characterized in that, include: The mobile terminal captures images of the test strips printed with QR codes and uploads the captured raw images; The positions and decoding information of all QR codes in the original image are identified. Based on the identified QR code corner points, the perspective transformation matrix is calculated, and the original image is geometrically corrected to obtain a corrected image. In the corrected image, based on the preset relative positional relationship between the QR code and the color development area, the color development area of each test strip is located, and the color development area sub-image is extracted; For each color-developing sub-image, grayscale values are projected in the horizontal and vertical directions, and the boundaries of the color-developing areas and the positions of the C-line and T-line are located respectively using a peak detection algorithm; At the locations of lines C and T, calculate the average grayscale intensity within the regions of lines C and T, and calculate the T / C ratio = T value / C value T value C represents the average grayscale intensity within the T-line region. value This represents the average grayscale intensity within the C-line region.
2. The quantitative identification method for the T / C line of a test strip based on a QR code according to claim 1, characterized in that, Also includes: The output results include: QR code information and the T / C ratio associated with the QR code information, T value Absolute value, C value Absolute value.
3. The quantitative identification method for the T / C line of a test strip based on a QR code according to claim 2, characterized in that, The result also includes a result image, which is obtained through the following steps: On the color-coded sub-image, the identified T-line and C-line are marked with lines of different colors; Using the inverse of the perspective transformation matrix, the coordinates of the labeled sub-image are mapped back to the original image space; The labeled sub-images are merged into the corresponding positions in the original image to generate the labeled and visualized result image.
4. The quantitative identification method for the T / C line of a test strip based on a QR code according to claim 3, characterized in that, The original image captured by the mobile terminal includes at least one test strip, and each test strip includes at least one color-coding area associated with the QR code on the test strip.
5. The quantitative identification method for the T / C line of a test strip based on a QR code according to claim 4, characterized in that, The process of identifying the location and decoding information of all QR codes in the original image includes: The original image is subjected to image enhancement processing to generate multiple enhanced variant images; The enhanced variant image is input into the QR code detector for recognition. If not all targets are recognized, the original image is upsampled and the detected coordinates are mapped back to the original image scale. All recognition results are merged, deduplication is performed based on the decoded content, and all unique QR codes are sorted by spatial location; The image enhancement processing method is one or more of the following: contrast-limited adaptive histogram equalization, brightness and contrast adjustment, sharpening filtering, gamma correction, global histogram equalization, and adaptive threshold binarization.
6. The quantitative identification method for the T / C line of a test strip based on a QR code according to claim 5, characterized in that, The process of locating the color development area of each test strip includes: Using the specified corner point of the QR code in the corrected image as a reference, the estimated rectangular area of the color development zone of each test strip is calculated according to the preset offset. Within each of the estimated rectangular regions, the final selected rectangular regions are determined as the final color-coding regions using the connected component method combined with constraint rules. The constraint rules include: area filtering rules, aspect ratio filtering rules, and absolute height filtering rules.
7. The quantitative identification method for the T / C line of a test strip based on a QR code according to claim 6, characterized in that, The process of projecting grayscale values in the horizontal and vertical directions onto each of the color-developing sub-images and locating the boundaries of the color-developing areas and the positions of the C-line and T-line using a peak detection algorithm includes: Convert the colorimetric sub-image into a grayscale image; Calculate the average gray level of each column of pixels in the grayscale image to obtain the horizontal grayscale distribution curve, and calculate the average gray level of each row of pixels in the grayscale image to obtain the vertical grayscale distribution curve. The peak detection algorithm is used to locate the left and right boundaries of the color development area on the horizontal grayscale distribution curve, and to locate the vertical positions of the C-line and T-line on the vertical grayscale distribution curve.
8. The quantitative identification method for the T / C line of a test strip based on a QR code according to claim 7, characterized in that, The peak detection algorithm uses a Savitzky-Golay filter to smooth the horizontal and vertical grayscale distribution curves, uses an adjustable dynamic threshold parameter to detect peaks, and clusters the detected peaks, retaining the highest peak in each cluster as a valid peak. The left and right boundaries of the color rendering area refer to the selection of the peaks with the highest intensity located on the left and right sides of the center line from the effective peaks of the horizontal grayscale distribution curve, which are respectively used as the left and right boundary indices of the color rendering area. The vertical position of the C-line and T-line refers to determining the effective peak above the center as the C-line index and the effective peak below the center as the T-line index, based on the relative relationship between the detected peak and the vertical position of the center of the color area sub-image.
9. A quantitative identification system for the T / C line of a test strip based on a QR code, characterized in that, include: The image acquisition module is used to acquire the original image, which is obtained by capturing the image of the test strip with the QR code printed on it through a mobile terminal; The detection and correction module is used to identify the position and decoding information of all QR codes in the original image, calculate the perspective transformation matrix based on the identified QR code corner points, and perform geometric correction on the original image to obtain a corrected image. The color development area positioning module is used to locate the color development area of each test strip in the calibration image based on the preset relative positional relationship between the QR code and the color development area, and to extract the color development area sub-image. The analysis and detection module is used to project grayscale values in the horizontal and vertical directions onto each color area sub-image, and to locate the color area boundary and the positions of the C-line and T-line respectively through a peak detection algorithm; The ratio calculation module is used to calculate the average grayscale intensity within the C-line and T-line regions at the locations of the C-line and T-line, and to calculate the T / C ratio = T. value / C value T value C represents the average grayscale intensity within the T-line region. value This represents the average grayscale intensity within the C-line region.
10. A quantitative identification system for the T / C line of a test strip based on a QR code according to claim 9, characterized in that, Also includes: The visualization module is used to mark the identified T-line and C-line with lines of different colors on the sub-image of the color display area, and to map the coordinates of the marked sub-image back to the original image space using the inverse matrix of the perspective transformation matrix. The marked sub-image is then merged into the corresponding position in the original image to generate a visualized result image with annotations. The result output module is used to output results, which include: QR code information and the T / C ratio associated with the QR code information, T... value Absolute value, C value The absolute value, and the resulting image.