Multi-scale edge detection method, device and equipment and readable storage medium

By performing multi-scale deep convolution and feature map fusion on the target image, the problem of low edge detection accuracy in existing technologies is solved, and more accurate edge detection results are achieved.

CN117237666BActive Publication Date: 2025-11-04CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311210764.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-19
Publication Date
2025-11-04
Estimated Expiration
2043-09-19

AI Technical Summary

Technical Problem

Existing multi-scale edge detection technologies rely on variations in convolution kernel size and multiple convolutions, leading to information loss and low accuracy.

Method used

Perform depthwise convolutions at at least two different scales on the target image, obtain the scale feature map corresponding to each scale in each convolutional layer, fuse multiple scale feature maps to generate a fused gradient map, and finally perform edge extraction.

Benefits of technology

By combining multiple scales, more target image information is extracted, improving the accuracy and robustness of edge detection and resulting in more accurate detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117237666B_ABST
    Figure CN117237666B_ABST
Patent Text Reader

Abstract

The application provides a multi-scale edge detection method, device and equipment and a readable storage medium. The method comprises the following steps: performing deep convolution on a target image at least two different scales to obtain a scale feature map corresponding to each scale in each convolution layer; fusing the scale feature maps corresponding to the multiple scales to obtain a fused gradient map; wherein each convolution layer corresponds to one fused gradient map; and performing edge extraction on each fused gradient map to obtain an edge result of the target image. According to the embodiment of the application, more image information can be extracted when the image is subjected to edge detection, so that the detection result is more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer image processing, in particular to a multi-scale edge detection method, device, equipment and readable storage medium. BACKGROUND

[0002] Multi-scale detection can represent data features of images at different resolutions, and can also remove noise information of images and reduce image complexity. Traditional multi-scale edge detection technology is committed to selecting the optimal scale, such as determining the optimal parameters through experimental results, or selecting adaptive parameters for different input images. In recent years, the core idea of multi-scale technology is reflected in multi-scale fusion. For example, the Richer Convolutional Features (RCF) algorithm averages and fuses the results of different scales, and the main method of the PCF algorithm is to send the target image to the convolution network for convolution at different scales, and finally obtain the edge map through full connection or other methods. This multi-scale fusion method has the following shortcomings:

[0003] The detection result depends on the change of the convolution kernel size and the features after multiple convolutions, and the detection result may lose part of the information and has low accuracy. SUMMARY

[0004] The purpose of the present application is to provide a multi-scale edge detection method, device, equipment and readable storage medium, which solves the problem of low accuracy of the existing edge detection method.

[0005] In order to solve the above technical problems, the present application provides a multi-scale edge detection method, comprising:

[0006] Performing deep convolution on the target image at least two different scales to obtain a scale feature map corresponding to each scale in each convolution layer;

[0007] Fusing the scale feature maps corresponding to multiple scales to obtain a fused gradient map; wherein each convolution layer corresponds to one of the fused gradient maps;

[0008] Performing edge extraction on each of the fused gradient maps to obtain an edge result of the target image.

[0009] Optionally, the deep convolution on the target image at least two different scales comprises:

[0010] Performing deep convolution on the target image by performing Gaussian filtering and feature extraction on the target image at least two different scales.

[0011] Optionally, the Gaussian filtering and feature extraction on the target image at least two different scales comprises:

[0012] Gaussian filtering the target image through at least two scale filters to obtain a filtered image corresponding to each scale;

[0013] performing feature extraction on each of the filtered images corresponding to each scale to generate a scale feature map, wherein each scale in each convolutional layer corresponds to a scale feature map, and the scale feature map corresponding to each convolutional layer is the target image used for convolution of the next layer.

[0014] Optionally, the performing feature extraction on each of the filtered images corresponding to each scale to generate a scale feature map comprises:

[0015] obtaining a number of filtered images corresponding to each scale;

[0016] in a case where the number of filtered images is greater than a first threshold, generating the scale feature map by extracting a minimum pixel value of each position according to a pixel value of each position of each of the filtered images corresponding to the scale;

[0017] in a case where the number of filtered images is less than or equal to the first threshold, generating the scale feature map by extracting a maximum pixel value of each position according to a pixel value of each position of each of the filtered images corresponding to the scale.

[0018] Optionally, the fusing the scale feature maps corresponding to multiple scales to obtain a fused gradient map comprises:

[0019] sorting a plurality of scale feature maps in descending order of scale;

[0020] fusing the scale feature maps in descending order of scale to obtain a target gradient map;

[0021] performing convolution calculation on the scale feature map corresponding to the highest scale and the target gradient map to obtain a fused gradient map.

[0022] Optionally, the fusing the scale feature maps in descending order of scale to obtain a target gradient map comprises:

[0023] obtaining two scale feature maps in descending order of scale and determining them as a first scale feature map and a second scale feature map, respectively;

[0024] performing gradient fusion on the first scale feature map and the second scale feature map to obtain a first gradient map;

[0025] obtaining a number of scale feature maps remaining after the gradient fusion;

[0026] In a case that the number of the remaining scale feature maps is greater than 0, the first gradient map is determined as the first scale feature map, and one of the remaining scale feature maps is obtained according to the arrangement order from high to low in scale and is determined as the second scale feature map;

[0027] In a case that the number of the remaining scale feature maps is equal to 0, the first gradient map is determined as the target gradient map.

[0028] Optionally, the gradient fusion on the first scale feature map and the second scale feature map to obtain the first gradient map comprises:

[0029] gradient calculation on the first scale feature map to obtain a gradient direction of each pixel of the first scale feature map;

[0030] gradient calculation on the second scale feature map according to the gradient direction to obtain a maximum gradient value of a pixel corresponding to the second scale feature map in the first gradient direction;

[0031] gradient fusion on the first scale feature map and the second scale feature map according to the gradient direction and the maximum gradient value to obtain the first gradient map.

[0032] Optionally, the edge extraction on each of the fusion gradient maps to obtain the edge result of the target image comprises:

[0033] upsampling processing on each of the fusion gradient maps to obtain a plurality of upsampled images;

[0034] average value processing and non-maximum suppression on the plurality of upsampled images to obtain the edge result of the target image.

[0035] The embodiment of the present application further provides a multi-scale edge detection device, comprising:

[0036] a first obtaining module configured to perform deep convolution of a target image in at least two different scales to obtain a scale feature map corresponding to each scale in each convolution layer;

[0037] a second obtaining module configured to fuse the scale feature maps corresponding to a plurality of scales to obtain a fusion gradient map; wherein each convolution layer corresponds to one of the fusion gradient maps;

[0038] a third obtaining module configured to perform edge extraction on each of the fusion gradient maps to obtain an edge result of the target image.

[0039] The embodiment of the present application further provides a network device, comprising a processor, a memory and a program stored in the memory and executable on the processor, and the program is executed by the processor to realize the multi-scale edge detection method according to any one of the above.

[0040] The embodiment of the present application further provides a readable storage medium, comprising a program stored in the readable storage medium, and the program is executed by a processor to realize the steps of the multi-scale edge detection method according to any one of the above.

[0041] The above technical solution of the present application has at least one of the following beneficial effects:

[0042] In the above scheme, at least two different scale depth convolutions are performed on the target image, and the scale feature map corresponding to each scale in each convolution layer is obtained, more image information can be extracted, the obtained scale feature maps are fused to generate a fusion gradient map, and finally the edge of the fusion gradient map is extracted to obtain the edge result of the target image, so that the detection result is more accurate. BRIEF DESCRIPTION OF DRAWINGS

[0043] Figure 1 The figure is a flowchart of the multi-scale edge detection method of the embodiment of the present application.

[0044] Figure 2 The figure is a flowchart of gradient fusion of the scale feature map in the embodiment of the present application.

[0045] Figure 3 The figure is a flowchart of the multi-scale edge detection method of the embodiment of the present application.

[0046] Figure 4 The figure is a structural diagram of the multi-scale edge detection device of the embodiment of the present application. DETAILED DESCRIPTION

[0047] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0048] Edge detection is one of the basic tasks in computer vision, and has wide applications in image segmentation, image recognition, video segmentation, etc. For an input image, the purpose of edge detection is to extract the pixels with obvious changes, which can be object contours, color changes, light and dark contrasts, textures, etc. Human eyes recognize an image in a hierarchical process, and the key information observed by human eyes is different with the distance to the image: the farther the distance, the first observed is the overall contour of large-size objects; the closer the distance, the key information is more reflected in details, textures and other local features. Similarly, image edge detection is also a gradual process, i.e. multi-scale, and different degrees of Gaussian smoothing can be used to filter noise data in the image, which is multi-scale edge detection.

[0049] As shown in Figure 1 The embodiment of the present application provides a multi-scale edge detection method, which comprises the following steps:

[0050] In step S101, at least two different scales of deep convolution are performed on the target image to obtain a scale feature map corresponding to each scale in each convolution layer;

[0051] In step S102, the scale feature maps corresponding to multiple scales are fused to obtain a fused gradient map; each convolution layer corresponds to one of the fused gradient maps;

[0052] In step S103, edge extraction is performed on each of the fused gradient maps to obtain an edge result of the target image.

[0053] In the embodiment of the present application, multiple different scales of deep convolution are performed on the target image, more local information of the target image can be obtained in the case of low scale, and more contour information of the target image can be obtained in the case of high scale. Multi-scale combination can extract more information of the target image. The scale feature maps corresponding to each scale in each convolution layer are obtained, the scale feature maps corresponding to multiple scales in each convolution layer are fused respectively to obtain multiple fused gradient maps, which are more accurate than the scale feature map corresponding to the last convolution layer in the prior art. The edge result obtained by performing edge extraction on each fused gradient map is more accurate.

[0054] Optionally, the at least two different scales of deep convolution on the target image comprise:

[0055] The deep convolution on the target image is performed by performing at least two different scales of Gaussian filtering and feature extraction on the target image.

[0056] In the embodiment of the present application, the method of deep convolution in step S101 is described, and the deep convolution calculation is performed through Gaussian filtering and feature extraction. In the deep convolution calculation process, Gaussian filtering and feature extraction are performed once for each convolution calculation. Different scale convolution calculations are achieved by performing Gaussian filtering and feature extraction of different scales on the target image.

[0057] Optionally, the Gaussian filtering and feature extraction of the target image in at least two different scales comprises:

[0058] Gaussian filtering is performed on the target image through at least two scale filters to obtain a filter map of each scale.

[0059] Feature extraction is performed on the filter map of each scale respectively to generate a scale feature map. Each scale in each convolution layer corresponds to a scale feature map, and the scale feature map corresponding to each convolution layer is the target image used for the next layer convolution.

[0060] In the embodiment of the present application, the method of convolution calculation on the target image through Gaussian filtering and feature extraction is described in detail. First, Gaussian filtering and feature extraction of at least two different scales are performed on the target image once, and a scale feature map is generated for each scale. The above process completes the first layer convolution calculation. The generated scale feature map is regarded as the target image used for the next layer convolution calculation. Gaussian filtering and feature extraction of the corresponding scale are performed on the new target image respectively, and a new scale feature map is generated at each scale, which completes the second layer convolution calculation. In this way, the whole convolution calculation is completed. It should be noted that the depth of convolution can refer to the number of layers of mainstream network structure, or the number of layers can be selected adaptively according to specific scenarios.

[0061] In the process of Gaussian filtering, Gaussian filtering is performed on the target image through at least two scale filters to obtain a filter map of each scale. Therefore, in the embodiment of the present application, the scale of deep convolution is determined according to the number of Gaussian kernels in the filter used for Gaussian filtering. For a 6x6 image, the receptive field of 2 3x3 Gaussian kernel convolution is the same as that of 1 5x5 Gaussian kernel convolution, and the output result is 2x2 feature. Similarly, the receptive field of 3 3x3 Gaussian kernel convolution is the same as that of 1 7x7 Gaussian kernel convolution. Therefore, the more the number of Gaussian kernels is, the smoother the filtering is, and the higher the scale is. In the embodiment of the present application, the number of Gaussian kernels is used to determine the high and low of the scale, and the calculation amount is smaller and the detection performance is higher in feature extraction.

[0062] Optionally, the feature extraction of the filter map of each scale respectively to generate a scale feature map comprises:

[0063] obtaining the number of filter maps corresponding to each scale;

[0064] in a case where the number of filter maps is greater than a first threshold, generating the scale feature map by extracting the minimum pixel value of each position according to the pixel value of each position of each filter map under the corresponding scale;

[0065] in a case where the number of filter maps is less than or equal to the first threshold, generating the scale feature map by extracting the maximum pixel value of each position according to the pixel value of each position of each filter map under the corresponding scale.

[0066] In the embodiment of the application, the method for generating the scale feature map by extracting features from the filter map is described. First, the number of filter maps of each scale is obtained, and the specific method for extracting features is determined by the number. In the embodiment of the application, the number of filter maps is the same as the number of Gaussian kernels in the corresponding filter. If the number of Gaussian kernels in the filter used for Gaussian filtering is M, the number of filter maps corresponding to the scale generated is also M, and M is an integer greater than or equal to 1.

[0067] In a case where the number of filter maps is greater than a first threshold, that is, the number of corresponding Gaussian kernels is greater than the first threshold, it is determined that the corresponding convolution scale is a high scale. The filter map of the high scale has a high smoothing degree, and the pixel value is generally small. The corresponding feature map is obtained by extracting the minimum pixel value of each position in the plurality of filter maps. In a case where the number of filter maps is less than or equal to the first threshold, that is, the number of corresponding Gaussian kernels is less than or equal to the first threshold, it is determined that the corresponding convolution scale is a low scale. The filter map of the low scale has a low smoothing degree, and the pixel value is generally large. The corresponding feature map is obtained by extracting the maximum pixel value of each position in the plurality of filter maps.

[0068] Optionally, the method further comprises:

[0069] sorting the plurality of scale feature maps in order from high to low scale;

[0070] gradient fusing the scale feature maps in order from high to low scale to obtain a target gradient map;

[0071] convolving the scale feature map corresponding to the highest scale with the target gradient map to obtain a fused gradient map.

[0072] In the embodiment of the present application, the method of fusing the scale feature maps corresponding to multiple scales in each volume layer in S102 is described. When fusing, it is necessary to start with the scale feature map of high scale, so the multiple scale feature maps are sorted in the order of high to low scale. The fusion gradient map generated in the embodiment of the present application is obtained by gradient fusion and convolution, and more useful information of the target image can be extracted.

[0073] Optionally, the scale feature maps are sequentially gradient fused according to the arrangement order of high to low scale to obtain a target gradient map, comprising:

[0074] Two scale feature maps are obtained according to the arrangement order of high to low scale, and are determined as a first scale feature map and a second scale feature map, respectively;

[0075] The first scale feature map and the second scale feature map are gradient fused to obtain a first gradient map;

[0076] The number of scale feature maps remaining after gradient fusion is obtained;

[0077] In the case that the number of the remaining scale feature maps is greater than 0, the first gradient map is determined as the first scale feature map, and one of the scale feature maps in the remaining scale feature maps is obtained according to the arrangement order of high to low scale and is determined as the second scale feature map;

[0078] In the case that the number of the remaining scale feature maps is equal to 0, the first gradient map is determined as a target gradient map.

[0079] In the embodiment of the present application, the idea of gradient fusion is described. When N different scale depth convolutions are performed on a target image, N different scale feature maps will be obtained in each volume layer, N is an integer greater than or equal to 2. In the case that N is equal to 2, two scale feature maps are directly gradient fused to obtain a target gradient map. In the case that N is greater than 2, two scale feature maps are obtained according to the arrangement order of high to low scale, the first gradient map is obtained by gradient fusion of the two scale feature maps, and another scale feature map is obtained according to the arrangement order of high to low scale (the scale feature map is different from the two scale feature maps which are gradient fused above), the first gradient map is gradient fused with the newly obtained scale feature map, and so on, until all the scale feature maps are fused, and finally the target gradient map is generated. Figure 2 As shown in FIG. 8, a method of fusing three scale feature maps of different scales is shown, wherein the scale feature maps Figure 1 , the scale feature map Figure 2 and the scale feature map Figure 3 correspond to scales decreasing in turn.

[0080] Optionally, the gradient fusion is performed on the first scale feature map and the second scale feature map to obtain a first gradient map, comprising:

[0081] Gradient calculation is performed on the first scale feature map to obtain a gradient direction of each pixel of the first scale feature map;

[0082] According to the gradient direction, gradient calculation is performed on the second scale feature map to obtain a maximum gradient value of a pixel corresponding to the second scale feature map in the first gradient direction;

[0083] According to the gradient direction and the maximum gradient value, gradient fusion is performed on the first scale feature map and the second scale feature map to obtain a first gradient map.

[0084] In the embodiment of the application, the specific method of gradient fusion of two scale feature maps is described, wherein the scale corresponding to the first scale feature map is higher than the scale corresponding to the second scale feature map. Since the first scale feature map has more contour information and the second scale feature map has more local pixel information, gradient fusion is performed. First, the gradient values on the first scale feature map and the second scale feature map are calculated. Then, the gradient direction of each pixel in the first scale feature map is calculated. The maximum gradient value of the pixel in the second scale feature map corresponding to the same position of the first scale feature map is obtained. The gradient direction of the first scale feature map and the maximum gradient value of the second scale feature map are fused to obtain a first gradient map.

[0085] Optionally, an edge extraction is performed on each of the fusion gradient maps to obtain an edge result of the target image, comprising:

[0086] Each of the fusion gradient maps is up-sampled to obtain a plurality of up-sampled images;

[0087] The plurality of up-sampled images are subjected to average value processing and non-maximum suppression to obtain an edge result of the target image.

[0088] In the embodiment of the application, in the process of depth convolution of the target image, a fusion gradient map of each convolution layer is obtained. The more the number of convolutions, the lower the resolution of the corresponding fusion gradient map obtained. In order to obtain a more accurate edge result, the up-sampling processing is performed on the fusion gradient map corresponding to each convolution layer to obtain a plurality of up-sampled images, so that the resolution of the up-sampled image is the same as that of the input target image. The average value processing and the non-maximum suppression are performed on the plurality of up-sampled images to finally obtain the edge result of the target image, which is more accurate. It should be noted that the up-sampling processing, the average value processing and the non-maximum suppression in the embodiment of the application are conventional processing methods, which will not be described herein.

[0089] Embodiment one: refer to Figure 3 The two different scale edge detection methods of the target image are as follows:

[0090] The first step is to input a 6x6x3 target image, wherein the original image of the target image is a 6x6 image, and since the color image has three channels, a 6x6x3 target image is input.

[0091] The second step is to perform two-layer deep convolution on the target image, wherein the target image is subjected to low-scale deep convolution through two 3x3 low-scale filters, and high-scale deep convolution through three 3x3 high-scale filters. In the first layer convolution, the target image is first subjected to Gaussian filtering through the low-scale filter and the high-scale filter to generate two 4x4 low-scale filter images and three 4x4 high-scale filter images, then a 4x4 low-scale feature image is generated by taking the maximum value of each pixel of the two 4x4 low-scale filter images for feature extraction, and a 4x4 high-scale feature image is generated by taking the minimum value of each pixel of the three 4x4 low-scale filter images for feature extraction. In the second layer convolution, the low-scale feature image generated in the first layer convolution is subjected to low-scale Gaussian filtering and feature extraction to generate a 2x2 low-scale feature image, and the high-scale feature image generated in the first layer convolution is subjected to high-scale Gaussian filtering and feature extraction to generate a 2x2 high-scale feature image.

[0092] The third step is to obtain the high-scale feature image and the low-scale feature image generated by each convolution layer, and to fuse the high-scale feature image and the low-scale feature image of each convolution layer to generate a fused gradient image, wherein the fused gradient image corresponding to the first convolution layer has a size of 4x4, and the fused gradient image corresponding to the second convolution layer has a size of 2x2.

[0093] The fourth step is to perform up-sampling processing on the two fused gradient images to generate two 6x6 up-sampled images, and to perform average value processing and non-maximum suppression on the two up-sampled images to obtain an edge image, i.e., the edge result of the target image.

[0094] The multi-scale edge detection method adopted by the embodiment of the application can obtain the local features and global features of the target image, has low computational complexity, improves the edge robustness, simultaneously fuses the features of each convolution layer in both directions, retains more confidence of the target image, has higher edge accuracy of detection, and is more consistent with the human eye visual features.

[0095] As shown in Figure 4 The embodiment of the application further provides a multi-scale edge detection device, which comprises:

[0096] The first obtaining module 401 is configured to perform deep convolution on the target image at at least two different scales, and obtain a scale feature map corresponding to each scale in each convolution layer;

[0097] The second obtaining module 402 is configured to fuse the scale feature maps corresponding to the multiple scales, and obtain a fused gradient map; each convolution layer corresponds to one of the fused gradient maps;

[0098] The third obtaining module 403 is configured to perform edge extraction on each of the fused gradient maps, and obtain an edge result of the target image.

[0099] Optionally, the first obtaining module 401 comprises:

[0100] The convolution calculation unit is configured to perform deep convolution on the target image by performing Gaussian filtering and feature extraction on the target image at at least two different scales.

[0101] Optionally, the convolution calculation unit comprises:

[0102] The first obtaining unit is configured to perform Gaussian filtering on the target image by using filters at at least two scales, and obtain a filter map of each scale;

[0103] The feature extraction unit is configured to perform feature extraction on each of the filter maps of each scale, and generate a scale feature map; each scale in each convolution layer corresponds to one of the scale feature maps, and the scale feature map corresponding to each convolution layer is the target image used for performing convolution of a next layer.

[0104] Optionally, the feature extraction unit comprises:

[0105] The second obtaining unit is configured to obtain a number of filter maps corresponding to each scale;

[0106] The first generating unit is configured to, in a case where the number of filter maps is greater than a first threshold, generate the scale feature map by extracting a minimum pixel value of each position according to a pixel value of each position of each of the filter maps corresponding to the scale;

[0107] The second generating unit is configured to, in a case where the number of filter maps is less than or equal to the first threshold, generate the scale feature map by extracting a maximum pixel value of each position according to a pixel value of each position of each of the filter maps corresponding to the scale.

[0108] Optionally, the second obtaining module 402 comprises:

[0109] The sorting unit is configured to sort the multiple scale feature maps in a descending order of scale;

[0110] The third acquisition unit is configured to sequentially perform gradient fusion on the scale feature maps according to the arrangement order from high to low of the scales, and acquire a target gradient map;

[0111] The fourth acquisition unit is configured to perform convolution calculation on the scale feature map corresponding to the highest scale and the target gradient map, and acquire a fused gradient map.

[0112] Optionally, the third acquisition unit comprises:

[0113] The fifth acquisition unit is configured to acquire two scale feature maps according to the arrangement order from high to low of the scales, and determine the two scale feature maps as a first scale feature map and a second scale feature map respectively.

[0114] The first fusion unit is configured to perform gradient fusion on the first scale feature map and the second scale feature map, and acquire a first gradient map.

[0115] The sixth acquisition unit is configured to acquire a number of scale feature maps remaining after the gradient fusion.

[0116] The first determination unit is configured to, in a case where the number of the scale feature maps remaining is greater than 0, determine the first gradient map as the first scale feature map, and acquire one of the scale feature maps remaining in the arrangement order from high to low of the scales and determine the one of the scale feature maps as the second scale feature map.

[0117] The second determination unit is configured to, in a case where the number of the scale feature maps remaining is equal to 0, determine the first gradient map as a target gradient map.

[0118] Optionally, the first fusion unit comprises:

[0119] The first calculation unit is configured to perform gradient calculation on the first scale feature map, and acquire a gradient direction of each pixel of the first scale feature map.

[0120] The second calculation unit is configured to perform gradient calculation on the second scale feature map according to the gradient direction, and acquire a maximum gradient value of pixels corresponding to the second scale feature map in the first gradient direction.

[0121] The second fusion unit is configured to perform gradient fusion on the first scale feature map and the second scale feature map according to the gradient direction and the maximum gradient value, and acquire a first gradient map.

[0122] Optionally, the third acquisition module 403 comprises:

[0123] The first processing unit is configured to perform up-sampling processing on each of the fused gradient maps, and acquire a plurality of up-sampling images.

[0124] The second processing unit is configured to perform average value processing and non-maximum suppression on the plurality of up-sampled images to obtain an edge result of the target image.

[0125] It should be noted that the embodiments of the device correspond to the embodiments of the method described above, and all implementation manners in the embodiments of the method are applicable to the embodiments of the device, and the same technical effects can be achieved.

[0126] The embodiments of the present application also provide a network device, comprising a processor, a memory, and a program stored in the memory and executable in the processor, and the program is executed by the processor to implement the multi-scale edge detection method according to any one of the above.

[0127] The embodiments of the present application also provide a readable storage medium, comprising a program stored in the readable storage medium, and the program is executed by the processor to implement the steps of the multi-scale edge detection method according to any one of the above.

[0128] It should be noted that, in this document, the relationship terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or terminal device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0129] Obviously, those skilled in the art can make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application also intends to include these modifications and variations.

Claims

1. A multi-scale edge detection method, characterized by, The method comprises the following steps: performing deep convolution on the target image at least two different scales to obtain a scale feature map corresponding to each scale in each convolution layer; fusing the scale feature maps corresponding to multiple scales to obtain a fused gradient map; each convolution layer corresponds to one of the fused gradient maps; performing edge extraction on each of the fused gradient maps to obtain an edge result of the target image; wherein performing deep convolution on the target image at least two different scales to obtain a scale feature map corresponding to each scale in each convolution layer comprises: performing Gaussian filtering on the target image through filters of at least two scales to obtain a filter map of each scale; performing feature extraction on each of the filter maps of each scale to generate a scale feature map; each scale in each convolution layer corresponds to one of the scale feature maps, and the scale feature map corresponding to each convolution layer is the target image used for the next layer of convolution; wherein performing feature extraction on each of the filter maps of each scale to generate a scale feature map comprises: obtaining the number of filter maps corresponding to each scale; in a case where the number of filter maps is greater than a first threshold, generating the scale feature map by extracting the minimum pixel value of each position according to the pixel value of each position of each of the filter maps under the corresponding scale; in a case where the number of filter maps is less than or equal to the first threshold, generating the scale feature map by extracting the maximum pixel value of each position according to the pixel value of each position of each of the filter maps under the corresponding scale.

2. The multi-scale edge detection method of claim 1, wherein, The method comprises the following steps: sorting multiple scale feature maps in order from high to low scale; gradient fusion of scale feature maps in order from high to low scale to obtain a target gradient map; convolution calculation of the scale feature map corresponding to the highest scale and the target gradient map to obtain a fused gradient map.

3. The method of claim 2, wherein, The method comprises the following steps: obtaining two scale feature maps in order from high to low scale and determining them as a first scale feature map and a second scale feature map, respectively; gradient fusion of the first scale feature map and the second scale feature map to obtain a first gradient map; obtaining the number of scale feature maps remaining after gradient fusion; in a case where the number of remaining scale feature maps is greater than 0, determining the first gradient map as the first scale feature map, and obtaining one of the scale feature maps in the remaining scale feature maps in order from high to low scale and determining it as the second scale feature map; in a case where the number of remaining scale feature maps is equal to 0, determining the first gradient map as a target gradient map.

4. The multi-scale edge detection method of claim 3, wherein, The method comprises the following steps: gradient calculation of the first scale feature map to obtain the gradient direction of each pixel of the first scale feature map; According to the gradient direction, gradient calculation is performed on the second scale feature map to obtain a maximum gradient value of pixels corresponding to the second scale feature map in the first gradient direction; According to the gradient direction and the maximum gradient value, gradient fusion is performed on the first scale feature map and the second scale feature map to obtain a first gradient map.

5. The method of claim 1, wherein, The edge extraction is respectively performed on each of the fusion gradient maps to obtain an edge result of the target image, including: The up-sampling processing is respectively performed on each of the fusion gradient maps to obtain a plurality of up-sampling images; The average value processing and the non-maximum suppression are performed on the plurality of up-sampling images to obtain the edge result of the target image.

6. A multi-scale edge detection apparatus characterized by comprising: Including: The first obtaining module is configured to perform deep convolution on a target image in at least two different scales to obtain a scale feature map corresponding to each scale in each convolution layer; The second obtaining module is configured to fuse the scale feature maps corresponding to the plurality of scales to obtain a fusion gradient map; each convolution layer corresponds to one of the fusion gradient maps; The third obtaining module is configured to perform edge extraction on each of the fusion gradient maps to obtain an edge result of the target image; The first obtaining module includes: The first obtaining unit is configured to perform Gaussian filtering on the target image by using filters of at least two scales to obtain a filter map of each scale; The feature extraction unit is configured to perform feature extraction on the filter map of each scale to generate a scale feature map; each scale in each convolution layer corresponds to one of the scale feature maps, and the scale feature map corresponding to each convolution layer is used for convolution of the target image in the next layer; The feature extraction unit includes: The second obtaining unit is configured to obtain a number of filter maps corresponding to each scale; The first generating unit is configured to, when the number of filter maps is greater than a first threshold, generate the scale feature map by extracting a minimum pixel value of each position according to a pixel value of each position of each filter map corresponding to the scale; The second generating unit is configured to, when the number of filter maps is less than or equal to the first threshold, generate the scale feature map by extracting a maximum pixel value of each position according to a pixel value of each position of each filter map corresponding to the scale.

7. A network device, comprising: Including: The processor, the memory, and a program stored in the memory and executable on the processor, the program being executed by the processor to implement the multi-scale edge detection method according to any one of claims 1 to 5.

8. A readable storage medium, characterized by, Including: The program is stored in the readable storage medium, and the program is executed by the processor to implement the steps of the multi-scale edge detection method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Remote sensing image segmentation method and device, and storage medium and server

    WO2020143323A1