Edge detection method based on dispersion light band extraction and multi-modal fitting

Through the edge detection method of dispersive light band extraction and multimodal fit, the detection problems of the prior art in low light, dark angle, low contrast and noise scenarios are solved, and high-precision and efficient edge detection are achieved, which is suitable for multiple fields.

CN120451192APending Publication Date: 2025-08-08HUZHOU INST OF ZHEJIANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510506979.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-22
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

The existing edge detection technology has significant flaws in low-light environments, viscera and low-contrast scenarios, and noise sensitivity, resulting in a decrease in detection reliability and accuracy. The deep learning model has high demand for computing power, making it difficult to deploy on computing power-limited devices.

Method used

Using edge detection method based on dispersive light band extraction and multimodal fitting, through color segmentation and clustering analysis, controllable dispersion optical elements are used to separate light band information of different wavelengths, combined with a lightweight fitting algorithm, the contours of specific color regions in the image are extracted and effective clusters are screened out, and convex hulls and original points are drawn.

Benefits of technology

It improves the robustness and accuracy of edge detection, reduces the sensitivity to noise, reduces the computing power requirement, adapts to complex backgrounds, and improves the reliability and efficiency of image area processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120451192A_ABST
    Figure CN120451192A_ABST
Patent Text Reader

Abstract

The invention relates to an edge detection method based on dispersion light band extraction and multi-modal fitting. The invention relates to the technical field of image edge detection. According to the invention, image data reading and color space conversion are carried out; defining a color range, and generating a mask of a corresponding color; each color mask is subjected to contour extraction, and contour points are determined; carrying out clustering analysis on the contour points; screening results of the clustering analysis to obtain effective clusters; and extracting and connecting clusters on the outermost side, storing the processed image to a specified path, and displaying a processing result in a window. The method has the advantages of being high in processing precision, high in adaptability to complex backgrounds and the like, can effectively improve the reliability and efficiency of image area processing, and has wide application prospects in multiple fields.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of image edge detection, and is an edge detection method based on dispersion light band extraction and multimodal fitting. Background Art

[0002] Although existing edge detection technologies perform well in common scenarios, they still have significant drawbacks in the following complex scenarios, which restricts their practical application:

[0003] 1. Limitations of Dark Corner Edge Detection

[0004] In low-light environments or areas with optical distortion (such as lens vignetting), traditional edge detection algorithms (such as Canny and Sobel) rely on image gradient information for edge extraction. However, in dark corners, the gradient amplitude is significantly reduced due to light attenuation or distortion, and noise interference is enhanced, resulting in loss or distortion of gradient information. For example, in surface inspection of industrial parts, fine cracks in dark corners can be easily misjudged as background noise due to weak gradient signals. In security monitoring scenarios, the outline of a human body in low-light environments may be missed due to gradient fractures. The Canny algorithm significantly increases its false detection rate in dark corners, seriously affecting detection reliability.

[0005] 2. Blurred edges in low-contrast foreground-background scenes

[0006] When the target and background have similar colors or grayscales (e.g., a white object against a light background), traditional methods based on grayscale threshold segmentation or color difference have difficulty effectively distinguishing edges. In such scenarios, the direction of edge gradients is chaotic, and the signal-to-noise ratio (SNR) drops significantly, making it difficult for algorithms to accurately locate boundaries. For example, in medical imaging, low-contrast boundaries between soft tissue and surrounding tissue are often overlooked due to gradient blurring. In autonomous driving, road markings in foggy conditions are similar in color to the road surface, making traditional algorithms prone to breakage or misconnection.

[0007] 3. Bottlenecks of Noise Sensitivity and High Computing Power Consumption

[0008] Although deep learning models (such as U-Net and Mask R-CNN) have shown certain advantages in edge detection, they have two core flaws:

[0009] Noise sensitivity: The model is susceptible to environmental noise, such as sudden changes in illumination, reflections, or sensor thermal noise, which can cause artifacts or breaks in edge predictions. For example, in metal surface detection, noise in reflective areas can be misidentified as edges.

[0010] High computing power requirements: Deep learning models rely on high-performance hardware such as GPUs and TPUs, making them difficult to deploy on embedded devices with limited computing power. Furthermore, model training requires a large amount of labeled data, further increasing application costs.

[0011] To address these issues, this paper proposes an edge detection method that combines dispersion band extraction with a multimodal fitting algorithm. By introducing a controllable dispersion optical element to separate the information from light bands of different wavelengths, combined with a lightweight fitting algorithm, the robustness, speed, and accuracy of edge detection are significantly improved. Summary of the Invention

[0012] In view of the shortcomings of the existing technology, the present invention provides an edge detection method based on dispersion light band extraction and multimodal fitting.

[0013] The present invention provides the following technical solutions:

[0014] An edge detection method based on dispersion light band extraction and multimodal fitting, the method comprising the following steps:

[0015] Step 1: Read image data and convert color space;

[0016] Step 2: Define the color range and generate a mask of the corresponding color;

[0017] Step 3: Perform contour extraction on each color mask and determine the contour points;

[0018] Step 4: Perform cluster analysis on contour points;

[0019] Step 5: Filter the results of cluster analysis to select valid clusters;

[0020] Step 6: Extract the outermost clusters and connect them. Save the processed image to the specified path and display the processing results in the window.

[0021] Preferably, the step 1 is specifically:

[0022] Read the image file to be processed from the specified path. If the image cannot be loaded correctly, an error message will be output and the processing will be terminated. The image reading function in the image processing library will be used to read the image file.

[0023] Convert the read image from BGR color space to HSV color space to ensure that HSV can cover a wider range of colors under different brightness levels, so as to facilitate subsequent color extraction and complete edge detection tasks.

[0024] Preferably, the step 2 is specifically as follows:

[0025] Step 2.1: Predefine specific colors. When red, orange, and blue are dispersed in visible light, the resulting color bands include red, orange, yellow, green, cyan, blue, and violet. When capturing images, red, orange, and blue are the most obvious color bands, which are within the HSV color space.

[0026] For each defined color range, use the cv2.inRange function to generate the corresponding color mask.

[0027] Preferably, the step 3 is specifically as follows:

[0028] Step 3.1: For each color mask, use the cv2.findContours function to find its outer contour;

[0029] Step 3.2: When searching for contour points, use point.size == 2 to limit all points to two-dimensional coordinates to ensure code accuracy;

[0030] Step 3.3: Extract all the points of each contour and store them in a list.

[0031] Preferably, the step 4 is specifically as follows:

[0032] Step 4.1: Convert the list storing the contour points into a NumPy array;

[0033] Step 4.2: Use DBSCAN to cluster all contour points, set the neighborhood radius and the minimum number of points required to form a core point, and set eps to 10 and min_samples to 5.

[0034] Preferably, the step 5 is specifically as follows:

[0035] Count the number of points in each cluster and ignore noise points;

[0036] The clusters with points greater than or equal to the preset threshold of 20 are selected as valid clusters.

[0037] Preferably, the step 6 is specifically:

[0038] Step 6.1: Merge all valid clusters and use the if function to set the label to 1 and the points with count >= 20;

[0039] Step 6.2: Use the cv2.convexHull function to calculate the convex hull of the point.

[0040] Step 6.3: Use the hull.squeeze function to extract all convex hull points;

[0041] Step 6.4: Use the np.mean function to calculate the center point of the convex hull point set;

[0042] Step 6.5: Sort the convex hull points according to their angles relative to the center point. dx and dy are the differences in the horizontal and vertical coordinates between a point and the center point. Calculate the polar angle using np.arctan2(dy, dx) and add the angle value to the angles list. Rearrange the original convex hull vertex array hull_points according to the sorted_indices index to generate a vertex set sorted_hull_points arranged in polar angle order.

[0043] Step 6.6: Use np.vstack to connect the sorted convex hull points to form a closed curve;

[0044] Step 6.7: Draw the original points and closed curves on the image and set the drawing color.

[0045] An edge detection system based on dispersion light band extraction and multimodal fitting algorithm, the system includes a data acquisition module, the data acquisition module performs image data reading and color space conversion;

[0046] A mask generation module, wherein the mask generation module defines a color range and generates a mask of a corresponding color;

[0047] A contour extraction module, wherein the contour extraction module performs contour extraction on each color mask to determine contour points;

[0048] A cluster analysis module, wherein the cluster analysis module performs cluster analysis on the contour points;

[0049] A screening module, wherein the screening module screens the results of the cluster analysis to select valid clusters;

[0050] A display module extracts and connects the outermost clusters, saves the processed image to a specified path, and displays the processing result in a window.

[0051] A computer-readable storage medium stores a computer program, which is executed by a processor to implement an edge detection method based on dispersion light band extraction and multimodal fitting.

[0052] A computer device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, an edge detection method based on dispersion light band extraction and multimodal fitting is implemented.

[0053] The present invention has the following beneficial effects:

[0054] Compared with the prior art, the present invention has the following advantages:

[0055] This method combines color segmentation and cluster analysis to accurately extract the outlines of specific color regions in an image, screen out qualified regions, and ultimately plot their convex hulls and origin points. This method boasts high processing accuracy and adaptability to complex backgrounds, effectively improving the reliability and efficiency of image region processing and possessing broad application prospects in a variety of fields. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0057] Figure 1 This is a simulation of the effect of photographing an asteroid directly with a CMOS camera using Zemax simulation software;

[0058] Figure 2 This is a simulation of the effect of using a CMOS camera to photograph an asteroid after adding a dispersion-enhanced optical lens;

[0059] Figure 3 It simulates direct shooting, extracts edge effects using deep learning methods, and shoots with an enhanced vertical axis chromatic aberration lens, extracting edge effects using the same deep learning method.

[0060] Figure 4 It uses the light band extraction algorithm to directly extract the light band effect;

[0061] Figure 5 is the edge curve fitted by the fitting algorithm;

[0062] Figure 6 The fitted edge curve (green) and the removed noise (pink). DETAILED DESCRIPTION

[0063] The technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0064] The present invention is described in detail below with reference to specific embodiments. Specific embodiment one:

[0066] according to Figures 1-6As shown, the specific optimization technical solution adopted by the present invention to solve the above technical problems is:

[0067] The present invention provides an edge detection method based on dispersion light band extraction and multimodal fitting, which is characterized in that the method comprises the following steps:

[0068] Step 1: Read image data and convert color space;

[0069] Step 2: Define the color range and generate a mask of the corresponding color;

[0070] Step 3: Perform contour extraction on each color mask and determine the contour points;

[0071] Step 4: Perform cluster analysis on contour points;

[0072] Step 5: Filter the results of cluster analysis to select valid clusters;

[0073] Step 6: Extract the outermost clusters and connect them. Save the processed image to the specified path and display the processing results in the window.

[0074] This method combines color segmentation and cluster analysis to accurately extract the outlines of specific color regions in an image, screen out qualified regions, and ultimately plot their convex hulls and origin points. This method boasts high processing accuracy and adaptability to complex backgrounds, effectively improving the reliability and efficiency of image region processing and possessing broad application prospects in a variety of fields. Specific embodiment two:

[0076] The difference between the second embodiment of the present invention and the first embodiment is that:

[0077] The step 1 is specifically as follows:

[0078] Read the image file to be processed from the specified path. If the image cannot be loaded correctly, an error message will be output and the processing will be terminated. The image reading function in the image processing library will be used to read the image file.

[0079] Convert the read image from BGR color space to HSV color space to ensure that HSV can cover a wider range of colors under different brightness levels, so as to facilitate subsequent color extraction and complete edge detection tasks. Specific embodiment three:

[0081] The only difference between the third embodiment of the present invention and the second embodiment is that:

[0082] The step 2 is specifically as follows:

[0083] Step 2.1: Predefine specific colors. When red, orange, and blue are dispersed in visible light, the resulting color bands include red, orange, yellow, green, cyan, blue, and violet. When capturing images, red, orange, and blue are the most obvious color bands, which are within the HSV color space.

[0084] For each defined color range, use the cv2.inRange function to generate the corresponding color mask. Specific embodiment four:

[0086] The only difference between the fourth embodiment of the present invention and the third embodiment is that:

[0087] The step 3 is specifically as follows:

[0088] Step 3.1: For each color mask, use the cv2.findContours function to find its outer contour;

[0089] Step 3.2: When searching for contour points, use point.size == 2 to limit all points to two-dimensional coordinates to ensure code accuracy;

[0090] Step 3.3: Extract all the points of each contour and store them in a list. Specific embodiment five:

[0092] The only difference between the fifth embodiment of the present invention and the fourth embodiment is that:

[0093] The step 4 is specifically as follows:

[0094] Step 4.1: Convert the list storing the contour points into a NumPy array;

[0095] Step 4.2: Use DBSCAN to cluster all contour points, set the neighborhood radius and the minimum number of points required to form a core point, and set eps to 10 and min_samples to 5. Specific embodiment six:

[0097] The only difference between the sixth embodiment of the present invention and the fifth embodiment is that:

[0098] The step 5 is specifically as follows:

[0099] Count the number of points in each cluster and ignore noise points;

[0100] The clusters with points greater than or equal to the preset threshold of 20 are selected as valid clusters. Specific embodiment seven:

[0102] The only difference between the seventh embodiment of the present invention and the sixth embodiment is that:

[0103] The step 6 is specifically as follows:

[0104] Step 6.1: Merge all valid clusters and use the if function to set the label to 1 and the points with count >= 20;

[0105] Step 6.2: Use the cv2.convexHull function to calculate the convex hull of the point.

[0106] Step 6.3: Use the hull.squeeze function to extract all convex hull points;

[0107] Step 6.4: Use the np.mean function to calculate the center point of the convex hull point set;

[0108] Step 6.5: Sort the convex hull points according to their angles relative to the center point. dx and dy are the differences in the horizontal and vertical coordinates between a point and the center point. Calculate the polar angle using np.arctan2(dy, dx) and add the angle value to the angles list. Rearrange the original convex hull vertex array hull_points according to the sorted_indices index to generate a vertex set sorted_hull_points arranged in polar angle order.

[0109] Step 6.6: Use np.vstack to connect the sorted convex hull points to form a closed curve;

[0110] Step 6.7: Draw the original points and closed curves on the image and set the drawing color. Specific embodiment eight:

[0112] The only difference between the eighth embodiment of the present invention and the seventh embodiment is that:

[0113] The present invention provides an edge detection system based on dispersion light band extraction and multimodal fitting algorithm, which is characterized in that: the system includes

[0114] A data acquisition module, which performs image data reading and color space conversion;

[0115] A mask generation module, wherein the mask generation module defines a color range and generates a mask of a corresponding color;

[0116] A contour extraction module, wherein the contour extraction module performs contour extraction on each color mask to determine contour points;

[0117] A cluster analysis module, wherein the cluster analysis module performs cluster analysis on the contour points;

[0118] A screening module, wherein the screening module screens the results of the cluster analysis to select valid clusters;

[0119] A display module extracts and connects the outermost clusters, saves the processed image to a specified path, and displays the processing result in a window. Specific embodiment nine:

[0121] The only difference between the ninth embodiment of the present invention and the eighth embodiment is that:

[0122] The present invention provides a computer-readable storage medium having a computer program stored thereon. The program is executed by a processor to implement an edge detection method based on dispersion light band extraction and multimodal fitting. Specific embodiment ten:

[0124] The only difference between the tenth embodiment of the present invention and the ninth embodiment is that:

[0125] The present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements an edge detection method based on dispersion light band extraction and multimodal fitting when executing the computer program. Specific implementation method eleven:

[0127] The specific application principle of the method of the present invention is as follows: The specific code is:

[0128]

[0129]

[0130]

[0131]

[0132]

[0133]

[0134] The method of the present invention comprises the following steps:

[0135] Step 1: Image reading and color space conversion

[0136] Reads an image from the specified path. If the read fails, an error message is output and processing is terminated.

[0137] Convert the read image from BGR color space to HSV color space to ensure that HSV can cover a wider range of colors under different brightness levels, so as to facilitate subsequent color extraction and complete edge detection tasks.

[0138] Step 2: Define the color range and generate the mask

[0139] Predefine the range of specific colors in the HSV color space (such as red, orange, and blue. This is because when visible light is dispersed, the color bands generated include red, orange, yellow, green, cyan, blue, and purple. Red, orange, and blue are the most obvious color bands when capturing images, so these three colors are used as examples).

[0140] For each defined color range, use the cv2.inRange function to generate the corresponding color mask.

[0141] Step 3: Contour extraction

[0142] For each color mask, use the cv2.findContours function to find its outer contour.

[0143] When searching for contour points, use point.size == 2 to limit all points to two-dimensional coordinates to ensure code accuracy.

[0144] Extract all the points for each contour and store them in a list.

[0145] Step 4:

[0146] Cluster analysis

[0147] Convert the list storing the contour points into a NumPy array.

[0148] Use the DBSCAN (density-based spatial clustering) algorithm to cluster all contour points, setting the neighborhood radius and the minimum number of points required to form a core point. In this algorithm, because the positions of light bands are uneven, dense points will be generated near the true edge and sparse points will be generated at the center of the object. Therefore, temporarily set eps to 10 and min_samples to 5.

[0149] Step 5: Screening valid clusters

[0150] Count the number of points in each cluster and ignore noise points (labeled as -1).

[0151] The clusters with the number of points greater than or equal to a preset threshold (such as 20) are selected as valid clusters.

[0152] Step 6: Extract the outermost clusters and connect them

[0153] Merge all points of valid clusters (use the if function to set label to 1 and count>=20).

[0154] Use cv2.convexHull function to calculate the convex hull of these points.

[0155] Use the hull.squeeze function to extract all convex hull points.

[0156] Use the np.mean function to calculate the center point of the convex hull point set.

[0157] Sort the convex hull points by their angle relative to the center point. dx and dy are the differences in the horizontal and vertical coordinates of a point relative to the center point. Calculate the polar angle using np.arctan2(dy, dx) and add the angle value to the angles list. Then, rearrange the original convex hull vertex array hull_points according to the sorted_indices index to generate a set of vertices sorted_hull_points sorted by polar angle.

[0158] Use np.vstack to connect the sorted convex hull points to form a closed curve.

[0159] Draw primitive points and closed curves on the image and set the drawing color.

[0160] Step 7: Save and display the results

[0161] Save the processed image to the specified path.

[0162] Display the processing results in the window and wait for the user to press a key to close the window.

[0163] The above description is merely a preferred embodiment of an edge detection method based on dispersion band extraction and multimodal fitting. The scope of protection for an edge detection method based on dispersion band extraction and multimodal fitting is not limited to the aforementioned embodiment; all technical solutions based on this concept fall within the scope of protection of the present invention. It should be noted that improvements and variations that do not depart from the principles of the present invention, as readily apparent to those skilled in the art, should also be considered within the scope of protection of the present invention.

Claims

1. An edge detection method based on dispersion band extraction and multimodal fitting, characterized by: The method comprises the following steps: Step 1: Read image data and convert color space; Step 2: Define the color range and generate a mask of the corresponding color; Step 3: Perform contour extraction on each color mask and determine the contour points; Step 4: Perform cluster analysis on contour points; Step 5: Filter the results of cluster analysis to select valid clusters; Step 6: Extract the outermost clusters and connect them. Save the processed image to the specified path and display the processing results in the window.

2. The method according to claim 1, wherein: The step 1 is specifically as follows: Read the image file to be processed from the specified path. If the image cannot be loaded correctly, an error message will be output and the processing will be terminated. The image reading function in the image processing library will be used to read the image file. Convert the read image from BGR color space to HSV color space to ensure that HSV can cover a wider range of colors under different brightness levels, so as to facilitate subsequent color extraction and complete edge detection tasks.

3. The method according to claim 2, wherein: The step 2 is specifically as follows: Step 2.1: Predefine specific colors. When red, orange, and blue are dispersed in visible light, the resulting color bands include red, orange, yellow, green, cyan, blue, and violet. When capturing images, red, orange, and blue are the most obvious color bands, which are within the HSV color space. For each defined color range, use the cv2.inRange function to generate the corresponding color mask.

4. The method according to claim 3, wherein: The step 3 is specifically as follows: Step 3.1: For each color mask, use the cv2.findContours function to find its outer contour; Step 3.2: When searching for contour points, use point.size == 2 to limit all points to two-dimensional coordinates to ensure code accuracy; Step 3.3: Extract all the points of each contour and store them in a list.

5. The method according to claim 4, wherein: The step 4 is specifically as follows: Step 4.1: Convert the list storing the contour points into a NumPy array; Step 4.2: Use DBSCAN to cluster all contour points, set the neighborhood radius and the minimum number of points required to form a core point, and set eps to 10 and min_samples to 5.

6. The method according to claim 5, wherein: The step 5 is specifically as follows: Count the number of points in each cluster and ignore noise points; The clusters with points greater than or equal to the preset threshold of 20 are selected as valid clusters.

7. The method according to claim 6, wherein: The step 6 is specifically as follows: Step 6.1: Merge all valid clusters and use the if function to set the label to 1 and the points with count >= 20; Step 6.2: Use the cv2.convexHull function to calculate the convex hull of the point. Step 6.3: Use the hull.squeeze function to extract all convex hull points; Step 6.4: Use the np.mean function to calculate the center point of the convex hull point set; Step 6.5: Sort the convex hull points according to their angles relative to the center point. dx and dy are the differences in the horizontal and vertical coordinates between a point and the center point. Calculate the polar angle using np.arctan2(dy, dx) and add the angle value to the angles list. Rearrange the original convex hull vertex array hull_points according to the sorted_indices index to generate a vertex set sorted_hull_points arranged in polar angle order. Step 6.6: Use np.vstack to connect the sorted convex hull points to form a closed curve; Step 6.7: Draw the original points and closed curves on the image and set the drawing color.

8. An edge detection system based on dispersion band extraction and multimodal fitting algorithm, characterized by: The system includes A data acquisition module, which performs image data reading and color space conversion; A mask generation module, wherein the mask generation module defines a color range and generates a mask of a corresponding color; A contour extraction module, wherein the contour extraction module performs contour extraction on each color mask to determine contour points; A cluster analysis module, wherein the cluster analysis module performs cluster analysis on the contour points; A screening module, wherein the screening module screens the results of the cluster analysis to select valid clusters; A display module extracts and connects the outermost clusters, saves the processed image to a specified path, and displays the processing result in a window.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the method according to claims 1 to 7.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the method of claims 1-7 is implemented.