Image analysis device for urine testing
By using HSV color space and domain division methods in urine detection equipment, the problems of low efficiency and insufficient accuracy of traditional urine detection methods are solved, and the accurate analysis of the color characteristics of urine samples and the reliability of detection results are achieved.
Patent Information
- Application Number
- CN202411289561.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2044-09-14
AI Technical Summary
Traditional urine detection methods are inefficient and are susceptible to subjective factors. The existing urine image analysis technology still has room for improvement in accuracy, accuracy and comprehensiveness, and it is difficult to meet the growing medical testing needs.
Design a urine detection image analysis device to acquire high-definition images through the image acquisition unit, and the data processing unit converts the image from the RGB color space to the HSV color space, extracts and calculates the mean and standard deviation of the H, S, and V values of pixel points , and by creating a hue domain, saturation domain, and brightness domain, calculate the absolute value and standard deviation of the difference, divide the domains and calculate the proportion, and determine whether the urine sample is abnormal.
Accurate quantification and comprehensive analysis of the color characteristics of urine samples is achieved, the accuracy and reliability of detection is improved, and the status of urine samples can be evaluated from multiple dimensions, providing intuitive detection results.
Smart Images

Figure CN118799330B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image analysis, and in particular to an image analysis device for urine detection. Background Art
[0002] Urine testing is an important part of medical diagnosis and is of great significance for disease screening, diagnosis and treatment monitoring. Traditional urine testing methods usually rely on manual observation and chemical analysis, which is not only inefficient but also easily affected by subjective factors, resulting in certain limitations in the accuracy and reliability of the test results.
[0003] With the continuous development of image processing technology and computer technology, the use of image analysis for urine testing has become a new research direction. However, the current urine image analysis technology still needs to be improved in terms of precision, accuracy and comprehensiveness. For example, in terms of color analysis, there is a lack of sophisticated algorithms to accurately determine whether urine samples are abnormal, which makes it difficult to meet the growing demand for medical testing. Therefore, it is of great practical significance to develop a more accurate, efficient and comprehensive urine testing image analysis device. Summary of the invention
[0004] The purpose of the present invention is to provide an image analysis device for urine detection, which solves the technical problems raised in the background technology.
[0005] The purpose of the present invention can be achieved through the following technical solutions:
[0006] An image analysis device for urine testing, comprising:
[0007] An image acquisition unit, used to obtain a high-definition image of the urine sample;
[0008] A data processing unit is used to convert the high-definition image from the RGB color space to the HSV color space, and extract the H, S and V values corresponding to each pixel point from the high-definition image, and then calculate the mean and standard deviation of the H values, S values and V values corresponding to all pixels in the high-definition image;
[0009] A data analysis unit is used to perform abnormality analysis on the high-definition image corresponding to the urine sample according to the processing result of the data processing unit, in which the hue domain, saturation domain, and brightness domain are created with any pixel point as the reference point, and the absolute value of the difference corresponding to the H value, S value, and V value of the adjacent pixel point and the reference point is calculated and compared with the standard deviation to determine whether to be included in the hue domain, saturation domain, and brightness domain, and so on to divide all pixel points into corresponding domains, determine the number of each domain and the number of pixels therein, calculate the proportion of the number of pixels in each domain in the total number of pixels, compare with the preset proportion threshold, and determine whether the urine sample has an abnormality;
[0010] Among them, if at least e corresponding proportions of hue, saturation or brightness are greater than the proportion threshold, the urine sample color is judged to be abnormal, otherwise, it is normal;
[0011] The result output unit is used to display the determination result of the data analysis unit to the user.
[0012] As a further solution of the present invention: the data processing unit is further used to record the values of H, S and V corresponding to each pixel as H i , S i and V i , i=1, 2, ...n, n represents the number of all pixels in the high-definition image. At the same time, the means of the H values, S values and V values corresponding to all pixels in the high-definition image are marked as Hp, Sp and Vp respectively, and the standard deviations of the H values, S values and V values corresponding to all pixels in the high-definition image are marked as HB, SB and VB respectively.
[0013] As a further solution of the present invention: the abnormality analysis method is as follows:
[0014] Step T1, initial reference point and domain creation and adjacent pixel value extraction, specifically:
[0015] Among all the pixels corresponding to the high-definition image, any pixel is used as a reference point, and a hue domain, a saturation domain, and a brightness domain are created based on the reference point;
[0016] Then, all pixel points adjacent to the reference point are obtained, and the corresponding H value, S value and V value are extracted from each of the adjacent pixel points;
[0017] Step T2, calculate and compare the hue difference of adjacent pixels, specifically:
[0018] Select an adjacent pixel;
[0019] Calculate the absolute value of the difference between the H value of the reference point and the H value of the adjacent pixel point, and mark it as HC;
[0020] Then the absolute value of the difference HC and H i The corresponding standard deviation HB is compared;
[0021] If HC≤HB, it means that the hue difference between the reference point and the adjacent pixel is small, and the adjacent pixel is included in the hue domain corresponding to the reference point;
[0022] If HC>HB, it means that the hue difference between the reference point and the adjacent pixel is large, and the adjacent pixel is not included in the hue domain corresponding to the reference point;
[0023] Step T3, determine whether all adjacent pixels are in the hue domain, specifically:
[0024] According to the method of Step T2, the absolute values of the H value differences of all the pixels adjacent to the reference point are calculated respectively, and according to the absolute values and standard deviations of the corresponding differences, it is determined whether the adjacent pixels are in the hue domain;
[0025] Step T4: Determine the adjacent pixels of the pixel in the domain as the new reference point, specifically:
[0026] According to the above method, other pixel points in the hue domain are respectively used as reference points, and then the corresponding adjacent pixel points are obtained, and it is determined whether the corresponding adjacent pixel points are in the hue domain where the reference point is located according to the method of Step T2 and Step T3;
[0027] Step T5: Create a new domain for pixels that are not in the original color domain. Specifically:
[0028] When a pixel point does not exist in the hue domain corresponding to the reference point, a hue domain is created with the pixel point, and the hue domain is divided in the above manner;
[0029] Step T6: Complete the high-definition image hue domain division and related data marking, specifically:
[0030] According to Step T2 and Step T5, all pixels in the high-definition image are divided into corresponding hue domains, and the number of hue domains in the high-definition image and the number of corresponding pixels in each hue domain are determined, and they are marked as HL and HX respectively. j1 , j1=1, 2, ... HL;
[0031] Step T7, determine the division of saturation domain and brightness domain and data marking, specifically:
[0032] According to Step T2 and Step T6, determine the number of divisions of the saturation domain and the brightness domain in the high-definition image, and mark them as SL and VL respectively, and the number of corresponding pixels in each saturation domain and each brightness domain, and mark them as SX respectively. j2 and VX j3 , j2=1, 2,...SL, j3=1, 2,...VL;
[0033] Step T8, calculate the proportion of pixels in each domain in the total pixels, specifically:
[0034] Get the number of all pixels in the high-definition image and record it as K;
[0035] Then calculate the HX corresponding to each hue domain, saturation domain and each brightness domain respectively j1 SX j2 and VX j3 The proportion of HZ in K j1 , SZ j2 and VZ j3 ;
[0036] Step T9, determine whether the color of the urine sample is abnormal based on the comparison between the proportion and the threshold, specifically:
[0037] All HZ j1 , SZ j2 and VZ j3 ; Compare with the preset proportion thresholds HZy, SZy and VZy corresponding to hue, saturation and brightness respectively:
[0038] If the high-definition image contains at least e HZ j1 >HZy or contains at least e SZ j1 > SZy or at least contains e VZ j1 >VZy, the color of the urine sample is judged to be abnormal, otherwise the color of the urine sample is judged to be normal;
[0039] Wherein, e is a preset value, and e is an integer value greater than 1.
[0040] As a further solution of the present invention: the hue domain is represented by the difference of the hue corresponding to each adjacent pixel in a continuous piece of pixels being within a set range;
[0041] The saturation domain is represented by the difference in saturation between adjacent pixels in a continuous piece of pixels within a set range;
[0042] The brightness domain is represented by the brightness difference of each adjacent pixel in a continuous piece of pixels being within a set range.
[0043] As a further solution of the present invention: wherein, when the absolute value of the difference between the corresponding H values of an adjacent pixel point and a reference point is greater than the standard deviation, but the absolute value of the difference between the pixel point and another pixel point indirectly adjacent to the reference point is less than or equal to the standard deviation, it is determined that the pixel point also exists in the hue domain corresponding to the reference point.
[0044] As a further solution of the present invention: the abnormality analysis method is also as follows:
[0045] First, through the formula: , calculate the color intensity judgment value YP of the high-definition image;
[0046] In the formula, β H , βS , β V H i , S i and V i Corresponding to the preset weight value;
[0047] Then the color intensity determination value YP is compared with the preset normal urine color range [Y min ,Y max ] to compare and determine whether the color is abnormal;
[0048] Among them, Y min Expressed as the minimum value of the normal urine transparency range, Y max Expressed as the maximum value of the normal urine clarity range;
[0049] If YP∈[Y min ,Y max ], the color of the urine sample is judged to be normal; otherwise, the color of the urine sample is judged to be abnormal.
[0050] As a further solution of the present invention: a specific light source and a light sensor are provided in the image acquisition unit, and the light sensor is used to measure the incident light intensity of the light source and the light intensity of the urine sample, which are then marked as G and in and G out .
[0051] As a further solution of the present invention: the data analysis unit is provided by the formula TG=G out / G in The transparency TG of the urine sample is calculated;
[0052] Then the transparency TG of the urine sample is compared with the preset normal urine transparency range [T min ,T max ] for comparison:
[0053] Among them, T min Expressed as the minimum value of the normal urine transparency range, T max Expressed as the maximum value of the normal urine clarity range;
[0054] If TG∈[T min ,T max ], the transparency of the urine sample is judged to be normal; otherwise, the transparency of the urine sample is judged to be abnormal.
[0055] Beneficial effects of the present invention:
[0056] The present invention, by being able to capture high-definition images of urine samples, provides a high-quality data basis for subsequent accurate analysis.
[0057] The present invention realizes accurate quantification of the color features of urine images by converting images from RGB color space to HSV color space and extracting and calculating the mean and standard deviation of H, S and V values of each pixel.
[0058] The present invention adopts an innovative division and analysis method of the hue domain, saturation domain and brightness domain, which can comprehensively and carefully analyze the color distribution and difference of the urine sample image, thereby accurately determining whether the color of the urine sample is abnormal.
[0059] The present invention combines the calculation of the color intensity determination value and the comparison with the preset normal range, as well as the measurement and judgment of the transparency of the urine sample, to evaluate the status of the urine sample from multiple dimensions, thereby improving the accuracy and reliability of the detection.
[0060] The present invention finally displays the determination result to the user through the result output unit, so that the user can intuitively and clearly understand the detection status of the urine sample. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] The present invention will be further described below in conjunction with the accompanying drawings.
[0062] Figure 1 It is a system block diagram of an image analysis device for urine detection according to the present invention.
[0063] Figure 2 It is a flow chart of a data analysis unit in an image analysis device for urine detection according to the present invention. DETAILED DESCRIPTION
[0064] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. 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 creative work are within the scope of protection of the present invention.
[0065] Embodiment 1
[0066] See also Figure 1 and Figure 2 As shown, the present invention is an image analysis device for urine detection, comprising:
[0067] An image acquisition unit, used to obtain a high-definition image of the urine sample;
[0068] Data processing unit, used for pre-processing high-definition images;
[0069] StepA1, convert the high-definition image from RGB color space to HSV color space;
[0070] Among them, the RGB color space defines colors by the intensity values of red R, green G, and blue B. The value range of each color channel is usually 0 to 255; the HSV color space describes colors by hue H, saturation S, and lightness V;
[0071] In this embodiment, the high-definition image is converted from the RGB color space to the HSV color space by:
[0072] SD1. Taking a pixel in a high-definition image as an example, obtain the R value, G value, and B value of the pixel;
[0073] SD2, through C1=max(R, G, B), get the maximum value from the R value, G value, and B value of the pixel point, and record it as C1;
[0074] SD3, through C2=min(R, G, B), get the minimum value from the R value, G value, and B value of the pixel point, and record it as C2;
[0075] SD4, V=C1;
[0076] SD5, when the value of V is 0, S=0;
[0077] When the value of V is not 0, S = (C1-C2) / C1;
[0078] SD6, when C1=C2, H=0;
[0079] When C1=R, H=60°×[0+(GB) / (C1-C2)];
[0080] When C1=G, H=60°×[2+(BR) / (C1-C2)];
[0081] When C1=B, H=60°×[4+(RG) / (C1-C2)];
[0082] When the result value of H is greater than 360°, H-360° is used as the H value of the pixel after conversion in the HSV color space;
[0083] Step A2: Extract the H, S, and V values corresponding to each pixel in the high-definition image and record them as H, S, and V, respectively. i , S i and V i , i=1, 2, ... n, n represents the number of all pixels in the high-definition image;
[0084] StepA3, calculate all H i , S i and V iThe corresponding means are marked as Hp, Sp and Vp respectively;
[0085] In this embodiment,
[0086] , , ;
[0087] StepA4, combine Hp, Sp and Vp to calculate all H i , S i and V i The corresponding standard deviations are labeled HB, SB, and VB respectively;
[0088] In this embodiment,
[0089] , , ;
[0090] A data analysis unit, used for performing abnormal analysis on the pre-processed high-definition images;
[0091] The exception analysis method is as follows:
[0092] Step T1. Among all the pixels corresponding to the high-definition image, take any pixel as a reference point, and create a hue domain, a saturation domain, and a brightness domain based on the reference point;
[0093] The hue domain is represented by the difference in hue between adjacent pixels in a continuous piece of pixels within a set range;
[0094] The saturation domain is represented by the difference in saturation between adjacent pixels in a continuous piece of pixels within a set range;
[0095] The brightness domain is represented by the brightness difference of each adjacent pixel in a continuous piece of pixels within a set range;
[0096] Then, all pixel points adjacent to the reference point are obtained, and the corresponding H value, S value and V value are extracted from each of the adjacent pixel points;
[0097] Step T2, select an adjacent pixel;
[0098] Calculate the absolute value of the difference between the H value of the reference point and the H value of the adjacent pixel point, and mark it as HC;
[0099] Then the absolute value of the difference HC and H i The corresponding standard deviation HB is compared;
[0100] If HC≤HB, it means that the hue difference between the reference point and the adjacent pixel is small, and the adjacent pixel is included in the hue domain corresponding to the reference point;
[0101] If HC>HB, it means that the hue difference between the reference point and the adjacent pixel is large, and the adjacent pixel is not included in the hue domain corresponding to the reference point;
[0102] Step T3, according to the method of Step T2, calculate the absolute value of the difference of the H value corresponding to all the pixels adjacent to the reference point, and determine whether the adjacent pixel is in the hue domain according to the absolute value and standard deviation of the corresponding difference;
[0103] Step T4, according to the above method, other pixel points in the hue domain are respectively used as reference points, and then the corresponding adjacent pixel points are obtained, and according to the method of Step T2 and Step T3, it is determined whether the corresponding adjacent pixel points are in the hue domain where the reference point is located;
[0104] When the absolute value of the difference between the corresponding H values of an adjacent pixel and the reference point is greater than the standard deviation, but the absolute value of the difference between the pixel and another pixel indirectly adjacent to the reference point is less than or equal to the standard deviation, it is determined that the pixel also exists in the hue domain corresponding to the reference point;
[0105] In this embodiment, if there are 9 pixels and they are displayed in a nine-square grid, a pixel in the middle of the nine-square grid is used as a reference point, and the pixels located just above, just below, just to the left, and just to the right of the reference point are the adjacent pixels of the reference point, while the pixels located at the upper left, lower left, upper right, and lower right of the reference point are not the adjacent pixels of the reference point.
[0106] When the absolute value of the difference between the H value of the adjacent pixel point located to the left of the reference point and the corresponding H value of the reference point is greater than the standard deviation;
[0107] The pixel located directly above the reference point is determined to be in the same hue domain as the reference point, and the pixel located to the upper left of the reference point is determined to be in the same hue domain as the reference point by comparing it with the pixel located directly above the reference point.
[0108] Then the pixel located at the upper left position of the reference point is judged against the pixel located at the left position of the reference point, and if the absolute value of the difference between the corresponding H values is less than or equal to the standard deviation, it is judged that the adjacent pixel located at the left position of the reference point is in the same hue domain as the reference point;
[0109] Step T5, when a pixel point does not exist in the hue domain corresponding to the reference point, a hue domain is created with the pixel point, and the hue domain is divided according to the above method;
[0110] Step T6: According to the method of Step T2 and Step T5, all the pixels in the high-definition image are divided into corresponding hue domains, and the number of hue domains in the high-definition image and the number of corresponding pixels in each hue domain are determined, and they are marked as HL and HX respectively. j1 , j1=1, 2, ... HL;
[0111] Step T7: According to Step T2 and Step T6, determine the number of divisions of the saturation domain and the brightness domain in the high-definition image, and mark them as SL and VL respectively, and the number of corresponding pixels in each saturation domain and each brightness domain, and mark them as SX respectively. j2 and VX j3 , j2=1, 2,...SL, j3=1, 2,...VL;
[0112] Step T8, obtain the number of all pixels in the high-definition image and record it as K;
[0113] Then calculate the HX corresponding to each hue domain, saturation domain and each brightness domain respectively j1 SX j2 and VX j3 The proportion of HZ in K j1 , SZ j2 and VZ j3 ;
[0114] StepT9, all HZ j1 , SZ j2 and VZ j3 ; Compare with the preset proportion thresholds HZy, SZy and VZy corresponding to hue, saturation and brightness respectively:
[0115] If the high-definition image contains at least e HZ j1 >HZy or contains at least e SZ j1 > SZy or at least contains e VZ j1 >VZy, the color of the urine sample is judged to be abnormal, otherwise the color of the urine sample is judged to be normal;
[0116] Wherein, e is a preset value, and e is an integer value greater than 1.
[0117] The result output unit is used to present the analysis results to the user in an intuitive form.
[0118] This embodiment can convert the high-definition image of the urine sample from the RGB color space to the HSV color space, and more accurately describe and analyze the color features; by creating the hue domain, saturation domain and lightness domain, and based on the comparison of the absolute value of the difference between the pixel points and the standard deviation, the high-definition image is analyzed for abnormalities, so as to accurately determine whether the color of the urine sample is abnormal; the analysis results are presented to the user in an intuitive form, so that the user can quickly obtain and understand the test results.
[0119] Embodiment 2
[0120] As the second embodiment of the present invention, when the present application is implemented, compared with the first embodiment, the technical solution of the present embodiment is different from that of the first embodiment only in that:
[0121] The data processing unit converts the high-definition image from the RGB color space to the HSV color space, and extracts the H, S, and V values corresponding to each pixel point from the high-definition image, and records them as H i , S i and V i , i=1, 2, ... n;
[0122] The abnormal analysis method of the data analysis unit is also as follows:
[0123] First, through the formula: , calculate the color intensity judgment value YP of the high-definition image;
[0124] In the formula, β H , β S , β V H i , S i and V i Corresponding to the preset weight value;
[0125] Then the color intensity determination value YP is compared with the preset normal urine color range [Y min ,Y max ] to compare and determine whether the color is abnormal;
[0126] Among them, Y min Expressed as the minimum value of the normal urine transparency range, Y max Expressed as the maximum value of the normal urine clarity range;
[0127] If YP∈[Y min ,Y max ], the color of the urine sample is judged to be normal; otherwise, the color of the urine sample is judged to be abnormal;
[0128] The result output unit presents the analysis results to the user in an intuitive form;
[0129] Among them, the normal urine color range is obtained in the following way: a large number of high-definition images corresponding to normal urine samples are collected by the image acquisition unit, and then the color intensity judgment value of each normal urine sample is calculated by the data analysis unit, and then a maximum value and a minimum value of the color intensity judgment value are selected from the color intensity judgment values of all normal urine samples to form a normal urine color range.
[0130] In addition to the color space conversion and abnormality analysis method of Example 1, this embodiment adds a method of determining whether the color is abnormal by calculating the color intensity determination value YP and comparing it with a preset normal urine color range, providing another angle and basis for determining abnormal urine color; the introduction of preset weight values distinguishes the importance of different color features, thereby improving the accuracy and pertinence of the judgment.
[0131] Embodiment 3
[0132] As the third embodiment of the present invention, when the present application is implemented, compared with the first and second embodiments, the technical solution of this embodiment is to combine the solutions of the first and second embodiments, and the difference between the technical solution of this embodiment and the first and second embodiments is only in this embodiment;
[0133] The image acquisition unit is provided with a specific light source and a light sensor, and the light sensor is used to measure the incident light intensity of the light source and the light intensity of the urine sample, which are then marked as G and in and G out ;
[0134] The data analysis unit is calculated by the formula TG=G out / G in The transparency TG of the urine sample is calculated;
[0135] Then the transparency TG of the urine sample is compared with the preset normal urine transparency range [T min ,T max ] for comparison:
[0136] Among them, T min Expressed as the minimum value of the normal urine transparency range, T max Expressed as the maximum value of the normal urine clarity range;
[0137] If TG∈[T min ,T max ], the transparency of the urine sample is judged to be normal; otherwise, the transparency of the urine sample is judged to be abnormal;
[0138] The result output unit presents the analysis results to the user in an intuitive form;
[0139] Among them, the normal urine transparency range is obtained in the following way: the incident light intensity and the light intensity transmitted through the normal urine samples corresponding to a large number of normal urine samples are collected by the image acquisition unit, and then the transparency of each normal urine sample is calculated by the data analysis unit, and then a maximum value and a minimum value of transparency are selected from the transparency of all normal urine samples to form a normal urine transparency range.
[0140] In this embodiment, a specific light source and a light sensor are set in the image acquisition unit, which can measure the transparency of the urine sample; by calculating the transparency TG and comparing it with the pre-set normal urine transparency range, it is determined whether the transparency of the urine sample is normal, which provides more dimensional information for the detection of urine samples.
[0141] Embodiment 4
[0142] As the fourth embodiment of the present invention, when the present application is specifically implemented, compared with the first, second and third embodiments, the technical solution of this embodiment is to combine and implement the solutions of the above-mentioned first, second and third embodiments.
[0143] This embodiment integrates all the technical solutions of Embodiment 1, Embodiment 2 and Embodiment 3, and realizes comprehensive, integrated and accurate detection and analysis of the color and transparency of urine samples; it can judge the quality of urine samples from multiple angles and indicators, and improves the accuracy and reliability of detection; it presents comprehensive test results in an intuitive form, and provides users with richer, clearer and easier to understand information.
[0144] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters and thresholds in the formula are set by technicians in this field according to actual conditions.
[0145] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. An image analysis device for urine detection, characterized in that: include: An image acquisition unit, used to obtain a high-definition image of the urine sample; A data processing unit is used to convert the high-definition image from the RGB color space to the HSV color space, and extract the H, S and V values corresponding to each pixel point from the high-definition image, and then calculate the mean and standard deviation of the H values, S values and V values corresponding to all pixels in the high-definition image; A data analysis unit is used to perform abnormality analysis on the high-definition image corresponding to the urine sample according to the processing result of the data processing unit, in which the hue domain, saturation domain, and brightness domain are created with any pixel point as the reference point, and the absolute value of the difference corresponding to the H value, S value, and V value of the adjacent pixel point and the reference point is calculated and compared with the standard deviation to determine whether to be included in the hue domain, saturation domain, and brightness domain, and so on to divide all pixel points into corresponding domains, determine the number of each domain and the number of pixels therein, calculate the proportion of the number of pixels in each domain in the total number of pixels, compare with the preset proportion threshold, and determine whether the urine sample has an abnormality; Among them, the total number of pixels is the number of all pixels in the high-definition image; The hue domain is represented by the difference in hue between adjacent pixels in a continuous piece of pixels within a set range; The saturation domain is represented by the difference in saturation between adjacent pixels in a continuous piece of pixels within a set range; The brightness domain is represented by the brightness difference of each adjacent pixel in a continuous piece of pixels within a set range; If at least e hues, saturations or brightness have a corresponding proportion greater than the proportion threshold, the urine sample is judged to have an abnormal color, otherwise, it is normal; The result output unit is used to display the determination result of the data analysis unit to the user.
2. The image analysis device for urine detection according to claim 1, characterized in that: The data processing unit is also used to record the values of H, S and V corresponding to each pixel as H i , S i and V i , i=1, 2, ...n, n represents the number of all pixels in the high-definition image. At the same time, the means of the H values, S values and V values corresponding to all pixels in the high-definition image are marked as Hp, Sp and Vp respectively, and the standard deviations of the H values, S values and V values corresponding to all pixels in the high-definition image are marked as HB, SB and VB respectively.
3. The image analysis device for urine detection according to claim 2, characterized in that: The exception analysis method is as follows: Step T1. Among all the pixels corresponding to the high-definition image, take any pixel as a reference point, and create a hue domain, a saturation domain, and a brightness domain based on the reference point; Then, all pixel points adjacent to the reference point are obtained, and the corresponding H value, S value and V value are extracted from each of the adjacent pixel points; Step T2, select an adjacent pixel; Calculate the absolute value of the difference between the H value of the reference point and the H value of the adjacent pixel point, and mark it as HC; Then the absolute value of the difference HC and H i The corresponding standard deviation HB is compared; If HC≤HB, the adjacent pixel point is included in the hue domain corresponding to the reference point; otherwise, the adjacent pixel point is not included in the hue domain corresponding to the reference point; Step T3, according to the method of Step T2, calculate the absolute value of the difference of the H value corresponding to all the pixels adjacent to the reference point, and determine whether the adjacent pixel is in the hue domain according to the absolute value and standard deviation of the corresponding difference; Step T4, according to the above method, other pixel points in the hue domain are respectively used as reference points, and then the corresponding adjacent pixel points are obtained, and according to the method of Step T2 and Step T3, it is determined whether the corresponding adjacent pixel points are in the hue domain where the reference point is located; Step T5, when a pixel point does not exist in the hue domain corresponding to the reference point, a hue domain is created with the pixel point, and the hue domain is divided according to the above method; Step T6: According to the method of Step T2 and Step T5, all the pixels in the high-definition image are divided into corresponding hue domains, and the number of hue domains in the high-definition image and the number of corresponding pixels in each hue domain are determined, and they are marked as HL and HX respectively. j1 , j1=1, 2, ... HL; Step T7: According to Step T2 and Step T6, determine the number of divisions of the saturation domain and the brightness domain in the high-definition image, and mark them as SL and VL respectively, and the number of corresponding pixels in each saturation domain and each brightness domain, and mark them as SX respectively. j2 and VX j3 , j2=1, 2,...SL, j3=1, 2,...VL; Step T8, obtain the number of all pixels in the high-definition image and record it as K; Then calculate the HX corresponding to each hue domain, saturation domain and each brightness domain respectively j1 SX j2 and VX j3 The proportion of HZ in K j1 , SZ j2 and VZ j3 ; StepT9, all HZ j1 , SZ j2 and VZ j3 Compare with the preset proportion thresholds HZy, SZy and VZy corresponding to hue, saturation and brightness respectively: If the high-definition image contains at least e HZ j1 >HZy or contains at least e SZ j1 > SZy contains at least e VZ j1 >VZy, the color of the urine sample is judged to be abnormal, otherwise the color of the urine sample is judged to be normal; Wherein, e is a preset value, and e is an integer value greater than 1.
4. The image analysis device for urine detection according to claim 3, characterized in that: in, When the absolute value of the difference between the corresponding H values of an adjacent pixel point and the reference point is greater than the standard deviation, but the absolute value of the difference between the pixel point and another pixel point indirectly adjacent to the reference point is less than or equal to the standard deviation, it is determined that the pixel point also exists in the hue domain corresponding to the reference point.
5. The image analysis device for urine detection according to claim 2, characterized in that: The abnormal analysis method is as follows: First, through the formula: , calculate the color intensity judgment value YP of the high-definition image; In the formula, β H , β S , β V H i , S i and V i Corresponding to the preset weight value; Then the color intensity determination value YP is compared with the preset normal urine color range [Y min ,Y max ] to compare and determine whether the color is abnormal; Among them, Y min Expressed as the minimum value of the normal urine transparency range, Y max Expressed as the maximum value of the normal urine clarity range; If YP∈[Y min ,Y max ], the color of the urine sample is judged to be normal; otherwise, the color of the urine sample is judged to be abnormal.
6. The image analysis device for urine detection according to claim 1, characterized in that: The image acquisition unit is provided with a specific light source and a light sensor, and the light sensor is used to measure the incident light intensity of the light source and the light intensity of the urine sample, which are then marked as G and in and G out .
7. The image analysis device for urine detection according to claim 6, characterized in that: The data analysis unit is through the formula TG=G out / G in The transparency TG of the urine sample is calculated; Then the transparency TG of the urine sample is compared with the preset normal urine transparency range [T min ,T max ] for comparison: Among them, T min Expressed as the minimum value of the normal urine transparency range, T max Expressed as the maximum value of the normal urine clarity range; If TG∈[T min ,T max ], the transparency of the urine sample is judged to be normal; otherwise, the transparency of the urine sample is judged to be abnormal.
Citation Information
Patent Citations
Portable urine detection device and method
CN109946290A
Urine color detection method and analyzer
CN112577905A