An image object segmentation optimization method based on interactive hints

CN122990185APending Publication Date: 2026-10-27SHENZHEN GRAPHIC DECORATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610769290.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-31
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0003]本发明的目的在于提供一种基于交互提示的图像目标分割优化方法,旨在解决现有一键智能抠图方法难以满足用户个性化需求、分割结果中存在冗余背景区域未被剔除或目标部分区域被遗漏、且难以进行精细化调整的技术问题

Benefits of technology

[0004]与现有技术相比,本发明通过获取待分割图像并生成初始分割掩膜,基于预设交互提示识别方法获得初始分割掩膜中目标边缘区域的特征点集,并沿初始分割掩膜的置信度梯度方向及其法线方向构建探测路径,根据特征点集中心至目标边缘区域各边界点的像素距离及掩膜置信度差值,向掩膜置信度较高的一侧偏移特征点集中心至置信度等值位置,从而获得修正特征点集,使交互提示位置能够准确收敛至目标真实边界,有效避免了传统交互式分割中特征点偏离目标导致的分割误差;进一步地,以修正特征点集为中心对目标区域进行等分区划分,并通过统计各等分区的掩膜覆盖率均值和边缘梯度值、引入距离加权因子计算掩膜差异指标,能够全面反映目标区域内分割质量的空间分布特征,准确识别出分割结果中存在的冗余背景区域或遗漏目标区域;在此基础上,根据掩膜差异指标自适应生成保留分割结果指令或局部修正指令,并支持对初始分割掩膜进行迭代更新,直至掩膜差异指标收敛至预设范围内,从而实现对一键抠图结果的智能化精细化优化,显著提升了复杂场景下图像目标分割的准确性、完整性和效率,能够快速满足用户的个性化抠图需求。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122990185A_ABST
    Figure CN122990185A_ABST
Patent Text Reader

Abstract

The application discloses an image target segmentation optimization method based on interactive prompts and relates to the technical field of image processing, which comprises the following steps: obtaining a to-be-segmented image and generating an initial segmentation mask; obtaining a feature point set of a target edge region in the initial segmentation mask based on a preset interactive prompt recognition method; constructing a detection path along a confidence gradient direction and a normal direction of the initial segmentation mask, obtaining distribution information of the feature point set to a stable segmentation region, and offsetting a feature point set center to a confidence equivalent position on a side with higher mask confidence, to obtain a corrected feature point set; dividing the target region into equal partitions with the corrected feature point set as the center, statistically obtaining an average mask coverage rate and an edge gradient value of each equal partition, and calculating a mask difference index; and generating a reserved segmentation result instruction or a local correction instruction according to the difference index. The application can intelligently delete redundant regions or complete missing regions through interactive editing and optimization of one-key matting results, and can improve the accuracy and efficiency of matting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and more specifically to an image target segmentation optimization method based on interactive prompts. Background Technology

[0002] In recent years, with the rapid development of image processing technology, intelligent image matting has become an important application in the field of image editing, widely used in e-commerce product display, film and television post-production, ID photo processing, and social media content creation. Traditional image matting methods mainly rely on manual editing tools, such as the lasso tool, magic wand tool, and brush tool. Users need to trace or repeatedly paint along the edge of the target, often requiring a lot of time and effort to adjust, and the results are often unsatisfactory. Especially when processing complex images, such as when the target and background colors are similar, or when there is hair or semi-transparent areas on the target edge, traditional methods struggle to accurately separate the user's target object from the background, resulting in significant differences in matting quality. With the rise of deep learning technology, one-click intelligent image matting methods based on neural networks have gradually become mainstream, capable of quickly generating target segmentation masks. However, one-click intelligent matting methods still have limitations when facing personalized user needs: firstly, redundant background areas are often not removed in the segmentation results; secondly, target areas are often missed in the segmentation results; and thirdly, users find it difficult to fine-tune the one-click matting results, failing to quickly meet actual editing needs. Therefore, there is an urgent need to provide an image target segmentation method that can interactively optimize one-click matting results to improve the accuracy and efficiency of matting. Summary of the Invention

[0003] The purpose of this invention is to provide an image target segmentation optimization method based on interactive prompts, which aims to solve the technical problems of existing one-click intelligent image matting methods that are difficult to meet users' personalized needs, have redundant background areas that are not removed or target areas that are missed in the segmentation results, and are difficult to make fine adjustments. To achieve the above objectives, the present invention provides an image target segmentation optimization method based on interactive prompts. The method includes the following steps: acquiring an image to be segmented and generating an initial segmentation mask corresponding to the image; obtaining a feature point set of the target edge region in the initial segmentation mask based on a preset interactive prompt recognition method; acquiring the distribution information of the feature point set to stable segmentation regions in the initial segmentation mask, and correcting the feature point set according to the distribution information to obtain a corrected feature point set; and performing a partitioned comparison of the target region in the image to be segmented based on the corrected feature point set to obtain segmentation optimization information for the target region. Optionally, the step of obtaining the distribution information of the feature point set to the stable segmented region in the initial segmentation mask includes: constructing a first detection path along the confidence gradient direction of the initial segmentation mask, starting from the center of the feature point set, and constructing a second detection path along the normal direction of the confidence gradient, wherein the first detection path intersects the target edge region at a first boundary point and a second boundary point, and the second detection path intersects the target edge region at a third boundary point and a fourth boundary point; and using the pixel distances and mask confidence differences between the center of the feature point set and the first boundary point, the second boundary point, the third boundary point, and the fourth boundary point as distribution information. Optionally, the step of correcting the feature point set according to the distribution information to obtain a corrected feature point set includes: along the first detection path direction, based on the first pixel distance between the center of the feature point set and the first boundary point and the mask confidence difference, and the second pixel distance between the center of the feature point set and the second boundary point and the mask confidence difference, shifting the center of the feature point set towards the side with higher mask confidence, until the center of the feature point set is located at a confidence level equivalent position between the first boundary point and the second boundary point, to determine an intermediate feature point set; along the second detection path direction, based on the third pixel distance between the intermediate feature point set and the third boundary point and the mask confidence difference, and the fourth pixel distance between the intermediate feature point set and the fourth boundary point and the mask confidence difference, shifting the intermediate feature point set towards the side with higher mask confidence, until the intermediate feature point set is located at a confidence level equivalent position between the third boundary point and the fourth boundary point, to determine the corrected feature point set. Optionally, the step of acquiring the image to be segmented and generating an initial segmentation mask corresponding to the image to be segmented includes: acquiring the image to be segmented and performing scale normalization processing on the image to be segmented; performing multi-scale feature extraction on the scale-normalized image to be segmented through a preset image encoder to obtain an image feature map; acquiring interactive prompts applied to the image to be segmented and encoding the interactive prompts through a preset prompt encoder to obtain a prompt embedding vector; inputting the image feature map and the prompt embedding vector into a preset mask decoder to output the initial segmentation mask corresponding to the image to be segmented. Optionally, the step of obtaining the feature point set of the target edge region in the initial segmentation mask based on the preset interactive prompt recognition method includes: analyzing the initial segmentation mask based on the preset interactive prompt recognition method; when the feature point set of the target edge region in the initial segmentation mask is identified, the feature point set is used as the initial feature point set, and the step of: obtaining the distribution information of the feature point set to the stable segmentation region in the initial segmentation mask; when the feature point set of the target edge region in the initial segmentation mask cannot be identified, the corresponding prompt information is output. Optionally, the step of partitioning and comparing the target region in the image to be segmented based on the modified feature point set to obtain the segmentation optimization information of the target region includes: dividing the target region in the image to be segmented into a preset number of equal partitions with the modified feature point set as the center; obtaining the mask distribution information of the equal partitions; and determining the segmentation optimization information of the target region based on the difference in the mask distribution information between the equal partitions. Optionally, the mask distribution information includes the average mask coverage and edge gradient values. The step of obtaining the mask distribution information of the equal partitions and determining the segmentation optimization information of the target region based on the differences in the mask distribution information between the equal partitions includes: statistically analyzing the average mask coverage and edge gradient values ​​of each equal partition, and calculating the mask difference index between each equal partition. The mask difference index is determined by the following formula: Wherein, ΔM is the mask difference index, Mᵢ is the average mask coverage of the i-th equal partition, M̄ is the average mask coverage of all equal partitions, Gᵢ is the edge gradient value of the i-th equal partition, Ḡ is the average edge gradient value of all equal partitions, dᵢ is the distance from the center of the i-th equal partition to the target reference point, dmax is the maximum reference distance of the target, ωᵢ is the distance weighting factor of the i-th equal partition, α and β are weighting coefficients, and N is the number of equal partitions; if the mask difference index is within a preset range, the segmentation optimization information indicates that the target region is completely segmented, and an instruction to retain the segmentation result is generated; if the mask difference index is not within the preset range, the segmentation optimization information indicates that the target region segmentation has defects, and a local correction instruction is generated. Optionally, the step of generating the instruction to retain the segmentation result or the local correction instruction includes: when the segmentation optimization information indicates that the target region is completely segmented, generating an instruction to retain the current mask and output the matting result; when the segmentation optimization information indicates that the target region has defects in segmentation, generating a local correction instruction to delete redundant regions or fill in missing regions for specific equal partitions. Optionally, the interactive prompt includes at least one of click prompt, bounding box prompt, and smear prompt. The step of obtaining the feature point set of the target edge region in the initial segmentation mask based on the preset interactive prompt recognition method further includes: when the interactive prompt is a click prompt, obtaining pixels within a preset radius centered on the click position as the feature point set; when the interactive prompt is a bounding box prompt, using the intersection of the boundary of the bounding box region and the target edge region as the feature point set; and when the interactive prompt is a smear prompt, using the pixels covered by the smear trajectory as the feature point set. Optionally, after generating the local correction instruction, the method further includes: updating the initial segmentation mask according to the local correction instruction to obtain the updated segmentation mask; using the updated segmentation mask as the initial segmentation mask again, and repeatedly executing the step of obtaining the feature point set of the target edge region in the initial segmentation mask based on the preset interactive prompt recognition method, until the mask difference index is within a preset range, and outputting the final target segmentation result.

[0004] Compared with existing technologies, this invention acquires the image to be segmented and generates an initial segmentation mask. Based on a preset interactive prompt recognition method, it obtains a feature point set of the target edge region in the initial segmentation mask. A detection path is constructed along the confidence gradient direction and normal direction of the initial segmentation mask. Based on the pixel distance from the center of the feature point set to each boundary point of the target edge region and the mask confidence difference, the center of the feature point set is shifted to a position with equal confidence on the side of higher mask confidence, thereby obtaining a corrected feature point set. This ensures that the interactive prompt position accurately converges to the true boundary of the target, effectively avoiding segmentation errors caused by feature points deviating from the target in traditional interactive segmentation. Furthermore, the target region is segmented using the corrected feature point set as the center. By dividing the image into equal partitions and calculating the mask difference index by statistically analyzing the average mask coverage and edge gradient values ​​of each partition and introducing a distance weighting factor, the system can comprehensively reflect the spatial distribution characteristics of the segmentation quality within the target area and accurately identify redundant background areas or missing target areas in the segmentation results. Based on this, the system adaptively generates instructions to retain the segmentation results or to make local corrections according to the mask difference index, and supports iterative updates to the initial segmentation mask until the mask difference index converges to a preset range. This achieves intelligent and refined optimization of the one-click matting results, significantly improving the accuracy, completeness, and efficiency of image target segmentation in complex scenes, and quickly meeting users' personalized matting needs. Attached Figure Description Figure 1 A flowchart illustrating the image target segmentation optimization method based on interactive prompts provided by the present invention; Figure 2 A schematic diagram illustrating the principle of feature point set correction process in the image target segmentation optimization method based on interactive prompts provided by the present invention; Figure 3 This is a schematic diagram illustrating the target region partitioning comparison and iterative optimization in the image target segmentation optimization method based on interactive prompts provided by the present invention; Figure 4 This is a schematic diagram of the initial segmentation mask generation structure in the image target segmentation optimization method based on interactive prompts provided by the present invention. Detailed Implementation To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified. To more clearly illustrate the technical solution of the present invention, the present invention will be further described in detail below with reference to specific embodiments and accompanying drawings. The embodiments are used to explain the present invention, rather than to limit the scope of protection of the present invention. The image target segmentation optimization method based on interactive prompts provided in this embodiment, through a complete closed-loop process of "image acquisition - prompt recognition - feature point correction - partition comparison", can retain the advantages of one-click intelligent segmentation speed while introducing user interaction intent as the basis for correction. It effectively solves the problem of redundant background not being removed or target areas being missed in one-click segmentation results, and significantly improves the accuracy and editing efficiency of image target segmentation in complex scenes. See Figure 1 As shown, the image target segmentation optimization method based on interactive prompts provided in this embodiment includes the following steps: S1. Obtain the image to be segmented and generate the initial segmentation mask corresponding to the image to be segmented. The image to be segmented can originate from local image files uploaded by the user, images captured in real-time by a camera, or image resources downloaded from the network. Common formats include bitmap formats such as JPEG, PNG, and BMP. In practical applications, these typically correspond to scenarios requiring image cutout processing, such as e-commerce product images, portrait photos, and film and television frame images. The initial segmentation mask is a grayscale image or probability map with the same size as the image to be segmented. The value at each pixel position represents the confidence that the pixel belongs to the target object. The closer the value is to 1, the higher the probability that the pixel belongs to the target; the closer the value is to 0, the higher the probability that the pixel belongs to the background; values ​​in the middle range reflect uncertainty in the segmentation result at that position. As an exemplary implementation, the initial segmentation mask can be obtained by performing one-click segmentation on the image to be segmented using a pre-trained image segmentation network. The image segmentation network can be the SegmentAnything model, a general-purpose segmentation model trained on large-scale image-mask data. It possesses zero-shot segmentation capabilities and can generate corresponding segmentation masks for any target object in any image without requiring additional training for specific target categories. The initial segmentation mask is obtained by inputting the image to be segmented into the SegmentAnything model. In practical image matting scenarios, the SegmentAnything model can quickly provide preliminary segmentation results for common objects such as people, goods, and animals. However, it still exhibits inaccuracies in segmenting areas such as hair at the target edge, semi-transparent regions, and areas where the target and background colors are similar. These areas require further refinement and optimization of the mask result through subsequent steps. S2. Based on the preset interactive prompt recognition method, obtain the feature point set of the target edge region in the initial segmentation mask. The target edge region refers to the annular or strip-shaped area in the initial segmentation mask where the mask confidence level undergoes a significant transition, i.e., the transition from the high-confidence core area to the low-confidence background area. This region carries the true contour information of the target object and is also the key location most prone to deviation in the one-click segmentation result. The interactive prompts are indication signals applied by the user to the image to be segmented through input methods such as mouse, stylus, or finger touch, to express the user's intention to correct the current segmentation result, such as indicating that a certain background area should be removed or that a certain target area has been missed and needs to be filled in. When performing this step, the interactive prompts applied by the user are first received on the human-computer interaction interface where the image to be segmented is located, and the coordinate values ​​of the prompt's location in the image coordinate system are recorded. Then, these coordinate values ​​are mapped to the corresponding positions in the initial segmentation mask, and a set of pixel points associated with the user's prompt are determined within the target edge region. This set of pixel points constitutes the feature point set, and the geometric center of this feature point set is used as the feature point set center. This feature point set contains precise location information of areas where the user is dissatisfied with the current segmentation result, providing key anchor points for subsequent correction and partition comparison processing. S3. Obtain the distribution information of the feature point set to the stable segmentation region in the initial segmentation mask, and correct the feature point set according to the distribution information to obtain the corrected feature point set. The stable segmentation region refers to the core region in the initial segmentation mask that consistently exhibits high mask confidence and a stable spatial distribution. This region typically corresponds to the part of the target object with a clear internal structure and distinct from the background, and can be considered the part with the highest confidence in the segmentation result. The distribution information is used to characterize the spatial and confidence relationships between the feature point set and the stable segmentation region. It can be described using parameters such as the pixel distance from the center of the feature point set to several reference positions within the stable segmentation region, and the difference between the mask confidence at the center of the feature point set and the mask confidence at the reference positions. After obtaining the distribution information, the position of the center of the feature point set is adjusted to approach the direction of the stable segmentation region and eventually converge to the position with the same confidence value corresponding to the true boundary of the target, thereby obtaining the corrected feature point set. The core function of this step is to eliminate potential positional deviations in user interaction prompts at the pixel level. For example, the user's click position may not fall precisely on the target boundary, the boundary of the selected area may be offset from the actual outline of the target, and the coverage of the smearing trajectory may not completely match the target boundary. This ensures that subsequent partition comparison processing is based on a more accurate positional benchmark, avoiding incorrect segmentation optimization direction caused by initial prompt positional deviations. S4. Based on the modified feature point set, the target region in the image to be segmented is partitioned and compared to obtain the segmentation optimization information of the target region. The target region refers to the image region occupied by the target object marked by the initial segmentation mask in the image to be segmented. This region may have various states such as complete segmentation, local redundancy, and local omission. The partition comparison uses the corrected feature point set as the reference center, divides the target region into multiple spatially non-overlapping sub-regions according to preset rules, and independently statistically analyzes and compares the mask distribution characteristics of each sub-region. The overall quality of the current segmentation result is evaluated and the location of local defects is located by the degree of difference between the sub-regions. The segmentation optimization information can include two forms: one is the preservation information indicating that the target region is completely segmented and the current segmentation result can be directly output; the other is the instruction information indicating that the target region segmentation has defects and that specific sub-regions need to be further corrected. The segmentation optimization information obtained in this step can drive the subsequent mask update and iterative optimization process until the segmentation result meets the user's personalized matting requirements in terms of accuracy, thereby realizing intelligent and refined optimization of the one-click matting result. This embodiment elaborates on the specific method of obtaining the distribution information between the feature point set and the stable segmentation region. By constructing a bidirectional detection path along the confidence gradient direction and the normal direction, it can accurately capture the degree of offset of the feature point set center relative to the true boundary of the target, providing a quantitative basis for subsequent feature point set correction, and effectively avoiding the interference of the deviation between the user interaction prompt position and the true contour of the target on the segmentation result. See Figure 2 As shown, the steps provided in this embodiment for obtaining the distribution information of the feature point set to the stable segmentation region in the initial segmentation mask include: S31. Starting from the center of the feature point set, construct a first detection path along the confidence gradient direction of the initial segmentation mask, and construct a second detection path along the normal direction of the confidence gradient. The first detection path intersects the target edge region at a first boundary point and a second boundary point, and the second detection path intersects the target edge region at a third boundary point and a fourth boundary point. The confidence gradient direction of the initial segmentation mask reflects the direction of the most drastic change in mask confidence. Moving along this direction results in the largest increase or decrease in mask value. This can be obtained by calculating the gradient vector of the initial segmentation mask at the center of the feature point set and taking its unit direction. The normal direction of the confidence gradient is perpendicular to the confidence gradient direction, and moving along this direction results in a relatively gradual change in mask value. Starting from the center P0 of the feature point set, the first detection path extends to both sides along the confidence gradient direction, and the second detection path extends to both sides along the confidence gradient normal direction. The two detection paths intersect at P0 and jointly cover the main orientation of the target object. During its extension to both sides, the first detection path intersects with the target edge region, forming the first boundary point B1 and the second boundary point B2 on both sides of P0. Similarly, the second detection path forms the third boundary point B3 and the fourth boundary point B4. B1, B2, B3, and B4 all fall on the boundary positions where the mask confidence transitions from high to low. S32. The pixel distances and mask confidence differences between the center of the feature point set and the first boundary point, the second boundary point, the third boundary point and the fourth boundary point are used as distribution information. The pixel distance refers to the Euclidean distance between the center of the feature point set and the corresponding boundary point in the image coordinate system, measured in pixels, reflecting the spatial relationship between the center of the feature point set and the target boundary. The mask confidence difference refers to the algebraic difference between the mask value at the center of the feature point set and the mask value at the corresponding boundary point, reflecting the degree of difference in probability distribution between the center of the feature point set and the target boundary. In practice, the four sets of pixel distances from P0 to B1, B2, B3, and B4, along with the corresponding four sets of mask confidence differences, are packaged together as the distribution information. This information serves as the quantization input for subsequently determining whether the center of the feature point set needs to be offset along a certain detection path. The greater the asymmetry of the distance values ​​and the greater the inconsistency of the confidence differences, the more significant the deviation of P0 from the true center of the target, and the greater the correction required. This embodiment elaborates on the specific acquisition process of the corrected feature point set. By sequentially performing offset operations along the first and second detection paths, which are perpendicular to each other, the center of the feature point set converges to the position of confidence value in two independent dimensions. This achieves two-dimensional joint correction of the position deviation of the user interaction prompt. Compared with single-direction correction, it can more comprehensively eliminate the deviation between the position of the interaction prompt and the true boundary of the target, ensuring that the corrected feature point set can accurately reflect the true contour of the target object. See Figure 2 As shown, the steps provided in this embodiment for correcting the feature point set based on the distribution information to obtain the corrected feature point set include: S33. Along the first detection path direction, based on the first pixel distance between the center of the feature point set and the first boundary point and the difference in mask confidence, and the second pixel distance between the center of the feature point set and the second boundary point and the difference in mask confidence, shift the center of the feature point set to the side with higher mask confidence, until the center of the feature point set is located at a position with equal confidence between the first boundary point and the second boundary point, so as to determine the intermediate feature point set. The offset process on the first detection path aims to balance the distribution characteristics on both sides. When the center P0 of the feature point set deviates from the true center of the target, the first pixel distance from P0 to the first boundary point B1 and the second pixel distance from P0 to the second boundary point B2 will be asymmetrical, and the difference between the mask confidence at P0 and the mask confidence at B1 and B2 will also be inconsistent. The side with shorter distance usually corresponds to the boundary where the mask confidence transition is steeper, that is, closer to the deviation position that the user wants to correct. During the offset operation, P0 is moved along the direction of the first detection path towards the side indicated by the larger of the first pixel distance and the second pixel distance, i.e., towards the stable segmentation region with higher mask confidence. After each step, the pixel distance and mask confidence difference between the moved position and B1 and B2 are recalculated. The symmetry of the distances and confidence differences on both sides is used as the convergence criterion. The offset and judgment operations are repeated until the distance and confidence difference between the moved position and B1 are equal to the distance and confidence difference between the moved position and B2 within a preset tolerance range. At this point, the moved position is located on the confidence contour line between B1 and B2, and this position is output as the intermediate feature point set P1. The physical meaning of the intermediate feature point set P1 is that it has eliminated the deviation from the true center of the target in the direction corresponding to the first detection path, but there may still be deviations in the other direction perpendicular to the first detection path, which need to be further corrected by the offset in the next stage. S34. Along the second detection path direction, based on the third pixel distance between the intermediate feature point set and the third boundary point and the mask confidence difference, and the fourth pixel distance between the intermediate feature point set and the fourth boundary point and the mask confidence difference, shift the intermediate feature point set to the side with higher mask confidence until the intermediate feature point set is located at a confidence level equivalent position between the third boundary point and the fourth boundary point, so as to determine the corrected feature point set. The offset process on the second detection path takes the intermediate feature point set P1 as a new starting point and is processed according to a criterion similar to that of the first detection path offset process. Specifically, the third pixel distance and mask confidence difference between P1 and the third boundary point B3, and the fourth pixel distance and mask confidence difference between P1 and the fourth boundary point B4 are calculated respectively. The offset direction is determined based on the relative magnitude of the third pixel distance and the fourth pixel distance. P1 is moved along the direction of the second detection path towards the stable segmentation region with higher mask confidence. After each step, the pixel distance and mask confidence difference between the moved position and B3 and B4 are recalculated. The symmetry of the distance and confidence difference on both sides is used as the convergence criterion. The offset and judgment operation is repeated until the distance and confidence difference between the moved position and B3 and the distance and confidence difference between the moved position and B4 are equal within a preset tolerance range. At this time, the moved position is located on the confidence contour line between B3 and B4, and this position is output as the corrected feature point set P2. The corrected feature point set P2 has been offset in both the first and second detection paths, which are perpendicular to each other. Its position satisfies the requirement of being symmetrical with the target boundary in both directions and being at the confidence level position defined by the stable segmentation region. Thus, P2 can accurately reflect the true center position of the target object in the neighborhood of the feature point set, providing a precise and reliable geometric reference for subsequent target region partitioning comparison processing based on the corrected feature point set. Understandably, the two-stage offset process formed by executing S33 and S34 sequentially is mathematically a decoupling correction of two-dimensional position deviation: the first stage eliminates the deviation in the confidence gradient direction, and the second stage eliminates the deviation in the confidence gradient normal direction. The two stages together constitute a complete correction trajectory of "P0→P1→P2", avoiding the computational overhead and convergence instability caused by complex joint optimization in the two-dimensional plane. At the same time, it also makes the offset direction and convergence criterion of each stage have clear physical meaning, which is convenient for implementation and debugging in actual engineering. This embodiment elaborates on the specific generation process of the initial segmentation mask. By introducing a collaborative processing architecture of image encoder, prompt encoder and mask decoder, the visual features of the image to be segmented and the semantic intent of the user interaction prompts can be deeply fused at the feature level. Compared with the method of segmenting only by relying on the image itself, an initial segmentation mask that is more in line with the user's intent can be obtained, laying a good foundation for subsequent optimization processing. See Figure 4 As shown, the steps provided in this embodiment for obtaining the image to be segmented and generating the initial segmentation mask corresponding to the image to be segmented include: S11. Acquire the image to be segmented and perform scale normalization processing on the image to be segmented. The data acquisition can be achieved through user uploads, real-time shooting with cameras, or downloading from online resources. The acquired images to be segmented may vary in size, resolution, and aspect ratio. The scale normalization process involves adjusting images of different sizes to a preset standard input size, such as 1024×1024 pixels. This adjustment can be achieved by maintaining the aspect ratio while scaling proportionally and padding the shorter sides with zeros to prevent deformation of the target object during scaling. The adjusted images are then normalized to pixel values, mapping the pixel value range from the original 0 to 255 to a standard range of 0 to 1 or -1 to 1, to accommodate the range requirements of subsequent feature extraction processing. S12. Multi-scale feature extraction is performed on the scale-normalized image to be segmented using a preset image encoder to obtain an image feature map. The preset image encoder can adopt a network structure based on visual Transformer, such as a ViT-H or ViT-L backbone network. The encoder extracts features from the input image layer by layer through stacked multi-layer self-attention modules. Shallow modules capture local details such as edges and textures, while deep modules capture global features such as target contours and semantic structures. The multi-layer features are fused to output the image feature map. The image feature map is a high-dimensional tensor with a spatial dimension smaller than the original image and a channel dimension much larger than the original image. The feature vector at each spatial location carries the visual information of that location under different receptive fields. S13. Obtain the interactive prompts applied to the image to be segmented, and encode the interactive prompts using a preset prompt encoder to obtain the prompt embedding vector. The interactive prompts include user-applied indicators such as clicks, selections, and smears on the image to be segmented. These are represented in their original form as coordinate points, bounding boxes, or pixel trajectories in the image coordinate system. The preset prompt encoder employs corresponding encoding methods for different types of interactive prompts: for click prompts, positional encoding maps coordinate points to fixed-dimensional vectors; for selection prompts, two-endpoint positional encoding maps rectangles to vector sequences; and for smear prompts, trajectory sampling-based positional encoding maps trajectory points point-by-point to vector sequences. All types of interactive prompts are uniformly expressed as the prompt embedding vector after encoding, enabling subsequent decoding processing to receive and process multiple types of interactive prompts in a unified manner. S14. Input the image feature map and the prompt embedding vector into the preset mask decoder, and output the initial segmentation mask corresponding to the image to be segmented. The preset mask decoder can employ a lightweight Transformer decoding structure. The decoder uses the image feature map as the key input and the cue embedding vector as the query input. Through a cross-attention mechanism, the cue embedding vector is weighted and aggregated at various spatial locations in the image feature map to determine the target region matching the user interaction cue. The decoded features are upsampled to the same spatial size as the image to be segmented, and a convolutional output layer predicts the probability value of belonging to the target object pixel by pixel, finally outputting the initial segmentation mask. The initial segmentation mask numerically reflects the confidence level of each pixel belonging to the target pointed to by the user, serving as input data for subsequent feature point set recognition and correction processing. This embodiment elaborates on the specific execution logic of the preset interactive prompt recognition method. By introducing a validity judgment mechanism for the recognition result, it can distinguish between successful and unsuccessful recognition and take corresponding follow-up processing. This avoids blindly executing the subsequent correction process when a valid feature point set cannot be obtained, which would lead to the failure of the processing result. This improves the robustness of the method in practical applications and the user-friendliness of the interaction. See Figure 1 As shown, the steps for obtaining the feature point set of the target edge region in the initial segmentation mask based on the preset interactive prompt recognition method provided in this embodiment include: S21. Analyze the initial segmentation mask based on the preset interactive prompt recognition method. During the analysis, the location of the user-applied interactive prompt is mapped to the initial segmentation mask. The confidence distribution of the mask is scanned in the neighborhood of the mapped location. The focus is on detecting the target edge region formed by the transition from high to low confidence, and an attempt is made to determine a set of pixels in this region that corresponds to the user's prompt. S22. When a set of feature points in the target edge region of the initial segmentation mask is identified, the set of feature points is used as the initial feature point set, and the following steps are performed: obtaining the distribution information of the feature point set to the stable segmentation region in the initial segmentation mask. The criteria for successful recognition are: a target edge region with continuous transition characteristics is detected within the neighborhood of the interactive prompt location, and the number of determined pixels reaches a preset threshold. When the above conditions are met, the determined pixel set is retained as the initial feature point set, and its geometric center is used as the starting position for subsequent offset correction. Then, the process of obtaining distribution information is executed, entering the offset correction stage of the initial feature point set. S23. When the feature point set of the target edge region in the initial segmentation mask cannot be identified, the corresponding prompt information is output. Common scenarios leading to recognition failure include: the user interaction prompt is located in a pure background region or a pure target interior region with uniform mask confidence in the initial segmentation mask, resulting in no effective target edge transition in the neighborhood; or the user interaction prompt is too far from the target object, causing the edge response in the neighborhood to be lower than a preset threshold. In these cases, the system outputs a message to the user via the human-computer interface: "No valid editing region detected, please re-specify the prompt location" or an equivalent message, guiding the user to adjust the prompt's location and re-trigger this step. This embodiment focuses on the partitioning comparison process of the target region. By uniformly dividing the target region around the modified feature point set and independently statistically analyzing the mask distribution information of each partition, the overall segmentation quality assessment problem can be transformed into a difference comparison problem between local sub-regions. This allows for the precise location of the specific spatial location of defects in the segmentation results, providing a quantitative basis for generating targeted optimization instructions. See Figure 3 As shown in the figure, the step of partitioning and comparing the target region in the image to be segmented based on the modified feature point set to obtain the segmentation optimization information of the target region provided in this embodiment includes: S41. Using the modified feature point set as the center, divide the target region in the image to be segmented into a preset number of equal partitions. The specific division method is as follows: Using the geometric center of the modified feature point set as the origin of the partition, multiple rays are drawn outwards from this origin at equal angular intervals, uniformly dividing the target region into a predetermined number of fan-shaped sub-regions. The predetermined number can be set according to the complexity of the target object; for example, simple geometric objects can be set to 4 equal partitions, regular objects to 8 equal partitions, and complex objects to 16 equal partitions. Each equal partition is spatially non-overlapping and collectively covers the entire range of the target region. Each equal partition corresponds to a local location of the target object. S42. Obtain the mask distribution information of the equal partitions, and determine the segmentation optimization information of the target region based on the differences in the mask distribution information between the equal partitions. For each equal partition, the mask values ​​corresponding to all pixels within that partition are independently calculated to obtain mask distribution information reflecting the segmentation state of that partition. The mask distribution information of each partition is then compared horizontally. Small differences indicate that the segmentation state of each partition is consistent, and the target region is segmented completely. Large differences indicate that the segmentation state of one or more partitions deviates from the other partitions, corresponding to local locations in the target region where segmentation defects exist. Based on the above comparison results, segmentation optimization information characterizing the overall quality of the current segmentation result and the location of defects is output. This embodiment elaborates on the specific calculation process of the mask difference index and its application in determining segmentation optimization information. By introducing three types of parameters—mean mask coverage, edge gradient value, and distance weighting factor—the mask distribution characteristics of each equal partition are comprehensively measured. This can integrate the mask distribution information that was originally scattered in multiple equal partitions into a unified quantitative index, and trigger different optimization instructions based on a preset range, thereby achieving automated quantitative evaluation of the overall quality of the segmentation results. See Figure 3 As shown, the step of determining the segmentation optimization information of the target region based on the differences in mask distribution information between the equal partitions provided in this embodiment includes: S43. Calculate the average mask coverage and edge gradient values ​​of each partition, and calculate the mask difference index between each partition. The statistical method for the average mask coverage Mᵢ is as follows: for all pixels in the i-th equal partition, the mask value of each pixel in the corresponding position in the initial segmentation mask is read one by one, and the mask values ​​of all pixels are arithmetically averaged to obtain Mᵢ. The value of Mᵢ ranges from 0 to 1. The closer the value is to 1, the higher the proportion of pixels in the equal partition that are judged to belong to the target object. The closer the value is to 0, the higher the proportion of pixels in the equal partition that are judged to belong to the background. Mᵢ reflects the overall tendency of the i-th equal partition in terms of target-background discrimination. The statistical method for the edge gradient value Gᵢ is as follows: For all pixels within the i-th equal partition, the partial derivatives of the initial segmentation mask in the horizontal and vertical directions are calculated using conventional image gradient calculation tools such as the Sobel operator or the Scharr operator, and the gradient magnitude of each pixel is synthesized according to the gradient magnitude formula. The gradient magnitudes of all pixels within the equal partition are then arithmetically averaged to obtain Gᵢ. Gᵢ reflects the degree of spatial variation of the mask value within the i-th equal partition. The larger the value, the more mask confidence transition positions exist within the equal partition, that is, the more target boundaries the equal partition spans. After obtaining the average mask coverage values ​​M1 to MN and the edge gradient values ​​G1 to GN for all equal partitions, the average mask coverage value M̄ and the average edge gradient value Ḡ for all equal partitions are further calculated, where M̄ is equal to the arithmetic mean of M1 to MN and Ḡ is equal to the arithmetic mean of G1 to GN. Then, a distance weighting factor ωᵢ is calculated for each equal partition, determined by the following formula: Wherein, dᵢ is the Euclidean distance between the geometric center of the i-th equal partition and the target reference point, and the target reference point can be the geometric center of the modified feature point set; dmax is the maximum Euclidean distance between the geometric centers of all equal partitions within the target region and the target reference point, and dmax is used to normalize the distance values ​​of each equal partition to between 0 and 1; β is the distance sensitivity coefficient, which can be selected between 0.1 and 1.0 according to the scale characteristics of the target object. The larger the value of β, the more significant the influence of distance on the weighting factor, and the greater the weight of equal partitions farther from the target reference point in subsequent difference calculations. The physical meaning of this distance weighting factor is that the edge part of the target object is usually far from the target reference point, and the edge part is more prone to segmentation defects than the interior. By introducing a weighting mechanism positively correlated with distance, equal partitions located at the target edge can receive higher attention in difference calculations. After obtaining Mᵢ, Gᵢ, M̄, Ḡ, and ωᵢ, the mask difference index is determined by the following formula: Where ΔM is the mask difference index, Mᵢ is the average mask coverage of the i-th equal partition, M̄ is the average mask coverage of all equal partitions, Gᵢ is the edge gradient value of the i-th equal partition, Ḡ is the average edge gradient value of all equal partitions, dᵢ is the distance from the center of the i-th equal partition to the target reference point, dmax is the maximum reference distance of the target, ωᵢ is the distance weighting factor of the i-th equal partition, α is the gradient sensitivity coefficient, which can be selected between 0.5 and 2.0 according to the clarity of the target object's edge. The larger the value of α, the more significant the impact of edge gradient difference on the mask difference index, and N is the number of equal partitions. The physical meaning of the mask difference index is as follows: The first term (Mᵢ − M̄)² within the parentheses reflects the degree of deviation between the mask coverage of the i-th equal partition and the average level of all equal partitions. If Mᵢ of a certain equal partition is significantly higher or lower than M̄, it indicates that the equal partition has been over-segmented or under-segmented relative to other equal partitions. The second term α(Gᵢ − Ḡ)² within the parentheses reflects the degree of deviation between the edge gradient intensity of the i-th equal partition and the average level of all equal partitions. If Gᵢ of a certain equal partition is significantly higher than Ḡ, it indicates that there is an abnormally dense mask transition within the equal partition, which may correspond to broken or jagged defects in the segmentation result. The sum of the two terms is amplified by the distance weighting factor ωᵢ and then averaged over all equal partitions to obtain the unified quantitative index ΔM that reflects the overall segmentation consistency of the target region. The smaller the value of ΔM, the more consistent the segmentation state of each equal partition and the more complete the segmentation of the target region. The larger the value of ΔM, the more significant the segmentation state deviation between each equal partition and the higher the possibility of segmentation defects in the target region. S44. If the mask difference index is within a preset range, the segmentation optimization information indicates that the target region is completely segmented, and an instruction to retain the segmentation result is generated. The preset range can be set according to the segmentation accuracy requirements in the actual application scenario. For example, in a high-precision matting scenario, the preset range can be set between 0 and 0.05, while in a regular matting scenario, the preset range can be set between 0 and 0.1. When the calculated ΔM falls within the preset range, it indicates that the distribution characteristics of each partition are highly consistent in both mask coverage and edge gradient dimensions, and the target region does not have obvious local defects. The current segmentation mask can be output as the final result, generating the instruction to retain the segmentation result to trigger the subsequent segmentation result retention and matting output process. S45. If the mask difference index is not within the preset range, the segmentation optimization information indicates that the target region segmentation has defects, and a local correction instruction is generated. When the calculated ΔM exceeds the preset range, it indicates that at least one equal partition deviates from the average level of all equal partitions in terms of mask coverage or edge gradient, and the target area has a segmentation defect. At this time, the ΔM contribution of each equal partition is further traversed, that is, the value of ωᵢ[(Mᵢ − M̄)² + α(Gᵢ − Ḡ)²] is calculated one by one. The equal partitions whose contribution exceeds the preset threshold are marked as defective equal partitions, and the local correction instruction is generated. The local correction instruction carries the orientation information of the marked defective equal partitions as the input basis for subsequent mask adjustment processing for the defective equal partitions. This embodiment elaborates on the specific generation logic of the instructions to retain segmentation results and the instructions for local correction. By transforming the abstract segmentation optimization information into operation instructions for specific execution objects, the optimization results output by the method can be directly connected to the subsequent matting output or mask adjustment stage. Compared with only providing an abstract segmentation quality assessment, this is more conducive to applying the segmentation optimization effect to actual image editing applications. See Figure 3 As shown, the steps for generating instructions to preserve segmentation results or local correction instructions provided in this embodiment include: S46. When the segmentation optimization information indicates that the target region is completely segmented, a retained segmentation result instruction is generated to retain the current mask and output the matting result. When the mask difference index falls within a preset range and the segmentation optimization information indicates that the target region is completely segmented, the current initial segmentation mask is retained as the final segmentation result. The instruction to retain the segmentation result carries a "no correction needed" status flag and the index address of the current mask in the storage medium. After the instruction is triggered, the subsequent matting output module reads the final segmentation result according to the index address and performs channel compositing processing on the initial segmentation mask and the image to be segmented at the pixel level. For example, the initial segmentation mask is superimposed as a transparency channel on the red, green, and blue channels of the image to be segmented to output a PNG format matting result with a transparent background, or the initial segmentation mask is merged with a new background image specified by the user to output a composite image with background replacement completed, thereby completing the matting task and presenting the result to the user interface. S47. When the segmentation optimization information indicates that the target region segmentation has defects, a local correction instruction is generated to delete redundant regions or fill in missing regions for specific equal partitions. When the mask difference index exceeds a preset range and the segmentation optimization information indicates that the target region segmentation has defects, the defect type is further determined based on the relative magnitude between the average mask coverage of the defective partitions and the average mask coverage of all partitions: if the average mask coverage of the defective partitions is significantly higher than the average level, it indicates that too many pixels in the partitions are incorrectly identified as targets, and there is redundant background that has not been removed. In this case, the local correction instruction carries the operation type identifier of "delete redundant region" and the orientation information of the defective partition. After the instruction is triggered, The mask update module sets the mask values ​​of pixels within the defect-like partitions that are higher than the background discrimination threshold to zero, thus restoring them to the background. If the average mask coverage of the defect-like partitions is significantly lower than the average level, it indicates that too many pixels in these partitions are incorrectly identified as background, resulting in the omission of target areas. In this case, the local correction instruction carries an operation type identifier of "filling in missing areas" and the orientation information of the defect-like partition. After the instruction is triggered, the mask update module sets the mask values ​​of pixels within the defect-like partitions that are lower than the target discrimination threshold to one, thus filling them into the target area. The local correction instruction, through adaptive discrimination of defect types and targeted instruction generation, enables the correction process of the segmentation results to accurately focus on the actual local location of the defect, avoiding interference with correctly segmented areas. This embodiment focuses on the specific forms of interactive prompts and the corresponding feature point set determination methods. By supporting three common interactive prompt types—click, selection box, and smearing—and employing differentiated feature point set extraction strategies for each type, it can cover the diverse operating habits of users in different image cutout scenarios, thereby improving the compatibility and adaptability of the method to various interactive prompts. See Figure 1As shown, the step of obtaining the feature point set of the target edge region in the initial segmentation mask based on the preset interactive prompt recognition method provided in this embodiment further includes: S24. When the interactive prompt is a click prompt, the pixel points within a preset radius are obtained as a feature point set, with the click position as the center. The click prompt refers to a single-point indication signal applied by the user to the image to be segmented by clicking the mouse or tapping with their finger. During this step, the coordinates of the click location in the image coordinate system are recorded. A circular neighborhood is defined on the initial segmentation mask with this coordinate as the center and a preset radius as the radius. The preset radius can be selected between 5 and 20 pixels depending on the image resolution. All pixels within this circular neighborhood that fall within the target edge region are used as the feature point set. S25. When the interactive prompt is a box selection prompt, the intersection of the boundary of the box selection area and the edge area of ​​the target is used as the feature point set. The bounding box prompt refers to the rectangular box indicator signal drawn by the user on the image to be segmented by dragging the mouse or using their finger. The boundary of the rectangular box includes four line segments: top, bottom, left, and right. During this step, the intersection of the rectangular box boundary and the target edge region at the pixel level is calculated line by line, and the pixels at all intersection locations are merged as the feature point set. S26. When the interactive prompt is a smearing prompt, the pixels covered by the smearing trajectory are used as the feature point set. The smearing prompt refers to the continuous trajectory indication signal formed by the user dragging the mouse or continuously sliding their finger on the image to be segmented. During this step, the coordinate values ​​of all pixels traversed by the smearing trajectory in the image coordinate system are recorded, and these pixels are used as the feature point set. This embodiment focuses on the iterative optimization process after the local correction instruction is generated. By updating the initial segmentation mask and re-inputting the updated mask into the feature point set recognition process, a closed-loop iterative mechanism of "recognition-correction-evaluation-update" is constructed. This allows the segmentation result to continuously approach the user's expected target contour in multiple iterations, ensuring that the final output segmentation result meets the preset accuracy requirements in terms of mask difference index. Compared with a single correction, it can more thoroughly eliminate local defects in the one-click segmentation result. See Figure 3 As shown, after generating the local correction instruction, the method provided in this embodiment further includes the following steps: S48. Update the initial segmentation mask according to the local correction instruction to obtain the updated segmentation mask. Based on the operation type identifier and defect location information carried in the local correction instruction, the local area that needs to be adjusted in the initial segmentation mask is located. The corresponding mask value adjustment operation is performed in the local area, including zeroing the mask of redundant background pixels or setting the mask of missing target pixels to one. After the adjustment, the mask presents a boundary shape that is more in line with the real contour of the target in the defect and other partitions. The adjusted overall mask is output as the updated segmentation mask. S49. Use the updated segmentation mask as the initial segmentation mask again, and repeat the step of obtaining the feature point set of the target edge region in the initial segmentation mask based on the preset interactive prompt recognition method until the mask difference index is within the preset range, and output the final target segmentation result. The updated segmentation mask is backfilled into the data position of the initial segmentation mask, triggering a new round of feature point set recognition, corrected feature point set acquisition, partition comparison, and mask difference index calculation. The mask difference index calculated in the new round is compared with the preset range. If it still exceeds the preset range, a local correction instruction is generated again and the mask is updated. If it has fallen into the preset range, the iteration is terminated and the current segmentation mask is output as the final target segmentation result. At the same time, a maximum iteration number threshold can be set to prevent infinite loops in abnormal situations. The above description is merely an exemplary embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural transformations made using the contents of the present invention specification and drawings under the technical concept of the present invention, or direct / indirect applications in other related technical fields, are included within the patent protection scope of the present invention.

Claims

1. An image target segmentation optimization method based on interactive prompts, characterized in that, The image target segmentation optimization method based on interactive prompts includes the following steps: Obtain the image to be segmented and generate an initial segmentation mask corresponding to the image to be segmented; Based on the preset interactive prompt recognition method, the feature point set of the target edge region in the initial segmentation mask is obtained; The distribution information of the feature point set to the stable segmentation region in the initial segmentation mask is obtained, and the feature point set is corrected according to the distribution information to obtain the corrected feature point set; Based on the modified feature point set, the target region in the image to be segmented is partitioned and compared to obtain the segmentation optimization information of the target region.

2. The image target segmentation optimization method based on interactive prompts according to claim 1, characterized in that, The step of obtaining the distribution information of the feature point set to the stable segmentation region in the initial segmentation mask includes: Starting from the center of the feature point set, a first detection path is constructed along the confidence gradient direction of the initial segmentation mask, and a second detection path is constructed along the normal direction of the confidence gradient. The first detection path intersects the target edge region at a first boundary point and a second boundary point, and the second detection path intersects the target edge region at a third boundary point and a fourth boundary point. The pixel distances and mask confidence differences between the center of the feature point set and the first boundary point, the second boundary point, the third boundary point, and the fourth boundary point are used as distribution information.

3. The image target segmentation optimization method based on interactive prompts according to claim 2, characterized in that, The step of correcting the feature point set based on the distribution information to obtain the corrected feature point set includes: Along the first detection path direction, based on the first pixel distance between the center of the feature point set and the first boundary point and the difference in mask confidence, and the second pixel distance between the center of the feature point set and the second boundary point and the difference in mask confidence, the center of the feature point set is shifted to the side with higher mask confidence until the center of the feature point set is located at a position with equal confidence between the first boundary point and the second boundary point, so as to determine the intermediate feature point set; Along the second detection path direction, based on the third pixel distance between the intermediate feature point set and the third boundary point and the mask confidence difference, and the fourth pixel distance between the intermediate feature point set and the fourth boundary point and the mask confidence difference, the intermediate feature point set is shifted to the side with higher mask confidence until the intermediate feature point set is located at a confidence level equivalent position between the third boundary point and the fourth boundary point, so as to determine the corrected feature point set.

4. The image target segmentation optimization method based on interactive prompts according to claim 1, characterized in that, The steps of acquiring the image to be segmented and generating the initial segmentation mask corresponding to the image to be segmented include: Acquire the image to be segmented and perform scale normalization on the image to be segmented; The image to be segmented after scale normalization is extracted using a preset image encoder to obtain an image feature map. The interactive prompts applied to the image to be segmented are obtained, and the interactive prompts are encoded by a preset prompt encoder to obtain a prompt embedding vector; The image feature map and the cue embedding vector are input into a preset mask decoder to output the initial segmentation mask corresponding to the image to be segmented.

5. The image target segmentation optimization method based on interactive prompts according to claim 1, characterized in that, The step of obtaining the feature point set of the target edge region in the initial segmentation mask based on the preset interactive prompt recognition method includes: The initial segmentation mask is analyzed based on a preset interactive prompt recognition method; When a set of feature points in the target edge region of the initial segmentation mask is identified, the set of feature points is used as the initial feature point set, and the following steps are performed: obtaining the distribution information of the feature point set to the stable segmentation region in the initial segmentation mask; If the feature point set of the target edge region in the initial segmentation mask cannot be identified, the corresponding prompt message will be output.

6. The image target segmentation optimization method based on interactive prompts according to any one of claims 1 to 5, characterized in that, The step of partitioning and comparing the target region in the image to be segmented based on the modified feature point set to obtain segmentation optimization information of the target region includes: Centered on the modified feature point set, the target region in the image to be segmented is divided into a preset number of equal partitions; Obtain the mask distribution information of the equal partitions, and determine the segmentation optimization information of the target region based on the differences in the mask distribution information between the equal partitions.

7. The image target segmentation optimization method based on interactive prompts according to claim 6, characterized in that, The mask distribution information includes the average mask coverage and edge gradient values. The step of obtaining the mask distribution information of the equal partitions and determining the segmentation optimization information of the target region based on the differences in the mask distribution information between the equal partitions includes: statistically analyzing the average mask coverage and edge gradient values ​​of each equal partition, and calculating the mask difference index between each equal partition. The mask difference index is determined by the following formula: Where ΔM is the mask difference index, Mᵢ is the average mask coverage of the i-th equal partition, M̄ is the average mask coverage of all equal partitions, Gᵢ is the edge gradient value of the i-th equal partition, Ḡ is the average edge gradient value of all equal partitions, dᵢ is the distance from the center of the i-th equal partition to the target reference point, dmax is the maximum reference distance of the target, ωᵢ is the distance weighting factor of the i-th equal partition, α and β are weighting coefficients, and N is the number of equal partitions; If the mask difference index is within a preset range, the segmentation optimization information indicates that the target region is completely segmented, and an instruction to retain the segmentation result is generated. If the mask difference index is not within the preset range, the segmentation optimization information indicates that the target region segmentation has defects, and a local correction instruction is generated.

8. The image target segmentation optimization method based on interactive prompts according to claim 7, characterized in that, The step of generating the instruction to preserve the segmentation result or the local correction instruction includes: When the segmentation optimization information indicates that the target region is completely segmented, a command to retain the segmentation result is generated, which preserves the current mask and outputs the matting result. When the segmentation optimization information indicates that the target region segmentation has defects, a local correction instruction is generated to delete redundant regions or fill in missing regions for specific equal partitions.

9. The image target segmentation optimization method based on interactive prompts according to claim 1, characterized in that, The interactive prompts include at least one of click prompts, selection prompts, and smearing prompts. The step of obtaining the feature point set of the target edge region in the initial segmentation mask based on the preset interactive prompt recognition method further includes: When the interactive prompt is a click prompt, the pixels within a preset radius are used as the feature point set, with the click location as the center. When the interactive prompt is a box selection prompt, the intersection of the boundary of the box selection area and the edge area of ​​the target is used as the feature point set; When the interactive prompt is a smear prompt, the pixels covered by the smear trajectory are used as the feature point set.

10. The image target segmentation optimization method based on interactive prompts according to claim 8, characterized in that, After generating the local correction instructions, the method further includes: The initial segmentation mask is updated according to the local correction instruction to obtain the updated segmentation mask; The updated segmentation mask is used again as the initial segmentation mask, and the step of obtaining the feature point set of the target edge region in the initial segmentation mask based on the preset interactive prompt recognition method is repeated until the mask difference index is within the preset range, and the final target segmentation result is output.