DIGITAL ASSESSMENT OF CHEMICAL DIP TESTS

20210325299 · 2021-10-21

    Inventors

    Cpc classification

    International classification

    Abstract

    A method of digital assessment of chemical dip tests is disclosed. A photograph of a dip tester including a colour change pad is taken with a mobile device, for example a mobile phone. The dip tester is photographed on or alongside a reference card, with both the dip tester and the reference card in the same frame. A processor on the mobile device analyses the photograph thus obtained to determine a value for a characteristic of water being tested. The characteristic may be for example, pH, concentration of iron, concentration of copper. The water may be central heating system water.

    Claims

    1. A method of testing central heating and/or cooling water comprising the steps of: providing at least one color-change dip tester for measuring a characteristic to be tested, the color-change dip tester having a color-change pad, and dipping the color-change dip tester in the central heating and/or cooling water; providing a color reference card, the color reference card having a range of reference colors on its surface, the reference colors on the color reference card corresponding to a range of possible colors of a dipped color tester; using a digital camera, taking a photograph of the dipped dip tester and the color reference card; by a processor, identifying an area of the digital photograph corresponding to an image of the color-change pad of the dip tester, and determining a color of that area of the photograph; by the processor, identifying areas in the digital photograph corresponding to an image of the reference colors on the color reference card, and determining colors associated with reference areas; determining the closest of the colors associated with reference areas to the color of the image of the color-change pad of the dip tester, and determining on that basis a value of the characteristic to be tested.

    2. The method of testing central heating and/or cooling of claim 1, wherein the characteristic to be tested is at least one of pH, concentration of iron, concentration of copper, concentration of aluminum, and concentration of a corrosion inhibitor.

    3. The method of testing central heating and/or cooling water of claim 1, wherein the color reference card includes indicia indicating a position in which the dip tester may be placed on or adjacent to the reference card, and in which the dip tester is located in the indicated position before the photograph is taken.

    4. The method of testing central heating and/or cooling water of claim 1, wherein the color reference card includes registration marks.

    5. The method of testing central heating and/or cooling water of claim 1, wherein identifying the area of the digital photograph corresponding to the color-change pad of the dip test and determining the color of that area comprises identifying a plurality of pixels corresponding to the color-change pad of the dip tester and determining the single most common color among those pixels.

    6. The method of testing central heating and/or cooling water of claim 1, wherein identifying areas of the digital photograph corresponding to reference areas and determining the color of the reference areas comprises identifying a plurality of pixels corresponding to each reference area, and determining the single most common color among each plurality of pixels.

    7. The method of testing central heating and/or cooling water of claim 1, further comprising determining a difference series based on the differences between the color of the area of the image corresponding with the color-change pad and the color of each of the reference areas.

    8. The method of testing central heating and/or cooling water—of claim 7, wherein a Kalman filter is applied to the difference series.

    9. The method of testing central heating and/or cooling water of claim 7, wherein a determination as to validity of the determined value of the characteristic is made based on a measure of the smoothness of the difference series.

    10. (canceled)

    11. The method of testing central heating and/or cooling of claim 1, wherein a pass or fail result is output based on a comparison of the determined value of the characteristic with a predetermined threshold value.

    12. The method of testing central heating and/or cooling water of claim 11, wherein the color gradient on the reference card includes portions of increased resolution in areas around the color corresponding to the predetermined threshold.

    13. The method of testing central heating and/or cooling of claim 1, wherein color-change pads are provided, and multiple corresponding reference gradients are provided on the reference card.

    14. The method of testing central heating and/or cooling water of claim 13, wherein a determination as to the validity of the determined value of a characteristic is made based on comparing the color of the color-change pad corresponding to that characteristic with a color reference gradient corresponding to a different characteristic.

    15. The method of testing central heating and/or cooling water of claim 1, wherein a mobile device including a camera, a display screen, and a processor is provided, the mobile device being adapted to stream images from the camera to the display screen, and superimpose a template pattern on the display screen to aid in positioning the camera relative to the reference card and dip tester.

    16. The method of testing central heating and/or cooling water of claim 15, wherein the mobile device is adapted to continuously process frames from the camera stream, at the same time as the camera stream is being displayed on the display screen, and to filter frames for suitability.

    17. The method of testing central heating and/or cooling water of claim 16, wherein the filter for suitability includes a test against a sharpness threshold.

    18. The method of testing central heating and/or cooling water of claim 16, wherein the color reference card includes registration marks and in which the filter for suitability includes a test as to whether registration marks can be detected in expected locations.

    19. The method of testing central heating and/or cooling of claim 16, wherein the mobile device is adapted to stop streaming the camera feed to the display when more than a predetermined number of acceptable frames have been captured.

    20. The method of testing central heating and/or cooling water of claim 15, wherein the mobile device is a mobile telephone or a tablet computer.

    21. (canceled)

    22. A non-transitory computer readable medium containing instructions which when executed on a processor of a mobile device, the mobile device including a camera, a display screen and a processor, cause the mobile device to carry out the steps of the method of claim 1 on a dipped color-change dip tester and associated color reference card.

    23-25. (canceled)

    Description

    DESCRIPTION OF THE DRAWINGS

    [0044] For a better understanding of the invention, and to show more clearly how it may be carried into effect, a preferred embodiment will now be described with reference to the accompanying drawings, in which:

    [0045] FIG. 1 shows a dip tester stick including six colour change pads, together with a colour reference card, used as part of the invention;

    [0046] FIG. 2 shows the dip tester stick and colour reference card of FIG. 1, with the dip tester stick positioned on the colour reference card according to reference indicia printed on the reference card;

    [0047] FIG. 3 and FIG. 4 show the use of a mobile device to take pictures of the dip tester stick and colour reference card of FIG. 2;

    [0048] FIG. 5 shows how a difference series may be obtained from areas of an image taken in FIG. 4; and

    [0049] FIG. 6 shows an example of a difference series plotted on a graph.

    DESCRIPTION OF AN EMBODIMENT

    [0050] Referring firstly to FIG. 1, a dip tester stick is indicated at 10, next to a colour reference card indicated at 12. The dip tester stick includes six colour change pads 14a, 14b, 14c, 14d, 14e, 14f. Colour change pad 14a is impregnated with a colour change reagent which indicates the presence of a molybdate inhibitor. Colour change pad 14b is impregnated with a colour change reagent which indicates the presence of copper. Colour change pad 14c is impregnated with a colour change reagent which indicates the presence of iron. Colour change pads 14d, 14e, 14f are impregnated with colour change reagents which indicate the pH of the sample.

    [0051] In other embodiments dip tester sticks may include five pads (for example, for testing molybdate, copper, iron, and two pads for pH), or four pads (for example, for testing molybdate, copper, iron, and one pad for pH).

    [0052] The dip tester stick has been dipped for a few seconds in a sample of central heating and/or cooling water, and therefore the colour change pads have changed colour according to the characteristics of the central heating and/or cooling water which was sampled.

    [0053] The colour reference card is printed with indicia 16 which show where the dip tester stick 10 is to be placed on the card, adjacent to colour reference gradients 18a, 18b, 18c, 18d, 18e, 18f.

    [0054] In various embodiments, the dip tester may be placed on the card, or adjacent to the card, as long as the photograph is taken with the reference card and the dip tester in the same frame.

    [0055] FIG. 2 shows the dip tester stick 10 placed on the reference card 12 in the location indicated by the indicia (16, FIG. 1). In this position, colour change pad 14a is adjacent colour reference gradient 18a, colour change pad 14b is adjacent colour reference gradient 18b, and so on.

    [0056] Referring now to FIG. 3, a mobile device is indicated at 100. The mobile device in this embodiment is a mobile telephone, but could be another suitable device such as a tablet computer. A suitable device has at least a camera, a display screen, and a processor. The mobile device 100 runs software which causes a template pattern 110 to be displayed on the display screen. The template pattern is the same shape as the reference card 12, i.e., in this embodiment, a rectangle with a certain ratio of the length of the long side to the length of the short side. The template pattern is displayed on the display screen overlaid on a direct video feed from the camera of the mobile device. The purpose of the template pattern is to assist the user in lining up the reference card in the camera's view, as closely as possible taking a photograph with minimal skew. In FIG. 3 there is some skew in the image on the mobile device, but the user can easily move the mobile device 100 to correct for this. FIG. 4 shows the mobile device 100 in more or less exactly an optimal position, with the image of the reference card 12 lined up exactly in the template pattern 110.

    [0057] While the image from the camera is being continually streamed to the display, and the user is trying to adjust the position of the camera as best he can to line up the image of the reference card 12 with the template pattern 110, still photographs are continuously being taken and processed. Typically, the video stream from a mobile phone camera may be about 30 frames per second or more. As many individual frames as possible may be processed, with frames being silently dropped when the processor is too busy. Processing a frame may include an initial filtering stage to determine the sharpness of the image. Frames which are too blurry may be rejected. The Laplacian algorithm may be used as a known test for sharpness.

    [0058] If a frame passes the sharpness test, the next stage is to check for the presence of expected registration marks. In this example, four registration marks 20 are provided, substantially at corners of the rectangular reference card 12. The registration marks are in the form of blue circles. The registration marks 20 are the only circular features on the reference card 12. In each image a process of identifying and filtering circles takes place. This typically comprises using an edge detection algorithm to identify and isolate features. For example, the Canny algorithm may be used. A Gaussian blur may first be applied to the image to reduce noise. Candidate circles can be identified firstly by removing straight lines. After straight lines are removed, remaining closed paths may be candidate circles. As a second stage/check, the area of each candidate feature can be measured (number of pixels inside the feature) and compared to a calculated area from a measured average radius of the candidate feature (by A=πr.sup.2). A candidate circle with a measured area of more than the calculated area is likely to be in reality, a square or another shape (bearing in mind that the edges may be pixelated and rough, this may not be obvious to the initial algorithm which finds candidate circle features). Therefore a candidate circle with a measured area more than the calculated area will be rejected and dropped from the set of candidate circles.

    [0059] If a frame contains four detected registration marks, then the relative position of those registration marks is checked against predetermined constraints. On the original reference card 12, the registration marks 20 are at corners of a rectangle. The user interface as described above is designed to help the user to minimise skew, but in practice some small amount of skew is likely to be present in most processed images. The registration marks in the processed image will therefore usually not quite form a rectangle, but a trapezium (US: trapezoid). As long as the interior angles of the trapezium are close enough to right angles, within some predetermined tolerance, for example between 85 and 95 degrees, the image may be determined to be good enough for further processing. Whatever small skew is present in an acceptable image can be corrected in software using known techniques, based on the detected registration marks 20.

    [0060] Referring now to FIG. 5, once an image has been selected as suitable and deskewed, different areas of the image can be identified with reference to known relative positions of the different components on the reference card (12). FIG. 5 shows an area of such an image, and black outlines show particular areas which are subject to individual processing. Firstly the (roughly square in this embodiment) area of the image corresponding to one of the colour change pads is identified. The relevant feature can be identified using an edge detection algorithm, and finding a feature in the right place on the image, using the identified registration marks (20) as reference points. A sub-area, entirely within the boundary of this identified feature, may be used for further processing. Excluding the edges of the identified feature leads to a patch with a more consistent colour throughout by removing boundary effects. Within the identified sub-area, which is marked in FIG. 5 by the black square outline, a dominant colour is identified. The dominant colour is the single most common colour of a pixel within the outline. In other words, it is the mode average pixel colour within that area of the image.

    [0061] Dominant colours in strips of the colour reference gradients 18 are also identified in the same way. The position of the relevant colour reference strip 18 on the image is identified, and multiple sub-areas within the colour reference strip 18 are processed to find the dominant colour of each (the dominant colour again being the most common colour of pixel within the area). In this embodiment, the colour gradient changes continuously along the dimension running horizontally across FIG. 5. Along the other dimension, i.e. along the height of the reference strip, the colour is continuous. Therefore, by identifying sub-areas in the form of thin slices of the image of the colour reference strip 18, in principle every pixel in a given slice should be very similar or the same, with variations being due to artefacts from the process of taking a picture, the lighting involved, noise from the camera sensor, etc. These slices of the image of the reference strip are shown, to aid understanding, in FIG. 5. They are the three rectangular slices shown in black outline. It should be understood that the width of these slices is over-exaggerated in FIG. 5—typically in embodiments the slices may be only a single pixel wide. Also, in a real embodiment, the slices will usually be either abutting or very close to each other, with many hundreds of slices along the image of the reference gradient.

    [0062] Once the dominant colour of the image of the coloured pad is identified, as well as the dominant colour of each of the strips of the image of the reference gradient, for each strip of the reference gradient a difference may be calculated between the dominant colour of that strip and the dominant colour of the colour-change pad. This leads to a difference series d.sub.0 . . . d.sub.i. FIG. 6 shows an example of a resulting series graphically, with the value of d on the vertical axis and the position of the relevant strip along the reference gradient on the horizontal axis. It is clear in FIG. 6 that there is a global minimum distance at 22. This is the position on the reference gradient which is closest to the colour of the colour change pad. From the position on the reference gradient which most closely matches the colour of the dip test, a characteristic of the heating and/or cooling water being sampled can be derived, for example, the concentration of iron in the sample.

    [0063] The difference metrics may be calculated by the LAB colour space difference system.

    [0064] In FIG. 6, there is a fairly clear global minimum 22. However, there are also local minima 24a, 24b in the difference series. A check may be made for validity of the result based on: [0065] the number of local minima; [0066] the difference between the global minimum and the second least local minimum (the second least local minimum is 24a in the FIG. 6 example); [0067] a measure of the smoothness of the difference series; [0068] the difference value of the global minimum found, which should not be too high.

    [0069] If there are too many local minima, there is no sufficiently clear global minimum (i.e. the second least local minimum is only a slightly greater difference value than the global minimum), or if the curve has a low smoothness measure, the result may be determined to be invalid. This may lead to a repeat of the process of capturing photographs, or an indication to the user that the dip test itself needs to be repeated with a new dip tester, or an indication that a sample needs to be sent away for a lab test.

    [0070] A Kalman filter may be applied to the difference series before the global minimum is determined and the various checks for validity are made.

    [0071] Typically, the initial process of capturing and screening frames may be repeated until several acceptable frames are obtained. A measure of the characteristic (e.g. concentration of iron) is made on each captured frame. The final determination is preferably made by taking a mean of the values obtained from each frame, and then reporting the single value which is closest to the mean. If there is too much variance in the values obtained from the different frames, then the result may be determined to be invalid.

    [0072] FIG. 5 shows a single colour change pad and reference pattern, taken from an image of the card shown in FIG. 2 with six colour change pads 14a-f and six reference gradients 18a-f. The process of determining the difference series and thus the measured value of each characteristic is repeated for the other five pairs of reference gradients and colour-change pads. However, in some embodiments, comparisons may also be made between the colour of a colour-change pad, and reference gradients other than the reference gradient corresponding to the colour-change pad. As a further check, if a colour-change pad is closer in colour to any point in a non-corresponding reference gradient, then the result may be determined to be invalid. It is likely in this case that the characteristic being measured by the colour change pad is completely out of the range envisaged by the reference gradient. For example, an extremely high concentration of iron might lead to a dark brown colour-change pad, closer in colour to one of the reference gradients corresponding to the pH colour-change pads.

    [0073] The invention described can be used to very easily and accurately test central heating and/or cooling water for a range of characteristics. By using an ordinary mobile telephone running appropriate software, an accurate determination of values of various characteristics can be made. The accuracy achieved is comparable with, or better than, experienced human assessment of chemical dip tests. Moreover, various checks are in place to determine when the result obtained can be relied on and when it cannot. In the worst case therefore, the method of the invention will reach the conclusion that it cannot determine the relevant characteristics of the sample, in contrast with some prior art colour matching systems which often return an incorrect result.