Image recognition-based azoic coupling component AS-PH chromaticity detection method and system

Through image recognition-based detection methods, combined with grayscale correction, adaptive sampling and dual Gaussian fuzzy noise denoising technologies, the problems of strong subjectivity and unstable detection accuracy in color phenol AS-PH detection technology are solved, and the quantitative detection effect with high accuracy and high reliability is achieved.

CN119942148AActive Publication Date: 2025-05-06SHANDONG ANDY NEW MATERIAL CO LTD

Patent Information

Application Number
CN202510006878.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-03
Publication Date
2025-05-06
Estimated Expiration
2045-01-03

AI Technical Summary

Technical Problem

The existing color phenol AS-PH detection technology has problems such as strong subjectivity, unstable detection accuracy, cumbersome operation, image noise interference, and uneven light, resulting in low stability and reliability of the detection results.

Method used

Using an image recognition-based detection method, the effective detection area of ​​the color phenol AS-PH test strip is extracted and its concentration value is calculated by placing the color phenol AS-PH test strip on a standard whiteboard, collecting RGB images, and performing technical processing such as grayscale correction, adaptive sampling, double Gaussian blur denoising, sub-region stability evaluation, and two-level concentration mapping model.

Benefits of technology

High-precision and high-reliability quantitative detection of color phenol AS-PH test strips was achieved, which significantly improved the measurement accuracy, controlled the relative deviation between ±4% and 12%, and a strict result verification mechanism was established to ensure the accuracy and reliability of the test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119942148A_ABST
    Figure CN119942148A_ABST
Patent Text Reader

Abstract

The invention discloses an azoic coupling component AS-PH chromaticity detection method and system based on image recognition, and relates to the technical field of image recognized.The method comprises the steps that azoic coupling component AS-PH test paper to be detected is placed on a standard white board, and RGB images of the azoic coupling component AS-PH test paper are collected through a camera; carrying out gray scale correction on the RGB image to obtain a corrected RGB corrected image; extracting an effective detection area of the azoic coupling component AS-PH test paper from the RGB corrected image, and eliminating edge noise of the effective detection area through a dual Gaussian blur algorithm; dividing the effective detection region into a plurality of equal-area sub-regions, calculating an RGB mean value of each sub-region, and selecting a central sub-region with the most stable RGB mean value as a target detection region; and according to the RGB value of the target detection area, in combination with a pre-established azoic coupling component AS-PH concentration-RGB mapping model, obtaining a concentration value of azoic coupling component AS-PH to be detected. According to the method, the problems of image noise, color instability, measurement errors and the like in a traditional detection method are effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of image recognition, and in particular to a method and system for detecting the chromaticity of naphthol AS-PH based on image recognition. Background Art

[0002] As an important biomarker, AS-PH has significant significance in medical diagnosis and physiological research. In recent years, with the rapid development of medical detection technology, the quantitative detection methods of biomarkers have continued to evolve. Traditional colorimetric detection technology mainly relies on manual visual inspection or professional spectrophotometers. These methods have prominent problems such as strong subjectivity, unstable detection accuracy, and cumbersome operation. With the iterative update of digital image processing technology and machine vision algorithms, quantitative detection methods based on image recognition have gradually become a research hotspot, providing a new technical path for biomarker detection.

[0003] Existing AS-PH detection technology faces many technical bottlenecks. First, the measurement accuracy of traditional detection methods is often limited by the subjective judgment of the human eye and the ambient light conditions, making it difficult to achieve accurate and standardized quantitative analysis. Secondly, existing image recognition methods generally have problems such as edge noise interference and uneven illumination when processing test paper images, resulting in low stability and reliability of the detection results. Especially in scenes with slight changes in chromaticity, the existing technology is often difficult to accurately capture subtle differences in color, which seriously restricts the sensitivity and accuracy of the detection. In contrast, the present invention significantly improves the signal-to-noise ratio and detection accuracy of AS-PH test paper images through innovative image preprocessing and region selection strategies. Summary of the invention

[0004] In view of the problems existing in the prior art, the present invention proposes a method and system for detecting the chromaticity of AS-PH based on image recognition.

[0005] Therefore, a method for detecting the colorimetric properties of AS-PH based on image recognition is provided, which can solve the problems mentioned in the background technology.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0007] In a first aspect, an embodiment of the present invention provides a method for detecting the colorimetric properties of AS-PH based on image recognition, which comprises:

[0008] The naphthol AS-PH test paper to be tested is placed on a standard white board, and an RGB image of the naphthol AS-PH test paper is collected by a camera;

[0009] Grayscale correction is performed on the RGB image to obtain a corrected RGB correction image; the correction uses a preset reflectivity value of a standard white plate area as a reference; the standard white plate area is a rectangular area at a preset distance from the outer side of the edge of the naphthol AS-PH test paper; an adaptive sampling method is used in the rectangular area;

[0010] Extracting the effective detection area of ​​the Naphthol AS-PH test paper from the RGB corrected image, and eliminating edge noise of the effective detection area by a double Gaussian blur algorithm;

[0011] Divide the effective detection area into multiple sub-areas of equal area, calculate the RGB mean of each sub-area, and select the central sub-area with the most stable RGB mean as the target detection area;

[0012] According to the RGB value of the target detection area, combined with the pre-established naphthol AS-PH concentration-RGB mapping model, the concentration value of the naphthol AS-PH to be tested is obtained.

[0013] As a preferred solution of the image recognition-based colorimetric detection method of AS-PH of the present invention, wherein: the adaptive sampling method includes dividing the rectangular area into nine equal small areas, and using adaptive weighted sampling at the center point of each small area;

[0014] The calculation of the sampling weight of the adaptive weighted sampling is shown in the following formula:

[0015]

[0016] Among them, x0 represents the coordinate value of the center point of the sampling area in the horizontal direction of the image, y0 represents the coordinate value of the center point of the sampling area in the vertical direction of the image, x represents the coordinate value of the pixel point in the horizontal direction of the image, y represents the coordinate value of the pixel point in the vertical direction of the image, σ is the sampling radius parameter, α is the gradient weight coefficient, is the image gradient at the pixel point (x, y), and ω(x, y) is the sampling weight.

[0017] As a preferred embodiment of the method for detecting the colorimetric degree of Naphthol AS-PH based on image recognition according to the present invention, obtaining the RGB correction image comprises:

[0018] Calculating the weighted average values ​​of the nine equal small areas according to the sampling weights to obtain the measured RGB mean value of the standard whiteboard area;

[0019] Calculate the correction coefficients of the three channels of RGB respectively according to the preset reflection value of the standard whiteboard area;

[0020] A correction mapping function is constructed, and the RGB three-channel value of each pixel point of the RGB image is corrected by the nonlinear correction mapping function to generate the RGB corrected image.

[0021] As a preferred embodiment of the method for detecting the colorimetric value of the chromatin AS-PH based on image recognition of the present invention, the calculation of the measured RGB mean value is shown in the following formula:

[0022]

[0023] Among them, I (RGB) (x, y) is the RGB channel value at the pixel point (x, y), V (RGB) is the measured RGB mean, S is the sampling area;

[0024] The calculation of the correction coefficient is shown below:

[0025]

[0026] Among them, β is the correction compensation coefficient, σ (RGB) is the standard deviation of the corresponding channel, κ (RGB) is the correction factor;

[0027] The nonlinear correction mapping function is expressed by the following formula:

[0028]

[0029] Among them, γ is the nonlinear adjustment coefficient, x1 is the original RGB channel value, M (RGB) (x1) is the nonlinear correction mapping function.

[0030] As a preferred solution of the colorimetric detection method of AS-PH based on image recognition described in the present invention, wherein: the double Gaussian blur algorithm includes a first Gaussian blur kernel function and a second adaptive Gaussian blur kernel function;

[0031] The first Gaussian blur kernel function is expressed as follows:

[0032]

[0033] Among them, σ1 is the standard deviation, G1(x,y) is the first Gaussian blur kernel function;

[0034] The second adaptive Gaussian blur kernel function is expressed as follows:

[0035]

[0036] Among them, σ2(x,y) is the adaptive standard deviation, G2(x,y) is the second adaptive Gaussian blur kernel function, and the calculation formula is:

[0037]

[0038] Among them, k1 is the reference coefficient, k2 is the gradient influence factor, is the edge gradient value of the effective detection area.

[0039] As a preferred embodiment of the method for detecting the colorimetric amount of Naphthol AS-PH based on image recognition according to the present invention, wherein: the target detection area is determined according to the sub-region stability evaluation index;

[0040] The stability evaluation indexes include:

[0041] The RGB mean difference between the sub-region and its eight adjacent sub-regions δ i,j , the RGB standard deviation of the sub-region itself σ i,j (R, G, B), the normalized distance d from the sub-region to the center of the effective detection area i,j And the entropy value H of the pixel value in the sub-region i,j ;

[0042] All sub-regions are sorted according to the comprehensive evaluation index, and the sub-region with the best evaluation index and located in the central area of ​​the detection area is selected as the target detection area, and the central area is defined as the area range with a distance of not less than N / 4 to the edge of the detection area;

[0043] The value of N is dynamically determined by the area S of the effective detection area, and the calculation formula is:

[0044] As a preferred embodiment of the method for detecting the colorimetric amount of Naphthol AS-PH based on image recognition of the present invention, wherein: the Naphthol AS-PH concentration-RGB mapping model includes a primary mapping function and a fine mapping function;

[0045] The primary mapping function divides the entire concentration detection range into multiple sub-intervals, each sub-interval corresponds to a local linear mapping relationship, and for an input RGB feature value, the concentration sub-interval to which it belongs is determined by calculating the minimum color difference distance between the input RGB feature value and a pre-stored standard color card RGB feature library. After the sub-interval is determined, the standard concentration value and RGB feature value corresponding to both ends of the interval are extracted, and a rough concentration estimate is obtained by linear interpolation;

[0046] The fine mapping function is based on the rough concentration estimate, with the concentration value obtained by the primary mapping as the center, and selects multiple adjacent standard points in the standard concentration sequence, and assigns different weights to these standard points; then the weighted standard points are used to establish a local regression equation, and on the basis of the regression equation, the regression parameters are continuously adjusted through multiple rounds of calculations until the difference between two adjacent calculation results is less than a preset threshold or the maximum number of iterations is reached, and the fine concentration value is obtained; the weight is determined by the RGB feature similarity between the point and the point to be tested,

[0047] The higher the similarity, the greater the weight.

[0048] As a preferred embodiment of the method for detecting the colorimetric value of Naphthol AS-PH based on image recognition according to the present invention, obtaining the concentration value comprises:

[0049] Calculate the multi-scale RGB feature vector of the target detection area and perform feature fusion;

[0050] Determine the rough concentration range using the primary mapping function;

[0051] Select adjacent standard points within the range to establish a local mapping relationship;

[0052] Applying a fine mapping function to calculate the concentration value;

[0053] Conducting reliability assessment on the concentration value;

[0054] The reliability assessment includes:

[0055] The coefficient of variation of the RGB values ​​of the target detection area is less than 3%;

[0056] The correlation coefficient of local mapping is not less than 0.98;

[0057] The deviation between the calculated result and the adjacent standard concentration point does not exceed the allowable range;

[0058] The reliability assessment of the concentration value must meet the above reliability requirements at the same time, otherwise the resampling mechanism will be triggered; when three consecutive calculation results fail to pass the reliability verification, a measurement abnormality will be reported.

[0059] In a second aspect, an embodiment of the present invention provides a system for detecting the colorimetric properties of naphthol AS-PH based on image recognition, which comprises:

[0060] An acquisition module is used to place the naphthol AS-PH test paper to be tested on a standard white board and acquire an RGB image of the naphthol AS-PH test paper through a camera;

[0061] A correction module is used to perform grayscale correction on the RGB image to obtain a corrected RGB correction image; the correction uses a preset reflectivity value of a standard white plate area as a reference; the standard white plate area is a rectangular area at a preset distance from the outer side of the edge of the naphthol AS-PH test paper; an adaptive sampling method is used in the rectangular area;

[0062] An effective detection module, used for extracting an effective detection area of ​​the naphthol AS-PH test paper from the RGB correction image, and eliminating edge noise of the effective detection area by a double Gaussian blur algorithm;

[0063] A target detection module is used to divide the effective detection area into multiple sub-areas of equal area, calculate the RGB mean of each sub-area, and select the central sub-area with the most stable RGB mean as the target detection area;

[0064] The concentration calculation module is used to obtain the concentration value of the to-be-tested naphthol AS-PH according to the RGB value of the target detection area in combination with a pre-established naphthol AS-PH concentration-RGB mapping model.

[0065] The beneficial effect of the present invention is to achieve high-precision and high-reliability quantitative detection of the AS-PH test paper for color phenol. Its core advantage lies in the use of technologies such as standard whiteboard correction, adaptive sampling, dual Gaussian blur denoising, sub-region stability evaluation, and dual-level concentration mapping model, which effectively overcomes the problems of image noise, color instability, and measurement error existing in traditional detection methods. This method not only significantly improves the measurement accuracy and controls the relative deviation of different concentration ranges between ±4%-12%, but also establishes a strict result verification mechanism. When the measurement result does not meet the reliability requirement, it can automatically trigger resampling, thereby ensuring the accuracy and reliability of the test result, and has a strong practical value and promotion significance. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:

[0067] Figure 1 The figure is a flow chart of a method for colorimetric detection of phenol AS-PH based on image recognition. DETAILED DESCRIPTION

[0068] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.

[0069] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0070] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.

[0071] The present invention is described in detail with reference to schematic diagrams. When describing the embodiments of the present invention, for the sake of convenience, the cross-sectional diagrams showing the device structure will not be partially enlarged according to the general scale, and the schematic diagrams are only examples, which should not limit the scope of protection of the present invention. In addition, in actual production, the three-dimensional dimensions of length, width and depth should be included.

[0072] At the same time, in the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "upper, lower, inner and outer" are based on the directions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as limiting the present invention. In addition, the terms "first, second or third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.

[0073] In the present invention, unless otherwise clearly specified and limited, the terms "install, connect, connect" should be understood in a broad sense, for example: it can be a fixed connection, a detachable connection or an integral connection; it can also be a mechanical connection, an electrical connection or a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0074] Example 1

[0075] Reference Figure 1, which is the first embodiment of the present invention, provides a method for detecting the colorimetric value of AS-PH based on image recognition, comprising:

[0076] S1: placing a naphthol AS-PH test paper to be tested on a standard white board, and collecting an RGB image of the naphthol AS-PH test paper through a camera, wherein the standard white board has a preset reflectivity;

[0077] The phenol AS-PH test paper to be tested is placed flatly in the center of the detection area of ​​a standard whiteboard with a preset reflectivity of 90%, the standard whiteboard is made of polytetrafluoroethylene material and has no scratches on the surface, and the side length of the standard whiteboard is 20 cm; a 2 million pixel camera is vertically set 30 cm away from the standard whiteboard, the aperture value of the camera is set to F2.8, the field of view angle of the camera is set to 45 degrees, and the RGB image of the phenol AS-PH test paper is collected by the camera under the irradiation of the D65 standard light source of 1000 lux.

[0078] S2: grayscale correction is performed on the RGB image, using a preset reflectivity value of a standard white plate as a reference to obtain a corrected RGB correction image;

[0079] The RGB three-channel values ​​of the standard white plate area in the RGB image are sampled and analyzed, wherein the standard white plate area is selected as a rectangular area 5 cm outside the edge of the phenol AS-PH test paper, recorded as the sampling area S, and the side length of the rectangular area is 10 cm; the nine-point sampling method is used in the rectangular area to divide the rectangular area into nine equal small areas, and the RGB value is sampled at the center of each small area; different weight coefficients are set for the RGB values ​​of the nine sampling points, that is, adaptive weighted sampling, and the calculation formula of the sampling weight is as follows:

[0080]

[0081] Among them, x0 represents the coordinate value of the center point of the sampling area in the horizontal direction of the image, y0 represents the coordinate value of the center point of the sampling area in the vertical direction of the image, x represents the coordinate value of the pixel point in the horizontal direction of the image, y represents the coordinate value of the pixel point in the vertical direction of the image, σ is the sampling radius parameter, which is 1 / 4 of the side length of the sampling area, α is the gradient weight coefficient, which is 0.5, is the image gradient at the pixel point (x, y).

[0082] The weighted average values ​​of the three RGB channels of the nine sampling points are calculated respectively to obtain the measured RGB mean value of the standard whiteboard area, namely:

[0083]

[0084] Among them, I(RGB) (x,y) is the RGB channel value at the pixel point (x,y).

[0085] Based on the preset reflectivity value of 90% of the standard whiteboard, the theoretical whiteboard RGB value is set to (230, 230, 230), and the correction coefficients of the three RGB channels are calculated respectively. The correction coefficients are equal to the ratio of the theoretical RGB value to the measured RGB mean value, that is:

[0086]

[0087] Among them, β is the correction compensation coefficient, which is 0.15, σ (RGB) is the standard deviation of the corresponding channel.

[0088] Furthermore, a nonlinear correction mapping function is constructed:

[0089]

[0090] Among them, γ is the nonlinear adjustment coefficient, the value is 0.1, x1 is the original RGB channel value, M (RGB) (x) is the nonlinear correction mapping function.

[0091] The RGB three-channel value of each pixel point of the RGB image is corrected by the nonlinear correction mapping function to generate the RGB corrected image:

[0092] I′ (RGB) (x,y)=M (RGB) (I (RGB) (x,y)

[0093] Among them, I′ (RGB) (x,y) is the RGB corrected image.

[0094] By sampling and testing the whiteboard area of ​​the RGB correction image, the standard deviation of the RGB three-channel values ​​must be less than 3 gray levels, and the deviation between the average value and the theoretical value must not exceed 1%.

[0095] S3: extracting the effective detection area of ​​the Naphthol AS-PH test paper from the RGB corrected image, and eliminating edge noise of the effective detection area by Gaussian blur algorithm;

[0096] The contour of the Naphthol AS-PH test paper is extracted from the RGB corrected image by an adaptive threshold segmentation algorithm, and the contour is shrunk inward by 8 pixels as the effective detection area R of the Naphthol AS-PH test paper; a double adaptive Gaussian blur process is applied to the effective detection area R, and the first Gaussian blur kernel function G1(x, y) is defined as:

[0097]

[0098] Among them, σ1 is the standard deviation, the initial value is set to 1.5, and the kernel size is 7×7 pixels;

[0099] Calculate the edge gradient value of the effective detection area

[0100]

[0101] in, and Calculated by a 3×3 pixel Sobel operator.

[0102] The second adaptive Gaussian blur kernel function G2(x,y) is defined as:

[0103]

[0104] Among them, σ2(x,y) is the adaptive standard deviation, and the calculation formula is:

[0105]

[0106] Among them, k1 is the reference coefficient, the value is 2.0, k2 is the gradient influence factor, the value is 0.1, is the edge gradient value of the effective detection area.

[0107] A weight decay model is established according to the distance from the effective detection area to the edge. The weight decay model adopts an exponentially decreasing function, with a weight of 0.3 at the edge and a weight of 0.7 at the center, and is defined as:

[0108] W(x,y)=0.7×exp(-λd(x,y))+0.3

[0109] Where d(x,y) is the minimum normalized distance from the pixel point (x,y) to the edge of the effective detection area, and λ is the attenuation coefficient, which is 3.0.

[0110] Finally, the double Gaussian blur results are fused through the weight attenuation model to obtain the effective detection area after noise reduction:

[0111]

[0112] S4: Divide the effective detection area into a plurality of sub-areas of equal area, calculate the RGB mean of each sub-area, and select the central sub-area with the most stable RGB mean as the target detection area;

[0113] The effective detection area is divided into N×N equal-area sub-areas, where the value of N is dynamically determined by the area S of the effective detection area, and the calculation formula is: Ensure that the area of ​​each sub-region is not less than 100 square pixels; for each sub-region S i,j (i,j∈[1,N] calculate the mean μ of the three RGB channels i,j (R,G,B)(i,j∈[1,N]), and calculate the standard deviation σ of the RGB values ​​in each sub-region i,j (R,G,B).

[0114] Establish the sub-region stability evaluation index φ i,j The stability evaluation index comprehensively considers the following factors: First, the RGB mean difference δ between the sub-region and its eight adjacent sub-regions i,j ; Second, the RGB standard deviation of the sub-region itself σ i,j (R, G, B); Third, the normalized distance d from the sub-region to the center of the effective detection area i,j ; Fourth, the entropy value H of the pixel value in the sub-region i,j .

[0115] Specifically, the stability evaluation index φ i,j The calculation process is as follows: First, calculate the RGB mean difference between the sub-region and its adjacent sub-regions:

[0116] For each sub-region, a sliding window of 5×5 pixels is set, the local variance is calculated pixel by pixel, and the region with the smallest local variance is selected as the feature region of the sub-region; the RGB mean of the feature region is calculated and used as the representative value of the sub-region; the temporal stability analysis of the representative value is performed, 5 frames of images are continuously collected, and the temporal variance of the representative value is calculated; the spatial stability and temporal stability indicators are weighted and fused to obtain a comprehensive evaluation index;

[0117] All sub-regions are sorted according to the comprehensive evaluation index, and the sub-region with the best evaluation index and located in the central area of ​​the detection area is selected as the target detection area. The central area is defined as the area range whose distance to the edge of the detection area is not less than N / 4.

[0118] After the target detection area is determined, its boundary is optimized: expand outward by 2 pixels, and use the contour smoothness criterion. If the curvature change of the expanded boundary contour exceeds the preset threshold, the expansion in this direction is retracted; the integrity of the final target detection area is verified, requiring that the area of ​​the target detection area is not less than 4% of the original effective detection area, and the aspect ratio is between 0.8-1.2.

[0119] S5: According to the RGB value of the target detection area, combined with the pre-established naphthol AS-PH concentration-RGB mapping model, the concentration value of the naphthol AS-PH to be tested is obtained.

[0120] Multi-scale RGB feature extraction is performed on the target detection area. First, three sampling grids of different scales are set in the target detection area, namely 4×4, 8×8 and 16×16 pixels, and RGB values ​​are sampled for each grid. An adaptive weighting method is used to fuse the sampling results of different scales, and the weighting coefficient is inversely proportional to the variance of the sampling grid. The fused RGB feature vector is normalized to obtain a standardized RGB feature value ξ(R, G, B).

[0121] A two-level AS-PH concentration mapping model was established, which included the following components: first, a primary mapping function M1 based on polynomial fitting was established, which mapped the RGB feature values ​​to a rough concentration range; second, a fine mapping function M2 based on local linear regression was constructed, which accurately calculated the concentration value based on the primary mapping.

[0122] Specifically, the primary mapping function first divides the entire concentration detection range into multiple sub-intervals, each of which corresponds to a local linear mapping relationship. For the input RGB feature value, the concentration sub-interval to which it belongs is determined by first calculating the minimum color difference distance between the input RGB feature value and the pre-stored standard color card RGB feature library. After determining the sub-interval, the system extracts the standard concentration value and RGB feature value corresponding to the two ends of the interval, and obtains a rough concentration estimate through linear interpolation.

[0123] The fine mapping function is based on the rough concentration estimate, with the concentration value obtained by the primary mapping as the center, and selects multiple adjacent standard points (usually 5 points) in the standard concentration sequence. Different weights are assigned to these standard points, and the weight value is determined by the RGB feature similarity between the point and the point to be tested. The higher the similarity, the greater the weight. Then, a local regression equation is established using these weighted standard points. Based on the regression equation, the regression parameters are continuously adjusted through multiple rounds of calculations until the difference between two adjacent calculation results is less than the preset threshold or the maximum number of iterations is reached. Finally, the validity of the calculated fine concentration value is verified.

[0124] Specifically, the calculation process of the concentration value C of the tested naphthol AS-PH includes:

[0125] Calculate the multi-scale RGB feature vector of the target detection area and perform feature fusion;

[0126] Determine the rough concentration range using the primary mapping function;

[0127] Select adjacent standard points within the range to establish a local mapping relationship;

[0128] Apply the refined mapping function to calculate the final concentration value;

[0129] Conduct reliability assessment on the calculation results.

[0130] To ensure the reliability of the measurement results, the following verification mechanism is set up:

[0131] The coefficient of variation of the RGB value of the target detection area is required to be less than 3%;

[0132] The correlation coefficient of local mapping is not less than 0.98;

[0133] The deviation between the calculated result and the adjacent standard concentration point shall not exceed the allowable range.

[0134] The concentration value calculation results must meet the above reliability requirements at the same time, otherwise the resampling mechanism will be triggered. When three consecutive calculation results fail to pass the reliability verification, the system will report a measurement abnormality.

[0135] It should be noted that the calculation result deviation limit adopts a multi-level constraint mechanism:

[0136] Set different allowable deviation ratios for different concentration ranges:

[0137] When the standard concentration is ≤0.5mg / L, the allowable relative deviation ε1 shall not exceed ±12%.

[0138] When 0.5mg / L<standard concentration≤2.0mg / L, the allowable relative deviation ε2 shall not exceed ±8%.

[0139] When 2.0mg / L<standard concentration≤5.0mg / L, the allowable relative deviation ε3 shall not exceed ±6%.

[0140] When the standard concentration is >5.0 mg / L, the allowable relative deviation ε4 shall not exceed ±4%.

[0141] Furthermore, this embodiment also provides a chromaticity detection system of Naphthol AS-PH based on image recognition, comprising:

[0142] An acquisition module is used to place the naphthol AS-PH test paper to be tested on a standard white board and acquire an RGB image of the naphthol AS-PH test paper through a camera;

[0143] A correction module is used to perform grayscale correction on the RGB image to obtain a corrected RGB correction image; the correction uses a preset reflectivity value of a standard white plate area as a reference; the standard white plate area is a rectangular area at a preset distance from the outer side of the edge of the naphthol AS-PH test paper; an adaptive sampling method is used in the rectangular area;

[0144] An effective detection module, used for extracting an effective detection area of ​​the naphthol AS-PH test paper from the RGB correction image, and eliminating edge noise of the effective detection area by a double Gaussian blur algorithm;

[0145] A target detection module is used to divide the effective detection area into multiple sub-areas of equal area, calculate the RGB mean of each sub-area, and select the central sub-area with the most stable RGB mean as the target detection area;

[0146] The concentration calculation module is used to obtain the concentration value of the to-be-tested naphthol AS-PH according to the RGB value of the target detection area in combination with a pre-established naphthol AS-PH concentration-RGB mapping model.

[0147] This embodiment also provides a computer device, which is suitable for the case of the colorimetric detection method of the chromophore AS-PH based on image recognition, and includes a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the colorimetric detection method of the chromophore AS-PH based on image recognition as proposed in the above embodiment.

[0148] The computer device may be a terminal, and the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covering the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.

[0149] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the method for detecting the colorimetry of AS-PH based on image recognition as proposed in the above embodiment is implemented.

[0150] The storage medium proposed in this embodiment and the data storage method proposed in the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be found in the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0151] Example 2

[0152] This is the second embodiment of the present invention, which provides a method for detecting the colorimetry of AS-PH based on image recognition. In order to verify the beneficial effects of the present invention, a scientific demonstration is carried out through simulation experiments.

[0153] In order to verify the reliability and accuracy of the concentration detection method of the phenol AS-PH test paper, a systematic experimental study was carried out under laboratory conditions. The standard laboratory of the Environmental Science Research Center was selected as the research site, and a high-precision optical system and professional image processing equipment were used to strictly control the experimental environment and measurement conditions. The experimental equipment includes: a 2-megapixel industrial-grade CCD camera (model: MV-CA020-10GC), a D65 standard light source (model: TCSS-D65-1000), a polytetrafluoroethylene standard white plate (reflectivity 90%), and a high-precision phenol AS-PH standard solution.

[0154] Before the experiment, the experimental environment was first standardized. A standard polytetrafluoroethylene white board with a size of 20cm×20cm was selected to ensure that there were no scratches or abnormal reflections on its surface. The camera was installed 30cm away from the white board, placed vertically, with the aperture value set to F2.8 and the field of view angle of 45 degrees. The light intensity in the laboratory was precisely controlled at 1000lux, and the D65 standard light source was used to ensure the consistency of the spectral distribution. Prepare different concentrations of phenol AS-PH test papers, covering a concentration range of 0.1mg / L to 10mg / L, and make 5 parallel samples for each concentration gradient.

[0155] During the image acquisition process, standardized operations were strictly performed in accordance with the invented method. First, the color phenol AS-PH test paper was placed flat in the center of a standard whiteboard, ensuring that the edge of the test paper was kept 5 cm away from the edge of the whiteboard. A 2-megapixel camera was used for RGB image acquisition, and multiple image processing algorithms were executed. In the image correction stage, a 10 cm × 10 cm rectangular area 5 cm away from the edge of the test paper was selected as the sampling area, and a nine-point adaptive weighted sampling method was used, and image correction was performed through a nonlinear correction mapping function. During the image processing process, the whiteboard area of ​​the RGB corrected image was focused on, requiring that the standard deviation of the RGB three-channel values ​​be less than 3 gray levels, and that the average value deviate from the theoretical value by no more than 1%.

[0156] The experimental data are recorded in Table 1 below:

[0157] Table 1. Experimental data of phenol AS-PH concentration detection.

[0158]

[0159]

[0160] The experimental data were analyzed in depth, and the results showed the significant advantages of the invented method in the detection of AS-PH concentration. First, in the concentration range of 0.1 mg / L to 10 mg / L, the actual detection value was highly consistent with the standard value, and the relative error was controlled within ±2.6%, which was much better than the error level of the traditional detection method. Secondly, as the concentration increased, the relative error showed a trend of gradually decreasing, which showed that the method had good linear correlation and stability.

[0161] The stability evaluation index gradually increased from 0.92 to 0.98, which fully verified the effectiveness of multi-scale RGB feature extraction and dual-level concentration mapping model. Compared with the traditional single linear mapping method, this method significantly improves the accuracy of concentration detection through the combination of primary polynomial fitting and local linear regression. Especially in the low concentration range (≤0.5mg / L), the relative error is controlled within 2.6%, and this performance indicator is at the leading level among similar technologies.

[0162] The trend of the change in the RGB mean also confirms the scientific nature of the detection method. As the concentration increases, the RGB value shows a linear decreasing characteristic. This regularity provides an important basis for establishing a reliable concentration-RGB mapping model. Through adaptive weighted sampling and nonlinear correction mapping, the influence of image noise and light fluctuation is successfully eliminated, ensuring the accuracy and repeatability of the measurement results.

[0163] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A method for detecting the colorimetric properties of Naphthol AS-PH based on image recognition, characterized in that: include: The naphthol AS-PH test paper to be tested is placed on a standard white board, and an RGB image of the naphthol AS-PH test paper is collected by a camera; Grayscale correction is performed on the RGB image to obtain a corrected RGB correction image; the correction uses a preset reflectivity value of a standard white plate area as a reference; the standard white plate area is a rectangular area at a preset distance from the outer side of the edge of the naphthol AS-PH test paper; an adaptive sampling method is used in the rectangular area; Extracting the effective detection area of ​​the Naphthol AS-PH test paper from the RGB corrected image, and eliminating edge noise of the effective detection area by a double Gaussian blur algorithm; Divide the effective detection area into multiple sub-areas of equal area, calculate the RGB mean of each sub-area, and select the central sub-area with the most stable RGB mean as the target detection area; According to the RGB value of the target detection area, combined with the pre-established naphthol AS-PH concentration-RGB mapping model, the concentration value of the naphthol AS-PH to be tested is obtained.

2. The method for detecting the colorimetric properties of Naphthol AS-PH based on image recognition as claimed in claim 1, characterized in that: The adaptive sampling method includes dividing the rectangular area into nine equal small areas, and adopting adaptive weighted sampling at the center point of each small area; The calculation of the sampling weight of the adaptive weighted sampling is shown in the following formula: Among them, x0 represents the coordinate value of the center point of the sampling area in the horizontal direction of the image, y0 represents the coordinate value of the center point of the sampling area in the vertical direction of the image, x represents the coordinate value of the pixel point in the horizontal direction of the image, y represents the coordinate value of the pixel point in the vertical direction of the image, σ is the sampling radius parameter, α is the gradient weight coefficient, is the image gradient at the pixel point (x, y), and ω(x, y) is the sampling weight.

3. The method for detecting the colorimetric properties of Naphthol AS-PH based on image recognition as claimed in claim 2, characterized in that: Obtaining the RGB corrected image comprises: Calculating the weighted average values ​​of the nine equal small areas according to the sampling weights to obtain the measured RGB mean value of the standard whiteboard area; Calculate the correction coefficients of the three channels of RGB respectively according to the preset reflection value of the standard whiteboard area; A correction mapping function is constructed, and the values ​​of the RGB three channels of each pixel point of the RGB image are corrected by the nonlinear correction mapping function to generate the RGB corrected image.

4. The method for detecting the colorimetric properties of Naphthol AS-PH based on image recognition as claimed in claim 3, characterized in that: The calculation of the measured RGB mean is shown in the following formula: Among them, I (RGB) (x, y) is the RGB channel value at the pixel point (x, y), V (RGB) is the measured RGB mean, S is the sampling area; The calculation of the correction coefficient is shown below: Among them, β is the correction compensation coefficient, σ (RGB) is the standard deviation of the corresponding channel, κ (RGB) is the correction factor; The nonlinear correction mapping function is expressed by the following formula: Among them, γ is the nonlinear adjustment coefficient, x1 is the original RGB channel value, M (RGB) (x1) is the nonlinear correction mapping function.

5. The method for detecting the colorimetric amount of Naphthol AS-PH based on image recognition as claimed in claim 4, characterized in that: The dual Gaussian blur algorithm includes a first Gaussian blur kernel function and a second adaptive Gaussian blur kernel function; The first Gaussian blur kernel function is expressed as follows: Among them, σ1 is the standard deviation, G1(x,y) is the first Gaussian blur kernel function; The second adaptive Gaussian blur kernel function is expressed as follows: Among them, σ2(x,y) is the adaptive standard deviation, G2(x,y) is the second adaptive Gaussian blur kernel function, and the calculation formula is: Among them, k1 is the reference coefficient, k2 is the gradient influence factor, is the edge gradient value of the effective detection area.

6. The method for detecting the colorimetric amount of Naphthol AS-PH based on image recognition as claimed in claim 5, characterized in that: The target detection area is determined according to the sub-region stability evaluation index; The stability evaluation indexes include: The RGB mean difference between the sub-region and its eight adjacent sub-regions δ i,j , the RGB standard deviation of the sub-region itself σ i,j (R, G, B), the normalized distance d from the sub-region to the center of the effective detection area i,j And the entropy value H of the pixel value in the sub-region i,j ; All sub-regions are sorted according to the comprehensive evaluation index, and the sub-region with the best evaluation index and located in the central area of ​​the detection area is selected as the target detection area, and the central area is defined as the area range with a distance of not less than N / 4 to the edge of the detection area; The value of N is dynamically determined by the area S of the effective detection area, and the calculation formula is:

7. The method for detecting the colorimetric amount of Naphthol AS-PH based on image recognition as claimed in claim 6, characterized in that: The naphthophenol AS-PH concentration-RGB mapping model includes a primary mapping function and a fine mapping function; The primary mapping function divides the entire concentration detection range into multiple sub-intervals, each sub-interval corresponds to a local linear mapping relationship, and for an input RGB feature value, the concentration sub-interval to which it belongs is determined by calculating the minimum color difference distance between the input RGB feature value and a pre-stored standard color card RGB feature library. After the sub-interval is determined, the standard concentration value and RGB feature value corresponding to both ends of the interval are extracted, and a rough concentration estimate is obtained by linear interpolation; The fine mapping function is based on the rough concentration estimate, with the concentration value obtained by the primary mapping as the center, and selects multiple adjacent standard points in the standard concentration sequence, and assigns different weights to these standard points; then the weighted standard points are used to establish a local regression equation, and on the basis of the regression equation, the regression parameters are continuously adjusted through multiple rounds of calculations until the difference between two adjacent calculation results is less than a preset threshold or the maximum number of iterations is reached, so as to obtain a fine concentration value; the weight is determined by the RGB feature similarity between the point and the point to be tested, and the higher the similarity, the greater the weight.

8. The method for detecting the colorimetric amount of Naphthol AS-PH based on image recognition as claimed in claim 7, characterized in that: Obtaining the concentration value includes: Calculate the multi-scale RGB feature vector of the target detection area and perform feature fusion; Determine the rough concentration range using the primary mapping function; Select adjacent standard points within the range to establish a local mapping relationship; Applying a fine mapping function to calculate the concentration value; Conducting reliability assessment on the concentration value; The reliability assessment includes: The coefficient of variation of the RGB values ​​of the target detection area is less than 3%; The correlation coefficient of local mapping is not less than 0.98; The deviation between the calculated result and the adjacent standard concentration point does not exceed the allowable range; The reliability assessment of the concentration value must meet the above reliability requirements at the same time, otherwise the resampling mechanism will be triggered; when three consecutive calculation results fail to pass the reliability verification, a measurement abnormality will be reported.

9. A system for detecting the colorimetric properties of Naphthol AS-PH based on image recognition, based on the method for detecting the colorimetric properties of Naphthol AS-PH based on image recognition according to any one of claims 1 to 8, characterized in that: include: An acquisition module is used to place the naphthol AS-PH test paper to be tested on a standard white board and acquire an RGB image of the naphthol AS-PH test paper through a camera; A correction module is used to perform grayscale correction on the RGB image to obtain a corrected RGB correction image; the correction uses a preset reflectivity value of a standard white plate area as a reference; the standard white plate area is a rectangular area at a preset distance from the outer side of the edge of the naphthol AS-PH test paper; an adaptive sampling method is used in the rectangular area; An effective detection module, used for extracting an effective detection area of ​​the naphthol AS-PH test paper from the RGB correction image, and eliminating edge noise of the effective detection area by a double Gaussian blur algorithm; A target detection module is used to divide the effective detection area into multiple sub-areas of equal area, calculate the RGB mean of each sub-area, and select the central sub-area with the most stable RGB mean as the target detection area; The concentration calculation module is used to obtain the concentration value of the to-be-tested naphthol AS-PH according to the RGB value of the target detection area in combination with a pre-established naphthol AS-PH concentration-RGB mapping model.

Citation Information

Patent Citations

  • Fire behavior monitoring method and device, electronic equipment and storage medium

    CN112132035A

  • Circuit board golden finger area defect detection method, system and device and medium

    CN114862817A

  • Black tea fermentation state intelligent identification method, apparatus and device, and storage medium

    CN117496254A

  • Method for detecting skin color in digital image

    JP2002197457A

  • Foreground object detection from multiple images

    US20150169989A1

Cited By

  • Method, system and equipment for detecting iron doping concentration in iron-doped gallium nitride crystal

    CN121236083A

  • Electronic device reference point detection method and device and readable storage medium

    CN121526989A