A computer program for determining wastewater quality
The computer program employs binarization and adaptive binarization with image processing to provide clear criteria for wastewater quality determination, enhancing accuracy and reducing processing load.
Patent Information
- Application Number
- JP2023013886
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2023-02-01
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2043-02-01
AI Technical Summary
Existing technologies for determining wastewater quality using machine learning lack clear criteria, making it difficult to identify the cause of water quality deterioration.
A computer program that utilizes binarization processing and adaptive binarization to determine wastewater quality based on clear criteria, including image processing functions for brightness equalization and chromaticity standardization to generate a target image for accurate determination.
Enables precise identification of wastewater quality abnormalities and reduces processing load by using adaptive binarization only when necessary, improving determination accuracy and efficiency.
Smart Images

Figure 0007772003000001 
Figure 0007772003000002 
Figure 0007772003000003
Abstract
Description
[Technical Field]
[0001] The present disclosure relates to a computer program for determining the quality of wastewater. [Background technology]
[0002] Various techniques for determining the quality of wastewater have been proposed. For example, Patent Document 1 discloses a technique for determining whether the quality of wastewater is normal by using learned parameters obtained by machine learning using image data of wastewater under normal conditions as training data. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Japanese Patent Publication No. 2021-140522 Summary of the Invention [Problem to be solved by the invention]
[0004] However, the technology in Patent Document 1 uses learned parameters obtained through machine learning to determine water quality, which results in unclear criteria for determination, making it difficult to identify the cause of water quality deterioration. Therefore, there is a need for a technology that can determine water quality using clear criteria. [Means for solving the problem]
[0005] The present disclosure can be realized in the following forms.
[0006] (1) According to one aspect of the present disclosure, there is provided a computer program for determining whether the quality of wastewater is normal or abnormal. The computer program causes a computer to realize an acquisition function for acquiring a target image, which is an image of the wastewater to be determined, a binarization processing function for binarizing the target image, a first comparison function for calculating a first area ratio, which is the proportion of the area of white portions in the binarized target image, and comparing the first area ratio with a predetermined first threshold, an adaptive binarization processing function for adaptively binarizing the target image, a second comparison function for calculating a second area ratio, which is the proportion of the area of white portions in the adaptively binarized target image, and comparing the second area ratio with a predetermined second threshold, and a determination function for determining that the water quality is normal if the first area ratio is equal to or less than the first threshold or the second area ratio is equal to or less than the second threshold, and for determining that the water quality is abnormal if the first area ratio exceeds the first threshold and the second area ratio exceeds the second threshold. According to this form of computer program, if the first area ratio, which is the area ratio of the white parts in the target image, exceeds the first threshold value and the second area ratio exceeds the second threshold value, the water quality of the wastewater is determined to be abnormal, so that the water quality can be determined based on clear criteria and it can be identified that the cause of the abnormality is bubbles. (2) In the computer program of the above aspect, the adaptive binarization processing function may have a function of performing the adaptive binarization processing on the target image when the first area ratio exceeds the first threshold value. According to this form of computer program, adaptive binarization processing is performed on the target image when the first area ratio exceeds the first threshold, thereby reducing the processing load on the computer compared to a configuration in which adaptive binarization processing is performed on all target images to be binarized. (3) In the computer program of the above form, the computer may further realize an image processing function of performing at least one of brightness equalization and chromaticity standardization on a pre-processed image, which is an image of the wastewater, to generate the target image. According to this form of computer program, the target image to be subjected to binarization processing and adaptive binarization processing is generated by performing brightness equalization and chromaticity standardization processing on the pre-processed image, so that the water quality of the wastewater in the target image can be accurately determined even if the imaging conditions at the time of imaging differ due to differences in the external environment. (4) In the computer program of the above form, the equalization of brightness may be performed by calculating a first average value by averaging the brightness of each pixel value in the pre-processed image, and correcting the difference between the first average value and a first reference value as a predetermined reference value for the brightness for all pixel values in the pre-processed image; and the standardization of chromaticity may be performed by calculating a second average value by averaging the chromaticity indicating the hue and saturation of each pixel value in the pre-processed image, and correcting the difference between the second average value and a second reference value as a predetermined reference value for the chromaticity for all pixel values in the pre-processed image. According to this aspect of the computer program, a first average value is calculated by averaging the brightness of each pixel value in the preprocessed image, and the difference between the first average value and the first reference value as a predetermined reference value for brightness is corrected for all pixel values in the preprocessed image, thereby easily correcting variations in brightness in the preprocessed image.Furthermore, a second average value is calculated by averaging the chromaticity indicating the hue and saturation of each pixel value in the preprocessed image, and the difference between the second average value and the second reference value as a predetermined reference value for chromaticity is corrected for all pixel values in the preprocessed image, thereby easily correcting variations in chromaticity in the preprocessed image. The present disclosure can be realized in various forms other than a computer program for determining the quality of wastewater, such as a method for determining the quality of wastewater, a water quality determination system, or a water quality determination device. [Brief explanation of the drawings]
[0007] [Figure 1] FIG. 1 is a diagram illustrating the route of drainage from the facility to the river. [Figure 2] FIG. 1 is a diagram showing a schematic configuration of a water quality determination system. [Figure 3]3 is a flowchart showing the procedure of a water quality determination process executed in the water quality determination device. [Figure 4] 10 is a flowchart showing the procedure of a water quality determination process in the second embodiment. [Figure 5] 10 is a flowchart showing a procedure for image processing. [Figure 6] FIG. 1 is an explanatory diagram showing an example in which water quality determination is performed using the water quality determination system. DETAILED DESCRIPTION OF THE INVENTION
[0008] A. First embodiment: A1. Water Quality Judgment System 1 Configuration: FIG. 1 is a diagram illustrating the path of wastewater W1 from a facility 81 to a river R. As shown in FIG. 1, wastewater W1 discharged from a facility 81, such as a factory, is transferred to a grit basin 83 installed outdoors. The grit basin 83 is a tank for removing solids contained in the wastewater W1 by settling them under their own weight. That is, in the grit basin 83, solids that would interfere with purification treatment at a wastewater treatment plant 87, which will be described later, are removed from the wastewater W1. In addition, in the grit basin 83, a water quality determination system 1 determines whether the water quality of the wastewater W1 is normal or abnormal based on the amount of bubbles in an image P capturing the water surface of the wastewater W1. If the amount of bubbles in the wastewater W1 is large, it is possible that the pH of the wastewater W1 is biased toward alkaline or that the concentration of chemicals, such as paint, is high. For this reason, wastewater W2, which has a large amount of bubbles and is therefore determined to be abnormal, is transferred to a treatment tank 85, separate from the wastewater treatment plant 87, for appropriate treatment. On the other hand, the wastewater W1 that has a small amount of bubbles, that is, that is, that is determined to be normal, is transferred to the wastewater treatment plant 87, where it is purified and then discharged into the river R.
[0009] FIG. 2 is a diagram showing the schematic configuration of the water quality determination system 1. The water quality determination system 1 includes an imaging device 9 and a water quality determination device 10. The imaging device 9 is a device that captures an image of the wastewater W1 to be determined. The imaging device 9 includes an optical system such as a lens and an imaging element, and captures images using visible light. The imaging element may be, for example, a CCD image sensor or a CMOS image sensor. The imaging device 9 captures an image of a predetermined imaging area A on the water surface of the wastewater W1 in the settling basin 83, and outputs the image P to the water quality determination device 10. The output image P is stored in a memory unit 5, which will be described later.
[0010] The water quality determination device 10 determines whether the wastewater W1 is normal or abnormal using an image P (hereinafter also referred to as a target image P) of the wastewater W1 captured by an imaging device 9. In this embodiment, the water quality determination device 10 is configured as a computer including a communication unit 2, a display unit 3, an input operation unit 4, a memory unit 5, and a CPU (Central Processing Unit) 6. The communication unit 2, the display unit 3, the input operation unit 4, the memory unit 5, and the CPU 6 are connected to each other via an internal path 7 so that they can communicate with each other.
[0011] The communication unit 2 is a functional unit that communicates with the imaging device 9. The water quality determination device 10 receives the image P captured by the imaging device 9 via the communication unit 2. The display unit 3 is a display that displays the water quality determination results, etc. The input operation unit 4 is a device for inputting user operations to the water quality determination device 10. The input operation unit 4 is an input device such as a mouse, keyboard, or touch panel. The memory unit 5 is composed of a ROM (Read Only Memory), RAM (Random Access Memory), etc. The memory unit 5 stores a computer program 51, the target image P sent from the imaging device 9, etc.
[0012] The CPU 6 executes the computer program 51 stored in the storage unit 5 to function as an acquisition unit 61, an image processing unit 62, a binarization processing unit 63, a first comparison unit 64, an adaptive binarization processing unit 65, a second comparison unit 66, and a determination unit 67. The functions of the acquisition unit 61, the image processing unit 62, the binarization processing unit 63, the first comparison unit 64, the adaptive binarization processing unit 65, the second comparison unit 66, and the determination unit 67 are also referred to as an acquisition function, an image processing function, a binarization processing function, a first comparison function, an adaptive binarization processing function, a second comparison function, and a determination function, respectively.
[0013] The acquisition unit 61 acquires the target image P from the storage unit 5. The image processing unit 62 performs image processing on the acquired target image P. The image processing includes, for example, adjusting the shading in the target image P. The binarization processing unit 63 performs binarization processing on the image-processed target image P. The binarization processing is a process of converting the target image P into an image of two colors, white and black. In the binarization processing, the pixel value of each pixel in the target image P is compared with a predetermined pixel threshold, and is converted into a pixel value corresponding to white or black, with the pixel threshold as the boundary. Note that image processing may not be performed in this embodiment. In such a case, the binarization processing unit 63 performs binarization processing on the target image P acquired by the acquisition unit 61.
[0014] The first comparing unit 64 calculates the proportion of white area in the binarized target image P (hereinafter also referred to as the first area ratio). The first comparing unit 64 also compares the first area ratio with a predetermined first threshold. Specifically, the first comparing unit 64 compares the first area ratio with the predetermined first threshold. The first threshold is, for example, 30%. Note that the first threshold is not limited to 30% and may be set to any value.
[0015] The adaptive binarization processor 65 adaptively binarizes the target image P. In the binarization process by the binarization processor 63 described above, the pixel value of each pixel in the target image P is compared with a predetermined value, thereby converting each pixel to white or black. In contrast, in the adaptive binarization process, the pixel value of the pixel to be converted is compared with the average value of the pixel values of the pixels surrounding the pixel (e.g., the eight pixels surrounding the pixel), and each pixel is converted to white or black depending on the comparison result. In other words, the pixel threshold used in the comparison is the average value of the pixel values of the surrounding pixels to be converted. Note that a median value may be used instead of the average value. Note that in this embodiment, the adaptive binarization processor 65 adaptively binarizes the target image P when the comparison by the first comparator 64 indicates that the first area ratio exceeds the first threshold.
[0016] The second comparing unit 66 calculates the proportion of the white area in the target image P that has been subjected to adaptive binarization processing by the adaptive binarization processing unit 65 (hereinafter also referred to as the second area ratio). The second comparing unit 66 also compares the second area ratio with a predetermined second threshold. Specifically, the second comparing unit 66 compares the second area ratio with the predetermined second threshold. The second threshold is, for example, 65%. Note that the second threshold is not limited to 65% and may be set to any value.
[0017] The determination unit 67 determines whether the water quality of the wastewater W1 is normal or abnormal using the comparison results of the first comparison unit 64 and the second comparison unit 66. Specifically, the determination unit 67 determines that the water quality of the wastewater W1 is normal when the first area ratio is equal to or less than the first threshold value or the second area ratio is equal to or less than the second threshold value. On the other hand, the determination unit 67 determines that the water quality of the wastewater W1 is abnormal when the first area ratio exceeds the first threshold value and the second area ratio exceeds the second threshold value. The determination result of the determination unit 67 can be displayed on the display unit 3.
[0018] A2. Water quality determination process: FIG. 3 is a flowchart showing the steps of the water quality determination process executed in the water quality determination device 10. The water quality determination process is a process for determining whether the water quality of the wastewater W1 is normal or abnormal. The water quality determination process is started when the user inputs a command to start the process using the input operation unit 4. As shown in FIG. 3, in the water quality determination device 10, the acquisition unit 61 acquires the target image P from the memory unit 5 (step S105).
[0019] The binarization processing unit 63 binarizes the target image P acquired by the acquisition unit 61 (step S110). The first comparison unit 64 calculates a first area ratio in the target image P binarized by the binarization processing unit 63 (step S115). The first comparison unit 64 compares the calculated first area ratio with a first threshold (step S120).
[0020] The determination unit 67 determines whether the first area ratio exceeds the first threshold value using the comparison result of step S120 (step S125). If the first area ratio does not exceed the first threshold value (step S125: No), that is, if the first area ratio is equal to or less than the second threshold value, the determination unit 67 determines that the water quality is normal (step S155). On the other hand, if the first area ratio exceeds the first threshold value (step S125: Yes), the adaptive binarization processor 65 performs adaptive binarization processing on the target image P (step S130). The second comparison unit 66 calculates a second area ratio in the target image P that has been adaptively binarized by the adaptive binarization processor 65 (step S135). The second comparison unit 66 compares the calculated second area ratio with the second threshold value (step S140).
[0021] The determination unit 67 determines whether the second area ratio exceeds the second threshold value using the comparison result of step S140 (step S145). If the second area ratio exceeds the second threshold value (step S145: Yes), the determination unit 67 determines that the water quality of the wastewater W1 is abnormal (step S150). On the other hand, if the second area ratio does not exceed the second threshold value (step S145: No), that is, if the second area ratio is equal to or less than the second threshold value, the determination unit 67 determines that the water quality of the wastewater W1 is normal (step S155).
[0022] According to the water quality determination system 1 of the first embodiment described above, if the first area ratio, which is the area ratio of the white parts in the target image P, exceeds the first threshold value and the second area ratio exceeds the second threshold value, the water quality of the wastewater W1 is determined to be abnormal, so that the water quality can be determined based on clear criteria and it can be identified that the cause of the abnormality is bubbles.
[0023] In addition, the adaptive binarization processing unit 65 performs adaptive binarization processing on the target image P when the first area ratio exceeds the first threshold value, thereby reducing the load compared to a configuration in which adaptive binarization processing is performed on all target images P to be binarized.
[0024] In addition, the water quality of the wastewater W1 is determined using an image obtained by adaptively binarizing the target image P. Therefore, compared to a configuration in which adaptive binarization processing is not performed, the wastewater W1 can be determined using a binarized image in which noise caused by time and weather is reduced, thereby suppressing a decrease in determination accuracy due to noise.
[0025] Furthermore, since the water quality of the wastewater W1 is determined not only using the image obtained by adaptively binarizing the target image P but also using the binarized image, a decrease in the determination accuracy can be suppressed compared to a configuration that uses only the image obtained by adaptive binarization. Specifically, if the target image P contains few bubbles in the imaging area A but has a relatively large area of white areas (i.e., blown-out highlights) caused by light reflection, performing adaptive binarization on the target image P will increase the number of pixels converted to white compared to binarization. This may result in a decrease in the determination accuracy. Therefore, in both the binarized image and the adaptive binarized image as in this embodiment, the water quality of the wastewater W1 is determined to be abnormal only when the area of the white areas exceeds a predetermined threshold, thereby suppressing a decrease in the determination accuracy.
[0026] B. Second embodiment: 4 is a flowchart showing the procedure for water quality determination processing executed in the water quality determination device 10 of the second embodiment. While the adaptive binarization processor 65 of the first embodiment adaptively binarizes the target image P after the binarization processor 63 binarizes the target image P, the adaptive binarization processor 65 of the second embodiment differs from the adaptive binarization processor 65 of the first embodiment in that it performs adaptive binarization processing of the target image P in parallel with the binarization processing of the target image P by the binarization processor 63. Other configurations of the water quality determination device 10 of the second embodiment are the same as those of the first embodiment, and therefore detailed descriptions thereof will be omitted. Furthermore, the step of acquiring the target image P (step S105) in the procedure for water quality determination processing of the second embodiment is the same as that of the water quality determination processing of the first embodiment, and therefore detailed descriptions thereof will be omitted.
[0027] As shown in FIG. 4, following the process of step S105, the process of step S210 and the process of step S225, which will be described later, are executed in parallel.
[0028] The binarization processing unit 63 performs binarization processing on the target image P acquired by the acquisition unit 61 (step S210). Next, the first comparison unit 64 calculates a first area ratio in the target image P binarized by the binarization processing unit 63 (step S215). The first comparison unit 64 also compares the first area ratio with a first threshold (step S220). Note that the processing content of the above steps S210 to S220 is the same as the processing content of the above steps S110 to S120.
[0029] The adaptive binarization processor 65 performs adaptive binarization on the target image P (step S225). The second comparator 66 calculates a second area ratio in the target image P that has been adaptively binarized by the adaptive binarization processor 65 (step S230). The adaptive binarization processor 65 compares the calculated second area ratio with a second threshold (step S235). Note that the processing content of the above steps S225 to S235 is the same as the processing content of the above steps S130 to S140.
[0030] The determination unit 67 determines whether the first area ratio exceeds the first threshold and the second area ratio exceeds the second threshold using the comparison results of steps S220 and S235 (step S240). If the first area ratio exceeds the first threshold and the second area ratio exceeds the second threshold (step S240: Yes), the determination unit 67 determines that the water quality of the wastewater W1 is abnormal (step S245). On the other hand, if the first area ratio exceeds the first threshold and the second area ratio does not exceed the second threshold, that is, if the first area ratio is equal to or less than the first threshold or the second area ratio is equal to or less than the second threshold (step S240: No), the determination unit 67 determines that the water quality of the wastewater W1 is normal (step S250).
[0031] According to the water quality determination system 1 of the second embodiment described above, the process of performing binarization processing and comparing the first area ratio with the first threshold value (steps S210 to S220) and the process of performing adaptive binarization processing and comparing the second area ratio with the second threshold value (steps S225 to S235) are executed in parallel, thereby reducing the time required for water quality determination compared to a configuration in which the binarization processing process and the adaptive binarization processing process are performed sequentially.
[0032] C. Third embodiment: For example, when determining the water quality and color state of the wastewater W1 using a target image P obtained by capturing an image of the water surface of the wastewater W1 stored in a tank located outdoors, such as the settling basin 83 shown in FIG. 1, the imaging conditions of the imaging device 9 may change depending on the external environment at the time of imaging. Specifically, differences in the amount of sunlight irradiated in the imaging area A occur due to differences in weather, such as sunshine and rain, differences between times of day and night, and differences between seasons. This may result in sunlight being reflected in the imaging area A (water surface) or shadows being cast. Furthermore, after sunset, moonlight may be reflected in the imaging area A, or if streetlights are installed illuminating the periphery of the imaging area A, streetlight light may be reflected. Even when capturing an image of the water surface of the wastewater W1 stored in a tank located indoors, the brightness of the imaging area A may change depending on the illumination of indoor lighting, etc. Furthermore, when the wastewater W1 is normally nearly colorless and transparent, the color of the tank forming the settling basin 83 located behind the wastewater W1 may be reflected in the imaging area A. As described above, even if the water quality of the wastewater W1 is normal, variations in the colors contained in the captured image P may occur depending on various external environmental factors.
[0033] Therefore, the image processing unit 62 in the water quality determining device 10 of the third embodiment adjusts the lightness and chromaticity of an image of the wastewater W1 that is the target of water quality determination, to generate a target image P. The generated target image P is stored in the memory unit 5. In this embodiment, the image is expressed in the L*a*b color system (hereinafter referred to as the Lab color system). The L value represents lightness, and the a value and b value represent chromaticity, i.e., hue and saturation. The function performed by the image processing unit 62 is also referred to as an image processing function.
[0034] 5 is a flowchart showing the steps of image processing. Image processing is performed before the step of acquiring the target image P (step S105) described above in the water quality assessment process. The image processing includes a brightness equalization step (step S300) and a chromaticity standardization step (step S350). The brightness equalization step (step S300) includes steps S305 to S330, which will be described later. The chromaticity standardization step (step S350) includes steps S355 to S380, which will be described later.
[0035] First, a brightness equalization step (step S300) is executed. The brightness equalization step (step S300) is a step of correcting the image captured of the wastewater W1 so as to reduce variations in brightness in each pixel value of the image.
[0036] The image processing unit 62 reads the first pre-processed image stored in the storage unit 5 (step S305). Here, the "first pre-processed image" refers to an image of the wastewater W1 (area A) before the brightness equalization process is performed.
[0037] The image processing unit 62 acquires pixel values relating to the brightness of all pixels constituting the first pre-processed image, that is, L values in the Lab color system, for each pixel (step S310).
[0038] The image processing unit 62 calculates a first average value (step S315). The "first average value" is the average value of the brightness of each pixel value in the first pre-processed image. In this embodiment, the first average value is the sum of the L values of each pixel that makes up the first pre-processed image divided by the number of pixels.
[0039] The image processing unit 62 calculates the difference between a predetermined first reference value and the first average value as a first difference (step S320). The first reference value is a predetermined L value. For example, when the L value is expressed in 256 gradations from 0 to 255, the first reference value is 127 or 128, which is a value near the middle between the upper and lower limit gradation values of the L value. Note that the L value is not limited to 127 or 128, and any value may be set.
[0040] The image processing unit 62 corrects the L values of all pixels in the first preprocessed image by the first difference (step S325). As a result, a second preprocessed image is generated in which the variation in brightness (L value) in the first preprocessed image is reduced (step S330). The second preprocessed image is stored in the storage unit 5. In this manner, the brightness equalization step (step S300) is executed.
[0041] Following the brightness equalization step (step S300), a chromaticity standardization step (step S350) is executed. The chromaticity standardization step (step S350) is a step of correcting the second pre-processed image so as to reduce chromaticity variations in each pixel value of the second pre-processed image.
[0042] The image processing unit 62 reads the second unprocessed image stored in the storage unit 5 (step S355).
[0043] The image processing unit 62 acquires pixel values relating to chromaticity for all pixels constituting the second pre-processed image, that is, a value and b value in the Lab color system, for each pixel (step S360).
[0044] The image processing unit 62 calculates a second average value (step S365). The second average value is the average value of the chromaticity of each pixel value in the second pre-processed image. In this embodiment, the second average value is composed of a second average value for the a-value and a second average value for the b-value. The second average value for the a-value is the sum of the a-values for each pixel that makes up the second pre-processed image divided by the number of pixels. The second average value for the b-value is the sum of the b-values for each pixel that makes up the second pre-processed image divided by the number of pixels.
[0045] The image processing unit 62 calculates the difference between a predetermined second reference value and the second average value as the second difference (step S370). The second reference value is a reference value related to predetermined chromaticity. Specifically, the second reference value includes two types: a second reference value related to the a value for correcting the a value of each pixel, and a second reference value related to the b value for correcting the b value of each pixel. The image processing unit 62 calculates the difference between the second average value related to the a value and the second reference value related to the a value as the second difference related to the a value. The image processing unit 62 also calculates the difference between the second average value related to the b value and the second reference value related to the b value as the second difference related to the b value. The second reference value related to the a value is, for example, the median between the upper limit gradation value of the a value and the lower limit gradation value of the a value. The second reference value related to the b value is, for example, the median between the upper limit gradation value of the b value and the lower limit gradation value of the b value. The second reference value for the a value and the second reference value for the b value are not limited to the median values, and any values may be set.
[0046] The image processing unit 62 corrects the a-values and b-values for all pixels of the second preprocessed image by the second difference (step S375). In this embodiment, the image processing unit 62 corrects the a-value of each pixel of the second preprocessed image by the second difference related to the a-value. The image processing unit 62 also corrects the b-value of each pixel of the second preprocessed image by the second difference related to the b-value. This generates a target image P that has been corrected so as to reduce the variations in the a-values and b-values, which represent chromaticity, contained in the second preprocessed image (step S380). The target image P is stored in the storage unit 5. In this manner, the chromaticity standardization step (step S350) is executed.
[0047] The target image P that has been subjected to the above-described image processing is used in the water quality determining device 10 for the water quality determining process of the wastewater W1.
[0048] According to the third embodiment of the water quality determination system 1 described above, the image processing unit 62 generates a target image P by performing brightness equalization and chromaticity standardization on the pre-processed image, which is an image of the wastewater W1, so that the water quality of the wastewater W1 in the target image P can be accurately determined even if the imaging conditions at the time of imaging differ due to differences in the external environment.
[0049] In addition, a first average value is calculated by averaging the brightness of each pixel value in the pre-processed image, and the difference between the first average value and a first reference value, which is a predetermined reference value for brightness, is corrected for all pixel values in the pre-processed image, so that variations in brightness in the pre-processed image can be easily corrected.
[0050] In addition, a second average value is calculated by averaging the chromaticity, which indicates the hue and saturation, of each pixel value in the preprocessed image, and the difference between the second average value and a second reference value, which is a predetermined reference value for chromaticity, is corrected for all pixel values in the preprocessed image, thereby making it easy to correct variations in chromaticity in the preprocessed image.
[0051] D. Working Example: FIG. 6 is an explanatory diagram showing an example of water quality determination using the water quality determination system 1. The image on the left side of FIG. 6 is the target image P, the image in the center of FIG. 6 is an image obtained by binarizing the target image P, and the image on the right side of FIG. 6 is an image obtained by adaptively binarizing the target image P. The numbers below the binarized image and the adaptively binarized image indicate the first area ratio and the second area ratio, i.e., the area ratio of the white portion in the image, respectively. In this example, the first threshold was set to 35%, and the second threshold was set to 65%. The pixel threshold for the binarization process was set to 180 / 255.
[0052] In Example 1, the first area ratio was 7% below the first threshold, and the second area ratio was 55% below the second threshold. Therefore, the water quality determination system 1 determined that the water quality was normal. In Example 2, the first area ratio was 83% above the first threshold, and the second area ratio was 67% above the second threshold. Therefore, the water quality determination system 1 determined that the water quality was abnormal. In Example 3, the first area ratio was 37% above the first threshold, and the second area ratio was 61% below the second threshold. Therefore, the water quality determination system 1 determined that the water quality was normal.
[0053] As shown in Example 3, there are cases where the first area ratio exceeds the first threshold, but the second area ratio is equal to or less than the second threshold. In other words, if water quality is determined using only a binarized image, there is a risk that water quality that should be determined as normal will be erroneously determined as abnormal. Therefore, as in the present disclosure, the accuracy of water quality determination can be improved by determining that water quality is abnormal if the first area ratio in the binarized image exceeds the first threshold and the second area ratio in the adaptive binarized image exceeds the second threshold.
[0054] E. Other Embodiments: (E1) In each of the above embodiments, the target of water quality judgment was wastewater W1 in the settling basin 83, but the present disclosure is not limited to this. The target of water quality judgment may be wastewater in any wastewater treatment facility other than the settling basin 83. Furthermore, the any wastewater treatment facility is not limited to being outdoors, and may be indoors.
[0055] (E2) In each of the above embodiments, the imaging device 9 is provided outside the water quality determination device 10, but the present disclosure is not limited to this. The imaging device 9 may be incorporated into the water quality determination device 10.
[0056] (E3) In the first embodiment, the judgment unit 67 judges that the water quality is normal when the first area ratio is equal to or less than the first threshold or the second area ratio is equal to or less than the second threshold, and judges that the water quality is abnormal when the first area ratio exceeds the first threshold and the second area ratio exceeds the second threshold, but the present disclosure is not limited to this. The judgment unit 67 may judge that the water quality is normal when the first area ratio is less than the first threshold or the second area ratio is less than the second threshold, and may judge that the water quality is abnormal when the first area ratio is equal to or greater than the first threshold and the second area ratio is equal to or greater than the second threshold.
[0057] (E4) In the second embodiment, the adaptive binarization processor 65 adaptively binarized the target image P when the first area ratio exceeded the first threshold. However, the present disclosure is not limited to this. The adaptive binarization processor 65 may adaptively binarize the target image P when the first area ratio is equal to or greater than the first threshold. Furthermore, in the second embodiment, the determination unit 67 determined that the water quality is normal when the second area ratio is equal to or less than the second threshold, and determined that the water quality is abnormal when the second area ratio exceeds the second threshold. However, the present disclosure is not limited to this. The determination unit 67 may determine that the water quality is normal when the second area ratio is less than the second threshold, and may determine that the water quality is abnormal when the second area ratio is equal to or greater than the second threshold.
[0058] (E5) In the third embodiment, the image is expressed in the Lab color system, but the present disclosure is not limited to this. The image may be expressed in any color system, such as RGB or CMYK.
[0059] (E6) In the third embodiment, the image processing includes a brightness equalization step (step S300) followed by a chromaticity standardization step (step S350), but the present disclosure is not limited to this. The brightness equalization step (step S300) may be performed after the chromaticity standardization step (step S350). Alternatively, only one of the brightness equalization step (step S300) and the chromaticity standardization step (step S350) may be performed.
[0060] (E7) In the above embodiments, the first area ratio and the second area ratio are the area ratios of white areas in the image, but the present disclosure is not limited to this. The first area ratio and the second area ratio may be the area ratios of black areas.
[0061] (E8) In the above embodiments, the determination result is displayed on the display unit 3, but the present disclosure is not limited to this. The determination result may be notified by sound or vibration.
[0062] (E9) In the first embodiment, the processes of steps S130 to S145 may be executed first, and then the processes of steps S110 to S145 may be executed.
[0063] The present disclosure is not limited to the above-described embodiments and can be realized in various configurations without departing from the spirit thereof. For example, the technical features in the embodiments corresponding to the technical features in each aspect described in the Summary of the Invention section can be appropriately replaced or combined to solve some or all of the above-described problems or achieve some or all of the above-described effects. Furthermore, if a technical feature is not described as essential in this specification, it can be appropriately deleted. [Explanation of symbols]
[0064] 1...water quality determination system, 2...communication unit, 3...display unit, 4...input operation unit, 5...memory unit, 6...CPU, 7...internal path, 9...imaging device, 10...water quality determination device, 51...computer program, 61...acquisition unit, 62...binarization processing unit, 63...first comparison unit, 64...adaptive binarization processing unit, 65...second comparison unit, 66...determination unit, 81...facility, 83...settling basin, 85...treatment tank, 87...wastewater treatment plant, A...imaging area, P...image, target image, R...river, W1...wastewater, W2...wastewater
Claims
1. A computer program for determining whether wastewater quality is normal or abnormal, an acquisition function for acquiring a target image, which is an image of the wastewater that is the target of the determination; a binarization processing function for binarizing the target image; a first comparison function that calculates a first area ratio, which is the ratio of an area of a white portion in the binarized target image, and compares the first area ratio with a predetermined first threshold value; an adaptive binarization processing function for adaptively binarizing the target image; a second comparison function that calculates a second area ratio, which is the ratio of an area of a white portion in the target image that has been subjected to the adaptive binarization processing, and compares the second area ratio with a predetermined second threshold value; a determination function that determines that the water quality is normal when the first area ratio is equal to or less than the first threshold value or the second area ratio is equal to or less than the second threshold value, and that determines that the water quality is abnormal when the first area ratio exceeds the first threshold value and the second area ratio exceeds the second threshold value; A computer program that enables a computer to realize the above.
2. 2. The computer program of claim 1, The adaptive binarization processing function of the computer program has a function of performing the adaptive binarization processing on the target image when the first area ratio exceeds the first threshold.
3. 3. The computer program according to claim 1, wherein: A computer program that further causes the computer to realize an image processing function of performing at least one of brightness equalization and chromaticity standardization on a pre-processed image, which is an image of the wastewater, and generating the target image.
4. 4. The computer program of claim 3, The brightness uniformity is a first average value is calculated by averaging the brightness of each pixel value in the unprocessed image, and a difference between the first average value and a first reference value as a predetermined reference value of the brightness is corrected for all pixel values in the unprocessed image; The standardization of the chromaticity is a second average value is calculated by averaging chromaticity values indicating hue and saturation for each pixel value of the unprocessed image, and a difference between the second average value and a second reference value as a predetermined reference value for the chromaticity is corrected for all pixel values in the unprocessed image. Computer program.
Citation Information
Patent Citations
Device and method for detecting oil slicks
JP2021085730A
Water quality determination apparatus
JP2021140522A
Abnormality assessment system and abnormality assessment method
JP2022026110A
Oil film detection system and oil film detection method
JP2022107535A
An apparatus for extracting characters and the method thereof
KR1020150075728A