Summary of the invention
A kind of insulator semiautomatic extraction method and device based on infrared image provided in an embodiment of the present invention, solves
The surface temperature of current thermal infrared imagery records photographing object, resolution ratio is low, and texture is simple, it is desirable to infrared insulative into
Trip temperature measures, and needs to be automatically positioned the exact position of insulator center line, the larger technical problem of caused difficulty.
A kind of insulator semiautomatic extraction method based on infrared image provided in an embodiment of the present invention, comprising:
It gets in infrared image by capturing the insulator in the rectangle frame containing insulator that sliding trace is chosen
Image;
The edge extracting of rectangular area is carried out to the insulation subgraph;
Straight line traversal is carried out to the insulation subgraph in the rectangular area, and is counted with multiple schemas;
The detection of edge strength period and the screening of cycle stage are carried out to multiple schemas, obtain corresponding period ginseng
Number, and according to the period Statistic features of the corresponding schema of insulator textural characteristics, filtering out corresponding insulator center line can
The energy maximum histogram of property, determines the accurate location of insulator center line.
Optionally, the edge extracting for carrying out rectangular area to the insulation subgraph specifically includes:
Edge extracting is carried out according to Laplace Boundary extracting algorithm to insulator image rectangular area.
Optionally, straight line traversal is carried out to the insulation subgraph in the rectangular area, and with the progress of multiple schemas
Statistics specifically includes:
Straight line traversal is carried out to the insulation subgraph in the rectangular area;
The gray value along the line for counting the insulation subgraph of every line correspondences edge extracting result is recorded as one-dimensional straight
Fang Tu.
Optionally, the gray value along the line of the insulation subgraph of every line correspondences edge extracting result, record are counted
It is specifically included for one dimensional histograms:
Recording direction parallel with x-axis in the insulation subgraph is 0 °, carries out the increase of counter clockwise direction degree, every 1 ° is done
Primary sampling, it is described to sample totally 180 angle directions;
To each angle direction i, a straight line collection Si is all corresponded to, carries out upper translated linear behaviour in the angle direction i
Make, enable Si to cover entire frame favored area, and between parallel lines Si the sampling interval be 1 pixel, it is straight after the completion of traversing
Line universal class is denoted as S=sigma (Si);
To straight line described in each in the straight line universal class S=sigma (Si) after the completion of traversal, and sample pixel-by-pixel
Gray value along the line;
It records along the edge of the insulator image zooming-out and two intersection points of the straight line and the straight line
On every bit gray-scale statistical be the one dimensional histograms.
Optionally, the detection of edge strength period and the screening of cycle stage are carried out to multiple schemas, is corresponded to
Cycle parameter filter out corresponding insulator and according to the period Statistic features of the corresponding schema of insulator textural characteristics
The maximum histogram of center line possibility determines that the accurate location of insulator center line specifically includes:
The edge intensity value computing v that wave crest detection calculates each pixel is carried out each described one dimensional histograms;
Statistical result along the corresponding one dimensional histograms is carried out screening determining wave according to the edge intensity value computing v
Peak, and record the corresponding coordinate value of the wave crest;
The interval between adjacent peaks two-by-two is calculated according to the coordinate value and determines periodic sequence, and records the corresponding period
Parameter;
The cycle parameter is successively screened three times, the screening three times is selected to filter out optimal straight line angle
Optimal straight line under the straight line angle out, finds the periodic regime of the optimal straight line;
According to the accurate location of the positioning insulator center line of screening three times.
A kind of insulator semi-automatic extraction device based on infrared image provided in an embodiment of the present invention, comprising:
Acquiring unit, for getting the rectangle containing insulator chosen in infrared image by capturing sliding trace
Insulation subgraph in frame;
Edge extracting unit, for carrying out the edge extracting of rectangular area to the insulation subgraph;
Statistic unit, for carrying out straight line traversal to the insulation subgraph in the rectangular area, and with multiple figures
Formula is counted;
Determination unit is obtained for carrying out the detection of edge strength period and the screening of cycle stage to multiple schemas
Corresponding cycle parameter is obtained, and according to the period Statistic features of the corresponding schema of insulator textural characteristics, filters out correspondence
The maximum histogram of insulator center line possibility, determines the accurate location of insulator center line.
Optionally, edge extracting unit, specifically for being mentioned to insulator image rectangular area according to the edge Laplace
Algorithm is taken to carry out edge extracting.
Optionally, statistic unit specifically includes:
Subelement is traversed, for carrying out straight line traversal to the insulation subgraph in the rectangular area;
Subelement is counted, the gray scale along the line of the insulation subgraph for counting every line correspondences edge extracting result
Value, is recorded as one dimensional histograms.
Optionally, statistics subelement specifically includes:
First logging modle is 0 ° for recording direction parallel with x-axis in the insulation subgraph, carries out side counterclockwise
U Degree U increases, and every 1 ° is done primary sampling, described to sample totally 180 angle directions;
Straight line universal class module, for a straight line collection Si all being corresponded to, in the angle side to each angle direction i
Upper translated linear operation is carried out to i, Si is enabled to cover entire frame favored area, and the sampling interval is 1 between parallel lines Si
Pixel, the straight line universal class after the completion of traversing are denoted as S=sigma (Si);
Sampling module, for straight described in each in the straight line universal class S=sigma (Si) after the completion of traversal
Line, and the gray value along sampling pixel-by-pixel;
Second logging modle, two friendships at the edge and the straight line for recording the insulator image zooming-out
The gray-scale statistical of every bit on along point and the straight line is the one dimensional histograms.
Optionally it is determined that unit specifically includes:
Computation subunit, for carrying out the side that wave crest detection calculates each pixel each described one dimensional histograms
Edge intensity value v;
Wave crest records subelement, for being counted according to the edge intensity value computing v to along the corresponding one dimensional histograms
As a result it carries out screening determining wave crest, and records the corresponding coordinate value of the wave crest;
Cycle parameter records subelement, and the interval for being calculated between adjacent peaks two-by-two according to the coordinate value determines week
Phase sequence, and record corresponding cycle parameter;
Subelement is screened, for successively being screened three times to the cycle parameter, the screening three times is to filter out most
Excellent straight line angle selects the optimal straight line under the straight line angle, finds the periodic regime of the optimal straight line;
Subelement is determined, for the accurate location according to the positioning insulator center line of screening three times.
As can be seen from the above technical solutions, the embodiment of the present invention has the advantage that
A kind of insulator semiautomatic extraction method and device based on infrared image provided in an embodiment of the present invention, method packet
It includes: getting in infrared image by capturing the insulation subgraph in the rectangle frame containing insulator that sliding trace is chosen;
The edge extracting of rectangular area is carried out to the insulation subgraph;The insulation subgraph in the rectangular area is carried out straight
Line traversal, and counted with multiple schemas;The detections of edge strength period and cycle stage are carried out to multiple schemas
Screening obtains corresponding cycle parameter, and according to the period Statistic features of the corresponding schema of insulator textural characteristics, screening
The maximum histogram of insulator center line possibility is corresponded to out, determines the accurate location of insulator center line.In the present embodiment, lead to
It crosses and gets by capturing the insulation subgraph in the rectangle frame containing insulator that sliding trace is chosen in infrared image, it is right
The insulation subgraph carries out the edge extracting of rectangular area, carries out straight line to the insulation subgraph in the rectangular area
Traversal, and counted with multiple schemas, multiple schemas are carried out with the sieve of the detection of edge strength period and cycle stage
Choosing, obtains corresponding cycle parameter, and according to the period Statistic features of the corresponding schema of insulator textural characteristics, filter out
The corresponding maximum histogram of insulator center line possibility, determines the accurate location of insulator center line, solves current heat
The surface temperature of infrared image records photographing object, resolution ratio is low, and texture is simple, it is desirable to carry out Temperature Quantity to infrared insulative
It surveys, needs to be automatically positioned the exact position of insulator center line, the larger technical problem of caused difficulty.
Specific embodiment
A kind of insulator semiautomatic extraction method and device based on infrared image provided in an embodiment of the present invention, solves
The surface temperature of current thermal infrared imagery records photographing object, resolution ratio is low, and texture is simple, it is desirable to infrared insulative into
Trip temperature measures, and needs to be automatically positioned the exact position of insulator center line, the larger technical problem of caused difficulty.
In order to make the invention's purpose, features and advantages of the invention more obvious and easy to understand, below in conjunction with the present invention
Attached drawing in embodiment, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that disclosed below
Embodiment be only a part of the embodiment of the present invention, and not all embodiment.Based on the embodiments of the present invention, this field
Those of ordinary skill's all other embodiment obtained without making creative work, belongs to protection of the present invention
Range.
Referring to Fig. 1, a kind of insulator semiautomatic extraction method one based on infrared image provided in an embodiment of the present invention
A embodiment includes:
101, it gets exhausted in the rectangle frame containing insulator that sliding trace is chosen by capturing in infrared image
Edge subgraph;
In the present embodiment, when needing the insulator semi-automatic extraction based on infrared image, got first in infrared shadow
By capturing the insulation subgraph in the rectangle frame containing insulator that sliding trace is chosen as in.
It should be noted that above-mentioned capture the rectangle frame containing insulator that sliding trace is chosen to include insulator
Infrared image in manually choose the rectangle frame containing insulator: left mouse button is pressed as starting point, as terminating at release
Point, the subgraph in the rectangle frame is that frame selects result.
102, the edge extracting of rectangular area is carried out to insulation subgraph;
When get in infrared image by capture sliding trace choose the rectangle frame containing insulator in insulation
After subgraph, need to carry out insulation subgraph the edge extracting of rectangular area.
The edge extracting for carrying out rectangular area to insulation subgraph specifically includes:
Edge extracting is carried out according to Laplace Boundary extracting algorithm to insulator image rectangular area.
103, straight line traversal is carried out to the insulation subgraph in rectangular area, and is counted with multiple schemas;
After carrying out the edge extracting of rectangular area to insulation subgraph, need to the insulation subgraph in rectangular area
Straight line traversal is carried out, and is counted with multiple schemas.
Further, straight line traversal is carried out to the insulation subgraph in rectangular area;
The gray value along the line for counting the insulation subgraph of every line correspondences edge extracting result, is recorded as one-dimensional histogram
Figure.
The gray value along the line for counting the insulation subgraph of every line correspondences edge extracting result, is recorded as one dimensional histograms
It specifically includes:
The direction parallel with x-axis is 0 ° in record insulation subgraph, carries out the increase of counter clockwise direction degree, and every 1 ° is done once
Sampling samples totally 180 angle directions;
To each angle direction i, a straight line collection Si is all corresponded to, upper translated linear operation is carried out in angle direction i, makes
Entire frame favored area can be covered by obtaining Si, and the sampling interval is 1 pixel, the straight line complete or collected works after the completion of traversing between parallel lines Si
Conjunction is denoted as S=sigma (Si);
To each straight line in the straight line universal class S=sigma (Si) after the completion of traversal, and the ash along sampling pixel-by-pixel
Angle value;
Record the gray scale of the every bit on along the edge of insulator image zooming-out and two intersection points and straight line of straight line
Statistics is an one dimensional histograms.
104, the detection of edge strength period and the screening of cycle stage are carried out to multiple schemas, obtains corresponding period ginseng
Number, and according to the period Statistic features of the corresponding schema of insulator textural characteristics, filter out corresponding insulator center line possibility
Maximum histogram determines the accurate location of insulator center line.
After carrying out straight line traversal to the insulation subgraph in rectangular area, and counted with multiple schemas, need
The detection of edge strength period and the screening of cycle stage are carried out to multiple schemas, obtain corresponding cycle parameter, and according to exhausted
The period Statistic features of the corresponding schema of edge textural characteristics filter out the corresponding maximum histogram of insulator center line possibility
Figure, determines the accurate location of insulator center line.
It should be noted that carrying out the detection of edge strength period and the screening of cycle stage, acquisition pair to multiple schemas
The cycle parameter answered, and according to the period Statistic features of the corresponding schema of insulator textural characteristics, it filters out in corresponding insulator
The maximum histogram of heart line possibility determines that the accurate location of insulator center line specifically includes:
The edge intensity value computing v that wave crest detection calculates each pixel is carried out to each one dimensional histograms;
Statistical result along corresponding one dimensional histograms is carried out screening determining wave crest according to edge intensity value computing v, and is recorded
The corresponding coordinate value of wave crest;
The interval between adjacent peaks two-by-two is calculated according to coordinate value and determines periodic sequence, and records corresponding period ginseng
Number;
Cycle parameter is successively screened three times, screening selects rectilinear angle to filter out optimal straight line angle three times
Optimal straight line under degree, finds the periodic regime of optimal straight line;
According to the accurate location of screening positioning insulator center line three times.
It is described below with a concrete application scene, please refers to Fig. 3 to 7, application examples includes:
Edge extracting is carried out to frame favored area, extracts the biggish region of grey scale change.The edge extracting that the invention uses is calculated
Method is Laplace edge extracting, and Laplace operator is second order grey scale difference operator, and the Laplace of continuous function F (x, y) is converted
Is defined as:
For discrete digital image, the Laplace of 8 neighborhoods transformation can following convolution algorithm realize:
G (j, k)=F (j, k) * H (j, k)
Wherein, F (j, k) is image original coordinates, and G (j, k) is after converting as a result, H (j, k) is convolution kernel, is indicated are as follows:
By above-mentioned conversion, edge extracting can be realized, extract result schematic diagram and see Fig. 4.
Straight line traversal is carried out to artificial frame favored area, counts the gray scale along the line of every line correspondences edge extracting result figure
Value, is recorded as one dimensional histograms.There is apparent period repeated characteristic at the edge of insulator, and this feature is that background area is no,
Gray-scale statistical is carried out to all straight lines in frame favored area, insulator center line must be period most apparent straight line, borrow
This can distinguish insulator and background.
Specifically, all straightways in selection range are traversed first, guarantees that all straight line set can
Cover entire frame favored area, it is ensured that insulator center line is among above-mentioned straight line set.Traversal mode is as follows:
Remember that the direction parallel with x-axis is 0 °, counter clockwise direction degree increases, and every 1 ° is done primary sampling, totally 180 angle sides
To for each angle direction i, corresponding straight line collection Si, translated linear, enables Si to cover entirely in this direction
Frame favored area, the sampling interval is 1 pixel between parallel lines Si, and the straight line complete or collected works after the completion of traversing are denoted as S=sigma (Si).
Above-mentioned ergodic process may make straight line collection S to cover entire frame favored area.Obviously, insulator center line is that a certain item in S is straight
Line.
After completing traversal, to each straight line in S, the gray value along sampling, the gray scale come from La Pula pixel-by-pixel
This edge extracting result figure indicates the edge strength at the original image pixel.Record starting point, terminal (as frame favored area
Two intersection points at edge and straight line), and along the line on every bit gray scale, by result statistics be an one dimensional histograms, such as
Shown in Fig. 5.The positioning of insulator center line is equivalent in each corresponding histogram of straight line collection S, is found the period and is best suitable for
One, so that it is determined that the accurate location of insulator center line.
To each obtained histogram, the detection of edge strength period and the screening of cycle stage are carried out.I.e. to each
A histogram is detected, and statistics obtains cycle parameter, and counts special according to the insulator textural characteristics corresponding histogram period
Point filters out the corresponding maximum histogram of insulator center line possibility.
Specifically, wave crest detection is carried out to any one histogram first.In Laplce's edge extracting result figure, often
One pixel has all calculated an edge intensity value computing v, which is the statistical value of a non-binaryzation, and edge is significantly
Side, intensity value v are significantly stronger than shoulder around.A threshold value is selected, statistical result along histogram is screened, is filtered
The lower part of intensity value finds local strength highest point, is denoted as wave crest.For each wave crest, its seat on the image is recorded
Mark.Secondly, these wave crest sequences are carried out with the detection in period, specific practice is the interval calculated between adjacent peaks, if gone out
Existing consecutive identical interval, as periodic sequence, cycle detection schematic diagram are as shown in Fig. 6.Record cycle parameter: period weight
Again it counts, two parameters of period distances length.
The corresponding cycle parameter of each histogram is obtained later it is necessary to screen to these parameters, finds and is best suitable for absolutely
One group of histogram of edge subcenter line texture features.Filtering algorithm is divided into three levels, filters out optimal straight line angle first,
Next selects the optimal straight line under the angle, is eventually found the periodic regime of the optimal straight line, can position insulator center line
Accurate location.
1) optimal straight line angle
Deviate the straight line of insulator center line angle or there is no period or cycle times very little;Insulator center line
Direction, cycle times are centainly maximum.Optimal straight line angle can be distinguished by counting each straight line angle maximum cycle number of repetition
Degree;A possibility that straight line angle identical for number of repetition, average period, gap length was smaller, insulator center line, is bigger,
As optimal straight line angle.
2) optimal straight line
It after finding optimal straight line angle, is concentrated in its corresponding parallel lines, centainly there is several adjacent straight line period weights
Again number is very big, finds the flanking sequence, selects most intermediate one, the as corresponding optimal straight line of insulator center line.
3) insulator center line
Finally, find the period range starting point and ending point of the central line, the as definite position of insulator center line
It sets.Testing result schematic diagram is as shown in Figure 7.
In the present embodiment, by getting the square containing insulator chosen in infrared image by capturing sliding trace
Insulation subgraph in shape frame carries out the edge extracting of rectangular area to insulation subgraph, to the insulation subgraph in rectangular area
It as carrying out straight line traversal, and is counted with multiple schemas, the detection of edge strength period and period feelings is carried out to multiple schemas
The screening of condition obtains corresponding cycle parameter, and according to the period Statistic features of the corresponding schema of insulator textural characteristics, screening
The maximum histogram of insulator center line possibility is corresponded to out, determines the accurate location of insulator center line, solves current
The surface temperature of thermal infrared imagery records photographing object, resolution ratio is low, and texture is simple, it is desirable to carry out temperature to infrared insulative
It measures, needs to be automatically positioned the exact position of insulator center line, the larger technical problem of caused difficulty.
Referring to Fig. 2, a kind of insulator semi-automatic extraction device based on infrared image provided in an embodiment of the present invention
One embodiment includes:
Acquiring unit 201, for getting in infrared image by capturing that sliding trace chooses containing insulator
Insulation subgraph in rectangle frame;
Edge extracting unit 202, for carrying out the edge extracting of rectangular area, edge extracting unit to insulation subgraph
202, it is specifically used for carrying out edge extracting according to Laplace Boundary extracting algorithm to insulator image rectangular area;
Statistic unit 203, for carrying out straight line traversal to the insulation subgraph in rectangular area, and with the progress of multiple schemas
Statistics;
Statistic unit 203 specifically includes:
Subelement 2031 is traversed, for carrying out straight line traversal to the insulation subgraph in rectangular area;
Subelement 2032 is counted, the gray scale along the line of the insulation subgraph for counting every line correspondences edge extracting result
Value, is recorded as one dimensional histograms.
Statistics subelement 2032 specifically includes:
First logging modle 2032a is 0 ° for recording direction parallel with x-axis in insulation subgraph, carries out counterclockwise
Direction degree increases, and every 1 ° is done primary sampling, samples totally 180 angle directions;
Straight line universal class module 2032b, for a straight line collection Si all being corresponded to, in angle side to each angle direction i
Upper translated linear operation is carried out to i, Si is enabled to cover entire frame favored area, and the sampling interval is 1 between parallel lines Si
Pixel, the straight line universal class after the completion of traversing are denoted as S=sigma (Si);
Sampling module 2032c, for each straight line in the straight line universal class S=sigma (Si) after the completion of traversal, and
Gray value along sampling pixel-by-pixel;
Second logging modle 2032d, for recording the edge of insulator image zooming-out and two intersection points of straight line, and it is straight
The gray-scale statistical of every bit on along line is an one dimensional histograms.
Determination unit 204 is obtained for carrying out the detection of edge strength period and the screening of cycle stage to multiple schemas
Corresponding cycle parameter, and according to the period Statistic features of the corresponding schema of insulator textural characteristics, filter out corresponding insulator
The maximum histogram of center line possibility, determines the accurate location of insulator center line.
Determination unit 204 specifically includes:
Computation subunit 2041, for carrying out the side that wave crest detection calculates each pixel to each one dimensional histograms
Edge intensity value v;
Wave crest records subelement 2042, is used for according to edge intensity value computing v to statistical result along corresponding one dimensional histograms
It carries out screening determining wave crest, and records the corresponding coordinate value of wave crest;
Cycle parameter records subelement 2043, and the interval for being calculated between adjacent peaks two-by-two according to coordinate value determines week
Phase sequence, and record corresponding cycle parameter;
Subelement 2044 is screened, for successively being screened three times to cycle parameter, screening is optimal to filter out three times
Straight line angle selects the optimal straight line under straight line angle, finds the periodic regime of optimal straight line;
Subelement 2045 is determined, for the accurate location according to screening positioning insulator center line three times.
In the present embodiment, got in infrared image by acquiring unit 201 by capturing containing for sliding trace selection
There is the insulation subgraph in the rectangle frame of insulator, 202 pairs of edge extracting unit insulation subgraphs carry out the edge of rectangular area
It extracts, statistic unit 203 carries out straight line traversal to the insulation subgraph in rectangular area, and is counted with multiple schemas, really
204 pairs of multiple schemas of order member carry out the detection of edge strength period and the screening of cycle stage, obtain corresponding cycle parameter,
And according to the period Statistic features of the corresponding schema of insulator textural characteristics, it is maximum to filter out corresponding insulator center line possibility
Histogram, determine the accurate location of insulator center line, solve the surface of current thermal infrared imagery records photographing object
Temperature, resolution ratio is low, and texture is simple, it is desirable to carry out measuring temp to infrared insulative, need to be automatically positioned insulation subcenter
The exact position of line, the larger technical problem of caused difficulty.
The above, the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although referring to before
Stating embodiment, invention is explained in detail, those skilled in the art should understand that: it still can be to preceding
Technical solution documented by each embodiment is stated to modify or equivalent replacement of some of the technical features;And these
It modifies or replaces, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution.