The content 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, its resolution are low, and texture is simple, it is desirable to which infrared insulative is entered
Trip temperature is measured, and needs to be automatically positioned the exact position of insulator centrage, 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, including:
Get in infrared image by catching 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 subimage;
The insulation subimage in the rectangular area carries out straight line traversal, and is counted with multiple schemas;
Multiple schemas are carried out with the detection of edge strength cycle and the screening of cycle stage, corresponding cycle ginseng is obtained
Number, and according to the cycle Statistic features of the corresponding schema of insulator textural characteristics, filtering out correspondence insulator centrage can
The maximum rectangular histogram of energy property, determines the accurate location of insulator centrage.
Alternatively, the edge extracting that the insulation subimage carries out rectangular area is specifically included:
Edge extracting is carried out according to Laplace Boundary extracting algorithms to the insulator image rectangular area.
Alternatively, to the rectangular area in the insulation subimage carry out straight line traversal, and carried out with multiple schemas
Statistics is specifically included:
The insulation subimage in the rectangular area carries out straight line traversal;
The gray value along the line of the insulation subimage of every line correspondences edge extracting result of statistics, is recorded as one-dimensional straight
Fang Tu.
Alternatively, the gray value along the line of the insulation subimage of every line correspondences edge extracting result, record are counted
Specifically include for one dimensional histograms:
In recording the insulation subimage, the direction parallel with x-axis is 0 °, carries out counter clockwise direction number of degrees increase, does per 1 °
Once sample, totally 180 angle directions of sampling;
To each angle direction i, a straight line collection Si is all corresponded to, translated linear behaviour is carried out in the angle direction i
Make so that Si can cover whole frame favored area, and the sampling interval is 1 pixel between parallel lines Si, straight after the completion of traversal
Line universal class is designated as S=sigma (Si);
The each straight line in straight line universal class S=sigma (Si) after the completion of to traversal, and sample pixel-by-pixel
Gray value along the line;
The edge of the insulator image zooming-out and two intersection points of the straight line are recorded, and the straight line is along the line
On every bit gray-scale statistical be the one dimensional histograms.
Alternatively, the detection of edge strength cycle and the screening of cycle stage are carried out to multiple schemas, is corresponded to
Cycle parameter, and according to the cycle Statistic features of the corresponding schema of insulator textural characteristics, filter out correspondence insulator
The maximum rectangular histogram of centrage probability, determines that the accurate location of insulator centrage is specifically included:
One dimensional histograms each described are carried out with edge intensity value computing v that crest detection calculates each pixel;
Screening is carried out to the statistical result along the line of the corresponding one dimensional histograms according to edge intensity value computing v and determines ripple
Peak, and record the corresponding coordinate figure of the crest;
The interval two-by-two between adjacent peaks is calculated according to the coordinate figure and determines periodic sequence, and record the corresponding cycle
Parameter;
Carry out three screenings to the cycle parameter successively, three screenings are selected for filtering out the straight line angle of optimum
The optimal straight line gone out under the straight line angle, finds the periodic regime of the optimal straight line;
According to the accurate location of described three times screening positioning insulator centrages.
A kind of insulator semi-automatic extraction device based on infrared image provided in an embodiment of the present invention, including:
Acquiring unit, for getting in infrared image by catching the rectangle containing insulator that sliding trace is chosen
Insulation subimage in frame;
Edge extracting unit, for carrying out the edge extracting of rectangular area to the insulation subimage;
Statistic unit, carries out straight line traversal for the insulation subimage in the rectangular area, and with multiple figures
Formula is counted;
Determining unit, for carrying out the detection of edge strength cycle and the screening of cycle stage to multiple schemas, obtains
Corresponding cycle parameter is obtained, and according to the cycle Statistic features of the corresponding schema of insulator textural characteristics, filters out correspondence
The maximum rectangular histogram of insulator centrage probability, determines the accurate location of insulator centrage.
Alternatively, edge extracting unit, specifically for carrying according to Laplace edges to the insulator image rectangular area
Taking algorithm carries out edge extracting.
Alternatively, statistic unit is specifically included:
Traversal subelement, carries out straight line traversal for the insulation subimage in the rectangular area;
Statistics subelement, for counting the gray scale along the line of the insulation subimage of every line correspondences edge extracting result
Value, is recorded as one dimensional histograms.
Alternatively, count subelement to specifically include:
First logging modle, is 0 ° for recording the direction parallel with x-axis in the insulation subimage, carries out side counterclockwise
U Degree U increases, and does per 1 ° and once samples, totally 180 angle directions of sampling;
Straight line universal class module, for each angle direction i, all corresponding to a straight line collection Si, in the angle side
Upper translated linear operation is carried out to i so that Si can cover whole frame favored area, and the sampling interval is 1 between parallel lines Si
Pixel, the straight line universal class after the completion of traversal are designated as S=sigma (Si);
Sampling module is described straight for each in straight line universal class S=sigma (Si) after the completion of to traversal
Line, and gray value along the line of sampling pixel-by-pixel;
Second logging modle, for recording two friendships at the edge of the insulator image zooming-out and the straight line
Point, and the straight line it is along the line on every bit gray-scale statistical be the one dimensional histograms.
Optionally it is determined that unit is specifically included:
Computation subunit, calculates the side of each pixel for one dimensional histograms each described are carried out with crest detection
Edge intensity level v;
Crest records subelement, for being counted to the corresponding one dimensional histograms along the line according to edge intensity value computing v
As a result carry out screening and determine crest, and record the corresponding coordinate figure of the crest;
Cycle parameter records subelement, and the interval for being calculated two-by-two between adjacent peaks according to the coordinate figure determines week
Phase sequence, and record corresponding cycle parameter;
Screening subelement, for carrying out three screenings to the cycle parameter successively, three screenings are 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;
Determination subelement, for the accurate location according to described three times screening positioning insulator centrages.
As can be seen from the above technical solutions, the embodiment of the present invention has advantages below:
A kind of insulator semiautomatic extraction method and device based on infrared image provided in an embodiment of the present invention, method bag
Include:Get in infrared image by catching the insulation subimage in the rectangle frame containing insulator that sliding trace is chosen;
The edge extracting of rectangular area is carried out to the insulation subimage;The insulation subimage in the rectangular area is carried out directly
Line is traveled through, and is counted with multiple schemas;Multiple schemas are carried out with the detection of edge strength cycle and cycle stage
Screening, obtains corresponding cycle parameter, and according to the cycle Statistic features of the corresponding schema of insulator textural characteristics, screening
Go out the maximum rectangular histogram of correspondence insulator centrage probability, determine the accurate location of insulator centrage.In the present embodiment, lead to
Cross and get by catching the insulation subimage in the rectangle frame containing insulator that sliding trace is chosen in infrared image, it is right
The insulation subimage carries out the edge extracting of rectangular area, to the rectangular area in the insulation subimage carry out straight line
Traversal, and counted with multiple schemas, the sieve of the detection of edge strength cycle and cycle stage is carried out to multiple schemas
Choosing, obtains corresponding cycle parameter, and according to the cycle Statistic features of the corresponding schema of insulator textural characteristics, filters out
The maximum rectangular histogram of correspondence insulator centrage probability, determines the accurate location of insulator centrage, solves current heat
The surface temperature of infrared image records photographing object, its resolution are low, and texture is simple, it is desirable to carry out Temperature Quantity to infrared insulative
Survey, need to be automatically positioned the exact position of insulator centrage, 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, its resolution are low, and texture is simple, it is desirable to which infrared insulative is entered
Trip temperature is measured, and needs to be automatically positioned the exact position of insulator centrage, the larger technical problem of caused difficulty.
For enabling goal of the invention of the invention, feature, advantage more obvious and understandable, below in conjunction with the present invention
Accompanying drawing in embodiment, is clearly and completely described to the technical scheme in the embodiment of the present invention, it is clear that disclosed below
Embodiment be only a part of embodiment of the invention, and not all embodiment.Based on the embodiment in the present invention, this area
All other embodiment that those of ordinary skill is obtained under the premise of creative work is not made, belongs to protection of the present invention
Scope.
Refer to Fig. 1, a kind of insulator semiautomatic extraction method one based on infrared image provided in an embodiment of the present invention
Individual embodiment includes:
101st, get exhausted in the rectangle frame containing insulator that sliding trace is chosen by catching in infrared image
Edge subimage;
In the present embodiment, when the insulator semi-automatic extraction based on infrared image is needed, got in infrared shadow first
By catching the insulation subimage in the rectangle frame containing insulator that sliding trace is chosen as in.
It should be noted that the aforesaid rectangle frame containing insulator for catching sliding trace selection is comprising insulator
Infrared image in artificial choose the rectangle frame containing insulator:Left mouse button is pressed as starting point, as termination at release
Point, the subimage of the rectangle inframe are frame and select result.
102nd, the edge extracting of rectangular area is carried out to the subimage that insulate;
Insulation in the rectangle frame containing insulator chosen by seizure sliding trace in infrared image is got
After subimage, need to carry out the subimage that insulate the edge extracting of rectangular area.
The edge extracting that the subimage that insulate carries out rectangular area is specifically included:
Edge extracting is carried out according to Laplace Boundary extracting algorithms to insulator image rectangular area.
103rd, straight line traversal is carried out to the insulation subimage in rectangular area, and is counted with multiple schemas;
After the edge extracting of rectangular area is carried out to the subimage that insulate, need to the insulation subimage 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 subimage in rectangular area;
The gray value along the line of the insulation subimage of every line correspondences edge extracting result of statistics, is recorded as one-dimensional Nogata
Figure.
The gray value along the line of the insulation subimage of every line correspondences edge extracting result of statistics, is recorded as one dimensional histograms
Specifically include:
In record insulation subimage, the direction parallel with x-axis is 0 °, carries out counter clockwise direction number of degrees increase, does once per 1 °
Sampling, totally 180 angle directions of sampling;
To each angle direction i, a straight line collection Si is all corresponded to, translated linear operation, makes on angle direction i is carried out
Si can cover whole frame favored area, and between parallel lines Si, the sampling interval is 1 pixel, the straight line complete or collected works after the completion of traversal
Conjunction is designated as S=sigma (Si);
To in straight line universal class S=sigma (Si) after the completion of traversal per straight line, and ash along the line of sampling pixel-by-pixel
Angle value;
Record the edge of insulator image zooming-out and two intersection points of straight line, and straight line it is along the line on every bit gray scale
Count as one dimensional histograms.
104th, multiple schemas are carried out with the detection of edge strength cycle and the screening of cycle stage, corresponding cycle ginseng is obtained
Number, and according to the cycle Statistic features of the corresponding schema of insulator textural characteristics, filter out correspondence insulator centrage probability
Maximum rectangular histogram, determines the accurate location of insulator centrage.
Insulation subimage in rectangular area carries out straight line traversal, and after being counted with multiple schemas, needs
Multiple schemas are carried out with the detection of edge strength cycle and the screening of cycle stage, corresponding cycle parameter is obtained, and according to exhausted
The cycle Statistic features of the corresponding schema of edge textural characteristics, filter out the maximum Nogata of correspondence insulator centrage probability
Figure, determines the accurate location of insulator centrage.
It should be noted that, multiple schemas are carried out with the detection of edge strength cycle and the screening of cycle stage, it is right to obtain
The cycle parameter answered, and according to the cycle Statistic features of the corresponding schema of insulator textural characteristics, filter out in correspondence insulator
The maximum rectangular histogram of heart line probability, determines that the accurate location of insulator centrage is specifically included:
Each one dimensional histograms are carried out with edge intensity value computing v that crest detection calculates each pixel;
Screening is carried out according to edge intensity value computing v to the statistical result along the line of corresponding one dimensional histograms and determines crest, and recorded
The corresponding coordinate figure of crest;
The interval two-by-two between adjacent peaks is calculated according to coordinate figure and determines periodic sequence, and record corresponding cycle ginseng
Number;
Carry out three screenings to cycle parameter successively, three screenings select rectilinear angle for filtering out the straight line angle of optimum
Optimal straight line under degree, finds the periodic regime of optimal straight line;
According to the accurate location of three screening positioning insulator centrages.
It is described with a concrete application scene below, refers to Fig. 3 to 7, application examples includes:
Edge extracting is carried out to frame favored area, extracts the larger region of grey scale change.The edge extracting that the invention is adopted is calculated
Method is Laplace edge extractings, and Laplace operators are second order grey scale difference operator, and the Laplace of continuous function F (x, y) is converted
It is defined as:
For discrete digital image, the Laplace conversion of 8 neighborhoods can following convolution algorithm realization:
G (j, k)=F (j, k) * H (j, k)
Wherein, F (j, k) is image original coordinates, and G (j, k) is the result after conversion, and H (j, k) is convolution kernel, is expressed as:
By above-mentioned conversion, you can realize edge extracting, 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 obvious cycle repeated characteristic at the edge of insulator, and this feature is that background area does not have,
All straight lines in frame favored area are carried out with gray-scale statistical, insulator centrage must be cycle most obvious straight line, borrow
This can make a distinction insulator and background.
Specifically, first all straightways in selection range are traveled through, it is ensured that all of straight line set can
Cover whole frame favored area, it is ensured that insulator centrage is among above-mentioned straight line set.Traversal mode is as follows:
The note direction parallel with x-axis is 0 °, and the counter clockwise direction number of degrees increase, and do per 1 ° and once sample, totally 180 angle sides
To, for each angle direction i, a straight line collection Si all corresponding to, translated linear, enables Si to cover entirely in this direction
Frame favored area, between parallel lines Si, the sampling interval is 1 pixel, and the straight line complete or collected works after the completion of traversal are designated as S=sigma (Si).
Above-mentioned ergodic process, can cause straight line collection S to cover whole frame favored area.Obviously, insulator centrage is that a certain bar in S is straight
Line.
After completing traversal, to every straight line, gray value along the line of sampling pixel-by-pixel in S, the gray scale is from La Pula
This edge extracting result figure, represents the edge strength at the original image pixel.Record starting point, terminal (as frame favored area
Two intersection points of edge and straight line), and it is along the line on every bit gray scale, be one dimensional histograms by result statistics, such as
Shown in Fig. 5.The positioning of insulator centrage, is equivalent in corresponding each rectangular histogram of straight line collection S, and the cycle of finding best suits
One, so that it is determined that the accurate location of insulator centrage.
To each rectangular histogram for obtaining, the detection of edge strength cycle and the screening of cycle stage is carried out.I.e. to each
Individual rectangular histogram is detected that statistics obtains cycle parameter, and special according to the corresponding rectangular histogram cycle statistics of insulator textural characteristics
Point, filters out the maximum rectangular histogram of correspondence insulator centrage probability.
Specifically, crest detection is carried out to any one rectangular histogram first.In Laplce's edge extracting result figure, often
One pixel has all calculated edge intensity value computing v, and the intensity level is the statistical value of a non-binaryzation, and edge is significantly
Side, intensity level v are significantly stronger than shoulder around.A threshold value is selected, rectangular histogram statistical result along the line is screened, is filtered
The relatively low part of intensity level, finds local strength's peak, is designated as crest.For each crest, its seat on image is recorded
Mark.Secondly, these crest sequences are entered with the detection of line period, specific practice is to calculate the interval between adjacent peaks, if gone out
Existing consecutive identical interval, as periodic sequence, cycle detection schematic diagram is as shown in Figure 6.Record cycle parameter:Cycle weight
Again count, two parameters of period distances length.
The corresponding cycle parameter of each rectangular histogram is obtained later it is necessary to screen to these parameters, is found and is best suited absolutely
One group of rectangular histogram of edge subcenter line texture features.Filtering algorithm is divided into three levels, filters out the straight line angle of optimum first,
Next selects the optimal straight line under the angle, is eventually found the periodic regime of the optimal straight line, you can positioning insulator centrage
Accurate location.
1) optimal straight line angle
Deviate the straight line of insulator centrage angle, or no cycle, or cycle times very little;Insulator centrage
Direction, cycle times are necessarily maximum.Optimal straight line angle can be distinguished by counting each straight line angle maximum cycle number of repetition
Degree;For number of repetition identical straight line angle, average period, gap length was less, and the probability of insulator centrage is bigger,
As optimal straight line angle.
2) optimal straight line
After finding optimal straight line angle, concentrate in its corresponding parallel lines, necessarily there are several adjacent straight line cycle weights
Again number is very big, finds the flanking sequence, selects most middle one, the as corresponding optimal straight line of insulator centrage.
3) insulator centrage
Finally, the period range starting point and ending point of the central line, the as definite position of insulator centrage are found
Put.Testing result schematic diagram is as shown in Figure 7.
In the present embodiment, by getting in infrared image by catching the square containing insulator that sliding trace is chosen
Insulation subimage in shape frame, carries out the edge extracting of rectangular area to the subimage that insulate, to the insulation subgraph in rectangular area
As carrying out straight line traversal, and counted with multiple schemas, multiple schemas are carried out with the detection of edge strength cycle and cycle feelings
The screening of condition, obtains corresponding cycle parameter, and according to the cycle Statistic features of the corresponding schema of insulator textural characteristics, screening
Go out the maximum rectangular histogram of correspondence insulator centrage probability, determine the accurate location of insulator centrage, solve current
The surface temperature of thermal infrared imagery records photographing object, its resolution are low, and texture is simple, it is desirable to enter trip temperature to infrared insulative
Measure, need to be automatically positioned the exact position of insulator centrage, the larger technical problem of caused difficulty.
Fig. 2 is referred to, 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 catching that sliding trace chooses containing insulator
Insulation subimage in rectangle frame;
Edge extracting unit 202, for carrying out the edge extracting of rectangular area, edge extracting unit to the subimage that insulate
202, specifically for carrying out edge extracting to insulator image rectangular area according to Laplace Boundary extracting algorithms;
Statistic unit 203, for carrying out straight line traversal to the insulation subimage in rectangular area, and is carried out with multiple schemas
Statistics;
Statistic unit 203 is specifically included:
Traversal subelement 2031, for carrying out straight line traversal to the insulation subimage in rectangular area;
Statistics subelement 2032, for counting the gray scale along the line of the insulation subimage of every line correspondences edge extracting result
Value, is recorded as one dimensional histograms.
Statistics subelement 2032 is specifically included:
First logging modle 2032a, is 0 ° for recording direction parallel with x-axis in insulation subimage, carries out counterclockwise
The direction number of degrees increase, and do per 1 ° and once sample, totally 180 angle directions of sampling;
Straight line universal class module 2032b, for each angle direction i, all corresponding to a straight line collection Si, in angle side
Upper translated linear operation is carried out to i so that Si can cover whole frame favored area, and the sampling interval is 1 between parallel lines Si
Pixel, the straight line universal class after the completion of traversal are designated as S=sigma (Si);
Sampling module 2032c, in straight line universal class S=sigma (Si) after the completion of traversal per straight line, and
Sample pixel-by-pixel gray value along the line;
Second logging modle 2032d, for recording the edge of insulator image zooming-out and two intersection points of straight line, and directly
The gray-scale statistical of the every bit on line is along the line is one dimensional histograms.
Determining unit 204, for multiple schemas are carried out with the detection of edge strength cycle and the screening of cycle stage, obtains
Corresponding cycle parameter, and according to the cycle Statistic features of the corresponding schema of insulator textural characteristics, filter out correspondence insulator
The maximum rectangular histogram of centrage probability, determines the accurate location of insulator centrage.
Determining unit 204 is specifically included:
Computation subunit 2041, calculates the side of each pixel for each one dimensional histograms are carried out with crest detection
Edge intensity level v;
Crest record subelement 2042, for according to edge intensity value computing v to the statistical result along the line of corresponding one dimensional histograms
Carry out screening and determine crest, and record the corresponding coordinate figure of crest;
Cycle parameter records subelement 2043, and the interval for being calculated two-by-two between adjacent peaks according to coordinate figure determines week
Phase sequence, and record corresponding cycle parameter;
Screening subelement 2044, for carrying out three screenings to cycle parameter successively, three screenings are to filter out optimum
Straight line angle, selects the optimal straight line under straight line angle, finds the periodic regime of optimal straight line;
Determination subelement 2045, for the accurate location according to three screening positioning insulator centrages.
In the present embodiment, got in infrared image by catching containing for sliding trace selection by acquiring unit 201
The insulation subimage having in the rectangle frame of insulator, 202 pairs of insulation subimages of edge extracting unit carry out the edge of rectangular area
Extract, statistic unit 203 carries out straight line traversal to the insulation subimage in rectangular area, and is counted with multiple schemas, really
204 pairs of multiple schemas of order unit carry out the detection of edge strength cycle and the screening of cycle stage, obtain corresponding cycle parameter,
And according to the cycle Statistic features of the corresponding schema of insulator textural characteristics, filter out correspondence insulator centrage probability maximum
Rectangular histogram, determine the accurate location of insulator centrage, solve the surface of current thermal infrared imagery records photographing object
Temperature, its resolution are 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, above example only to illustrate technical scheme, rather than a limitation;Although with reference to front
State embodiment to be described in detail the present invention, it will be understood by those within the art that:Which still can be to front
State the technical scheme described in each embodiment to modify, or equivalent is carried out to which part technical characteristic;And these
Modification is replaced, and does not make the essence of appropriate technical solution depart from the spirit and scope of various embodiments of the present invention technical scheme.