A method and system for intelligent detection of urine specimens for laboratory

By analyzing continuous frame images of urine specimens, distinguishing bubbles and sediments, and performing color enhancement, the problem of bubbles in urine specimens affecting the accuracy of analysis is solved, and the detection accuracy of sediments in urine specimens is improved.

CN119090871BActive Publication Date: 2025-01-21SECOND AFFILIATED HOSPITAL OF XIAN MEDICAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411566539.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-05
Publication Date
2025-01-21
Estimated Expiration
2044-11-05

AI Technical Summary

Technical Problem

There may be bubble effects during the transfer of urine specimens, resulting in similar colors of precipitates and bubbles in the collected urine images, affecting the doctor's accurate analysis of precipitates in urine specimens.

Method used

By obtaining the continuous frame image of the urine specimen, analyze the gray distribution features of the first frame of image, calculate the gray degree distribution coefficient, and distinguish the bubbles and sediments. Use the regional growth algorithm and confidence to calculate the formula to determine the final confidence of the pixel point, and enhance the color according to the confidence and gray differences to generate enhanced urine images.

Benefits of technology

It can effectively distinguish bubbles and sediments in urine samples and improve the accuracy of doctors' analysis of sediments in urine samples based on video images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119090871B_ABST
    Figure CN119090871B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of urine image enhancement, and specifically to an intelligent detection method and system for urine specimens used in a laboratory. According to the grayscale features in the first frame image of the urine specimen, a specimen to be enhanced is obtained; according to the grayscale distribution of the pixels in the image, reference pixels are obtained, and then target pixels are screened out; initial confidence is obtained according to the positional features of the target pixels in the continuous frame images; the final confidence is obtained in combination with the shape of the region with the same grayscale where the target pixel is located; the color enhancement coefficient is obtained in combination with the grayscale difference between the target pixel and the reference pixel; the target pixel is adjusted to obtain an enhanced color value; an enhanced urine image is obtained according to the enhanced color value; and then the specimen to be enhanced is detected. The present invention distinguishes between bubbles and sediments in urine specimens, and increases the accuracy of subsequent doctors' analysis of sediments in urine specimens based on video images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of urine image enhancement, and in particular to an intelligent detection method and system for urine specimens used in a laboratory. Background Art

[0002] Urine, as a physiological excretion, contains a variety of metabolites, and its composition can reflect the health status of the human body. Urine testing is an important non-invasive examination method that can provide valuable information about physical health. By analyzing the components in urine, such as the detection of sediment, it helps to assess kidney function, metabolic status and the health of the endocrine system, thereby helping doctors to develop more accurate treatment plans.

[0003] In the current detection of sediment in urine samples, in order to facilitate the examination of medical personnel, relevant medical-specific equipment is usually used to collect video frame images of urine samples and transmit them to the computer to facilitate medical personnel to observe and analyze the sediment therein. However, when collecting urine sample images, there may be bubbles in the urine sample during the transfer process, and the color of the sediment collected in the urine may be close to the color of the bubbles, thereby affecting the accuracy of the subsequent doctor's analysis of the sediment in the urine sample based on the video image. Summary of the invention

[0004] In order to solve the technical problem that the color of the collected urine sediment is close to the color of the bubbles, which affects the accuracy of the subsequent doctor's analysis of the sediment in the urine specimen based on the video image, the purpose of the present invention is to provide a method and system for intelligent detection of urine specimens for laboratory use, and the technical scheme adopted is as follows:

[0005] A method for intelligent detection of urine specimens for laboratory use, the system comprising:

[0006] Acquiring a preset number of continuous frames of urine images of the urine specimen;

[0007] According to the grayscale distribution characteristics in the first frame of urine image in the urine specimen, the grayscale distribution coefficient of the first frame of urine image in the urine specimen is obtained; according to the grayscale distribution coefficient, the urine specimen is analyzed to obtain the sample to be enhanced; according to the grayscale distribution of the pixels in the first frame of urine image in the specimen to be enhanced, the reference pixel in the first frame of urine image in the specimen to be enhanced is obtained; any pixel other than the reference pixel in the first frame of urine image of the specimen to be enhanced is used as the target pixel; according to the position distribution characteristics of the target pixel in the urine images of consecutive frames, the initial confidence of the target pixel is obtained; according to the grayscale characteristics of the target pixel, the same grayscale area where the target pixel is located is obtained; according to the shape characteristics of the same grayscale area and the initial confidence of the target pixel, the final confidence of the target pixel is obtained;

[0008] Obtaining a color enhancement coefficient of the target pixel according to the grayscale difference between the target pixel and the reference pixel, and the final confidence of the target pixel; adjusting the target pixel according to the color enhancement coefficient to obtain an enhanced color value of the target pixel;

[0009] The corresponding enhanced urine image is obtained according to the enhanced color value of each pixel in the first frame urine image of the specimen to be enhanced; and the specimen to be enhanced is detected according to the enhanced urine image.

[0010] Furthermore, the method for obtaining the grayscale distribution coefficient of the first frame of urine image includes:

[0011] Calculate the difference between the maximum grayscale value and the minimum grayscale value in the first frame of urine image as a first difference value;

[0012] The ratio between the first difference and the preset first parameter is used as the grayscale distribution coefficient of the first frame of urine image.

[0013] Furthermore, the method for obtaining the specimen to be enhanced includes:

[0014] When the grayscale distribution coefficient is greater than a preset first threshold, the urine sample corresponding to the first frame of urine image is used as the sample to be enhanced.

[0015] Furthermore, the method for obtaining the reference pixel includes:

[0016] In the first frame of urine image in the specimen to be enhanced, the pixels with the most identical gray values ​​are used as reference pixels.

[0017] Furthermore, the method for obtaining the initial confidence level includes:

[0018] In each frame of urine image of the specimen to be enhanced, a Cartesian coordinate system is established with the lower boundary as the x-axis and the left boundary as the y-axis, and the distance between the target pixel point and the upper boundary in each frame of urine image is calculated as the first distance of the target pixel point;

[0019] The initial confidence is obtained according to the initial confidence calculation formula, and the initial confidence calculation formula is as follows:

[0020] In the formula, Indicates the sequence number of the target pixel; Indicates the initial confidence of the target pixel; represents the number of urine images collected in the specimen to be enhanced; Indicates the upper boundary of each frame of urine image; Indicates A first distance between a target pixel and an upper boundary in a frame urine image; represents a real number that is not 0, where The value range is ; Indicates A first distance between a target pixel and an upper boundary in a frame urine image; Indicates The first distance between the target pixel and the upper boundary in the frame urine image.

[0021] Furthermore, the method for obtaining the final confidence level includes:

[0022] Using a region growing algorithm to obtain the same grayscale region of the target pixel;

[0023] Calculate the distance between the centroid pixel point in the same grayscale area of ​​the target pixel point and the edge of the same grayscale area as the second distance;

[0024] Starting from the horizontal right direction of the target pixel point, obtain a distance sequence consisting of all second distances in a counterclockwise direction;

[0025] The final confidence is obtained according to the final confidence calculation formula, and the final confidence calculation formula is as follows:

[0026] In the formula, Indicates the sequence number of the target pixel; Indicates the final confidence of the target pixel; Indicates the initial confidence of the target pixel; represents a real number that is not 0, where The value range is ; Indicates the number of elements in the distance sequence corresponding to the target pixel; Indicates the distance sequence corresponding to the target pixel. distance values; Represents the mean distance in the distance sequence corresponding to the target pixel; Represents the normalization function.

[0027] Furthermore, the method for obtaining the color enhancement coefficient includes:

[0028] The color enhancement coefficient is obtained according to the color enhancement coefficient calculation formula, and the color enhancement coefficient calculation formula is as follows:

[0029] In the formula, Indicates the sequence number of the target pixel; Indicates the color enhancement coefficient of the target pixel; represents a real number that is not 0, where The value range is ; Represents the gray value of the target pixel; Represents the gray value of the reference pixel; Indicates the final confidence of the target pixel; Represents the preset hyperparameters of the target pixel; Represents the normalization function.

[0030] Furthermore, the method for obtaining the enhanced color value includes:

[0031] The enhanced color value is obtained according to the enhanced color value calculation formula, and the enhanced color value calculation formula is as follows:

[0032] In the formula, Represents the enhanced color value of the target pixel, The original color value of the target pixel can be obtained by the existing technology; Indicates the color enhancement coefficient of the target pixel; Represents the ceiling function.

[0033] A urine specimen intelligent detection system for a laboratory, the system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the urine specimen intelligent detection method for a laboratory when executing the computer program.

[0034] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned intelligent detection method for urine specimens for laboratory use when executing the computer program.

[0035] The present invention has the following beneficial effects:

[0036] The present invention obtains a preset number of continuous frames of urine images of a urine specimen; since there may be bubbles or impurities in the urine specimen, and there is a difference in grayscale in the first frame of urine image, the corresponding urine specimen may contain sediment or bubbles, so according to the grayscale distribution characteristics in the first frame of urine image in the urine specimen, the grayscale distribution coefficient of the first frame of urine image in the urine specimen is obtained, and the sample to be enhanced is obtained; since the largest number of pixels in the urine image are the pixels in the area where the urine is located, and the difference between the grayscale value of the bubbles or sediment and the grayscale value of the pixel in the area where the urine is located is large, the reference pixel is first obtained; since the density of bubbles is usually smaller than that of sediment, and the bubbles will float, the continuous frames of urine are used to obtain the reference pixel points; The motion state of the pixel in the liquid image is analyzed for the area to which the pixel belongs, and the initial confidence of the target pixel is obtained; since some sediments are small or light, they may float with the movement of bubbles, and the surface of the bubble is affected by tension in the liquid, and may present a state close to a circle, so the regional shape composed of all pixels with the same grayscale characteristics as the target pixel is analyzed, and the confidence of the target pixel is further analyzed through the regional shape to obtain the final confidence of the target pixel; through the grayscale difference between the target pixel and the reference pixel, different degrees of color enhancement are performed to obtain the color enhancement coefficient of the target pixel, and then the enhanced color value of the target pixel is obtained. The corresponding enhanced urine image is obtained according to the enhanced color value of each pixel in the first frame of the urine image of the specimen to be enhanced; the specimen to be enhanced is detected according to the enhanced urine image. The present invention distinguishes between bubbles and sediments in urine specimens, and increases the accuracy of subsequent doctors' analysis of sediments in urine specimens based on video images. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0038] Figure 1 The present invention provides a flowchart of an intelligent detection method for urine specimens for laboratory use according to an embodiment of the present invention. DETAILED DESCRIPTION

[0039] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation method, structure, features and effects of an intelligent detection method and system for urine specimens for laboratory use proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0040] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0041] The specific scheme of the intelligent detection method and system for urine specimens for laboratory use provided by the present invention is described in detail below with reference to the accompanying drawings.

[0042] See also Figure 1 , which shows an intelligent detection method for urine specimens for laboratory use provided by an embodiment of the present invention, the method comprising:

[0043] Step S1: obtaining a preset number of continuous frames of urine images of a urine specimen.

[0044] The embodiment of the present invention is mainly used in the urine image enhancement scenario. When collecting urine sample images, there may be bubbles in the urine sample during the transfer process. At this time, the color of the precipitate collected in the urine is close to the color of the bubbles, which is difficult to distinguish, resulting in the difficulty for medical personnel to accurately identify the precipitate. Since the bubbles will show rising movement characteristics during the transfer process, the movement process of the same bubble can be reflected in the continuous frame image. Therefore, in the embodiment of the present invention, a preset number of continuous frames of urine images of the urine sample are first obtained.

[0045] In an embodiment of the present invention, a high-definition camera of a medical device related to urine testing is used to obtain an initial image of a preset number of continuous frames of a urine specimen, and the obtained image is preprocessed to obtain a urine image, which is then transmitted to an image processing module of the device.

[0046] In one embodiment of the present invention, the preset number is set to 10, and the preprocessing operation includes denoising and grayscale processing, wherein denoising and grayscale processing are technical means well known to those skilled in the art and are not described in detail here. It should be noted that in other embodiments of the present invention, the preset number can be set arbitrarily and is not limited here.

[0047] Step S2: according to the grayscale distribution characteristics in the first frame of urine image in the urine specimen, obtain the grayscale distribution coefficient of the first frame of urine image in the urine specimen; analyze the urine specimen according to the grayscale distribution coefficient to obtain the sample to be enhanced; according to the grayscale distribution of the pixels in the first frame of urine image in the specimen to be enhanced, obtain the reference pixel in the first frame of urine image in the specimen to be enhanced; any pixel other than the reference pixel in the first frame of urine image of the specimen to be enhanced is taken as the target pixel; according to the position distribution characteristics of the target pixel in the urine images of consecutive frames, obtain the initial confidence of the target pixel; according to the grayscale characteristics of the target pixel, obtain the same grayscale area where the target pixel is located; according to the shape characteristics of the same grayscale area and the initial confidence of the target pixel, obtain the final confidence of the target pixel.

[0048] When the urine specimen is transferred, there may not be any sediment inside the specimen, and no bubbles are generated. At this time, in the urine image corresponding to the urine specimen, the grayscale distribution of each area is relatively uniform, and the urine image corresponding to the urine specimen at this time does not need to be enhanced; while in the urine image corresponding to the urine specimen containing sediment or bubbles, there is a large grayscale gap between the image area corresponding to the bubble or sediment and other image areas. Since the above process obtains urine images of continuous frames of the urine specimen, the components of the sediment contained in each frame of the urine image are consistent. If there is a difference in grayscale in the first frame of the urine image, the corresponding urine specimen may contain sediment or bubbles, so the embodiment of the present invention can analyze the first frame of the urine image to distinguish between bubbles and sediments in the urine specimen. Therefore, in the embodiment of the present invention, according to the grayscale distribution characteristics in the first frame of the urine image in the urine specimen, the grayscale distribution coefficient of the first frame of the urine image in the urine specimen is obtained; according to the grayscale distribution coefficient, the urine specimen is analyzed to obtain the sample to be enhanced.

[0049] Preferably, in one embodiment of the present invention, the method for obtaining the grayscale distribution coefficient of the first frame of urine image includes:

[0050] The difference between the maximum grayscale value and the minimum grayscale value in the first frame of urine image is calculated as the first difference; and the ratio between the first difference and the preset first parameter is used as the grayscale distribution coefficient of the first frame of urine image. In one embodiment of the present invention, the calculation formula of the grayscale distribution coefficient is as follows:

[0051] In the formula, Represents the grayscale distribution coefficient of the first frame of urine image in the urine specimen; Indicates the maximum grayscale value in the first frame of urine image in the urine specimen; Indicates the minimum gray value in the first frame of urine image in the urine specimen; Indicates the preset first parameter.

[0052] In the calculation formula of grayscale distribution coefficient, the difference between the maximum grayscale value and the minimum grayscale value in the first frame of urine image is The larger the value, the more likely it is that there are bubbles or sediments in the first urine image.

[0053] In one embodiment of the present invention, since the maximum difference between the grayscale values ​​of image pixels is 255, the preset first parameter is set to 255. It should be noted that in other embodiments of the present invention, the preset first parameter can be set arbitrarily, and is not limited here.

[0054] Whether the urine sample needs to be enhanced is analyzed based on the grayscale distribution coefficient of the first frame of urine image.

[0055] Preferably, in one embodiment of the present invention, the method for obtaining a specimen to be enhanced includes:

[0056] When the grayscale distribution coefficient is greater than the preset first threshold, the urine sample corresponding to the first frame of urine image is used as the sample to be enhanced. In one embodiment of the present invention, the preset first threshold is set to 0.2, that is, when the grayscale distribution coefficient of the first frame of urine image of the urine sample is greater than 0.2, it is considered that bubbles or sediments exist in the urine sample at this time. It should be noted that in other embodiments of the present invention, the preset first threshold can be set voluntarily and is not limited here.

[0057] The embodiment of the present invention aims to distinguish sediment from bubbles. Since the largest number of pixels in the urine image are the pixels in the urine area, and the grayscale value of the bubbles or sediment is different from the grayscale value of the pixels in the urine area, the pixels in the urine area are used as reference pixels to distinguish the pixels in the bubble area from the pixels in the sediment area. Therefore, in the embodiment of the present invention, the reference pixels in the first frame of urine image in the specimen to be enhanced are obtained according to the grayscale distribution of the pixels in the first frame of urine image in the specimen to be enhanced.

[0058] Preferably, in an embodiment of the present invention, the method for obtaining reference pixels includes:

[0059] In the first frame of urine image in the specimen to be enhanced, the pixels with the most identical gray values ​​are used as reference pixels.

[0060] When the specimen to be enhanced is subjected to sediment detection, small bubbles may be generated during the transfer or operation of the specimen to be enhanced, and since the density of bubbles is usually smaller than that of sediment, the bubbles may float up or hover near the upper part of the liquid of the specimen to be enhanced over time in the urine. Since the density of the sediment in the urine is usually larger, its movement direction and position in the image are opposite to those of the possible bubbles. Therefore, in the embodiment of the present invention, the area to which the pixel belongs can be analyzed through the movement state of the pixel in the continuous frame urine image.

[0061] Preferably, in one embodiment of the present invention, the method for obtaining the initial confidence level includes:

[0062] In each urine image frame of the specimen to be enhanced, a Cartesian coordinate system is established with the lower boundary as the x-axis and the left boundary as the y-axis, and the distance between the target pixel point and the upper boundary in each urine image frame is calculated as the first distance of the target pixel point. In one embodiment of the present invention, the Euclidean distance between the target pixel point and the upper boundary in each urine image frame is calculated as the first distance of the target pixel point.

[0063] The initial confidence is obtained according to the initial confidence calculation formula. The initial confidence calculation formula is as follows:

[0064] In the formula, Indicates the sequence number of the target pixel; Indicates the initial confidence of the target pixel; represents the number of urine images collected in the specimen to be enhanced; Indicates the upper boundary of each frame of urine image; Indicates A first distance between a target pixel and an upper boundary in a frame urine image; represents a real number that is not 0, where The value range is ; Indicates A first distance between a target pixel and an upper boundary in a frame urine image; Indicates The first distance between the target pixel and the upper boundary in the frame urine image.

[0065] In the initial confidence calculation formula, the closer the target pixel is to the upper boundary of the image in the urine image of adjacent frames, the The larger it is, the closer the moving direction of the target pixel in the urine image of the continuous frame is to the upper boundary of the image, and the more similar the moving directions of the target pixel are to the pixel in the bubble area. At this time, the initial confidence that the target pixel is the pixel in the bubble area is higher. The smaller it is, the closer the target pixel is to the upper boundary of the image in the last frame of urine image. The larger it is, the higher the initial confidence that the target pixel is the pixel in the bubble area.

[0066] Through the above process, the initial confidence that each pixel belongs to the bubble area can be obtained. However, since some sediments are small or light, they may float up to a certain extent with the movement of the bubbles. Therefore, the estimation of whether the pixel is a pixel in the bubble area based on the motion characteristics of the pixel in the urine image of continuous frames may not be accurate enough. Since the surface of the bubble is affected by tension in the liquid, it may appear to be close to a circular state. Therefore, the shape of the area composed of all pixels with the same grayscale characteristics as the target pixel is analyzed, and the confidence of the target pixel is further analyzed through the shape of the area. Therefore, in the embodiment of the present invention, the same grayscale area where the target pixel is located is obtained according to the grayscale characteristics of the target pixel; the final confidence of the target pixel is obtained according to the shape characteristics of the same grayscale area and the initial confidence of the target pixel.

[0067] Preferably, in one embodiment of the present invention, the method for obtaining the final confidence level includes:

[0068] The region growing algorithm is used to obtain the same grayscale region of the target pixel. It should be noted that the region growing algorithm is a technical means well known to those skilled in the art and will not be described in detail here.

[0069] Calculate the distance between the centroid pixel point and the edge of the same grayscale area in the same grayscale area of ​​the target pixel point as the second distance; start from the horizontal right direction of the target pixel point and obtain a distance sequence consisting of all second distances in a counterclockwise direction;

[0070] The final confidence is obtained according to the final confidence calculation formula. The final confidence calculation formula is as follows:

[0071] In the formula, Indicates the sequence number of the target pixel; Indicates the final confidence of the target pixel; Indicates the initial confidence of the target pixel; represents a real number that is not 0, where The value range is ; Indicates the number of elements in the distance sequence corresponding to the target pixel; Indicates the distance sequence corresponding to the target pixel. distance values; Represents the mean distance in the distance sequence corresponding to the target pixel; Represents the normalization function.

[0072] In the final confidence calculation formula, the initial confidence of the target pixel is The larger the value, the greater the final confidence that the target pixel is a pixel in the bubble area; the difference between each second distance and the mean of the second distance between the centroid pixel and the edge of the area in the same grayscale area where the target pixel is located The smaller, The larger it is, the closer the shape of the same grayscale area of ​​the target pixel is to the bubble shape. At this time, the final confidence that the target pixel is a pixel in the bubble area is greater.

[0073] Step S3: obtaining a color enhancement coefficient of the target pixel according to the grayscale difference between the target pixel and the reference pixel and the final confidence of the target pixel; adjusting the target pixel according to the color enhancement coefficient to obtain an enhanced color value of the target pixel.

[0074] Different degrees of color enhancement are performed based on the grayscale difference between the target pixel and the reference pixel. Therefore, in the embodiment of the present invention, the color enhancement coefficient of the target pixel is obtained based on the grayscale difference between the target pixel and the reference pixel and the final confidence of the target pixel.

[0075] Preferably, in an embodiment of the present invention, a method for obtaining a color enhancement coefficient includes:

[0076] The color enhancement coefficient is obtained according to the color enhancement coefficient calculation formula. The color enhancement coefficient calculation formula is as follows:

[0077] In the formula, Indicates the sequence number of the target pixel; Indicates the color enhancement coefficient of the target pixel; represents a real number that is not 0, where The value range is ; Represents the gray value of the target pixel; Represents the gray value of the reference pixel; Indicates the final confidence of the target pixel; Represents the preset hyperparameters of the target pixel; Represents the normalization function.

[0078] In the color enhancement coefficient calculation formula, the grayscale difference between the target pixel and the reference pixel is The smaller, The larger the value, the closer the color of the target pixel is to the urine background color and the harder it is to observe. The greater the color enhancement, that is, the greater the color enhancement coefficient of the target pixel. The final confidence level of the target pixel is The smaller it is, the more likely the target pixel is a pixel in the sediment area. At this time, the color enhancement degree of the target pixel is greater, that is, the color enhancement coefficient of the target pixel is greater.

[0079] In one embodiment of the present invention, the hyperparameters of the pixels in the image enhancement are set to technical features well known to those skilled in the art, which are not limited or elaborated herein, wherein the preset hyperparameter is set to 0.8. It should be noted that in other embodiments of the present invention, the preset hyperparameters can be set arbitrarily, which is not limited herein.

[0080] The target pixel is adjusted according to the color enhancement coefficient to obtain an enhanced color value of the target pixel. Preferably, in one embodiment of the present invention, the method for obtaining the enhanced color value includes:

[0081] The enhanced color value is obtained according to the enhanced color value calculation formula. The enhanced color value calculation formula is as follows:

[0082] In the formula, Represents the enhanced color value of the target pixel, The original color value of the target pixel can be obtained by the existing technology; Indicates the color enhancement coefficient of the target pixel; Represents the ceiling function.

[0083] At this point, the enhanced color values ​​of the pixels other than the reference pixels are obtained.

[0084] Step S4: obtaining a corresponding enhanced urine image according to the enhanced color value of each pixel in the first frame of the urine image of the specimen to be enhanced; and detecting the specimen to be enhanced according to the enhanced urine image.

[0085] In the embodiment of the present invention, the enhanced color value of the reference pixel in the first frame urine image of the specimen to be enhanced is consistent with the original color value, and the enhanced color values ​​of the pixels other than the reference pixel, that is, the pixels in the bubble area and the pixels in the sediment area can be obtained by the above operation, and the enhanced urine image can be obtained by the enhanced color value of each pixel. Among them, the enhanced urine image can improve the clarity of the sediment, and medical personnel can improve the accuracy of sediment detection in the urine specimen by enhancing the urine image.

[0086] At this point, the intelligent detection of urine samples is completed.

[0087] In summary, a preset number of continuous frames of urine images of a urine specimen are obtained; according to the grayscale distribution characteristics of the first frame of urine image in the urine specimen, the grayscale distribution coefficient of the first frame of urine image in the urine specimen is obtained; according to the grayscale distribution coefficient, the urine specimen is analyzed to obtain a sample to be enhanced; according to the grayscale distribution of pixels in the first frame of urine image in the specimen to be enhanced, the reference pixel point in the first frame of urine image in the specimen to be enhanced is obtained; any pixel point other than the reference pixel point in the first frame of urine image of the specimen to be enhanced is taken as a target pixel point; according to the position distribution characteristics of the target pixel point in the continuous frames of urine images, the target pixel point is obtained. Initial confidence; obtaining the same grayscale area where the target pixel is located according to the grayscale features of the target pixel; obtaining the final confidence of the target pixel according to the shape features of the same grayscale area and the initial confidence of the target pixel; obtaining the color enhancement coefficient of the target pixel according to the grayscale difference between the target pixel and the reference pixel, and the final confidence of the target pixel; adjusting the target pixel according to the color enhancement coefficient to obtain the enhanced color value of the target pixel; obtaining the corresponding enhanced urine image according to the enhanced color value of each pixel in the first frame of urine image of the specimen to be enhanced; detecting the specimen to be enhanced according to the enhanced urine image.

[0088] An embodiment of the present invention provides an intelligent urine specimen detection system for a laboratory, the system comprising a memory, a processor and a computer program, wherein the memory is used to store a corresponding computer program, the processor is used to run the corresponding computer program, and when the computer program runs in the processor, the method described in steps S1-S4 can be implemented.

[0089] The third objective of an embodiment of the present invention is to provide a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the method described in steps S1-S4 is implemented when the processor executes the computer program.

[0090] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0091] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

Claims

1. An intelligent detection method for urine specimens for laboratory use, characterized in that: The method comprises: Acquiring a preset number of continuous frames of urine images of the urine specimen; According to the grayscale distribution characteristics in the first frame of urine image in the urine specimen, the grayscale distribution coefficient of the first frame of urine image in the urine specimen is obtained; according to the grayscale distribution coefficient, the urine specimen is analyzed to obtain the sample to be enhanced; according to the grayscale distribution of the pixels in the first frame of urine image in the specimen to be enhanced, the reference pixel in the first frame of urine image in the specimen to be enhanced is obtained; any pixel other than the reference pixel in the first frame of urine image of the specimen to be enhanced is used as the target pixel; according to the position distribution characteristics of the target pixel in the urine images of consecutive frames, the initial confidence of the target pixel is obtained; according to the grayscale characteristics of the target pixel, the same grayscale area where the target pixel is located is obtained; according to the shape characteristics of the same grayscale area and the initial confidence of the target pixel, the final confidence of the target pixel is obtained; Obtaining a color enhancement coefficient of the target pixel according to the grayscale difference between the target pixel and the reference pixel, and the final confidence of the target pixel; adjusting the target pixel according to the color enhancement coefficient to obtain an enhanced color value of the target pixel; Obtaining a corresponding enhanced urine image according to the enhanced color value of each pixel in the first frame urine image of the specimen to be enhanced; and detecting the specimen to be enhanced using the enhanced urine image; The method for obtaining the grayscale distribution coefficient of the first frame of urine image includes: Calculate the difference between the maximum grayscale value and the minimum grayscale value in the first frame of urine image as a first difference value; Using the ratio between the first difference and the preset first parameter as the grayscale distribution coefficient of the first frame of urine image; The method for obtaining the reference pixel point includes: In the first frame of urine image in the specimen to be enhanced, the pixels with the most identical gray values ​​are used as reference pixels; The method for obtaining the initial confidence level includes: In each frame of urine image of the specimen to be enhanced, a Cartesian coordinate system is established with the lower boundary as the x-axis and the left boundary as the y-axis, and the distance between the target pixel point and the upper boundary in each frame of urine image is calculated as the first distance of the target pixel point; The initial confidence is obtained according to the initial confidence calculation formula, and the initial confidence calculation formula is as follows: In the formula, Indicates the sequence number of the target pixel; Indicates the initial confidence of the target pixel; represents the number of urine images collected in the specimen to be enhanced; Indicates the upper boundary of each frame of urine image; Indicates A first distance between a target pixel and an upper boundary in a frame urine image; represents a real number that is not 0, where The value range is ; Indicates A first distance between a target pixel and an upper boundary in a frame urine image; Indicates A first distance between a target pixel and an upper boundary in a frame urine image; The methods for obtaining the final confidence include: Using a region growing algorithm to obtain the same grayscale region of the target pixel; Calculate the distance between the centroid pixel point in the same grayscale area of ​​the target pixel point and the edge of the same grayscale area as the second distance; Starting from the horizontal right direction of the target pixel point, obtain a distance sequence consisting of all second distances in a counterclockwise direction; The final confidence is obtained according to the final confidence calculation formula, and the final confidence calculation formula is as follows: In the formula, Indicates the sequence number of the target pixel; Indicates the final confidence of the target pixel; Indicates the initial confidence of the target pixel; represents a real number that is not 0, where The value range is ; Indicates the number of elements in the distance sequence corresponding to the target pixel; Indicates the distance sequence corresponding to the target pixel. distance values; Represents the mean distance in the distance sequence corresponding to the target pixel; Represents the normalization function.

2. The intelligent detection method for urine specimens for laboratory use according to claim 1, characterized in that: Methods for obtaining specimens to be enhanced include: When the grayscale distribution coefficient is greater than a preset first threshold, the urine sample corresponding to the first frame of urine image is used as the sample to be enhanced.

3. The intelligent detection method for urine specimens for laboratory use according to claim 1, characterized in that: The method for obtaining the color enhancement coefficient includes: The color enhancement coefficient is obtained according to the color enhancement coefficient calculation formula, and the color enhancement coefficient calculation formula is as follows: In the formula, Indicates the sequence number of the target pixel; Indicates the color enhancement coefficient of the target pixel; represents a real number that is not 0, where The value range is ; Represents the gray value of the target pixel; Represents the gray value of the reference pixel; Indicates the final confidence of the target pixel; Represents the preset hyperparameters of the target pixel; Represents the normalization function.

4. The intelligent detection method for urine specimens for laboratory use according to claim 1, characterized in that: The method for obtaining the enhanced color value comprises: The enhanced color value is obtained according to the enhanced color value calculation formula, and the enhanced color value calculation formula is as follows: In the formula, Represents the enhanced color value of the target pixel, The original color value of the target pixel can be obtained by the existing technology; Indicates the color enhancement coefficient of the target pixel; Represents the ceiling function.

5. A urine specimen intelligent detection system for laboratory use, the system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the intelligent detection method of urine specimens for laboratory use as described in any one of claims 1 to 4 are implemented.

6. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the intelligent detection method of urine specimens for laboratory use as claimed in any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Urine detection method, urine detection equipment and computer readable storage medium

    CN112712490A

  • Method for determining concentration of analyte in sample of bodily fluid, mobile device, kit, computer program and computer-readable storage medium

    CN115667893A