Image segmentation method, device and storage medium

By dividing the image into image blocks and determining the token and theme of the block, the problem of inaccurate labeling data or segmentation in the prior art is solved, and high-precision image segmentation is achieved.

CN114549459BActive Publication Date: 2025-05-23SHANGHAI HAOHUA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210158357.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-21
Publication Date
2025-05-23
Estimated Expiration
2042-02-21

AI Technical Summary

Technical Problem

Existing image segmentation methods require labeling data or cannot divide different parts of the object into a whole, resulting in poor segmentation accuracy.

Method used

By dividing the image to be segmented into multiple image blocks, the token set of each image block is determined, the theme of each image block is determined based on the token set, and the image is segmented based on these topics to obtain the initial segmented image.

Benefits of technology

It realizes the segmentation of complex images with high accuracy without labeling data, and improves the accuracy of image segmentation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114549459B_ABST
    Figure CN114549459B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image processing technology, and specifically provides an image segmentation method, device and storage medium, aiming to solve the technical problem that the existing segmentation methods need to annotate data, or cannot segment different parts of an object into a whole, resulting in poor segmentation accuracy. To this end, the image segmentation method of the present invention includes the following steps: dividing the image to be segmented into at least one first image block; determining the token of each first image block to obtain a token set; determining the subject corresponding to each first image block based on the token set; segmenting the image to be segmented based on the subject corresponding to each first image block to obtain an initial segmented image. In this way, the accuracy of image segmentation is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and specifically provides an image segmentation method, device and storage medium. Background Art

[0002] At present, traditional image segmentation methods mainly include supervised methods, semi-supervised methods, domain transfer methods and unsupervised methods. Among them, supervised methods, semi-supervised methods and domain transfer methods all require more or less labeled data or interactive data. For a few completely unsupervised methods, they use pixels with similar features to belong to the same object to achieve image segmentation. However, unsupervised methods easily lead to different parts of an object not being segmented into a whole.

[0003] Accordingly, the art needs a new image segmentation solution to solve the above problems. Summary of the invention

[0004] In order to overcome the above defects, the present invention is proposed to solve or at least partially solve the technical problems that the existing segmentation methods need to annotate data or cannot segment different parts of an object into a whole, resulting in poor segmentation accuracy. The present invention provides an image segmentation method, device and storage medium.

[0005] In a first aspect, the present invention provides an image segmentation method, comprising the following steps: dividing an image to be segmented into at least one first image block; determining a Token for each of the first image blocks to obtain a Token set; determining a subject corresponding to each first image block based on the Token set; and segmenting the image to be segmented based on the subject corresponding to each first image block to obtain an initial segmented image.

[0006] In one embodiment, determining the Token of each of the first image blocks to obtain a Token set includes: acquiring a feature vector of each of the first image blocks based on an image feature extraction model; clustering the feature vectors of the first image blocks to obtain the Token of the first image blocks; and obtaining a Token set based on the Token of each of the first image blocks.

[0007] In one embodiment, determining the topic corresponding to each first image block based on the Token set includes: constructing an LDA model and training the LDA model; inputting the Token set into the trained LDA model to obtain the topic corresponding to each first image block.

[0008] In one embodiment, segmenting the image to be segmented based on the subject corresponding to each first image block to obtain an initial segmented image includes: S1, determining the central pixel point of the first image block, and taking the subject corresponding to the first image block as the subject corresponding to the central pixel point of the first image block; S2, dividing the image to be segmented for a second time to obtain at least one second image block, and determining the subject of the central pixel point of the second image block based on the second image block, wherein the size of the second image block is the same as the size of the first image block; S3, continuing to divide the image to be segmented until W×W divisions of the image to be segmented are completed to obtain at least one Nth image block, and determining the subject of the central pixel point of the Nth image block based on the Nth image block, wherein W is the size of the first image block; S4, obtaining an initial segmented image based on at least one of the Nth image blocks and the subject corresponding to the Nth image block.

[0009] In one embodiment, the image segmentation method further includes: when segmenting the image to be segmented based on the subject corresponding to each image block, constraining the image to be segmented using a Markov random field model.

[0010] In one embodiment, the image segmentation method also includes: determining the border of the initial segmented image; enlarging the border of the initial segmented image to a preset size; performing binary erosion on the initial segmented image to obtain an eroded initial segmented image; and inputting an area including the eroded initial segmented image and the border into a GraphCut model to obtain a final segmented image.

[0011] In one embodiment, the image segmentation method further includes: grouping at least one of the Nth image blocks based on a theme corresponding to the Nth image block to obtain a theme of at least one segmentation object composed of the Nth image block.

[0012] In a second aspect, the present invention provides an image segmentation device, comprising: a division module, configured to divide an image to be segmented into at least one first image block; a set determination module, configured to determine the Token of each of the first image blocks to obtain a Token set; a theme determination module, configured to determine the theme corresponding to each first image block based on the Token set; and a segmentation module, configured to segment the image to be segmented based on the theme corresponding to each first image block to obtain an initial segmented image.

[0013] In a third aspect, an electronic device is provided, the electronic device comprising a processor and a storage device, wherein the storage device is suitable for storing a plurality of program codes, and the program codes are suitable for being loaded and run by the processor to execute any of the above-mentioned image segmentation methods.

[0014] In a fourth aspect, a computer-readable storage medium is provided, wherein a plurality of program codes are stored in the computer-readable storage medium, wherein the program codes are suitable for being loaded and run by a processor to execute any of the aforementioned image segmentation methods.

[0015] The above one or more technical solutions of the present invention have at least one or more of the following beneficial effects:

[0016] The present invention provides an image segmentation method, device and storage medium, which first determine the Token of each first image block to obtain a Token set, then determine the subject corresponding to each first image block based on the Token set, and finally segment the image to be segmented based on the subject corresponding to each first image block to obtain an initial segmented image, thereby achieving segmentation of complex images without any labeled data or interactive data, thereby improving the accuracy of image segmentation.

[0017] When the image to be segmented is segmented according to the subject corresponding to each image block, a Markov random field (CRF) model can be used to constrain the image to be segmented so that the subjects of adjacent pixels are similar, thereby further improving the accuracy of image segmentation. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The disclosure of the present invention will become more easily understood with reference to the accompanying drawings. It is easy for those skilled in the art to understand that these drawings are only for illustrative purposes and are not intended to limit the scope of protection of the present invention. In addition, similar numbers in the figures are used to represent similar components, among which:

[0019] Figure 1 is a schematic flow chart of main steps of an image segmentation method according to an embodiment of the present invention;

[0020] Figure 2 is a schematic diagram of a process for determining a Token set according to an embodiment of the present invention

[0021] Figure 3 is a schematic diagram of segmenting an image to be segmented according to an embodiment of the present invention;

[0022] Figure 4 is a complete flow chart of an image segmentation method according to an embodiment of the present invention;

[0023] Figure 5 It is a schematic diagram of the main structural block diagram of an image segmentation device according to an embodiment of the present invention.

[0024] Reference numerals list :

[0025] 11: Division module; 12: Collection determination module; 13: Theme determination module; 14: Segmentation module. DETAILED DESCRIPTION

[0026] Some embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.

[0027] In the description of the present invention, "module" and "processor" may include hardware, software or a combination of the two. A module may include hardware circuits, various suitable sensors, communication ports, and memories, and may also include software parts, such as program codes, or a combination of software and hardware. The processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor, or any other suitable processor. The processor has data and / or signal processing functions. The processor may be implemented in software, hardware, or a combination of the two. Non-temporary computer-readable storage media include any suitable medium that can store program codes, such as a magnetic disk, a hard disk, an optical disk, a flash memory, a read-only memory, a random access memory, and the like. The term "A and / or B" means all possible combinations of A and B, such as only A, only B, or A and B. The term "at least one A or B" or "at least one of A and B" has a similar meaning to "A and / or B", and may include only A, only B, or A and B. The singular terms "one" and "the" may also include plural forms.

[0028] At present, traditional image segmentation methods mainly include supervised methods, semi-supervised methods, domain transfer methods and unsupervised methods, among which supervised methods, semi-supervised methods and domain transfer methods all require more or less labeled data or interactive data. For a few completely unsupervised methods, the pixels with similar features belong to the same object to achieve image segmentation. However, unsupervised methods easily lead to different parts of an object not being segmented into a whole. To this end, the present application provides an image segmentation method, device and storage medium, first determining the Token of each first image block to obtain a Token set, then determining the subject corresponding to each first image block based on the Token set, and finally segmenting the image to be segmented based on the subject corresponding to each first image block to obtain an initial segmented image, thereby achieving the segmentation of complex images without any labeled data or interactive data, and improving the accuracy of image segmentation.

[0029] See attached Figure 1 , Figure 1 FIG. 1 is a flow chart of the main steps of an image segmentation method according to an embodiment of the present invention. Figure 1As shown, the image segmentation method in the embodiment of the present invention mainly includes the following steps S101 to S104.

[0030] Step S101: Divide the image to be segmented into a plurality of first image blocks. Specifically, in this step, the image to be segmented is segmented into image blocks of a fixed size WxW, wherein the size of the image blocks can be adjusted according to the actual application scenario, such as adjusting the image block size according to the image resolution, the size of the object contained in the image, etc.

[0031] Step S102: Determine the Token of each first image block to obtain a Token set. Figure 2 As shown, this step is the process of tokenizing the image block, where Token can be the encoding value corresponding to each image block, such as 1, 2, ..., 99, etc. In this step, the feature vector of each first image block can be first obtained based on the image feature extraction model, where the image feature extraction model can be a convolutional neural network. Convolutional neural network (CNN) is a type of feedforward neural network that includes convolution calculation and has a deep structure. The structure of the convolutional neural network includes an input layer, a hidden layer and an output layer, wherein the hidden layer includes a convolutional layer, a pooling layer and a fully connected layer. The convolutional layer and the pooling layer of the convolutional neural network can respond to the translation invariance of the input feature, and can identify similar features located at different positions in the image space, so as to achieve the purpose of extracting image features. It should be noted that the convolutional neural network of the embodiment of the present invention can be a neural network constructed based on Resnet18 network, Resnet34 network, Resnet50 network or Alexnet. In this embodiment, each WxW first image block can be used as a convolutional neural network constructed in this application to obtain the feature vector of each first image block.

[0032] After obtaining the feature vector of each first image block, the feature vector of the first image block is clustered to obtain the Token of the first image block. In this embodiment, the K-means clustering method can be used to cluster the feature vectors of all first image blocks, where the number of clusters can be adjusted according to the application scenario. After K-means clustering, the Token corresponding to the first image block can be obtained. Of course, the present application can also be other clustering methods, not just limited to the K-means clustering method. Finally, the Tokens of all first image blocks are combined to obtain the Token set of the image to be segmented.

[0033] Step S103: Determine the topic corresponding to each first image block based on the Token set. In the process of determining the topic corresponding to each first image block based on the Token set, an LDA model can be first constructed and trained. The LDA (Latent Dirichlet Allocation) model is a document topic generation model, also known as a three-layer Bayesian probability model, which includes a three-layer structure of words, topics and documents. The input of the LDA model is a Token set, which can assign a topic to all Tokens, where the number of topics is a preset parameter, which roughly represents the type of object to be segmented. After obtaining the trained LDA model, the Token set is input into the trained LDA model to obtain the topic corresponding to each first image block.

[0034] Step S104: Segment the image to be segmented based on the subject corresponding to each first image block to obtain an initial segmented image. This step is mainly implemented through the following S1 to S4.

[0035] S1. Determine the central pixel of the first image block, and take the subject corresponding to the first image block as the subject corresponding to the central pixel of the first image block. For example, based on step S101, the image to be segmented can be divided into 25 first image blocks, such as Figure 3 As shown, in the first division, the upper left corner vertex of the image is used as the starting point for division, wherein the size of each image block is WxW. In this step, the center point of each first image block can be used as a pixel point, such as point A, point B, point C, and point D, and the subject of the first image block is used as the subject corresponding to the center pixel point of the first image block.

[0036] S2, performing a second division on the image to be segmented to obtain at least one second image block, and determining the subject of the central pixel point of the second image block based on the second image block, wherein the size of the second image block is the same as the size of the first image block. Specifically, the starting point of the second division can be obtained by offsetting the starting point of the first division, for example, Figure 3 The starting point of the first division is set to (0,0), then the starting point of the second division can be obtained by offsetting (i,j) on the basis of (0,0), and the size of each second image block during division is still WxW. For example, Figure 3As shown, a (W / 2)x(W / 2) border (as shown in dark gray) can be pre-added around the image to be segmented, and then the central pixel point of the first image block is used as the starting point for the second division to divide the image to be segmented, and finally a plurality of second image blocks are obtained. After obtaining the second image block, the method of the aforementioned steps S101 to S103 can be used to continue to determine the theme of the second image block, and the theme of the second image block can be used as the theme of the central pixel point of the second image block.

[0037] S3, continue to divide the image to be segmented until the W×W divisions of the image to be segmented are completed, and at least one Nth image block is obtained, and the theme of the central pixel point of the Nth image block is determined based on the Nth image block, where W is the size of the first image block, which can be the length or width of the first image block. Specifically, in the process of the third division and the W×W division of the image to be segmented, the division principle is the same as the division principle of the aforementioned S2, and both are to first determine the starting point of each division, wherein the starting point of each division is obtained by offsetting the starting point of the previous division by (i, j), and then divide the image to be segmented based on the starting point, and the size of each image block obtained by each division is W×W. After W×W divisions, at least one Nth image block is obtained. Similarly, the method of the aforementioned steps S101-S103 is used to continue to determine the theme of the Nth image block, and the theme of the Nth image block is used as the theme of the central pixel point of the Nth image block. In this way, the theme of each central pixel point in the image to be segmented can be determined.

[0038] S4. Obtain an initial segmented image based on multiple Nth image blocks and themes corresponding to the Nth image blocks. In this step, after the aforementioned steps S1 to S3, multiple first image blocks, multiple second image blocks, and multiple Nth image blocks can be obtained. The theme of the central pixel of each image block is also known. The image spliced ​​with adjacent image blocks with the same theme can be used as a segmentation object. Thus, after segmenting the image to be segmented, at least one segmentation object can be obtained. For example, after segmenting an image containing children, mountains, and sky using the image segmentation method of the present application, the regions where the three objects of children, mountains, and sky are located can be segmented.

[0039] Based on the above steps S101 to S104, firstly, the Token of each first image block is determined to obtain a Token set, then the subject corresponding to each first image block is determined based on the Token set, and finally, the image to be segmented is segmented based on the subject corresponding to each first image block to obtain an initial segmented image, thereby achieving the segmentation of complex images without any labeled data or interactive data, thereby improving the accuracy of image segmentation.

[0040] In one embodiment, when the image to be segmented is segmented according to the subject corresponding to each image block, a Markov random field (CRF) model can be used to constrain the image to be segmented so that the subjects of adjacent pixels are similar, thereby further improving the accuracy of image segmentation. The Markov random field (CRF) model can be implemented by the following energy function E(X):

[0041]

[0042] In the above formula, X represents the theme to which each pixel on the image belongs, which is the variable that the model needs to optimize, i represents the index of the pixel, and N i represents the index of the neighboring pixel of pixel i if and only if x i ≠x j hour Indicates that the initial topic distribution of the i-th pixel is in topic x i The probability on , γ is the weight coefficient. When there are specific constraints, Gibbs sampling can be used to optimize X, and finally the initial segmented image of the image to be segmented is obtained.

[0043] In one embodiment, if Figure 4 As shown, the initial segmented image can also be refined by the GraphCut model to obtain the final segmented image. Generally speaking, for a given image, two regions are first specified, which can be the foreground part and the background part respectively. The GraphCut model can separate the foreground part from the background part according to the pixel value of the image. In the refinement process, the border of the initial segmented image is first determined. Specifically, the border position of each segmented object can be determined according to the position of each segmented object in the initial segmented image. Then, the border of the initial segmented image is enlarged to a preset size, and the preset size here can be a pre-set size. Secondly, the initial segmented image is binary eroded to appropriately reduce the size of the initial segmented image to obtain the eroded initial segmented image. Finally, the area containing the eroded initial segmented image and the border is input into the GraphCut model to obtain the final segmented image. The segmented object can be separated from the background by inputting the segmented object and the border of the segmented object into the GraphCut model.

[0044] In one embodiment, a plurality of Nth image blocks are grouped based on the theme corresponding to the Nth image block to obtain the theme of at least one segmented object composed of the Nth image blocks. Specifically, because each Nth image block has a specific theme, each segmented object also has its own theme. After the plurality of Nth image blocks are grouped by theme, the theme containing the largest number of themes in the grouped image blocks is used as the theme of the segmented object, thereby achieving automatic grouping of segmented objects and the segmented objects corresponding to each group are always similar. In addition, the theme of the segmented object can also be named according to the segmented object corresponding to each theme.

[0045] It should be pointed out that although the various steps in the above embodiments are described in a specific order, those skilled in the art can understand that in order to achieve the effects of the present invention, different steps do not have to be performed in such an order. They can be performed simultaneously (in parallel) or in other orders. These changes are within the scope of protection of the present invention.

[0046] Furthermore, the present invention also provides an image segmentation device. Figure 5 , Figure 5 FIG. 1 is a main structural block diagram of an image segmentation device according to an embodiment of the present invention. Figure 5 As shown, the image segmentation device in the embodiment of the present invention mainly includes a division module 11, a set determination module 12, a theme determination module 13 and a segmentation module 14. In some embodiments, one or more of the division module 11, the set determination module 12, the theme determination module 13 and the segmentation module 14 can be combined into one module. In some embodiments, the division module 11 can be configured to divide the image to be segmented into multiple first image blocks. The set determination module 12 can be configured to determine the Token of each first image block to obtain a Token set. The theme determination module 13 can be configured to determine the theme corresponding to each first image block based on the Token set. The segmentation module 14 can be configured to segment the image to be segmented based on the theme corresponding to each first image block to obtain an initial segmented image. In one embodiment, the description of the specific implementation function can be found in steps S101-S104.

[0047] The image segmentation device is used to perform Figure 1 The image segmentation method embodiment shown in the figure has similar technical principles, technical problems solved and technical effects produced. Technicians in this technical field can clearly understand that for the convenience and conciseness of description, the specific working process and related instructions of the image segmentation device can refer to the contents described in the embodiment of the image segmentation method, which will not be repeated here.

[0048] It is understood by those skilled in the art that the present invention implements all or part of the processes in the method of the above embodiment, and can also be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device, medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, electric carrier signal, telecommunication signal and software distribution medium that can carry the computer program code. It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media do not include electric carrier signals and telecommunication signals.

[0049] Furthermore, the present invention also provides an electronic device. In an electronic device embodiment according to the present invention, the electronic device includes a processor and a storage device, the storage device can be configured to store a program for executing the image segmentation method of the above method embodiment, and the processor can be configured to execute the program in the storage device, which includes but is not limited to the program for executing the image segmentation method of the above method embodiment. For ease of explanation, only the parts related to the embodiment of the present invention are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present invention.

[0050] Furthermore, the present invention also provides a computer-readable storage medium. In a computer-readable storage medium embodiment according to the present invention, the computer-readable storage medium can be configured to store a program for executing the image segmentation method of the above method embodiment, and the program can be loaded and run by a processor to implement the above image segmentation method. For ease of explanation, only the parts related to the embodiment of the present invention are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present invention. The computer-readable storage medium can be a storage device formed by various electronic devices. Optionally, the computer-readable storage medium in the embodiment of the present invention is a non-temporary computer-readable storage medium.

[0051] Further, it should be understood that since the setting of each module is only for illustrating the functional units of the device of the present invention, the physical devices corresponding to these modules may be the processor itself, or a part of the software in the processor, a part of the hardware, or a part of the combination of software and hardware. Therefore, the number of each module in the figure is only schematic.

[0052] Those skilled in the art will appreciate that the modules in the device can be adaptively split or merged. Such splitting or merging of specific modules will not cause the technical solution to deviate from the principle of the present invention, and therefore, the technical solutions after splitting or merging will fall within the protection scope of the present invention.

[0053] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.

Claims

1. An image segmentation method, It is characterized in that The steps include: Dividing the image to be segmented into at least one first image block; Determine a Token of each of the first image blocks to obtain a Token set; Determine a theme corresponding to each first image block based on the Token set; Segmenting the image to be segmented based on the subject corresponding to each first image block to obtain an initial segmented image, including: S1. Determine a central pixel point of the first image block, and use a subject corresponding to the first image block as a subject corresponding to the central pixel point of the first image block; S2, performing a second division on the image to be segmented to obtain at least one second image block, and determining a theme of a central pixel point of the second image block based on the second image block, wherein the size of the second image block is the same as the size of the first image block, and the starting point of the second division is obtained by offsetting the starting point of the first division, and the starting point of the first division is set to (0,0), and the starting point of the second division is obtained by offsetting (i,j) on the basis of (0,0); S3, continue to divide the image to be segmented until the image to be segmented is segmented W×W times to obtain at least one Nth image block, and determine the theme of the central pixel point of the Nth image block based on the Nth image block, wherein W is the size of the first image block, including: in the process of performing the third division and the W×Wth division on the image to be segmented, first determine the starting point of each division, wherein the starting point of each division is obtained by offsetting the starting point of the previous division by (i, j), and then divide the image to be segmented based on the starting point, and the size of the image block obtained by each division is W×W; S4. Obtaining an initial segmented image based on at least one of the Nth image blocks and a theme corresponding to the Nth image block, including: dividing to obtain a plurality of first image blocks, a plurality of second image blocks, and a plurality of Nth image blocks, wherein the theme of the central pixel of each image block is also known, taking an image spliced ​​with adjacent image blocks with the same theme as a segmentation object, and obtaining at least one segmentation object after segmenting the image to be segmented.

2. The image segmentation method according to claim 1, It is characterized in that Determine the token of each of the first image blocks to obtain a token set including: Acquire a feature vector of each of the first image blocks based on an image feature extraction model; Clustering the feature vector of the first image block to obtain a Token of the first image block; A Token set is obtained based on the Token of each of the first image blocks.

3. The image segmentation method according to claim 1, It is characterized in that Determining the subject corresponding to each first image block based on the Token set includes: Constructing an LDA model and training the LDA model; The Token set is input into the trained LDA model to obtain the topic corresponding to each first image block.

4. The image segmentation method according to claim 1, It is characterized in that The image segmentation method further includes: when segmenting the image to be segmented based on the subject corresponding to each image block, constraining the image to be segmented using a Markov random field model.

5. The image segmentation method according to claim 1, It is characterized in that The image segmentation method further comprises: Determining a border of the initial segmented image; Enlarging the border of the initial segmented image to a preset size; Performing binary erosion on the initial segmented image to obtain an eroded initial segmented image; The region including the eroded initial segmented image and the border is input into the GraphCut model to obtain a final segmented image.

6. The image segmentation method according to claim 1, It is characterized in that The image segmentation method further includes: grouping at least one of the Nth image blocks based on the subject corresponding to the Nth image block to obtain the subject of at least one segmentation object composed of the Nth image block.

7. An image segmentation device, It is characterized in that include: A division module, configured to divide the image to be segmented into at least one first image block; A set determination module, configured to determine a Token of each of the first image blocks to obtain a Token set; A theme determination module, configured to determine a theme corresponding to each first image block based on the Token set; A segmentation module is configured to segment the image to be segmented based on the subject corresponding to each first image block to obtain an initial segmented image, including: S1. Determine a central pixel point of the first image block, and use a subject corresponding to the first image block as a subject corresponding to the central pixel point of the first image block; S2, performing a second division on the image to be segmented to obtain at least one second image block, and determining a theme of a central pixel point of the second image block based on the second image block, wherein the size of the second image block is the same as the size of the first image block, and the starting point of the second division is obtained by offsetting the starting point of the first division, and the starting point of the first division is set to (0,0), and the starting point of the second division is obtained by offsetting (i,j) on the basis of (0,0); S3, continue to divide the image to be segmented until the image to be segmented is segmented W×W times to obtain at least one Nth image block, and determine the theme of the central pixel point of the Nth image block based on the Nth image block, wherein W is the size of the first image block, including: in the process of performing the third division and the W×Wth division on the image to be segmented, first determine the starting point of each division, wherein the starting point of each division is obtained by offsetting the starting point of the previous division by (i, j), and then divide the image to be segmented based on the starting point, and the size of the image block obtained by each division is W×W; S4. Obtaining an initial segmented image based on at least one of the Nth image blocks and a theme corresponding to the Nth image block, including: dividing to obtain a plurality of first image blocks, a plurality of second image blocks, and a plurality of Nth image blocks, wherein the theme of the central pixel of each image block is also known, taking an image spliced ​​with adjacent image blocks with the same theme as a segmentation object, and obtaining at least one segmentation object after segmenting the image to be segmented.

8. An electronic device comprising a processor and a storage device, wherein the storage device is suitable for storing a plurality of program codes, It is characterized in that The program code is suitable for being loaded and executed by the processor to perform the method of any one of claims 1 to 6.

9. A computer-readable storage medium having a plurality of program codes stored therein, It is characterized in that The program code is suitable for being loaded and executed by a processor to execute the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Image processing apparatus, image processing method, computer-readable medium and computer data signal

    US20100014756A1