A computer device, comprising a memory, a processor, and a computer program, wherein the computer program is stored in the memory and runs on the processor, and the processor executes the computer program to perform the following steps:
- obtaining a plurality of clinical red blood cell images, dividing red blood cells of different shapes at different positions in each of the plurality of clinical red blood cell images into a plurality of submasks, and synthesizing the plurality of submasks corresponding to each of the plurality of clinical red blood cell images to generate one mask, and to obtain a plurality of masks corresponding to the plurality of red blood cell images, wherein each of the plurality of clinical red blood cell images comprises a plurality of red blood cells, and shapes and positions of the plurality of red blood cells on the same red blood cell image are identical or different;
- collecting shape data of the plurality of red blood cells from the plurality of masks to obtain a training data set, calculating a segmentation boundary of each red blood cell in the training data set, and establishing a red blood cell shape data set based on the segmentation boundary of the each red blood cell, wherein the red blood cell shape data set is used to provide the shape data of the plurality of red blood cells during synthesis of a red blood cell image, wherein the processor executes the computer program to collect the shape data of the plurality of red blood cells from the plurality of masks to obtain the training data set, to calculate the segmentation boundary of the each red blood cell in the training data set, and to establish the red blood cell shape data set based on the segmentation boundary of the each red blood cell, comprising the following steps:
- identifying a discontinuous background region in a background image through image segmentation, marking the discontinuous background region, and determining a segmentation threshold;
- performing an edge detection on cell membranes of the plurality of red blood cells in each red blood cell image region by using an edge detection method, and obtaining an 8-connected edge of a single pixel in the each red blood cell image region;
- comparing the segmentation threshold with a grayscale value of a pixel, performing a pixel segmentation on the red blood cell image based on the segmentation threshold and obtaining a plurality of red blood cell image regions, and performing a grayscale stretching on the 8-connected edge of the single pixel in the each red blood cell image region to segment a red blood cell image background and a grayscale value of the 8-connected edge of the single pixel and obtaining a binary image;
- performing a fill operation on the binary image to fill an interior of the each red blood cell in the binary image and obtaining a filled binary image;
- and
- performing a canny edge detection on the filled binary image and obtaining the segmentation boundary of the each red blood cell;
- wherein
- when the grayscale stretching is performed on the 8-connected edge of the single pixel in the each red blood cell image region, segmenting the red blood cell image background and the grayscale value of the 8-connected edge of the single pixel and obtaining the binary image g(i,j) by using a conversion formula of:
- g
-
- (
- i
- ,
- j
- )
- =
- {
- 1
- ,
- f
-
- (
- i
- ,
- j
- )
- ≥
- T
- 0
- ,
- f
-
- (
- i
- ,
- j
- )
- <
- T
- ,
- wherein, T represents the segmentation threshold, f(i,j) represents an input red blood cell image, and g(i,j) represents an output red blood cell image;
- collecting distribution data of the each red blood cell in the red blood cell shape data set;
- and
- synthesizing the red blood cell shape data set into a plurality of red blood cell images.