CN113379649A - Image enhancement method, device, equipment and storage medium - Google Patents
Image enhancement method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN113379649A CN113379649A CN202110780006.5A CN202110780006A CN113379649A CN 113379649 A CN113379649 A CN 113379649A CN 202110780006 A CN202110780006 A CN 202110780006A CN 113379649 A CN113379649 A CN 113379649A
- Authority
- CN
- China
- Prior art keywords
- image
- target
- segmented
- mask
- gaussian
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000001914 filtration Methods 0.000 claims abstract description 26
- 238000007781 pre-processing Methods 0.000 claims abstract description 15
- 230000002708 enhancing Effects 0.000 claims abstract description 10
- 238000003709 image segmentation Methods 0.000 claims abstract description 8
- 239000000284 extract Substances 0.000 claims abstract description 6
- 238000005286 illumination Methods 0.000 claims description 21
- 230000003044 adaptive Effects 0.000 claims description 19
- 238000004590 computer program Methods 0.000 claims description 9
- 230000004044 response Effects 0.000 claims description 9
- 230000011218 segmentation Effects 0.000 claims description 8
- 230000000877 morphologic Effects 0.000 claims description 6
- 238000005260 corrosion Methods 0.000 claims description 5
- 230000002146 bilateral Effects 0.000 claims description 4
- 238000009499 grossing Methods 0.000 claims description 3
- 238000005282 brightening Methods 0.000 claims description 2
- 210000004204 Blood Vessels Anatomy 0.000 description 48
- 230000000694 effects Effects 0.000 description 10
- 230000000875 corresponding Effects 0.000 description 7
- 238000000034 method Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 230000000007 visual effect Effects 0.000 description 4
- 238000000605 extraction Methods 0.000 description 3
- 230000000717 retained Effects 0.000 description 3
- 210000003462 Veins Anatomy 0.000 description 2
- 239000000203 mixture Substances 0.000 description 2
- 230000036961 partial Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000003628 erosive Effects 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000000670 limiting Effects 0.000 description 1
- 230000000750 progressive Effects 0.000 description 1
- 230000002829 reduced Effects 0.000 description 1
- 230000001629 suppression Effects 0.000 description 1
- 230000002792 vascular Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/001—Image restoration
- G06T5/002—Denoising; Smoothing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/006—Geometric correction
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10068—Endoscopic image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20024—Filtering details
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30004—Biomedical image processing
- G06T2207/30101—Blood vessel; Artery; Vein; Vascular
Abstract
The application discloses an image enhancement method, an image enhancement device, image enhancement equipment and a storage medium, wherein the method comprises the following steps: preprocessing an original image to obtain an image to be segmented; respectively adopting a multi-scale Gaussian matching filtering method and a self-adaptive thresholding algorithm to segment and extract a target Mask in an image to be segmented; merging the two extracted target masks to obtain a merged target part; and only enhancing the image information characteristics of the target part, and assigning the pixel value of the enhanced target part to the original image to generate a target enhanced image. Therefore, the target Mask is extracted through image segmentation, and only the foreground target to be observed in the image is enhanced in a targeted manner, so that the difference between the foreground target and the background in the image can be enlarged, the original information of the background is reserved, the foreground target can be more highlighted on the premise of keeping the whole image undistorted, and the observation of the foreground target in the image can be clearer and more accurate.
Description
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to an image enhancement method, an image enhancement device, an image enhancement apparatus, and a storage medium.
Background
In daily life and work, images are everywhere, the most intuitive and simple method for acquiring information is provided, and the most effective information transmission medium is provided. In experiments and scientific research, images also occupy very important positions and are main targets of research and exploration. The image enhancement is a more key step in the digital image processing, and the accuracy of subsequent systems such as target tracking, mode recognition and the like is greatly improved.
At present, although the global image enhancement mode is adopted, the effects of highlighting texture, form, color and the like can be achieved on a foreground target in an image, and certain influence can be generated on the background of the image. If the image is excessively enhanced, the characteristics of both the foreground target and the background are enhanced, so that the problems of overlarge noise, distortion of pixel colors and partial textures and the like of the whole image occur, the enhancement effect of the foreground target is weakened due to the excessive enhancement of the background, the visual effect of the target cannot be highlighted, or the visual effect of the whole image is distorted or excessively changed, so that the observation and judgment of a user on the image are influenced.
Therefore, how to emphasize and improve the visual effect of the target in the whole image is a technical problem to be solved urgently by those skilled in the art.
Disclosure of Invention
In view of this, the present invention provides an image enhancement method, an image enhancement apparatus, an image enhancement device, and a storage medium, which can highlight a foreground object and make observation of the foreground object in an image clearer and more accurate without distortion of the whole image. The specific scheme is as follows:
an image enhancement method, comprising:
preprocessing an original image to obtain an image to be segmented;
respectively adopting a multi-scale Gaussian matching filtering method and a self-adaptive thresholding algorithm to segment and extract a target Mask in the image to be segmented;
merging the two extracted target masks to obtain a merged target part;
and only enhancing the image information characteristics of the target part, and assigning the enhanced pixel value of the target part to the original image to generate a target enhanced image.
Preferably, in the image enhancement method provided in the embodiment of the present invention, the preprocessing the original image to obtain an image to be segmented includes:
carrying out illumination equalization and Gamma correction on the original image;
denoising the corrected image by adopting a bilateral filtering method;
and carrying out graying processing on the image subjected to denoising processing, and stretching the contrast of the image by adopting a contrast-limiting self-adaptive histogram equalization algorithm to obtain an image to be segmented.
Preferably, in the above image enhancement method provided by the embodiment of the present invention, the performing illumination equalization and Gamma correction on the original image includes:
carrying out illumination equalization on the original image by adopting an Opencv rapid global smoothing filter algorithm to obtain an illumination map;
and brightening the brightness of the illumination pattern by Gamma correction.
Preferably, in the image enhancement method provided in the embodiment of the present invention, the extracting a target Mask in the image to be segmented by using a multi-scale gaussian matching filter method includes:
constructing a Gaussian matched filter with multiple scales and multiple direction angles;
filtering each pixel point in the image to be segmented at different angles through the Gaussian matched filter of each scale, and taking the maximum response value in different directions as the response output of each pixel point;
calculating the average value of images output by the Gaussian matched filter with various scales to obtain a Gaussian matched filter image;
and performing OTSU thresholding on the Gaussian matched filter image, and extracting a target Mask in the image to be segmented.
Preferably, in the image enhancement method provided in the embodiment of the present invention, the extracting a target Mask in the image to be segmented by using an adaptive thresholding algorithm includes:
and performing local segmentation on local thresholds of different regions in the image to be segmented by adopting a Gaussian adaptive thresholding algorithm, and extracting a target Mask in the image to be segmented.
Preferably, in the image enhancement method provided in the embodiment of the present invention, after the extracting the target Mask in the image to be segmented by using the adaptive thresholding algorithm, the method further includes:
and performing morphological expansion and corrosion treatment on the extracted target Mask.
Preferably, in the image enhancement method provided in the embodiment of the present invention, before the merging the two extracted target masks, the method further includes:
carrying out global thresholding on the image to be segmented and extracting an outer contour Mask;
and correcting the two extracted target masks by using the outer contour masks.
An embodiment of the present invention further provides an image enhancement apparatus, including:
the image preprocessing module is used for preprocessing an original image to obtain an image to be segmented;
the image segmentation module is used for extracting a target Mask in the image to be segmented by respectively adopting a multi-scale Gaussian matching filtering method and a self-adaptive thresholding algorithm;
the target merging module is used for merging the two extracted target masks to obtain a merged target part;
and the image enhancement module is used for enhancing the image information characteristics of the target part only, and assigning the enhanced pixel value of the target part to the original image to generate a target enhanced image.
The embodiment of the present invention further provides an image enhancement device, which includes a processor and a memory, wherein the processor implements the above image enhancement method provided by the embodiment of the present invention when executing the computer program stored in the memory.
Embodiments of the present invention further provide a computer-readable storage medium for storing a computer program, where the computer program, when executed by a processor, implements the above-mentioned image enhancement method provided by the embodiments of the present invention.
It can be seen from the above technical solutions that, an image enhancement method provided by the present invention includes: preprocessing an original image to obtain an image to be segmented; respectively adopting a multi-scale Gaussian matching filtering method and a self-adaptive thresholding algorithm to segment and extract a target Mask in an image to be segmented; merging the two extracted target masks to obtain a merged target part; and only enhancing the image information characteristics of the target part, and assigning the pixel value of the enhanced target part to the original image to generate a target enhanced image.
According to the method, the target Mask is extracted through image segmentation, only the foreground target to be observed in the image is pertinently enhanced, the difference between the foreground target and the background in the image can be enlarged, the original information of the background is reserved, the foreground target can be more highlighted under the premise that the whole image is not distorted, the observation of the foreground target in the image can be clearer and more accurate, and the problem that the background is influenced when the target information amount in the image is enriched under the global enhancement is avoided. In addition, the invention also provides a corresponding device, equipment and a computer readable storage medium aiming at the image enhancement method, so that the method has higher practicability, and the device, the equipment and the computer readable storage medium have corresponding advantages.
Drawings
In order to more clearly illustrate the embodiments of the present invention or technical solutions in related arts, the drawings used in the description of the embodiments or related arts will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flowchart of an image enhancement method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating an image enhancement method according to an embodiment of the present invention;
FIG. 3 is an original image of an endoscope provided by an embodiment of the present invention;
FIG. 4 is a light map provided by an embodiment of the present invention;
FIG. 5 is an image with balanced illumination and adjusted brightness according to an embodiment of the present invention;
FIG. 6 is a denoised image according to an embodiment of the present invention;
FIG. 7 is a grayed image provided by an embodiment of the present invention;
FIG. 8 is a contrast stretched image provided by an embodiment of the present invention;
fig. 9 to fig. 11 are respectively images after gaussian matching filtering of different scales according to an embodiment of the present invention;
FIG. 12 is a Gaussian matched filter graph obtained by averaging the values of FIGS. 9-11;
FIG. 13 is an OTSU thresholded image provided by an embodiment of the present invention;
FIG. 14 is an image after Gaussian adaptive thresholding according to an embodiment of the present invention;
FIG. 15 is an image after morphological dilation and erosion processing provided by an embodiment of the invention;
FIG. 16 is a gray scale image before enhancement provided by an embodiment of the present invention;
FIG. 17 is a schematic structural diagram of an outer Mask provided in an embodiment of the present invention;
FIG. 18 is a Mask of a vessel extracted by Gaussian matched filter segmentation according to an embodiment of the present invention;
FIG. 19 is a Mask corrected in FIG. 18;
FIG. 20 is a Mask of a vessel extracted by Gaussian adaptive thresholding segmentation according to an embodiment of the present invention;
FIG. 21 is a Mask corrected in FIG. 20;
FIG. 22 is a blood vessel partial image obtained by combining FIG. 19 with FIG. 21;
FIG. 23 is a schematic diagram of superimposing the enhancement effect in the vessel Mask only onto the original image according to the embodiment of the present invention;
FIG. 24 is a diagram illustrating assignment of pixel values of a blood vessel portion in an enhanced image to an original image according to an embodiment of the present invention;
FIGS. 25 to 29 are comparison diagrams of an original image and a target enhanced image provided by an embodiment of the present invention;
fig. 30 is a schematic structural diagram of an image enhancement apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention provides an image enhancement method, as shown in fig. 1, comprising the following steps:
s101, preprocessing an original image to obtain an image to be segmented;
s102, extracting a target Mask in the image to be segmented by respectively adopting a multi-scale Gaussian matching filtering method and an adaptive thresholding algorithm;
s103, merging the two extracted target masks to obtain a merged target part;
and S104, enhancing the image information characteristics of the target part, and assigning the pixel value of the enhanced target part to the original image to generate a target enhanced image.
In the image enhancement method provided by the embodiment of the invention, the target Mask is extracted through image segmentation, and then only the foreground target to be observed in the image is enhanced in a targeted manner, so that the difference between the foreground target and the background in the image can be enlarged, the original information of the background is reserved, the foreground target can be more highlighted on the premise of keeping the whole image undistorted, the observation of the foreground target in the image can be clearer and more accurate, and the problem that the background is influenced while the target information amount in the image is enriched under the global enhancement is avoided.
It should be noted that, in step S104, only the image information characteristics such as color and form of the extracted target portion are specifically enhanced, so that the original unclear target becomes clear, the features such as texture and form of the target are emphasized, the difference between the target and the background in the image is enlarged, but the original information of the background can be retained, so that the visual effect of the target in the whole image can be enhanced and improved on the premise of keeping the whole effect of the whole image unchanged.
In the invention, an image segmentation method based on image processing (based on multi-scale Gaussian matched filtering and adaptive thresholding algorithm) is specifically adopted to extract a blood vessel Mask in an endoscopic image, and after the blood vessel part is enhanced, pixels are assigned to an original image, so that an enhanced image only aiming at blood vessel enhancement is obtained.
In practical application, the situations of uneven illumination, low contrast, more noise and the like often occur in an endoscope image obtained through an endoscope lens, so that the blood vessels have the situations of unobvious lines, disconnection and the like. Therefore, certain pre-processing operations are required on the image. In specific implementation, in the image enhancement method provided in the embodiment of the present invention, the step S101 performs preprocessing on the original image to obtain an image to be segmented, as shown in fig. 2, the method specifically includes the following steps:
step one, carrying out illumination equalization and Gamma correction on an original image;
specifically, illumination equalization can be performed on the original image ImageI by adopting an Opencv fast global smoothing filter (fastglobalssmotherfilter) algorithm to obtain an illumination image ImageL; and then brightness of the light map ImageL is enhanced by Gamma correction.
Calculating the image ImageR after the illumination balance and the brightness adjustment by adopting the following formula:
ImageR=ImageI/ImageLλ
after parameter adjustment, λ is 0.75.
The algorithm not only performs equalization operation on image illumination to enable the illumination of a dark area and a bright area of an image to be equalized, gamma correction with lambda of 0.75 is adopted to brighten the brightness of the image, but also enables the background to be brightened to enable the target (such as a blood vessel) and the background to be obvious in order to simultaneously play a role in stretching out the target (such as the blood vessel) and the background, even enables a non-target (such as the blood vessel) to be partially white in an excessive way, and therefore the target (such as the blood vessel) can be better segmented in order to subsequently adopt thresholding.
Fig. 3 to 5 show an original image of an endoscope, an illumination map calculated by a fastglobalssmoothther filter, and an image after light balance and brightness adjustment, respectively.
Secondly, denoising the corrected image by adopting a bilateral filtering method;
it should be noted that, in order to remove the image noise point but also to store the edge characteristics of the target (such as blood vessel) in the image, the invention adopts bilateral filtering, combines the compromise processing of the spatial proximity and the pixel value similarity of the image based on the characteristics of the algorithm, such as simplicity, non-iteration and locality, and takes into account the spatial difference and the intensity difference of the image pixels, thereby achieving the effects of removing noise and storing the blood vessel boundary. Fig. 6 shows the denoised image.
And thirdly, carrying out graying processing on the image subjected to denoising processing, and stretching the contrast of the image by adopting a contrast-limited adaptive histogram equalization (CLAHE) algorithm to obtain the image to be segmented.
It should be noted that, in order to make the local texture more obvious, the present invention also adopts the CLAHE algorithm to stretch the image contrast. The algorithm can enable the gray value of the image to be uniformly distributed, thereby improving the contrast of the image, overcoming the problem that the general histogram equalization operation can excessively amplify the image noise due to the characteristic of contrast amplitude limiting, and being beneficial to the subsequent blood vessel extraction.
In practical application, after the RBG image is converted into the gray scale image shown in fig. 7, the image is stretched by using the CLAHE algorithm carried by Opencv to obtain the image shown in fig. 8, so that the texture color difference between the blood vessel and the background is more obvious.
By executing the first step to the third step, the illumination is adjusted to balance the illumination of the image, the noise of the image is reduced, and the contrast of the image is stretched to make the vein texture clear, so that the subsequent segmentation and extraction of the vein are facilitated.
In specific implementation, in the image enhancement method provided in the embodiment of the present invention, in step S102, a multi-scale gaussian matching filtering method is used to extract a target Mask in an image to be segmented, as shown in fig. 2, the method specifically includes: firstly, constructing a Gaussian matched filter with multiple scales and multiple direction angles; then, filtering each pixel point in the image to be segmented at different angles through Gaussian matched filters of all scales, and taking the maximum response value in different directions as the response output of each pixel point; then, calculating the average value of the images output by the Gaussian matched filters with various scales to obtain a Gaussian matched filter image; and finally, performing OTSU thresholding on the Gaussian matched filter image, and extracting a target Mask in the image to be segmented.
Specifically, the endoscopic image blood vessel Mask can be segmented and extracted by adopting multi-scale Gaussian matched filtering, the image background can be suppressed based on the Gaussian matched filtering, the gray level of a target blood vessel is improved, the characteristic of a blood vessel structure is highlighted, and the detection and extraction of the blood vessel in the image are realized.
Because the growth direction of the blood vessel is uncertain, a Gaussian matched filter with the angle interval being equal to or larger than 0 degree and equal to or smaller than 180 degrees can be adopted to track and detect the trend of the blood vessel under a plurality of direction angles. The method can design and construct Gaussian matched filters with 12 direction angles (theta is equal to 0 degree and 15 degrees and … 180 degrees), and carries out 12 different-angle filtering on each pixel point in the image.
In the algorithm, when the direction angle of the Gaussian matched filter is close to the growth direction angle of the blood vessel, the calculated response value is large, so that after the 12 Gaussian matched filters with different direction angles convolve the image respectively, each pixel point takes the maximum response value in 12 directions as the final response output.
The expression of the gaussian matched filter adopted by the invention is as follows:
wherein theta represents the angle of the filter function direction, and theta is more than or equal to 0 degree and less than or equal to 180 degrees; l represents a target blood vessel length that the filter can detect at the rotation angle θ; σ denotes the vessel cross-sectional extension that the filter can detect at the rotation angle θ.
In order to enable the oscilloscope to perform tracking processing on blood vessels with different thicknesses, the invention may design a gaussian matching filter with 3 scales (i.e., σ is 0.5, L is 5, σ is 1.1, L is 9, σ is 1.5, and L is 15) to process the image, and fig. 9 to 11 respectively show the gray scale images after gaussian matching filtering.
Then, averaging images (namely Img _ Match1, Img _ Match2 and Img _ Match3) output after processing by the gaussian matched filters with three sizes to obtain a final gaussian matched filter image Img:
Img=(Img_Match1+Img_Match2+Img_Match3)/3
fig. 12 shows a gaussian matched filter graph. Next, OTSU thresholding is performed on the gray-scale map after gaussian matching filtering to extract a target Mask. Figure 13 shows the blood vessel Mask after OTSU thresholding.
In specific implementation, in the image enhancement method provided in the embodiment of the present invention, in step S102, a target Mask in an image to be segmented is extracted by using an adaptive thresholding algorithm, as shown in fig. 2, which may specifically include: and local threshold values of different areas in the image to be segmented are segmented locally by adopting a Gaussian adaptive thresholding algorithm, and a target Mask in the image to be segmented is extracted. Then, the method can further comprise the following steps: and performing morphological expansion and corrosion treatment on the extracted target Mask.
Because the blood vessel masks are segmented and extracted by adopting the Gaussian matched filter algorithm, and a part of non-blood vessel parts are extracted as blood vessels by mistake, the invention further adopts self-adaptive thresholding to extract the blood vessel masks again, and aims to combine the two blood vessel masks and remove part of the non-blood vessels.
Specifically, a Gaussian adaptive thresholding algorithm is adopted, and for the condition that the gray level in the image is not uniform, the algorithm adaptively calculates local thresholds of different regions according to the brightness distribution of the different regions in the image to perform local segmentation, and accurately extracts local details, so that a target is extracted.
The enhanced endoscopic gray scale map is operated on with adaptive thresholding, and the image after thresholding is shown in FIG. 14. The extracted Mask is subjected to morphological expansion and corrosion treatment, so that small fine-grained points can be effectively removed, small gap points can be added and supplemented, and the outline boundary can be smoothed, and an image subjected to the morphological expansion and corrosion treatment is shown in fig. 15.
Further, in a specific implementation, before the merging the two extracted target masks, the method for enhancing an image according to the embodiment of the present invention may further include: carrying out global thresholding on an image to be segmented and extracting an outer contour Mask; and correcting the two extracted target masks by using the outer contour masks.
It can be understood that, since the effective area of the endoscope is an octagon, in order to eliminate the noise of eight corners, the effective area in the octagon needs to be extracted. By performing simple global thresholding using the gray-scale map before enhancement shown in fig. 16, the outline Mask of the octagon shown in fig. 17 can be extracted, and the extracted blood vessel Mask is corrected by the outline Mask. FIG. 18 shows the extracted vessel Mask of the Gaussian matched filter segmentation, and FIG. 19 shows the Mask after the correction of FIG. 18; fig. 20 shows a Mask of a blood vessel extracted by gaussian adaptive thresholding segmentation, and fig. 21 shows a Mask obtained by correcting fig. 20.
In the blood vessel Mask extracted based on the gaussian matching filtering, because the algorithm performs certain extension on the cross section of the blood vessel in order to better track the blood vessel, certain errors may exist between the edges of the blood vessel and the actual edges of the blood vessel; in Mask extracted by adaptive thresholding, the vessel boundary is closer to the actual vessel shape, but contains a part of non-vessel objects. Therefore, the present invention combines two masks (and takes the two masks as the parts of the blood vessel), i.e. step S103 is executed, as shown in fig. 22, the combined masks are more accurate than the blood vessel morphology extracted by gaussian matched filtering or adaptive thresholding alone.
Further, in specific implementation, when step S104 is executed, according to the extracted blood vessel Mask, as shown in fig. 23, the present invention only superimposes the enhancement effect in the blood vessel Mask on the original image, so that not only the background effect of the original image is retained, but also the texture structure of the blood vessel is more obvious, and the blood vessel which is not obvious originally is visually enhanced.
Vascular enhancement was performed using the following formula:
ImageO=α·ImageI-β·ImageL
wherein, ImageI is inputted into an image, ImageL is an image obtained by processing the inputted image ImageI by a fastGlobolaSmootherFilter algorithm of Opencv, alpha is 1.5, and beta is 0.75.
Finally, as shown in fig. 24, the pixel values of the blood vessel portion in the enhanced image are assigned to the original image, and an enhanced effect map for the enhancement of the target blood vessel is generated.
Fig. 25 to 29 are diagrams showing the effect contrast between the original image and the target enhanced image (i.e., the effect image after the blood vessel is specifically enhanced), in which the original image is shown on the left side and the blood vessel enhanced image is shown on the right side. Therefore, the invention can clearly and accurately observe the blood vessels in the image and retain the original information of the background.
Based on the same inventive concept, the embodiment of the present invention further provides an image enhancement apparatus, and as the principle of the apparatus for solving the problem is similar to the image enhancement method, the implementation of the apparatus can refer to the implementation of the image enhancement method, and repeated details are omitted.
In specific implementation, the image enhancement apparatus provided in the embodiment of the present invention, as shown in fig. 30, specifically includes:
the image preprocessing module 11 is configured to preprocess an original image to obtain an image to be segmented;
the image segmentation module 12 is configured to extract a target Mask in the image to be segmented by respectively using a multi-scale gaussian matching filtering method and an adaptive thresholding algorithm;
a target merging module 13, configured to merge the two extracted target masks to obtain a merged target portion;
and the image enhancement module 14 is configured to enhance only the image information characteristics of the target portion, and assign the pixel value of the enhanced target portion to the original image to generate a target enhanced image.
In the image enhancement device provided by the embodiment of the invention, the difference between the foreground target and the background in the image can be expanded through the interaction of the four modules, the original information of the background is retained, the foreground target can be more highlighted under the premise of keeping the whole image undistorted, and the observation of the foreground target in the image can be clearer and more accurate.
Further, in a specific implementation, the image enhancement apparatus provided in the embodiment of the present invention may further include: the target correction module is used for carrying out global thresholding on the image to be segmented and extracting an outer contour Mask; and correcting the two extracted target masks by using the outer contour Mask.
For more specific working processes of the modules, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not repeated here.
Correspondingly, the embodiment of the invention also discloses image enhancement equipment, which comprises a processor and a memory; wherein the processor, when executing the computer program stored in the memory, implements the image enhancement method disclosed in the foregoing embodiments.
For more specific processes of the above method, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not repeated here.
Further, the present invention also discloses a computer readable storage medium for storing a computer program; the computer program when executed by a processor implements the image enhancement method disclosed in the foregoing.
For more specific processes of the above method, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not repeated here.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device, the equipment and the storage medium disclosed by the embodiment correspond to the method disclosed by the embodiment, so that the description is relatively simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
To sum up, an image enhancement method provided by the embodiment of the present invention includes: preprocessing an original image to obtain an image to be segmented; respectively adopting a multi-scale Gaussian matching filtering method and a self-adaptive thresholding algorithm to segment and extract a target Mask in an image to be segmented; merging the two extracted target masks to obtain a merged target part; and only enhancing the image information characteristics of the target part, and assigning the pixel value of the enhanced target part to the original image to generate a target enhanced image. According to the method, the target Mask is extracted through image segmentation, only the foreground target to be observed in the image is pertinently enhanced, the difference between the foreground target and the background in the image can be enlarged, the original information of the background is reserved, the foreground target can be more highlighted under the premise that the whole image is not distorted, the observation of the foreground target in the image can be clearer and more accurate, and the problem that the background is influenced when the target information amount in the image is enriched under the global enhancement is avoided. In addition, the invention also provides a corresponding device, equipment and a computer readable storage medium aiming at the image enhancement method, so that the method has higher practicability, and the device, the equipment and the computer readable storage medium have corresponding advantages.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The image enhancement method, device, apparatus and storage medium provided by the present invention are described in detail above, and the principle and the implementation of the present invention are explained herein by applying specific examples, and the description of the above embodiments is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
Claims (10)
1. An image enhancement method, comprising:
preprocessing an original image to obtain an image to be segmented;
respectively adopting a multi-scale Gaussian matching filtering method and a self-adaptive thresholding algorithm to segment and extract a target Mask in the image to be segmented;
merging the two extracted target masks to obtain a merged target part;
and only enhancing the image information characteristics of the target part, and assigning the enhanced pixel value of the target part to the original image to generate a target enhanced image.
2. The image enhancement method according to claim 1, wherein the preprocessing the original image to obtain the image to be segmented comprises:
carrying out illumination equalization and Gamma correction on the original image;
denoising the corrected image by adopting a bilateral filtering method;
and carrying out graying processing on the image subjected to denoising processing, and stretching the contrast of the image by adopting a contrast-limiting self-adaptive histogram equalization algorithm to obtain an image to be segmented.
3. The image enhancement method of claim 2, wherein the illumination equalization and Gamma correction of the original image comprises:
carrying out illumination equalization on the original image by adopting an Opencv rapid global smoothing filter algorithm to obtain an illumination map;
and brightening the brightness of the illumination pattern by Gamma correction.
4. The image enhancement method according to claim 3, wherein the extracting of the target Mask in the image to be segmented by using a multi-scale Gaussian matching filter method comprises:
constructing a Gaussian matched filter with multiple scales and multiple direction angles;
filtering each pixel point in the image to be segmented at different angles through the Gaussian matched filter of each scale, and taking the maximum response value in different directions as the response output of each pixel point;
calculating the average value of images output by the Gaussian matched filter with various scales to obtain a Gaussian matched filter image;
and performing OTSU thresholding on the Gaussian matched filter image, and extracting a target Mask in the image to be segmented.
5. The image enhancement method according to claim 4, wherein the extracting of the target Mask in the image to be segmented by adopting the adaptive thresholding algorithm comprises:
and performing local segmentation on local thresholds of different regions in the image to be segmented by adopting a Gaussian adaptive thresholding algorithm, and extracting a target Mask in the image to be segmented.
6. The image enhancement method according to claim 5, wherein after the extracting of the target Mask in the image to be segmented by the adaptive thresholding algorithm, the method further comprises:
and performing morphological expansion and corrosion treatment on the extracted target Mask.
7. The image enhancement method according to claim 6, further comprising, before the merging the extracted two target masks:
carrying out global thresholding on the image to be segmented and extracting an outer contour Mask;
and correcting the two extracted target masks by using the outer contour masks.
8. An image enhancement apparatus, comprising:
the image preprocessing module is used for preprocessing an original image to obtain an image to be segmented;
the image segmentation module is used for extracting a target Mask in the image to be segmented by respectively adopting a multi-scale Gaussian matching filtering method and a self-adaptive thresholding algorithm;
the target merging module is used for merging the two extracted target masks to obtain a merged target part;
and the image enhancement module is used for enhancing the image information characteristics of the target part only, and assigning the enhanced pixel value of the target part to the original image to generate a target enhanced image.
9. An image enhancement device comprising a processor and a memory, wherein the processor, when executing a computer program stored in the memory, implements the image enhancement method of any one of claims 1 to 7.
10. A computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the image enhancement method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110780006.5A CN113379649A (en) | 2021-07-09 | 2021-07-09 | Image enhancement method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110780006.5A CN113379649A (en) | 2021-07-09 | 2021-07-09 | Image enhancement method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113379649A true CN113379649A (en) | 2021-09-10 |
Family
ID=77581632
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110780006.5A Pending CN113379649A (en) | 2021-07-09 | 2021-07-09 | Image enhancement method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113379649A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114677497A (en) * | 2022-05-18 | 2022-06-28 | 浙江大华技术股份有限公司 | Image processing method and device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104715459A (en) * | 2015-03-27 | 2015-06-17 | 浙江大学 | Blood vessel image enhancement method |
CN105761258A (en) * | 2016-02-06 | 2016-07-13 | 上海市第人民医院 | Retinal fundus image bleeding detection method |
CN108154519A (en) * | 2017-12-25 | 2018-06-12 | 吉林大学 | Dividing method, device and the storage medium of eye fundus image medium vessels |
CN109801244A (en) * | 2019-02-19 | 2019-05-24 | 广州视源电子科技股份有限公司 | Image enchancing method, device, computer equipment and storage medium |
CN112801896A (en) * | 2021-01-19 | 2021-05-14 | 西安理工大学 | Backlight image enhancement method based on foreground extraction |
-
2021
- 2021-07-09 CN CN202110780006.5A patent/CN113379649A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104715459A (en) * | 2015-03-27 | 2015-06-17 | 浙江大学 | Blood vessel image enhancement method |
CN105761258A (en) * | 2016-02-06 | 2016-07-13 | 上海市第人民医院 | Retinal fundus image bleeding detection method |
CN108154519A (en) * | 2017-12-25 | 2018-06-12 | 吉林大学 | Dividing method, device and the storage medium of eye fundus image medium vessels |
CN109801244A (en) * | 2019-02-19 | 2019-05-24 | 广州视源电子科技股份有限公司 | Image enchancing method, device, computer equipment and storage medium |
CN112801896A (en) * | 2021-01-19 | 2021-05-14 | 西安理工大学 | Backlight image enhancement method based on foreground extraction |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114677497A (en) * | 2022-05-18 | 2022-06-28 | 浙江大华技术股份有限公司 | Image processing method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Kim et al. | Optimized contrast enhancement for real-time image and video dehazing | |
US8090214B2 (en) | Method for automatic detection and correction of halo artifacts in images | |
CN110766736B (en) | Defect detection method, defect detection device, electronic equipment and storage medium | |
CN107633503B (en) | Image processing method for automatically detecting residual straws in grains | |
Yang et al. | An improved method for finger-vein image enhancement | |
CN112001906A (en) | Steel plate weld image detection method combining non-maximum value inhibition | |
CN108470343A (en) | A kind of improved method for detecting image edge | |
CN113379649A (en) | Image enhancement method, device, equipment and storage medium | |
CN111833366A (en) | Edge detection method based on Canny algorithm | |
CN110909631A (en) | Finger vein image ROI extraction and enhancement method | |
CN109903294B (en) | Image processing method and device, electronic equipment and readable storage medium | |
CN110008969B (en) | Method and device for detecting image saliency region | |
CN106408533A (en) | Card image extraction method and card image extraction system | |
CN114863498A (en) | Hand vein infrared image enhancement and segmentation method based on AGC and Frangi | |
CN114463352A (en) | Slide scanning image target segmentation and extraction method and system | |
CN106952243A (en) | UUV Layer Near The Sea Surface infrared image self adaptation merger histogram stretches Enhancement Method | |
CN111445402A (en) | Image denoising method and device | |
CN114596210A (en) | Noise estimation method, device, terminal equipment and computer readable storage medium | |
CN112085683A (en) | Depth map reliability detection method in significance detection | |
CN110930358A (en) | Solar panel image processing method based on self-adaptive algorithm | |
CN111754413A (en) | Image processing method, device, equipment and storage medium | |
CN111192280B (en) | Method for detecting optic disc edge based on local feature | |
CN114067122B (en) | Two-stage binarization image processing method | |
CN115294202B (en) | Pupil position marking method and system | |
CN112528741B (en) | State identification method and device for transformer substation pressure plate |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |