CN111310573B - Method for identifying pressing plate in image of protection screen cabinet - Google Patents
Method for identifying pressing plate in image of protection screen cabinet Download PDFInfo
- Publication number
- CN111310573B CN111310573B CN202010054414.8A CN202010054414A CN111310573B CN 111310573 B CN111310573 B CN 111310573B CN 202010054414 A CN202010054414 A CN 202010054414A CN 111310573 B CN111310573 B CN 111310573B
- Authority
- CN
- China
- Prior art keywords
- image
- calculating
- screening
- function
- canvas
- 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.)
- Active
Links
- 238000003825 pressing Methods 0.000 title claims abstract description 17
- 238000000034 method Methods 0.000 title claims abstract description 13
- 238000001914 filtration Methods 0.000 claims abstract description 14
- 238000012937 correction Methods 0.000 claims abstract description 12
- 238000012216 screening Methods 0.000 claims description 14
- 230000008859 change Effects 0.000 claims description 4
- 230000000877 morphologic effect Effects 0.000 claims description 3
- 230000001681 protective effect Effects 0.000 claims 1
- 101100534231 Xenopus laevis src-b gene Proteins 0.000 description 5
- 238000007689 inspection Methods 0.000 description 5
- 238000012545 processing Methods 0.000 description 5
- 230000006872 improvement Effects 0.000 description 3
- 230000009466 transformation Effects 0.000 description 3
- 230000001174 ascending effect Effects 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000005260 corrosion Methods 0.000 description 1
- 230000007797 corrosion Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000003628 erosive effect Effects 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/10—Terrestrial scenes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/60—Rotation of whole images or parts thereof
- G06T3/608—Rotation of whole images or parts thereof by skew deformation, e.g. two-pass or three-pass rotation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/20—Image enhancement or restoration using local operators
- G06T5/30—Erosion or dilatation, e.g. thinning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/60—Analysis of geometric attributes
- G06T7/62—Analysis of geometric attributes of area, perimeter, diameter or volume
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/90—Determination of colour characteristics
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/30—Noise filtering
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Geometry (AREA)
- Image Analysis (AREA)
Abstract
The invention provides a method for identifying a pressing plate in a protection cabinet image, which comprises the following steps: s1, acquiring the picture of the protection screen cabinet through the handheld scanning equipment; s2, performing background filtering; s3, performing rotation correction on the picture after background filtering; s4, the platen state after the rotation correction is recognized.
Description
Technical Field
The invention relates to the technical field of electric power system inspection assistance, in particular to a method for identifying a pressing plate in a protection cabinet image.
Background
The number of protection screen cabinets in a 110kv substation is usually 10-20, the number of the protection screen cabinets in 220kv and 500kv substations can reach hundreds, the number of the pressure plate switches of each protection screen cabinet can reach fifty-four, and the pressure plate switches need to be checked in the inspection work. However, in the current manual inspection process, the problems of large workload, poor timeliness, materialization of working recording paper and the like exist, and inspection personnel may make mistakes due to factors such as physical and psychological quality, responsibility, technical level, working experience and the like, so that potential safety hazards are left, and even serious safety disasters are caused. Due to the long-term development of the existing machine vision technology and the existing network technology, the pressing plate part of the protection screen cabinet can be photographed through the camera, then the opening and closing state of the pressing plate is recognized through processing the image through the processor, finally the opening and closing state is checked through the pressing plate on-off table, and the checked result and the photographed picture are stored. However, the prior art has not developed an effective platen state identification method.
Disclosure of Invention
The invention provides a method for identifying a pressing plate in a protection screen cabinet image, which can effectively solve the problems.
The invention is realized by the following steps:
a method for identifying a pressing plate in a protection cabinet image comprises the following steps:
s1, acquiring the picture of the protection screen cabinet through the handheld scanning equipment;
s2, performing background filtering;
s3, performing rotation correction on the picture after background filtering;
s4, the platen state after the rotation correction is recognized.
The invention has the beneficial effects that: 1. the invention utilizes machine vision to identify the pressing plate of the protection screen cabinet, thereby improving the inspection efficiency of an inspector on the protection screen cabinet; 2. according to the invention, the background filtering and the rotation correction are carried out on the picture, and then the pressing plate state identification is carried out, so that the identification accuracy can be improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are required 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 to 23 are process images of background filtering, rotation correction, and platen state identification processing in the platen identification method for protecting a cabinet image according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings of the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all embodiments of the present invention.
Referring to fig. 1 to 23, an embodiment of the present invention provides a method for identifying a pressing plate in a protection cabinet image, including the following steps:
s1, acquiring the picture of the protection screen cabinet through the handheld scanning equipment;
s2, performing background filtering;
s3, performing rotation correction on the picture after background filtering;
s4, the platen state after the rotation correction is recognized.
Referring to fig. 1, in step S2, the step of background filtering the photo includes:
s21, acquiring an S channel in the HSV color space of the input photograph, performing binarization for a threshold value of 80 and a maximum value of 255, and acquiring a picture as shown in fig. 2:
s22, performing morphological operations using morphologyEx function, selecting a rectangle with a kernel size of 9 × 9, performing image opening operations (erosion and then expansion), and obtaining a picture as shown in fig. 3:
opening operation:
img_open=open(img_THR.element)=dilate(erode(img_THR element))
firstly, corrosion:
re-expansion:
s23, finding the contour by using the findContours function, storing all the Contours found, and obtaining the picture as shown in FIG. 4:
Contours=findContours(img_open)。
s24, taking the minimum bounding rectangle bounding rect for each element of the contents, and obtaining a picture as shown in fig. 5:
BoundRects={boundRect|boundRect
=Rect(min(contour.x),min(contour.y),max(contour.x)
-min(contour.x),max(contour.y)-min(contour.y)),contour∈Contours}
s25, calculating the median of all bound Rects (instead of area boundary screening, so that the algorithm is suitable for distribution boards with various pixel sizes), carrying out first screening on each element of bound Rects to define a deviation domain of the bound Rects and screening out TarRects1, as shown in FIG. 6:
the area size set after increasing sorting according to the area size of the bound Rect is terms
terms(BoundRects)=Ascending order(BoundRects.area)
Calculating median of terms
First screening
S26, performing secondary screening on each element limited length-width ratio of the TarRects1 to screen out TarRects2, as shown in FIG. 7;
TarRects2={rect|2*rect.height>rect.width,rect∈TarRects1}。
s27, calculating and normalizing histogram H with calcHist function for each element of TarRect 2, comparing the histogram with the previously prepared red and yellow pressboard templates with the composehist function, limiting the upper limit of score, filtering the non-red and yellow pressboards, and performing a third screening of TarRect3, as shown in fig. 9:
the comparison histogram is as follows:
s28, calculating four corner points for each element of TarRect3, and merging and storing the four corner points into a point container;
s29, taking the minimum bounding rectangle filter _ rect of all the points in the point container, and performing boundary range adjustment, filling the parts outside the area in the input picture with white, to obtain a picture with filtered background, as shown in fig. 10.
As a further improvement, in step S3, the step of performing rotation correction on the photograph includes:
s31, taking the minimum bounding rectangle (minAreaRect) from the picture of the filtered background, and then calculating a two-dimensional box (CvBox2D) to obtain a single rotation angle, as shown in FIG. 11;
the average rotation angle avg _ angle is calculated.
Background filtered three screened platens were lined with the profile under the index:
Contours2={contour|contour=Contours[rect.index],rect∈TarRect3}
average rotation angle:
s32, selecting the larger number of the longer width of the input graphSetting the times as canvas, taking a square with the length and the width as canvas, and filling the gap between the input graph and the canvas with copymakeBorder function to be black, as shown in FIG. 12;
side length of square canvas:
length and width of upper, lower, left and right filling areas:
dx=(canvas_length-img_BGFilter.cols)/2
dy=(canvas_length-img_BGFilter.rows)/2
thus, the canvas after filling:
canvas=Rect(0,0,canvas_length,canvas_length)。
s33, the input graph is rotated by using a warpAffine function, the rotation angle is avg _ angle, and the center of the canvas is recorded as center, as shown in FIG. 13.
The original coordinates (x, y) are transformed into new coordinates (x ', y'), the middle transformation matrix is denoted as M.
The basic formula for transformation of warpAffine,
shift conversion if
x′=x+tx
y′=y+ty
Then
And (4) performing rotation conversion if the rotation angle is theta.
In opencv image processing, all image processing is performed from the origin, the origin of an image is defaulted to be the upper left corner of the image, and when we rotate the image, the center of the image is generally used as the axis, so the following processing is required: the axis is moved to the original point to do rotation transformation, and finally the upper left corner is set as the original point of the image.
src2(x′,y′)=M3 x img_BGFilter(x,y)。
S34, calculating the size of the minimum bounding rectangle img _ Recor of the rotated image, and cutting off redundant frames of the canvas, as shown in FIG. 14:
output img _ Recor length and width:
img_Recor.width=src2.cols*abs(cos(avg_angle))+src2.rows*abs(sin(avg_angle))
img_Recor.height=src2.cols*abs(sin(avg_angle))+src2.rows*abs(cos(avR_angle))
cutting the length and the width of a canvas area:
dx2=(canvas_length-img_Recor.width)/2
dy2=(canvas_length-img_Recor.height)/2
thus, the output img _ Recor:
img_Recor=canvas(dx2,dy2,img_Recor,width,img_Recor.height)。
as a further improvement, in step S4, the step of performing platen state recognition on the photo includes:
S41-S46 are the same as S21-S26, please refer to FIGS. 15-20.
S47, judging the switch state of the pressure plate according to the length-width ratio for each element of Tar curves 2; referring to fig. 21:
opening:
TarRects_on={rect|2*rect.width>rect.height,rect∈TarRects2}
turning off:
TarRects_off={rect|2*rect.width≤rect.height,rect∈TarRects2}。
s48, sorting the x coordinates of each element of the TarRects2 in an increasing mode, calculating the difference of adjacent elements, and converting the difference of adjacent elements into percentage change diff; s339, progressively sorting the y-coordinate of each element of tarreturns 2, calculating the difference between adjacent elements, and converting the difference between adjacent elements into a percentage change diff, please refer to fig. 22 and 23:
and setting a threshold diffVal, and entering the next cluster when diffVal is larger than diffVal.
TarRects2=Ascending order(TarRects2)
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (2)
1. A method for identifying a pressing plate in a protection cabinet image is characterized by comprising the following steps:
s1, acquiring the image of the protection screen cabinet through handheld scanning equipment;
s2, background filtering is carried out on the image, wherein in the step S2: the step of background filtering the image comprises:
s21, acquiring an S channel in an input image HSV color space, and carrying out binarization on a threshold value of 80 and a maximum value of 255;
s22, performing morphological operation by using a morphologoEx function, selecting a rectangle with the size of 9x9 by a kernel, and performing operation on the image;
s23, using findContours function to search contour, storing all contour found;
s24, taking the minimum bounding rectangle for each element of the Contours;
s25, calculating the area median of all bound Rects, carrying out first screening on the deviation domain of each element of the bound Rect, and screening out TarRects 1;
s26, limiting the length-width ratio of each element of the TarRects1, carrying out secondary screening, and screening out TarRects 2;
s27, calculating a histogram H of each element of the TarRects2 by using a calcHist function, normalizing the histogram, comparing the histogram with a red pressing plate template and a yellow pressing plate template which are prepared in advance by using a composeHist function, limiting a score upper limit, filtering non-red pressing plates and yellow pressing plates, and screening the TarRect3 for the third time;
s28, calculating four corner points for each element of TarRect3, and merging and storing the four corner points into a point container;
s29, taking the minimum external rectangle filter _ rect of all the points in the point container, adjusting the boundary range, filling the parts outside the area in the input image into white, and obtaining the image of the filtered background;
s3, performing rotation correction on the image after background filtering;
s4, recognizing the platen state after the rotation correction;
in step S3, the step of performing rotation correction on the background-filtered image includes:
s31, taking the minimum circumscribed rectangle of the image of the filtered background, and then solving the two-dimensional box to obtain a single rotation angle;
s32, selecting the larger number of the length and the width in the input graph multiplied by the number 2 as canvas, taking the square with the length and the width as canvas, and filling the gap between the input graph and the canvas with copy MakeBorder function to be black;
s33, rotating the input graph by using a warpAffine function, wherein the rotating angle is avg _ angle, and the center of the canvas is recorded as center;
s34, calculating the size of the minimum bounding rectangle img _ Recor of the rotated image, and cutting off redundant borders of the canvas.
2. The method for identifying a platen in a protective cabinet image as claimed in claim 1, wherein in step S4, the step of identifying the rotation-corrected platen state comprises:
s41, taking out the S channel in the HSV color space, and carrying out binarization on the threshold value 80 and the maximum value 255;
s42, performing morphological operation by using a morphologoEx function, selecting a rectangle with the size of 9x9 by a kernel, and performing operation on the image;
s43, using findContours function to search contour, storing all contour found;
s44, taking the minimum bounding rectangle for each element of the Contours;
s45, calculating the area median of all bound Rects, and performing first screening on the deviation domain of each element of the bound Rects, so as to screen out TarRects 1;
s46, limiting the length-width ratio of each element of the TarRects1, carrying out secondary screening, and screening out TarRects 2;
s47, judging the switch state of the pressure plate according to the length-width ratio for each element of Tar curves 2;
s48, sorting the x coordinates of each element of the TarRects2 in an increasing mode, calculating the difference of adjacent elements, and converting the difference of adjacent elements into percentage change diff;
s49, sorting the y-coordinate of each element of TarRects2 in increments, calculating the adjacent element differences, and converting the adjacent element differences to a percent change diff.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010054414.8A CN111310573B (en) | 2020-01-17 | 2020-01-17 | Method for identifying pressing plate in image of protection screen cabinet |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010054414.8A CN111310573B (en) | 2020-01-17 | 2020-01-17 | Method for identifying pressing plate in image of protection screen cabinet |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111310573A CN111310573A (en) | 2020-06-19 |
CN111310573B true CN111310573B (en) | 2021-08-10 |
Family
ID=71160043
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010054414.8A Active CN111310573B (en) | 2020-01-17 | 2020-01-17 | Method for identifying pressing plate in image of protection screen cabinet |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111310573B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112949425A (en) * | 2021-02-05 | 2021-06-11 | 广东驰行电力设备有限公司 | Automatic identification method beneficial to improving accuracy of identifying on-off state of pressing plate |
CN113158751B (en) * | 2021-02-05 | 2023-09-19 | 广东驰行电力设备有限公司 | Method for facilitating rapid processing of press plate switch state |
CN117132499B (en) * | 2023-09-07 | 2024-05-14 | 石家庄开发区天远科技有限公司 | Background removing method and device for image recognition |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106952307A (en) * | 2017-03-22 | 2017-07-14 | 广东工业大学 | Sphere orientation method and system in a kind of image |
CN108010026A (en) * | 2017-12-26 | 2018-05-08 | 深圳供电局有限公司 | One kind protection pressing plate state identification method and device |
CN109687382A (en) * | 2018-12-13 | 2019-04-26 | 广东电网有限责任公司 | It is a kind of based on color stencil matching relay-protection pressing plate throwing move back state identification method |
WO2019186583A2 (en) * | 2018-03-26 | 2019-10-03 | Videonetics Technology Private Limited | System and method for automatic real-time localization of license plate of vehicle from plurality of images of the vehicle |
-
2020
- 2020-01-17 CN CN202010054414.8A patent/CN111310573B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106952307A (en) * | 2017-03-22 | 2017-07-14 | 广东工业大学 | Sphere orientation method and system in a kind of image |
CN108010026A (en) * | 2017-12-26 | 2018-05-08 | 深圳供电局有限公司 | One kind protection pressing plate state identification method and device |
WO2019186583A2 (en) * | 2018-03-26 | 2019-10-03 | Videonetics Technology Private Limited | System and method for automatic real-time localization of license plate of vehicle from plurality of images of the vehicle |
CN109687382A (en) * | 2018-12-13 | 2019-04-26 | 广东电网有限责任公司 | It is a kind of based on color stencil matching relay-protection pressing plate throwing move back state identification method |
Non-Patent Citations (2)
Title |
---|
medical image registration based-on points contour and curves;peng wen et al;《2008 international conference on biomedical engineering and informatics 》;20081231;132-136 * |
基于图像处理与形态特征分析的智能变电站保护压板状态识别;付文龙 等;《电力自动化设备》;20191231;第39卷(第7期);203-207 * |
Also Published As
Publication number | Publication date |
---|---|
CN111310573A (en) | 2020-06-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111310573B (en) | Method for identifying pressing plate in image of protection screen cabinet | |
CN111242938A (en) | Automatic checking method for pressing plate state | |
CN102132323B (en) | System and method for automatic image straightening | |
CN109409355B (en) | Novel transformer nameplate identification method and device | |
CN108146093B (en) | Method for removing bill seal | |
CA2650180C (en) | Image binarization using dynamic sub-image division | |
KR101893679B1 (en) | Card number recognition method using deep learnig | |
CN109993161A (en) | A kind of text image rotational correction method and system | |
CN111353961A (en) | Document curved surface correction method and device | |
CN111861866A (en) | Panoramic reconstruction method for substation equipment inspection image | |
CN111242939A (en) | Method for identifying state of pressing plate | |
CN104361335A (en) | Method for automatically removing black edges of scanning images | |
CN116052152A (en) | License plate recognition system based on contour detection and deep neural network | |
CN113569859B (en) | Image processing method and device, electronic equipment and storage medium | |
US9332154B2 (en) | Image binarization using dynamic sub-image division | |
CN111242869A (en) | Method for filtering background of photo | |
CN114037873A (en) | Transformer substation secondary circuit protection pressing plate detection system and method based on artificial intelligence | |
WO2009067022A1 (en) | A method for resolving contradicting output data from an optical character recognition (ocr) system, wherein the output data comprises more than one recognition alternative for an image of a character | |
Rastegar et al. | An intelligent control system using an efficient License Plate Location and Recognition Approach | |
JPS58113941A (en) | Preparing device of printing mask or block copy | |
CN114913370A (en) | State automatic detection method and device based on deep learning and morphology fusion | |
WO2022056875A1 (en) | Method and apparatus for segmenting nameplate image, and computer-readable storage medium | |
Deb et al. | Statistical characteristics in HSI color model and position histogram based vehicle license plate detection | |
CN113610091A (en) | Intelligent identification method and device for air switch state and storage medium | |
CN112215852A (en) | Digital image segmentation method based on cluster learning device integration |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |