Colloidal gold test paper, detection method and device thereof and computer readable storage medium
By printing positioning blocks on colloidal gold test strips and combining image processing technology of mobile terminals and cloud servers, the automated detection of colloidal gold test strips is realized, solving the problems of artificial inaccurate interpretation and inconvenient equipment in the prior art, and providing a fast and accurate real-time inspection solution.
Patent Information
- Application Number
- CN202410090123.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-22
- Publication Date
- 2025-07-22
AI Technical Summary
The results of existing colloidal gold immunochromatography test strips rely on artificial observation, and the accuracy is greatly affected by personal experience, unable to be automated archived, and professional equipment is not suitable for personal and family use, resulting in insufficient convenience and accuracy of instant POCT testing.
The first positioning block and the second positioning block are printed on the colloidal gold test strip, the test strip image is taken through the mobile terminal, the color rendering area is positioned using the positioning block, image processing and feature extraction are performed, and sent to the cloud server for classification prediction, and automatic detection is realized.
Without increasing the production cost of test strips, users can quickly and accurately obtain test results through mobile terminals, which is suitable for popular use, improving the convenience and accuracy of instant inspection.
Smart Images

Figure CN120352613A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of rapid test paper detection technology, and in particular to a colloidal gold test paper and a detection method, device and computer-readable storage medium thereof. Background Art
[0002] Colloidal gold immunochromatographic test strip rapid detection technology has the advantages of being fast and simple, and has been widely used in fields such as food safety, environmental sanitation, and medical health. For a long time, the interpretation of test strip results has mainly relied on visual inspection, combined with the paper standard colorimetric card provided by the manufacturer, and the color depth of the CT line (quality control line and test line) on the test strip is observed by human eyes, combined with personal experience to make a qualitative judgment. Human factors have a greater impact on the judgment of the results, and the results cannot be automatically archived in a computer, which is not conducive to long-term result tracking and analysis.
[0003] With the development of technology, specialized colloidal gold immunochromatographic analyzers and readers have been invented, which can realize quantitative or semi-quantitative results detection of matching test strips. However, these instruments often have certain technical requirements in terms of operation, light environment and equipment maintenance, so they can only be used by medical institutions and professionals, and are not suitable for popular promotion and use by individuals and families. For example, in outdoor point-of-care testing (POCT), the sampling site is analyzed immediately, which causes many inconveniences due to factors such as the inconvenience of carrying some equipment, the incompatibility of the experimental environment and the power supply. For another example, for ovulation test strips based on colloidal gold technology, many older or women of childbearing age are not professionals, and it is difficult to find the exact ovulation day by visual inspection, which makes it difficult to conceive. Therefore, the research of more convenient, fast, readily available, accurate and low-cost POCT-related products and services is a problem to be solved. Summary of the invention
[0004] In view of this, the embodiments of the present application provide a colloidal gold test paper and a detection method, device and computer-readable storage medium thereof, which can solve the problem in the prior art that users cannot perform instant testing of colloidal gold test paper by themselves.
[0005] In a first aspect, an embodiment of the present application provides a colloidal gold test paper, which includes a first positioning block and a second positioning block set by a printing process, and a color development area is provided between the first positioning block and the second positioning block; wherein the color and size ratio of the first positioning block and the second positioning block are set according to the type of the colloidal gold test paper.
[0006] In a second aspect, an embodiment of the present application provides a colloidal gold test paper detection method, which is applied to the colloidal gold test paper, and the method comprises:
[0007] Acquire a target image that completely contains the colloidal gold test paper to be tested;
[0008] Perform positioning block positioning on the target image to obtain the position information of the first positioning block and the second positioning block;
[0009] Based on the position information of the positioning block, obtain the chromogenic region image where the chromogenic region is located;
[0010] Divide the chromogenic region image to obtain a test line image and a quality control line image, and perform image preprocessing to determine the validity of the test line image and the quality control line image;
[0011] Extract features from the valid test line image and quality control line image to obtain feature vectors and send them to the cloud server;
[0012] Receive the colloidal gold concentration prediction result obtained by classifying the feature vectors using the classification prediction model returned by the cloud server.
[0013] In some embodiments, the position information includes the center point coordinates of the first positioning block and the second positioning block in the target image. After obtaining the position information of the two positioning blocks in the target image, it further includes:
[0014] Use the abscissa in the center point coordinates and the corresponding contour area to respectively determine whether the first positioning block and the second positioning block are large-end positioning blocks or small-end positioning blocks;
[0015] The step of dividing the chromogenic region image to obtain a test line image and a quality control line image includes:
[0016] Bisect the chromogenic region image along the length direction of the colloidal gold test strip to obtain two segmented images. Take the segmented image close to the large-end positioning block as the quality control line image, and take the other segmented image close to the small-end positioning block as the test line image.
[0017] In some embodiments, the colloidal gold test strip detection method further includes:
[0018] According to the center point coordinates of the first positioning block and / or the second positioning block in the target image, select the RGB color values of the center point coordinates of the corresponding positioning block. According to the magnitudes of the respective color components in the RGB color values, determine the color of the corresponding positioning block;
[0019] Wherein, the color of the corresponding positioning block is used to determine the type of the colloidal gold test strip, and further determine the classification prediction model corresponding to the type of the colloidal gold test strip.
[0020] In some embodiments, positioning the first positioning block and the second positioning block in the target image to obtain the position information of the first positioning block and the second positioning block includes:
[0021] Obtaining all contour information in the region of interest in the target image;
[0022] Detecting whether there are two rectangular contours within a threshold range among all the contours, and when they exist, determining the position coordinates of the positioning blocks corresponding to the two rectangular contours in the target image;
[0023] After obtaining the position information of the first positioning block and the second positioning block, the following steps are further included:
[0024] Calculating the edge gradient of the image in the region where each positioning block is located according to the position information of each positioning block in the target image to determine whether the clarity of the target image meets the clarity condition, and when the clarity condition is met, obtaining the chromogenic region image where the chromogenic region is located.
[0025] In some embodiments, detecting whether there are two rectangular contours within a threshold range among all the contours includes:
[0026] Detecting whether the number of all the contours is greater than or equal to two. If it is less than two, determining that the target image is invalid and ending this detection operation;
[0027] If it is greater than or equal to two, screening out a first target contour group located within the contour area threshold range from all the contours;
[0028] Detecting whether the number of contours in the first target contour group is greater than or equal to two. If it is less than two, determining that the target image is invalid and ending this detection operation;
[0029] If it is greater than or equal to two, screening out a second target contour group located within the ratio threshold range between the contour area and the area of the circumscribed rectangle from the first target contour group;
[0030] Detecting whether the number of contours in the second target contour group is greater than or equal to two. If it is less than two, determining that the target image is invalid and ending this detection operation;
[0031] If it is greater than or equal to two, selecting two rectangular contours corresponding to the maximum and minimum abscissas from the second target contour group according to the size of the abscissa of the contour center point as the contours corresponding to the first positioning block and the second positioning block.
[0032] In some embodiments, performing image preprocessing to determine the validity of the detection line image and the quality control line image includes:
[0033] Obtain the contour information in the test line image and the quality control line image respectively, and construct a test line contour array and a quality control line contour array;
[0034] If the number of contours in the quality control line contour array is not zero, then according to the set contour width and height thresholds, remove the invalid contours in the test line contour array and the quality control line contour array;
[0035] Detect whether the number of remaining contours in the quality control line contour array is equal to one. If it is not equal to one, determine that the target image is invalid;
[0036] Detect whether the number of contours in the test line contour array is greater than one or equal to zero. If it is greater than one, determine that the target image is invalid; if it is equal to zero, output the result of this detection as negative.
[0037] In some embodiments, the feature extraction of the valid test line image and the quality control line image to obtain feature vectors includes:
[0038] Perform HSV color domain conversion and channel segmentation on the test line image and the quality control line image respectively, and extract the first feature values of the test line and the quality control line respectively, and the first feature difference between the test line and the quality control line from each obtained single-channel image;
[0039] Perform grayscale conversion on the test line image and the quality control line image respectively, and extract the second feature values of the test line and the quality control line respectively, and the second feature difference between the test line and the quality control line from the obtained grayscale images.
[0040] In a third aspect, an embodiment of the present application provides a colloidal gold test strip detection device, which is applied to the colloidal gold test strip, and the device includes:
[0041] An image acquisition module, configured to acquire a target image that completely contains the colloidal gold test strip to be tested;
[0042] A test strip positioning module, configured to perform positioning block positioning on the target image to obtain the position information of the first positioning block and the second positioning block;
[0043] A color development area extraction module, configured to obtain a color development area image where the color development area is located based on the position information of the positioning block;
[0044] An image preprocessing module, configured to divide the color development area image into a test line image and a quality control line image, and perform image preprocessing to determine the validity of the test line image and the quality control line image;
[0045] A feature extraction module, configured to extract features from the valid detection line image and the quality control line image to obtain feature vectors;
[0046] A prediction result display module, configured to receive and display the colloidal gold concentration prediction result obtained by classifying the feature vectors using a classification prediction model and returned by the cloud server.
[0047] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which when executed on a processor, implements the colloidal gold test strip detection method described above.
[0048] The embodiments of the present application have the following beneficial effects:
[0049] The colloidal gold test strip of the present application is printed with a first positioning block and a second positioning block on both sides of the color development area respectively, and automatic instant detection of the test strip is performed based on these two positioning blocks. The method includes: first, obtaining a target image completely containing the colloidal gold test strip to be tested; then, performing positioning of the positioning blocks to obtain the position information of the two positioning blocks; then, obtaining the color development area image based on this position information, and further obtaining the detection line image and the quality control line image; furthermore, performing image preprocessing to determine the validity of the target image, and obtaining the CT line image to extract the feature vectors of the detection line and the quality control line; finally, the cloud server uses a classification prediction model to obtain the detection result and return it. This solution enables users to automatically identify the accurate position of the colloidal gold test strip and obtain instant detection results using a mobile terminal with a camera with almost no increase in production cost, which is convenient and fast, and is conducive to popular detection and promotion. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] To more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.
[0051] Figure 1 Shows a schematic diagram of a colloidal gold test strip according to an embodiment of the present application;
[0052] Figure 2 Shows a first flowchart of the colloidal gold test strip detection method according to an embodiment of the present application;
[0053] Figure 3 Shows a second flowchart of the colloidal gold test strip detection method according to an embodiment of the present application;
[0054] Figure 4Shows the third flowchart of the colloidal gold test strip detection method according to the embodiments of the present application;
[0055] Figure 5 Shows the fourth flowchart of the colloidal gold test strip detection method according to the embodiments of the present application;
[0056] Figure 6 Shows the fifth flowchart of the colloidal gold test strip detection method according to the embodiments of the present application;
[0057] Figure 7 Shows an application scenario of the colloidal gold test strip detection method according to the embodiments of the present application;
[0058] Figure 8 Shows the detection result of the ovulation test strip obtained by using the method according to the embodiments of the present application;
[0059] Figure 9 Shows a structural schematic diagram of the colloidal gold test strip detection device according to the embodiments of the present application.
[0060] Main element symbol description:
[0061] 100 - Colloidal gold test strip detection device; 110 - Image acquisition module; 120 - Test strip positioning module; 130 - Color development area extraction module; 140 - Image preprocessing module; 150 - Feature extraction module; 160 - Prediction result display module. Detailed implementation manners
[0062] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments.
[0063] Generally, the components of the embodiments of the present application described and shown in the accompanying drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the claimed present application, but merely represents the selected embodiments of the present application. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative efforts belong to the scope of protection of the present application.
[0064] As used hereinafter, the terms "comprising", "having" and their cognates that may be used in various embodiments of the present application are only intended to indicate specific features, numbers, steps, operations, elements, components or combinations of the foregoing items, and should not be construed as precluding the existence or adding the possibility of one or more other features, numbers, steps, operations, elements, components or combinations of the foregoing items. In addition, the terms "first", "second", "third", etc. are only used for distinguishing descriptions and cannot be construed as indicating or implying relative importance.
[0065] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art to which various embodiments of the present application pertain. The terms (such as those defined in a commonly used dictionary) will be construed to have the same meaning as the contextual meaning in the relevant technical field and will not be construed to have an idealized meaning or an overly formal meaning unless clearly defined in various embodiments of the present application.
[0066] The following will describe in detail some embodiments of the present application in conjunction with the accompanying drawings. Without conflict, the following embodiments and the features in the embodiments may be combined with each other.
[0067] The present application provides a colloidal gold test strip and a detection method thereof. The colloidal gold test strip is provided with positioning blocks at both ends of a common strip-shaped colloidal gold test strip by means of a printing process, and then the positioning blocks are used to automatically and accurately identify the CT line in the colloidal gold test strip. In addition, it can also be used to identify the type of the colloidal gold test strip, so that when a user collects an image of the test strip to be detected, there is no need to use a fixed bottom plate for positioning, nor to analyze barcodes and two-dimensional code information for distinguishing the types of test strips, etc. Moreover, the production cost of the test strip is hardly increased by the printing method. Therefore, for both the manufacturers of colloidal gold test strips and the users of colloidal gold test strips, the convenience is greatly improved, especially the user experience can be improved, etc.
[0068] Exemplarily, the colloidal gold test strip of the present application mainly includes two positioning blocks, a color development area, a blotting paper, etc. Among them, the two positioning blocks are respectively denoted as a first positioning block and a second positioning block, and are both arranged on the colloidal gold test strip by means of a printing process; and the color development area is arranged between the first positioning block and the second positioning block. In the present application, the color development area refers to an area that includes a test line (T line) and a quality control line (C line) and presents a test result through the color change states of the two.
[0069] Regarding the position settings of the two positioning blocks, for example, in one embodiment, the first positioning block is arranged on the side of the test strip handle, that is, the end held by the user, and the second positioning block is arranged on the side of the blotting paper, such asFigure 1 As shown, at this time, the first positioning block is called the large-end positioning block P1, and the second positioning block is called the small-end positioning block P2.
[0070] It can be understood that the large-end positioning block P1 refers to the positioning block on the side of the test strip handle, and the small-end positioning block P2 refers to the positioning block on the side of the absorbent paper. The above "first" and "second" are only used to distinguish the two positioning blocks, and do not mean that the first positioning block is the large-end positioning block P1 and the second positioning block is the small-end positioning block P2, and vice versa.
[0071] It should be noted that the colors and size ratios of the first positioning block and the second positioning block of this application can be set according to the type of the colloidal gold test strip. It can be understood that there are many applicable scenarios for colloidal gold test strips, and there will be various corresponding types. For example, it can include but is not limited to ovulation test strips, early pregnancy test strips, urinary protein test strips, nucleic acid test strips, pesticide residue test strips, etc. Therefore, by setting the positioning block parameters with different colors and different size ratios, several types of colloidal gold test strips can be supported.
[0072] For example, when using a red positioning block, the colloidal gold test strip is an ovulation test strip; when using a blue positioning block, the colloidal gold test strip is an early pregnancy test strip, etc. This is just an example here. Further optionally, different classification prediction models can be trained for different types of colloidal gold test strips, such as the support vector machine SVC prediction model, etc.
[0073] The detection method of the above colloidal gold test strip will be described below with specific embodiments.
[0074] Figure 2 A flowchart of the colloidal gold test strip detection method according to an embodiment of the present application is shown. Exemplarily, the colloidal gold test strip detection method includes the following steps:
[0075] S110, obtain a target image completely containing the colloidal gold test strip to be tested.
[0076] It can be understood that the colloidal gold test strip to be tested refers to the test strip that has been dropped with the test sample and the reaction has been completed. By identifying the color development result of the CT line in the test strip, the test result can be obtained.
[0077] Exemplarily, when it is necessary to use a certain type of colloidal gold test strip for corresponding index detection, such as ovulation detection, nucleic acid detection, etc., the user can use a mobile terminal with a camera function such as a mobile phone, a tablet, or a watch to take pictures or video streams containing the colloidal gold test strip to be tested. Among them, when it is a video stream, multiple test strip pictures after the reaction is completed can be captured from it. It can be understood that when the user uses the mobile terminal to obtain the target image, it only needs to ensure that the test strip to be tested is presented within the set scanning interface for taking pictures.
[0078] It should be understood that the above complete inclusion means that it includes at least two positioning blocks, a detection line, a quality control line, and a background area in the colloidal gold test strip. Optionally, the obtained target image is converted into the Mat format of Opencv for subsequent positioning block positioning processing.
[0079] As an alternative solution, when scanning the test strip to be tested through a mobile terminal, the test strip to be tested should be completely presented within the scanning frame of the scanning interface. Among them, the size of the scanning frame can be set to be the same as the size of the region of interest (ROI), so that the coordinates of the ROI correspond to the coordinates of the scanning frame. In this way, the ROI coordinate parameters can be directly passed to the subsequent test strip positioning module. Since there is no excessive redundant background content, etc., the operation time can be reduced and the speed can be improved.
[0080] S120. Perform positioning block positioning on the target image to obtain the position information of the first positioning block and the second positioning block.
[0081] Exemplarily, after obtaining the target image, this embodiment will extract the position regions of the two positioning blocks from the target image. Preferably, the target image can be intercepted through the above ROI coordinate parameters to obtain the region of interest, and this region of interest is used as the object for positioning processing.
[0082] Among them, the above position information includes the coordinates of the first positioning block and the second positioning block in the target image. For example, it can be the coordinates of the four corner points, or the center point coordinates, or other key point coordinates, etc. There is no limitation here as long as the position of the positioning block can be described.
[0083] In one implementation, as Figure 3 shown, the above step S120 includes the following sub-steps:
[0084] S210. Obtain all contour information in the region of interest in the target image.
[0085] For example, the region of interest (ROI) image can be subjected to color domain conversion, such as from the RGB color space to the HSV color space, and then channel segmentation can be performed to obtain single-channel images of the H, S, and V components. For example, the S channel can be extracted separately, and the Otsu threshold method is used to perform binary processing on the S channel image to obtain the corresponding binary image. It can be understood that the H component and the S component represent color distance and can better reflect the numerical difference of colors.
[0086] Next, perform morphological operations on the above binary image, such as erosion, dilation, etc., to remove noise points in the image. It can be understood that if the size of the kernel for denoising is too small, the noise reduction effect is not obvious, and if it is too large, the image is prone to distortion. For example, here a kernel function with a size of 5*5 can be used for processing.
[0087] Finally, the contour search function can be used to search for the contours in the denoised binary image to obtain all the contours in the region of interest, including information such as the number and position of each contour.
[0088] Considering that the method of this application is fully automated for recognition and prediction, to ensure the accuracy and effectiveness of the detection results, in this application, the validity determination of the target image will be carried out in multiple stages, for example, the positioning block positioning stage, the color development area extraction stage, etc., to ensure that the final obtained detection results are from valid colloidal gold test strip pictures to be measured.
[0089] S220, Detect whether there are two rectangular contours within the threshold range among all the contours, and when they exist, determine the position coordinates of the positioning blocks corresponding to the two rectangular contours in the target image.
[0090] In one implementation, as Figure 4 shown, for the contour judgment in step S122, the following processing can be included:
[0091] S310, Detect whether the number of all contours is greater than or equal to two. If it is greater than or equal to two, execute step S312, and if it is less than two, execute step S322.
[0092] It can be understood that if the total number of contours is less than two, it means that the target image does not contain the contours of two positioning blocks. Therefore, it can be determined that the target image belongs to an invalid picture.
[0093] S312, If it is greater than or equal to two, filter out the first target contour group within the contour area threshold range from all the contours.
[0094] It can be understood that by comparing each contour with the set contour area threshold, some invalid contours that do not meet the area conditions can be removed, thereby improving the accuracy.
[0095] Among them, the above-mentioned contour area threshold can be set according to actual needs. For example, referring to the specification parameters of the colloidal gold test strip itself, in one implementation, in pixels, the minimum value of the contour area threshold can be 800 pixels, and the maximum value can be 20000 pixels, etc.
[0096] S314. Detect whether the number of contours in the first target contour group is greater than or equal to two. If it is greater than or equal to two, execute step S316; if it is less than two, execute step S322.
[0097] It can be understood that if the number of remaining contours obtained after contour area screening is less than two, it also indicates that the target image does not contain the contours of two positioning blocks. Therefore, it is determined that the target image belongs to an invalid picture.
[0098] S316. If it is greater than or equal to two, then screen out a second target contour group from the first target contour group that is within the ratio threshold range between the contour area and the area of the circumscribed rectangle.
[0099] Furthermore, to ensure that the contour is square, on the premise of tolerating a certain trapezoidal distortion, according to the set ratio threshold between the contour area and the area of the circumscribed rectangle, the rectangular contours among them are screened out. A square contour is a special type of rectangular contour.
[0100] Among them, the range of the ratio threshold between the contour area and the area of the circumscribed rectangle can be set according to actual needs. For example, referring to the specification parameters of the colloidal gold test strip itself, in one implementation, the minimum value of this ratio threshold is 0.65 and the maximum value is 1, etc.
[0101] S318. Detect whether the number of contours in the second target contour group is greater than or equal to two. If it is greater than or equal to two, execute step S320; if it is less than two, execute step S322.
[0102] S320. If it is greater than or equal to two, then select two rectangular contours corresponding to the maximum and minimum abscissas from the second target contour group according to the size of the abscissa of the contour center point, as the contours corresponding to the first positioning block and the second positioning block.
[0103] It can be understood that if it is greater than or equal to two in the second target contour group, it indicates that the contours of two positioning blocks are included. At this time, the contours can be sorted in ascending order of the abscissa X of the contour center point, and the two rectangular contours corresponding to the minimum and maximum coordinates are taken as the contours corresponding to the two positioning blocks.
[0104] S322. Determine that the target image is invalid and end this detection operation.
[0105] It can be understood that when it is determined that the target image is invalid, the subsequent detection operation will be ended to avoid obtaining invalid detection results by using an invalid image for detection. Further optionally, the user can be prompted to re - take a new image.
[0106] After obtaining the position information of the two rectangular contours through step S320, the method further includes:
[0107] S324. Determine whether the first positioning block and the second positioning block are large-end positioning blocks or small-end positioning blocks respectively by using the abscissa of the center point of the positioning block and the corresponding contour area.
[0108] Generally, the area of the large-end positioning block P1 is larger than that of the small-end positioning block P2. Thus, taking the position information of the center point coordinates as an example, if the contour area corresponding to the minimum abscissa X1 is larger than the contour area corresponding to the maximum abscissa X2, it indicates that the large-end positioning block P1 is on the left; otherwise, the large-end positioning block P1 is on the right.
[0109] Further, after obtaining the position information of the first positioning block and the second positioning block through step S120 and before acquiring the color display area image where the color display area is located, the method further includes:
[0110] According to the position information of each positioning block in the target image, calculate the edge gradient of the image area where each positioning block is located to determine whether the clarity of the target image meets the clarity condition, and when the clarity condition is met, acquire the color display area image where the color display area is located.
[0111] For example, the region image where the positioning block is located can be differentiated in the horizontal and vertical directions respectively through algorithms such as the Sobel edge detection algorithm to obtain the gradients in the two directions, and then compared with a preset clarity threshold to determine whether the clarity of the target image meets the requirements. For example, when it is lower than the clarity threshold, it is determined that the requirements are not met; when it is equal to or greater than the clarity threshold, it is determined that the requirements are met. Only when it is detected that the clarity condition is met, step S130 is executed. Among them, the algorithms used for edge detection may include but are not limited to the Laplacian operator detection algorithm, the Roberts operator detection algorithm, the canny edge detection algorithm, etc.
[0112] S130. Based on the position information of the positioning block, acquire the color display area image where the color display area is located.
[0113] Exemplarily, when intercepting the color display area image, it can be intercepted according to the coordinates of the four corner points of the color display area. Further optionally, on the basis of the coordinates of the four corner points, it can be moved a certain proportion (such as 5% of the pixel units, etc.) towards the center respectively to exclude the possibly contaminated color blocks at the edges.
[0114] As an alternative solution, the colloidal gold test strip detection method further includes:
[0115] According to the center point coordinates of the first positioning block and / or the second positioning block in the target image, select the RGB color values corresponding to the center point coordinates of the corresponding positioning block, and determine the color of the corresponding positioning block according to the magnitudes of the respective color components in the RGB color values.
[0116] Exemplarily, after obtaining the position information of the two positioning blocks, such as the center point coordinates as described above, the RGB color value at the center point coordinates of the positioning block can be further selected. If the corresponding value of the R component is greater than the G and B components, it indicates a red positioning block; if the G component is greater than the R and B components, it indicates a green positioning block; otherwise, it is a blue positioning block.
[0117] It should be noted that when selecting the color value, when the colors of the two positioning blocks are the same, the color value of one of the positioning blocks can also be selected. When selecting the color values of the two positioning blocks, one of them can be used to correct or calibrate the color of the other to identify the correct color of the positioning block. Further, the color of the positioning block is used to determine the type of the colloidal gold test strip, and then determine the classification prediction model corresponding to the type of the colloidal gold test strip, such as the support vector machine SVC model.
[0118] It can be understood that according to the pre-configuration in the cloud server, different positioning blocks correspond to different types of colloidal gold test strips, and further different types of colloidal gold test strips are associated with different machine learning classification prediction models or algorithms.
[0119] S140, divide the color development area image to obtain a test line image and a quality control line image, and perform image preprocessing to determine the effectiveness of the test line image and the quality control line image.
[0120] Taking the position information of the center point coordinates as an example, in one implementation, the color development area image can be bisected along the length direction of the colloidal gold test strip to obtain two segmented images. Then, one segmented image close to the large-end positioning block P1 is used as the quality control line image, and the other segmented image close to the small-end positioning block P2 is used as the test line image.
[0121] After obtaining the test line image and the quality control line image, image preprocessing will also be performed on them to be used for judging the validity of the picture, so as to ensure the accuracy of the test result. In one implementation, as Figure 5 shown, the image preprocessing process in step S140 includes the following sub-steps:
[0122] S410, respectively obtain the contour information in the test line image and the quality control line image, and construct a test line contour array and a quality control line contour array.
[0123] For example, when obtaining contour information, the obtained test line image and quality control line image can be converted from the RGB format to the HSV format, then channel segmentation is performed, and then reverse binarization processing is carried out to obtain the binarized images corresponding to the test line image and the quality control line image respectively. Further, contour searching is performed on the binarized images to obtain the respective contour information and generate corresponding contour arrays. Among them, the reverse binarization process is the opposite of the forward binarization, which is used to change the pixel values greater than the threshold to 0 and change the pixel values less than or equal to the threshold to the maximum value. For example, in one implementation, the following reverse binarization function can be used:
[0124]
[0125] In the formula, dst represents the reverse binarization function, maxValue represents the set maximum value; src(x, y) represents the pixel value at the coordinate (x, y); T represents the grayscale value threshold.
[0126] S412, check whether the number of contours in the quality control line contour array is zero. If it is not zero, then execute step S414; if it is zero, then execute step S422.
[0127] S414, if it is not zero, eliminate the invalid contours in the test line contour array and the quality control line contour array according to the set contour width and height thresholds. In theory, the heights of the quality control line image contour and the test line image contour should be consistent with the height of the test strip.
[0128] S416, check whether the number of the remaining contours in the quality control line contour array is equal to one. If it is equal to one, then execute step S418; if it is not equal to one, then execute step S422.
[0129] S418, check whether the number of contours in the test line contour array is greater than one or equal to zero. If it is greater than one, then execute step S422; if it is equal to zero, then execute step S420. Further, if it is neither greater than one nor equal to zero, it means the number is equal to one, and at this time, execute step S424.
[0130] S420, directly output the result of this detection as negative and end this detection operation. It can be understood that in the presence of a quality control line, if the test line does not appear, it is usually because the colloidal gold concentration is too low, so at this time, the detection result of the colloidal gold test strip can be determined to be negative.
[0131] S422, determine that the target image is invalid.
[0132] S424, determine that there is a unique contour in the test line contour array.
[0133] It can be understood that through the above series of detections, the validity of the target image can be further determined.
[0134] Finally, according to the only contour existing in the quality control line contour array and the circumscribed rectangles corresponding to the contours in the test line contour array, the test line (T line) image and the quality control line (C line) image, that is, the CT line image, are intercepted from the target image.
[0135] S150 Extract features from the valid test line image and quality control line image, obtain feature vectors and send them to the cloud server.
[0136] In this embodiment, the mobile terminal performs multi-dimensional feature extraction on the CT line image, and then sends the obtained multi-dimensional features to the cloud, so that the cloud server can use a pre-trained classification prediction model to predict the test results. It can be understood that due to production differences, the concentration of the quality control line is not always consistent. For example, the concentration and width of the test line sometimes exceed the concentration and width of the quality control line. Therefore, the positive and negative grades and concentrations of the colloidal gold test strip need to be comprehensively judged by multiple factors, such as including the test line concentration, the quality control line concentration, and the comparison of the test line and quality control line concentrations (which can be reflected in the color difference).
[0137] In one implementation, as Figure 6 shown, step S150 includes the following sub-steps:
[0138] S510 Convert the test line image and the quality control line image into the HSV color domain and perform channel segmentation respectively, and extract the respective first feature values of the test line and the quality control line, as well as the first feature difference between the test line and the quality control line, from each obtained single-channel image.
[0139] Exemplarily, the test line image and the quality control line image are respectively converted from the RGB format to the HSV format, and at the same time, channel segmentation is performed to obtain the three single-channel images of H, S, and V corresponding to the test line image and the quality control line image respectively, and then feature extraction is performed respectively. Further, the above-mentioned feature values between the two corresponding to the same single-channel image are subtracted from each other to obtain the first feature difference.
[0140] In one implementation, there are 36 first feature values for the test line and the quality control line. Specifically, for the test line, it includes the pixel mean value, variance, image maximum value and its position, and image minimum value and its position corresponding to the three single-channel images; for the quality control line, it includes the pixel mean value, variance, image maximum value and its position, and image minimum value and its position corresponding to the three single-channel images. And the first feature difference includes 6, specifically including: the pixel mean difference between the test line and the quality control line of the three single-channel images, and the variance difference between the test line and the quality control line.
[0141] S520, convert the test line image and the quality control line image into grayscale images respectively, and extract the respective second feature values of the test line and the quality control line, as well as the second feature difference between the test line and the quality control line from the obtained grayscale images.
[0142] Exemplarily, convert the test line image and the quality control line image from RGB format color images into grayscale images (Gray) respectively, and extract their respective second feature values from them. Further, subtract the above feature values between the two in the grayscale image to obtain the first feature difference.
[0143] In one implementation, there are a total of 12 second feature values for the test line and the quality control line. Specifically, for the test line, it includes the pixel mean, variance, maximum value of the image and its location, minimum value of the image and its location of the grayscale image; for the quality control line, it includes the pixel mean and variance of the grayscale image, maximum value of the image and its location, minimum value of the image and its location. Similarly, there are a total of 2 second feature differences, including the pixel mean difference and variance difference between the test line and the quality control line of the grayscale image.
[0144] Thus, all feature values are obtained and form a feature value vector. Furthermore, as Figure 7 shown, the mobile terminal converts the feature vector of the CT line image extracted from the target image into Json format and sends it to the cloud server for detection through an HTTP request.
[0145] S160, receive and display the colloidal gold concentration classification result obtained by classifying the feature vector using the classification prediction model returned by the cloud server.
[0146] Among them, the above classification prediction model may include but is not limited to being constructed based on the SVC classification algorithm. This classification prediction model acquires the feature values of the CT line and presets classification labels by collecting a large amount of sample data, and then trains the network constructed based on the SVC classification algorithm to obtain the above classification prediction model.
[0147] Exemplarily, the cloud server uses the corresponding classification prediction model to classify the colloidal gold concentration of the feature vector to obtain a semi-quantitative colloidal gold concentration classification result. For example, the support vector machine (SVC) model is used here. By inputting the feature value vector one by one, a semi-quantitative colloidal gold concentration classification is obtained. For multiple concentration results, a mode voting mechanism is adopted, and the concentration value with the most votes is used as the final result and returned to the user's mobile terminal for display.
[0148] Further optionally, when there are detection results of such colloidal gold test strips in different periods, overall trend analysis can also be performed to further predict the situation at future times, etc. For example, for an ovulation test strip similar to this, the customer's mobile terminal can display the LH concentration curve during the menstrual cycle through detection records, such as Figure 8 as shown.
[0149] It can be understood that since the classification prediction model of the present application adopts a large-scale machine learning algorithm and collects sample data under various environmental factors, including data of user mobile terminals in multi-light environments and several manufacturers, etc., it adapts to the impacts of light environment, sensor response, sensor image algorithm, liquid sample color, etc. on detection, and ensures the accuracy of detection, etc.
[0150] The colloidal gold test strip detection method of the present application is aimed at a colloidal gold test strip based on two positioning blocks set by printing. Without particularly increasing the production cost of the colloidal gold test strip, users can collect and perform positioning block positioning, extraction of CT line feature vectors, etc. through a camera in a mobile terminal such as a mobile phone. Then, the cloud server performs classification prediction of the colloidal gold concentration to obtain the detection result and return it to the mobile terminal. For users, the processing operation of the cloud server is imperceptible. Therefore, for users, they can quickly know the POCT detection result, improving the user experience.
[0151] Figure 9 Fig. shows a schematic structural diagram of a colloidal gold test strip detection device 100 according to an embodiment of the present application. Exemplarily, the colloidal gold test strip detection device 100 includes:
[0152] An image acquisition module 110, configured to acquire a target image including a complete colloidal gold test strip to be measured.
[0153] A test strip positioning module 120, configured to perform positioning block positioning on the target image to obtain the position information of the first positioning block and the second positioning block.
[0154] A color development area extraction module 130, configured to acquire a color development area image where the color development area is located based on the position information of the positioning block.
[0155] An image preprocessing module 140, configured to divide the color development area image into a test line image and a quality control line image, and perform image preprocessing to respectively determine the effectiveness of the test line image and the quality control line image.
[0156] A feature extraction module 150, configured to perform feature extraction on the effective test line image and quality control line image to obtain a feature vector and send it to the cloud server.
[0157] A prediction result display module 160, configured to receive and display the colloidal gold concentration prediction result obtained by classifying the feature vector using the classification prediction model and returned by the cloud server.
[0158] It can be understood that the device in this embodiment corresponds to the colloidal gold test strip detection method in the above embodiment. The optional items in the above embodiment are also applicable to this embodiment, so they will not be described repeatedly here.
[0159] This application also provides a user mobile terminal. For example, a smart phone, a tablet, a smart watch, etc. Exemplarily, the user mobile terminal includes a camera, a display screen, a processor, and a memory. Among them, the camera is used to collect a complete image of the colloidal gold test strip to be measured, the display screen is used to display the colloidal gold concentration prediction result, etc., the memory stores a computer program, and the processor runs the computer program to enable the user mobile terminal to execute the above colloidal gold test strip detection method or the functions of each module in the above colloidal gold test strip detection device.
[0160] Among them, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU), a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application.
[0161] The memory can be, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. Among them, the memory is used to store a computer program, and after receiving an execution instruction, the processor can execute the computer program accordingly.
[0162] The present application also provides a computer-readable storage medium for storing the computer program used in the above user mobile terminal.
[0163] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architectures, functions, and operations of the devices, methods, and computer program products according to multiple embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the block may occur in a different order from that marked in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the structure diagram and / or flowchart, as well as the combination of blocks in the structure diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0164] In addition, each functional module or unit in various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0165] If the above functions are implemented in the form of software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a smart phone, a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0166] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should all be covered by the protection scope of the present application.
Claims
1. A colloidal gold test strip, characterized in that, The colloidal gold test strip includes a first positioning block and a second positioning block arranged by a printing process, and a color development area is provided between the first positioning block and the second positioning block; wherein, the colors and size ratios of the first positioning block and the second positioning block are set according to the type of the colloidal gold test strip.
2. A colloidal gold test strip detection method, characterized in that, Applied to the colloidal gold test strip as described in claim 1, the method includes: Obtaining a target image that completely contains the colloidal gold test strip to be measured; Performing positioning block positioning on the target image to obtain the position information of the first positioning block and the second positioning block; Based on the position information of the positioning blocks, obtaining a color development area image where the color development area is located; Dividing the color development area image to obtain a test line image and a quality control line image, and performing image preprocessing to determine the effectiveness of the test line image and the quality control line image; Performing feature extraction on the effective test line image and quality control line image to obtain feature vectors and sending them to the cloud server; Receiving and displaying the colloidal gold concentration prediction result obtained by classifying the feature vectors using a classification prediction model returned by the cloud server.
3. The method according to claim 2, wherein The position information includes the center point coordinates of the first positioning block and the second positioning block in the target image. After obtaining the position information of the two positioning blocks in the target image, it further includes: Using the abscissa in the center point coordinates and the corresponding contour area to respectively determine whether the first positioning block and the second positioning block are large-end positioning blocks or small-end positioning blocks; The dividing the color development area image to obtain a test line image and a quality control line image includes: Bisecting the color development area image along the length direction of the colloidal gold test strip to obtain two segmented images, taking the segmented image close to the large-end positioning block as the quality control line image, and taking the other segmented image close to the small-end positioning block as the test line image.
4. The method according to claim 3, characterized in that It further includes: According to the center point coordinates of the first positioning block and / or the second positioning block in the target image, selecting the RGB color value of the center point coordinates of the corresponding positioning block, and determining the color of the corresponding positioning block according to the magnitudes of the respective color components in the RGB color value; Wherein, the color of the corresponding positioning block is used to determine the type of the colloidal gold test strip, and further determine the classification prediction model corresponding to the type of the colloidal gold test strip.
5. The method according to claim 2 or 3, characterized in that, The performing positioning on the first positioning block and the second positioning block in the target image to obtain the position information of the first positioning block and the second positioning block includes: Obtaining all contour information in the region of interest in the target image; Detecting whether there are two rectangular contours that meet the threshold range among all the contours, and when they exist, determining the position coordinates of the positioning blocks corresponding to the two rectangular contours in the target image; After obtaining the position information of the first positioning block and the second positioning block, it further includes: According to the position information of each positioning block in the target image, the edge gradient of the image in the area where each positioning block is located is calculated to determine whether the clarity of the target image meets the clarity condition, and when the clarity condition is met, the color development area image where the color development area is located is obtained.
6. The method according to claim 5, characterized in that, The step of detecting whether there are two rectangular contours that meet the threshold range among all contours includes: Check whether the number of all contours is greater than or equal to two. If it is less than two, determine that the target image is invalid and end this detection operation; If it is greater than or equal to two, then a first target contour group within the contour area threshold range is obtained by screening from all contours; Detecting whether the number of contours in the first target contour group is greater than or equal to two, if less than two, determining that the target image is invalid, and ending this detection operation; If it is greater than or equal to two, then filtering out from the first target contour group a second target contour group that is within a threshold range of the ratio between the contour area and the circumscribed rectangle area; Detecting whether the number of contours in the second target contour group is greater than or equal to two, and if less than two, determining that the target image is invalid, and terminating the current detection operation; If it is greater than or equal to two, two rectangular contours corresponding to the maximum and minimum horizontal coordinates are selected from the second target contour group according to the size of the horizontal coordinate of the contour center point to serve as contours corresponding to the first positioning block and the second positioning block.
7. The method according to claim 2, characterized in that The image preprocessing to determine the validity of the detection line image and the quality control line image includes: Respectively acquiring contour information in the detection line image and the quality control line image, and constructing a detection line contour array and a quality control line contour array; If the number of contours in the quality control line contour array is not zero, then according to the set contour width and height thresholds, invalid contours in the detection line contour array and the quality control line contour array are eliminated; Detecting whether the number of remaining contours in the quality control line contour array is equal to one, and if not equal to one, determining that the target image is invalid; Check whether the number of contours in the detection line contour array is greater than one or equal to zero. If it is greater than one, determine that the target image is invalid; if it is equal to zero, output the detection result as negative.
8. The method according to claim 2, wherein The extracting features of the effective detection line image and the quality control line image to obtain a feature vector includes: Performing HSV color domain conversion and channel segmentation on the detection line image and the quality control line image, respectively, and extracting first characteristic values of the detection line and the quality control line, respectively, and first characteristic difference values between the detection line and the quality control line from each obtained single-channel image; The detection line image and the quality control line image are respectively converted into grayscale images, and the second characteristic values of the detection line and the quality control line, and the second characteristic difference between the detection line and the quality control line are respectively extracted from the obtained grayscale images.
9. A colloidal gold test strip detection device, characterized in that, Applied to the colloidal gold test paper as claimed in claim 1, the device comprises: An image acquisition module is used to acquire a target image that completely contains the colloidal gold test paper to be tested; The test strip positioning module is used to perform positioning block positioning on the target image to obtain the position information of the first positioning block and the second positioning block; The color development area extraction module is used to obtain the color development area image where the color development area is located based on the position information of the positioning block; The image preprocessing module is used to divide the color development area image into a test line image and a quality control line image, and perform image preprocessing to determine the effectiveness of the test line image and the quality control line image; The feature extraction module is used to extract features from the effective test line image and quality control line image to obtain feature vectors; The prediction result display module is used to receive and display the colloidal gold concentration prediction result obtained by classifying the feature vectors using the classification prediction model returned by the cloud server.
10. A computer-readable storage medium, characterized in that, It stores a computer program, and when the computer program is executed on a processor, it implements the colloidal gold test strip detection method according to any one of claims 2-8.
Citation Information
Cited By
Test paper type identification and switching method and system based on dual-mode interpretation and medium
CN121214120A
Test strip type identification and switching method, system, and medium based on dual-mode interpretation
CN121214120B
Test strip detection method and device, electronic equipment and storage medium
CN121275745A