An edge detection method, device and image processing equipment of an image

By performing multi-scale edge detection and probability distribution map processing on images, an edge probability map pyramid is generated, which solves the problem of poor multi-scale information fusion in existing technologies and improves the accuracy of edge detection and the effect of conforming to human visual characteristics.

CN116862937BActive Publication Date: 2026-05-29CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD
Filing Date
2023-06-30
Publication Date
2026-05-29

Smart Images

  • Figure CN116862937B_ABST
    Figure CN116862937B_ABST
Patent Text Reader

Abstract

The application provides an edge detection method and device of an image and an image processing device, and relates to the technical field of communication. The method comprises the following steps: performing edge detection on a gray image corresponding to a to-be-detected image under N scales to obtain N detection results; N is a positive integer; obtaining an edge probability distribution map corresponding to the gray image according to the N detection results; the edge probability distribution map is used for representing a probability value of each pixel point in the gray image being an edge pixel point; and obtaining an edge image corresponding to the gray image according to the edge probability distribution map. The scheme of the application solves the problem that the existing edge detection scheme cannot fuse multi-scale information under the same resolution, so that the finally fused edge result is inconsistent with the human eye visual characteristics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to an image edge detection method, apparatus, and image processing equipment. Background Technology

[0002] Edges are low-level features of an image, representing its most important information, and are widely used in tasks such as image analysis and computer vision. Edge detection requires noise reduction of the original image, so the detection process generally involves setting scale parameters. At low scales, edge localization accuracy is high, but it contains a lot of redundant details, resulting in less than ideal detection precision; at high scales, redundant information is effectively filtered out, but the detected edges are deformed, resulting in less than ideal detection recall.

[0003] Currently, to achieve better edge detection results, image pyramids are mainly used to fuse information from multiple scales of an image. For example... Figure 1 As shown, an image pyramid is a collection of images of the same image at different resolutions, with the original image at the bottom and the resolution decreasing as you move up. Common image pyramids are created by filtering the original image, downsampling it, and then performing single-scale edge detection on the downsampled image. This approach fails to fuse multi-scale information at the same resolution, resulting in a final fused edge image that does not match human visual characteristics. Summary of the Invention

[0004] The purpose of this invention is to provide an image edge detection method, apparatus, and image processing device, which solves the problem that existing edge detection schemes cannot fuse multi-scale information at the same resolution, resulting in the final fused edge result not matching the visual characteristics of the human eye.

[0005] To achieve the above objectives, embodiments of the present invention provide an image edge detection method, comprising:

[0006] Perform edge detection at N scales on the grayscale image corresponding to the image to be detected to obtain N detection results; N is a positive integer.

[0007] Based on the N detection results, an edge probability distribution map corresponding to the grayscale image is obtained; the edge probability distribution map is used to characterize the probability value of each pixel in the grayscale image being an edge pixel;

[0008] Based on the edge probability distribution map, the edge image corresponding to the grayscale image is obtained.

[0009] Optionally, obtaining the edge probability distribution map corresponding to the grayscale image based on the N detection results includes:

[0010] Determine the grayscale value of each pixel in the grayscale image among the N detection results;

[0011] Based on the N grayscale values ​​corresponding to each pixel, the probability value of each pixel being an edge pixel is obtained;

[0012] The edge probability distribution map is obtained based on the probability values ​​corresponding to all pixels in the grayscale image.

[0013] Optionally, obtaining the probability value of each pixel being an edge pixel based on the N grayscale values ​​corresponding to each pixel includes:

[0014] According to the formula: Calculate the probability value of each pixel being an edge pixel; where P1 represents the probability value of pixel coordinates (x, y) being an edge pixel; N represents the number of scales. This represents the grayscale value of the pixel coordinates (x, y) in the detection result at scale i in the grayscale image, where i = 1, 2, ..., N; 0 indicates that (x,y) is a non-edge pixel, and 1 indicates that (x,y) is an edge pixel.

[0015] Optionally, obtaining the edge image corresponding to the grayscale image based on the edge probability distribution map includes:

[0016] Based on the marginal probability distribution map, a marginal probability map pyramid is generated; the marginal probability map pyramid includes M marginal probability maps of different sizes; M is a positive integer.

[0017] Remove pixels whose probability values ​​are less than a preset threshold from the M edge probability maps to obtain a downsampled image corresponding to each edge probability map;

[0018] Based on the M downsampled images, the edge image corresponding to the grayscale image is obtained.

[0019] Optionally, generating the marginal probability map pyramid based on the marginal probability distribution map includes:

[0020] Radial differential downsampling is performed on the edge probability distribution map to generate the edge probability map pyramid;

[0021] Wherein, the probability value corresponding to the outermost corner pixel of the i-th edge probability map is the radial difference between the probability value corresponding to the outermost corner pixel of the (i+1)-th edge probability map and the probability value corresponding to the second-to-last corner pixel.

[0022] The probability value of each non-corner pixel in the outermost layer of the i-th edge probability map is the radial difference between the probability value of the non-corner pixel in the outermost layer of the (i+1)-th edge probability map and the probability value of the non-corner pixel in the second-to-last layer.

[0023] Optionally, obtaining the edge image corresponding to the grayscale image based on the M downsampled images includes:

[0024] Upsampling is performed on the M downsampled images to obtain M upsampled images with the same resolution as the grayscale image;

[0025] The M upsampled images are fused to obtain the edge image corresponding to the grayscale image.

[0026] To achieve the above objectives, embodiments of the present invention provide an image edge detection device, characterized in that it comprises:

[0027] The first processing module is used to perform edge detection at N scales on the grayscale image corresponding to the image to be detected, and obtain N detection results; N is a positive integer.

[0028] The second processing module is used to obtain an edge probability distribution map corresponding to the grayscale image based on the N detection results; the edge probability distribution map is used to characterize the probability value of each pixel in the grayscale image being an edge pixel;

[0029] The third processing module is used to obtain the edge image corresponding to the grayscale image based on the edge probability distribution map.

[0030] To achieve the above objectives, embodiments of the present invention provide an image processing device, including a processor and a transceiver, wherein the processor is used for:

[0031] Perform edge detection at N scales on the grayscale image corresponding to the image to be detected to obtain N detection results; N is a positive integer.

[0032] Based on the N detection results, an edge probability distribution map corresponding to the grayscale image is obtained; the edge probability distribution map is used to characterize the probability value of each pixel in the grayscale image being an edge pixel;

[0033] Based on the edge probability distribution map, the edge image corresponding to the grayscale image is obtained.

[0034] To achieve the above objectives, embodiments of the present invention provide an image processing device, including a transceiver, a processor, a memory, and a program or instructions stored in the memory and executable on the processor; when the processor executes the program or instructions, it implements the image edge detection method described above.

[0035] To achieve the above objectives, embodiments of the present invention provide a readable storage medium having a program or instructions stored thereon, which, when executed by a processor, implement the steps in the image edge detection method described above.

[0036] The beneficial effects of the above-described technical solution of the present invention are as follows:

[0037] The method of this invention involves performing edge detection at N scales on a grayscale image corresponding to the image to be detected, obtaining N detection results; N is a positive integer; based on the N detection results, an edge probability distribution map corresponding to the grayscale image is obtained; the edge probability distribution map is used to characterize the probability value of each pixel in the grayscale image being an edge pixel; based on the edge probability distribution map, an edge image corresponding to the grayscale image is obtained. Thus, this embodiment can fuse edge detection results at multiple scales through the edge probability distribution map, balancing the precision and recall of edge detection, making the final fused edge image more consistent with human visual characteristics. This solves the problem that single-scale edge detection cannot fuse multi-scale information at the same resolution, resulting in a final fused edge image that does not match human visual characteristics. Attached Figure Description

[0038] Figure 1 This is a schematic diagram of edge detection based on image pyramids;

[0039] Figure 2 This is one of the flowcharts for an image edge detection method according to an embodiment of the present invention;

[0040] Figure 3 This is a schematic diagram of radial differential downsampling according to an embodiment of the present invention;

[0041] Figure 4 This is a second flowchart of the image edge detection method according to an embodiment of the present invention;

[0042] Figure 5 This is a structural diagram of the image edge detection device according to an embodiment of the present invention;

[0043] Figure 6 This is a structural diagram of an image processing device according to an embodiment of the present invention;

[0044] Figure 7 This is a structural diagram of an image processing device according to another embodiment of the present invention. Detailed Implementation

[0045] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.

[0046] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of the invention. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.

[0047] In various embodiments of the present invention, it should be understood that the sequence number of each process described below does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0048] In addition, the terms "system" and "network" are often used interchangeably in this article.

[0049] In the embodiments provided in this application, it should be understood that "B corresponding to A" means that B is associated with A, and B can be determined based on A. However, it should also be understood that determining B based on A does not mean determining B solely based on A; B can also be determined based on A and / or other information.

[0050] like Figure 2 As shown, an image edge detection method according to an embodiment of the present invention specifically includes the following steps:

[0051] Step 101: Perform edge detection at N scales on the grayscale image corresponding to the image to be detected to obtain N detection results; N is a positive integer.

[0052] For example, the Canny edge detection operator is used to perform edge detection at N scales on the grayscale image corresponding to the image to be detected, resulting in N detection results. The Canny edge detection operator is a multi-level detection algorithm proposed by John F. Canny.

[0053] Here, the N scales of a grayscale image can refer to the results obtained after filtering with N Gaussian kernels of different sizes; where the larger the Gaussian kernel size, the higher the scale; and the smaller the Gaussian kernel size, the lower the scale.

[0054] Step 102: Based on the N detection results, obtain the edge probability distribution map corresponding to the grayscale image; the edge probability distribution map is used to characterize the probability value of each pixel in the grayscale image being an edge pixel.

[0055] For example, for a grayscale image comprising 7×7 pixels, such as Figure 3 The first image from the left shows the edge probability distribution of a 7×7 pixel grayscale image. i, (i=1,...,49) represents the probability value of a pixel being an edge pixel.

[0056] Step 103: Obtain the edge image corresponding to the grayscale image based on the edge probability distribution map.

[0057] In this embodiment, since the edge probability distribution map is obtained based on the edge detection results of the grayscale image at N scales, the edge probability distribution map can fuse the edge detection results of the grayscale image at N scales, balancing the precision and recall of edge detection, making the final fused edge image more consistent with human visual characteristics, thereby solving the problem that single-scale edge detection cannot fuse multi-scale information at the same resolution, resulting in the final fused edge image not matching human visual characteristics.

[0058] In one embodiment, step 102 above, obtaining the edge probability distribution map corresponding to the grayscale image based on the N detection results, includes:

[0059] Determine the grayscale value of each pixel in the grayscale image among the N detection results;

[0060] Based on the N grayscale values ​​corresponding to each pixel, the probability value of each pixel being an edge pixel is obtained;

[0061] The edge probability distribution map is obtained based on the probability values ​​corresponding to all pixels in the grayscale image.

[0062] In practice, the detection result is an edge map, which is a binary map. The grayscale value of each pixel's coordinates (x, y) in a detection result (the detection result is an edge map) is 0 or 1. 0 indicates that the pixel is a pixel on the edge map, and 1 indicates that the pixel is not a pixel on the edge map.

[0063] Alternatively, it can be based on the formula: Calculate the probability value of each pixel being an edge pixel;

[0064] Where P1 refers to the probability value that the pixel coordinates (x, y) are edge pixels; N refers to the number of scales. This represents the grayscale value of the pixel coordinates (x, y) in the detection result at scale i in the grayscale image, where i = 1, 2, ..., N; 0 indicates that (x,y) is a non-edge pixel, and 1 indicates that (x,y) is an edge pixel; here, (x,y) represents the coordinates of a pixel in the grayscale image.

[0065] In this embodiment, after calculating the probability values ​​corresponding to all pixels in the grayscale image, the following can be obtained: Figure 3The first image from the left shows the edge probability distribution map. Each pixel in the edge probability distribution map corresponds to a probability value, which is used to characterize the probability that the pixel is a pixel on the edge image.

[0066] In one embodiment, step 103 above, obtaining the edge image corresponding to the grayscale image based on the edge probability distribution map, includes:

[0067] Based on the marginal probability distribution map, a marginal probability map pyramid is generated; the marginal probability map pyramid includes M marginal probability maps of different sizes; M is a positive integer.

[0068] Remove pixels whose probability values ​​are less than a preset threshold from the M edge probability maps to obtain a downsampled image corresponding to each edge probability map;

[0069] Based on the M downsampled images, the edge image corresponding to the grayscale image is obtained.

[0070] It should be noted that the value of M is related to the scale of the original grayscale image. For example, if the original image is 7×7 pixels, then M can be 4.

[0071] For example, such as Figure 3 As shown, for a grayscale image with 7×7 pixels, the first layer is a 7×7 edge probability map, the second layer is a 5×5 edge probability map, the third layer is a 3×3 edge probability map, and the fourth layer is a 1×1 edge probability map.

[0072] It should be explained that if a pixel's probability value is less than a preset threshold, it means that the corresponding pixel is less likely to be an edge pixel. Therefore, pixels with probability values ​​less than the preset threshold in each edge probability map are filtered out. Further, after filtering out pixels with probability values ​​less than the preset threshold, the downsampled edge image corresponding to each edge probability map can be obtained based on the remaining pixels. That is, pixels with probability values ​​greater than or equal to the preset threshold are considered edge pixels, and their grayscale value is set to 1; pixels with probability values ​​lower than the preset threshold are considered non-edge pixels, and their grayscale value is set to 0. This ultimately yields the downsampled edge image corresponding to each edge probability map.

[0073] In this embodiment, an edge probability map pyramid is generated based on the edge probability distribution map; further, M downsampled images are generated based on the edge probability map pyramid. Compared with the original image pyramid scheme in the prior art, this application integrates multi-scale information at the same resolution, improves edge robustness, and the obtained edge image is more consistent with human visual characteristics. It can also reduce computational complexity, making the edge detection method more efficient and solving the problems of high complexity, information loss, and inconsistency with human visual characteristics of image pyramids.

[0074] It is particularly important to note that this application does not construct a pyramid from the original image. Instead, it obtains an edge probability map pyramid based on the edge probability distribution maps of the original image at multiple scales, and further obtains a downsampled image based on the edge probability map pyramid. The multi-scale edge probability map retains the accuracy of low-scale edges and has the noise resistance of high-scale edges, improving the accuracy of edge detection and making the detected edges more consistent with human visual perception.

[0075] In one embodiment, generating an edge probability map pyramid based on the edge probability distribution map includes:

[0076] Radial differential downsampling is performed on the edge probability distribution map to generate the edge probability map pyramid;

[0077] Wherein, the probability value corresponding to the outermost corner pixel of the i-th edge probability map is the radial difference between the probability value corresponding to the outermost corner pixel of the (i+1)-th edge probability map and the probability value corresponding to the second-to-last corner pixel.

[0078] The probability value of each non-corner pixel in the outermost layer of the i-th edge probability map is the radial difference between the probability value of the non-corner pixel in the outermost layer of the (i+1)-th edge probability map and the probability value of the non-corner pixel in the second-to-last layer.

[0079] It should be noted that the main idea of ​​radial difference is that the probability values ​​of the four corner pixels of the outermost layer are obtained by subtracting the probability values ​​of the diagonal pixels, and the probability values ​​of other pixels in the outermost layer are obtained by subtracting the probability values ​​of the corresponding pixels in the previous layer. Compared with traditional maximum value downsampling and other methods, this downsampling method can integrate the contextual features and relationships of pixels, and is more representative of the edges. Moreover, since it is a pyramid of the edge probability distribution map, the computational load is low, reducing the computational complexity and improving the processing efficiency.

[0080] For example, such as Figure 3 In the middle, the first layer is a 7×7 marginal probability map, x i (i = 1, ..., 49) represents the marginal probability value, and the arrow indicates radial difference. The second layer is a 5×5 marginal probability map, calculated as follows: y1 = x1 - x9, y2 = x3 - x9. 10 y3 = x4 - x 11 y4 = x5 - x 12 y5 = x7 - x 13 y6=x 15 -x 16 y7=x 21 -x 20 y8=x 22 -x 23 y9=x 28 -x 27 y10 =x 29 -x 30 y 11 =x 35 -x 34 y 12 =x 43 -x 37 y 13 =x 45 -x 38 y 14 =x 46 -x 39 y 15 =x 47 -x 40 y 16 =x 49 -x 41 Similarly, the third layer is a 3×3 marginal probability map, calculated as: z1=y1-x 17 z2=y3-x 18 z3 = y5 - x 19 z4 = y8 - x 24 z5 = y9 - x 26 z6 = y 12 -x 31 z7 = y 14 -x 32 z8 = y 16 -x 33 The fourth layer is a 1×1 edge probability map. Since there is only one pixel, the probability value of that pixel remains unchanged: x 25 .

[0081] In one embodiment, obtaining the edge image corresponding to the grayscale image based on the M downsampled images includes:

[0082] Upsampling is performed on the M downsampled images to obtain M upsampled images with the same resolution as the grayscale image;

[0083] The M upsampled images are fused to obtain the edge image corresponding to the grayscale image.

[0084] It should be noted that downsampling means reducing the size of the image, while upsampling means enlarging the size of the image.

[0085] For example, an edge map with the same resolution as the original grayscale image can be obtained by performing bilinear interpolation on the downsampled image.

[0086] For example, when fusing M upsampled images, the edge image corresponding to the grayscale image can be obtained by averaging the grayscale values ​​of the M upsampled images.

[0087] For example, such as Figure 4 The diagram shows a flowchart of an image edge detection method according to an embodiment of this application, which mainly includes the following steps:

[0088] Step 1: Perform edge detection at n scales on the input grayscale image to obtain n detection results; the n detection results obtained in Step 1 correspond to... Figure 4 A schematic diagram of multi-scale edge detection.

[0089] Step 2: Based on the n detection results, calculate the edge probability of each pixel in the grayscale image to obtain the edge probability distribution map of the grayscale image; the edge probability distribution map obtained in Step 2 corresponds to... Figure 4 A schematic diagram of the marginal probability distribution in the image.

[0090] Step 3: Perform radial differential downsampling on the edge probability distribution map to generate the edge probability map pyramid; the edge probability pyramid in Step 3 corresponds to... Figure 4 A schematic diagram of the radial difference pyramid.

[0091] Step 4: Remove pixels with probability values ​​less than a preset threshold from the M edge probability maps to obtain a downsampled image corresponding to each edge probability map; the downsampled image in Step 4 corresponds to... Figure 4 A schematic diagram of threshold filtering in [the diagram].

[0092] Step 5: Perform upsampling processing on the downsampled image to obtain M upsampled images with the same resolution as the grayscale image; the upsampled images in Step 5 correspond to... Figure 4 A schematic diagram of mid-to-up sampling;

[0093] Step 6: Perform fusion processing on the M upsampled images to obtain the edge image corresponding to the grayscale image.

[0094] Furthermore, such as Figure 5 As shown, an embodiment of the present invention provides an image edge detection device 500, comprising:

[0095] The first processing module 501 is used to perform edge detection at N scales on the grayscale image corresponding to the image to be detected, and obtain N detection results; N is a positive integer.

[0096] The second processing module 502 is used to obtain an edge probability distribution map corresponding to the grayscale image based on the N detection results; the edge probability distribution map is used to characterize the probability value of each pixel in the grayscale image being an edge pixel.

[0097] The third processing module 503 is used to obtain the edge image corresponding to the grayscale image based on the edge probability distribution map.

[0098] Optionally, the second processing module 502 includes:

[0099] The first processing submodule is used to determine the grayscale value of each pixel in the grayscale image among the N detection results;

[0100] The second processing submodule is used to obtain the probability value of each pixel being an edge pixel based on the N gray values ​​corresponding to each pixel.

[0101] The third processing submodule is used to obtain the edge probability distribution map based on the probability values ​​corresponding to all pixels in the grayscale image.

[0102] Optionally, the second processing submodule includes:

[0103] According to the formula: Calculate the probability value of each pixel being an edge pixel; where P1 represents the probability value of pixel coordinates (x, y) being an edge pixel; N represents the number of scales. This represents the grayscale value of the pixel coordinates (x, y) in the detection result at scale i in the grayscale image, where i = 1, 2, ..., N; 0 indicates that (x,y) is a non-edge pixel, and 1 indicates that (x,y) is an edge pixel.

[0104] Optionally, the third processing module 503 includes:

[0105] The fourth processing submodule is used to generate an edge probability map pyramid based on the edge probability distribution map; the edge probability map pyramid includes M edge probability maps of different sizes; M is a positive integer;

[0106] The fifth processing submodule is used to remove pixels with probability values ​​less than a preset threshold from the M edge probability maps to obtain a downsampled image corresponding to each edge probability map;

[0107] The sixth processing submodule is used to obtain the edge image corresponding to the grayscale image based on the M downsampled images.

[0108] Optionally, the fourth processing submodule includes:

[0109] The first processing unit is used to perform radial differential downsampling on the edge probability distribution map to generate the edge probability map pyramid.

[0110] Wherein, the probability value corresponding to the outermost corner pixel of the i-th edge probability map is the radial difference between the probability value corresponding to the outermost corner pixel of the (i+1)-th edge probability map and the probability value corresponding to the second-to-last corner pixel.

[0111] The probability value of each non-corner pixel in the outermost layer of the i-th edge probability map is the radial difference between the probability value of the non-corner pixel in the outermost layer of the (i+1)-th edge probability map and the probability value of the non-corner pixel in the second-to-last layer.

[0112] Optionally, the sixth processing submodule includes:

[0113] The second processing unit is used to perform upsampling processing on the M downsampled images to obtain M upsampled images with the same resolution as the grayscale image;

[0114] The third processing unit is used to perform fusion processing on the M upsampled images to obtain the edge image corresponding to the grayscale image.

[0115] The edge detection device 500 of this embodiment obtains the edge probability distribution map based on the edge detection results of the grayscale image at N scales. Therefore, the edge probability distribution map can fuse the edge detection results of the grayscale image at N scales, balance the precision and recall of edge detection, and make the final fused edge image more consistent with the visual characteristics of the human eye. This solves the problem that single-scale edge detection cannot fuse multi-scale information at the same resolution, resulting in the final fused edge image not conforming to the visual characteristics of the human eye.

[0116] like Figure 6 As shown, an image processing device 600 according to an embodiment of the present invention includes a processor 610 and a transceiver 620, wherein the processor is used for the following steps:

[0117] Perform edge detection at N scales on the grayscale image corresponding to the image to be detected to obtain N detection results; N is a positive integer.

[0118] Based on the N detection results, an edge probability distribution map corresponding to the grayscale image is obtained; the edge probability distribution map is used to characterize the probability value of each pixel in the grayscale image being an edge pixel;

[0119] Based on the edge probability distribution map, the edge image corresponding to the grayscale image is obtained.

[0120] Optionally, the processor is specifically used for the following steps:

[0121] Determine the grayscale value of each pixel in the grayscale image among the N detection results;

[0122] Based on the N grayscale values ​​corresponding to each pixel, the probability value of each pixel being an edge pixel is obtained;

[0123] The edge probability distribution map is obtained based on the probability values ​​corresponding to all pixels in the grayscale image.

[0124] Optionally, the processor is specifically used for the following steps:

[0125] According to the formula: Calculate the probability value of each pixel being an edge pixel;

[0126] Where P1 refers to the probability value that the pixel coordinates (x, y) are edge pixels; N refers to the number of scales. This represents the grayscale value of the pixel coordinates (x, y) in the detection result at scale i in the grayscale image, where i = 1, 2, ..., N; 0 indicates that (x,y) is a non-edge pixel, and 1 indicates that (x,y) is an edge pixel.

[0127] Optionally, the processor is specifically used for the following steps:

[0128] Based on the marginal probability distribution map, a marginal probability map pyramid is generated; the marginal probability map pyramid includes M marginal probability maps of different sizes; M is a positive integer.

[0129] Remove pixels whose probability values ​​are less than a preset threshold from the M edge probability maps to obtain a downsampled image corresponding to each edge probability map;

[0130] Based on the M downsampled images, the edge image corresponding to the grayscale image is obtained.

[0131] Optionally, the processor is specifically used for the following steps:

[0132] Radial differential downsampling is performed on the edge probability distribution map to generate the edge probability map pyramid;

[0133] Wherein, the probability value corresponding to the outermost corner pixel of the i-th edge probability map is the radial difference between the probability value corresponding to the outermost corner pixel of the (i+1)-th edge probability map and the probability value corresponding to the second-to-last corner pixel.

[0134] The probability value of each non-corner pixel in the outermost layer of the i-th edge probability map is the radial difference between the probability value of the non-corner pixel in the outermost layer of the (i+1)-th edge probability map and the probability value of the non-corner pixel in the second-to-last layer.

[0135] Optionally, the processor is specifically used for the following steps:

[0136] Upsampling is performed on the M downsampled images to obtain M upsampled images with the same resolution as the grayscale image;

[0137] The M upsampled images are fused to obtain the edge image corresponding to the grayscale image.

[0138] The image processing device 600 of this embodiment obtains the edge probability distribution map based on the edge detection results of the grayscale image at N scales. Therefore, the edge probability distribution map can fuse the edge detection results of the grayscale image at N scales, balance the precision and recall of edge detection, and make the final fused edge image more consistent with the visual characteristics of the human eye. This solves the problem that single-scale edge detection cannot fuse multi-scale information at the same resolution, resulting in the final fused edge image not conforming to the visual characteristics of the human eye.

[0139] Another embodiment of the image processing device of the present invention, such as Figure 7 As shown, it includes a transceiver 710, a processor 700, a memory 720, and a program or instructions stored in the memory 720 and executable on the processor 700; when the processor 700 executes the program or instructions, it implements the above-described edge detection method applied to images.

[0140] The transceiver 710 is used to receive and send data under the control of the processor 700.

[0141] Among them, Figure 7 In this context, the bus architecture can include any number of interconnected buses and bridges, specifically linking various circuits of one or more processors represented by processor 700 and memory represented by memory 720 together. The bus architecture can also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides an interface. The transceiver 710 can be multiple elements, including transmitters and receivers, providing a unit for communicating with various other devices over a transmission medium. For different user equipment, the user interface 730 can also be an interface capable of connecting external or internal devices, including but not limited to keypads, displays, speakers, microphones, joysticks, etc.

[0142] The processor 700 is responsible for managing the bus architecture and general processing, while the memory 720 can store the data used by the processor 700 during operation.

[0143] This invention provides a readable storage medium storing a program or instructions. When executed by a processor, the program or instructions implement the steps of the image edge detection method described above and achieve the same technical effect. To avoid repetition, further details are omitted here. The computer-readable storage medium may include read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0144] It should be further noted that the terminals described in this specification include, but are not limited to, smartphones, tablets, etc., and many of the functional components described are referred to as modules in order to emphasize the independence of their implementation.

[0145] In this embodiment of the invention, the module can be implemented in software so that it can be executed by various types of processors. For example, an identified executable code module may include one or more physical or logical blocks of computer instructions, which may be constructed as objects, procedures, or functions. Nevertheless, the executable code of the identified module does not need to be physically located together, but may include different instructions stored in different bits, which, when logically combined, constitute the module and achieve the module's intended purpose.

[0146] In practice, an executable code module can be a single instruction or many instructions, and can even be distributed across multiple different code segments, different programs, and across multiple memory devices. Similarly, operational data can be identified within the module and can be implemented in any suitable form and organized within any suitable type of data structure. This operational data can be collected as a single dataset or distributed across different locations (including different storage devices), and can exist, at least in part, solely as electronic signals within the system or network.

[0147] When a module can be implemented using software, considering the current level of hardware technology, modules that can be implemented in software can be implemented using hardware circuits by those skilled in the art to achieve the corresponding functions, without considering cost. These hardware circuits include conventional very-large-scale integrated circuits (VLSI) or gate arrays, as well as existing semiconductors such as logic chips and transistors, or other discrete components. Modules can also be implemented using programmable hardware devices, such as field-programmable gate arrays, programmable array logic, and programmable logic devices.

[0148] The exemplary embodiments described above are with reference to the accompanying drawings. Many different forms and embodiments are feasible without departing from the spirit and teachings of the invention. Therefore, the invention should not be construed as limiting the exemplary embodiments set forth herein. Rather, these exemplary embodiments are provided to make the invention complete and convey the scope of the invention to those skilled in the art. In these drawings, component dimensions and relative dimensions may be exaggerated for clarity. The terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. As used herein, unless clearly indicated otherwise, the singular forms “a,” “an,” and “the” are intended to include all such forms. It will be further understood that the terms “comprising” and / or “including”, when used in this specification, indicate the presence of the stated features, integers, steps, operations, components, and / or elements, but do not exclude the presence or addition of one or more other features, integers, steps, operations, components, and / or groups thereof. Unless otherwise indicated, when stated, a range of values ​​includes the upper and lower limits of the range and any subranges in between.

[0149] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. An image edge detection method, characterized in that, include: Perform edge detection at N scales on the grayscale image corresponding to the image to be detected to obtain N detection results; N is a positive integer. Based on the N detection results, the edge probability distribution map corresponding to the grayscale image is obtained; The edge probability distribution map is used to characterize the probability value of each pixel in the grayscale image being an edge pixel; Obtaining the edge image corresponding to the grayscale image based on the edge probability distribution map includes: generating an edge probability map pyramid based on the edge probability distribution map. Radial differential downsampling is performed on the edge probability distribution map to generate the edge probability map pyramid; Wherein, the probability value corresponding to the outermost corner pixel of the i-th edge probability map is the radial difference between the probability value corresponding to the outermost corner pixel of the (i+1)-th edge probability map and the probability value corresponding to the second-to-last corner pixel. The probability value of each non-corner pixel in the outermost layer of the i-th edge probability map is the radial difference between the probability value of the non-corner pixel in the outermost layer of the (i+1)-th edge probability map and the probability value of the non-corner pixel in the second-to-last layer.

2. The image edge detection method according to claim 1, characterized in that, The step of obtaining the edge probability distribution map corresponding to the grayscale image based on the N detection results includes: Determine the grayscale value of each pixel in the grayscale image among the N detection results; Based on the N grayscale values ​​corresponding to each pixel, the probability value of each pixel being an edge pixel is obtained; The edge probability distribution map is obtained based on the probability values ​​corresponding to all pixels in the grayscale image.

3. The image edge detection method according to claim 2, characterized in that, The step of obtaining the probability value of each pixel being an edge pixel based on the N gray values ​​corresponding to each pixel includes: According to the formula: Calculate the probability value of each pixel being an edge pixel; Where P1 refers to the probability value that the pixel coordinates (x, y) are edge pixels; N refers to the number of scales. This represents the grayscale value of the pixel coordinates (x, y) in the detection result at scale i in the grayscale image. 0 indicates that (x, y) is a non-edge pixel, and 1 indicates that (x, y) is an edge pixel.

4. The image edge detection method according to claim 1, characterized in that, The step of obtaining the edge image corresponding to the grayscale image based on the edge probability distribution map further includes: The marginal probability graph pyramid comprises M marginal probability graphs of different sizes; M is a positive integer. Remove pixels whose probability values ​​are less than a preset threshold from the M edge probability maps to obtain a downsampled image corresponding to each edge probability map; Based on the M downsampled images, the edge image corresponding to the grayscale image is obtained.

5. The image edge detection method according to claim 4, characterized in that, The step of obtaining the edge image corresponding to the grayscale image based on the M downsampled images includes: Upsampling is performed on the M downsampled images to obtain M upsampled images with the same resolution as the grayscale image; The M upsampled images are fused to obtain the edge image corresponding to the grayscale image.

6. An image edge detection device, characterized in that, include: The first processing module is used to perform edge detection at N scales on the grayscale image corresponding to the image to be detected, and obtain N detection results; N is a positive integer. The second processing module is used to obtain the edge probability distribution map corresponding to the grayscale image based on the N detection results; The edge probability distribution map is used to characterize the probability value of each pixel in the grayscale image being an edge pixel; The third processing module is used to obtain the edge image corresponding to the grayscale image based on the edge probability distribution map, including: generating an edge probability map pyramid based on the edge probability distribution map. Radial differential downsampling is performed on the edge probability distribution map to generate the edge probability map pyramid; Wherein, the probability value corresponding to the outermost corner pixel of the i-th edge probability map is the radial difference between the probability value corresponding to the outermost corner pixel of the (i+1)-th edge probability map and the probability value corresponding to the second-to-last corner pixel. The probability value of each non-corner pixel in the outermost layer of the i-th edge probability map is the radial difference between the probability value of the non-corner pixel in the outermost layer of the (i+1)-th edge probability map and the probability value of the non-corner pixel in the second-to-last layer.

7. An image processing device, characterized in that, include: Transceiver and processor; The processor is used for: Perform edge detection at N scales on the grayscale image corresponding to the image to be detected to obtain N detection results; N is a positive integer. Based on the N detection results, the edge probability distribution map corresponding to the grayscale image is obtained; The edge probability distribution map is used to characterize the probability value of each pixel in the grayscale image being an edge pixel; Obtaining the edge image corresponding to the grayscale image based on the edge probability distribution map includes: generating an edge probability map pyramid based on the edge probability distribution map. Radial differential downsampling is performed on the edge probability distribution map to generate the edge probability map pyramid; Wherein, the probability value corresponding to the outermost corner pixel of the i-th edge probability map is the radial difference between the probability value corresponding to the outermost corner pixel of the (i+1)-th edge probability map and the probability value corresponding to the second-to-last corner pixel. The probability value of each non-corner pixel in the outermost layer of the i-th edge probability map is the radial difference between the probability value of the non-corner pixel in the outermost layer of the (i+1)-th edge probability map and the probability value of the non-corner pixel in the second-to-last layer.

8. An image processing apparatus, comprising: A transceiver, a processor, a memory, and a program or instructions stored in the memory and executable on the processor; characterized in that, when the processor executes the program or instructions, it implements the image edge detection method as described in any one of claims 1-5.

9. A readable storage medium having a program or instructions stored thereon, characterized in that, When the program or instructions are executed by the processor, they implement the steps in the image edge detection method as described in any one of claims 1-5.