Image segmentation method and device, electronic equipment and storage medium
The image segmentation method that combines preset channel thresholds and text prompt information solves the problems of dependence on annotation data and high consumption of computing resources in the existing technology, achieves fast and accurate image segmentation in complex environments such as substations, and improves equipment Detection efficiency and accuracy.
Patent Information
- Application Number
- CN202410699821.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-05-31
AI Technical Summary
Existing image segmentation technology requires a large amount of annotated data and computing resources, has poor adaptability, and is difficult to quickly and accurately detect problems such as equipment rust and cracks in complex environments such as substations.
By obtaining the image data to be segmented, initial segmentation is performed based on the preset channel threshold data, the prompt point information is determined and input into the preset image segmentation model, combined with the preset text prompt information, the similarity data is calculated to determine the target image segmentation result, reducing confusion. Annotate data dependencies and improve the speed and accuracy of image segmentation.
It achieves rapid and accurate identification of target segmentation areas in images in complex environments, reduces the demand for computing resources, improves the applicability and efficiency of image segmentation, and avoids mis-segmentation problems.
Smart Images

Figure CN118570231A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an image segmentation method, device, electronic equipment and storage medium. Background Art
[0002] Substations are a key part of the power system, and their safe and stable operation is crucial to ensuring the overall efficiency of the power grid. After long-term use, equipment in substations will have problems such as rust and cracks. Equipment corrosion will greatly reduce the insulation performance of the equipment, which will cause greater hidden dangers of failure to the normal operation of the equipment. Cracks in the equipment will also cause safety hazards.
[0003] The traditional inspection method for substation equipment is manual inspection. As the number of substations increases, the traditional method is inefficient. Equipment inspection through image processing methods can segment problematic areas to improve inspection efficiency. However, the traditional image processing method has the problem of inaccurate segmentation results. Image segmentation through neural network models such as U-Net, SegNet, and DeepLab requires a large amount of labeled data for model training. If the segmented object changes, the model needs to be retrained, which has the problems of high computing resource consumption and poor adaptability. Summary of the invention
[0004] The present invention provides an image segmentation method, device, electronic device and storage medium to solve the problems existing in the existing image segmentation technology, such as the need for a large amount of standard data, large consumption of computing resources and poor adaptability.
[0005] According to one aspect of the present invention, there is provided an image segmentation method, comprising:
[0006] Acquire image data to be segmented, and perform segmentation processing on the image data to be segmented based on preset channel threshold data to obtain an initial segmentation result, wherein the initial segmentation result includes at least one initial segmentation area;
[0007] Determine the cue point information corresponding to each initial segmentation area, input the cue point information and the image data to be segmented into a preset image segmentation model for processing, and obtain a first image segmentation result of the image data to be segmented, wherein the first image segmentation result is used to characterize the target segmentation area in the image data to be segmented;
[0008] Obtaining preset text prompt information, inputting the preset text prompt information and the image data to be segmented into a preset image segmentation model for processing, and obtaining a second image segmentation result of the image data to be segmented, wherein the preset text prompt information is prompt information of the object to which the target segmentation area belongs, and the second image segmentation result is used to characterize the segmentation area where the object to which the target segmentation area belongs in the image data to be segmented is located;
[0009] Similarity data between the first image segmentation result and the second image segmentation result is determined, and a target image segmentation result of the image data to be segmented is determined based on the similarity data.
[0010] Optionally, the preset channel threshold data is preset hue threshold data; segmentation processing is performed on the image data to be segmented based on the preset channel threshold data to obtain an initial segmentation result, including: performing color space conversion processing on the image data to be segmented to obtain image data in a preset color space, the image data in the preset color space includes hue channel data; comparing the hue channel data of the image data to be segmented with the preset hue threshold data, segmenting out the area that meets the preset hue threshold data, and obtaining an initial segmentation result.
[0011] Optionally, before determining the cue point information corresponding to each initial segmentation area, the method includes: performing image preprocessing on the initial segmentation result to obtain a processed initial segmentation result, wherein the image preprocessing includes morphological processing and filtering processing, and the initial segmentation result includes at least one connected domain.
[0012] Optionally, the cue point information and the image data to be segmented are input into a preset image segmentation model for processing to obtain a first image segmentation result of the image data to be segmented, including: traversing each initial segmentation area, inputting the cue point information and the image data to be segmented of each initial segmentation area into a preset image segmentation model for processing, and obtaining a first sub-segmentation result corresponding to each initial segmentation area, and each first sub-segmentation result forms a first image segmentation result.
[0013] Optionally, similarity data between the first image segmentation result and the second image segmentation result is determined, and a target image segmentation result of the image data to be segmented is determined based on the similarity data, including: determining the similarity data between the first image segmentation result and the second image segmentation result; comparing the similarity data with a preset similarity threshold, and if the similarity data is less than the preset similarity threshold, taking the first image segmentation result as the target image segmentation result.
[0014] Optionally, the first image segmentation result includes a first sub-segmentation result corresponding to at least one target segmentation area, and the second image segmentation result includes a second sub-segmentation result corresponding to at least one segmentation area where the object is located; determining the similarity data of the first image segmentation result and the second image segmentation result includes: traversing the first image segmentation result and the second image segmentation result, and determining the similarity data of any first sub-segmentation result and any second sub-segmentation result.
[0015] Optionally, determining similarity data between the first image segmentation result and the second image segmentation result, and determining a target image segmentation result of the image data to be segmented based on the similarity data, further includes: if any similarity data is greater than or equal to a preset similarity threshold, determining a target segmentation area corresponding to the similarity data greater than or equal to the preset similarity threshold, adjusting the prompt point information of the initial segmentation result corresponding to the target segmentation area, and returning to execute the step of inputting the prompt point information and the image data to be segmented into a preset image segmentation model for processing based on the adjusted prompt point information to obtain the first image segmentation result of the image data to be segmented, so as to obtain the target image segmentation result.
[0016] According to another aspect of the present invention, there is provided an image segmentation device, comprising:
[0017] An initial segmentation result determination module is used to obtain image data to be segmented, and perform segmentation processing on the image data to be segmented based on preset channel threshold data to obtain an initial segmentation result, wherein the initial segmentation result includes at least one initial segmentation area;
[0018] A first image segmentation result determination module is used to determine the cue point information corresponding to each initial segmentation area, input the cue point information and the image data to be segmented into a preset image segmentation model for processing, and obtain a first image segmentation result of the image data to be segmented, and the first image segmentation result is used to characterize the target segmentation area in the image data to be segmented;
[0019] A second image segmentation result determination module is used to obtain preset text prompt information, input the preset text prompt information and the image data to be segmented into a preset image segmentation model for processing, and obtain a second image segmentation result of the image data to be segmented, wherein the preset text prompt information is prompt information of the object to which the target segmentation area belongs, and the second image segmentation result is used to characterize the segmentation area where the object to which the target segmentation area belongs in the image data to be segmented is located;
[0020] The target image segmentation result determination module is used to determine similarity data between the first image segmentation result and the second image segmentation result, and determine the target image segmentation result of the image data to be segmented based on the similarity data.
[0021] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0022] at least one processor; and
[0023] a memory communicatively connected to at least one processor; wherein,
[0024] The memory stores a computer program that can be executed by at least one processor. The computer program is executed by at least one processor so that the at least one processor can execute the image segmentation method of any embodiment of the present invention.
[0025] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the image segmentation method of any embodiment of the present invention when executed.
[0026] The technical solution of the embodiment of the present invention obtains image data to be segmented, performs segmentation processing on the image data to be segmented based on preset channel threshold data, and obtains an initial segmentation result, wherein the initial segmentation result includes at least one initial segmentation area; determines prompt point information corresponding to each initial segmentation area, inputs the prompt point information and the image data to be segmented into a preset image segmentation model for processing, and obtains a first image segmentation result of the image data to be segmented, and the first image segmentation result is used to characterize the target segmentation area in the image data to be segmented; obtains preset text prompt information, inputs the preset text prompt information and the image data to be segmented into a preset image segmentation model for processing, and obtains a second image segmentation result of the image data to be segmented. , wherein the preset text prompt information is the prompt information of the object to which the target segmentation area belongs, and the second image segmentation result is used to characterize the segmentation area where the object to which the target segmentation area belongs in the image data to be segmented is located; the similarity data of the first image segmentation result and the second image segmentation result are determined, and the target image segmentation result of the image data to be segmented is determined based on the similarity data, which solves the problem that a large amount of labeled data is required to determine the segmentation of the image data, reduces the dependence on a large amount of labeled data, does not require additional model training, adopts a prompt strategy to enhance the image segmentation model's recognition ability for images in complex environments, and improves the speed, accuracy and applicability of the segmentation processing of the target segmentation area in the image data to be segmented.
[0027] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0029] Figure 1 is a flow chart of an image segmentation method provided by Embodiment 1 of the present invention;
[0030] Figure 2 is a flow chart of an image segmentation method provided by Embodiment 2 of the present invention;
[0031] Figure 3 is a structural schematic diagram of an image segmentation device provided by Embodiment 3 of the present invention;
[0032] Figure 4 It is a schematic diagram of the structure of an electronic device for implementing the image segmentation method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0033] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0035] Embodiment 1
[0036] Figure 1 1 is a flowchart of an image segmentation method provided by the first embodiment of the present invention. This embodiment is applicable to the case of image segmentation. The method can be executed by an image segmentation device. The image segmentation device can be implemented in the form of hardware and / or software. The image segmentation device can be configured in electronic devices such as servers and computers. Figure 1 As shown, the method includes:
[0037] S110, obtaining image data to be segmented, and performing segmentation processing on the image data to be segmented based on preset channel threshold data to obtain an initial segmentation result, wherein the initial segmentation result includes at least one initial segmentation area.
[0038] Among them, the image data to be segmented can be specifically understood as image data that needs to be processed by image segmentation. The image data to be segmented can be acquired by timed acquisition or real-time acquisition through an image acquisition device, and the acquisition method can be set according to the actual needs of image segmentation. It should be noted that image acquisition devices can be installed in all scenes that need to be detected, and the collected image data is used as image data to be segmented. For example, in a substation scene, an image acquisition device can be installed in an environment that needs to be detected to collect image data, wherein the image data includes at least one object to be detected, and the detected object can be an instrument. For example, whether the appearance of the instrument is intact, whether there are signs of rust on the instrument, etc. The preset channel threshold data can be specifically understood as data set for coarse segmentation of the image data to be segmented, and the region of interest in the image data to be segmented is first roughly segmented, specifically referring to the color channel data in the color space. Exemplarily, for the HSV color space, the preset channel threshold data may be the threshold data corresponding to one of the hue channel, saturation channel, and brightness channel. The preset channel threshold data is selected and set according to actual needs. It should be noted that the preset channel threshold data in different color spaces are different. For determining a reasonable color space of the image data to be segmented, it can be determined according to the characteristics of the target segmentation area in the image data, and the characteristics may include color characteristics, material properties, and shape characteristics. Exemplarily, for the rusted area on the equipment as the target segmentation area, the corresponding channel threshold range can be determined according to the material properties of the equipment and the color characteristics of the rust of the corresponding material, and the corresponding preset channel threshold data can be obtained, which is used to roughly segment the rusted area in the image, that is, roughly segment the rusted area that meets the preset channel threshold data. The preset channel threshold data of different target segmentation areas can be set and stored in advance, and when needed, the corresponding preset channel threshold data can be matched according to the target segmentation task, wherein the target segmentation task may include the feature data corresponding to the target segmentation area.
[0039] Specifically, the image data is collected in real time by an image acquisition device in the scene to be detected, and the collected image data is used as the image data to be segmented. According to the image segmentation requirements, the preset channel threshold data corresponding to the image data to be segmented is matched from the preset storage space, wherein the image segmentation requirements include the feature data of the target segmentation area in the image data to be segmented. The channel data that matches the preset channel threshold data of the image data to be segmented is identified, and then the channel data of the image data to be segmented is compared with the preset channel threshold data, and the area corresponding to the number of channels that meets the preset channel threshold data is segmented to obtain an initial segmentation result. It should be noted that if the color space corresponding to the image data to be segmented is different from the color space corresponding to the preset channel threshold data, it is necessary to convert the color space corresponding to the image data to be segmented into the color space corresponding to the preset channel threshold data to ensure the accuracy of the comparison result between the channel data of the image data to be segmented and the preset channel threshold data.
[0040] In this embodiment, the image data to be segmented is segmented by preset channel threshold data to obtain an initial segmentation result, thereby achieving a rough segmentation of the image data to be segmented in advance and determining the position of the region of interest in the image data to be segmented, which facilitates the subsequent rapid positioning of the target segmentation area for accurate image segmentation, thereby improving the speed of image segmentation.
[0041] Optionally, the preset channel threshold data is preset hue threshold data; segmentation processing is performed on the image data to be segmented based on the preset channel threshold data to obtain an initial segmentation result, including: performing color space conversion processing on the image data to be segmented to obtain image data in a preset color space, the image data in the preset color space includes hue channel data; comparing the hue channel data of the image data to be segmented with the preset hue threshold data, segmenting out the area that meets the preset hue threshold data, and obtaining an initial segmentation result.
[0042] Among them, the color channel data corresponding to the image data to be segmented in different color spaces are different. Usually, the color space corresponding to the image data to be segmented is the RGB color space, which is obtained by changing the three color channels of red (R), green (G), and blue (B) and superimposing them with each other to obtain various colors. RGB represents the colors of the three channels of red, green, and blue, and the display of hue characteristics is not obvious. The HSV color space can intuitively express the brightness, hue, and vividness of colors. H stands for hue, which indicates the category of color. The value range is 0° to 360°, which is used to distinguish different colors. Red corresponds to 0°, green corresponds to 120°, and blue corresponds to 240°; S stands for saturation, which indicates the vividness of the color, also known as purity. The value range of saturation is 0% to 100%, the saturation of pure color is 100%, and the saturation of gray is 0%; V stands for value, which indicates the brightness of the color. When the brightness is 0%, it is black; when the brightness is 100%, it is white; when it is between 0% and 100%, it represents the brightness and darkness of different colors. The HSV color space is convenient for contrasting colors, especially the hue channel has significant features, which can be used to quickly determine the area of interest in the image data to be segmented, by setting the data range corresponding to the hue channel data of the area of interest as the preset channel threshold data.
[0043] Specifically, in the case where the preset channel threshold data is the preset hue threshold data, the image data to be segmented is subjected to color space conversion processing, and the RGB color space of the image data to be segmented is converted into the HSV color space to obtain the hue channel data corresponding to the image data to be segmented, and the hue channel data corresponding to the image data to be segmented is compared with the preset channel threshold data, and the image area corresponding to the hue channel data that meets the preset channel threshold data is segmented to obtain an initial segmentation result.
[0044] In this embodiment, the hue channel feature in the HSV color space is used to perform a rough segmentation process on the image data to be segmented according to the hue channel data to obtain an initial image segmentation result. This allows for further precise segmentation to be performed quickly on the basis of the rough segmentation result, thereby improving the segmentation speed of the image segmentation. It should be noted that the preset channel threshold data can be set according to the actual segmentation requirements to improve the adaptability of image segmentation.
[0045] S120, determining the cue point information corresponding to each initial segmentation area, inputting the cue point information and the image data to be segmented into a preset image segmentation model for processing, and obtaining a first image segmentation result of the image data to be segmented, wherein the first image segmentation result is used to characterize the target segmentation area in the image data to be segmented.
[0046] Among them, the prompt point information can be specifically understood as multiple pixel point information selected from the initial segmentation area, wherein the prompt point information includes the number of prompt points and prompt point position data, the number of prompt points can be set according to actual needs, preferably, the number of prompt points is set to 5, and the prompt point position data specifically refers to pixel-level position data. The preset image segmentation model can be specifically understood as a neural network model. Preferably, the preset image segmentation model adopts a SAM model. The SAM model can guide the model to perform image processing through the prompt point information to obtain an image segmentation result, which helps to improve the accuracy and efficiency of image segmentation. The target segmentation area can be specifically understood as the area of interest in the image data to be segmented.
[0047] Specifically, a preset number of cue points are selected in each initial segmentation area by random selection, and position data corresponding to each selected cue point is obtained to obtain cue point information corresponding to each initial segmentation area. The cue point information corresponding to each initial segmentation area and the image data to be segmented are input into a preset image segmentation model as a set of input parameters. The preset image segmentation model processes each set of input parameters, and segments the image data to be segmented according to the cue point information to obtain a first image segmentation result of the image data to be segmented.
[0048] In this embodiment, the prompt information of the coarse segmentation result obtained by the image threshold segmentation method is input into the preset image segmentation model together with the image data to be segmented. The prompt point information guides the model to process the image data to be segmented, so that the segmentation result matching the prompt point information can be quickly obtained, thereby improving the speed and accuracy of image segmentation.
[0049] Optionally, the cue point information and the image data to be segmented are input into a preset image segmentation model for processing to obtain a first image segmentation result of the image data to be segmented, including: traversing each initial segmentation area, inputting the cue point information and the image data to be segmented of each initial segmentation area into a preset image segmentation model for processing, and obtaining a first sub-segmentation result corresponding to each initial segmentation area, and each first sub-segmentation result forms a first image segmentation result.
[0050] Specifically, each initial segmentation area is traversed, and each initial segmentation area and the image data to be segmented are taken as a set of input parameters, and are input one by one into the preset image segmentation model. The preset image segmentation model processes each set of input parameters to obtain the segmentation result corresponding to each set of input parameters, that is, the first sub-segmentation result corresponding to each initial segmentation area is obtained, and the set consisting of the first sub-segmentation results corresponding to all the initial segmentation areas is taken as the first image segmentation result.
[0051] Optionally, before determining the cue point information corresponding to each initial segmentation area, the method includes: performing image preprocessing on the initial segmentation result to obtain a processed initial segmentation result, wherein the image preprocessing includes morphological processing and filtering processing, and the initial segmentation result includes at least one connected domain.
[0052] Among them, image preprocessing specifically refers to preprocessing the image according to a preset image preprocessing method, which is used to remove the false detection area in the image to improve the accuracy of the subsequent image segmentation results. Among them, image preprocessing includes morphological processing and filtering processing. Morphological processing refers to erosion-dilation processing of the image; filtering processing refers to filtering the non-interesting areas in the image. The image annotation method can be used to identify and annotate the area of interest in the image to obtain the size and aspect ratio characteristics of the area of interest, and filtering processing is performed according to the annotated size and aspect ratio characteristics.
[0053] Specifically, each initial segmentation area in the initial segmentation result is corroded to remove small noise points, and then adjacent areas with a distance less than a preset distance threshold are connected by dilation processing to form a continuous area, that is, the corresponding connected domain is obtained. In this way, each connected domain in the initial segmentation result is obtained by corrosion and dilation processing. The initial segmentation result includes at least one connected domain. It should be noted that if there is no connected domain in the initial segmentation result, no subsequent processing is required, and the segmentation result can be directly output. After obtaining each connected domain in the initial segmentation result, the image annotation algorithm is called to identify and annotate each connected domain in the initial segmentation result to obtain the size and aspect ratio features of each connected domain, and it is determined whether the size and aspect ratio features of each connected domain meet the corresponding preset size threshold and the corresponding aspect ratio threshold. If the size of any connected domain does not meet the corresponding preset size threshold or the aspect ratio feature of any connected domain does not meet the corresponding aspect ratio threshold, the connected domain is deleted.
[0054] In this embodiment, the initial segmentation results are processed through morphological processing and filtering processing, the false detection areas, small shadow areas and highlight points in the initial segmentation results are deleted, and the areas that do not need to be paid attention to are deleted, thereby reducing the amount of data processing and improving the speed and accuracy of image segmentation.
[0055] S130, obtaining preset text prompt information, inputting the preset text prompt information and the image data to be segmented into a preset image segmentation model for processing, and obtaining a second image segmentation result of the image data to be segmented, wherein the preset text prompt information is prompt information of the object to which the target segmentation area belongs, and the second image segmentation result is used to characterize the segmentation area where the object to which the target segmentation area in the image data to be segmented belongs is located.
[0056] Among them, the preset text prompt information can be specifically understood as information characterizing the object to be segmented in the image data. The preset text prompt information can be configured in the configuration information in advance. When the preset text prompt information needs to be obtained, the preset text prompt information matching the segmented object can be read from the configuration information. In this embodiment, the preset text prompt information is the prompt information of the object to which the target segmentation area belongs. Exemplarily, in a substation, the instruments and equipment in the image data of the substation are specified to be segmented, and the preset text prompt information can be set to "Substation Related Equipment", or, to specify that only the transformer in the image data of the substation is segmented, the preset text prompt information can be set to "Transformer of the substation", and the preset text prompt information can be preset according to actual needs. Exemplarily, the target segmentation requirement is to segment the rusted area on the equipment in the substation, and the rusted area is used as the target segmentation area. The equipment corresponding to the segmented target segmentation area is the segmentation area where the object to which the target segmentation area belongs is located.
[0057] Specifically, the preset text prompt information can be obtained from the configuration information, the preset image segmentation model can be called, the preset text prompt information and the image data to be segmented can be input into the preset image segmentation model, and the preset image segmentation model can perform segmentation processing on the image data to be segmented according to the preset text prompt information, and the device area in the image data to be segmented can be segmented to obtain a second image segmentation result of the image data to be segmented.
[0058] On the basis of the above embodiment, the image data to be segmented is segmented according to the preset text prompt information through the preset image segmentation model, and the second image segmentation result of the image data to be segmented is obtained, wherein the second image segmentation result is used to characterize the segmentation area where the target segmentation area in the image data to be segmented belongs to which the object is located. The preset image segmentation model can not only separate the segmentation area where the object is located, but also generate a corresponding mask image. For example, if the object is an instrument, then a mask image of the equipment area is generated, that is, an equipment segmentation map. When the segmentation result is determined, a corresponding number is set for each segmented equipment area. The corresponding number set for each equipment area in the same image to be segmented is unique, which can be used to determine the equipment number to which each segmentation area in the first image segmentation result belongs, that is, not only the target segmentation area segmented in the image data to be segmented can be known, but also the object number to which the target segmentation area belongs can be known. For example, if the equipment is detected to see if there is a rusted area, the equipment number corresponding to the rusted area can be determined according to the image segmentation result, which has a high reference value for quickly locating equipment with a risk of failure.
[0059] In this embodiment, the preset image segmentation model is guided to perform image segmentation according to the preset text prompt information to obtain a second image segmentation result, and the object belonging to the target segmentation area is segmented out for subsequent verification of the accuracy of the target segmentation area to ensure the accuracy of the target segmentation area.
[0060] S140 , determining similarity data between the first image segmentation result and the second image segmentation result, and determining a target image segmentation result of the image data to be segmented based on the similarity data.
[0061] The similarity data represents the similarity between the first image segmentation result and the second image segmentation result, and is used to verify the first image segmentation result. The similarity data can be calculated by an image similarity algorithm, which includes but is not limited to a Euclidean distance algorithm, a cosine similarity algorithm, and a Hausdorff distance algorithm.
[0062] Specifically, by calculating the similarity data of the first image segmentation result and the second image segmentation result through a preset similarity algorithm, each segmented area in the first image segmentation result can be merged into a group of image data, and the similarity data between the merged image data and the second image segmentation result can be calculated, or the similarity data between the segmented areas in the first image segmentation result and the second image segmentation result can be calculated separately, and the setting is made according to the actual situation. After determining the similarity data, the similarity data can be compared with the preset similarity threshold, and the target image segmentation result of the image data to be segmented can be determined according to the comparison result. Exemplarily, if the similarity data all meet the preset similarity threshold, the first image segmentation result can be used as the target image segmentation result.
[0063] Exemplarily, the segmented areas in the second image segmentation result are extracted, and the similarity data between the segmented areas in the second image segmentation result and each initial segmented area in the first image segmentation result are respectively calculated by the Hausdorff distance algorithm to determine whether the similarity data satisfies the preset distance threshold data. If both are not satisfied, it indicates that the similarity between the first image segmentation result and the second image segmentation result is low, which means that when performing image segmentation through the prompt point information, the target segmented area is not mistakenly segmented as the object area to which the target segmented area belongs, and the first image segmentation result can be used as the target segmentation result.
[0064] In this embodiment, the accuracy of the image segmentation result is verified by similarity data between the first image segmentation result and the second image segmentation result, thereby avoiding mis-segmentation of the target segmentation area as the object area to which the target segmentation area belongs when performing image segmentation through prompt point information, thereby improving the accuracy of the image segmentation result.
[0065] The technical solution of this embodiment is to obtain image data to be segmented, perform segmentation processing on the image data to be segmented based on preset channel threshold data, and obtain an initial segmentation result, wherein the initial segmentation result includes at least one initial segmentation area; determine the prompt point information corresponding to each initial segmentation area, input the prompt point information and the image data to be segmented into a preset image segmentation model for processing, and obtain a first image segmentation result of the image data to be segmented, and the first image segmentation result is used to characterize the target segmentation area in the image data to be segmented; obtain preset text prompt information, input the preset text prompt information and the image data to be segmented into a preset image segmentation model for processing, and obtain a second image segmentation result of the image data to be segmented. Among them, the preset text prompt information is the prompt information of the object to which the target segmentation area belongs, and the second image segmentation result is used to characterize the segmentation area where the object to which the target segmentation area in the image data to be segmented belongs is located; the similarity data of the first image segmentation result and the second image segmentation result are determined, and the target image segmentation result of the image data to be segmented is determined based on the similarity data, which solves the problem that a large amount of labeled data is needed to determine the segmentation of the image data, reduces the dependence on a large amount of labeled data, does not require additional model training, and adopts a prompt strategy to enhance the image segmentation model's recognition ability for images in complex environments, thereby improving the speed, accuracy and applicability of the segmentation processing of the target segmentation area in the image data to be segmented.
[0066] Embodiment 2
[0067] Figure 2 It is a flowchart of an image segmentation method provided in the second embodiment of the present invention. This embodiment is a further optimization of the method of the above embodiment. Optionally, the similarity data is compared with a preset similarity threshold. If the similarity data is less than the preset similarity threshold, the first image segmentation result is used as the target image segmentation result; if any similarity data is greater than or equal to the preset similarity threshold, the target segmentation area corresponding to the similarity data greater than or equal to the preset similarity threshold is determined, and the prompt point information of the initial segmentation result corresponding to the target segmentation area is adjusted. Based on the adjusted prompt point information, the prompt point information and the image data to be segmented are input into the preset image segmentation model for processing to obtain the step of obtaining the first image segmentation result of the image data to be segmented, so as to obtain the target image segmentation result. Figure 2 As shown, the method includes:
[0068] S210, obtaining image data to be segmented, and performing segmentation processing on the image data to be segmented based on preset channel threshold data to obtain an initial segmentation result, wherein the initial segmentation result includes at least one initial segmentation area.
[0069] S220, determining the cue point information corresponding to each initial segmentation area, inputting the cue point information and the image data to be segmented into a preset image segmentation model for processing, and obtaining a first image segmentation result of the image data to be segmented, wherein the first image segmentation result is used to characterize the target segmentation area in the image data to be segmented.
[0070] S230, obtaining preset text prompt information, inputting the preset text prompt information and the image data to be segmented into a preset image segmentation model for processing, and obtaining a second image segmentation result of the image data to be segmented, wherein the preset text prompt information is prompt information of the object to which the target segmentation area belongs, and the second image segmentation result is used to characterize the segmentation area where the object to which the target segmentation area in the image data to be segmented belongs is located.
[0071] S240: Determine similarity data between the first image segmentation result and the second image segmentation result.
[0072] S250: Compare the similarity data with a preset similarity threshold. If the similarity data is less than the preset similarity threshold, use the first image segmentation result as the target image segmentation result.
[0073] The preset similarity threshold is set to determine the target image segmentation result, and specifically, the target image segmentation result is determined based on the result of determining whether the first image segmentation result satisfies the preset similarity threshold.
[0074] Specifically, the similarity data is compared with a preset similarity threshold to determine whether the similarity data are all less than the preset similarity threshold. If they are all less than the preset similarity threshold, it indicates that the target segmentation area is not segmented into the object area corresponding to the target segmentation area, that is, if the first image segmentation result meets the image segmentation requirements, the first image segmentation result is used as the target image segmentation result. Otherwise, the first image segmentation result needs to be adjusted.
[0075] Based on the above embodiment, the first image segmentation result includes a first sub-segmentation result corresponding to at least one target segmentation area, and the second image segmentation result includes a second sub-segmentation result corresponding to at least one segmentation area where an object is located; determining the similarity data of the first image segmentation result and the second image segmentation result includes: traversing the first image segmentation result and the second image segmentation result, and determining the similarity data of any first sub-segmentation result and any second sub-segmentation result.
[0076] It can be understood that, when the first image segmentation result includes a first sub-segmentation result corresponding to at least one target segmentation area, and the second image segmentation result includes a second sub-segmentation result corresponding to the segmentation area where the object is located, there will be a situation where the similarity data of multiple first sub-segmentation results in the first image segmentation result and multiple second sub-segmentation results in the second image segmentation result are calculated. In this case, it is necessary to traverse the first image segmentation result and the second image segmentation result, extract the multiple second sub-segmentation results in the second image segmentation result, and compare the similarity with the multiple first sub-segmentation results in the first image segmentation result respectively. Through a preset similarity algorithm, the multiple first sub-segmentation results in the first image segmentation result and the multiple second sub-segmentation results in the second image segmentation result are calculated pairwise, and the similarity data of any first sub-segmentation result and any second sub-segmentation result are determined to obtain multiple similarity data.
[0077] In this embodiment, by determining the similarity data of any first sub-segmentation result and any second sub-segmentation result, the first sub-segmentation result corresponding to the similarity data that is not less than the preset similarity threshold can be determined based on the similarity data judgment result, which helps to determine the initial segmentation area to be adjusted. Only the initial segmentation area to be adjusted needs to be re-segmented, and there is no need to adjust all the initial segmentation areas in the initial segmentation results of the segmented image data, which can reduce the workload to a certain extent and help improve the efficiency of image segmentation.
[0078] S260. If any similarity data is greater than or equal to a preset similarity threshold, determine the target segmentation area corresponding to the similarity data greater than or equal to the preset similarity threshold, adjust the prompt point information of the initial segmentation result corresponding to the target segmentation area, and return to the step of inputting the prompt point information and the image data to be segmented into a preset image segmentation model for processing based on the adjusted prompt point information to obtain a first image segmentation result of the image data to be segmented, so as to obtain a target image segmentation result.
[0079] Specifically, when it is determined that any similarity data is greater than or equal to a preset similarity threshold, it is determined that the target segmentation area in the first image segmentation result is mistakenly segmented into the area of the object to which the target segmentation area belongs, and it is necessary to determine the corresponding initial segmentation result according to the target segmentation area corresponding to the similarity data greater than or equal to the preset similarity threshold, and then adjust the prompt point information of the initial segmentation result. Exemplarily, the number of prompt points and the position of prompt points in the prompt point information are adjusted, that is, prompt points of a preset number threshold can be randomly selected again, and prompt points of a number greater than the preset number threshold can be selected, and the position data of the corresponding prompt points are read to obtain the adjusted prompt point information, and the preset image segmentation model is re-called, and the adjusted prompt point information and the image data to be segmented are used as input data of the preset image segmentation model. The preset image segmentation model is guided by the adjusted prompt point information to perform image segmentation processing on the image data to be segmented, and a new first image segmentation result is obtained for re-determining the target image segmentation result.
[0080] The technical solution of this embodiment is as follows: by acquiring image data to be segmented, segmenting the image data to be segmented based on preset channel threshold data to obtain an initial segmentation result, wherein the initial segmentation result includes at least one initial segmentation area; determining cue point information corresponding to each initial segmentation area, inputting the cue point information and the image data to be segmented into a preset image segmentation model for processing, obtaining a first image segmentation result of the image data to be segmented, and the first image segmentation result is used to characterize the target segmentation area in the image data to be segmented; acquiring preset text prompt information, inputting the preset text prompt information and the image data to be segmented into a preset image segmentation model for processing, and obtaining a second image segmentation result of the image data to be segmented, wherein the preset text prompt information is prompt information of the object to which the target segmentation area belongs, and the second image segmentation result is used to characterize the segmentation area where the object to which the target segmentation area in the image data to be segmented belongs is located; determining similarity data between the first image segmentation result and the second image segmentation result; comparing the similarity data with a preset similarity threshold, and if the similarity data is less than the preset similarity threshold, taking the first image segmentation result as the target image segmentation result. The problem that a large amount of labeled data is needed to determine the segmentation of image data is solved, the dependence on a large amount of labeled data is reduced, and no additional model training is required. The prompt strategy is adopted to enhance the image segmentation model's recognition ability for images in complex environments, and the speed and accuracy of the segmentation processing of the target segmentation area in the image data to be segmented are improved; the prompt point information corresponding to the initial segmentation area in the first image segmentation result that does not meet the segmentation requirements is adjusted to re-determine the target image segmentation result, so as to avoid the target segmentation area being mistakenly segmented as the object area to which the target segmentation area belongs when performing image segmentation through the prompt point information, thereby improving the accuracy and applicability of the image segmentation result.
[0081] Embodiment 3
[0082] Figure 3 FIG. 1 is a schematic diagram of the structure of an image segmentation device provided by Embodiment 3 of the present invention. Figure 3 As shown, the device comprises:
[0083] The initial segmentation result determination module 310 is used to obtain the image data to be segmented, and perform segmentation processing on the image data to be segmented based on the preset channel threshold data to obtain an initial segmentation result, wherein the initial segmentation result includes at least one initial segmentation area;
[0084] The first image segmentation result determination module 320 is used to determine the cue point information corresponding to each initial segmentation area, input the cue point information and the image data to be segmented into a preset image segmentation model for processing, and obtain the first image segmentation result of the image data to be segmented, and the first image segmentation result is used to represent the target segmentation area in the image data to be segmented;
[0085] The second image segmentation result determination module 330 is used to obtain preset text prompt information, input the preset text prompt information and the image data to be segmented into a preset image segmentation model for processing, and obtain a second image segmentation result of the image data to be segmented, wherein the preset text prompt information is the prompt information of the object to which the target segmentation area belongs, and the second image segmentation result is used to characterize the segmentation area where the object to which the target segmentation area belongs in the image data to be segmented is located;
[0086] The target image segmentation result determination module 340 is used to determine similarity data between the first image segmentation result and the second image segmentation result, and determine a target image segmentation result of the image data to be segmented based on the similarity data.
[0087] The technical solution of this embodiment is to obtain the image data to be segmented through an initial segmentation result determination module, and perform segmentation processing on the image data to be segmented based on preset channel threshold data to obtain an initial segmentation result, wherein the initial segmentation result includes at least one initial segmentation area; a first image segmentation result determination module is used to determine the prompt point information corresponding to each initial segmentation area, input the prompt point information and the image data to be segmented into a preset image segmentation model for processing, and obtain a first image segmentation result of the image data to be segmented, and the first image segmentation result is used to characterize the target segmentation area in the image data to be segmented; a second image segmentation result determination module is used to obtain preset text prompt information, input the preset text prompt information and the image data to be segmented into a preset image segmentation model for processing, and obtain a second image segmentation result of the image data to be segmented, wherein the preset text prompt information is the prompt information of the object to which the target segmentation area belongs, and the second image segmentation result is used to characterize the segmentation area where the object to which the target segmentation area belongs in the image data to be segmented is located; a target image segmentation result determination module is used to determine similarity data between the first image segmentation result and the second image segmentation result, and determine the target image segmentation result of the image data to be segmented based on the similarity data. It solves the problem that a large amount of labeled data is needed to determine the segmentation of image data, reduces the dependence on a large amount of labeled data, does not require additional model training, and adopts a prompt strategy to enhance the image segmentation model's recognition ability for images in complex environments, thereby improving the speed, accuracy and applicability of the segmentation processing of the target segmentation area in the image data to be segmented.
[0088] On the basis of the above embodiment, optionally, the preset channel threshold data is preset hue threshold data; the initial segmentation result determination module 310 is specifically used to perform color space conversion processing on the image data to be segmented to obtain image data of a preset color space, and the image data of the preset color space includes hue channel data; the hue channel data of the image data to be segmented is compared with the preset hue threshold data, and the area that meets the preset hue threshold data is segmented to obtain an initial segmentation result.
[0089] Optionally, the device also includes an image preprocessing module, which is used to perform image preprocessing on the initial segmentation result before determining the prompt point information corresponding to each initial segmentation area to obtain a processed initial segmentation result, wherein the image preprocessing includes morphological processing and filtering processing, and the initial segmentation result includes at least one connected domain.
[0090] Optionally, the first image segmentation result determination module 320 is used to traverse each initial segmentation area, input the prompt point information and the image data to be segmented of each initial segmentation area into a preset image segmentation model for processing, and obtain the first sub-segmentation result corresponding to each initial segmentation area. Each first sub-segmentation result forms the first image segmentation result.
[0091] Optionally, the target image segmentation result determination module 340 is further used to determine similarity data between the first image segmentation result and the second image segmentation result;
[0092] The similarity data is compared with a preset similarity threshold, and if the similarity data is less than the preset similarity threshold, the first image segmentation result is used as the target image segmentation result.
[0093] Optionally, the first image segmentation result includes a first sub-segmentation result corresponding to at least one target segmentation area, and the second image segmentation result includes a second sub-segmentation result corresponding to at least one segmentation area where the object is located; the target image segmentation result determination module is also used to traverse the first image segmentation result and the second image segmentation result to determine the similarity data of any first sub-segmentation result and any second sub-segmentation result.
[0094] Optionally, the target image segmentation result determination module 340 is also used to determine the target segmentation area corresponding to the similarity data that is greater than or equal to the preset similarity threshold if any similarity data is greater than or equal to the preset similarity threshold, adjust the prompt point information of the initial segmentation result corresponding to the target segmentation area, and return to execute the step of inputting the prompt point information and the image data to be segmented into the preset image segmentation model for processing based on the adjusted prompt point information to obtain the first image segmentation result of the image data to be segmented, so as to obtain the target image segmentation result.
[0095] The image segmentation device provided in the embodiment of the present invention can execute the image segmentation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0096] Embodiment 4
[0097] Figure 4 1 is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0098] like Figure 4As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0099] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0100] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as an image segmentation method.
[0101] In some embodiments, the image segmentation method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the image segmentation method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the image segmentation method in any other appropriate manner (e.g., by means of firmware).
[0102] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0103] The computer program for implementing the image segmentation method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program can be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0104] Embodiment 5
[0105] Embodiment 5 of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to execute an image segmentation method, the method comprising:
[0106] Acquire image data to be segmented, and perform segmentation processing on the image data to be segmented based on preset channel threshold data to obtain an initial segmentation result, wherein the initial segmentation result includes at least one initial segmentation area;
[0107] Determine the cue point information corresponding to each initial segmentation area, input the cue point information and the image data to be segmented into a preset image segmentation model for processing, and obtain a first image segmentation result of the image data to be segmented, wherein the first image segmentation result is used to characterize the target segmentation area in the image data to be segmented;
[0108] Obtaining preset text prompt information, inputting the preset text prompt information and the image data to be segmented into a preset image segmentation model for processing, and obtaining a second image segmentation result of the image data to be segmented, wherein the preset text prompt information is prompt information of the object to which the target segmentation area belongs, and the second image segmentation result is used to characterize the segmentation area where the object to which the target segmentation area belongs in the image data to be segmented is located;
[0109] Similarity data between the first image segmentation result and the second image segmentation result is determined, and a target image segmentation result of the image data to be segmented is determined based on the similarity data.
[0110] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0111] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0112] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0113] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0114] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0115] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. An image segmentation method, characterized in that: include: Acquire image data to be segmented, and perform segmentation processing on the image data to be segmented based on preset channel threshold data to obtain an initial segmentation result, wherein the initial segmentation result includes at least one initial segmentation area; Determine cue point information corresponding to each of the initial segmented regions, input the cue point information and the image data to be segmented into a preset image segmentation model for processing, and obtain a first image segmentation result of the image data to be segmented, wherein the first image segmentation result is used to characterize a target segmented region in the image data to be segmented; Obtaining preset text prompt information, inputting the preset text prompt information and the image data to be segmented into a preset image segmentation model for processing, and obtaining a second image segmentation result of the image data to be segmented, wherein the preset text prompt information is prompt information of the object to which the target segmentation area belongs, and the second image segmentation result is used to characterize the segmentation area where the object to which the target segmentation area belongs in the image data to be segmented is located; Similarity data between the first image segmentation result and the second image segmentation result is determined, and a target image segmentation result of the image data to be segmented is determined based on the similarity data.
2. The method according to claim 1, characterized in that The preset channel threshold data is preset hue threshold data; The segmenting process of the image data to be segmented based on the preset channel threshold data to obtain an initial segmentation result includes: Performing color space conversion processing on the image data to be segmented to obtain image data in a preset color space, wherein the image data in the preset color space includes hue channel data; The hue channel data of the image data to be segmented is compared with the preset hue threshold data, and the area satisfying the preset hue threshold data is segmented to obtain the initial segmentation result.
3. The method according to claim 1, characterized in that Before determining the cue point information corresponding to each of the initial segmented areas, the method includes: The initial segmentation result is subjected to image preprocessing to obtain a processed initial segmentation result, wherein the image preprocessing includes morphological processing and filtering processing, and the initial segmentation result includes at least one connected domain.
4. The method according to claim 1, characterized in that: The step of inputting the cue point information and the image data to be segmented into a preset image segmentation model for processing to obtain a first image segmentation result of the image data to be segmented includes: Traverse each of the initial segmentation areas, input the prompt point information of each of the initial segmentation areas and the image data to be segmented into the preset image segmentation model for processing, and obtain the first sub-segmentation result corresponding to each of the initial segmentation areas, and each of the first sub-segmentation results forms the first image segmentation result.
5. The method according to claim 1, characterized in that The determining of similarity data between the first image segmentation result and the second image segmentation result, and determining a target image segmentation result of the image data to be segmented based on the similarity data, comprises: Determining similarity data between the first image segmentation result and the second image segmentation result; The similarity data is compared with a preset similarity threshold, and if the similarity data is less than the preset similarity threshold, the first image segmentation result is used as a target image segmentation result.
6. The method according to claim 5, characterized in that The first image segmentation result includes at least one first sub-segmentation result corresponding to the target segmentation area, and the second image segmentation result includes at least one second sub-segmentation result corresponding to the segmentation area where the object is located; The determining the similarity data between the first image segmentation result and the second image segmentation result includes: traversing the first image segmentation result and the second image segmentation result, and determining the similarity data between any of the first sub-segmentation results and any of the second sub-segmentation results.
7. The method according to claim 6, characterized in that The determining of similarity data between the first image segmentation result and the second image segmentation result, and determining a target image segmentation result of the image data to be segmented based on the similarity data, further includes: If any of the similarity data is greater than or equal to the preset similarity threshold, the target segmentation area corresponding to the similarity data greater than or equal to the preset similarity threshold is determined, the prompt point information of the initial segmentation result corresponding to the target segmentation area is adjusted, and based on the adjusted prompt point information, the step of inputting the prompt point information and the image data to be segmented into a preset image segmentation model for processing to obtain a first image segmentation result of the image data to be segmented is returned to obtain the target image segmentation result.
8. An image segmentation device, characterized in that: include: An initial segmentation result determination module is used to obtain image data to be segmented, and perform segmentation processing on the image data to be segmented based on preset channel threshold data to obtain an initial segmentation result, wherein the initial segmentation result includes at least one initial segmentation area; A first image segmentation result determination module is used to determine the cue point information corresponding to each of the initial segmentation areas, input the cue point information and the image data to be segmented into a preset image segmentation model for processing, and obtain a first image segmentation result of the image data to be segmented, wherein the first image segmentation result is used to characterize the target segmentation area in the image data to be segmented; A second image segmentation result determination module is used to obtain preset text prompt information, input the preset text prompt information and the image data to be segmented into a preset image segmentation model for processing, and obtain a second image segmentation result of the image data to be segmented, wherein the preset text prompt information is prompt information of the object to which the target segmentation area belongs, and the second image segmentation result is used to characterize the segmentation area where the object to which the target segmentation area belongs in the image data to be segmented is located; The target image segmentation result determination module is used to determine similarity data between the first image segmentation result and the second image segmentation result, and determine a target image segmentation result of the image data to be segmented based on the similarity data.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the image segmentation method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the image segmentation method according to any one of claims 1 to 7 when executed.
Citation Information
Patent Citations
Infrared image power equipment interactive segmentation method and system
CN116862847A
Abandoned area extraction method based on deep learning
CN116958827A
Image segmentation method and device, equipment and storage medium
CN117132604A
Intelligent interactive remote sensing information extraction method and system combined with visual large model
CN117333766A
Cited By
Water conservancy project concrete quality detection equipment and method
CN120427762A
Cranial nerve fiber bundle labeling method and device, electronic equipment and readable storage medium
CN120451974A
Brain nerve fiber bundle labeling method and device, electronic equipment and readable storage medium
CN120451974B
