Method for identifying the readings on the LCD screen of a water meter without backlight under poor lighting conditions
By enhancing and scaling the image of the non-backlit water meter LCD screen, combined with contrast calculation and neural network recognition, the problem of low recognition accuracy under poor lighting conditions is solved and higher recognition accuracy and robustness are achieved.
Patent Information
- Application Number
- CN202211266566.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-17
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2042-10-17
AI Technical Summary
The existing technology cannot accurately identify the indication on the LCD screen of a water meter without backlight under poor lighting conditions, and is limited by problems such as small instruction text and insufficient image resolution.
A method is adopted, including acquiring the LCD screen image, performing image enhancement and scaling, calculating the contrast between the instruction text area and the contrast area, and using a pre-trained neural network model to perform digital recognition to improve recognition accuracy.
It significantly enhances the robustness of the recognition algorithm and improves the recognition accuracy of the water meter LCD screen display. Especially under poor lighting conditions, the effect is better than the traditional method.
Smart Images

Figure CN115546799B
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image processing, and in particular to a method for identifying the indication of a liquid crystal screen of a water meter without backlight under poor lighting conditions. Background Art
[0002] The statements in this section merely provide background art related to the present invention and do not necessarily constitute prior art.
[0003] Currently, there are a large number of water meters with LCD displays on the market, but there are two difficulties with LCD displays: first, the LCD screens on water meters generally have no backlight; second, the LCD screens on water meters are status-based and periodically display different content, which interferes with recognition.
[0004] The inventors have found that due to problems such as poor lighting conditions, small indicator text, and insufficient image resolution, it is often impossible to accurately identify the water meter status and water meter characters using conventional image recognition or text recognition methods. Summary of the invention
[0005] In order to solve the deficiencies of the prior art, the present invention provides a method for identifying the indication of a water meter LCD screen without backlight under poor lighting conditions, which greatly enhances the robustness of the recognition algorithm and improves the recognition accuracy of the water meter LCD screen indication.
[0006] In order to achieve the above object, the present invention adopts the following technical solution:
[0007] A first aspect of the present invention provides a method for identifying the indication of a liquid crystal display of a water meter without backlight under poor lighting conditions.
[0008] A method for identifying the indication of a water meter LCD screen without backlight under poor lighting conditions includes the following steps:
[0009] Get the image of the LCD screen;
[0010] Performing image enhancement on the acquired LCD screen image;
[0011] Scale the enhanced image to a fixed size;
[0012] Compare the area where the indicated text is located with the area of the same size below to obtain a reference contrast ratio;
[0013] The position of the display state to be identified on the LCD screen is taken as the region of interest, and the contrast between it and the contrast area is calculated;
[0014] If the ratio of the calculated contrast to the reference contrast is greater than a set threshold, the image is an image in a display state to be identified; otherwise, the image is not an image in a display state to be identified;
[0015] If the image is a display state image to be identified, a pre-trained neural network model is used to obtain a LCD screen digital recognition result.
[0016] As an optional implementation, acquiring an image of a liquid crystal screen includes:
[0017] For the water meter image, the YoloV5 model is used to locate the LCD screen, and the positioning result of the LCD screen is intercepted to obtain the LCD screen image.
[0018] As an optional implementation, the acquired LCD screen image is enhanced, including:
[0019] Sort all pixels in the image from small to large, then remove the largest 10% of the data in the sorted array, get the maximum value m in the sorted array, and perform pixel mapping according to the following formula:
[0020]
[0021] in, is the pixel value of the target image at row x and column y, p(x,y) is the pixel value of the original image at row x and column y, and min is the minimum function.
[0022] As an optional implementation, the display state to be identified is the remaining amount or the accumulated flow.
[0023] As an optional implementation method, the line where the indicating text is located is compared with the adjacent rectangular area r2 of the same size below with a rectangular area r1 of fixed width, and the sliding window method is used to slide to the right to obtain multiple contrast values. All contrast values are sorted, and the median of the sorted values is used as the reference contrast d.
[0024] As a further limitation, assume that the region where the character string to be identified is located is (x s ,y s , w s ,h s ), where x s y is the upper left corner horizontal coordinate of the string to be identified. s The upper left corner ordinate of the string to be identified and displayed, w s is the width of the string to be identified. s The height of the string to be identified.
[0025] Calculate the area where the string to be identified is located and the area (x s ,y s +h s , w s ,h s), if r / d is greater than a set threshold, the image is an image in a display state to be identified; otherwise, the image is not an image in a display state to be identified.
[0026] As a further limitation, the region r1(x s ,y s , w s ,h s ) and the region r2(x s ,y s +h s , w s ,h s ) of the contrast r, including:
[0027]
[0028] Among them, r1 and r2 are two areas to be compared, p is a pixel, and ε is a set value.
[0029] A second aspect of the present invention provides a system for identifying the indication of a water meter LCD screen without backlight under poor lighting conditions.
[0030] A water meter LCD display reading recognition system without backlight under poor lighting conditions, comprising:
[0031] The image acquisition module is configured to: acquire an image of the LCD screen;
[0032] The image enhancement module is configured to: perform image enhancement on the acquired LCD screen image;
[0033] The image scaling module is configured to: scale the enhanced image to a fixed size;
[0034] The reference contrast acquisition module is configured to: compare the area where the indication text is located with the area of the same size below to obtain a reference contrast;
[0035] The contrast calculation module is configured to: take the display state to be identified at the position of the liquid crystal screen as the region of interest, and calculate the contrast between the region of interest and the contrast area;
[0036] The state judgment module is configured to: if the ratio of the calculated contrast to the reference contrast is greater than a set threshold, the image is an image in a display state to be identified; otherwise, the image is not an image in a display state to be identified;
[0037] The digital recognition module is configured as follows: if the image is a display state image to be recognized, a pre-trained neural network model is used to obtain a liquid crystal screen digital recognition result.
[0038] The third aspect of the present invention provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the steps of the method for identifying the indication of a water meter LCD screen without backlight under poor lighting conditions as described in the first aspect of the present invention.
[0039] The fourth aspect of the present invention provides an electronic device, including a memory, a processor, and a program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in the method for identifying the indication of a water meter LCD screen without backlight under poor lighting conditions as described in the first aspect of the present invention are implemented.
[0040] Compared with the prior art, the present invention has the following beneficial effects:
[0041] 1. The method for identifying the indication of a water meter LCD screen without backlight under poor lighting conditions described in the present invention greatly enhances the robustness of the recognition algorithm and improves the recognition accuracy of the indication of the water meter LCD screen.
[0042] 2. The method for identifying the indication of a water meter LCD screen without backlight under poor lighting conditions described in the present invention innovatively proposes an image enhancement method and adopts a specific mapping method to achieve better image enhancement under poor lighting conditions, and the effect is better than the histogram equalization enhancement method.
[0043] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0045] Figure 1 This is a schematic diagram of a method for identifying the readings on a liquid crystal display of a water meter without backlight under poor lighting conditions provided in Example 1 of the present invention.
[0046] Figure 2 This is a schematic diagram of the image enhancement principle provided in Example 1 of the present invention.
[0047] Figure 3 This is a schematic diagram of an original liquid crystal screen provided in Example 1 of the present invention.
[0048] Figure 4 This is the liquid crystal screen after histogram equalization provided by Embodiment 1 of the present invention.
[0049] Figure 5 The liquid crystal screen provided by Example 1 of the present invention after using the enhancement method of the present invention.
[0050] Figure 6 A schematic flow chart of a method for identifying a liquid crystal screen state provided in Embodiment 1 of the present invention.
[0051] Figure 7 A schematic diagram of a single digital capture provided in Example 1 of the present invention.
[0052] Figure 8 A single digital image (left) and a binarized image (right) provided in Example 1 of the present invention.
[0053] Fig. 9 Schematic diagram of a deep convolutional neural network for liquid crystal digit recognition provided in Example 1 of the present invention. DETAILED DESCRIPTION
[0054] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0055] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0056] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0057] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.
[0058] Embodiment 1:
[0059] like Figure 1 As shown, Embodiment 1 of the present invention provides a flow chart of a method for identifying the indication of a water meter LCD screen without backlight under poor lighting conditions. This embodiment takes "remaining amount" as an example of the display state to be identified, and includes the following processes:
[0060] First, the LCD screen in the water meter is located and the image is captured. Then, the captured image is enhanced, and then the LCD screen status is identified. When the status is "remaining amount", the LCD screen indication is identified. Specifically, for the image obtained by the camera device, the precise position of the LCD screen is found and a sub-image is captured. The YoloV5 algorithm model is used to locate the LCD screen.
[0061] S1: LCD screen image enhancement
[0062] like Figure 2 As shown, all pixels in the LCD screen image are sorted from small to large, and then 10% of the data on the right side of the sorted array is removed to avoid the influence of outliers or noise points on the algorithm. Then, the last element of the sorted array, i.e., its maximum value m, is obtained and mapped using formula (1):
[0063]
[0064] in, is the pixel value of the target image at row x and column y, p(x,y) is the pixel value of the original image at row x and column y, m is the maximum value obtained in the previous step, and min is the minimum function.
[0065] The above enhancement method is implemented in this way, and the effect is better than histogram equalization in an environment with poor lighting conditions. Figure 3 For the original LCD screen, you can see that the content is difficult to recognize. Figure 4 This is the enhanced image obtained by histogram equalization. It can be seen that due to the uneven illumination of various parts of the LCD screen, the contrast of the enhanced image is too large, and many stains caused by uneven illumination are enhanced, affecting the display of normal content. Figure 5 The enhanced image obtained by the algorithm in this embodiment is shown. It can be seen that the whole image is displayed evenly and has better adaptability to low light intensity and uneven light.
[0066] S2: LCD screen status identification
[0067] like Figure 6 As shown, the states of the LCD screen include the remaining amount, accumulated flow and other states. These states are distinguished by the indication text on the upper part of the LCD screen. The target to be identified in this embodiment is the remaining amount. The enhanced LCD image is identified according to the following method:
[0068] First, the image is scaled to a fixed size. Due to the production process of the LCD screen, the display position of the remaining quantity string and the positions of other indicator strings in the image are fixed values. The row where the indicator text is located is compared with the adjacent rectangular area r2 of the same size below with a rectangular area r1 of fixed width, and the sliding window method is used to slide to the right to obtain a set of contrast values.
[0069] The contrast ratio is calculated as:
[0070]
[0071] Among them, r1 and r2 are two regions to be compared, p is a pixel, and ε is 10 -5 , the formula calculates the sum of pixels in the two regions respectively, and calculates the ratio of their maximum value to minimum value.
[0072] Specifically, the following algorithm is used to obtain multiple expected contrasts according to the sliding window, and these contrasts are sorted, and the median thereof is used as the reference contrast d.
[0073]
[0074]
[0075] Let the region where the remaining string is located be r1(x s ,y s , w s ,h s ), because the image size is scaled to a fixed size, for the same type of LCD screen, this area is known and is a fixed value. Use formula (2) to calculate the area and area r2(x s ,y s +h s , w s ,h s ) is denoted as r.
[0076] Calculate the relationship between r / d and the fixed threshold Θ. If it is greater than, it is considered that the image currently displayed on the LCD screen is the remaining amount, otherwise it is considered not.
[0077] S3: LCD screen digital recognition
[0078] According to the LCD screen status recognition method of S2, it is determined whether the current image is the remaining quantity. If so, the LCD screen digital recognition is performed. Because the LCD screen image is scaled to a fixed size, the position of the digital display is fixed. A single number can be extracted using the area of the digital measured in advance, so only a single number needs to be recognized, and the recognition results can be combined to obtain the final recognition result.
[0079] like Figure 7 As shown, it is a schematic diagram of a single digital interception. Figure 8 A single digital image (left) and its binarized image (right). Fig. 9As shown in the figure, a three-layer convolutional deep neural network is used to recognize the binarized image, and the single digital image after binarization is scaled to 32*32; the network input is a single color channel image of 1*32*32, which passes through 32 convolution kernels of 5*5 with a step size of 1, and then a maximum pooling operation of 2*2 with a step size of 1 is performed to obtain a 12*12 image of 32 channels, and then convolution is performed using 64 convolution kernels of 5*5 with a step size of 1, and then a maximum pooling operation is performed. The obtained image is flattened and mapped to a vector of dimension 500 using a fully connected layer, and then a ReLU activation function is used, and then a fully connected layer with a SoftMax activation function is used to finally obtain a 10-dimensional classification result, that is, a vector of length 10, and its maximum value is calculated, and the subscript of the maximum value is taken as the recognition result.
[0080] In an LCD screen, there are generally multiple digital digits. Each digit is fixed in position in the LCD screen, and the above method can be used to identify a single digit. Assume that the lowest digit recognition result is n0 (the rightmost digit), and the other digits are n1, n2,...n... m , then the final reading n obtained by LCD screen recognition can be expressed as:
[0081]
[0082] Embodiment 2:
[0083] Embodiment 2 of the present invention provides a system for identifying the readings of a water meter LCD screen without backlight under poor lighting conditions, comprising:
[0084] The image acquisition module is configured to: acquire an image of the LCD screen;
[0085] The image enhancement module is configured to: perform image enhancement on the acquired LCD screen image;
[0086] The image scaling module is configured to: scale the enhanced image to a fixed size;
[0087] The reference contrast acquisition module is configured to: compare the area where the indication text is located with the area of the same size below to obtain a reference contrast;
[0088] The contrast calculation module is configured to: take the display state to be identified at the position of the liquid crystal screen as the region of interest, and calculate the contrast between the region of interest and the contrast area;
[0089] The state judgment module is configured to: if the ratio of the calculated contrast to the reference contrast is greater than a set threshold, the image is an image in a display state to be identified; otherwise, the image is not an image in a display state to be identified;
[0090] The digital recognition module is configured as follows: if the image is a display state image to be recognized, a pre-trained neural network model is used to obtain a liquid crystal screen digital recognition result.
[0091] The working method of the system is the same as the method for identifying the indication of a water meter LCD screen without backlight under poor lighting conditions provided in Example 1, and will not be described in detail here.
[0092] Embodiment 3:
[0093] Embodiment 3 of the present invention provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the steps of the method for identifying the indication of a water meter LCD screen without backlight under poor lighting conditions as described in Embodiment 1 of the present invention.
[0094] Embodiment 4:
[0095] Embodiment 4 of the present invention provides an electronic device, including a memory, a processor, and a program stored in the memory and executable on the processor. When the processor executes the program, the steps of the method for identifying the indication of a water meter LCD screen without backlight under poor lighting conditions as described in Embodiment 1 of the present invention are implemented.
[0096] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.
[0097] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0098] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0099] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0100] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0101] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for identifying the readings on a water meter LCD screen without backlight under poor lighting conditions, characterized in that: The process includes: Get the image of the LCD screen; Performing image enhancement on the acquired LCD screen image; Scale the enhanced image to a fixed size; Compare the area where the indicated text is located with the area of the same size below to obtain the reference contrast, which is: The row where the indicating text is located is compared with the adjacent rectangular area r2 of the same size below using a fixed width rectangular area r1, and the sliding window method is used to slide to the right to obtain multiple contrast values. All contrast values are sorted, and the median after sorting is used as the reference contrast d; The position of the display state to be identified on the LCD screen is taken as the region of interest, and the contrast between it and the contrast area is calculated, specifically: The display status to be identified is the remaining amount or the accumulated flow; Assume that the area where the string to be identified is located is (x s ,y s , w s ,h s ), where x s y is the upper left corner horizontal coordinate of the string to be identified. s The upper left corner ordinate of the string to be identified and displayed, w s is the width of the string to be identified. s The height of the string to be identified. Calculate the area where the string to be identified is located and the area (x s ,y s +h s , w s ,h s ), if r / d is greater than the set threshold, the image is an image in a display state to be identified; otherwise, the image is not an image in a display state to be identified; If the ratio of the calculated contrast to the reference contrast is greater than a set threshold, the image is an image in a display state to be identified; otherwise, the image is not an image in a display state to be identified; If the image is a display state image to be identified, a pre-trained neural network model is used to obtain a LCD screen digital recognition result.
2. The method for identifying the readings of a water meter LCD screen without backlight under poor lighting conditions as claimed in claim 1, characterized in that: Get an image of the LCD screen, including: For the water meter image, the YoloV5 model is used to locate the LCD screen, and the positioning result of the LCD screen is intercepted to obtain the LCD screen image.
3. The method for identifying the readings of a water meter LCD screen without backlight under poor lighting conditions as claimed in claim 1, characterized in that: Perform image enhancement on the acquired LCD screen image, including: Sort all pixels in the image from small to large, then remove the largest 10% of the data in the sorted array, get the maximum value m in the sorted array, and perform pixel mapping according to the following formula: in, is the pixel value of the target image at row x and column y, is the pixel value of the original image at row x and column y, To find the minimum function.
4. The method for identifying the readings of a water meter LCD screen without backlight under poor lighting conditions as claimed in claim 1, characterized in that: Calculate the region r1 (x s ,y s , w s ,h s ) and area r2(x s ,y s +h s , w s ,h s ) of the contrast r, including: Among them, r1 and r2 are two areas to be compared, p is a pixel, is the set value.
5. A water meter LCD display reading recognition system without backlight under poor lighting conditions, characterized by: include: The image acquisition module is configured to: acquire an image of the LCD screen; The image enhancement module is configured to: perform image enhancement on the acquired LCD screen image; The image scaling module is configured to: scale the enhanced image to a fixed size; The reference contrast acquisition module is configured to: compare the area where the indication text is located with the area of the same size below to obtain a reference contrast, specifically: The row where the indicating text is located is compared with the adjacent rectangular area r2 of the same size below using a fixed width rectangular area r1, and the sliding window method is used to slide to the right to obtain multiple contrast values. All contrast values are sorted, and the median after sorting is used as the reference contrast d; The contrast calculation module is configured to: take the display state to be identified at the position of the LCD screen as the region of interest, and calculate the contrast between it and the contrast area, specifically: The display status to be identified is the remaining amount or the accumulated flow; Assume that the area where the string to be identified is located is (x s ,y s , w s ,h s ), where x s y is the upper left corner horizontal coordinate of the string to be identified. s The upper left corner ordinate of the string to be identified and displayed, w s is the width of the string to be identified. s The height of the string to be identified. Calculate the area where the string to be identified is located and the area (x s ,y s +h s , w s ,h s ), if r / d is greater than the set threshold, the image is an image in a display state to be identified; otherwise, the image is not an image in a display state to be identified; The state judgment module is configured to: if the ratio of the calculated contrast to the reference contrast is greater than a set threshold, the image is an image in a display state to be identified; otherwise, the image is not an image in a display state to be identified; The digital recognition module is configured as follows: if the image is a display state image to be recognized, a pre-trained neural network model is used to obtain a liquid crystal screen digital recognition result.
6. A computer-readable storage medium having a program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method for identifying the indication of a water meter LCD screen without backlight under poor lighting conditions as described in any one of claims 1 to 4 are implemented.
7. An electronic device comprising a memory, a processor, and a program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method for identifying the indication of a water meter LCD screen without backlight under poor lighting conditions as described in any one of claims 1 to 4 are implemented.
