Gas concentration determination method, device and equipment and storage medium

Through the shooting device to obtain the detection tube image and use the color extraction algorithm to automatically calculate the gas concentration, solve the problem of low efficiency of traditional artificial reading and poor accuracy, and achieve rapid and accurate gas concentration detection.

CN119354954APending Publication Date: 2025-01-24WUXI HUISHAN DISTRICT TONGHUI NEW ENERGY VEHICLE INNOVATION RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411617690.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

The manual reading of traditional longer gas detectors is inefficient, has poor accuracy, and is susceptible to environmental conditions and subjective factors of the detector.

Method used

To obtain the detection pipe image by shooting the device, automatically identify the color reaction area by using the color extraction algorithm, calculate the reaction length, and automatically calculate the gas concentration in combination with the calibration information.

Benefits of technology

The rapid and accurate testing of the gas concentration is achieved, the artificial error is reduced, the detection efficiency and consistency are improved, and it is suitable for various complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119354954A_ABST
    Figure CN119354954A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a gas concentration determination method and device, equipment and a storage medium. Comprising the steps that a detection tube image is obtained through a shooting device, and the detection tube image is a gas reaction image of gas to be detected; identifying a color reaction area in the detection tube image, and determining a pixel value corresponding to the color reaction area; and determining the target gas concentration of the to-be-detected gas according to the pixel value. Clear and accurate detection tube images are obtained through the shooting device, errors possibly generated by manual observation are avoided, and a reliable basis is provided for subsequent accurate analysis. The automatic image acquisition and processing process greatly shortens the detection time, can quickly obtain the detection result, and meets the requirements on the detection speed under the conditions of detection of a large number of samples or emergency. The method is not limited by environmental conditions during manual detection, and can be used for stably and accurately detecting in various complex environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of gas detection technology, and in particular to a gas concentration determination method, device, equipment and storage medium. Background Art

[0002] In the field of gas detection, the ratio gas detector, as a common and important detection tool, has long played a key role in many scenarios such as industrial production, environmental monitoring, and laboratory analysis.

[0003] However, the traditional reading method of the ratio-length gas detector mainly relies on manual operation. The inspector needs to observe the length of the color reaction area in the detection tube with the naked eye, and read the reading and concentration according to the scale. This manual reading method has many obvious defects. Manual reading is easily affected by subjective factors, and the judgment standards and reading accuracy of different inspectors may vary, making it difficult to ensure the accuracy and consistency of the test results. Moreover, manual reading is inefficient and cannot meet the needs of rapid testing when a large number of test samples need to be processed. In addition, long-term manual observation can easily lead to fatigue of the inspector, further increasing the risk of reading errors. Summary of the invention

[0004] The purpose of the present invention is to overcome the problems of low efficiency and poor accuracy of manual reading in the prior art solutions, and provide a method, device, equipment and storage medium for determining gas concentration. A calibrated camera is used to shoot a ratio gas detector, and a color extraction algorithm is used to automatically calculate the reaction length in the detection tube, and then the gas concentration of the gas to be measured is automatically calculated through a set scale.

[0005] In a first aspect, an embodiment of the present disclosure provides a method for determining gas concentration, the method comprising: Acquire a detection tube image by a photographing device, wherein the detection tube image is a gas reaction image of the gas to be detected; Identify the color reaction area in the detection tube image and determine the pixel value corresponding to the color reaction area; The target gas concentration of the gas to be measured is determined based on the pixel value.

[0006] Optionally, obtaining an image of the detection tube by means of a photographing device includes: obtaining a relatively long gas detection tube filled with the gas to be tested; placing the detection tube within the field of view of the photographing device to ensure that the entire length of the detection tube is within the shooting screen; and photographing an image of the detection tube of the relatively long gas detection tube by means of the photographing device.

[0007] Optionally, before acquiring the image of the detection tube through the shooting device, the method also includes: fixing the shooting device at the target position; acquiring a standard color block of a fixed length, placing the standard color block on the same shooting plane as the longer gas detection tube, and shooting the standard color block and the detection tube through the shooting device to acquire the image to be calibrated; determining the first length of the standard color block in the image to be calibrated and the second length of the detection tube; calibrating the shooting device according to the first length, the second length and the fixed length, and generating calibration information.

[0008] Optionally, identifying the color reaction area in the detection tube image includes: preprocessing the detection tube image to generate a processed detection tube image, wherein the preprocessing includes denoising and contrast enhancement; determining the color value of each pixel in the processed detection tube image, and determining the color reaction area according to the color value.

[0009] Optionally, determining the pixel value corresponding to the color reaction area includes: determining a boundary position of the color reaction area; determining length information of the color reaction area according to the boundary position, and converting the length information into a pixel value.

[0010] Optionally, the target gas concentration of the gas to be tested is determined based on the pixel value, including: determining the pixel length corresponding to the pixel value, and converting the pixel length into an actual length in combination with calibration information; obtaining a concentration determination list, wherein the concentration determination list includes gas concentrations corresponding to each length; matching the actual length through the concentration determination list to determine the target gas concentration corresponding to the actual length.

[0011] Optionally, after determining the target gas concentration of the gas to be tested according to the pixel value, the method further includes: displaying the target gas concentration; determining a timestamp corresponding to the target gas concentration, and storing the target gas concentration in a database according to the timestamp.

[0012] In a second aspect, an embodiment of the present disclosure further provides a gas concentration determination device, the device comprising: A detection tube image acquisition module, used to acquire a detection tube image through a shooting device, wherein the detection tube image is a gas reaction image of the gas to be detected; A color reaction area pixel value determination module is used to identify the color reaction area in the detection tube image and determine the pixel value corresponding to the color reaction area; The target gas concentration determination module is used to determine the target gas concentration of the gas to be measured according to the pixel value.

[0013] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising: at least one processor; and a memory communicatively connected to at least one processor; wherein, When the memory stores a computer program executable by at least one processor, the computer program is executed by the at least one processor so that the at least one processor can perform a gas concentration determination method according to any embodiment of the present disclosure.

[0014] In a fourth aspect, an embodiment of the present disclosure provides a computer storage medium on which a computer program is stored, and when the program is executed by a processor, a gas concentration determination method as in any embodiment of the present disclosure is implemented.

[0015] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description.

[0016] Therefore, the present invention has the following beneficial effects: 1. Obtaining clear and accurate images of the test tube through the shooting device avoids the errors that may be caused by manual observation and provides a reliable basis for subsequent accurate analysis.

[0017] 2. The automated image acquisition and processing process greatly shortens the detection time and can quickly obtain the detection results, meeting the requirements for detection speed in large-scale sample testing or emergency situations.

[0018] 3. It is not restricted by the environmental conditions during manual detection and can perform detection stably and accurately in various complex environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of 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.

[0020] Figure 1 is a flow chart of a method for determining gas concentration provided according to Embodiment 1 of the present invention; Figure 2 is a schematic diagram of the structure of a gas concentration determination device provided according to Embodiment 2 of the present invention; Figure 3 It is a structural schematic diagram of an electronic device provided according to Embodiment 3 of the present invention. DETAILED DESCRIPTION

[0021] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0023] Embodiment 1 Figure 1 A flow chart of a method for determining gas concentration is provided for the first embodiment of the present invention. This embodiment is applicable to the case of taking readings of a long gas detection tube. The method can be performed by a gas concentration determination device provided by an embodiment of the present disclosure. The device can be implemented in software and / or hardware and can generally be integrated in a computer device. The method of the embodiment of the present disclosure specifically includes: S110: Acquire a detection tube image by a photographing device, wherein the detection tube image is a gas reaction image of the gas to be detected.

[0024] The detection tube image refers to an image of a gas detection tube containing the gas to be detected, which is obtained by a shooting device (such as a camera). The detection tube image reflects the state of the detection tube after reacting with the gas to be detected. Specifically, after the chemical reagent in the detection tube comes into contact with the gas to be detected, a specific color change will occur. The detection tube image is a record of this color change, which includes information such as the appearance of the detection tube, the color reaction area, and the surrounding background.

[0025] Optionally, obtaining an image of the detection tube by means of a photographing device includes: obtaining a relatively long gas detection tube filled with the gas to be tested; placing the detection tube within the field of view of the photographing device to ensure that the entire length of the detection tube is within the shooting screen; and photographing an image of the detection tube of the relatively long gas detection tube by means of the photographing device.

[0026] Among them, the ratio-length gas detection tube is a tool that detects the concentration of a specific gas based on a chemical color reaction. It is usually filled with a reagent that can react chemically with the gas to be tested. When the gas to be tested passes through the detection tube, it will react with the reagent to produce a color change, and the length of the color change is proportional to the concentration of the gas to be tested. It should be noted that the gas to be tested can be introduced into the detection tube through a specific sampling method, such as using a gas sampling pump to draw the gas in the environment into the detection tube, or directly exposing the detection tube to an environment containing the gas to be tested to allow the gas to diffuse naturally into the detection tube.

[0027] Specifically, the shooting device (such as a camera) has a certain field of view, which is determined by the focal length, viewing angle and other parameters of the lens. Placing the detection tube within the field of view of the shooting device is to ensure that the detection tube can be captured by the lens. If part or all of the detection tube is not within the field of view, the complete image of the detection tube cannot be obtained, which affects subsequent analysis. Specifically, the shooting distance can be adjusted according to the length of the detection tube and the lens parameters of the shooting device so that the full length of the detection tube can be clearly presented in the shooting picture.

[0028] Optionally, before acquiring the image of the detection tube through the shooting device, the method also includes: fixing the shooting device at the target position; acquiring a standard color block of a fixed length, placing the standard color block on the same shooting plane as the longer gas detection tube, and shooting the standard color block and the detection tube through the shooting device to acquire the image to be calibrated; determining the first length of the standard color block in the image to be calibrated and the second length of the detection tube; calibrating the shooting device according to the first length, the second length and the fixed length, and generating calibration information.

[0029] The purpose of fixing the camera is to ensure that the shooting angle, distance and other parameters remain stable during the subsequent shooting process, and to ensure that the images obtained each time are consistent, so as to facilitate accurate analysis and comparison. A standard color block is an object of known length, usually with bright colors and clear boundaries, so that it is easy to identify and measure in the image. The length of the standard color block is accurately measured and can be used as a reference standard to calibrate the camera.

[0030] Specifically, by using standard color blocks, a corresponding relationship between the length of an object in an image and its actual length can be established. Since the actual length of the standard color block is known, once the length of the standard color block in the image is determined, the actual length of other objects in the image can be calculated based on the proportional relationship.

[0031] Among them, the shooting plane refers to the imaging plane of the shooting device, that is, the plane where the object in the image is located. Placing the standard color block and the detection tube on the same shooting plane can ensure that their positional relationship in the image is consistent with the actual positional relationship. Image processing software or algorithms can be used to measure the length of the standard color block in the image to be calibrated. For example, the boundary of the standard color block can be determined by an edge detection algorithm, and then the pixel distance between the boundaries is calculated, and then the pixel distance is converted into the actual length according to the resolution of the image. Principle: The edge detection algorithm determines the boundary of the object based on the grayscale change of the edge of the object in the image. In the image to be calibrated, the edge of the standard color block usually has obvious grayscale changes, and its boundary can be accurately determined by the edge detection algorithm. Then, according to the resolution of the image, the pixel distance can be converted into the actual length. Image processing software or algorithms can also be used to measure the length of the detection tube in the image to be calibrated.

[0032] Furthermore, according to the actual length (fixed length) of the standard color block and the first length of the standard color block in the image to be calibrated, the proportional coefficient between the length in the image and the actual length can be calculated. The proportional coefficient is equal to the actual length divided by the image length, which reflects the imaging proportional relationship of the shooting device. By calculating the proportional coefficient, the length in the image can be converted into the actual length, thereby realizing the calibration of the shooting device. Using the proportional coefficient and the second length of the detection tube in the image to be calibrated, the actual length of the detection tube can be calculated. The actual length of the detection tube is equal to the proportional coefficient multiplied by the second length. The calibration information may include the proportional coefficient, the parameter setting of the shooting device, the actual length of the standard color block, etc.

[0033] S120: Identify the color reaction area in the detection tube image, and determine the pixel value corresponding to the color reaction area.

[0034] Among them, the color reaction area refers to the area in the detection tube image that shows a specific color change due to the reaction between the gas to be tested and the reagent in the detection tube. The color of the color reaction area is obviously different from the color of the unreacted part of the detection tube and the surrounding background. Different gases to be tested will produce different colors after reacting with the reagent. By identifying and analyzing the color reaction area, information about the gas to be tested can be obtained. For example, if the reagent in the detection tube turns blue after reacting with a certain gas to be tested, then the area that appears blue in the detection tube image is the color reaction area. In the detection tube image, the pixel value of the color reaction area reflects the color characteristics of the area. By determining the pixel value of the color reaction area, the degree of color reaction can be quantified, and then linked to the concentration of the gas to be tested.

[0035] Optionally, identifying the color reaction area in the detection tube image includes: preprocessing the detection tube image to generate a processed detection tube image, wherein the preprocessing includes denoising and contrast enhancement; determining the color value of each pixel in the processed detection tube image, and determining the color reaction area according to the color value.

[0036] It is known that during the image acquisition and transmission process, due to the influence of various factors, there will be noise in the detection tube image. The noise will interfere with the subsequent recognition of the color reaction area and reduce the quality and accuracy of the image. The purpose of denoising is to remove these noises to make the image clearer. The contrast between the color reaction area and the surrounding background in the detection tube image may not be obvious enough, which in turn affects the recognition of the color reaction area. The purpose of contrast enhancement is to make the difference between the color reaction area and the surrounding background more significant, which is convenient for subsequent analysis.

[0037] Specifically, in a digital image, each pixel has a color value, which is usually represented by the values ​​of the three channels RGB (red, green, and blue). By reading an image file or using image processing software, the RGB value of each pixel in the detection tube image can be obtained. The color reaction area refers to the area in the detection tube image that shows a specific color change due to the reaction between the gas to be tested and the reagent in the detection tube. By comparing the color value of the pixel with the preset color range, it can be determined which pixels belong to the color reaction area.

[0038] Exemplarily, a color range can be set according to the color characteristics of the gas to be tested after the reaction with the reagent. For example, if the color after the reaction is red, the value of the red channel can be set within a certain range, while the values ​​of the green and blue channels are relatively low. Then traverse each pixel in the detection tube image and compare its color value with the set color range. If the color value of the pixel is within the color range, it is considered that the pixel belongs to the color reaction area. Finally, the color reaction area can be marked using image processing software or an image processing library in a programming language. For example, the pixel value of the color reaction area can be set to a specific value, or marked with different colors for subsequent analysis and processing.

[0039] Optionally, determining the pixel value corresponding to the color reaction area includes: determining a boundary position of the color reaction area; determining length information of the color reaction area according to the boundary position, and converting the length information into a pixel value.

[0040] The color reaction area in the image usually has a different color feature from the surrounding area. By analyzing the color value changes of pixels in the image, the boundary position of the color reaction area can be determined. Specifically, methods such as color segmentation and edge detection can be used.

[0041] Specifically, once the border position of the color reaction area is determined, the length information can be determined by measuring the distance between the borders. In an image, the length can be represented by the number of pixels. The length information is usually in units of actual physical length, and in an image, it needs to be converted into pixel values.

[0042] S130: Determine the target gas concentration of the gas to be measured according to the pixel value.

[0043] The target gas concentration refers to the concentration of the gas to be tested in the detection tube. By analyzing the color reaction area and its pixel value in the detection tube image, the target gas concentration of the gas to be tested can be determined based on the pre-established relationship between the pixel value and the gas concentration.

[0044] Optionally, the target gas concentration of the gas to be tested is determined based on the pixel value, including: determining the pixel length corresponding to the pixel value, and converting the pixel length into an actual length in combination with calibration information; obtaining a concentration determination list, wherein the concentration determination list includes gas concentrations corresponding to each length; matching the actual length through the concentration determination list to determine the target gas concentration corresponding to the actual length.

[0045] Specifically, the controller will also determine the pixel length corresponding to the pixel value, which can be determined by analyzing the distribution and arrangement of the pixels in the image. The calibration information is obtained by calibrating the camera device using a standard color block of known length in the previous step, which contains the proportional relationship between the pixel length and the actual length. The pixel length can be converted into the actual length through the calibration information.

[0046] Among them, the concentration determination list is pre-established, which contains the correspondence between the length of the color reaction area and the concentration of the gas to be tested. Different lengths correspond to different gas concentrations. This is based on the working principle of the ratio-length gas detection tube, that is, after the gas to be tested reacts with the reagent in the detection tube, the length of the color reaction area generated is proportional to the gas concentration.

[0047] For example, by conducting a test gas experiment with known concentrations, the length of the color reaction area at different concentrations can be measured to establish a concentration determination list. For example, in the experiment, the test gas with known concentrations of 10 ppm, 20 ppm, 30 ppm, etc. is passed into a comparative gas detection tube, and the corresponding color reaction area lengths of 2 cm, 4 cm, 6 cm, etc. are recorded, and then a concentration determination list is established, which includes the gas concentrations corresponding to different lengths.

[0048] Specifically, according to the correspondence between the length and the concentration established in the concentration determination list, the target gas concentration corresponding to the actual measured length of the color reaction area can be determined by searching or interpolating. If the actual measured length of the color reaction area is 5 cm, find the record closest to this length in the concentration determination list. Assume that the list records that the gas concentration corresponding to the length of 4.5 cm is 25 ppm, and the gas concentration corresponding to the length of 5.5 cm is 30 ppm. The target gas concentration when the actual length is 5 cm can be determined by linear interpolation. For example, the target gas concentration is calculated to be approximately 27.5 ppm ((30 ppm - 25 ppm) × (5 cm - 4.5 cm) / (5.5 cm - 4.5 cm) + 25 ppm).

[0049] Optionally, after determining the target gas concentration of the gas to be tested according to the pixel value, the method further includes: displaying the target gas concentration; determining a timestamp corresponding to the target gas concentration, and storing the target gas concentration in a database according to the timestamp.

[0050] Among them, the display of the target gas concentration can be realized by an electronic display screen. The display screen can be a liquid crystal display (LCD), a light emitting diode display (LED), etc. The timestamp is a mark that records time, usually expressed in a specific format. When determining the timestamp corresponding to the target gas concentration, it is necessary to obtain the current time information and associate it with the target gas concentration. The function of the timestamp is to record the measurement time of the target gas concentration for subsequent data analysis and query. Through the timestamp, the change of the target gas concentration over time can be understood. A database is a software system for storing and managing data. Storing the target gas concentration and timestamp in a database can facilitate long-term storage, query and analysis of data. Databases usually use structured data storage methods, such as table structures in relational databases. The target gas concentration and timestamp can be stored as data records in a table in the database for subsequent query and statistical analysis.

[0051] The technical solution of the embodiment of the present invention obtains clear and accurate images of the detection tube through a shooting device, avoiding errors that may be caused by manual observation and providing a reliable basis for subsequent accurate analysis. Identifying the color reaction area and determining its pixel value can process information in a digital and quantitative manner, reducing the influence of subjective judgment, thereby improving the accuracy of gas concentration measurement. The automated image acquisition and processing process greatly shortens the detection time, can quickly obtain detection results, and meets the requirements for detection speed in large-scale sample detection or emergency situations. It is not limited by environmental conditions during manual detection and can perform detection stably and accurately in various complex environments.

[0052] Embodiment 2 Figure 2 This is a schematic diagram of the structure of a gas concentration determination device provided in the second embodiment of the present invention. The device can be implemented in software and / or hardware, and can generally be integrated into an electronic device that executes the method. Figure 2 As shown, the device comprises: The detection tube image acquisition module 210 is used to acquire the detection tube image through a shooting device, wherein the detection tube image is a gas reaction image of the gas to be detected; A color reaction area pixel value determination module 220 is used to identify the color reaction area in the detection tube image and determine the pixel value corresponding to the color reaction area; The target gas concentration determination module 230 is used to determine the target gas concentration of the gas to be measured according to the pixel value.

[0053] Optionally, the detection tube image acquisition module 210 is specifically used to: obtain a relatively long gas detection tube filled with a gas to be tested; place the detection tube within the field of view of a shooting device to ensure that the entire length of the detection tube is within the shooting screen; and capture an image of the detection tube of the relatively long gas detection tube through the shooting device.

[0054] Optionally, the device also includes: a shooting device calibration module, which is used to: fix the shooting device at a target position before acquiring the image of the detection tube through the shooting device; acquire a standard color block of a fixed length, place the standard color block on the same shooting plane as the longer gas detection tube, and shoot the standard color block and the detection tube through the shooting device to acquire the image to be calibrated; determine the first length of the standard color block in the image to be calibrated and the second length of the detection tube; calibrate the shooting device according to the first length, the second length and the fixed length, and generate calibration information.

[0055] Optionally, the color reaction area pixel value determination module 220 specifically includes: a color reaction area identification unit, used to: preprocess the detection tube image to generate a processed detection tube image, wherein the preprocessing includes denoising and contrast enhancement; determine the color value of each pixel in the processed detection tube image, and determine the color reaction area according to the color value.

[0056] Optionally, the color reaction area pixel value determination module 220 specifically includes: a pixel value determination unit, used to: determine the boundary position of the color reaction area; determine the length information of the color reaction area according to the boundary position, and convert the length information into a pixel value.

[0057] Optionally, the target gas concentration determination module 230 is specifically used to: determine the pixel length corresponding to the pixel value, and convert the pixel length into an actual length in combination with calibration information; obtain a concentration determination list, wherein the concentration determination list includes gas concentrations corresponding to each length; match the actual length through the concentration determination list to determine the target gas concentration corresponding to the actual length.

[0058] Optionally, the device also includes: a gas concentration display and storage module, which is used to: display the target gas concentration after determining the target gas concentration of the gas to be tested according to the pixel value; determine the timestamp corresponding to the target gas concentration, and store the target gas concentration in a database according to the timestamp.

[0059] A gas concentration determination device provided in an embodiment of the present invention can execute a gas concentration determination method provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.

[0060] The technical solution of the embodiment of the present invention obtains clear and accurate images of the detection tube through a shooting device, avoiding errors that may be caused by manual observation and providing a reliable basis for subsequent accurate analysis. Identifying the color reaction area and determining its pixel value can process information in a digital and quantitative manner, reducing the influence of subjective judgment, thereby improving the accuracy of gas concentration measurement. The automated image acquisition and processing process greatly shortens the detection time, can quickly obtain detection results, and meets the requirements for detection speed in large-scale sample detection or emergency situations. It is not limited by environmental conditions during manual detection and can perform detection stably and accurately in various complex environments.

[0061] Embodiment 3 Figure 3 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0062] like Figure 3As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.

[0063] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0064] The processor 11 may be a variety of general and / or dedicated processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a gas concentration determination method.

[0065] In some embodiments, a gas concentration determination method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the gas concentration determination method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform a gas concentration determination method in any other appropriate manner (e.g., by means of firmware).

[0066] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0067] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0068] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0069] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0070] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0071] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0072] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0073] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for determining gas concentration, characterized in that: include: Acquire a detection tube image by a photographing device, wherein the detection tube image is a gas reaction image of the gas to be detected; Identify the color reaction area in the detection tube image, and determine the pixel value corresponding to the color reaction area; The target gas concentration of the gas to be measured is determined according to the pixel value.

2. A method for determining gas concentration according to claim 1, characterized in that: The method of acquiring the image of the detection tube by using a photographing device comprises: Obtain a comparatively long gas detection tube filled with a gas to be detected; The detection tube is placed within the field of view of the camera to ensure that the entire length of the detection tube is within the camera image; The detection tube image of the relatively long gas detection tube is captured by a shooting device.

3. A method for determining gas concentration according to claim 2, characterized in that: Before acquiring the image of the detection tube by the photographing device, the method further includes: Fix the camera device at the target location; Obtain a standard color block of fixed length, place the standard color block on the same shooting plane as the longer gas detection tube, and shoot the standard color block and the detection tube by a shooting device to obtain an image to be calibrated; Determine a first length of the standard color block in the image to be calibrated and a second length of the detection tube; The photographing device is calibrated according to the first length, the second length and the fixed length to generate calibration information.

4. A method for determining gas concentration according to claim 1, characterized in that: The identifying the color reaction area in the detection tube image includes: Preprocessing the detection tube image to generate a processed detection tube image, wherein the preprocessing includes denoising and contrast enhancement; The color value of each pixel in the processed detection tube image is determined, and the color reaction area is determined according to the color value.

5. A method for determining gas concentration according to claim 4, characterized in that: The determining of the pixel value corresponding to the color reaction area includes: Determine the border position of the color reaction area; The length information of the color reaction area is determined according to the boundary position, and the length information is converted into a pixel value.

6. A method for determining gas concentration according to claim 3, characterized in that: The step of determining the target gas concentration of the gas to be measured according to the pixel value comprises: Determine a pixel length corresponding to the pixel value, and convert the pixel length into an actual length in combination with the calibration information; Obtaining a concentration determination list, wherein the concentration determination list includes gas concentrations corresponding to each length; The actual length is matched with the concentration determination list to determine the target gas concentration corresponding to the actual length.

7. A method for determining gas concentration according to claim 1, characterized in that: After determining the target gas concentration of the gas to be measured according to the pixel value, the method further includes: Displaying the target gas concentration; A timestamp corresponding to the target gas concentration is determined, and the target gas concentration is stored in a database according to the timestamp.

8. A gas concentration determination device, characterized in that: include: A detection tube image acquisition module, used to acquire a detection tube image through a shooting device, wherein the detection tube image is a gas reaction image of the gas to be detected; A color reaction area pixel value determination module, used to identify the color reaction area in the detection tube image and determine the pixel value corresponding to the color reaction area; The target gas concentration determination module is used to determine the target gas concentration of the gas to be measured according to the pixel value.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute a gas concentration determination method according to any one of claims 1 to 7.

10. A computer storage medium, characterized in that: The computer storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a gas concentration determination method according to any one of claims 1 to 7 when executed.