CN111652891A - Dynamic contour image segmentation algorithm, device, terminal and readable storage medium based on Legendre moment and statistical shape model - Google Patents

Dynamic contour image segmentation algorithm, device, terminal and readable storage medium based on Legendre moment and statistical shape model Download PDF

Info

Publication number
CN111652891A
CN111652891A CN202010076438.3A CN202010076438A CN111652891A CN 111652891 A CN111652891 A CN 111652891A CN 202010076438 A CN202010076438 A CN 202010076438A CN 111652891 A CN111652891 A CN 111652891A
Authority
CN
China
Prior art keywords
shape
moment
legendre
principal component
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010076438.3A
Other languages
Chinese (zh)
Inventor
张俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen V Soft Co ltd
Original Assignee
Shenzhen V Soft Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen V Soft Co ltd filed Critical Shenzhen V Soft Co ltd
Priority to CN202010076438.3A priority Critical patent/CN111652891A/en
Publication of CN111652891A publication Critical patent/CN111652891A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/12Edge-based segmentation

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

The application relates to a Legendre moment and statistical shape model-based dynamic contour image segmentation algorithm, a device, a terminal and a medium, wherein the Legendre moment and statistical shape model-based dynamic contour image segmentation algorithm comprises S1 and is used for establishing a statistical shape model; s2, segmenting the image through the statistical shape model and the dynamic contour model to obtain a dynamic contour; s3, projecting the shape contained in the dynamic contour to a principal component space, and acquiring the position vector of the shape in the principal component space; s4, updating the position vector obtained in the step S3 to obtain a new position vector; s5, reconstructing the shape of the new position vector in the image space based on the new position vector obtained in step S4; s6, in the image space, evolving the shape reconstructed in step S5 using the drive equation; s7, repeating the steps S3-S6 until the driving equation converges. The algorithm, the device, the terminal and the readable storage medium effectively expand the applicability of the segmentation algorithm; and only a small number of samples need to be learned, so that an effective statistical shape model can be obtained.

Description

Dynamic contour image segmentation algorithm, device, terminal and readable storage medium based on Legendre moment and statistical shape model
[ technical field ] A method for producing a semiconductor device
The application relates to the technical field of image processing and computer vision, in particular to a dynamic contour image segmentation algorithm, a device, a terminal and a readable storage medium based on Legendre moment and a statistical shape model.
[ background of the invention ]
Image segmentation is the process of algorithmically separating objects in an image. Image segmentation is one of the basic problems to be solved in image processing, and has wide application in reality. For example, in an automated production process, a segmentation algorithm is often required to segment out a product in an image, and then the segmentation result is geometrically matched with a product model to determine whether the product has a quality problem.
The dynamic contour segmentation technology is an image segmentation technology which enables an initially inaccurate curve to continuously approximate a target contour through iterative evolution of the curve. The evolution of the curve is driven by a specific partial differential equation. These partial differential equations are often derived from the corresponding energy functions. The evolution process of the curve is the process of continuously optimizing the energy function.
The driving equations used by conventional dynamic profiling methods generally include the following information: (1) edge information of the object; (2) prior statistical information of the target and the background; (3) internal tension information of the curve (smoothing prior). In some practical applications, the conventional dynamic contour method cannot achieve the ideal effect. This is due to the lack of consideration in the models of conventional algorithms for many complex practical situations. These include: complex backgrounds, shadows, occlusions, low contrast, motion blur, strong noise at low light levels, strong structural noise, and the like. Under the above conditions, the conventional dynamic contour method tends to converge to a local optimum point far from the target, resulting in failure of segmentation.
[ summary of the invention ]
The method comprises the steps that a Legendre moment and a statistical shape model are used for calculating the dynamic contour image of a user, and the dynamic contour image is divided into a plurality of dynamic contour images; and only a small number of samples need to be learned, and an effective statistical shape model can be obtained quickly.
The application is realized by the following technical scheme:
a dynamic contour image segmentation algorithm based on Legendre moment and a statistical shape model comprises the following steps:
s1, establishing a statistical shape model through learning, wherein the statistical shape model comprises the following steps:
(i) collecting a target shape of the image to obtain a shape sample;
(ii) projecting a target shape in the shape sample on a normalized two-dimensional legendre function to obtain a moment vector of the shape sample;
(iii) after moment vectors of all shape samples are obtained, principal component analysis is carried out on the moment vectors to obtain principal component characteristic vectors;
(iiii) establishing a nonparametric probability distribution function in the principal component space, wherein the probability distribution function is a superposition function of a multidimensional gaussian function with each principal component feature vector as a mean;
s2, segmenting the image through the statistical shape model and the dynamic contour model to obtain a dynamic contour, wherein the dynamic contour is initialized before the dynamic contour is iteratively evolved when the dynamic contour model segments the image;
s3, projecting the shape contained in the current dynamic contour to a principal component space, and acquiring the position vector of the shape in the principal component space;
s4, updating the position vector obtained in step S3 according to the probability distribution function obtained in step S1 to obtain a new position vector;
s5, reconstructing the shape of the new position vector in the image space based on the new position vector obtained in step S4;
s6, in the image space, evolving the shape reconstructed in step S5 using the drive equation;
and S7, repeating the steps S3-S6 until the driving equation converges, and finally obtaining the region contained in the contour, namely the result of image segmentation.
In the dynamic contour image segmentation algorithm based on the legendre moments and the statistical shape model as described above, in step S1, the legendre function is an n-th order polynomial with a domain of [ -1, 1], which is defined as:
Figure BDA0002378603120000031
the normalized two-dimensional Legendre function LpqIs the tensor product of two Legendre functions of order p and q, respectively, expressed as:
Figure BDA0002378603120000032
where (x, y) represents the coordinates of a point on a two-dimensional plane, omega represents the set of points on the interior and edges of the target shape,
Figure BDA0002378603120000041
representing the set of points on the edge of the target shape, and recording as the target contour, the area of the target shape is represented as | Ω |, and the barycentric coordinate of the target shape is
Figure BDA0002378603120000042
And projecting the shape omega onto a two-dimensional normalized Legendre function to obtain Legendre moment:
Figure BDA0002378603120000043
wherein, the moment vector λ formed by Legendre moment is (λ)pq,p+q≤No) Feature vectors for describing the target shape, NoFor a given maximum order of the two-dimensional Legendre function, the moment vector λ comprises (N)o+1)(No+2)/2 real numbers.
In the aforementioned dynamic contour image segmentation algorithm based on legendre moments and statistical shape models, in step (iii), the performing principal component analysis includes:
obtaining a mean value and a covariance matrix of the shape sample moment vectors;
singular value decomposition is carried out on the covariance matrix to obtain a series of orthonormal eigenvectors and singular values corresponding to the eigenvectors;
and selecting a plurality of eigenvectors with the largest singular value as principal component eigenvectors, wherein the ratio of the sum of the selected singular values to the sum of all singular values is larger than 0.95.
In the above-mentioned dynamic contour image segmentation algorithm based on legendre moments and statistical shape models, the projection in step S3 includes:
transformation from image space to projection of feature space: projecting the shape contained in the current dynamic contour on a normalized two-dimensional Legendre function to obtain a moment vector of the current shape;
projection from feature space to principal component space: and subtracting the mean value of the moment vectors of the shape samples obtained by learning from the moment vector of the current shape, and projecting the moment vector to the principal component characteristic vector obtained by learning to obtain the position vector of the current shape in the principal component space.
In the above-mentioned dynamic contour image segmentation algorithm based on legendre moments and statistical shape models, the updating in step S4 includes:
using the main component characteristic vector obtained by learning as an attractor;
each attractor generates an attraction force component to the position vector, wherein the attraction force component is a vector with a direction and a magnitude, the direction of the attraction force component is a vector difference between a corresponding principal component feature vector and the position vector, and the magnitude of the attraction force component is a weighted value of a numerical value corresponding to a position vector of a multidimensional Gaussian function with the corresponding attractor as a center;
and performing vector superposition on the attraction force components generated by each attractor to obtain the total attraction force received by the corresponding position vector, wherein the updated position vector moves on the basis of the original position vector, the moving direction is the direction of the total attraction force, and the moving size is the size of the total attraction force multiplied by the step length.
In the above dynamic contour image segmentation algorithm based on legendre moments and statistical shape models, step S5, reconstructing the shape of the new position vector in the image space includes:
reconstruction from principal component space to feature space: taking the principal component eigenvector as a matrix formed by column vectors, multiplying the matrix by a new position vector, and adding the mean value of the moment vectors of the shape samples to the multiplied result to complete the reconstruction of the eigenvector;
reconstruction from feature space to image space: the reconstructed feature vector includes the updated legendre moment, and a reconstructed image can be obtained by multiplying the updated legendre moment by the corresponding legendre function in step S3 and then superimposing the product, where the reconstructed shape is defined as a set of all pixels with values greater than 0.5 in the reconstructed image.
The above-mentioned dynamic contour image segmentation algorithm based on Legendre moment and statistical shape model, wherein the shape reconstructed in step S5 is transformed by using a driving equation to numerically approximate a partial differential equation of driving contour evolution by using a level set method,
the level set partial differential equation driving the profile evolution is expressed as:
Figure BDA0002378603120000061
where φ represents the level set function, I represents the image to be segmented, μΩAnd muΩc represents the mean value of the gray levels inside and outside the dynamic profile, and γ represents a parameter for balancing the two terms.
The present application further provides a dynamic contour image segmentation apparatus based on legendre moments and statistical shape models, comprising:
the model building module is used for building a statistical shape model through learning and comprises a collecting module, a projection module, a principal component analysis module and a probability distribution function building module; the collecting module is used for collecting the target shape of the image to obtain a shape sample; the projection module is used for projecting a target shape in the shape sample on a normalized two-dimensional Legendre function to obtain a moment vector of the shape sample; the principal component analysis module is used for obtaining the moment vectors of all the shape samples and then carrying out principal component analysis on the moment vectors to obtain principal component characteristic vectors; the probability distribution function establishing module is used for establishing a nonparametric probability distribution function in a principal component space, wherein the probability distribution function is a superposition function of a multidimensional Gaussian function taking each principal component feature vector as a mean value;
the dynamic contour acquisition module is used for segmenting the image through the statistical shape model and the dynamic contour model to obtain a dynamic contour;
the position vector acquisition module is used for projecting the shape contained in the current dynamic contour to a principal component space and acquiring the position vector of the current dynamic contour in the principal component space;
the updating module is used for updating the position vector obtained by the position vector obtaining module according to the probability distribution function to obtain a new position vector;
the position vector reconstruction module is used for reconstructing the shape of the new position vector in the image space according to the new position vector;
and the shape evolution module is used for evolving the reconstructed shape in the image space by using the driving equation.
The application also provides a dynamic contour image segmentation terminal based on Legendre moment and a statistical shape model, which comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program to realize the dynamic contour image segmentation method based on Legendre moment and the statistical shape model.
The present application also provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the method for dynamic contour image segmentation based on legendre moments and statistical shape models as described above.
Compared with the prior art, the method has the following advantages:
the dynamic contour image segmentation algorithm based on the Legendre moment and the statistical shape model is organically combined by the statistical shape model and the dynamic contour algorithm, so that the applicability of the segmentation algorithm is effectively expanded; and only a small number of samples need to be learned, and an effective statistical shape model can be obtained quickly.
The device, the terminal and the readable storage medium apply the Legendre moment and statistical shape model-based dynamic contour image segmentation algorithm, and therefore have corresponding beneficial effects.
[ description of the drawings ]
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flow chart of an embodiment of the present application.
FIG. 2 is four test images to be segmented in the embodiment of the present application, where a is an ideal image and a circle in the figure is an initial dynamic contour; b is an image polluted by Gaussian noise; c is an image of the mechanical noise pollution; d is an image contaminated by gaussian noise and structural noise.
Fig. 3 is a schematic diagram of a result obtained by segmentation with a conventional algorithm according to an embodiment of the present application, where a solid line is a segmentation result of each test image in fig. 2 with a dynamic contour algorithm without a statistical shape model, and a dotted line in fig. b is an ideal target contour.
Fig. 4 is a sample of all shapes of an object to be segmented according to an embodiment of the present application. All shape samples used to build the statistical shape model.
Fig. 5 is a principal component space formed by two most significant feature vectors obtained in the learning process according to the embodiment of the present application. The dots in the figure represent the projection of the shape sample in figure 4 in this space; the iso-curves in the figure show the probability distribution functions constructed by the projection of the shape samples; three real, imaginary and point curves with a frame as an initial point are respectively connected with the projections (corresponding to the intersection points in the figure) of the dynamic contour evolution shapes of the segmentation test images b, c and d in the space.
FIG. 6 shows the results of the test images a, b, c, d segmented by the dynamic contour image segmentation algorithm based on Legendre moments and statistical shape models according to the embodiment of the present application; wherein, the solid line is the segmentation result of the dynamic contour algorithm on the test image in fig. 2 under the condition of the statistical shape model; the dashed line in the diagram b is the actual target contour.
Fig. 7 shows an evolution process of segmenting a test image by a motion profile for an embodiment of the present application. The images show the iterative evolution of the dynamic contour in the segmentation process from left to right and from top to bottom respectively.
Fig. 8 is a block diagram of a system according to an embodiment of the present application.
[ detailed description ] embodiments
In order to make the technical problems, technical solutions and advantageous effects solved by the present application more clear and obvious, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
As shown in fig. 1, the embodiment of the present application provides a dynamic contour image segmentation algorithm based on legendre moments and a statistical shape model, which includes the following steps S1-S7:
step S1, the statistical shape model is established by learning, and the step (i), (ii), (iii), and (iiii) of establishing the statistical shape model by learning includes steps.
Step (i) collects the target shape of the image to obtain a shape sample, and the target shape included in the sample image should be representative.
Step (ii) projects the target shape in the shape sample on a normalized two-dimensional legendre function to obtain a moment vector of the shape sample.
Wherein, Legendre function is defined as [ -1, 1 [ -1 [ ]]Is defined as:
Figure BDA0002378603120000091
legendre polynomials of different orders are orthonormal in their domain of definition, so that the functions projected onto them can be expressed compactly.
The normalized two-dimensional Legendre function LpqIs the tensor product of two legendre functions of order p and q respectively,expressed as:
Figure BDA0002378603120000101
where (x, y) represents the coordinates of a point on a two-dimensional plane, omega represents the set of points on the interior and edges of the target shape,
Figure BDA0002378603120000102
representing the set of points on the edge of the target shape, and recording as the target contour, the area of the target shape is represented as | Ω |, and the barycentric coordinate of the target shape is
Figure BDA0002378603120000103
And projecting the shape omega onto a two-dimensional normalized Legendre function to obtain Legendre moment:
Figure BDA0002378603120000104
wherein, the moment vector λ formed by Legendre moment is (λ)pq,p+q≤No) Feature vectors for describing the target shape, NoFor a given maximum order of the two-dimensional Legendre function, the moment vector λ comprises (N)o+1)(No+2)/2 real numbers, and the maximum order N of the two-dimensional Legendre functionoDepending on the application, relatively complex shapes and shapes that vary relatively more often generally correspond to a relatively large NoLikewise, the main advantages of representing a shape by Legendre's moment are its compactness and its invariance to shape displacement and size. .
And (iii) after the moment vectors of all the shape samples are obtained, carrying out principal component analysis on the moment vectors to obtain principal component characteristic vectors, wherein the obtained principal component characteristic vectors, namely the final learning information, are selected to be used as attractors in a principal component space to influence the subsequent segmentation process.
The main purposes of principal component analysis are: on the premise of keeping the main shape components, the secondary shape components caused by noise are reduced, so that the robustness of a subsequent segmentation algorithm can be improved, meanwhile, the calculation amount required by shape reconstruction is reduced, the secondary components are reduced, the segmentation accuracy is inevitably reduced, and the accuracy can be compensated through the dynamic contour evolution in the image space.
Performing principal component analysis includes: obtaining a mean value and a covariance matrix of the shape sample moment vectors; singular value decomposition is carried out on the covariance matrix to obtain a series of orthonormal eigenvectors and singular values corresponding to the eigenvectors; and selecting a plurality of eigenvectors with the largest singular value as principal component eigenvectors, wherein the ratio of the sum of the selected singular values to the sum of all singular values is larger than 0.95.
The learning result can be understood as that step (iiii) establishes a non-parametric probability distribution function in the principal component space, wherein the probability distribution function is a superposition function of multidimensional gaussian functions with the mean of the feature vectors of the respective principal components, each of the multidimensional gaussian functions is isotropic and has the same variance σ2. Variance σ as a parameter2Usually, the number of samples and the distribution of the samples in the principal component space need to be specified according to the actual application.
Step S2, segmenting the image through the statistical shape model and the dynamic contour model to obtain the dynamic contour, wherein, before the dynamic contour model segments the image to iteratively evolve the dynamic contour, the dynamic contour is initialized,
the location of initialization is determined by the particular application. Generally, the closer the initial position is to the target position, the greater the probability that the algorithm will converge to the correct position, and the faster the rate of convergence. For a particular application, the size of the algorithm convergence field is determined by the relative merits of the algorithm. Both theory and practical application prove that the algorithm of the invention effectively expands the convergence domain of the traditional algorithm. For applications without object location prior information, the initial contour may be a matrix of circles covering the full map. Because the present invention uses the level set as an implementation method for dynamic contour evolution, the topology of the contour can be freely changed, so the topology of the initial contour does not necessarily need to be consistent with the topology of the target contour.
In step S3, the shape included in the current dynamic contour is projected into the principal component space, and the position vector of the shape in the principal component space is obtained.
The projection in step S3 includes two consecutive projections, i.e., two spatial conversions: transformation from image space to projection of feature space: projecting the shape contained in the current dynamic contour on a normalized two-dimensional Legendre function to obtain a moment vector of the current shape; projection from feature space to principal component space: and subtracting the mean value of the moment vectors of the shape samples obtained by learning from the moment vector of the current shape, and projecting the moment vector to the principal component characteristic vector obtained by learning to obtain the position vector of the current shape in the principal component space.
In step S4, the position vector obtained in step S3 is updated according to the probability distribution function obtained in step S1, and a new position vector is obtained.
The updating process in step S4 is completed in the principal component space, and includes: using the main component characteristic vector obtained by learning as an attractor; each attractor generates an attraction force component to the position vector, wherein the attraction force component is a vector with a direction and a magnitude, the direction of the attraction force component is a vector difference between a corresponding principal component feature vector and the position vector, and the magnitude of the attraction force component is a weighted value of a numerical value corresponding to a position vector of a multidimensional Gaussian function with the corresponding attractor as a center; and performing vector superposition on the attraction force components generated by each attractor to obtain the total attraction force received by the corresponding position vector, wherein the updated position vector moves on the basis of the original position vector, the moving direction is the direction of the total attraction force, the moving size is the size of the total attraction force multiplied by the step length beta, and the parameter beta is used for controlling the influence of the statistical shape model on the dynamic contour evolution. Too large a beta limits the dynamic profile to change in a limited sample space, making it impossible to handle too large a difference between the target shape and the sample shape. While too small beta will weaken the effect of the shape model, degrading the algorithm to the traditional contour evolution method
Step S5, reconstructing the shape of the new position vector in image space from the new position vector obtained in step S4. This reconstruction process is the inverse of the projection process described in step S3, and also involves two spatial transformations.
In step S5, reconstructing the shape of the new position vector in image space includes:
reconstruction from principal component space to feature space: taking the principal component eigenvector as a matrix formed by column vectors, multiplying the matrix by a new position vector, and adding the mean value of the moment vectors of the shape samples to the multiplied result to complete the reconstruction of the eigenvector; reconstruction from feature space to image space: the reconstructed feature vector includes the updated legendre moment, and a reconstructed image can be obtained by multiplying the updated legendre moment by the corresponding legendre function in step S3 and then superimposing the product, where the reconstructed shape is defined as a set of all pixels with values greater than 0.5 in the reconstructed image.
Step S6, in the image space, the shape reconstructed in step S5 is evolved using the drive equation. The method of using the driving equation to evolve the shape reconstructed in step S5 into using the level set to numerically approximate the partial differential equation of the driving contour evolution, where the level set partial differential equation of the driving contour evolution is expressed as:
Figure BDA0002378603120000131
where φ represents the level set function, I represents the image to be segmented, μΩAnd muΩc represents the mean value of the gray levels inside and outside the dynamic profile, γ represents the parameter for balancing the two terms, and t represents time. From the above equations, it can be seen that the evolution of the level set function in time is driven by two terms. The first item represents the driving force of the image area information on the outline, and the second item represents the driving force of the self geometry on the outline. The parameter γ balances these two driving forces. Larger values of gamma correspond to smoother motion profiles.
It should be noted that for completeness of description, the present invention uses the above classical drive equations. The actual driving equations used are application specific and will often vary somewhat from the above equations. And the use of different driving equations only affects the specific implementation of this step, and does not affect other steps in the present invention.
The principle of step S6 is to embed the contour as a zero contour into a level set function with one dimension higher, and then realize the evolution of the contour through the evolution of the level set function, and the advantages of the level set method mainly include: (1) the topology of the embedded contour can be freely changed in the evolution, and special processing is not needed; (2) in iteration, point sets belonging to the target and the background can be quickly and effectively determined, so that image statistical information of the target and the background is obtained to drive the further evolution of the contour; (3) the level set function and the image to be segmented have the same function mapping structure, so that the algorithm is convenient to realize.
And step S7, repeating the steps S3-S6 until the driving equation converges, and finally obtaining the region contained in the contour, namely the image segmentation result. The convergence means that the dynamic profile does not change significantly any more in successive iterations.
In the embodiment, the dynamic contour image segmentation algorithm based on the Legendre moment and the statistical shape model aims at the problems of complex background, shadow, shielding, low contrast, motion blur, strong noise and the like in the actual image segmentation processing, and achieves the purpose of efficient and accurate segmentation by combining a small amount of prior geometric information of a target object. In addition, the algorithm in the embodiment greatly improves the robustness of the algorithm under the complex application condition by adding the prior geometric information of the target in the dynamic contour model as soft constraint. Wherein the involved a priori geometrical information is derived from learning the shape of the target contour.
Furthermore, the Legendre moment and statistical shape model-based dynamic contour image segmentation algorithm is organically combined by the statistical shape model and the dynamic contour algorithm, and the applicability of the segmentation algorithm is effectively expanded. The present invention can be applied to target segmentation in the following cases: complex background, shadows, occlusions, low contrast, motion blur, strong noise at low illumination, strong structural noise. Meanwhile, the invention can obtain an effective statistical shape model only by learning a small number of samples.
Further, the currently popular machine learning based segmentation algorithm also has a deep convolutional neural network. However, deep neural networks require a large amount of labeled data as learning samples in the learning process. This is difficult to achieve in many applications. The algorithm of the invention can achieve a relatively ideal effect only by a small number of learning samples (for example, dozens of images).
The principle of the present solution is illustrated by a more specific image processing procedure embodiment as follows:
fig. 2 shows four test images that need to be segmented in a specific embodiment. The test image a is an ideal binary image without any noise interference, wherein the target object is white and the background is black. The latter three test images b, c, d can be generated with this as reference image. The test image b is added with white gaussian noise on the basis of the test image a. As can be seen from the image, the magnitude of the added noise is so great that it is difficult for the human eye to discern the location of the target. This image is used to simulate the strong noise and low contrast phenomena that occur in low light conditions. The structural noise is added to the test image c on the basis of the test image a, and the structural noise is used for simulating the incomplete and shielding phenomena of the target in practical application. And the white Gaussian noise is added to the test image d on the basis of the test image c, so that the segmentation effect of the algorithm under the simultaneous action of the two types of noise is inspected.
The test image in fig. 2 was first segmented using a conventional dynamic contour algorithm without a statistical shape model as a constraint, the results of which are shown in fig. 3. In this embodiment, all the initial dynamic profiles are circles r centered at the center of the image. As shown in fig. 3, the conventional dynamic contour algorithm fails to segment on all three other test images except that an accurate segmentation is obtained on the ideal test image a. In the test image b, the position of the segmentation is basically correct, but the accuracy of the segmentation contour is poor under the influence of strong noise (for comparison, the dashed line shows the position of the ideal segmentation result). In the test images c, d, the segmentation result not only does not contain the complete target, but also contains a large amount of structural noise in false contours.
In order to overcome the drawbacks of the conventional dynamic contour algorithm, a statistical shape model of the target needs to be established. Fig. 4 shows all shape samples of the object to be segmented. As described in the learning step S1, Legendre moment vectors are extracted from all shape samples and principal component analysis is performed, so that several principal component feature vectors can be obtained to determine the probability distribution function in the principal component space, thereby completing the learning process of the statistical shape model. In order to make the results of the above learning process exposable on a plane, we have chosen the two most dominant principal component feature vectors to construct the principal component space shown in fig. 5. Where the solid dots represent the projection of the shape sample in figure 4 in this space. The probability distribution function constructed based on the projection is represented in the graph as a series of probability contours. The contours of the inner layer correspond to a greater probability value than the contours of the outer layer. As shown, the local maxima of the probability distribution function tend to occur in areas where the proxels are relatively dense.
FIG. 6 shows the result of segmenting a test image using a statistical shape model based dynamic contour algorithm of the present invention. The result shows that the algorithm overcomes the interference of Gaussian noise and structural noise and obtains successful segmentation in four test images. Fig. 7 illustrates an evolution process of the motion profile to segment the test image, and particularly illustrates an iterative evolution of the dynamic profile in the segmentation process from left to right and from top to bottom, respectively. The same evolution process can also be developed in the principal component space represented in fig. 5. The projection of the initialized dynamic profile (circle in test image b of fig. 2) in this space is a small box near the center of the graph. Since the initial contour shape is far from the target shape, this small box is also far from the sample projections in the principal component space, corresponding to smaller probability values. Projecting the dynamic contours corresponding to each iteration of the dynamic contour in the evolution onto this principal component space, we will obtain a series of intersections in fig. 5. We tabulate the cutting process for test images b, c, d, respectively, by connecting corresponding intersections with solid, dashed and dotted lines. It can be seen that the general trend of evolution is from a position with a smaller probability value to a position with a larger probability value, which represents the role of the statistical shape model in the algorithm. Meanwhile, the evolution does not always tend to be a high-probability region closest to the current position, and does not always stabilize at the position corresponding to the probability local maximum, which represents the role of the image information in the algorithm. It is the balance of these two effects that makes the algorithm of the present invention have higher robustness.
The embodiment also provides a dynamic contour image segmentation terminal based on legendre moment and a statistical shape model, which comprises a processor, a memory and a computer program stored in the memory and operable on the processor, wherein the processor implements the dynamic contour image segmentation method based on legendre moment and a statistical shape model as described above when executing the computer program.
Illustratively, the computer program may be partitioned into one or more modules that are stored in the memory and executed by the processor to implement the invention. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program in the apparatus of the terminal device. For example, the computer program may be divided into:
the model building module 100 is used for building a statistical shape model through learning, and the model building module 100 comprises a collecting module 101, a projecting module 102, a principal component analyzing module 103 and a probability distribution function building module 104; the collecting module 101 is configured to collect a target shape of an image to obtain a shape sample; the projection module 102 is configured to project a target shape in a shape sample on a normalized two-dimensional legendre function to obtain a moment vector of the shape sample; the principal component analysis module 103 is configured to perform principal component analysis on the moment vectors of all the shape samples to obtain principal component feature vectors; the probability distribution function establishing module 104 is configured to establish a nonparametric probability distribution function in a principal component space, where the probability distribution function is a superposition function of a multidimensional gaussian function taking each principal component feature vector as a mean;
a dynamic contour obtaining module 200, configured to segment the image through the statistical shape model and the dynamic contour model to obtain a dynamic contour;
a position vector obtaining module 300, configured to project a shape included in the current dynamic contour to a principal component space, and obtain a position vector of the shape in the principal component space;
an updating module 400, configured to update the location vector obtained by the location vector obtaining module according to the probability distribution function to obtain a new location vector;
a position vector reconstruction module 500, configured to reconstruct a shape of the new position vector in the image space according to the new position vector;
a shape evolution module 600 for evolving the reconstructed shape in the image space using the drive equations.
The terminal can be a desktop computer, a notebook, a palm computer, a cloud server and other computing equipment. The terminal may include, but is not limited to, a processor, a memory. Those skilled in the art will appreciate that the terminal may also include input output devices, network access devices, buses, and the like. The processor may be a Central Processing Unit (CPU), other general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc.
The memory may be used to store the computer programs and/or modules, and the processor may implement various functions of the terminal by operating or executing the computer programs and/or modules stored in the memory and calling data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a flash memory Card (FlashCard), at least one magnetic disk storage device, a flash memory device, or other volatile solid state storage device.
Wherein the terminal-integrated module, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a computer-readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
It should be noted that the above-described device embodiments are merely illustrative, where the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. In addition, in the drawings of the embodiment of the apparatus provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, and may be specifically implemented as one or more communication buses or signal lines. One of ordinary skill in the art can understand and implement it without inventive effort.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.

Claims (10)

1. A dynamic contour image segmentation algorithm based on Legendre moment and a statistical shape model is characterized by comprising the following steps:
s1, establishing a statistical shape model through learning, wherein the statistical shape model comprises the following steps:
(i) collecting a target shape of the image to obtain a shape sample;
(ii) projecting a target shape in the shape sample on a normalized two-dimensional legendre function to obtain a moment vector of the shape sample;
(iii) after moment vectors of all shape samples are obtained, principal component analysis is carried out on the moment vectors to obtain principal component characteristic vectors;
(iiii) establishing a nonparametric probability distribution function in the principal component space, wherein the probability distribution function is a superposition function of a multidimensional gaussian function with each principal component feature vector as a mean;
s2, segmenting the image through the statistical shape model and the dynamic contour model to obtain a dynamic contour, wherein the dynamic contour is initialized before the dynamic contour is iteratively evolved when the dynamic contour model segments the image;
s3, projecting the shape contained in the current dynamic contour to a principal component space, and acquiring the position vector of the shape in the principal component space;
s4, updating the position vector obtained in step S3 according to the probability distribution function obtained in step S1 to obtain a new position vector;
s5, reconstructing the shape of the new position vector in the image space based on the new position vector obtained in step S4;
s6, in the image space, evolving the shape reconstructed in step S5 using the drive equation;
and S7, repeating the steps S3-S6 until the driving equation converges, and finally obtaining the region contained in the contour, namely the result of image segmentation.
2. The Legendre moment and statistical shape model based dynamic contour image segmentation algorithm of claim 1, wherein in step S1, the Legendre function is an n-th order polynomial with a domain of [ -1, 1] defined as:
Figure FDA0002378603110000021
the normalized two-dimensional Legendre function LpqIs the tensor product of two Legendre functions of order p and q, respectively, expressed as:
Figure FDA0002378603110000022
where (x, y) represents the coordinates of a point on a two-dimensional plane, omega represents the set of points on the interior and edges of the target shape,
Figure FDA0002378603110000024
representing the set of points on the edge of the target shape, and recording as the target contour, the area of the target shape is represented as | Ω |, and the barycentric coordinate of the target shape is
Figure FDA0002378603110000025
And projecting the shape omega onto a two-dimensional normalized Legendre function to obtain Legendre moment:
Figure FDA0002378603110000023
wherein, the moment vector λ formed by Legendre moment is (λ)pqp+q≤Ne) Feature vectors for describing the target shape, NoFor a given maximum order of the two-dimensional Legendre function, the moment vector λ comprises (N)o+1)(No+2)/2 real numbers.
3. The Legendre moment and statistical shape model based dynamic contour image segmentation algorithm of claim 1, wherein in step (iii), performing principal component analysis comprises:
obtaining a mean value and a covariance matrix of the shape sample moment vectors;
singular value decomposition is carried out on the covariance matrix to obtain a series of orthonormal eigenvectors and singular values corresponding to the eigenvectors;
and selecting a plurality of eigenvectors with the largest singular value as principal component eigenvectors, wherein the ratio of the sum of the selected singular values to the sum of all singular values is larger than 0.95.
4. The Legendre moment and statistical shape model based dynamic contour image segmentation algorithm of claim 1, wherein the projection in step S3 comprises:
transformation from image space to projection of feature space: projecting the shape contained in the current dynamic contour on a normalized two-dimensional Legendre function to obtain a moment vector of the current shape;
projection from feature space to principal component space: and subtracting the mean value of the moment vectors of the shape samples obtained by learning from the moment vector of the current shape, and projecting the moment vector to the principal component characteristic vector obtained by learning to obtain the position vector of the current shape in the principal component space.
5. The Legendre moment and statistical shape model based dynamic contour image segmentation algorithm of claim 4, wherein the updating in step S4 comprises:
using the main component characteristic vector obtained by learning as an attractor;
each attractor generates an attraction force component to the position vector, wherein the attraction force component is a vector with a direction and a magnitude, the direction of the attraction force component is a vector difference between a corresponding principal component feature vector and the position vector, and the magnitude of the attraction force component is a weighted value of a numerical value corresponding to a position vector of a multidimensional Gaussian function with the corresponding attractor as a center;
and performing vector superposition on the attraction force components generated by each attractor to obtain the total attraction force received by the corresponding position vector, wherein the updated position vector moves on the basis of the original position vector, the moving direction is the direction of the total attraction force, and the moving size is the size of the total attraction force multiplied by the step length.
6. The Legendre moment and statistical shape model based dynamic contour image segmentation algorithm of claim 4, wherein the step S5 of reconstructing the shape of the new position vector in the image space comprises:
reconstruction from principal component space to feature space: taking the principal component eigenvector as a matrix formed by column vectors, multiplying the matrix by a new position vector, and adding the mean value of the moment vectors of the shape samples to the multiplied result to complete the reconstruction of the eigenvector;
reconstruction from feature space to image space: the reconstructed feature vector includes the updated legendre moment, and a reconstructed image can be obtained by multiplying the updated legendre moment by the corresponding legendre function in step S3 and then superimposing the product, where the reconstructed shape is defined as a set of all pixels with values greater than 0.5 in the reconstructed image.
7. The Legendre moment and statistical shape model based dynamic contour image segmentation algorithm of claim 1, wherein the shape reconstructed in step S5 is transformed by using a driving equation to numerically approximate a partial differential equation of driving contour evolution by using a level set method,
the level set partial differential equation driving the profile evolution is expressed as:
Figure FDA0002378603110000041
where φ represents the level set function, I represents the image to be segmented, μΩAnd muΩ cRepresent the mean values of the gray levels inside and outside the dynamic profile, and gamma represents a parameter for balancing the two terms.
8. A dynamic contour image segmentation apparatus based on Legendre moment and statistical shape model, comprising:
the model building module is used for building a statistical shape model through learning and comprises a collecting module, a projection module, a principal component analysis module and a probability distribution function building module; the collecting module is used for collecting the target shape of the image to obtain a shape sample; the projection module is used for projecting a target shape in the shape sample on a normalized two-dimensional Legendre function to obtain a moment vector of the shape sample; the principal component analysis module is used for obtaining the moment vectors of all the shape samples and then carrying out principal component analysis on the moment vectors to obtain principal component characteristic vectors; the probability distribution function establishing module is used for establishing a nonparametric probability distribution function in a principal component space, wherein the probability distribution function is a superposition function of a multidimensional Gaussian function taking each principal component feature vector as a mean value;
the dynamic contour acquisition module is used for segmenting the image through the statistical shape model and the dynamic contour model to obtain a dynamic contour;
the position vector acquisition module is used for projecting the shape contained in the current dynamic contour to a principal component space and acquiring the position vector of the current dynamic contour in the principal component space;
the updating module is used for updating the position vector obtained by the position vector obtaining module according to the probability distribution function to obtain a new position vector;
the position vector reconstruction module is used for reconstructing the shape of the new position vector in the image space according to the new position vector;
and the shape evolution module is used for evolving the reconstructed shape in the image space by using the driving equation.
9. A terminal for segmenting dynamic contour images based on legendre moments and statistical shape models, comprising a processor, a memory and a computer program stored in the memory and operable on the processor, characterized in that the processor, when executing the computer program, implements the method for segmenting dynamic contour images based on legendre moments and statistical shape models according to any one of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out a method for dynamic contour image segmentation based on legendre moments and statistical shape models according to any one of claims 1 to 7.
CN202010076438.3A 2020-01-23 2020-01-23 Dynamic contour image segmentation algorithm, device, terminal and readable storage medium based on Legendre moment and statistical shape model Pending CN111652891A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010076438.3A CN111652891A (en) 2020-01-23 2020-01-23 Dynamic contour image segmentation algorithm, device, terminal and readable storage medium based on Legendre moment and statistical shape model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010076438.3A CN111652891A (en) 2020-01-23 2020-01-23 Dynamic contour image segmentation algorithm, device, terminal and readable storage medium based on Legendre moment and statistical shape model

Publications (1)

Publication Number Publication Date
CN111652891A true CN111652891A (en) 2020-09-11

Family

ID=72348416

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010076438.3A Pending CN111652891A (en) 2020-01-23 2020-01-23 Dynamic contour image segmentation algorithm, device, terminal and readable storage medium based on Legendre moment and statistical shape model

Country Status (1)

Country Link
CN (1) CN111652891A (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109559328A (en) * 2018-11-13 2019-04-02 河海大学 A kind of Fast image segmentation method and device based on Bayesian Estimation and level set

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109559328A (en) * 2018-11-13 2019-04-02 河海大学 A kind of Fast image segmentation method and device based on Bayesian Estimation and level set

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
YAN ZHANG等: "《Statistical Model of Shape Moments with Active Contour Evolution for Shape Detection and Segmentation》", 《JOURNAL OF MATHEMATICAL IMAGING AND VISION》 *

Similar Documents

Publication Publication Date Title
Mescheder et al. Occupancy networks: Learning 3d reconstruction in function space
US10740897B2 (en) Method and device for three-dimensional feature-embedded image object component-level semantic segmentation
Yuan et al. Factorization-based texture segmentation
CN111598998B (en) Three-dimensional virtual model reconstruction method, three-dimensional virtual model reconstruction device, computer equipment and storage medium
CN108875935B (en) Natural image target material visual characteristic mapping method based on generation countermeasure network
CN112634149B (en) Point cloud denoising method based on graph convolution network
CN111127631B (en) Three-dimensional shape and texture reconstruction method, system and storage medium based on single image
CN113450396B (en) Three-dimensional/two-dimensional image registration method and device based on bone characteristics
CN110060329B (en) Mobile terminal human body model reconstruction method based on color depth video stream data
CN113808277B (en) Image processing method and related device
CN110838122A (en) Point cloud segmentation method and device and computer storage medium
CN116416376A (en) Three-dimensional hair reconstruction method, system, electronic equipment and storage medium
CN113449784A (en) Image multi-classification method, device, equipment and medium based on prior attribute map
CN116310095A (en) Multi-view three-dimensional reconstruction method based on deep learning
Xu et al. Generative image completion with image-to-image translation
Angelopoulou et al. Fast 2d/3d object representation with growing neural gas
Fuentes-Jimenez et al. Texture-generic deep shape-from-template
US20100322472A1 (en) Object tracking in computer vision
CN109829857B (en) Method and device for correcting inclined image based on generation countermeasure network
CN116452715A (en) Dynamic human hand rendering method, device and storage medium
CN111652891A (en) Dynamic contour image segmentation algorithm, device, terminal and readable storage medium based on Legendre moment and statistical shape model
CN114332119A (en) Method and related device for generating face attribute change image
CN115100115A (en) Organ image segmentation method, device, equipment and storage medium
CN115170854A (en) End-to-end PCANetV 2-based image classification method and system
Saval-Calvo et al. Evaluation of sampling method effects in 3D non-rigid registration

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination