WO2024119322A1 - Method and apparatus for evaluating quality of grayscale image, and electronic device and storage medium - Google Patents
Method and apparatus for evaluating quality of grayscale image, and electronic device and storage medium Download PDFInfo
- Publication number
- WO2024119322A1 WO2024119322A1 PCT/CN2022/136658 CN2022136658W WO2024119322A1 WO 2024119322 A1 WO2024119322 A1 WO 2024119322A1 CN 2022136658 W CN2022136658 W CN 2022136658W WO 2024119322 A1 WO2024119322 A1 WO 2024119322A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image
- contour image
- segment
- tissue
- grayscale
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 54
- 238000004364 calculation method Methods 0.000 claims abstract description 36
- 230000011218 segmentation Effects 0.000 claims description 34
- 238000001303 quality assessment method Methods 0.000 claims description 19
- 238000004590 computer program Methods 0.000 claims description 14
- 230000007797 corrosion Effects 0.000 claims description 9
- 238000005260 corrosion Methods 0.000 claims description 9
- 230000010339 dilation Effects 0.000 claims description 2
- 238000012545 processing Methods 0.000 abstract description 10
- 238000011156 evaluation Methods 0.000 abstract description 6
- 238000010586 diagram Methods 0.000 description 21
- 238000005516 engineering process Methods 0.000 description 9
- 230000008569 process Effects 0.000 description 9
- 238000004891 communication Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 7
- 230000003628 erosive effect Effects 0.000 description 6
- 238000013473 artificial intelligence Methods 0.000 description 5
- 239000011159 matrix material Substances 0.000 description 5
- 238000013441 quality evaluation Methods 0.000 description 4
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 3
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 2
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 2
- 238000003709 image segmentation Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000010801 machine learning Methods 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 1
- 230000003416 augmentation Effects 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012886 linear function Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000003058 natural language processing Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
Definitions
- the present disclosure relates to the field of data processing technology, and in particular to a method and device for grayscale image quality assessment, an electronic device, and a storage medium.
- the present disclosure provides a method and device for grayscale image quality assessment, an electronic device and a storage medium.
- the main purpose is to solve the problem that there is no method for assessing the grayscale image quality of the target area tissue.
- the main purpose is to achieve the assessment of the grayscale image quality of the target area tissue.
- a method for grayscale image quality assessment comprising:
- the outer contour image and the inner contour image of the target area tissue grayscale image are calculated respectively;
- the pixel density ratio is the ratio of the pixel proportion of a segment of the outer contour image to a segment of the inner contour image in each of the image combinations, and the pixel proportion is the ratio of the pixel points to the total pixel points;
- the grayscale image quality of the target area tissue is described by calculation according to the pixel density ratio.
- the method before respectively calculating the outer contour image and the inner contour image of the target area tissue grayscale image, the method includes:
- the enhanced tissue grayscale image is subjected to tissue segmentation based on the mask image to obtain the target area tissue grayscale image.
- the step of respectively calculating an outer contour image and an inner contour image of a target area tissue grayscale image comprises:
- the first tissue grayscale image and the target area tissue grayscale image are subjected to differential calculation to obtain an outer contour image
- Corrosion is performed on the target area tissue grayscale image based on the corrosion kernel to obtain a second tissue grayscale image
- the second tissue grayscale image and the target area tissue grayscale image are differentially calculated to obtain an inner contour image.
- dividing the outer contour image and the inner contour image into N segments respectively includes:
- the outer contour image and the inner contour image are respectively divided into N segments based on the segmentation positions.
- pairing each segment of the outer contour image with each segment of the inner contour image in pairs comprises:
- the segment of the external contour image and the segment of the internal contour image are paired.
- the remapping of the grayscale intervals of the tissue grayscale image to obtain an enhanced tissue grayscale image includes:
- the grayscale values whose number of pixels in the tissue grayscale image meets a first preset range are widened, and the first preset range is the number range of pixels corresponding to the grayscale values that play a major role in the display of the tissue grayscale image; the grayscale values whose number of pixels in the tissue grayscale image meets a second preset range are merged, and the second preset range is the number range of pixels corresponding to the grayscale values that do not play a major role in the display of the tissue grayscale image;
- the grayscale values after broadening and merging are remapped to the tissue grayscale image to obtain the enhanced tissue grayscale image.
- the calculating and describing the grayscale image quality of the target area tissue according to the pixel density ratio includes:
- the grayscale image quality of the target area tissue is calculated based on the average value of the pixel density ratio.
- a grayscale image quality assessment device comprising:
- a first calculation unit is used to calculate and obtain an outer contour image and an inner contour image of a target area tissue grayscale image respectively;
- a pairing unit configured to divide the outer contour image and the inner contour image into N segments respectively, and pair each segment of the outer contour image with each segment of the inner contour image in pairs to obtain N image combinations, each of which includes a segment of the outer contour image and a segment of the inner contour image;
- a second calculation unit is used to calculate the pixel density ratio of a segment of the outer contour image to a segment of the inner contour image in each of the image combinations, to obtain N pixel density ratios, wherein the pixel density ratio is the ratio of the pixel proportion of a segment of the outer contour image to a segment of the inner contour image in each of the image combinations, and the pixel proportion is the ratio of the pixel point to the total pixel points;
- a third calculation unit is configured to calculate a grayscale image quality describing the target area tissue according to the pixel density ratio.
- the device comprises:
- An acquisition unit used for acquiring a tissue grayscale image and a mask image, wherein the mask image is a binary image
- a remapping unit used for remapping the grayscale interval of the tissue grayscale image to obtain an enhanced tissue grayscale image
- a segmentation unit is used to perform tissue segmentation on the enhanced tissue grayscale image based on the mask image to obtain the target area tissue grayscale image.
- the first computing unit includes:
- An expansion module used for expanding the target area tissue grayscale image based on the expansion kernel to obtain a first tissue grayscale image
- a first calculation module used for performing a difference calculation between the first tissue grayscale image and the target area tissue grayscale image to obtain an outer contour image
- An erosion module used for eroding the target area tissue grayscale image based on the erosion kernel to obtain a second tissue grayscale image
- the second calculation module is used to perform a difference calculation between the second tissue grayscale image and the target area tissue grayscale image to obtain an inner contour image.
- the pairing unit includes:
- a calibration module used for calibrating the segmentation position of the outer contour image and the inner contour image, wherein the segmentation position of the outer contour image corresponds to the segmentation position value of the inner contour image
- a segmentation module is used to segment the outer contour image and the inner contour image into N segments respectively based on the segmentation position.
- the pairing unit further includes:
- a calculation module used for calculating the centroid of each segment of the external contour image and the centroid of each segment of the internal contour image, wherein the calculated centroid is a description of the shape of each segment of the external contour image and each segment of the internal contour image;
- the pairing module is used to pair the segment of the external contour image with the segment of the internal contour image when the similarity between the centroid of the segment of the external contour image and the centroid of the segment of the internal contour image is greater than a preset threshold.
- the remapping unit includes:
- a stretching and merging module for stretching the grayscale values whose number of pixels in the tissue grayscale image meets a first preset range, wherein the first preset range is the number range of pixels corresponding to the grayscale values that play a major role in displaying the tissue grayscale image; and merging the grayscale values whose number of pixels in the tissue grayscale image meets a second preset range, wherein the second preset range is the number range of pixels corresponding to the grayscale values that do not play a major role in displaying the tissue grayscale image;
- the remapping module is used to remap the grayscale values after widening and merging to the tissue grayscale image to obtain the enhanced tissue grayscale image.
- the third computing unit includes:
- a first calculation module used for calculating an average value of N pixel density ratios
- the second calculation module is used to calculate the grayscale image quality of the target area tissue according to the average value of the pixel density ratio.
- an electronic device including:
- the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect.
- a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the method described in the first aspect.
- a computer program product comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method as described in the first aspect above.
- the present disclosure provides a method and device, electronic device and storage medium for evaluating the quality of grayscale images.
- the main technical scheme includes: respectively calculating the outer contour image and the inner contour image of the target area tissue grayscale image; dividing the outer contour image and the inner contour image into N segments, and pairing each segment of the outer contour image with each segment of the inner contour image to obtain N image combinations, each of which includes a segment of the outer contour image and a segment of the inner contour image; respectively calculating the pixel density ratio of a segment of the outer contour image and a segment of the inner contour image in each of the image combinations to obtain N pixel density ratios, the pixel density ratio is the ratio of the pixel proportion of a segment of the outer contour image and a segment of the inner contour image in each of the image combinations, and the pixel proportion is the ratio of the pixel point to the total pixel point; and calculating the quality of the target area tissue grayscale image according to the pixel density ratio.
- an evaluation score for the quality of the target area tissue grayscale image is obtained, thereby realizing the quality evaluation of the tissue grayscale image.
- FIG1 is a schematic flow chart of a grayscale image quality assessment method provided by an embodiment of the present disclosure
- FIG2 is a schematic diagram of a relationship structure between an external contour image and an internal contour image provided by an embodiment of the present disclosure
- FIG. 3 is a schematic diagram of another structure of the relationship between the external contour image and the internal contour image provided by an embodiment of the present disclosure.
- FIG4 is a schematic diagram of a process of tissue grayscale image segmentation provided by an embodiment of the present disclosure.
- FIG5 is a schematic diagram of an original tissue grayscale image provided by an embodiment of the present disclosure.
- FIG6 is a schematic diagram of a grayscale image of tissue before and after augmentation provided by an embodiment of the present disclosure
- FIG7 is a schematic diagram of a histogram corresponding to an original tissue grayscale image provided by an embodiment of the present disclosure
- FIG8 is a schematic diagram of a histogram corresponding to an enhanced tissue grayscale image provided by an embodiment of the present disclosure
- FIG9 is a schematic diagram of the structure of a grayscale image quality assessment device provided by an embodiment of the present disclosure.
- FIG10 is a schematic diagram of the structure of another grayscale image quality assessment device provided by an embodiment of the present disclosure.
- FIG. 11 is a schematic block diagram of an example electronic device 400 provided according to an embodiment of the present disclosure.
- FIG1 is a schematic flow chart of a grayscale image quality assessment method provided in an embodiment of the present disclosure.
- the method includes the following steps:
- Step 101 respectively calculating and obtaining an outer contour image and an inner contour image of a target area tissue grayscale image.
- the outer contour image and the inner contour image of the target area tissue grayscale image can be obtained respectively based on matrix operation.
- the outer contour image and the inner contour image are band-shaped annular contours, and the outer contour image can surround the inner contour image.
- Step 102 dividing the outer contour image and the inner contour image into N segments respectively, and pairing each segment of the outer contour image with each segment of the inner contour image in pairs to obtain N image combinations, each of which includes a segment of the outer contour image and a segment of the inner contour image.
- Figure 2 is a schematic diagram of the relationship structure between an outer contour image and an inner contour image provided in an embodiment of the present disclosure
- Figure 3 is a schematic diagram of the relationship structure between another outer contour image and an inner contour image provided in an embodiment of the present disclosure.
- the outer contour image and the inner contour image are respectively divided into N segments, that is, the outer contour image is evenly divided into N segments, and the inner contour image is evenly divided into N segments.
- a segment is taken from the N segments of the outer contour image and paired with a segment in the N segments of the inner contour image to form an image combination. After the pairing is completed, N image combinations can be obtained.
- Step 103 respectively calculate the pixel density ratio of a section of the outer contour image to a section of the inner contour image in each of the image combinations to obtain N pixel density ratios, wherein the pixel density ratio is the ratio of the pixel proportion of a section of the outer contour image to a section of the inner contour image in each of the image combinations, and the pixel proportion is the ratio of the pixel point to the total pixel point.
- Calculating the pixel ratio of a segment of the outer contour image includes dividing the number of pixels in the segment of the outer contour image by the total number of pixels in the segment of the outer contour image.
- the pixel points are pixels with grayscale values greater than 127.
- the method for calculating the pixel ratio of a segment of the inner contour image is consistent with the method for calculating the pixel ratio of a segment of the outer contour image, that is, dividing the number of pixels in the segment of the inner contour image by the total number of pixels in the segment of the inner contour image, and so on, and finally calculating the pixel ratios of all segments of the outer contour images and the pixel ratios of all segments of the inner contour images.
- the ratio is the pixel density ratio.
- the section of the outer contour image and the section of the inner contour image exist in an image combination, that is, the two are paired with each other.
- the calculation of the ratio of the pixel ratio of a section of the outer contour image to the pixel ratio of a section of the inner contour image in all image combinations is completed, and finally N pixel density ratios are obtained.
- Step 104 Calculate the grayscale image quality of the target area tissue according to the pixel density ratio.
- the calculation of describing the grayscale image quality of the target area tissue based on the pixel density ratio includes but is not limited to the following implementation methods, for example: substituting the average value of the pixel density ratio into a preset function to calculate a numerical value describing the grayscale image quality of the target area tissue, and the preset function can be a linear function or a nonlinear function.
- the average value of the effective pixel density ratio is x.
- x is greater than 0 and less than 200, it can be substituted into formula (1) to obtain a numerical value describing the grayscale image quality of the target area tissue.
- Formula (1) is as follows:
- the method for evaluating the quality of grayscale images mainly includes the following technical solutions: respectively calculating the outer contour image and the inner contour image of the grayscale image of the target area tissue; respectively dividing the outer contour image and the inner contour image into N segments, and pairing each segment of the outer contour image with each segment of the inner contour image to obtain N image combinations, each of which includes a segment of the outer contour image and a segment of the inner contour image; respectively calculating the pixel density ratio of a segment of the outer contour image to a segment of the inner contour image in each of the image combinations to obtain N pixel density ratios, the pixel density ratio being the ratio of the pixel proportion of a segment of the outer contour image to a segment of the inner contour image in each of the image combinations, the pixel proportion being the ratio of the pixel point to the total pixel point; and calculating and describing the quality of the grayscale image of the target area tissue according to the pixel density ratio.
- an evaluation score for the quality of the grayscale image of the target area tissue is obtained, thereby realizing the quality evaluation of the grayscale image of the tissue.
- FIG4 is a schematic diagram of a process of tissue grayscale image segmentation provided by an embodiment of the present disclosure. As shown in FIG4 ,
- Step 201 Acquire a tissue grayscale image and a mask image, wherein the mask image is a binary image.
- a tissue grayscale image to be segmented is obtained, and a mask image for performing tissue segmentation on the tissue grayscale image is obtained, wherein the mask image is a binary image, that is, the grayscale value of pixels in the mask image is 0 or 255.
- Step 202 remap the grayscale interval of the tissue grayscale image to obtain an enhanced tissue grayscale image.
- step 202 the main purpose of step 202 is to enhance the clarity of the tissue grayscale image.
- the tissue grayscale image is highlighted and the outline of the blurred area is made clearer, so as to finally obtain a clearer tissue grayscale image.
- Step 203 performing tissue segmentation on the enhanced tissue grayscale image based on the mask image to obtain the target area tissue grayscale image.
- the following implementation methods can be adopted but are not limited to, for example: based on the expansion kernel, the target area tissue grayscale image is expanded to obtain a first tissue grayscale image; the first tissue grayscale image and the target area tissue grayscale image are differentially calculated to obtain an outer contour image; based on the erosion kernel, the target area tissue grayscale image is eroded to obtain a second tissue grayscale image; the second tissue grayscale image and the target area tissue grayscale image are differentially calculated to obtain an inner contour image.
- the expansion kernel is a matrix constructed according to the size of the target area tissue grayscale image. If the target area tissue grayscale image is larger, the constructed matrix is larger and has more elements.
- the expansion kernel is used to expand the highlight area of the target area tissue grayscale image to obtain a first tissue grayscale image with an area larger than the target area tissue grayscale image.
- the expansion is actually a convolution calculation of the expansion kernel and the target area tissue grayscale image. Then, the obtained first tissue grayscale image is subjected to a differential calculation with the target area tissue grayscale image to obtain an outer contour image.
- the corrosion process is consistent with the expansion process.
- the corrosion kernel is a matrix constructed according to the size of the target area tissue grayscale image. The larger the target area tissue grayscale image is, the larger the constructed matrix is and the more elements are.
- the corrosion kernel is used to reduce the highlight area of the target area tissue grayscale image to obtain a second tissue grayscale image with an area smaller than the target area tissue grayscale image.
- the corrosion is actually a convolution calculation between the corrosion kernel and the target area tissue grayscale image. Then, the obtained second tissue grayscale image is subjected to a differential calculation with the target area tissue grayscale image to obtain an inner contour image.
- step 102 to divide the outer contour image and the inner contour image into N segments respectively when executing step 102 to divide the outer contour image and the inner contour image into N segments respectively, the following implementation methods can be adopted but are not limited to, for example: calibrating the segmentation positions of the outer contour image and the inner contour image, the segmentation positions of the outer contour image and the segmentation position values of the inner contour image correspond to each other; and dividing the outer contour image and the inner contour image into N segments respectively based on the segmentation positions.
- the calibration of the segmentation position includes: taking the first pixel point A in the outer contour image as the starting point, and dividing it into N segments along the contour line. Searching for the point B closest to point A in the inner contour image as the starting point, and dividing it into N segments along the contour line.
- the outer contour image and the inner contour image can be divided according to the number of pixels, and the contour line refers to treating the outer contour image and the inner contour image as a line without width for easy segmentation.
- the inner contour and the outer contour may be divided by, but not limited to, a preset ratio division, a preset length division, etc.
- the following implementation methods may be adopted but are not limited to, for example: calculating the centroid of each segment of the outer contour image and the centroid of each segment of the inner contour image, the centroid calculated is the description of the shape of each segment of the outer contour image and each segment of the inner contour image; if the similarity between the centroid of a segment of the outer contour image and the centroid of a segment of the inner contour image is greater than a preset threshold, the segment of the outer contour image is paired with the segment of the inner contour image. Pairing the segment of the outer contour image with the segment of the inner contour image based on the centroid is essentially pairing the segment of the outer contour image with the segment of the inner contour image with the shape having the highest similarity to form an image combination.
- the following implementation methods can be adopted but are not limited to, for example: widening the grayscale values whose number of pixels in the tissue grayscale image meets a first preset range, and the first preset range is the number range of pixels corresponding to the grayscale values that play a major role in the display of the tissue grayscale image; merging the grayscale values whose number of pixels in the tissue grayscale image meets a second preset range, and the second preset range is the number range of pixels corresponding to the grayscale values that do not play a major role in the display of the tissue grayscale image; remapping the widened and merged grayscale values to the tissue grayscale image to obtain the enhanced tissue grayscale image.
- the purpose of the above steps is to enhance the clarity of the tissue grayscale image by expanding certain grayscale values to make the highlight area of the tissue grayscale image larger and by merging certain grayscale values to make the outline of the tissue grayscale image more obvious.
- the enhanced tissue grayscale image can be implemented in the following ways, but not limited to:
- the grayscale is divided into 256 blocks to draw the histogram. If it is a 16-bit image, 1 bin contains 256 grayscale levels, and if it is an 8-bit image, 1 bin contains only 1 grayscale level.
- the search from low point to high point is from the histogram 0bin to 255bin, traverse each bin in the histogram. If the value of this bin, that is, val, meets the condition of imgsize/5000 ⁇ val ⁇ imgsize/10, it is a qualified value.
- the search from high point to low point is from the histogram 255bin to 0bin, find the value that meets the condition of imgsize/5000 ⁇ val ⁇ imgsize/10, and stop searching.
- imgsize refers to the total number of pixels of the image
- the bin is the gray value block
- the value of the bin, that is, val is the number of pixels corresponding to each bin.
- Figure 5 is a schematic diagram of an original tissue grayscale image provided in an embodiment of the present disclosure
- Figure 6 is a schematic diagram of a tissue grayscale image before and after enhancement provided in an embodiment of the present disclosure.
- the tissue grayscale image shown in Figure 6 is the effect after the tissue grayscale image of Figure 5 is enhanced.
- Figure 7 is a schematic diagram of a histogram corresponding to an original tissue grayscale image provided in an embodiment of the present disclosure
- Figure 8 is a schematic diagram of a histogram corresponding to an enhanced tissue grayscale image provided in an embodiment of the present disclosure. It can be seen from Figures 7 and 8 that the number of pixels and the corresponding grayscale values in the histogram corresponding to the enhanced tissue image are more discrete, and the selection of the above-mentioned bin value can refer to Figure 7.
- step 104 when executing step 104 to calculate the grayscale image quality of the target area tissue according to the pixel density ratio, the following implementation methods can be adopted but are not limited to, for example: calculating the average value of N pixel density ratios; calculating the grayscale image quality of the target area tissue according to the average value of the pixel density ratio.
- N is a positive integer.
- the influence of noise on the evaluation results can be reduced by dividing the inner contour image and the outer contour image into two segments and then calculating the average value of their pixel density ratio.
- the present invention also provides a grayscale image quality assessment device. Since the device embodiment of the present invention corresponds to the above-mentioned method embodiment, details not disclosed in the device embodiment can be referred to the above-mentioned method embodiment, and will not be repeated in the present invention.
- FIG9 is a schematic diagram of the structure of a grayscale image quality assessment device provided by an embodiment of the present disclosure, as shown in FIG9 , comprising:
- the first calculation unit 31 is used to calculate and obtain the outer contour image and the inner contour image of the target area tissue grayscale image respectively;
- a pairing unit 32 configured to divide the outer contour image and the inner contour image into N segments respectively, and pair each segment of the outer contour image with each segment of the inner contour image in pairs to obtain N image combinations, each of which includes a segment of the outer contour image and a segment of the inner contour image;
- a second calculation unit 33 is used to calculate the pixel density ratio of a segment of the outer contour image to a segment of the inner contour image in each of the image combinations, to obtain N pixel density ratios, wherein the pixel density ratio is the ratio of the pixel proportion of a segment of the outer contour image to a segment of the inner contour image in each of the image combinations, and the pixel proportion is the ratio of the pixel point to the total pixel points;
- the third calculation unit 34 calculates the grayscale image quality of the target area tissue according to the pixel density ratio.
- the device for evaluating the quality of grayscale images includes: respectively calculating the outer contour image and the inner contour image of the grayscale image of the target area tissue; respectively dividing the outer contour image and the inner contour image into N segments, and pairing each segment of the outer contour image with each segment of the inner contour image to obtain N image combinations, each of which includes a segment of the outer contour image and a segment of the inner contour image; respectively calculating the pixel density ratio of a segment of the outer contour image and a segment of the inner contour image in each of the image combinations to obtain N pixel density ratios, the pixel density ratio is the ratio of the pixel proportion of a segment of the outer contour image and a segment of the inner contour image in each of the image combinations, and the pixel proportion is the ratio of the pixel point to the total pixel point; and calculating the quality of the grayscale image of the target area tissue according to the pixel density ratio.
- an evaluation score for the quality of the grayscale image of the target area tissue is obtained, thereby realizing the quality evaluation of the grayscale image of the tissue.
- FIG10 is a schematic diagram of the structure of another grayscale image quality assessment device provided by an embodiment of the present disclosure. As shown in FIG10 , the device includes:
- An acquisition unit 35 used for acquiring a tissue grayscale image and a mask image, wherein the mask image is a binary image
- a remapping unit 36 configured to remap the grayscale interval of the tissue grayscale image to obtain an enhanced tissue grayscale image
- the segmentation unit 37 is used to perform tissue segmentation on the enhanced tissue grayscale image based on the mask image to obtain the target area tissue grayscale image.
- the first calculating unit 31 includes:
- An expansion module 311 is used to expand the target area tissue grayscale image based on the expansion kernel to obtain a first tissue grayscale image
- a first calculation module 312 is used for performing a difference calculation between the first tissue grayscale image and the target area tissue grayscale image to obtain an outer contour image;
- An erosion module 313, configured to erode the target region tissue grayscale image based on the erosion kernel to obtain a second tissue grayscale image
- the second calculation module 314 is used to perform a difference calculation between the second tissue grayscale image and the target area tissue grayscale image to obtain an inner contour image.
- the pairing unit 32 includes:
- a calibration module 321 is used to calibrate the segmentation position of the outer contour image and the inner contour image, wherein the segmentation position of the outer contour image corresponds to the segmentation position value of the inner contour image;
- the segmentation module 322 is used to segment the outer contour image and the inner contour image into N segments respectively based on the segmentation positions.
- the pairing unit 32 further includes:
- the pairing module 324 is configured to pair a segment of the external contour image with a segment of the internal contour image when the similarity between the centroid of a segment of the external contour image and the centroid of a segment of the internal contour image is greater than a preset threshold.
- the remapping unit 36 includes:
- the stretching and merging module 361 is used to stretch the grayscale values whose number of pixels in the tissue grayscale image meets a first preset range, wherein the first preset range is the number range of pixels corresponding to the grayscale values that play a major role in displaying the tissue grayscale image; and to merge the grayscale values whose number of pixels in the tissue grayscale image meets a second preset range, wherein the second preset range is the number range of pixels corresponding to the grayscale values that do not play a major role in displaying the tissue grayscale image;
- the remapping module 362 is used to remap the grayscale values after stretching and merging to the tissue grayscale image to obtain the enhanced tissue grayscale image.
- the third calculation unit 34 includes:
- a first calculation module 341 is used to calculate an average value of N pixel density ratios
- the second calculation module 342 is used to calculate the grayscale image quality of the target area tissue according to the average value of the pixel density ratio.
- the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
- FIG. 11 shows a schematic block diagram of an example electronic device 400 that can be used to implement an embodiment of the present disclosure.
- the electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers.
- the electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices.
- the components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and/or required herein.
- the device 400 includes a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in a ROM (Read-Only Memory) 402 or a computer program loaded from a storage unit 408 into a RAM (Random Access Memory) 403.
- a ROM Read-Only Memory
- RAM Random Access Memory
- various programs and data required for the operation of the device 400 can also be stored.
- the computing unit 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404.
- An I/O (Input/Output) interface 405 is also connected to the bus 404.
- I/O interface 405 Multiple components in the device 400 are connected to the I/O interface 405, including: an input unit 406, such as a keyboard, a mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a disk, an optical disk, etc.; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc.
- the communication unit 409 allows the device 400 to exchange information/data with other devices through a computer network such as the Internet and/or various telecommunication networks.
- the computing unit 401 may be a variety of general and/or special processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a CPU (Central Processing Unit), a GPU (Graphic Processing Units), various dedicated AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, a DSP (Digital Signal Processor), and any appropriate processor, controller, microcontroller, etc.
- the computing unit 401 performs the various methods and processes described above, such as a grayscale image quality assessment method.
- the grayscale image quality assessment method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 408 .
- part or all of the computer program can be loaded and/or installed onto the device 400 via the ROM 402 and/or the communication unit 409.
- the computing unit 401 When the computer program is loaded into RAM 403 and executed by the computing unit 401, one or more steps of the method described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to perform the aforementioned grayscale image quality assessment method in any other appropriate manner (e.g., by means of firmware).
- Various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Array), ASICs (Application-Specific Integrated Circuit), ASSPs (Application Specific Standard Product), SOCs (System On Chip), CPLDs (Complex Programmable Logic Device), computer hardware, firmware, software, and/or combinations thereof.
- FPGAs Field Programmable Gate Array
- ASICs Application-Specific Integrated Circuit
- ASSPs Application Specific Standard Product
- SOCs System On Chip
- CPLDs Complex Programmable Logic Device
- Various embodiments may include being implemented in one or more computer programs that can be executed and/or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
- a programmable processor which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
- the program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, implements the functions/operations specified in the flow chart and/or block diagram.
- the program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
- a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device.
- a machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
- a machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing.
- machine-readable storage media would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, RAM, ROM, EPROM (Electrically Programmable Read-Only-Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
- a computer having: a display device (e.g., a CRT (Cathode-Ray Tube) or an LCD (Liquid Crystal Display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer.
- a display device e.g., a CRT (Cathode-Ray Tube) or an LCD (Liquid Crystal Display) monitor
- a keyboard and pointing device e.g., a mouse or trackball
- the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
- feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
- the systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components.
- the components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), the Internet, and blockchain networks.
- a computer system may include a client and a server.
- the client and the server are generally remote from each other and usually interact through a communication network.
- the relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other.
- the server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short).
- the server may also be a server for a distributed system, or a server combined with a blockchain.
- artificial intelligence is a discipline that studies how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), and includes both hardware-level and software-level technologies.
- Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning/deep learning, big data processing technology, knowledge graph technology, and other major directions.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Image Analysis (AREA)
Abstract
The present disclosure relates to the technical field of data processing. Disclosed are a method and apparatus for evaluating the quality of a grayscale image, and an electronic device and a storage medium. The method comprises: separately performing calculation to obtain an outer contour image and an inner contour image of a grayscale image of tissue in a target region; equally dividing each of the outer contour image and the inner contour image into N segments, and performing pairwise matching on each segment of outer contour image and each segment of inner contour image to obtain N image combinations; separately calculating a pixel density ratio of a segment of outer contour image to a segment of inner contour image in each image combination to obtain N pixel density ratios; and calculating the quality of the grayscale image of the tissue in the target region according to the pixel density ratios, and then describing same. Separately calculating a pixel density ratio of a segment of outer contour image to a segment of inner contour image in each image combination achieves the evaluation of the quality of a grayscale image of tissue in a target region.
Description
本公开涉及数据处理技术领域,尤其涉及一种灰度图像质量评估的方法及装置、电子设备和存储介质。The present disclosure relates to the field of data processing technology, and in particular to a method and device for grayscale image quality assessment, an electronic device, and a storage medium.
目前阶段,在对组织灰度图像进行组织分割得到目标区域组织灰度图像时,还没有一种方法用以评估所述目标区域组织灰度图像的质量,因此,设计一种对所述目标区域组织灰度图像进行质量评估的方法是目前急需解决的问题。At present, when performing tissue segmentation on a tissue grayscale image to obtain a target area tissue grayscale image, there is no method to evaluate the quality of the target area tissue grayscale image. Therefore, designing a method for evaluating the quality of the target area tissue grayscale image is an issue that needs to be urgently addressed.
发明内容Summary of the invention
本公开提供了一种灰度图像质量评估的方法及装置、电子设备和存储介质。其主要目的在于解决还没有一种方法可以对所述目标区域组织灰度图像质量进行评估的问题。其主要目的是为了实现对所述目标区域组织灰度图像质量进行评估。The present disclosure provides a method and device for grayscale image quality assessment, an electronic device and a storage medium. The main purpose is to solve the problem that there is no method for assessing the grayscale image quality of the target area tissue. The main purpose is to achieve the assessment of the grayscale image quality of the target area tissue.
根据本公开的第一方面,提供了一种灰度图像质量评估的方法,其中,包括:According to a first aspect of the present disclosure, a method for grayscale image quality assessment is provided, comprising:
分别计算得到目标区域组织灰度图像的外轮廓图像与内轮廓图像;The outer contour image and the inner contour image of the target area tissue grayscale image are calculated respectively;
将所述外轮廓图像与所述内轮廓图像分别分为N段,并将每段所述外轮廓图像与每段所述内轮廓图像两两配对,得到N个图像组合,每个所述图像组合包括一段外轮廓图像与一段内轮廓图像;Divide the outer contour image and the inner contour image into N segments respectively, and pair each segment of the outer contour image with each segment of the inner contour image in pairs to obtain N image combinations, each of which includes a segment of the outer contour image and a segment of the inner contour image;
分别计算每个所述图像组合中一段外轮廓图像与一段内轮廓图像的像素密度比值,得到N个所述像素密度比值,所述像素密度比值为每个所述图像组合中一段外轮廓图像与一段内轮廓图像的像素占比的比值,所述像素占比为像素点与总像素点的比值;Calculate the pixel density ratio of a segment of the outer contour image to a segment of the inner contour image in each of the image combinations respectively, and obtain N pixel density ratios, wherein the pixel density ratio is the ratio of the pixel proportion of a segment of the outer contour image to a segment of the inner contour image in each of the image combinations, and the pixel proportion is the ratio of the pixel points to the total pixel points;
根据所述像素密度比值计算描述所述目标区域组织灰度图像质量。The grayscale image quality of the target area tissue is described by calculation according to the pixel density ratio.
可选的,在所述分别计算得到目标区域组织灰度图像的外轮廓图像与内轮廓图像之前,包括:Optionally, before respectively calculating the outer contour image and the inner contour image of the target area tissue grayscale image, the method includes:
获取组织灰度图像和掩模图像,所述掩模图像为二值图;Acquire a tissue grayscale image and a mask image, wherein the mask image is a binary image;
对所述组织灰度图像的灰度区间重映射,获得增强组织灰度图像;Remapping the grayscale interval of the tissue grayscale image to obtain an enhanced tissue grayscale image;
基于所述掩模图像对所述增强组织灰度图像进行组织分割,得到所述目标区域组织灰度图像。The enhanced tissue grayscale image is subjected to tissue segmentation based on the mask image to obtain the target area tissue grayscale image.
可选的,所述分别计算得到目标区域组织灰度图像的外轮廓图像与内轮廓图像包括:Optionally, the step of respectively calculating an outer contour image and an inner contour image of a target area tissue grayscale image comprises:
基于膨胀核对目标区域组织灰度图像进行膨胀,得到第一组织灰度图像;Dilate the target region tissue grayscale image based on the dilation kernel to obtain a first tissue grayscale image;
所述第一组织灰度图像与所述目标区域组织灰度图像进行差分计算,得到外轮廓图像;The first tissue grayscale image and the target area tissue grayscale image are subjected to differential calculation to obtain an outer contour image;
基于腐蚀核对目标区域组织灰度图像进行腐蚀,得到第二组织灰度图像;Corrosion is performed on the target area tissue grayscale image based on the corrosion kernel to obtain a second tissue grayscale image;
所述第二组织灰度图像与所述目标区域组织灰度图像进行差分计算,得到内轮廓图像。The second tissue grayscale image and the target area tissue grayscale image are differentially calculated to obtain an inner contour image.
可选的,所述将所述外轮廓图像与所述内轮廓图像分别分为N段,包括:Optionally, dividing the outer contour image and the inner contour image into N segments respectively includes:
标定所述外轮廓图像与所述内轮廓图像的分割位置,所述外轮廓图像的分割位置与所述内轮廓图像的分割位值相互对应;Marking the segmentation position of the outer contour image and the inner contour image, wherein the segmentation position of the outer contour image corresponds to the segmentation position value of the inner contour image;
基于所述分割位置将所述外轮廓图像与所述内轮廓图像分别分割成N段。The outer contour image and the inner contour image are respectively divided into N segments based on the segmentation positions.
可选的,所述将每段所述外轮廓图像与每段所述内轮廓图像两两配对,包括:Optionally, pairing each segment of the outer contour image with each segment of the inner contour image in pairs comprises:
计算每段外部轮廓图像的质心和每段内部轮廓图像的质心,计算得到的质心为每段外部轮廓图像和每段内部轮廓图像的形状的描述;Calculate the centroid of each segment of the external contour image and the centroid of each segment of the internal contour image, and the calculated centroid is a description of the shape of each segment of the external contour image and each segment of the internal contour image;
若一段外部轮廓图像的质心与一段内部轮廓图像的质心相似度大于预设阈值,则对所述一段外部轮廓图像与所述一段内部轮廓图像进行配对。If the similarity between the centroid of a segment of the external contour image and the centroid of a segment of the internal contour image is greater than a preset threshold, the segment of the external contour image and the segment of the internal contour image are paired.
可选的,所述对所述组织灰度图像的灰度区间重映射,获得增强组织灰度图像包括:Optionally, the remapping of the grayscale intervals of the tissue grayscale image to obtain an enhanced tissue grayscale image includes:
对在所述组织灰度图像中像素点个数满足第一预设范围的灰度值进行展宽,所述第一预设范围为对所述组织灰度图像显示起主要作用的灰度值对应的像素点的数量范围;对在所述组织灰度图像中像素点个数满足第二预设范围的灰度值进行归并,所述第二预设范围为对所述组织灰度图像显示不起主要作用的灰度值对应的像素点的数量范围;The grayscale values whose number of pixels in the tissue grayscale image meets a first preset range are widened, and the first preset range is the number range of pixels corresponding to the grayscale values that play a major role in the display of the tissue grayscale image; the grayscale values whose number of pixels in the tissue grayscale image meets a second preset range are merged, and the second preset range is the number range of pixels corresponding to the grayscale values that do not play a major role in the display of the tissue grayscale image;
将展宽和归并后的灰度值重映射至所述组织灰度图像,得到所述增强组织灰度图像。The grayscale values after broadening and merging are remapped to the tissue grayscale image to obtain the enhanced tissue grayscale image.
可选的,所述根据所述像素密度比值计算描述所述目标区域组织灰度图像质量包括:Optionally, the calculating and describing the grayscale image quality of the target area tissue according to the pixel density ratio includes:
计算N个所述像素密度比值的平均值;Calculate the average value of N pixel density ratios;
根据所述像素密度比值的平均值计算描述所述目标区域组织灰度图像质量。The grayscale image quality of the target area tissue is calculated based on the average value of the pixel density ratio.
根据本公开的第二方面,提供了一种灰度图像质量评估装置,包括:According to a second aspect of the present disclosure, there is provided a grayscale image quality assessment device, comprising:
第一计算单元,用于分别计算得到目标区域组织灰度图像的外轮廓图像与内轮廓图像;A first calculation unit is used to calculate and obtain an outer contour image and an inner contour image of a target area tissue grayscale image respectively;
配对单元,用于将所述外轮廓图像与所述内轮廓图像分别分为N段,并将每段所述外轮廓图像与每段所述内轮廓图像两两配对,得到N个图像组合,每个所述图像组合包括一段外轮廓图像与一段内轮廓图像;a pairing unit, configured to divide the outer contour image and the inner contour image into N segments respectively, and pair each segment of the outer contour image with each segment of the inner contour image in pairs to obtain N image combinations, each of which includes a segment of the outer contour image and a segment of the inner contour image;
第二计算单元,用于分别计算每个所述图像组合中一段外轮廓图像与一段内轮廓图像的像素密度比值,得到N个所述像素密度比值,所述像素密度比值为每个所述图像组合中一段外轮廓图像与一段内轮廓图像的像素占比的比值,所述像素占比为像素点与总像素点的比值;A second calculation unit is used to calculate the pixel density ratio of a segment of the outer contour image to a segment of the inner contour image in each of the image combinations, to obtain N pixel density ratios, wherein the pixel density ratio is the ratio of the pixel proportion of a segment of the outer contour image to a segment of the inner contour image in each of the image combinations, and the pixel proportion is the ratio of the pixel point to the total pixel points;
第三计算单元,根据所述像素密度比值计算描述所述目标区域组织灰度图像质量。A third calculation unit is configured to calculate a grayscale image quality describing the target area tissue according to the pixel density ratio.
可选的,所述装置包括:Optionally, the device comprises:
获取单元,用于获取组织灰度图像和掩模图像,所述掩模图像为二值图;An acquisition unit, used for acquiring a tissue grayscale image and a mask image, wherein the mask image is a binary image;
重映射单元,用于对所述组织灰度图像的灰度区间重映射,获得增强组织灰度图像;A remapping unit, used for remapping the grayscale interval of the tissue grayscale image to obtain an enhanced tissue grayscale image;
分割单元,用于基于所述掩模图像对所述增强组织灰度图像进行组织分割,得到所述目标区域组织灰度图像。A segmentation unit is used to perform tissue segmentation on the enhanced tissue grayscale image based on the mask image to obtain the target area tissue grayscale image.
可选的,所述第一计算单元包括:Optionally, the first computing unit includes:
膨胀模块,用于基于膨胀核对目标区域组织灰度图像进行膨胀,得到第一组织灰度图像;An expansion module, used for expanding the target area tissue grayscale image based on the expansion kernel to obtain a first tissue grayscale image;
第一计算模块,用于所述第一组织灰度图像与所述目标区域组织灰度图像进行差分计算,得到外轮廓图像;A first calculation module, used for performing a difference calculation between the first tissue grayscale image and the target area tissue grayscale image to obtain an outer contour image;
腐蚀模块,用于基于腐蚀核对目标区域组织灰度图像进行腐蚀,得到第二组织灰度图像;An erosion module, used for eroding the target area tissue grayscale image based on the erosion kernel to obtain a second tissue grayscale image;
第二计算模块,用于所述第二组织灰度图像与所述目标区域组织灰度图像进行差分计算,得到内轮廓图像。The second calculation module is used to perform a difference calculation between the second tissue grayscale image and the target area tissue grayscale image to obtain an inner contour image.
可选的,配对单元包括:Optionally, the pairing unit includes:
标定模块,用于标定所述外轮廓图像与所述内轮廓图像的分割位置,所述外轮廓图像的分割位置与所述内轮廓图像的分割位值相互对应;A calibration module, used for calibrating the segmentation position of the outer contour image and the inner contour image, wherein the segmentation position of the outer contour image corresponds to the segmentation position value of the inner contour image;
分割模块,用于基于所述分割位置将所述外轮廓图像与所述内轮廓图像分别分割成N段。A segmentation module is used to segment the outer contour image and the inner contour image into N segments respectively based on the segmentation position.
可选的,所述配对单元还包括:Optionally, the pairing unit further includes:
计算模块,用于计算每段外部轮廓图像的质心和每段内部轮廓图像的质心,计算得到的质心为每段外部轮廓图像和每段内部轮廓图像的形状的描述;A calculation module, used for calculating the centroid of each segment of the external contour image and the centroid of each segment of the internal contour image, wherein the calculated centroid is a description of the shape of each segment of the external contour image and each segment of the internal contour image;
配对模块,用于当一段外部轮廓图像的质心与一段内部轮廓图像的质心相似度大于预设阈值时,对所述一段外部轮廓图像与所述一段内部轮廓图像进行配对。The pairing module is used to pair the segment of the external contour image with the segment of the internal contour image when the similarity between the centroid of the segment of the external contour image and the centroid of the segment of the internal contour image is greater than a preset threshold.
可选的,所述重映射单元包括:Optionally, the remapping unit includes:
展宽和归并模块,用于对在所述组织灰度图像中像素点个数满足第一预设范围的灰度值进行展宽,所述第一预设范围为对所述组织灰度图像显示起主要作用的灰度值对应的像素点的数量范围;对在所述组织灰度图像中像素点个数满足第二预设范围的灰度值进行归并,所述第二预设范围为对所述组织灰度图像显示不起主要作用的灰度值对应的像素点的数量范围;A stretching and merging module, for stretching the grayscale values whose number of pixels in the tissue grayscale image meets a first preset range, wherein the first preset range is the number range of pixels corresponding to the grayscale values that play a major role in displaying the tissue grayscale image; and merging the grayscale values whose number of pixels in the tissue grayscale image meets a second preset range, wherein the second preset range is the number range of pixels corresponding to the grayscale values that do not play a major role in displaying the tissue grayscale image;
重映射模块,用于将展宽和归并后的灰度值重映射至所述组织灰度图像,得到所述增强组织灰度图像。The remapping module is used to remap the grayscale values after widening and merging to the tissue grayscale image to obtain the enhanced tissue grayscale image.
可选的,所述第三计算单元包括:Optionally, the third computing unit includes:
第一计算模块,用于计算N个所述像素密度比值的平均值;A first calculation module, used for calculating an average value of N pixel density ratios;
第二计算模块,用于根据所述像素密度比值的平均值计算描述所述目标区域组织灰度图像质量。The second calculation module is used to calculate the grayscale image quality of the target area tissue according to the average value of the pixel density ratio.
根据本公开的第三方面,提供了一种电子设备,包括:According to a third aspect of the present disclosure, there is provided an electronic device, including:
至少一个处理器;以及at least one processor; and
与所述至少一个处理器通信连接的存储器;其中,a memory communicatively connected to the at least one processor; wherein,
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行前述第一方面所述的方法。The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect.
根据本公开的第四方面,提供了一种存储有计算机指令的非瞬时计算机可读存储介质,其中,所述计算机指令用于使所述计算机执行前述第一方面所述的方法。According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method described in the first aspect.
根据本公开的第五方面,提供了一种计算机程序产品,包括计算机程序,所述计算机程序在被处理器执行时实现如前述第一方面所述的方法。According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method as described in the first aspect above.
本公开提供的灰度图像质量评估的方法及装置、电子设备和存储介质,主要技术 方案包括:分别计算得到目标区域组织灰度图像的外轮廓图像与内轮廓图像;将所述外轮廓图像与所述内轮廓图像分别分为N段,并将每段所述外轮廓图像与每段所述内轮廓图像两两配对,得到N个图像组合,每个所述图像组合包括一段外轮廓图像与一段内轮廓图像;分别计算每个所述图像组合中一段外轮廓图像与一段内轮廓图像的像素密度比值,得到N个所述像素密度比值,所述像素密度比值为每个所述图像组合中一段外轮廓图像与一段内轮廓图像的像素占比的比值,所述像素占比为像素点与总像素点的比值;根据所述像素密度比值计算描述所述目标区域组织灰度图像质量。基于分别计算每个所述图像组合中一段外轮廓图像与一段内轮廓图像的像素密度比值,从而得到对所述目标区域组织灰度图像质量的评估分,实现了组织灰度图像的质量评估。The present disclosure provides a method and device, electronic device and storage medium for evaluating the quality of grayscale images. The main technical scheme includes: respectively calculating the outer contour image and the inner contour image of the target area tissue grayscale image; dividing the outer contour image and the inner contour image into N segments, and pairing each segment of the outer contour image with each segment of the inner contour image to obtain N image combinations, each of which includes a segment of the outer contour image and a segment of the inner contour image; respectively calculating the pixel density ratio of a segment of the outer contour image and a segment of the inner contour image in each of the image combinations to obtain N pixel density ratios, the pixel density ratio is the ratio of the pixel proportion of a segment of the outer contour image and a segment of the inner contour image in each of the image combinations, and the pixel proportion is the ratio of the pixel point to the total pixel point; and calculating the quality of the target area tissue grayscale image according to the pixel density ratio. Based on respectively calculating the pixel density ratio of a segment of the outer contour image and a segment of the inner contour image in each of the image combinations, an evaluation score for the quality of the target area tissue grayscale image is obtained, thereby realizing the quality evaluation of the tissue grayscale image.
应当理解,本部分所描述的内容并非旨在标识本申请的实施例的关键或重要特征,也不用于限制本申请的范围。本申请的其它特征将通过以下的说明书而变得容易理解。It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description.
附图用于更好地理解本方案,不构成对本公开的限定。其中:The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
图1为本公开实施例所提供的一种灰度图像质量评估的方法的流程示意图;FIG1 is a schematic flow chart of a grayscale image quality assessment method provided by an embodiment of the present disclosure;
图2为本公开实施例提供的一种外部轮廓图像与内部轮廓图像的关系结构示意图;FIG2 is a schematic diagram of a relationship structure between an external contour image and an internal contour image provided by an embodiment of the present disclosure;
图3为本公开实施例提供的另一种外部轮廓图像与内部轮廓图像的关系结构示意图FIG. 3 is a schematic diagram of another structure of the relationship between the external contour image and the internal contour image provided by an embodiment of the present disclosure.
图4为本公开实施例提供的一种组织灰度图像分割的流程示意图;FIG4 is a schematic diagram of a process of tissue grayscale image segmentation provided by an embodiment of the present disclosure;
图5为本公开实施例提供的一种原组织灰度图像的示意图;FIG5 is a schematic diagram of an original tissue grayscale image provided by an embodiment of the present disclosure;
图6为本公开实施例提供的一种增前后组织灰度图像的示意图;FIG6 is a schematic diagram of a grayscale image of tissue before and after augmentation provided by an embodiment of the present disclosure;
图7为本公开实施例提供的一种原组织灰度图像对应的直方图的示意图;FIG7 is a schematic diagram of a histogram corresponding to an original tissue grayscale image provided by an embodiment of the present disclosure;
图8为本公开实施例提供的一种增强后组织灰度图像对应的直方图的示意图;FIG8 is a schematic diagram of a histogram corresponding to an enhanced tissue grayscale image provided by an embodiment of the present disclosure;
图9为本公开实施例提供的一种灰度图像质量评估的装置的结构示意图;FIG9 is a schematic diagram of the structure of a grayscale image quality assessment device provided by an embodiment of the present disclosure;
图10为本公开实施例提供的另一种灰度图像质量评估的装置的结构示意图;FIG10 is a schematic diagram of the structure of another grayscale image quality assessment device provided by an embodiment of the present disclosure;
图11为本公开实施例提供的示例电子设备400的示意性框图。FIG. 11 is a schematic block diagram of an example electronic device 400 provided according to an embodiment of the present disclosure.
以下结合附图对本公开的示范性实施例做出说明,其中包括本公开实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本公开的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
下面参考附图描述本公开实施例的灰度图像质量评估的方法及装置、电子设备和 存储介质。The following describes the grayscale image quality assessment method and device, electronic device and storage medium according to the embodiments of the present disclosure with reference to the accompanying drawings.
图1为本公开实施例所提供的一种灰度图像质量评估的方法的流程示意图。FIG1 is a schematic flow chart of a grayscale image quality assessment method provided in an embodiment of the present disclosure.
如图1所示,该方法包含以下步骤:As shown in Figure 1, the method includes the following steps:
步骤101,分别计算得到目标区域组织灰度图像的外轮廓图像与内轮廓图像。 Step 101, respectively calculating and obtaining an outer contour image and an inner contour image of a target area tissue grayscale image.
作为上述步骤101的细化,在实施步骤101时,可基于矩阵运算分别得到所述目标区域组织灰度图像的外轮廓图像与内轮廓图像,在本实施例中所述外部轮廓图像与所述内轮廓图像为带状环形轮廓,所述外轮廓图像可包围住所述内轮廓图像。As a refinement of the above-mentioned step 101, when implementing step 101, the outer contour image and the inner contour image of the target area tissue grayscale image can be obtained respectively based on matrix operation. In this embodiment, the outer contour image and the inner contour image are band-shaped annular contours, and the outer contour image can surround the inner contour image.
步骤102,将所述外轮廓图像与所述内轮廓图像分别分为N段,并将每段所述外轮廓图像与每段所述内轮廓图像两两配对,得到N个图像组合,每个所述图像组合包括一段外轮廓图像与一段内轮廓图像。 Step 102 , dividing the outer contour image and the inner contour image into N segments respectively, and pairing each segment of the outer contour image with each segment of the inner contour image in pairs to obtain N image combinations, each of which includes a segment of the outer contour image and a segment of the inner contour image.
为了更直观的展示所述外轮廓图像与所述内轮廓图像的关系,图2为本公开实施例提供的一种外部轮廓图像与内部轮廓图像的关系结构示意图,图3为本公开实施例提供的另一种外部轮廓图像与内部轮廓图像的关系结构示意图,如图2所示,所述将所述外轮廓图像与所述内轮廓图像分别分为N段即将所述外轮廓图像均匀分割成N段,将所述内轮廓图像均匀分割成N段,在所述N段外轮廓图像中取一段与所述N段内轮廓图像中的一段进行配对,形成图像组合,配对完成后便可以得到N个图像组合。In order to more intuitively show the relationship between the outer contour image and the inner contour image, Figure 2 is a schematic diagram of the relationship structure between an outer contour image and an inner contour image provided in an embodiment of the present disclosure, and Figure 3 is a schematic diagram of the relationship structure between another outer contour image and an inner contour image provided in an embodiment of the present disclosure. As shown in Figure 2, the outer contour image and the inner contour image are respectively divided into N segments, that is, the outer contour image is evenly divided into N segments, and the inner contour image is evenly divided into N segments. A segment is taken from the N segments of the outer contour image and paired with a segment in the N segments of the inner contour image to form an image combination. After the pairing is completed, N image combinations can be obtained.
步骤103,分别计算每个所述图像组合中一段外轮廓图像与一段内轮廓图像的像素密度比值,得到N个所述像素密度比值,所述像素密度比值为每个所述图像组合中一段外轮廓图像与一段内轮廓图像的像素占比的比值,所述像素占比为像素点与总像素点的比值。 Step 103, respectively calculate the pixel density ratio of a section of the outer contour image to a section of the inner contour image in each of the image combinations to obtain N pixel density ratios, wherein the pixel density ratio is the ratio of the pixel proportion of a section of the outer contour image to a section of the inner contour image in each of the image combinations, and the pixel proportion is the ratio of the pixel point to the total pixel point.
作为上述步骤103的细化,在计算所述像素密度比值之前,需要先计算每段所述外轮廓图像与每段所述内轮廓图像的像素占比,计算一段所述外轮廓图像的像素占比包括使用该段外轮廓图像内的像素点的数量除以该段外轮廓图像内的像素点的总数量,在本实施例中所述像素点为灰度值大于127的像素点,计算一段内轮廓图像的像素占比与计算一段所述外轮廓图像的像素占比的方法一致,即使用该段内轮廓图像内的像素点的数量除以该段内轮廓图像内的像素点的总数量,以此类推最终计算完成所有段的外轮廓图像的像素占比和所有段的内轮廓图像的像素占比。As a refinement of the above step 103, before calculating the pixel density ratio, it is necessary to first calculate the pixel ratio of each segment of the outer contour image and each segment of the inner contour image. Calculating the pixel ratio of a segment of the outer contour image includes dividing the number of pixels in the segment of the outer contour image by the total number of pixels in the segment of the outer contour image. In this embodiment, the pixel points are pixels with grayscale values greater than 127. The method for calculating the pixel ratio of a segment of the inner contour image is consistent with the method for calculating the pixel ratio of a segment of the outer contour image, that is, dividing the number of pixels in the segment of the inner contour image by the total number of pixels in the segment of the inner contour image, and so on, and finally calculating the pixel ratios of all segments of the outer contour images and the pixel ratios of all segments of the inner contour images.
在完成上述像素占比的计算之后,还需计算一段外轮廓图像的像素占比与一段内轮廓图像的像素占比的比值,所述比值即为像素密度比值,所述一段外轮廓图像与所述一段内轮廓图像存在于一个图像组合,即二者之间相互配对,完成所有图像组合中的一段外轮廓图像的像素占比与一段内轮廓图像的像素占比的比值的计算,最终得到N个像素密度比值。After completing the above-mentioned pixel ratio calculation, it is also necessary to calculate the ratio of the pixel ratio of a section of the outer contour image to the pixel ratio of a section of the inner contour image. The ratio is the pixel density ratio. The section of the outer contour image and the section of the inner contour image exist in an image combination, that is, the two are paired with each other. The calculation of the ratio of the pixel ratio of a section of the outer contour image to the pixel ratio of a section of the inner contour image in all image combinations is completed, and finally N pixel density ratios are obtained.
步骤104,根据所述像素密度比值计算描述所述目标区域组织灰度图像质量。Step 104: Calculate the grayscale image quality of the target area tissue according to the pixel density ratio.
作为上述步骤104的细化,所述根据所述像素密度比值计算描述所述目标区域组织灰度图像质量包括但不限于以下实现方式,例如:将所述像素密度比值的平均值代入预设函数计算出描述所述目标区域组织灰度图像质量的数值,所述预设函数可以为 线性函数也可为非线性函数。As a refinement of the above step 104, the calculation of describing the grayscale image quality of the target area tissue based on the pixel density ratio includes but is not limited to the following implementation methods, for example: substituting the average value of the pixel density ratio into a preset function to calculate a numerical value describing the grayscale image quality of the target area tissue, and the preset function can be a linear function or a nonlinear function.
为了便于理解上述细化的内容,本实施例提供了一种结合公式的示例性说明,例如:所述效像素密度比值的平均值为x,当所述x大于0小于200时,可代入公式(1)得到描述所述目标区域组织灰度图像质量的数值,公式(1)如下所示:In order to facilitate understanding of the above-mentioned detailed contents, this embodiment provides an exemplary explanation in combination with a formula. For example, the average value of the effective pixel density ratio is x. When x is greater than 0 and less than 200, it can be substituted into formula (1) to obtain a numerical value describing the grayscale image quality of the target area tissue. Formula (1) is as follows:
F(x)=100*x^0.7(0<x<200) 公式(1)F(x)=100*x^0.7(0<x<200) Formula (1)
F(x)=0(x<=0) 公式(2)F(x)=0(x<=0) Formula (2)
F(x)=100(x>=200) 公式(3)F(x)=100(x>=200) Formula (3)
上述公式仅为示例性说明,其可以被任意函数替换,本公开实施例对公式不进行限定。The above formula is only for illustrative purposes and can be replaced by any function. The embodiments of the present disclosure do not limit the formula.
本公开提供的灰度图像质量评估的方法,主要技术方案包括:分别计算得到目标区域组织灰度图像的外轮廓图像与内轮廓图像;将所述外轮廓图像与所述内轮廓图像分别分为N段,并将每段所述外轮廓图像与每段所述内轮廓图像两两配对,得到N个图像组合,每个所述图像组合包括一段外轮廓图像与一段内轮廓图像;分别计算每个所述图像组合中一段外轮廓图像与一段内轮廓图像的像素密度比值,得到N个所述像素密度比值,所述像素密度比值为每个所述图像组合中一段外轮廓图像与一段内轮廓图像的像素占比的比值,所述像素占比为像素点与总像素点的比值;根据所述像素密度比值计算描述所述目标区域组织灰度图像质量。基于分别计算每个所述图像组合中一段外轮廓图像与一段内轮廓图像的像素密度比值,从而得到对所述目标区域组织灰度图像质量的评估分,实现了组织灰度图像的质量评估。The method for evaluating the quality of grayscale images provided by the present disclosure mainly includes the following technical solutions: respectively calculating the outer contour image and the inner contour image of the grayscale image of the target area tissue; respectively dividing the outer contour image and the inner contour image into N segments, and pairing each segment of the outer contour image with each segment of the inner contour image to obtain N image combinations, each of which includes a segment of the outer contour image and a segment of the inner contour image; respectively calculating the pixel density ratio of a segment of the outer contour image to a segment of the inner contour image in each of the image combinations to obtain N pixel density ratios, the pixel density ratio being the ratio of the pixel proportion of a segment of the outer contour image to a segment of the inner contour image in each of the image combinations, the pixel proportion being the ratio of the pixel point to the total pixel point; and calculating and describing the quality of the grayscale image of the target area tissue according to the pixel density ratio. Based on respectively calculating the pixel density ratio of a segment of the outer contour image to a segment of the inner contour image in each of the image combinations, an evaluation score for the quality of the grayscale image of the target area tissue is obtained, thereby realizing the quality evaluation of the grayscale image of the tissue.
图4为本公开实施例提供的一种组织灰度图像分割的流程示意图,如图4所示,FIG4 is a schematic diagram of a process of tissue grayscale image segmentation provided by an embodiment of the present disclosure. As shown in FIG4 ,
步骤201,获取组织灰度图像和掩模图像,所述掩模图像为二值图。Step 201: Acquire a tissue grayscale image and a mask image, wherein the mask image is a binary image.
获取待分割的组织灰度图像,以及获取用于对所述组织灰度图形进行组织分割的掩模图像,所述掩模图像为二值图,即所述掩模图像的像素点灰度值为0或255。A tissue grayscale image to be segmented is obtained, and a mask image for performing tissue segmentation on the tissue grayscale image is obtained, wherein the mask image is a binary image, that is, the grayscale value of pixels in the mask image is 0 or 255.
步骤202,对所述组织灰度图像的灰度区间重映射,获得增强组织灰度图像。Step 202: remap the grayscale interval of the tissue grayscale image to obtain an enhanced tissue grayscale image.
作为步骤202的细化,所述步骤202主要目的是为了增强所述组织灰度图像的清晰度,通过重映射灰度期间,使所述组织灰度图像变得高亮,且使模糊区域的轮廓更加分明,最终得到更加清晰的所述组织灰度图像。As a refinement of step 202, the main purpose of step 202 is to enhance the clarity of the tissue grayscale image. By remapping the grayscale, the tissue grayscale image is highlighted and the outline of the blurred area is made clearer, so as to finally obtain a clearer tissue grayscale image.
步骤203,基于所述掩模图像对所述增强组织灰度图像进行组织分割,得到所述目标区域组织灰度图像。Step 203: performing tissue segmentation on the enhanced tissue grayscale image based on the mask image to obtain the target area tissue grayscale image.
对非所述掩模图像覆盖的区域进行组织分割,得到目标区域组织灰度图像。Perform tissue segmentation on the area not covered by the mask image to obtain a tissue grayscale image of the target area.
作为上述实施例的细化,在执行步骤101所述分别计算得到目标区域组织灰度图像的外轮廓图像与内轮廓图像时,可以采用但不限于以下实现方式,例如:基于膨胀核对目标区域组织灰度图像进行膨胀,得到第一组织灰度图像;所述第一组织灰度图像与所述目标区域组织灰度图像进行差分计算,得到外轮廓图像;基于腐蚀核对目标区域组织灰度图像进行腐蚀,得到第二组织灰度图像;所述第二组织灰度图像与所述目标区域组织灰度图像进行差分计算,得到内轮廓图像。As a refinement of the above embodiment, when executing step 101 to respectively calculate the outer contour image and the inner contour image of the target area tissue grayscale image, the following implementation methods can be adopted but are not limited to, for example: based on the expansion kernel, the target area tissue grayscale image is expanded to obtain a first tissue grayscale image; the first tissue grayscale image and the target area tissue grayscale image are differentially calculated to obtain an outer contour image; based on the erosion kernel, the target area tissue grayscale image is eroded to obtain a second tissue grayscale image; the second tissue grayscale image and the target area tissue grayscale image are differentially calculated to obtain an inner contour image.
所述膨胀核为根据所述目标区域组织灰度图像的大小构建的矩阵,若所述目标区域组织灰度图像越大则构建的所述矩阵越大,元素越多;使用所述膨胀核将所述目标区域组织灰度图像的高亮区域进行扩张,得到面积大于所述目标区域组织灰度图像的第一组织灰度图像,所述膨胀实际上为所述膨胀核与所述目标区域组织灰度图像做卷积计算。然后将得到的所述第一组织灰度图像与所述目标区域组织灰度图像进行差分计算,得到外轮廓图像。The expansion kernel is a matrix constructed according to the size of the target area tissue grayscale image. If the target area tissue grayscale image is larger, the constructed matrix is larger and has more elements. The expansion kernel is used to expand the highlight area of the target area tissue grayscale image to obtain a first tissue grayscale image with an area larger than the target area tissue grayscale image. The expansion is actually a convolution calculation of the expansion kernel and the target area tissue grayscale image. Then, the obtained first tissue grayscale image is subjected to a differential calculation with the target area tissue grayscale image to obtain an outer contour image.
所述腐蚀的过程与所述膨胀的过程一致,所述腐蚀核为根据所述目标区域组织灰度图像的大小构建的矩阵,若所述目标区域组织灰度图像越大则构建的所述矩阵越大,元素越多;使用所述腐蚀核将所述目标区域组织灰度图像的高亮区域进行减少,得到面积小于所述目标区域组织灰度图像的第二组织灰度图像,所述腐蚀实际上为所述腐蚀核与所述目标区域组织灰度图像做卷积计算。然后将得到的所述第二组织灰度图像与所述目标区域组织灰度图像进行差分计算,得到内轮廓图像。The corrosion process is consistent with the expansion process. The corrosion kernel is a matrix constructed according to the size of the target area tissue grayscale image. The larger the target area tissue grayscale image is, the larger the constructed matrix is and the more elements are. The corrosion kernel is used to reduce the highlight area of the target area tissue grayscale image to obtain a second tissue grayscale image with an area smaller than the target area tissue grayscale image. The corrosion is actually a convolution calculation between the corrosion kernel and the target area tissue grayscale image. Then, the obtained second tissue grayscale image is subjected to a differential calculation with the target area tissue grayscale image to obtain an inner contour image.
作为上述实施例的细化,在执行步骤102所述将所述外轮廓图像与所述内轮廓图像分别分为N段时,可以采用但不限于以下实现方式,例如:标定所述外轮廓图像与所述内轮廓图像的分割位置,所述外轮廓图像的分割位置与所述内轮廓图像的分割位值相互对应;基于所述分割位置将所述外轮廓图像与所述内轮廓图像分别分割成N段。As a refinement of the above embodiment, when executing step 102 to divide the outer contour image and the inner contour image into N segments respectively, the following implementation methods can be adopted but are not limited to, for example: calibrating the segmentation positions of the outer contour image and the inner contour image, the segmentation positions of the outer contour image and the segmentation position values of the inner contour image correspond to each other; and dividing the outer contour image and the inner contour image into N segments respectively based on the segmentation positions.
作为上述实施例的细化,所述分割位置的标定包括:在外轮廓图像取得第一个像素点A作为起始点,沿着轮廓线均分成N段。在内轮廓图像搜索离A点距离最近的点B作为起始点,沿着轮廓线均分成N段。在一定层度上,可以根据像素点的多少对所述外轮廓图像与所述内轮廓图像进行划分,所述轮廓线是指将所述外轮廓图像与所述内轮廓图像看作为没有宽度的线,以便于分割。As a refinement of the above embodiment, the calibration of the segmentation position includes: taking the first pixel point A in the outer contour image as the starting point, and dividing it into N segments along the contour line. Searching for the point B closest to point A in the inner contour image as the starting point, and dividing it into N segments along the contour line. At a certain level, the outer contour image and the inner contour image can be divided according to the number of pixels, and the contour line refers to treating the outer contour image and the inner contour image as a line without width for easy segmentation.
在一些实施例中所述内轮廓与外轮廓的分割方式还可以采用但不限于预设比例分割,预设长度分割等。In some embodiments, the inner contour and the outer contour may be divided by, but not limited to, a preset ratio division, a preset length division, etc.
作为上述实施例的细化,在执行步骤102所述将每段所述外轮廓图像与每段所述 内轮廓图像两两配对时,可以采用但不限于以下实现方式,例如:计算每段外部轮廓图像的质心和每段内部轮廓图像的质心,计算得到的质心为每段外部轮廓图像和每段内部轮廓图像的形状的描述;若一段外部轮廓图像的质心与一段内部轮廓图像的质心相似度大于预设阈值,则对所述一段外部轮廓图像与所述一段内部轮廓图像进行配对。基于质心对所述一段外部轮廓图像与所述一段内部轮廓图像进行配对,实质上是将一段外部轮廓图像的形状与一段内部轮廓图像的形状相似度最高的配为一对,形成一个图像组合。As a refinement of the above embodiment, when performing the pairing of each segment of the outer contour image with each segment of the inner contour image in pair in step 102, the following implementation methods may be adopted but are not limited to, for example: calculating the centroid of each segment of the outer contour image and the centroid of each segment of the inner contour image, the centroid calculated is the description of the shape of each segment of the outer contour image and each segment of the inner contour image; if the similarity between the centroid of a segment of the outer contour image and the centroid of a segment of the inner contour image is greater than a preset threshold, the segment of the outer contour image is paired with the segment of the inner contour image. Pairing the segment of the outer contour image with the segment of the inner contour image based on the centroid is essentially pairing the segment of the outer contour image with the segment of the inner contour image with the shape having the highest similarity to form an image combination.
作为上述实施例的细化,在执行步骤202所述对所述组织灰度图像的灰度区间重映射,获得增强组织灰度图像时,可以采用但不限于以下实现方式,例如:对在所述组织灰度图像中像素点个数满足第一预设范围的灰度值进行展宽,所述第一预设范围为对所述组织灰度图像显示起主要作用的灰度值对应的像素点的数量范围;对在所述组织灰度图像中像素点个数满足第二预设范围的灰度值进行归并,所述第二预设范围为对所述组织灰度图像显示不起主要作用的灰度值对应的像素点的数量范围;将展宽和归并后的灰度值重映射至所述组织灰度图像,得到所述增强组织灰度图像。As a refinement of the above embodiment, when executing the grayscale interval remapping of the tissue grayscale image described in step 202 to obtain an enhanced tissue grayscale image, the following implementation methods can be adopted but are not limited to, for example: widening the grayscale values whose number of pixels in the tissue grayscale image meets a first preset range, and the first preset range is the number range of pixels corresponding to the grayscale values that play a major role in the display of the tissue grayscale image; merging the grayscale values whose number of pixels in the tissue grayscale image meets a second preset range, and the second preset range is the number range of pixels corresponding to the grayscale values that do not play a major role in the display of the tissue grayscale image; remapping the widened and merged grayscale values to the tissue grayscale image to obtain the enhanced tissue grayscale image.
上述步骤目的是为了增强所述组织灰度图像的清晰度,通过展宽某些灰度值使所述组织灰度图像高亮区域变大,同时通过归并某些灰度值使所述组织灰度图像的轮廓更加明显。The purpose of the above steps is to enhance the clarity of the tissue grayscale image by expanding certain grayscale values to make the highlight area of the tissue grayscale image larger and by merging certain grayscale values to make the outline of the tissue grayscale image more obvious.
在具体实施过程中所述增强组织灰度图像可以采用但不限于以下实现方式:In the specific implementation process, the enhanced tissue grayscale image can be implemented in the following ways, but not limited to:
需要了解的是将灰度分为256个区块绘制直方图。如果是16bit图片,1个bin就包含256个灰度级,如果是8bit图片,1个bin只包含1个灰度级。What you need to know is that the grayscale is divided into 256 blocks to draw the histogram. If it is a 16-bit image, 1 bin contains 256 grayscale levels, and if it is an 8-bit image, 1 bin contains only 1 grayscale level.
场景性的,以256bin统计直方图为例,从低点至高点的搜索所述直方图:从直方图0bin至255bin,在直方图中逐bin遍历,如果这个bin的值即val,符合imgsize/5000<val<imgsize/10即为符合条件的值。反之高点至低点的搜索则是从直方图255bin至0bin,找到符合条件imgsize/5000<val<imgsize/10的值,并停止搜索。其中imgsize指代图片的像素总数,所述bin为灰度值区块,所述bin的值即val为每个所述bin对应的像素点数量。In the scenario, take the 256-bin statistical histogram as an example, and search the histogram from low point to high point: from the histogram 0bin to 255bin, traverse each bin in the histogram. If the value of this bin, that is, val, meets the condition of imgsize/5000<val<imgsize/10, it is a qualified value. On the contrary, the search from high point to low point is from the histogram 255bin to 0bin, find the value that meets the condition of imgsize/5000<val<imgsize/10, and stop searching. Among them, imgsize refers to the total number of pixels of the image, the bin is the gray value block, and the value of the bin, that is, val, is the number of pixels corresponding to each bin.
为了更直观的展示所述组织灰度图像增强前后的效果,图5为本公开实施例提供的一种原组织灰度图像的示意图,图6为本公开实施例提供的一种增前后组织灰度图像的示意图,图6所示的组织灰度图像为所述图5组织灰度图像增强后的效果。In order to more intuitively demonstrate the effects of the tissue grayscale image before and after enhancement, Figure 5 is a schematic diagram of an original tissue grayscale image provided in an embodiment of the present disclosure, and Figure 6 is a schematic diagram of a tissue grayscale image before and after enhancement provided in an embodiment of the present disclosure. The tissue grayscale image shown in Figure 6 is the effect after the tissue grayscale image of Figure 5 is enhanced.
同时为了便于了解所述组织灰度图像的增强过程,图7为本公开实施例提供的一 种原组织灰度图像对应的直方图的示意图,图8为本公开实施例提供的一种增强后组织灰度图像对应的直方图的示意图,从图7和图8中可以看出增强后的组织图像对应的直方图中像素点数量及对应的灰度值更加离散,且上述bin值的选择可以参照图7。At the same time, in order to facilitate understanding of the enhancement process of the tissue grayscale image, Figure 7 is a schematic diagram of a histogram corresponding to an original tissue grayscale image provided in an embodiment of the present disclosure, and Figure 8 is a schematic diagram of a histogram corresponding to an enhanced tissue grayscale image provided in an embodiment of the present disclosure. It can be seen from Figures 7 and 8 that the number of pixels and the corresponding grayscale values in the histogram corresponding to the enhanced tissue image are more discrete, and the selection of the above-mentioned bin value can refer to Figure 7.
作为上述实施例的细化,在执行步骤104所述根据所述像素密度比值计算描述所述目标区域组织灰度图像质量时,可以采用但不限于以下实现方式例如:计算N个所述像素密度比值的平均值;根据所述像素密度比值的平均值计算描述所述目标区域组织灰度图像质量。As a refinement of the above embodiment, when executing step 104 to calculate the grayscale image quality of the target area tissue according to the pixel density ratio, the following implementation methods can be adopted but are not limited to, for example: calculating the average value of N pixel density ratios; calculating the grayscale image quality of the target area tissue according to the average value of the pixel density ratio.
将所述N个像素密度比值相加后除以N,得到所述像素密度比值的平均值。根据所述平均值的大小确定所述组织灰度图像的质量高低,在本公开实施例中所述N为正整数。The N pixel density ratios are added and then divided by N to obtain an average value of the pixel density ratios. The quality of the tissue grayscale image is determined according to the size of the average value. In the embodiment of the present disclosure, N is a positive integer.
综上所述,本公开实施例能达到以下效果:In summary, the embodiments of the present disclosure can achieve the following effects:
1.基于分别计算每个所述图像组合中一段外轮廓图像与一段内轮廓图像的像素密度比值,从而得到对所述目标区域组织灰度图像质量的评估分,实现了组织灰度图像的质量评估。1. Based on respectively calculating the pixel density ratio of a section of the outer contour image and a section of the inner contour image in each of the image combinations, an evaluation score for the quality of the tissue grayscale image of the target area is obtained, thereby realizing the quality evaluation of the tissue grayscale image.
2.基于本实施例进行所述组织灰度图像的质量评估时,无需人工监督。2. When performing the quality assessment of the tissue grayscale image based on this embodiment, no manual supervision is required.
3.通过采用内轮廓图像与外轮廓图像两两分段统计后求其像素密度占比的平均值的方法,降低噪音对评估结果的影响。3. The influence of noise on the evaluation results can be reduced by dividing the inner contour image and the outer contour image into two segments and then calculating the average value of their pixel density ratio.
与上述的灰度图像质量评估的方法相对应,本发明还提出一种灰度图像质量评估的装置。由于本发明的装置实施例与上述的方法实施例相对应,对于装置实施例中未披露的细节可参照上述的方法实施例,本发明中不再进行赘述。Corresponding to the above-mentioned grayscale image quality assessment method, the present invention also provides a grayscale image quality assessment device. Since the device embodiment of the present invention corresponds to the above-mentioned method embodiment, details not disclosed in the device embodiment can be referred to the above-mentioned method embodiment, and will not be repeated in the present invention.
图9为本公开实施例提供的一种灰度图像质量评估的装置的结构示意图,如图9所示,包括:FIG9 is a schematic diagram of the structure of a grayscale image quality assessment device provided by an embodiment of the present disclosure, as shown in FIG9 , comprising:
第一计算单元31,用于分别计算得到目标区域组织灰度图像的外轮廓图像与内轮廓图像;The first calculation unit 31 is used to calculate and obtain the outer contour image and the inner contour image of the target area tissue grayscale image respectively;
配对单元32,用于将所述外轮廓图像与所述内轮廓图像分别分为N段,并将每段所述外轮廓图像与每段所述内轮廓图像两两配对,得到N个图像组合,每个所述图像组合包括一段外轮廓图像与一段内轮廓图像;A pairing unit 32, configured to divide the outer contour image and the inner contour image into N segments respectively, and pair each segment of the outer contour image with each segment of the inner contour image in pairs to obtain N image combinations, each of which includes a segment of the outer contour image and a segment of the inner contour image;
第二计算单元33,用于分别计算每个所述图像组合中一段外轮廓图像与一段内轮廓图像的像素密度比值,得到N个所述像素密度比值,所述像素密度比值为每个所述图像组合中一段外轮廓图像与一段内轮廓图像的像素占比的比值,所述像素占比为像素点与总像素点的比值;A second calculation unit 33 is used to calculate the pixel density ratio of a segment of the outer contour image to a segment of the inner contour image in each of the image combinations, to obtain N pixel density ratios, wherein the pixel density ratio is the ratio of the pixel proportion of a segment of the outer contour image to a segment of the inner contour image in each of the image combinations, and the pixel proportion is the ratio of the pixel point to the total pixel points;
第三计算单元34,根据所述像素密度比值计算描述所述目标区域组织灰度图像质量。The third calculation unit 34 calculates the grayscale image quality of the target area tissue according to the pixel density ratio.
本公开提供的灰度图像质量评估的装置,包括:分别计算得到目标区域组织灰度图像的外轮廓图像与内轮廓图像;将所述外轮廓图像与所述内轮廓图像分别分为N段,并将每段所述外轮廓图像与每段所述内轮廓图像两两配对,得到N个图像组合,每个所述图像组合包括一段外轮廓图像与一段内轮廓图像;分别计算每个所述图像组合中一段外轮廓图像与一段内轮廓图像的像素密度比值,得到N个所述像素密度比值,所述像素密度比值为每个所述图像组合中一段外轮廓图像与一段内轮廓图像的像素占比的比值,所述像素占比为像素点与总像素点的比值;根据所述像素密度比值计算描述所述目标区域组织灰度图像质量。基于分别计算每个所述图像组合中一段外轮廓图像与一段内轮廓图像的像素密度比值,从而得到对所述目标区域组织灰度图像质量的评估分,实现了组织灰度图像的质量评估。The device for evaluating the quality of grayscale images provided by the present disclosure includes: respectively calculating the outer contour image and the inner contour image of the grayscale image of the target area tissue; respectively dividing the outer contour image and the inner contour image into N segments, and pairing each segment of the outer contour image with each segment of the inner contour image to obtain N image combinations, each of which includes a segment of the outer contour image and a segment of the inner contour image; respectively calculating the pixel density ratio of a segment of the outer contour image and a segment of the inner contour image in each of the image combinations to obtain N pixel density ratios, the pixel density ratio is the ratio of the pixel proportion of a segment of the outer contour image and a segment of the inner contour image in each of the image combinations, and the pixel proportion is the ratio of the pixel point to the total pixel point; and calculating the quality of the grayscale image of the target area tissue according to the pixel density ratio. Based on respectively calculating the pixel density ratio of a segment of the outer contour image and a segment of the inner contour image in each of the image combinations, an evaluation score for the quality of the grayscale image of the target area tissue is obtained, thereby realizing the quality evaluation of the grayscale image of the tissue.
进一步地,在本实施例一种可能的实现方式中,图10为本公开实施例提供的另一种灰度图像质量评估的装置的结构示意图,如图10所示,所述装置包括:Further, in a possible implementation of this embodiment, FIG10 is a schematic diagram of the structure of another grayscale image quality assessment device provided by an embodiment of the present disclosure. As shown in FIG10 , the device includes:
获取单元35,用于获取组织灰度图像和掩模图像,所述掩模图像为二值图;An acquisition unit 35, used for acquiring a tissue grayscale image and a mask image, wherein the mask image is a binary image;
重映射单元36,用于对所述组织灰度图像的灰度区间重映射,获得增强组织灰度图像;A remapping unit 36, configured to remap the grayscale interval of the tissue grayscale image to obtain an enhanced tissue grayscale image;
分割单元37,用于基于所述掩模图像对所述增强组织灰度图像进行组织分割,得到所述目标区域组织灰度图像。The segmentation unit 37 is used to perform tissue segmentation on the enhanced tissue grayscale image based on the mask image to obtain the target area tissue grayscale image.
进一步地,在本实施例一种可能的实现方式中,如图10所示,所述第一计算单元31包括:Furthermore, in a possible implementation of this embodiment, as shown in FIG10 , the first calculating unit 31 includes:
膨胀模块311,用于基于膨胀核对目标区域组织灰度图像进行膨胀,得到第一组织灰度图像;An expansion module 311 is used to expand the target area tissue grayscale image based on the expansion kernel to obtain a first tissue grayscale image;
第一计算模块312,用于所述第一组织灰度图像与所述目标区域组织灰度图像进行差分计算,得到外轮廓图像;A first calculation module 312 is used for performing a difference calculation between the first tissue grayscale image and the target area tissue grayscale image to obtain an outer contour image;
腐蚀模块313,用于基于腐蚀核对目标区域组织灰度图像进行腐蚀,得到第二组织灰度图像;An erosion module 313, configured to erode the target region tissue grayscale image based on the erosion kernel to obtain a second tissue grayscale image;
第二计算模块314,用于所述第二组织灰度图像与所述目标区域组织灰度图像进行差分计算,得到内轮廓图像。The second calculation module 314 is used to perform a difference calculation between the second tissue grayscale image and the target area tissue grayscale image to obtain an inner contour image.
进一步地,在本实施例一种可能的实现方式中,如图10所示,配对单元32包括:Furthermore, in a possible implementation of this embodiment, as shown in FIG10 , the pairing unit 32 includes:
标定模块321,用于标定所述外轮廓图像与所述内轮廓图像的分割位置,所述外轮廓图像的分割位置与所述内轮廓图像的分割位值相互对应;A calibration module 321 is used to calibrate the segmentation position of the outer contour image and the inner contour image, wherein the segmentation position of the outer contour image corresponds to the segmentation position value of the inner contour image;
分割模块322,用于基于所述分割位置将所述外轮廓图像与所述内轮廓图像分别分割成N段。The segmentation module 322 is used to segment the outer contour image and the inner contour image into N segments respectively based on the segmentation positions.
进一步地,在本实施例一种可能的实现方式中,如图10所示,所述配对单元32还包括:Furthermore, in a possible implementation of this embodiment, as shown in FIG10 , the pairing unit 32 further includes:
计算模块323,用于计算每段外部轮廓图像的质心和每段内部轮廓图像的质心,计算得到的质心为每段外部轮廓图像和每段内部轮廓图像的形状的描述;A calculation module 323, used to calculate the centroid of each segment of the external contour image and the centroid of each segment of the internal contour image, the calculated centroid is a description of the shape of each segment of the external contour image and each segment of the internal contour image;
配对模块324,用于当一段外部轮廓图像的质心与一段内部轮廓图像的质心相似度大于预设阈值时,对所述一段外部轮廓图像与所述一段内部轮廓图像进行配对。The pairing module 324 is configured to pair a segment of the external contour image with a segment of the internal contour image when the similarity between the centroid of a segment of the external contour image and the centroid of a segment of the internal contour image is greater than a preset threshold.
进一步地,在本实施例一种可能的实现方式中,如图10所示,所述重映射单元36包括:Furthermore, in a possible implementation of this embodiment, as shown in FIG10 , the remapping unit 36 includes:
展宽和归并模块361,用于对在所述组织灰度图像中像素点个数满足第一预设范围的灰度值进行展宽,所述第一预设范围为对所述组织灰度图像显示起主要作用的灰度值对应的像素点的数量范围;对在所述组织灰度图像中像素点个数满足第二预设范围的灰度值进行归并,所述第二预设范围为对所述组织灰度图像显示不起主要作用的灰度值对应的像素点的数量范围;The stretching and merging module 361 is used to stretch the grayscale values whose number of pixels in the tissue grayscale image meets a first preset range, wherein the first preset range is the number range of pixels corresponding to the grayscale values that play a major role in displaying the tissue grayscale image; and to merge the grayscale values whose number of pixels in the tissue grayscale image meets a second preset range, wherein the second preset range is the number range of pixels corresponding to the grayscale values that do not play a major role in displaying the tissue grayscale image;
重映射模块362,用于将展宽和归并后的灰度值重映射至所述组织灰度图像,得到所述增强组织灰度图像。The remapping module 362 is used to remap the grayscale values after stretching and merging to the tissue grayscale image to obtain the enhanced tissue grayscale image.
进一步地,在本实施例一种可能的实现方式中,如图10所示,所述第三计算单元34包括:Furthermore, in a possible implementation of this embodiment, as shown in FIG10 , the third calculation unit 34 includes:
第一计算模块341,用于计算N个所述像素密度比值的平均值;A first calculation module 341 is used to calculate an average value of N pixel density ratios;
第二计算模块342,用于根据所述像素密度比值的平均值计算描述所述目标区域组织灰度图像质量。The second calculation module 342 is used to calculate the grayscale image quality of the target area tissue according to the average value of the pixel density ratio.
需要说明的是,前述对方法实施例的解释说明,也适用于本实施例的装置,原理相同,本实施例中不再限定。It should be noted that the above explanation of the method embodiment is also applicable to the device of this embodiment, and the principle is the same, which is no longer limited in this embodiment.
根据本公开的实施例,本公开还提供了一种电子设备、一种可读存储介质和一种计算机程序产品。According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
图11示出了可以用来实施本公开的实施例的示例电子设备400的示意性框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作 台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本公开的实现。FIG. 11 shows a schematic block diagram of an example electronic device 400 that can be used to implement an embodiment of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and/or required herein.
如图11所示,设备400包括计算单元401,其可以根据存储在ROM(Read-Only Memory,只读存储器)402中的计算机程序或者从存储单元408加载到RAM(Random Access Memory,随机访问/存取存储器)403中的计算机程序,来执行各种适当的动作和处理。在RAM403中,还可存储设备400操作所需的各种程序和数据。计算单元401、ROM 402以及RAM 403通过总线404彼此相连。I/O(Input/Output,输入/输出)接口405也连接至总线404。As shown in FIG. 11 , the device 400 includes a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in a ROM (Read-Only Memory) 402 or a computer program loaded from a storage unit 408 into a RAM (Random Access Memory) 403. In the RAM 403, various programs and data required for the operation of the device 400 can also be stored. The computing unit 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An I/O (Input/Output) interface 405 is also connected to the bus 404.
设备400中的多个部件连接至I/O接口405,包括:输入单元406,例如键盘、鼠标等;输出单元407,例如各种类型的显示器、扬声器等;存储单元408,例如磁盘、光盘等;以及通信单元409,例如网卡、调制解调器、无线通信收发机等。Multiple components in the device 400 are connected to the I/O interface 405, including: an input unit 406, such as a keyboard, a mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a disk, an optical disk, etc.; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc.
通信单元409允许设备400通过诸如因特网的计算机网络和/或各种电信网络与其他设备交换信息/数据。The communication unit 409 allows the device 400 to exchange information/data with other devices through a computer network such as the Internet and/or various telecommunication networks.
计算单元401可以是各种具有处理和计算能力的通用和/或专用处理组件。计算单元401的一些示例包括但不限于CPU(Central Processing Unit,中央处理单元)、GPU(Graphic Processing Units,图形处理单元)、各种专用的AI(Artificial Intelligence,人工智能)计算芯片、各种运行机器学习模型算法的计算单元、DSP(Digital Signal Processor,数字信号处理器)、以及任何适当的处理器、控制器、微控制器等。计算单元401执行上文所描述的各个方法和处理,例如灰度图像质量评估方法。The computing unit 401 may be a variety of general and/or special processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a CPU (Central Processing Unit), a GPU (Graphic Processing Units), various dedicated AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, a DSP (Digital Signal Processor), and any appropriate processor, controller, microcontroller, etc. The computing unit 401 performs the various methods and processes described above, such as a grayscale image quality assessment method.
例如,在一些实施例中,灰度图像质量评估方法可被实现为计算机软件程序,其被有形地包含于机器可读介质,例如存储单元408。For example, in some embodiments, the grayscale image quality assessment method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 408 .
在一些实施例中,计算机程序的部分或者全部可以经由ROM 402和/或通信单元409而被载入和/或安装到设备400上。In some embodiments, part or all of the computer program can be loaded and/or installed onto the device 400 via the ROM 402 and/or the communication unit 409.
当计算机程序加载到RAM 403并由计算单元401执行时,可以执行上文描述的方法的一个或多个步骤。备选地,在其他实施例中,计算单元401可以通过其他任何适当的方式(例如,借助于固件)而被配置为执行前述灰度图像质量评估方法。When the computer program is loaded into RAM 403 and executed by the computing unit 401, one or more steps of the method described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to perform the aforementioned grayscale image quality assessment method in any other appropriate manner (e.g., by means of firmware).
本文中以上描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电 路系统、FPGA(Field Programmable Gate Array,现场可编程门阵列)、ASIC(Application-Specific Integrated Circuit,专用集成电路)、ASSP(Application Specific Standard Product,专用标准产品)、SOC(System On Chip,芯片上系统的系统)、CPLD(Complex Programmable Logic Device,复杂可编程逻辑设备)、计算机硬件、固件、软件、和/或它们的组合中实现。Various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Array), ASICs (Application-Specific Integrated Circuit), ASSPs (Application Specific Standard Product), SOCs (System On Chip), CPLDs (Complex Programmable Logic Device), computer hardware, firmware, software, and/or combinations thereof.
这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。These various embodiments may include being implemented in one or more computer programs that can be executed and/or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
用于实施本公开的方法的程序代码可以采用一个或多个编程语言的任何组合来编写。这些程序代码可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器或控制器,使得程序代码当由处理器或控制器执行时使流程图和/或框图中所规定的功能/操作被实施。程序代码可以完全在机器上执行、部分地在机器上执行,作为独立软件包部分地在机器上执行且部分地在远程机器上执行或完全在远程机器或服务器上执行。The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, implements the functions/operations specified in the flow chart and/or block diagram. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、RAM、ROM、EPROM(Electrically Programmable Read-Only-Memory,可擦除可编程只读存储器)或快闪存储器、光纤、CD-ROM(Compact Disc Read-Only Memory,便捷式紧凑盘只读存储器)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, RAM, ROM, EPROM (Electrically Programmable Read-Only-Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(Cathode-Ray Tube,阴极射线管)或者LCD(Liquid Crystal Display,液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (Cathode-Ray Tube) or an LCD (Liquid Crystal Display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer.
其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。Other types of devices may also be used to provide interaction with a user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:LAN(Local Area Network,局域网)、WAN(Wide Area Network,广域网)、互联网和区块链网络。The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), the Internet, and blockchain networks.
计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。服务器可以是云服务器,又称为云计算服务器或云主机,是云计算服务体系中的一项主机产品,以解决了传统物理主机与VPS服务("Virtual Private Server",或简称"VPS")中,存在的管理难度大,业务扩展性弱的缺陷。服务器也可以为分布式系统的服务器,或者是结合了区块链的服务器。A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server for a distributed system, or a server combined with a blockchain.
其中,需要说明的是,人工智能是研究使计算机来模拟人的某些思维过程和智能行为(如学习、推理、思考、规划等)的学科,既有硬件层面的技术也有软件层面的技术。人工智能硬件技术一般包括如传感器、专用人工智能芯片、云计算、分布式存储、大数据处理等技术;人工智能软件技术主要包括计算机视觉技术、语音识别技术、自然语言处理技术以及机器学习/深度学习、大数据处理技术、知识图谱技术等几大方向。It should be noted that artificial intelligence is a discipline that studies how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), and includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning/deep learning, big data processing technology, knowledge graph technology, and other major directions.
应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本发公开中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本公开公开的技术方案所期望的结果,本文在此不进行限制。It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
上述具体实施方式,并不构成对本公开保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本公开的精神和原则之内所作的修改、等同替换和改进等,均应包含在本公开保护范围之内。The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims (11)
- 一种灰度图像质量评估的方法,其特征在于,包括:A method for grayscale image quality assessment, comprising:分别计算得到目标区域组织灰度图像的外轮廓图像与内轮廓图像;The outer contour image and the inner contour image of the target area tissue grayscale image are calculated respectively;将所述外轮廓图像与所述内轮廓图像分别分为N段,并将每段所述外轮廓图像与每段所述内轮廓图像两两配对,得到N个图像组合,每个所述图像组合包括一段外轮廓图像与一段内轮廓图像;Divide the outer contour image and the inner contour image into N segments respectively, and pair each segment of the outer contour image with each segment of the inner contour image in pairs to obtain N image combinations, each of which includes a segment of the outer contour image and a segment of the inner contour image;分别计算每个所述图像组合中一段外轮廓图像与一段内轮廓图像的像素密度比值,得到N个所述像素密度比值,所述像素密度比值为每个所述图像组合中一段外轮廓图像与一段内轮廓图像的像素占比的比值,所述像素占比为像素点与总像素点的比值;Calculate the pixel density ratio of a segment of the outer contour image to a segment of the inner contour image in each of the image combinations respectively, and obtain N pixel density ratios, wherein the pixel density ratio is the ratio of the pixel proportion of a segment of the outer contour image to a segment of the inner contour image in each of the image combinations, and the pixel proportion is the ratio of the pixel points to the total pixel points;根据所述像素密度比值计算描述所述目标区域组织灰度图像质量。The grayscale image quality of the target area tissue is described by calculation according to the pixel density ratio.
- 根据权利要求1所述的方法,其特征在于,在所述分别计算得到目标区域组织灰度图像的外轮廓图像与内轮廓图像之前,包括:The method according to claim 1 is characterized in that, before respectively calculating the outer contour image and the inner contour image of the target area tissue grayscale image, it comprises:获取组织灰度图像和掩模图像,所述掩模图像为二值图;Acquire a tissue grayscale image and a mask image, wherein the mask image is a binary image;对所述组织灰度图像的灰度区间重映射,获得增强组织灰度图像;Remapping the grayscale interval of the tissue grayscale image to obtain an enhanced tissue grayscale image;基于所述掩模图像对所述增强组织灰度图像进行组织分割,得到所述目标区域组织灰度图像。The enhanced tissue grayscale image is subjected to tissue segmentation based on the mask image to obtain the target area tissue grayscale image.
- 根据权利要求1所述的方法,其特征在于,所述分别计算得到目标区域组织灰度图像的外轮廓图像与内轮廓图像包括:The method according to claim 1, characterized in that the step of respectively calculating the outer contour image and the inner contour image of the target area tissue grayscale image comprises:基于膨胀核对目标区域组织灰度图像进行膨胀,得到第一组织灰度图像;Dilate the target region tissue grayscale image based on the dilation kernel to obtain a first tissue grayscale image;所述第一组织灰度图像与所述目标区域组织灰度图像进行差分计算,得到外轮廓图像;The first tissue grayscale image and the target area tissue grayscale image are subjected to differential calculation to obtain an outer contour image;基于腐蚀核对目标区域组织灰度图像进行腐蚀,得到第二组织灰度图像;Corrosion is performed on the target area tissue grayscale image based on the corrosion kernel to obtain a second tissue grayscale image;所述第二组织灰度图像与所述目标区域组织灰度图像进行差分计算,得到内轮廓图像。The second tissue grayscale image and the target area tissue grayscale image are differentially calculated to obtain an inner contour image.
- 根据权利要求1所述的方法,其特征在于,所述将所述外轮廓图像与所述内轮廓图像分别分为N段,包括:The method according to claim 1, characterized in that the step of dividing the outer contour image and the inner contour image into N segments respectively comprises:标定所述外轮廓图像与所述内轮廓图像的分割位置,所述外轮廓图像的分割位置与所述内轮廓图像的分割位值相互对应;Marking the segmentation position of the outer contour image and the inner contour image, wherein the segmentation position of the outer contour image corresponds to the segmentation position value of the inner contour image;基于所述分割位置将所述外轮廓图像与所述内轮廓图像分别分割成N段。The outer contour image and the inner contour image are respectively divided into N segments based on the segmentation positions.
- 根据权利要求1所述的方法,其特征在于,所述将每段所述外轮廓图像与每段所述内轮廓图像两两配对,包括:The method according to claim 1, characterized in that pairing each segment of the outer contour image with each segment of the inner contour image in pairs comprises:计算每段外部轮廓图像的质心和每段内部轮廓图像的质心,计算得到的质心为每段外部轮廓图像和每段内部轮廓图像的形状的描述;Calculate the centroid of each segment of the external contour image and the centroid of each segment of the internal contour image, and the calculated centroid is a description of the shape of each segment of the external contour image and each segment of the internal contour image;若一段外部轮廓图像的质心与一段内部轮廓图像的质心相似度大于预设阈值,则对所述一段外部轮廓图像与所述一段内部轮廓图像进行配对。If the similarity between the centroid of a segment of the external contour image and the centroid of a segment of the internal contour image is greater than a preset threshold, the segment of the external contour image and the segment of the internal contour image are paired.
- 根据权利要求2所述的方法,其特征在于,所述对所述组织灰度图像的灰度区间重映射,获得增强组织灰度图像包括:The method according to claim 2, characterized in that the grayscale interval remapping of the tissue grayscale image to obtain an enhanced tissue grayscale image comprises:对在所述组织灰度图像中像素点个数满足第一预设范围的灰度值进行展宽,所述第一预设范围为对所述组织灰度图像显示起主要作用的灰度值对应的像素点的数量范围;对在所述组织灰度图像中像素点个数满足第二预设范围的灰度值进行归并,所述第二预设范围为对所述组织灰度图像显示不起主要作用的灰度值对应的像素点的数量范围;The grayscale values whose number of pixels in the tissue grayscale image meets a first preset range are widened, and the first preset range is the number range of pixels corresponding to the grayscale values that play a major role in the display of the tissue grayscale image; the grayscale values whose number of pixels in the tissue grayscale image meets a second preset range are merged, and the second preset range is the number range of pixels corresponding to the grayscale values that do not play a major role in the display of the tissue grayscale image;将展宽和归并后的灰度值重映射至所述组织灰度图像,得到所述增强组织灰度图像。The grayscale values after broadening and merging are remapped to the tissue grayscale image to obtain the enhanced tissue grayscale image.
- 根据权利要求1所述的方法,其特征在于,所述根据所述像素密度比值计算描述所述目标区域组织灰度图像质量包括:The method according to claim 1, characterized in that the step of calculating the grayscale image quality of the target area tissue according to the pixel density ratio comprises:计算N个所述像素密度比值的平均值;Calculate the average value of N pixel density ratios;根据所述像素密度比值的平均值计算描述所述目标区域组织灰度图像质量。The grayscale image quality of the target area tissue is calculated based on the average value of the pixel density ratio.
- 一种灰度图像质量评估装置,其特征在于,包括:A grayscale image quality assessment device, comprising:第一计算单元,用于分别计算得到目标区域组织灰度图像的外轮廓图像与内轮廓图像;A first calculation unit is used to calculate and obtain an outer contour image and an inner contour image of a target area tissue grayscale image respectively;配对单元,用于将所述外轮廓图像与所述内轮廓图像分别分为N段,并将每段所述外轮廓图像与每段所述内轮廓图像两两配对,得到N个图像组合,每个所述图像组合包括一段外轮廓图像与一段内轮廓图像;a pairing unit, configured to divide the outer contour image and the inner contour image into N segments respectively, and pair each segment of the outer contour image with each segment of the inner contour image in pairs to obtain N image combinations, each of which includes a segment of the outer contour image and a segment of the inner contour image;第二计算单元,用于分别计算每个所述图像组合中一段外轮廓图像与一段内轮廓图像的像素密度比值,得到N个所述像素密度比值,所述像素密度比值为每个所述图像组合中一段外轮廓图像与一段内轮廓图像的像素占比的比值,所述像素占比为像素点与总像素点的比值;A second calculation unit is used to calculate the pixel density ratio of a segment of the outer contour image to a segment of the inner contour image in each of the image combinations, to obtain N pixel density ratios, wherein the pixel density ratio is the ratio of the pixel proportion of a segment of the outer contour image to a segment of the inner contour image in each of the image combinations, and the pixel proportion is the ratio of the pixel point to the total pixel points;第三计算单元,根据所述像素密度比值计算描述所述目标区域组织灰度图像质量。A third calculation unit is configured to calculate a grayscale image quality describing the target area tissue according to the pixel density ratio.
- 一种电子设备,其特征在于,包括:An electronic device, comprising:至少一个处理器;以及at least one processor; and与所述至少一个处理器通信连接的存储器;其中,a memory communicatively connected to the at least one processor; wherein,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求1-7中任一项所述的方法。The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.
- 一种存储有计算机指令的非瞬时计算机可读存储介质,其特征在于,所述计算机指令用于使所述计算机执行根据权利要求1-7中任一项所述的方法。A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method according to any one of claims 1-7.
- 一种计算机程序产品,其特征在于,包括计算机程序,所述计算机程序在被处理器执行时实现根据权利要求1-7中任一项所述的方法。A computer program product, characterized in that it comprises a computer program, and when the computer program is executed by a processor, it implements the method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2022/136658 WO2024119322A1 (en) | 2022-12-05 | 2022-12-05 | Method and apparatus for evaluating quality of grayscale image, and electronic device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2022/136658 WO2024119322A1 (en) | 2022-12-05 | 2022-12-05 | Method and apparatus for evaluating quality of grayscale image, and electronic device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2024119322A1 true WO2024119322A1 (en) | 2024-06-13 |
Family
ID=91378378
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/136658 WO2024119322A1 (en) | 2022-12-05 | 2022-12-05 | Method and apparatus for evaluating quality of grayscale image, and electronic device and storage medium |
Country Status (1)
Country | Link |
---|---|
WO (1) | WO2024119322A1 (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6999631B1 (en) * | 1999-11-19 | 2006-02-14 | Fujitsu Limited | Image processing apparatus and method |
CN101853504A (en) * | 2010-05-07 | 2010-10-06 | 厦门大学 | Image quality evaluating method based on visual character and structural similarity (SSIM) |
CN107481238A (en) * | 2017-09-20 | 2017-12-15 | 众安信息技术服务有限公司 | Image quality measure method and device |
CN111028198A (en) * | 2019-07-12 | 2020-04-17 | 北京达佳互联信息技术有限公司 | Image quality evaluation method, device, terminal and readable storage medium |
-
2022
- 2022-12-05 WO PCT/CN2022/136658 patent/WO2024119322A1/en unknown
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6999631B1 (en) * | 1999-11-19 | 2006-02-14 | Fujitsu Limited | Image processing apparatus and method |
CN101853504A (en) * | 2010-05-07 | 2010-10-06 | 厦门大学 | Image quality evaluating method based on visual character and structural similarity (SSIM) |
CN107481238A (en) * | 2017-09-20 | 2017-12-15 | 众安信息技术服务有限公司 | Image quality measure method and device |
CN111028198A (en) * | 2019-07-12 | 2020-04-17 | 北京达佳互联信息技术有限公司 | Image quality evaluation method, device, terminal and readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20220147822A1 (en) | Training method and apparatus for target detection model, device and storage medium | |
US20210406579A1 (en) | Model training method, identification method, device, storage medium and program product | |
CN114565763B (en) | Image segmentation method, device, apparatus, medium and program product | |
US20220036068A1 (en) | Method and apparatus for recognizing image, electronic device and storage medium | |
EP3876197A2 (en) | Portrait extracting method and apparatus, electronic device and storage medium | |
US12118770B2 (en) | Image recognition method and apparatus, electronic device and readable storage medium | |
CN114677565B (en) | Training method and image processing method and device for feature extraction network | |
CN114564971B (en) | Training method of deep learning model, text data processing method and device | |
US11861498B2 (en) | Method and apparatus for compressing neural network model | |
US20230115765A1 (en) | Method and apparatus of transferring image, and method and apparatus of training image transfer model | |
CN116403083A (en) | Image processing method and device, electronic equipment and storage medium | |
CN115457329B (en) | Training method of image classification model, image classification method and device | |
CN113962845B (en) | Image processing method, image processing apparatus, electronic device, and storage medium | |
WO2024119322A1 (en) | Method and apparatus for evaluating quality of grayscale image, and electronic device and storage medium | |
CN114926322B (en) | Image generation method, device, electronic equipment and storage medium | |
CN113361575B (en) | Model training method and device and electronic equipment | |
CN113947146A (en) | Sample data generation method, model training method, image detection method and device | |
CN113887435A (en) | Face image processing method, device, equipment, storage medium and program product | |
CN114495236B (en) | Image segmentation method, apparatus, device, medium, and program product | |
CN114844889B (en) | Video processing model updating method and device, electronic equipment and storage medium | |
CN112434170B (en) | Dictionary updating method and device | |
CN112819715B (en) | Data recovery method, network training method, related device and electronic equipment | |
US11227115B2 (en) | Information processing apparatus, information processing method, and non-transitory computer-readable medium storing information processing program | |
US20220327757A1 (en) | Method and apparatus for generating dynamic video of character, electronic device and storage medium | |
US20220351493A1 (en) | Method and apparatus for detecting object, electronic device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22967485 Country of ref document: EP Kind code of ref document: A1 |