A novel array-based urine test strip instant detection and analysis method
Through the new array urine test strip and image processing technology, the impact of the light environment on urine detection is solved, and accurate analysis is achieved under different light environments, which is suitable for early chronic disease screening.
Patent Information
- Application Number
- CN202311230542.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-21
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2043-09-21
AI Technical Summary
Existing instant urine detection technology is prone to errors in different light environments, and the human eye recognition accuracy is low, making it difficult to accurately analyze and detect color signals on the test strips.
The new array urine test strip is adopted to arrange the test strip and the reference color block into a nine-grid array, and combined with image processing technology, including background elimination, correction, segmentation and color information calculation, to achieve accurate analysis of the test strip image.
Accurate urine analysis is achieved under different light environments, reducing human eye recognition errors, improving detection efficiency, and suitable for early chronic disease screening.
Smart Images

Figure CN117274295B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing and recognition systems, and in particular to a novel array-type urine test paper instant detection and analysis method. Background Art
[0002] POCT (Point of Care Testing), also known as point-of-care testing, is a subsector of the IVD (in vitro diagnostic) industry. It refers to a rapid diagnosis performed immediately at the sampling site, eliminating the complexities of laboratory specimen testing and utilizing portable analytical instruments and supporting reagents to rapidly obtain test results. It is a modern medical testing method derived from the integrated development of multiple disciplines, including medicine, immunology, analytical biology, mechanics, and optics. POCT primarily utilizes portable, automated instruments and equipment, offering simple and quick operation without requiring specific experimental conditions. It is suitable for use in primary healthcare institutions and on-site, and is widely used in complex, multi-indicator urine testing.
[0003] The main diagnostic principle of urine POCT is based on colorimetric analysis of color blocks or color strips. Existing urine instant detection technology usually uses the method of observing the test strip with the naked eye, that is, the urine sample is soaked in the test strip, and humans obtain color signals in the way of human eyes, and then evaluate and analyze the color signals through human perception. However, when the color displayed on the test strip is not significantly different from the color of the standard color card / color block, and the standard color card / color block is discontinuous in space, errors are likely to occur. At the same time, when the test strip is analyzed using a smartphone under different light environments, the color displayed on the test strip will show obvious color difference, which makes analysis difficult. Therefore, there is an urgent need for a urine instant analysis method that can adapt to different light environments to solve the problem of low accuracy of human eye recognition. Summary of the Invention
[0004] To solve the above problems, the present invention provides a novel array-type urine test strip instant detection and analysis method, comprising the following steps:
[0005] S1. Soaking the novel array urine test paper with urine to obtain an image of the novel array urine test paper after the urine is soaked; wherein:
[0006] The novel array-type urine test strip comprises a waterproof card and multiple single-item indicator detection and analysis arrays disposed thereon; each single-item indicator detection and analysis array comprises a square detection area, a detection strip, and a reference color block; the square detection area is divided into nine equal-sized squares, each numbered from 1 from left to right and from top to bottom; the detection strip is placed on the square numbered 5, the detection indicator is marked on the square numbered 4, and different reference color blocks are disposed on the remaining numbered squares according to the detection indicator; during testing, urine soaks all the detection strips;
[0007] S2. Perform background removal on the test paper image to obtain a test paper contour image;
[0008] S3. Correcting the test strip contour image by image processing to obtain a corrected test strip contour image;
[0009] S4. Segment the test strip contour image according to the boundary positioning method to obtain multiple single indicator detection and analysis array images;
[0010] S5. Perform separate detection and analysis on each individual indicator detection and analysis array image, including:
[0011] S51. Detect and analyze the array image for any single indicator, obtain the coordinates of the center point of the test paper and the center point of the reference color block, and calculate the test paper ROI and the reference color block ROI;
[0012] S52. Extracting the color information of the test paper ROI and the reference color block ROI in the RGB space after median filtering;
[0013] S53 converts the color information of the RGB space into the color information of the CIEab space, and calculates the color value of the test paper ROI and the color value of the reference color block ROI;
[0014] S54. Calculate the Euclidean distance between the test paper ROI color value and each reference color block ROI color value, and detect the reference color block corresponding to the minimum Euclidean distance by the adjustable threshold color similarity judgment method to obtain a matching result;
[0015] S55. Classify the matching results to obtain corresponding concentration information.
[0016] Furthermore, step S2 performs background removal processing on the test paper image to obtain a test paper contour image, including:
[0017] S21. Grayscale the test strip image to obtain a grayscale test strip image, and use the Otus method to obtain a binarization threshold of the grayscale test strip image;
[0018] S22. Binarize the grayscale test strip image according to the binarization threshold to obtain a binary grayscale test strip image, use a contour detection algorithm to obtain all contours in the binary grayscale test strip image, and calculate the area of each contour;
[0019] S23. Filter the areas of all contours according to a preset area threshold to find the contour of the new urine test paper, segment and extract the test paper image according to the contour of the new urine test paper, and obtain a test paper contour image.
[0020] Furthermore, step S3 performs correction image processing on the test paper contour image to obtain a corrected test paper contour image, including:
[0021] S31. Correct the test strip contour image using an image tilt correction algorithm based on Hough transform;
[0022] S32. Perform grayscale processing and binarization processing on the corrected test paper contour image to obtain a corrected test paper contour image.
[0023] Furthermore, the boundary positioning method includes a left and right boundary positioning method and a horizontal projection algorithm. The left and right boundary positioning method is used to obtain the left and right boundaries of the single indicator detection and analysis array, including:
[0024] S41 obtains the width w and height h of the correction test paper contour image;
[0025] S42. Calculate the total number of black pixels in column i of the correction test paper contour image, sum[i], where i = 1, 2, ..., w;
[0026] S43. Determine whether the inequality sum[i]>T holds. If so, save the i-th column of the corrected test paper contour image as the n-th suspicious boundary b[n]; where T is the pixel threshold;
[0027] S44 repeats steps S42-S43 until the calculation and judgment of each column of the corrected test strip contour image is completed, N suspicious boundaries are obtained and the process proceeds to step S45;
[0028] S45. Use the boundary filtering function to process the N suspicious boundaries to obtain the left boundary and the right boundary of each single indicator detection and analysis array.
[0029] Furthermore, the boundary filter function is expressed as:
[0030]
[0031] Where f(k) represents the boundary filtering result of the k-th suspicious boundary, Ess1 and Ess2 are boundary errors, l represents the proportional coefficient between the width of the single indicator detection and analysis array and the distance between two adjacent single indicator detection and analysis arrays; b[k] represents the k-th suspicious boundary.
[0032] Beneficial effects of the present invention:
[0033] The present invention optimizes the arrangement of existing urine test strips and provides a new array-type urine test strip, in which the test strips and reference color blocks are arranged to form a nine-square array, the test strips are arranged in the center of the nine-square grid, and the reference color blocks are arranged on the periphery of the nine-square grid center. Multiple nine-square arrays are arranged in parallel, and different components of urine can be detected simultaneously. In the new urine test strip, the radial distance between the test strip and the reference color block is small, and the color changes of the test strip and the reference color block tend to be consistent under different light environments. The instant detection and analysis method based on the new array-type urine test strip will not be affected by light and will not produce result errors.
[0034] This method is suitable for performing urine analysis under various publicly available light conditions. By capturing an image of a completed urine test strip and performing a series of image processing, the concentration of the corresponding indicator in the sample being tested is determined. This method is highly efficient and simple to operate, avoiding issues such as ambient light interference and low human visual recognition accuracy. It can also be used to screen patients for early-stage chronic diseases and reduce disease risk.
[0035] Furthermore, the new urine test strips can be analyzed instantly by the human eye, without the need for additional colorimetric charts. The proposed colorimetric analysis scheme provides accurate results under various ambient lighting conditions, without the need for color calibration, making it suitable for practical applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 This is a flow chart of the novel array-type urine test strip identification method disclosed in an embodiment of the present invention;
[0037] Figure 2 This is a schematic diagram of a single indicator detection and analysis array of a novel array-type urine test paper disclosed in an embodiment of the present invention;
[0038] Figure 3 This is a schematic diagram of a novel array-type urine test paper disclosed in an embodiment of the present invention;
[0039] Figure 4 This is a schematic diagram of a novel array-type urine test strip image contour detection disclosed in an embodiment of the present invention;
[0040] Figure 5 This is a schematic diagram of a novel array-type urine test strip image tilt correction method disclosed in an embodiment of the present invention;
[0041] Figure 6 This is a schematic diagram of an array image for extracting a single indicator for detection and analysis disclosed in an embodiment of the present invention;
[0042] Figure 7 A schematic diagram of coordinates of a region of interest for a single indicator detection disclosed in an embodiment of the present invention;
[0043] Figure 8This is a schematic diagram of extracting a region of interest for single indicator detection disclosed in an embodiment of the present invention. DETAILED DESCRIPTION
[0044] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0045] The present invention provides a novel array-type urine test paper instant detection and analysis method, such as Figure 1 Said method comprises the following steps:
[0046] S1. Soaking the novel array urine test paper with urine to obtain an image of the novel array urine test paper after the urine is soaked; wherein:
[0047] The novel array-type urine test strips include a waterproof card and multiple single-item indicator detection and analysis arrays disposed thereon. Each single-item indicator detection and analysis array comprises a square detection area, a test strip, and a reference color block. The square detection area is divided into nine equal-sized squares, each of which has a length of d. Each square is numbered starting from 1, from left to right and from top to bottom. The test strip is placed on square numbered 5, the detection indicator is marked on square numbered 4, and the remaining numbered squares are provided with different reference color blocks according to the detection indicator. During testing, urine soaks all the test strips.
[0048] Multiple single indicator detection and analysis arrays are arranged horizontally on a waterproof card. All single indicator detection and analysis arrays are used to detect the concentration of different components in urine, including vitamin C, white blood cells, urobilinogen, occult blood, nitrite, pH, protein, urine specific gravity, ketone bodies, and glucose. Figure 2 As shown in the figure, the detection index is marked as pH on the square numbered 4, which means that the detection object of the single indicator detection and analysis array is the pH concentration in urine. If the reference color blocks of a single indicator detection and analysis array are less than 7, a black slash is marked in the blank square. Figure 3 shown.
[0049] Specifically, in step S1, a new array urine test strip that completes urine infiltration detection within one minute is placed on a flat table, and a mobile phone APP is used to capture the test strip image. At this time, the camera is placed flat above the new array urine test strip at a distance of 8-15 cm.
[0050] S2. Perform background removal processing on the test paper image to obtain a test paper contour image.
[0051] Specifically, step S2 performs background removal processing on the test paper image to obtain a test paper contour image, such as Figure 4 As shown, including:
[0052] S21. Grayscale the test strip image to obtain a grayscale test strip image, and use the Otus method (also known as the Otsu method or the maximum variance method) to obtain a binarization threshold for the grayscale test strip image;
[0053] S22. Binarize the grayscale test strip image according to the binarization threshold to obtain a binary grayscale test strip image, use a contour detection algorithm to obtain all contours in the binary grayscale test strip image, and calculate the area of each contour;
[0054] Specifically, the binarization process includes: scanning and judging each pixel of the grayscale test paper image, and if the grayscale value of the pixel is greater than the binarization threshold, setting the grayscale value of the pixel to 1, otherwise setting it to 0.
[0055] S23. Filter the areas of all contours according to a preset area threshold to find the contour of the new urine test paper, segment and extract the test paper image according to the contour of the new urine test paper, and obtain a test paper contour image.
[0056] S3. Perform correction image processing on the test paper contour image to obtain a corrected test paper contour image.
[0057] Specifically, step S3 performs correction image processing on the test paper contour image to obtain a corrected test paper contour image, such as Figure 5 As shown, including:
[0058] S31. Correct the test strip contour image using an image tilt correction algorithm based on Hough transform, including:
[0059] The tilt angle of the test paper contour image is obtained by Hough line detection, and the two-dimensional rotation affine transformation matrix A is calculated. The test paper contour image is corrected by the tilt angle and the two-dimensional rotation affine transformation matrix A.
[0060] S32. Perform grayscale processing and binarization processing on the corrected test paper contour image to obtain a corrected test paper contour image.
[0061] S4. Segment and correct the test paper contour image according to the boundary positioning method to obtain multiple single indicator detection and analysis array images.
[0062] Specifically, the boundary positioning method includes the upper and lower boundary positioning of the entire test paper, and the left and right boundary positioning of the single indicator detection and analysis array. The left and right boundary positioning method of the single indicator detection and analysis array is designed in a multi-noise environment, considering the projection method combined with the inherent geometric characteristics of the new urine test paper. The left and right boundary positioning methods are used to obtain the left and right boundaries of all single indicator detection and analysis arrays in the corrected test paper contour image. At the same time, the horizontal projection algorithm is used to obtain the upper and lower boundaries of the entire test paper. According to the four boundary information, the single indicator detection and analysis array image is cropped in the corrected test paper contour image, as shown in FIG. Figure 6 shown.
[0063] Specifically, step S4 obtains the left and right boundaries of the single indicator detection and analysis array according to the left and right boundary positioning method, including:
[0064] S41 obtains the width w and height h of the correction test paper contour image;
[0065] S42. Calculate the total number of black pixels in column i of the correction test paper contour image, sum[i], where i = 1, 2, ..., w;
[0066] S43. Determine whether the inequality sum[i]>T holds. If so, save the i-th column of the corrected test paper contour image as the n-th suspicious boundary b[n]; where T is the pixel threshold;
[0067] S44 repeats steps S42-S43 until the calculation and judgment of each column of the corrected test strip contour image is completed, N suspicious boundaries are obtained and the process proceeds to step S45;
[0068] S45. Use the boundary filtering function to process the N suspicious boundaries to obtain the left boundary and the right boundary of each single indicator detection and analysis array.
[0069] Specifically, the boundary filter function is expressed as:
[0070]
[0071] Where f(k) represents the boundary filtering result of the k-th suspicious boundary, Ess1 and Ess2 are boundary errors, l represents the proportional coefficient between the width of a single indicator detection and analysis array and the distance between two adjacent single indicator detection and analysis arrays in the correction test paper contour image; b[k] represents the k-th suspicious boundary.
[0072] S5. Perform separate detection and analysis on each individual indicator detection and analysis array image, including:
[0073] S51. Detect and analyze the array image for any single index, obtain the coordinates of the center point of the test strip and the center point of the reference color block, and calculate the ROI of the test strip and the ROI of the reference color block.
[0074] Specifically, according to the geometric characteristics of the new urine test strip, establish a pixel coordinate system with the upper left corner of the array image for detecting and analyzing this single index as the origin, and the coordinate values in the pixel coordinate system are non - negative numbers; obtain the coordinates of the center point of the test strip in the array image for detecting and analyzing this single index as (o x , o y ), and calculate the coordinates of the center point of the reference color block for each square of the set reference color block according to the square size. As Figure 7 shown, where:
[0075] Square numbered 1: (o x - d, o y - d), square numbered 2: (o x , o y - d), square numbered 3: (o x+ d, o y - d), square numbered 6: (o x+ d, o y ), square numbered 7: (o x - d, o y+ d), square numbered 8: (o x , o y+ d), square numbered 9: (o x+ d, o y+ d).
[0076] After obtaining the center point coordinates, extract the ROI of the test strip with d as the radius, where the total number of pixel points is N O , and extract the ROI of the reference color block with R (R < d) as the radius. As Figure 8 shown, where the total number of pixel points of the ROI of the reference color block extracted from the square numbered i is N i , i = 1, 2, 3, 5, 6, 7, 8, 9.
[0077] S52. Extract the color information of the ROI of the test strip and the ROI of the reference color block in the RGB space after mean filtering.
[0078] Specifically, the mean filtering formula is:
[0079]
[0080] Where g(x,y) represents the value of the pixel point (x,y) after mean filtering, Ns represents the total number of pixels in the filter window area, f(x,y) represents the value of the pixel point (x,y) before mean filtering, s represents the filter window, and f∈s represents the summation of pixels in the filter window.
[0081] S53. Convert the color information of the RGB space into the color information of the CIEab space, and calculate the color value of the test paper ROI and the color value of the reference color block ROI.
[0082] Specifically, the color information of the RGB space is converted to the XYZ space coordinate system, which is expressed as:
[0083]
[0084]
[0085]
[0086] in, (R, G, B) is the RGB three-primary color value of the pixel (x, y), (R liner ,G liner ,B liner ) is the linearized three primary color value of the pixel (x, y), γ -1 is the inverse correction factor, and (X, Y, Z) is the color information of the pixel point (x, y) in the XYZ space coordinate system.
[0087] Convert the color information of the XYZ space coordinate system to the CIELab space, expressed as:
[0088]
[0089]
[0090] Among them, (X n ,Y n ,Z n ) is the tristimulus value of the pixel point (x, y) when the CIE standard illuminant D65 is irradiated on a completely diffuse reflector and then reflected to the observer's eyes. In this embodiment, X n =95.047, Y n =100.0、Z n =108.883. (L * , a * , b * ) is the color information of the pixel (x, y) in the CIELab space; L * Represents the brightness component of the pixel (x, y), a *Represents the yellow and blue channel components of the pixel (x, y), b * Represents the red and green channel components of the pixel (x, y). f(t) is the linear transformation function.
[0091] Specifically, the color value of the test paper ROI is calculated as:
[0092]
[0093] Among them, (L o * , a o * , b o * ) represents the color value of the test paper ROI, Represents the average brightness component of all pixels in the test paper ROI. Represents the average value of the yellow and blue channel components of all pixels in the test paper ROI. Represents the average value of the red and green channel components of all pixels in the test paper ROI, N o Indicates the total number of pixels in the test paper ROI, L k Represents the brightness component of the kth pixel in the test paper ROI, a k represents the yellow-blue channel component of the kth pixel in the test paper ROI, b k Represents the red and green channel components of the k-th pixel in the test paper ROI.
[0094] The reference color block ROI color value is expressed as:
[0095]
[0096] Among them, (L i * , a i * , b i * ) represents the reference color block ROI color value of the reference color block ROI numbered i, Represents the average brightness component of all pixels in the reference color block ROI area numbered i, Represents the average value of the yellow and blue channel components of all pixels in the reference color block ROI area numbered i, Represents the average value of the red and green channel components of all pixels in the reference color block ROI area numbered i, N i Indicates the total number of pixels in the reference color block ROI area numbered i, L j Represents the brightness component of the jth pixel in the reference color block ROI area numbered i, a jIndicates the yellow-blue channel component of the j-th pixel in the reference color block ROI area numbered i, b j Represents the red and green channel components of the j-th pixel in the reference color block ROI area numbered i.
[0097] S54. Calculate the Euclidean distance between the color value of the test paper ROI and the color value of each reference color block ROI, and detect the reference color block corresponding to the minimum Euclidean distance using the adjustable threshold color similarity judgment method to obtain a matching result.
[0098] Specifically, the Euclidean distance between the color value of the test paper ROI and the color value of the i-th reference color block ROI is calculated, which is expressed as:
[0099]
[0100] Specifically, the reference color block corresponding to the minimum Euclidean distance is detected by the adjustable similarity color similarity judgment method to obtain a matching result, including:
[0101] S541. Obtain the coordinates of the center point of the reference color block corresponding to the minimum Euclidean distance ( minx ,o miny );
[0102] S542. Divide the test paper into the test paper center coordinates ( x ,o y ) as the center, D similar A rectangular area with side length T o ; Divide the reference color block into the reference color block center coordinates (o minx ,o miny ) as the center, D similar A rectangular area with side length T min , where D similar <d;
[0103] S543. Set rectangular area T o With the rectangular area T min The total number of similar pixels in is n similar , initialize the total number of similar pixels to n similar =0; at the same time set the rectangular area T o With the rectangular area T min The total number of pixels is N1, and the total number of similar pixels threshold is T n and angle threshold T α ;
[0104] S544. Calculate rectangular area T o The color value vector of the mth pixel in (L om , a om , b om) and the rectangular area T min The color value vector of the mth pixel in (L im , a im , b im ) m :
[0105]
[0106] S545. Determine the angle α m Does it satisfy the inequality α? m <T α , if it satisfies, then the rectangular area T o The mth pixel and the rectangular area T min The mth pixel in is similar, then n similar =n similar +1;
[0107] S546. Determine whether the equation m=N1 is satisfied. If so, proceed to step S547. If not, m=m+1 and return to step S544.
[0108] S547. Determine whether condition n is met similar ≥T n If satisfied, the test paper matches the target reference color block; if not satisfied, the matching degree n between the test paper and the target reference color block is output. similar / N1.
[0109] S55. Classify the matching results to obtain corresponding concentration information.
[0110] In the present invention, unless otherwise clearly stipulated and limited, the terms "installation", "setting", "connection", "fixation", "rotation" and the like should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be the internal connection of two elements or the interaction relationship between two elements. Unless otherwise clearly defined, ordinary technicians in this field can understand the specific meanings of the above terms in the present invention according to the specific circumstances.
[0111] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. A novel array-type urine test strip instant detection and analysis method, characterized in that: The following steps are involved: S1. Soaking the novel array urine test paper with urine to obtain an image of the novel array urine test paper after the urine is soaked; wherein: The novel array-type urine test strip comprises a waterproof card and multiple single-item indicator detection and analysis arrays disposed thereon; each single-item indicator detection and analysis array comprises a square detection area, a detection strip, and a reference color block; the square detection area is divided into nine squares of equal size, each of which has a length of d; each square is numbered starting from 1 in order from left to right and from top to bottom; the detection strip is placed on the square numbered 5, the detection indicator is marked on the square numbered 4, and different reference color blocks are disposed on the remaining numbered squares according to the detection indicator; during testing, urine soaks all the detection strips; S2. Perform background removal on the test paper image to obtain a test paper contour image; S3. Correcting the test strip contour image by image processing to obtain a corrected test strip contour image; S4. Segment the test strip contour image according to the boundary positioning method to obtain multiple single indicator detection and analysis array images; S5. Perform separate detection and analysis on each individual indicator detection and analysis array image, including: S51. Detect and analyze the array image for any single indicator, obtain the coordinates of the center point of the test paper and the center point of the reference color block, and calculate the test paper ROI and the reference color block ROI; S52. Extracting the color information of the test paper ROI and the reference color block ROI in the RGB space after median filtering; S53 converts the color information of the RGB space into the color information of the CIEab space, and calculates the color value of the test paper ROI and the color value of the reference color block ROI; S54. Calculate the Euclidean distance between the test paper ROI color value and each reference color block ROI color value, and detect the reference color block corresponding to the minimum Euclidean distance by the adjustable threshold color similarity judgment method to obtain a matching result; S55. Classify the matching results to obtain corresponding concentration information.
2. A novel array-type urine test strip instant detection and analysis method according to claim 1, characterized in that: Step S2 performs background removal processing on the test paper image to obtain a test paper contour image, including: S21. Grayscale the test strip image to obtain a grayscale test strip image, and use the Otus method to obtain a binarization threshold of the grayscale test strip image; S22. Binarize the grayscale test strip image according to the binarization threshold to obtain a binary grayscale test strip image, use a contour detection algorithm to obtain all contours in the binary grayscale test strip image, and calculate the area of each contour; S23. Filter the areas of all contours according to a preset area threshold to find the contour of the new urine test paper, segment and extract the test paper image according to the contour of the new urine test paper, and obtain a test paper contour image.
3. A novel array-type urine test strip instant detection and analysis method according to claim 1, characterized in that: Step S3 performs correction image processing on the test paper contour image to obtain a corrected test paper contour image, including: S31. Correct the test strip contour image using an image tilt correction algorithm based on Hough transform; S32. Perform grayscale processing and binarization processing on the corrected test paper contour image to obtain a corrected test paper contour image.
4. A novel array-type urine test strip instant detection and analysis method according to claim 1, characterized in that: The boundary positioning method includes a left and right boundary positioning method and a horizontal projection algorithm. The left and right boundary positioning method is used to obtain the left and right boundaries of the single indicator detection and analysis array, including: S41 obtains the width w and height h of the correction test paper contour image; S42. Calculate the total number of black pixels in column i of the correction test paper contour image, sum[i], where i = 1, 2, ..., w; S43. Determine whether the inequality sum[i]>T holds. If so, save the i-th column of the corrected test paper contour image as the n-th suspicious boundary b[n]; where T is the black pixel number threshold; S44 repeats steps S42-S43 until the calculation and judgment of each column of the corrected test strip contour image is completed, N suspicious boundaries are obtained and the process proceeds to step S45; S45. Use the boundary filtering function to process the N suspicious boundaries to obtain the left boundary and the right boundary of each single indicator detection and analysis array.
5. A novel array-type urine test strip instant detection and analysis method according to claim 4, characterized in that: The boundary filter function is expressed as: Where f(k) represents the boundary filtering result of the k-th suspicious boundary, Ess1 and Ess2 are boundary errors, l represents the proportional coefficient between the width of the single indicator detection and analysis array and the distance between two adjacent single indicator detection and analysis arrays; b[k] represents the k-th suspicious boundary.
6. A novel array-type urine test strip instant detection and analysis method according to claim 1, characterized in that: The reference color block corresponding to the minimum Euclidean distance is detected by the adjustable threshold color similarity judgment method to obtain the matching results, including: S541. Obtain the coordinates of the center point of the target reference color block corresponding to the minimum Euclidean distance ( minx ,o miny ); S542. Divide the test paper into the test paper center coordinates ( x ,o y ) as the center, D similar A rectangular area with side length T o ; Divide the target reference color block into the reference color block center coordinates (o minx ,o miny ) as the center, D similar A rectangular area with side length T min , where D similar <d; S543. Set rectangular area T o With the rectangular area T min The total number of similar pixels in is n similar , initialize the total number of similar pixels to n similar =0; at the same time set the rectangular area T o With the rectangular area T min The total number of pixels is N1, and the total number of similar pixels threshold is T n and angle threshold T α ; S544. Calculate rectangular area T o The color value vector of the mth pixel in the rectangular area T min The angle α between the color value vectors of the mth pixel m ; S545. Determine the angle α m Does it satisfy the inequality α? m <T α , if it satisfies, then the rectangular area T o The mth pixel and the rectangular area T min The mth pixel in is similar, then n similar =n similar +1; S546. Determine whether the equation m=N1 is satisfied. If so, proceed to step S547. If not, m=m+1 and return to step S544. S547. Determine whether condition n is met similar ≥T n If it is satisfied, the test paper matches the target reference color block. If it is not satisfied, the matching degree n between the test paper and the target reference color block is output. similar / N1.
7. A novel array-type urine test strip instant detection and analysis method according to claim 6, characterized in that: Step S544 calculates the rectangular area T o The color value vector of the mth pixel in the rectangular area T min The angle α between the color value vectors of the mth pixel m , expressed as: Among them, (L om , a om , b om ) represents the rectangular area T o The color value vector of the mth pixel in (L im , a im , b im ) represents the rectangular area T min The color value vector of the m-th pixel in .
Citation Information
Patent Citations
Method for identifying color of test strip of urine detector
CN109991216A
Method for detecting body fluid based on special test paper
WO2017067023A1