CN115082776A - Electric energy meter automatic detection system and method based on image recognition - Google Patents

Electric energy meter automatic detection system and method based on image recognition Download PDF

Info

Publication number
CN115082776A
CN115082776A CN202210989601.4A CN202210989601A CN115082776A CN 115082776 A CN115082776 A CN 115082776A CN 202210989601 A CN202210989601 A CN 202210989601A CN 115082776 A CN115082776 A CN 115082776A
Authority
CN
China
Prior art keywords
image
electric energy
energy meter
information
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210989601.4A
Other languages
Chinese (zh)
Inventor
吴滨
秦冬雷
施火泉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuxi Hengtong Electric Appliance Co ltd
Original Assignee
Wuxi Hengtong Electric Appliance Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuxi Hengtong Electric Appliance Co ltd filed Critical Wuxi Hengtong Electric Appliance Co ltd
Priority to CN202210989601.4A priority Critical patent/CN115082776A/en
Publication of CN115082776A publication Critical patent/CN115082776A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/22Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/02Recognising information on displays, dials, clocks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses an automatic detection system and a method of an electric energy meter based on image recognition, belonging to the technical field of electric energy meter detection, which obtains an electric energy meter image by taking a picture of the electric energy meter to be detected, preprocesses the electric energy meter image to obtain a target electric energy meter image corresponding to the electric energy meter image, locates an image recognition area by adopting horizontal projection and vertical projection according to the target electric energy meter image to determine the characteristic information of the electric energy meter, detects a liquid crystal screen and an LED trip lamp of the electric energy meter according to the characteristic information of the electric energy meter and inputs the detected information into a trained neural network model by combining the reading of the electric energy meter in a preset period to train to obtain the detection result of the electric energy meter, solves the problem that the image in the image processing electric energy meter is easy to be interfered, improves the detection efficiency and the accuracy of the electric energy meter, and effectively recognizes the appearance and the electric energy quality of the electric energy meter, the credibility of charging the electricity fee is improved.

Description

Electric energy meter automatic detection system and method based on image recognition
Technical Field
The invention belongs to the technical field of electric energy meter detection, and particularly relates to an electric energy meter automatic detection system and method based on image recognition.
Background
With the rapid development of social economy, electric energy is developing towards intellectualization and informatization, the power consumption requirements of enterprises and common families are gradually increased, the intelligent electric energy meter is taken as a key device in a national power grid intelligent power grid metering system and is gradually popularized and used, the electric energy meter mainly displays information through a liquid crystal screen of the electric energy meter, the accuracy of the displayed content of the liquid crystal screen needs to be ensured, but in the production and transportation processes, various quality problems can be caused due to external extrusion collision, internal welding and the like, such as the situations of the non-bright liquid crystal screen, the defects of character display, the non-bright prompt lamp, the inaccurate electric energy metering and the like. However, with the rapid development of new generation information technologies such as big data, mobile internet and cloud computing, the role of image recognition technology in the development of the economic society is increasingly prominent, and image information is the most intuitive and convenient way for people to acquire information, so that the amount of digital image information is increased dramatically.
Disclosure of Invention
In view of the above, the present invention provides an automatic electric energy meter detection system and method based on image recognition, which use machine vision to detect the appearance quality of electric energy meter products, save human resources, and improve detection efficiency, so as to solve the above technical problems, and is implemented by using the following technical solutions.
In a first aspect, the present invention provides an electric energy meter automatic detection system based on image recognition, including:
the image acquisition module is used for photographing an electric energy meter to be detected to obtain an electric energy meter image, and preprocessing the electric energy meter image to obtain a target electric energy meter image corresponding to the electric energy meter image, wherein the image preprocessing comprises image gray level transformation, image binarization and image filtering;
an image processing module for processing the image based onThe image processing module comprises a first positioning unit and a second positioning unit, the first positioning unit is used for identifying the upper and lower boundary images of the electric energy meter, the second positioning unit is used for identifying the left and right boundaries of the electric energy meter, and the execution process of the first positioning unit comprises the following steps: presetting the length and width of a reading area image of a target electric energy meter image to be identified as
Figure 755421DEST_PATH_IMAGE001
The gray level image obtained by the pretreatment is
Figure 953184DEST_PATH_IMAGE002
An image obtained by subjecting the image to binarization is
Figure 766420DEST_PATH_IMAGE003
Then, the horizontal projection value of the ith row is:
Figure 608605DEST_PATH_IMAGE004
Figure 114673DEST_PATH_IMAGE005
(ii) a Wherein
Figure 534153DEST_PATH_IMAGE006
The method is in a form that binary images are cumulatively distributed according to lines, the part with a non-zero horizontal projection value is a continuous horizontal projection corresponding to a target, and the segmentation process comprises the following steps: scanning down from above the image with a horizontal line, finding the upper border of the image, i.e. the first one satisfies
Figure 275712DEST_PATH_IMAGE007
Row of
Figure 97038DEST_PATH_IMAGE008
Then, a horizontal line is selected to scan upwards from the lower part of the image to find the imageLower boundary of, i.e. first
Figure 774007DEST_PATH_IMAGE007
Row of
Figure 821729DEST_PATH_IMAGE009
And the electric energy meter detection module is used for detecting a liquid crystal display and an LED trip lamp of the electric energy meter according to the characteristic information of the electric energy meter and inputting the electric energy meter reading in a preset period into the trained neural network model in combination to train so as to obtain the detection result of the electric energy meter.
As a further improvement of the technical scheme, the upper and lower boundaries are positioned by using thickness and thickness positioning in horizontal projection, and the process comprises the following steps:
will gray scale image
Figure 242346DEST_PATH_IMAGE002
Obtaining a binary image through binarization of the maximum inter-class variance
Figure 918178DEST_PATH_IMAGE003
To obtain a binary image
Figure 890682DEST_PATH_IMAGE003
Partial image of (1)
Figure 550333DEST_PATH_IMAGE010
Making gray projection in horizontal direction, the horizontal projection of i-th row is
Figure 243483DEST_PATH_IMAGE011
Wherein
Figure 177416DEST_PATH_IMAGE012
Figure 930608DEST_PATH_IMAGE013
W and h represent the width and height of the grayscale image;
from
Figure 811977DEST_PATH_IMAGE014
Line down scans to
Figure 699030DEST_PATH_IMAGE015
Line, find the first satisfaction
Figure 615034DEST_PATH_IMAGE016
Figure 539127DEST_PATH_IMAGE017
Row of
Figure 783158DEST_PATH_IMAGE008
From the picture
Figure 83689DEST_PATH_IMAGE018
Is scanned in the line direction to
Figure 854199DEST_PATH_IMAGE015
Line, find the first satisfaction
Figure 339407DEST_PATH_IMAGE016
Figure 195368DEST_PATH_IMAGE019
Row of
Figure 299590DEST_PATH_IMAGE009
According to the upper boundary
Figure 799972DEST_PATH_IMAGE008
And a lower boundary
Figure 331448DEST_PATH_IMAGE009
Cutting off ineffective upper and lower boundary images to obtain new binary image
Figure 674705DEST_PATH_IMAGE020
And counting the new horizontal projection corresponding to the new binary image
Figure 176093DEST_PATH_IMAGE006
Images from
Figure 921195DEST_PATH_IMAGE014
Line down scans to
Figure 623572DEST_PATH_IMAGE015
Find the last satisfaction
Figure 63912DEST_PATH_IMAGE016
Figure 509937DEST_PATH_IMAGE017
Row of
Figure 109545DEST_PATH_IMAGE021
(ii) a Image slave
Figure 841878DEST_PATH_IMAGE018
Is scanned in the line direction to
Figure 159727DEST_PATH_IMAGE015
Find the last satisfaction
Figure 409442DEST_PATH_IMAGE016
Figure 863558DEST_PATH_IMAGE019
Row (b)
Figure 508735DEST_PATH_IMAGE022
Determining
Figure 313880DEST_PATH_IMAGE002
Corresponding upper boundary is
Figure 101707DEST_PATH_IMAGE023
The lower boundary is
Figure 534963DEST_PATH_IMAGE024
Wherein, twice before and after
Figure 750043DEST_PATH_IMAGE025
Get the
Figure 42484DEST_PATH_IMAGE026
Figure 978210DEST_PATH_IMAGE027
Figure 406918DEST_PATH_IMAGE028
Figure 58479DEST_PATH_IMAGE029
Figure 431691DEST_PATH_IMAGE030
Figure 561321DEST_PATH_IMAGE031
Figure 110115DEST_PATH_IMAGE032
Figure 276785DEST_PATH_IMAGE033
Figure 278239DEST_PATH_IMAGE034
And projecting the local image of the coarse positioning result image to the horizontal direction for fine positioning to obtain the upper and lower boundaries of the character string so as to determine the upper and lower boundaries of the electric energy meter.
As a further improvement of the above technical solution, the executing process of the second positioning unit includes:
carrying out gray projection on a target electric energy meter image in the vertical direction, adopting blank gaps among characters to segment single characters one by one to determine the left and right boundaries of the target electric energy meter image, and presetting the size as
Figure 211560DEST_PATH_IMAGE035
Binary image of
Figure 473914DEST_PATH_IMAGE003
The vertical projection value on the jth column is
Figure 201698DEST_PATH_IMAGE036
Wherein
Figure 300236DEST_PATH_IMAGE037
Column j indicates the space between the characters, and the left boundary, i.e. the first one, of a character is found by scanning a vertical line from the left boundary to the right boundary
Figure 771668DEST_PATH_IMAGE038
Point of (2)
Figure 29474DEST_PATH_IMAGE039
The right border of the first character, i.e. the first, is found by scanning to the right
Figure 52794DEST_PATH_IMAGE037
Point of (2)
Figure 28840DEST_PATH_IMAGE040
And finding the corresponding left and right boundaries of the rest characters according to the same process to determine the left and right boundaries of the electric energy meter.
As a further improvement of the above technical solution, the image processing module further includes a reading identification unit and a barcode identification unit, the barcode identification unit is configured to identify a barcode information of the electric energy meter, which includes manufacturer information, date of delivery and number, according to a start area and a data area of the barcode on the electric energy meter, the reading identification unit obtains electric quantity information of electric quantity and total electric quantity on the current electric energy meter by using a character identification algorithm, and the electric quantity information and the barcode information are associated with characteristic information of the electric energy meter.
As a further improvement of the technical scheme, the image acquisition module comprises an image gray level transformation unit, an image binarization unit and an image filtering unit;
the execution process of the image gray scale conversion unit comprises the following steps: method for selecting different weights of RGB (red, green and blue) of three primary colors to form different gray scales by using weighted gray scale methodThe electric energy meter image is expressed as
Figure 38384DEST_PATH_IMAGE041
In which
Figure 416276DEST_PATH_IMAGE042
Is in a pixel
Figure 92721DEST_PATH_IMAGE043
Obtaining a gray level image after weighted conversion;
Figure 556063DEST_PATH_IMAGE044
Figure 228353DEST_PATH_IMAGE045
and
Figure 460751DEST_PATH_IMAGE046
represents a weighting coefficient when
Figure 966819DEST_PATH_IMAGE047
Figure 651878DEST_PATH_IMAGE048
And
Figure 878591DEST_PATH_IMAGE049
the gray scale of the image is most reasonable;
the execution process of the image binarization unit comprises the following steps: setting a threshold value, wherein the preset pixel points smaller than the threshold value are all 0, otherwise, the preset pixel points are all 1, and the expression is
Figure 965496DEST_PATH_IMAGE050
Wherein
Figure 642465DEST_PATH_IMAGE051
Is a threshold value, and is,
Figure 673875DEST_PATH_IMAGE052
is in a pixel
Figure 828912DEST_PATH_IMAGE043
The gray-scale value of (a) is,
Figure 35903DEST_PATH_IMAGE053
is a binary value, the value of which is 0 or 1;
the image filtering unit performs a process including: using morphological filtering without passivation of image structure, the operation process includes erosion and expansion, wherein the expression of erosion is
Figure 493560DEST_PATH_IMAGE054
Wherein the corrosion results are a set of shift elements z, such that the result of B on element shift operations is contained in A, and further wherein the expression for dilation is
Figure 153212DEST_PATH_IMAGE055
The reflection of B is translated, the intersection of the reflection of B and A is not empty, the reflection of B is not mapped relative to the original point of the reflection of B, and the translation of B is to displace the reflection of B; removing isolated dots and burrs in the image, and performing open operation on the image of the electric energy meter by using an expression
Figure 111940DEST_PATH_IMAGE056
Wherein
Figure 32492DEST_PATH_IMAGE057
The method comprises the following steps of performing open operation on an image A by using an image B, corroding the image A by using the image B, and expanding a result by using the image B, namely separating slightly connected image blocks; the other algorithm is a closed operation opposite to the open operation, namely, B is used for expanding A, and then B is used for corroding the result, namely, the finely connected image blocks are closed, so that the preprocessing of the electric energy meter image is completed.
As a further improvement of the technical scheme, the electric energy meter detection module comprises a liquid crystal screen detection unit and an LED trip lamp detection unit, the liquid crystal screen detection unit adopts character marking texts to position the liquid crystal screen so as to determine the position of the liquid crystal screen, the LED trip lamp detection unit determines the position range of the LED trip lamp according to the position of the liquid crystal screen of the electric energy meter, and the position of the LED trip lamp of the electric energy meter is positioned in the position range by adopting a Hough gradient method.
As a further improvement of the above technical solution, the process of positioning the LED trip lamp includes:
canny edge detection is carried out on an image in the characteristic information of the electric energy meter to obtain a binary edge image, and a Sobel operator is adopted to solve a gradient value of each non-zero pixel point in the x direction and the y direction to obtain the gradient of the pixel point;
traversing all nonzero pixel points in the binary edge image, drawing a line segment along the gradient direction, determining the length and the starting point of the line segment according to a set radius area, taking the intersection point of all gradient line segments as candidate circle centers, storing the candidate circle centers into a two-dimensional accumulator, and removing the candidate circle centers with low possibility by adopting a non-maximum inhibition method;
sorting the number of the intersection points in the accumulator from large to small, taking the pixel point with the largest intersection point number as a circle center, performing radius estimation, presetting a preset threshold value of the largest radius and the smallest radius, calculating the distance between the candidate circle center and all the circumference lines, and reserving the distance within the range of the preset threshold value and sorting;
and calculating the number of the sorted distances with the same size, determining the line segment as the radius of the circle center when the number reaches a preset threshold, traversing all the circle centers in the accumulator, and repeating the calculation of the distances from the candidate circle centers to all the circumference lines to obtain all the circles meeting the conditions in the image so as to determine the position of the LED trip lamp.
As a further improvement of the above technical solution, the electric energy meter detection module includes an electric energy quality detection unit, and the neural network adopts a residual error learning module and a distraction mechanism to improve a capsule neural network by convolution and summation
Figure 785684DEST_PATH_IMAGE058
The convolutional layer, the characteristic data information is further fused and then transmitted to the initial capsule layer to construct vector neurons, the classifier adopts a digital capsule layer classifier and a full-connection layer classifier, the interval loss and the reconstruction loss are combined in proportion to construct a loss function, and the process comprises the following steps:
the image characteristics corresponding to the characteristic information of the electric energy meters with different sizes are adopted as input, and the size of a convolution kernel is
Figure 932632DEST_PATH_IMAGE058
Performing dimensionality reduction on the convolution original acid, increasing the dimensionality of input data characteristics to an N channel through convolution, extracting data characteristic information by adopting two modules, dividing each module into two parts, and performing convolution operation and attention calculation respectively, wherein the characteristic size of an image is kept unchanged;
the output results of the two modules are connected together in a characteristic connection mode to obtain data of a 2N-dimensional channel, and then the data are processed by convolution kernel with the size of
Figure 570418DEST_PATH_IMAGE058
Performing convolution operation to reduce dimension to obtain an N channel, combining output data with original data through a residual error structure, forming N and vector neurons through constructing vector neuron operation, and inputting data characteristic information to a digital capsule layer by combining a dynamic routing algorithm to realize classification of power quality to obtain a detection result.
As a further improvement of the above technical solution, the electric energy meter automatic detection system further includes an identity verification unit and a communication unit, the identity verification unit is configured to verify the electric energy meter and the user identity when the image acquisition module is turned on to obtain user identity information, and after the verification is passed, bind the user identity information and the barcode information and send the detection result to a user side corresponding to the user identity information through the communication unit in combination with the detection result.
In a second aspect, the invention further provides an electric energy meter automatic detection method based on image recognition, which comprises the following steps:
the method comprises the steps of obtaining an electric energy meter to be tested, photographing to obtain an electric energy meter image, and preprocessing the electric energy meter image to obtain a target electric energy meter image corresponding to the electric energy meter image, wherein the image preprocessing comprises image gray level transformation, image binarization and image filtering;
performing image identification area positioning by adopting horizontal projection and vertical projection according to the target electric energy meter image to determine electric energy meter characteristic information, wherein the electric energy meter characteristic information comprises electric energy meter reading, manufacturer information and bar code information;
and detecting a liquid crystal screen and an LED trip lamp of the electric energy meter according to the characteristic information of the electric energy meter, and inputting the electric energy meter reading in a preset period into the trained neural network model in combination to train so as to obtain a detection result of the electric energy meter.
The invention provides an automatic detection system and a method of an electric energy meter based on image recognition, which are characterized in that an image of the electric energy meter to be detected is obtained by photographing the electric energy meter to be detected, the image of the electric energy meter is preprocessed to obtain a target electric energy meter image corresponding to the image of the electric energy meter, image recognition area positioning is carried out by adopting horizontal projection and vertical projection according to the target electric energy meter image to determine characteristic information of the electric energy meter, a liquid crystal screen and an LED trip lamp of the electric energy meter are detected according to the characteristic information of the electric energy meter and are input into a trained neural network model in combination with reading of the electric energy meter in a preset period to train to obtain a detection result of the electric energy meter, the problem that the image in the image processing electric energy meter is easy to interfere is solved, the detection efficiency and the detection accuracy of the electric energy meter are improved, the situation that the traditional manual detection of the electric energy meter has lower working efficiency is replaced, and effective recognition is carried out from the appearance and the electric energy quality of the electric energy meter, the credibility of charging the electricity fee is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
FIG. 1 is a block diagram of an automatic detection system for an electric energy meter based on image recognition according to the present invention;
FIG. 2 is a process diagram of the LED trip light positioning provided by the present invention;
fig. 3 is a flowchart of an electric energy meter automatic detection method based on image recognition according to the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
It will be understood that when an element is referred to as being "secured to" another element, it can be directly on the other element or intervening elements may also be present. When an element is referred to as being "connected" to another element, it can be directly connected to the other element or intervening elements may also be present. In contrast, when an element is referred to as being "directly on" another element, there are no intervening elements present. The terms "vertical," "horizontal," "left," "right," and the like are used herein for purposes of illustration only.
Referring to fig. 1, the present invention provides an electric energy meter automatic detection system based on image recognition, including:
the system comprises an image acquisition module, a data processing module and a data processing module, wherein the image acquisition module is used for photographing an electric energy meter to be tested to obtain an electric energy meter image, and preprocessing the electric energy meter image to obtain a target electric energy meter image corresponding to the electric energy meter image, wherein the image preprocessing comprises image gray level conversion, image binarization and image filtering;
the image processing module is used for carrying out image identification area positioning by adopting horizontal projection and vertical projection according to the target electric energy meter image so as to determine electric energy meter characteristic information, the electric energy meter characteristic information comprises electric energy meter reading, manufacturer information and bar code information, the image processing module comprises a first positioning unit and a second positioning unit, the first positioning unit is used for identifying upper and lower boundary images of the electric energy meter, the second positioning unit is used for identifying left and right boundaries of the electric energy meter, and the execution process of the first positioning unit comprises the following steps: presetting the length and width of a reading area image of a target electric energy meter image to be identified as
Figure 220842DEST_PATH_IMAGE001
The gray scale image obtained by the preprocessing is
Figure 144935DEST_PATH_IMAGE002
An image obtained by binarization processing is
Figure 903813DEST_PATH_IMAGE003
Then, the horizontal projection value of the ith row is:
Figure 938765DEST_PATH_IMAGE004
Figure 974854DEST_PATH_IMAGE005
(ii) a Wherein
Figure 948145DEST_PATH_IMAGE006
The method is in a form that binary images are cumulatively distributed according to lines, the part with a non-zero horizontal projection value is a continuous horizontal projection corresponding to a target, and the segmentation process comprises the following steps: scanning down from above the image with a horizontal line, finding the upper border of the image, i.e. the first one satisfies
Figure 69685DEST_PATH_IMAGE007
Row of
Figure 173907DEST_PATH_IMAGE008
Then, a horizontal line is selected to scan upwards from the lower part of the image to find the lower boundary of the image, namely the first one
Figure 657978DEST_PATH_IMAGE007
Row of
Figure 189453DEST_PATH_IMAGE009
And the electric energy meter detection module is used for detecting a liquid crystal display and an LED trip lamp of the electric energy meter according to the characteristic information of the electric energy meter and inputting the electric energy meter reading in a preset period into the trained neural network model in combination to train so as to obtain the detection result of the electric energy meter.
In this embodiment, the upper and lower boundaries are located by using the thickness-priority location during the horizontal projection, and the process includes: will gray scale image
Figure 532710DEST_PATH_IMAGE002
Obtaining a binary image through binarization of the maximum inter-class variance
Figure 440623DEST_PATH_IMAGE003
To obtain a binary image
Figure 795512DEST_PATH_IMAGE003
Partial image of (1)
Figure 497889DEST_PATH_IMAGE010
Making gray projection in horizontal direction, the horizontal projection of i-th row is
Figure 187496DEST_PATH_IMAGE011
Wherein
Figure 633521DEST_PATH_IMAGE012
Figure 233130DEST_PATH_IMAGE013
W and h represent the width and height of the grayscale image; from
Figure 716195DEST_PATH_IMAGE014
Line down scans to
Figure 34044DEST_PATH_IMAGE015
Line, find the first satisfaction
Figure 18180DEST_PATH_IMAGE016
Figure 737875DEST_PATH_IMAGE017
Row of
Figure 641109DEST_PATH_IMAGE008
Images from
Figure 446254DEST_PATH_IMAGE018
Is scanned in the line direction to
Figure 843868DEST_PATH_IMAGE015
Line, find the first satisfaction
Figure 418069DEST_PATH_IMAGE016
Figure 633150DEST_PATH_IMAGE019
Row of
Figure 660011DEST_PATH_IMAGE009
(ii) a According to the upper boundary
Figure 110584DEST_PATH_IMAGE008
And a lower boundary
Figure 539292DEST_PATH_IMAGE009
Cutting off invalid upper and lower boundary images to obtain new binary image, and counting new horizontal projection corresponding to the new binary image
Figure 925274DEST_PATH_IMAGE006
Images from
Figure 311868DEST_PATH_IMAGE014
Line down scans to
Figure 441498DEST_PATH_IMAGE015
Find the last satisfaction
Figure 583766DEST_PATH_IMAGE016
Figure 406229DEST_PATH_IMAGE017
Row of
Figure 407683DEST_PATH_IMAGE021
(ii) a Image slave
Figure 341004DEST_PATH_IMAGE018
Is scanned in the line direction to
Figure 354090DEST_PATH_IMAGE015
Find the last satisfaction
Figure 81875DEST_PATH_IMAGE016
Figure 570625DEST_PATH_IMAGE019
Row of
Figure 901112DEST_PATH_IMAGE022
(ii) a Determining
Figure 158918DEST_PATH_IMAGE002
Corresponding upper boundary is
Figure 323183DEST_PATH_IMAGE023
The lower boundary is
Figure 909017DEST_PATH_IMAGE024
Wherein, twice before and after
Figure 918561DEST_PATH_IMAGE025
Get
Figure 296453DEST_PATH_IMAGE026
Figure 490674DEST_PATH_IMAGE027
Figure 688437DEST_PATH_IMAGE028
Figure 501672DEST_PATH_IMAGE029
Figure 609436DEST_PATH_IMAGE030
Figure 584346DEST_PATH_IMAGE031
Figure 534984DEST_PATH_IMAGE032
,,
Figure 276544DEST_PATH_IMAGE034
And projecting the local image of the coarse positioning result image to the horizontal direction for fine positioning to obtain the upper and lower boundaries of the character string so as to determine the upper and lower boundaries of the electric energy meter.
It should be noted that, the boundary positioning may be implemented to obtain four boundaries of the whole character string, the horizontal projection method is used for positioning the upper and lower boundaries, the left and right boundaries are positioned by using vertical projection, the horizontal projection method is to implement segmentation according to the prominent gray difference between the background and the target in the binary image, project the binary image to the horizontal direction, then determine the start and end lines of the character string, and form a histogram by the amount of white or black pixels of the character in the horizontal direction. The method comprises the steps of positioning the upper and lower boundaries of electric energy meter reading, a manufacturer and a bar code information character string by using a boundary method to obtain a gray image of a region to be cut, wherein coarse positioning is to be achieved, projecting a partial image horizontal projection histogram obtained after OSTU binarization to the horizontal direction to perform fine positioning on a partial image of a coarse positioning result image, finally obtaining the upper and lower boundaries of the character string, obtaining the left and right boundaries of the character string according to the same process, cutting out a complete electric energy meter reading, the manufacturer and the bar code information image, then obtaining the left and right boundaries of each character by using a vertical projection method again, and achieving independent segmentation of each character, thereby accurately determining an electric energy meter identification region.
It should be understood that the image processing module further comprises a reading identification unit and a bar code identification unit, the bar code identification unit is used for identifying according to a starting area and a data area of a bar code on the electric energy meter to obtain bar code information of the electric energy meter, wherein the bar code information comprises manufacturer information, factory date and number, the reading identification unit obtains electric quantity information of electric quantity and total electric quantity on the current electric energy meter by adopting a character identification algorithm, and the electric quantity information and the bar code information are related to characteristic information of the electric energy meter. The bar code mainly comprises a part of a quiet area on the front, namely, the beginning of bar code search is shown, a starting area is arranged beside the quiet area, different bar codes have different starting areas, the part shows a starting signal of the bar code and a type signal of the bar code, a data area is decrypted according to rules in a code table, and finally bar code numbers or figures are data calculated by combining the bar code type specified by the starting area with the result of the data area. The purpose of reducing the space size of the attribute can be achieved by selecting some effective features from the feature information of the electric energy meter, and the attribute extraction and selection are to reduce the recognition error rate and recognition time of recognition as much as possible, so that the automatic detection efficiency of the electric energy meter is improved.
Optionally, the image acquisition module includes an image gray scale transformation unit, an image binarization unit and an image filtering unit, and the execution process of the image gray scale transformation unit includes: selecting different weights of three primary colors RGB by using a weighted gray scale method to form electric energy meter images with different gray scales, wherein the expression is
Figure 363449DEST_PATH_IMAGE041
Wherein
Figure 774839DEST_PATH_IMAGE042
Is in a pixel
Figure 837209DEST_PATH_IMAGE043
Obtaining a gray level image after weighted conversion;
Figure 992246DEST_PATH_IMAGE044
Figure 933658DEST_PATH_IMAGE045
and
Figure 640582DEST_PATH_IMAGE046
represents a weighting coefficient when
Figure 300234DEST_PATH_IMAGE047
Figure 993383DEST_PATH_IMAGE048
And
Figure 930247DEST_PATH_IMAGE049
the gray scale of the image is most reasonable; the execution process of the image binarization unit comprises the following steps: setting a threshold value, wherein the preset pixel points smaller than the threshold value are all 0, otherwise, the preset pixel points are all 1, and the expression is
Figure 949018DEST_PATH_IMAGE050
Wherein
Figure 95966DEST_PATH_IMAGE051
Is a threshold value, and is,
Figure 451861DEST_PATH_IMAGE052
is in a pixel
Figure 367864DEST_PATH_IMAGE043
The gray-scale value of (a) is,
Figure 291958DEST_PATH_IMAGE053
is a binary value, the value of which is 0 or 1;
the image filtering unit performs a process including: using morphological filtering without passivation of image structure, and its operation process includes erosion and expansion, in which the expression of erosion is
Figure 801568DEST_PATH_IMAGE054
Wherein the corrosion results are a set of shift elements z, such that the result of B on element shift operations is contained in A, and further wherein the expression for dilation is
Figure 102099DEST_PATH_IMAGE055
The reflection of B is translated, the intersection of the reflection of B and A is not empty, the reflection of B is not mapped relative to the original point of the reflection of B, and the translation of B is to displace the reflection of B; removing isolated dots and burrs in the image, and performing open operation on the image of the electric energy meter by using an expression
Figure 872609DEST_PATH_IMAGE056
Wherein
Figure 233183DEST_PATH_IMAGE057
The method comprises the following steps of performing open operation on an image A by using an image B, corroding the image A by using the image B, and expanding a result by using the image B, namely separating slightly connected image blocks; the other algorithm is a closed operation opposite to the open operation, namely, B is used for expanding A, and then B is used for corroding the result, namely, the finely connected image blocks are closed, so that the preprocessing of the electric energy meter image is completed.
In the embodiment, after the electric energy meter image is acquired through professional image acquisition equipment, the electric energy meter image is preprocessed, and the preprocessing mainly comprises image gray scale transformation, image binarization and image filtering. After the electric energy meter is subjected to weighted gray level transformation, the requirement of image extraction on an image is high, the calculated amount of image extraction can be increased due to overlarge image data amount, and the effective acquisition of information of an electric energy meter image is not facilitated.
The image quality is greatly improved by preprocessing the electric energy meter image, the electric energy meter image features are extracted to be used as a basis for identifying and analyzing the electric energy meter, the image feature extraction method mainly comprises identification methods such as statistics, modules and structures, template matching is a common image identification process, and the template matching is adopted, namely target information such as the number of representations and bar code information is searched in the electric energy meter image and the position of the target information is determined.
Optionally, the electric energy meter detection module comprises a liquid crystal screen detection unit and an LED trip lamp detection unit, the liquid crystal screen detection unit adopts a character marking text to position the liquid crystal screen so as to determine the position of the liquid crystal screen, the LED trip lamp detection unit determines the position range of the LED trip lamp according to the position of the electric energy meter liquid crystal screen, and the position of the LED trip lamp of the electric energy meter is positioned in the position range by adopting a Hough gradient method.
In this embodiment, the process of detecting the liquid crystal display includes image acquisition, format conversion of the streaming media and digital identification, where the format conversion of the streaming media is to implement real-time performance of the system, and first output an original code stream as a YUV chrominance image through a callback function, then convert the YUV chrominance image into an RGB image format for subsequent processing, and then use a digital identification algorithm to perform real-time reading and identification on the numbers on the liquid crystal display of the electric energy meter. The digital recognition algorithm comprises the steps of firstly positioning a digital region in an image, then carrying out Gaussian filtering to remove image noise, then carrying out binarization and image morphology processing to facilitate image character segmentation, and finally carrying out digital recognition. The segmentation of the digital area is performed by adopting a method for detecting connected domains, all the connected domains in the image are detected by using a findContours function in OpenCV, the detected connected domains are described by a series of points, for example, four points are used to describe a rectangular connected domain, since the numbers in the electric energy meter are rectangles with fixed length-width ratios, therefore, the detected outer contour is also a rectangle with a fixed length-width ratio, and if the length-width ratio is 5:2, screening all detected contours according to the proportion, reserving the part with the detected contour rectangle proportion of 5:2, removing the rest parts, the numbers can be divided, the numbers are out of order at the time, the arrangement positions of the numbers need to be reordered, when extracting the contour, orderly marking, namely naming and storing the extracted contour according to the size of the X coordinate of the number. In order to detect whether the LED trip lamp of the electric energy meter is turned on or not, the LED trip lamp needs to be accurately positioned, and according to the position characteristic analysis of the LED trip lamp, the distance between the LED trip lamp and the left lower corner of the liquid crystal display is about one third, so that the LED trip lamp can be searched in a specified area range, the interference of other LED lamps is avoided, and the operation speed can be improved.
Referring to fig. 2, optionally, the process of LED trip lamp positioning includes:
s20: canny edge detection is carried out on the image in the characteristic information of the electric energy meter to obtain a binary edge image, and a Sobel operator is adopted to solve a gradient value of each non-zero pixel point in the x direction and the y direction to obtain the gradient of the pixel point;
s21: traversing all nonzero pixel points in the binary edge image, drawing a line segment along the gradient direction, determining the length and the starting point of the line segment according to a set radius area, taking the intersection point of all gradient line segments as candidate circle centers, storing the candidate circle centers into a two-dimensional accumulator, and removing the candidate circle centers with low possibility by adopting a non-maximum inhibition method;
s22: sorting the number of intersection points in the accumulator from large to small, taking the pixel point with the largest number of intersection points as a circle center, carrying out radius estimation, presetting a preset threshold value of the largest radius and the smallest radius, calculating the distance from the candidate circle center to all circumferential lines, and reserving the distance within the range of the preset threshold value and sorting;
s23: and calculating the number of the sorted distances with the same size, determining the line segment as the radius of the circle center when the number reaches a preset threshold, traversing all the circle centers in the accumulator, and repeating the calculation of the distances from the candidate circle centers to all the circumference lines to obtain all the circles meeting the conditions in the image so as to determine the position of the LED trip lamp.
In the embodiment, the round LED lamp is positioned by using a hough transform method, which is an image feature extraction technology, and can effectively detect geometric shapes such as a straight line and a round lamp shape in an image, and the hough transform method can convert a cartesian coordinate system into a spherical coordinate system.
Optionally, the electric energy meter detection module comprises an electric energy quality detection unit, and the neural network adopts a residual error learning module and a distraction mechanism to improve a capsule neural network, and the residual error learning module and the distraction mechanism are used for improving the capsule neural network through convolution and summation
Figure 213777DEST_PATH_IMAGE058
The convolutional layer, the characteristic data information is further fused and then transmitted to the initial capsule layer to construct vector neurons, the classifier adopts a digital capsule layer classifier and a full-connection layer classifier, the interval loss and the reconstruction loss are combined in proportion to construct a loss function, and the process comprises the following steps:
the image characteristics corresponding to the characteristic information of the electric energy meters with different sizes are adopted as input, and the size of a convolution kernel is
Figure 52420DEST_PATH_IMAGE058
Performing dimensionality reduction on the convolution original acid, increasing the dimensionality of input data characteristics to an N channel through convolution, extracting data characteristic information by adopting two modules, dividing each module into two parts, and performing convolution operation and attention calculation respectively, wherein the characteristic size of an image is kept unchanged;
the output results of the two modules are connected together in a characteristic connection mode to obtain data of a 2N-dimensional channel, and then the data is processed by convolution with a convolution kernel of which the size is
Figure 552803DEST_PATH_IMAGE058
Performing convolution operation to reduce dimension to obtain an N channel, combining output data with original data through a residual error structure, forming N and vector neurons through constructing vector neuron operation, and inputting data characteristic information to a digital capsule layer by combining a dynamic routing algorithm to realize classification of power quality to obtain a detection result.
In this embodiment, the decentralized attention mechanism is to group the input feature data, perform convolution operation and attention operation in the group respectively, obtain different weights for different feature data in the group, and increase the feature highlighting effect and the operation efficiency of the model. The capsule network is characterized in that the vector neurons instantiate objects and retain the interrelation among spatial features, the vector neurons and the scalar neurons are mainly different in the structural form of input and output data, and the vector structure has richer feature expression capability. The characteristic information of the electric energy meter is used as an input sample, the electric energy quality disturbance in a region within a period of time can be identified, and therefore accurate electric energy meter data are obtained and the real-time situation of local electric energy is known.
Optionally, the electric energy meter automatic detection system further comprises an identity verification unit and a communication unit, wherein the identity verification unit is used for verifying the electric energy meter and the identity of the user when the image acquisition module is started to obtain user identity information, and after the user identity information passes the verification, the user identity information and the bar code information are bound and are sent to the user side corresponding to the user identity information through the communication unit in combination with the detection result.
In the embodiment, the characteristic information of the electric energy meter is effectively associated with the identity information of the user, so that the detection result of the electric energy meter can be effectively fed back to the user through the communication unit, the time for manual checking or troubleshooting is saved, reasonable early warning is carried out on the electric quantity, the liquid crystal display and faults of the electric energy meter, such as tripping and the like more intelligently and timely, and the user experience is improved.
Referring to fig. 3, the invention also provides an electric energy meter automatic detection method based on image recognition, which comprises the following steps:
s30: the method comprises the steps of obtaining an electric energy meter to be detected, photographing to obtain an electric energy meter image, and preprocessing the electric energy meter image to obtain a target electric energy meter image corresponding to the electric energy meter image, wherein the image preprocessing comprises image gray level transformation, image binarization and image filtering;
s31: performing image identification area positioning by adopting horizontal projection and vertical projection according to the target electric energy meter image to determine electric energy meter characteristic information, wherein the electric energy meter characteristic information comprises electric energy meter reading, manufacturer information and bar code information;
s32: and detecting a liquid crystal display and an LED trip lamp of the electric energy meter according to the characteristic information of the electric energy meter, and inputting the detected data into a trained neural network model in combination with the reading of the electric energy meter in a preset period to train so as to obtain a detection result of the electric energy meter.
In the embodiment, the electric energy meter to be tested is obtained and photographed to obtain the electric energy meter image, the electric energy meter image is preprocessed to obtain the target electric energy meter image corresponding to the electric energy meter image, positioning an image identification area by adopting horizontal projection and vertical projection according to the target electric energy meter image to determine the characteristic information of the electric energy meter, the method detects the liquid crystal screen and the LED trip lamp of the electric energy meter according to the characteristic information of the electric energy meter, inputs the detected information into the trained neural network model in combination with the reading of the electric energy meter in the preset period to train and obtain the detection result of the electric energy meter, solves the problem that the image in the image processing electric energy meter is easy to interfere, improves the detection efficiency and the accuracy of the electric energy meter, replaces the condition that the traditional manual detection electric energy meter has lower working efficiency, the appearance and the electric energy quality of the electric energy meter are effectively identified, and the credibility of collecting the electric charge is improved.
In all examples shown and described herein, any particular value should be construed as merely exemplary, and not as a limitation, and thus other examples of example embodiments may have different values.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above examples are merely illustrative of several embodiments of the present invention, and the description thereof is more specific and detailed, but not to be construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention.

Claims (10)

1. An electric energy meter automatic detection system based on image recognition is characterized by comprising:
the image acquisition module is used for photographing an electric energy meter to be detected to obtain an electric energy meter image, and preprocessing the electric energy meter image to obtain a target electric energy meter image corresponding to the electric energy meter image, wherein the image preprocessing comprises image gray level transformation, image binarization and image filtering;
an image processing module for positioning the image identification region by horizontal projection and vertical projection according to the target electric energy meter image to determine electricityThe electric energy meter comprises electric energy meter characteristic information, the electric energy meter characteristic information comprises electric energy meter reading, manufacturer information and bar code information, the image processing module comprises a first positioning unit and a second positioning unit, the first positioning unit is used for identifying upper and lower boundary images of the electric energy meter, the second positioning unit is used for identifying left and right boundaries of the electric energy meter, and the execution process of the first positioning unit comprises the following steps: presetting the length and width of a reading area image of a target electric energy meter image to be identified as
Figure 168316DEST_PATH_IMAGE001
The gray scale image obtained by the preprocessing is
Figure 882194DEST_PATH_IMAGE002
An image obtained by binarization processing is
Figure 396352DEST_PATH_IMAGE003
Then, the horizontal projection value of the ith row is:
Figure 198086DEST_PATH_IMAGE004
Figure 543617DEST_PATH_IMAGE005
(ii) a Wherein
Figure 38183DEST_PATH_IMAGE006
The method is in a form that binary images are cumulatively distributed according to lines, the part with a non-zero horizontal projection value is a continuous horizontal projection corresponding to a target, and the segmentation process comprises the following steps: scanning down from above the image with a horizontal line, finding the upper border of the image, i.e. the first one satisfies
Figure 39637DEST_PATH_IMAGE007
Row of
Figure 769696DEST_PATH_IMAGE008
Then, a horizontal line is selected to scan upwards from the lower part of the image to find the imageLower boundary of, i.e. first
Figure 845099DEST_PATH_IMAGE007
Row of
Figure 635201DEST_PATH_IMAGE009
And the electric energy meter detection module is used for detecting a liquid crystal display and an LED trip lamp of the electric energy meter according to the characteristic information of the electric energy meter and inputting the electric energy meter reading in a preset period into the trained neural network model in combination to train so as to obtain the detection result of the electric energy meter.
2. The automatic electric energy meter detection system based on image recognition as claimed in claim 1, wherein the upper and lower boundaries are located by using thickness-thickness location in horizontal projection, and the process comprises:
to gray scale image
Figure 796055DEST_PATH_IMAGE002
Obtaining a binary image through binarization of the maximum inter-class variance
Figure 267487DEST_PATH_IMAGE003
To obtain a binary image
Figure 587610DEST_PATH_IMAGE003
Partial image of (1)
Figure 423979DEST_PATH_IMAGE010
Gray projection is performed in the horizontal direction, and the horizontal projection of the ith row is
Figure 400025DEST_PATH_IMAGE011
Wherein
Figure 471887DEST_PATH_IMAGE012
Figure 521882DEST_PATH_IMAGE013
W and h represent the width and height of the grayscale image;
from
Figure 388207DEST_PATH_IMAGE014
Line down scans to
Figure 851549DEST_PATH_IMAGE015
Line, find the first satisfaction
Figure 599538DEST_PATH_IMAGE016
Figure 831936DEST_PATH_IMAGE017
Row (b)
Figure 400321DEST_PATH_IMAGE008
Images from
Figure 757484DEST_PATH_IMAGE018
Is scanned in the line direction to
Figure 374410DEST_PATH_IMAGE015
Line, find the first satisfaction
Figure 523632DEST_PATH_IMAGE016
Figure 200601DEST_PATH_IMAGE019
Row (b)
Figure 45060DEST_PATH_IMAGE009
According to the upper boundary
Figure 262415DEST_PATH_IMAGE008
And a lower boundary
Figure 469405DEST_PATH_IMAGE009
Cutting off ineffective upper and lower boundary images to obtain new binary image
Figure 254959DEST_PATH_IMAGE020
And counting the new horizontal projection corresponding to the new binary image
Figure 711348DEST_PATH_IMAGE006
Images from
Figure 670076DEST_PATH_IMAGE014
Line down scan to
Figure 403677DEST_PATH_IMAGE015
Find the last satisfaction
Figure 422449DEST_PATH_IMAGE016
Figure 631713DEST_PATH_IMAGE017
Row of
Figure 394133DEST_PATH_IMAGE021
(ii) a Image slave
Figure 982240DEST_PATH_IMAGE018
Is scanned in the line direction to
Figure 968651DEST_PATH_IMAGE015
Find the last satisfaction
Figure 602894DEST_PATH_IMAGE016
Figure 841109DEST_PATH_IMAGE019
Row of
Figure 673936DEST_PATH_IMAGE022
Determining
Figure 768931DEST_PATH_IMAGE002
Corresponding upper boundary is
Figure 828153DEST_PATH_IMAGE023
The lower boundary is
Figure 932376DEST_PATH_IMAGE024
Wherein, twice before and after
Figure 619709DEST_PATH_IMAGE025
Get
Figure 151184DEST_PATH_IMAGE026
Figure 169475DEST_PATH_IMAGE027
Figure 139705DEST_PATH_IMAGE028
Figure 884807DEST_PATH_IMAGE029
Figure 259287DEST_PATH_IMAGE030
Figure 152157DEST_PATH_IMAGE031
Figure 598182DEST_PATH_IMAGE032
Figure 135474DEST_PATH_IMAGE033
Figure 8752DEST_PATH_IMAGE034
To coarsely position the resulting imageAnd projecting the local image to the horizontal direction for fine positioning to obtain the upper and lower boundaries of the character string so as to determine the upper and lower boundaries of the electric energy meter.
3. The system for automatically detecting the electric energy meter based on the image recognition is characterized in that the second positioning unit executes the process comprising the following steps of:
carrying out gray projection on a target electric energy meter image in the vertical direction, adopting blank gaps among characters to divide single characters one by one to determine the left and right boundaries of the target electric energy meter image, and presetting the size to be
Figure 388918DEST_PATH_IMAGE035
Binary image of (2)
Figure 45158DEST_PATH_IMAGE003
The vertical projection value on the jth column is
Figure 764852DEST_PATH_IMAGE036
In which
Figure 871349DEST_PATH_IMAGE037
Column j indicates the space between the characters, and the left boundary, i.e. the first one, of a character is found by scanning a vertical line from the left boundary to the right boundary
Figure 348597DEST_PATH_IMAGE038
Point of (2)
Figure 136425DEST_PATH_IMAGE039
The right border of the first character, i.e. the first, is found by scanning to the right
Figure 772942DEST_PATH_IMAGE037
Point of (2)
Figure 988023DEST_PATH_IMAGE040
The other characters being in accordance with the aboveAnd finding the corresponding left and right boundaries in the same process to determine the left and right boundaries of the electric energy meter.
4. The automatic electric energy meter detection system based on image recognition as claimed in claim 1, wherein the image processing module further comprises a reading recognition unit and a barcode recognition unit, the barcode recognition unit is used for recognizing a barcode information containing manufacturer information, factory date and number of the electric energy meter according to a start area and a data area of a barcode on the electric energy meter, the reading recognition unit obtains electric quantity information of electric quantity and total electric quantity on the current electric energy meter by adopting a character recognition algorithm, and the electric quantity information and the barcode information are associated to the electric energy meter characteristic information.
5. The electric energy meter automatic detection system based on image recognition as claimed in claim 1, wherein the image acquisition module comprises an image gray level transformation unit, an image binarization unit and an image filtering unit;
the execution process of the image gray scale conversion unit comprises the following steps: selecting different weights of three primary colors RGB by using a weighted gray scale method to form electric energy meter images with different gray scales, wherein the expression is
Figure 952568DEST_PATH_IMAGE041
In which
Figure 340824DEST_PATH_IMAGE042
Is in a pixel
Figure 769531DEST_PATH_IMAGE043
Obtaining a gray level image after weighted conversion;
Figure 93197DEST_PATH_IMAGE044
Figure 669671DEST_PATH_IMAGE045
and
Figure 799301DEST_PATH_IMAGE046
represents a weighting coefficient when
Figure 20198DEST_PATH_IMAGE047
Figure 842661DEST_PATH_IMAGE048
And
Figure 640853DEST_PATH_IMAGE049
the gray scale of the image is most reasonable;
the execution process of the image binarization unit comprises the following steps: setting a threshold value, wherein the preset pixel points smaller than the threshold value are all 0, otherwise, the preset pixel points are all 1, and the expression is
Figure 508927DEST_PATH_IMAGE050
Wherein
Figure 646647DEST_PATH_IMAGE051
Is a threshold value, and is,
Figure 702328DEST_PATH_IMAGE052
is in a pixel
Figure 863182DEST_PATH_IMAGE043
The gray-scale value of (a) is,
Figure 334615DEST_PATH_IMAGE053
is a binary value, the value of which is 0 or 1;
the image filtering unit executes the process of: using morphological filtering without passivation of image structure, and its operation process includes erosion and expansion, in which the expression of erosion is
Figure 654737DEST_PATH_IMAGE054
Wherein the corrosion results are a set consisting of shift elements z, such that B is the result package of the shift operation on the elementsContained in A, and further, the expression of swelling is
Figure 819003DEST_PATH_IMAGE055
The reflection of B is translated, the intersection of the reflection of B and A is not empty, the reflection of B is not mapped relative to the original point of the reflection of B, and the translation of B is to displace the reflection of B; removing isolated dots and burrs in the image, and performing open operation on the image of the electric energy meter by using an expression
Figure 467153DEST_PATH_IMAGE056
Wherein
Figure 742276DEST_PATH_IMAGE057
The method comprises the following steps of performing open operation on an image A by using an image B, corroding the image A by using the image B, and expanding a result by using the image B, namely separating slightly connected image blocks; the other algorithm is a closed operation opposite to the open operation, namely, B is used for expanding A, and then B is used for corroding the result, namely, the finely connected image blocks are closed, so that the preprocessing of the electric energy meter image is completed.
6. The electric energy meter automatic detection system based on image recognition is characterized in that the electric energy meter detection module comprises a liquid crystal screen detection unit and an LED trip lamp detection unit, the liquid crystal screen detection unit adopts character labeling texts to position the liquid crystal screen so as to determine the position of the liquid crystal screen, the LED trip lamp detection unit determines the position range of the LED trip lamp according to the position of the electric energy meter liquid crystal screen, and the position of the electric energy meter LED trip lamp is positioned in the position range by adopting a Hough gradient method.
7. The automatic electric energy meter detection system based on image recognition as claimed in claim 6, wherein the process of positioning the LED trip lamp comprises the following steps:
canny edge detection is carried out on the image in the characteristic information of the electric energy meter to obtain a binary edge image, and a Sobel operator is adopted to solve a gradient value of each non-zero pixel point in the x direction and the y direction to obtain the gradient of the pixel point;
traversing all nonzero pixel points in the binary edge image, drawing a line segment along the gradient direction, determining the length and the starting point of the line segment according to a set radius area, taking the intersection point of all gradient line segments as candidate circle centers, storing the candidate circle centers into a two-dimensional accumulator, and removing the candidate circle centers with low possibility by adopting a non-maximum inhibition method;
sorting the number of the intersection points in the accumulator from large to small, taking the pixel point with the largest intersection point number as a circle center, performing radius estimation, presetting a preset threshold value of the largest radius and the smallest radius, calculating the distance between the candidate circle center and all the circumference lines, and reserving the distance within the range of the preset threshold value and sorting;
and calculating the number of the sorted distances with the same size, determining the line segment as the radius of the circle center when the number reaches a preset threshold, traversing all the circle centers in the accumulator, and repeating the calculation of the distances from the candidate circle centers to all the circumference lines to obtain all the circles meeting the conditions in the image so as to determine the position of the LED trip lamp.
8. The system of claim 6, wherein the energy meter detection module comprises an energy quality detection unit, and the neural network is modified by a residual learning module and a split attention mechanism, and is formed by convolution and summation
Figure 916906DEST_PATH_IMAGE058
The characteristic data information is further fused and then transmitted to an initial capsule layer to construct a vector neuron, the classifier adopts a digital capsule layer classifier and a full-connection layer classifier, the interval loss and the reconstruction loss are combined in proportion to construct a loss function, and the process comprises the following steps:
the image characteristics corresponding to the characteristic information of the electric energy meters with different sizes are adopted as input, and the size of a convolution kernel is
Figure 924176DEST_PATH_IMAGE058
Reducing dimension of the convolved ortho-acid, and taking the input numberExtracting data characteristic information by two modules according to the characteristic through convolution dimension increasing to an N channel, dividing each module into two parts to respectively perform convolution operation and attention calculation, and keeping the characteristic size of the image unchanged;
the output results of the two modules are connected together in a characteristic connection mode to obtain data of a 2N-dimensional channel, and then the data are processed by convolution kernel with the size of
Figure 387518DEST_PATH_IMAGE058
Performing convolution operation to reduce dimension to obtain an N channel, combining output data with original data through a residual error structure, forming N and vector neurons through constructing vector neuron operation, and inputting data characteristic information to a digital capsule layer by combining a dynamic routing algorithm to realize classification of power quality to obtain a detection result.
9. The automatic electric energy meter detection system based on image recognition as claimed in claim 1, wherein the automatic electric energy meter detection system further comprises an identity verification unit and a communication unit, the identity verification unit is configured to verify the electric energy meter and the identity of the user when the image acquisition module is started to obtain user identity information, bind the user identity information and the barcode information after the verification is passed, and send the detection result to a user side corresponding to the user identity information through the communication unit.
10. An automatic electric energy meter detection method based on image recognition, which comprises the step of executing the automatic electric energy meter detection system based on image recognition according to any one of claims 1-9, wherein the automatic electric energy meter detection method based on image recognition comprises the following steps:
the method comprises the steps of obtaining an electric energy meter to be tested, photographing to obtain an electric energy meter image, and preprocessing the electric energy meter image to obtain a target electric energy meter image corresponding to the electric energy meter image, wherein the image preprocessing comprises image gray level transformation, image binarization and image filtering;
performing image identification area positioning by adopting horizontal projection and vertical projection according to the target electric energy meter image to determine electric energy meter characteristic information, wherein the electric energy meter characteristic information comprises electric energy meter reading, manufacturer information and bar code information;
and detecting a liquid crystal display and an LED trip lamp of the electric energy meter according to the characteristic information of the electric energy meter, and inputting the detected data into a trained neural network model in combination with the reading of the electric energy meter in a preset period to train so as to obtain a detection result of the electric energy meter.
CN202210989601.4A 2022-08-18 2022-08-18 Electric energy meter automatic detection system and method based on image recognition Pending CN115082776A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210989601.4A CN115082776A (en) 2022-08-18 2022-08-18 Electric energy meter automatic detection system and method based on image recognition

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210989601.4A CN115082776A (en) 2022-08-18 2022-08-18 Electric energy meter automatic detection system and method based on image recognition

Publications (1)

Publication Number Publication Date
CN115082776A true CN115082776A (en) 2022-09-20

Family

ID=83245208

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210989601.4A Pending CN115082776A (en) 2022-08-18 2022-08-18 Electric energy meter automatic detection system and method based on image recognition

Country Status (1)

Country Link
CN (1) CN115082776A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115661098A (en) * 2022-10-31 2023-01-31 河海大学 Submarine pipeline two-dimensional scouring profile image recognition and data extraction method
CN117095389A (en) * 2023-10-19 2023-11-21 南京电力自动化设备三厂有限公司 Image data processing method and system based on liquid crystal visual recognition unit

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102236788A (en) * 2010-04-20 2011-11-09 荣科科技股份有限公司 Kilowatt-hour meter image automatic identification method
CN102298134A (en) * 2010-06-23 2011-12-28 荣科科技股份有限公司 Batch detection method and device for withdrawn electric energy meters

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102236788A (en) * 2010-04-20 2011-11-09 荣科科技股份有限公司 Kilowatt-hour meter image automatic identification method
CN102298134A (en) * 2010-06-23 2011-12-28 荣科科技股份有限公司 Batch detection method and device for withdrawn electric energy meters

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
彭宇: "基于卷积神经网络的电能表液晶屏缺陷检测系统设计", 《硕士电子期刊》 *
蒋鑫源: "电能表图像识别技术研究与实现", 《硕士电子期刊》 *
陈川川: "基于改进VMD与深度学习的电能质量扰动检测与分类研究", 《硕士电子期刊》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115661098A (en) * 2022-10-31 2023-01-31 河海大学 Submarine pipeline two-dimensional scouring profile image recognition and data extraction method
CN115661098B (en) * 2022-10-31 2024-02-06 河海大学 Submarine pipeline two-dimensional scouring profile image recognition and data extraction method
CN117095389A (en) * 2023-10-19 2023-11-21 南京电力自动化设备三厂有限公司 Image data processing method and system based on liquid crystal visual recognition unit
CN117095389B (en) * 2023-10-19 2024-02-06 南京电力自动化设备三厂有限公司 Image data processing method and system based on liquid crystal visual recognition unit

Similar Documents

Publication Publication Date Title
CN109829914B (en) Method and device for detecting product defects
CN107545239B (en) Fake plate detection method based on license plate recognition and vehicle characteristic matching
CN109840521B (en) Integrated license plate recognition method based on deep learning
CN105046252B (en) A kind of RMB prefix code recognition methods
Pan et al. A robust system to detect and localize texts in natural scene images
CN106096610B (en) A kind of file and picture binary coding method based on support vector machines
CN107491730A (en) A kind of laboratory test report recognition methods based on image procossing
CN115082683A (en) Injection molding defect detection method based on image processing
CN107273896A (en) A kind of car plate detection recognition methods based on image recognition
CN115082776A (en) Electric energy meter automatic detection system and method based on image recognition
CN115082419A (en) Blow-molded luggage production defect detection method
CN106529532A (en) License plate identification system based on integral feature channels and gray projection
CN109740572A (en) A kind of human face in-vivo detection method based on partial color textural characteristics
CN104408449A (en) Intelligent mobile terminal scene character processing method
CN108829711B (en) Image retrieval method based on multi-feature fusion
CN113221881B (en) Multi-level smart phone screen defect detection method
CN113240626A (en) Neural network-based method for detecting and classifying concave-convex flaws of glass cover plate
CN107195069A (en) A kind of RMB crown word number automatic identifying method
CN109784341A (en) A kind of medical document recognition methods based on LSTM neural network
CN107578011A (en) The decision method and device of key frame of video
CN115797813B (en) Water environment pollution detection method based on aerial image
CN108509950A (en) Railway contact line pillar number plate based on probability characteristics Weighted Fusion detects method of identification
CN110689003A (en) Low-illumination imaging license plate recognition method and system, computer equipment and storage medium
CN113033558A (en) Text detection method and device for natural scene and storage medium
CN111401364A (en) License plate positioning algorithm based on combination of color features and template matching

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination