CN110288624A - Detection method, device and the relevant device of straightway in a kind of image - Google Patents
Detection method, device and the relevant device of straightway in a kind of image Download PDFInfo
- Publication number
- CN110288624A CN110288624A CN201910577980.4A CN201910577980A CN110288624A CN 110288624 A CN110288624 A CN 110288624A CN 201910577980 A CN201910577980 A CN 201910577980A CN 110288624 A CN110288624 A CN 110288624A
- Authority
- CN
- China
- Prior art keywords
- straightway
- gradient
- image
- line segment
- detection
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
-
- 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10024—Color image
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Geometry (AREA)
- Image Analysis (AREA)
Abstract
This application discloses a kind of detection methods of straightway in image, including when receiving image to be detected, carry out gradient calculating to described image to be detected according to gradient of vector method, obtain the gradient amplitude and gradient direction of each pixel;Edge detection is carried out to described image to be detected by default edge detection algorithm, obtains each edge line segment;Link processing or division processing are carried out to each edge line segment in conjunction with the gradient amplitude and gradient direction of each pixel, obtain each candidate straightway;Each candidate straightway is screened according to default screening rule, obtains straightway;The detection method of straightway can directly detect the straightway of color image in the image, effectively prevent the problem of straightway loss or inaccuracy caused by converting due to image grayscale.Disclosed herein as well is detection device, system and the computer readable storage mediums of straightway in a kind of image, all have above-mentioned beneficial effect.
Description
Technical field
This application involves technical field of image detection, in particular to the detection method of straightway, further relates in a kind of image
Detection device, system and the computer readable storage medium of straightway in a kind of image.
Background technique
Line segment detection is a underlying issue in computer vision, in remote Sensing Image Analysis, images match, end point
It is widely used in the tasks such as detection and object detection.Straightway is generally present on the edge of culture, it comprises
Basic geological information and topology information in scene can provide key message to further understand and analyzing image.
Currently, having considerable research achievement in line segment detection field, some mainstream algorithms are in recall rate, accurate rate
All has good performance with time complexity etc..However, people are solving since early stage calculates the limitation of equipment performance
Gray level image is usually only considered when image analysis and understanding task, this way continues into the present, and is also in terms of line segment detection
In this way, existing line segment detection algorithm is for gray level image come design and implementation.Even if we can use at this stage
Very low cost obtains color image, and convention way is still to convert thereof into gray level image to carry out line segment detection again.
But but often there is the problem of missing inspection or false retrieval in the line segment detection algorithm based on grayscale image.Specifically, right
In a width color image, the presence of straightway can be expressed between object and background by heterochromia, but in image grayscale
Different colors may correspond to same or similar gray scale after change, may partially be thrown with color come the image information expressed
It abandons, to cause the loss or remitted its fury of straightway.Occur in addition, the missing of color also results in the straightway being detected
The problems such as endpoint location inaccuracy and discontinuous line segment, so as to cause unsatisfied detection effect.
Therefore, how the straightway of color image is effectively detected, is avoided straight caused by being converted due to image grayscale
Line segment is lost or the problem of inaccuracy is those skilled in the art's urgent problem to be solved.
Summary of the invention
The purpose of the application is to provide a kind of detection method of straightway in image, the detection method of straightway in the image
Directly the straightway of color image can be detected, effectively prevent due to image grayscale convert caused by straightway lose or
The problem of inaccuracy;The another object of the application is to provide detection device, system and the computer of straightway in a kind of image
Readable storage medium storing program for executing, it may have above-mentioned beneficial effect.
In order to solve the above technical problems, this application provides a kind of detection method of straightway in image, in described image
The detection method of straightway includes:
When receiving image to be detected, gradient calculating is carried out to described image to be detected according to gradient of vector method, is obtained
The gradient amplitude and gradient direction of each pixel;
Edge detection is carried out to described image to be detected by default edge detection algorithm, obtains each edge line segment;
Gradient amplitude and gradient direction in conjunction with each pixel carry out link processing to each edge line segment or divide
Processing is split, each candidate straightway is obtained;
Each candidate straightway is screened according to default screening rule, obtains straightway.
Preferably, described that gradient calculating is carried out to described image to be detected according to gradient of vector method, obtain each pixel
Gradient amplitude and gradient direction, comprising:
According to Di Zenzo operator to described image to be detected carry out gradient calculating, obtain each pixel gradient amplitude and
Gradient direction.
Preferably, described that edge detection is carried out to described image to be detected by default edge detection algorithm, obtain each side
Edge line segment, comprising:
Edge detection is carried out to described image to be detected by Color EDV algorithm, obtains each edge line segment.
Preferably, described that edge detection is carried out to described image to be detected by default edge detection algorithm, obtain each side
After edge line segment, further includes:
Least square fitting processing is carried out to each edge line segment, obtains each standard edge line segment.
Preferably, the gradient amplitude of each pixel of the combination and gradient direction carry out chain to each edge line segment
Processing or division processing are connect, each candidate straightway is obtained, comprising:
It is ranked up by gradient amplitude of the predetermined order algorithm to each pixel in the edge line segment, obtains sequence knot
Fruit;
Referring to predetermined gradient amplitude criteria and predetermined gradient direction standard, according to the gradient amplitude and ladder of each pixel
Degree direction carries out link processing to each edge line segment or division is handled, and obtains each candidate straightway.
Preferably, the predetermined order algorithm is recurrence sort algorithm.
Preferably, the basis is preset screening rule and is screened to each candidate straightway, obtains straightway, packet
It includes:
Each candidate straightway is screened according to Helmholtz criterion, obtains the straightway.
In order to solve the above technical problems, present invention also provides a kind of detection device of straightway in image, described image
The detection device of middle straightway includes:
Gradient computing module, for when receiving image to be detected, according to gradient of vector method to described image to be detected
Gradient calculating is carried out, the gradient amplitude and gradient direction of each pixel are obtained;
Edge detection module is obtained for carrying out edge detection to described image to be detected by default edge detection algorithm
Obtain each edge line segment;
Edge line segment processing module, in conjunction with each pixel gradient amplitude and gradient direction to each edge
Line segment carries out link processing or division processing, obtains each candidate straightway;
Straightway screening module obtains straight for being screened according to default screening rule to each candidate straightway
Line segment.
In order to solve the above technical problems, present invention also provides a kind of detection system of straightway in image, described image
The detection system of middle straightway includes:
Memory, for storing computer program;
Processor realizes the detection method of straightway in any one of the above image when for executing the computer program
The step of.
In order to solve the above technical problems, the computer can present invention also provides a kind of computer readable storage medium
It reads to be stored with computer program on storage medium, the computer program realizes any one of the above image when being executed by processor
The step of detection method of middle straightway.
The detection method of straightway in a kind of image provided herein, including when receiving image to be detected, root
Gradient calculating is carried out to described image to be detected according to gradient of vector method, obtains the gradient amplitude and gradient direction of each pixel;It is logical
It crosses default edge detection algorithm and edge detection is carried out to described image to be detected, obtain each edge line segment;In conjunction with each pixel
The gradient amplitude and gradient direction of point carry out link processing or division processing to each edge line segment, obtain each candidate straight line
Section;Each candidate straightway is screened according to default screening rule, obtains straightway.
As it can be seen that in image provided herein straightway detection method, introduce gradient of vector algorithm realize to be checked
The gradient for surveying color image calculates, so that the implicit fusion of color information in color image is realized, so that different in color image
The opposite vector of color component is mutually reinforced, and the color extracted in color image would be much more convenient when carrying out edge detection as a result,
Multimedia message finally can be obtained the straightway in color image, compared to traditional skill after the processing such as link, division, screening
The processing method that color image is converted to gray image is needed in art, which can directly carry out color image
Processing, without carrying out gradation conversion, to effectively prevent straightway loss or inaccuracy caused by converting due to image grayscale
The problem of, greatly improve detection effect.
Detection device, system and the computer readable storage medium of straightway in a kind of image provided herein,
Above-mentioned beneficial effect is all had, details are not described herein.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
The embodiment of application for those of ordinary skill in the art without creative efforts, can also basis
The attached drawing of offer obtains other attached drawings.
Fig. 1 is the flow diagram of the detection method of straightway in a kind of image provided herein;
Fig. 2 is the structural schematic diagram of the detection device of straightway in a kind of image provided herein;
Fig. 3 is the structural schematic diagram of the detection system of straightway in a kind of image provided herein.
Specific embodiment
The core of the application is to provide a kind of detection method of straightway in image, the detection method of straightway in the image
Directly the straightway of color image can be detected, effectively prevent due to image grayscale convert caused by straightway lose or
The problem of inaccuracy;Another core of the application is to provide detection device, system and the computer of straightway in a kind of image
Readable storage medium storing program for executing, it may have above-mentioned beneficial effect.
To keep the purposes, technical schemes and advantages of the embodiment of the present application clearer, below in conjunction with the embodiment of the present application
In attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is
Some embodiments of the present application, instead of all the embodiments.Based on the embodiment in the application, those of ordinary skill in the art
All other embodiment obtained without making creative work, shall fall in the protection scope of this application.
Referring to FIG. 1, Fig. 1 is the flow diagram of the detection method of straightway in a kind of image provided herein,
The detection method of straightway may include: in the image
S101: when receiving image to be detected, gradient calculating is carried out to image to be detected according to gradient of vector method, is obtained
The gradient amplitude and gradient direction of each pixel;
The line segment detection of image relates generally to the edge detection of image, and the calculating of gradient direction and gradient amplitude is then
The key of edge detection process, this step are the gradient calculating aimed to image to be detected, and certainly, which is
To need to carry out the color image of line segment detection.
In prior art, when carrying out line segment detection to color image, color image is first usually converted into ash
Chromatic graph picture, but color different after image gray processing may correspond to same or similar gray scale, and part carrys out table with color
The image information reached may be abandoned, to cause the loss or remitted its fury of straightway.But it if directly will be existing
Line segment detection technology is applied to color image, for example, when carrying out respectively to three color channels of red, green, blue in color image
When detection, the testing result of triple channel is but difficult to realize reasonably merge.
To solve the above problems, the application introduces gradient of vector method.Since each of color image pixel can be with
Regard a trivector as, therefore, the detection of color image is realized using vector method.Specifically, when receive to
When detection image, gradient calculating can be carried out to it by gradient of vector method, it includes gradient amplitude and gradient side which, which calculates,
To calculating, i.e., the gradient amplitude and gradient direction of pixel each in image to be detected are calculated.
Preferably, above-mentioned that gradient calculating is carried out to image to be detected according to gradient of vector method, obtain the gradient of each pixel
Amplitude and gradient direction may include carrying out gradient calculating to image to be detected according to Di Zenzo operator, obtain each pixel
Gradient amplitude and gradient direction.
This application provides a kind of more specific gradient of vector methods, i.e., are realized based on Di Zenzo operator.Specifically, logical
It crosses Di Zenzo operator to calculate each channel gradient of image to be detected, can effectively realize all kinds of color informations in image
Implicit fusion, so that the opposite vector of different colours component is mutually reinforced in image to be detected, is more favorable in image to be detected
The extraction of color information avoids the problem that straightway missing inspection or false retrieval.
Certainly, above-mentioned gradient of vector method is only a kind of implementation provided herein, not uniquely, for example, may be used also
To add up after calculating gradient to each color channel respectively, then calculated based on cumulative gradient, but this kind of realization side
Formula needs to consume more times relative to Di Zenzo operator, and operation efficiency is relatively low.
S102: edge detection is carried out to image to be detected by default edge detection algorithm, obtains each edge line segment;
This step aims at edge detection, to obtain each edge line segment of image to be detected, can pass through preset side
Edge detection algorithm is realized.Specifically, since the gradient for having been realized in image to be detected in above-mentioned S101 calculates, wherein not
Opposite vector with color component has mutually been reinforced, at this point, carrying out the extraction of edge line segment would be much more convenient fast.Wherein,
Any one edge detection algorithm in prior art can be used in the realization of above-mentioned edge detection, and the application is not specifically limited.
Preferably, edge detection is carried out to image to be detected above by default edge detection algorithm, obtains each edge line
Section may include carrying out edge detection to image to be detected by Color EDV algorithm, obtain each edge line segment.
This application provides a kind of more specific edge detection modes, i.e., are realized based on Color EDV algorithm.Color
EDV algorithm is a kind of edge detection algorithm specifically for color image, which can not only extract than existing detection
The more edge line segments of algorithm also have good time performance.
Di Zenzo operator can be combined with Color EDV algorithm as a result, specific implementation process includes: to count first
The gradient vector for calculating each color channel calculates the average gradient value of each pixel, is then calculated and a kind of " intelligence by " anchor point "
Energy circuit by " model obtains edge lines, i.e. edge line segment, Color EDV calculation is effectively controlled by Di Zenzo operator as a result,
The time complexity of method obtains good edge detection effect.
Preferably, edge detection is carried out to image to be detected above by default edge detection algorithm, obtains each edge line
After section, it can also include that least square fitting processing is carried out to each edge line segment, obtain each standard edge line segment.
It, can also be further after obtaining each edge line segment in order to detect longer, the higher straightway of accurate rate
Least square fitting processing is carried out to each of the edges line segment, the edge line segment of more standard is obtained, to improve parameter summed efficiency.
S103: each edge line segment is carried out at link processing or division in conjunction with the gradient amplitude and gradient direction of each pixel
Reason obtains each candidate straightway;
It is above-mentioned that each edge line segment is obtained based on S102, but the position of edge pixel is highly susceptible to the dry of various noises
It disturbs, leading to line segment detection result, there are biggish errors, therefore, can for the accuracy for effectively improving line segment detection result
Further combined with the gradient amplitude and gradient direction of pixel each in image to be detected, it then follows preset standard rule is to above-mentioned each
Edge line segment carries out certain link processing or classification processing, to remove noise.For example, being carried out for too long edge line segment
Division processing, carries out link processing for too short edge line segment or individual pixel, and it is certain to can be obtained satisfaction as a result,
It is required that candidate straightway.It wherein, can be by technical staff according to reality for the above-mentioned standard rule for being linked or being divided
Demand carries out otherness setting, and the application does not limit this.
Preferably, the gradient amplitude of each pixel of above-mentioned combination and gradient direction to each edge line segment carry out link processing or
Division processing obtains each candidate straightway, may include the gradient by predetermined order algorithm to each pixel in edge line segment
Amplitude is ranked up, and obtains ranking results;Referring to predetermined gradient amplitude criteria and predetermined gradient direction standard, according to each pixel
Gradient amplitude and gradient direction carries out link processing to each edge line segment or division is handled, obtain each candidate straightway.
This application provides the acquisition methods of more specific candidate straightway, specifically, can presetted pixel point ladder
Amplitude criteria and gradient direction standard are spent, when extracting candidate straightway, the ladder to pixel each in image to be detected first
Degree amplitude is ranked up, and can specifically be realized according to preset sort algorithm;Further, that is, it can refer to above-mentioned predetermined gradient amplitude mark
Quasi- and predetermined gradient direction standard is linked accordingly to each edge line segment or division processing, to obtain each candidate straight
Line segment.
Preferably, above-mentioned predetermined order algorithm can be recurrence sort algorithm.
For above-mentioned predetermined order algorithm, this application provides more concrete implementation modes, i.e. recurrence sort algorithm.When
So, the algorithm of recurrence sequence, which is also only a kind of implementation provided herein, uniquely not can also be used prior art
In any one sort algorithm realize, such as quick sorting algorithm.
S104: each candidate straightway is screened according to default screening rule, obtains straightway.
In S103, although obtaining each candidate straightway based on preset standard rule, in complex environment often
There are a large amount of noise jammings, such as ground weeds, shade.It therefore, can also be further to every candidate for error is effectively reduced
Straightway is verified, i.e., is screened based on default screening rule to each candidate straightway, to obtain accurately straight
Line segment.Wherein, above-mentioned preset standard rule can be set according to actual needs by technical staff, specifically limit content not
Influence the implementation of the technical program.
Preferably, above-mentioned basis is preset screening rule and is screened to each candidate straightway, obtains straightway, may include
Each candidate straightway is screened according to Helmholtz criterion, obtains straightway.
It goes to determine whether candidate straightway is real straightway since threshold value is manually set, sensitivity to parameter can be related to
And therefore the problems such as algorithm stability, more specifically presets screening rule this application provides a kind of, i.e. Helmholtz is quasi-
Then.Helmholtz criterion is one kind by establish after effectively analyzing to the probability for occurring error detection under noise circumstance
Mathematical model for inhibiting false dangerous section to occur, according to Helmholtz criterion, when the phase of candidate straightway in a noisy environment
It when prestige is worth small Mr. Yu's threshold value, is identified as that there is perception meaning, can guarantee line segment detection process under influence of noise as a result,
Generate lower error rate.Specifically, calculating false alarm number using Helmholtz criterion, each candidate straightway is carried out
Verifying, by error detection control in lower range.
The detection method of straightway in image provided herein introduces the realization of vector analysis algorithm and treats sense colors
The gradient of image calculates, so that the implicit fusion of color information in color image is realized, so that different colours point in color image
The opposite vector of amount is mutually reinforced, and the color information extracted in color image would be much more convenient when carrying out edge detection as a result,
Finally can be obtained straightway in color image after the processing such as link, division, screening, compared to needed in traditional technology by
Color image is converted to the processing method of gray image, which can directly be handled color image, nothing
Gradation conversion need to be carried out, so that the problem of straightway loss or inaccuracy caused by converting due to image grayscale is effectively prevented,
Greatly improve detection effect.
On the basis of above-mentioned each embodiment, this application provides the detection sides of straightway in more specifically image
The specific implementation flow of method, the detection method is as follows:
Firstly, for a certain color image I to be detected, there are three color channel, the components of each color channel to be denoted as tool
Ir、Ig、Ib, respectively indicate the image layer in red, green, blue channel;Assuming thatuWithvIt is the local derviation of color image I in the x and y direction
Number, then Di Zenzo operator definitions are as follows:
The gradient amplitude g (x, y) and gradient direction dir (x, y) of each pixel are respectively as follows: in color image I as a result,
Wherein, θ indicates the tilt angle of edge line segment.
Further, least square fitting is carried out to each edge line segment, to improve parameter summed efficiency, then is linked or divided
Split processing:
(1) recurrence sorts:
According to gradient amplitude, to the pixel quicksort of all edge line segments, it is assumed that n element to be sorted is stored in
In array A [0,2,3 ..., n-1], sequencer procedure is as follows:
(a) variable that two initial values are respectively i=0 and j=n-1 is set, using first element of array as key
Data are assigned to key, i.e. key=A [0];
(b) (j--) is searched for forward since j, until first value A [j] for being less than critical data key is found, by A [j]
It is assigned to A [i];
(c) (i++) is searched for backward since i, until first value A [i] for being greater than critical data key is found, by A [i]
It is assigned to A [j];
(d) it repeats (b) and (c), until i=j;
The above sequence step executes the primary final position at least determining an element, passes through Recursion process residue as a result,
The ranking results of all pixels point can be obtained in data;
(2) link is handled:
For each edge line segment, since the pixel with greatest gradient amplitude, by 8 neighborhood gradients around the pixel
Current region is added in the pixel that error is less than threshold value on direction, and these pixels is marked to use, further circulate operation
Until all pixels point is labeled;Wherein, 8 neighborhood gradient directions refer to 8 around the pixel with greatest gradient amplitude
A neighborhood, i.e., just on, just under, positive left, positive right, upper left, upper right, lower-left, the neighborhood of bottom right eight, error refer to two pixels it
Between line angle error, i.e. whether line angle is less than given threshold between two pixels, is added if being less than and works as proparea
Domain;
(3) division is handled:
If presetting the error between any two endpoint in a certain rectangular edges region is greater than 1 pixel, and the square
The length of shape fringe region is greater than default minimum threshold θmin, then division processing is carried out to the rectangular edges section, is divided into two
A region further repeats the step until all edge line segments are processed;Wherein, it for fission process, can first choose
One endpoint in rectangular edges region is as reference, if the error between the endpoint of the other end and the endpoint is greater than 1 pixel,
The subregion since the endpoint of the other end realizes division processing;
Each candidate straightway can be obtained based on the above-mentioned processing to edge line segment as a result,.
Finally, candidate straightway is screened, to obtain straightway:
Assuming that there is the image of a N × N, L indicates that a length is the straightway S of nn, then NFA (Number of False
Alarms, false alarm number) it may be defined as:
Wherein, p indicates the probability of a pixel and the alignment of a candidate line sections, such as in LSD algorithm, is arranged
It is 1/8;
Above-mentioned verification process only used the directional information of edge line segment pixel, but gradient direction is simplest part
The information that contrast does not change, so, when the condition verified using only gradient direction as straightway, if gradient amplitude compared with
It is small, then it will appear the unstable problem of gradient direction, it is clear that when different candidate straightways have equal length and identical quantity
When the pixel of alignment, the straightway with high gradient magnitude has stronger feature than the straightway with low gradient amplitude,
Therefore, Helmholtz criterion can be introduced, above-mentioned NFA is changed are as follows:
Wherein, u indicates the minimal gradient amplitude of pixel in straightway S, NpIt indicates all and is connected to the total of candidate straightway
Number, H (u)nnIt indicates the probability that u event occurs, can be detected the straight line for providing more snap to pixels points and stronger gradient as a result,
Section.
Based on above-mentioned implementation process, complete algorithm implementation can be obtained:
Input I: color image to be detected;
1) according to { Ir,Ig,IbCalculate the gradient direction dir (x, y) and gradient amplitude g (x, y) of each pixel;
2) ColorEDV (I is executedr,Ig,Ib,σ,τl) function, extract the initial edge figure in color image I;
3) respectively to three color channel { I of color image Ir,Ig,IbBe smoothed, as a result it is denoted as { Sr,Sg,
Sb};
4) it is based on { Sr,Sg,SbInitial edge is linked or divided, obtain candidate straightway;
5) candidate straightway is verified, true straightway is filtered out;
Output records each straightway endpoint Lk(x1,x2,y1,y2), wherein (x1,y1) and (x2,y2) respectively indicate straight line
Section LkTwo endpoints, and k=1,2,3 ... n.
Wherein, σ indicates the standard variance parameter of Gaussian smoothing,τlThe threshold value for indicating shortest straight line segment length, in application,
Set σ=0.7, τl=7.
In addition, can also be based further on preset evaluation index has line Segment Detection provided herein
Effect card and assessment, wherein evaluation index may include accurate rate, recall rate, IOU and F- score:
(1) accurate rate P (Precision) indicates that correct straightway accounts for artificial mark figure in all straightways detected
The ratio of middle straightway:
(2) recall rate R (Recall) indicates the ratio of length of straigh line in correct detection length of straigh line and artificial mark figure
Value:
(3) IOU indicates the intersection of testing result and artificial mark figure and both upper union:
(4) F- score F (F-score) indicates the harmonic-mean of accurate rate and recall rate two indices:
Wherein, TP indicates to extract correct number of straight segments, and FP indicates the number of straight segments of detection mistake, FN indicate not by
The number of straight segments detected, β indicate the ratio of accurate rate and recall rate, and in this application, value takes 1.
Based on above-mentioned each index to line segment detection mode provided herein and all kinds of straight lines in the prior art
The performance of section detection method is assessed, and can determine that line Segment Detection provided herein has according to assessment result
Highest performance.Wherein, participate in assessment line Segment Detection in the prior art include LSD algorithm, EDLines algorithm,
CannyLines algorithm, MCMLSD algorithm, Linelet algorithm and ELSDc algorithm.
The detection method of straightway in image provided by the embodiment of the present application introduces vector analysis algorithm and realizes to be checked
The gradient for surveying color image calculates, so that the implicit fusion of color information in color image is realized, so that different in color image
The opposite vector of color component is mutually reinforced, and the color extracted in color image would be much more convenient when carrying out edge detection as a result,
Multimedia message finally can be obtained the straightway in color image, compared to traditional skill after the processing such as link, division, screening
The processing method that color image is converted to gray image is needed in art, which can directly carry out color image
Processing, without carrying out gradation conversion, to effectively prevent straightway loss or inaccuracy caused by converting due to image grayscale
The problem of, greatly improve detection effect.
To solve the above problems, referring to FIG. 2, Fig. 2 is the detection dress of straightway in a kind of image provided herein
The structural schematic diagram set, the detection device of straightway in the image can include:
Gradient computing module 10, for when receiving image to be detected, according to time-vector method to image to be detected into
Row gradient calculates, and obtains the gradient amplitude and gradient direction of each pixel;
Edge detection module 20 is obtained for carrying out edge detection to image to be detected by default edge detection algorithm
Each edge line segment;
Edge line segment processing module 30, for combine each pixel gradient amplitude and gradient direction to each edge line segment into
Row link processing or division processing obtain each candidate straightway;
Straightway screening module 40 obtains straight line for screening according to default screening rule to each candidate straightway
Section.
As a kind of preferred embodiment, above-mentioned gradient computing module 10 can be specifically used for according to Di Zenzo operator to be checked
Altimetric image carries out gradient calculating, obtains the gradient amplitude and gradient direction of each pixel.
As a kind of preferred embodiment, above-mentioned edge detection module 20 can be specifically used for treating by Color EDV algorithm
Detection image carries out edge detection, obtains each edge line segment.
As a kind of preferred embodiment, the detection device of straightway may also include preprocessing module in the image, for pair
Each edge line segment carries out least square fitting processing, obtains each standard edge line segment.
As a kind of preferred embodiment, edge line segment processing module 30 can be specifically used for through predetermined order algorithm to edge
The gradient amplitude of each pixel is ranked up in line segment, obtains ranking results;Referring to predetermined gradient amplitude criteria and predetermined gradient
Direction standard, according to the gradient amplitude of each pixel and gradient direction carries out link processing to each edge line segment or division is handled,
Obtain each candidate straightway.
As a kind of preferred embodiment, above-mentioned predetermined order algorithm can be recurrence sort algorithm.
As a kind of preferred embodiment, above-mentioned straightway screening module 40 can be specifically used for according to Helmholtz criterion pair
Each candidate's straightway is screened, and straightway is obtained.
Above method embodiment is please referred to for the introduction of device provided by the present application, this will not be repeated here by the application.
To solve the above problems, referring to FIG. 3, Fig. 3 is the detection system of straightway in a kind of image provided herein
The structural schematic diagram of system, the detection system of straightway in the image can include:
Memory 1, for storing computer program;
Processor 2, realizes following steps when for executing computer program:
When receiving image to be detected, gradient calculating is carried out to image to be detected according to time-vector method, obtains each picture
The gradient amplitude and gradient direction of vegetarian refreshments;Edge detection is carried out to image to be detected by default edge detection algorithm, is obtained each
Edge line segment;Link processing or division processing are carried out to each edge line segment in conjunction with the gradient amplitude and gradient direction of each pixel,
Obtain each candidate straightway;Each candidate straightway is screened according to default screening rule, obtains straightway.
Above method embodiment is please referred to for the introduction of system provided by the present application, this will not be repeated here by the application.
To solve the above problems, present invention also provides a kind of computer readable storage medium, the computer-readable storage
It is stored with computer program on medium, can be realized when computer program is executed by processor following rapid:
When receiving image to be detected, gradient calculating is carried out to image to be detected according to time-vector method, obtains each picture
The gradient amplitude and gradient direction of vegetarian refreshments;Edge detection is carried out to image to be detected by default edge detection algorithm, is obtained each
Edge line segment;Link processing or division processing are carried out to each edge line segment in conjunction with the gradient amplitude and gradient direction of each pixel,
Obtain each candidate straightway;Each candidate straightway is screened according to default screening rule, obtains straightway.
The computer readable storage medium may include: USB flash disk, mobile hard disk, read-only memory (Read-OnlyMemory,
ROM), random access memory (Random Access Memory, RAM), magnetic or disk etc. are various can store program
The medium of code.
Above method embodiment is please referred to for the introduction of computer readable storage medium provided by the present application, the application exists
This is not repeated them here.
Each embodiment is described in a progressive manner in specification, the highlights of each of the examples are with other realities
The difference of example is applied, the same or similar parts in each embodiment may refer to each other.For device disclosed in embodiment
Speech, since it is corresponded to the methods disclosed in the examples, so being described relatively simple, related place is referring to method part illustration
?.
Professional further appreciates that, unit described in conjunction with the examples disclosed in the embodiments of the present disclosure
And algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware and
The interchangeability of software generally describes each exemplary composition and step according to function in the above description.These
Function is implemented in hardware or software actually, the specific application and design constraint depending on technical solution.Profession
Technical staff can use different methods to achieve the described function each specific application, but this realization is not answered
Think beyond scope of the present application.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can directly be held with hardware, processor
The combination of capable software module or the two is implemented.Software module can be placed in random access memory (RAM), memory, read-only deposit
Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology
In any other form of storage medium well known in field.
It to the detection method of straightway in image provided herein, device, system and computer-readable deposits above
Storage media is described in detail.Specific examples are used herein to illustrate the principle and implementation manner of the present application,
The description of the example is only used to help understand the method for the present application and its core ideas.It should be pointed out that for this technology
For the those of ordinary skill in field, under the premise of not departing from the application principle, several improvement can also be carried out to the application
And modification, these improvement and modification also fall into the protection scope element of the claim of this application.
Claims (10)
1. the detection method of straightway in a kind of image characterized by comprising
When receiving image to be detected, gradient calculating is carried out to described image to be detected according to gradient of vector method, obtains each picture
The gradient amplitude and gradient direction of vegetarian refreshments;
Edge detection is carried out to described image to be detected by default edge detection algorithm, obtains each edge line segment;
Each edge line segment is carried out at link processing or division in conjunction with the gradient amplitude and gradient direction of each pixel
Reason obtains each candidate straightway;
Each candidate straightway is screened according to default screening rule, obtains straightway.
2. detection method as described in claim 1, which is characterized in that it is described according to gradient of vector method to described image to be detected
Gradient calculating is carried out, the gradient amplitude and gradient direction of each pixel are obtained, comprising:
Gradient calculating is carried out to described image to be detected according to Di Zenzo operator, obtains the gradient amplitude and gradient of each pixel
Direction.
3. detection method as described in claim 1, which is characterized in that described by presetting edge detection algorithm to described to be checked
Altimetric image carries out edge detection, obtains each edge line segment, comprising:
Edge detection is carried out to described image to be detected by Color EDV algorithm, obtains each edge line segment.
4. detection method as claimed in claim 3, which is characterized in that described by presetting edge detection algorithm to described to be checked
Altimetric image carries out edge detection, after obtaining each edge line segment, further includes:
Least square fitting processing is carried out to each edge line segment, obtains each standard edge line segment.
5. the detection method as described in Claims 1-4 any one, which is characterized in that each pixel of combination
Gradient amplitude and gradient direction carry out link processing or division processing to each edge line segment, obtain each candidate straightway, packet
It includes:
It is ranked up by gradient amplitude of the predetermined order algorithm to each pixel in the edge line segment, obtains ranking results;
Referring to predetermined gradient amplitude criteria and predetermined gradient direction standard, according to the gradient amplitude of each pixel and gradient side
Link processing or division processing are carried out to each edge line segment, obtains each candidate straightway.
6. detection method as claimed in claim 5, which is characterized in that the predetermined order algorithm is recurrence sort algorithm.
7. detection method as described in claim 1, which is characterized in that the basis presets screening rule to each described candidate straight
Line segment is screened, and straightway is obtained, comprising:
Each candidate straightway is screened according to Helmholtz criterion, obtains the straightway.
8. the detection device of straightway in a kind of image, which is characterized in that further include:
Gradient computing module, for being carried out to described image to be detected according to gradient of vector method when receiving image to be detected
Gradient calculates, and obtains the gradient amplitude and gradient direction of each pixel;
Edge detection module obtains each for carrying out edge detection to described image to be detected by default edge detection algorithm
Edge line segment;
Edge line segment processing module, in conjunction with each pixel gradient amplitude and gradient direction to each edge line segment
Link processing or division processing are carried out, each candidate straightway is obtained;
Straightway screening module obtains straightway for screening according to default screening rule to each candidate straightway.
9. the detection system of straightway in a kind of image characterized by comprising
Memory, for storing computer program;
Processor realizes straight line in image as claimed in any one of claims 1 to 7 when for executing the computer program
The step of detection method of section.
10. a kind of computer readable storage medium, which is characterized in that be stored with computer on the computer readable storage medium
Program, the computer program realize straightway in image as claimed in any one of claims 1 to 7 when being executed by processor
Detection method the step of.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910577980.4A CN110288624A (en) | 2019-06-28 | 2019-06-28 | Detection method, device and the relevant device of straightway in a kind of image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910577980.4A CN110288624A (en) | 2019-06-28 | 2019-06-28 | Detection method, device and the relevant device of straightway in a kind of image |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110288624A true CN110288624A (en) | 2019-09-27 |
Family
ID=68019685
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910577980.4A Pending CN110288624A (en) | 2019-06-28 | 2019-06-28 | Detection method, device and the relevant device of straightway in a kind of image |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110288624A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111080661A (en) * | 2019-12-09 | 2020-04-28 | Oppo广东移动通信有限公司 | Image-based line detection method and device and electronic equipment |
CN111489341A (en) * | 2020-04-09 | 2020-08-04 | 长沙琢冶信息技术有限公司 | Method, device, equipment and storage medium for detecting random filament of filament coiling filament |
CN111652825A (en) * | 2020-08-06 | 2020-09-11 | 上海海栎创微电子有限公司 | Edge tracking straight line segment rapid detection device and method based on gradient direction constraint |
CN113469989A (en) * | 2021-07-14 | 2021-10-01 | 广东电网有限责任公司 | Method, system, equipment and medium for extracting power transmission conductor in remote sensing image |
CN113689447A (en) * | 2020-05-19 | 2021-11-23 | 华晨宝马汽车有限公司 | Method, device, apparatus and system for identifying strip-shaped fixing parts |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107423737A (en) * | 2017-05-03 | 2017-12-01 | 武汉东智科技股份有限公司 | The video quality diagnosing method that foreign matter blocks |
CN108399626A (en) * | 2018-03-02 | 2018-08-14 | 苏州大学 | A kind of detection method, device and the equipment of image cathetus section |
CN109801281A (en) * | 2019-01-23 | 2019-05-24 | 浙江大学 | A kind of texture-free metal parts image regulation straightway edge detection method |
CN109816639A (en) * | 2019-01-05 | 2019-05-28 | 西安交通大学 | A kind of real-time line segment detection system and method based on LSD algorithm |
-
2019
- 2019-06-28 CN CN201910577980.4A patent/CN110288624A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107423737A (en) * | 2017-05-03 | 2017-12-01 | 武汉东智科技股份有限公司 | The video quality diagnosing method that foreign matter blocks |
CN108399626A (en) * | 2018-03-02 | 2018-08-14 | 苏州大学 | A kind of detection method, device and the equipment of image cathetus section |
CN109816639A (en) * | 2019-01-05 | 2019-05-28 | 西安交通大学 | A kind of real-time line segment detection system and method based on LSD algorithm |
CN109801281A (en) * | 2019-01-23 | 2019-05-24 | 浙江大学 | A kind of texture-free metal parts image regulation straightway edge detection method |
Non-Patent Citations (3)
Title |
---|
CUNEYT AKINLAR 等: "ColorED: Color edge and segment detection by Edge Drawing (ED)", 《J. VIS. COMMUN. IMAGE R.》 * |
XIAOHU LU 等: "CANNYLINES:A PARAMETER-FREE LINE SEGMENT DETECTOR", 《2015IEEE》 * |
董晶 等: "基于边缘连接的快速直线段检测算法", 《光学学报》 * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111080661A (en) * | 2019-12-09 | 2020-04-28 | Oppo广东移动通信有限公司 | Image-based line detection method and device and electronic equipment |
CN111080661B (en) * | 2019-12-09 | 2023-12-22 | Oppo广东移动通信有限公司 | Image-based straight line detection method and device and electronic equipment |
CN111489341A (en) * | 2020-04-09 | 2020-08-04 | 长沙琢冶信息技术有限公司 | Method, device, equipment and storage medium for detecting random filament of filament coiling filament |
CN111489341B (en) * | 2020-04-09 | 2023-05-30 | 长沙琢冶信息技术有限公司 | Method, device, equipment and storage medium for detecting wire disorder of wire winding of wire disc |
CN113689447A (en) * | 2020-05-19 | 2021-11-23 | 华晨宝马汽车有限公司 | Method, device, apparatus and system for identifying strip-shaped fixing parts |
CN111652825A (en) * | 2020-08-06 | 2020-09-11 | 上海海栎创微电子有限公司 | Edge tracking straight line segment rapid detection device and method based on gradient direction constraint |
CN113469989A (en) * | 2021-07-14 | 2021-10-01 | 广东电网有限责任公司 | Method, system, equipment and medium for extracting power transmission conductor in remote sensing image |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110288624A (en) | Detection method, device and the relevant device of straightway in a kind of image | |
CN110287932B (en) | Road blocking information extraction method based on deep learning image semantic segmentation | |
US7657090B2 (en) | Region detecting method and region detecting apparatus | |
CN112581463A (en) | Image defect detection method and device, electronic equipment, storage medium and product | |
US6721447B1 (en) | Representative color designating method using reliability | |
CN102982534B (en) | Canny edge detection dual threshold acquiring method based on chord line tangent method | |
CN109461133B (en) | Bridge bolt falling detection method and terminal equipment | |
JP2018017570A (en) | Rock mass strength determination device, rock mass strength determination method, and rock mass strength determination program | |
CN106937114A (en) | Method and apparatus for being detected to video scene switching | |
CN111507411B (en) | Image comparison method and system | |
CN110909640A (en) | Method and device for determining water level line, storage medium and electronic device | |
CN112164086B (en) | Method, system and electronic equipment for determining refined image edge information | |
CN115597494B (en) | Precision detection method and system for prefabricated part preformed hole based on point cloud | |
CN115690012A (en) | Detection method for wrong connection line of electric energy meter | |
CN107392948B (en) | Image registration method of amplitude-division real-time polarization imaging system | |
US7203358B2 (en) | Method and device for measuring similarity between images | |
CN109738752A (en) | A kind of fast imaging method for grounded screen maintenance | |
CN112101468B (en) | Method for judging abnormal sequence in sequence combination | |
CN115424009A (en) | Automatic reading method for pointer instrument data based on Yolact network | |
CN115439864A (en) | Water meter reading identification method and system, computer equipment and storage medium | |
CN113553980A (en) | Method, system and device for generating trademark graphic element codes of pictures | |
CN114155440A (en) | Automatic detection method and system for farmland non-farming | |
CN109472766B (en) | Bridge bolt area positioning method and terminal equipment | |
CN106055669A (en) | Data discretization method and system | |
CN111695576A (en) | Electric energy meter appearance rapid identification method based on neural network |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190927 |
|
RJ01 | Rejection of invention patent application after publication |