A method and device for same-color real-time correction for outdoor instant colorimetric detection

By arranging color calibration cards of the same color system on the paper-based sensor and combining them with real-time ambient light dynamic correction of RGB color values, the problem of outdoor ambient light affecting the accuracy of colorimetric detection is solved, and efficient and accurate colorimetric detection under complex lighting conditions is achieved.

CN121499406BActive Publication Date: 2026-05-08INTELLIGENT EQUIPMENT RESEARCH CENTER BEIJING ACADEMY OF AGRICULTURE AND FORESTRY SCIENCES
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INTELLIGENT EQUIPMENT RESEARCH CENTER BEIJING ACADEMY OF AGRICULTURE AND FORESTRY SCIENCES
Filing Date
2026-01-13
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Changes in outdoor ambient light affect the accuracy of detection results from paper-based sensors. Existing calibration methods are ineffective under complex lighting conditions, making it difficult to achieve accurate colorimetric detection in outdoor scenarios.

Method used

Using a color chart with the same color system, multiple color gradient areas are arranged on the paper-based sensor. The color value correction mapping relationship is determined dynamically in combination with real-time ambient light. The RGB color values ​​of the color display area of ​​the paper-based sensor are corrected, and a correction matrix is ​​constructed to reduce the influence of ambient light.

Benefits of technology

It improves the accuracy of colorimetric detection in outdoor environments, simplifies operation steps, reduces computational burden, and is suitable for rapid detection in smart terminals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121499406B_ABST
    Figure CN121499406B_ABST
Patent Text Reader

Abstract

The application provides a same-color-series real-time correction method and device for outdoor instant colorimetric detection, relates to the technical field of colorimetric detection, and aims to solve the problem of low accuracy of detection results caused by environmental light. The method comprises the following steps: collecting an image of a paper-based sensor provided with a same-color-series correction color card under environmental light to obtain a to-be-identified image; identifying the to-be-identified image, determining a color value correction mapping relationship in combination with real-time environmental light based on first RGB color values of each color series included in the same-color-series correction color card in the to-be-identified image and second RGB color values of each color series included in the same-color-series correction color card in a preset image; correcting third RGB color values of a chromogenic area on the paper-based sensor in the to-be-identified image based on the color value correction mapping relationship to obtain corrected RGB color values; and determining a detection result of a to-be-detected sample based on the corrected RGB color values.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of colorimetric testing technology, and in particular to a method and apparatus for real-time correction of the same color system for outdoor instant colorimetric testing. Background Technology

[0002] Colorimetric detection is a qualitative and quantitative analysis method based on colorimetric reactions, widely used in food safety, water quality testing, environmental monitoring, and biomedicine. With the rapid development of paper-based sensors, technologies for real-time, in-situ colorimetric detection outdoors, based on paper-based platforms (i.e., paper-based sensors) and photographic equipment, are gradually emerging. This enables rapid on-site detection, greatly expanding the application scope of colorimetric detection.

[0003] However, in outdoor scenarios, colorimetric detection is inevitably affected by ambient light. Furthermore, the intensity of ambient light fluctuates with time, weather, and location, directly impacting the color representation of images captured by the photographic device from the paper-based sensor. For example, the RGB values ​​of the extracted colorimetric regions often differ significantly when the same paper-based sensor is photographed on sunny and cloudy days, or in the morning and afternoon. The linear model establishing the relationship between color and concentration in a colorimetric model is typically performed under standard laboratory lighting, but outdoor ambient light differs considerably from standard lighting. This alters the color temperature and intensity of the paper-based colorimetric region in the photographic device, disrupting the original correspondence between color and analyte concentration. This renders the predictive model established under standard lighting ineffective, thus reducing the accuracy of the detection results. Summary of the Invention

[0004] This invention provides a method and apparatus for real-time correction of the same color system for outdoor instant colorimetric detection, which solves the defect of low accuracy of detection results caused by the influence of ambient light when performing colorimetric detection based on paper-based sensors in outdoor scenes. It realizes the reduction of the influence of ambient light and the improvement of the accuracy of detection results when performing colorimetric detection based on paper-based sensors in outdoor scenes.

[0005] This invention provides a real-time correction method for color matching detection in outdoor instantaneous colorimetry, comprising the following steps.

[0006] Image acquisition is performed on a paper-based sensor equipped with a color calibration chart under ambient light to obtain an image to be identified. The color calibration chart includes color gradient regions of multiple color systems. The color gradient range corresponding to each color gradient region is determined based on the color change range of the sample to be detected after it is developed on the paper-based sensor. The difference between the color values ​​of the color systems corresponding to two adjacent color gradient regions on the color calibration chart is greater than a preset difference. The color gradient regions of multiple color systems are evenly distributed on the color calibration chart. The paper-based sensor is the sensor that develops color after sampling the sample to be detected.

[0007] The image to be identified is determined by combining the first RGB color value of each color system included in the same color system correction color card in the image to be identified with the second RGB color value of each color system included in the same color system correction color card in the preset image, and the color value correction mapping relationship is determined by combining the real-time ambient light. The preset image is the image obtained by image acquisition of the same color system correction color card under the preset standard light source.

[0008] Based on the color value correction mapping relationship, the third RGB color value of the color display area on the paper-based sensor in the image to be recognized is corrected to obtain the corrected RGB color value;

[0009] The detection result of the sample to be tested is determined based on the corrected RGB color values.

[0010] The present invention provides a real-time color correction method for outdoor instant colorimetric detection, which, based on the first RGB color values ​​of each color system included in the color system correction color chart in the image to be identified, and the second RGB color values ​​of each color system included in the color system correction color chart in the preset image, dynamically determines the color value correction mapping relationship in conjunction with real-time ambient light, including:

[0011] Divide the color gradient area of ​​each color system in the same color system into multiple color blocks, and extract a preset number of color blocks equally from the color gradient area of ​​each color system.

[0012] Based on the first RGB color values ​​of a preset number of color blocks corresponding to each color system in the color correction color chart of the image to be identified, and the second RGB color values ​​of a preset number of color blocks corresponding to each color system in the color correction color chart of the preset image, the color value correction mapping relationship is dynamically determined in combination with the real-time ambient light.

[0013] According to the present invention, a real-time correction method for colorimetric detection in outdoor instantaneous colorimetry is provided. Based on a color value correction mapping relationship, the third RGB color value of the color-developing area on the paper-based sensor in the image to be identified is corrected to obtain the corrected RGB color value, including:

[0014] Based on the third RGB color value of the color display area, a first reference area with the same or similar color system as the color display area is determined from the same color system correction color card in the image to be identified;

[0015] Based on the first RGB color value of the first reference area and the second RGB color value of the second reference area in the preset image, the third RGB color value is corrected to obtain the corrected RGB color value. The first reference area and the second reference area are the same area of ​​the same color correction color card in different images.

[0016] According to the present invention, a real-time color correction method for outdoor instant colorimetric detection is provided, which corrects a third RGB color value based on a first RGB color value of a first reference area and a second RGB color value of a second reference area in a preset image to obtain a corrected RGB color value, including:

[0017] Based on the third RGB color value of the color display area, a target color block is determined from a preset number of color blocks corresponding to the first reference area, where the first RGB color value of the target color block is most similar to the third RGB color value.

[0018] Based on the target color block, determine multiple adjacent color blocks, including the target color block and the color blocks on both sides / on the same side of the target color block;

[0019] Based on the first RGB color values ​​of multiple color blocks in the first reference area and the second RGB color values ​​of multiple color blocks in the second reference area, the third RGB color value is corrected to obtain the corrected RGB color value.

[0020] According to the present invention, a real-time correction method for color matching detection in outdoor real-time isochromatic systems is provided. The color value correction mapping relationship is represented by a correction matrix. The correction matrix is ​​constructed in any of the following ways: first-order polynomial, second-order polynomial, radical polynomial. The correction matrix is ​​dynamically determined based on the first RGB color value of each color system included in the isochromatic correction color card in the image to be identified, and the second RGB color value of each color system included in the isochromatic correction color card in the preset image, combined with the real-time ambient light.

[0021] According to the present invention, a real-time correction method for outdoor instant colorimetric detection based on the same color system determines the detection result of the sample to be tested based on the corrected RGB color values, including:

[0022] Convert the corrected RGB color values ​​to Lab or HSV color values;

[0023] The test result for the sample to be tested is determined based on Lab color values ​​or HSV color values.

[0024] The present invention also provides a real-time colorimetric correction device for outdoor instant colorimetric detection, comprising the following modules: an image acquisition module, an image recognition module, a correction module, and a detection module;

[0025] The image acquisition module is used to acquire images of a paper-based sensor equipped with a color calibration chart under ambient light to obtain an image to be identified. The color calibration chart includes color gradient regions of multiple color systems. The color gradient range corresponding to each color gradient region is determined based on the color change range of the sample to be detected after it is developed on the paper-based sensor. The difference between the color values ​​of the color systems corresponding to two adjacent color gradient regions on the color calibration chart is greater than a preset difference. The color gradient regions of multiple color systems are evenly distributed on the color calibration chart. The paper-based sensor is the sensor that develops the color after sampling the sample to be detected.

[0026] The image recognition module is used to recognize the image to be recognized. Based on the first RGB color value of each color system included in the same color system correction color card in the image to be recognized, and the second RGB color value of each color system included in the same color system correction color card in the preset image, the color value correction mapping relationship is dynamically determined in combination with the real-time ambient light. The preset image is an image obtained by image acquisition of the same color system correction color card under a preset standard light source.

[0027] The correction module is used to correct the third RGB color value of the color display area on the paper-based sensor in the image to be recognized based on the color value correction mapping relationship, so as to obtain the corrected RGB color value.

[0028] The detection module is used to determine the detection result of the sample to be tested based on the corrected RGB color values.

[0029] According to the present invention, a real-time colorimetric correction device for outdoor instant colorimetric detection, comprising an image recognition module, is specifically used for:

[0030] Divide the color gradient area of ​​each color system in the same color system into multiple color blocks, and extract a preset number of color blocks equally from the color gradient area of ​​each color system.

[0031] Based on the first RGB color values ​​of a preset number of color blocks corresponding to each color system in the color correction color chart of the image to be identified, and the second RGB color values ​​of a preset number of color blocks corresponding to each color system in the color correction color chart of the preset image, the color value correction mapping relationship is dynamically determined in combination with the real-time ambient light.

[0032] According to the present invention, a real-time colorimetric correction device for outdoor instant colorimetric testing is provided, wherein the correction module is specifically used for:

[0033] Based on the third RGB color value of the color display area, a first reference area with the same or similar color system as the color display area is determined from the same color system correction color card in the image to be identified;

[0034] Based on the first RGB color value of the first reference area and the second RGB color value of the second reference area in the preset image, the third RGB color value is corrected to obtain the corrected RGB color value. The first reference area and the second reference area are the same area of ​​the same color correction color card in different images.

[0035] According to the present invention, a real-time colorimetric correction device for outdoor instant colorimetric testing is provided, wherein the correction module is specifically used for:

[0036] Based on the third RGB color value of the color display area, a target color block is determined from a preset number of color blocks corresponding to the first reference area, where the first RGB color value of the target color block is most similar to the third RGB color value.

[0037] Based on the target color block, determine multiple adjacent color blocks, including the target color block and the color blocks on both sides / on the same side of the target color block;

[0038] Based on the first RGB color values ​​of multiple color blocks in the first reference area and the second RGB color values ​​of multiple color blocks in the second reference area, the third RGB color value is corrected to obtain the corrected RGB color value.

[0039] According to the present invention, a real-time colorimetric correction device for outdoor instant colorimetric detection is provided. The color value correction mapping relationship is represented by a correction matrix. The correction matrix is ​​constructed in any of the following ways: first-order polynomial, second-order polynomial, radical polynomial. The correction matrix is ​​dynamically determined based on the first RGB color value of each color system included in the colorimetric correction color card in the image to be identified, and the second RGB color value of each color system included in the colorimetric correction color card in the preset image, combined with the real-time ambient light.

[0040] According to the present invention, a real-time colorimetric correction device for outdoor instant colorimetric testing is provided, wherein the detection module is specifically used for:

[0041] Convert the corrected RGB color values ​​to Lab or HSV color values;

[0042] The test result for the sample to be tested is determined based on Lab color values ​​or HSV color values.

[0043] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the same color system real-time correction method for outdoor instant colorimetric detection as described above.

[0044] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the same color system real-time correction method for outdoor instant colorimetric detection as described above.

[0045] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the same color system real-time correction method for outdoor instant colorimetric detection as described above.

[0046] This invention provides a real-time colorimetric calibration method and apparatus for outdoor instantaneous colorimetric detection. The method involves acquiring an image of a paper-based sensor equipped with a colorimetric calibration chart under ambient light to obtain an image to be identified. The image is then identified, and a color value calibration mapping relationship is dynamically determined based on the first RGB color values ​​of each color system included in the colorimetric calibration chart in the image to be identified, and the second RGB color values ​​of each color system included in the colorimetric calibration chart in a preset image obtained under a preset standard light source. This is combined with real-time ambient light dynamics. The determined color value calibration mapping relationship is then used to correct the third RGB color values ​​of the color display area on the paper-based sensor in the image to be identified, resulting in corrected RGB color values. These corrected RGB color values ​​are then directly input into a color space constructed under a standard light source and a concentration model of the sample to be tested to determine the detection result of the sample. This application utilizes a color calibration chart with multiple color gradient regions to perform colorimetric detection on the color display area of ​​a paper-based sensor under ambient light. This corrects the influence of ambient light on the color values ​​of the paper-based sensor's color display area, thereby determining accurate detection results based on the corrected RGB color values. This reduces the impact of ambient light on detection results and improves accuracy when performing colorimetric detection using a paper-based sensor in outdoor scenarios. Attached Figure Description

[0047] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0048] Figure 1 This is one of the flowcharts of the same color system real-time correction method for outdoor instant colorimetric detection provided by the present invention.

[0049] Figure 2 This is a schematic diagram of the assembly of the paper-based sensor and the same color calibration card provided by the present invention.

[0050] Figure 3 This is the second flowchart of the same color system real-time correction method for outdoor instant colorimetric detection provided by the present invention.

[0051] Figure 4 This is the third flowchart of the same color system real-time correction method for outdoor instant colorimetric detection provided by the present invention.

[0052] Figure 5 This is the fourth flowchart of the same-color system real-time correction method for outdoor instant colorimetric detection provided by the present invention.

[0053] Figure 6 This is the fifth flowchart of the same color system real-time correction method for outdoor instant colorimetric detection provided by the present invention.

[0054] Figure 7 This is a schematic diagram comparing the G values ​​of the colorimetric regions detected by various methods, provided by the present invention.

[0055] Figure 8 This is a schematic diagram showing the comparison of G-value differences in colorimetric regions detected by various methods, provided by the present invention.

[0056] Figure 9 This is a schematic diagram of the structure of the same color system real-time correction device for outdoor instant colorimetric detection provided by the present invention.

[0057] Figure 10 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0058] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0059] In recent years, with the rapid development of paper-based sensors, in-situ real-time colorimetric detection technology based on "paper-based platform + mobile phone photography" has gradually emerged. This type of method is characterized by low cost, simple operation, and no need for specialized instruments, enabling rapid on-site detection and greatly expanding the application scope of colorimetric detection. Especially in the detection of food spoilage, environmental pollutants, and disease biomarkers, real-time in-situ colorimetric detection based on a mobile phone + paper-based platform provides the possibility for real-time monitoring and has significant application prospects.

[0060] However, in outdoor scenarios, ambient light alters the color temperature and intensity of the paper-based color development area on the mobile phone camera, disrupting the original correspondence between color and analyte concentration. This renders the predictive model established under standard light sources ineffective, reducing the accuracy of the detection results. Therefore, eliminating or reducing the interference of ambient light is a core issue that in-situ real-time colorimetric detection must address.

[0061] Currently, solutions to the above problems mainly fall into two categories. The first solution involves using a dark box to isolate the paper substrate from external light. The paper substrate is placed inside the dark box, and a light source installed within the box provides illumination for the phone to capture color information. While this method effectively reduces errors caused by changes in external light, its large size makes it inconvenient to carry and dependent on power supply, thus it is not an ideal in-situ, real-time detection mode. The second method involves using standard color charts to calibrate the color of the paper substrate detection area, such as black-and-white chart calibration, grayscale calibration, or 24-color chart calibration. These calibration methods improve the impact of ambient light changes on the detection results to some extent, but their application is still limited to scenarios with relatively stable ambient light, such as hospitals and laboratories, where the light intensity is typically between 300-750 lux. For outdoor environments, where the light intensity can reach 30,000 to 300,000 lux on a sunny day, the aforementioned color chart calibration methods have certain limitations, and these color charts are not suitable for color calibration of phone-paper substrate colorimetric detection under outdoor ambient light.

[0062] Therefore, in the field of colorimetric testing, methods such as black-and-white correction, gray card correction, and 24-color chart correction, while mitigating the interference of ambient light on the test results to some extent, still have significant shortcomings. Black-and-white correction relies on using black and white as reference endpoints for light intensity, adjusting the color values ​​in the test image through linear mapping. While this method can correct for changes in light intensity to some extent, it struggles to compensate for RGB channel imbalances caused by ambient light color temperature shifts, often failing to guarantee accuracy under complex lighting conditions. Gray card correction uses a neutral gray block as a standard reference, eliminating the influence of light-induced color shifts to some extent. However, this method requires high-quality gray cards with high reflectivity, and the gray card must be under identical lighting conditions with the test area during shooting; otherwise, additional errors will occur. Furthermore, gray card correction is susceptible to surface contamination and positional shifts, leading to unstable results. While 24-color chart correction offers a more comprehensive solution, its wider color gamut coverage allows for more refined mapping relationships, making it particularly suitable for color correction with high color richness, such as color accuracy correction in portrait photographs. However, this method requires carrying a complete standard color chart and extracting color patches one by one for calculation, making the operation cumbersome. Furthermore, for the correction of relatively single colors, such as the G channel of a single color, 24-color chart correction introduces too many other colors to construct the correction matrix. This increases the computational load and, conversely, may reduce the correction effect on certain color channels. Therefore, these methods are mostly used in environments with limited ambient light variation, such as indoor laboratory environments. In actual outdoor or complex ambient light conditions, these methods do not provide significant improvement, making it difficult to balance ease of operation, correction accuracy, and computational efficiency. In mobile rapid detection scenarios, these methods inevitably introduce operational burdens and insufficient robustness. Therefore, a new correction method is urgently needed that can eliminate the dual effects of ambient light intensity and color shift, while maintaining accuracy and reducing operational complexity and computational burden. This would provide a more reliable color correction method for mobile phone-paper-based colorimetric detection in outdoor environments, thereby improving detection accuracy.

[0063] The following is combined with Figures 1-10 This invention describes a method and apparatus for real-time correction of the same color system for outdoor instant colorimetric detection.

[0064] Figure 1 This is one of the flowcharts illustrating the real-time colorimetric correction method for outdoor instant colorimetric testing provided by the present invention, such as... Figure 1 As shown, the method includes the following:

[0065] Step 101: Under ambient light, acquire an image of the paper-based sensor equipped with a color calibration card of the same color system to obtain the image to be identified.

[0066] The same color system calibration color chart includes color gradient regions of multiple color systems. The color gradient range corresponding to each color gradient region is determined based on the color change range of the sample to be tested after it is developed on the paper-based sensor. The difference between the color values ​​of the color systems corresponding to two adjacent color gradient regions on the same color system calibration color chart is greater than a preset difference. The color gradient regions of multiple color systems are evenly arranged on the same color system calibration color chart. The paper-based sensor is the sensor that develops color after sampling the sample to be tested.

[0067] Step 102: Identify the image to be identified. Based on the first RGB color value of each color system included in the same color system correction color card in the image to be identified, and the second RGB color value of each color system included in the same color system correction color card in the preset image, the color value correction mapping relationship is dynamically determined in combination with the real-time ambient light.

[0068] The preset image is an image obtained by acquiring a color chart of the same color system under a preset standard light source.

[0069] Step 103: Correct the third RGB color value of the color display area on the paper-based sensor in the image to be identified based on the color value correction mapping relationship, and obtain the corrected RGB color value.

[0070] Step 104: Determine the detection result of the sample to be tested based on the corrected RGB color values.

[0071] In one possible implementation, a paper-based sensor equipped with a color calibration card can be used. Specifically, the paper-based sensor, after sampling and color development, can be attached to or inserted into a color calibration card with gaps. Then, an image acquisition device (such as a smartphone) can be used to take a picture of the paper-based sensor equipped with the color calibration card to obtain the image to be identified.

[0072] For example, Figure 2 This is an assembly diagram of the paper-based sensor and the same color calibration card provided by the present invention, as shown below. Figure 2 As shown, by attaching the paper-based sensor that develops color after sampling the sample to be tested to a color calibration card of the same color system, a paper-based sensor equipped with a color calibration card of the same color system is obtained. Then, the paper-based sensor equipped with the color calibration card of the same color system can be photographed by an image acquisition device, thereby identifying the detection result.

[0073] In one possible implementation, such as Figure 2As shown, color gradient areas of the same color system can be arranged around the color display area on the paper-based sensor. Then, based on the color calibration card of the same color system in the stored preset image, the color value correction mapping relationship of each color gradient area of ​​the same color system in ambient light and standard light source is established in real time, thereby realizing the accurate correction of the color value of the color display area.

[0074] In one possible implementation, the sample to be tested can be any of the following: soil, urine, and blood, etc.

[0075] In one possible implementation, the biggest difference between a color calibration chart and other calibration charts (such as black and white charts, grayscale charts, and 24-color charts) lies in the fact that the color gradient range of multiple color systems is highly correlated with the color change range of the sample being tested after it is developed on a paper-based sensor (i.e., the color change range of the developed area). Currently, commercially available calibration charts are mass-produced and do not take into account the linear correlation with the color to be calibrated (i.e., the color value of the developed area).

[0076] This is because colorimetric detection is based on the extremely high linear correlation between the color of the sample to be tested (i.e., the analyte and the reactant) after the reaction and the target concentration. Therefore, the creation of a colorimetric calibration chart is based on the actual color change after the reaction of the analyte and the reactant, determining the color change range and trend of the color gradient region of each color system. Compared with other calibration charts, the colorimetric calibration chart used in this embodiment is extremely similar to the color of the area to be tested (i.e., the color development area). The advantage of doing so is that no interference from other colors is added when constructing the calibration matrix, achieving a more accurate calibration matrix construction.

[0077] Thus, based on the known concentration of the sample to be tested and the corresponding display range and trend within the detection range, the corresponding R, G, and B channel colors are extracted, and interpolation is performed at different concentrations to create a color calibration chart (i.e., multiple color gradient areas) that includes the expected target concentration range. These multiple color gradient areas are arranged in a circular pattern around the color display area of ​​the paper-based sensor, and the positions of the color gradient areas of different color systems in the circle need to meet two requirements: first, color gradient areas of two color systems with similar colors cannot be arranged adjacently, that is, the color values ​​of adjacent color gradient areas must be significantly different; second, the multiple color gradient areas are evenly distributed around the color display area.

[0078] In this embodiment, an image of a paper-based sensor equipped with a color calibration chart is acquired under ambient light to obtain an image to be identified. The image is then identified, and a color value correction mapping relationship is dynamically determined based on the first RGB color values ​​of each color system included in the color calibration chart in the image to be identified, and the second RGB color values ​​of each color system included in the color calibration chart in a preset image obtained under a preset standard light source, combined with real-time ambient light. Thus, the third RGB color values ​​of the color display area on the paper-based sensor in the image to be identified are corrected using the determined color value correction mapping relationship, resulting in corrected RGB color values. These corrected RGB color values ​​are then directly input into the color space constructed under a standard light source and the concentration model of the sample to be detected to determine the detection result. In this way, by setting a color calibration chart including color gradient areas of multiple color systems, and performing colorimetric detection on the color display area of ​​the paper-based sensor under ambient light, the influence of ambient light on the color values ​​of the color display area of ​​the paper-based sensor can be corrected, thereby determining an accurate detection result based on the corrected RGB color values. This reduces the impact of ambient light on the detection results and improves the accuracy of the results when performing colorimetric detection based on paper-based sensors in outdoor scenarios.

[0079] Figure 3 This is the second flowchart of the same-color system real-time correction method for outdoor instant colorimetric detection provided by the present invention, as shown below. Figure 3 As shown, the method includes the following:

[0080] Step 301: Under ambient light, acquire an image of the paper-based sensor equipped with a color calibration card of the same color system to obtain the image to be identified.

[0081] Step 302: Identify the image to be identified, divide the color gradient area of ​​each color system included in the same color system correction color card into multiple color blocks, and extract a preset number of color blocks equally from the color gradient area of ​​each color system.

[0082] Step 303: Based on the first RGB color values ​​of a preset number of color blocks corresponding to each color system in the same color system correction color card in the image to be identified, and the second RGB color values ​​of a preset number of color blocks corresponding to each color system in the same color system correction color card in the preset image, the color value correction mapping relationship is dynamically determined in combination with the real-time ambient light.

[0083] Step 304: Correct the third RGB color value of the color display area on the paper-based sensor in the image to be recognized based on the color value correction mapping relationship to obtain the corrected RGB color value.

[0084] Step 305: Determine the detection result of the sample to be tested based on the corrected RGB color values.

[0085] In one possible implementation, when constructing a color value correction mapping relationship, the color gradient region of each color system first needs to be equally divided into multiple color blocks. These equally divided color blocks can all be used to construct the color value correction mapping relationship (e.g., a correction matrix). Alternatively, a preset number of color blocks can be extracted from the multiple color blocks corresponding to each color system according to the color value from low to high, and used to construct the color value correction mapping relationship. Alternatively, the color block corresponding to the color system can be determined by identifying the color block with the color value most similar to the color display area on the paper-based sensor, and the most similar color block and nearby color blocks can be selected for constructing the color value correction mapping relationship.

[0086] In one possible implementation, the color value correction mapping relationship is represented by a correction matrix, which is constructed in any of the following ways: a first-order polynomial, a second-order polynomial, or a radical polynomial. The correction matrix is ​​dynamically determined based on the first RGB color values ​​of each color system included in the same color system correction color chart in the image to be identified, and the second RGB color values ​​of each color system included in the same color system correction color chart in the preset image, combined with real-time ambient light. Different feature forms can balance computational complexity and correction accuracy.

[0087] It is understandable that the color value correction mapping relationship between a color calibration chart under ambient light and a color calibration chart under a preset standard light source can be obtained by constructing a correction matrix. Furthermore, by constructing the correction matrix using various methods such as first-order polynomials, second-order polynomials, and radical polynomials, different orders of polynomials can be used to balance computational complexity and correction accuracy. Thus, by inputting the RGB values ​​of the color-coding region under ambient light into the trained correction model through the correction calculation unit in the image acquisition device, a correction result close to that under a standard light source can be obtained.

[0088] Specifically, the first RGB color values ​​of a preset number of color blocks corresponding to each color system in the same color system calibration color chart of the image to be identified acquired under ambient light can be converted into a multinomial feature vector. Furthermore, the second RGB color values ​​of a preset number of color blocks corresponding to each color system in the same color system calibration color chart of the preset image pre-stored in the image acquisition device can be converted into a multinomial feature vector. The color value correction mapping relationship can be established using the least squares method, and this color value correction mapping relationship can be applied to the color correction of the color display area to be tested.

[0089] Thus, by constructing a color value correction mapping relationship, the color difference between the color-developing area under ambient light and the color-developing area under standard light source can be significantly reduced. It can be used under different lighting conditions, such as sunny and cloudy days, to reduce the error between the color value of the measured color-developing area after correction and the color value under standard light source, demonstrating good universality and robustness. Furthermore, the same-color-system correction color card can be assembled with a paper base and can be reused. It is simple to operate, requires little computation, and is suitable for real-time colorimetric detection on smart terminals.

[0090] In this embodiment, the calibration matrix (or color value calibration mapping relationship) is determined dynamically based on real-time ambient light because existing color calibration methods are based on conventional commercial color charts, and the constructed color calibration matrix is ​​fixed. However, outdoor ambient light changes irregularly and is complex. Even though existing fixed calibration matrices have considered many environmental factors during construction, they still have certain limitations when facing irregular and complex outdoor ambient light.

[0091] Therefore, to solve the interference of outdoor ambient light on color correction, it is necessary to consider the dynamic changes of ambient light in real time. Based on the same color system correction color card, the embodiment of this application constructs a correction matrix in real time based on the mobile phone analysis platform. At the same time, based on the correction method proposed in this embodiment, color correction can be performed using only simple mathematical algorithms when constructing the correction matrix, without the need for excessive computing power.

[0092] In this embodiment, an image (i.e., the image to be identified) containing the color-coding region to be tested and a color calibration chart of the same color family is acquired under ambient light using an image acquisition device. An image (i.e., the preset image) containing the color calibration chart of the same color family is also acquired under standard light conditions. Then, an image processing algorithm automatically identifies the color-coding region and the reference region in the image and extracts the RGB values ​​of each region. By placing a gradient of colors of the same color family around the color-coding region to be tested, the possible color variation range of the color-coding region can be covered, thus ensuring the targeted and complete nature of the calibration process.

[0093] Figure 4 This is the third flowchart of the same-color system real-time correction method for outdoor instant colorimetric detection provided by the present invention, as shown below. Figure 4 As shown, the method includes the following:

[0094] Step 401: Under ambient light, acquire an image of the paper-based sensor equipped with a color calibration card of the same color system to obtain the image to be identified.

[0095] Step 402: Identify the image to be identified, divide the color gradient area of ​​each color system included in the same color system correction color card into multiple color blocks, and extract a preset number of color blocks equally from the color gradient area of ​​each color system.

[0096] Step 403: Based on the first RGB color values ​​of a preset number of color blocks corresponding to each color system in the same color system correction color card in the image to be identified, and the second RGB color values ​​of a preset number of color blocks corresponding to each color system in the same color system correction color card in the preset image, the color value correction mapping relationship is dynamically determined in combination with the real-time ambient light.

[0097] Step 404: Based on the third RGB color value of the color display area, determine the first reference area with the same or similar color system as the color display area from the same color system correction color card in the image to be identified.

[0098] Step 405: Based on the first RGB color value of the first reference area and the second RGB color value of the second reference area in the preset image, the third RGB color value is corrected to obtain the corrected RGB color value.

[0099] The first reference area and the second reference area are the same areas of the same color calibration color card in different images.

[0100] Step 406: Determine the detection result of the sample to be tested based on the corrected RGB color values.

[0101] In one possible implementation, since the selection of the same color correction color card is based on the color setting of each color development area of ​​the paper base, the range of the same color correction color card corresponding to each color development area covers the range of color change of the color development area with concentration.

[0102] Therefore, when constructing the color value correction mapping relationship, the color gradient region of each color system in the same color system correction color chart is equally divided into multiple color blocks. Then, a predetermined number of color blocks are extracted from the multiple color blocks of each color system included in the same color system correction color chart in the image to be recognized. Thus, based on the first RGB color values ​​of the extracted predetermined number of color blocks in the image to be recognized, and based on the second RGB color values ​​of the extracted predetermined number of color blocks in the preset image, the color value correction mapping relationship can be constructed.

[0103] In this embodiment, when constructing the color value correction mapping relationship, the color gradient region of each color system is equally divided into multiple color blocks, and a preset number of color blocks are equally extracted from the color gradient region of each color system. The color value correction mapping relationship can then be constructed using the first RGB color values ​​of the extracted preset number of color blocks in the image to be identified, and the second RGB color values ​​in the preset image. This eliminates the need to construct the color value correction mapping relationship based on the color values ​​of multiple color blocks equally divided from the color gradient region of each color system, reducing the amount of data processed and improving the efficiency of constructing the color value correction mapping relationship.

[0104] Figure 5 This is the fourth flowchart of the same-color system real-time correction method for outdoor instant colorimetric detection provided by the present invention, as shown below. Figure 5 As shown, the above "step 405, correcting the third RGB color value based on the first RGB color value of the first reference region and the second RGB color value of the second reference region in the preset image to obtain the corrected RGB color value" specifically includes the following:

[0105] Step 501: Based on the third RGB color value of the color display area, determine the target color block from the preset number of color blocks corresponding to the first reference area.

[0106] Among them, the first RGB color value and the third RGB color value of the target color block are most similar.

[0107] Step 502: Determine multiple adjacent color blocks based on the target color block. The multiple color blocks include the target color block and the color blocks on both sides / on the same side of the target color block.

[0108] Step 503: Based on the first RGB color values ​​of multiple color blocks in the first reference area and the second RGB color values ​​of multiple color blocks in the second reference area, the third RGB color value is corrected to obtain the corrected RGB color value.

[0109] In one possible implementation, by comparing the third RGB color value of the color display area in the image to be identified with the first RGB color value of each color block in a preset number of color blocks corresponding to the first reference area, the target color block whose color value is most similar to the third RGB color value of the color display area can be determined from the preset number of color blocks.

[0110] In one possible implementation, with the target color block as the center (reference), a certain number of color blocks (e.g., 2 or 3 color blocks on each side) can be selected on both sides of the target color block. A color value correction mapping relationship is then constructed based on the first RGB color values ​​of the selected color blocks in the first reference region of the image to be identified, and the second RGB color values ​​of the selected color blocks in the second reference region of the preset image. The third RGB color value is then corrected through the constructed color value correction mapping relationship to obtain the corrected RGB color value.

[0111] In another possible implementation, if the target color block is an edge color block of the first reference area, then a certain number of color blocks (e.g., 5 or 6 color blocks on one side) are selected on the same side of the target color block in the first reference area, based on the first RGB color value of the selected color blocks in the first reference area of ​​the image to be identified, and the second RGB color value of the selected color blocks in the second reference area of ​​the preset image, to construct a color value correction mapping relationship. The third RGB color value is then corrected through the constructed color value correction mapping relationship to obtain the corrected RGB color value.

[0112] Thus, this application identifies a target color patch whose color value is most similar to the third RGB color value of the display area. Based on this target color patch and other color patches on either side of it with similar color values, a color value correction mapping relationship can be constructed. The color values ​​of the display area are then corrected using this constructed color value correction mapping relationship to obtain accurate color values.

[0113] Figure 6 This is the fifth flowchart of the real-time colorimetric correction method for outdoor instant colorimetric testing provided by the present invention, as shown below. Figure 6 As shown, the method includes the following:

[0114] Step 601: Under ambient light, acquire an image of the paper-based sensor equipped with a color calibration card of the same color system to obtain the image to be identified.

[0115] Step 602: Identify the image to be identified. Based on the first RGB color value of each color system included in the same color system correction color card in the image to be identified, and the second RGB color value of each color system included in the same color system correction color card in the preset image, the color value correction mapping relationship is dynamically determined in combination with the real-time ambient light.

[0116] Step 603: Correct the third RGB color value of the color display area on the paper-based sensor in the image to be recognized based on the color value correction mapping relationship, and obtain the corrected RGB color value.

[0117] Step 604: Convert the corrected RGB color values ​​to Lab color values ​​or HSV color values.

[0118] Step 605: Determine the detection result of the sample to be tested based on the Lab color value or HSV color value.

[0119] In one possible implementation, the RGB color values ​​are further converted to Lab or HSV color values, thereby enabling analysis in color spaces such as Lab or HSV.

[0120] Furthermore, after obtaining the corrected RGB color values, the image acquisition device can directly input the corrected RGB color values ​​into the color space constructed under a standard light source and the concentration model of the sample to be tested, thereby directly outputting quantitative detection results.

[0121] Specifically, experimental results show that this application can significantly reduce the color difference between the test area under ambient light and the standard light source, with an average color difference reduction of about 90% and a standard deviation reduced to less than 1. The stability of the correction results is significantly better than that of black and white correction, gray card correction and 24-color card correction.

[0122] Taking the G value of the colorimetric region on a paper-based sensor as an example, Figure 7 This is a schematic diagram comparing the G values ​​of the colorimetric regions detected by various methods, as provided by the present invention. Figure 7 The figure shows the changes in the G value of the color rendering region over time under various lighting conditions: standard light source (under a lightbox), black and white correction, gray card correction, 24-color correction, monochromatic correction, and ambient light. It can be seen that the G value of the color rendering region detected by monochromatic correction provided in this embodiment is closest to the G value of the color rendering region detected under standard light source. The G values ​​of the color rendering region detected by black and white correction, gray card correction, 24-color correction, and ambient light are all significantly higher or lower than the G value of the color rendering region detected under standard light source.

[0123] Furthermore, Figure 8 This is a schematic diagram comparing the G-value differences of colorimetric regions detected by various methods, as provided by the present invention. Figure 8As shown, the difference between the G value of the color rendering area directly detected under ambient light and the G value of the color rendering area detected under standard light source is greater than 50 at any time. The difference between the G value of the color rendering area detected by black-and-white correction and the G value of the color rendering area detected under standard light source is greater than 5 at any time. The difference between the G value of the color rendering area detected by gray card correction and the G value of the color rendering area detected under standard light source is greater than 20 at any time. The difference between the G value of the color rendering area detected by 24-color correction and the G value of the color rendering area detected under standard light source is close to 5 at any time. However, the difference between the G value of the color rendering area detected by monochromatic correction and the G value of the color rendering area detected under standard light source is less than 5 at any time, and is smaller than the differences corresponding to black-and-white correction, gray card correction, 24-color correction, and ambient light.

[0124] In this embodiment, a color gradient region of similar color to the target color area is arranged around it. Color data of these color gradient regions and the color area of ​​the paper-based sensor are acquired under both ambient light and standard light source conditions. A small-sample polynomial mapping is used to establish a color value correction mapping relationship from ambient light to standard light in real time at the device. Based on this, the color value of the target color area is corrected to approximate the true color value under standard light source conditions. Thus, using a "neighborhood of the same color" instead of "cross-color gamut" as the correction benchmark balances ease of operation, lightweight computation, and effective correction, making it highly suitable for rapid outdoor testing processes. It not only effectively reduces the impact of ambient light on the test results but also offers the advantages of ease of operation and lightweight computation, making it particularly suitable for the practical needs of mobile phone-paper-based colorimetric testing. It can effectively mitigate the impact of outdoor ambient light fluctuations on the validity and stability of mobile phone-paper-based colorimetric testing results.

[0125] Furthermore, this application can also be used for other colorimetric detections (e.g., display modes using a porous plate as a platform and a liquid as a medium) and to improve the applicability of the model across different mobile phones. Although this application is aimed at reducing the impact of outdoor ambient light on the accuracy and stability of mobile phone-paper-based colorimetric detection results, it can also be used in indoor environments and any environment with varying light levels.

[0126] Thus, this application can correct the color of the test area to near standard light source conditions under complex ambient light, significantly reducing the color difference from standard light illumination. Taking the G channel in the experiment as an example, the average color difference between the uncorrected G channel under ambient light and the standard lamp in the dark box is about 60; after using the same color system correction, the average color difference is reduced to about 5, and the standard deviation of the difference is about 1, showing less residual color and better repeatability than black and white, gray card, and 24-color card methods. The same color system correction color card setup and shooting process is simplified, the calculation is lightweight, and it is suitable for local real-time completion on a mobile device, which has good promotional value for on-site colorimetric solutions such as food safety, water pollutant, and environmental monitoring.

[0127] The following describes the same-color system real-time correction device for outdoor instant colorimetric testing provided by the present invention. The same-color system real-time correction device for outdoor instant colorimetric testing described below can be referred to in correspondence with the same-color system real-time correction method for outdoor instant colorimetric testing described above.

[0128] Figure 9 This is a schematic diagram of the structure of the real-time colorimetric correction device for outdoor instant colorimetric testing provided by the present invention, as shown below. Figure 9 As shown, the real-time colorimetric calibration device for outdoor instant colorimetric testing includes the following modules: image acquisition module 901, image recognition module 902, calibration module 903, and detection module 904;

[0129] Image acquisition module 901 is used to acquire images of a paper-based sensor equipped with a color calibration card under ambient light to obtain an image to be identified. The color calibration card includes color gradient regions of multiple color systems. The color gradient range corresponding to each color gradient region is determined based on the color change range of the sample to be detected after it is developed on the paper-based sensor. The difference between the color values ​​of the color systems corresponding to two adjacent color gradient regions on the color calibration card is greater than a preset difference. The color gradient regions of multiple color systems are evenly arranged on the color calibration card. The paper-based sensor is a sensor that develops color after sampling the sample to be detected.

[0130] The image recognition module 902 is used to recognize the image to be recognized. Based on the first RGB color value of each color system included in the same color system correction color card in the image to be recognized, and the second RGB color value of each color system included in the same color system correction color card in the preset image, the color value correction mapping relationship is dynamically determined in combination with the real-time ambient light. The preset image is an image obtained by image acquisition of the same color system correction color card under a preset standard light source.

[0131] The correction module 903 is used to correct the third RGB color value of the color display area on the paper-based sensor in the image to be recognized based on the color value correction mapping relationship, so as to obtain the corrected RGB color value.

[0132] The detection module 904 is used to determine the detection result of the sample to be tested based on the corrected RGB color values.

[0133] According to the present invention, a real-time colorimetric correction device for outdoor instant colorimetric detection is provided, wherein the image recognition module 902 is specifically used for:

[0134] Divide the color gradient area of ​​each color system in the same color system into multiple color blocks, and extract a preset number of color blocks equally from the color gradient area of ​​each color system.

[0135] Based on the first RGB color values ​​of a preset number of color blocks corresponding to each color system in the color correction color chart of the image to be identified, and the second RGB color values ​​of a preset number of color blocks corresponding to each color system in the color correction color chart of the preset image, the color value correction mapping relationship is dynamically determined in combination with the real-time ambient light.

[0136] According to the present invention, a real-time colorimetric calibration device for outdoor instant colorimetric testing is provided, wherein the calibration module 903 is specifically used for:

[0137] Based on the third RGB color value of the color display area, a first reference area with the same or similar color system as the color display area is determined from the same color system correction color card in the image to be identified;

[0138] Based on the first RGB color value of the first reference area and the second RGB color value of the second reference area in the preset image, the third RGB color value is corrected to obtain the corrected RGB color value. The first reference area and the second reference area are the same area of ​​the same color correction color card in different images.

[0139] According to the present invention, a real-time colorimetric calibration device for outdoor instant colorimetric testing is provided, wherein the calibration module 903 is specifically used for:

[0140] Based on the third RGB color value of the color display area, a target color block is determined from a preset number of color blocks corresponding to the first reference area, where the first RGB color value of the target color block is most similar to the third RGB color value.

[0141] Based on the target color block, determine multiple adjacent color blocks, including the target color block and the color blocks on both sides / on the same side of the target color block;

[0142] Based on the first RGB color values ​​of multiple color blocks in the first reference area and the second RGB color values ​​of multiple color blocks in the second reference area, the third RGB color value is corrected to obtain the corrected RGB color value.

[0143] According to the present invention, a real-time colorimetric correction device for outdoor instant colorimetric detection is provided. The color value correction mapping relationship is represented by a correction matrix. The correction matrix is ​​constructed in any of the following ways: first-order polynomial, second-order polynomial, radical polynomial. The correction matrix is ​​dynamically determined based on the first RGB color value of each color system included in the colorimetric correction color card in the image to be identified, and the second RGB color value of each color system included in the colorimetric correction color card in the preset image, combined with the real-time ambient light.

[0144] According to the present invention, a real-time colorimetric correction device for outdoor instant colorimetric testing is provided, wherein the detection module 904 is specifically used for:

[0145] Convert the corrected RGB color values ​​to Lab or HSV color values;

[0146] The test result of the sample to be tested is determined based on the Lab color value or HSV color value.

[0147] Figure 10 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 10 As shown, the electronic device may include: a processor 1010, a communications interface 1020, a memory 1030, and a communications bus 1040, wherein the processor 1010, the communications interface 1020, and the memory 1030 communicate with each other through the communications bus 1040. The processor 1010 can call logic instructions in the memory 1030 to execute a real-time colorimetric correction method for outdoor instantaneous colorimetric detection. This method includes: acquiring an image of a paper-based sensor equipped with a colorimetric correction color chart under ambient light to obtain an image to be identified; the colorimetric correction color chart includes color gradient regions of multiple color systems, and the paper-based sensor is a sensor that displays color after sampling the sample to be detected; identifying the image to be identified; determining a color value correction mapping relationship based on the first RGB color values ​​of each color system included in the colorimetric correction color chart in the image to be identified, and the second RGB color values ​​of each color system included in the colorimetric correction color chart in a preset image, combined with real-time ambient light dynamics; the preset image is an image acquired by acquiring an image of the colorimetric correction color chart under a preset standard light source; correcting the third RGB color values ​​of the color display regions on the paper-based sensor in the image to be identified based on the color value correction mapping relationship to obtain corrected RGB color values; and determining the detection result of the sample to be detected based on the corrected RGB color values.

[0148] Furthermore, the logical instructions in the aforementioned memory 1030 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0149] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the same-color system real-time correction method for outdoor instant colorimetric detection provided by the above methods. The method includes: acquiring an image of a paper-based sensor equipped with a same-color system correction color card under ambient light to obtain an image to be identified. The same-color system correction color card includes color gradient areas of multiple color systems, and the paper-based sensor is a sensor that displays color after sampling the sample to be detected; identifying the image to be identified, and determining a color value correction mapping relationship based on the first RGB color value of each color system included in the same-color system correction color card in the image to be identified, and the second RGB color value of each color system included in the same-color system correction color card in a preset image, combined with real-time ambient light dynamics. The preset image is an image obtained by acquiring an image of the same-color system correction color card under a preset standard light source; correcting the third RGB color value of the color display area on the paper-based sensor in the image to be identified based on the color value correction mapping relationship to obtain the corrected RGB color value; and determining the detection result of the sample to be detected based on the corrected RGB color value.

[0150] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program performs the above-described method for real-time colorimetric detection using the same color system, the method comprising: acquiring an image of a paper-based sensor equipped with a same color system calibration color card under ambient light to obtain an image to be identified, wherein the same color system calibration color card includes color gradient regions of multiple color systems, and the paper-based sensor is a sensor that displays color after sampling the sample to be detected; identifying the image to be identified, and determining a color value correction mapping relationship based on the first RGB color values ​​of each color system included in the same color system calibration color card in the image to be identified, and the second RGB color values ​​of each color system included in the same color system calibration color card in a preset image, combined with real-time ambient light dynamics, wherein the preset image is an image obtained by acquiring an image of the same color system calibration color card under a preset standard light source; correcting the third RGB color values ​​of the color display regions on the paper-based sensor in the image to be identified based on the color value correction mapping relationship to obtain corrected RGB color values; and determining the detection result of the sample to be detected based on the corrected RGB color values.

[0151] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0152] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0153] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A real-time colorimetric correction method for outdoor instantaneous colorimetric testing, characterized in that, include: Image acquisition is performed on a paper-based sensor equipped with a color calibration chart under ambient light to obtain an image to be identified. The color calibration chart includes multiple color gradient regions of different color systems. The color gradient range corresponding to each color gradient region is determined based on the color change range of the sample to be tested after it is developed on the paper-based sensor. The difference between the color values ​​of two adjacent color gradient regions on the color calibration chart is greater than a preset difference. The multiple color gradient regions of different color systems are evenly arranged in a circular shape on the color calibration chart. The paper-based sensor is a sensor that develops color after sampling the sample to be tested. The color gradient range of the multiple color gradient regions of different color systems is related to the color change range of the developed color region of the sample to be tested after it is developed on the paper-based sensor. The color calibration chart determines the color gradient range corresponding to each color gradient region based on the actual color change of the sample to be tested after reacting with the reactant. The image to be identified is determined by combining the first RGB color value of each color system included in the same color system correction color card in the image to be identified with the second RGB color value of each color system included in the same color system correction color card in the preset image, and the color value correction mapping relationship is determined dynamically in combination with real-time ambient light. The preset image is an image obtained by image acquisition of the same color system correction color card under a preset standard light source. Based on the color value correction mapping relationship, the third RGB color value of the color display area on the paper-based sensor in the image to be identified is corrected to obtain the corrected RGB color value; Based on the corrected RGB color values, the detection result for the sample to be detected is determined.

2. The method for real-time correction of the same color system for outdoor instant colorimetric detection according to claim 1, characterized in that, The step of determining the color value correction mapping relationship based on the first RGB color values ​​of each color system included in the same color system correction color chart in the image to be identified, and the second RGB color values ​​of each color system included in the same color system correction color chart in the preset image, combined with real-time ambient light dynamics, includes: The color gradient area of ​​each color system included in the same color system correction color card is divided into multiple color blocks, and a preset number of color blocks are equally extracted from the color gradient area of ​​each color system. Based on the first RGB color values ​​of a preset number of color blocks corresponding to each color system in the same color system correction color card in the image to be identified, and the second RGB color values ​​of a preset number of color blocks corresponding to each color system in the same color system correction color card in the preset image, the color value correction mapping relationship is dynamically determined in conjunction with real-time ambient light.

3. The method for real-time correction of the same color system for outdoor instant colorimetric detection according to claim 2, characterized in that, The third RGB color value of the color display area on the paper-based sensor in the image to be identified is corrected based on the color value correction mapping relationship to obtain the corrected RGB color value, including: Based on the third RGB color value of the color display area, a first reference area with the same or similar color system as the color display area is determined from the same color system correction color card in the image to be identified; Based on the first RGB color value of the first reference area and the second RGB color value of the second reference area in the preset image, the third RGB color value is corrected to obtain the corrected RGB color value. The first reference area and the second reference area are the same area of ​​the same color correction color card in different images.

4. The method for real-time correction of the same color system for outdoor instant colorimetric testing according to claim 3, characterized in that, The step of correcting the third RGB color value based on the first RGB color value of the first reference region and the second RGB color value of the second reference region in the preset image to obtain the corrected RGB color value includes: Based on the third RGB color value of the color display area, a target color block is determined from a preset number of color blocks corresponding to the first reference area, wherein the first RGB color value of the target color block is most similar to the third RGB color value; Based on the target color block, a plurality of adjacent color blocks are determined, the plurality of color blocks including the target color block and color blocks on both sides / on the same side of the target color block; Based on the first RGB color values ​​of the plurality of color blocks in the first reference area and the second RGB color values ​​of the plurality of color blocks in the second reference area, the third RGB color value is corrected to obtain the corrected RGB color value.

5. The method for real-time correction of the same color system for outdoor instant colorimetric testing according to claim 1, characterized in that, The color value correction mapping relationship is represented by a correction matrix, which is constructed in any of the following ways: first-order polynomial, second-order polynomial, radical polynomial. The correction matrix is ​​dynamically determined based on the first RGB color value of each color system included in the same color system correction color card in the image to be identified, and the second RGB color value of each color system included in the same color system correction color card in the preset image, combined with the real-time ambient light.

6. The method for real-time correction of the same color system for outdoor instant colorimetric detection according to claim 1, characterized in that, Determining the detection result for the sample to be detected based on the corrected RGB color values ​​includes: Convert the corrected RGB color values ​​to Lab color values ​​or HSV color values; The detection result for the sample to be detected is determined based on the Lab color value or the HSV color value.

7. A real-time colorimetric calibration device for outdoor instant colorimetric testing, characterized in that, include: Image acquisition module, image recognition module, correction module, and detection module; The image acquisition module is used to acquire images of a paper-based sensor equipped with a color calibration chart under ambient light to obtain an image to be identified. The color calibration chart includes multiple color gradient regions of different color systems. The color gradient range corresponding to each color gradient region is determined based on the color change range of the sample to be detected after it is developed on the paper-based sensor. The difference between the color values ​​of two adjacent color gradient regions on the color calibration chart is greater than a preset difference. The multiple color gradient regions of different color systems are evenly arranged in a circular shape on the color calibration chart. The paper-based sensor is a sensor that develops color after sampling the sample to be detected. The color gradient range of the multiple color gradient regions of different color systems is related to the color change range of the developed color region of the sample to be detected after it is developed on the paper-based sensor. The color calibration chart determines the color gradient range corresponding to each color gradient region based on the actual color change of the sample to be detected after reacting with the reactant. The image recognition module is used to recognize the image to be recognized. Based on the first RGB color value of each color system included in the same color system correction color card in the image to be recognized, and the second RGB color value of each color system included in the same color system correction color card in the preset image, the color value correction mapping relationship is dynamically determined in combination with real-time ambient light. The preset image is an image obtained by image acquisition of the same color system correction color card under a preset standard light source. The correction module is used to correct the third RGB color value of the color display area on the paper-based sensor in the image to be identified based on the color value correction mapping relationship, so as to obtain the corrected RGB color value. The detection module is used to determine the detection result of the sample to be detected based on the corrected RGB color values.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the same-color system real-time correction method for outdoor instant colorimetric detection as described in any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the same-color system real-time correction method for outdoor instant colorimetric detection as described in any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the same-color system real-time correction method for outdoor instant colorimetric detection as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Color correction method, system and device based on cooperative flight of double unmanned aerial vehicles, medium and product

    CN120912487A