A liquid level detection method, device, medium and product for microplate
Through a liquid level detection method including image processing and computer programs, the problem of liquid level detection of microplate is solved, efficient and accurate liquid level measurement is achieved, adapting to changes in external light intensity and camera shaking, and reducing detection costs.
Patent Information
- Application Number
- CN202210074586.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-21
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2042-01-21
AI Technical Summary
The prior art is difficult to efficiently and accurately detect the liquid level of the microplate, especially in the case of small volume and large quantity, which is high cost, small space and difficult to operate, resulting in low manual detection efficiency and low accuracy.
A liquid level detection method is adopted, including obtaining target images, angle correction processing, ROI extraction, histogram processing and filtering processing, and obtaining the liquid level curve through a computer program, adapting to changes in external light intensity and camera shaking, and ensuring detection accuracy.
It realizes efficient and accurate detection of the liquid level of the microwell plate, adapts to harsh environments, reduces detection costs, and improves the accuracy of liquid level volume calculation.
Smart Images

Figure CN114581653B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of machine vision, and in particular to a liquid level detection method, equipment, medium and product of a microplate. Background Art
[0002] In recent years, due to the characteristics of machine vision technology, such as non-contact, lossless, and able to adapt to harsh industrial environments, its application fields have become increasingly extensive, the technology has become increasingly mature, and good results have been achieved in various fields. Machine vision technology has high detection accuracy, low cost, higher efficiency, easy information integration and portability, and strong adaptability. These characteristics make it one of the preferred detection technologies for industrial production; machine vision often detects large containers such as storage tanks, transparent containers such as glass bottles and unobstructed containers on all sides in liquid level detection, and has achieved good detection results; in the liquid level detection of transparent containers, sensors are used to collect images vertically from the side of the container and detect them. For non-transparent large containers, they are often processed using triangulation with the help of lasers or their own high-intensity light; and there is less research on microplates that are obstructed on all sides and have a smaller volume.
[0003] Especially in the medical field, it is necessary to check the liquid level in a large number of containers. However, in the prior art, it is difficult to implement pressure-type liquid level detection technology for microplates with smaller volumes. For example, in the detection of liquid levels in related containers, the more mature technology is capacitive liquid level detection. However, this technology has the problems of high cost, small space and difficulty in operation when performing liquid level detection on microplates with small volumes and large numbers. Laser and ultrasonic liquid level detection are relatively expensive. Due to the complex characteristics of microplate materials and volumes, microplate liquid level detection currently still uses manual detection methods, which have low efficiency and low accuracy. Therefore, it is impossible to check a large number of micropores for liquid level measurement in the prior art. Summary of the invention
[0004] In view of the above technical problems, the technical solution adopted by the present invention is:
[0005] A liquid level detection method, the method comprising the following steps:
[0006] S100, acquiring a target image and processing the target image to obtain a second intermediate image;
[0007] S200, performing angle correction processing on the second intermediate image to obtain a third intermediate image;
[0008] S300, performing ROI extraction on the third intermediate image to obtain an ROI area image of each micropore;
[0009] S400, performing histogram processing on the ROI area image of each micropore to obtain a key image corresponding to each micropore;
[0010] S500, filtering the key image corresponding to each micropore to obtain a final image;
[0011] S600: Based on the final image, obtain a liquid level curve corresponding to the target image.
[0012] The present invention also protects a non-transitory computer-readable storage medium, in which at least one instruction or at least one program is stored, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the above method.
[0013] The present invention also protects an electronic device, including a processor and the above-mentioned non-transitory computer-readable storage medium.
[0014] The present invention also protects a computer program product, including a computer program, wherein the computer program is executed by a processor to implement the above method.
[0015] The present invention has at least the following technical effects: it can adapt to changes in external light intensity and prevent the angle of microplate imaging from shifting due to camera shaking during image acquisition, which affects the detection accuracy. It can also well guarantee the accuracy requirements, making the calculation of liquid level volume more efficient and concise, and meeting the detection needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be 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 creative work.
[0017] Figure 1 A schematic diagram of a flow chart of a liquid level detection system for a microplate executing a program provided in Example 1 of the present application;
[0018] Figure 2 A schematic flow chart of a liquid level detection method provided in Embodiment 2 of the present invention. DETAILED DESCRIPTION
[0019] 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0020] Embodiment 1
[0021] like Figure 1 As shown, the first embodiment of the present invention provides a system for liquid level detection of a microplate, the system comprising: a processor and a memory storing a computer program, when the computer program is executed by the processor, the following steps are implemented:
[0022] S1. Set the parameters of the drive device;
[0023] S11. Obtain the pulse frequency P, which meets the following conditions:
[0024] Among them, c is the set motor subdivision, i is the speed ratio of the reducer, R is the radius of the conveyor belt, and n is the motor speed; n meets the following conditions:
[0025] Wherein, V represents the transmission speed; those skilled in the art can set it according to requirements.
[0026] S13, adjusting P so that P reaches a preset pulse frequency threshold.
[0027] S2. Obtain the target pixel number B, and collect complete liquid level information.
[0028] Specifically, step S2 also includes the following steps to obtain B:
[0029] S21, obtaining the height H and diameter L of any microwell in the microwell plate to be tested, and obtaining α based on H and L, where α 0 ≤α≤90°;
[0030] Furthermore, α 0 Meet the following conditions:
[0031]
[0032] The camera collects the image of the microplate at an inclined angle, ensuring that the camera can obtain the image of the entire microplate microwell height and ensuring the imaging quality of the image.
[0033] S23 obtains the number of pixels B based on α, where B meets the following conditions:
[0034] Wherein, G represents the width of the field of view, and those skilled in the art can set the value of G according to actual needs, and α represents the tilt angle value of the camera, that is, the angle between the line connecting the camera light spot and the right bottom end point of a microwell and the microwell plate surface; α 0It represents the minimum tilt angle of the camera, that is, when the camera light spot and the left top endpoint and the right bottom endpoint of a microwell are in a straight line, the angle between the straight line and the surface of the microwell plate; d represents the resolution of the camera.
[0035] d meets the following conditions:
[0036] d=u×cosα, wherein u represents the physical resolution of the liquid level height in the camera, and those skilled in the art can set the value of u according to actual needs.
[0037] The above can ensure that the camera light spot and the left top endpoint and the right bottom endpoint of each microwell on the microwell plate are in a straight line, and the image of the entire height of the microwell can be completely collected, making the subsequent liquid level extraction more convenient.
[0038] Furthermore, the bottom shape of the micro-well plate is any one of a flat bottom, a round bottom and a V-shaped bottom. Preferably, the bottom shape of the micro-well plate is a flat bottom.
[0039] Preferably, the microporous plate is provided with 12 rows of microporous holes, and the number of microporous holes corresponding to each row is 8, wherein the microporous plate is 120 mm long, 80 mm wide and 14 mm high.
[0040] Preferably, each microwell has an inner diameter of 6 mm, an inner height of 10.5 mm, a volume of about 400 μl, and a distance between the centers of the microwells is 9 mm.
[0041] Preferably, the microplate is transparent.
[0042] S3. Obtain target depth of field ΔL.
[0043] Specifically, step S3 also includes the following steps to obtain ΔL:
[0044] S31, obtaining the field of view width W of the target camera device;
[0045] S33. Based on W, obtain the focal length f of the lens, where f meets the following conditions:
[0046] f=a×D / W, where a represents the horizontal width of the camera image, i.e., the horizontal size of the selected camera photosensitive chip; D represents the distance from the camera to the object, i.e., the object distance.
[0047] S35 . Obtain a target depth of field ΔL based on the depth BC in the optical axis direction of the target camera device and f.
[0048] Specifically, BC meets the following conditions:
[0049] BC = h × cos α;
[0050] Specifically, ΔL meets the following conditions:
[0051] ΔL=ΔL 1 +ΔL 2 ;
[0052] Where, ΔL 1 Indicates the depth of field of the lens, ΔL 2 Indicates the depth of field behind the lens, ΔL 1 With ΔL 2 Meet the following conditions:
[0053]
[0054] Wherein δ represents the diameter of the allowed circle of confusion; F represents the shooting aperture value; L represents the focus distance, which can be understood as the object distance. Those skilled in the art can set the values of L and F according to actual needs; this can provide the camera with a clearer image.
[0055] Specifically, the target camera device is an industrial camera and a lens used in conjunction with the industrial camera.
[0056] S4. Calibrate the target camera device based on B and ΔL. A person skilled in the art may adopt any camera calibration method in the prior art to calibrate the camera, for example, Zhang Zhengyou calibration method, camera calibration based on 3D stereo targets, active vision camera calibration, and camera self-calibration method, etc. Preferably, the embodiment of the present invention adopts Zhang Zhengyou calibration method, which can eliminate the distortion that occurs when taking photos and improve the measurement accuracy of the system.
[0057] S5. Matching the preset camera acquisition frame rate of the target camera device with the transmission speed in the driving device to obtain a single-row microplate image and use the single-row microplate image as the target image.
[0058] Furthermore, a soft triggering method is adopted to enable the target camera device to perform image acquisition.
[0059] Furthermore, those skilled in the art may adopt any method to match the camera acquisition frame rate with the conveyor belt speed V, which will not be described in detail here.
[0060] Furthermore, those skilled in the art may adopt any soft triggering method to allow the camera to perform image acquisition, which will not be described in detail here.
[0061] Embodiment 2
[0062] like Figure 2 As shown, this embodiment provides a method for detecting the liquid level of a microplate, the method is implemented by using a liquid level detection system for a microplate in the embodiment, and the method further includes the following steps:
[0063] S100: Acquire a target image and process the target image to obtain a second intermediate image.
[0064] Specifically, step S100 also includes the following steps:
[0065] S101. Binarize the target image to obtain a first intermediate image.
[0066] S103: Acquire a target image region from the first intermediate image and perform a closing operation on the target image region to obtain a second intermediate image.
[0067] Furthermore, in step S101, the first intermediate image is obtained by the following steps:
[0068] Get the pixel point list D corresponding to the target image = (D 1 , D 2 , ..., D f ), where D g It refers to the gray value of the g-th pixel, g = 1...f, f is the number of pixels;
[0069] When D g ≥ preset grayscale threshold t, D g Set to 255;
[0070] When D g <t, D g Set to 0;
[0071] Based on all settings D g , and obtain the first intermediate image.
[0072] Furthermore, those skilled in the art may set the grayscale threshold according to requirements, which will not be elaborated here. Preferably, the grayscale threshold is 127.
[0073] Furthermore, in step S103, the closing operation is an expansion and corrosion process, which can be understood as: performing expansion processing on the target area to obtain an intermediate area; performing corrosion processing on the intermediate area to obtain a final image area and based on the final area, obtaining a second intermediate image; those skilled in the art can adopt the expansion and corrosion processing method in the prior art as needed, which will not be repeated here.
[0074] Preferably, the target area refers to an area in the first intermediate image where an abnormality exists, such as separation, disconnection, edge cracking, omission, etc. Those skilled in the art know the method of obtaining the area with abnormality, which will not be described in detail here.
[0075] S200, based on the second intermediate image, perform angle correction processing on the target image to obtain a third intermediate image; it can be understood that: the liquid surface presentation area, that is, the final area, can be obtained from the second intermediate image.
[0076] Specifically, step S200 also includes the following steps:
[0077] S201, based on the second intermediate image, obtain the target pixel point p 0 The coordinates (x 0 ,y 0 );
[0078] S203, based on the target pixel point p 0 The coordinates (x 0 ,y 0 ), obtain the target slope value range;
[0079] S205. Based on the target slope value range, two straight lines corresponding to the two edges of the target image are fitted and the intersection of the two straight lines is used as the corner point. A person skilled in the art knows the method of obtaining the corner point based on the target slope value range, which will not be described in detail here.
[0080] Specifically, step S203 also includes the following steps:
[0081] S2031, obtaining a preset slope value range A to B;
[0082] S2033, dividing the preset slope value range into n sub-intervals, wherein the width of each sub-interval is 1 / n;
[0083] S2035. Set the accumulator K for the j-th subinterval j , j = 1...n, and when K j = 0, traverse the pixel point list corresponding to the second intermediate image and obtain the i-th pixel point P in the straight line detection area from the pixel point list corresponding to the second intermediate image. i The coordinates (x i ,y i ), according to P i The coordinates (x i ,y i ), and get P i The corresponding slope m i , i = 0...Z, Z is the number of pixels in the straight line detection area, where m i Meet the following conditions:
[0084]
[0085] S2037, when m i In any subinterval, get mi The accumulator K of the corresponding subinterval j =K j +1;
[0086] S2039, taking the subinterval of the maximum value of the accumulator and its two adjacent subintervals as the next slope value range, repeating steps S2033-S2037 until the slope value range is smaller than the preset slope threshold range and is used as the target slope value range.
[0087] Specifically, the straight line inspection area refers to an image area obtained by performing Hough transform straight line detection processing on the target image.
[0088] The above steps are based on the straight line detection process, which can prevent the microplate image from being offset at an angle due to camera shaking during image acquisition, thereby affecting the detection accuracy, and ensure that four accurate corner points are finally obtained.
[0089] S207. Process the second intermediate image according to all corner point coordinates to obtain a third intermediate image; wherein the processing adopts a perspective transformation method. Those skilled in the art may adopt any perspective transformation method, which will not be described here, so that the angle of the microplate in the first intermediate image can be parallel to the horizontal axis.
[0090] S300, extracting the ROI of the third intermediate image to obtain the ROI area image of each micropore; only the micropore image portion with better liquid level characteristics can be retained to reduce unnecessary interference.
[0091] Specifically, step S300 also includes the following steps:
[0092] S301, obtaining a middle portion image of any micropore in a third intermediate image corresponding to each micropore, wherein the height of the middle portion is 1 / Q of the total height of each micropore, preferably, Q=2;
[0093] S303, obtaining the starting coordinates of the ROI corresponding to each micropore according to the coordinates of all endpoints corresponding to the third intermediate image and the preset width of any micropore pixel; those skilled in the art can set the preset width according to actual needs, which will not be described in detail here;
[0094] S305, obtaining the ROI area image of each micropore according to the width and height of the preset designated area; the technicians in this field set the width and height of the preset designated area according to actual needs, which will not be repeated here.
[0095] S400 , performing histogram processing on the ROI area image of each micropore to obtain a key image corresponding to each micropore.
[0096] Specifically, step S400 also includes the following steps:
[0097] S401, obtaining the grayscale level r of the ROI area image of each micropore, 0≤r≤1, which can be understood as: when r=0, the grayscale value of the ROI area image of each micropore is 0, and when r=1, the grayscale value of the ROI area image of each micropore is 255.
[0098] S403 , performing histogram processing on the ROI area image of each micropore to obtain a grayscale level s corresponding to the key image corresponding to each micropore, where 0≤s≤1.
[0099] Furthermore, those skilled in the art may adopt any histogram processing method, which will not be described in detail herein. Preferably, the histogram processing is a histogram processing of continuous grayscale values. For example, when the probability density corresponding to r is P r (r), the probability density P corresponding to s s (s) = 1, where P() is the probability density function corresponding to the image grayscale.
[0100] After histogram processing, some pixel values are merged to increase the contrast of the image and make the liquid level features of the image clearer.
[0101] S500 , filtering the key image corresponding to each micropore to obtain a final image.
[0102] Specifically, step S500 also includes the following steps:
[0103] S501, processing the key image corresponding to each micropore to obtain a fourth intermediate image, wherein the processing method is a seed filling method, preferably, the processing method is an eight-neighborhood pixel filling method;
[0104] S503, obtaining a connected region from the fourth intermediate image, and when the area of the connected region is less than or equal to a preset area threshold, setting the grayscale values of all pixels in the connected region to 0;
[0105] When the area of the connected region is greater than the preset area threshold, the grayscale values of all pixels in the connected region are retained.
[0106] After the image is filtered, the noise points such as the black holes above are removed, and the interference of the non-liquid part is filtered out, leaving only the valid part containing liquid.
[0107] S600. Based on the final image, obtain the liquid level curve corresponding to the target image. A person skilled in the art knows that any method can be used to obtain the liquid level curve through the image. Preferably, the least square method is used to perform polynomial fitting on the obtained liquid level contour coordinates to obtain the liquid level curve corresponding to the target image, wherein the liquid level contour is found in the final image using the findContours function in openCV.
[0108] In this embodiment, the liquid level curve is fitted, which can solve the problem in the prior art that the liquid levels corresponding to the multiple micropores of the micropore plate cannot be determined, and can accurately determine the contour of the liquid level, reduce the error in calculating the liquid volume, and improve the accuracy of the liquid volume calculation.
[0109] An embodiment of the present invention also provides a non-transitory computer-readable storage medium, which can be set in an electronic device to store at least one instruction or at least one program related to implementing a method in a method embodiment. The at least one instruction or the at least one program is loaded and executed by the processor to implement the method provided in the above embodiment.
[0110] An embodiment of the present invention further provides an electronic device, comprising a processor and the aforementioned non-transitory computer-readable storage medium.
[0111] An embodiment of the present invention further provides a computer program product, which includes program code. When the program product is run on an electronic device, the program code is used to enable the electronic device to execute the steps of the method according to various exemplary embodiments of the present invention described above in this specification.
[0112] Although some specific embodiments of the present invention have been described in detail by way of example, it should be understood by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It should also be understood by those skilled in the art that various modifications may be made to the embodiments without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.
Claims
1. A method for detecting liquid level of a microplate, characterized in that: The method comprises the following steps: S100, acquiring a target image and processing the target image to obtain a second intermediate image; The step S100 includes the following steps: S101, performing binarization processing on the target image to obtain a first intermediate image; S103, acquiring a target image region from the first intermediate image and performing a closing operation on the target image region to obtain a second intermediate image; S200, performing angle correction processing on the target image based on the second intermediate image to obtain a third intermediate image; The step S200 includes the following steps: S201, based on the second intermediate image, obtaining the coordinates (x0, y0) of the target pixel point p0; S203, based on the coordinates (x0, y0) of the target pixel point p0, obtaining a target slope value range; S205, based on the target slope value range, fitting two straight lines corresponding to the two edges of the target image and taking the intersection point between the two straight lines as the corner point; S207, processing the second intermediate image according to the coordinates of all corner points to obtain a third intermediate image; S300, performing ROI extraction on the third intermediate image to obtain an ROI area image of each micropore; The step S300 includes the following steps: S301, obtaining a middle portion image of any micropore in a third intermediate image corresponding to each micropore; S303, obtaining the starting coordinates of the ROI corresponding to each micropore according to the coordinates of all endpoints corresponding to the third intermediate image and the preset width of any micropore pixel; S305, acquiring the ROI area image of each micro-hole according to the preset width and height of the designated area; S400, performing histogram processing on the ROI area image of each micropore to obtain a key image corresponding to each micropore; The step S400 includes the following steps: S401, obtaining the gray level r of the ROI area image of each micropore, 0≤r≤1; S403, performing histogram processing on the ROI area image of each micropore to obtain the grayscale level s corresponding to the key image corresponding to each micropore, where 0≤s≤1; S500, filtering the key image corresponding to each micropore to obtain a final image; The step S500 includes the following steps: S501, processing the key image corresponding to each micropore to obtain a fourth intermediate image; S503, obtaining a connected region from the fourth intermediate image, and when the area of the connected region is less than or equal to a preset area threshold, setting the grayscale values of all pixels in the connected region to 0; when the area of the connected region is greater than the preset area threshold, retaining the grayscale values of all pixels in the connected region; S600: Based on the final image, obtain a liquid level curve corresponding to the target image.
2. The liquid level detection method of a microplate according to claim 1, characterized in that: The height of the middle portion is 1 / 2 of the total height of each microwell.
3. The liquid level detection method of a microplate according to claim 1, characterized in that: The histogram processing is a histogram processing of continuous grayscale values.
4. A non-transitory computer-readable storage medium, characterized in that: The storage medium stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the method according to any one of claims 1 to 3.
5. An electronic device, characterized in that: Comprising a processor and the non-transitory computer-readable storage medium of claim 4.
6. A computer program product comprising a computer program, characterized in that The computer program is executed by a processor to implement the method according to any one of claims 1 to 3.
