CN116912133B - Gradient direction correction method and device - Google Patents
Gradient direction correction method and device Download PDFInfo
- Publication number
- CN116912133B CN116912133B CN202311171777.XA CN202311171777A CN116912133B CN 116912133 B CN116912133 B CN 116912133B CN 202311171777 A CN202311171777 A CN 202311171777A CN 116912133 B CN116912133 B CN 116912133B
- Authority
- CN
- China
- Prior art keywords
- pixel
- cell edge
- pixels
- cell
- gradient
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 28
- 238000012937 correction Methods 0.000 title claims abstract description 22
- 238000000605 extraction Methods 0.000 claims description 4
- 238000010586 diagram Methods 0.000 description 11
- 238000012545 processing Methods 0.000 description 6
- 238000011282 treatment Methods 0.000 description 5
- 238000004364 calculation method Methods 0.000 description 3
- 239000000284 extract Substances 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 239000011521 glass Substances 0.000 description 1
- 239000007788 liquid Substances 0.000 description 1
- 238000011160 research Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10056—Microscopic image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30242—Counting objects in image
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
Abstract
The embodiment of the invention provides a gradient direction correction method, which comprises the steps of obtaining a cell image containing cell edge information; calculating a first gradient direction and a curve direction of each pixel at the cell edge, and determining a straight line, and determining coordinate differences of the vertical feet and the pixels from the pixels at the cell edge to the straight line as the curve direction by two pixels of a preset distance forward and a preset distance backward along the cell edge; correcting the first gradient direction according to the signs of the first gradient directions and the signs of the curve directions of all pixels corresponding to the cell edges. In the embodiment of the invention, the straight line is determined by the pixels with the cell edges along the two pixels with the preset forward and backward distances, the coordinate difference value between the pixel and the vertical foot of the straight line is the curve direction of the pixel, the first gradient direction and the curve direction of each pixel at the cell edges are calculated, and the first gradient direction is corrected by the sign of the first gradient direction and the sign of the curve direction, so that the accuracy of calculating the cell center is improved.
Description
Technical Field
The invention relates to the field of image processing, in particular to a gradient direction correction method and a gradient direction correction device.
Background
Cell counting is a commonly used function in biological research, and accurate counting results are very important for the assessment of experiments. Cell counting based on microscopic cell images is currently one of the mainstream methods. Compared with the method of manual cell counting by a microscope, the cell counting based on the microscope cell image has obvious advantages, and can greatly improve the accuracy and the counting efficiency of cell counting, and the accurate calculation of the circle center of the cells is an important circle in the cell counting process.
The hough gradient method is a common circle center calculation method. For an object with an arc shape, the method extracts the edge of the object, each pixel of the edge votes on the pixels along the gradient direction within the preset projection length range, and the pixel with the largest voting value (namely the largest number of straight line intersection points) is the circle center. Because the calculated gradient direction may be the direction towards the center of the circle or the opposite direction to the center of the circle, each pixel where the cell edge is located votes along the gradient direction, if the gradient direction of a large number of pixels is the opposite direction to the center of the circle, the voting value of the true center of the circle is smaller, and thus the true center of the circle may be misjudged as not having the center of the circle. And when the cells are gathered, if the gradient direction of some pixels is the opposite direction of the circle center, voting values of adjacent cells can be disturbed, and the pixels which are positioned between the cells and are used as the background can acquire larger voting values, so that the pixels where the background is positioned are misjudged as the circle center.
The cell image shown in fig. 1 is a gradient image, which contains clear cells and cells in the virtual focus. The cells with the arrows on the left are clear cells, and the gradient direction of the pixels with the edges of the cells is the direction towards the center of the circle, as shown by the arrows on the left; the cells with the arrows on the right are cells with virtual focus, and the gradient direction of the pixels with the edges of the cells is the opposite direction towards the center of the circle, as shown by the arrows on the right. If the gradient direction correction is not carried out on the cells with the virtual focus, the voting value in the cells is very small, the false judgment is easy to be that the circle center does not exist, the ring leakage is caused during the cell counting, and the cell counting is inaccurate.
Disclosure of Invention
The embodiment of the invention provides a gradient direction correction method, which aims to solve the problem of inaccurate cell count caused by misjudgment of circle centers when voting is carried out along a gradient direction in the prior art.
In a first aspect, a gradient direction correction method is provided, including:
acquiring a cell image containing cell edge information;
calculating a first gradient direction and a curve direction of each pixel corresponding to the cell edge, wherein a straight line, coordinate differences of the vertical feet of the pixels from the pixels to the straight line and the pixels of the pixels where the cell edge is located are determined to be the curve direction by two pixels of a preset distance forward and a preset distance backward along the cell edge;
and correcting the first gradient direction according to the signs of the first gradient directions and the signs of the curve directions of all pixels corresponding to the cell edge to obtain a second gradient direction.
In a second aspect, there is provided a gradient direction correcting device comprising:
an acquisition unit configured to acquire a cell image containing cell edge information;
the first calculating unit is used for calculating a first gradient direction and a curve direction of each pixel corresponding to the cell edge, wherein a straight line is determined by two pixels of the pixel where the cell edge is located along the cell edge by a preset distance and a preset distance, and the coordinate difference value of the vertical foot from the pixel to the straight line to the pixel is the curve direction;
and the correcting unit is used for correcting the first gradient direction according to the signs of the first gradient directions and the signs of the curve directions of all pixels corresponding to the cell edge to obtain a second gradient direction.
According to the embodiment of the invention, the straight line is determined by the pixels with the cell edges along the two pixels with the preset forward and backward distances, the coordinate difference value between the pixel and the straight line is the curve direction of the pixel, the first gradient direction and the curve direction of each pixel corresponding to the cell edges are calculated, the first gradient direction is corrected by the sign of the first gradient direction and the sign of the curve direction, the second gradient direction is obtained, the accuracy of calculating the circle center of the cell is improved, and the accuracy of cell counting is further ensured.
Drawings
The foregoing and/or additional aspects and advantages of the invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, in which:
FIG. 1 is a gradient image provided in accordance with a first embodiment of the present invention;
FIG. 2 is a flow chart of a gradient direction correction method according to an embodiment of the invention;
FIG. 3 is a gradient binarized image according to a first embodiment of the present invention;
FIG. 4 is a flow chart of a method for processing a cell edge with a single pixel thickness according to an embodiment of the invention;
FIG. 5 is a schematic diagram of a center point and pixel distribution in the fourth area according to the first embodiment of the present invention;
FIG. 6 is a graph showing the values of the edge regions of cells according to the first embodiment of the present invention;
fig. 7 is a schematic diagram illustrating a curve direction of a pixel a according to a first embodiment of the present invention;
FIG. 8 is a schematic diagram illustrating a curve direction of a pixel B according to a first embodiment of the present invention;
FIG. 9 is a flow chart illustrating a first gradient direction correction method according to an embodiment of the present invention;
FIG. 10 is a schematic diagram showing the gradient direction of the X direction and the sign of the curve direction of the X direction of all pixels corresponding to the cell edge according to the first embodiment of the present invention;
FIG. 11 is a schematic diagram showing the gradient direction of the X direction and the sign of the curve direction of the X direction of all pixels corresponding to the cell edge according to the first embodiment of the present invention;
FIG. 12 is a schematic diagram showing the gradient direction of the X direction after correction of all pixels corresponding to the cell edge according to the first embodiment of the present invention;
FIG. 13 is a graph showing the comparison of effects of cell sorting after uncorrected and corrected treatments according to one embodiment of the present invention;
fig. 14 is a block diagram of a gradient direction correcting device according to a second embodiment of the present invention.
Description of the embodiments
Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar modules or modules having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the invention. On the contrary, the embodiments of the invention include all alternatives, modifications and equivalents as may be included within the spirit and scope of the appended claims.
According to the embodiment of the invention, the straight line is determined by the pixels with the cell edges along the two pixels with the preset forward and backward distances, the coordinate difference value between the pixel and the straight line is the curve direction of the pixel, the first gradient direction and the curve direction of each pixel corresponding to the cell edges are calculated, the first gradient direction is corrected by the sign of the first gradient direction and the sign of the curve direction, the second gradient direction is obtained, the accuracy of calculating the circle center of the cell is improved, and the accuracy of cell counting is further ensured.
Fig. 2 is a flowchart of a gradient direction correction method according to an embodiment of the invention. As shown in fig. 2, the method includes the following steps.
Step S201: cell images containing cell edge information are acquired.
In the embodiment of the invention, the cell image can be a color image or a gray image obtained by shooting a glass slide filled with cell liquid under a microscope light path, wherein the color image or the gray image contains cell edge information. If the image is a color image, a gray image can be obtained through conversion, and then the gray image is converted into other cell images for later steps.
The cell image shown in fig. 1 is a gradient image converted from a gray scale image, and the cell image shown in fig. 3 is a gradient binarized image converted from a gradient image. In both fig. 1 and 3, a large circle is covered with a small circle or arc, and the large circle and the enclosed area thereof represent a cell. For each cell, the large circle, the small circle, and the circular arc are all called cell edges, and all three cover a number of pixels. The cell edge information includes the positions of the covered pixels of the large circle, the small circle and the circular arc, the corresponding pixel values, and the like. In fig. 3, the pixel value of the cell edge cover pixel is 255, and the pixel values of the other pixels are 0.
Step S202: cell edge information of single pixel thickness is extracted from the cell image.
Because the storage mode and the traversing mode of the cell image are in a row-column sequence mode, in order to facilitate the processing of pixels where cell edges are located in subsequent steps, as one embodiment of the invention, cell edge information is extracted from the cell image, and the cell edge information is stored in a one-dimensional array front-back sequence mode.
In order to improve the accuracy of calculating the center of the cell, the cell edge is processed into the cell edge with single pixel thickness, and then the extraction is carried out. As an embodiment of the present invention, as shown in fig. 4, the method of processing the cell edge to a single pixel thickness includes the following steps.
Step S401: judging whether each pixel corresponding to the cell edge meets a preset condition in the four adjacent areas.
Step S402: and removing the pixels meeting the preset conditions to obtain the cell edge with the single pixel thickness.
Fig. 5 lists 4 kinds of center points and the pixel distribution in the four fields. In the embodiment of the present invention, for each pixel corresponding to the edge of the cell, it is determined whether the pixels in the four neighboring regions thereof satisfy any distribution condition as shown in fig. 5, that is, whether the pixel values of the left and upper two pixels thereof are identical to each other, or whether the pixel values of the right and upper two pixels thereof are identical to each other, or whether the pixel values of the left and lower two pixels thereof are identical to each other, or whether the pixel values of the right and lower two pixels thereof are identical to each other, with respect to each pixel. If any distribution condition is satisfied, the pixel values are the same, and the thickness of the non-single pixel is judged, and the pixel (center point) needs to be removed; if none of the 4 cases is satisfied, it is determined as a single pixel thickness. The removal is to set the pixel value of the pixel to other values, such as to the same value as the background. Thereby obtaining a cell edge of single pixel thickness.
In the embodiment of the invention, the method for extracting the cell edge information with single pixel thickness comprises the following steps.
First, connected regions are divided in the gradient binarized image so that connected regions have the same region value and non-connected regions have different region values. The connected region division may use the existing eight-neighborhood marking algorithm, etc., and will not be described here again. Thus, a cell edge becomes a connected region, and a plurality of pixels covered by the connected region have the same region value, and as shown in fig. 6, the region value of the cell edge is 1; different cell edges are areas of non-connectivity, which cover pixels with different area values.
Then, the starting point of each connected region, i.e., the starting point of each cell edge is found. And taking any pixel covered by the cell edge as a central point, and counting the number of pixels with the same regional value as the pixels in the eight neighborhood. If the number is only 1, the pixel is set as the starting point of the connected area, namely the pixel is used as the starting point of the cell edge, and the next step is carried out; if the number is greater than 1, moving the center point to the pixel covered by the next cell edge, and repeating the operation of searching the starting point; if the pixel covered by the cell edge is not able to determine the starting point, the last center point is set as the starting point of the cell edge.
Finally, pixels covered by the cell edge from the starting point are stored in a one-dimensional array in a sequential manner. And taking the starting point as a central point, storing the information of the central point into an array, searching pixels with the area value equal to the area value in the eight adjacent domains according to the clockwise direction or the anticlockwise direction, moving the central point to the pixels after searching, and storing the information of the new central point into the array. The above operation is repeated until all pixels covered by the cell edge are traversed.
Step S203: the first gradient direction and curve direction of each pixel corresponding to the cell edge are calculated.
In the embodiment of the invention, the first gradient direction of each pixel corresponding to the cell edge is calculated according to the gray level diagram. The first gradient direction is defined in the field of image processing, and comprises a gradient direction in the X direction and a gradient direction in the Y direction. And calculating the curve direction of each pixel corresponding to the cell edge according to the gradient binarized image or the cell edge information extracted in the step 202. The curve direction of a pixel where the cell edge is located is: and determining a straight line by two pixels of which the front preset distance and the rear preset distance are along the edge of the cell, wherein the coordinate difference value between the vertical foot of the pixel to the straight line and the pixel is a curve direction. The curved direction also includes a curved direction of the X direction and a curved direction of the Y direction, corresponding to the first gradient direction.
Fig. 7 is a schematic diagram illustrating a curve direction of a pixel a according to an embodiment of the invention. Fig. 8 is a schematic diagram illustrating a curve direction of a pixel B according to an embodiment of the invention. As shown in fig. 7, the coordinates of the pixel a are (100 ), the front 5 pixels and the back 5 pixels along the cell edge are the pixel P1, the pixel P2 (the preset distance is 5 pixels, which is not limited herein), the pixel P1 and the pixel P2 determine a straight line, the vertical foot of the pixel a to the straight line is the pixel P, the coordinates of the pixel P are (150, 160), and the coordinate difference between the pixel P and the pixel a, that is, the curve direction of the pixel a is (50, 60); similarly, as shown in fig. 8, the coordinates of the pixel B are (400,180), which are the pixels P1 and P2 along the cell edge, the pixels P1 and P2 define a straight line, the vertical leg of the pixel B to the straight line is the pixel P, and the coordinates of the pixel P are (380, 190), so that the difference between the coordinates of the pixel P and the pixel B, i.e., the curve direction of the pixel B is (-20, 10).
Step S204: and correcting the first gradient direction according to the signs of the first gradient directions and the signs of the curve directions of all pixels corresponding to the cell edge to obtain a second gradient direction.
As an embodiment of the present invention, a process of correcting the first gradient direction of all pixels corresponding to the cell edge is shown in fig. 9, and the method includes the following steps.
Step S901: for all pixels corresponding to the cell edge, the sign of the first gradient direction and the sign of the curve direction are extracted.
Step S902: if the number of pixels with different numbers in the first gradient direction and the curve direction is more than that of pixels with the same number, the first gradient directions of all pixels corresponding to the cell edge are inverted to obtain a second gradient direction.
As shown in fig. 10, the left side is the gradient direction of the X direction of all pixels corresponding to a certain cell edge, and the right side is the sign of the curve direction of the X direction of all pixels corresponding to the cell edge (1 indicates positive sign, -1 indicates negative sign). And judging whether the gradient direction of each pixel in the X direction and the curve direction of the X direction are different numbers or same numbers. The method of judgment may be to multiply the two and then extract the symbol, which is not limited herein. As shown in fig. 11, the gradient direction in the X direction and the curve direction in the X direction are different numbers, i.e., the number of pixels with different numbers is greater than that of pixels with the same number. The gradient directions in the X direction of all pixels corresponding to the cell edge are inverted to obtain the corrected gradient directions in the X direction, as shown in fig. 12. Similarly, the same processing is performed on the gradient direction in the Y direction and the curve direction in the Y direction of all pixels corresponding to the cell edge, and the corrected gradient direction in the Y direction is obtained. The corrected gradient direction in the X direction and the corrected gradient direction in the Y direction are the second gradient direction. The second gradient direction obtained after correction is to actually correct the arrows on the right in fig. 1 from the opposite direction of the circle center to the direction of the circle center, so that the voting value in the cells of the virtual focus is increased.
In the embodiment of the invention, if the number of pixels with the same sign in the first gradient direction and the curve direction is more than that of pixels with different signs, the first gradient direction of all pixels corresponding to the cell edge is kept unchanged, and the circle center of the cell is calculated according to the first gradient direction kept unchanged in the subsequent steps. The first gradient method which is kept unchanged can also be endowed with the second gradient direction, and the subsequent step calculates the circle center of the cell according to the second gradient direction.
Step S205: and calculating the center of the cell according to the second gradient direction of each pixel corresponding to the edge of the cell.
In the embodiment of the invention, the circle center of the cell is calculated according to the second gradient direction of each pixel corresponding to the edge of the cell, i.e. voting is performed towards the direction of the circle center as much as possible so as to judge the circle center position of the cell. As shown in fig. 13, the left side is a cell image of cells which have not been subjected to correction treatment and cell sorting, the middle is a cell image of cells which have been subjected to cell sorting without correction treatment, and the right side is a cell image of cells which have been subjected to cell sorting after correction treatment. It can be seen that the middle cell image is circled with cells (the position indicated by the arrow), and the cells which are circled in the right cell image are circled (the position indicated by the arrow) after the gradient direction correction treatment, so that the accuracy of cell counting is ensured.
According to the embodiment of the invention, the straight line is determined by the pixels with the cell edges along the two pixels with the preset forward and backward distances, the coordinate difference value between the pixel and the straight line is the curve direction of the pixel, the first gradient direction and the curve direction of each pixel corresponding to the cell edges are calculated, the first gradient direction is corrected by the sign of the first gradient direction and the sign of the curve direction, the second gradient direction is obtained, the accuracy of calculating the circle center of the cell is improved, and the accuracy of cell counting is further ensured.
Fig. 14 is a block diagram of a gradient direction correcting device according to a second embodiment of the present invention, and as shown in fig. 14, the device includes: an acquisition unit 1401, a first calculation unit 1402, and a correction unit 1403.
The acquisition unit is used for acquiring a cell image containing cell edge information.
The first calculating unit is used for calculating a first gradient direction and a curve direction of each pixel corresponding to the cell edge, wherein a straight line is determined by two pixels of the pixel where the cell edge is located along the cell edge by a preset distance and a preset distance, and the coordinate difference value of the vertical foot and the pixel from the pixel to the straight line is the curve direction.
The correction unit is used for correcting the first gradient direction according to the signs of the first gradient directions and the signs of the curve directions of all pixels corresponding to the cell edge to obtain a second gradient direction.
Preferably, the correction unit 1403 includes a sign sub-unit and an inversion sub-unit.
The sign subunit is configured to extract, for all pixels corresponding to the cell edge, a sign of the first gradient direction and a sign of the curve direction.
The inverting subunit is configured to invert the first gradient directions of all pixels corresponding to the cell edge to obtain a second gradient direction if the pixels with different numbers in the first gradient direction and the curve direction are more than the pixels with the same number.
Preferably, the first gradient direction includes a gradient direction of the X direction and a gradient direction of the Y direction, and the curved direction includes a curved direction of the X direction and a curved direction of the Y direction.
Further, the gradient direction correcting device further comprises an extraction unit. The extraction unit is used for extracting cell edge information of single pixel thickness from the cell image.
Further, the gradient direction correcting device further includes a second calculating unit. The second calculating unit is used for calculating the circle center of the cell according to the second gradient direction of each pixel corresponding to the edge of the cell.
The gradient direction correcting method operated in the gradient direction correcting device corresponds to the method described in the first embodiment one by one, and will not be described herein.
According to the embodiment of the invention, the straight line is determined by the pixels with the cell edges along the two pixels with the preset forward and backward distances, the coordinate difference value between the pixel and the straight line is the curve direction of the pixel, the first gradient direction and the curve direction of each pixel corresponding to the cell edges are calculated, the first gradient direction is corrected by the sign of the first gradient direction and the sign of the curve direction, the second gradient direction is obtained, the accuracy of calculating the circle center of the cell is improved, and the accuracy of cell counting is further ensured.
While embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the invention, and that variations, modifications, alternatives and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the invention.
Claims (6)
1. A method of gradient direction correction, the method comprising:
acquiring a cell image containing cell edge information;
extracting cell edge information with single pixel thickness from the cell image;
calculating a first gradient direction and a curve direction of each pixel corresponding to the cell edge, wherein a straight line is determined by two pixels of the pixel where the cell edge is located along the cell edge by a preset distance and a preset distance, and the coordinate difference value between the pixel and the vertical foot of the straight line and the pixel is the curve direction;
correcting the first gradient direction according to the signs of the first gradient direction and the signs of the curve direction of all pixels corresponding to the cell edge to obtain a second gradient direction;
wherein extracting cell edge information of single pixel thickness from the cell image comprises:
judging whether each pixel corresponding to the cell edge meets a preset condition in the four adjacent areas, wherein the preset condition is that each pixel corresponding to the cell edge is taken as a central point, judging whether the pixels in the four adjacent areas meet any distribution, whether the pixel values of the left pixel and the upper pixel are identical to each other, whether the pixel values of the right pixel and the upper pixel are identical to each other, or whether the pixel values of the left pixel and the lower pixel are identical to each other, or whether the pixel values of the right pixel and the lower pixel are identical to each other;
removing pixels meeting preset conditions to obtain the cell edge with single pixel thickness;
correcting the first gradient direction according to the signs of the first gradient direction and the signs of the curve direction of all pixels corresponding to the cell edge to obtain a second gradient direction comprises:
extracting the signs of the first gradient direction and the signs of the curve direction for all pixels corresponding to the cell edges;
and if the number of pixels with different first gradient directions and curve directions is more than that of pixels with the same number, inverting the first gradient directions of all the pixels corresponding to the cell edge to obtain a second gradient direction.
2. The method of claim 1, wherein the first gradient direction comprises an X-direction gradient direction and a Y-direction gradient direction; the curved direction includes a curved direction of an X direction and a curved direction of a Y direction.
3. The method according to claim 1 or 2, further comprising:
and calculating the center of the cell according to the second gradient direction of each pixel corresponding to the cell edge.
4. A gradient direction correcting device, the device comprising:
an acquisition unit configured to acquire a cell image containing cell edge information;
an extracting unit for extracting cell edge information of single pixel thickness from the cell image;
the first calculating unit is used for calculating a first gradient direction and a curve direction of each pixel corresponding to the cell edge, wherein a straight line is determined by two pixels of which the pixel is located at the cell edge and a preset distance forwards and a preset distance backwards along the cell edge, and the coordinate difference value from the pixel to the vertical foot of the straight line to the pixel is the curve direction;
the correcting unit is used for correcting the first gradient direction according to the signs of the first gradient directions and the signs of the curve directions of all pixels corresponding to the cell edge to obtain a second gradient direction;
the extraction unit specifically comprises:
judging whether each pixel corresponding to the cell edge meets a preset condition in the four adjacent areas, wherein the preset condition is that each pixel corresponding to the cell edge is taken as a central point, judging whether the pixels in the four adjacent areas meet any distribution, whether the pixel values of the left pixel and the upper pixel are identical to each other, whether the pixel values of the right pixel and the upper pixel are identical to each other, or whether the pixel values of the left pixel and the lower pixel are identical to each other, or whether the pixel values of the right pixel and the lower pixel are identical to each other;
removing pixels meeting preset conditions to obtain the cell edge with single pixel thickness;
the correction unit includes:
a sign subunit, configured to extract, for all pixels corresponding to the cell edge, a sign of a first gradient direction and a sign of a curve direction;
and the inverting subunit is used for inverting the first gradient directions of all pixels corresponding to the cell edge to obtain a second gradient direction if the number of the pixels with different first gradient directions and curve directions is more than that of the pixels with the same number.
5. The apparatus of claim 4, wherein the first gradient direction comprises an X-direction gradient direction and a Y-direction gradient direction; the curved direction includes a curved direction of an X direction and a curved direction of a Y direction.
6. The apparatus according to any one of claims 4 or 5, further comprising:
and the second calculating unit is used for calculating the circle center of the cell according to the second gradient direction of each pixel corresponding to the cell edge.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311171777.XA CN116912133B (en) | 2023-09-12 | 2023-09-12 | Gradient direction correction method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311171777.XA CN116912133B (en) | 2023-09-12 | 2023-09-12 | Gradient direction correction method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116912133A CN116912133A (en) | 2023-10-20 |
CN116912133B true CN116912133B (en) | 2023-12-19 |
Family
ID=88351499
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311171777.XA Active CN116912133B (en) | 2023-09-12 | 2023-09-12 | Gradient direction correction method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116912133B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101849240A (en) * | 2007-05-21 | 2010-09-29 | 康奈尔大学 | Method for segmenting objects in images |
CN108074268A (en) * | 2016-11-09 | 2018-05-25 | 安克生医股份有限公司 | Cytology image processing apparatus and cytology image feature quantization method |
CN110717890A (en) * | 2019-09-11 | 2020-01-21 | 北京控制工程研究所 | Butt joint ring identification method and medium |
CN112734743A (en) * | 2021-01-20 | 2021-04-30 | 武汉中旗生物医疗电子有限公司 | Automatic measuring method and device for fetal head circumference |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6115214B2 (en) * | 2012-05-22 | 2017-04-19 | 株式会社リコー | Pattern processing apparatus, pattern processing method, and pattern processing program |
US10360434B2 (en) * | 2016-07-25 | 2019-07-23 | Case Western Reserve University | Multi-pass adaptive voting for nuclei detection in histopathological images |
-
2023
- 2023-09-12 CN CN202311171777.XA patent/CN116912133B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101849240A (en) * | 2007-05-21 | 2010-09-29 | 康奈尔大学 | Method for segmenting objects in images |
CN108074268A (en) * | 2016-11-09 | 2018-05-25 | 安克生医股份有限公司 | Cytology image processing apparatus and cytology image feature quantization method |
CN110717890A (en) * | 2019-09-11 | 2020-01-21 | 北京控制工程研究所 | Butt joint ring identification method and medium |
CN112734743A (en) * | 2021-01-20 | 2021-04-30 | 武汉中旗生物医疗电子有限公司 | Automatic measuring method and device for fetal head circumference |
Non-Patent Citations (2)
Title |
---|
基于选择性阈值取反和径向对称的瞳孔中心定位;赵彦涛等;光电子•激光;第27卷(第11期);第1208-1213页 * |
基于随机Hough变换圆检测算法的MRI质量控制空间线性度自动检测程序设计;林迪逵等;中国医疗设备;第33卷(第10期);第19-22、40页 * |
Also Published As
Publication number | Publication date |
---|---|
CN116912133A (en) | 2023-10-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109978901B (en) | Quick and accurate circular detection and circle center positioning method | |
CN109903282B (en) | Cell counting method, system, device and storage medium | |
CN111369495B (en) | Panoramic image change detection method based on video | |
WO2018209969A1 (en) | Depth map creation method and system and image blurring method and system | |
CN110580481B (en) | Light field image key position detection method based on EPI | |
CN107358628B (en) | Linear array image processing method based on target | |
CN113223068A (en) | Multi-modal image registration method and system based on depth global features | |
CN112580383B (en) | Two-dimensional code identification method and device, electronic equipment and storage medium | |
CN113763350B (en) | Glue line detection method and device, glue line detection equipment and storage medium | |
CN115187602A (en) | Injection molding part defect detection method and system based on image processing | |
CN115131346B (en) | Fermentation tank processing procedure detection method and system based on artificial intelligence | |
CN110570445A (en) | Image segmentation method, device, terminal and readable medium | |
CN116385374A (en) | Cell counting method based on convolutional neural network | |
CN116912133B (en) | Gradient direction correction method and device | |
CN116071272A (en) | Image correction method and device, electronic equipment and storage medium thereof | |
CN112950650B (en) | Deep learning distorted light spot center extraction method suitable for high-precision morphology measurement | |
CN113112511B (en) | Method and device for correcting test paper, storage medium and electronic equipment | |
CN108596840B (en) | Data set enhancement method for deep learning evaluation of vascular network development level | |
CN116563298B (en) | Cross line center sub-pixel detection method based on Gaussian fitting | |
CN112184696A (en) | Method and system for counting cell nucleus and cell organelle and calculating area of cell nucleus and cell organelle | |
CN111768384B (en) | Cell counting method and system based on three-dimensional scanning imaging | |
CN111402281B (en) | Book edge detection method and device | |
CN104616264B (en) | The automatic contrast enhancement method of gene-chip Image | |
CN113808144A (en) | Density peak value clustering soil image shadow detection method based on histogram fitting | |
CN112200873A (en) | Corneal endothelial cell counter positioning photographing method based on iris characteristics |
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 |