A detection algorithm and device for color recognition at the titration endpoint

By using LAB color space conversion and Euclidean distance calculation, combined with multi-channel position detection sensors, the problems of low accuracy, low efficiency, and RGB threshold offset in titration detection are solved. This enables accurate identification and automatic adjustment of the titration endpoint, improves detection accuracy and efficiency, and extends the service life of the titration instrument.

CN116026820BActive Publication Date: 2026-04-03国投检测科技(山东)有限公司
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-28
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing titration testing methods suffer from problems such as low detection accuracy and efficiency, incorrect identification of titration endpoints, RGB threshold reference deviation, inability to intelligently adjust titration speed, changes in brightness due to refraction inside the glass bottle, and detection failures caused by incomplete cleaning.

Method used

By employing LAB color space conversion and calculating the color difference before and after titration using Euclidean distance, the titration speed is dynamically adjusted to achieve color reference correction and cleaning effect recognition. Combined with a multi-channel position detection sensor device, external light interference is prevented, improving detection accuracy and efficiency.

Benefits of technology

It achieves accurate identification of the titration endpoint, automatically adjusts the titration speed, prevents RGB threshold shift, ensures cleaning effect, improves detection accuracy and efficiency, and extends the service life of the titration instrument.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116026820B_ABST
    Figure CN116026820B_ABST
Patent Text Reader

Abstract

This invention provides a detection algorithm and device for color recognition at the titration endpoint, comprising: S1: turning on the light source; S2: extracting clean water, setting the white balance of the RGB sensor, identifying the RGB values ​​of the clean water, converting them to LAB values, and selecting the LAB threshold for the clean water; S3: draining the clean water, adding the sample solution and indicator, identifying the RGB values ​​of the solution at this time, and selecting the LAB threshold for the solution; S4: titrating the titrant, identifying the RGB values ​​of the mixed solution at this time, selecting the LAB threshold for the mixed solution, and calculating the Euclidean distance between the color and the solution LAB threshold in S3; S5: performing titration at a set speed, selecting the solution LAB value in real time, and calculating the Euclidean distance ΔE between the color and the color before titration in real time. x And determine ΔE at different titration stages. x Threshold; S6: ΔE based on the determined different titration stages x Threshold is set, and automatic titration identification begins. This invention solves the problems of unintelligent detection, inability to adjust titration speed based on color information, long detection time, and incomplete cleaning in existing technologies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of titration detection and recognition, and more specifically, relates to a detection algorithm and device for titration endpoint color recognition. Background Technology

[0002] In modern technological development, titration is a quantitative analysis method and a common operation in chemical, biological, and other experimental fields. It involves specific treatment followed by a quantitative reaction between two or more solutions to determine the content, properties, etc., of a substance. The titration endpoint can be indicated by the color change of an indicator, and the analytical results can be calculated based on phenomena such as the volume consumed or color change of the standard solution to determine the content or composition of the analyte.

[0003] A search revealed that invention patent CN107091839A discloses a novel online intelligent titrator for laboratories, relating to the field of unmanned online water quality monitoring technology. The sample pump, titration pump, and touchscreen are mounted on the front panel of the instrument, which also has a drain port. Internally, the instrument houses a titration unit, a PLC, and an air pump. It also includes four solenoid valves: a sample inlet valve, a titration valve, a drain valve, and an air filling valve. The titration unit comprises a titration vessel, a stirring unit, an LED supplemental light, a color recognition sensor, and a stepper motor. The stirring unit is located below the titration vessel, an LED supplemental light is mounted on one side of the vessel, and a color recognition sensor is mounted on the other side. The color recognition sensor feeds back the RGB color data to the PLC. This invention can automatically determine the endpoint color of the titration, enabling unattended real-time water quality monitoring. However, it does not solve the problem of RGB threshold bias and does not propose a specific algorithm to address this issue.

[0004] In existing titration detection technologies, color changes and abrupt changes are often visually compared in a laboratory setting, resulting in low accuracy and efficiency. Titration endpoint detection often uses electrode potential detection, which is susceptible to corrosion and blackening by the titrant, leading to a short lifespan. Furthermore, online endpoint detection and recognition using cameras or RGB sensors typically involves identifying RGB values ​​before and after titration and setting thresholds for detection. However, when comparing titration color similarity using RGB, changes in one channel can significantly impact the overall color change, and the effects of refraction within the glass vial on brightness variations are not considered. These technologies suffer from a lack of intelligent detection, inability to adjust titration speed based on color information, long detection times, and the risk of endpoint identification errors due to adhered color to the glass vial and incomplete cleaning. Moreover, existing color recognition methods are mostly based on RGB scalar detection, with fixed RGB thresholds. Since the detection involves chemical material components, reference shifts can occur, causing changes in the RGB thresholds, necessitating continuous calibration. Summary of the Invention

[0005] This invention aims to overcome at least one of the shortcomings of the prior art and provide a detection algorithm for titration endpoint color recognition.

[0006] The present invention also provides a detection device for titration endpoint color recognition, used to complete titration threshold calibration and automatic titration recognition.

[0007] The detailed technical solution of this invention is as follows:

[0008] To address the aforementioned technical problems, this invention provides a detection algorithm for titration endpoint color recognition, characterized by comprising: a titration threshold calibration process and automatic titration recognition;

[0009] The automatic titration identification includes color reference correction, titration endpoint identification, and cleaning effect identification;

[0010] The titration threshold calibration process includes:

[0011] S1: Turn on the light source and drive it with constant current according to the set current;

[0012] S2: Extract clean water, set the white balance of the RGB sensor, identify the RGB value of the current solution (clean water), and convert it to LAB value using the RGB to LAB formula. L represents lightness, A represents red-green difference, and B represents blue-yellow difference. Through multiple operations and measurements, select the LAB threshold of the current clean water, that is, select the LAB value of multiple experiments, and take the average value as the current threshold, which is L0, A0, B0.

[0013] S3: Drain the water, add the sample solution first, then add the indicator, identify the RGB values ​​of the mixed solution (indicator and sample solution) at this time, which are R0, G0, and B0 respectively; and convert them into LAB values ​​through a formula. Through multiple operations and measurements, select the LAB threshold of the current mixed solution, that is, select the LAB values ​​of multiple experiments, and take the average value as the current threshold, which is L1, A1, and B1.

[0014] S4: Titrate the titrant to a fixed quantity, identify the RGB values ​​of the new mixed solution (indicator, sample solution, and titrant), and convert them to LAB values ​​using a formula. Through multiple operations and measurements, select the LAB threshold for the new mixed solution, i.e., select the average of the LAB values ​​from multiple experiments as the threshold for the current new mixed solution, denoted as L2, A2, B2. Calculate the Euclidean distance from the color before titrating the titrant:

[0015] ΔE2=sqrt((L2-L1)^2+(A2-A1)^2+(B2-B1)^2) (I);

[0016] The color before titration refers to the color corresponding to the LAB threshold of the indicator mentioned in S3; sqrt in this article refers to the square root operation;

[0017] S5: Continue titration at the set speed. This speed ensures sufficient time between the two titrants for the solution in the cuvette to react fully. Continuously detect and identify the current RGB values ​​of the solution, convert them to LAB values ​​using a formula, select the current LAB value, and calculate in real time the Euclidean distance ΔE between the current LAB value and the original colors (the colors corresponding to L1, A1, and B1 in S3). x Continue titrating until the endpoint, recording the endpoint LAB value and ΔE. This is visually identifiable because color changes occur during titration, which can be distinguished by the human eye. Through multiple titration experiments at different concentrations, the ΔE value at different titration stages can be determined. x Thresholds include: first-stage threshold, second-stage threshold, and third-stage threshold;

[0018] S6: After threshold calibration of the titration endpoint process described above, automatic titration identification begins, including color reference correction, titration endpoint identification, and cleaning effect identification.

[0019] The color reference correction includes the following steps:

[0020] S601: Start the controller and send a visual detection and analysis control signal to begin visual non-contact detection;

[0021] S602: Clean the titration cuvette;

[0022] S603: Draw a quantitative sample solution into the colorimetric cell, and then add an indicator;

[0023] S604: Turn on the LED light source, set the light source current, keep the light source current constant, and the RGB sensor starts to read the RGB values ​​at this time, which are R1, G1, and B1.

[0024] S605: Using the RGB to LAB conversion formula, convert RGB values ​​to LAB values, namely L21, A21, and B21;

[0025] S606: Using the Euclidean distance formula, the Euclidean distance ΔE1 between the LAB value of the indicator measured by S605 and the standard LAB value after white balance during the calibration process can be calculated.

[0026] S607: Based on the required detection accuracy, set the values ​​of δ1 and δ2. δ1 is the calibration standard value, which means that if the color difference between the indicator added at this time and the indicator added during calibration is within the range of δ1, then no color deviation correction is required unless there are special requirements. δ2 is the upper limit of color difference. If the color difference exceeds the upper limit, manual inspection is required. Manual inspection means manually determining whether the bottle is not in the recognition area and needs to be adjusted, or whether the bottle is seriously contaminated and needs to be replaced, etc., in abnormal situations.

[0027] S608: Performs color deviation correction. The core idea of ​​the algorithm is to distinguish colors in the LAB space. ΔA = A21 - A1; ΔA > 0 means the color is closer to red, and vice versa. ΔB = B21 - B1; ΔB > 0 means the color is closer to yellow, and vice versa.

[0028] By utilizing the color bias between ΔA and ΔB, RGB colors are re-picked and corrected. The correction idea is to first determine the direction of the RGB color bias, and then take the median value of the RGB values ​​with color bias as the new RGB value based on the determination result, while the RGB values ​​without color bias are still taken as the original values, i.e., the initial RGB measurement values: R0, G0, B0.

[0029] The titration endpoint identification includes the following steps:

[0030] S609: After color deviation correction, the titration endpoint detection begins. The detection algorithm is based on the following idea: the titration endpoint is determined by calculating whether the distance between the color difference and the standard threshold calibrated for the titration endpoint process is close. At the same time, three thresholds are set to determine the titration process. The titration speed can be dynamically adjusted to speed up the detection efficiency and improve the detection accuracy.

[0031] At the beginning of the test, the titration device titrates at an initial speed v1. At each set time interval, the Euclidean distance formula is used to calculate in real time the color difference ΔE2 between the color values ​​L31, A31, B31 and the indicator L21, A21, B21 during the titration process.

[0032] S610: Based on the real-time calculated color values ​​L31, A31, B31 of the titration process and the color difference ΔE2 of the indicator L21, A21, B21, compared with the first-stage threshold, second-stage threshold, and third-stage threshold obtained during the titration threshold calibration process, determine the current stage and adjust the titration speed.

[0033] S611: The next step is the detection near the endpoint. Titrate at the titration rate of the third stage, adjust the detection time interval, and continue detection. When ΔE2 exceeds the threshold of the third stage, the total volume of titrant consumed is the median value calculated based on the current ion concentration. The ion content is calculated based on the current titration volume. When ΔE2 exceeds 84.66, the endpoint is also reached.

[0034] The cleaning effect identification includes the following steps:

[0035] S612: To ensure the next testing process, the cleaning device performs automatic cleaning. At the same time, an algorithm for judging the degree of cleaning cleanliness is proposed. After automatic cleaning, the Euclidean distance between the LAB values ​​L41, A41, and B41 of the clean water at this time and the standard LAB value of the clean water after white balance during the calibration process, i.e., the color difference ΔE3, is calculated. It is then determined whether the difference is within a suitable range, with δ3 being the upper limit.

[0036] S613: If ΔE3 < δ3, proceed to the next detection process; otherwise, repeat the cleaning process. If the bottle is still not in the appropriate range after three repeated cleanings, manual inspection is required. Manual inspection means determining whether the bottle is not in the identification area and needs to be adjusted, or whether the bottle is severely contaminated and needs to be replaced, or other abnormal situations.

[0037] On the other hand, the present invention also provides a device based on a multi-channel position detection sensor, comprising: a titration device, a light source, a glass bottle, an RGB sensor, and a controller, the whole being shielded by a black body to prevent external light interference;

[0038] A titration apparatus is used to extract or titrate liquids;

[0039] LED light sources provide illumination for experiments, creating imaging effects that are beneficial for image processing and reducing the requirements for image processing algorithms; they also overcome ambient light interference, ensure image stability, and improve the accuracy and efficiency of the system.

[0040] A colorimetric cell provides space for the solution to react;

[0041] A cleaning device for cleaning colorimetric cells;

[0042] An RGB sensor is used to collect the R, G, and B values ​​of a liquid and transmit them to the controller.

[0043] The controller is used to implement the titration threshold calibration process, the automatic titration identification algorithm, and the control of the titration device.

[0044] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0045] (1) The present invention provides a detection algorithm and device for color recognition of titration endpoint, which is suitable for color changes in the same color gamut that are relatively close during titration. It converts the linear RGB space into a non-linear LAB space, continuously identifies and calculates the color distance at different times before titration, during titration and at the titration endpoint, and compares the similarity between the two by setting a threshold, thereby determining the titration endpoint.

[0046] (2) The present invention provides a detection algorithm and device for color recognition of titration endpoint. By calculating the color distance based on LAB space, the titration process is judged. By judging the process, the titration speed is changed. If the distance to the titration endpoint is far, the titration speed is increased. If the distance to the titration endpoint is close, the titration speed is decreased.

[0047] (3) The present invention provides a detection algorithm and device for color recognition of titration endpoint, and proposes an algorithm for judging the degree of cleaning during the titration process. Before recognition, the present invention extracts a transparent solution and performs white balance processing on the RGB sensor. After each detection, the bottle is automatically cleaned. After each cleaning, the color distance in the LAB space is calculated, and the degree of cleaning is judged based on the color distance. If the color distance is too large, the user can be reminded whether the bottle is placed correctly and whether it needs to be replaced.

[0048] (4) This invention provides a detection algorithm and device for color recognition at the titration endpoint. It proposes a color reference correction algorithm that determines the color distance between the measured value and the reference value. If the reference offset exceeds a limit, the direction of color change is determined by judging the color deviation. Monochromatic values ​​of the main changing color gamut in the RGB space of the measured and reference values ​​are extracted. Based on the monochromatic values ​​of the main changing regions within the RGB space, a straight-line distance is calculated. The midpoint of the line connecting the two points is taken as the new monochromatic value, and together with other values, it is used as the new RGB reference value, thus obtaining a new LAB pre-test reference value. This invention can automatically calibrate the color reference, preventing color reference offset due to the detection of multiple material components and ensuring the service life of the titration instrument. Attached Figure Description

[0049] Figure 1 This is a flowchart illustrating the detection algorithm described in Embodiment 1 of the present invention.

[0050] Figure 2 This is a schematic diagram of the device in Embodiment 1 of the present invention. Detailed Implementation

[0051] The present disclosure will be further described below with reference to the accompanying drawings and embodiments.

[0052] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of this disclosure. Unless otherwise specified, 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 disclosure pertains.

[0053] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this disclosure. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms “comprising” and / or “including” are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0054] Where there is no conflict, the embodiments and features described herein can be combined with each other.

[0055] Example 1

[0056] This embodiment provides a detection algorithm and device for color recognition at the titration endpoint, such as... Figure 1 As shown, the process includes the following steps. Taking potassium chromate titration as an example, a yellow to reddish-brown precipitate will form. The first step is the titration threshold calibration process:

[0057] S1: Turn on the light source and drive it with constant current according to the set current;

[0058] S2: Extract clean water, set the white balance of the RGB sensor, identify the RGB value of the current solution (clean water), and convert it into LAB value through the formula. L represents lightness, A represents red-green difference, and B represents blue-yellow difference. Through multiple operations and measurements, select the LAB threshold of the current clean water, that is, select the LAB value of multiple experiments, and take the average value as the current threshold, which is L0, A0, B0. The formula is as follows:

[0059]

[0060]

[0061] The function f(X) that transforms X, Y, Z into L, a, b is:

[0062]

[0063] S3: Drain the water, add the sample solution first, then add the indicator, identify the RGB values ​​of the mixed solution (indicator and sample solution) at this time, which are R0, G0, and B0 respectively; and convert them into LAB values ​​through a formula. Through multiple operations and measurements, select the LAB threshold of the current mixed solution, that is, select the LAB values ​​of multiple experiments, and take the average value as the current threshold, which is L1, A1, and B1.

[0064] S4: Titrate 1 ml of titrant, identify the RGB values ​​of the new mixed solution (indicator, sample solution, and titrant), and convert them to LAB values ​​using a formula. Through multiple operations and measurements, select the LAB threshold of the new mixed solution, i.e., select the average of the LAB values ​​from multiple experiments as the threshold of the current new mixed solution, denoted as L2, A2, B2, and calculate the Euclidean distance from the color before titration:

[0065] ΔE2=sqrt((L2-L1)^2+(A2-A1)^2+(B2-B1)^2) (I);

[0066] The sample solution contains the ion to be measured; the titrant reacts with the sample solution to generate a reactant; the indicator reacts with the reactant to produce a color change.

[0067] The color before titration refers to the color corresponding to the LAB threshold of the indicator mentioned in S3;

[0068] S5: Continue titration at the set speed. This speed ensures sufficient time between the two titrants for the solution in the cuvette to react fully. Continuously detect and identify the current RGB values ​​of the solution, convert them to LAB values ​​using a formula, select the current LAB value, and calculate in real time the Euclidean distance ΔE between the current LAB value and the original colors (the colors corresponding to L1, A1, and B1 in S3). x :

[0069] ΔE x =sqrt((Lx-L1)^2+(Ax-A1)^2+(Bx-B1)^2) (II);

[0070] The value of x ranges from 3 to e, where e is the titration endpoint. When the titrant is the nth drop, x takes the value of n+1. For example, when the titrant is the second drop, n takes the value of 3.

[0071] Continue titrating until the endpoint, and record the endpoint as Le, Ae, Be, and ΔE_end (ΔE_end). e );

[0072] ΔE e =sqrt((Le-L1)^2+(Ae-A1)^2+(Be-B1)^2) (III);

[0073] Through multiple titration experiments at different concentrations, the ΔE at different titration stages can be determined. x The thresholds are as follows: first stage threshold: 47.8, second stage threshold: 72.6, and third stage threshold: 84.66.

[0074] S6: Determining ΔE at different titration stages as described above. xAfter the threshold is reached, automatic titration identification begins, including color reference correction algorithm, titration endpoint identification algorithm, and cleaning effect identification algorithm;

[0075] The color reference correction algorithm includes the following steps:

[0076] S601: Start the controller and send a visual detection and analysis control signal to begin visual non-contact detection;

[0077] S602: Clean the titration cell;

[0078] S603: Draw a quantitative sample solution into the colorimetric cell, and then add an indicator; taking potassium chromate titration as an example, potassium chromate is used as the indicator and silver nitrate is the titrant.

[0079] S604: Turn on the LED light source, set the light source current, and keep the light source current constant, as follows: Figure 2 As shown, the RGB sensor begins reading the RGB values ​​at this time, which are R1, G1, and B1.

[0080] S605: Using the RGB to LAB conversion formula, convert RGB values ​​to LAB values, namely L21, A21, and B21;

[0081] S606: Using the Euclidean distance formula, calculate the Euclidean distance, i.e. the color difference, between the LAB value measured by S605 and the standard LAB value after white balance during the calibration process: ΔE1=sqrt((L21-L1)^2+(A21-A1)^2+(B21-B1)^2);

[0082] S607: Based on the required detection accuracy, set the values ​​of δ1 and δ2. δ1 is the calibration standard value, representing the color difference between the added indicator and the color difference between the added indicator and the color difference during calibration. If the color difference is within the range of δ1, then color deviation correction is not required. Unless otherwise specified, δ1 is generally set to the default value of 2. δ2 is the upper limit of color difference, which is generally set to 10. If the color difference exceeds the upper limit, manual inspection is required. Manual inspection means manually determining whether the bottle is not in the recognition area and needs to be adjusted, or whether the bottle is severely contaminated and needs to be replaced, etc., which are abnormal situations.

[0083] S608: If ΔE1 is greater than or equal to δ1 and less than or equal to δ2, then the color deviation correction algorithm is performed; if ΔE1 is less than δ1, then proceed to the next step; if ΔE1 is greater than δ1, then an interrupt alarm is triggered, prompting for inspection; the core idea of ​​the algorithm is to distinguish colors in the LAB space, ΔA = A21 - A1: when ΔA > 0, it means the color is closer to red, and vice versa; ΔB = B21 - B1: when ΔB > 0, it means the color is closer to yellow, and vice versa;

[0084] By utilizing the color bias between ΔA and ΔB, RGB colors are re-picked and corrected. The correction idea is to first determine the direction of the RGB color bias, and then determine the RGB values ​​based on the result: take the median value of the RGB values ​​with color bias as the new RGB value, while the RGB values ​​without color bias are still taken as the original values, i.e., the initial RGB measurement values: R0, G0, B0.

[0085] The specific algorithm flow is as follows: when ΔA≧0, ΔB≧0, R1=(R1+R0) / 2, G1=G1, B1=B1;

[0086] When ΔA≧0, ΔB<0, R1=(R1+R0) / 2, G1=G1, B1=(B0+B1) / 2;

[0087] When ΔA<0, ΔB<0, R1=R1, G1=(G1+G0) / 2, B1=(B0+B1) / 2;

[0088] When ΔA<0, ΔB≧0, R1=R1, G1=(G1+G0) / 2, B1=B1, recalculate the new RGB values ​​as the current R1, G1, B1, and recalculate ΔE1.

[0089] The titration endpoint identification algorithm includes the following steps:

[0090] S609: After color deviation correction, the titration endpoint detection begins. The detection algorithm is based on the following idea: the titration endpoint is determined by calculating whether the distance between the color difference and the standard threshold calibrated for the titration endpoint process is close. At the same time, the titration process is determined based on the ΔEx threshold of different titration stages. The titration speed can be dynamically adjusted to speed up the detection efficiency and improve the detection accuracy.

[0091] At the beginning of the test, titration is performed at an initial speed v1. Every 500ms, the Euclidean distance formula is used to calculate in real time the color difference ΔE2 between the color values ​​L31, A31, B31 and the indicator L21, A21, B21 during the titration process.

[0092] S610: If ΔE2 < 47.8, the titration is in the first stage, the titration speed of the titration device is adjusted to V2, and continuous monitoring is performed. If 47.8 ≤ ΔE2 ≤ 72.6, the titration is in the second stage, the titration speed of the titration device is adjusted to V3, and continuous monitoring is performed. If 72.6 ≤ ΔE2 ≤ 84.66, the titration is in the third stage, and the titration speed of the titration device is adjusted to V4. The 47.8, 72.6, and 84.66 are the ΔEx threshold values ​​obtained during the titration threshold calibration process.

[0093] S611: Next is the detection near the endpoint. Titrate at a rate of V4, with the detection interval adjusted to 100ms, and continue detection. When ΔE2 exceeds 84.66, the endpoint is reached, and titration and detection are stopped. At this point, the total volume of titrant consumed is the median value calculated from the current ion concentration, and the ion content can be calculated based on the current titration volume.

[0094] The cleaning effect recognition algorithm includes the following steps:

[0095] S612: To ensure the next testing process, the cleaning device performs automatic cleaning. At the same time, an algorithm for judging the degree of cleaning cleanliness is proposed. After automatic cleaning, the Euclidean distance between the LAB values ​​L41, A41, and B41 of the clean water at this time and the standard LAB values ​​of the clean water after white balance during the calibration process is calculated, which is the color difference ΔE3 = sqrt((L41-L0)^2+(A41-A0)^2+(B41-B0)^2). It is judged whether the difference is within a suitable range. δ3 is the upper limit value, and the value of δ3 is generally set to 2.

[0096] S613: If ΔE3 < δ3, proceed to the next detection process; otherwise, repeat the cleaning process. If the bottle is still not in the appropriate range after three repeated cleanings, manual inspection is required. Manual inspection means determining whether the bottle is not in the identification area and needs to be adjusted, or whether the bottle is severely contaminated and needs to be replaced, or other abnormal situations.

[0097] On the other hand, the present invention also provides a device based on a multi-channel position detection sensor, comprising: a titration device, a light source, a glass bottle, an RGB sensor, and a controller, the whole being shielded by a black body to prevent external light interference;

[0098] A titration apparatus is used to extract or titrate liquids;

[0099] LED light sources provide illumination for experiments, creating imaging effects that are beneficial for image processing and reducing the requirements for image processing algorithms; they also overcome ambient light interference, ensure image stability, and improve the accuracy and efficiency of the system.

[0100] A colorimetric cell provides space for the solution to react;

[0101] A cleaning device for cleaning colorimetric cells;

[0102] An RGB sensor is used to collect the R, G, and B values ​​of a liquid and transmit them to the controller.

[0103] The controller is used to implement the titration threshold calibration process and automatic titration identification.

[0104] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the technical solutions of the present invention, and are not intended to limit the specific implementation of the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the claims of the present invention should be included within the protection scope of the claims of the present invention.

Claims

1. A detection algorithm for color recognition at the titration endpoint, characterized in that, include; S1: Turn on the light source and drive it with constant current according to the set current; S2: Extract clean water, set the white balance of the RGB sensor, identify the RGB value of the clean water, convert it to LAB value using the RGB to LAB formula, and select the LAB threshold of the current clean water as L0, A0, B0; S3: Drain the water, add the sample solution first, then add the indicator, identify the RGB values ​​of the mixed solution at this time, which are the RGB values ​​of the indicator and the sample solution after mixing, namely R0, G0, and B0; and convert them into LAB values ​​through the formula, and select the LAB threshold of the current mixed solution, which are L1, A1, and B1. S4: Add the titrant and identify the RGB values ​​of the new mixed solution, i.e., the RGB values ​​of the indicator, sample solution, and titrant after mixing. Convert these values ​​to LAB values ​​using a formula, select LAB thresholds for the new mixed solution as L2, A2, and B2, and calculate the Euclidean distance between the color of the new mixed solution and the color of the solution before titration using the Euclidean distance formula. E2; S5: Perform titration detection at the set speed, continuously detect and identify the current RGB values ​​of the solution, convert them to LAB values ​​using a formula, select the current LAB value, and calculate the Euclidean distance from the color before titration in real time according to the Euclidean distance formula. E x That is, the Euclidean distance to the colors corresponding to L1, A1, and B1 in S3. E x Continue titrating until the titration endpoint, and record the endpoint LAB value and... Finally, through titration experiments, the values ​​at different titration stages can be determined. E x Thresholds: First-stage threshold, second-stage threshold, third-stage threshold; S6: After determining the threshold calibration of the titration endpoint process, start automatic titration identification, including color reference correction algorithm, titration endpoint identification algorithm, and cleaning effect identification algorithm.

2. The detection algorithm for color recognition at the titration endpoint according to claim 1, characterized in that, The color reference correction algorithm includes: S601: Turn on the control device, i.e. the titration analyzer. The titration analyzer sends a visual detection and analysis control signal to start visual non-contact detection. S602: Cleaning the colorimetric cell; S603: Extract a quantitative sample solution and then add an indicator; S604: Turn on the light source, set the light source current, keep the light source current constant, and the RGB sensor starts to read the RGB values ​​at this time, which are R1, G1, and B1. S605: Using the RGB to LAB conversion formula, convert RGB values ​​to LAB values, namely L21, A21, and B21; S606: Using the Euclidean distance formula, the Euclidean distance (i.e., color difference) between the indicator's LAB value at this point and the standard LAB value after white balance during calibration can be calculated. E1; S607: Based on the required detection accuracy, set the values ​​of δ1 and δ2. δ1 is the calibration standard value, which means that if the color difference between the indicator added at this time and the indicator added during calibration is within the range of δ1, then no color deviation correction is required; δ2 is the upper limit of color difference. If the color difference exceeds the upper limit, manual inspection is required. S608: If When E1 is greater than or equal to δ1 and less than or equal to δ2, color deviation correction is required: if If E1 is less than δ1, proceed to the next step; if If E1 is greater than δ2, an interrupt alarm will be triggered, prompting a check. The color deviation correction includes: first determining the direction of RGB color bias, taking the median value of the RGB values ​​with color bias as the new RGB value, while the RGB values ​​without color bias are still taken as the original values, i.e., R0, G0, B0.

3. The detection algorithm for color recognition at the titration endpoint according to claim 2, characterized in that, The color deviation correction algorithm is as follows: Differentiate colors in the LAB color space. A = A21 - A1, A>0 means the color is closer to red. A < 0 leans towards green; B = B21 - B1, B>0 means the color is closer to yellow. B < 0 leans towards blue; when A≧0, B≧0, R1=(R1+R0) / 2, G1=G1, B1=B1; when A≧0, B<0, R1=(R1+R0) / 2, G1=G1, B1=(B0+B1) / 2; when A<0, B<0, R1=R1, G1=(G1+G0) / 2, B1=(B0+B1) / 2; when A<0, B≧0, R1=R1, G1=(G1+G0) / 2, B1=B1, recalculate the new RGB values ​​as the current R1, G1, B1, and recalculate. E1.

4. The detection algorithm for color recognition at the titration endpoint according to claim 1, characterized in that, The titration endpoint identification algorithm includes the following steps: S609: After color deviation correction, begin titration endpoint detection: determine the titration endpoint by calculating whether the distance between the color difference and the standard threshold calibrated during the titration endpoint process is close. Simultaneously, based on different titration stages... The Ex threshold determines the stage of titration and adjusts the titration rate accordingly; At the start of the test, the titration apparatus titrates at an initial predetermined rate v1. At fixed time intervals, using the Euclidean distance formula, the color differences between the values ​​of L31, A31, and B31 of the titration process and the colors of the indicators L21, A21, and B21 can be calculated in real time. E2; S610: If E2 < the first-stage threshold, the titration is in the first stage, and the titration speed of the titration apparatus is adjusted to V2; continuous monitoring continues, and if the first-stage threshold ≤ If E2 ≤ the second-stage threshold, the titration is in the second stage, and the titration speed of the titration apparatus is adjusted to V3; continuous monitoring continues, and if the second-stage threshold ≤ E2 ≤ the third stage threshold, the titration is in the third stage, and the titration speed of the titration apparatus is adjusted to V4; S611: Detection of the endpoint: Titrate at a rate of V4, adjust the detection time interval, and continue detection until... When E2 exceeds the threshold of the third stage, titration should be stopped.

5. The detection algorithm for color recognition at the titration endpoint according to claim 3, characterized in that, The cleaning effect recognition algorithm includes the following steps: S612: After automatic cleaning, calculate the Euclidean distance (i.e., color difference) between the LAB values ​​L41, A41, and B41 of the clean water at this time and the LAB values ​​of the clean water after white balance during calibration. E3 determines whether the difference is within a suitable range, with δ3 being the upper limit. S613: If If E3 < δ3, proceed to the next detection process; If E3 > δ3, repeat the cleaning process; if the cleaning is repeated three times... If E3≤δ3, then manual testing is required.

6. A detection apparatus for implementing a detection algorithm for titration endpoint color recognition as described in any one of claims 1-5, characterized in that, include: A titration apparatus is used to extract or titrate liquids; LED light source provides illumination for the experiment; A colorimetric cell provides space for the solution to react; A cleaning device for cleaning colorimetric cells; An RGB sensor is used to collect the R, G, and B values ​​of a liquid and transmit them to the controller. The controller is used to implement the titration threshold calibration process, the automatic titration identification algorithm, and the control of the titration device.

Citation Information

Patent Citations

  • Novel laboratorial on-line intelligent titrator

    CN107091839A

  • Color recognition module applied to titration using volumetric method, titration end point judgment system and working method thereof

    CN110044897A

  • High-precision titration device for measuring chemical oxygen demand

    CN112129751A