Online pH value detection method

Through an automated pH detection system, threshold segmentation and pixel histogram analysis are performed in the HSV space, combined with the color card database, the problems of large error, low efficiency and poor safety of pH detection in the slurry filling station are solved, and high-precision and low-cost remote real-time detection are achieved.

CN120334218APending Publication Date: 2025-07-18GUIZHOU FULIN MINING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510597870.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-09
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

The existing pH detection has problems such as large human error, low efficiency, high cost, poor safety and inconvenient data recording in the slurry filling station, and the linear interpolation method of the existing pH meter may lead to misjudgment.

Method used

An automated pH value detection system is adopted, and threshold segmentation and pixel histogram analysis are performed in the HSV space after the pH test strip changes color. The pH value is determined in combination with the color card database. The color discolored area is extracted through the threshold segmentation algorithm, the pixel histogram is calculated and compared with the color card, and the pH value of the color discolored area with the largest area is selected as the detection result.

Benefits of technology

Remote contactless real-time pH detection is realized, which improves detection accuracy and efficiency, reduces labor costs, ensures operational safety, and avoids misjudgment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120334218A_ABST
    Figure CN120334218A_ABST
Patent Text Reader

Abstract

The invention discloses a pH value online detection method. The method comprises the following steps: contacting a detection object with pH test paper by using a preset automatic pH value detection system so as to change the color of the pH test paper; collecting the color of the pH test paper, and generating a corresponding HSV space; in a saturation channel in the HSV space, a threshold segmentation algorithm is used to extract a color change area in the saturation channel; in a color value channel of the HSV space, sequentially selecting all color change area units in the color change area, and calculating pixel histograms of the color change area units; sequentially comparing a preset number of pixel-level colors which are distributed in the front of the pixel histogram with a color card database to obtain corresponding pH values; the pH value of the color changing area is determined; the pH value corresponding to the color changing area with the largest area serves as the pH value of the detection object. According to the pH value online detection method, remote non-contact real-time pH value detection can be realized, the detection precision and the detection efficiency of the pH value are improved, the operation safety is guaranteed, and the labor cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of chemical detection, and particularly relates to an online pH detection method. Background Art

[0002] In a slurry filling station, the existing pH detection process generally adopts the method of manual sampling, where an operator holds a pH test paper for detection. This method has the following problems: (1) There are human errors in the color judgment by different operators, and inconsistent operation specifications will also affect the detection results; (2) High cost and low efficiency. When frequently detecting the slurry, the manual labor intensity is high. Even with frequent detection, the real-time change of the pH value cannot be continuously monitored. Therefore, there may be a situation where the sudden change of the pH value during the interval between two detections affects production but cannot be detected; (3) Inconvenient data recording. The manual recording method is prone to errors and cannot realize automatic storage and analysis of data; (4) Poor safety. The operator needs to be in close contact with the slurry, and may be exposed to a harmful environment, so there is a potential safety hazard to the person.

[0003] There is also a pH meter now, which calculates the Euclidean distance between a certain color and other standard colors by using the linear interpolation method to obtain the pH value accurate to the decimal level. However, since the pH value does not change linearly, using the linear interpolation method between different pH values may also cause misjudgment. For example, in the case of showing different colors, the same pH value may be calculated. It can be seen that this detection method is not accurate either. Summary of the Invention

[0004] To solve the above technical problems, the present invention provides an online pH detection method, which can realize remote non-contact real-time pH detection, is more in line with the intuition of the human eye, avoids misjudgment, thereby can improve the detection accuracy and detection efficiency of the pH value, ensure operation safety, and reduce labor costs.

[0005] An online pH detection method provided by the present invention includes:

[0006] Using a preset automatic pH detection system to contact the detection object with a pH test paper to make the pH test paper change color;

[0007] Collecting the color of the pH test paper to generate a corresponding HSV space;

[0008] In the saturation channel in the HSV space, using the threshold segmentation algorithm to extract the discolored area therein;

[0009] In the color value channel of the HSV space, successively selecting each discolored area unit in the discolored area and calculating the pixel histogram of the discolored area unit;

[0010] Sequentially compare the preset number of pixel-level colors with a relatively high distribution in the pixel histogram with a color card database to obtain the corresponding pH values;

[0011] Determine the pH value of the color-changing area based on the pH values corresponding to all pixel-level colors within the color-changing area;

[0012] Sort the areas of all the color-changing areas, and use the pH value corresponding to the color-changing area with the largest area as the pH value of the detection object.

[0013] Preferably, in the above pH value on-line detection method, the step of sequentially comparing the preset number of pixel-level colors with a relatively high distribution in the pixel histogram with a color card database to obtain the corresponding pH values is as follows:

[0014] Sequentially compare the three pixel-level colors with a relatively high distribution in the pixel histogram with the color card to determine whether they are within the color range corresponding to the preset pH value marked in the color card database. If so, the preset pH value gets one vote; otherwise, compare the next pH value until all pH values are compared;

[0015] After completing one round of voting, use the pH value with the most votes as the pH value corresponding to the color-changing area unit.

[0016] Preferably, in the above pH value on-line detection method, the step of sorting the areas of all the color-changing areas includes:

[0017] Aggregate all pixel points with the same pH value into the same area;

[0018] Add up the number of pixel points in each area to determine the area of the color-changing area.

[0019] Preferably, in the above pH value on-line detection method, before using the preset automated pH value detection system to contact the detection object with the pH test paper to cause the pH test paper to change color, it further includes:

[0020] Extract the color value ranges corresponding to each pH value on the physical color card of the pH test paper, store each pH value and the corresponding color value range as a group of arrays in the color card database, and use the pH value as the index of the array.

[0021] Preferably, in the above pH value on-line detection method, the step of sequentially comparing the three pixel-level colors with a relatively high distribution in the pixel histogram with the color card database to determine whether they are within the color range corresponding to the preset pH value marked in the color card database. If so, the preset pH value gets one vote; otherwise, compare the next pH value until all pH values are compared includes:

[0022] Compare the three pixel-level colors with the highest distribution in the pixel histogram with the color ranges in the color card database from the color range corresponding to pH = 1 to the color range corresponding to pH = 14 in sequence. Determine whether it is within the color range corresponding to the preset pH value in the color card database. If so, the preset pH value gets one vote; otherwise, compare the next pH value until all pH values have been compared.

[0023] Preferably, in the above pH value on-line detection method, the preset automated pH value detection system includes:

[0024] A light-shielding container;

[0025] A pH test paper fixing device, installed inside the light-shielding container, on which a pH test paper is fixed;

[0026] A sampling device, connected to a rotating device inside the light-shielding container, and the rotating device is used to rotate the sampling device;

[0027] A sampling pipeline, with the first end communicating with a sample container and the second end facing the sampling device. The sampling device can rotate to a first position in contact with the sample flowing out of the sampling pipeline, and can rotate to a second position in contact with the pH test paper to direct the sample to the first side of the pH test paper to make it develop color;

[0028] A color recognition device, arranged facing the second side of the pH test paper away from the sampling device, for obtaining the color of the pH test paper after color development.

[0029] Preferably, in the above pH value on-line detection method, the pH test paper fixing device includes:

[0030] A pH test paper container;

[0031] A servo motor, spaced a preset distance from the pH test paper;

[0032] The first end of the pH test paper is bound to the rotating shaft of the servo motor, and the second end of the pH test paper is located inside the pH test paper container. The pH test paper is located between the sampling device and the color recognition device, and the servo motor is used to drive the pH test paper to be drawn out of the pH test paper container when rotating the rotating shaft to achieve the switching of the pH test paper.

[0033] Preferably, in the above pH value on-line detection method, the color recognition device includes:

[0034] An industrial camera, arranged facing the second side of the pH test paper away from the sampling device;

[0035] A parallel light source is arranged facing the second side of the pH test paper away from the sampling device.

[0036] Preferably, in the above pH value on-line detection method, the preset automatic pH value detection system further includes:

[0037] A control device, electrically connected to the color recognition device and the rotating device, is used to control the sampling device to rotate to a first position in contact with the sample flowing out of the sampling pipeline, coat the sample on the sampling device, and is used to control the sampling device to rotate to a second position in contact with the pH test paper, direct the sample to the first side of the pH test paper to make it show color, and is used to control the color recognition device to obtain the color of the pH test paper after color development.

[0038] Preferably, in the above pH value on-line detection method, the sampling device is a glass rod, and the control device is a programmable logic controller.

[0039] From the above description, it can be seen that in the pH value on-line detection method provided by the present invention, first, the detection object is brought into contact with the pH test paper by using a preset automatic pH value detection system to make the pH test paper change color, then the color of the pH test paper is collected to generate a corresponding HSV space. In the saturation channel of the HSV space, the threshold segmentation algorithm is used to extract the discolored area therein. Then, in the color value channel of the HSV space, each discolored area unit is sequentially selected within the discolored area, the pixel histogram of the discolored area unit is calculated, and then the preset number of pixel-level colors with the front distribution of the pixel histogram are sequentially compared with the color card database to obtain the corresponding pH value. According to the pH values corresponding to all the pixel-level colors within the discolored area, the pH value of the discolored area is determined. Finally, the areas of all the discolored areas are sorted, and the pH value corresponding to the discolored area with the largest area is used as the pH value of the detection object. It can be seen that this method can better simulate the analysis process of the human eye on the image, so it can realize remote non-contact real-time pH value detection, be more in line with the intuition of the human eye, avoid misjudgment, thereby improving the detection accuracy and detection efficiency of the pH value, ensuring operation safety, and reducing labor costs. Description of the Drawings

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only the embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to the provided drawings.

[0041] Figure 1Schematic diagram of an embodiment of an on-line pH detection method provided by the present invention;

[0042] Figure 2 Schematic diagram of a preset automatic pH detection system adopted by the method provided by this application. Detailed implementation mode

[0043] The core of the present invention is to provide an on-line pH detection method, which can realize remote non-contact real-time pH detection, is more in line with the intuition of the human eye, avoids misjudgment, thereby improving the detection accuracy and detection efficiency of pH value, ensuring operation safety and reducing labor costs.

[0044] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0045] An embodiment of an on-line pH detection method provided by the present invention is as Figure 1 shown Figure 1 Schematic diagram of an embodiment of an on-line pH detection method provided by the present invention. The on-line pH detection method may include the following steps:

[0046] S1: Use a preset automatic pH detection system to contact the detection object with a pH test paper to make the pH test paper change color;

[0047] It should be noted that when the pH test paper contacts the detection object, the test paper will change color. The color sensor or camera in the system will monitor the color change of the test paper in real time. The color sensor can directly measure the wavelength of the light reflected or transmitted by the test paper to determine the color, while the camera can analyze the color of the test paper through image processing technology.

[0048] S2: Collect the color of the pH test paper and generate a corresponding HSV space;

[0049] It should be noted that the HSV color space is a model based on human perception of colors. It divides colors into three main parameters: Hue: representing the type of color, such as red, green, blue, etc., usually expressed in degrees (0° - 360°); Saturation: representing the purity of the color, ranging from 0 (gray) to 1 (pure color); Value: representing the brightness of the color, ranging from 0 (black) to 1 (brightest). The HSV color space is more suitable for dealing with the intuitive characteristics of colors, such as changes in hue. Therefore, it is widely used in color recognition and image processing. The colors collected are in RGB format, and RGB color values are usually between 0 and 255. After converting them to the HSV color space, it can be more in line with human intuition about colors.

[0050] S3: In the saturation channel of the HSV space, the discolored area is extracted using the threshold segmentation algorithm;

[0051] It should be noted that since multiple color-changing regions are generated during the color change process of the pH test paper, all color-changing regions need to be segmented first. The boundaries of the color-changing regions can be clearly observed in the saturation (S) channel. Therefore, a threshold segmentation algorithm is used to extract the color-changing regions on this channel. The threshold refers to the boundary of a certain pixel to distinguish the selected region and the unselected region, and this value can be determined through the pixel histogram. For example, if the pixel histogram has an extreme value at the pixel point with a level of 128, the threshold is set to 128 to segment the color-changing and non-color-changing regions. The saturation channel reflects the purity of the color, ranging from 0 (gray) to 1 (pure color). In the color analysis of the pH test paper, the color-changing regions usually correspond to the parts with higher saturation. Therefore, the color-changing regions can be extracted in the saturation channel through the threshold segmentation algorithm. First, the saturation channel is extracted from the HSV color space, that is, the saturation value of each pixel point is obtained. In image processing libraries such as OpenCV, this can be achieved by splitting the HSV image into three channels. Then, threshold segmentation is performed. Using the threshold, the pixels in the image can be divided into two parts: pixels greater than or equal to the threshold and pixels less than the threshold. In the saturation channel, selecting a suitable threshold can separate the color-changing regions (regions with high saturation) from the background regions (regions with low saturation). Among them, a fixed threshold can be determined based on experience or experiments. For example, if the saturation of the color-changing regions of the pH test paper is usually above 0.5, the threshold can be set to 0.5. An adaptive threshold algorithm such as the Otsu method can also be used to automatically determine the optimal threshold according to the histogram of the image. During the segmentation process, each pixel in the saturation channel is traversed, and the saturation value of each pixel is compared with the threshold. If the saturation value is greater than or equal to the threshold, the pixel is marked as a color-changing region (usually set to 255 or 1). If the saturation value is less than the threshold, the pixel is marked as a background region (usually set to 0). Then, the color-changing regions are extracted. After threshold segmentation, the color-changing regions are marked as 255 (or 1), and the background regions are marked as 0. These regions can be extracted through functions in the image processing library. For example, the findContours function in OpenCV can be used to find the contours of the color-changing regions.

[0052] S4: In the color value channel of the HSV space, each color-changing region unit is sequentially selected within the color-changing region, and the pixel histogram of the color-changing region unit is calculated;

[0053] It should be noted that after all the colored and non - colored areas are segmented, a colored area unit is randomly selected on the hue (H) channel of the color value. The change in the color value of the colored area can reflect the brightness of the pH test paper color. By calculating the pixel histogram of the colored area unit, the color distribution can be analyzed, providing data support for the accurate detection of the pH value. Specifically, the colored area unit refers to a set of pixels with similar colors within the colored area. These units can be continuous regions or discrete points. In practical applications, the colored area can be divided into multiple units as needed. The hue channel of the color value is extracted from the HSV color space, that is, the color value of each pixel point is obtained. In image - processing libraries such as OpenCV, this can be achieved by splitting the HSV image into three channels. Through methods such as threshold segmentation, the colored area has been extracted from the background. Techniques such as contour detection and region labeling can be used to further locate each unit within the colored area. For each colored area unit, the pixel histogram of its hue channel is calculated. The histogram reflects the distribution of the color value, that is, the number of pixels within different color - value ranges. The pixel histogram can be obtained through the following steps: First, define the number of intervals (bins) of the histogram, for example, 256 intervals, and each interval represents a color value. Second, traverse each pixel within the colored area unit and count the interval in which its color value lies. Finally, normalize the statistical results to obtain the pixel histogram.

[0054] S5: Compare the preset number of pixel - level colors with the highest distribution in the pixel histogram with the color - card database in sequence to obtain the corresponding pH value;

[0055] In specific implementation, first, a color - card database needs to be established, which contains the pixel histograms of the pH test paper colors corresponding to different pH values. This database can be obtained through experiments, that is, immersing the pH test paper in a solution with a known pH value, photographing the color of the test paper, then calculating its pixel histogram and storing it. For the pH test paper image to be measured, the pixel histogram of the colored area unit has been calculated previously. This histogram reflects the number of pixels with different color values in the colored area unit. According to the histogram, select the preset number of pixel - level colors with the highest distribution. For example, the top 3 color values with the highest frequency in the histogram can be selected. This number can be selected according to actual needs. Compare the selected pixel - level colors with the histograms in the color - card database. Histogram similarity measurement methods such as histogram intersection and chi - square distance can be used to evaluate the similarity between the color to be measured and the colors in the color - card database. According to the evaluation results of the similarity, find the color - card color most similar to the color to be measured, so as to obtain the corresponding pH value.

[0056] S6: Determine the pH value of the colored area according to the pH values corresponding to all the pixel - level colors within the colored area;

[0057] Specifically, any of the following methods can be used to determine: (1) Mean value: Calculate the mean value of the pH values corresponding to all pixel-level colors; (2) Mode: Find the pH value that appears most frequently; (3) Median: Find the median of all pH values.

[0058] S7: Sort the areas of all the color-changing regions, and use the pH value corresponding to the color-changing region with the largest area as the pH value of the detection object.

[0059] Specifically, through methods such as threshold segmentation, the color-changing regions have been extracted from the background. Techniques such as contour detection and region labeling can be used to further locate each unit within the color-changing regions, calculate the area of each unit, sort the areas of all the color-changing region units, find the unit with the largest area, and determine its corresponding pH value according to the color value of the color-changing region unit with the largest area and the mapping relationship between color and pH value. It can be seen that using the histogram voting method and the largest color-changing region labeling instead of the linear interpolation method to determine the pH value based on the region with the largest color-changing area and the darkest color conforms to the general intuition of the human eye and there is no misjudgment phenomenon.

[0060] From the above description, it can be seen that in the embodiment of the online pH value detection method provided by the present invention, first, the detection object is brought into contact with the pH test paper using a preset automated pH value detection system to make the pH test paper change color, then the color of the pH test paper is collected to generate the corresponding HSV space. In the saturation channel of the HSV space, the color-changing regions are extracted using the threshold segmentation algorithm. Then, in the color value channel of the HSV space, each color-changing region unit is sequentially selected within the color-changing regions, the pixel histogram of the color-changing region unit is calculated, and then the preset number of pixel-level colors with the frontmost distribution in the pixel histogram are sequentially compared with the color card database to obtain the corresponding pH values. According to the pH values corresponding to all the pixel-level colors within the color-changing regions, the pH value of the color-changing region is determined. Finally, the areas of all the color-changing regions are sorted, and the pH value corresponding to the color-changing region with the largest area is used as the pH value of the detection object. It can be seen that this method can better simulate the human eye's analysis process of images, so it can achieve remote non-contact real-time pH value detection, which is more in line with the intuition of the human eye, avoids misjudgment, and thus can improve the detection accuracy and efficiency of pH values, ensure operation safety, and reduce labor costs.

[0061] In a specific embodiment of the above online pH value detection method, specifically, sequentially comparing the preset number of pixel-level colors with the frontmost distribution in the pixel histogram with the color card database to obtain the corresponding pH values can be:

[0062] Compare the top three pixel-level colors with the color card in the order of the distribution of the pixel histogram to determine whether they are within the color range corresponding to the preset pH value marked in the color card database. If so, the preset pH value gets one vote; otherwise, compare the next pH value until all pH values are compared.

[0063] After completing one round of voting, take the pH value with the most votes as the pH value corresponding to the color-changing area unit.

[0064] Specifically, the three selected pixel-level colors can be compared with the histograms in the color card database. Histogram similarity measurement methods such as histogram intersection and chi-square distance can be used to evaluate the similarity between the color to be measured and the colors in the color card database. For each preset pH value, if the color to be measured is within the color range corresponding to the preset pH value marked in the color card database, then the preset pH value gets one vote; otherwise, compare the next pH value until all pH values are compared. After completing one round of voting, take the pH value with the most votes as the pH value corresponding to the color-changing area unit.

[0065] In another specific embodiment of the above pH value on-line detection method, on the basis of the above embodiment, sorting the areas of all color-changing regions specifically may include:

[0066] Cluster all pixel points with the same pH value into the same region;

[0067] Add up the number of pixel points in each region to determine the area of the color-changing region.

[0068] It should be noted that this can be implemented through functions in the image processing library. For example, the connectedComponentsWithStats function in OpenCV calculates the number of pixel points in each clustered region, which is the area of the region. The connectedComponentsWithStats function in OpenCV can return the area of each connected region, which can more accurately reflect the acidity and alkalinity of the solution.

[0069] In yet another specific embodiment of the above pH value on-line detection method, on the basis of the above another specific embodiment, before using the preset automated pH value detection system to bring the detection object into contact with the pH test paper to cause the pH test paper to change color, the following steps may further be included:

[0070] Extract the color value ranges corresponding to each pH value on the physical color card of the pH test paper, and store each pH value and the corresponding color value range as a group of arrays in the color card database, and use the pH value as the index of the array.

[0071] It should be noted that, first, a physical color card containing colors corresponding to different pH values can be prepared. The color of each area on the color card corresponds to a specific pH value range. Then, use a high-resolution camera to take an image of the color card, ensuring that the image is clear and the colors are accurate. The colors of each area on the color card can be extracted through image processing techniques, which can be achieved using image processing libraries such as OpenCV. For each area corresponding to a pH value, calculate the color value range of its color. The color value range can be determined through the Value channel in the HSV color space. Store each pH value and its corresponding color value range in a database, which can be implemented using a Python dictionary, where the pH value is used as the key (index) and the color value range is used as the value.

[0072] In a preferred embodiment of the above pH value online detection method, based on the above-mentioned another specific embodiment, the three pixel-level colors with the frontmost distribution in the pixel histogram are sequentially compared with the color card database to determine whether they are within the color range corresponding to the preset pH value marked in the color card database. If so, the preset pH value obtains one vote; otherwise, compare the next pH value until all pH values are compared, including:

[0073] The three pixel-level colors with the frontmost distribution in the pixel histogram are sequentially compared with the color ranges from the color range corresponding to pH = 1 to the color range corresponding to pH = 14 in the color card database to determine whether they are within the color range corresponding to the preset pH value in the color card database. If so, the preset pH value obtains one vote; otherwise, compare the next pH value until all pH values are compared.

[0074] Through the above steps, it is possible to extract the color from the pixel histogram of the color-changing area and compare it with the color card database, and finally determine the most likely pH value.

[0075] Based on any embodiment of the above pH value online detection method, refer to Figure 2 , Figure 2 is a schematic diagram of a preset automated pH value detection system adopted by the method provided in this application. The preset automated pH value detection system can include:

[0076] A light-shielding container 1, whose function is to block light and form a dark room inside, thus avoiding the adverse effects of external light on color recognition;

[0077] A pH test paper fixing device 2, installed inside the light-shielding container 1, on which a pH test paper 3 is fixed. This pH test paper 3 is used to show a certain color when contacting the sample to identify the pH value;

[0078] Sampling device 4, connected to the rotating device 5 inside the light-shielding container 1. The rotating device 5 is used to rotate the sampling device 4. This sampling device 4 can rotate to the lower part to contact the sample and can also rotate to the upper part for color recognition. It can be seen that this method is relatively flexible. Without moving the pH test paper, color recognition can be achieved;

[0079] Sampling pipeline 6, with the first end communicating with the sample container 7 and the second end facing the sampling device 4. The sampling device 4 can rotate to the first position in contact with the sample flowing out of the sampling pipeline 6 and can also rotate to the second position in contact with the pH test paper 3 to direct the sample to the first side of the pH test paper 3 to make it show color. It should be noted that the sampling pipeline 6 can be connected to the overflow port 701 of the sample container 7, and this sample container 7 can be a stirrer;

[0080] Color recognition device 8, arranged facing the second side of the pH test paper 3 away from the sampling device 4, used to obtain the color of the pH test paper 3 after color development. Since the second side of the pH test paper 3 is detected here, it will not be affected by the sample itself on the first side. Therefore, this method has a higher accuracy rate for color recognition.

[0081] It should also be noted that the above light-shielding container 1 can be suspended in the air by a fixed bracket 9 to be as close as possible to the sample container 7. Moreover, the lower part of the second end of the sampling pipeline 6 can be a filling pump 10, and the other end of the filling pump 10 is connected to a slurry outlet 11, so that the normal operation of the slurry will not be affected.

[0082] Furthermore, the above pH test paper fixing device 2 can include:

[0083] pH test paper container;

[0084] Servo motor, at a preset distance from the pH test paper;

[0085] The first end of the pH test paper is bound to the rotating shaft of the servo motor, and the second end of the pH test paper is located in the pH test paper container. The pH test paper is located between the sampling device and the color recognition device, and the servo motor is used to drive the pH test paper to be drawn out of the pH test paper container when rotating the rotating shaft to realize the replacement of the pH test paper.

[0086] It can be seen that this method can automatically replace the pH test paper, thereby further improving work efficiency and significantly reducing labor costs. Of course, when the pH test papers in the pH test paper container are used up, the operator needs to replace them with a new roll of pH test papers.

[0087] Even further, continue to refer to Figure 2 , the above color recognition device 8 can include:

[0088] The industrial camera 801 is arranged facing the second side of the pH test paper 3 away from the sampling device 4;

[0089] The parallel light source 802 is arranged facing the second side of the pH test paper 3 away from the sampling device. A ring-shaped light source may be used, which only emits light around its periphery to illuminate the pH test paper 3 to assist in color identification. The middle of the ring-shaped light source is empty to avoid blocking the industrial camera 801.

[0090] In another preferred embodiment of the above-mentioned pH value online detection method, continue to refer to Figure 2 , the above-mentioned preset automatic pH value detection system may also include:

[0091] The control device 12 is electrically connected to the color recognition device 8 and the rotating device 5, and is used to control the sampling device 4 to rotate to a first position in contact with the sample flowing out of the sampling pipe 6, and apply the sample to the sampling device 4, and to control the sampling device 4 to rotate to a second position in contact with the pH test paper 3, and guide the sample to the first side of the pH test paper 3 to make it color, and to control the color recognition device 8 to obtain the color of the pH test paper 3 after color development.

[0092] It can be seen that the control device 12 can be used to control these devices to work on an automated basis, greatly reducing the involvement of operators, so that the time interval between each detection can be controlled to be smaller, and the adverse effects of abnormal pH values on the production process can be better avoided.

[0093] Furthermore, the above-mentioned sampling device may preferably be a glass rod, which is easy to obtain, low in cost, and can achieve better sampling. A glass rod of corresponding length can be selected according to actual needs, and the above-mentioned control device may preferably be a programmable logic controller, that is, a PLC, which is low in cost and can achieve efficient control. Of course, other types of sampling devices and control devices can also be selected according to actual needs, which is not limited here.

[0094] The process of using the above-mentioned pH value online detection method for detection can be as follows:

[0095] First, an additional sampling pipe is led out from the agitator, and the slurry flows out through the sampling pipe and falls into the filling port, re-entering the filling cycle;

[0096] Secondly, the pH detection device is placed above the sampling pipeline. A test paper box is placed on the left side inside the device, and a servo motor (used to replace the pH test paper) is placed on the right side. One end of the pH test paper is bound to the rotating shaft of the servo motor, with the front facing the sampling pipeline opening. A glass rod is bound to the rotating shaft of another servo motor. The PLC is used to control the rotation of the other servo motor to dip the glass rod into the slurry, and then rotate the glass rod upward so that the glass rod touches the above-mentioned pH test paper, thereby making the slurry stick to the front of the pH test paper and causing a color reaction;

[0097] Then, the color reaction of the pH test paper after dipping in the slurry will penetrate to the back, and there is no slurry adhesion on this side. Therefore, an industrial camera is installed on the back of the pH test paper. After waiting for a period of time, when the pH test paper is completely soaked, the PLC will send a control signal to the host computer software. The software will control the industrial camera to take a picture and call relevant algorithms to complete the detection of the pH value;

[0098] Finally, the above-mentioned servo motor winds the pH test paper to vacate a new detection area. The above pH monitoring device will repeat the above steps every once in a while to realize the cyclic on-line monitoring of the pH value of the slurry.

[0099] It can be seen that combined with the above hardware facilities, the above method can realize the on-line monitoring of the pH value of the filling slurry from the algorithm level to the equipment level. The whole process can not only get rid of manual detection operations, but also can carry out a large number of detection tasks at any time, significantly reducing the labor intensity. It should be noted that if the light source or the pH color card changes, the pH value color range must be re-extracted, which can be completed in the color card calibration module built in the software. The specific steps are as follows: First, use the camera to re-take the pH color card, then manually calibrate the color range corresponding to each pH value, and finally form the corresponding configuration file. Just load this configuration file when using it.

[0100] Using the above method, adopting the automatic sampling and detection method, it can fully automatically and real-time monitor and record the change of the pH value, avoiding human error. Therefore, it can improve the detection accuracy and efficiency, reduce the labor cost, replace part of the manual operation, realize non-stop work for 24 hours, reduce the manual labor intensity, and can also optimize the data recording method, so that the data can be automatically stored and analyzed, avoiding the tediousness and error-proneness of manual recording. In addition, it can improve safety because it can reduce the close contact between the operator and the slurry and reduce the risk of the operator being exposed to harmful substances environment.

[0101] The foregoing description of the disclosed embodiments enables those skilled in the art to practice or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An on-line pH value detection method, characterized in that, Including: Using a preset automated pH detection system to bring the object to be detected into contact with a pH test paper to cause the pH test paper to change color; Collecting the color of the pH test paper to generate a corresponding HSV space; In the saturation channel of the HSV space, using a threshold segmentation algorithm to extract the discolored area therein; In the color value channel of the HSV space, successively select each discolored area unit within the discolored area, and calculate the pixel histogram of the discolored area unit; Successively compare the preset number of pixel-level colors with the highest distribution in the pixel histogram with the color card database to obtain the corresponding pH value; Determine the pH value of the discolored area according to the pH values corresponding to all pixel-level colors within the discolored area; Sort the areas of all the discolored areas, and use the pH value corresponding to the discolored area with the largest area as the pH value of the object to be detected.

2. The on-line pH value detection method according to claim 1, characterized in that The step of successively comparing the preset number of pixel-level colors with the highest distribution in the pixel histogram with the color card database to obtain the corresponding pH value is: Successively compare the three pixel-level colors with the highest distribution in the pixel histogram with the color card, and determine whether they are within the color range corresponding to the preset pH value marked in the color card database. If so, the preset pH value gets one vote; otherwise, compare the next pH value until all pH values are compared; After one round of voting, use the pH value with the most votes as the pH value corresponding to the discolored area unit.

3. The online pH value detection method according to claim 2, characterized in that, The step of sorting the areas of all the discolored areas includes: Aggregating all pixel points with the same pH value into the same area; Add up the number of pixel points in each area to determine the area of the discolored area.

4. The on-line pH value detection method according to claim 3, characterized in that Before using the preset automated pH detection system to bring the object to be detected into contact with the pH test paper to cause the pH test paper to change color, it further includes: Extracting the color value ranges corresponding to each pH value on the physical color card of the pH test paper, storing each pH value and the corresponding color value range as a group of arrays in the color card database, and using the pH value as the index of the array.

5. The on-line pH value detection method according to claim 4, characterized in that, The step of successively comparing the three pixel-level colors with the highest distribution in the pixel histogram with the color card database to determine whether they are within the color range corresponding to the preset pH value marked in the color card database. If so, the preset pH value gets one vote; otherwise, compare the next pH value until all pH values are compared includes: Successively compare the three pixel-level colors with the highest distribution in the pixel histogram with the color range in the color card database from the color range corresponding to pH = 1 to the color range corresponding to pH = 14, and determine whether they are within the color range corresponding to the preset pH value in the color card database. If so, the preset pH value gets one vote; otherwise, compare the next pH value until all pH values are compared.

6. The online pH value detection method according to any one of claims 1-5, characterized in that, The preset automated pH detection system includes: A light-shielding container; A pH test paper fixing device installed inside the light-shielding container, on which a pH test paper is fixed; A sampling device connected to a rotating device inside the light-shielding container, and the rotating device is used to rotate the sampling device; A sampling pipe, the first end of which is connected to the sample container, and the second end of which faces the sampling device, the sampling device can be rotated to a first position in contact with the sample flowing out of the sampling pipe, and can be rotated to a second position in contact with the pH test paper to guide the sample to the first side of the pH test paper to make it color; The color recognition device is arranged facing the second side of the pH test paper away from the sampling device, and is used to obtain the color of the pH test paper after color development.

7. The online pH value detection method according to claim 6, characterized in that, The pH test paper fixing device comprises: pH test paper container; A servo motor is spaced a preset distance from the pH test paper; The first end of the pH test paper is bound to the rotating shaft of the servo motor, and the second end of the pH test paper is located in the pH test paper container. The pH test paper is located between the sampling device and the color recognition device, and the servo motor is used to drive the pH test paper to be drawn out of the pH test paper container when rotating the rotating shaft to achieve the switching of the pH test paper.

8. The on-line pH value detection method according to claim 7, characterized in that, The color recognition device comprises: An industrial camera is arranged facing the second side of the pH test paper away from the sampling device; A parallel light source is arranged facing the second side of the pH test paper away from the sampling device.

9. The on-line pH value detection method according to claim 8, characterized in that, The preset automated pH value detection system also includes: A control device is electrically connected to the color recognition device and the rotating device, and is used to control the sampling device to rotate to a first position in contact with the sample flowing out of the sampling pipe, and apply the sample to the sampling device, and is used to control the sampling device to rotate to a second position in contact with the pH test paper, and guide the sample to the first side of the pH test paper to make it develop color, and is used to control the color recognition device to obtain the color of the pH test paper after the color development.

10. The on-line pH value detection method according to claim 9, characterized in that, The sampling device is a glass rod, and the control device is a programmable logic controller.