CN108416789A - Method for detecting image edge and system - Google Patents
Method for detecting image edge and system Download PDFInfo
- Publication number
- CN108416789A CN108416789A CN201810564446.5A CN201810564446A CN108416789A CN 108416789 A CN108416789 A CN 108416789A CN 201810564446 A CN201810564446 A CN 201810564446A CN 108416789 A CN108416789 A CN 108416789A
- Authority
- CN
- China
- Prior art keywords
- image
- edge
- pixel
- gradient
- candidate
- 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
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Image Analysis (AREA)
Abstract
A kind of method for detecting image edge of offer of the embodiment of the present invention and system, including:The gradient magnitude that each pixel in original image is obtained according to roberts operator detection algorithms, obtains gradient image, wherein the roberts operators use 3 × 3 operator templates;Non-maxima suppression processing is carried out to the gradient image, candidate edge image is obtained, the pixel as candidate marginal is marked in the candidate edge image;Edge detection is carried out to the candidate edge image according to canny operators detection algorithm, obtains edge image.The embodiment of the present invention calculates accurate gradient magnitude by the roberts operators of 3 × 3 operator templates, good condition is created to carry out canny operator detection algorithms, and canny operators is used to screen boundary in candidate edge image for the pixel of candidate marginal, the advantages of calculation amount of canny operator detection algorithms can be reduced, improve computational accuracy, while retaining flatness and extreme value inhibition.
Description
Technical field
The present invention relates to technical field of image processing, more particularly, to method for detecting image edge and system.
Background technology
In the picture, edge is the most apparent place of image local intensity variation, it is primarily present in target and target, mesh
Between mark and background, region and region.Edge shows the beginning of the termination and another feature region of a characteristic area.Edge institute
The internal feature or attribute of separation region are consistent, and different region internal features or attribute are different.
Roberts operators, also known as Luo Baici operators are a kind of simplest operators, are a kind of local difference operators of utilization
Find the operator at edge.Traditional Roberts operators are a 2x2 operator templates, using diagonally opposed adjacent two
The difference of pixel detects edge.From the point of view of the actual effect of image procossing, the operator is very sensitive to noise, can not inhibit noise
It influences, and there are edges thicker, the defect of position inaccurate.
Canny operators are the multistage edge detection algorithm that John F.Canny developed in 1986, this method
It is not readily susceptible to noise jamming, can monitor real weak edge.But there are the Roberts of traditional 2*2 operator templates calculations
The local pixel variable gradient that is constructed of son cannot be directly with traditional canny operators of 3*3 ranks be combined the drawbacks of.
Image Edge-Detection in taxi under complex background is easy extraneous by ambient noise and illumination condition variation etc.
The influence of factor, therefore caused there are noiseproof feature is not strong and the discontinuous drawback in edge using traditional edge detection method
Detection result is bad, and needs artificial selection parameter, and the flexibility of algorithm is relatively low.
Invention content
The present invention provides a kind of Image Edge-Detection side for overcoming the above problem or solving the above problems at least partly
Method and system.
According to the first aspect of the invention, a kind of method for detecting image edge is provided, including:
The gradient magnitude that each pixel in original image is obtained according to roberts operator detection algorithms, obtains gradient map
Picture, wherein the roberts operators use 3 × 3 operator templates;
Non-maxima suppression processing is carried out to the gradient image, obtains candidate edge image, the candidate edge image
In pixel as candidate marginal is marked;
Edge detection is carried out to the candidate edge image according to canny operators detection algorithm, obtains edge image.
According to the second aspect of the invention, a kind of Image Edge-Detection system is provided, including:
First edge detection module, for obtaining each pixel in original image according to roberts operator detection algorithms
Gradient magnitude, obtain gradient image, wherein the roberts operators use 3 × 3 operator templates;
Non-maxima suppression module obtains candidate edge for carrying out non-maxima suppression processing to the gradient image
The pixel as candidate marginal is marked in the candidate edge image for image;
Second edge detection module, for carrying out edge to the candidate edge image according to canny operators detection algorithm
Detection obtains edge image.
According to the third aspect of the invention we, a kind of Image Edge-Detection equipment is also provided, including:
At least one processor;And
At least one processor being connect with the processor communication, wherein:
The memory is stored with the program instruction that can be executed by the processor, and the processor calls described program to refer to
Enable the image border for being able to carry out that any possible realization method is provided in the various possible realization methods of first aspect
Detection method.
According to the fourth aspect of the invention, a kind of non-transient computer readable storage medium, the non-transient meter are also provided
Calculation machine readable storage medium storing program for executing stores computer instruction, and the computer instruction makes the computer execute the various of first aspect can
The method for detecting image edge that any possible realization method is provided in the realization method of energy.
Method for detecting image edge proposed by the present invention and system first pass through the roberts operator meters of 3 × 3 operator templates
Accurate gradient magnitude is calculated, good condition is created to carry out canny operator detection algorithms, and uses canny operators pair
Boundary is that the pixel of candidate marginal is screened in candidate edge image, can reduce the meter of canny operator detection algorithms
Calculation amount improves computational accuracy, while retaining the advantages of flatness and extreme value inhibit.
Description of the drawings
Fig. 1 is the flow diagram according to the method for detecting image edge of the embodiment of the present invention;
Fig. 2 is the flow diagram according to the acquisition gradient image of the embodiment of the present invention;
Fig. 3 is the flow diagram according to the acquisition candidate edge image of the embodiment of the present invention;
Fig. 4 is the flow diagram according to the acquisition candidate edge image of the embodiment of the present invention;
Fig. 5 is the flow diagram according to the acquisition edge image of the embodiment of the present invention;
Fig. 6 is according to the first threshold and the second threshold in the determination canny operators detection algorithm of the embodiment of the present invention
The flow diagram of value;
Fig. 7 is the functional block diagram according to the Image Edge-Detection system of the embodiment of the present invention;
Fig. 8 is the block diagram according to the Image Edge-Detection equipment of the embodiment of the present invention.
Specific implementation mode
With reference to the accompanying drawings and examples, the specific implementation mode of the present invention is described in further detail.Implement below
Example is not limited to the scope of the present invention for illustrating the present invention.
Roberts operators, also known as Luo Baici operators are a kind of simplest operators, are a kind of local difference operators of utilization
Find the operator at edge.Traditional Roberts operators are a 2x2 operator templates, using diagonally opposed adjacent two
The difference of pixel detects edge.From the point of view of the actual effect of image procossing, the operator is very sensitive to noise, can not inhibit noise
It influences, and there are edges thicker, the defect of position inaccurate.Canny operators are that John F.Canny were developed in 1986
The multistage edge detection algorithm come, this method are not readily susceptible to noise jamming, can monitor real weak edge.But it deposits
Tradition that cannot directly with 3*3 ranks in the local pixel variable gradient that the Roberts operators of traditional 2*2 operator templates are constructed
The drawbacks of canny operators are combined.
Image Edge-Detection in taxi under complex background is easy extraneous by ambient noise and illumination condition variation etc.
The influence of factor, therefore caused there are noiseproof feature is not strong and the discontinuous drawback in edge using traditional edge detection method
Detection result is bad, and needs artificial selection parameter, and the flexibility of algorithm is relatively low.
In order to overcome the drawbacks described above of the prior art, the basic conception of the embodiment of the present invention to be, pass through 3 × 3 operator templates
The local first-order differences of roberts operators can calculate exact gradient, establish gradient width in each pixel neighborhood of a point
The quantitative measurement of value;The Gaussian smoothing of canny operators detection and the advantage of non-maxima suppression processing are recycled, in conjunction with
The first-order difference that roberts operators obtain, builds first differential and derivative seeks the local extremum of operator, reduces tradition canny and calculates
Son calculation amount, improve computational accuracy, and remain canny operators flatness and extreme value inhibit the advantages of.
The embodiment of the present invention provides a kind of method for detecting image edge, and this method can be used for Driving Scene, can also use
In indoor/outdoor monitoring scene, the embodiment of the present invention is not especially limited this.For example, if this method is used for Driving Scene, it is somebody's turn to do
The executive agent of method can be mobile phone terminal or mobile unit.If this method is used for outdoor monitoring scene, this method is held
Row main body can be picture pick-up device.A kind of stream of method for detecting image edge of the embodiment of the present invention is shown referring to Fig. 1, Fig. 1
Journey schematic diagram, as shown, this method includes:
S101, the gradient magnitude that each pixel in original image is obtained according to roberts operator detection algorithms, obtain ladder
Spend image, wherein roberts operators use 3 × 3 operator templates.
It should be noted that roberts operators of the embodiment of the present invention using 3 × 3 operator formwork calculation original images 0 °,
The gradient magnitude in the directions such as 45 °, 90 ° and 135 °, effectively detect 8 directions edge, and with 2 × 2 operator templates
Roberts operators are compared, and the weights of diagonal are increased so that edge positioning is more accurate in gradient magnitude calculating.
The gradient magnitude of each pixel pixel is indicated in gradient image, when specifically calculating, first to picture
The first-order difference of the pixel value of vegetarian refreshments in 8 directions is calculated, and the first-order difference of the pixel value on 8 directions is then integrated
Calculate second order norm, the gradient magnitude as pixel.
S102, non-maxima suppression processing is carried out to gradient image, obtains candidate edge image, the acceptance of the bid of candidate edge image
The pixel as candidate marginal is remembered.
It should be noted that carrying out non-maxima suppression processing to gradient image, purpose is by gradient magnitude in gradient image
It is not that the pixel of maximum is inhibited in regional area, excludes its possibility as image border.By to gradient image
Non-maxima suppression processing is carried out, can recognize that the non-edge point in gradient image and the pixel as candidate marginal,
By the way that the pixel for being used as candidate marginal is marked, that is, obtain candidate edge image.
S103, edge detection is carried out to candidate edge image according to canny operators detection algorithm, obtains edge image.
It should be noted that the roberts operators that the embodiment of the present invention first passes through 3 × 3 operator templates calculate accurately
Gradient magnitude creates good condition to carry out canny operator detection algorithms, and uses canny operators to candidate edge figure
Boundary is that the pixel of candidate marginal is screened as in, can reduce the calculation amount of canny operator detection algorithms, improve meter
The advantages of calculating precision, while retaining flatness and extreme value inhibition.
Content based on above-described embodiment, as a kind of alternative embodiment, the embodiment of the present invention according to roberts to not calculating
Sub- detection algorithm obtains the gradient magnitude of each pixel in original image, obtain gradient image make it is specific limit, referring to Fig. 2,
It specifically includes:
S201, Gaussian noise is added to original image, obtains noise image.
It should be noted that the process for carrying out edge detection to image can be summarized as filtering, enhancing, detection and positioning four
A step can be obtained by first adding Gaussian noise to original image before filtering compared to being directly filtered to image
Take the less image of noise.
S202, according to the gradient magnitude of each pixel in roberts operator detection algorithm detection noise images, contained
It makes an uproar edge image.
Specifically, for any one pixel (x, y) in noise image, the difference for calculating 0 ° of direction of pixel is:f0
=f (x, y-1)-f (x, y+1);The difference in 45 ° of directions is:f45=3 × (f (x+1, y-1)-f (x-1, y+1));90 ° of directions
Difference is:f90=f (x-1, y)-f (x+1, y);The difference in 135 ° of directions is:f135=(- 3) × (f (x-1, y-1)-f (x+1, y+
1))。
The corresponding convolution operator of above-mentioned difference is respectively:
Second order norm calculation gradient magnitude is:
After the gradient magnitude for obtaining pixel, gradient magnitude is compared with preset threshold value, if object pixel
Gradient magnitude is less than threshold value, then deletes the pixel in noise image, more complete marginal information is obtained with this.
However in real image processing, strong and weak light of strong and weak light, partial occlusion, alternating etc. is will appear in image and is made an uproar
Sound, when extracting image border, these noises will cause the jumping characteristic of pixel gradient amplitude to change so that the new amplitude (quilt of gradient
Originally there is gradient magnitude in the people of detection or the corresponding pixel in Essential Environment the inside where object, however, when noise intervenes it
New gradient magnitude will be formed afterwards) it is more than threshold value, cause noise to be extracted as pseudo-edge, and then influence the edge of acquisition
Information accuracy.Therefore noise spot must be excluded, therefore, being obtained according to roberts operator detection algorithms for the embodiment of the present invention is former
The gradient magnitude of each pixel in beginning image obtains gradient image, further includes:
S203, ladder is obtained to the progress denoising of Noisy edge image according to the gradient magnitude of pixel in Noisy edge image
Spend image.
It should be noted that mean filter may be used when carrying out denoising to Noisy edge image in the embodiment of the present invention
The methods of method, median filter method or Wavelet noise-eliminating method, the embodiment of the present invention does not limit this specifically.
Method provided in an embodiment of the present invention obtains noise image, then root by first adding Gaussian noise to original image
The gradient magnitude that each pixel is detected according to roberts operator detection algorithms is closed by the size of contrast gradient's amplitude and threshold value
System obtains Noisy edge image, denoising is carried out further according to the gradient magnitude of pixel in Noisy edge image, after obtaining denoising
Gradient image helps to improve the accuracy for obtaining marginal information in image.
Content based on above-described embodiment, as a kind of alternative embodiment, the embodiment of the present invention is not to Noisy edge figure
Mode as carrying out denoising specifically limits.Specifically, Noisy edge image is gone using three-dimensional block matching method (BM3D)
It makes an uproar.
It should be noted that common Denoising Algorithm has mean filter and median filtering algorithm.Mean filter denoising is simple
Intuitively, effect is pretty good in eliminating white Gaussian noise, but it can bring edge and details fuzzy;Medium filtering removes salt-pepper noise
Relatively strong, disadvantage can equally bring soft edge and pseudo-edge occurs.And the original image in the embodiment of the present invention is to be related to
To the stereo-picture of various visual angles composition, therefore BM3D methods may be used and carry out denoising.There is similar part to tie for this method combination
The fritter of structure carries out joint denoising and the multiple estimations of effective integration to fritter, and detailed process is:(1) similar block is searched for, similar
Block combination (grouping) at 3D blocks (stack) one by one.(image itself is 2D structures, but is become after stack just at 3D
Structure);(2) all similar three-dimensional bits are combined;(3) the Harr wavelet transformations of three-dimensional bits are calculated;(4) apply Kalman filtering into
Row optimization;(5) Harr inverse wavelet transforms are used;(6) each three-dimensional bits after combined filter form the image after denoising.
Method provided in an embodiment of the present invention carries out denoising using BM3D methods, is more conducive to monitoring scene in vehicle
The lower stereo-picture through various visual angles composition carries out denoising.
Content based on above-described embodiment, as a kind of alternative embodiment, the embodiment of the present invention not to gradient image into
The processing of row non-maxima suppression, the mode for obtaining candidate edge image are specifically limited.Referring to Fig. 3, specifically include:
301, to gradient magnitude in gradient image be 0 or 1 pixel as the pixel in first area;
302, non-maxima suppression processing is carried out to being located at the pixel except first area in gradient image, obtained candidate
Edge image.
It should be noted that gradient magnitude means do not have aberration between two pixels for 0, it is contemplated that interior image
Actual conditions, gradient magnitude mean that two pixels are respectively black pixel point and white pixel point for 1, are also less likely to make
For edge pixel point, therefore, the pixel that gradient magnitude is first 0 or 1 by the embodiment of the present invention as non-edge pixels point,
Non-maxima suppression processing is carried out to non-zero in gradient image and non-1 pixel, to obtain candidate edge image, the present invention is real
The method for applying example helps to improve the arithmetic speed of edge detection.
Content based on above-described embodiment, as a kind of alternative embodiment, the embodiment of the present invention is not to in gradient image
Pixel except first area carries out non-maxima suppression processing, and the mode for obtaining candidate edge image does specific limit
It is fixed.Referring to Fig. 4, specifically include:
401, for being located at any one pixel except first area in gradient image, by the gradient side of the pixel
To 4 parts are divided into, gradient magnitude and weight coefficient that the pixel corresponds to each part are obtained respectively.
Specifically, in processing procedure, the gradient direction θ according to the pixel 8 neighborhoods of pixel (j, j) is needed
(i, j) is divided into 4 parts, wherein 0 °≤θ (i, j)≤45 ° and 180 °<θ(i,j)<225 ° about center pixel pass in a center of symmetry
System, so the two is classified as a part, and so on be divided into 4 parts.Remember that the gradient magnitude of pixel (i, j) is M (i, j), for convenience
Description only considers 0 °≤θ<The case where at 180 °.
When 0 °<θ(i,j)<At 45 °, the gradient magnitude of 4 parts of pixel (i, j) is:
p1=M (i, j+1), p2=M (i-1, j+1), p3=M (i, j-1), p4=M (i+1, j-1)
Gradient magnitude (i.e. p according to pixel in 0 ° and 90 ° directionxAnd py) calculate weight coefficient w:
402, for an arbitrary part, gradient magnitude and weight coefficient according to pixel in the part obtain the pixel
Two interpolation M of the corresponding part of point1And M2:
M1=p1×(1-w)+p2×w
M2=p3×(1-w)+p4×w
It is found out when 45 ° according to above method<θ(i,j)<90 °, -90 °<θ(i,j)<- 45 ° and -45 °<θ(i,j)<At 0 °
Two interpolation.
If 403, being simultaneously greater than two interpolation according to the gradient magnitude of pixel, which is identified as candidate edge
Point.
404, candidate edge image is obtained according to the mark result of all pixels point.
It should be noted that the embodiment of the present invention to being located at the pixel except first area in gradient image by carrying out
Non-maxima suppression processing, on the one hand reduces computing object, provides arithmetic speed, on the other hand largely reduces knot
Interference in fruit and false edge.
Content based on above-described embodiment, as a kind of alternative embodiment, the embodiment of the present invention is not to according to canny operators
Detection algorithm carries out edge detection to candidate edge image, and the mode for obtaining edge image is specifically limited.Referring to Fig. 5, specifically
Including:
S501, according to the frequency of occurrences of the gradient magnitude of candidate marginal in candidate edge image, determine that canny operators are examined
First threshold in method of determining and calculating and second threshold, wherein first threshold be more than second threshold (i.e. first threshold be high threshold, second
Threshold value is Low threshold).
Specifically, know edge feature phase in image by counting the frequency of occurrences of the gradient magnitude of candidate edge pixel
The gradient magnitude distribution situation of pass finds out the global segmentation threshold value of candidate edge image according to gradient magnitude distribution situation, will
Candidate edge image is divided into high gradient regions and low gradient region, further determines that first threshold and the second threshold on this basis
Value.
S502, it is more than first threshold from one gradient magnitude of random search in candidate edge image and not labeled time
Marginal point is selected, is labeled as marginal point, and using the marginal point as datum mark.
It should be noted that occurring refusing very mistake in order to prevent, when choosing datum mark for the first time, will can also at random select
Non-edge point as datum mark, and according to subsequent judgment step, marginal point will necessarily be determined from candidate marginal.
S503, search is more than the pixel of first threshold with the presence or absence of gradient magnitude in 8 neighborhoods of datum mark, if depositing
S504 is then being executed, if being not present, is executing S505;
S504, the pixel that gradient magnitude is more than to first threshold are labeled as marginal point, and return to S503;
S505, search is more than the pixel of second threshold with the presence or absence of gradient magnitude in 8 neighborhoods of datum mark, if depositing
S506 is then being executed, if being not present, is executing S507;
S506, the pixel that gradient magnitude is more than to second threshold are labeled as marginal point, and return to S505;
S507, the pixel that gradient magnitude is less than to second threshold are labeled as non-edge point, return to S502, until candidate side
All candidate marginals are labeled in edge image.
It should be noted that the embodiment of the present invention replaces empirically specifying in the prior art by way of threshold value iteration
The thinking of threshold value obtains objective contour automatically, reduces Human disturbance probability, hoisting machine automatic identification efficiency.
Content based on above-described embodiment, as a kind of alternative embodiment, the embodiment of the present invention is not to according to candidate edge
The frequency of occurrences of the gradient magnitude of candidate marginal in image determines the first threshold and second in canny operator detection algorithms
The mode of threshold value is specifically limited.Referring to Fig. 6, specifically include:
601, the frequency of occurrences of the gradient magnitude of candidate marginal in candidate edge image is counted, histogram is built.
It should be noted that the gradient magnitude of candidate marginal in candidate edge image is counted, and to identical ladder
The pixel number that degree amplitude is included is counted, and is obtained and the relevant histogram of edge feature.
602, the global segmentation threshold value that histogram is obtained according to maximum variance between clusters, is waited according to global segmentation threshold value
Select the high gradient regions in edge image and low gradient region.
It should be noted that histogram reflects information related with image border, and the marginal portion in image only accounts for
Fraction in whole image, according to the actual conditions of image in taxi, with information (such as the target of image detection ---
Driver and passenger) image section gray value it is higher, it is larger with gray value difference around, therefore edge gradient is bigger than normal, and noise
The pseudo-edge gradient that interference or illumination effect generate is then less than normal.Therefore as far as possible by high gradient value in histogram and low Grad
Big degree distinguishes, it will be able to distinguish true edge to a certain extent with false edge.
If in addition, carrying out dividing candidate edge image using single global threshold, obtained edge image can be lost very much
Detail edges region.After constructing histogram, the global segmentation threshold value of gradient image is sought using maximum variance between clusters, it will be high
Gradient region and low gradient region are separated, can find more rational threshold value on the basis of global segmentation threshold value.
603, the mean value and variance for obtaining low gradient region obtain first threshold and second threshold according to mean value and variance.
Specifically, on the basis of by the candidate edge image of non-maxima suppression, according to priori selected threshold
Parameter is determined as the ratio that true edge number of pixels accounts for all pixels.Determine first threshold V on this basishWith
Two threshold value Vl;First threshold VhIf selecting edge region, many and relevant important edges of target information may be lost.
If chosen other than the non-edge in histogram of gradients simultaneously, the generation of more false edge can be inhibited.According to equal
Value and variance can utilize the mean μ of low gradient region in the application value of probability statistics0And variances sigma0 2(according to each pixel
The gradient magnitude average statistical μ of point0And variances sigma0 2) calculate separation between fringe region and non-edge.When first
Threshold value VhMore than desired value μ0With variances sigma0 2The sum of when, it is believed that VhIt, in this way can be with larger journey other than non-edge
Inhibit false edge, therefore V on degreeh=μ0+σ0 2, as second threshold Vl=μ0-σ0 2, when, the effect of canny operator detection algorithms
It is ideal.
According to another aspect of the present invention, a kind of Image Edge-Detection system is also provided, referring to Fig. 7, which is used for
The edge in image is detected in foregoing embodiments.Therefore, the Image Edge-Detection side in foregoing embodiments
Description in method and definition can be used for the understanding of each execution module in the embodiment of the present invention.
As shown, the system includes:
First edge detection module 701, for obtaining each pixel in original image according to roberts operator detection algorithms
The gradient magnitude of point obtains gradient image, wherein roberts operators use 3 × 3 operator templates;
Non-maxima suppression module 702 obtains candidate edge figure for carrying out non-maxima suppression processing to gradient image
The pixel as candidate marginal is marked in candidate edge image for picture;
Second edge detection module 703, for carrying out edge inspection to candidate edge image according to canny operators detection algorithm
It surveys, obtains edge image.
The embodiment of the present invention first passes through first edge detection module and is calculated according to the roberts operators of 3 × 3 operator templates
Accurate gradient magnitude creates good item for canny operator detection algorithms used by progress second edge detection module
Part uses canny operators to boundary in candidate edge image for the pixel of candidate marginal by second edge detection module
It is screened, the calculation amount of canny operator detection algorithms can be reduced, improve computational accuracy, while retaining flatness and extreme value
The advantages of inhibition.
An embodiment of the present invention provides a kind of Image Edge-Detection equipment.Referring to Fig. 8, which includes:Processor
(processor) 801, memory (memory) 802 and bus 803;
Wherein, processor 801 and memory 802 complete mutual communication by bus 803 respectively;Processor 801 is used
In calling the program instruction in memory 802, to execute the method for detecting image edge that above-described embodiment is provided, such as wrap
It includes:The gradient magnitude that each pixel in original image is obtained according to roberts operator detection algorithms, obtains gradient image,
In, roberts operators use 3 × 3 operator templates;Non-maxima suppression processing is carried out to gradient image, obtains candidate edge figure
The pixel as candidate marginal is marked in candidate edge image for picture;According to canny operator detection algorithms to candidate edge
Image carries out edge detection, obtains edge image.
The embodiment of the present invention provides a kind of non-transient computer readable storage medium, the non-transient computer readable storage medium
Matter stores computer instruction, which makes computer execute the method for detecting image edge that above-described embodiment is provided,
Such as including:The gradient magnitude that each pixel in original image is obtained according to roberts operator detection algorithms, obtains gradient map
Picture, wherein roberts operators use 3 × 3 operator templates;Non-maxima suppression processing is carried out to gradient image, obtains candidate side
The pixel as candidate marginal is marked in candidate edge image for edge image;According to canny operator detection algorithms to candidate
Edge image carries out edge detection, obtains edge image.
The apparatus embodiments described above are merely exemplary, wherein can be as the unit that separating component illustrates
Or may not be and be physically separated, the component shown as unit may or may not be physical unit, i.e.,
A place can be located at, or may be distributed over multiple network units.It can select according to the actual needs therein
Some or all of module achieves the purpose of the solution of this embodiment.Those of ordinary skill in the art are not paying creative labor
In the case of dynamic, you can to understand and implement.
Through the above description of the embodiments, those skilled in the art can be understood that each embodiment can
It is realized by the mode of software plus required general hardware platform, naturally it is also possible to pass through hardware.Based on this understanding, on
Stating technical solution, substantially the part that contributes to existing technology can be expressed in the form of software products in other words, should
Computer software product can store in a computer-readable storage medium, such as ROM/RAM, magnetic disc, CD, including several fingers
It enables and using so that a computer equipment (can be personal computer, server or the network equipment etc.) executes each implementation
The method of certain parts of example or embodiment.
Finally it should be noted that:The above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although
Present invention has been described in detail with reference to the aforementioned embodiments, it will be understood by those of ordinary skill in the art that:It still may be used
With technical scheme described in the above embodiments is modified or equivalent replacement of some of the technical features;
And these modifications or replacements, various embodiments of the present invention technical solution that it does not separate the essence of the corresponding technical solution spirit and
Range.
Claims (10)
1. a kind of method for detecting image edge, which is characterized in that including:
The gradient magnitude that each pixel in original image is obtained according to roberts operator detection algorithms, obtains gradient image,
In, the roberts operators use 3 × 3 operator templates;
Non-maxima suppression processing is carried out to the gradient image, obtains candidate edge image, the candidate edge image acceptance of the bid
The pixel as candidate marginal is remembered;
Edge detection is carried out to the candidate edge image according to canny operators detection algorithm, obtains edge image.
2. method for detecting image edge according to claim 1, which is characterized in that described to be detected according to roberts operators
Algorithm obtains the gradient magnitude of each pixel in original image, obtains gradient image, specially:
Gaussian noise is added to the original image, obtains noise image;
The gradient magnitude that each pixel in the noise image is detected according to roberts operator detection algorithms, obtains noisy side
Edge image;
According to the gradient magnitude of pixel in the Noisy edge image, denoising is carried out to the Noisy edge image, obtains institute
State gradient image.
3. method for detecting image edge according to claim 2, which is characterized in that it is described to the Noisy edge image into
Row denoising specially carries out denoising using three-dimensional block matching method to the Noisy edge image.
4. method for detecting image edge according to claim 1, which is characterized in that described non-to gradient image progress
Maximum inhibition is handled, and obtains candidate edge image, specially:
To gradient magnitude in the gradient image be 0 or 1 pixel as the pixel in first area;
Non-maxima suppression processing is carried out to being located at the pixel except the first area in the gradient image, described in acquisition
Candidate edge image.
5. method for detecting image edge according to claim 4, which is characterized in that described to being located in the gradient image
Pixel except the first area carries out non-maxima suppression processing, obtains the candidate edge image, specially:
For being located at any one pixel except the first area in gradient image, by the gradient direction of the pixel point
For 4 parts, gradient magnitude and weight coefficient that the pixel corresponds to each part are obtained respectively;
For an arbitrary part, gradient magnitude and weight coefficient according to pixel in the part, obtaining pixel correspondence should
Two partial interpolation;
If being simultaneously greater than described two interpolation according to the gradient magnitude of pixel, which is identified as candidate marginal;
Candidate edge image is obtained according to the mark result of all pixels point.
6. method for detecting image edge according to claim 1, which is characterized in that described detected according to canny operators is calculated
Method carries out edge detection to the candidate edge image, obtains edge image, specifically includes:
Step 1: according to the frequency of occurrences of the gradient magnitude of candidate marginal in the candidate edge image, the canny is determined
First threshold in operator detection algorithm and second threshold, the first threshold are more than the second threshold;
Step 2: being more than the first threshold from one gradient magnitude of random search in the candidate edge image and not marked
The candidate marginal of note is labeled as marginal point, and using the marginal point as datum mark;
Step 3: search is more than the pixel of the first threshold with the presence or absence of gradient magnitude in 8 neighborhoods of the datum mark,
If in the presence of thening follow the steps four, if being not present, thening follow the steps five;
Step 4: the pixel that gradient magnitude is more than to the first threshold is labeled as marginal point, and return to step three;
Step 5: search is more than the pixel of the second threshold with the presence or absence of gradient magnitude in 8 neighborhoods of the datum mark,
If in the presence of thening follow the steps six, if being not present, thening follow the steps seven;
Step 6: the pixel that gradient magnitude is more than to the second threshold is labeled as marginal point, and return to step five;
Step 7: the pixel that gradient magnitude is less than to the second threshold is labeled as non-edge point, return to step two, until institute
It is labeled to state all candidate marginals in candidate edge image.
7. method for detecting image edge according to claim 6, which is characterized in that described according to the candidate edge image
The frequency of occurrences of the gradient magnitude of middle candidate marginal determines the first threshold and second in the canny operators detection algorithm
Threshold value, specially:
The frequency of occurrences of the gradient magnitude of candidate marginal in the candidate edge image is counted, histogram is built;
The global segmentation threshold value of the histogram is obtained according to maximum variance between clusters;
High gradient regions and the low gradient region in the candidate edge image are obtained according to the global segmentation threshold value;
The mean value and variance for obtaining the low gradient region obtain the first threshold and the second threshold according to the mean value and variance
Value.
8. method for detecting image edge according to claim 7, which is characterized in that described to be obtained according to the mean value and variance
The first threshold and second threshold are obtained, specially:
By the mean value and variance and as the first threshold, using the difference of the mean value and variance as second threshold
Value.
9. a kind of Image Edge-Detection system, which is characterized in that including:
First edge detection module, the ladder for obtaining each pixel in original image according to roberts operator detection algorithms
Amplitude is spent, gradient image is obtained, wherein the roberts operators use 3 × 3 operator templates;
Non-maxima suppression module, for gradient image progress non-maxima suppression processing, obtaining candidate edge image,
The pixel as candidate marginal is marked in the candidate edge image;
Second edge detection module, for carrying out edge detection to the candidate edge image according to canny operators detection algorithm,
Obtain edge image.
10. a kind of Image Edge-Detection equipment, which is characterized in that including:
At least one processor;And
At least one processor being connect with the processor communication, wherein:
The memory is stored with the program instruction that can be executed by the processor, and the processor calls described program to instruct energy
Enough execute method as described in any of the claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810564446.5A CN108416789A (en) | 2018-06-04 | 2018-06-04 | Method for detecting image edge and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810564446.5A CN108416789A (en) | 2018-06-04 | 2018-06-04 | Method for detecting image edge and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108416789A true CN108416789A (en) | 2018-08-17 |
Family
ID=63141242
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810564446.5A Pending CN108416789A (en) | 2018-06-04 | 2018-06-04 | Method for detecting image edge and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108416789A (en) |
Cited By (29)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109063689A (en) * | 2018-08-31 | 2018-12-21 | 江苏航天大为科技股份有限公司 | Facial image hair style detection method |
CN109360217A (en) * | 2018-09-29 | 2019-02-19 | 国电南瑞科技股份有限公司 | Power transmission and transforming equipment method for detecting image edge, apparatus and system |
CN109685846A (en) * | 2018-12-19 | 2019-04-26 | 吉林大学 | Metal object localization method in a kind of X-ray photograph based on Dijkstra |
CN109784213A (en) * | 2018-12-27 | 2019-05-21 | 合肥工业大学 | A kind of non-maxima suppression circuit structure of low cost |
CN109816673A (en) * | 2018-12-27 | 2019-05-28 | 合肥工业大学 | A kind of non-maxima suppression, dynamic threshold calculates and method for detecting image edge |
CN110032964A (en) * | 2019-04-08 | 2019-07-19 | 腾讯科技(成都)有限公司 | Image processing method, method, apparatus, equipment and the storage medium for identifying visual angle |
CN110874844A (en) * | 2018-08-30 | 2020-03-10 | 京东方科技集团股份有限公司 | Line segment detection method, device and equipment |
CN111091107A (en) * | 2019-12-20 | 2020-05-01 | 广州杰赛科技股份有限公司 | Face region edge detection method and device and storage medium |
CN111223116A (en) * | 2020-01-17 | 2020-06-02 | 中国人民解放军国防科学技术大学 | Two-stage edge detection method and device for broken edge target |
CN111476801A (en) * | 2020-03-31 | 2020-07-31 | 万翼科技有限公司 | Image segmentation method, electronic equipment and related product |
CN111815578A (en) * | 2020-06-23 | 2020-10-23 | 浙江大华技术股份有限公司 | Image stripe detection method, video monitoring system and related device |
CN112233134A (en) * | 2020-10-26 | 2021-01-15 | 北京爱奇艺科技有限公司 | Control segmentation method and device, storage medium and electronic equipment |
CN112967303A (en) * | 2021-03-08 | 2021-06-15 | 南京理工大学 | Image edge detection and edge precision verification method thereof |
CN113034525A (en) * | 2021-03-18 | 2021-06-25 | 河北工程大学 | Image edge detection method, device and equipment |
CN113436216A (en) * | 2021-07-06 | 2021-09-24 | 国网信息通信产业集团有限公司 | Electrical equipment infrared image edge detection method based on Canny operator |
CN113544738A (en) * | 2018-12-31 | 2021-10-22 | I-Deal有限责任公司 | Portable acquisition equipment for human body measurement data and method for collecting human body measurement data |
CN113570593A (en) * | 2021-08-10 | 2021-10-29 | 深圳诺博医疗科技有限公司 | Accurate medicament counting method and device, computer equipment and storage medium |
CN113744295A (en) * | 2021-08-20 | 2021-12-03 | 九天创新(广东)智能科技有限公司 | Surface stain detection method and device and cleaning robot |
CN113837198A (en) * | 2021-05-18 | 2021-12-24 | 中国计量大学 | Improved self-adaptive threshold Canny edge detection method based on three-dimensional block matching |
CN113888577A (en) * | 2021-12-01 | 2022-01-04 | 暨南大学 | Image edge detection method, device and medium based on whale optimization algorithm |
CN114331951A (en) * | 2021-09-30 | 2022-04-12 | 腾讯科技(深圳)有限公司 | Image detection method, image detection device, computer, readable storage medium, and program product |
CN114581472A (en) * | 2022-03-11 | 2022-06-03 | 合肥御微半导体技术有限公司 | Image edge detection method and device, electronic equipment and storage medium |
CN114663451A (en) * | 2022-02-28 | 2022-06-24 | 惠州学院 | Edge detection method and system capable of processing noise and texture |
CN114743184A (en) * | 2022-06-10 | 2022-07-12 | 航天科技控股集团股份有限公司 | Driver driving state early warning system |
CN115035050A (en) * | 2022-05-23 | 2022-09-09 | 广东人工智能与先进计算研究院 | Method, device, equipment and product for detecting surface defects of battery pole piece |
CN115170992A (en) * | 2022-09-07 | 2022-10-11 | 山东水发达丰再生资源有限公司 | Image identification method and system for scattered blanking of scrap steel yard |
CN115578357A (en) * | 2022-10-21 | 2023-01-06 | 中国人民解放军战略支援部队信息工程大学 | Medical image edge detection method and system based on quantum algorithm |
CN116385446A (en) * | 2023-06-06 | 2023-07-04 | 山东德圣源新材料有限公司 | Crystal impurity detection method for boehmite production |
CN116630321A (en) * | 2023-07-24 | 2023-08-22 | 铁正检测科技有限公司 | Intelligent bridge health monitoring system based on artificial intelligence |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102789636A (en) * | 2012-08-01 | 2012-11-21 | 中山大学 | Method for enhancing image details on basis of multiscale combined bilateral grid smooth model |
CN105096330A (en) * | 2015-08-20 | 2015-11-25 | 厦门美图之家科技有限公司 | Image processing method capable of automatically recognizing pure-color borders, system and a photographing terminal |
CN108022233A (en) * | 2016-10-28 | 2018-05-11 | 沈阳高精数控智能技术股份有限公司 | A kind of edge of work extracting method based on modified Canny operators |
-
2018
- 2018-06-04 CN CN201810564446.5A patent/CN108416789A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102789636A (en) * | 2012-08-01 | 2012-11-21 | 中山大学 | Method for enhancing image details on basis of multiscale combined bilateral grid smooth model |
CN105096330A (en) * | 2015-08-20 | 2015-11-25 | 厦门美图之家科技有限公司 | Image processing method capable of automatically recognizing pure-color borders, system and a photographing terminal |
CN108022233A (en) * | 2016-10-28 | 2018-05-11 | 沈阳高精数控智能技术股份有限公司 | A kind of edge of work extracting method based on modified Canny operators |
Non-Patent Citations (3)
Title |
---|
孙智鹏等: "改进的自适应 Canny 边缘检测算法", 《电测与仪表》 * |
王方超等: "改进的Roberts图像边缘检测算法", 《探测与控制学报》 * |
陈秋艳: "复杂背景下弱目标检测技术研究", 《中国优秀硕士学位论文全文数据库信息科技辑》 * |
Cited By (45)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11276178B2 (en) | 2018-08-30 | 2022-03-15 | Boe Technology Group Co., Ltd. | Line segment detection method, apparatus, device, and computer-readable storage medium |
CN110874844A (en) * | 2018-08-30 | 2020-03-10 | 京东方科技集团股份有限公司 | Line segment detection method, device and equipment |
CN109063689B (en) * | 2018-08-31 | 2022-04-05 | 江苏航天大为科技股份有限公司 | Face image hairstyle detection method |
CN109063689A (en) * | 2018-08-31 | 2018-12-21 | 江苏航天大为科技股份有限公司 | Facial image hair style detection method |
CN109360217A (en) * | 2018-09-29 | 2019-02-19 | 国电南瑞科技股份有限公司 | Power transmission and transforming equipment method for detecting image edge, apparatus and system |
CN109685846A (en) * | 2018-12-19 | 2019-04-26 | 吉林大学 | Metal object localization method in a kind of X-ray photograph based on Dijkstra |
CN109685846B (en) * | 2018-12-19 | 2023-03-10 | 吉林大学 | Dijkstra-based metal object positioning method in X-ray photograph |
CN109784213A (en) * | 2018-12-27 | 2019-05-21 | 合肥工业大学 | A kind of non-maxima suppression circuit structure of low cost |
CN109784213B (en) * | 2018-12-27 | 2022-10-11 | 合肥工业大学 | Low-cost non-maximum suppression circuit structure |
CN109816673B (en) * | 2018-12-27 | 2022-11-01 | 合肥工业大学 | Non-maximum value inhibition, dynamic threshold value calculation and image edge detection method |
CN109816673A (en) * | 2018-12-27 | 2019-05-28 | 合肥工业大学 | A kind of non-maxima suppression, dynamic threshold calculates and method for detecting image edge |
CN113544738B (en) * | 2018-12-31 | 2024-03-05 | I-Deal有限责任公司 | Portable acquisition device for anthropometric data and method for collecting anthropometric data |
CN113544738A (en) * | 2018-12-31 | 2021-10-22 | I-Deal有限责任公司 | Portable acquisition equipment for human body measurement data and method for collecting human body measurement data |
CN110032964A (en) * | 2019-04-08 | 2019-07-19 | 腾讯科技(成都)有限公司 | Image processing method, method, apparatus, equipment and the storage medium for identifying visual angle |
CN110032964B (en) * | 2019-04-08 | 2023-07-14 | 腾讯科技(成都)有限公司 | Image processing method, device, equipment and storage medium for identifying visual angle |
CN111091107A (en) * | 2019-12-20 | 2020-05-01 | 广州杰赛科技股份有限公司 | Face region edge detection method and device and storage medium |
CN111223116A (en) * | 2020-01-17 | 2020-06-02 | 中国人民解放军国防科学技术大学 | Two-stage edge detection method and device for broken edge target |
CN111476801A (en) * | 2020-03-31 | 2020-07-31 | 万翼科技有限公司 | Image segmentation method, electronic equipment and related product |
CN111815578B (en) * | 2020-06-23 | 2024-05-28 | 浙江大华技术股份有限公司 | Image stripe detection method, video monitoring system and related device |
CN111815578A (en) * | 2020-06-23 | 2020-10-23 | 浙江大华技术股份有限公司 | Image stripe detection method, video monitoring system and related device |
CN112233134A (en) * | 2020-10-26 | 2021-01-15 | 北京爱奇艺科技有限公司 | Control segmentation method and device, storage medium and electronic equipment |
CN112967303B (en) * | 2021-03-08 | 2022-10-21 | 南京理工大学 | Image edge detection and edge precision verification method thereof |
CN112967303A (en) * | 2021-03-08 | 2021-06-15 | 南京理工大学 | Image edge detection and edge precision verification method thereof |
CN113034525A (en) * | 2021-03-18 | 2021-06-25 | 河北工程大学 | Image edge detection method, device and equipment |
CN113837198B (en) * | 2021-05-18 | 2023-11-28 | 中国计量大学 | Improved self-adaptive threshold Canny edge detection method based on three-dimensional block matching |
CN113837198A (en) * | 2021-05-18 | 2021-12-24 | 中国计量大学 | Improved self-adaptive threshold Canny edge detection method based on three-dimensional block matching |
CN113436216B (en) * | 2021-07-06 | 2024-03-05 | 国网信息通信产业集团有限公司 | Electrical equipment infrared image edge detection method based on Canny operator |
CN113436216A (en) * | 2021-07-06 | 2021-09-24 | 国网信息通信产业集团有限公司 | Electrical equipment infrared image edge detection method based on Canny operator |
CN113570593A (en) * | 2021-08-10 | 2021-10-29 | 深圳诺博医疗科技有限公司 | Accurate medicament counting method and device, computer equipment and storage medium |
CN113570593B (en) * | 2021-08-10 | 2024-05-14 | 深圳诺博医疗科技有限公司 | Accurate counting method and device for medicament, computer equipment and storage medium |
CN113744295A (en) * | 2021-08-20 | 2021-12-03 | 九天创新(广东)智能科技有限公司 | Surface stain detection method and device and cleaning robot |
CN114331951A (en) * | 2021-09-30 | 2022-04-12 | 腾讯科技(深圳)有限公司 | Image detection method, image detection device, computer, readable storage medium, and program product |
CN113888577A (en) * | 2021-12-01 | 2022-01-04 | 暨南大学 | Image edge detection method, device and medium based on whale optimization algorithm |
CN114663451A (en) * | 2022-02-28 | 2022-06-24 | 惠州学院 | Edge detection method and system capable of processing noise and texture |
CN114581472A (en) * | 2022-03-11 | 2022-06-03 | 合肥御微半导体技术有限公司 | Image edge detection method and device, electronic equipment and storage medium |
CN115035050A (en) * | 2022-05-23 | 2022-09-09 | 广东人工智能与先进计算研究院 | Method, device, equipment and product for detecting surface defects of battery pole piece |
CN114743184A (en) * | 2022-06-10 | 2022-07-12 | 航天科技控股集团股份有限公司 | Driver driving state early warning system |
CN115170992A (en) * | 2022-09-07 | 2022-10-11 | 山东水发达丰再生资源有限公司 | Image identification method and system for scattered blanking of scrap steel yard |
CN115170992B (en) * | 2022-09-07 | 2022-12-06 | 山东水发达丰再生资源有限公司 | Image identification method and system for scattered blanking of scrap steel yard |
CN115578357B (en) * | 2022-10-21 | 2023-11-21 | 中国人民解放军战略支援部队信息工程大学 | Medical image edge detection method and system based on quantum algorithm |
CN115578357A (en) * | 2022-10-21 | 2023-01-06 | 中国人民解放军战略支援部队信息工程大学 | Medical image edge detection method and system based on quantum algorithm |
CN116385446A (en) * | 2023-06-06 | 2023-07-04 | 山东德圣源新材料有限公司 | Crystal impurity detection method for boehmite production |
CN116385446B (en) * | 2023-06-06 | 2023-08-15 | 山东德圣源新材料有限公司 | Crystal impurity detection method for boehmite production |
CN116630321A (en) * | 2023-07-24 | 2023-08-22 | 铁正检测科技有限公司 | Intelligent bridge health monitoring system based on artificial intelligence |
CN116630321B (en) * | 2023-07-24 | 2023-10-03 | 铁正检测科技有限公司 | Intelligent bridge health monitoring system based on artificial intelligence |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108416789A (en) | Method for detecting image edge and system | |
Sharma et al. | A comparative study of edge detectors in digital image processing | |
JP6660313B2 (en) | Detection of nuclear edges using image analysis | |
Juneja et al. | Performance evaluation of edge detection techniques for images in spatial domain | |
CN111080661B (en) | Image-based straight line detection method and device and electronic equipment | |
Smith et al. | SUSAN—a new approach to low level image processing | |
CN109741356B (en) | Sub-pixel edge detection method and system | |
CN108898610A (en) | A kind of object contour extraction method based on mask-RCNN | |
CN113034452B (en) | Weldment contour detection method | |
CN108022233A (en) | A kind of edge of work extracting method based on modified Canny operators | |
WO2021109697A1 (en) | Character segmentation method and apparatus, and computer-readable storage medium | |
Selvakumar et al. | The performance analysis of edge detection algorithms for image processing | |
CN110415208A (en) | A kind of adaptive targets detection method and its device, equipment, storage medium | |
Igbinosa | Comparison of edge detection technique in image processing techniques | |
CN109712158A (en) | A kind of infrared small target catching method based on target background pixel statistical restraint | |
JP2016505185A (en) | Image processor having edge selection function | |
Alazzawi | Edge detection-application of (first and second) order derivative in image processing: communication | |
CN108510510A (en) | Method for detecting image edge based on gradient direction | |
Bhadauria et al. | Comparison between various edge detection methods on satellite image | |
CN117764983A (en) | Visual detection method for binocular identification of intelligent manufacturing production line | |
CN112396618A (en) | Grain boundary extraction and grain size measurement method based on image processing | |
Othman et al. | Road crack detection using adaptive multi resolution thresholding techniques | |
Anandakrishnan et al. | An evaluation of popular edge detection techniques in digital image processing | |
Rana et al. | Review on traditional methods of edge detection to morphological based techniques | |
CN111951254B (en) | Edge-guided weighted-average-based source camera identification method and system |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180817 |