A reagent cap detection method and system based on non-uniform light conditions

By acquiring multiple frames of original images, performing grayscale conversion and optimization processing, generating a fused image and denoising it, and setting a region of interest for reagent cap recognition, the accuracy problem of reagent cap detection under non-uniform lighting conditions is solved, and higher recognition accuracy is achieved.

CN115861278BActive Publication Date: 2026-06-19AVIC AVIONICS CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
AVIC AVIONICS CO LTD
Filing Date
2022-12-26
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

In existing technologies for reagent cap detection under non-uniform lighting conditions, changes in light affect the accuracy of target positioning, leading to inaccurate identification and detection results.

Method used

By acquiring multiple frames of original images, performing grayscale and optimization processing, generating a fused image, and then performing median filtering and opening operation denoising processing, a region of interest is set for reagent cap recognition and detection.

Benefits of technology

This improves the accuracy of reagent cap recognition and detection, effectively avoids the uneven light caused by light flickering, and improves the accuracy of the final recognition result.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115861278B_ABST
    Figure CN115861278B_ABST
Patent Text Reader

Abstract

This invention relates to the field of reagent detection technology and provides a method and system for detecting reagent caps under non-uniform lighting conditions. The method includes the following steps: acquiring multiple consecutive frames of original images; performing optimal processing on the pixel grayscale values ​​of the multiple frames of original images to obtain a fused image; performing noise reduction processing on the fused image; and identifying and detecting the reagent caps. In this embodiment of the invention, the pixel grayscale values ​​of the multiple frames of original images are optimized to obtain a high-quality fused image for detection, making the differences between bright and dark images more obvious, which can improve the accuracy of the identification and detection results. It can effectively avoid the problem that uneven light distribution on the surface of the reagent cap caused by light flickering affects the final identification and detection results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of reagent detection technology, and particularly relates to a reagent cap detection method and system based on non-uniform light conditions. Background Technology

[0002] The experimental process involving chemical reagents requires extremely strict control over the operational procedures; each step must be executed flawlessly, without any deviation from the correct order. To address this, robotic arms and vision-based positioning are employed to reduce human intervention and prevent experimental failures. However, vision-based positioning presupposes the prior detection of the target's location.

[0003] In practical applications, target detection often relies on image processing. However, existing technologies do not take into account the effects of uneven lighting in the environment, which interferes with the accuracy of reagent cap positioning and results in inaccurate identification and detection results. Summary of the Invention

[0004] The purpose of this invention is to provide a reagent cap detection method and system based on non-uniform light conditions, aiming to solve the problems existing in the prior art as identified in the background art.

[0005] The present invention is implemented as follows: a reagent cap detection method based on non-uniform light conditions, the method comprising the following steps:

[0006] Acquire multiple consecutive frames of raw images;

[0007] The pixel grayscale values ​​of multiple original images are optimized to obtain a fused image;

[0008] The fused image is then denoised.

[0009] Identify and test the reagent caps.

[0010] Another objective of this invention is to provide a reagent cap detection system based on non-uniform light conditions, the system comprising:

[0011] The image acquisition module is used to acquire multiple consecutive frames of raw images;

[0012] The image fusion module is used to perform optimal processing on the pixel grayscale values ​​of multiple original images to obtain a fused image;

[0013] A noise reduction module is used to perform noise reduction processing on the fused image;

[0014] The identification and detection module is used to identify and detect reagent caps.

[0015] The beneficial effects of the embodiments of the present invention are as follows: The embodiments of the present invention perform optimal processing on the pixel gray values ​​of multiple frames of original images to obtain a high-quality fused image for detection, making the difference between bright and dark images more obvious, which can improve the accuracy of recognition and detection results. It can effectively avoid the problem that uneven light distribution on the surface of the reagent cap caused by light flickering affects the final recognition and detection results. Attached Figure Description

[0016] Figure 1 A flowchart of a reagent cap detection method based on non-uniform light conditions provided in an embodiment of the present invention;

[0017] Figure 2 A flowchart for obtaining a fused image provided in an embodiment of the present invention;

[0018] Figure 3 This is a flowchart of the denoising process for the fused image provided in an embodiment of the present invention;

[0019] Figure 4 This is a flowchart of the process for identifying and detecting reagent caps provided in an embodiment of the present invention;

[0020] Figure 5 A flowchart for determining whether a detection starting point exists in a first region of interest in a fused image, provided in an embodiment of the present invention;

[0021] Figure 6 This is a flowchart for determining whether a reagent cap exists in a second region of interest in a fused image, provided in an embodiment of the present invention.

[0022] Figure 7 A structural block diagram of a reagent cap detection system under non-uniform light conditions provided in an embodiment of the present invention;

[0023] Figure 8 This is a structural block diagram of the image fusion module provided in an embodiment of the present invention;

[0024] Figure 9 This is a structural block diagram of the identification and detection module provided in an embodiment of the present invention;

[0025] Figure 10 This is a block diagram of the internal structure of a computer device in one embodiment. Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0027] It is understood that the terms "first," "second," etc., used in this application may be used herein to describe various elements, but unless otherwise specified, these elements are not limited by these terms. These terms are used only to distinguish one element from another. For example, without departing from the scope of this application, a first script may be referred to as a second script, and similarly, a second script may be referred to as a first script.

[0028] like Figure 1 As shown, in one embodiment, a reagent cap detection method based on non-uniform light conditions is proposed, which may specifically include the following steps:

[0029] Step S100: Obtain multiple consecutive frames of original images.

[0030] In this embodiment of the invention, an image acquisition device can be used to acquire the original image. The original image can be captured continuously or extracted from video. The image acquisition device used is a line scan camera from Medtronic, with a resolution of 640x480. Video images can be acquired through a USB video interface. Preferably, the number of frames or the number of original images can be 30, but this can be set according to actual needs. This embodiment of the invention does not impose any additional limitations.

[0031] Step S200: Optimize the pixel grayscale values ​​of the multiple original images to obtain the fused image.

[0032] In this embodiment of the invention, when acquiring the original image, changes in the surrounding environment may cause light flickering, resulting in uneven light distribution on the surface of the reagent cap, which affects the final recognition and detection results. This embodiment of the invention optimizes the pixel grayscale values ​​of multiple frames of the original image to obtain a high-quality fused image for detection, making the differences between bright and dark images more obvious and improving the accuracy of the recognition and detection results.

[0033] Step S300: Denoise the fused image.

[0034] In this embodiment of the invention, denoising the fused image can improve the detection of the reagent cap's position in subsequent processes.

[0035] Step S400: Identify and detect the reagent cap.

[0036] In this embodiment of the invention, the pixel grayscale values ​​of multiple frames of original images are optimized to obtain a high-quality fused image for detection, making the differences between bright and dark images more obvious. This can effectively avoid the problem of uneven light distribution on the surface of the reagent cap caused by light flicker, which affects the final recognition and detection results.

[0037] In one embodiment, such as Figure 2 As shown, step S200 may specifically include the following steps:

[0038] Step S201: Each frame of the original image is converted to grayscale.

[0039] In this embodiment of the invention, the grayscale processing is performed using existing conventional methods, and there are no specific limitations on them here.

[0040] Step S202: Obtain the grayscale value of each pixel in the original image after grayscale processing for each frame.

[0041] Step S203: When the gray values ​​of the pixel exceeding a set proportion are all greater than the first threshold, the largest gray value is assigned to the pixel; when the gray values ​​of the pixel exceeding a set proportion are all less than the second threshold, the smallest gray value is assigned to the pixel.

[0042] In this embodiment of the invention, the ratio here can be adjusted according to the actual situation. A preferred ratio is 2 / 3. Taking an original image with 30 frames as an example, for a certain pixel, if the grayscale value of the corresponding pixel in more than 20 frames is greater than the first threshold, the largest grayscale value is assigned to the pixel. Similarly, if the grayscale value of the corresponding pixel in more than 20 frames is less than the second threshold, the smallest grayscale value is assigned to the pixel. The first and second thresholds can be 150. In practical applications, the first and second thresholds can be the same or different; no limitation is made here.

[0043] Step S204: Optimize the grayscale values ​​of the pixels to obtain the fused image.

[0044] In one embodiment, such as Figure 3 As shown, step S300 may specifically include the following steps:

[0045] Step S301: Perform median filtering on the fused image.

[0046] In this embodiment of the invention, let the fused image to be processed be Image, and the median filtering process be as follows:

[0047] MedianImage=Median(Image).

[0048] Step S302: Perform opening operation filtering on the fused image after median filtering to complete the denoising of the fused image.

[0049] In this embodiment of the invention, the fused image after median filtering still needs to undergo noise processing. Here, morphological opening operation is used to obtain the fused image after opening operation:

[0050] OpenImage=Open(MedianImage).

[0051] In one embodiment, such as Figure 4 As shown, step S400 may specifically include the following steps:

[0052] Step S401: Set a first region of interest and a second region of interest, wherein the first region of interest is used to identify the detection start point and the second region of interest is used to identify the reagent cap detection area.

[0053] In this embodiment of the invention, since the positions of the image acquisition device and the reagent kit are relatively fixed, a first region of interest and a second region of interest can be set based on experience before identification and detection. The first region of interest is used to identify the detection starting point, and the second region of interest is used to identify the reagent cap detection area.

[0054] Step S402: Determine whether there is a detection starting point in the first region of interest in the fused image.

[0055] Step S403: When the detection starting point exists, determine whether a reagent cap exists in the second region of interest in the fused image.

[0056] In this embodiment of the invention, the presence of a detection start point in the first region of interest indicates that the reagent kit is placed correctly. At this point, it is determined whether a reagent cap exists in the second region of interest in the fused image. If no detection start point exists in the first region of interest, a message will be displayed indicating that the reagent kit is placed incorrectly, prompting the experimenter to re-check the correctness of the position.

[0057] Step S404: When a reagent cap is present in the second region of interest, the reagent cap is encoded.

[0058] In one embodiment, such as Figure 5 As shown, step S402 may include the following steps:

[0059] Step S4021: Count the number of bright spots in the first region of interest.

[0060] In this embodiment of the invention, since the width and height of the first region of interest are known, and their width and height are FlagW and FlagH respectively, the image corresponding to the first region of interest in the fused image is Image. flag .

[0061] The formula for counting the number of bright spots is:

[0062] Among them, S flag K represents the number of bright spots, and K is the set brightness threshold, which can be set to 150 here.

[0063] Step S4022: Determine whether the number of bright spots is greater than a set third threshold, wherein the third threshold is determined based on the size of the first region of interest.

[0064] In this embodiment of the invention, the third threshold is FlagW*FlagH*2 / 3, and the ratio 2 / 3 can be set according to the actual situation.

[0065] In one embodiment, such as Figure 6 As shown, step S403 may include the following steps:

[0066] Step S4031: Divide the second region of interest into several regions equal to the number of grid cells in the reagent kit.

[0067] In this embodiment of the invention, the target is a national standard reagent kit. The reagent kit has 12x8 rows and columns and can hold 96 reagents. In this embodiment of the invention, the second region of interest can be divided into several regions that are equal to or correspond one-to-one with the grid positions of the reagent kit.

[0068] Step S4032: Number each of the regions in a predetermined order.

[0069] Step S4033: Count the number of bright spots in each region.

[0070] In this embodiment of the invention, the image of the second region of interest is an Image. tip The image of each region within the second region of interest is Image. tip-n The statistical method is the same as described above, and the formula is:

[0071]

[0072] Among them, S tip The value represents the number of bright spots, K is the set brightness threshold (which can be set to 150 here), and tipW and tipH are the area width and height, respectively.

[0073] Step S4034: Determine whether the number of bright spots is greater than a set fourth threshold, which is determined based on the size of the reagent kit compartment.

[0074] In this embodiment of the invention, the fourth threshold is tipW*tipH*2 / 3. The ratio 2 / 3 can be set according to actual conditions. If S tip If the value is greater than the fourth threshold, then the region is considered to contain a reagent cap.

[0075] In one embodiment, when the reagent caps are encoded, they start in a predetermined order, with the position where a reagent cap exists marked as 1 and the empty space where no reagent cap exists marked as 0. This results in 96 dimensions of 0 and 1 data, which is then sent to the control console of the robotic arm. The control console will send the next instruction based on the current motion state, thereby completing the entire automatic reagent grasping process.

[0076] like Figure 7 As shown, in one embodiment, a reagent cap detection system based on non-uniform lighting conditions is provided, which may specifically include an image acquisition module 100, an image fusion module 200, a noise reduction module 300, and a recognition and detection module 400. Wherein:

[0077] The image acquisition module 100 is used to acquire multiple consecutive frames of original images;

[0078] The image fusion module 200 is used to perform optimal processing on the pixel grayscale values ​​of multiple frames of original images to obtain a fused image;

[0079] The denoising module 300 is used to denoise the fused image;

[0080] The identification and detection module 400 is used to identify and detect the reagent cap.

[0081] In this embodiment of the invention, the pixel grayscale values ​​of multiple frames of original images are optimized to obtain a high-quality fused image for detection. This makes the differences between bright and dark images more obvious, which can improve the accuracy of the recognition and detection results. It can effectively avoid the problem that uneven light distribution on the surface of the reagent cap caused by light flickering affects the final recognition and detection results.

[0082] like Figure 8 As shown, in one embodiment, the image fusion module 200 specifically includes: a grayscale processing unit 201, a grayscale value acquisition unit 202, a grayscale value assignment unit 203, and a result output unit 204.

[0083] in:

[0084] The grayscale processing unit 201 is used to perform grayscale processing on each frame of the original image;

[0085] The grayscale value acquisition unit 202 is used to acquire the grayscale value of each pixel of the original image after grayscale processing for each frame.

[0086] The grayscale value assignment unit 203 is used to assign the largest grayscale value to the pixel when the grayscale values ​​of the pixel exceeding a set proportion are all greater than a first threshold; and to assign the smallest grayscale value to the pixel when the grayscale values ​​of the pixel exceeding a set proportion are all less than a second threshold.

[0087] The result output unit 204 is used to optimize the grayscale values ​​of pixels to obtain a fused image.

[0088] like Figure 9 As shown, in one embodiment, the identification and detection module 400 includes a region setting unit 401, a first determination unit 402, a second determination unit 403, and an encoding unit 404. Wherein:

[0089] The region setting unit 401 is used to set a first region of interest and a second region of interest, wherein the first region of interest is used to identify the detection start point and the second region of interest is used to identify the reagent cap detection area.

[0090] The first determination unit 402 is used to determine whether there is a detection starting point in the first region of interest in the fused image.

[0091] The second determination unit 403 is used to determine whether a reagent cap exists in the second region of interest in the fused image when the detection starting point exists.

[0092] The encoding unit 404 is used to encode the reagent cap when the reagent cap is present in the second region of interest.

[0093] Figure 10 An internal structural diagram of a computer device in one embodiment is shown. Figure 10 As shown, the computer device includes a processor, memory, network interface, input device, and display screen connected via a system bus. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and may also store a computer program. When executed by the processor, this computer program enables the processor to implement a reagent cap detection method under non-uniform lighting conditions. The internal memory may also store a computer program, which, when executed by the processor, enables the processor to implement a reagent cap detection method under non-uniform lighting conditions. The display screen can be an LCD screen or an e-ink screen. The input device can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.

[0094] Those skilled in the art will understand that Figure 10The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0095] In one embodiment, the reagent cap detection system based on non-uniform light conditions provided in this application can be implemented as a computer program, which can be implemented as follows: Figure 10 The system runs on the computer device shown. The computer device's memory can store the various program modules that make up this reagent cap detection system based on non-uniform light conditions, for example... Figure 7 The image acquisition module 100, image fusion module 200, noise reduction module 300, and recognition and detection module 400 are shown. The computer program comprised of these modules causes the processor to execute the steps of a reagent cap detection method under non-uniform lighting conditions according to various embodiments of this application described in this specification.

[0096] For example, Figure 10 The computer equipment shown can be used as follows Figure 7 The image acquisition module 100 in the reagent cap detection system under non-uniform lighting conditions shown executes step S100. The computer device can execute step S200 via the image fusion module 200. The computer device can execute step S300 via the noise reduction processing module 300.

[0097] In one embodiment, a computer device is provided, the computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, performs the following steps:

[0098] Step S100: Obtain multiple consecutive frames of original images.

[0099] Step S200: Optimize the pixel grayscale values ​​of the multiple original images to obtain the fused image.

[0100] Step S300: Denoise the fused image.

[0101] Step S400: Identify and detect the reagent cap.

[0102] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, causes the processor to perform the following steps:

[0103] Step S100: Obtain multiple consecutive frames of original images.

[0104] Step S200: Optimize the pixel grayscale values ​​of the multiple original images to obtain the fused image.

[0105] Step S300: Denoise the fused image.

[0106] Step S400: Identify and detect the reagent cap.

[0107] It should be understood that although the steps in the flowcharts of the various embodiments of the present invention are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the various embodiments may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.

[0108] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0109] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0110] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of this patent should be determined by the appended claims.

[0111] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A reagent cap detection method based on non-uniform light conditions, characterized by, The method includes the following steps: Acquire multiple consecutive frames of raw images; A fused image is obtained by performing optimal grayscale value processing on the pixels of multiple original images. Specifically, this step includes: performing grayscale processing on each frame of the original image; obtaining the grayscale value of each pixel in each grayscale processed original image; assigning the largest grayscale value to the pixel when the grayscale values ​​of the pixel exceeding a predetermined proportion are all greater than a first threshold; assigning the smallest grayscale value to the pixel when the grayscale values ​​of the pixel exceeding a predetermined proportion are all less than a second threshold; and completing the pixel grayscale value optimization to obtain the fused image. The fused image is then denoised. Identify and test the reagent caps.

2. The method of claim 1, wherein, The step of denoising the fused image specifically includes: The fused image is then subjected to median filtering. An opening operation filter is applied to the fused image after median filtering to denoise the fused image.

3. The method of claim 1, wherein, The steps for identifying and detecting the reagent cap specifically include: Define a first region of interest and a second region of interest, wherein the first region of interest is used to identify the detection start point and the second region of interest is used to identify the reagent cap detection area; Determine whether a detection start point exists within the first region of interest in the fused image; When the detection starting point exists, it is determined whether a reagent cap exists in the second region of interest in the fused image; When a reagent cap is present in the second region of interest, the reagent cap is encoded.

4. The method according to claim 3, characterized in that, The step of determining whether a detection starting point exists within the first region of interest in the fused image specifically includes: Count the number of bright spots in the first area of ​​interest; Determine whether the number of bright spots is greater than a set third threshold, which is determined based on the size of the first region of interest.

5. The method according to claim 3, characterized in that, When the reagent caps are coded, they are coded in a predetermined order, with the position where a reagent cap exists marked as 1 and the empty space where no reagent cap exists marked as 0.

6. The method according to claim 3, characterized in that, The step of determining whether a reagent cap exists in the second region of interest in the fused image specifically includes: The second region of interest is divided into several regions equal to the number of cells in the reagent kit; Each of the aforementioned regions is numbered in a predetermined order; Count the number of bright spots in each of the aforementioned areas; Determine whether the number of bright spots is greater than a set fourth threshold, which is determined based on the size of the reagent kit compartment.

7. A reagent cap detection system based on non-uniform light conditions, characterized in that, The system includes: The image acquisition module is used to acquire multiple consecutive frames of raw images; An image fusion module is used to perform optimal processing on the grayscale values ​​of pixels in multiple frames of original images to obtain a fused image. The image fusion module includes: a grayscale processing unit for performing grayscale processing on each frame of the original image; a grayscale value acquisition unit for acquiring the grayscale value of each pixel in each frame of the grayscale processed original image; a grayscale value assignment unit for assigning the largest grayscale value to the pixel when the grayscale values ​​of the pixel exceeding a set proportion are all greater than a first threshold, and assigning the smallest grayscale value to the pixel when the grayscale values ​​of the pixel exceeding a set proportion are all less than a second threshold; and a result output unit for completing the optimization of pixel grayscale values ​​to obtain the fused image. A noise reduction module is used to perform noise reduction processing on the fused image; The identification and detection module is used to identify and detect reagent caps.

8. The system according to claim 7, characterized in that, The identification and detection module includes: A region setting unit is used to set a first region of interest and a second region of interest, wherein the first region of interest is used to identify the detection start point and the second region of interest is used to identify the reagent cap detection area. The first determination unit is used to determine whether a detection starting point exists in the first region of interest in the fused image; The second determination unit is used to determine whether a reagent cap exists in the second region of interest in the fused image when the detection starting point exists; The encoding unit is used to encode the reagent cap when the reagent cap is present in the second region of interest.