CN111310573A - 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
- CN111310573A CN111310573A CN202010054414.8A CN202010054414A CN111310573A CN 111310573 A CN111310573 A CN 111310573A CN 202010054414 A CN202010054414 A CN 202010054414A CN 111310573 A CN111310573 A CN 111310573A
- Authority
- CN
- China
- Prior art keywords
- boundrects
- image
- pressing plate
- calculating
- screening
- 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.)
- Granted
Links
- 238000003825 pressing Methods 0.000 title claims abstract description 19
- 238000000034 method Methods 0.000 title claims abstract description 15
- 238000001914 filtration Methods 0.000 claims abstract description 16
- 238000012937 correction Methods 0.000 claims abstract description 12
- 238000012216 screening Methods 0.000 claims description 12
- 230000008859 change Effects 0.000 claims description 4
- 230000000877 morphologic effect Effects 0.000 claims description 3
- 230000001681 protective effect Effects 0.000 claims 2
- 238000007689 inspection Methods 0.000 description 5
- 238000012545 processing Methods 0.000 description 5
- 101100534231 Xenopus laevis src-b gene Proteins 0.000 description 4
- 230000006872 improvement Effects 0.000 description 3
- 230000009466 transformation Effects 0.000 description 3
- 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
- 241000872198 Serjania polyphylla Species 0.000 description 1
- 230000001174 ascending effect Effects 0.000 description 1
- 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:
BoundRocts={boundRect|boundRect
=Rect(min(contour.x),min(contour.y)max(contour.x)
-min(contour.x),max(contour.y)-mincontour.y))contour∈Contoirs}。
s25, calculating the median of the area of all BoundRects (instead of area boundary filtering, so that the algorithm is suitable for distribution boards with various pixel sizes), and performing first filtering on each element of BoundRects to define a deviation domain of BoundRects and the BoundRects to screen out TarRects1, as shown in FIG. 6:
the area size set after the area size increasing sorting according to BoundRects 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∈TarRests1}。
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 region rectangle (minareaRect) from the background-filtered photograph, and then finding the 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 square as canvas, inputting the gap between the drawing and the canvasFill in black with copyMakeBorder function, as shown in fig. 12;
side length of square canvas:
length and width of upper, lower, left and right filling areas:
dx=(convos_longth-img_BGFitor,cols)/2
dy=(canvaslength-img_BGFilter,row8)/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
xt=x+tx
γ′=γ+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′)=M3xlmg_BGFllter(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,cola*aba(cos(avg_angle))+src2,rows*abs(sin(avg_angle))img_Recor,height=src2,cols*abs(sin(avg_angle))+arc2,rows*abs(cos(avg_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.widtb,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:
TarRect8_off={rect|2*rect,wldth≤rect,heightrect∈TarRect2}。
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, sorting the y coordinate of each element of tarreturns 2 in an increasing manner, calculating the difference between adjacent elements, and converting the difference 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=Ascendingorder(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 (4)
1. A method for identifying a pressing plate in a protection cabinet image is characterized by comprising 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.
2. The method for identifying a platen in a protective cabinet image as claimed in claim 1, wherein in step S2, the step of background filtering the photo comprises:
s21, acquiring an S channel in an HSV color space of the input photo, 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 median of the areas of all BoundRects, limiting a deviation domain of each element of the BoundRects and carrying out first screening on the BoundRects and the deviation domain of the BoundRects, 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;
and S29, taking the minimum circumscribed rectangle filter _ rect of all the points in the point container, adjusting the boundary range, and filling the parts outside the area in the input picture into white to obtain the picture with the filtered background.
3. The method for identifying a platen in a protective cabinet image as claimed in claim 1, wherein in step S3, the step of performing rotation correction on the photo comprises:
s31, taking the minimum area rectangle from the picture of the filtered background, and then solving a two-dimensional box to obtain a single rotation angle;
s32, selecting the larger number of the longer width of the input graphSetting the times as canvas, using a square with the length and the width as canvas, and utilizing copyMakeBorder function to the gap between the input graph and the canvasFilling 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.
4. The method for identifying a pressing plate in a protection cabinet image according to claim 1, wherein in step S4, the step of identifying the pressing plate state of the photo 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 median of the areas of all BoundRects, limiting a deviation domain of each element of the BoundRects and carrying out first screening on the BoundRects and the deviation domain of the BoundRects, and screening 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 differences to a percentage 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 true CN111310573A (en) | 2020-06-19 |
CN111310573B 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) |
Cited By (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 |
CN113158751A (en) * | 2021-02-05 | 2021-07-23 | 广东驰行电力设备有限公司 | Method for conveniently and rapidly processing on-off state of pressing plate |
CN117132499A (en) * | 2023-09-07 | 2023-11-28 | 石家庄开发区天远科技有限公司 | 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 |
---|
PENG WEN ET AL: "medical image registration based-on points contour and curves", 《2008 INTERNATIONAL CONFERENCE ON BIOMEDICAL ENGINEERING AND INFORMATICS 》 * |
付文龙 等: "基于图像处理与形态特征分析的智能变电站保护压板状态识别", 《电力自动化设备》 * |
Cited By (5)
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 |
CN113158751A (en) * | 2021-02-05 | 2021-07-23 | 广东驰行电力设备有限公司 | Method for conveniently and rapidly processing on-off state of pressing plate |
CN113158751B (en) * | 2021-02-05 | 2023-09-19 | 广东驰行电力设备有限公司 | Method for facilitating rapid processing of press plate switch state |
CN117132499A (en) * | 2023-09-07 | 2023-11-28 | 石家庄开发区天远科技有限公司 | Background removing method and device for image recognition |
CN117132499B (en) * | 2023-09-07 | 2024-05-14 | 石家庄开发区天远科技有限公司 | Background removing method and device for image recognition |
Also Published As
Publication number | Publication date |
---|---|
CN111310573B (en) | 2021-08-10 |
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 | |
CN104156704A (en) | Novel license plate identification method and system | |
CN111284154A (en) | Seal control machine seal control method, device and system based on image recognition | |
CN104851085A (en) | Method and system automatically obtaining detection zone in image | |
CN108133216A (en) | The charactron Recognition of Reading method that achievable decimal point based on machine vision is read | |
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 | |
CN112419260A (en) | PCB character area defect detection method | |
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 | |
CN115588208A (en) | Full-line table structure identification method based on digital image processing technology | |
US9332154B2 (en) | Image binarization using dynamic sub-image division | |
CN113569859B (en) | Image processing method and device, electronic equipment and storage medium | |
CN112348019B (en) | Answer sheet correction method and device, electronic equipment and storage medium | |
CN111242869A (en) | Method for filtering background of photo | |
Rastegar et al. | An intelligent control system using an efficient License Plate Location and Recognition Approach | |
CN112308848A (en) | Method and system for identifying state of baffle plate of scrap steel truck, electronic equipment and medium | |
CN114926635B (en) | Target segmentation method in multi-focus image combined with deep learning method | |
CN110619331A (en) | Color distance-based color image field positioning method |
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 |