Image segmentation methods, image segmentation apparatus, electronic devices, and storage media
By adjusting the brightness and color feature recognition of ore images, the problem of difficulty in identifying the edges of ore and background was solved, achieving more accurate image segmentation and improving the efficiency and accuracy of ore sorting.
Patent Information
- Application Number
- CN202510535812.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2045-04-27
AI Technical Summary
During the ore sorting process, due to ore properties or collection environment, it is difficult to accurately identify the edges of the ore and background in the image, which affects the accuracy of image segmentation.
By adjusting the brightness of the ore image, the color difference between the ore area and the background area is increased under normal exposure. Image segmentation is then performed based on the ore color characteristics, including color channel gain processing, nonlinear brightness adjustment, color space conversion, and mask image processing.
It improves the accuracy and anti-interference ability of image segmentation, ensures clear boundaries between the ore and the background, and enhances the reliability and efficiency of image segmentation.
Smart Images

Figure CN120047480B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of ore sorting, specifically to an image segmentation method, an image segmentation apparatus, an electronic device, and a computer-storable medium. Background Technology
[0002] In the material mining and processing industry, material segmentation is a crucial step. With the development of digital image processing technology, material segmentation technology is also constantly improving. However, during image acquisition, factors such as ore properties or the acquisition environment may cause the edges between the ore and the background in the generated image to be inaccurately identified, thus affecting the accuracy of image segmentation. Summary of the Invention
[0003] To overcome the problems existing in related technologies, an exemplary embodiment of this disclosure provides an image segmentation method, the method comprising: acquiring an image of a mineral to be processed; adjusting the image brightness of the mineral image to obtain an optimal image, wherein the color difference between the mineral region and the background region in the optimal image is the maximum value of the background region under normal exposure; identifying the mineral in the optimal image based on the mineral color features determined by the optimal image to obtain an mineral mask image; and obtaining a target mask image corresponding to the mineral image based on the mineral mask image.
[0004] In some embodiments, adjusting the image brightness of a ore image to obtain an optimal image includes: performing gain processing on multiple color channels of the ore image to increase the color difference between the ore region and the background region in the ore image while the background region is under normal exposure, thereby obtaining an intermediate image; and performing non-linear brightness adjustment processing on the intermediate image to obtain the optimal image.
[0005] In some embodiments, based on the ore color features determined by the optimal image, identifying the ore in the optimal image to obtain an ore mask image includes: performing color space conversion on the optimal image to obtain a multi-color channel image, wherein the color channel image corresponds one-to-one with the color channels in the color space; determining the ore color threshold range corresponding to each color channel based on the ore color features determined by the optimal image; and identifying the ore in the optimal image based on the matching result between the color value in each color channel image and the corresponding ore color threshold range to obtain an ore mask image.
[0006] In some embodiments, obtaining a target mask image corresponding to the ore image based on the ore mask image includes: identifying the largest ore contour in the ore mask image; determining seed points for the largest ore contour; expanding the largest ore contour based on the seed points to obtain the target ore contour; and performing mask morphology restoration based on the target ore contour to obtain the target mask image corresponding to the ore image.
[0007] In some embodiments, acquiring an image of the ore to be processed includes: acquiring a transmission image of the ore collected by a radiation acquisition device of an ore sorting equipment, the ore sorting equipment including a color sorting acquisition device downstream of the radiation acquisition device; acquiring a color sorting image corresponding to the transmission image of the ore collected by the color sorting acquisition device; identifying the ore contour in the transmission image of the ore; determining a local image in the color sorting image corresponding to the ore contour; and extracting the image of the ore to be processed from the color sorting image based on the local image.
[0008] In some embodiments, the method further includes: determining the image position of the ore image on the color sorting image; and superimposing the target mask image on the color sorting image according to the image position to obtain a segmentation annotation image corresponding to the color sorting image.
[0009] In some embodiments, the method further includes: denoising the ore image; denoising the optimal image; and / or denoising the ore mask image; wherein the denoising process includes performing any one or a combination of the following processes: mean blurring, Gaussian blurring, and median blurring.
[0010] Secondly, this disclosure also provides an image segmentation apparatus, comprising: an acquisition module for acquiring a mineral image to be processed; an adjustment module for adjusting the image brightness of the mineral image to obtain an optimal image, wherein the color difference between the mineral region and the background region in the optimal image is the maximum value of the background region under normal exposure; a first processing module for identifying the mineral in the optimal image using mineral color features determined based on the optimal image to obtain a mineral mask image; and a second processing module for obtaining a target mask image corresponding to the mineral image based on the mineral mask image.
[0011] Thirdly, this disclosure also provides an electronic 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.
[0012] Fourthly, this disclosure also provides a computer-readable storage medium storing a program for performing any of the above-described image segmentation methods.
[0013] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure.
[0014] The technical solutions provided by the embodiments of this disclosure can include the following beneficial effects: According to the image segmentation method provided by this disclosure, by adjusting the image brightness of the ore image, the color difference between the ore area and the background area can be increased as much as possible under the condition that the background area is under normal exposure, so that the contour boundary between the ore and the background is clearer. Then, based on the obtained optimal image and the determined ore color features, image segmentation can be performed, which can effectively enhance the anti-interference ability of image segmentation and improve the accuracy of image segmentation, so that the final target mask image can be more accurate and reliable. Attached Figure Description
[0015] This disclosure can be better understood by describing exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, in which:
[0016] Figure 1 This is a schematic diagram of a sorting device structure shown according to an exemplary embodiment disclosed in a publication;
[0017] Figure 2 This is a schematic diagram of an image segmentation method according to an exemplary embodiment of a publication;
[0018] Figure 3 This is a schematic diagram of an image segmentation method flow according to another exemplary embodiment disclosed;
[0019] Figure 4 It is an image of a mineral illustrated according to an exemplary embodiment disclosed in a book;
[0020] Figure 5 It is a target mask image shown according to an exemplary embodiment disclosed in a book;
[0021] Figure 6 It is a segmented and labeled image illustrated according to an exemplary embodiment of a published document;
[0022] Figure 7 This is a schematic diagram of the architecture of an image segmentation apparatus according to an exemplary embodiment disclosed in a publication;
[0023] Figure 8 This is a schematic diagram of the architecture of an electronic device illustrated in an exemplary embodiment of a publication. Detailed Implementation
[0024] The following describes specific embodiments of this disclosure. It should be noted that, in order to provide a concise description, this specification cannot exhaustively describe all features of the actual embodiments. It should be understood that, in the actual implementation of any embodiment, just as in any engineering or design project, various specific decisions are often made to achieve the developer's specific goals and to meet system-related or business-related constraints, and this can change from one embodiment to another. Furthermore, it is understood that although the efforts made in this development process may be complex and lengthy, for those skilled in the art related to the content disclosed in this disclosure, changes in design, manufacturing, or production based on the technical content disclosed in this disclosure are merely conventional technical means and should not be construed as insufficient content of this disclosure.
[0025] Unless otherwise defined, the technical or scientific terms used in this disclosure shall have the ordinary meaning understood by one of ordinary skill in the art to which this disclosure pertains. The terms “first,” “second,” and similar terms used in this disclosure do not indicate any order, quantity, or importance, but are merely used to distinguish different components. The terms “a” or “one,” etc., do not indicate a quantity limitation, but rather indicate the presence of at least one. The terms “comprising,” “including,” etc., mean that the element or object preceding “comprising” or “including” encompasses the elements or objects listed following “comprising” or “including” and their equivalents, and do not exclude other elements or objects. The terms “connected,” “linked,” etc., are not limited to physical or mechanical connections, nor are they limited to direct or indirect connections.
[0026] In the field of ore sorting, ore sorting equipment needs to combine collected ore images for identification and classification during the ore sorting process, and then perform targeted sorting. For example, Figure 1 As shown, the ore sorting equipment 100 may include a feeding mechanism 110, a conveying mechanism 120, a detection mechanism 130, and a sorting device 140. The feeding mechanism 110 feeds the ore to be sorted into the conveying mechanism 120. The conveying mechanism 120 may be a conveyor belt or a chute, etc., used to transport the ore to be sorted fed by the feeding mechanism 110. The detection mechanism 130 is used to detect the ore conveyed on the conveying mechanism 120 to determine whether the ore is to be rejected; the ore to be rejected refers to the ore that will be separated by the sorting device. The ore to be rejected can be desired ore or undesirable ore, as long as ore sorting can be achieved. The sorting device 140 is used to remove the ore to be rejected.
[0027] However, during image acquisition, factors such as ore properties or the acquisition environment may prevent accurate identification of the edges between the ore and the background in the generated image. For example, ore properties may include surface reflectivity or color. If the ore surface is highly reflective, the strong reflective effect during image acquisition will cause the incident light to be reflected at high angles, resulting in drastic brightness variations in the same area of the image, making it difficult for edge detection algorithms to accurately determine the ore boundaries. Similarly, if the color difference between the two ores to be sorted is small, the ore contours may not be correctly identified. Furthermore, in low-contrast acquisition environments, the lack of image detail will make ore identification particularly difficult, resulting in a low recognition rate.
[0028] To address the aforementioned problems, an exemplary embodiment of this disclosure provides an image segmentation method. For example... Figure 2 As shown, the image segmentation method may include:
[0029] Step S210: Obtain the image of the ore to be processed.
[0030] An ore image refers to an image containing ore. This ore image can be acquired during the ore transport process by the conveying mechanism of an ore sorting device. By acquiring this ore image, targeted analysis of the ore within it can be performed, thereby improving the ore sorting efficiency during subsequent sorting by the sorting mechanism.
[0031] Step S220: Adjust the image brightness of the ore image to obtain the optimal image.
[0032] In the actual image acquisition process, factors such as the reflective properties of the ore surface, camera parameters, and lighting environment can affect the image brightness of the ore image, resulting in some parts of the image being too bright and others being too dark. This makes the segmentation edge between the ore and the background in the ore image unclear, affecting the accuracy of ore segmentation.
[0033] Therefore, to improve the reliability and accuracy of image segmentation, the image brightness of the ore image is adjusted to maximize the color difference between the ore region and the background region. To ensure the reasonableness of the image brightness adjustment, the image brightness of the ore image is adjusted while the background region is under normal exposure, thus obtaining the optimal image. The color difference between the ore region and the background region in the optimal image is the maximum value of the background region under normal exposure.
[0034] By adjusting the ore image to its optimal state, the brightness contrast between the ore region and the background region becomes more pronounced. This improves the accuracy and reliability of boundary recognition during subsequent image segmentation, thereby enhancing the precision of image segmentation.
[0035] Step S230: Based on the color features of the ore determined by the optimal image, identify the ore in the optimal image to obtain an ore mask image.
[0036] During the transport of ore by the conveyor mechanism, the ore is placed directly on the mechanism. Since the conveyor components and the ore are made of different materials, their color features differ during image recognition. Therefore, to improve image segmentation accuracy, the ore's color features are determined using the optimal image. This allows for the identification of which regions in the optimal image correspond to the ore, enabling effective segmentation and the generation of an ore mask image. This ore mask image is a binary image, with different numerical values corresponding to the ore and background regions.
[0037] In some examples, "0" and "1" can be used to identify the mineral region and the background region, respectively, in the mineral mask image. For instance, during image segmentation, the mineral region is a region of interest, while the background region is a region of non-interest. Therefore, "1" can be used to identify the mineral region and "0" to identify the background region, which facilitates the computer to quickly distinguish regions, reduces the probability of false detections, and improves image segmentation efficiency.
[0038] In other examples, "black" and "white" can be used to identify the ore region and background region respectively in the ore mask image. For example, using "white" to identify the ore region and "black" to identify the background region makes the outline of the ore region clearer and more prominent during subsequent image segmentation, facilitating accurate segmentation and improving image segmentation accuracy.
[0039] Step S240: Based on the ore mask image, obtain the target mask image corresponding to the ore image.
[0040] Since the optimal image is the result of adjusting the brightness of the ore image, a correspondence between the obtained ore mask image and the ore image can be established. This clarifies that the ore mask image is determined based on the ore image, allowing the target mask image to accurately depict the position of the ore in the ore image. This yields the target mask image corresponding to the ore image, which can then be used for targeted analysis of the ore in the corresponding ore image, improving the accuracy and efficiency of ore sorting.
[0041] According to the image segmentation method provided in this disclosure, by adjusting the image brightness of the ore image, the color difference between the ore region and the background region can be increased as much as possible while the background region is under normal exposure, so that the contour boundary between the ore and the background is clearer. Then, based on the obtained optimal image and the determined ore color features, image segmentation can be performed, which can effectively enhance the anti-interference ability of image segmentation and improve the accuracy of image segmentation, so that the final target mask image can be more accurate and reliable.
[0042] In some embodiments, step S220 above may include the following steps:
[0043] Step a1: Gain processing is performed on multiple color channels of the ore image to increase the color difference between the ore area and the background area in the ore image while the background area is under normal exposure, thus obtaining an intermediate image.
[0044] To improve image quality, gain processing is applied to multiple color channels of the ore image to increase the image brightness of the corresponding color channels. This makes the ore area in the ore image more prominent while keeping the exposure of the background area as unchanged as possible, thus obtaining an intermediate image.
[0045] In some optional applications, the R (red), G (green), and B (blue) color channels of the ore image can be linearly enhanced separately to increase the color difference between the ore area and the background area, making it easier to identify and separate the ore. For example, the R (red), G (green), and B (blue) color channels of the ore image can be given at least a 1x gain adjustment. If a change in the exposure of the background area is detected during gain adjustment, the gain is reduced to determine the optimal gain factor without changing the exposure of the background area, thereby obtaining a reliable intermediate image.
[0046] In other optional application scenarios, gain processing can be applied to multiple color channels of a mineral image using any of the following methods or combinations: white balance-guided gain adjustment, multi-channel joint linear operation processing, etc. The specific gain adjustment method used can be determined according to actual needs and is not limited here. White balance-guided gain adjustment can include: calculating the gain factor of each color channel using an automatic white balance algorithm to balance the gray areas of the image and eliminate the influence of illumination color shift. Multi-channel joint linear operation processing can include: performing joint gain processing on multiple color channels using matrix operations, and then adjusting the coupling relationship between channels through matrix coefficients to obtain the desired intermediate image.
[0047] Step a2 involves performing non-linear brightness adjustment on the intermediate image to obtain the optimal image.
[0048] During image acquisition, factors such as mineral reflection or low ambient light may cause some details in the intermediate image to be obscured due to insufficient brightness. Therefore, non-linear brightness adjustment is applied to the intermediate image to enhance the brightness of locally dark areas and improve the clarity of local details. Furthermore, because it is a non-linear brightness adjustment process, it can effectively prevent overexposure in bright areas of the intermediate image, ensuring the reliability of detail brightness adjustment and avoiding ineffective adjustments, thereby improving the efficiency of determining the optimal image. The non-linear brightness adjustment can include, but is not limited to, any one or a combination of the following methods: histogram equalization, gamma correction, adaptive image enhancement, exponential gain adjustment, etc., which can be determined according to actual needs.
[0049] By performing gain processing and nonlinear brightness adjustment on multiple color channels of the ore image, the rationality of brightness adjustment can be ensured. This maximizes the brightness difference between the ore and background areas while ensuring that the exposure of the background area is normal, making the ore details in the ore area clearer and more obvious. This allows for rapid identification of the boundary between the ore and background areas during subsequent image segmentation, improving the accuracy and efficiency of image segmentation and making the image segmentation process more resistant to interference.
[0050] In some embodiments, step S230 above may include the following steps:
[0051] Step b1: Perform color space conversion on the optimal image to obtain a multi-color channel image.
[0052] During ore transport, different types of ores may exist that are similar in color. Therefore, to improve the accuracy of ore segmentation, the optimal image undergoes color space conversion to determine the corresponding color channel images for each color channel. This facilitates subsequent pixel selection within each color channel image based on the ore's color characteristics, ensuring the reliability and accuracy of ore region determination. The color channel images correspond one-to-one with the color channels in the color space. For example, if the color space is HSV, the color channels can be H, S, and V channels, where H represents hue, S represents saturation, and V represents lightness. If the color space is HSL, the color channels can be H, S, and L channels, where H represents hue, S represents saturation, and L represents lightness. If the color space is Lab, the color channels can be L, a, and b channels, where L represents lightness, a represents the color range from green to red, and b represents the color range from blue to yellow.
[0053] Step b2: Based on the mineral color features determined by the optimal image, determine the mineral color threshold range corresponding to each color channel.
[0054] Based on the color characteristics of the ore, the color distribution of the ore region can be determined, and then the ore color threshold range corresponding to each color channel can be determined. This makes the subsequent filtering of pixels in each color channel image more targeted and can effectively avoid misidentification.
[0055] In some application scenarios, taking the HSV color space as an example, based on the color characteristics of the mineral, the distribution of the mineral in the hue channel can be determined to identify the dominant hue, thus defining the color threshold range for color channel H. Similarly, the distribution of the mineral in the saturation channel can be determined, defining the color threshold range for color channel S. Finally, the distribution of the mineral in the lightness channel can be determined, defining the color threshold range for color channel V. For instance, based on the analysis of the mineral color characteristics, the color threshold range for color channel H can be determined to be 20-150, for color channel S 95-130, and for color channel V 115-225.
[0056] Step b3: Based on the matching results between the color values in each color channel image and the corresponding ore color threshold range, identify the ore in the optimal image to obtain the ore mask image.
[0057] By using mineral color thresholds, the maximum and minimum color values belonging to minerals in a corresponding color channel can be determined. Then, by matching the color values of each pixel in each color channel image with the corresponding mineral color threshold, it can be quickly determined whether the current pixel belongs to a mineral region. For example, if a pixel's color value falls within the mineral color threshold range of the corresponding color channel, it indicates that the pixel belongs to a mineral region. If a pixel's color value does not fall within the mineral color threshold range of the corresponding color channel, it indicates that the pixel does not belong to a mineral region and can be considered a background pixel.
[0058] Identifying the ore in the optimal image through pixel matching can effectively improve the localization efficiency of the ore region, thereby quickly obtaining the required ore mask image.
[0059] In some examples, since pixel matching is performed separately for each color channel, some pixels may have color values that are only within the corresponding ore color threshold range but do not actually belong to the ore. Therefore, to improve the reliability of the ore mask image determination, the pixels corresponding to each color channel image can be integrated. Pixels that belong to the ore in multiple color channel images can be taken as the pixels corresponding to the ore. Based on the finally determined pixels corresponding to the ore, an ore mask image corresponding to the ore can be generated, which can effectively avoid misidentification and improve the generation quality of the ore mask image.
[0060] In some embodiments, step S240 above may include the following steps:
[0061] Step c1: Identify the largest ore contour in the ore mask image;
[0062] Step c2: Determine the seed point for the largest ore profile;
[0063] Step c3: Based on the seed point, expand the maximum ore contour to obtain the target ore contour;
[0064] Step c4: Perform mask morphology repair based on the target ore contour to obtain a target mask image corresponding to the ore image.
[0065] Specifically, during ore transport, there may be closely spaced adjacent ores, resulting in the extracted ore image potentially containing a complete ore image as well as partial images of other ores. Therefore, the number of ore mask images can be at least one.
[0066] To ensure the accuracy and completeness of image segmentation, contour recognition processing is performed on the ore mask image to determine the largest ore contour in the ore mask image. This largest ore contour can be considered as the contour with the most complete contour information in the ore mask image.
[0067] Because different contour recognition algorithms may have certain recognition biases, the obtained ore contour may have a pixel difference from the ore region. Therefore, to improve the reliability of the maximum ore contour, seed points for the maximum ore contour are analyzed and determined. These seed points are then used to expand the maximum ore contour to eliminate recognition errors and obtain a reliable target ore contour. For example, the seed point can be the center point, centroid, or a feature point with obvious characteristics on the contour, which can be determined according to actual needs. If the seed point is the centroid of the maximum ore contour, it can be determined using the `moment` or `centerOfMass` functions. The methods for expanding the maximum ore contour can include, but are not limited to, any of the following: 1. Using morphological dilation operations (such as the `dilate` function), starting from the seed point, iteratively expanding the contour to obtain the target ore contour that matches the expectation; 2. Using the seed point as a reference, employing the `FloodFill` algorithm to achieve adaptive region expansion.
[0068] After obtaining the target ore contour, mask morphology restoration is performed on the contour to make the contour edges smoother and more natural, and the mask image area smoother and more complete, resulting in a higher quality target mask image. Mask morphology restoration can include, but is not limited to, using operations such as erosion and dilation to restore the contour and eliminate small holes or noise on the target ore contour; using the fillPoly or drawContours functions to fill the areas within the contour. In some application scenarios, when performing mask morphology restoration on the target ore contour, erosion operations using 3×3 structuring elements can be used to eliminate burrs at the mask edges and fill in holes inside the target ore contour, thereby improving the quality of the generated target mask image.
[0069] In some embodiments, such as Figure 3 As shown, step S210 above may include the following steps:
[0070] Step 211: Obtain the ore transmission image acquired by the X-ray acquisition device of the ore sorting equipment.
[0071] To better identify the ore and facilitate subsequent targeted sorting, the X-ray acquisition device of the ore sorting equipment is used to acquire images, obtaining X-ray images of the ore corresponding to it. This allows for subsequent targeted analysis of the ore based on the obtained transmission images, such as analysis of its internal structure and composition. The X-ray acquisition device can include an X-ray imaging system or a gamma-ray imaging system, which can be determined based on actual needs.
[0072] Step 212: Obtain the color sorting image corresponding to the ore transmission image acquired by the color sorting acquisition device.
[0073] The ore sorting equipment includes a color sorting acquisition device located downstream of the X-ray acquisition device. To facilitate targeted analysis of the identified ore, the color sorting acquisition device determines a color sorted image corresponding to the transmission image of the ore, and the appearance characteristics of the ore, such as color and surface texture, are determined based on the color sorted image.
[0074] In some examples, the process of determining the color sorting image can be as follows: Based on the distance between the X-ray acquisition device and the color sorting acquisition device and the speed at which the transmission mechanism transports the ore, the time when the color sorting acquisition device acquires the color sorting image can be synchronized with the time when the X-ray acquisition device acquires the ore transmission image. Then, based on the acquisition time corresponding to the multiple frames of images acquired by the color sorting acquisition device, the color sorting image corresponding to the ore transmission image can be quickly determined.
[0075] Step 213: Identify the ore outline in the ore transmission image.
[0076] To determine the location of the ore in the ore transmission image, contour recognition processing is performed on the ore transmission image to obtain the ore contour corresponding to the ore.
[0077] Step 214: Determine the local image in the color sorting image that corresponds to the ore outline.
[0078] Since the ore transmission image and the color sorting image are acquired using different image acquisition devices, in order to determine the image in the color sorting image corresponding to the ore outline, a geometric mapping relationship is established based on the installation positions of the X-ray imaging system and the color sorting acquisition device. Based on the position of the ore outline in the ore transmission image, the coordinates of the stone outline mapped to the ore outline in the color sorting image are determined. Thus, based on the stone outline coordinates, a local image in the color sorting image corresponding to the ore outline is obtained.
[0079] Step 215: Extract the ore image to be processed from the color sorting image based on the local image.
[0080] During contour recognition, inherent limitations in the algorithm may lead to pixel discrepancies between the identified ore contour and the actual ore contour. Therefore, to eliminate these errors, a region expansion process is performed on the local image. This ensures that the adjusted local image encompasses as much of the complete image corresponding to the ore as possible, thus obtaining the ore image to be extracted and providing a strong and reliable data foundation for subsequent image segmentation.
[0081] In some examples, region expansion processing of a local image can be performed by adjusting the height and width of the local image according to a specified pixel compensation. That is, a corresponding specified pixel compensation can be added to the width and height of the local image to obtain the expanded ore image. Taking a specified pixel compensation of 10 pixels as an example, if the width and height of the local image are 100 pixels and 200 pixels respectively, then the corresponding width and height of the expanded ore image will be 110 pixels and 210 pixels respectively.
[0082] In other examples, region expansion processing of a local image can be performed by adjusting the height and width of the local image according to a preset pixel ratio. That is, based on the width of the local image and the preset pixel ratio, the width pixel difference to be compensated can be determined; based on the height of the local image and the preset pixel ratio, the height pixel difference to be compensated can be determined. Pixel compensation is performed on the width of the local image based on the height pixel difference, and pixel compensation is performed on the height of the local image based on the width pixel difference. Then, based on the compensation results for width and height, the expanded ore image is obtained. For example, taking a preset pixel ratio of 10% as an example, if the width and height of the local image are 100 pixels and 200 pixels respectively, then the width pixel difference = 100 pixels * 10% = 10 pixels; the height pixel difference = 200 pixels * 10% = 20 pixels. The corresponding width and height of the expanded ore image are 110 (100+10) pixels and 220 (200+20) pixels respectively.
[0083] Extracting ore images using the above method ensures image quality, making the ore contour information more complete. This provides a reliable data foundation for subsequent image segmentation, guarantees the quality of the generated target mask image, and effectively improves the sorting quality when using the target mask image for ore sorting, thus contributing to increased ore sorting efficiency.
[0084] In other embodiments, the image segmentation method described above may further include the following steps:
[0085] Step d1: Determine the image position of the ore image on the color sorting image;
[0086] Step d2: Based on the image position, the target mask image is superimposed on the color sorting image to obtain the segmentation annotation image corresponding to the color sorting image.
[0087] Specifically, since the target mask image is generated based on the ore image extracted from the color sorting image, ideally, the area covered by the target mask image on the color sorting image should completely correspond to the ore image.
[0088] Therefore, to determine the quality of the generated target mask image, the image position of the ore image on the color sorting image is determined to determine the coverage area of the target mask image. The target mask image is then superimposed on the color sorting image according to this image position to obtain the segmentation annotation image corresponding to the color sorting image. Based on the position of the target mask image in the segmentation annotation image and the image content covered by the target mask image, the quality of the target mask image can be analyzed intuitively and quickly. This helps to subsequently improve or maintain the image segmentation process, enhancing the accuracy and reliability of image segmentation, ensuring the stability and accuracy of subsequent analysis using the target mask image, and ultimately improving the performance of ore sorting. In some application scenarios, to facilitate the distinction between the target mask image and its corresponding color sorting image content, the generated segmentation annotation image uses color annotation to locate the position of the target mask image on the color sorting image.
[0089] In some embodiments, the image segmentation method described above may further include denoising the ore image to improve the visibility of ore features. The denoising process includes performing any one or a combination of the following: mean blurring, Gaussian blurring, and median blurring. For example, mean blurring may be performed using a 5x5 convolution kernel to denoise the ore image. Gaussian blurring or median blurring may be performed using a 15x15 convolution kernel to denoise the ore image. It should be noted that the kernel size in the example is for illustrative purposes only and depends on actual needs; it is not limited here.
[0090] In some embodiments, the image segmentation method described above may further include denoising the optimal image to ensure the quality of subsequent analysis. The denoising process includes performing any one or a combination of the following: mean blurring, Gaussian blurring, and median blurring. For example, mean blurring may involve using a 5x5 convolution kernel to denoise the optimal image. Gaussian blurring or median blurring may involve using a 15x15 convolution kernel to denoise the optimal image. It should be noted that the kernel size in the example is for illustrative purposes only and depends on actual needs; it is not limited here.
[0091] In some embodiments, the image segmentation method described above may further include denoising the ore mask image to preserve ore features while removing noise. The denoising process includes performing any one or a combination of the following: mean blurring, Gaussian blurring, and median blurring. For example, mean blurring may be performed using a 5x5 convolution kernel to denoise the ore mask image. Gaussian blurring or median blurring may be performed using a 15x15 convolution kernel to denoise the ore mask image. It should be noted that the kernel size in the example is for illustrative purposes only and depends on actual needs; it is not limited here.
[0092] In some examples, the denoising process can be determined based on the quality of the ore image, optimal image, or ore mask image. For instance, if the ore image, optimal image, or ore mask image is of good quality, any one of the following denoising methods—mean blur, Gaussian blur, and median blur—can be used. If the ore image, optimal image, or ore mask image is of medium quality, any combination of two of these methods can be used. If the ore image, optimal image, or ore mask image is of relatively poor quality, a three-stage cascaded filtering process combining mean blur, Gaussian blur, and median blur can be used to eliminate noise interference as much as possible, enhance the image features of the ore, and ensure the reliability of the generated target mask image.
[0093] In some optional application scenarios, the process of determining the target mask image using the image segmentation method provided in this disclosure can be as follows: During the process of ore sorting equipment transporting ore through a transmission mechanism, an image is acquired by a ray acquisition device to obtain a ore transmission image. Based on the distance between the ray acquisition device and the color sorting acquisition device and the speed at which the ore is transported by the transmission mechanism, a color sorting image corresponding to the ore transmission image is acquired by the color sorting acquisition device. The ore contour in the ore transmission image is identified, and based on the installation positions of the ray imaging system and the color sorting acquisition device, a local image corresponding to the ore contour in the color sorting image is determined. This local image is subjected to region expansion processing to obtain the ore image to be processed, and the ore is extracted from the color sorting image.
[0094] Gain processing is applied to multiple color channels (RGB) of the ore image to increase the color difference between the ore and background areas while the background area is under normal exposure, resulting in an intermediate image. Then, non-linear brightness adjustment is applied to the intermediate image to enhance the brightness of locally darker areas, improving the clarity of local details and thus obtaining the optimal image.
[0095] The optimal image is converted to a different color space to obtain multiple color channel images corresponding to the HSV color space. Based on the ore color features determined from the optimal image, the ore color threshold range corresponding to each color channel is determined. Based on the matching results between the color values in each color channel image and the corresponding ore color threshold range, the ore in the optimal image is identified, resulting in an ore mask image.
[0096] The maximum ore contour in the ore mask image is identified, and seed points for this contour are determined. Using these seed points as a reference, the FloodFill algorithm is employed to adaptively expand the region, thereby obtaining the target ore contour. Mask morphology restoration is then performed on the target ore contour to obtain a target mask image corresponding to the ore image.
[0097] The image segmentation method provided in this disclosure improves the anti-interference capability of image segmentation of ore images in complex environments, effectively enhancing the accuracy of ore edge detection and reducing false recognition, thereby helping to ensure the accuracy and reliability of image segmentation. Furthermore, the computational logic of image segmentation is relatively simple, thus effectively ensuring the efficiency of image segmentation and meeting the real-time requirements of industrial applications.
[0098] In other alternative application scenarios, based on ore transmission images, ore images extracted from color sorting images can be... Figure 4 As shown. According to the image segmentation method provided in this disclosure, processing the ore image yields the following result: Figure 5 The target mask image is shown. The resulting segmentation and annotation image formed by overlaying the target mask image onto the color sorting image can be seen as follows: Figure 6 As shown, the generation quality and effectiveness of the target mask image can be determined through this segmented and labeled image, so that the above image segmentation process can be further optimized.
[0099] Based on the same inventive concept, this disclosure also provides an image segmentation apparatus. For example... Figure 7 As shown, the image segmentation device 300 includes:
[0100] The acquisition module 310 is used to acquire the image of the ore to be processed;
[0101] The adjustment module 320 is used to adjust the image brightness of the ore image to obtain the optimal image, wherein the color difference between the ore area and the background area in the optimal image is the maximum value of the background area under normal exposure.
[0102] The first processing module 330 uses the ore color features determined based on the optimal image to identify the ore in the optimal image and obtain an ore mask image;
[0103] The second processing module 340 is used to obtain a target mask image corresponding to the ore image based on the ore mask image.
[0104] In some embodiments, the adjustment module 320 includes: a first adjustment unit for performing gain processing on multiple color channels of the ore image to increase the color difference between the ore region and the background region in the ore image while the background region is under normal exposure, thereby obtaining an intermediate image; and a second adjustment unit for performing non-linear brightness adjustment processing on the intermediate image to obtain an optimal image.
[0105] In some embodiments, the first processing module 330 includes: a first processing unit, configured to perform color space conversion on the optimal image to obtain a multi-color channel image, wherein the color channel image corresponds one-to-one with the color channels in the color space; a first determining unit, configured to determine the ore color threshold range corresponding to each color channel based on the ore color features determined from the optimal image; and a second processing unit, configured to identify the ore in the optimal image based on the matching result between the color value in each color channel image and the corresponding ore color threshold range, thereby obtaining an ore mask image.
[0106] In some embodiments, the second processing module 340 includes: an identification unit for identifying the largest ore contour in the ore mask image; a second determination unit for determining seed points of the largest ore contour; a third processing unit for expanding the largest ore contour based on the seed points to obtain a target ore contour; and a fourth processing unit for performing mask morphology repair based on the target ore contour to obtain a target mask image corresponding to the ore image.
[0107] In some embodiments, the acquisition module 310 includes: a first acquisition unit, configured to acquire a transmission image of ore collected by a radiation acquisition device of an ore sorting equipment, the ore sorting equipment including a color sorting acquisition device located downstream of the radiation acquisition device; a second acquisition unit, configured to acquire a color sorting image corresponding to the transmission image of ore collected by the color sorting acquisition device; a second recognition unit, configured to recognize the ore outline in the transmission image of ore; a third determination unit, configured to determine a local image in the color sorting image corresponding to the ore outline; and a fifth processing unit, configured to extract the ore image to be processed from the color sorting image based on the local image.
[0108] In some embodiments, the image segmentation apparatus 300 further includes: a third processing module for determining the image position of the ore image on the color sorting image; and a fourth processing module for superimposing a target mask image onto the color sorting image according to the image position to obtain a segmentation annotation image corresponding to the color sorting image.
[0109] In some embodiments, the image segmentation apparatus 300 further includes: a first noise reduction module for performing noise reduction processing on the ore image; a second noise reduction module for performing noise reduction processing on the optimal image; and / or a third noise reduction module for performing noise reduction processing on the ore mask image; wherein the noise reduction processing includes performing any one or a combination of the following processing: mean blur processing, Gaussian blur processing, and median blur processing.
[0110] Regarding the image detection device in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated here.
[0111] Based on the same inventive concept, such as Figure 8 As shown, one embodiment of this disclosure provides an electronic device. The electronic device includes one or more processors 410, a memory 420, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components are interconnected via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the electronic device, including instructions stored in or on 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, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple electronic devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 8 Take a processor 410 as an example.
[0112] Processor 410 may be a central processing unit, a network processor, or a combination thereof. Processor 410 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0113] The memory 420 stores instructions executable by at least one processor 410 to cause the at least one processor 410 to perform the image segmentation method shown in the above embodiments.
[0114] The memory 420 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the electronic device. Furthermore, the memory 420 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 420 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0115] The memory 420 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 420 may also include a combination of the above types of memory.
[0116] The electronic device also includes an input device 430 and an output device 440. The processor 410, memory 420, input device 430, and output device 440 can be connected via a bus or other means. Figure 8 Taking the example of a connection between China and Israel via a bus.
[0117] Input device 430 can receive input numerical or character information, and generate key signal inputs related to user settings and function control of the electronic device, such as a touch screen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc. Output device 440 may include display devices, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibration motors). The aforementioned display devices include, but are not limited to, liquid crystal displays, light-emitting diodes, displays, and plasma displays. In some alternative embodiments, the display device may be a touch screen.
[0118] Based on the same inventive concept, this disclosure also provides a computer-readable storage medium storing a program for performing the image segmentation method of any of the foregoing embodiments.
[0119] This disclosure uses specific terms to describe embodiments of the present disclosure. Terms such as "an embodiment," "one embodiment," and / or "some embodiments" refer to a particular feature, structure, or characteristic associated with at least one embodiment of the present disclosure. Therefore, it should be emphasized and noted that references to "an embodiment," "one embodiment," or "an alternative embodiment" in different locations throughout this specification do not necessarily refer to the same embodiment. Furthermore, certain features, structures, or characteristics in one or more embodiments of the present disclosure can be appropriately combined.
[0120] In the context of this disclosure, unless the context clearly indicates otherwise, the words "a," "an," "an," and / or "the" do not specifically refer to the singular and may also include the plural. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of expressly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.
[0121] Similarly, it should be noted that, in order to simplify the description of this disclosure and thus aid in the understanding of one or more embodiments, the foregoing description of embodiments of this disclosure may sometimes combine multiple features into a single embodiment, drawing, or description thereof. However, this disclosure method does not imply that the subject matter of this disclosure requires more features than the features claimed. In fact, the embodiments contain fewer features than all the features of the single embodiments disclosed above.
[0122] The basic concepts have been described above. It is obvious that the above disclosure is merely illustrative and does not constitute a limitation of this disclosure. Although not explicitly stated herein, various modifications, improvements, and corrections may be made to this disclosure by those skilled in the art. Such modifications, improvements, and corrections are suggested in this disclosure and therefore remain within the spirit and scope of the embodiments of this disclosure.
Claims
1. An image segmentation method, characterized in that, The method includes: Acquire the image of the ore to be processed; Adjusting the image brightness of the ore image to obtain an optimal image includes: performing gain processing on multiple color channels of the ore image to increase the color difference between the ore region and the background region in the ore image while the background region is under normal exposure, thereby obtaining an intermediate image; and performing non-linear brightness adjustment processing on the intermediate image to obtain the optimal image, wherein the color difference between the ore region and the background region in the optimal image is the maximum value of the background region under normal exposure. Based on the ore color features determined from the optimal image, identifying the ore in the optimal image and obtaining an ore mask image includes: performing color space conversion on the optimal image to obtain a multi-color channel image, wherein each color channel image corresponds one-to-one with a color channel in the color space; determining the ore color threshold range corresponding to each color channel based on the ore color features determined from the optimal image; identifying the ore in the optimal image based on the matching result between the color value in each color channel image and the corresponding ore color threshold range, and obtaining the ore mask image includes: taking pixels that belong to the ore in multiple color channel images as pixels corresponding to the ore; and generating the ore mask image corresponding to the ore based on the finally determined pixels corresponding to the ore. Based on the ore mask image, a target mask image corresponding to the ore image is obtained.
2. The image segmentation method according to claim 1, characterized in that, The step of obtaining a target mask image corresponding to the ore image based on the ore mask image includes: Identify the largest ore contour in the ore mask image; Determine the seed point for the maximum ore profile; Based on the seed point, the maximum ore contour is expanded to obtain the target ore contour; Mask morphology restoration is performed based on the target ore contour to obtain the target mask image corresponding to the ore image.
3. The image segmentation method according to claim 1, characterized in that, The process of acquiring the ore image to be processed includes: Acquire a transmission image of ore obtained by a radiation acquisition device of an ore sorting equipment, wherein the ore sorting equipment includes a color sorting acquisition device located downstream of the radiation acquisition device; Obtain a color sorting image corresponding to the transmission image of the ore, acquired by the color sorting acquisition device; Identify the ore outline in the ore transmission image; Determine the local image in the color sorting image that corresponds to the ore outline; Based on the local image, the ore image to be processed is extracted from the color sorting image.
4. The image segmentation method according to claim 3, characterized in that, The method further includes: Determine the image position of the ore image on the color sorting image; Based on the image position, the target mask image is superimposed on the color sorting image to obtain the segmentation annotation image corresponding to the color sorting image.
5. The image segmentation method according to claim 1, characterized in that, The method further includes: The ore image is subjected to noise reduction processing; Denoising the optimal image; and / or The ore mask image is subjected to noise reduction processing; The noise reduction process includes performing any one or a combination of the following processes: mean blurring, Gaussian blurring, and median blurring.
6. An image segmentation apparatus, characterized in that, The device includes: The acquisition module is used to acquire images of the ore to be processed; An adjustment module is used to adjust the image brightness of the ore image to obtain an optimal image. This includes: performing gain processing on multiple color channels of the ore image to increase the color difference between the ore region and the background region in the ore image while the background region is under normal exposure, thus obtaining an intermediate image; and performing non-linear brightness adjustment processing on the intermediate image to obtain the optimal image, wherein the color difference between the ore region and the background region in the optimal image is the maximum value of the background region under normal exposure. The first processing module identifies the ore in the optimal image using the ore color features determined based on the optimal image, and obtains an ore mask image. This includes: performing a color space conversion on the optimal image to obtain a multi-color channel image, where each color channel image corresponds one-to-one with a color channel in the color space; determining the ore color threshold range corresponding to each color channel based on the ore color features determined by the optimal image; and identifying the ore in the optimal image based on the matching result between the color values in each color channel image and the corresponding ore color threshold range, and obtaining the ore mask image. This includes: identifying pixels that belong to the ore in all of the multiple color channel images as pixels corresponding to the ore; and generating the ore mask image corresponding to the ore based on the finally determined pixels corresponding to the ore. The second processing module is used to obtain a target mask image corresponding to the ore mask image based on the ore mask image.
7. An electronic device, characterized in that, include: The system includes 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 according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program for performing the image segmentation method according to any one of claims 1-5.
Citation Information
Patent Citations
Ore image recognition method and device based on color feature filtering
CN116229108A