[go: up one dir, main page]

CN110838126A - Cell image segmentation method, device, computer equipment and storage medium - Google Patents

Cell image segmentation method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN110838126A
CN110838126A CN201911044681.0A CN201911044681A CN110838126A CN 110838126 A CN110838126 A CN 110838126A CN 201911044681 A CN201911044681 A CN 201911044681A CN 110838126 A CN110838126 A CN 110838126A
Authority
CN
China
Prior art keywords
cell
image
segmentation
chain code
cells
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.)
Granted
Application number
CN201911044681.0A
Other languages
Chinese (zh)
Other versions
CN110838126B (en
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 Taili Biotechnology Co ltd
Original Assignee
Dongguan Taili Biological Engineering 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 Dongguan Taili Biological Engineering Co ltd filed Critical Dongguan Taili Biological Engineering Co ltd
Priority to CN201911044681.0A priority Critical patent/CN110838126B/en
Publication of CN110838126A publication Critical patent/CN110838126A/en
Application granted granted Critical
Publication of CN110838126B publication Critical patent/CN110838126B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • G06T5/30Erosion or dilatation, e.g. thinning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration using histogram techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/12Edge-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/155Segmentation; Edge detection involving morphological operators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20036Morphological image processing
    • G06T2207/20041Distance transform
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20112Image segmentation details
    • G06T2207/20152Watershed segmentation

Landscapes

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

Abstract

The application relates to a cell image segmentation method, a cell image segmentation device, a computer device and a storage medium. The method comprises the following steps: reading a cell gray level image; performing histogram equalization operation on the cell gray level image to obtain an equalized image; performing morphological operation on the equalized image to obtain a morphological image; the morphological operations comprise a top hat operation and a gradient operation; detecting the cell edge in the morphological image through an edge detection algorithm to obtain a cell edge image; carrying out binarization processing on the cell edge image to obtain a binarized cell image; and carrying out cell segmentation according to the binary cell image to obtain a cell segmentation image. By adopting the method, the accuracy of cell image segmentation can be improved.

Description

细胞图像分割方法、装置、计算机设备和存储介质Cell image segmentation method, device, computer equipment and storage medium

技术领域technical field

本申请涉及图像处理领域,特别是涉及一种细胞图像分割方法、装置、计算机设备和存储介质。The present application relates to the field of image processing, and in particular, to a cell image segmentation method, device, computer equipment and storage medium.

背景技术Background technique

稳定细胞株筛选在生物技术领域具有重要意义。传统的稳定细胞株筛选方法是检测细胞分泌至培养基中目标蛋白的总量,根据蛋白表达量筛选高产的细胞株,通过表达载体优化和细胞改造等方法,可以提高筛选效率,获得高单细胞产量的稳定生产细胞株,但是上述方法存在操作复杂和耗时较长等不足。随着人工智能技术的发展,人们开始借助高倍显微镜拍摄细胞株图像,采用深度学习等方法对细胞株图像进行筛选,以克服上述不足,这就需要一种能够从细胞图像中快速准确分割出单细胞的图像分割方法。Screening of stable cell lines is of great significance in the field of biotechnology. The traditional stable cell line screening method is to detect the total amount of target protein secreted by cells into the medium, and screen high-yielding cell lines according to the protein expression. However, the above method has disadvantages such as complicated operation and long time-consuming. With the development of artificial intelligence technology, people begin to take cell line images with the help of high-power microscopes, and use deep learning and other methods to screen cell line images to overcome the above shortcomings. Image segmentation methods for cells.

传统的细胞图像分割基于阈值方法来实现,然而,阈值方法受阈值设置的影响较大,容易导致图像分割的不准确,且无法处理细胞粘连情况。The traditional cell image segmentation is based on the threshold method. However, the threshold method is greatly affected by the threshold setting, which easily leads to inaccurate image segmentation and cannot handle cell adhesion.

因此,传统的细胞图像分割方法存在图像分割准确度较低的问题。Therefore, traditional cell image segmentation methods have the problem of low image segmentation accuracy.

发明内容SUMMARY OF THE INVENTION

基于此,有必要针对上述技术问题,提供一种准确度较高的细胞图像分割方法、一种细胞图像分割装置、一种计算机设备和一种计算机可读存储介质。Based on this, it is necessary to provide a high-accuracy cell image segmentation method, a cell image segmentation device, a computer device, and a computer-readable storage medium for the above-mentioned technical problems.

一种细胞图像分割方法,包括:A cell image segmentation method, comprising:

读取细胞灰度图像;Read cell grayscale images;

对所述细胞灰度图像进行直方图均衡化操作,得到均衡化图像;performing a histogram equalization operation on the cell grayscale image to obtain an equalized image;

对所述均衡化图像进行形态学操作,得到形态学图像;所述形态学操作包括顶帽操作和梯度操作;performing a morphological operation on the equalized image to obtain a morphological image; the morphological operation includes a top-hat operation and a gradient operation;

通过边缘检测算法检测所述形态学图像中的细胞边缘,得到细胞边缘图像;Detect the cell edge in the morphological image by an edge detection algorithm to obtain a cell edge image;

对所述细胞边缘图像进行二值化处理,得到二值化细胞图像;performing binarization processing on the cell edge image to obtain a binarized cell image;

根据所述二值化细胞图像进行细胞分割,得到细胞分割图像。Perform cell segmentation according to the binarized cell image to obtain a cell segmentation image.

在其中一个实施例中,所述根据所述二值化细胞图像进行细胞分割,得到细胞分割图像,包括:In one embodiment, the cell segmentation is performed according to the binarized cell image to obtain a cell segmentation image, including:

当所述二值化细胞图像中存在粘连细胞时,通过链码方法计算所述粘连细胞中的细胞个数;When there are adherent cells in the binarized cell image, the number of cells in the adherent cells is calculated by the chain code method;

根据所述粘连细胞中的细胞个数,得到H-minima变换方法中的最优极小值点;According to the number of cells in the adhesion cells, obtain the optimal minimum point in the H-minima transformation method;

根据所述最优极小值点,对所述二值化细胞图像进行距离变换,得到距离变换图像;Perform distance transformation on the binarized cell image according to the optimal minimum point to obtain a distance transformed image;

使用分水岭算法对所述距离变换图像进行分割,得到所述细胞分割图像。The distance transformed image is segmented using a watershed algorithm to obtain the cell segmented image.

在其中一个实施例中,所述当所述二值化细胞图像中存在粘连细胞时,通过链码方法计算所述粘连细胞中的细胞个数,包括:In one embodiment, when there are adherent cells in the binarized cell image, the number of cells in the adherent cells is calculated by a chain code method, including:

对所述二值化细胞图像的链码起始位置进行标记,得到链码起始标记;Marking the chain code start position of the binarized cell image to obtain the chain code start mark;

对所述二值化细胞图像中链码方向发生改变的位置进行标记,得到链码变化标记;Marking the position where the chain code direction changes in the binarized cell image to obtain a chain code change mark;

对所述二值化细胞图像的链码结尾位置进行标记,得到链码结尾标记;Marking the chain code end position of the binarized cell image to obtain the chain code end mark;

根据所述链码起始标记、所述链码变化标记和所述链码结尾标记,计算所述粘连细胞中的细胞个数。According to the chain code start marker, the chain code change marker and the chain code end marker, the number of cells in the adherent cells is calculated.

在其中一个实施例中,所述根据所述粘连细胞中的细胞个数,得到H-minima变换方法中的最优极小值点,包括:In one embodiment, the optimal minimum point in the H-minima transformation method is obtained according to the number of cells in the adherent cells, including:

获取H-minima变换阈值;Get the H-minima transform threshold;

根据所述H-minima变换阈值,得到极小值点个数;According to the H-minima transformation threshold, the number of minimum points is obtained;

通过将所述极小值点个数与所述粘连细胞中的细胞个数进行比较,得到所述最优极小值点。The optimal minimum point is obtained by comparing the number of minimum points with the number of cells in the adherent cells.

在其中一个实施例中,所述对所述细胞边缘图像进行二值化处理,得到二值化细胞图像,包括:In one embodiment, performing binarization processing on the cell edge image to obtain a binarized cell image includes:

对所述细胞边缘图像进行阈值处理,得到阈值化图像;Perform thresholding on the cell edge image to obtain a thresholded image;

通过开运算,去除所述阈值化图像背景中的非细胞区域,得到开运算图像;Through the opening operation, the non-cellular area in the thresholded image background is removed to obtain the opening operation image;

通过闭运算,去除所述开运算图像中的细胞内部边缘,得到闭运算图像;Through the closing operation, the inner edge of the cell in the opening operation image is removed to obtain the closing operation image;

当所述闭运算图像中仍然存在细胞内部边缘时,对所述闭运算图像进行孔洞填充,得到所述二值化细胞图像。When the inner edge of the cell still exists in the closed operation image, the closed operation image is filled with holes to obtain the binarized cell image.

在其中一个实施例中,所述根据所述二值化细胞图像进行细胞分割,得到细胞分割图像,包括:In one embodiment, the cell segmentation is performed according to the binarized cell image to obtain a cell segmentation image, including:

通过在所述二值化细胞图像中查找细胞轮廓,得到细胞轮廓信息;Obtain cell contour information by searching the cell contour in the binarized cell image;

根据所述细胞轮廓信息,获取包含所述细胞轮廓的最小矩形,得到所述细胞分割图像。According to the cell outline information, the smallest rectangle containing the cell outline is obtained to obtain the cell segmentation image.

在其中一个实施例中,所述根据所述二值化细胞图像进行细胞分割,得到细胞分割图像的步骤之后,包括:In one embodiment, after the step of performing cell segmentation according to the binarized cell image to obtain the cell segmentation image, the step includes:

从所述细胞分割图像中,采集细胞信息;所述细胞信息包括细胞尺寸和细胞内部结构;From the cell segmentation image, collect cell information; the cell information includes cell size and cell internal structure;

根据所述细胞信息,得到训练样本数据;所述训练样本数据用于细胞特征识别和细胞筛选。According to the cell information, training sample data is obtained; the training sample data is used for cell feature identification and cell screening.

一种细胞图像分割装置,包括:A cell image segmentation device, comprising:

输入模块,用于读取细胞灰度图像;Input module for reading cell grayscale images;

均衡化模块,用于对所述细胞灰度图像进行直方图均衡化操作,得到均衡化图像;an equalization module, configured to perform a histogram equalization operation on the grayscale image of the cells to obtain an equalized image;

形态学模块,用于对所述均衡化图像进行形态学操作,得到形态学图像;所述形态学操作包括顶帽操作和梯度操作;a morphology module, configured to perform a morphological operation on the equalized image to obtain a morphological image; the morphological operation includes a top-hat operation and a gradient operation;

边缘检测模块,用于通过边缘检测算法检测所述形态学图像中的细胞边缘,得到细胞边缘图像;an edge detection module for detecting the cell edge in the morphological image through an edge detection algorithm to obtain a cell edge image;

二值化模块,用于对所述细胞边缘图像进行二值化处理,得到二值化细胞图像;The binarization module is used for binarizing the cell edge image to obtain a binarized cell image;

分割模块,用于根据所述二值化细胞图像进行细胞分割,得到细胞分割图像。A segmentation module, configured to perform cell segmentation according to the binarized cell image to obtain a cell segmentation image.

一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现以下步骤:A computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

读取细胞灰度图像;Read cell grayscale images;

对所述细胞灰度图像进行直方图均衡化操作,得到均衡化图像;performing a histogram equalization operation on the cell grayscale image to obtain an equalized image;

对所述均衡化图像进行形态学操作,得到形态学图像;所述形态学操作包括顶帽操作和梯度操作;performing a morphological operation on the equalized image to obtain a morphological image; the morphological operation includes a top-hat operation and a gradient operation;

通过边缘检测算法检测所述形态学图像中的细胞边缘,得到细胞边缘图像;Detect the cell edge in the morphological image by an edge detection algorithm to obtain a cell edge image;

对所述细胞边缘图像进行二值化处理,得到二值化细胞图像;performing binarization processing on the cell edge image to obtain a binarized cell image;

根据所述二值化细胞图像进行细胞分割,得到细胞分割图像。Perform cell segmentation according to the binarized cell image to obtain a cell segmentation image.

一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:A computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

读取细胞灰度图像;Read cell grayscale images;

对所述细胞灰度图像进行直方图均衡化操作,得到均衡化图像;performing a histogram equalization operation on the cell grayscale image to obtain an equalized image;

对所述均衡化图像进行形态学操作,得到形态学图像;所述形态学操作包括顶帽操作和梯度操作;performing a morphological operation on the equalized image to obtain a morphological image; the morphological operation includes a top-hat operation and a gradient operation;

通过边缘检测算法检测所述形态学图像中的细胞边缘,得到细胞边缘图像;Detect the cell edge in the morphological image by an edge detection algorithm to obtain a cell edge image;

对所述细胞边缘图像进行二值化处理,得到二值化细胞图像;performing binarization processing on the cell edge image to obtain a binarized cell image;

根据所述二值化细胞图像进行细胞分割,得到细胞分割图像。Perform cell segmentation according to the binarized cell image to obtain a cell segmentation image.

上述细胞图像分割方法、装置、计算机设备和计算机可读存储介质,对读取的细胞灰度图像进行直方图均衡化操作,能够增强图像对比度,清晰化细胞边缘,以便准确检测细胞边缘。对均衡化图像进行形态学操作,可以进一步清晰化细胞边缘,使检测到的细胞边缘更加准确。通过边缘检测算法检测形态学图像中的细胞边缘,得到细胞边缘图像,由于细胞边缘图像中不但包含细胞外轮廓,还包含细胞内部轮廓,还进一步对细胞边缘图像进行二值化处理,以去掉细胞内部轮廓。根据得到的二值化细胞图像进行细胞分割,由于没有细胞内部轮廓的干扰,可以得到准确度较高的细胞分割图像,从而实现单细胞图像的准确分割,在后续的深度学习过程中,能够提供海量高质量的训练样本,提高细胞特征识别和细胞筛选的准确度。The above cell image segmentation method, device, computer equipment and computer-readable storage medium perform histogram equalization operation on the read cell grayscale image, which can enhance the image contrast and clarify the cell edge, so as to accurately detect the cell edge. Morphological operations on the equalized image can further clarify the edge of the cells and make the edge of the detected cells more accurate. The cell edge in the morphological image is detected by the edge detection algorithm, and the cell edge image is obtained. Since the cell edge image contains not only the outer contour of the cell, but also the inner contour of the cell, the cell edge image is further binarized to remove the cells. Internal outline. Perform cell segmentation according to the obtained binarized cell image. Since there is no interference from the inner contour of the cell, a cell segmentation image with high accuracy can be obtained, so as to achieve accurate segmentation of single-cell images. In the subsequent deep learning process, it can provide Massive high-quality training samples improve the accuracy of cell feature recognition and cell screening.

附图说明Description of drawings

图1是一个实施例的一种细胞图像分割方法的流程示意图;1 is a schematic flowchart of a cell image segmentation method according to an embodiment;

图2是一个实施例的一种细胞图像分割方法的应用环境图;Fig. 2 is an application environment diagram of a cell image segmentation method according to an embodiment;

图3A/B/C/D/E是一个实施例的一种细胞图像分割方法的各步骤图像处理结果图;3A/B/C/D/E are image processing result diagrams of each step of a cell image segmentation method according to an embodiment;

图4是一个实施例的一种细胞图像分割方法的图像分割结果图;4 is an image segmentation result diagram of a cell image segmentation method according to an embodiment;

图5A/B是一个实施例的一种细胞图像分割方法的链码方法示意图;5A/B is a schematic diagram of a chain code method of a cell image segmentation method according to an embodiment;

图6是一个实施例的一种细胞图像分割方法的距离变换结果图;Fig. 6 is the distance transformation result diagram of a kind of cell image segmentation method of one embodiment;

图7是一个实施例的一种细胞图像分割方法的分水岭算法示意图;7 is a schematic diagram of a watershed algorithm for a cell image segmentation method according to an embodiment;

图8是一个实施例的一种细胞图像分割装置的结构框图;8 is a structural block diagram of a cell image segmentation device according to an embodiment;

图9是一个实施例的一种计算机设备的内部结构图。FIG. 9 is an internal structure diagram of a computer device according to an embodiment.

具体实施方式Detailed ways

为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application will be described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application.

在一个实施例中,如图1所示,提供了一种细胞图像分割方法。本实施例提供的细胞图像分割方法,可以应用于如图2所示的应用环境中。在该应用环境中,包括有用户终端202和细胞图像分割服务器204。其中,用户终端202可以但不限于是各种能够获取高倍细胞影像的个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备,细胞图像分割服务器204可以但不限于是各种具有图像处理功能的个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备。上述的细胞图像分割方法,以应用于图2中的细胞图像分割服务器204为例进行说明,可以包括以下步骤:In one embodiment, as shown in FIG. 1, a cell image segmentation method is provided. The cell image segmentation method provided in this embodiment can be applied to the application environment shown in FIG. 2 . In this application environment, a user terminal 202 and a cell image segmentation server 204 are included. Wherein, the user terminal 202 can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers and portable wearable devices capable of acquiring high-magnification cell images, and the cell image segmentation server 204 can be, but is not limited to, various types of image processing Functional personal computers, laptops, smartphones, tablets and portable wearables. The above-mentioned cell image segmentation method, which is applied to the cell image segmentation server 204 in FIG. 2 as an example, may include the following steps:

步骤S102,读取细胞灰度图像。Step S102, reading the cell grayscale image.

其中,细胞灰度图像可以为通过显微镜对细胞拍摄到的仅具有灰度值的影像。例如,细胞灰度图像可以为不同时期的CHO(Chinese Hamster Ovary,中国地鼠卵巢)细胞影像的灰度图。The cell grayscale image may be an image with only grayscale values captured by a microscope on the cell. For example, the grayscale images of cells can be grayscale images of CHO (Chinese Hamster Ovary, Chinese Hamster Ovary) cell images at different stages.

具体实现中,在观察周期内拍摄不同时期的CHO细胞影像,将细胞影像存储在细胞图像分割服务器204中,当需要进行图像分割处理时,从细胞图像分割服务器204中读取CHO细胞影像的灰度图。In the specific implementation, CHO cell images of different periods are captured during the observation period, and the cell images are stored in the cell image segmentation server 204. When image segmentation processing is required, the grayscale of the CHO cell image is read from the cell image segmentation server 204. Degree Chart.

例如,可以在细胞株培养过程中选取5个时间点,分别通过高倍显微镜拍摄CHO细胞影像,得到5幅细胞灰度图像,将这些图像存储在细胞图像分割服务器204中,当需要进行细胞图像分割时,从细胞图像分割服务器204中读取一幅细胞灰度图像。For example, 5 time points can be selected during the cell line culture process, and images of CHO cells can be photographed with a high-power microscope to obtain 5 grayscale images of cells, and these images can be stored in the cell image segmentation server 204. When cell image segmentation needs to be performed At the time, a grayscale image of cells is read from the cell image segmentation server 204 .

步骤S104,对细胞灰度图像进行直方图均衡化操作,得到均衡化图像。Step S104, performing a histogram equalization operation on the cell grayscale image to obtain an equalized image.

其中,直方图均衡化操作可以为通过直方图算法对图像中不同元素的对比度进行均衡化的操作。The histogram equalization operation may be an operation of equalizing the contrasts of different elements in the image through a histogram algorithm.

具体实现中,可以对细胞灰度图像进行直方图均衡化操作,统计像素中每个灰度值的个数,计算每个灰度值出现的概率,根据概率对灰度值进行映射。通过直方图均衡化操作,可以起到增强图像对比度,清晰化细胞边缘的作用,以便准确检测细胞边缘。In a specific implementation, a histogram equalization operation can be performed on the cell grayscale image, the number of each grayscale value in a pixel is counted, the probability of each grayscale value occurring is calculated, and the grayscale value is mapped according to the probability. Through the histogram equalization operation, the image contrast can be enhanced and the edge of the cell can be sharpened, so that the edge of the cell can be detected accurately.

实际应用中,可以通过下列公式实现上述的直方图均衡化操作:In practical applications, the above-mentioned histogram equalization operation can be achieved by the following formula:

Figure BDA0002253815110000061
Figure BDA0002253815110000061

其中,round()函数表示取整操作,对括号中自变量的小数位数进行四舍五入运算,M和N分别为细胞灰度图像中长和宽的像素个数,L表示灰度级数,v为细胞灰度图像中的像素值,cdfmin为累积分布函数的最小值,累积分布函数cdf通过下式计算Among them, the round() function represents the rounding operation, which rounds the number of decimal places of the argument in parentheses, M and N are the length and width of pixels in the cell grayscale image respectively, L represents the grayscale level, v is the pixel value in the grayscale image of the cell, cdf min is the minimum value of the cumulative distribution function, and the cumulative distribution function cdf is calculated by the following formula

Figure BDA0002253815110000062
Figure BDA0002253815110000062

其中,px(j)表示灰度级为j的像素出现的概率,即像素值为j的图像的直方图,归一化到[0,1]。Among them, p x (j) represents the probability of the occurrence of the pixel with gray level j, that is, the histogram of the image with the pixel value j, normalized to [0,1].

例如,对于400×300像素的细胞灰度图像,M=400,N=300,采用8比特深度,L为2^8=256,v为每一个像素点的具体灰度值,可以取0~255之间的任意一个值。针对细胞灰度图像中的每一个像素点,根据公式进行改进直方图均衡化操作,得到均衡化图像。For example, for a cell grayscale image of 400×300 pixels, M=400, N=300, 8-bit depth is used, L is 2^8=256, and v is the specific grayscale value of each pixel, which can be 0~ Any value between 255. For each pixel in the cell grayscale image, an improved histogram equalization operation is performed according to the formula to obtain an equalized image.

步骤S106,对均衡化图像进行形态学操作,得到形态学图像。Step S106, performing morphological operations on the equalized image to obtain a morphological image.

其中,形态学操作为对相邻的元素进行连接或将相邻元素分离成独立元素的操作,形态学操作可以具体包括顶帽操作和梯度操作。The morphological operation is an operation of connecting adjacent elements or separating adjacent elements into independent elements, and the morphological operation may specifically include a top-hat operation and a gradient operation.

具体实现中,可以先采用形态学顶帽操作在细胞图像的大幅背景下突出细胞轮廓,然后,采用形态学梯度操作来寻找细胞边缘,通过联合使用形态学顶帽操作和梯度操作,可以确保在后续的边缘检测过程中能够准确提取细胞边缘。In the specific implementation, the morphological top-hat operation can be used to highlight the cell outline in the large background of the cell image, and then the morphological gradient operation can be used to find the cell edge. The cell edge can be accurately extracted in the subsequent edge detection process.

实际应用中,可以令src表示均衡化图像,element表示结构元素,对均衡化图像进行顶帽操作的公式为In practical applications, src can be used to represent an equalized image, and element can be used to represent a structural element. The formula for performing a top-hat operation on an equalized image is:

dst=tophat(src,element)=src-open(src,element)=src-dilate(erode(src,element));dst=tophat(src, element)=src-open(src, element)=src-dilate(erode(src, element));

其中,open(src,element)表示形态学开运算,对src进行先腐蚀再膨胀操作,dilate(src,element)表示膨胀操作。Among them, open(src, element) represents the morphological opening operation, src is first eroded and then dilated, and dilate(src, element) represents the dilation operation.

然后,对图像dst进行梯度操作,公式为Then, the gradient operation is performed on the image dst, and the formula is

dst′=morphgrad(dst,element)=dilate(dst,element)-erode(dst,element);dst'=morph grad (dst,element)=dilate(dst,element)-erode(dst,element);

其中,erode(dst,element)表示对dst进行腐蚀操作,得到的图像dst’为形态学图像。Among them, erode(dst, element) represents the erosion operation on dst, and the obtained image dst' is a morphological image.

步骤S108,通过边缘检测算法检测形态学图像中的细胞边缘,得到细胞边缘图像。Step S108 , detect the cell edge in the morphological image through an edge detection algorithm to obtain a cell edge image.

其中,边缘检测算法为能够识别形态学图像中最优的细胞轮廓的一种算法,可以为Canny方法。Among them, the edge detection algorithm is an algorithm that can identify the optimal cell contour in the morphological image, and can be the Canny method.

具体实现中,Canny方法首先通过高斯平滑滤波器对形态学图像进行降噪处理,然后计算图像中每个像素点的梯度强度和方向,通过非极大值抑制(Non-MaximumSuppression)方法消除杂散响应,排除非边缘像素,保留候选边缘,最后通过双阈值(Double-Threshold)确定细胞边缘。上述Canny方法不容易受到噪声干扰,通过使用双阈值能够分别检测到强边缘和弱边缘,当弱边缘和强边缘相连时,输出图像中包含有弱边缘,得到的边缘检测结果准确度较高。In the specific implementation, the Canny method first denoises the morphological image through a Gaussian smoothing filter, then calculates the gradient intensity and direction of each pixel in the image, and eliminates spurs through the Non-Maximum Suppression method. In response, non-edge pixels were excluded, candidate edges were retained, and finally cell edges were determined by double-threshold. The above Canny method is not easily disturbed by noise, and can detect strong edges and weak edges respectively by using double thresholds. When weak edges and strong edges are connected, the output image contains weak edges, and the obtained edge detection results have high accuracy.

实际应用中,Canny方法可以执行以下步骤:In practical applications, the Canny method can perform the following steps:

(1)使用高斯滤波器对形态学图像做平滑处理,滤除噪声,大小为(2k+1)*(2k+1)的高斯滤波器核生成公式为(1) Use the Gaussian filter to smooth the morphological image and filter out the noise. The Gaussian filter kernel generation formula with the size of (2k+1)*(2k+1) is:

(2)计算形态学图像中每个像素点的梯度强度和方向;(2) Calculate the gradient intensity and direction of each pixel in the morphological image;

(3)通过非极大值抑制方法,消除掉边缘检测所带来的杂散响应;(3) Through the non-maximum suppression method, the spurious response caused by edge detection is eliminated;

(4)通过双阈值检测确定形态学图像中真实和潜在的边缘;(4) Determine real and potential edges in morphological images by double-threshold detection;

(5)通过抑制孤立的弱边缘完成边缘检测,得到细胞边缘图像。(5) Complete edge detection by suppressing isolated weak edges to obtain cell edge images.

步骤S110,对细胞边缘图像进行二值化处理,得到二值化细胞图像。Step S110, performing binarization processing on the cell edge image to obtain a binarized cell image.

其中,二值化处理可以为对细胞边缘图像进行二值化处理,使输出的图像中只包含黑和白两种颜色,可以包括阈值处理、开运算、闭运算和空洞填充。Among them, the binarization processing can be performed on the cell edge image, so that the output image only contains two colors of black and white, and can include threshold processing, opening operation, closing operation and hole filling.

具体实现中,由于CHO细胞内部较复杂,得到的细胞边缘图像不但包含细胞外轮廓,而且还包含细胞的内部轮廓。为了根据细胞外轮廓进行细胞分割,首先对细胞边缘图像进行阈值处理,得到阈值化图像,例如,设置阈值为100,对于细胞边缘图像中灰度值高于100的像素点,令其灰度值为255,对于灰度值低于或等于100的像素点,令其灰度值为0。对阈值化图像做开运算,去除背景中的非细胞区域,得到开运算图像,然后,对开运算图像做闭运算,去除开运算图像中的细胞内部边缘,得到闭运算图像。当闭运算图像中仍然存在细胞内部边缘时,可以对闭运算图像进行孔洞填充,公式为In the specific implementation, since the interior of the CHO cell is relatively complex, the obtained cell edge image not only includes the outer contour of the cell, but also includes the inner contour of the cell. In order to perform cell segmentation according to the extracellular contour, first threshold the cell edge image to obtain a thresholded image, for example, set the threshold value to 100, and set the gray value of the pixel point whose gray value is higher than 100 in the cell edge image. is 255, and for pixels whose gray value is lower than or equal to 100, the gray value is 0. Perform the opening operation on the thresholded image, remove the non-cellular area in the background, and obtain the opening operation image. Then, perform the closing operation on the opening operation image, and remove the inner edge of the cells in the opening operation image to obtain the closing operation image. When the inner edge of the cell still exists in the closed operation image, the hole can be filled in the closed operation image, and the formula is:

Xk=(Xk-1⊕B)∩Ac k=1,2,3...;X k = (X k-1 ⊕B)∩A c k=1,2,3...;

其中,X0为全黑且在孔洞处有一个白像素的图像,B表示结构元,Ac表示闭运算图像的补集,⊕表示B结构元对Xk-1做膨胀操作。Among them, X 0 is an image that is completely black and has a white pixel at the hole, B represents the structuring element, A c represents the complement of the closed operation image, and ⊕ represents that the B structuring element performs the expansion operation on X k-1 .

步骤S112,根据二值化细胞图像进行细胞分割,得到细胞分割图像。Step S112: Perform cell segmentation according to the binarized cell image to obtain a cell segmentation image.

其中,细胞分割为根据二值化细胞图像中的细胞轮廓,将整个单细胞分割出来,得到的细胞分割图像可以为包含整个单细胞外轮廓的最小矩形。The cell segmentation is to segment the entire single cell according to the cell contour in the binarized cell image, and the obtained cell segmentation image can be the smallest rectangle containing the outer contour of the entire single cell.

具体实现中,可以调用opencv库中的findContours函数获取细胞轮廓,调用boundingRect函数获取轮廓最小外界矩形,判断细胞面积,以及存储细胞分割图像。In the specific implementation, you can call the findContours function in the opencv library to obtain the cell contour, call the boundingRect function to obtain the minimum outer rectangle of the contour, determine the cell area, and store the cell segmentation image.

实际应用中,findContours函数采用遍历每个像素点的像素值的原理进行轮廓查找,其公式为In practical applications, the findContours function uses the principle of traversing the pixel value of each pixel to find the contour, and its formula is

contours,hierarchy=cv2.findContours(image,contours, hierarchy=cv2.findContours(image,

cv2.RETR_TREE,;cv2.RETR_TREE,;

cv2.CHAIN_APPROX_SIMPLE)cv2.CHAIN_APPROX_SIMPLE)

其中,cv2为opencv的简写,image为输入的二值化细胞图像,cv2.RETR_TREE是一种检索轮廓的模式——建立一个等级树结构的轮廓,cv2.CHAIN_APPROX_SIMPLE表示一种轮廓的近似办法——压缩水平方向,垂直方向,对角线方向的元素,只保留该方向的终点坐标,例如一个矩形轮廓只需4个点来保存轮廓信息,contours存储的每个轮廓的点向量,contours[i]表示第i个轮廓,hierarchy表示轮廓的拓扑信息,contours[i]轮廓的对应的拓扑信息为hierarchy[i][0]~hierarchy[i][3],分别表示后一个轮廓,前一个轮廓,父轮廓,内嵌轮廓的索引,如果没有对应项,则相应的hierarchy[i]设置为负数。然后遍历轮廓contours[i]。Among them, cv2 is the abbreviation of opencv, image is the input binarized cell image, cv2.RETR_TREE is a mode for retrieving contours - building a hierarchical tree structure contour, cv2.CHAIN_APPROX_SIMPLE represents an approximation method for contours - Compress the elements in the horizontal, vertical, and diagonal directions, and only retain the coordinates of the end point in this direction. For example, a rectangular contour only needs 4 points to save the contour information, and contours stores the point vector of each contour, contours[i] Represents the i-th contour, hierarchy represents the topological information of the contour, and the corresponding topological information of the contours[i] contour is hierarchy[i][0]~hierarchy[i][3], which respectively represent the next contour, the previous contour, Parent contour, the index of the embedded contour, if there is no corresponding item, the corresponding hierarchy[i] is set to a negative number. Then iterate over the contours[i].

boundingRect函数的公式为The formula for the boundingRect function is

x,y,w,h=cv2.boundingRect(contours[i]);x,y,w,h=cv2.boundingRect(contours[i]);

其中x与y分别为轮廓最小外接矩形的左上定点像素坐标,w和h分别为矩形的宽和高,截取该部分,并遍历该区域中像素值为255的像素个数作为该轮廓的面积,然后根据细胞的面积筛选出合适的细胞的轮廓图片,并保存细胞最小外接矩形图。Where x and y are the pixel coordinates of the upper left fixed point of the minimum circumscribed rectangle of the contour, w and h are the width and height of the rectangle, respectively, intercept this part, and traverse the number of pixels with a pixel value of 255 in the area as the area of the contour, Then, according to the area of the cell, the outline image of the appropriate cell is screened, and the minimum circumscribed rectangle image of the cell is saved.

应该理解的是,虽然图1的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图1中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the various steps in the flowchart of FIG. 1 are shown in sequence according to the arrows, these steps are not necessarily executed in the sequence shown by the arrows. Unless explicitly stated herein, the execution of these steps is not strictly limited to the order, and the steps may be executed in other orders. Moreover, at least a part of the steps in FIG. 1 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed and completed at the same time, but may be executed at different times. The execution of these sub-steps or stages The sequence is also not necessarily sequential, but may be performed alternately or alternately with other steps or sub-steps of other steps or at least a portion of a phase.

上述细胞图像分割方法,对读取的细胞灰度图像进行直方图均衡化操作,能够增强图像对比度,清晰化细胞边缘,以便准确检测细胞边缘。对均衡化图像进行形态学操作,可以进一步清晰化细胞边缘,使检测到的细胞边缘更加准确。通过边缘检测算法检测形态学图像中的细胞边缘,得到细胞边缘图像,由于细胞边缘图像中不但包含细胞外轮廓,还包含细胞内部轮廓,还进一步对细胞边缘图像进行二值化处理,以去掉细胞内部轮廓。根据得到的二值化细胞图像进行细胞分割,由于没有细胞内部轮廓的干扰,可以得到准确度较高的细胞分割图像。The above cell image segmentation method performs histogram equalization operation on the read cell grayscale image, which can enhance the image contrast and clarify the cell edge, so as to accurately detect the cell edge. Morphological operations on the equalized image can further clarify the edge of the cells and make the edge of the detected cells more accurate. The cell edge in the morphological image is detected by the edge detection algorithm, and the cell edge image is obtained. Since the cell edge image contains not only the outer contour of the cell, but also the inner contour of the cell, the cell edge image is further binarized to remove the cells. Internal outline. The cell segmentation is performed according to the obtained binarized cell image. Since there is no interference from the inner contour of the cell, a cell segmentation image with high accuracy can be obtained.

图3是一个实施例的一种细胞图像分割方法的各步骤图像处理结果图,其中,图3A为在步骤S102所读取的细胞灰度图像;图3B为经过步骤S104的直方图均衡化处理,得到的均衡化图像;图3C为经过步骤S108的边缘检测,得到的细胞边缘图像;图3D和3E分别为步骤S110二值化处理过程中得到的闭运算图像和二值化细胞图像。Fig. 3 is an image processing result diagram of each step of a cell image segmentation method according to an embodiment, wherein Fig. 3A is a grayscale image of cells read in step S102; Fig. 3B is a histogram equalization process after step S104 , the obtained equalized image; Fig. 3C is the cell edge image obtained after the edge detection in step S108; Figs. 3D and 3E are the closed operation image and the binarized cell image obtained during the binarization process in step S110, respectively.

图4是一个实施例的一种细胞图像分割方法的图像分割结果图,对于图3A中的各个单细胞,分割得到包含单细胞轮廓的最小外界矩形,根据该结果可以计算细胞面积,分割结果保存在细胞图像分割服务器中,可以用于在深度学习中进行细胞特征识别和细胞筛选。FIG. 4 is an image segmentation result diagram of a cell image segmentation method according to an embodiment. For each single cell in FIG. 3A , the minimum outer rectangle containing the outline of the single cell is obtained by segmentation, and the cell area can be calculated according to the result, and the segmentation result is saved. In the cell image segmentation server, it can be used for cell feature recognition and cell screening in deep learning.

在另一个实施例中,上述步骤S112,可以具体包括:当二值化细胞图像中存在粘连细胞时,通过链码方法计算粘连细胞中的细胞个数;根据粘连细胞中的细胞个数,得到H-minima变换方法中的最优极小值点;根据最优极小值点,对二值化细胞图像进行距离变换,得到距离变换图像;使用分水岭算法对距离变换图像进行分割,得到细胞分割图像。In another embodiment, the above step S112 may specifically include: when there are adherent cells in the binarized cell image, calculating the number of cells in the adherent cells by a chain code method; according to the number of cells in the adherent cells, obtaining The optimal minimum point in the H-minima transformation method; according to the optimal minimum point, the binarized cell image is subjected to distance transformation to obtain a distance transformed image; the distance transformed image is segmented using the watershed algorithm to obtain cell segmentation image.

其中,粘连细胞为二值化细胞图像中两个或多个相互粘连的单细胞。Among them, the adherent cells are two or more single cells that adhere to each other in the binarized cell image.

其中,链码方法为基于Freeman链码,对细胞粘连图像进行标记的方法,图5B给出了当两个单细胞粘连时的链码示意图。Among them, the chain code method is based on the Freeman chain code, and the cell adhesion image is marked. FIG. 5B shows a schematic diagram of the chain code when two single cells are adhered.

其中,最优极小值点为H-minima变换方法中当极小值点个数等于粘连细胞个数时的极小值点。Among them, the optimal minimum point is the minimum point when the number of minimum points is equal to the number of adhesion cells in the H-minima transformation method.

具体实现中,当存在粘连细胞时,获取二值化细胞图像中细胞粘连部分的Freeman链码,根据图5A,当采用8连通链码时,像素点的8个方向从右正方向为0开始计数,逆时针依次增加,图5B中的Freeman链码依次为455677567011231233。In the specific implementation, when there are adherent cells, the Freeman chain code of the cell adhesion part in the binarized cell image is obtained. According to Figure 5A, when the 8-connected chain code is used, the eight directions of the pixel point start from 0 in the positive right direction. Counting, increasing counterclockwise, the Freeman chain code in Figure 5B is 455677567011231233.

对Freeman链码进行改进,步骤如下:To improve the Freeman chain code, the steps are as follows:

(1)选取起始位置,加入标记‘B’,如图5B所示;(1) select starting position, add mark 'B', as shown in Figure 5B;

(2)逆时针方向遍历,当相邻的两个链码方向不同时,例如,前一个链码的方向为左上、正左、左下,后一个链码的方向在右上、正右、右下,或者前一个链码方向为左上、正上、右上,而下一个链码方向为左下、正下、右下,则在两个链码中插入‘C’,如图5B中的灰色圆点所示;(2) Traverse in a counterclockwise direction. When the directions of two adjacent chain codes are different, for example, the direction of the previous chain code is upper left, right left, and lower left, and the direction of the latter chain code is upper right, right, and lower right. , or the direction of the previous chain code is upper left, upper right, and upper right, and the direction of the next chain code is lower left, lower, and lower right, then insert 'C' in the two chain codes, as shown in the gray dots in Figure 5B shown;

(3)遍历到链码结尾处加入标记‘E’,如图5B所示。(3) Traverse to the end of the chain code and add the mark 'E', as shown in Figure 5B.

基于改进的Freeman链码,图5B的链码输出为B4556C77C56C70112C3C12C33E,根据实验可以得出,在‘B’和‘E’之间,每增加一个粘连细胞,需要标记的‘C’增加4个,令NC为改进的Freeman链码中‘C’的个数,可以计算粘连细胞中的细胞个数为Based on the improved Freeman chain code, the chain code output in Figure 5B is B4556C77C56C70112C3C12C33E. According to the experiment, it can be concluded that between 'B' and 'E', for each additional adherent cell, 4 'C's need to be marked, so that N C is the number of 'C' in the improved Freeman chain code, and the number of cells in the adherent cells can be calculated as

Figure BDA0002253815110000111
Figure BDA0002253815110000111

根据所得到的粘连细胞个数,确定H-minima变换中的h阈值,可以随机选取h阈值,每个h阈值对应一个极小值点的图像,当图像中极小值点个数等于粘连细胞个数时,可以确定h阈值为当前选取的h阈值,根据确定的h阈值得到最优的极小值点,然后生成极小值像素点集合。According to the obtained number of adhesion cells, determine the h threshold value in the H-minima transformation. The h threshold value can be randomly selected. Each h threshold value corresponds to an image of a minimum point. When the number of minimum points in the image is equal to the number of adhesion cells When the number of h thresholds is determined, the h threshold value can be determined as the currently selected h threshold value, and the optimal minimum value point is obtained according to the determined h threshold value, and then a minimum value pixel point set is generated.

接下来,通过距离变换将二值化细胞图像转换为距离变换图像。采用欧氏距离变换计算二值化细胞图像中非零像素点到极小值点的最小距离,作为该点变换后的值,距离公式如下:Next, the binarized cell image is converted to a distance transformed image by distance transform. The Euclidean distance transformation is used to calculate the minimum distance from the non-zero pixel point to the minimum value point in the binarized cell image, as the transformed value of the point. The distance formula is as follows:

Figure BDA0002253815110000112
Figure BDA0002253815110000112

其中(x,y)是像素值非零点的坐标,(i,j)为极小值点坐标。经过距离变换得到的距离变换图像为灰度图,如图6所示,其中黑色部分为两个细胞,白色区域为“盆地”的边缘,可以将两个细胞分割开来。Where (x, y) is the coordinate of the non-zero pixel value, and (i, j) is the coordinate of the minimum value point. The distance transformed image obtained by distance transformation is a grayscale image, as shown in Figure 6, in which the black part is two cells, and the white area is the edge of the "basin", which can be divided into two cells.

最后,采用分水岭算法对距离变换图像进行分割,通过调用opencv中connectedComponents函数获取距离变换图像的masker标签,其中前景(细胞部分)标签为1,背景为0,从标签为1的地方开始漫水,让水漫起来找到最后的边界,将该边界存储为数据,根据该数据对粘连细胞进行分割,得到如图7所示的细胞分割图像。Finally, the distance-transformed image is segmented by the watershed algorithm, and the masker label of the distance-transformed image is obtained by calling the connectedComponents function in opencv, where the foreground (cell part) label is 1, the background is 0, and the water starts from the place where the label is 1. Let the water diffuse to find the final boundary, store the boundary as data, and segment the adherent cells according to the data to obtain the cell segmentation image shown in Figure 7.

上述细胞图像分割方法,针对二值化细胞图像中存在粘连细胞的情况,通过链码方法,准确获得粘连细胞中的细胞个数,根据细胞个数确定H-minima变换方法中的最优极小值点,根据最优极小值点,对二值化细胞图像进行距离变换得到距离变换图像,距离变换图像实现了对于粘连细胞的分离,使用分水岭算法对距离变换图像进行分割,可以从粘连细胞图像中准确分割出单细胞图像。The above cell image segmentation method, in view of the existence of adherent cells in the binarized cell image, accurately obtains the number of cells in the adherent cells through the chain code method, and determines the optimal minimum value in the H-minima transformation method according to the number of cells. value point, according to the optimal minimum value point, the binarized cell image is subjected to distance transformation to obtain a distance transformed image. The distance transformed image realizes the separation of adhesion cells. The watershed algorithm is used to segment the distance transformed image. Single-cell images are accurately segmented in the image.

在另一个实施例中,上述步骤S112,可以还包括:对二值化细胞图像的链码起始位置进行标记,得到链码起始标记;对二值化细胞图像中链码方向发生改变的位置进行标记,得到链码变化标记;对二值化细胞图像的链码结尾位置进行标记,得到链码结尾标记;根据链码起始标记、链码变化标记和链码结尾标记,计算粘连细胞中的细胞个数。In another embodiment, the above step S112 may further include: marking the starting position of the chain code in the binarized cell image to obtain the starting mark of the chain code; Mark the position of the chain code to obtain the chain code change mark; mark the end position of the chain code of the binarized cell image to obtain the chain code end mark; calculate the adhesion cell according to the chain code start mark, chain code change mark and chain code end mark the number of cells in .

具体实现中,如图5所示,在传统的Freeman链码方法基础上,首先确定链码起始位置,在链码起始位置引入标记‘B’,然后进行逆时针方向遍历,当相邻的两个链码方向不同时,可以确定链码方向发生改变的位置,将其标记为‘C’,最后,当遍历到链码结尾处时,确定链码结尾位置,加入标记‘E’。统计‘B’和‘E’之间的‘C’的个数NC,由于每增加一个粘连细胞,标记‘C’增加4个,可以计算粘连细胞中的细胞个数为

Figure BDA0002253815110000121
由于步骤S112的上述处理过程在前述实施例中已有详细说明,在此不再赘述。In the specific implementation, as shown in Figure 5, on the basis of the traditional Freeman chain code method, first determine the starting position of the chain code, introduce the mark 'B' at the starting position of the chain code, and then traverse counterclockwise. When the direction of the two chain codes is different, the position where the direction of the chain code changes can be determined and marked as 'C'. Finally, when the end of the chain code is traversed, the position of the end of the chain code is determined and the mark 'E' is added. Count the number N C of 'C' between 'B' and 'E', since each additional adherent cell increases the number of labeled 'C' by 4, the number of cells in the adherent cell can be calculated as
Figure BDA0002253815110000121
Since the above-mentioned processing process of step S112 has been described in detail in the foregoing embodiments, it will not be repeated here.

上述方法对二值化细胞图像的链码起始位置、链码方向发生改变的位置和链码结尾位置分别进行标记,根据标记计算粘连细胞中的细胞个数,便于在后续步骤中使用距离变换方法对粘连细胞进行分离,以及使用分水岭算法从粘连细胞图像中准确分割出单细胞图像。The above method marks the starting position of the chain code, the position where the direction of the chain code changes, and the end position of the chain code of the binarized cell image, respectively, and calculates the number of cells in the adherent cells according to the marks, so as to facilitate the use of distance transformation in subsequent steps. The method separates adherent cells and uses the watershed algorithm to accurately segment single-cell images from adherent cell images.

在另一个实施例中,上述步骤S112,可以还包括:获取H-minima变换阈值;根据H-minima变换阈值,得到极小值点个数;通过将极小值点个数与粘连细胞中的细胞个数进行比较,得到最优极小值点。In another embodiment, the above step S112 may further include: obtaining an H-minima transformation threshold; obtaining the number of minimum points according to the H-minima transformation threshold; The number of cells is compared to obtain the optimal minimum point.

其中,H-minima变换阈值为H-minima变换方法中的h阈值。Among them, the H-minima transformation threshold is the h threshold in the H-minima transformation method.

具体实现中,可以随机选取h阈值,每个h阈值对应一个极小值点的图像,当图像中极小值点个数等于粘连细胞个数时,可以确定h阈值为当前选取的h阈值,根据确定的h阈值得到最优的极小值点,然后生成极小值像素点集合。由于步骤S112的上述处理过程在前述实施例中已有详细说明,在此不再赘述。In the specific implementation, the h threshold can be randomly selected, and each h threshold corresponds to an image of a minimum value point. When the number of minimum value points in the image is equal to the number of adhesion cells, the h threshold value can be determined as the currently selected h threshold value, According to the determined h threshold, the optimal minimum value point is obtained, and then a minimum value pixel point set is generated. Since the above-mentioned processing process of step S112 has been described in detail in the foregoing embodiments, it will not be repeated here.

上述方法根据H-minima变换阈值得到最优极小值点,便于在后续步骤中使用距离变换方法对粘连细胞进行分离,以及使用分水岭算法从粘连细胞图像中准确分割出单细胞图像。The above method obtains the optimal minimum point according to the H-minima transform threshold, which is convenient to use the distance transform method to separate the adherent cells in the subsequent steps, and use the watershed algorithm to accurately segment the single-cell image from the adherent cell image.

在另一个实施例中,上述步骤S110,可以具体包括:对细胞边缘图像进行阈值处理,得到阈值化图像;通过开运算,去除阈值化图像背景中的非细胞区域,得到开运算图像;通过闭运算,去除开运算图像中的细胞内部边缘,得到闭运算图像;当闭运算图像中仍然存在细胞内部边缘时,对闭运算图像进行孔洞填充,得到二值化细胞图像。In another embodiment, the above step S110 may specifically include: performing threshold processing on the cell edge image to obtain a thresholded image; removing non-cellular areas in the background of the thresholded image through an opening operation to obtain an opening operation image; operation, remove the inner edge of the cell in the open operation image, and obtain the closed operation image; when there are still internal cell edges in the closed operation image, the closed operation image is filled with holes to obtain a binarized cell image.

具体实现中,设置一个阈值对细胞边缘图像进行二值化处理,例如,设置阈值为100,对于细胞边缘图像中灰度值高于100的像素点,令其灰度值为255,对于灰度值低于或等于100的像素点,令其灰度值为0。然后进行开运算操作,去除背景中的非细胞区域,以及进行闭运算操作去除开运算图像中的细胞内部边缘,得到的图像如图3D所示的闭运算图像,当闭运算图像中仍然存在细胞内部边缘时,例如,图3D细胞内部的黑色点状区域,对闭运算图像进行孔洞填充,得到如3E所示的二值化细胞图像。由于步骤S110的上述处理过程在前述实施例中已有详细说明,在此不再赘述。In the specific implementation, a threshold is set to binarize the cell edge image. For example, the threshold is set to 100. For the pixel points whose gray value is higher than 100 in the cell edge image, the gray value is set to 255. Pixels whose values are lower than or equal to 100 are assigned a grayscale value of 0. Then perform the opening operation to remove the non-cellular area in the background, and perform the closing operation to remove the inner edge of the cells in the opening operation image, and the obtained image is the closed operation image shown in Figure 3D. When there are still cells in the closed operation image When there is an inner edge, for example, the black dotted area inside the cell in Figure 3D, the closed operation image is filled with holes, resulting in a binarized cell image as shown in 3E. Since the above-mentioned processing process of step S110 has been described in detail in the foregoing embodiments, it will not be repeated here.

上述方法通过阈值处理将细胞边缘图像中的细胞与背景区分开来,便于后续分割细胞图像,开运算可以去除背景区域中的非细胞区域,避免对背景进行错误分割,闭运算可以去除细胞的内部边缘,当闭运算图像中仍然存在细胞内部边缘时,对闭运算图像进行孔洞填充,便于后续针对细胞外边缘得到准确的细胞分割图像。The above method distinguishes the cells in the cell edge image from the background through threshold processing, which is convenient for subsequent segmentation of the cell image. The open operation can remove the non-cellular area in the background area and avoid wrong segmentation of the background. The closed operation can remove the interior of the cell. Edge, when there is still an inner edge of the cell in the closed operation image, fill the hole in the closed operation image, which is convenient to obtain an accurate cell segmentation image for the outer edge of the cell.

在另一个实施例中,上述步骤S112,可以还包括:通过在二值化细胞图像中查找细胞轮廓,得到细胞轮廓信息;根据细胞轮廓信息,获取包含细胞轮廓的最小矩形,得到细胞分割图像。In another embodiment, the above step S112 may further include: obtaining cell contour information by searching the cell contour in the binarized cell image; obtaining the smallest rectangle containing the cell contour according to the cell contour information to obtain the cell segmentation image.

具体实现中,对于如图3E所示的二值化细胞图像,可以调用opencv库中的findContours函数,通过遍历每个像素点的像素值进行轮廓查找,得到细胞轮廓信息,然后,使用boundingRect函数获取轮廓最小外界矩形,判断细胞面积,以及存储细胞分割图像。由于步骤S112的上述处理过程在前述实施例中已有详细说明,在此不再赘述。In the specific implementation, for the binarized cell image shown in Figure 3E, the findContours function in the opencv library can be called to search for the contour by traversing the pixel value of each pixel to obtain the cell contour information, and then use the boundingRect function to obtain Outline the smallest outer rectangle, determine the cell area, and store the cell segmentation image. Since the above-mentioned processing process of step S112 has been described in detail in the foregoing embodiments, it will not be repeated here.

上述方法在二值化细胞图像中查找细胞轮廓,得到的细胞轮廓信息较准确,根据此细胞轮廓信息获取包含细胞轮廓的最小矩形,得到的细胞分割图像准确度较高。The above method searches for the cell contour in the binarized cell image, and the obtained cell contour information is relatively accurate. According to the cell contour information, the smallest rectangle containing the cell contour is obtained, and the obtained cell segmentation image has high accuracy.

在另一个实施例中,上述步骤S112之后,还可以包括:从细胞分割图像中,采集细胞信息;细胞信息包括细胞尺寸和细胞内部结构;根据细胞信息,得到训练样本数据;训练样本数据用于细胞特征识别和细胞筛选。In another embodiment, after the above step S112, the method may further include: collecting cell information from the cell segmentation image; the cell information includes cell size and cell internal structure; obtaining training sample data according to the cell information; the training sample data is used for Cell Characterization and Cell Screening.

其中,细胞信息为单个细胞的尺寸和内部结构等信息。Among them, the cell information is information such as the size and internal structure of a single cell.

具体实现中,可以从图4所示的细胞分割图像中采集每个单细胞的尺寸,以及蛋白表达参数等信息,对采集到的信息进行分类整理,得到训练样本数据,当需要使用深度学习等方法进行细胞特征识别或细胞筛选时,基于训练样本数据进行训练,根据需要实现的功能不同,可以建立细胞特征识别模型或细胞筛选模型,基于建立的模型进行细胞特征识别或细胞筛选。In the specific implementation, information such as the size of each single cell and protein expression parameters can be collected from the cell segmentation image shown in Figure 4, and the collected information can be classified and sorted to obtain training sample data. When deep learning is required, etc. When performing cell feature identification or cell screening, training is performed based on the training sample data, and a cell feature identification model or cell screening model can be established according to different functions to be realized, and cell feature identification or cell screening can be performed based on the established model.

上述方法从细胞分割图像中采集细胞信息,由于细胞分割图像准确度较高,采集到的细胞信息也具有较高的准确度,将该信息作为训练样本,基于该训练样本使用深度学习进行细胞特征识别和细胞筛选,结果具有较高的准确性和较低的运算时间。The above method collects cell information from cell segmentation images. Since the cell segmentation images have high accuracy, the collected cell information also has high accuracy. This information is used as a training sample, and based on the training sample, deep learning is used to perform cell features. Identification and cell screening, resulting in high accuracy and low computational time.

在一个实施例中,如图8所示,提供了一种细胞图像分割装置800,包括:输入模块802、均衡化模块804、形态学模块806、边缘检测模块808、二值化模块810和分割模块812,其中:In one embodiment, as shown in FIG. 8, a cell image segmentation device 800 is provided, including: an input module 802, an equalization module 804, a morphology module 806, an edge detection module 808, a binarization module 810, and a segmentation module Module 812, where:

输入模块802,用于读取细胞灰度图像;an input module 802, configured to read a grayscale image of cells;

均衡化模块804,用于对细胞灰度图像进行直方图均衡化操作,得到均衡化图像;an equalization module 804, configured to perform a histogram equalization operation on the cell grayscale image to obtain an equalized image;

形态学模块806,用于对均衡化图像进行形态学操作,得到形态学图像;Morphology module 806, configured to perform morphological operations on the equalized image to obtain a morphological image;

边缘检测模块808,用于通过边缘检测算法检测形态学图像中的细胞边缘,得到细胞边缘图像;an edge detection module 808, configured to detect the cell edge in the morphological image through an edge detection algorithm to obtain a cell edge image;

二值化模块810,用于对细胞边缘图像进行二值化处理,得到二值化细胞图像;The binarization module 810 is configured to perform binarization processing on the cell edge image to obtain a binarized cell image;

分割模块812,用于根据二值化细胞图像进行细胞分割,得到细胞分割图像。The segmentation module 812 is configured to perform cell segmentation according to the binarized cell image to obtain a cell segmentation image.

在一个实施例中,分割模块812,包括:当二值化细胞图像中存在粘连细胞时,通过链码方法计算粘连细胞中的细胞个数;根据粘连细胞中的细胞个数,得到H-minima变换方法中的最优极小值点;根据最优极小值点,对二值化细胞图像进行距离变换,得到距离变换图像;使用分水岭算法对距离变换图像进行分割,得到细胞分割图像。In one embodiment, the segmentation module 812 includes: when there are adherent cells in the binarized cell image, calculating the number of cells in the adherent cells by a chain code method; obtaining H-minima according to the number of cells in the adherent cells The optimal minimum point in the transformation method; according to the optimal minimum point, the binarized cell image is subjected to distance transformation to obtain a distance transformed image; the distance transformed image is segmented using the watershed algorithm to obtain a cell segmentation image.

在一个实施例中,分割模块812,还包括:对二值化细胞图像的链码起始位置进行标记,得到链码起始标记;对二值化细胞图像中链码方向发生改变的位置进行标记,得到链码变化标记;对二值化细胞图像的链码结尾位置进行标记,得到链码结尾标记;根据链码起始标记、链码变化标记和链码结尾标记,计算粘连细胞中的细胞个数。In one embodiment, the segmentation module 812 further includes: marking the starting position of the chain code in the binarized cell image to obtain the starting mark of the chain code; Mark to get the chain code change mark; mark the chain code end position of the binarized cell image to get the chain code end mark; calculate the chain code start mark, chain code change mark and chain code end mark according to the chain code start mark number of cells.

在一个实施例中,分割模块812,还包括:获取H-minima变换阈值;根据H-minima变换阈值,得到极小值点个数;通过将极小值点个数与粘连细胞中的细胞个数进行比较,得到最优极小值点。In one embodiment, the segmentation module 812 further includes: obtaining an H-minima transform threshold; obtaining the number of minimum points according to the H-minima transform threshold; by comparing the number of minimum points with the number of cells in the adherent cells The numbers are compared to obtain the optimal minimum point.

在一个实施例中,二值化模块810,包括:对细胞边缘图像进行阈值处理,得到阈值化图像;通过开运算,去除阈值化图像背景中的非细胞区域,得到开运算图像;通过闭运算,去除开运算图像中的细胞内部边缘,得到闭运算图像;当闭运算图像中仍然存在细胞内部边缘时,对闭运算图像进行孔洞填充,得到二值化细胞图像。In one embodiment, the binarization module 810 includes: performing thresholding on the cell edge image to obtain a thresholded image; removing non-cellular areas in the background of the thresholded image through an opening operation to obtain an opening operation image; performing a closing operation , remove the inner edge of the cell in the open operation image, and get the closed operation image; when there is still an inner edge of the cell in the closed operation image, fill the hole in the closed operation image to obtain the binarized cell image.

在一个实施例中,分割模块812,还包括:通过在二值化细胞图像中查找细胞轮廓,得到细胞轮廓信息;根据细胞轮廓信息,获取包含细胞轮廓的最小矩形,得到细胞分割图像。In one embodiment, the segmentation module 812 further includes: obtaining cell contour information by searching the cell contour in the binarized cell image; obtaining the smallest rectangle containing the cell contour according to the cell contour information to obtain the cell segmentation image.

在一个实施例中,分割模块812,还包括:从细胞分割图像中,采集细胞信息;细胞信息包括细胞尺寸和细胞内部结构;根据细胞信息,得到训练样本数据;训练样本数据用于细胞特征识别和细胞筛选。In one embodiment, the segmentation module 812 further includes: collecting cell information from the cell segmentation image; the cell information includes cell size and cell internal structure; obtaining training sample data according to the cell information; the training sample data is used for cell feature recognition and cell screening.

关于细胞图像分割装置的具体限定可以参见上文中对于细胞图像分割方法的限定,在此不再赘述。上述细胞图像分割装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific definition of the cell image segmentation device, please refer to the definition of the cell image segmentation method above, which will not be repeated here. Each module in the above cell image segmentation device can be implemented in whole or in part by software, hardware and combinations thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

上述提供的细胞图像分割装置可用于执行上述任意实施例提供的细胞图像分割方法,具备相应的功能和有益效果。The cell image segmentation device provided above can be used to execute the cell image segmentation method provided in any of the foregoing embodiments, and has corresponding functions and beneficial effects.

在一个实施例中,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图可以如图9所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口、显示屏和输入装置。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种空气传感器的室内定位方法。该计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。In one embodiment, a computer device is provided, and the computer device may be a terminal, and its internal structure diagram may be as shown in FIG. 9 . The computer equipment includes a processor, memory, a network interface, a display screen, and an input device connected by a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium, an internal memory. The nonvolatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the execution of the operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. The computer program implements an indoor positioning method of an air sensor when executed by a processor. The display screen of the computer equipment may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment may be a touch layer covered on the display screen, or a button, a trackball or a touchpad set on the shell of the computer equipment , or an external keyboard, trackpad, or mouse.

本领域技术人员可以理解,图9中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in FIG. 9 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied. Include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.

在一个实施例中,提供了一种计算机设备,包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现以下步骤:In one embodiment, a computer device is provided, including a memory and a processor, a computer program is stored in the memory, and the processor implements the following steps when executing the computer program:

读取细胞灰度图像;Read cell grayscale images;

对细胞灰度图像进行直方图均衡化操作,得到均衡化图像;Perform histogram equalization operation on the grayscale image of cells to obtain an equalized image;

对均衡化图像进行形态学操作,得到形态学图像;Perform morphological operations on the equalized image to obtain a morphological image;

通过边缘检测算法检测形态学图像中的细胞边缘,得到细胞边缘图像;The cell edge in the morphological image is detected by edge detection algorithm, and the cell edge image is obtained;

对细胞边缘图像进行二值化处理,得到二值化细胞图像;Perform binarization processing on the cell edge image to obtain a binarized cell image;

根据二值化细胞图像进行细胞分割,得到细胞分割图像。Perform cell segmentation according to the binarized cell image to obtain a cell segmentation image.

在一个实施例中,处理器执行计算机程序时还实现以下步骤:当二值化细胞图像中存在粘连细胞时,通过链码方法计算粘连细胞中的细胞个数;根据粘连细胞中的细胞个数,得到H-minima变换方法中的最优极小值点;根据最优极小值点,对二值化细胞图像进行距离变换,得到距离变换图像;使用分水岭算法对距离变换图像进行分割,得到细胞分割图像。In one embodiment, the processor further implements the following steps when executing the computer program: when there are adherent cells in the binarized cell image, calculating the number of cells in the adherent cells by a chain code method; according to the number of cells in the adherent cells , obtain the optimal minimum point in the H-minima transformation method; according to the optimal minimum point, perform distance transformation on the binarized cell image to obtain the distance transformed image; use the watershed algorithm to segment the distance transformed image to obtain Cell segmentation images.

在一个实施例中,处理器执行计算机程序时还实现以下步骤:对二值化细胞图像的链码起始位置进行标记,得到链码起始标记;对二值化细胞图像中链码方向发生改变的位置进行标记,得到链码变化标记;对二值化细胞图像的链码结尾位置进行标记,得到链码结尾标记;根据链码起始标记、链码变化标记和链码结尾标记,计算粘连细胞中的细胞个数。In one embodiment, the processor further implements the following steps when executing the computer program: marking the starting position of the chain code in the binarized cell image to obtain the starting mark of the chain code; generating a chain code direction in the binarized cell image Mark the changed position to get the chain code change mark; mark the chain code end position of the binarized cell image to get the chain code end mark; calculate the chain code start mark, chain code change mark and chain code end mark according to the chain code start mark, chain code change mark and chain code end mark The number of cells in the adherent cells.

在一个实施例中,处理器执行计算机程序时还实现以下步骤:获取H-minima变换阈值;根据H-minima变换阈值,得到极小值点个数;通过将极小值点个数与粘连细胞中的细胞个数进行比较,得到最优极小值点。In one embodiment, when the processor executes the computer program, the following steps are further implemented: obtaining the H-minima transformation threshold; obtaining the number of minimum points according to the H-minima transformation threshold; Compare the number of cells in and get the optimal minimum point.

在一个实施例中,处理器执行计算机程序时还实现以下步骤:对细胞边缘图像进行阈值处理,得到阈值化图像;通过开运算,去除阈值化图像背景中的非细胞区域,得到开运算图像;通过闭运算,去除开运算图像中的细胞内部边缘,得到闭运算图像;当闭运算图像中仍然存在细胞内部边缘时,对闭运算图像进行孔洞填充,得到二值化细胞图像。In one embodiment, the processor also implements the following steps when executing the computer program: performing threshold processing on the cell edge image to obtain a thresholded image; removing non-cellular areas in the background of the thresholded image through the opening operation to obtain the opening operation image; Through the closing operation, the inner edge of the cell in the open operation image is removed, and the closed operation image is obtained; when the closed operation image still has the inner edge of the cell, the closed operation image is filled with holes to obtain the binarized cell image.

在一个实施例中,处理器执行计算机程序时还实现以下步骤:通过在二值化细胞图像中查找细胞轮廓,得到细胞轮廓信息;根据细胞轮廓信息,获取包含细胞轮廓的最小矩形,得到细胞分割图像。In one embodiment, when the processor executes the computer program, the processor further implements the following steps: obtaining cell contour information by searching the cell contour in the binarized cell image; obtaining the smallest rectangle containing the cell contour according to the cell contour information to obtain cell segmentation image.

在一个实施例中,处理器执行计算机程序时还实现以下步骤:从细胞分割图像中,采集细胞信息;细胞信息包括细胞尺寸和细胞内部结构;根据细胞信息,得到训练样本数据;训练样本数据用于细胞特征识别和细胞筛选。In one embodiment, the processor further implements the following steps when executing the computer program: collecting cell information from the cell segmentation image; cell information including cell size and cell internal structure; obtaining training sample data according to the cell information; for cell characterization and cell screening.

在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:In one embodiment, a computer-readable storage medium is provided on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

读取细胞灰度图像;Read cell grayscale images;

对细胞灰度图像进行直方图均衡化操作,得到均衡化图像;Perform histogram equalization operation on the grayscale image of cells to obtain an equalized image;

对均衡化图像进行形态学操作,得到形态学图像;Perform morphological operations on the equalized image to obtain a morphological image;

通过边缘检测算法检测形态学图像中的细胞边缘,得到细胞边缘图像;The cell edge in the morphological image is detected by edge detection algorithm, and the cell edge image is obtained;

对细胞边缘图像进行二值化处理,得到二值化细胞图像;Perform binarization processing on the cell edge image to obtain a binarized cell image;

根据二值化细胞图像进行细胞分割,得到细胞分割图像。Perform cell segmentation according to the binarized cell image to obtain a cell segmentation image.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:当二值化细胞图像中存在粘连细胞时,通过链码方法计算粘连细胞中的细胞个数;根据粘连细胞中的细胞个数,得到H-minima变换方法中的最优极小值点;根据最优极小值点,对二值化细胞图像进行距离变换,得到距离变换图像;使用分水岭算法对距离变换图像进行分割,得到细胞分割图像。In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: when there are adherent cells in the binarized cell image, the number of cells in the adherent cells is calculated by a chain code method; number to obtain the optimal minimum point in the H-minima transformation method; according to the optimal minimum point, perform distance transformation on the binarized cell image to obtain the distance transformed image; use the watershed algorithm to segment the distance transformed image, Obtain cell segmentation images.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:对二值化细胞图像的链码起始位置进行标记,得到链码起始标记;对二值化细胞图像中链码方向发生改变的位置进行标记,得到链码变化标记;对二值化细胞图像的链码结尾位置进行标记,得到链码结尾标记;根据链码起始标记、链码变化标记和链码结尾标记,计算粘连细胞中的细胞个数。In one embodiment, the computer program further implements the following steps when executed by the processor: marking the starting position of the chain code in the binarized cell image to obtain the starting mark of the chain code; marking the chain code direction in the binarized cell image Mark the changed position to get the chain code change mark; mark the chain code end position of the binarized cell image to get the chain code end mark; according to the chain code start mark, chain code change mark and chain code end mark, Count the number of cells in the adherent cells.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:获取H-minima变换阈值;根据H-minima变换阈值,得到极小值点个数;通过将极小值点个数与粘连细胞中的细胞个数进行比较,得到最优极小值点。In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: obtaining the H-minima transformation threshold; obtaining the number of minimum points according to the H-minima transformation threshold; The number of cells in the cell is compared to obtain the optimal minimum point.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:对细胞边缘图像进行阈值处理,得到阈值化图像;通过开运算,去除阈值化图像背景中的非细胞区域,得到开运算图像;通过闭运算,去除开运算图像中的细胞内部边缘,得到闭运算图像;当闭运算图像中仍然存在细胞内部边缘时,对闭运算图像进行孔洞填充,得到二值化细胞图像。In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: performing threshold processing on the cell edge image to obtain a thresholded image; removing non-cellular areas in the background of the thresholded image through the opening operation to obtain the opening operation image ; Through the closing operation, remove the inner edge of the cell in the open operation image to obtain the closed operation image; when the closed operation image still exists the cell inner edge, fill the hole in the closed operation image to obtain the binarized cell image.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:通过在二值化细胞图像中查找细胞轮廓,得到细胞轮廓信息;根据细胞轮廓信息,获取包含细胞轮廓的最小矩形,得到细胞分割图像。In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: by searching the cell contour in the binarized cell image to obtain cell contour information; according to the cell contour information, obtaining the smallest rectangle containing the cell contour to obtain the cell contour Split the image.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:从细胞分割图像中,采集细胞信息;细胞信息包括细胞尺寸和细胞内部结构;根据细胞信息,得到训练样本数据;训练样本数据用于细胞特征识别和细胞筛选。In one embodiment, the computer program further implements the following steps when executed by the processor: collecting cell information from the cell segmentation image; cell information including cell size and cell internal structure; obtaining training sample data according to the cell information; training sample data For cell characterization and cell screening.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage In the medium, when the computer program is executed, it may include the processes of the above-mentioned method embodiments. Wherein, any reference to memory, storage, database or other medium used in the various embodiments provided in this application may include non-volatile and/or volatile memory. Nonvolatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Road (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be combined arbitrarily. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features It is considered to be the range described in this specification.

以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only represent several embodiments of the present application, and the descriptions thereof are specific and detailed, but should not be construed as a limitation on the scope of the invention patent. It should be pointed out that for those skilled in the art, without departing from the concept of the present application, several modifications and improvements can be made, which all belong to the protection scope of the present application. Therefore, the scope of protection of the patent of the present application shall be subject to the appended claims.

Claims (10)

1. A method of cell image segmentation, comprising:
reading a cell gray level image;
performing histogram equalization operation on the cell gray level image to obtain an equalized image;
performing morphological operation on the equalized image to obtain a morphological image; the morphological operations comprise a top hat operation and a gradient operation;
detecting the cell edge in the morphological image through an edge detection algorithm to obtain a cell edge image;
carrying out binarization processing on the cell edge image to obtain a binarized cell image;
and carrying out cell segmentation according to the binary cell image to obtain a cell segmentation image.
2. The method according to claim 1, wherein said performing cell segmentation based on said binarized cell image to obtain a cell segmentation image comprises:
when the adhesion cells exist in the binarized cell image, calculating the number of the cells in the adhesion cells by a chain code method;
obtaining an optimal minimum value point in an H-minima transformation method according to the number of the cells in the adhesion cells;
according to the optimal minimum value point, performing distance transformation on the binary cell image to obtain a distance transformation image;
and segmenting the distance transformation image by using a watershed algorithm to obtain the cell segmentation image.
3. The method according to claim 2, wherein the calculating the number of cells in the adherent cells by a chain code method when adherent cells are present in the binarized cell image comprises:
marking the chain code initial position of the binary cell image to obtain a chain code initial mark;
marking the position of the chain code with changed direction in the binary cell image to obtain a chain code change mark;
marking the chain code ending position of the binary cell image to obtain a chain code ending mark;
and calculating the cell number in the adherent cells according to the chain code starting marker, the chain code change marker and the chain code ending marker.
4. The method as claimed in claim 2, wherein the obtaining the optimal minimum point in the H-minima transformation method according to the cell number in the adherent cells comprises:
acquiring an H-minima transformation threshold;
obtaining the number of minimum value points according to the H-minima conversion threshold;
and comparing the number of the minimum value points with the number of the cells in the adherent cells to obtain the optimal minimum value points.
5. The method according to claim 1, wherein the binarizing the cell edge image to obtain a binarized cell image comprises:
carrying out threshold processing on the cell edge image to obtain a thresholded image;
removing a non-cell area in the thresholding image background through an opening operation to obtain an opening operation image;
removing the inner edge of the cell in the opening operation image through closing operation to obtain a closing operation image;
and when the internal edges of the cells still exist in the closed operation image, filling holes in the closed operation image to obtain the binary cell image.
6. The method according to claim 1, wherein said performing cell segmentation based on said binarized cell image to obtain a cell segmentation image comprises:
searching a cell contour in the binary cell image to obtain cell contour information;
and acquiring a minimum rectangle containing the cell outline according to the cell outline information to obtain the cell segmentation image.
7. The method according to claim 1, wherein the step of performing cell segmentation based on the binarized cell image to obtain a cell segmentation image is followed by:
collecting cell information from the cell segmentation image; the cellular information includes cell size and cell internal structure;
obtaining training sample data according to the cell information; the training sample data is used for cell feature recognition and cell screening.
8. A cell image segmentation apparatus, comprising:
the input module is used for reading the cell gray level image;
the equalization module is used for carrying out histogram equalization operation on the cell gray level image to obtain an equalized image;
the morphological module is used for performing morphological operation on the equalized image to obtain a morphological image; the morphological operations comprise a top hat operation and a gradient operation;
the edge detection module is used for detecting the cell edges in the morphological image through an edge detection algorithm to obtain a cell edge image;
the binarization module is used for carrying out binarization processing on the cell edge image to obtain a binarization cell image;
and the segmentation module is used for carrying out cell segmentation according to the binary cell image to obtain a cell segmentation image.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the cell image segmentation method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the cell image segmentation method according to any one of claims 1 to 7.
CN201911044681.0A 2019-10-30 2019-10-30 Cell image segmentation method, cell image segmentation device, computer equipment and storage medium Active CN110838126B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911044681.0A CN110838126B (en) 2019-10-30 2019-10-30 Cell image segmentation method, cell image segmentation device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911044681.0A CN110838126B (en) 2019-10-30 2019-10-30 Cell image segmentation method, cell image segmentation device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110838126A true CN110838126A (en) 2020-02-25
CN110838126B CN110838126B (en) 2020-11-17

Family

ID=69575943

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911044681.0A Active CN110838126B (en) 2019-10-30 2019-10-30 Cell image segmentation method, cell image segmentation device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110838126B (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111598029A (en) * 2020-05-21 2020-08-28 东莞太力生物工程有限公司 Method, system, server and storage medium for screening target cell strain
CN111862071A (en) * 2020-07-29 2020-10-30 南通大学 A method for measuring CT value of lumbar 1 vertebral body based on CT image
CN112017730A (en) * 2020-08-26 2020-12-01 东莞太力生物工程有限公司 Cell screening method and device based on expression quantity prediction model
CN112598626A (en) * 2020-12-07 2021-04-02 上海市同仁医院 Analysis method for automatically identifying fat vacuoles in bone marrow slices
CN112750118A (en) * 2021-01-18 2021-05-04 中南大学 Novel method and system for identifying cell number in single cell pore plate sequencing based on automatic visual detection
CN113286079A (en) * 2021-05-10 2021-08-20 迈克医疗电子有限公司 Image focusing method and device, electronic equipment and readable storage medium
CN113537181A (en) * 2021-09-17 2021-10-22 北京慧荣和科技有限公司 CB microkernel microscopic image identification and analysis method and system based on neural network
CN114359325A (en) * 2021-12-31 2022-04-15 南京理工大学智能计算成像研究院有限公司 An accurate segmentation method of cell images based on digital holographic imaging technology
CN114757867A (en) * 2020-12-29 2022-07-15 上海微创卜算子医疗科技有限公司 Cell tracking method, sperm optimization method, electronic device, and storage medium
CN115082783A (en) * 2022-05-30 2022-09-20 华南农业大学 Low-contrast fogdrop image identification method
CN115546462A (en) * 2022-12-01 2022-12-30 南京维拓科技股份有限公司 Method for extracting shape features of product and counting based on image recognition
CN116189178A (en) * 2022-12-30 2023-05-30 广州市明美光电技术有限公司 Identification method, equipment and storage medium for microscopic cell image
CN117078621A (en) * 2023-08-15 2023-11-17 深圳太力生物技术有限责任公司 Cell strain stability determination method, device, computer equipment and storage medium
CN117333929A (en) * 2023-12-01 2024-01-02 贵州省公路建设养护集团有限公司 Method and system for identifying abnormal personnel under road construction based on deep learning

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106295588A (en) * 2016-08-17 2017-01-04 电子科技大学 The automatic identifying method of leukocyte in a kind of leucorrhea micro-image
CN106875404A (en) * 2017-01-18 2017-06-20 宁波摩视光电科技有限公司 The intelligent identification Method of epithelial cell in a kind of leukorrhea micro-image
CN107316077A (en) * 2017-06-21 2017-11-03 上海交通大学 A kind of fat cell automatic counting method based on image segmentation and rim detection
US20190095679A1 (en) * 2017-09-25 2019-03-28 Olympus Corporation Image processing device, cell-cluster recognition apparatus, cell-cluster recognition method, and cell-cluster recognition program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106295588A (en) * 2016-08-17 2017-01-04 电子科技大学 The automatic identifying method of leukocyte in a kind of leucorrhea micro-image
CN106875404A (en) * 2017-01-18 2017-06-20 宁波摩视光电科技有限公司 The intelligent identification Method of epithelial cell in a kind of leukorrhea micro-image
CN107316077A (en) * 2017-06-21 2017-11-03 上海交通大学 A kind of fat cell automatic counting method based on image segmentation and rim detection
US20190095679A1 (en) * 2017-09-25 2019-03-28 Olympus Corporation Image processing device, cell-cluster recognition apparatus, cell-cluster recognition method, and cell-cluster recognition program

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
徐露: "医学显微细胞图像分割算法及荧光强度提取研究", 《中国优秀硕士学位论文全文数据库》 *

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021232616A1 (en) * 2020-05-21 2021-11-25 深圳太力生物技术有限责任公司 Method and system for screening out target cell line, and server and storage medium
CN111598029A (en) * 2020-05-21 2020-08-28 东莞太力生物工程有限公司 Method, system, server and storage medium for screening target cell strain
CN111862071A (en) * 2020-07-29 2020-10-30 南通大学 A method for measuring CT value of lumbar 1 vertebral body based on CT image
CN111862071B (en) * 2020-07-29 2024-03-05 南通大学 Method for measuring CT value of lumbar 1 vertebral body based on CT image
CN112017730A (en) * 2020-08-26 2020-12-01 东莞太力生物工程有限公司 Cell screening method and device based on expression quantity prediction model
CN112017730B (en) * 2020-08-26 2022-08-09 深圳太力生物技术有限责任公司 Cell screening method and device based on expression quantity prediction model
CN112598626A (en) * 2020-12-07 2021-04-02 上海市同仁医院 Analysis method for automatically identifying fat vacuoles in bone marrow slices
CN114757867A (en) * 2020-12-29 2022-07-15 上海微创卜算子医疗科技有限公司 Cell tracking method, sperm optimization method, electronic device, and storage medium
CN112750118A (en) * 2021-01-18 2021-05-04 中南大学 Novel method and system for identifying cell number in single cell pore plate sequencing based on automatic visual detection
CN113286079B (en) * 2021-05-10 2023-04-28 迈克医疗电子有限公司 Image focusing method and device, electronic equipment and readable storage medium
CN113286079A (en) * 2021-05-10 2021-08-20 迈克医疗电子有限公司 Image focusing method and device, electronic equipment and readable storage medium
CN113537181A (en) * 2021-09-17 2021-10-22 北京慧荣和科技有限公司 CB microkernel microscopic image identification and analysis method and system based on neural network
CN114359325A (en) * 2021-12-31 2022-04-15 南京理工大学智能计算成像研究院有限公司 An accurate segmentation method of cell images based on digital holographic imaging technology
CN115082783A (en) * 2022-05-30 2022-09-20 华南农业大学 Low-contrast fogdrop image identification method
CN115546462A (en) * 2022-12-01 2022-12-30 南京维拓科技股份有限公司 Method for extracting shape features of product and counting based on image recognition
CN116189178A (en) * 2022-12-30 2023-05-30 广州市明美光电技术有限公司 Identification method, equipment and storage medium for microscopic cell image
CN117078621A (en) * 2023-08-15 2023-11-17 深圳太力生物技术有限责任公司 Cell strain stability determination method, device, computer equipment and storage medium
CN117333929A (en) * 2023-12-01 2024-01-02 贵州省公路建设养护集团有限公司 Method and system for identifying abnormal personnel under road construction based on deep learning
CN117333929B (en) * 2023-12-01 2024-02-09 贵州省公路建设养护集团有限公司 Method and system for identifying abnormal personnel under road construction based on deep learning

Also Published As

Publication number Publication date
CN110838126B (en) 2020-11-17

Similar Documents

Publication Publication Date Title
CN110838126A (en) Cell image segmentation method, device, computer equipment and storage medium
US11037291B2 (en) System and method for detecting plant diseases
WO2019232853A1 (en) Chinese model training method, chinese image recognition method, device, apparatus and medium
CN111476284B (en) Image recognition model training and image recognition method and device and electronic equipment
Shi et al. Cloud detection of remote sensing images by deep learning
CN109522908B (en) Image Saliency Detection Method Based on Region Label Fusion
Liasis et al. Building extraction in satellite images using active contours and colour features
CN108121991B (en) Deep learning ship target detection method based on edge candidate region extraction
Zhang et al. Road recognition from remote sensing imagery using incremental learning
CN109919002B (en) Yellow stop line identification method and device, computer equipment and storage medium
WO2019232850A1 (en) Method and apparatus for recognizing handwritten chinese character image, computer device, and storage medium
CN101634706B (en) Method for automatically detecting bridge target in high-resolution SAR images
WO2019232852A1 (en) Handwriting training sample obtaining method and apparatus, and device and medium
CN110942013A (en) Satellite image feature extraction method and system based on deep neural network
CN107633226A (en) A kind of human action Tracking Recognition method and system
CN114638818B (en) Image processing methods, devices, electronic equipment and storage media
CN106327507A (en) Color image significance detection method based on background and foreground information
CN111695373B (en) Zebra stripes positioning method, system, medium and equipment
CN107085726A (en) Single character location method in oracle bone rubbings based on multi-method denoising and connected region analysis
CN112528845A (en) Physical circuit diagram identification method based on deep learning and application thereof
CN113239945B (en) Infrared weak and small target detection method utilizing trajectory constraint
CN115690803A (en) Digital image recognition method, device, electronic device and readable storage medium
Li et al. Transition region-based single-object image segmentation
Li et al. Hierarchical clustering driven by cognitive features
Mukherjee et al. Segmentation of natural images based on super pixel and graph merging

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
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20211201

Address after: 518048 No. 323-m, third floor, comprehensive Xinxing phase I, No. 1, Haihong Road, Fubao community, Fubao street, Futian District, Shenzhen, Guangdong Province

Patentee after: Shenzhen Taili Biotechnology Co.,Ltd.

Address before: 523560 building 3 and 4, gaobao green technology city, Tutang village, Changping Town, Dongguan City, Guangdong Province

Patentee before: DONGGUAN TAILI BIOLOGICAL ENGINEERING CO.,LTD.

TR01 Transfer of patent right