CN108470345A - A kind of method for detecting image edge of adaptive threshold - Google Patents
A kind of method for detecting image edge of adaptive threshold Download PDFInfo
- Publication number
- CN108470345A CN108470345A CN201710100735.5A CN201710100735A CN108470345A CN 108470345 A CN108470345 A CN 108470345A CN 201710100735 A CN201710100735 A CN 201710100735A CN 108470345 A CN108470345 A CN 108470345A
- Authority
- CN
- China
- Prior art keywords
- image
- threshold
- gradient
- value
- edge
- 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.)
- Withdrawn
Links
- 238000000034 method Methods 0.000 title claims abstract description 42
- 230000003044 adaptive effect Effects 0.000 title claims abstract description 11
- 238000003708 edge detection Methods 0.000 claims abstract description 31
- 230000004044 response Effects 0.000 claims abstract description 13
- 230000001629 suppression Effects 0.000 claims abstract description 5
- 238000004364 calculation method Methods 0.000 claims description 7
- 238000001514 detection method Methods 0.000 claims description 5
- 239000000463 material Substances 0.000 claims description 3
- 239000002246 antineoplastic agent Substances 0.000 description 1
- 229940041181 antineoplastic drug Drugs 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 238000003709 image segmentation Methods 0.000 description 1
- 238000010187 selection method Methods 0.000 description 1
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/20—Special algorithmic details
- G06T2207/20004—Adaptive image processing
- G06T2207/20008—Globally adaptive
-
- 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/20—Special algorithmic details
- G06T2207/20024—Filtering details
Landscapes
- Image Analysis (AREA)
Abstract
The invention discloses a kind of method for detecting image edge of adaptive threshold, include the following steps:S1:It selects two-dimensional Gaussian function as filter, gives the value range of filter size w respectively、And the value of α;S2:Image is calculated separately in the skirt response value in 0 °, 45 °, 90 ° and 135 ° direction using edge detection operator to input picture, calculates image gradient;S3:Image gradient is normalized, calculates the histogram h (I) of gradient image, and calculate separately candidate thresholdsWith;S4:It is assumed that,, calculate separatelyWithRatio of the corresponding non-edge pixels point in gradient image pixel point be respectivelyWith, judgeWhether meet, if satisfied, then going to step S5, otherwise going to step S2 after determining filter size continues to calculate;S5:Determine the high threshold of hysteresis threshold, Low threshold takes
Description
Technical Field
The invention relates to the field, in particular to a method for preparing a novel anti-cancer drug.
Background
The edge features are used as important image bottom layer features and are widely applied to the fields of image segmentation, target detection and identification, industrial detection, stereoscopic vision and the like. The image edge detection result has a direct influence on subsequent image processing and understanding, and the technology thereof is an important research subject in the field of image processing.
Among the many edge detection methods proposed in recent years, an edge detection method based on a gaussian function has gained wide attention and research due to its unique advantages. Such edge detection algorithms typically employ a single or multiple gaussian functions for edge detection. The edge detection method based on multiple Gaussian functions has the disadvantages of large calculated amount and difficult parameter setting because filtering results of the Gaussian functions need to be fused. Edge detection algorithms based on single gaussian functions are widely used due to simple computation, typically Canny operators. The Canny operator smoothes the image using a gaussian filter, calculates the gradient of the image, performs Non-maximum supression (NMS) according to the gradient direction, and determines edge pixels using a hysteresis threshold method (hystersthresh-solving). Studies have shown that the performance of the Canny operator depends largely on the efficiency of NMS and hysteresis thresholding. How to determine the hysteresis threshold has been the focus of research in edge detection algorithms.
At present, methods for determining a hysteresis threshold in an unsupervised manner are roughly divided into two categories, 1) calculating the hysteresis threshold by estimating image noise; 2) an optimal threshold for a certain criterion is found from the candidate thresholds as a hysteresis threshold. The first method requires statistics of image noise characteristics and suppression of noise, and thus has a large calculation amount. The second method needs to provide a selection range and a judgment criterion of a candidate threshold, and the used threshold selection criterion has an important influence on the performance of the algorithm.
The two types of hysteresis threshold determination methods described above are still limited to selecting thresholds based on image characteristics (e.g., gradient), and do not take into account the effect of filter size on hysteresis thresholds. Because the image gradients of different scales can be obtained by adopting the Gaussian filters of different sizes, and the influence of noise on the gradient image generally changes along with the change of the image scale, the noise has larger influence on the image gradient under a small scale, and the influence of the noise on the image gradient is relatively smaller under a large scale. It follows that the hysteresis threshold depends on the image gradient, which in turn is related to the filter size, so the coupling between the filter size and the hysteresis threshold should be taken into account when selecting the hysteresis threshold.
Disclosure of Invention
The invention aims to solve the technical problem of providing.
An adaptive threshold image edge detection method comprises the following steps:
s1: selecting two-dimensional Gaussian function as filter, and respectively setting value range of filter size w、and the value of alpha, take the distanceThe most recent odd number is taken as the filter size,the value of the threshold value of the proportion difference value of the non-edge pixel pointsα take on the value;
S2: respectively calculating edge response values of the image in the directions of 0 degree, 45 degrees, 90 degrees and 135 degrees by adopting an edge detection operator for the input image, and calculating image gradient;
s3: normalizing the image gradient, calculating histogram h (I) of the gradient image, and calculating candidate threshold values respectivelyAnd;
s4: it is assumed that,,respectively calculateAndthe proportion of the corresponding non-edge pixel points in the gradient image pixel points is respectivelyAndjudgment ofWhether or not to satisfyIf yes, go to step S5, otherwise, go to step S2 to continue calculating after determining the filter size;
S5: high threshold for determining hysteresis thresholdLow threshold fetch;
S6: and carrying out non-maximum suppression (NMS) on the image gradient amplitude, and detecting and connecting edges by adopting a hysteresis threshold method to obtain the image edges.
Further, the expression of the two-dimensional gaussian function is:
。
further, a specific method for calculating an edge response value by using an edge detection operator is as follows:
differentiating the expression of the two-dimensional Gaussian function along the x axis and the y axis respectively to obtain differential operators of the Gaussian function along the x axis and the y axis:
,
,
based on the above formula, a detection operator for detecting the edge of the image in any direction is constructed as follows:
,
wherein,representing an angle of an image edge; adopting the above formula edge detection operator to input imagesPerforming convolution to obtain an imageImage edge corresponding value of direction:
,
wherein,which represents a convolution of the signals of the first and second,
,
。
further, the image gradient is calculated as follows:
by solving the image edge responses in different directions, the total image edge response can be obtained, i.e. the image gradient is:
,
wherein n is the image edge angleThe number of (2).
Further, a specific method for calculating the histogram h (I) of the gradient image is as follows:
assuming that the gradient of the image I is normalized, so that the number of pixels of the gradient image is N, the gray scale range is [1, L ], and the number of pixels corresponding to the gray level is 1 ≦ I ≦ L, the probability is:
,
and is provided with a plurality of groups of the materials,
,
according toA histogram of image gradients h (I) may be obtained.
Further, candidate thresholdsThe calculation method of (2) is as follows:
1) skewness of image gradient histogram h (I)And kurtosisCan be expressed as:
,,
wherein,representing the nth-order center distance corresponding to the first I gray levels in h (I);
degree of deviationAnd kurtosisCustomization of value range ofOrThe corresponding histogram gray value interval is called a histogram RIO;
2) let RIO correspond to a histogram with a gray scale value range ofAnd calculating each gray levelThe corresponding gradient image inter-class variance is:
,
wherein,
,
,
make itMaximum gray level as candidate edge threshold of gradient image。
Further, candidate thresholdsThe calculation method of (2) is as follows:
assuming that the total number of image pixel points is N and the proportion of non-edge pixel points is r, taking r =0.7, accumulating the number of image points in sequence from low to high in the image gradient histogram, and when the accumulated number reaches the valueThen, the corresponding image gradient value is taken as a candidate threshold value。
Further, the specific method for determining the size of the filter is as follows:
let the filter size w take on a value range ofThen, given an initial value, the value of w is within the range of valuesThe value is determined iteratively:
。
further, hysteresis thresholdThe value taking method comprises the following steps:
,
wherein,andthe proportion of non-edge pixel points in the gradient image is,The corresponding gradient values of the image are taken,,。
the invention has the beneficial effects that:
the method is based on a differential operator of a two-dimensional Gaussian function, and the image gradient is calculated by constructing a multi-direction edge detection filter. In order to reduce the influence of noise on the image gradient, a method for adaptively determining the size of a filter according to a candidate threshold value is provided. On the basis of determining the size of the filter, an adaptive selection method of the hysteresis threshold is further provided. The method can adaptively select the size of the filter and the hysteresis threshold according to the noise condition of the image, and has good anti-noise performance.
Detailed Description
The following specific examples further illustrate the invention but are not intended to limit the invention thereto.
An adaptive threshold image edge detection method comprises the following steps:
s1: selecting two-dimensional Gaussian function as filter, and respectively setting value range of filter size w、and the value of alpha, take the distanceThe most recent odd number is taken as the filter size,the value of the threshold value of the proportion difference value of the non-edge pixel pointsα take on the value;
S2: respectively calculating edge response values of the image in the directions of 0 degree, 45 degrees, 90 degrees and 135 degrees by adopting an edge detection operator for the input image, and calculating image gradient;
s3: normalizing the image gradient, calculating histogram h (I) of the gradient image, and calculating candidate threshold values respectivelyAnd;
s4: it is assumed that,,respectively calculateAndthe proportion of the corresponding non-edge pixel points in the gradient image pixel points is respectivelyAndjudgment ofWhether or not to satisfyIf yes, go to step S5, otherwise, go to step S2 to continue calculating after determining the filter size;
S5: high threshold for determining hysteresis thresholdLow threshold fetch;
S6: and carrying out non-maximum suppression (NMS) on the image gradient amplitude, and detecting and connecting edges by adopting a hysteresis threshold method to obtain the image edges.
The expression of the two-dimensional Gaussian function is as follows:
。
the specific method for calculating the edge response value by adopting the edge detection operator is as follows:
differentiating the expression of the two-dimensional Gaussian function along the x axis and the y axis respectively to obtain differential operators of the Gaussian function along the x axis and the y axis:
,
,
based on the above formula, a detection operator for detecting the edge of the image in any direction is constructed as follows:
,
wherein,representing an angle of an image edge; adopting the above formula edge detection operator to input imagesPerforming convolution to obtain an imageImage edge corresponding value of direction:
,
wherein,which represents a convolution of the signals of the first and second,
,
。
the image gradient is calculated as follows:
by solving the image edge responses in different directions, the total image edge response can be obtained, i.e. the image gradient is:
,
wherein n is the image edge angleThe number of (2).
The specific method for calculating the histogram h (I) of the gradient image is as follows:
assuming that the gradient of the image I is normalized, so that the number of pixels of the gradient image is N, the gray scale range is [1, L ], and the number of pixels corresponding to the gray level is 1 ≦ I ≦ L, the probability is:
,
and is provided with a plurality of groups of the materials,
,
according toObtaining the image gradient histogramFIG. h (I).
Candidate thresholdThe calculation method of (2) is as follows:
1) skewness of image gradient histogram h (I)And kurtosisCan be expressed as:
,,
wherein,representing the nth-order center distance corresponding to the first I gray levels in h (I);
degree of deviationAnd kurtosisCustomization of value range ofOrThe corresponding histogram gray value interval is called a histogram RIO;
2) let RIO correspond to a histogram with a gray scale value range ofAnd calculating each gray levelThe corresponding gradient image inter-class variance is:
,
wherein,
,
,
make itMaximum gray level as candidate edge threshold of gradient image。
Candidate thresholdThe calculation method of (2) is as follows:
assuming that the total number of image pixel points is N and the proportion of non-edge pixel points is r, taking r =0.7, accumulating the number of image points in sequence from low to high in the image gradient histogram, and when the accumulated number reaches the valueThen, the corresponding image gradient value is taken as a candidate threshold value。
The specific method for determining the size of the filter is as follows:
let the filter size w take on a value range ofThen, given an initial value, the value of w is within the range of valuesThe value is determined iteratively:
。
hysteresis thresholdThe value taking method comprises the following steps:
,
wherein,andthe proportion of non-edge pixel points in the gradient image is,The corresponding gradient values of the image are taken,,。
Claims (9)
1. An adaptive threshold image edge detection method, comprising the steps of:
s1: selecting two-dimensional Gaussian function as filter, and respectively setting value range of filter size w、and the value of alpha, take the distanceThe most recent odd number is taken as the filter size,the value of the threshold value of the proportion difference value of the non-edge pixel pointsα take on the value;
S2: respectively calculating edge response values of the image in the directions of 0 degree, 45 degrees, 90 degrees and 135 degrees by adopting an edge detection operator for the input image, and calculating image gradient;
s3: normalizing the image gradient, calculating histogram h (I) of the gradient image, and calculating candidate threshold values respectivelyAnd;
s4: it is assumed that,,respectively calculateAndthe proportion of the corresponding non-edge pixel points in the gradient image pixel points is respectivelyAndjudgment ofWhether or not to satisfyIf yes, go to step S5, otherwise, go to step S2 to continue calculating after determining the filter size;
S5: high threshold for determining hysteresis thresholdLow threshold fetch;
S6: and carrying out non-maximum suppression (NMS) on the image gradient amplitude, and detecting and connecting edges by adopting a hysteresis threshold method to obtain the image edges.
2. The adaptive threshold image edge detection method according to claim 1, wherein the expression of the two-dimensional gaussian function is:
。
3. the adaptive threshold image edge detection method according to claim 1, wherein the specific method for calculating the edge response value by using the edge detection operator is as follows:
differentiating the expression of the two-dimensional Gaussian function along the x axis and the y axis respectively to obtain differential operators of the Gaussian function along the x axis and the y axis:
,
,
based on the above formula, a detection operator for detecting the edge of the image in any direction is constructed as follows:
,
wherein,representing an angle of an image edge; adopting the above formula edge detection operator to input imagesPerforming convolution to obtain an imageImage edge corresponding value of direction:
,
wherein,which represents a convolution of the signals of the first and second,
,
。
4. the adaptive threshold image edge detection method of claim 1, wherein the image gradient is calculated as follows:
by solving the image edge responses in different directions, the total image edge response can be obtained, i.e. the image gradient is:
,
wherein n is the image edge angleThe number of (2).
5. The adaptive threshold image edge detection method according to claim 1, wherein the specific method for calculating the histogram h (I) of the gradient image is as follows:
assuming that the gradient of the image I is normalized, so that the number of pixels of the gradient image is N, the gray scale range is [1, L ], and the number of pixels corresponding to the gray level is 1 ≦ I ≦ L, the probability is:
,
and is provided with a plurality of groups of the materials,
,
according toA histogram of image gradients h (I) may be obtained.
6. The adaptive-threshold image edge detection method of claim 1, wherein the candidate threshold is a threshold candidateThe calculation method of (2) is as follows:
1) skewness of image gradient histogram h (I)And kurtosisCan be expressed as:
,,
wherein,representing the nth-order center distance corresponding to the first I gray levels in h (I);
degree of deviationAnd kurtosisCustomization of value range ofOrThe corresponding histogram gray value interval is called a histogram RIO;
2) let RIO correspond to a histogram with a gray scale value range ofAnd calculating each gray levelCorresponding toGradient image inter-class variance is:
,
wherein,
,
,
make itMaximum gray level as candidate edge threshold of gradient image。
7. The adaptive-threshold image edge detection method of claim 1, wherein the candidate threshold is a threshold candidateThe calculation method of (2) is as follows:
assuming that the total number of image pixel points is N and the proportion of non-edge pixel points is r, taking r =0.7, accumulating the number of image points in sequence from low to high in the image gradient histogram, and when the accumulated number reaches the valueThen, the corresponding image gradient value is taken as a candidate threshold value。
8. The adaptive threshold image edge detection method of claim 1, wherein the specific method for determining the filter size is as follows:
let the filter size w take on a value range ofThen, given an initial value, the value of w is within the range of valuesThe value is determined iteratively:
。
9. the adaptive-threshold image edge detection method of claim 1, wherein a hysteresis threshold valueThe value taking method comprises the following steps:
,
wherein,andthe proportion of non-edge pixel points in the gradient image is,The corresponding gradient values of the image are taken,,。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710100735.5A CN108470345A (en) | 2017-02-23 | 2017-02-23 | A kind of method for detecting image edge of adaptive threshold |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710100735.5A CN108470345A (en) | 2017-02-23 | 2017-02-23 | A kind of method for detecting image edge of adaptive threshold |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108470345A true CN108470345A (en) | 2018-08-31 |
Family
ID=63266741
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710100735.5A Withdrawn CN108470345A (en) | 2017-02-23 | 2017-02-23 | A kind of method for detecting image edge of adaptive threshold |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108470345A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109035249A (en) * | 2018-09-10 | 2018-12-18 | 东北大学 | A kind of parallel global threshold detection method of pipeline fault based on image procossing |
CN110264489A (en) * | 2019-06-24 | 2019-09-20 | 北京奇艺世纪科技有限公司 | A kind of image boundary detection method, device and terminal |
CN117876361A (en) * | 2024-03-11 | 2024-04-12 | 烟台海上航天科技有限公司 | Image processing method and system for high-risk operation of gas pipeline |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103856781A (en) * | 2014-03-18 | 2014-06-11 | 江西理工大学 | Self-adaptation threshold value video streaming multi-texture-direction error concealment method |
CN104574417A (en) * | 2015-01-27 | 2015-04-29 | 中国人民解放军国防科学技术大学 | Image edge grey level fluctuation measurement and adaptive detection method |
-
2017
- 2017-02-23 CN CN201710100735.5A patent/CN108470345A/en not_active Withdrawn
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103856781A (en) * | 2014-03-18 | 2014-06-11 | 江西理工大学 | Self-adaptation threshold value video streaming multi-texture-direction error concealment method |
CN104574417A (en) * | 2015-01-27 | 2015-04-29 | 中国人民解放军国防科学技术大学 | Image edge grey level fluctuation measurement and adaptive detection method |
Non-Patent Citations (1)
Title |
---|
李敏花: "自适应阈值图像边缘检测方法", 《模式识别与人工智能》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109035249A (en) * | 2018-09-10 | 2018-12-18 | 东北大学 | A kind of parallel global threshold detection method of pipeline fault based on image procossing |
CN109035249B (en) * | 2018-09-10 | 2021-08-24 | 东北大学 | Pipeline fault parallel global threshold detection method based on image processing |
CN110264489A (en) * | 2019-06-24 | 2019-09-20 | 北京奇艺世纪科技有限公司 | A kind of image boundary detection method, device and terminal |
CN117876361A (en) * | 2024-03-11 | 2024-04-12 | 烟台海上航天科技有限公司 | Image processing method and system for high-risk operation of gas pipeline |
CN117876361B (en) * | 2024-03-11 | 2024-05-10 | 烟台海上航天科技有限公司 | Image processing method and system for high-risk operation of gas pipeline |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109272489B (en) | Infrared weak and small target detection method based on background suppression and multi-scale local entropy | |
CN109767439B (en) | Target detection method for multi-scale difference and bilateral filtering of self-adaptive window | |
CN102156996B (en) | Image edge detection method | |
CN108416789A (en) | Method for detecting image edge and system | |
CN104134200B (en) | Mobile scene image splicing method based on improved weighted fusion | |
CN109064418B (en) | Non-local mean value-based non-uniform noise image denoising method | |
Khaire et al. | A fuzzy set approach for edge detection | |
CN107067382A (en) | A kind of improved method for detecting image edge | |
CN101976436B (en) | Pixel-level multi-focus image fusion method based on correction of differential image | |
CN102521836A (en) | Edge detection method based on gray-scale image of specific class | |
CN111080661A (en) | Image-based line detection method and device and electronic equipment | |
Hua et al. | Extended guided filtering for depth map upsampling | |
CN108470340A (en) | A kind of improved Sobel edge detection algorithms | |
CN109377450A (en) | A kind of edge-protected denoising method | |
CN107292900A (en) | A kind of method for detecting image edge and device based on Canny algorithms | |
CN109410235B (en) | Target tracking method fusing edge features | |
CN108470345A (en) | A kind of method for detecting image edge of adaptive threshold | |
CN108510510A (en) | Method for detecting image edge based on gradient direction | |
CN113421206B (en) | Image enhancement method based on infrared polarization imaging | |
CN112907460B (en) | Remote sensing image enhancement method | |
CN116468641A (en) | Infrared blood vessel image enhancement processing method | |
CN114119437B (en) | GMS-based image stitching method for improving distortion of moving object | |
CN104766287A (en) | Blurred image blind restoration method based on significance detection | |
CN113205494B (en) | Infrared small target detection method and system based on adaptive scale image block weighting difference measurement | |
CN106778822B (en) | Image straight line detection method based on funnel transformation |
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 | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20180831 |
|
WW01 | Invention patent application withdrawn after publication |