CN108242060A - A kind of method for detecting image edge based on Sobel operators - Google Patents
A kind of method for detecting image edge based on Sobel operators Download PDFInfo
- Publication number
- CN108242060A CN108242060A CN201611243522.XA CN201611243522A CN108242060A CN 108242060 A CN108242060 A CN 108242060A CN 201611243522 A CN201611243522 A CN 201611243522A CN 108242060 A CN108242060 A CN 108242060A
- Authority
- CN
- China
- Prior art keywords
- edge
- image
- sobel
- filter
- template
- 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
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
Landscapes
- Image Analysis (AREA)
- Image Processing (AREA)
Abstract
The invention discloses a kind of method for detecting image edge based on Sobel operators, include the following steps:1) filtering process is guided to pending original image;2) edge image processing is carried out using improved sobel method to filtered image;3) Sobel operators are reused to above-mentioned edge image and carry out image secondary edge detection;4) edge filter is carried out to above-mentioned image, edge strength is small and the short marginal point of boundary chain to filter out, and obtains final edge image.The method for detecting image edge of the present invention uses guiding filtering, and changing small region in image pixel intensities has done a weighted mean filter, and is changing big region, very weak to the filter effect of image, but is conducive to keep edge;Secondly using improved sobel method edge detection, secondary Sobel operator edge detections and edge filter, the accuracy of Image Edge-Detection is improved.
Description
Technical field
The present invention relates to a kind of edge detection method of image, especially a kind of image border inspection based on Sobel operators
Survey method belongs to the technical field of image procossing.
Background technology
Image border is one of most basic feature of image, because in image identification and image analysis, marginal information energy
The contour shape of enough objects of description well.And the shape feature of object in itself can be not only extracted by edge detection, moreover it is possible to
Enough substantially reduce subsequent image and analyze data volume to be treated, thus Image Edge-Detection be in image procossing one very
Important technology, and it has been widely used for the fields such as target identification, target following, fingerprint recognition.So edge of image
Detection has the function of very crucial in image procossing.
Method for detecting image edge is broadly divided into three categories:The first kind is classical edge extracting method, including first differential
Operator and Second Order Differential Operator, first order differential operator include Roberts operators, Sobel operators, Kirsch operators, Prewitt and calculate
Son etc., Second Order Differential Operator include Log operators, Marr operators, Canny operators etc.;Second class is multi-scale method, as small echo becomes
It changes, it is characterized in that carrying out multiscale analysis, and sign mutation to function or signal by calculation functions such as flexible and translations
Point detects and is a critically important application of wavelet transformation by marginal point reconstruction original signal or image;Third class is will be fuzzy
Mathematics, neuroid and mathematical morphology etc. are applied to edge detection.Any of the above edge detection method has respective excellent scarce
Point and suitable application area.In recent years, it with the fast development of machine vision technique, extensively should be obtained in terms of industrial detection
With the part quality context of detection particularly during industrial production part.It is usually used in part quality detecting system
The mode that industrial camera and computer are combined is acquired image, handles and analyzes, and with this is to judge part quality
No qualification.Within the system, the Image Edge-Detection of part is one of important technology for judging whether part is qualified.
In industrial detection, classical edge extracting method is maximally efficient.Wherein, Sobel operators are with vertically and horizontally two
Direction template makees image convolution and carries out edge detection, since its method is simple, calculation amount is small, processing speed is fast, is commonly used in
In real time image processing system.But the edge direction that Sobel algorithms can detect is limited, only to vertical and horizontal orientation-sensitive,
A part of edge is easily lost, anti-noise ability is relatively low, and is susceptible to the wide phenomenon of the more pixels in edge, this brings to its use
Limitation.So a kind of method for detecting image edge based on Sobel operators has important research meaning.
Invention content
For problems of the prior art with insufficient, the present invention proposes a kind of image detection based on Sobel operators
Method, to improve the anti-noise ability of edge detection and accuracy.
According to technical solution provided by the invention, a kind of method for detecting image edge based on Sobel operators, including following
Step:
U1, filtering process is guided to pending original image;
U2, edge detection for the first time is carried out to filtered image using improved Sobel operators template;
U3, secondary edge detection is carried out to edge image for the first time using Sobel operators template;
U4, secondary edge image is carried out using edge filter to filter out the marginal point that edge strength is small and boundary chain is short.
In the step U1, when being filtered using guiding filtering to original image, the input picture of selection with it is to be filtered
Image it is identical.
In the step U2, edge detection for the first time is carried out to filtered image using improved Sobel operators template,
Include the following steps:
U2.1, improved sobel method template is established, respectively:
U2.2, the corresponding image pixel value of the coefficient in template is multiplied, calculates gradient;
U2.3, the new gray value for calculating the pixel;
U2.4, setting optimal threshold, judge whether the pixel is marginal point.
In the step U3, convolution is done to edge image for the first time using Sobel operators template, carries out secondary edge detection,
Include the following steps:
U3.1, Sobel operator templates are established, Sobel operators template includes both horizontally and vertically template, respectively:
U3.2, the corresponding image pixel value of the coefficient in template is multiplied, calculates gradient;
U3.3, the new gray value for calculating the pixel;
U3.4, setting optimal threshold, judge whether the pixel is marginal point.
In the step U4, to secondary edge image filter out that edge strength is small and boundary chain is short using edge filter
Marginal point includes the following steps;
U4.1, setting boundary chain length threshold and boundary chain intensity threshold;
U4.2, in 8 field of image, connect adjacent marginal point, if length be more than edge chain length high threshold point protect
It stays, is filtered out if the point less than Low threshold, if point of the length between high-low threshold value, if these points can be with the point of high threshold
It is connected on one edge chain and then retains, otherwise filter out, finally obtain the set of several boundary chains;
U4.3, it is closed in the obtained collection of several boundary chains of step U4.2 and carries out edge strength again and filter out, if intensity is big
Then retain in the point of boundary chain high threshold, otherwise filter out.
The beneficial effect of the present invention compared with the prior art is:
Method for detecting image edge provided by the present invention based on Sobel operators, first guides image filtering,
Secondly Sobel operator edge detections are improved to filtered image, carry out the inspection of Sobel operators edge to edge image again
It surveys, edge filter finally is carried out to secondary edge image.It can be realized using guiding filtering method small in image pixel intensities variation
Region is changing big region as a weighted mean filter, very weak to the filter effect of image, but is conducive to keep side
Edge;Edge detection is carried out using improved Sobel operators, enhances edge detail information, but does not extract edge, therefore
It needs to carry out secondary Sobel edge extractings;Finally reduce pseudo-edge using edge filter, improve the accurate of edge positioning
Degree.
Description of the drawings
Fig. 1 is present invention specific implementation flow chart.
Specific embodiment
With reference to embodiment and compare attached drawing the present invention is described in further details.
As shown in Figure 1, the flow chart for the method for detecting image edge in present embodiment, includes the following steps:
U1, filtering process is guided to pending original image;
U2, edge detection for the first time is carried out to filtered image using improved Sobel operators template;
U3, secondary edge detection is carried out to edge image for the first time using Sobel operators template;
U4, secondary edge image is carried out using edge filter to filter out the marginal point that edge strength is small and boundary chain is short.
Wherein in U1 steps, Local Linear Model is initially set up;Secondly linear function coefficients are solved;Finally according to linear mould
Type coefficient and original image determine finally to filter output image.
The specific implementation step of step U1 is as follows:
U1.1, Local Linear Model is established;
Local Linear Model is:
Wherein, q is the value of output pixel, and I is the value of input picture, and a and b are the linear letters when window center is located at k
Several coefficients, i and k are pixel index.In fact, input picture is not necessarily image to be filtered in itself or other figures
Picture i.e. navigational figure, in the method, input picture and image to be filtered itself are identical.
Then gradient is taken to above formula both sides, it is as follows formula can be obtained:
I.e. when input picture I has gradient, output q also has similar gradient, whereinIt is gradient signs.
U1.2, linear function coefficients a is solvedkAnd bk;
Due to
qi=pi-ni,
Wherein, p is guiding filtering image, and n is noise, so to determine linear coefficient, and meet the difference so that q and p
Minimum, is converted into optimization problem, and formula is as follows:
Wherein, ∈ is the big a of a punishmentkRegularization parameter.
Then coefficient a can be acquired by least square method to above-mentioned formulakAnd bk, it is as follows respectively:
Wherein μkIt is I in window ωkIn average value,It is I in window ωkIn variance, | ω | be window ωkMiddle picture
The quantity of element,It is image p to be filtered in window ωkIn mean value.
U1.3, final filtering output image q is determinedi;
Input picture and linear coefficient are brought into Local Linear Model, you can obtain output image qi。
In U2 steps, improved sobel method template is initially set up;Secondly by the corresponding image slices of the coefficient in template
Element value is multiplied;The new gray value of the pixel is calculated again;Optimal threshold is finally set, judges whether the pixel is marginal point.
The specific implementation step of step U2 is as follows:
U2.1, improved sobel method template is established;
Since Sobel operators are to both horizontally and vertically most sensitive, with reference to two side of horizontal and vertical of Kirsch operators
To template, experiment proves that, improved sobel method template is obtained, it is as follows respectively:
U2.2, the corresponding image pixel value of the coefficient in template is multiplied, calculates gradient;
If 8 field pixel of image is as follows:
Improved sobel method template includes four kinds of templates, respectively by the corresponding image pixel value of the coefficient in template
It is multiplied, obtains gradient, i.e. gradient calculation formula is:
G1=(z7+2z8+z9)-(z1+2z2+z3),
G2=(z3+2z6+z9)-(z1+2z4+z7),
G3=-(z1+2z2-z3)-(2z4-z6)-(z7+2z8-z9),
G4=(z1+2z2+z3)-2(z4+z6)-(z7+2z8+z9);
U2.3, the new gray value for calculating the pixel;
The new gray value of each pixel of image calculates the size of the gradient by the following formula:
G=max | G1| |G2| |G3| |G4|,
Solve G1、G2、G3、G4The maximum value of four gradient absolute values, and the maximum value of four convolution is assigned in image
The pixel of corresponding templates center, the new gray value G as the pixel.
U2.4, setting optimal threshold, judge whether the pixel is marginal point;
Optimal threshold T is set, if during pixel Grad G >=T, which is marginal point, and otherwise the point is not marginal point.
In U3 steps, Sobel operator templates are initially set up;Secondly by the corresponding image pixel value of the coefficient in template
It is multiplied;The new gray value of the pixel again;Optimal threshold is finally set, it, should if the new gray value of pixel is more than the optimal threshold
Pixel is marginal point.
U3.1, Sobel operator templates are established;
Sobel operators template includes both horizontally and vertically template, as follows respectively:
U3.2, the corresponding image pixel value of the coefficient in template is multiplied, calculates gradient;
If 8 field pixel of image is as follows:
Sobel operators template includes both horizontally and vertically template, respectively by the corresponding figure of the coefficient in template
As pixel value multiplication, gradient is obtained, i.e. gradient calculation formula is:
Gx=(z7+2z8+z9)-(z1+2z2+z3),
Gy=(z3+2z6+z9)-(z1+2z4+z7);
U3.3, the new gray value for calculating the pixel;
The new gray value of each pixel of image calculates the size of the gradient by the following formula:
G=| Gx|+|Gy|,
Solve GxAnd GxThe sum of absolute value, and by this and the pixel for being assigned to corresponding templates center in image, as this
The new gray value G of pixel.
U3.4, setting optimal threshold, judge whether the pixel is marginal point;
Optimal threshold T is set, if during pixel Grad G >=T, which is marginal point, and otherwise the point is not marginal point.
In U4 steps, boundary chain length threshold and boundary chain intensity threshold are set first;Secondly by edge chain length threshold
Value judges whether the pixel retains;Judge whether the pixel retains finally by boundary chain intensity threshold.
U4.1, setting boundary chain length threshold T1 and boundary chain intensity threshold T2;
U4.2, in 8 field of image, connect adjacent marginal point, if length be more than edge chain length high threshold T1 point
Retain, filtered out if the point less than Low threshold T1, if point of the length between high-low threshold value T1, if these points can be with high threshold
The point of value, which is connected on one edge chain, then to be retained, and is otherwise filtered out, is finally obtained the set of several boundary chains;
U4.3, it is closed in the obtained collection of several boundary chains of step U4.2 and carries out edge strength again and filter out, if intensity is big
Then retain in the point of boundary chain high threshold T2, otherwise filter out.
Claims (1)
1. a kind of method for detecting image edge based on Sobel operators, which is characterized in that include the following steps:
U1, filtering process is guided to pending original image;
U2, edge detection for the first time is carried out to filtered image using improved Sobel operators template;
U3, secondary edge detection is carried out to edge image for the first time using Sobel operators template;
U4, secondary edge image is carried out using edge filter to filter out the marginal point that edge strength is small and boundary chain is short;
In the step U2, edge detection for the first time is carried out to filtered image using improved Sobel operators template, including
Following steps:
U2.1, improved sobel method template is established, respectively:
U2.2, the corresponding image pixel value of the coefficient in template is multiplied, calculates gradient;
U2.3, the new gray value for calculating the pixel;
U2.4, setting optimal threshold, judge whether the pixel is marginal point.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611243522.XA CN108242060A (en) | 2016-12-23 | 2016-12-23 | A kind of method for detecting image edge based on Sobel operators |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611243522.XA CN108242060A (en) | 2016-12-23 | 2016-12-23 | A kind of method for detecting image edge based on Sobel operators |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108242060A true CN108242060A (en) | 2018-07-03 |
Family
ID=62702850
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611243522.XA Pending CN108242060A (en) | 2016-12-23 | 2016-12-23 | A kind of method for detecting image edge based on Sobel operators |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108242060A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111523373A (en) * | 2020-02-20 | 2020-08-11 | 广州杰赛科技股份有限公司 | Vehicle identification method and device based on edge detection and storage medium |
CN111553868A (en) * | 2020-04-29 | 2020-08-18 | 南京航空航天大学 | Tunnel reflectivity image filtering method based on improved sobel operator |
CN111735448A (en) * | 2020-06-23 | 2020-10-02 | 上海航天控制技术研究所 | Star map joint non-uniform correction method, equipment and storage medium |
CN113643272A (en) * | 2021-08-24 | 2021-11-12 | 凌云光技术股份有限公司 | Target positioning modeling method |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102289825A (en) * | 2011-07-08 | 2011-12-21 | 暨南大学 | Real-time image edge detection circuit and realization method thereof |
US20120050563A1 (en) * | 2010-09-01 | 2012-03-01 | Apple Inc. | Flexible color space selection for auto-white balance processing |
CN104732555A (en) * | 2015-04-13 | 2015-06-24 | 南通理工学院 | Image edge detection method based on Sobel operator |
CN104899888A (en) * | 2015-06-18 | 2015-09-09 | 大连理工大学 | Legemdre moment-based image subpixel edge detection method |
CN105761230A (en) * | 2016-03-16 | 2016-07-13 | 西安电子科技大学 | Single image defogging method based on sky region segmentation processing |
CN106228138A (en) * | 2016-07-26 | 2016-12-14 | 国网重庆市电力公司电力科学研究院 | A kind of Road Detection algorithm of integration region and marginal information |
-
2016
- 2016-12-23 CN CN201611243522.XA patent/CN108242060A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120050563A1 (en) * | 2010-09-01 | 2012-03-01 | Apple Inc. | Flexible color space selection for auto-white balance processing |
CN102289825A (en) * | 2011-07-08 | 2011-12-21 | 暨南大学 | Real-time image edge detection circuit and realization method thereof |
CN104732555A (en) * | 2015-04-13 | 2015-06-24 | 南通理工学院 | Image edge detection method based on Sobel operator |
CN104899888A (en) * | 2015-06-18 | 2015-09-09 | 大连理工大学 | Legemdre moment-based image subpixel edge detection method |
CN105761230A (en) * | 2016-03-16 | 2016-07-13 | 西安电子科技大学 | Single image defogging method based on sky region segmentation processing |
CN106228138A (en) * | 2016-07-26 | 2016-12-14 | 国网重庆市电力公司电力科学研究院 | A kind of Road Detection algorithm of integration region and marginal information |
Non-Patent Citations (1)
Title |
---|
许宏科等: "一种改进的边缘细化方法", 《激光与红外》 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111523373A (en) * | 2020-02-20 | 2020-08-11 | 广州杰赛科技股份有限公司 | Vehicle identification method and device based on edge detection and storage medium |
CN111523373B (en) * | 2020-02-20 | 2023-09-19 | 广州杰赛科技股份有限公司 | Vehicle identification method and device based on edge detection and storage medium |
CN111553868A (en) * | 2020-04-29 | 2020-08-18 | 南京航空航天大学 | Tunnel reflectivity image filtering method based on improved sobel operator |
CN111553868B (en) * | 2020-04-29 | 2022-03-01 | 南京航空航天大学 | Tunnel reflectivity image filtering method based on improved sobel operator |
CN111735448A (en) * | 2020-06-23 | 2020-10-02 | 上海航天控制技术研究所 | Star map joint non-uniform correction method, equipment and storage medium |
CN113643272A (en) * | 2021-08-24 | 2021-11-12 | 凌云光技术股份有限公司 | Target positioning modeling method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Tang et al. | Automatic crack detection and segmentation using a hybrid algorithm for road distress analysis | |
CN107169953B (en) | Bridge concrete surface crack detection method based on HOG characteristics | |
CN104299008B (en) | Vehicle type classification method based on multi-feature fusion | |
CN104156693B (en) | A kind of action identification method based on the fusion of multi-modal sequence | |
CN107808161B (en) | Underwater target identification method based on optical vision | |
CN106446952A (en) | Method and apparatus for recognizing score image | |
CN109410228A (en) | Internal wave of ocean detection algorithm based on Method Based on Multi-Scale Mathematical Morphology Fusion Features | |
CN108764186A (en) | Personage based on rotation deep learning blocks profile testing method | |
CN108242060A (en) | A kind of method for detecting image edge based on Sobel operators | |
Hu et al. | A multi-directions algorithm for edge detection based on fuzzy mathematical morphology | |
CN110276759B (en) | Mobile phone screen bad line defect diagnosis method based on machine vision | |
CN109446913A (en) | A kind of detection method for judging vehicle bottom and whether reequiping | |
Zhao et al. | Recognition of flooding and sinking conditions in flotation process using soft measurement of froth surface level and QTA | |
Anandakrishnan et al. | An evaluation of popular edge detection techniques in digital image processing | |
Yu et al. | Optimized self-adapting contrast enhancement algorithm for wafer contour extraction | |
CN105930811A (en) | Palm texture feature detection method based on image processing | |
CN104778662A (en) | Millimeter-wave image enhancing method and system | |
CN104102911A (en) | Image processing for AOI (automated optical inspection)-based bullet appearance defect detection system | |
CN116524269A (en) | Visual recognition detection system | |
Barbu | Automatic edge detection solution using anisotropic diffusion-based multi-scale image analysis and fine-to-coarse tracking | |
Bhat et al. | A mixed model based on Watershed and Active contour algorithms for brain tumor segmentation | |
Akter et al. | Integration of contourlet transform and canny edge detector for brain image segmentation | |
CN112116579B (en) | Defect detection method and device for transparent medicine bottle | |
CN115409768A (en) | Water leakage disease deep learning detection method based on characteristic input enhancement | |
CN114354631A (en) | Valve blank surface defect detection method based on vision |
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 | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20180703 |
|
WD01 | Invention patent application deemed withdrawn after publication |