A method, device, electronic device and storage medium for fading lesion images

By extracting the mononuclear lesion area in the near-infrared image of the lesion, and using the rectangular frame structure for fading, the weighted hue value is calculated to replace the hue value of pixel points, the problems of unnatural and limiting the hue value range in the prior art are solved, and the natural transition and efficient fading effect are achieved.

CN113902716BActive Publication Date: 2025-06-27NINGBO DOLBY MEDICAL TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111193162.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-13
Publication Date
2025-06-27
Estimated Expiration
2041-10-13

AI Technical Summary

Technical Problem

When the prior art desalination of the mononuclear lesion area, there is a situation where the area or edges are unnatural, and the fuzzy method can only deal with areas with limited hue values.

Method used

By acquiring near-infrared images of the lesions, the mononuclear foci area is extracted and the external rectangular area and multiple rectangular boxes are generated. In the order from the outside to the inside, the target pixel points on each rectangular box are desalinated, and the weighted hue value is calculated using the hue values ​​of the target pixel points and surrounding pixel points to replace the hue value of the target pixel points.

Benefits of technology

Adaptive fading treatment is realized to ensure that the fading area transitions naturally, improve the fading effect of the mononuclear lesion area, and avoid the problems of unnatural areas and limiting the hue value range.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113902716B_ABST
    Figure CN113902716B_ABST
Patent Text Reader

Abstract

The present invention provides a method, apparatus, electronic device and storage medium for fading lesion images. The method includes: obtaining a near-infrared image of a lesion and extracting a single-nucleus lesion area from the near-infrared image of the lesion; generating a circumscribed rectangular area by using the single-nucleus lesion area, and generating a plurality of rectangular frames starting from the edge of the circumscribed rectangular area and moving inward; the border thickness of the rectangular frames is one pixel, and all the rectangular frames cover the circumscribed rectangular area; in the order from outside to inside, fading processing is performed on the target pixel points of each rectangular frame on the single-nucleus lesion area; the fading processing includes calculating a weighted hue value by using the hue values of the target pixel points and other surrounding pixel points, and replacing the hue value of the target pixel points with the weighted hue value; the weighted hue value of the target pixel points in the circumscribed lesion area can be used to fade the single-nucleus lesion area, and this value is obtained according to the hue values of this pixel point and its surroundings, which can fade adaptively and ensure a natural transition of the fading area, improving the fading effect of the single-nucleus lesion area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of medicine, and particularly to a method, device, electronic device and storage medium for fading lesion images. Background Art

[0002] A lesion refers to a diseased part of the body, and a single-nucleus lesion area is a lesion area containing a single lesion nucleus. To facilitate medical staff in analyzing the single-nucleus lesion area of interest, it is usually necessary to remove other single-nucleus lesion areas that are not concerned.

[0003] In related technologies, the subtractive color method, random noise method or blur method is usually used to remove irrelevant lesion areas. However, the areas removed by the subtractive color method and random noise method have unnatural situations within the area or at the area edge, and the blur method can only process areas containing a limited number of hue values. Summary of the Invention

[0004] The purpose of the present invention is to provide a method, device, electronic device and storage medium for fading lesion images, which can calculate a weighted hue value according to the target pixel points in the single-nucleus lesion area and the hue values around them, and use the weighted hue value to fade the single-nucleus lesion area, enabling adaptive fading, ensuring natural transition of the faded area and improving the fading effect of the single-nucleus lesion area.

[0005] To solve the above technical problems, the present invention provides a method for fading lesion images, including:

[0006] Obtain a near-infrared image of the lesion, and extract the single-nucleus lesion area in the near-infrared image of the lesion;

[0007] Generate an outer circumscribed rectangle area using the single-nucleus lesion area, and generate a plurality of rectangular frames starting from the edge of the outer circumscribed rectangle area and moving inward; the thickness of the border of the rectangular frame is one pixel, and all the rectangular frames cover the outer circumscribed rectangle area;

[0008] In the order from outside to inside, perform fading processing on the target pixel points of each rectangular frame on the single-nucleus lesion area; the fading processing includes calculating a weighted hue value using the hue values of the target pixel point and other surrounding pixel points, and replacing the hue value of the target pixel point with the weighted hue value.

[0009] Optionally, the extracting the single-nucleus lesion area in the near-infrared image of the lesion includes:

[0010] Extract the lesion area and a plurality of lesion nuclei in the near-infrared image of the lesion using a preset hue value range;

[0011] Use the shortest distance between the lesion nuclei and the edge of the lesion area to determine the dividing lines between the lesion nuclei;

[0012] Use the dividing line to divide the lesion area to obtain an initial single-nucleus lesion area;

[0013] Determine an initial target area and an initial protection area in the initial single-nucleus lesion area, and use the color fitting method to restore the overlapping part of the initial protection area with the initial target area to obtain an edge-restored image;

[0014] Use the edge-restored image to adjust the initial protection area and the initial protection area image in the initial protection area to obtain a protection area and a protection area image;

[0015] Use the protection area to adjust the initial target area to obtain the single-nucleus lesion area, and use the protection area image to cover the initial protection area image;

[0016] Execute the step of generating a circumscribed rectangle area using the single-nucleus lesion area in the near-infrared image of the lesion after the covering is completed.

[0017] Optionally, the generating a circumscribed rectangle area using the single-nucleus lesion area includes:

[0018] Determine the maximum abscissa, minimum abscissa, maximum ordinate, and minimum ordinate in the single-nucleus lesion area;

[0019] Use the maximum abscissa, the minimum abscissa, the maximum ordinate, and the minimum ordinate to generate the circumscribed rectangle area.

[0020] Optionally, after fading the target pixel points of each rectangle frame on the single-nucleus lesion area, it further includes:

[0021] Perform a filtering process on the single-nucleus lesion area.

[0022] Optionally, the calculating the weighted hue value using the hue values of the target pixel point and other surrounding pixel points includes:

[0023] Determine a preset square area centered on the target pixel point;

[0024] According to the positional relationship between each pixel point in the preset square area and the target pixel point, set a weight value for each pixel point in the preset square area;

[0025] Use the weight value and the hue value of the corresponding pixel point to calculate an initial weighted hue value for each pixel point in the preset square area;

[0026] Use the sum of the weight values and the initial weighted hue values to calculate the weighted hue value for the target pixel point.

[0027] The present invention also provides a lesion image fading device, including:

[0028] A region extraction module, configured to obtain a near-infrared image of a lesion and extract a single-nucleus lesion region from the near-infrared image of the lesion;

[0029] A rectangular frame generation module, configured to generate an enclosing rectangular region by using the single-nucleus lesion region, and generate a plurality of rectangular frames starting from the edge of the enclosing rectangular region and moving inward; the thickness of the border of the rectangular frame is one pixel, and all the rectangular frames cover the enclosing rectangular region;

[0030] A fading module, configured to perform fading processing on the target pixel points of each rectangular frame on the single-nucleus lesion region in the order from outside to inside; the fading processing includes calculating a weighted hue value by using the hue values of the target pixel point and other surrounding pixel points, and replacing the hue value of the target pixel point with the weighted hue value.

[0031] Optionally, the region extraction module includes:

[0032] A region extraction sub-module, configured to extract a lesion region and a plurality of lesion nuclei from the near-infrared image of the lesion by using a preset hue value range;

[0033] A calculation sub-module, configured to determine a dividing line between each of the lesion nuclei by using the shortest distance between the lesion nucleus and the edge of the lesion region;

[0034] A segmentation sub-module, configured to segment the lesion region by using the dividing line to obtain an initial single-nucleus lesion region;

[0035] An edge restoration sub-module, configured to determine an initial target region and an initial protection region in the initial single-nucleus lesion region, and restore an overlapping part of the initial protection region with the initial target region by using a color fitting method to obtain an edge restoration image;

[0036] A first adjustment sub-module, configured to adjust the initial protection region and an initial protection region image in the initial protection region by using the edge restoration image to obtain a protection region and a protection region image;

[0037] A second adjustment sub-module, configured to adjust the initial target region by using the protection region to obtain the single-nucleus lesion region, and cover the initial protection region image with the protection region image;

[0038] The rectangular frame generation module is further configured to perform the step of generating an enclosing rectangular region by using the single-nucleus lesion region in the near-infrared image of the lesion after completion of coverage.

[0039] Optionally, the rectangular box generation module includes:

[0040] A coordinate determination sub-module, configured to determine the maximum abscissa, minimum abscissa, maximum ordinate, and minimum ordinate in the single-nucleus lesion area;

[0041] A rectangular box generation sub-module, configured to generate the circumscribed rectangular area by using the maximum abscissa, the minimum abscissa, the maximum ordinate, and the minimum ordinate.

[0042] The present invention also provides an electronic device, including:

[0043] A memory, configured to store a computer program;

[0044] A processor, configured to implement the steps of the lesion image fading method as described above when executing the computer program.

[0045] The present invention also provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the lesion image fading method as described above are implemented.

[0046] The present invention provides a lesion image fading method, including: acquiring a near-infrared image of a lesion, and extracting a single-nucleus lesion area from the near-infrared image of the lesion; generating a circumscribed rectangular area by using the single-nucleus lesion area, and generating a plurality of rectangular boxes starting from the edge of the circumscribed rectangular area and moving inward; the border thickness of the rectangular box is one pixel, and all the rectangular boxes cover the circumscribed rectangular area; in the order from outside to inside, performing a fading process on the target pixel points of each rectangular box on the single-nucleus lesion area; the fading process includes calculating a weighted hue value by using the hue values of the target pixel point and other surrounding pixel points, and replacing the hue value of the target pixel point with the weighted hue value.

[0047] It can be seen that the present invention first generates a circumscribed rectangular area according to the single-core lesion area, generates a plurality of rectangular frames within the circumscribed rectangular area, and fades the target pixel points of each rectangular frame on the single-core lesion area in the order from outside to inside. Since the rectangular frames can completely cover the circumscribed rectangular area, and the circumscribed rectangular area can completely contain the single-core lesion area, the entire single-core lesion area can be faded. Secondly, in the process of fading, the present invention calculates the weighted hue value for the target pixel points by using the hue values of the target pixel points and their surrounding pixel points, and replaces the original hue value of the target pixel points with the weighted hue value. In other words, the present invention can adaptively fade the pixel points according to the hue situation around the pixel points, ensure that the faded area has a natural transition, and is not affected by the hue value range, effectively avoiding the problems of unnatural removal area, unnatural removal edge, and removal process limited by the hue value in the related art. The present invention also provides a lesion image fading device, an electronic device, and a storage medium, which have the above beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.

[0049] Figure 1 It is a flowchart of a lesion image fading method provided by an embodiment of the present invention;

[0050] Figure 2 It is a schematic diagram of an adjusted protected area image provided by an embodiment of the present invention;

[0051] Figure 3 It is a schematic diagram of adjusting an initial target area by using a protected area image provided by an embodiment of the present invention;

[0052] Figure 4 It is a schematic diagram of generating rectangular frames in a rectangular area provided by an embodiment of the present invention;

[0053] Figure 5 It is a schematic diagram of weight value setting provided by an embodiment of the present invention;

[0054] Figure 6 It is a schematic diagram of lesion image fading provided by an embodiment of the present invention;

[0055] Figure 7 It is a structural block diagram of a lesion image fading device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE INVENTION

[0056] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0057] A lesion refers to a diseased part of the body, and a single-nucleus lesion area is a lesion area containing a single lesion nucleus. To facilitate medical staff in analyzing the single-nucleus lesion area of interest, it is usually necessary to remove other single-nucleus lesion areas that are not of concern. In related technologies, usually the color reduction method, the random noise method or the blur method is used to remove the irrelevant lesion areas. However, the areas removed by the color reduction method and the random noise method have unnatural conditions within the area or at the area edge, and the blur method can only process areas containing limited hue values. In view of this, the embodiments of the present invention provide a method for fading a lesion image, which can calculate a weighted hue value according to the target pixel points in the single-nucleus lesion area and their surrounding hue values, and use the weighted hue value to fade the single-nucleus lesion area, enabling adaptive fading, ensuring a natural transition of the faded area and improving the fading effect of the single-nucleus lesion area. Please refer to Figure 1 , Figure 1 which is a flowchart of a method for fading a lesion image provided by the embodiments of the present invention. The method may include:

[0058] S101. Obtain a near-infrared image of the lesion, and extract the single-nucleus lesion area in the near-infrared image of the lesion.

[0059] In the embodiments of the present invention, the single-nucleus lesion region is the area range diffused by a single lesion nucleus, and the lesion nucleus is the position with the deepest lesion concentration in the lesion region. It should be noted that the embodiments of the present invention do not limit the number of lesion nuclei included in the near-infrared image of the lesion, which can be one or multiple. It can be understood that in the near-infrared image of the lesion, since the hue value of the lesion region is different from that of the normal region, when only one lesion nucleus is included in the image, the single-nucleus lesion region can be directly extracted using a preset hue value range, where Hue is a color feature; and when multiple lesion nuclei are included in the image, it can be understood that the diffusion ranges corresponding to each lesion nucleus will overlap, and at this time, it will be necessary to segment each single-nucleus lesion region. The embodiments of the present invention do not limit the specific method for segmenting the single-nucleus lesion region. For example, a machine learning model can be used for recognition and segmentation, or a circular diffusion region of the single-nucleus lesion region can be constructed according to the diffusion equation, and the intersection line between the circular diffusion regions is used to determine the segmentation line between each single-nucleus lesion region, and then the segmentation line is used for segmentation. The diffusion equation is a type of partial differential equation used to describe the change in the mass density in the diffusion phenomenon. In the embodiments of the present invention, considering that it is relatively complex to analyze the lesion nucleus using a machine learning model, a large amount of training data needs to be collected and a large amount of training is required to achieve the effect that meets the application requirements, and the diffusion of the lesion nucleus generally conforms to the diffusion equation. The diffusion of the lesion nucleus can be regarded as circular diffusion. Only a circular diffusion region centered on the lesion nucleus needs to be constructed, and the overlapping region between the circular diffusion regions is used to determine the segmentation line, so that multiple single-nucleus lesion regions can be efficiently segmented. Therefore, the present invention will segment the single-nucleus lesion region by constructing a circular diffusion region.

[0060] Specifically, since the hue value between the lesion region and the normal region is different, and the hue value of the lesion nucleus region is also different from that of other lesion regions, the lesion region and the lesion nucleus in the near-infrared image of the lesion can be extracted using a preset hue value range. It can be understood that when extracting the lesion region and the lesion nucleus, two different preset hue value ranges can be set, where the hue value range for extracting the lesion region includes the hue value range for extracting the lesion nucleus, and the specific range values can be set according to actual application requirements. Further, to construct a circular diffusion region, the radius of the circular diffusion region needs to be determined. In the embodiments of the present invention, the shortest distance between the lesion nucleus and the edge of the lesion region will be used as the value of the above radius. It should be noted that the embodiments of the present invention do not limit how to determine the shortest distance between the lesion nucleus and the edge of the lesion region. For example, the distances from the lesion nucleus to each point on the edge of the lesion region can be calculated, and the minimum value among these distances can be set as the shortest distance, or the lesion region can be scanned, and the shortest distance can be determined according to the scanning result, which can be set according to actual application requirements. Further, after constructing the circular diffusion region using the shortest distance, the intersection line of the two circles can be determined according to geometric knowledge, and then the intersection line can be set as the segmentation line.

[0061] Further, it can be understood that for overlapping single-nucleus lesion regions, if only the dividing line is used for division and the divided single-nucleus lesion regions are directly used for fading, it is easily affected by the hue values in other adhesively connected single-nucleus lesion regions, thereby affecting the fading effect. In view of this, in the embodiments of the present invention, for such adhesively connected single-nucleus lesion regions, the initial protected region to be protected and the initial target region to be faded will be first determined. Subsequently, the color fitting method will be used to restore the overlapping part of the initial protected region with the initial target region to obtain an edge restoration image. The color fitting method can utilize the hue values of each pixel value in the initial protected region to fit a transition edge from the lesion to the normal part (i.e., a transition edge from the lesion hue value to the normal part hue value) in the above overlapping part. Please refer to Figure 6 The right half of Figure 2 , Figure 2 is the adjusted protected region image of the upper single-nucleus lesion region. It can be seen that the overlapping part with the lower single-nucleus lesion region has been restored, and a restored edge that naturally transitions to the normal part has been obtained. After that, the initial target region will be adjusted using the protected region. In other words, the overlapping part of the initial target region and the protected region will be removed, and the protected region image will be used to cover the initial protected region image. Please refer to Figure 3 , in which the upper single-nucleus lesion region has been covered with the adjusted image, and the newly determined lower single-nucleus lesion region is wrapped by the region boundary line. It can be seen that at this time, an obvious boundary region appears between the upper single-nucleus lesion region and the lower single-nucleus lesion region, and the hue value in this boundary region is the hue value of the normal part. In other words, through the above operations, the embodiments of the present invention can effectively separate adhesively connected lesion regions and avoid the fading effect of the target region being affected by the adhesively connected protected region during the fading process. Finally, it can be understood that subsequent fading processing will be performed on the near-infrared image of the lesion after covering. In a possible case, extracting the single-nucleus lesion region from the near-infrared image of the lesion may include:

[0062] Step 11: Extract the lesion region and multiple lesion nuclei in the near-infrared image of the lesion using a preset hue value range;

[0063] Step 12: Determine the dividing lines between the lesion nuclei by using the shortest distance between the lesion nuclei and the edge of the lesion area;

[0064] Step 13: Divide the lesion area by using the dividing lines to obtain the initial single-nucleus lesion areas.

[0065] Step 14: Determine the initial target area and the initial protection area in the initial single-nucleus lesion area, and use the color fitting method to restore the overlapping part of the initial protection area with the initial target area to obtain an edge-restored image;

[0066] It should be noted that the embodiment of the present invention does not limit the specific process of the color fitting method, and relevant technologies for fitting the area edge by using color values or hue values can be referred to.

[0067] Step 15: Adjust the initial protection area and the initial protection area image in the initial protection area by using the edge-restored image to obtain the protection area and the protection area image;

[0068] It should be noted that the adjustment here is to supplement the edge-restored image to the initial protection area and the initial protection area image.

[0069] Step 16: Adjust the initial target area by using the protection area to obtain a single-nucleus lesion area, and cover the initial protection area image with the protection area image;

[0070] It should be noted that the adjustment here is to remove the overlapping part of the initial target area and the protection area.

[0071] Step 17: Execute the step of generating a circumscribed rectangular area by using the single-nucleus lesion area in the covered near-infrared image of the lesion.

[0072] S102: Generate a circumscribed rectangular area by using the single-nucleus lesion area, and generate a plurality of rectangular frames starting from the edge of the circumscribed rectangular area and moving inward; the thickness of the border of the rectangular frame is one pixel, and all the rectangular frames cover the circumscribed rectangular area.

[0073] It can be understood that the shape of the single-core lesion area is usually irregular. If the irregular graph is faded, it is easy to increase the complexity of the fading process. Therefore, in the embodiments of the present invention, an external circumscribed rectangle area will be additionally generated for the single-core lesion area, where the external circumscribed rectangle area includes the single-core lesion area. In other words, the embodiments of the present invention will convert the single-core lesion area into a regular area convenient for processing and perform the fading process within this regular area. Of course, to further improve the processing efficiency, the external circumscribed rectangle area should be parallel to the horizontal direction. It should be noted that the embodiments of the present invention do not limit how to determine the external circumscribed rectangle area, and relevant technologies of the contour external circumscribed rectangle can be referred to. Of course, the external circumscribed rectangle area can also be directly generated using the coordinate values included in the external circumscribed rectangle area. Specifically, the maximum abscissa, minimum abscissa, maximum ordinate, and minimum ordinate in the single-core lesion area can be determined, and these coordinates can be used to determine the coordinates of the four corners of the single-core lesion area. For example, when the positive direction of the X-axis of the two-dimensional coordinate system is horizontally to the right and the positive direction of the Y-axis is horizontally downward, the upper left corner coordinate of the rectangle area is (minimum abscissa, minimum ordinate), the lower left corner coordinate is (minimum abscissa, maximum ordinate), the upper right corner coordinate is (maximum abscissa, minimum ordinate), and the lower right corner coordinate is (maximum abscissa, maximum ordinate). It should be noted that the embodiments of the present invention do not limit the specific two-dimensional coordinate system. When the two-dimensional coordinate system changes, the coordinates of the four corners of the external circumscribed rectangle area will also change accordingly.

[0074] In a possible case, generating the external circumscribed rectangle area using the single-core lesion area may include:

[0075] Step 21: Determine the maximum abscissa, minimum abscissa, maximum ordinate, and minimum ordinate in the single-core lesion area;

[0076] Step 22: Generate the external circumscribed rectangle area using the maximum abscissa, minimum abscissa, maximum ordinate, and minimum ordinate.

[0077] It should be noted that the embodiments of the present invention do not limit the method for determining the above abscissa and ordinate. For example, each pixel point in the single-core lesion area can be traversed, or the edge of the single-core lesion area can be scanned, and it can be described according to actual application requirements.

[0078] Further, in the near-infrared image of the lesion, the hue value of each pixel point increases as the distance from the lesion nucleus shortens. On the color image, it gradually changes from green and yellow to blue and indigo, and finally becomes the purple and dark purple of the lesion nucleus. At the same time, since the single-nucleus lesion area is located inside the circumscribed rectangle, the hue value of each pixel point generally shows an increasing trend in the direction from the outside to the inside of the circumscribed rectangle. Since the present invention needs to fade the single-nucleus lesion area and reduce the hue value of each pixel point in the single lesion area, and needs to fade adaptively, it is necessary to fade from the outside to the inside of the circumscribed rectangle. In the embodiment of the present invention, for the convenience of operation, starting from the edge of the circumscribed rectangle area, a plurality of rectangular frames with a border thickness of one pixel are gradually generated inward, and the pixel points on each rectangular frame are faded in the order from the outside to the inside. Please refer to Figure 4 , Figure 4 is a schematic diagram of generating a rectangular frame in a rectangular area provided by an embodiment of the present invention. Among them, the size of the rectangular area is 7×5 pixels, so three rectangular frames (rectangular frames 1, 2, and 3) can be generated inward from the edge of the area. It can be understood that the rectangular frame in the exact middle of the rectangular area is actually a rectangle or a square. For example, rectangular frame 3 is a 1×3 pixel rectangle. In other words, the embodiment of the present invention divides the rectangular area in the form of "tree rings". It can be understood that in order to fade all the pixel points in the single-nucleus lesion area in the circumscribed rectangle area, it is necessary to ensure that the border parts of all rectangular frames completely cover the circumscribed rectangle area.

[0079] S103. Fade the target pixel points on each rectangular frame in the single-nucleus lesion area in the order from the outside to the inside; the fading process includes calculating the weighted hue value using the hue values of the target pixel point and other surrounding pixel points, and replacing the hue value of the target pixel point with the weighted hue value.

[0080] It should be noted that the embodiment of the present invention does not limit the processing order of the target pixel points on each rectangular frame. For example, it can be processed counterclockwise or clockwise, and can be processed according to actual application requirements. It can be understood that in order to fade the target pixel points on the rectangular frame in the single-nucleus lesion area, first, the pixel points on the rectangular frame need to be selected according to the above processing order, and it is judged whether the pixel point is in the single-nucleus lesion area. If so, it is set as the target pixel point and faded, and if not, the next pixel point is continued to be selected.

[0081] Further, embodiments of the present invention will use the hue values of the target pixel and other surrounding pixels to calculate a weighted hue value for the target pixel and replace the original hue value, so as to achieve the purpose of fading. It should be noted that embodiments of the present invention do not limit the other pixels participating in the weighted calculation, as long as they are the pixels around the target pixel. For example, they can be the four pixels located above, below, left, and right of the target pixel, or the eight pixels around the target pixel, or the 24 pixels around the target pixel, which can be processed according to specific requirements. In embodiments of the present invention, for the convenience of calculation, a preset square area is determined with the target pixel as the center, and all the hue values in this area are used for weighted calculation. Embodiments of the present invention do not limit the size of the square area. For example, it can be 3×3 pixels or 5×5 pixels, and can be calculated according to actual application requirements. For the convenience of calculation, in embodiments of the present invention, a square area of 3×3 pixels can be selected as the calculation area for the weighted hue value.

[0082] Further, embodiments of the present invention do not limit the setting method of the weighting values of each point in the square area, which can be set according to actual application requirements. For the convenience of calculation, in embodiments of the present invention, the weighting values can be set according to the positional relationship between each pixel point (including the target pixel point) in the square area and the target pixel point. For example, in a 3×3 pixel square area, the weighting value of the target pixel point is 1, the weighting values of the pixels located above, below, left, and right are 0.5, and the points at the four corners around are 0.25, as Figure 5 shown Figure 5 is a schematic diagram of a weighting value setting provided by embodiments of the present invention. Of course, the weighting value can also have other values, which can be set according to actual application requirements. After obtaining the required hue values and weighting values, the weighted hue value calculation can be performed.

[0083] In a possible case, calculating the weighted hue value using the hue values of the target pixel and other surrounding pixels may include:

[0084] Step 31: Determine a preset square area with the target pixel as the center;

[0085] Step 32: Set a weighting value for each pixel point in the preset square area according to the positional relationship between each pixel point in the preset square area and the target pixel point;

[0086] Step 33: Calculate an initial weighted hue value for each pixel point in the preset square area using the weighting value and the hue value of the corresponding pixel point;

[0087] Step 34: Calculate the weighted hue value for the target pixel point using the sum of the weighting values and the initial weighted hue value.

[0088] Specifically, the weighted hue value of the target pixel can be calculated using the following formula: weighted hue value = (hue value of the target pixel × weighted value of the target pixel + Σ hue values of other pixels × weighted values of other pixels) / total weighted value, where the total weighted value is the sum of the weighted value of the target pixel and the weighted values of other pixels. After obtaining the weighted hue value, the original hue value of the target pixel can be replaced to complete the fading of the pixel. When the processing of all pixels in the circumscribed rectangular area is completed, the fading of the single-nucleus lesion area is completed. Please refer to Figure 6 , Figure 6 FIG. Figure 6 is a schematic diagram of fading a lesion image provided by an embodiment of the present invention. The area surrounded by the white frame is the single-nucleus lesion area to be faded. The right figure is before fading, and the left figure is after fading. It can be seen that the present invention can effectively fade the single-nucleus lesion area.

[0089] Of course, in order to improve the fading effect, after fading, the single-nucleus lesion area can also be filtered to further improve the fading transition effect.

[0090] In a possible case, after fading the target pixels of each rectangular frame on the single-nucleus lesion area, it further includes:

[0091] Step 41: Filter the single-nucleus lesion area.

[0092] It should be noted that the embodiment of the present invention does not limit the specific filtering process, and relevant techniques in image processing can be referred to.

[0093] Based on the above embodiments, the present invention first generates a circumscribed rectangular area according to the single-nucleus lesion area, generates multiple rectangular frames within the circumscribed rectangular area, and fades the target pixels of each rectangular frame on the single-nucleus lesion area in the order from outside to inside. Since the rectangular frame can completely cover the circumscribed rectangular area, and the circumscribed rectangular area can completely contain the single-nucleus lesion area, the entire single-nucleus lesion area can be faded. Secondly, in the process of fading, the present invention calculates the weighted hue value for the target pixel using the hue values of the target pixel and its surrounding pixels, and replaces the original hue value of the target pixel with the weighted hue value. In other words, the present invention can adaptively fade the pixel according to the surrounding hue situation, ensuring that the fading area has a natural transition and is not affected by the hue value range, and effectively avoiding the problems of unnatural removal area, unnatural removal edge, and removal process being limited by the hue value in the related art.

[0094] Next, the lesion image fading device, electronic device, and storage medium provided by the embodiments of the present invention will be introduced. The lesion image fading device, electronic device, and storage medium described below can be mutually referred to with the lesion image fading method described above.

[0095] Please refer to Figure 7 , Figure 7 which is a structural block diagram of a lesion image fading device provided by an embodiment of the present invention. The device may include:

[0096] A region extraction module 701, configured to obtain a near-infrared image of a lesion and extract a single-nucleus lesion region from the near-infrared image of the lesion;

[0097] A rectangular box generation module 702, configured to generate an enclosing rectangular region by using the single-nucleus lesion region, and generate a plurality of rectangular boxes starting from the edge of the enclosing rectangular region and moving inward; the thickness of the border of the rectangular box is one pixel, and all the rectangular boxes cover the enclosing rectangular region;

[0098] A fading module 703, configured to perform fading processing on the target pixel points of each rectangular box on the single-nucleus lesion region in the order from outside to inside; the fading processing includes calculating a weighted hue value by using the hue values of the target pixel points and other surrounding pixel points, and replacing the hue value of the target pixel points with the weighted hue value.

[0099] Optionally, the region extraction module 701 may include:

[0100] A region extraction sub-module, configured to extract a lesion region and a plurality of lesion nuclei in the near-infrared image of the lesion by using a preset hue value range;

[0101] A calculation sub-module, configured to determine a dividing line between each lesion nucleus by using the shortest distance between the lesion nucleus and the edge of the lesion region;

[0102] A segmentation sub-module, configured to segment the lesion region by using the dividing line to obtain an initial single-nucleus lesion region.

[0103] An edge restoration sub-module, configured to determine an initial target region and an initial protection region in the initial single-nucleus lesion region, and use a color fitting method to restore the overlapping part of the initial protection region with the initial target region to obtain an edge restoration image;

[0104] A first adjustment sub-module, configured to adjust the initial protection region and the initial protection region image in the initial protection region by using the edge restoration image to obtain a protection region and a protection region image;

[0105] A second adjustment sub-module, configured to adjust the initial target region by using the protection region to obtain a single-nucleus lesion region, and cover the initial protection region image with the protection region image;

[0106] Wherein,

[0107] The rectangular box generation module 702 is further configured to perform the step of generating an enclosing rectangular region by using the single-nucleus lesion region in the near-infrared image of the lesion after the covering is completed.

[0108] Optionally, the rectangular box generation module 702 includes:

[0109] A coordinate determination sub-module, configured to determine the maximum abscissa, minimum abscissa, maximum ordinate, and minimum ordinate in the single-core lesion area;

[0110] A rectangular box generation sub-module, configured to generate a circumscribed rectangular area by using the maximum abscissa, minimum abscissa, maximum ordinate, and minimum ordinate.

[0111] Optionally, the device may further include:

[0112] A filtering module, configured to perform filtering processing on the single-core lesion area.

[0113] Optionally, the fading module 703 may include:

[0114] An area determination sub-module, configured to determine a preset square area centered on the target pixel point;

[0115] A weight value setting sub-module, configured to set a weight value for each pixel point in the preset square area according to the positional relationship between each pixel point in the preset square area and the target pixel point;

[0116] A first calculation sub-module, configured to calculate an initial weighted hue value for each pixel point in the preset square area by using the weight value and the hue value of the corresponding pixel point;

[0117] A second calculation sub-module, configured to calculate a weighted hue value for the target pixel point by using the sum of the weight values and the initial weighted hue values.

[0118] An embodiment of the present invention further provides an electronic device, including:

[0119] A memory, configured to store a computer program;

[0120] A processor, configured to implement the steps of the lesion image fading method as described above when executing the computer program.

[0121] Since the embodiments of the electronic device part correspond to the embodiments of the lesion image fading method part, for the embodiments of the electronic device part, please refer to the description of the embodiments of the lesion image fading method part, which will not be elaborated here for the time being.

[0122] An embodiment of the present invention further provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the lesion image fading method in any of the above embodiments are implemented.

[0123] Since the embodiments of the storage medium part correspond to the embodiments of the lesion image fading method part, please refer to the description of the embodiments of the lesion image fading method part for the embodiments of the storage medium part, which will not be elaborated here for the time being.

[0124] The various embodiments in the specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple. For the relevant parts, reference can be made to the description in the method part.

[0125] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0126] The steps of the method or algorithm described in combination with the embodiments disclosed in this article can be directly implemented by hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the technical field.

[0127] The above has introduced in detail a method, device, electronic device, and storage medium for fading lesion images provided by the present invention. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.

Claims

1. A method for fading lesion images, characterized in that, Comprising: Obtain a near-infrared image of a lesion, and extract a single-nucleus lesion region from the near-infrared image of the lesion; Generate a circumscribed rectangular region using the single-nucleus lesion region, and generate a plurality of rectangular frames starting from the edge of the circumscribed rectangular region and moving inward; the thickness of the border of the rectangular frame is one pixel, and the border parts of all the rectangular frames completely cover the circumscribed rectangular region; In the order from outside to inside, perform a fading process on the target pixel points on the border part of each rectangular frame on the single-nucleus lesion region; the fading process includes calculating a weighted hue value using the hue values of the target pixel point and other surrounding pixel points, and replacing the hue value of the target pixel point with the weighted hue value; The extracting the single-nucleus lesion region from the near-infrared image of the lesion includes: Extract the lesion region and a plurality of lesion nuclei in the near-infrared image of the lesion using a preset hue value range; Determine the dividing lines between the lesion nuclei using the shortest distances between the lesion nuclei and the edge of the lesion region; Segment the lesion region using the dividing lines to obtain an initial single-nucleus lesion region; Determine an initial target region and an initial protection region in the initial single-nucleus lesion region, and use a color fitting method to restore the overlapping part of the initial protection region with the initial target region to obtain an edge-restored image; Adjust the initial protection region and the initial protection region image in the initial protection region using the edge-restored image to obtain a protection region and a protection region image; Adjust the initial target region using the protection region to obtain the single-nucleus lesion region, and cover the initial protection region image with the protection region image; Execute the step of generating a circumscribed rectangular region using the single-nucleus lesion region in the near-infrared image of the lesion after the covering is completed.

2. The lesion image fading method according to claim 1, wherein The generating a circumscribed rectangular region using the single-nucleus lesion region includes: Determine the maximum abscissa, minimum abscissa, maximum ordinate, and minimum ordinate in the single-nucleus lesion region; Generate the circumscribed rectangular region using the maximum abscissa, the minimum abscissa, the maximum ordinate, and the minimum ordinate.

3. The lesion image fading method according to claim 1, wherein, After performing the fading process on the target pixel points on each rectangular frame on the single-nucleus lesion region, further comprising: Perform a filtering process on the single-nucleus lesion region.

4. The method for fading lesion images according to any one of claims 1 to 3, characterized in that, The calculating a weighted hue value using the hue values of the target pixel point and other surrounding pixel points includes: Determine a preset square region centered on the target pixel point; Set a weight value for each pixel point in the preset square region according to the positional relationship between each pixel point in the preset square region and the target pixel point; Calculate an initial weighted hue value for each pixel point in the preset square region using the weight value and the hue value of the corresponding pixel point; Calculate the weighted hue value for the target pixel point using the sum of the weight values and the initial weighted hue value.

5. A lesion image fading device, characterized in that, Comprising: A region extraction module, configured to obtain a near-infrared image of a lesion, and extract a single-nucleus lesion region from the near-infrared image of the lesion; A rectangular box generation module, configured to generate a circumscribed rectangular area by using the single-nucleus lesion area, and generate a plurality of rectangular boxes starting from the edge of the circumscribed rectangular area and moving inwards; the thickness of the border of the rectangular box is one pixel, and the border parts of all the rectangular boxes completely cover the circumscribed rectangular area; A fading module, configured to fade the target pixel points on the single-nucleus lesion area of the border part of each rectangular box in the order from outside to inside; the fading process includes calculating a weighted hue value by using the hue values of the target pixel points and other surrounding pixel points, and replacing the hue value of the target pixel points with the weighted hue value; The area extraction module includes: An area extraction sub-module, configured to extract the lesion area and a plurality of lesion nuclei in the near-infrared image of the lesion by using a preset hue value range; A calculation sub-module, configured to determine the dividing lines between the lesion nuclei by using the shortest distance between the lesion nuclei and the edge of the lesion area; A segmentation sub-module, configured to segment the lesion area by using the dividing lines to obtain an initial single-nucleus lesion area; An edge restoration sub-module, configured to determine an initial target area and an initial protection area in the initial single-nucleus lesion area, and restore the overlapping part of the initial protection area with the initial target area by using a color fitting method to obtain an edge restored image; A first adjustment sub-module, configured to adjust the initial protection area and the initial protection area image in the initial protection area by using the edge restored image to obtain a protection area and a protection area image; A second adjustment sub-module, configured to adjust the initial target area by using the protection area to obtain the single-nucleus lesion area, and cover the initial protection area image with the protection area image; The rectangular box generation module is further configured to execute the step of generating the circumscribed rectangular area by using the single-nucleus lesion area in the near-infrared image of the lesion after the covering is completed.

6. The lesion image fading device according to claim 5, wherein The rectangular box generation module includes: A coordinate determination sub-module, configured to determine the maximum abscissa, the minimum abscissa, the maximum ordinate, and the minimum ordinate in the single-nucleus lesion area; A rectangular box generation sub-module, configured to generate the circumscribed rectangular area by using the maximum abscissa, the minimum abscissa, the maximum ordinate, and the minimum ordinate.

7. An electronic device, characterized in that, It includes: A memory, configured to store a computer program; A processor, configured to implement the steps of the lesion image fading method according to any one of claims 1 to 4 when executing the computer program.

8. A storage medium, characterized in that, A computer program is stored on the storage medium, and when the computer program is executed by the processor, the steps of the lesion image fading method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Ultrasonic imaging method and system, ultrasonic image measurement method and treatment system as well as medium

    CN109846513A

  • Image processing method and system

    CN110223289A

  • Tumor recognition system based on artificial intelligence

    CN110706225A