Pointer instrument reading identification method, system, equipment and computer storage medium
1. A method of identifying a pointer meter reading, the method comprising:
acquiring a pointer instrument image, wherein the pointer instrument image comprises image deflection data;
carrying out image correction processing on the pointer instrument image according to the image deflection data to obtain a target image;
inputting the target image into a deep neural network model to obtain a target characteristic image;
and calculating the reading of the pointer instrument according to the target characteristic image.
2. The method of claim 1, wherein the step of performing image correction processing on the pointer instrument image according to the image deflection data to obtain a target image comprises:
carrying out perspective transformation processing on the pointer instrument image to obtain a front-view shot image;
and carrying out image preprocessing on the front-view shot image to obtain a target image.
3. The method for recognizing a reading of a pointer instrument as claimed in claim 2, wherein the step of subjecting the image of the pointer instrument to perspective transformation to obtain an orthographic view image comprises:
determining parameters of a matrix perspective transformation equation according to the image deflection data to obtain a matrix perspective transformation equation;
and processing the pointer instrument image according to the matrix perspective transformation equation to obtain an orthographic shot image.
4. The method for identifying a reading of a pointer meter as recited in claim 2, wherein the step of performing image preprocessing on the orthographic captured image to obtain a target image comprises:
carrying out graying processing on the front-view shot image to obtain a shot image with grayed out;
performing median filtering processing on the shot image subjected to the gray level removal to obtain a filtered shot image;
and smoothing the filtered shot image to obtain a target image.
5. The method of claim 1, wherein the step of obtaining a pointer meter image, the pointer meter image including image deflection data, comprises:
and carrying out image rectangular feature analysis processing on the pointer instrument image to obtain image deflection data.
6. The method of claim 1, wherein the target feature image includes feature location information, confidence level, and feature strength, and the step of calculating the pointer meter reading from the target feature image includes:
determining the instrument scale, the position pointed by the pointer and the pointer axis of the pointer instrument by using the characteristic position information, the confidence coefficient and the characteristic strength;
acquiring a first connecting line between zero scale in the instrument scale and the pointer shaft and a second connecting line between the position pointed by the pointer and the pointer shaft, and determining an included angle between the first connecting line and the second connecting line;
and calculating to obtain the reading of the pointer instrument by utilizing the ratio of the included angle to a preset included angle, wherein the preset included angle is the included angle between zero scale and the maximum scale in the instrument scale.
7. The method of claim 6, wherein the deep neural network model comprises a first sub-network model and a second sub-network model, and the step of inputting the target image into the deep neural network model to obtain the target feature image comprises:
inputting the target image into the first sub-network model to obtain a multi-dimensional sub-feature image;
and inputting the multi-dimensional sub-feature image into the second sub-network model to obtain a target feature image, wherein the target feature image comprises the feature position information, the confidence coefficient and the feature strength.
8. An identification system for pointer meter readings, the identification system comprising:
the device comprises an acquisition unit, a display unit and a control unit, wherein the acquisition unit is used for acquiring a pointer instrument image which comprises image deflection data;
the image correction unit is used for carrying out image correction processing on the pointer instrument image according to the image deflection data to obtain a target image;
the feature extraction unit is used for inputting the target image into a deep neural network model to obtain a target feature image;
and the calculating unit is used for calculating the reading of the pointer instrument according to the target characteristic image.
9. A terminal device, comprising a memory and a processor coupled to the memory;
wherein the memory is for storing program data and the processor is for executing the program data to implement the method of identifying a pointer meter reading according to any one of claims 1 to 7.
10. A computer storage medium for storing program data which, when executed by a processor, is adapted to implement a method of identifying a pointer meter reading according to any one of claims 1 to 7.
Background
Current machine vision techniques aimed at character class recognition are well established. For example, the digital instrument reading is identified and processed by using a deep neural network model. However, due to the self-attribute of the reading of the pointer instrument, the requirement on the environment for shooting the image is high, and if the deep neural network model is directly used for identifying and processing the image of the pointer instrument, the reading of the instrument is inaccurate.
Disclosure of Invention
The application provides a method, a system and equipment for identifying the reading of a pointer instrument and a computer storage medium, which aim to solve the problem that the reading of the pointer instrument is inaccurate in the prior art.
In order to solve the technical problem, the present application provides a method for identifying a reading of a pointer instrument, the method including:
acquiring a pointer instrument image, wherein the pointer instrument image comprises image deflection data;
carrying out image correction processing on the pointer instrument image according to the image deflection data to obtain a target image;
inputting the target image into a deep neural network model to obtain a target characteristic image;
and calculating the reading of the pointer instrument according to the target characteristic image.
In order to solve the above technical problem, the present application provides an identification system for reading of a pointer instrument, the identification system including:
the device comprises an acquisition unit, a display unit and a control unit, wherein the acquisition unit is used for acquiring a pointer instrument image which comprises image deflection data;
the image correction unit is used for carrying out image correction processing on the pointer instrument image according to the image deflection data to obtain a target image;
the feature extraction unit is used for inputting the target image into a deep neural network model to obtain a target feature image;
and the calculating unit is used for calculating the reading of the pointer instrument according to the target characteristic image.
To solve the above technical problem, the present application provides a terminal device, which includes a memory and a processor coupled to the memory;
the memory is used for storing program data and the processor is used for executing the program data to realize the identification method of the reading of the pointer instrument.
In order to solve the above technical problem, the present application further provides a computer storage medium for storing program data, which when executed by a processor, is used to implement the identification method of reading of a pointer instrument as described above.
According to the pointer instrument reading identification method, the image deflection data of the shot image is utilized to correct the pointer instrument image to obtain the target image, the target image is input into the deep neural network model to obtain the target characteristic image, and then the pointer instrument reading is obtained based on the target characteristic image calculation, so that the pointer instrument reading accuracy is improved, and the problem that the pointer instrument reading accuracy is low due to poor pointer instrument image quality is solved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts. Wherein:
FIG. 1 is a schematic flow chart diagram illustrating an embodiment of a method for identifying a reading of a pointer meter provided herein;
FIG. 2 is a schematic flow chart diagram of an embodiment of S102 in the method for identifying a reading of a pointer meter shown in FIG. 1;
FIG. 3 is a schematic flow chart diagram of an embodiment of S201 in the method for identifying a reading of a pointer meter shown in FIG. 2;
FIG. 4 is a schematic flow chart diagram of an embodiment of S202 in the method for identifying a pointer meter reading shown in FIG. 2;
FIG. 5 is a schematic flow chart diagram of an embodiment of S104 in the method for identifying a pointer meter reading shown in FIG. 1;
FIG. 6 is a schematic diagram of an embodiment of an identification system provided herein;
fig. 7 is a schematic structural diagram of an embodiment of a terminal device provided in the present application;
FIG. 8 is a schematic structural diagram of an embodiment of a computer storage medium provided in the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The present application provides a method for recognizing a reading of a pointer instrument, and particularly please refer to fig. 1, where fig. 1 is a schematic flowchart of an embodiment of the method for recognizing a reading of a pointer instrument provided in the present application. The identification method of the pointer meter reading in the embodiment can be applied to an identification device, and the identification device of the present application can be a server, a mobile device, or a system in which the server and the mobile device are matched with each other. Accordingly, each part, such as each unit, sub-unit, module, and sub-module, included in the mobile device may be all disposed in the server, may also be all disposed in the mobile device, and may also be disposed in the server and the mobile device, respectively.
Further, the server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster formed by multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as a plurality of software or software modules, for example, software or software modules for providing distributed servers, or as a single software or software module, and is not limited herein.
The method for identifying the reading of the pointer instrument in the embodiment specifically comprises the following steps:
s101: a pointer instrument image is acquired, the pointer instrument image including image deflection data.
In the embodiment of the disclosure, in consideration of the significant influence of the image quality of the pointer instrument on the reading identification of the pointer instrument, the problem that the quality of the obtained image of the pointer instrument is poor due to the problems of ambient light of the pointer instrument or the angle of shooting the image of the pointer instrument is solved, and therefore the reading accuracy of the pointer instrument identified by using the image of the pointer instrument is low. For this reason, the identification device of the embodiment should acquire a pointer instrument image with high quality to identify and obtain a pointer instrument reading with high accuracy based on the pointer instrument image with high quality. It should be noted that the pointer instrument image with high quality is an orthographic shot image and the ambient light of the pointer instrument does not change much.
Specifically, in order to improve the acquisition efficiency of a high-quality pointer instrument image, the recognition device may acquire the pointer instrument image and obtain the image deflection data of the pointer instrument image by processing the pointer instrument image. Specifically, the recognition device can process the pointer instrument image by using an image rectangular characteristic analysis technology to obtain image deflection data. The image deflection data is the deflection difference between the actual captured image and the desired pointer instrument image.
It should be noted that the recognition means may calculate the image deflection data using the feature similarity between the pointer instrument image and the preset pointer instrument image. Image deflection data of the pointer instrument image may also be acquired using a gyroscope mounted in the identification device.
The identification device of the embodiment can shoot the pointer instrument image through the camera arranged in the direction of the positive visual angle of the pointer instrument. And the pointer instrument image can also be obtained through a mobile terminal carried by a meter reading worker. The method for acquiring the pointer instrument image by the camera arranged in the front-view direction of the pointer instrument is adopted, and the time interval can be preset to acquire the pointer instrument image. The method for acquiring the pointer instrument image by the mobile terminal carried by the meter reading staff is adopted, and the pointer instrument image can be acquired when the meter reading staff arrives at the position of the pointer instrument every time.
In a specific embodiment, when the mobile terminal carried by the meter reading staff is used for acquiring the pointer instrument image, the identification device can acquire the image deflection data of the pointer instrument image by using a gyroscope in the mobile terminal.
S102: and carrying out image correction processing on the pointer instrument image according to the image deflection data to obtain a target image.
In order to obtain a high-quality pointer instrument image and further improve the accuracy of the reading of the pointer instrument. The recognition means may correct the pointer instrument image. Specifically, the recognition device performs image correction processing on the pointer instrument image according to the image deflection data to obtain a target image. The target image is a front-view shot image and the ambient light of the pointer instrument does not change much. I.e. a pointer instrument image of higher quality.
S103: and inputting the target image into the deep neural network model to obtain a target characteristic image.
In order to identify and obtain the pointer instrument reading in the target image, the identification device of the embodiment inputs the high-quality pointer instrument image into the deep neural network model. Specifically, the recognition device inputs the target image into the deep neural network model to obtain a target characteristic image.
Wherein, the deep neural network model is a trained network model. In a specific embodiment, the recognition device can utilize a large number of training images and annotation images to train the deep neural network model to obtain a training characteristic image, calculate a loss function between the training characteristic image and a target characteristic image, and train the deep neural network model with the loss function becoming smaller as a target to obtain the deep neural network model meeting the requirements.
In a specific embodiment, the recognition device may input the target image into the first sub-network model, resulting in a multi-dimensional sub-feature image. And inputting the multi-dimensional sub-feature image into a second sub-network model to obtain a target feature image.
Further, the target feature image includes feature location information, confidence, and feature strength. The characteristic position information may be characteristic information of a position where the pointer is located in the target image, or may be characteristic information of a position where the scale is located. Therefore, the characteristic position information needs to be set according to actual requirements. This embodiment is not limited to this.
S104: and calculating the reading of the pointer instrument according to the target characteristic image.
Based on the target feature image acquired in S103, the recognition apparatus determines the meter scale of the pointer meter, the position pointed by the pointer, the pointer axis, and the like, using the feature position information, the confidence, and the feature intensity in the target feature image, and calculates the pointer meter reading using the meter scale of the pointer meter, the position pointed by the pointer, and the pointer axis.
In the scheme, the identification device corrects the pointer instrument image by using the image deflection data of the shot image to obtain the target image, inputs the target image into the deep neural network model to obtain the target characteristic image, and then obtains the pointer instrument reading based on the target characteristic image calculation, so that the accuracy of the pointer instrument reading is improved, and the low accuracy of the pointer instrument reading caused by poor image quality of the pointer instrument is avoided.
Continuing to refer to fig. 2, fig. 2 is a schematic flow chart of an embodiment of S102 in the method for identifying a reading of a pointer meter shown in fig. 1. On the basis of the above embodiment, S102 further includes the steps of:
s201: and carrying out perspective transformation processing on the pointer instrument image to obtain an orthographic shot image.
Optionally, this embodiment may adopt the embodiment in fig. 3 to implement S201, and specifically includes S301 to S302:
s301: and determining the parameters of the matrix perspective transformation equation according to the image deflection data to obtain the matrix perspective transformation equation.
In order to avoid low accuracy of pointer meter reading identification due to large deflection data between the shot pointer meter image and the preset image, the identification device of the embodiment determines the image conversion relation parameter between the pointer meter image and the target image by using the deflection data of the pointer meter image. Specifically, the identification device takes deflection data of the pointer instrument image as a matrix perspective transformation equation parameter to obtain a matrix perspective transformation equation. The preset image is an indicator image of an image shot when the ambient light is not greatly changed based on the front-view direction.
S302: and processing the pointer instrument image according to a matrix perspective transformation equation to obtain an orthographic shot image.
Based on the matrix perspective transformation equation acquired in S301, the recognition device obtains an orthographic view taken image corresponding to the pointer instrument image by calculation using the matrix perspective transformation equation.
S202: and carrying out image preprocessing on the front-view shot image to obtain a target image.
The shooting angle of the front-view shot image meets the requirement of the target image, but the quality problem of the target image caused by shooting ambient light or other reasons exists. Therefore, the recognition device carries out image preprocessing on the orthographic shot image to obtain a target image.
Optionally, in this embodiment, S202 may be implemented by using the embodiment in fig. 4, and specifically includes S401 to S403:
s401: and carrying out graying processing on the front-view shot image to obtain a shot image with grayed removed.
The recognition device performs graying processing on the front-view shot image to obtain a shot image subjected to graying removal.
S402: and carrying out median filtering processing on the shot image subjected to the gray level removal to obtain a filtered shot image.
Based on the captured image after the removal of the gray scale acquired in S401, the recognition device performs noise reduction processing on the captured image after the removal of the gray scale by filtering. Specifically, the recognition device performs median filtering processing on the captured image after the grayness is removed, and obtains a filtered captured image.
S403: and smoothing the filtered shot image to obtain a target image.
Based on the filtered photographed image acquired in S402, the recognition device performs smoothing processing on the filtered photographed image to obtain a target image.
In the scheme, the identification device obtains the matrix perspective transformation equation by using the image deflection data as the matrix perspective transformation equation parameters, obtains the front-view shot image corresponding to the pointer instrument image according to the matrix perspective transformation equation, and then performs image preprocessing on the front-view shot image to obtain the target image, so that the reading accuracy of the pointer instrument is improved, and the low reading accuracy of the pointer instrument caused by poor image quality of the pointer instrument is avoided.
Continuing to refer to fig. 5, fig. 5 is a flowchart illustrating an embodiment of S104 in the method for identifying a reading of a pointer meter shown in fig. 1. Specifically, S104 further includes the steps of:
s501: and determining the instrument scale, the position pointed by the pointer and the pointer shaft of the pointer instrument by utilizing the characteristic position information, the confidence coefficient and the characteristic strength.
The target feature image comprises feature position information, confidence coefficient and feature strength. The identification device calculates the scales of the pointer instrument, the pointed position of the pointer and the pointer shaft by utilizing the characteristic position information, the confidence coefficient and the characteristic strength.
S502: a first connecting line between zero scale and a pointer shaft in the instrument scale and a second connecting line between the position pointed by the pointer and the pointer shaft are obtained, and an included angle between the first connecting line and the second connecting line is determined.
Based on the acquired pointer and scale, the identification device acquires a first connecting line between the zero scale in the scale and the axis of the pointer and a second connecting line between the position pointed by the pointer and the axis of the pointer, and determines an included angle between the first connecting line and the second connecting line.
S503: and calculating to obtain the reading of the pointer instrument by using the ratio of the included angle to a preset included angle, wherein the preset included angle is the included angle between zero scale and the maximum scale in the scale of the instrument.
Since the total reading of the scale is determined, the identification device calculates the reading of the pointer instrument by using the ratio of the included angle between the first connecting line and the second connecting line to the preset included angle. In particular, the identification means calculates the pointer meter reading using the product between the ratio and the total reading. The preset included angle is an included angle between zero scale and the maximum scale in the scales of the pointer instrument.
It should be noted that, in order to improve the accuracy of the pointer reading, the identification device determines the accuracy of the pointer and the scale identified by the contour identification technology by judging whether the center of the circle where the axis and the scale are located coincides before calculating the pointer reading, so that the pointer instrument reading is calculated based on the pointer and the scale to obtain the pointer instrument reading, and the accuracy of the pointer instrument reading is improved.
In the scheme, the identification device determines the instrument scale, the position pointed by the pointer and the pointer shaft of the pointer instrument by utilizing the characteristic position information, the confidence coefficient and the characteristic strength; acquiring a first connecting line between zero scale and a pointer shaft in the instrument scale and a second connecting line between the position pointed by the pointer and the pointer shaft, and determining an included angle between the first connecting line and the second connecting line; the reading of the pointer instrument is calculated by utilizing the ratio of the included angle to the preset included angle, the preset included angle is the included angle between the zero scale and the maximum scale in the scale of the instrument, and the reading accuracy of the pointer instrument is improved.
To implement the method for recognizing the reading of the pointer instrument in the foregoing embodiment, the present application provides a recognition system, and specifically refer to fig. 6, where fig. 6 is a schematic structural diagram of an embodiment of the recognition system provided in the present application.
The recognition system 600 includes an acquisition unit 61, an image correction unit 62, a feature extraction unit 63, and a calculation unit 64.
Specifically, the recognition system 600 includes: an acquisition unit 61 for acquiring a pointer instrument image, the pointer instrument image comprising image deflection data.
And the image correction unit 62 is used for performing image correction processing on the pointer instrument image according to the image deflection data to obtain a target image.
And the feature extraction unit 63 is configured to input the target image into the deep neural network model to obtain a target feature image.
And the calculating unit 64 is used for calculating the reading of the pointer instrument according to the target characteristic image.
To implement the method for recognizing the reading of the pointer instrument in the foregoing embodiment, the present application provides a terminal device, and specifically refer to fig. 7, where fig. 7 is a schematic structural diagram of an embodiment of the terminal device provided in the present application.
The terminal device 700 comprises a memory 71 and a processor 72, wherein the memory 71 and the processor 72 are coupled.
The memory 71 is used for storing program data, and the processor 72 is used for executing the program data to realize the identification method of the reading of the pointer meter of the above embodiment.
In the present embodiment, the processor 72 may also be referred to as a CPU (Central Processing Unit). The processor 72 may be an integrated circuit chip having signal processing capabilities. The processor 72 may also be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor 72 may be any conventional processor or the like.
The present application also provides a computer storage medium 800, as shown in fig. 8, the computer storage medium 800 is used for storing program data 81, and the program data 81, when executed by a processor, is used for implementing the method for identifying a reading of a pointer meter as described in the method embodiment of the present application.
The method involved in the embodiment of the identification method for the reading of the pointer meter is realized in the form of a software functional unit, and can be stored in a device, such as a computer readable storage medium, when the method is sold or used as a stand-alone product. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the purpose of illustrating embodiments of the present application and is not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application or are directly or indirectly applied to other related technical fields, are also included in the scope of the present application.