Image segmentation method, image segmentation device, material sorting equipment and storage medium
By acquiring the polarization image and ray image of the material, combining the local area selection threshold, identifying candidate segmentation points and paths, and determining the target segmentation strategy, the accurate segmentation problem of sticky stones in low-contrast material segmentation is solved, the segmentation efficiency and accuracy are improved, and the sorting quality and efficiency of material sorting equipment are improved.
Patent Information
- Application Number
- CN202510495148.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2045-04-21
AI Technical Summary
In the process of low-contrast material segmentation, it is difficult to accurately identify and accurately divide the adhered stones, resulting in increased division difficulty and inaccurate division results, affecting the quality and efficiency of material sorting.
By obtaining the polarization image and ray image of the material, combining the local area selection threshold, determining the material profile information and gradient information, identifying candidate segmentation points and paths, determining the target segmentation strategy through multi-dimensional feature coupling, and performing image segmentation.
It improves the identification accuracy and segmentation efficiency of adhesion positions, ensures the reliability and accuracy of segmentation results, and improves the sorting performance of material sorting equipment.
Smart Images

Figure CN120013972B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing technologies, and in particular, to an image segmentation method, an image segmentation device, a material sorting device, and a computer-readable storage medium. Background Art
[0002] In the material extraction and processing industry, material segmentation is a crucial link. With the development of digital image processing technologies, material segmentation technologies have also been continuously advancing. However, in actual operations, the material segmentation process with low contrast often faces problems of whether to segment and how to perform fine segmentation. It is manifested as the problem of whether to segment the "adhesive" stones with low imaging contrast, and the problem of whether the stones that can be segmented can be accurately segmented along the actual segmentation line. This problem of segmenting "adhesive" stones with low contrast not only increases the difficulty of segmentation but also seriously affects the accuracy and precision of segmentation. Summary of the Invention
[0003] To overcome the problems existing in the related technologies, an exemplary embodiment of the present disclosure provides an image segmentation method, which is applied to a material sorting device. The method includes: obtaining an image to be processed; determining material contour information where materials are adhered in the image to be processed and a local image corresponding to the material contour information; determining candidate segmentation points for segmenting the local image based on the material contour information; determining a candidate segmentation path of the local image based on multiple extreme points in the local image; determining a target segmentation strategy based on a matching result between the candidate segmentation points and the candidate segmentation path; and segmenting the local image according to the target segmentation strategy to obtain a target image.
[0004] In some embodiments, the material sorting device includes a ray acquisition device. Obtaining the image to be processed includes: obtaining a polarization image of the material through a polarization annular light source provided by the material sorting device; obtaining a ray image of the material through the ray acquisition device; determining gradient information of the polarization image based on the polarization image, the ray image, and a local area selection threshold; and obtaining the image to be processed based on the gradient information and the ray image.
[0005] In some embodiments, the material contour information includes coordinate information of multiple contour pixel points. Determining candidate segmentation points for segmenting the local image based on the material contour information includes: constructing a contour topology chain corresponding to the material contour information according to the coordinate information of the multiple contour pixel points; counting the occurrence times of each contour pixel point in the contour topology chain; and using the contour pixel points with occurrence times greater than or equal to a first quantity threshold as candidate segmentation points for segmenting the local image.
[0006] In some embodiments, determining a candidate segmentation path of a local image based on multiple extreme points in the local image includes: determining the length of the short side of the local image; screening multiple extreme points in the local image based on the short side length to obtain a set of effective extreme points; and performing a concave point path analysis based on the set of effective extreme points to determine the candidate segmentation path of the local image.
[0007] In some embodiments, determining a target segmentation strategy based on the matching result between a candidate segmentation point and a candidate segmentation path includes: performing spatial registration of the candidate segmentation point and the candidate segmentation path to determine a region to be segmented in the local image, where the region to be segmented includes concave point pairs corresponding to the candidate segmentation path and / or candidate segmentation points; and determining a target segmentation strategy for processing the image to be segmented based on the target segmentation quantity in the region to be segmented.
[0008] In some embodiments, determining a target segmentation strategy for processing the image to be segmented based on the target segmentation quantity in the region to be segmented includes: if the target segmentation quantity is greater than or equal to a second quantity threshold, determining that the target segmentation strategy for processing the image to be segmented is a first segmentation strategy, where the first segmentation strategy includes performing image segmentation processing on the region to be segmented based on the neighborhood connectivity state between every two different segmentation points; if the target segmentation quantity is less than the second quantity threshold, determining that the target segmentation strategy for processing the image to be segmented is a second segmentation strategy, where the second segmentation strategy includes performing image segmentation processing along the gradient direction of the concave point pairs or candidate segmentation points in the region to be segmented.
[0009] In some embodiments, if the number of regions to be segmented is multiple, segmenting the image to be processed based on the target segmentation strategy to obtain a target image includes: respectively determining the segmentation priority of each region to be segmented based on the distribution of concave point pairs and candidate segmentation points in each region to be segmented; respectively determining the segmentation order of each region to be segmented according to the segmentation priority of each region to be segmented; and segmenting the image to be processed according to the segmentation order based on the target segmentation strategy of each region to be segmented to obtain the target image.
[0010] In some embodiments, the method further includes: detecting the segmentation effectiveness of the target image based on the image areas of the target image and the local image; or detecting the segmentation effectiveness of the target image based on the contours of the target image and the local image.
[0011] Second aspect, the present disclosure also provides an image segmentation device applied to a material sorting device. The device includes: an acquisition module for acquiring an image to be processed; a first determination module for determining material contour information with material adhesion in the image to be processed and a local image corresponding to the material contour information; a second determination module for determining candidate segmentation points for segmenting the local image based on the material contour information; a third determination module for determining a candidate segmentation path of the local image based on multiple extreme points in the local image; a fourth determination module for determining a target segmentation strategy based on a matching result between the candidate segmentation points and the candidate segmentation path; and a first processing module for segmenting the local image according to the target segmentation strategy to obtain a target image.
[0012] Third aspect, the present disclosure also provides a material sorting device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the image segmentation method provided in any of the above aspects.
[0013] Fourth aspect, the present disclosure also provides a computer-readable storage medium storing the following program for performing the image segmentation method provided in any of the above aspects.
[0014] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure.
[0015] The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects: According to the image segmentation method provided by the present disclosure, for the material contour information with material adhesion, candidate segmentation points and candidate segmentation paths for possible image segmentation are determined respectively from different dimensions, and based on the matching result between the candidate segmentation points and the candidate segmentation paths, a target segmentation strategy for image segmentation is determined, which can improve the recognition accuracy of the adhesion position in a way of multi-dimensional feature coupling, and then segment the local image according to the target segmentation strategy, which can not only improve the segmentation efficiency, but also help to ensure the reliability, accuracy and robustness of the segmentation result, thus contributing to ensuring the quality and efficiency of subsequent material sorting and improving the material sorting performance of the material sorting device. Description of the Drawings
[0016] By describing the exemplary embodiments of the present disclosure in conjunction with the drawings, the present disclosure can be better understood. In the drawings:
[0017] Figure 1 is a schematic structural diagram of a sorting device shown according to an exemplary embodiment of the present disclosure;
[0018] Figure 2 is a schematic flowchart of an image segmentation method shown according to an exemplary embodiment of the present disclosure;
[0019] Figure 3 is a schematic flow chart of an image segmentation method shown according to another disclosed exemplary embodiment;
[0020] Figure 4 is a schematic block diagram of a material sorting system shown according to a disclosed exemplary embodiment;
[0021] Figure 5 is a schematic block diagram of a material sorting device shown according to a disclosed exemplary embodiment. Detailed implementation manners
[0022] The following will describe the detailed implementation manners of the present disclosure. It should be noted that in the specific description process of these implementation manners, for the sake of concise description, this specification cannot describe all features of the actual implementation manners in detail. It should be understood that in the actual implementation process of any implementation manner, just as in the process of any engineering project or design project, in order to achieve the specific goals of the developer and to meet system-related or business-related restrictions, various specific decisions are often made, and these will also change from one implementation manner to another. In addition, it should also be understood that although the efforts made in this development process may be complex and lengthy, for those of ordinary skill in the art related to the content disclosed in the present disclosure, some design, manufacturing or production changes based on the technical content disclosed in the present disclosure are only conventional technical means and should not be understood as the content of the present disclosure being insufficient.
[0023] Unless otherwise defined, the technical terms or scientific terms used in the present disclosure should have the ordinary meanings understood by those of ordinary skill in the technical field to which the present disclosure belongs. The "first", "second" and similar terms used in the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. The terms such as "a" or "one" do not indicate a quantity limitation, but indicate that there is at least one. The terms such as "include" or "comprise" mean that the elements or items appearing before "include" or "comprise" cover the elements or items listed after "include" or "comprise" and their equivalent elements, and do not exclude other elements or items. The terms such as "connect" or "be connected" are not limited to physical or mechanical connections, nor are they limited to direct or indirect connections.
[0024] In the related art, to solve the problem of segmenting "sticky" stones with low contrast, the focus is mainly on optimizing image processing algorithms and improving segmentation accuracy. Although existing image processing technologies can, to a certain extent, identify and process low-contrast "sticky" materials in images, there are still many problems in practical applications. For example, on the one hand, due to the physical properties of the materials themselves and the complex scene environment, there are various low-contrast situations, making it difficult to effectively process them with a single algorithm; on the other hand, when existing segmentation algorithms are used for precise segmentation, the actual segmentation path cannot be confirmed, resulting in inaccurate segmentation results and unable to meet the requirements of practical applications.
[0025] To solve the above problems, an exemplary embodiment of the present disclosure provides an image segmentation method applied to a material sorting device. The material sorting device 100 can be used to sort materials, such as ores, metals, plastics, etc. As Figure 1 shown, the material sorting device 100 may include a feeding mechanism 110, a conveying mechanism 120, a detection mechanism 130, and a sorting device 140. The feeding mechanism 110 is used to feed the materials to be sorted into the conveying mechanism 120. The conveying mechanism 120 can be a conveyor belt or a chute structure, etc., for conveying the materials to be sorted fed by the feeding mechanism 110. The detection mechanism 130 is used to detect the materials conveyed on the conveying mechanism 120 to detect whether the materials are the materials to be removed; the materials to be removed refer to the materials that will be separated by the sorting device. The materials to be removed can be the required materials or the non-required materials, as long as the sorting of materials can be achieved. The sorting device 140 is used to remove the materials to be removed. The material sorting device 100 can be used for tasks such as ore sorting, food sorting, or waste sorting, depending on the actual application requirements.
[0026] As Figure 2 shown, the image segmentation method may include:
[0027] Step S210, obtaining an image to be processed.
[0028] The image to be processed can be understood as an image that can determine the distribution of materials. The image to be processed can be a ray image collected in real time during the transmission of materials, or a binary image obtained by performing binary processing on the ray image, which can be specifically determined according to actual requirements. By obtaining the image to be processed, the distribution of materials during the transmission process can be determined, so as to perform targeted sorting subsequently.
[0029] Step S220, determining the material contour information where material adhesion exists in the image to be processed and the local image corresponding to the material contour information.
[0030] In order to facilitate the identification of the distribution of each material so that targeted sorting can be carried out later, contour recognition processing is performed on the processed image to determine the contour information of each material. However, during the actual material transmission process, some materials may adhere to other materials due to various reasons (such as friction, humidity or viscosity, etc.), and then during the contour recognition process, the contours of multiple adhered materials may be mistakenly identified as one contour. Among them, material adhesion may include but is not limited to at least one contact point or contact surface between multiple materials.
[0031] Therefore, in order to improve the accuracy of material sorting, each contour information is analyzed in a targeted manner according to the contour recognition processing result, and then the contour information of the material with material adhesion in the image to be processed is determined. In some examples, the targeted analysis of the contour information may include but is not limited to the analysis of any one or a combination of the following features: contour shape, size (for example, the area, perimeter, aspect ratio and other dimensional parameters of the contour), position, texture features, etc. The contour corresponding to the selected material contour information is more complex in shape and larger in area than the contour corresponding to the contour information of the normal material.
[0032] When the material contour information is determined, a local image corresponding to the material contour information is extracted from the image to be processed so that targeted segmentation processing can be performed later.
[0033] Step S230: determining candidate segmentation points for segmenting the local image based on the material contour information.
[0034] The candidate segmentation point can be understood as a potential segmentation point for segmenting the contour corresponding to the material contour information. The candidate segmentation point can be any one or more of the following feature points of the contour corresponding to the material contour information: the endpoints at both ends of the contour, the contour turning point, or the contour pixel point with the most drastic gray value change on the contour.
[0035] According to the material contour information, the geometric shape of its corresponding contour can be determined, and then by performing feature point detection on the contour, the candidate segmentation points on the contour corresponding to the material contour information can be quickly determined for segmenting the local image, so that the segmentation efficiency can be improved during subsequent image segmentation.
[0036] In some examples, the candidate segmentation points can be determined based on any of the following methods: determined based on the local gray-scale change of the contour, determined by a pre-trained machine model, or determined using prior knowledge or constraints. For example, to determine the candidate segmentation points based on the local gray-scale change of the contour, it can be done by analyzing the local gray-scale change at different positions on the contour. To determine the candidate segmentation points by a pre-trained machine model, it can be automatically determined using a pre-trained deep learning model or other machine learning models that can recognize contour features and turning points. To determine the candidate segmentation points using prior knowledge or constraints, it can be determined using domain knowledge or prior understanding of the material properties.
[0037] Step S240: Determine the candidate segmentation path of the local image based on multiple extreme points in the local image.
[0038] Since the local image contains multiple adhesively connected materials, for the convenience of segmentation, the local image is processed by Euclidean distance transformation to determine the shortest distance from each pixel point in the local image to the nearest object edge or background, and then multiple extreme points can be determined therefrom. The extreme points can be understood as the pixel points with the largest or smallest distance values. These points usually correspond to the edges or important feature points of the material image. Therefore, the positions where the extreme points are located can be used as the segmentation reference.
[0039] However, since the extreme points can be at any position in the local image, depending on the actual image acquisition result, directly using the extreme points for segmentation may lead to an unreasonable segmentation result. Therefore, based on the distribution of the extreme points in the local image, a candidate segmentation path for segmenting the local image is determined, so that when performing segmentation subsequently, the rationality and reliability of image segmentation can be improved.
[0040] Step S250: Determine the target segmentation strategy based on the matching result between the candidate segmentation points and the candidate segmentation path.
[0041] Since the candidate segmentation points and the candidate segmentation path are determined from two different dimensional directions, in order to improve the accuracy of image segmentation, the candidate segmentation points are matched with the candidate segmentation path to obtain a matching result. According to the matching result, the corresponding relationship between each candidate segmentation point and the candidate segmentation path can be determined, which helps to quickly determine the image segmentation process, and then obtain a target segmentation strategy adapted to this corresponding relationship, so that when performing image segmentation subsequently, the image segmentation can be accurately and reliably completed in a short time, improving the image segmentation efficiency. Among them, the target segmentation strategy can include but is not limited to determining the segmentation order, segmentation direction, etc.
[0042] In some examples, during the process of matching candidate segmentation points with candidate segmentation paths, the matching can be performed according to the association relationship between the candidate segmentation points and the candidate segmentation paths. For example, the association degrees between each candidate segmentation point and each candidate segmentation path are respectively determined, and then it is analyzed on which candidate segmentation path each candidate segmentation point may be a valid segmentation point, so as to obtain the matching result. In other examples, based on the nearest neighbor matching algorithm or the greedy matching algorithm, a matching result between the candidate segmentation points and the candidate segmentation paths is established, and then the matching result is obtained.
[0043] Step S260, segment the local image according to the target segmentation strategy to obtain the target image.
[0044] Through the target segmentation strategy, it can be clearly determined how to perform targeted segmentation on the to-be-processed image. Then, by segmenting the to-be-processed image according to the target segmentation strategy, the segmentation position can be quickly located for targeted segmentation to obtain the target image, thereby effectively improving the segmentation efficiency and robustness, ensuring the quality and efficiency of material sorting, and helping to improve the material sorting performance of the material sorting device.
[0045] According to the image segmentation method provided by the present disclosure, for the material contour information with material adhesion, candidate segmentation points and candidate segmentation paths where image segmentation may be performed are respectively determined from different dimensions, and based on the matching result of the candidate segmentation points and the candidate segmentation paths, a target segmentation strategy for image segmentation is determined, which can improve the recognition accuracy of the adhesion position in a way of multi-dimensional feature coupling. Then, by segmenting the local image according to the target segmentation strategy, not only can the segmentation efficiency be improved, but also it helps to ensure the reliability, accuracy, and robustness of the segmentation result, thereby helping to ensure the quality and efficiency of subsequent material sorting and being beneficial to improving the material sorting performance of the material sorting device.
[0046] In some embodiments, the material sorting device includes a ray acquisition device, and the above step S210 may include the following steps:
[0047] Step a1, obtain the polarization image of the material through the polarization annular light source provided by the material sorting device;
[0048] Step a2, obtain the ray image of the material through the ray acquisition device;
[0049] Step a3, determine the gradient information of the polarization image based on the polarization image, the ray image, and the local area selection threshold;
[0050] Step a4, obtain the to-be-processed image based on the gradient information and the ray image.
[0051] Since different types of materials may have similar appearance colors, such as coal and ore, quartz and mica, etc., during the image recognition process, misidentification may occur due to the low contrast between pixels.
[0052] In view of this, in order to improve the accuracy of material identification, the polarized annular light source provided by the material sorting equipment can be used to capture images of the material to eliminate or reduce the impact of specular reflection on low-contrast areas, thereby obtaining a polarized image that can enhance image quality and features. In some examples, the polarized annular light source includes an annular array light source and a polarizing filter. Since the annular array light source and the polarizing filter are both part of the material sorting equipment, in the process of image acquisition, the annular array light source and the polarizing filter in the material sorting equipment are used to form a polarized annular light source for image acquisition, which can not only effectively improve the utilization rate of the component structure, but also meet the demand for improving image accuracy without additional cost.
[0053] For material sorting equipment, the images used to identify materials and perform image segmentation are mainly radiographic images obtained by collecting images of materials through a ray collection device. The ray collection device may include but is not limited to an X-ray fluorescence spectrometer (XRF), a gamma-ray fluorescence spectrometer, or an X-ray computed tomography (X-ray CT).
[0054] Through the polarization image, the texture, reflection characteristics, color and other characteristics of the corresponding identified material surface can be determined. Through the ray image, the elemental composition and density of the corresponding identified material can be determined. In order to improve the accuracy of image segmentation, the ray image is analyzed to determine the connected body path, direction or other important information contained therein to obtain the analysis result. According to the analysis result, the local area to be analyzed in the polarization image can be determined, and then the threshold is selected according to the predetermined local area, and the brightness, contrast or other characteristics in the local area are processed in a targeted manner to improve the image quality and the detail clarity in the local area, so that the gradient information of the polarization image can be determined according to the specified gradient algorithm. Among them, the gradient information may include but is not limited to the size (amplitude) and direction of the gradient. Determining the gradient information in this way can better reflect the local features of the image and enhance the feature significance. Moreover, the local area selection threshold is analyzed, so there is no need to perform detailed gradient analysis on the entire image, which can reduce unnecessary calculation burden and improve processing speed.
[0055] After determining the gradient information of the polarization image, the gradient information is mapped onto the ray image to combine the polarization image with the ray image, enabling the fused image to simultaneously reflect the characteristic information provided by both images. Subsequently, it is possible to determine which local regions in the ray image are effective regions related to the material, thereby obtaining a processed image for image segmentation.
[0056] In some examples, during the process of determining the image to be segmented, image fusion can be performed based on the weights between the gradient information and the ray image. Subsequently, binary processing is carried out on the fused image. During this process, local binary processing is performed on the fused image by combining the first weight of the gradient information and the second weight of the ray image, which can effectively reduce the occurrence of misidentification. Thus, when performing contour recognition processing on the obtained processed image subsequently, the material contour can be better distinguished. That is, when performing binary processing on the fused image, not only global binary processing is carried out, but also local binary processing is performed, so that the obtained processed image can provide as much detail and accurate contour as possible, ensuring the accuracy and reliability of subsequent material screening and image segmentation. Among them, the first weight of the gradient information and the second weight of the ray image can be determined according to requirements. Since the gradient information is relatively accurate and reliable, the first weight can be greater than or equal to the second weight. For example, the first weight of the gradient information can be determined to be 0.6, and the second weight of the ray image can be determined to be 0.4. Subsequently, during local binary processing, the gradient information can be fully utilized to highlight the detailed features of the object image (such as texture and surface structure), reduce noise interference, and thus contribute to improving the determination accuracy of the processed image.
[0057] In some other examples, the algorithm used for binarizing the fused image can be the Otsu algorithm with a locally-contrasted weight factor introduced, so that local binarization can be performed during global binarization. For example, when binarizing the fused image through the improved Otsu algorithm, the gray value corresponding to the pixel points with pixel values less than 20 can be set to 0, the gray value corresponding to the pixel points with pixel values greater than 180 can be set to 1, and for the pixel points with pixel values between 20 and 180, the corresponding gray value is determined by selecting through the first weight of the gradient information and the second weight of the ray image, and then the processed binary image is obtained. Among them, a gray value of 0 indicates that the pixel point belongs to the background pixel, and a gray value of 1 indicates that the pixel point belongs to the material pixel. Or, a gray value of 1 indicates that the pixel point belongs to the background pixel, and a gray value of 0 indicates that the pixel point belongs to the material pixel. The regions corresponding to the pixel points with gray values of 0 and 1 can be determined according to requirements, but the regions corresponding to the two are different. Through the improved Otsu algorithm for image segmentation, the local contrast can be fully considered, the target recognition accuracy can be improved, the generation of artifacts can be reduced, and when processing regions with rich edges and textures, the local information around the pixels can be combined for comprehensive analysis to reduce the influence of noise on this part of the local region, and then these details can be better retained, thus helping to improve the accuracy and reliability of distinguishing the material and the background.
[0058] In some application scenarios, it is pre-determined that a gray value of 0 indicates that the pixel point belongs to the background pixel, and a gray value of 1 indicates that the pixel point belongs to the material pixel. Then, when binarizing the fused image, the gray value corresponding to the pixel points with pixel values less than 20 can be set to 0, and the gray value corresponding to the pixel points with pixel values greater than 180 can be set to 1. For the pixel points with pixel values between 20 and 180, if, by combining the first weight of the gradient information and the second weight of the ray image, it is determined that the calculated pixel value corresponding to the pixel points with pixel values between 20 and 180 is greater than 180, it indicates that the pixel point is a pixel point corresponding to the material, and then the gray value corresponding to the pixel point can be set to 1. If, by combining the first weight of the gradient information and the second weight of the ray image, it is determined that the calculated pixel value corresponding to the pixel points with pixel values between 20 and 180 is less than 20, it indicates that the pixel point is a pixel point corresponding to the background, and then the gray value corresponding to the pixel point can be set to 0.
[0059] In some embodiments, the material contour information includes the coordinate information of multiple contour pixel points, and the above step S230 may include the following steps:
[0060] Step b1, constructing a contour topology chain corresponding to the material contour information according to the coordinate information of the multiple contour pixel points;
[0061] Step b2: Count the occurrence times of each contour pixel point in the contour topology chain.
[0062] Step b3: Use the contour pixel points whose occurrence times are greater than or equal to the first quantity threshold as candidate segmentation points for segmenting the local image.
[0063] Specifically, according to the coordinate information of each contour pixel point, the contour shape corresponding to the material contour information can be determined, and then the contour topology chain corresponding to the material contour information can be constructed, and the relative position relationship between each contour pixel point can be determined, thereby helping to determine the position relationship between multiple adhered materials.
[0064] In some examples, to facilitate determining the position relationship between each contour pixel point and avoid the situation of missing determination, each contour pixel point is stored in a specified order to construct the contour topology chain corresponding to the material contour information to ensure the integrity of the contour. The specified order can be counterclockwise or clockwise, which can specifically depend on the actual setting.
[0065] For the contour of a single material, the occurrence times of each contour pixel point in its corresponding contour topology chain are only once. For the contour containing multiple materials, the occurrence times of the contour pixel points corresponding to the intersection positions of multiple materials in its corresponding contour topology chain may be multiple times, and each time corresponds to a different material. Therefore, the minimum occurrence times that can be used to determine the contour pixel points corresponding to the intersection positions of multiple materials, that is, the first quantity threshold, are determined in advance. The occurrence times of each contour pixel point in the contour topology chain are counted respectively. If the occurrence times of the contour pixel point are greater than or equal to the first quantity threshold, it can be determined that the contour pixel point corresponds to the intersection position of multiple materials. Therefore, to reduce the situation of missing recognition, the contour pixel points whose occurrence times are greater than or equal to the first quantity threshold are used as candidate segmentation points for segmenting the local image to ensure the accuracy and robustness of image segmentation. In some examples, the first quantity threshold can be 2, which helps to ensure the integrity of the determination of candidate segmentation points.
[0066] In some embodiments, the above step S240 may include the following steps:
[0067] Step c1: Determine the length of the short side of the local image.
[0068] Step c2: Based on the length of the short side, filter multiple extreme points in the local image to obtain an effective extreme point set.
[0069] Step c3: Based on the effective extreme point set, perform concave point path analysis to determine the candidate segmentation path of the local image.
[0070] Specifically, in a local image, an extreme point may be a point where the brightness or grayscale value is significantly higher or lower than that of surrounding pixel points, and it may be the edge, corner, or specific feature point of the material. If the pixels between adjacent materials are close, there may be false extreme points among multiple extreme points. Since extreme points usually correspond to edges, corners, or other significant features in the image, to ensure the reliability of extreme point determination, the extreme points are screened based on the length of the short side of the local image, which can simplify the screening difficulty, improve the screening efficiency, and thus quickly obtain an effective set of extreme points. In some examples, in image processing, maintaining certain proportional relationships is important for subsequent analysis. Screening by the short side can help maintain certain geometric features of the image, such as the aspect ratio, which is beneficial for subsequent image registration or feature extraction. In other examples, to determine the effectiveness of each extreme point, the minimum radius threshold of the extreme point is determined according to the length of the short side of the local image. For example, the minimum radius threshold is 1 / 3 of the short side length. If the radius of an extreme point is greater than the minimum radius threshold, it can be considered that the extreme point is more representative and belongs to an effective extreme point. If the radius of the extreme point is less than or equal to the minimum radius threshold, it can be considered that the extreme point is relatively ordinary and is mis-identified, belonging to an ineffective extreme point.
[0071] Each extreme point in the effective set of extreme points is an effective extreme point. Therefore, according to the distribution of each extreme point, multiple extreme point paths can be obtained, and then the shortest path is taken as the optimal path. Concave point pairs are detected along both sides of the optimal path. If a concave point pair is detected, the direction of the straight line connecting the concave point pair can be used as the candidate segmentation direction, and the path connecting the two concave points in the concave point pair can be used as the candidate segmentation path. Among them, a concave point is a contour pixel point where the gradient direction changes abruptly in the contour corresponding to the material contour information.
[0072] Screening extreme points by the short side of the image can effectively reduce the computational burden and improve the processing speed. Then, based on the effective set of extreme points, the candidate segmentation path is determined, which can ensure the accuracy and reliability of the candidate segmentation path.
[0073] In some embodiments, the above step S250 may include the following steps:
[0074] Step d1, spatially register the candidate segmentation points and the candidate segmentation path to determine the region to be segmented in the local image.
[0075] Specifically, since the candidate segmentation points and the candidate segmentation paths are determined by different processing methods, in order to ensure the reliability and accuracy of image segmentation, the candidate segmentation points and the candidate segmentation paths are spatially registered to fuse the two, so as to clarify the candidate segmentation paths corresponding to each candidate segmentation point, thereby obtaining a reliable and accurate region to be segmented. Among them, the region to be segmented includes concave point pairs corresponding to the candidate segmentation paths and / or candidate segmentation points. That is, for the same region to be segmented, it may include concave point pairs and corresponding candidate segmentation points, or may only include candidate segmentation points or concave point pairs.
[0076] Step d2: Determine the target segmentation strategy for processing the image to be segmented based on the target segmentation quantity in the region to be segmented.
[0077] Specifically, according to the target segmentation quantity in the region to be segmented, it can be determined that the region to be segmented needs to be divided into multiple local regions. If the target segmentation quantity is small, the segmentation process is relatively simple and may only require simple segmentation operations. If the target segmentation quantity is large, the segmentation process is relatively complex and may require multi-level segmentation. Therefore, in order to improve the reliability and accuracy of image segmentation, the segmentation strategy corresponding to the target segmentation quantity is used as the target segmentation strategy, so that the corresponding segmentation requirements can be met during the segmentation process, and the flexibility and self-adaptability of image segmentation are ensured.
[0078] In some examples, if the target segmentation quantity is greater than or equal to the second quantity threshold, it is determined that the target segmentation strategy for processing the image to be segmented is the first segmentation strategy. Among them, the first segmentation strategy includes performing image segmentation processing on the region to be segmented based on the neighborhood connectivity state between every two different segmentation points. If the target segmentation quantity is greater than or equal to the second quantity threshold, it indicates that the segmentation process is relatively complex. Therefore, in order to make the segmentation result more conform to the actual adhesion situation of the material, the first segmentation strategy is used as the target segmentation strategy, so that when performing image segmentation subsequently, it can be segmented based on the neighborhood connectivity state between every two different segmentation points, so that the final segmentation result obtained can be accurate and reliable.
[0079] In other examples, if the target segmentation quantity is less than the second quantity threshold, it is determined that the target segmentation strategy for processing the image to be segmented is the second segmentation strategy. Among them, the second segmentation strategy includes performing image segmentation processing along the gradient direction of the concave point pairs in the region to be segmented or the candidate segmentation points. If the target segmentation quantity is greater than the second quantity threshold, it indicates that the segmentation process is relatively simple. Therefore, in order to make the segmentation result more conform to the actual adhesion situation of the material, the second segmentation strategy is used as the target segmentation strategy, so that when performing image segmentation subsequently, it can perform image segmentation processing along the gradient direction of the concave point pairs in the region to be segmented or the candidate segmentation points, so as to simplify the segmentation difficulty and improve the segmentation efficiency.
[0080] In some other embodiments, if the number of regions to be segmented is multiple, the above step S260 may include the following steps:
[0081] Step e1: Based on the distribution of concave point pairs and candidate segmentation points in each region to be segmented, determine the segmentation priority of each region to be segmented respectively;
[0082] Step e2: According to the segmentation priority of each region to be segmented, determine the segmentation order of each region to be segmented respectively;
[0083] Step e3: Based on the target segmentation strategy of each region to be segmented, segment the image to be processed in the segmentation order to obtain the target image.
[0084] Specifically, to improve the accuracy of image segmentation, the segmentation priority of each region to be segmented is determined respectively according to the distribution of concave point pairs and candidate segmentation points in each region to be segmented. If a region to be segmented includes both concave point pairs and candidate segmentation points, it indicates that no matter which method is used for image segmentation detection, this region to be segmented needs to be segmented and the segmentation degree is relatively complex. Therefore, the segmentation priority of this segmentation region is the highest. If a region to be segmented includes multiple concave point pairs or candidate segmentation points, it indicates that this region to be segmented needs to be segmented, but the segmentation degree is a bit complex. Therefore, the segmentation priority of this segmentation region is relatively high. If a region to be segmented includes only one concave point pair or candidate segmentation point, it indicates that this region to be segmented needs to be segmented, but the segmentation degree is relatively simple. Therefore, the segmentation priority of this segmentation region is the lowest.
[0085] According to the segmentation priority of each region to be segmented, the segmentation order of each region to be segmented is determined respectively, which can ensure that the regions to be segmented with difficult segmentation are preferentially subjected to image segmentation processing, so as to reduce the influence of these regions to be segmented on subsequent segmentation, contribute to improving the overall segmentation quality, facilitate simplifying the difficulty of subsequent image segmentation, and be conducive to better managing segmentation resources.
[0086] During the process of image segmentation, by segmenting each region to be segmented in the segmentation order using the corresponding target segmentation strategy in turn, it can ensure that each region to be segmented can be subjected to targeted image segmentation processing, ensure that the image segmentation process is both efficient and accurate, and at the same time meet the requirements and characteristics of each region to be segmented, providing a reliable data basis for subsequent material identification and sorting, thus being conducive to improving the sorting performance of the material sorting equipment.
[0087] In some optionally implemented scenarios, the second quantity threshold may be 2. If the target segmentation quantity is greater than or equal to 2, it indicates that the segmentation process is relatively complex. Therefore, when using the first segmentation strategy to perform segmentation processing on the area to be segmented, the following process can be adopted: Based on multiple segmentation points included in the area to be segmented, any two different segmentation points are selected, and the neighborhood connectivity state between these two segmentation points is determined. Among them, the segmentation point can be one of the candidate segmentation points or the concave point pair. If the neighborhood connectivity state is connected, it indicates that the contour where these two segmentation points are located is double-object adhesion, and then bidirectional cutting is performed. If the neighborhood connectivity state is not connected, it indicates that the contour where these two segmentation points are located is multi-object cross adhesion, and then the extreme point path segmentation is performed in a recursive manner to gradually narrow the segmentation from a large segmentation range, so as to obtain the segmentation result of the area to be sorted.
[0088] If the target segmentation quantity is less than 2, it indicates that the segmentation process is relatively simple. Therefore, when using the second segmentation strategy to perform segmentation processing on the area to be segmented, the following process can be adopted: Cut directly along the gradient direction of the concave point pair or the candidate segmentation point, and the attribution rule adopts the contour area weighting method, and then the segmentation result of the area to be sorted is obtained.
[0089] In some embodiments, the above image segmentation method may further include: Detecting the segmentation effectiveness of the target image based on the image areas of the target image and the local image. Since in the actual contour detection process, impurities or the quality of the algorithm will affect the accuracy of the material contour information. Therefore, to determine whether the target image is valid, it is necessary to determine whether the geometric constraint index of the target image meets the requirements according to the image area of the local image. According to the image area of the local image, the minimum effective area critical value can be determined. For example, the minimum effective area critical value = the area of the circumscribed rectangle * 5%. If the area difference between the target image and the local image is less than the minimum effective area critical value, it indicates that the image segmented out may be noise, and this segmentation belongs to invalid segmentation. If the area difference between the target image and the local image is greater than the minimum effective area critical value, it indicates that the image segmented out is a material image, and this segmentation belongs to effective segmentation.
[0090] In some other embodiments, the above image segmentation method may further include: Detecting the segmentation effectiveness of the target image based on the contours of the target image and the local image. That is, determining the Hausdorff distance between the contour of the target image and the contour of the local image. If the Hausdorff distance is less than or equal to the specified pixel difference distance, and the area difference between the target image and the local image is greater than the minimum effective area critical value, it indicates that the image segmented out is a material image, and this segmentation belongs to effective segmentation. If the Hausdorff distance is greater than or equal to the specified pixel difference distance, this segmentation belongs to invalid segmentation.
[0091] In some other embodiments, to make the contour of the target image clearer and the pixels between adjacent images smoother, a closing operation (e.g., a 3×3 circular kernel) is performed on the target image to repair edge pixel points, and a Bezier curve is used to fit the contour to improve smoothness.
[0092] In some optional application scenarios, the process of image segmentation by the material sorting device using the image segmentation method provided by the present disclosure can be as Figure 3 shown, including the following steps:
[0093] Obtain a polarization image of the material through a polarization annular light source provided by the material sorting device; and obtain a ray image of the material through a ray acquisition device.
[0094] Fuse the polarization image and the ray image, and perform global and local binary processing on the fusion result to obtain an image to be processed. That is, based on the polarization image, the ray image, and a local region selection threshold, determine the gradient information of the polarization image, and then perform image fusion according to the gradient information, the ray image, the first weight of the gradient information, and the second weight of the ray image, and perform global and local binary processing on the fused image to obtain an image to be processed.
[0095] Determine the material contour information where there is material adhesion in the image to be processed, and construct a contour topology chain corresponding to the material contour information according to the coordinate information of multiple contour pixel points in the material contour information.
[0096] Determine the local image corresponding to the material contour information, and perform extreme point detection to obtain a candidate segmentation path.
[0097] Judge whether there are concave point pairs on both sides of the candidate segmentation path.
[0098] If there are concave point pairs, determine that the candidate segmentation path is valid. If there are no concave point pairs, count the number of occurrences of each contour pixel point in the contour topology chain to determine candidate segmentation points.
[0099] Based on the matching result between the candidate segmentation points and the candidate segmentation path, determine the region to be segmented and the corresponding priority.
[0100] Judge the target segmentation quantity of the region to be segmented.
[0101] If the target segmentation quantity is less than the second quantity threshold, perform single-target cutting along the gradient direction of the concave point pair or the candidate segmentation points in the region to be segmented.
[0102] If the target number of segments is greater than or equal to the second threshold, determine the neighborhood connectivity state between any two different segmentation points in the region to be segmented. If the neighborhood connectivity state is connected, perform bidirectional cutting. If the neighborhood connectivity state is not connected, perform extreme point path segmentation in a recursive manner.
[0103] Determine whether the segmented contour is independent. If it is an independent contour, perform contour repair to obtain the target image.
[0104] Detect the segmentation effectiveness of the target image. If the segmentation of the target image is effective, end.
[0105] If it is not an independent contour, re - execute the determination of the region to be segmented and its corresponding priority based on the matching result between the candidate segmentation points and the candidate segmentation paths.
[0106] According to the image segmentation method provided by the present disclosure, the data processing efficiency and accuracy can be effectively improved. This optimization not only enables the system to maintain a stable and efficient operation state when processing a large amount of data, but also greatly improves the accuracy of data analysis, providing more reliable data support for decision - making.
[0107] In practical applications, by applying the image segmentation method provided by the present disclosure, users can obtain the required information more quickly and improve work efficiency. At the same time, the present disclosure also reduces the error rate of data processing and the decision - making risks brought by inaccurate data. In addition, the present disclosure has good scalability and adaptability, and can be customized and optimized according to the needs of different users to meet the data processing requirements in different fields and scenarios.
[0108] In summary, the image segmentation method provided by the present disclosure can bring significant technical effects and practical application values to users through its unique technical principle and innovative design. It not only improves the data processing efficiency and accuracy, but also reduces the decision - making risks, providing a more convenient and efficient data processing solution for users.
[0109] Based on the same inventive concept, the present disclosure also provides an image segmentation device. As Figure 4 shown, the image segmentation device 300 includes:
[0110] An acquisition module 310, configured to acquire an image to be processed;
[0111] A first determination module 320, configured to determine the material contour information with material adhesion in the image to be processed and the local image corresponding to the material contour information;
[0112] A second determination module 330, configured to determine candidate segmentation points for segmenting the local image based on the material contour information;
[0113] A third determination module 340, configured to determine a candidate segmentation path of the local image based on a plurality of extreme points in the local image;
[0114] A fourth determination module 350, configured to determine a target segmentation strategy based on a matching result between a candidate segmentation point and the candidate segmentation path;
[0115] A first processing module 360, configured to segment the local image according to the target segmentation strategy to obtain a target image.
[0116] In some embodiments, the material sorting device includes a ray acquisition device, and the acquisition module 310 includes: a first acquisition unit, configured to acquire a polarization image of the material through a polarization annular light source provided by the material sorting device; a second acquisition unit, configured to acquire a ray image of the material through the ray acquisition device; a first processing unit, configured to determine gradient information of the polarization image based on the polarization image, the ray image, and a local area selection threshold; a second processing unit, configured to obtain a to-be-processed image based on the gradient information and the ray image.
[0117] In some embodiments, the material contour information includes coordinate information of a plurality of contour pixel points, and the second determination module 330 includes: a third processing unit, configured to construct a contour topology chain corresponding to the material contour information according to the coordinate information of the plurality of contour pixel points; a statistical unit, configured to count the number of occurrences of each contour pixel point in the contour topology chain; a first screening unit, configured to use the contour pixel points whose number of occurrences is greater than or equal to a first quantity threshold as candidate segmentation points for segmenting the local image.
[0118] In some embodiments, the third determination module 340 includes: a first determination unit, configured to determine the length of the short side of the local image; a second screening unit, configured to screen a plurality of extreme points in the local image based on the short side length to obtain an effective extreme point set; a fourth processing unit, configured to perform concave point path analysis based on the effective extreme point set to determine a candidate segmentation path of the local image.
[0119] In some embodiments, the fourth determination module 350 includes: a second determination unit, configured to perform spatial registration on the candidate segmentation point and the candidate segmentation path to determine a to-be-segmented area in the local image, where the to-be-segmented area includes concave point pairs corresponding to the candidate segmentation path and / or candidate segmentation points; a third determination unit, configured to determine a target segmentation strategy for processing the to-be-segmented image based on a target segmentation quantity in the to-be-segmented area.
[0120] In some embodiments, the third determination unit includes: a first execution unit configured to, if the target segmentation quantity is greater than or equal to the second quantity threshold, determine that the target segmentation strategy for processing the image to be segmented is a first segmentation strategy, where the first segmentation strategy includes performing image segmentation processing on the region to be segmented based on the neighborhood connectivity state between every two different segmentation points; and a second execution unit configured to, if the target segmentation quantity is less than the second quantity threshold, determine that the target segmentation strategy for processing the image to be segmented is a second segmentation strategy, where the second segmentation strategy includes performing image segmentation processing along the gradient direction of the concave point pairs or candidate segmentation points in the region to be segmented.
[0121] In some embodiments, if the number of regions to be segmented is multiple, the first processing module 360 includes: a fifth processing unit configured to respectively determine the segmentation priority of each region to be segmented based on the distribution of concave point pairs and candidate segmentation points in each region to be segmented; a sixth processing unit configured to respectively determine the segmentation order of each region to be segmented according to the segmentation priority of each region to be segmented; and a seventh processing unit configured to segment the image to be processed according to the segmentation order based on the target segmentation strategy of each region to be segmented to obtain a target image.
[0122] In some embodiments, the image segmentation apparatus 300 further includes: a first detection module configured to detect the segmentation effectiveness of the target image based on the image areas of the target image and the local image; or a second detection module configured to detect the segmentation effectiveness of the target image based on the contours of the target image and the local image.
[0123] Regarding the image detection apparatus in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated herein.
[0124] Based on the same inventive concept, as Figure 5 shown, an embodiment of the present disclosure provides a material sorting device. The electronic device includes: one or more processors 410, a memory 420, and an interface for connecting each component, including a high-speed interface and a low-speed interface. Each component communicates with each other using different buses and can be installed on a common main board or installed in other ways as needed. The processor can process instructions executed within the electronic device, including instructions stored in the memory or on the memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to the interface). In some alternative embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a set of blade servers, or a multi-processor system). Figure 5Take a processor 410 as an example.
[0125] The processor 410 can be a central processing unit, a network processor, or a combination thereof. Among them, the processor 410 can further include a hardware chip. The above-mentioned hardware chip can be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The above-mentioned programmable logic device can be a complex programmable logic device, a field programmable gate array, a generic array logic, or any combination thereof.
[0126] Among them, the memory 420 stores instructions that can be executed by at least one processor 410, so that at least one processor 410 executes the image segmentation method shown in the above embodiments.
[0127] The memory 420 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created according to the use of the electronic device, etc. In addition, the memory 420 can include a high-speed random access memory, and can also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some alternative embodiments, the memory 420 can optionally include a memory remotely set relative to the processor 10, and these remote memories can be connected to the electronic device through a network. Examples of the above-mentioned network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0128] The memory 420 can include a volatile memory, such as a random access memory; the memory can also include a non-volatile memory, such as a flash memory, a hard disk, or a solid-state hard disk; the memory 420 can also include a combination of the above types of memories.
[0129] The electronic device further includes an input device 430 and an output device 440. The processor 410, the memory 420, the input device 430, and the output device 440 can be connected through a bus or other means. Figure 5 Take the connection through the bus as an example.
[0130] The input device 430 can receive input digital or character information, and generate key signal inputs related to the user settings and function controls of the electronic device, such as a touch screen, a keypad, a mouse, a trackpad, a touchpad, a pointing stick, one or more mouse buttons, a trackball, a joystick, etc. The output device 440 can include a display device, an auxiliary lighting device (such as an LED), and a tactile feedback device (such as a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light-emitting diode, a display, and a plasma display. In some alternative embodiments, the display device can be a touch screen.
[0131] Based on the same inventive concept, the present disclosure also provides a computer-readable storage medium storing the following program for executing the image segmentation method of any one of the foregoing embodiments.
[0132] The present disclosure uses specific terms to describe the embodiments of the present disclosure. For example, "one embodiment", "an embodiment", and / or "some embodiments" mean a certain feature, structure, or characteristic related to at least one embodiment of the present disclosure. Therefore, it should be emphasized and noted that the "one embodiment" or "an embodiment" or "an alternative embodiment" mentioned twice or more at different positions in this specification does not necessarily refer to the same embodiment. In addition, certain features, structures, or characteristics in one or more embodiments of the present disclosure can be appropriately combined.
[0133] In the context of the present disclosure, unless the context clearly indicates an exception, words such as "a", "an", "one", and / or "the" are not specifically singular and may also include the plural. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements.
[0134] Similarly, it should be noted that, in order to simplify the description of the present disclosure and thus help the understanding of one or more embodiments of the application, in the foregoing description of the embodiments of the present disclosure, sometimes multiple features are merged into one embodiment, drawing, or description thereof. However, this disclosure method does not mean that the features required by the subject matter of the present disclosure are more than the features required to be protected. In fact, the features of the embodiment are less than all the features of the single embodiment disclosed above.
[0135] The basic concepts have been described above. Obviously, for those skilled in the art, the above disclosure is only an example and does not constitute a limitation to the present disclosure. Although not explicitly stated here, those skilled in the art may make various modifications, improvements, and corrections to the present disclosure. Such modifications, improvements, and corrections are proposed in the present disclosure, so such modifications, improvements, and corrections still fall within the spirit and scope of the embodiments of the present disclosure.
Claims
1. An image segmentation method, characterized in that, Applied to a material sorting device, the method includes: Obtain an image to be processed; Determine the material contour information with material adhesion in the image to be processed and the local image corresponding to the material contour information; Based on the material contour information, determine candidate segmentation points for segmenting the local image; Based on multiple extreme points in the local image, determine a candidate segmentation path for the local image, including: determining the short side length of the local image; screening multiple extreme points in the local image based on the short side length to obtain an effective extreme point set, where the extreme point is a point with a significantly higher or lower brightness or gray value than surrounding pixel points, or a material edge, corner, or specific feature point; based on the effective extreme point set, perform concave point path analysis to determine the candidate segmentation path for the local image; Based on the matching result between the candidate segmentation points and the candidate segmentation path, determine a target segmentation strategy, including: performing spatial registration on the candidate segmentation points and the candidate segmentation path to determine the area to be segmented in the local image, where the area to be segmented includes concave point pairs and / or candidate segmentation points corresponding to the candidate segmentation path; based on the target segmentation quantity in the area to be segmented, determine the target segmentation strategy for processing the image to be segmented, where the target segmentation quantity is the quantity used to determine the number of local areas into which the area to be segmented needs to be divided; Segment the local image according to the target segmentation strategy to obtain a target image.
2. The image segmentation method according to claim 1, wherein The material sorting device includes a ray acquisition device, and the obtaining of the image to be processed includes: Obtain a polarization image of the material through the polarization ring light source provided by the material sorting device; Obtain a ray image of the material through the ray acquisition device; Based on the polarization image, the ray image, and a local area selection threshold, determine the gradient information of the polarization image; Based on the gradient information and the ray image, obtain the image to be processed.
3. The image segmentation method according to claim 1, characterized in that The material contour information includes coordinate information of multiple contour pixel points. Based on the material contour information, determining candidate segmentation points for segmenting the local image includes: According to the coordinate information of multiple contour pixel points, construct a contour topology chain corresponding to the material contour information; Count the occurrence times of each contour pixel point in the contour topology chain; Use the contour pixel points with occurrence times greater than or equal to a first quantity threshold as candidate segmentation points for segmenting the local image.
4. The image segmentation method according to claim 1, characterized in that Based on the target segmentation quantity in the area to be segmented, determining the target segmentation strategy for processing the image to be segmented includes: If the target segmentation quantity is greater than or equal to a second quantity threshold, determine that the target segmentation strategy for processing the image to be segmented is a first segmentation strategy, and the first segmentation strategy includes performing image segmentation processing on the area to be segmented based on the neighborhood connectivity state between every two different segmentation points; If the target segmentation quantity is less than the second quantity threshold, determine that the target segmentation strategy for processing the image to be segmented is the second segmentation strategy, where the second segmentation strategy includes performing image segmentation processing along the gradient direction of the concave point pairs or the candidate segmentation points in the region to be segmented.
5. The image segmentation method according to claim 4, characterized in that, If the number of regions to be segmented is multiple, then based on the target segmentation strategy, segmenting the image to be processed to obtain a target image includes: Based on the distribution of the concave point pairs and the candidate segmentation points in each region to be segmented, respectively determine the segmentation priority of each region to be segmented; According to the segmentation priority of each region to be segmented, respectively determine the segmentation order of each region to be segmented; Based on the target segmentation strategy of each region to be segmented, segment the image to be processed in accordance with the segmentation order to obtain a target image.
6. The image segmentation method according to claim 1, wherein The method further includes: Detecting the segmentation effectiveness of the target image based on the image areas of the target image and the local image; or Detecting the segmentation effectiveness of the target image based on the contours of the target image and the local image.
7. An image segmentation device, characterized in that, Applied to a material sorting device, the apparatus includes: An acquisition module, configured to acquire an image to be processed; A first determination module, configured to determine the material contour information with material adhesion in the image to be processed and the local image corresponding to the material contour information; A second determination module, configured to determine candidate segmentation points for segmenting the local image based on the material contour information; A third determination module, configured to determine a candidate segmentation path of the local image based on multiple extreme points in the local image, including: determining the short side length of the local image; screening the multiple extreme points in the local image based on the short side length to obtain a set of valid extreme points, where the extreme point is a point where the brightness or gray value is significantly higher or lower than the surrounding pixel points, or is a material edge, corner or specific feature point; based on the set of valid extreme points, performing concave point path analysis to determine the candidate segmentation path of the local image; A fourth determination module, configured to determine a target segmentation strategy based on the matching result between the candidate segmentation points and the candidate segmentation path, including: performing spatial registration on the candidate segmentation points and the candidate segmentation path to determine the region to be segmented in the local image, where the region to be segmented includes concave point pairs and / or candidate segmentation points corresponding to the candidate segmentation path; based on the target segmentation quantity in the region to be segmented, determine the target segmentation strategy for processing the image to be segmented, where the target segmentation quantity is the quantity used to determine the number of local regions into which the region to be segmented needs to be divided; A first processing module, configured to segment the local image according to the target segmentation strategy to obtain a target image.
8. A material sorting device, characterized in that, Including: A memory and a processor, where the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor performs the computer instructions to perform the image segmentation method according to any one of claims 1-6.
9. A computer-readable storage medium storing the following program for performing the image segmentation method according to any one of claims 1-6.
Citation Information
Patent Citations
Method and device for identifying characters
CN102129560A
Segmentation method for adhering grain binary image
CN102663700A
Image processing method capable of performing adhesion removal segmentation on sunflower seed image
CN114022490A