An edge detection method and system capable of processing noise and texture

By combining the edge detection method of Canny detector and texture features to deal with noise and texture, the problem of difficulty in balancing the accuracy and generalization of edge information in the existing technology is solved, the accurate detection of edge information is achieved and the calculation cost is reduced.

CN114663451BActive Publication Date: 2024-10-18HUIZHOU UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210184019.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-28
Publication Date
2024-10-18
Estimated Expiration
2042-02-28

AI Technical Summary

Technical Problem

Existing edge detection technology has difficulty balancing the accuracy and generality of edge information when dealing with noise and texture, and the high cost of deep learning training limits the effective acquisition of edge information.

Method used

An edge detection method that combines Canny detectors and texture features is used to process noise and texture through Gaussian smoothing, gradient calculation, texture suppression and filtering operations to ensure the accuracy and generalization of edge information, and edge detection is implemented through the system.

Benefits of technology

It achieves effective suppression of noise and texture, detects real edge information, reduces computational costs, and avoids the high cost of deep learning training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114663451B_ABST
    Figure CN114663451B_ABST
Patent Text Reader

Abstract

The present invention provides an edge detection method and system capable of processing noise and texture. By treating noise as a special texture, noise and texture do not need to be processed separately. The detail resolution capability of a traditional canny detector and the texture suppression capability of an active contour method based on texture features are combined. The edge information detected can suppress false edges caused by noise and texture, and can detect implicit edges between texture blocks. A beneficial balance is made between edge accuracy and generalization. The edge detection method of the present invention has a low computational cost and can effectively overcome the problem of high cost of deep learning training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to an edge detection method and system capable of processing noise and texture. Background Art

[0002] In image processing technology, the presence of noise and texture often causes deviations in image processing results. In edge detection, noise and texture can cause the detection algorithm to misjudge false edges and cover up real edges. Current edge detection technology already has some methods for processing noise and texture, but these methods often process noise and texture separately, such as using denoising preprocessing based on wavelet filters and active contour extraction using texture feature extraction. These methods cannot take into account both the accuracy and generalization of edge information, and while suppressing noise and texture, they lose more edge information. In addition, the newly emerging deep learning technology is also used in edge detection, but due to the high cost of deep learning training, the edge information obtained by the current edge detection deep network is still relatively general. Summary of the invention

[0003] In view of the above technical problems, the present invention proposes an edge detection method capable of processing noise and texture, comprising the following steps:

[0004] Input the image to be detected I and the upper and lower thresholds of the canny detector [th, tl];

[0005] The image I is converted into a grayscale image Ig; the grayscale image Ig is Gaussian smoothed to obtain a grayscale image Ig2, and the x-axis gradient image dx and the y-axis gradient image dy of the grayscale image Ig2, as well as the gradient amplitude image M are calculated; the portion of the amplitude image M with an amplitude greater than 0.05 is taken as the mask image Mask, the edge information E is calculated using the canny detector, and the edge point in the edge information E with an edge point amplitude Mij greater than an upper threshold th is taken as a canny strong edge, to obtain a canny strong edge image B.

[0006] Furthermore, a feature matrix F is extracted from the grayscale image Ig2, and the feature matrix F is inputted, and a level set active contour extraction method is used to obtain an edge map B2 for suppressing texture.

[0007] The feature matrix F includes texture feature quantities, gradient feature quantities and amplitude feature quantities, and the texture feature quantities are calculated by using an LBP operator or wavelet filtering.

[0008] Perform an expansion operation on the canny strong edge map B to obtain an edge map B1; perform an AND operation on the edge map B2 and the mask map Mask to obtain an edge map E2; and then calculate the connected area of ​​the edge map B1.

[0009] The calculating of the connected areas of B1 also includes: for each connected area of ​​the edge graph B1, if the area does not have any common pixels with the edge graph B2, deleting the area in B1;

[0010] Perform an AND operation on the canny strong edge graphs B and B1 to obtain the common pixel bp in the canny strong edge graphs B and B1; take the common pixel bp as the strong edge, connect and select the edge graph E to obtain the edge graph E1; perform an OR operation on the edge graph E1 and the edge graph E2 to obtain the edge graph E3; assign the edge graph E1 to the edge graph E3, and calculate the connected area graph L of the edge graph E3.

[0011] For each connected region L1 in the connected region graph L that has no intersection with the edge graph E2, a pixel coordinate set of the connected region L1 is calculated, including a horizontal coordinate set rr and a vertical coordinate set cc.

[0012] Determine whether the pixel coordinate set satisfies the following formula:

[0013] (std(rr)+std(cc)) / sqrt((max(rr)-min(rr))*(max(cc)-min(cc)))<6;

[0014] If satisfied, delete the connected area L1 in the edge graph E1; assign the edge graph E2 to the edge graph E1; set the amplitude of the edge graph E1 to the edge graph E; otherwise, do not process.

[0015] For each connected area L2 in the connected area graph L that has no intersection with the edge graph E2, a square all-1 matrix of size w*w is used as a filter to calculate the filtered image A, where w=15.

[0016] Determine whether the number of pixels with values ​​greater than w in the filtered image A is greater than a times the number of pixels in the connected region graph L. If so, delete the connected region in E1; otherwise, perform a thinning operation on the edge graph E1 to obtain the final edge graph E; where a=0.8.

[0017] Preferably, the present invention further provides an edge detection system capable of processing noise and texture, characterized in that it at least comprises:

[0018] A data receiving module is used to receive the detection image I acquired by the image acquisition end;

[0019] A detection unit, comprising at least one processor and a memory in communication with the at least one processor; wherein the memory stores instructions executable by the one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the edge detection method capable of processing noise and texture, and output a canny strong edge map B;

[0020] The image display end is used to present the canny strong edge image B.

[0021] In summary, the present invention provides an edge detection method and system that can handle noise and texture. By treating noise as a special texture, noise and texture do not need to be processed separately. The detail resolution ability of the traditional canny detector and the texture suppression ability of the active contour method based on texture features are combined. The edge information detected can suppress the false edges caused by noise and texture, and can detect the implicit edges between texture blocks. A beneficial balance is made between the accuracy and generalization of the edge. The edge detection method of the present invention has a low computational cost and can effectively overcome the problem of the high cost of deep learning training. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 is an original image in one embodiment.

[0023] Figure 2 (1) shows Figure 1 The effect after Canny processing of the edge.

[0024] Figure 2 (2) is the noise graph of Figure 2 (1).

[0025] Figure 3 (1) is Figure 1 The effect image after edge processing using an edge detection method that can handle noise and texture.

[0026] Figure 3 (2) is the noise graph of Figure 3 (1).

[0027] Figure 4 This is the final edge map obtained after texture processing. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0029] The present invention provides an edge detection method capable of processing noise and texture, comprising the following steps:

[0030] Input the image to be detected I and the upper and lower thresholds of the canny detector [th, tl];

[0031] The image I is converted into a grayscale image Ig; the grayscale image Ig is Gaussian smoothed to obtain a grayscale image Ig2, and the x-axis gradient image dx and the y-axis gradient image dy of the grayscale image Ig2, as well as the gradient amplitude image M are calculated; the portion of the amplitude image M with an amplitude greater than 0.05 is taken as the mask image Mask, the edge information E is calculated using the canny detector, and the edge point in the edge information E with an edge point amplitude Mij greater than an upper threshold th is taken as a canny strong edge, to obtain a canny strong edge image B.

[0032] Furthermore, a feature matrix F is extracted from the grayscale image Ig2, and the feature matrix F is inputted, and a level set active contour extraction method is used to obtain an edge map B2 for suppressing texture.

[0033] The feature matrix F includes texture feature quantities, gradient feature quantities and amplitude feature quantities, and the texture feature quantities are calculated by using an LBP operator or wavelet filtering.

[0034] Perform an expansion operation on the canny strong edge map B to obtain an edge map B1; perform an AND operation on the edge map B2 and the mask map Mask to obtain an edge map E2; and then calculate the connected area of ​​the edge map B1.

[0035] The calculating of the connected areas of B1 also includes: for each connected area of ​​the edge graph B1, if the area does not have any common pixels with the edge graph B2, deleting the area in B1;

[0036] Perform an AND operation on the canny strong edge graphs B and B1 to obtain the common pixel bp in the canny strong edge graphs B and B1; take the common pixel bp as the strong edge, connect and select the edge graph E to obtain the edge graph E1; perform an OR operation on the edge graph E1 and the edge graph E2 to obtain the edge graph E3; assign the edge graph E1 to the edge graph E3, and calculate the connected area graph L of the edge graph E3.

[0037] For each connected region L1 in the connected region graph L that has no intersection with the edge graph E2, a pixel coordinate set of the connected region L1 is calculated, including a horizontal coordinate set rr and a vertical coordinate set cc.

[0038] Determine whether the pixel coordinate set satisfies the following formula:

[0039] (std(rr)+std(cc)) / sqrt((max(rr)-min(rr))*(max(cc)-min(cc)))<6;

[0040] If satisfied, delete the connected area L1 in the edge graph E1; assign the edge graph E2 to the edge graph E1; set the amplitude of the edge graph E1 to the edge graph E; otherwise, do not process.

[0041] For each connected area L2 in the connected area graph L that has no intersection with the edge graph E2, a square all-1 matrix of size w*w is used as a filter to calculate the filtered image A, where w=15.

[0042] Determine whether the number of pixels with values ​​greater than w in the filtered image A is greater than a times the number of pixels in the connected region graph L. If so, delete the connected region in E1; otherwise, perform a thinning operation on the edge graph E1 to obtain the final edge graph E; where a=0.8.

[0043] According to the above principle, an original image is processed, where the original image is as follows Figure 1 As shown, if the existing Canny processing edge is used, it becomes as shown in Figure 2 (1), the outline is obviously unclear, and some lines are broken, and the obtained image noise edge image is shown in Figure 2 (2). After the edge processing is performed using the method described in the present invention, the edge image shown in Figure 3 (1) is obtained. Further, after the image denoising is performed, Figure 3 (2) is obtained. After texture processing, the effect is as shown Figure 4 As shown; it can be seen that by treating noise as a special texture, noise and texture do not need to be processed separately. By combining the detail resolution ability of the traditional canny detector and the texture suppression ability of the active contour method based on texture features, the detected edge information can suppress the false edges caused by noise and texture, and can detect the implicit edges between texture blocks, which can effectively overcome the high cost of deep learning training.

[0044] Preferably, the present invention further provides an edge detection system capable of processing noise and texture, characterized in that it at least comprises:

[0045] A data receiving module is used to receive the detection image I acquired by the image acquisition end;

[0046] A detection unit, comprising at least one processor, and a memory in communication with the at least one processor; wherein the memory stores instructions executable by the one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the edge detection method capable of processing noise and texture according to claims 1-9, and output a canny strong edge map B;

[0047] The image display end is used to present the canny strong edge image B.

[0048] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

Claims

1. An edge detection method capable of handling noise and texture, characterized in that: The following steps are involved: Input the image to be detected I and the upper and lower thresholds of the canny detector [th, tl]; The image I is converted into a grayscale image Ig; the grayscale image Ig is Gaussian smoothed to obtain a grayscale image Ig2, and the x-axis direction gradient image dx and the y-axis direction gradient image dy of the grayscale image Ig2, as well as the gradient amplitude image M are calculated; the portion of the amplitude image M with an amplitude greater than 0.05 is taken as the mask image Mask, the edge information E is calculated using the canny detector, and the edge point in the edge information E with an edge point amplitude Mij greater than an upper threshold th is taken as a canny strong edge, to obtain a canny strong edge image B; The method further comprises: extracting a feature matrix F from the grayscale image Ig2, inputting the feature matrix F, and obtaining a texture-suppressed edge image B2 using a level set active contour extraction method; The feature matrix F includes texture feature quantities, gradient feature quantities and amplitude feature quantities, and the texture feature quantities are calculated by LBP operator or wavelet filtering; The method further includes: performing an expansion operation on the canny strong edge map B to obtain an edge map B1; performing an AND operation on the edge map B2 and the mask map Mask to obtain an edge map E2; and then calculating the connected area of ​​the edge map B1; The method further includes: for each connected region of the edge graph B1, if the region does not have any common pixels with the edge graph B2, deleting the region in B1; Perform an AND operation on the canny strong edge graphs B and B1 to obtain the common pixel bp in the canny strong edge graphs B and B1; take the common pixel bp as the strong edge, connect and select the edge graph E to obtain the edge graph E1; perform an OR operation on the edge graph E1 and the edge graph E2 to obtain the edge graph E3; assign the edge graph E1 to the edge graph E3, and calculate the connected region graph L of the edge graph E3; For each connected region L1 in the connected region graph L that has no intersection with the edge graph E2, a pixel coordinate set of the connected region L1 is calculated, including a horizontal coordinate set rr and a vertical coordinate set cc; Determine whether the pixel coordinate set satisfies the following formula: (std(rr)+std(cc)) / sqrt((max(rr)-min(rr))*(max(cc)-min(cc))) < 6; If satisfied, delete the connected region L1 in the edge graph E1; assign the edge graph E2 to the edge graph E1; set the amplitude of the edge graph E1 to the edge graph E; otherwise, do not process; The method further includes: for each connected region L2 in the connected region graph L that has no intersection with the edge graph E2, using a square matrix of all 1s with a size of w*w as a filter, calculating a filtered image A, where w=15; It also includes: judging whether the number of pixels with a value greater than w in the filtered image A is greater than a times the number of pixels in the connected area graph L; if so, deleting the connected area in E1; otherwise, performing a thinning operation on the edge graph E1 to obtain the final edge graph E; wherein a=0.

8.

2. An edge detection system capable of handling noise and texture, characterized in that: At least: A data receiving module is used to receive the detection image I acquired by the image acquisition end; A detection unit, comprising at least one processor, and a memory in communication with the at least one processor; wherein the memory stores instructions executable by the one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the edge detection method capable of processing noise and texture according to claim 1, and output a canny strong edge map B; The image display end is used to present the canny strong edge image B.

Citation Information

Patent Citations

  • Image edge detection method

    CN102156996A

  • Grayscale target automatic tracking method based on marginal information

    CN103077531A