Grayscale image quality evaluation method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202280102346.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-05
- Publication Date
- 2025-07-15
AI Technical Summary
Existing technology lacks methods to evaluate the quality of tissue grayscale images in target areas.
By calculating the pixel density ratio of the outer contour image and the inner contour image of the target area tissue grayscale image, combined with image segmentation and remapping technology, the quality of the target area tissue grayscale image is evaluated.
It achieves effective assessment of the quality of grayscale images of tissue in the target area, reduces the impact of noise on the assessment results, and does not require manual supervision.
Smart Images

Figure CN120322795A_ABST
Abstract
Description
Grayscale image quality assessment method and device, electronic device and storage medium Technical Field
[0001] 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. Background Art
[0002] 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 performing quality evaluation on the target area tissue grayscale image is an issue that needs to be urgently addressed.
[0003] Summary of the Invention
[0004] The present disclosure provides a method and apparatus, electronic device, and storage medium for grayscale image quality assessment. The primary purpose is to address the lack of a method for assessing the quality of grayscale images of target tissue areas. The primary purpose is to assess the quality of grayscale images of target tissue areas.
[0005] According to a first aspect of the present disclosure, a method for grayscale image quality assessment is provided, comprising:
[0006] The outer contour image and the inner contour image of the target area tissue grayscale image are calculated respectively;
[0007] 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 to obtain N image combinations, each of which includes a segment of the outer contour image and a segment of the inner contour image;
[0008] 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, where the pixel density ratio is the ratio of the pixel proportion of the segment of the outer contour image to the 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;
[0009] The grayscale image quality of the target area tissue is calculated based on the pixel density ratio.
[0010] Optionally, before respectively calculating the outer contour image and the inner contour image of the target area tissue grayscale image, the method includes:
[0011] Acquire a tissue grayscale image and a mask image, wherein the mask image is a binary image;
[0012] remapping the grayscale interval of the tissue grayscale image to obtain an enhanced tissue grayscale image;
[0013] The enhanced tissue grayscale image is subjected to tissue segmentation based on the mask image to obtain the target area tissue grayscale image.
[0014] Optionally, the step of separately calculating an outer contour image and an inner contour image of a target area tissue grayscale image includes:
[0015] dilating the target region tissue grayscale image based on the dilation kernel to obtain a first tissue grayscale image;
[0016] Performing a differential calculation on the first tissue grayscale image and the target area tissue grayscale image to obtain an outer contour image;
[0017] Corrosion is performed on the target area tissue grayscale image based on the corrosion kernel to obtain a second tissue grayscale image;
[0018] A difference calculation is performed between the second tissue grayscale image and the target area tissue grayscale image to obtain an inner contour image.
[0019] Optionally, dividing the outer contour image and the inner contour image into N segments respectively includes:
[0020] 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;
[0021] The outer contour image and the inner contour image are respectively divided into N segments based on the segmentation positions.
[0022] Optionally, pairing each segment of the outer contour image with each segment of the inner contour image in pairs includes:
[0023] 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 centroids are descriptions of the shapes of each segment of the external contour image and each segment of the internal contour image;
[0024] 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.
[0025] Optionally, remapping the grayscale intervals of the tissue grayscale image to obtain an enhanced tissue grayscale image includes:
[0026] Grayscale values in the tissue grayscale image whose number of pixels falls within a first preset range are stretched, where the first preset range is the range of the number of pixels corresponding to grayscale values that play a major role in displaying the tissue grayscale image; grayscale values in the tissue grayscale image whose number of pixels falls within a second preset range are merged, where the second preset range is the range of the number of pixels corresponding to grayscale values that do not play a major role in displaying the tissue grayscale image;
[0027] The stretched and merged grayscale values are remapped to the tissue grayscale image to obtain the enhanced tissue grayscale image.
[0028] Optionally, the calculating and describing the grayscale image quality of the target area tissue according to the pixel density ratio includes:
[0029] Calculating an average value of N pixel density ratios;
[0030] The grayscale image quality of the target area tissue is calculated based on the average value of the pixel density ratio.
[0031] According to a second aspect of the present disclosure, there is provided a grayscale image quality assessment device, comprising:
[0032] The first calculation unit is used to calculate and obtain the outer contour image and the inner contour image of the grayscale image of the target area tissue respectively;
[0033] a pairing unit, configured to divide the outer contour image and the inner contour image into N segments, and pair 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;
[0034] a second calculation unit, configured to respectively calculate a 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 a ratio of a pixel point to a total pixel point.
[0035] A third calculation unit is configured to calculate a grayscale image quality of the target area tissue according to the pixel density ratio.
[0036] Optionally, the device includes:
[0037] an acquisition unit, configured to acquire a tissue grayscale image and a mask image, wherein the mask image is a binary image;
[0038] a remapping unit, configured to remap the grayscale intervals of the tissue grayscale image to obtain an enhanced tissue grayscale image;
[0039] 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.
[0040] Optionally, the first computing unit includes:
[0041] an expansion module, configured to expand the target region tissue grayscale image based on the expansion kernel to obtain a first tissue grayscale image;
[0042] a first calculation module, configured to perform a difference calculation between the first tissue grayscale image and the target area tissue grayscale image to obtain an outer contour image;
[0043] an erosion module, configured to erode the target region tissue grayscale image based on the erosion kernel to obtain a second tissue grayscale image;
[0044] 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.
[0045] Optionally, the pairing unit includes:
[0046] a calibration module, configured 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;
[0047] A segmentation module is used to segment the outer contour image and the inner contour image into N segments based on the segmentation positions.
[0048] Optionally, the pairing unit further includes:
[0049] A calculation module, used to calculate 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;
[0050] The pairing module is configured 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.
[0051] Optionally, the remapping unit includes:
[0052] a stretching and merging module, configured to stretch the grayscale values in the tissue grayscale image whose number of pixels falls within a first preset range, wherein the first preset range is the range of the number of pixels corresponding to the grayscale values that play a major role in displaying the tissue grayscale image; and merge the grayscale values in the tissue grayscale image whose number of pixels falls within a second preset range, wherein the second preset range is the range of the number of pixels corresponding to the grayscale values that do not play a major role in displaying the tissue grayscale image;
[0053] The remapping module is used to remap the grayscale values after stretching and merging to the tissue grayscale image to obtain the enhanced tissue grayscale image.
[0054] Optionally, the third calculation unit includes:
[0055] A first calculation module is used to calculate an average value of N pixel density ratios;
[0056] 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.
[0057] According to a third aspect of the present disclosure, there is provided an electronic device, including:
[0058] at least one processor; and
[0059] a memory communicatively connected to the at least one processor; wherein,
[0060] The memory stores instructions that can be executed by the at least one processor. 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.
[0061] 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.
[0062] 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.
[0063] The present disclosure provides a method and device, electronic device, and storage medium for evaluating grayscale image quality. The main technical solutions include: calculating the outer contour image and inner contour image of the target region tissue grayscale image 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; calculating the pixel density ratio of a segment of the outer contour image to a segment of the inner contour image in each image combination 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 image combination, and the pixel proportion is the ratio of the pixel point to the total pixel point; and calculating the quality of the target region tissue grayscale image based on the pixel density ratio. Based on the calculation of the pixel density ratio of a segment of the outer contour image to a segment of the inner contour image in each image combination, an evaluation score for the quality of the target region tissue grayscale image is obtained, thereby achieving the quality evaluation of the tissue grayscale image.
[0064] 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. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] The accompanying drawings are used to better understand the present invention and do not constitute a limitation of the present invention.
[0066] FIG1 is a schematic flow chart of a grayscale image quality assessment method provided by an embodiment of the present disclosure;
[0067] FIG2 is a schematic diagram showing the relationship between an external contour image and an internal contour image provided by an embodiment of the present disclosure;
[0068] FIG3 is a schematic diagram showing the relationship between another external contour image and an internal contour image provided by an embodiment of the present disclosure.
[0069] FIG4 is a schematic diagram of a process for segmenting a tissue grayscale image provided by an embodiment of the present disclosure;
[0070] FIG5 is a schematic diagram of a grayscale image of an original tissue provided by an embodiment of the present disclosure;
[0071] FIG6 is a schematic diagram of grayscale images of tissue before and after augmentation provided by an embodiment of the present disclosure;
[0072] FIG7 is a schematic diagram of a histogram corresponding to an original tissue grayscale image provided by an embodiment of the present disclosure;
[0073] FIG8 is a schematic diagram of a histogram corresponding to an enhanced tissue grayscale image provided by an embodiment of the present disclosure;
[0074] FIG9 is a schematic structural diagram of a device for grayscale image quality assessment provided by an embodiment of the present disclosure;
[0075] FIG10 is a schematic structural diagram of another apparatus for grayscale image quality assessment provided by an embodiment of the present disclosure;
[0076] FIG11 is a schematic block diagram of an example electronic device 400 provided in accordance with an embodiment of the present disclosure. DETAILED DESCRIPTION
[0077] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize 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.
[0078] The following describes a method and apparatus for grayscale image quality assessment, an electronic device, and a storage medium according to embodiments of the present disclosure with reference to the accompanying drawings.
[0079] FIG1 is a flow chart of a grayscale image quality assessment method provided by an embodiment of the present disclosure.
[0080] As shown in Figure 1, the method includes the following steps:
[0081] Step 101 : Calculate and obtain the outer contour image and inner contour image of the target area tissue grayscale image respectively.
[0082] As a refinement of the above-mentioned step 101, when implementing step 101, the outer contour image and the inner contour image of the grayscale image of the target area tissue can be obtained respectively based on matrix operations. 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.
[0083] Step 102 : 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 to obtain N image combinations, each of which includes one segment of the outer contour image and one segment of the inner contour image.
[0084] In order to more intuitively demonstrate the relationship between the outer contour image and the inner contour image, Figure 2 is a schematic structural diagram of the relationship between an outer contour image and an inner contour image provided in an embodiment of the present disclosure, and Figure 3 is a schematic structural diagram of another relationship between an 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 divided into N segments respectively, 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 from the N segments of the inner contour image to form an image combination. After the pairing is completed, N image combinations can be obtained.
[0085] 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 points.
[0086] 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 completing the calculation of the pixel ratios of all segments of the outer contour images and the pixel ratios of all segments of the inner contour images.
[0087] 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.
[0088] Step 104 : Calculate the grayscale image quality of the target area tissue according to the pixel density ratio.
[0089] As a refinement of the above step 104, calculating the quality of the grayscale image of the target region tissue according to 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 the value describing the quality of the grayscale image of the target region tissue. The preset function can be a linear function or a non-linear function.
[0090] To facilitate understanding of the above refined content, this embodiment provides an exemplary illustration in combination with formulas. For example: the average value of the effective pixel density ratio is x. When x is greater than 0 and less than 200, the formula (1) can be substituted to obtain the value describing the quality of the grayscale image of the target region tissue. The formula (1) is as follows:
[0091] F(x) = 100 * x^0.7(0 < x < 200) Formula (1)
[0092] F(x) = 0(x <= 0) Formula (2)
[0093] F(x) = 100(x >= 200) Formula (3)
[0094] The above formulas are only exemplary illustrations and can be replaced by any function. The embodiments of the present disclosure do not limit the formulas. <
[0098] A tissue grayscale image to be segmented is obtained, and a mask image for performing tissue segmentation on the tissue grayscale image is obtained. The mask image is a binary image, that is, the grayscale value of the pixels in the mask image is 0 or 255.
[0099] Step 202 : remap the grayscale intervals of the tissue grayscale image to obtain an enhanced tissue grayscale image.
[0100] 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, and finally a clearer tissue grayscale image is obtained.
[0101] Step 203 : performing tissue segmentation on the enhanced tissue grayscale image based on the mask image to obtain the target area tissue grayscale image.
[0102] Perform tissue segmentation on the area not covered by the mask image to obtain a grayscale image of the target area tissue.
[0103] 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: dilating the target area tissue grayscale image based on the dilation kernel to obtain a first tissue grayscale image; performing differential calculation on the first tissue grayscale image and the target area tissue grayscale image to obtain an outer contour image; corroding the target area tissue grayscale image based on the erosion kernel to obtain a second tissue grayscale image; performing differential calculation on the second tissue grayscale image and the target area tissue grayscale image to obtain an inner contour image.
[0104] The dilation kernel is a matrix constructed based on the size of the target region's tissue grayscale image. A larger target region's tissue grayscale image results in a larger matrix with more elements. The dilation kernel is used to expand the highlighted area of the target region's tissue grayscale image, generating a first tissue grayscale image larger in area than the target region's tissue grayscale image. The dilation kernel is essentially a convolution calculation between the dilation kernel and the target region's tissue grayscale image. The resulting first tissue grayscale image is then differentially calculated with the target region's tissue grayscale image to generate an outer contour image.
[0105] The erosion process is consistent with the dilation process. The erosion kernel is a matrix constructed based on the size of the target region's tissue grayscale image. The larger the target region's tissue grayscale image, the larger the matrix and the more elements it contains. The erosion kernel is used to reduce the highlighted areas of the target region's tissue grayscale image, resulting in a second tissue grayscale image with a smaller area than the target region's tissue grayscale image. Erosion is essentially a convolution calculation between the erosion kernel and the target region's tissue grayscale image. The resulting second tissue grayscale image is then differentially calculated with the target region's tissue grayscale image to obtain an inner contour image.
[0106] 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.
[0107] As a refinement of the above embodiment, the segmentation position calibration includes: taking the first pixel point A in the outer contour image as the starting point and dividing the image 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 the image into N segments along the contour line. To a certain degree, the outer contour image and the inner contour image can be divided based on the number of pixels. The contour line refers to treating the outer contour image and the inner contour image as a line without width to facilitate segmentation.
[0108] 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, and the like.
[0109] 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 step 102, the following implementation method may be used, but is 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 calculated centroid being a 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, then pairing the segment of the outer contour image 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 essentially pairs the segment of the outer contour image with the segment of the inner contour image with the highest shape similarity to form an image combination.
[0110] As a refinement of the above embodiments, when performing the gray-scale interval remapping of the tissue gray-scale image in step 202 to obtain the enhanced tissue gray-scale image, the following implementation manners may be adopted but are not limited thereto. For example: widen the gray-scale values of the pixel points in the tissue gray-scale image that satisfy the first preset range, where the first preset range is the number range of pixel points corresponding to the gray-scale values that mainly affect the display of the tissue gray-scale image; merge the gray-scale values of the pixel points in the tissue gray-scale image that satisfy the second preset range, where the second preset range is the number range of pixel points corresponding to the gray-scale values that do not mainly affect the display of the tissue gray-scale image; remap the widened and merged gray-scale values to the tissue gray-scale image to obtain the enhanced tissue gray-scale image.
[0111] The purpose of the above steps is to enhance the clarity of the tissue gray-scale image. By widening some gray-scale values, the highlight area of the tissue gray-scale image becomes larger, and at the same time, by merging some gray-scale values, the contour of the tissue gray-scale image becomes more obvious.
[0112] In the specific implementation process, the enhanced tissue gray-scale image may adopt the following implementation manners but are not limited thereto:
[0113] It should be understood that the gray-scale is divided into 256 blocks to draw a histogram. If it is a 16-bit image, 1 bin contains 256 gray levels, and if it is an 8-bit image, 1 bin contains only 1 gray level.
[0114] Scenically, taking the 256-bin statistical histogram as an example, search the histogram from the low point to the high point: from histogram bin 0 to bin 255, traverse each bin in the histogram. If the value of this bin, i.e., val, meets the condition imgsize / 5000 < val < imgsize / 10, it is a qualified value. Conversely, for the search from the high point to the low point, it is from histogram bin 255 to bin 0. Find the value that meets the condition imgsize / 5000 < val < imgsize / 10 and stop the search. Here, imgsize refers to the total number of pixels of the image, the bin is the gray-scale value block, and the value of the bin, i.e., val, is the number of pixel points corresponding to each bin.
[0115] To more intuitively display the effects before and after the enhancement of the tissue gray-scale image, FIG. 5 is a schematic diagram of an original tissue gray-scale image provided by an embodiment of the present disclosure, FIG. 6 is a schematic diagram of a tissue gray-scale image before and after enhancement provided by an embodiment of the present disclosure, and the tissue gray-scale image shown in FIG. 6 is the effect after the enhancement of the tissue gray-scale image in FIG. 5. <00002At 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.
[0117] As a refinement of the above embodiment, when executing step 104 to calculate the grayscale image quality of the target area tissue based on the pixel density ratio, the following implementation method can be adopted but is not limited to, for example: calculating the average value of N pixel density ratios; calculating the grayscale image quality of the target area tissue based on the average value of the pixel density ratio.
[0118] The N pixel density ratios are added and divided by N to obtain an average value of the pixel density ratios. The quality of the tissue grayscale image is determined based on the average value. In the embodiment of the present disclosure, N is a positive integer.
[0119] In summary, the embodiments of the present disclosure can achieve the following effects:
[0120] 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 of the grayscale image quality of the target area tissue is obtained, thereby realizing the quality evaluation of the grayscale image of the tissue.
[0121] 2. When performing the quality assessment of the tissue grayscale image based on this embodiment, no manual supervision is required.
[0122] 3. The influence of noise on the evaluation results is reduced by dividing the inner contour image and the outer contour image into two segments and calculating the average value of their pixel density ratio.
[0123] Corresponding to the aforementioned 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 aforementioned method embodiment, any details not disclosed in the device embodiment can be referred to the aforementioned method embodiment and will not be further described in this invention.
[0124] 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:
[0125] The first calculation unit 31 is used to calculate and obtain the outer contour image and the inner contour image of the grayscale image of the target area tissue respectively;
[0126] a pairing unit 32 configured to divide the outer contour image and the inner contour image into N segments, and pair 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;
[0127] a second calculating unit 33 for calculating a pixel density ratio of a segment of the outer contour image to a segment of the inner contour image in each image combination, to obtain N pixel density ratios, wherein the pixel density ratio is a ratio of a pixel point to a total pixel point.
[0128] The third calculation unit 34 calculates the grayscale image quality of the target area tissue according to the pixel density ratio.
[0129] The present disclosure provides a device for evaluating grayscale image quality, comprising: calculating an outer contour image and an inner contour image of a target region 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; calculating a pixel density ratio of a segment of the outer contour image to a segment of the inner contour image in each image combination 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 image combination, and the pixel proportion is the ratio of the pixel point to the total pixel point; and calculating a description of the target region tissue grayscale image quality based on the pixel density ratio. Based on calculating the pixel density ratio of a segment of the outer contour image to a segment of the inner contour image in each image combination, an evaluation score for the target region tissue grayscale image quality is obtained, thereby achieving tissue grayscale image quality evaluation.
[0130] Furthermore, in a possible implementation of this embodiment, FIG10 is a schematic structural diagram of another grayscale image quality assessment device provided by an embodiment of the present disclosure. As shown in FIG10 , the device includes:
[0131] An acquisition unit 35 is used to acquire a tissue grayscale image and a mask image, wherein the mask image is a binary image;
[0132] a remapping unit 36, configured to remap the grayscale intervals of the tissue grayscale image to obtain an enhanced tissue grayscale image;
[0133] The segmentation unit 37 is configured to perform tissue segmentation on the enhanced tissue grayscale image based on the mask image to obtain the target area tissue grayscale image.
[0134] Furthermore, in a possible implementation of this embodiment, as shown in FIG10 , the first calculating unit 31 includes:
[0135] An expansion module 311 is configured to expand the target region tissue grayscale image based on the expansion kernel to obtain a first tissue grayscale image;
[0136] A first calculation module 312 is configured to perform a difference calculation between the first tissue grayscale image and the target area tissue grayscale image to obtain an outer contour image;
[0137] An erosion module 313 is configured to erode the target region tissue grayscale image based on the erosion kernel to obtain a second tissue grayscale image;
[0138] The second calculation module 314 is configured to perform a difference calculation between the second tissue grayscale image and the target area tissue grayscale image to obtain an inner contour image.
[0139] Furthermore, in a possible implementation of this embodiment, as shown in FIG10 , the pairing unit 32 includes:
[0140] a calibration module 321 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;
[0141] The segmentation module 322 is configured to segment the outer contour image and the inner contour image into N segments based on the segmentation positions.
[0142] Furthermore, in a possible implementation of this embodiment, as shown in FIG10 , the pairing unit 32 further includes:
[0143] A calculation module 323 is used to calculate the centroid of each segment of the outer contour image and the centroid of each segment of the inner contour image, where the calculated centroids are descriptions of the shapes of each segment of the outer contour image and each segment of the inner contour image;
[0144] The pairing module 324 is configured 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.
[0145] Furthermore, in a possible implementation of this embodiment, as shown in FIG10 , the remapping unit 36 includes:
[0146] The stretching and merging module 361 is configured to stretch the grayscale values of the tissue grayscale image whose number of pixels falls within a first preset range, wherein the first preset range is the range of the number of pixels corresponding to the grayscale values that play a major role in displaying the tissue grayscale image; and to merge the grayscale values of the tissue grayscale image whose number of pixels falls within a second preset range, wherein the second preset range is the range of the number of pixels corresponding to the grayscale values that do not play a major role in displaying the tissue grayscale image;
[0147] The remapping module 362 is configured to remap the stretched and merged grayscale values to the tissue grayscale image to obtain the enhanced tissue grayscale image.
[0148] Furthermore, in a possible implementation of this embodiment, as shown in FIG10 , the third calculation unit 34 includes:
[0149] A first calculation module 341 is configured to calculate an average value of the N pixel density ratios;
[0150] The second calculation module 342 is configured to calculate the grayscale image quality of the target area tissue according to the average value of the pixel density ratio.
[0151] It should be noted that the above explanation of the method embodiment is also applicable to the device of this embodiment, and the principles are the same, which is not limited in this embodiment.
[0152] 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.
[0153] FIG11 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 assistants, 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.
[0154] As shown in Figure 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. Various programs and data required for the operation of the device 400 can also be stored in the RAM 403. 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.
[0155] 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.
[0156] 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.
[0157] The computing unit 401 can be any general-purpose and / or specialized processing component 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 that run 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 the grayscale image quality assessment method.
[0158] 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 .
[0159] In some embodiments, part or all of the computer program may be loaded and / or installed onto the device 400 via the ROM 402 and / or the communication unit 409 .
[0160] When the computer program is loaded into RAM 403 and executed by computing unit 401, one or more steps of the method described above may be performed. Alternatively, in other embodiments, computing unit 401 may be configured to perform the aforementioned grayscale image quality assessment method in any other appropriate manner (e.g., via firmware).
[0161] Various implementations 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 Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application Specific Standard Products), SOCs (System On Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof.
[0162] These various embodiments may include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system comprising at least one programmable processor, which may 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.
[0163] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0164] 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, device, or apparatus. 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, device, or apparatus, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may 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.
[0165] 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 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.
[0166] Other types of devices may also be used to provide interaction with the 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).
[0167] The systems and techniques described herein can be implemented in a computing system that includes back-end 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 front-end components (e.g., a user computer with a graphical user interface or 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 back-end components, middleware components, or front-end components. The components of the system can 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.
[0168] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact via a communication network. This client-server relationship is established by computer programs running on the respective computers, establishing a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host, a host product within a cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosts and VPS services ("Virtual Private Servers" or simply "VPS"). The server may also be a server in a distributed system or a server integrated with blockchain.
[0169] It's important to note that artificial intelligence (AI) is the study of how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). This encompasses both hardware and software technologies. AI hardware technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, and big data processing. AI software technologies primarily encompass computer vision, speech recognition, natural language processing, machine learning / deep learning, big data processing, and knowledge graphs.
[0170] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not a limitation herein.
[0171] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.
Claims
1. A method for grayscale image quality assessment, characterized in that: include: The outer contour image and the inner contour image of the grayscale image of the target area tissue are calculated respectively; 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; 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, where the pixel density ratio is the ratio of the pixel proportion of the segment of the outer contour image to the 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 calculated based on the pixel density ratio.
2. The method according to claim 1, characterized in that 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.
3. The method according to claim 1, characterized in that The outer contour image and the inner contour image of the target area tissue grayscale image are respectively calculated and obtained, comprising: dilating the target region tissue grayscale image based on the dilation kernel to obtain a first tissue grayscale image; Performing a differential calculation on the first tissue grayscale image and the target area tissue grayscale image 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; A difference calculation is performed between the second tissue grayscale image and the target area tissue grayscale image to obtain an inner contour image.
4. The method according to claim 1, wherein The step of dividing the outer contour image and the inner contour image into N segments respectively includes: 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; The outer contour image and the inner contour image are respectively divided into N segments based on the segmentation positions.
5. The method according to claim 1, wherein The step of pairing each segment of the outer contour image with each segment of the inner contour image comprises: 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 centroids are descriptions of the shapes 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.
6. 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 includes: Grayscale values in the tissue grayscale image whose number of pixels falls within a first preset range are stretched, where the first preset range is the range of the number of pixels corresponding to grayscale values that play a major role in displaying the tissue grayscale image; grayscale values in the tissue grayscale image whose number of pixels falls within a second preset range are merged, where the second preset range is the range of the number of pixels corresponding to grayscale values that do not play a major role in displaying the tissue grayscale image; The stretched and merged grayscale values are remapped to the tissue grayscale image to obtain the enhanced tissue grayscale image.
7. The method according to claim 1, characterized in that The calculating and describing the grayscale image quality of the target area tissue according to the pixel density ratio includes: Calculating an 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.
8. A grayscale image quality assessment device, characterized in that: include: The first calculation unit is used to calculate and obtain the outer contour image and the inner contour image of the grayscale image of the target area tissue respectively; a pairing unit, configured to divide the outer contour image and the inner contour image into N segments, and pair 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; a second calculation unit, configured to respectively calculate a 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 a ratio of a pixel point to a total pixel point. A third calculation unit is configured to calculate a grayscale image quality of the target area tissue according to the pixel density ratio.
9. An electronic device, characterized in that: include: at least one processor; as well as 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 according to any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 7.
11. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 7.