Data processing method for assisting detection of focus area in skin image
By calculating the degree of grayscale abnormality of each pixel point in the skin image and the difference value of peer pixel points, the boundaries of the lesion area are identified and enhanced, and the problem of inaccurate boundary recognition of minor lesion areas in the prior art is solved, and accurate identification and significant enhancement of lesion areas are achieved.
Patent Information
- Application Number
- CN202510307513.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-17
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2045-03-17
AI Technical Summary
The prior art is difficult to accurately identify and enhance the boundaries of minor lesions in skin images, resulting in misdetecting and inaccurate lesions identification.
By calculating the degree of grayscale anomaly of each pixel point, and using the difference in grayscale anomaly of pixel points on the left and right sides of the peer line, the boundaries of the area to be enhanced are accurately obtained. Then, the contrast of each area to be enhanced is enhanced to obtain an enhanced image, thereby achieving accurate identification of the lesion area.
Accurate identification and significant enhancement of the edges of mild lesions are achieved, misdetecting is avoided, and the accuracy of identification of lesions is improved.
Smart Images

Figure CN119831994A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image data processing, and in particular relates to a data processing method for assisting in detecting lesion areas in skin images. Background Art
[0002] Phototherapy is mainly used to treat skin tissue. Since the size and severity of the lesion areas vary, doctors usually need to make independent judgments, which requires a high level of experience from doctors. In order to assist doctors in identifying the lesion areas, computer vision is generally used to identify lesion areas of different sizes in skin images. The features of milder lesions are less obvious, so the computer cannot intuitively obtain the location information of the lesion area. The collected skin images need to be enhanced to facilitate the identification of the lesion area from the enhanced skin images.
[0003] Before enhancing the lesion area, it is necessary to accurately obtain the boundary of the lesion area. For lesion areas with large differences, the boundary of the lesion area can be directly obtained by means of threshold segmentation and other means. Since the color difference between mild lesion areas and normal skin is small, it is difficult to obtain a clear boundary of mild lesion areas. The grayscale difference between it and normal skin is small. Directly using the threshold segmentation method to obtain the boundary of the lesion area will divide the slight differences of the skin itself into the boundary of the lesion area, thereby causing misdetection of the lesion area, and thus failing to accurately identify the lesion area. Summary of the invention
[0004] When enhancing a skin image to be identified, the present invention calculates the grayscale abnormality of each pixel in the skin image to be identified according to the frequency of occurrence of the grayscale value corresponding to each pixel in the skin image to be identified, identifies the boundary of the area to be enhanced according to the grayscale abnormality of each pixel, and after accurately identifying the boundary of the area to be enhanced, enhances the contrast of each area to be enhanced to obtain an enhanced image, thereby achieving accurate identification of the lesion area in the enhanced image.
[0005] The data processing method of the present invention for assisting the detection of lesion areas in skin images adopts the following technical solutions: Acquire a skin image to be identified; Calculate the grayscale abnormality of each pixel in the skin image to be identified according to the frequency of occurrence of the grayscale value corresponding to each pixel in the skin image to be identified; The difference in grayscale abnormality between each pixel in the skin image to be identified and the pixels on the left and right sides of the same row is used as the difference value of each pixel in the skin image to be identified; Obtain the mean absolute value of the difference values of each row of pixels in the skin image to be identified, select the pixels in each row whose absolute value of the difference value is greater than the mean absolute value of the difference value of the row as edge points, and divide the edge points into starting points and ending points according to the positive and negative corresponding difference values of the edge points; Mark the pixels between the starting point and the ending point as pixels to be enhanced in the order from the starting point to the ending point; All the pixels to be enhanced form a plurality of regions to be enhanced, and according to the grayscale abnormality of all the pixels to be enhanced in each region to be enhanced, the enhancement degree of each region to be enhanced is calculated; Calculate the contrast difference between each area to be enhanced and the skin image to be identified, and calculate the contrast increment of each area to be enhanced based on the enhancement degree and the contrast difference of each area to be enhanced; A contrast increment is added based on the contrast of each area to be enhanced, and each area to be enhanced is enhanced to obtain an enhanced image; Identify the lesion area in the enhanced image.
[0006] Furthermore, the step of calculating the grayscale abnormality of each pixel in the skin image to be identified includes: Calculate a first ratio of the number of pixels having the same grayscale value as each pixel in the skin image to be identified to the total number of pixels in the skin image to be identified; Selecting a maximum value from all the first ratios obtained as a maximum ratio, and selecting a minimum value from all the first ratios obtained as a minimum ratio; Select any pixel in the skin image to be identified as the target pixel; Calculate a second ratio of the number of pixels in the skin image to be identified that have the same grayscale value as the target pixel to the total number of pixels in the skin image to be identified; Calculate a first difference between the maximum ratio and the second ratio, and simultaneously calculate a second difference between the maximum ratio and the minimum ratio; The third ratio of the first difference to the second difference is used as the grayscale abnormality degree of the target pixel in the skin image to be identified, and the grayscale abnormality degree of each pixel in the skin image to be identified is calculated according to the calculation method of the grayscale abnormality degree of the target pixel.
[0007] Furthermore, the step of calculating the difference value of each pixel in the skin image to be identified includes: The grayscale abnormality level of the pixel on the left side of each pixel in the skin image to be identified is subtracted from the grayscale abnormality level of the pixel on the right side of the same row to obtain the difference value of each pixel in the skin image to be identified.
[0008] Furthermore, the step of dividing the edge points into starting points and ending points according to the positive and negative values of the difference values corresponding to the edge points includes: The edge points with negative difference values are taken as the starting points, and the edge points with positive difference values are taken as the ending points.
[0009] Furthermore, the step of marking the pixels between the starting point and the ending point as pixels to be enhanced in the order from the starting point to the ending point includes: Start from the first starting point of each row and traverse from left to right until another starting point appears, and stop traversing. All the traversed end points are used as the end points to be matched; Calculate the third difference between the absolute value of the difference value of the first starting point and the absolute value of the difference value of each to-be-matched termination point, and take the to-be-matched termination point with the smallest third difference as the final matching termination point; Pair the first starting point with the final matching ending point to get a set of starting and ending points, and traverse from another starting point in the same row to get another set of starting and ending points. Similarly, get multiple sets of starting and ending points in the same row. The pixels between multiple groups of start and end points in the same row are marked as pixels to be enhanced.
[0010] Furthermore, the step of calculating the enhancement degree of each to-be-enhanced area includes: Obtain the grayscale abnormality degree and value of all pixels to be enhanced in each area to be enhanced; Obtain the total number of pixels to be enhanced in each area to be enhanced; The normalized value of the ratio of the grayscale abnormality level and value to the total number is used as the enhancement degree of each area to be enhanced.
[0011] Furthermore, the step of calculating the contrast increment of each area to be enhanced includes: The product of the contrast difference between each region to be enhanced and the skin image to be identified and the enhancement degree of the corresponding region to be enhanced is taken as the contrast increment of the region to be enhanced.
[0012] The beneficial effects of the present invention are: The present invention provides a data processing method for assisting the detection of lesion areas in skin images. The grayscale abnormality of each pixel in the skin image to be identified is calculated according to the frequency of occurrence of the grayscale value corresponding to each pixel in the skin image to be identified. When identifying the lesion area, the present invention does not rely on the grayscale value of the pixel, but converts the grayscale value of the pixel into the grayscale abnormality of the pixel; since the grayscale value of the edge pixel of the lesion area is not much different from the grayscale value of normal skin, but the grayscale value of the edge pixel of the lesion area will not be exactly the same as the grayscale value of normal skin, there will be slight differences, the frequency of occurrence of the grayscale value of the edge pixel is smaller than the grayscale value of normal skin, and the grayscale abnormality calculation formula is used to calculate the grayscale abnormality. The abnormality is large, so the gray value of the pixel is converted into the gray abnormality of the pixel, and the pixel to be enhanced is accurately obtained through the gray abnormality difference of the pixels on the left and right sides of each pixel in the skin image to be identified, so as to accurately identify the edge of the lesion area; after obtaining the pixel to be enhanced, the area to be enhanced is composed of all the pixels to be enhanced, and the contrast increment of each area to be enhanced is calculated according to the contrast of the area to be enhanced and the gray abnormality of all the pixels in the area to be enhanced. The present invention enhances the contrast of the image to obtain an enhanced image, and can achieve significant enhancement of the slight lesion area through contrast enhancement, so as to accurately identify the lesion area in the enhanced image. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0014] Figure 1 A schematic flow chart of the overall steps of an embodiment of a data processing method for assisting in detecting lesion areas in skin images of the present invention; Figure 2 A schematic diagram of a grayscale abnormality value variation curve of any row of pixels in the present invention; Figure 3 It is a schematic diagram of making a secant line in a horizontal direction for a circular lesion area in the present invention; Figure 4 It is a schematic diagram of a binary image of a region to be enhanced in the present invention. DETAILED DESCRIPTION
[0015] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0016] An embodiment of the data processing method of the present invention for assisting detection of lesion areas in skin images is as follows: Figure 1 As shown, the method includes: S1. Obtain a skin image to be identified.
[0017] The phototherapy device has a fixed time gear, and obtains the skin image at a moment when the irradiation time of the current time gear is half of the time, and uses it as the original image for subsequent processing, filtering and denoising the original image, and weighted grayscale conversion to obtain the skin image to be identified.
[0018] S2. Calculate the grayscale abnormality of each pixel in the skin image to be identified according to the frequency of occurrence of the grayscale value corresponding to each pixel in the skin image to be identified.
[0019] The diseased tissue on the skin and the normal skin tissue absorb infrared light differently. Therefore, the thermal effect of the infrared light from the phototherapy equipment will produce different degrees of heat on the two tissues. The diseased tissue and normal tissue will show different colors after the temperature rises. The area that needs to be enhanced is obtained according to the grayscale abnormality of the pixels in the skin image to be tested. The skin lesions will appear as whiter or darker areas compared to normal skin tissue in the grayscale image. Therefore, the grayscale abnormality of each pixel in the skin image to be identified is calculated according to the frequency of the grayscale value corresponding to each pixel in the skin image to be identified.
[0020] Since the grayscale value of the edge pixel of the lesion area is not much different from that of the normal skin, but the grayscale value of the edge pixel of the lesion area will not be exactly the same as that of the normal skin, there will be slight differences. The frequency of occurrence of the grayscale value of the edge pixel is smaller than that of the normal skin, and the abnormality calculated by the grayscale abnormality calculation formula is large. Therefore, the grayscale value of the pixel is converted into the grayscale abnormality of the pixel, and the grayscale abnormality difference between the left and right sides of each pixel in the skin image to be identified is used to accurately obtain the pixel to be enhanced, thereby achieving accurate identification of the edge of the lesion area.
[0021] The step of calculating the grayscale abnormality of each pixel in the skin image to be identified includes: calculating the first ratio of the number of pixels in the skin image to be identified that have the same grayscale value as each pixel to the total number of pixels in the skin image to be identified; selecting the maximum value from all the first ratios obtained as the maximum ratio, and selecting the minimum value from all the first ratios obtained as the minimum ratio; selecting any pixel in the skin image to be identified as the target pixel; calculating the second ratio of the number of pixels in the skin image to be identified that have the same grayscale value as the target pixel to the total number of pixels in the skin image to be identified; calculating the first difference between the maximum ratio and the second ratio, and at the same time calculating the second difference between the maximum ratio and the minimum ratio; using the third ratio of the first difference to the second difference as the grayscale abnormality of the target pixel in the skin image to be identified, and calculating the grayscale abnormality of each pixel in the skin image to be identified according to the calculation method of the grayscale abnormality of the target pixel.
[0022] The calculation formula for the grayscale abnormality of the target pixel in the skin image to be identified is: in, Indicates selecting the first pixels as target pixels; Indicates the grayscale abnormality of the target pixel in the skin image to be identified; Represents the target pixel in the skin image to be identified Gray value The number of identical pixels; The gray value in the skin image to be identified is equal to the gray value The number of pixels; Represents the total number of pixels in the skin image to be identified; Represents the target pixel in the skin image to be identified Gray value a second ratio of the number of identical pixels to the total number of pixels in the skin image to be identified; represents the maximum ratio, that is, the maximum value of the first ratio of the number of pixels in the skin image to be identified that have the same grayscale value as each pixel to the total number of pixels in the skin image to be identified; It represents the minimum ratio, that is, the minimum value of the first ratio between the number of pixels with the same grayscale value as each pixel in the skin image to be identified and the total number of pixels in the skin image to be identified.
[0023] In the calculation formula of the grayscale abnormality of the target pixel in the skin image to be identified, once the skin image to be identified is determined, the maximum value of the first ratio of the number of pixels in the skin image to be identified that has the same grayscale value as each pixel and the total number of pixels in the skin image to be identified is determined and unchanged, that is, is a non-variable; at the same time, the minimum value of the first ratio of the number of pixels in the skin image to be identified that has the same grayscale value as each pixel and the total number of pixels in the skin image to be identified is also fixed and unchanged, that is, is a non-variable; Indicates the target pixel The corresponding gray value The frequency of appearance in the skin image to be identified. The larger the ratio, the higher the target pixel point. Gray value The more times it appears, the higher the gray value of the target pixel. The more common the occurrence of The greater the background degree, the smaller the ratio is, which means the target pixel Gray value The fewer the occurrences, the gray value of the target pixel It is highly likely that the target pixel is a lesion area or an edge of a lesion area, and it is highly likely that the target pixel is a pixel that needs to be enhanced later.
[0024] S3, taking the grayscale abnormality difference between the left and right pixels of each pixel in the skin image to be identified as the difference value of each pixel in the skin image to be identified.
[0025] The step of calculating the difference value of each pixel in the skin image to be identified includes: subtracting the grayscale abnormality degree of the pixel on the left side of the same row of each pixel in the skin image to be identified from the grayscale abnormality degree of the pixel on the right side of the same row to obtain the difference value of each pixel in the skin image to be identified.
[0026] In step S2, the grayscale abnormality of each pixel is obtained, and the grayscale value of each pixel in the skin image to be identified is replaced with the grayscale abnormality of the pixel to obtain an abnormal feature matrix, and the abnormal feature matrix is used to locate the area that needs to be enhanced; according to the grayscale abnormality of the pixel, it is arranged according to the corresponding position of the pixel in the image as the abnormal feature matrix of the image.
[0027] There is a grayscale difference between the edge of the lesion area and the normal skin area. The details of the skin itself are also different from those of ordinary skin. In order to avoid misjudgment, the lesion area is compared with the skin details. The skin details are distributed in a point shape on the skin. The area occupied by the skin details in the skin image to be identified is larger than that of the lesion area in the skin image to be identified.
[0028] The change trend of grayscale abnormality degree in the row direction of the obtained abnormal feature matrix is judged, and the coordinate system is set to the method of establishing the coordinate system in the lower left corner of the image in the prior art, and the row direction of the abnormal feature matrix is the image coordinate system. Axis positive direction, such as Figure 2 , which is a schematic diagram of a grayscale abnormality value variation curve of any row of pixels in the present invention.
[0029] like Figure 3 As shown in the figure, it is a schematic diagram of making a secant line in the horizontal row direction for a circular lesion area in the present invention. The secant line must have two intersections with the edge of the area, that is, the position where the abnormality degree has a large difference before and after is the dual situation as the basis for judgment, and the position where the abnormality degree has a small difference before and after is likely to be the internal position of the abnormal lesion area. Therefore, by judging the abnormality degree value of each pixel point in the row before and after The difference value , the changes in the degree of pixel abnormality are quantified to facilitate the subsequent positioning of abnormal pixels.
[0030] In order to obtain the starting point and the ending point of each row of the lesion area, the grayscale abnormality of each pixel on the left side of the same row is subtracted from the grayscale abnormality of the pixel on the right side of the same row to obtain the difference value of each pixel in the skin image to be identified.
[0031] The calculation formula for the difference value of each pixel in the skin image to be identified is: in, Indicates The difference value of pixels; Indicates The coordinates of the pixel points in the skin image to be identified; Indicates The grayscale abnormality of the pixel on the right side of the same row as the pixel; Indicates The grayscale abnormality of the pixels on the left side of the same row is calculated, and the difference value of each pixel in each row of the skin image to be identified is calculated; Among them, in the calculation formula of the difference value of each pixel in the skin image to be identified, the grayscale abnormality of the pixel on the left side of the same row of each pixel is subtracted from the grayscale abnormality of the pixel on the right side of the same row to obtain the difference value of each pixel in the skin image to be identified. This is because for the edge pixels of the lesion area, the grayscale abnormality of the pixels on the left and right sides of the edge pixels will suddenly change, and based on this, pixels with large differences in grayscale abnormality can be screened out as edge points.
[0032] S4. Obtain the mean absolute value of the difference values of each row of pixels in the skin image to be identified, select the pixels in each row whose absolute value of the difference value is greater than the mean absolute value of the difference value of the row as edge points, and divide the edge points into starting points and ending points according to the positive and negative corresponding difference values of the edge points.
[0033] Since the larger the difference value corresponding to each pixel point is, the greater the difference in the grayscale abnormality of the pixels on the left and right sides when the pixel point is the center pixel point, the pixels with large differences in grayscale abnormality can be screened out as edge points, and the starting point and the end point are subsequently selected from the edge points.
[0034] After obtaining the difference values of each row of pixels, sort the difference values of each row of pixels in order from left to right to obtain the difference value sequence of each row , and set the hyperparameters for partitioning, hyperparameters is the absolute mean of the difference values of each row of pixels , select The pixel points are taken as edge points, and the edge points are the starting and ending points of possible abnormal positions.
[0035] The step of dividing the edge points into starting points and ending points according to the positive and negative corresponding difference values of the edge points includes: taking the edge points with negative difference values as the starting points, and taking the edge points with positive difference values as the ending points; since the starting point of the edge of the lesion area has a normal skin area on the left and a lesion area on the right, the grayscale abnormality of the pixels in the normal skin area is small, while the grayscale abnormality of the pixels in the lesion area is large, when the grayscale abnormality of the pixels on the left of the same line in the skin image to be identified is subtracted from the grayscale abnormality of the pixels on the right of the same line, the difference value obtained is negative; similarly, the ending point of the edge of the lesion area has a lesion area on the left and a normal skin area on the right, when the grayscale abnormality of the pixels on the left of the same line in the skin image to be identified is subtracted from the grayscale abnormality of the pixels on the right of the same line, the difference value obtained is negative, therefore, the edge points with negative difference values are taken as the starting points, and the edge points with positive difference values are taken as the ending points.
[0036] S5. Mark the pixels between the starting point and the ending point as pixels to be enhanced in order from the starting point to the ending point.
[0037] The step of marking the pixel points between the starting point and the end point as the pixel points to be enhanced in the order from the starting point to the end point includes: starting from the first starting point of each row, traversing from left to right until another starting point appears, and stopping the traversal, and taking all the traversed end points as the end points to be matched; calculating the third difference between the absolute value of the difference value of the first starting point and the absolute value of the difference value of each end point to be matched, and taking the end point to be matched with the smallest third difference as the final matching end point; pairing the first starting point with the final matching end point to obtain a group of start and end points, starting from another starting point in the same row to traverse to obtain another group of start and end points, and similarly obtaining multiple groups of start and end points in the same row; marking the pixel points between the multiple groups of start and end points in the same row as the pixel points to be enhanced.
[0038] like Figure 2 As shown in FIG. 1 , if the corresponding difference values of the edge points selected in step S4 are -15 and 18, it can be inferred that the curve The position indicates the previous pixel The value is slightly lower than A smaller value means that the grayscale anomaly at the latter point is more severe, which may be the starting point of the area that needs to be enhanced.
[0039] The curve is The position indicates the previous pixel The value is slightly lower than A larger value indicates that the grayscale abnormality of the previous point is more severe, which may be the end point of the edge of the area that needs to be enhanced. The position represents the left edge of the lesion area in this row; for the end point, it is the point where the downward change occurs. The position area represents the right edge of the lesion area, based on which the starting and ending points of the lesion area of the row can be located.
[0040] If the number of start and end points selected for a row is different: For example, if the difference value of a row of pixels is sequence for: The starting points in the row are selected as -18 and -20, and the ending points in the row are selected as 14, 15, and 21. Then the number of starting points and ending points is not equal, that is, there may be noise points, and the noise points cannot be matched; the step of pairing all the starting points and ending points of each row to obtain multiple groups of starting and ending points includes traversing from the first starting point of each row from left to right until another starting point appears, then the points that can match the first starting point -18 are 14 and 15, which are both ending points to be matched.
[0041] Calculate the difference between the absolute value of the difference value of the first starting point and the absolute value of the difference value of each end point to be matched. The absolute value difference between the starting point and the 14th position is ; The absolute value difference between the starting point and position 15 is ; then the first -18 position is the starting point, and the 15 position with the smallest absolute value difference is first selected as the final matching end point; similarly, multiple groups of starting and ending points in the same row are obtained.
[0042] The pixel points in the same row that are within the range between each group of start and end points are marked as 1, and the pixel points in the same row that are outside the range of the start and end points are marked as 0, and each row in the skin image to be identified is judged.
[0043] S6. All the pixels to be enhanced form a plurality of regions to be enhanced, and according to the grayscale abnormality of all the pixels to be enhanced in each region to be enhanced, calculate the enhancement degree of each region to be enhanced.
[0044] The step of calculating the enhancement degree of each area to be enhanced includes: obtaining the grayscale abnormality degree and value of all pixels to be enhanced in each area to be enhanced; obtaining the total number of pixels to be enhanced in each area to be enhanced; and taking the normalized value of the ratio of the grayscale abnormality degree and value to the total number as the enhancement degree of each area to be enhanced.
[0045] After all the pixels to be enhanced are obtained, multiple regions to be enhanced are formed by all the pixels to be enhanced, such as Figure 4 As shown, it is a schematic diagram of the binary image of the area to be enhanced in the present invention; after all the areas to be enhanced are obtained, each area has a different degree of difference from its surroundings, representing the different severity of the lesion area of the patient's skin, and the grayscale abnormality between the two and the normal skin surface Calculate areas where enhancement is possible The degree of enhancement , to evaluate the enhancement degree of each area.
[0046] The calculation formula for the enhancement degree of each area to be enhanced is: in, Indicates The degree of enhancement of the area to be enhanced; Indicates In the area to be enhanced The grayscale abnormality of each pixel; Indicates The total number of pixels in the area to be enhanced; Represents an existing normalization function.
[0047] In the calculation formula of the enhancement degree of each area to be enhanced, For Region The average value of the grayscale abnormality of the pixels in the middle represents the area The overall abnormality of the pixels in the area. The larger the value, the greater the abnormality of the area. The more abnormal the pixels are, the The more likely it is that the target area needs to be enhanced, the The function is normalized so that the data falls into interval.
[0048] S7. Calculate the contrast difference between each region to be enhanced and the skin image to be identified, and calculate the contrast increment of each region to be enhanced based on the enhancement degree and the contrast difference of each region to be enhanced.
[0049] The contrast of the skin image to be identified and the contrast of the area to be enhanced are obtained, and the contrast difference between each area to be enhanced and the skin image to be identified is calculated.
[0050] In the skin image to be identified, the grayscale value of the severe lesion area is significantly different from that of the normal skin tissue, and its contour edge can be clearly judged. The grayscale of the mild lesion area is closer to that of the normal skin tissue; the severe lesion area requires a longer irradiation time than the mild lesion area, but after the mild lesion area has been irradiated for a sufficient period of time, if the irradiation time is further extended, it will cause damage to other skin tissues. Therefore, the lesions in the mild lesion area limit the irradiation time of phototherapy. In the present invention, the contrast of each area to be enhanced is obtained. Since the contrast of the mild lesion area is smaller, and the contrast of the severe lesion area is larger, the present invention can identify the mild lesion area and the severe lesion area according to the contrast.
[0051] At the same time, since the color difference between the mild lesion area and the normal skin is small, it is difficult to obtain a clear boundary of the mild lesion area. The mild lesion area needs to be enhanced in the image more than the severe lesion area in order to achieve the purpose of highlighting it from the image; the contrast represents the difference between the darkest black and the brightest white between the areas. Compared with direct grayscale enhancement, contrast enhancement is more intuitive for image performance.
[0052] The step of calculating the contrast increment of each area to be enhanced includes: taking the product of the contrast difference between each area to be enhanced and the skin image to be identified and the enhancement degree of the corresponding area to be enhanced as the contrast increment of the area to be enhanced.
[0053] Calculate the contrast increment of each area to be enhanced , to enhance the area and calculate the area The contrast increment, The calculation formula for the contrast increment of the area to be enhanced is: in, express The contrast increment of the area to be enhanced; Indicates The degree of enhancement of the area to be enhanced; Indicates the contrast of the skin image to be identified; Indicates the contrast of the area to be enhanced.
[0054] The contrast increment in each area to be enhanced In the calculation formula, Indicates The contrast difference between the area to be enhanced and the skin image to be identified. The larger the value, the greater the amount of regional contrast enhancement. Weighted enhancement means that both the degree of enhancement and the amount of contrast enhancement are given equal weight. For areas with mild lesions, the original contrast of the area is low, and the enhancement amount is weighted by the degree of enhancement. Weighting is performed so that the contrast after enhancement is greater than the original contrast, indicating that the mild lesion area has been more significantly enhanced.
[0055] S8. Add a contrast increment based on the contrast of each region to be enhanced, and enhance each region to be enhanced to obtain an enhanced image.
[0056] After obtaining the contrast increment of each region to be enhanced, the contrast increment is increased on the basis of the contrast of each region to be enhanced, and each region to be enhanced is enhanced to obtain an enhanced image.
[0057] S9. Identify the lesion area in the enhanced image.
[0058] An enhanced image is obtained through step S8. In the enhanced image, the image of the lesion area is specifically enhanced compared with that before the processing. After the enhanced image is obtained, the lesion area is identified using the existing technology.
[0059] The data processing method provided by the present invention assists in detecting lesion areas in skin images. When enhancing a skin image to be identified, the grayscale abnormality of each pixel in the skin image to be identified is calculated according to the frequency of occurrence of the grayscale value corresponding to each pixel in the skin image to be identified. According to the grayscale abnormality of each pixel, the boundary of the area to be enhanced is identified. After the boundary of the area to be enhanced is accurately identified, the contrast of each area to be enhanced is enhanced to obtain an enhanced image, thereby achieving accurate identification of the lesion area in the enhanced image.
[0060] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A data processing method for assisting the detection of lesion areas in skin images, characterized in that: The method includes: Acquire a skin image to be identified; Calculate the grayscale abnormality of each pixel in the skin image to be identified according to the frequency of occurrence of the grayscale value corresponding to each pixel in the skin image to be identified; The difference in grayscale abnormality between each pixel in the skin image to be identified and the pixels on the left and right sides of the same row is used as the difference value of each pixel in the skin image to be identified; Obtain the mean absolute value of the difference values of each row of pixels in the skin image to be identified, select the pixels in each row whose absolute value of the difference value is greater than the mean absolute value of the difference value of the row as edge points, and divide the edge points into starting points and ending points according to the positive and negative corresponding difference values of the edge points; Mark the pixels between the starting point and the ending point as pixels to be enhanced in the order from the starting point to the ending point; All the pixels to be enhanced form a plurality of regions to be enhanced, and according to the grayscale abnormality of all the pixels to be enhanced in each region to be enhanced, the enhancement degree of each region to be enhanced is calculated; Calculate the contrast difference between each area to be enhanced and the skin image to be identified, and calculate the contrast increment of each area to be enhanced based on the enhancement degree and the contrast difference of each area to be enhanced; A contrast increment is added based on the contrast of each area to be enhanced, and each area to be enhanced is enhanced to obtain an enhanced image; Identify the lesion area in the enhanced image.
2. The data processing method for assisting the detection of lesion areas in skin images according to claim 1, characterized in that: The steps of calculating the grayscale abnormality of each pixel in the skin image to be identified include: Calculate a first ratio of the number of pixels having the same grayscale value as each pixel in the skin image to be identified to the total number of pixels in the skin image to be identified; Selecting a maximum value from all the first ratios obtained as a maximum ratio, and selecting a minimum value from all the first ratios obtained as a minimum ratio; Select any pixel in the skin image to be identified as the target pixel; Calculate a second ratio of the number of pixels in the skin image to be identified that have the same grayscale value as the target pixel to the total number of pixels in the skin image to be identified; Calculate a first difference between the maximum ratio and the second ratio, and simultaneously calculate a second difference between the maximum ratio and the minimum ratio; The third ratio of the first difference to the second difference is used as the grayscale abnormality degree of the target pixel in the skin image to be identified, and the grayscale abnormality degree of each pixel in the skin image to be identified is calculated according to the calculation method of the grayscale abnormality degree of the target pixel.
3. The data processing method for assisting the detection of lesion areas in skin images according to claim 1, characterized in that: The steps for calculating the difference value of each pixel in the skin image to be identified include: The grayscale abnormality level of the pixel on the left side of each pixel in the skin image to be identified is subtracted from the grayscale abnormality level of the pixel on the right side of the same row to obtain the difference value of each pixel in the skin image to be identified.
4. The data processing method for assisting the detection of lesion areas in skin images according to claim 3, characterized in that: The steps of dividing the edge points into starting points and ending points according to the positive and negative values of the corresponding difference values of the edge points include: The edge points with negative difference values are taken as the starting points, and the edge points with positive difference values are taken as the ending points.
5. The data processing method for assisting the detection of lesion areas in skin images according to claim 1, characterized in that: The step of marking the pixels between the starting point and the ending point as pixels to be enhanced in the order from the starting point to the ending point comprises: Start from the first starting point of each row and traverse from left to right until another starting point appears, and stop traversing. All the traversed end points are used as the end points to be matched; Calculate the third difference between the absolute value of the difference value of the first starting point and the absolute value of the difference value of each to-be-matched termination point, and take the to-be-matched termination point with the smallest third difference as the final matching termination point; Pair the first starting point with the final matching ending point to get a set of starting and ending points, and traverse from another starting point in the same row to get another set of starting and ending points. Similarly, get multiple sets of starting and ending points in the same row. The pixels between multiple groups of start and end points in the same row are marked as pixels to be enhanced.
6. The data processing method for assisting the detection of lesion areas in skin images according to claim 1, characterized in that: The steps of calculating the enhancement degree of each area to be enhanced include: Obtain the grayscale abnormality degree and value of all pixels to be enhanced in each area to be enhanced; Obtain the total number of pixels to be enhanced in each area to be enhanced; The normalized value of the ratio of the grayscale abnormality level and value to the total number is used as the enhancement degree of each area to be enhanced.
7. The data processing method for assisting the detection of lesion areas in skin images according to claim 1, characterized in that: The steps of calculating the contrast increment of each area to be enhanced include: The product of the contrast difference between each region to be enhanced and the skin image to be identified and the enhancement degree of the corresponding region to be enhanced is taken as the contrast increment of the region to be enhanced.
Citation Information
Patent Citations
Mining intelligent water pump impeller fault image detail enhancement method
CN117437129A
Traditional Chinese medicine dermatosis auxiliary system based on computer vision
CN118279340A
Apple quality analysis and evaluation method based on image recognition
CN118691690A
Method and System for Image Analysis to Detect Cancer
US20190019291A1
Methods and systems for ultrasound image processing
US20230316527A1
Cited By
Urban lighting fault positioning method and device
CN120352111A