The invention provides a
lung segmentation method, comprising following steps: step S1, inputting an original image, carrying out preprocessing to the original image; step S2, carrying out coarse segmentation to a
lung region, wherein the step S2 comprises: step S201, setting a threshold value, using the threshold value to carrying out segmentation, carrying out binarization
processing to the preprocessed image, extracting the
lung region and partial background similar to the gray value of the
lung region; step S202, carrying out background backfill starting from the edges at four corners of the image; step S203, finding out a layer of lung with maximum area in the z direction from the top of the head downwards; step S204, carrying out forward and backward layer-by-layer region growth in the z direction by the maximum layer of lung, judging layer by layer, preventing adhesion with the background; step S3, carrying out fine segmentation to the
lung region so as to extract and remove trachea and separate left and right lungs. According to the settings, the segmentation speed is increased; and the segmentation effect is improved.