Fundus image processing method and device
Patent Information
- Application Number
- CN202310304434.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2023-02-27
- Filing Date
- 2023-03-27
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2043-03-27
AI Technical Summary
[0003]现有的图像处理技术并未考虑到彩色眼底图像可能在图像分辨率、图像尺寸、FOV形状和压缩方式等方面具有高度异质性,容易对后续的图像分类、图像检测和图像分割等流程的准确性造成影响
[0016] The beneficial effects of this invention compared with the prior art are as follows: This invention performs retinal region detection and character extraction of patient information on fundus images, uses the results of retinal region detection to downsample the fundus images, and performs pseudo-pixel filling and background color inversion on the sampled results to form an inverted result. The extracted result, the sampled result, and the inverted result are output. This fully considers that color fundus images may have high heterogeneity in terms of image resolution, image size, FOV shape, and compression method, and standardizes the style of fundus images, which is beneficial to subsequent image analysis.
Smart Images

Figure CN116739971B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to image processing methods, and more specifically to fundus image processing methods and apparatus. Background Technology
[0002] The optical principle of a color fundus camera is based on indirect ophthalmoscopy, using a donut-shaped aperture. Reflected light from the retina passes through the circular aperture of the donut, forming a circular image of the fundus. The field of view (FOV) refers to the optical angle of reception of the camera lens. Fundus cameras can typically observe a 30° to 60° area of the retina, also known as the field of view. Color fundus images taken by different camera brands, shooting environments, and operators can exhibit high heterogeneity in image resolution, image size, FOV shape, and compression methods. A color fundus image is a matrix composed of red, green, and blue pixels, also called an RGB image. The R, G, and B channels are all 8-bit images, with each pixel's value ranging from [0, 255]. Common storage formats for color fundus images include JPG and PNG.
[0003] Existing image processing techniques do not take into account the high heterogeneity that color fundus images may have in terms of image resolution, image size, FOV shape, and compression method, which can easily affect the accuracy of subsequent processes such as image classification, image detection, and image segmentation.
[0004] Therefore, it is necessary to design a new method to fully consider the high heterogeneity of color fundus images in terms of image resolution, image size, FOV shape, and compression method, and to standardize the style of fundus images to facilitate subsequent image analysis. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method and apparatus for processing fundus images.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: a fundus image processing method, comprising: Acquire fundus images; The fundus image is subjected to retinal region detection to obtain detection results; The patient information characters are extracted from the fundus image to obtain the extraction results; Based on the detection results, the fundus image is downsampled to obtain the sampling result; The sampling results are then padded with pseudo-pixels to obtain the filled result; The background color of the filled result is inverted to obtain the inverted result; Output the extraction result, the sampling result, and the inversion result.
[0007] A further technical solution is as follows: The step of performing retinal region detection on the fundus image to obtain detection results includes: Extract the FOV mask image from the fundus image; Determine the square border from the FOV mask image; The fundus image is cropped according to the coordinates of the upper left and lower right corners of the square border to obtain the detection result.
[0008] The further technical solution is as follows: the extraction of patient information characters from the fundus image to obtain the extraction result includes: The fundus image is transformed from the RGB color space to the HSV color space to obtain the conversion result; The conversion result of the V channel is subjected to threshold segmentation to obtain the segmentation result; The segmentation results are subjected to mathematical morphological dilation to obtain the extraction results.
[0009] A further technical solution is as follows: The step of downsampling the fundus image based on the detection result to obtain a sampling result includes: Based on the detection results, the fundus image is scaled with the optic disc diameter as a reference to obtain the sampling results.
[0010] A further technical solution is as follows: The process of performing pseudo-pixel filling on the sampling result to obtain the filling result includes: Add several black pixels around the sampling result and the fundus image to obtain the first result and the second result; The first and second results are image-expanded to obtain the fourth and fifth results; Determine the edge pixel set of the fifth result; A mathematical morphological dilation operation is performed on the edge pixels to obtain the operation result; Extract the region of the operation result in the fourth result and assign it to the same position in the first result to update the first result; Replace the sampling result with the first result and replace the fundus image with the second result; Set the iteration count to the previous iteration count plus one; Determine whether the number of iterations has reached a set threshold; If the number of iterations reaches a set threshold, the sampling result is determined to be a filling result.
[0011] A further technical solution is as follows: after determining whether the number of iterations has reached a set threshold, the method further includes: If the number of iterations does not reach the set threshold, then add several black pixels around the sampling result and the fundus image to obtain the first result and the second result.
[0012] A further technical solution is as follows: The process of inverting the background color of the filling result to obtain the inverted result includes: The black background pixels of the filling result are converted into white pixels to obtain the inverted result.
[0013] The present invention also provides a fundus image processing apparatus, comprising: Image acquisition unit, used to acquire fundus images; The detection unit is used to perform retinal region detection on the fundus image to obtain detection results; The extraction unit is used to extract characters of patient information from the fundus image to obtain the extraction result; The downsampling unit is used to downsample the fundus image based on the detection result to obtain a sampling result; A filling unit is used to perform pseudo-pixel filling on the sampling result to obtain a filling result; The inversion unit is used to invert the background color of the fill result to obtain the inverted result; The output unit is used to output the extraction result, the sampling result, and the inversion result.
[0014] The present invention also provides a computer device, the computer device including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the above-described method.
[0015] The present invention also provides a storage medium storing a computer program that, when executed by a processor, implements the above-described method.
[0016] The beneficial effects of this invention compared with the prior art are as follows: This invention performs retinal region detection and character extraction of patient information on fundus images, uses the results of retinal region detection to downsample the fundus images, and performs pseudo-pixel filling and background color inversion on the sampled results to form an inverted result. The extracted result, the sampled result, and the inverted result are output. This fully considers that color fundus images may have high heterogeneity in terms of image resolution, image size, FOV shape, and compression method, and standardizes the style of fundus images, which is beneficial to subsequent image analysis.
[0017] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a schematic diagram illustrating an application scenario of the fundus image processing method provided in an embodiment of the present invention; Figure 2 A schematic flowchart of the fundus image processing method provided in an embodiment of the present invention; Figure 3 A schematic diagram of a sub-process of the fundus image processing method provided in an embodiment of the present invention; Figure 4 A schematic diagram of a sub-process of the fundus image processing method provided in an embodiment of the present invention; Figure 5 A schematic diagram of a sub-process of the fundus image processing method provided in an embodiment of the present invention; Figure 6 A schematic diagram of a fundus image provided in an embodiment of the present invention; Figure 7 A schematic diagram of the detection results provided in an embodiment of the present invention; Figure 8 A schematic diagram of the extraction results provided in an embodiment of the present invention; Figure 9 This is a schematic diagram of the reticulum diameter and field of view (FOV) diameter provided in an embodiment of the present invention; Figure 10 A schematic diagram of the filling results provided in the embodiments of the present invention. Figure 1 ; Figure 11 A schematic diagram of the inversion result provided in an embodiment of the present invention; Figure 12 A schematic diagram of the sampling results provided in an embodiment of the present invention; Figure 13 A schematic diagram of the filling results provided in the embodiments of the present invention. Figure 2 ; Figure 14 A schematic diagram of the FOV mask image of the sampling results provided in an embodiment of the present invention; Figure 15 A schematic diagram of the FOV mask image of the filling result provided in an embodiment of the present invention; Figure 16 A schematic block diagram of a fundus image processing device provided in an embodiment of the present invention; Figure 17 A schematic block diagram of a computer device provided for an embodiment of the present invention. Detailed Implementation
[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0022] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0023] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0024] Please see Figure 1 and Figure 2 , Figure 1 This is a schematic diagram illustrating an application scenario of the fundus image processing method provided in an embodiment of the present invention. Figure 2 This is a schematic flowchart illustrating the fundus image processing method provided in an embodiment of the present invention. The fundus image processing method is applied in a server. The server interacts with a color fundus camera and a terminal to fully consider the high heterogeneity that color fundus images may have in terms of image resolution, image size, FOV shape, and compression method, and standardizes the fundus images to facilitate subsequent image analysis.
[0025] Figure 2 This is a schematic flowchart of the fundus image processing method provided in an embodiment of the present invention. Figure 2 As shown, the method includes the following steps S110 to S170.
[0026] S110. Obtain fundus image.
[0027] In this embodiment, fundus image refers to a color fundus image, which may have high heterogeneity in terms of image resolution, image size, FOV shape, and compression method. For example... Figure 6 As shown, the fundus image was taken by a handheld fundus camera, with an image size of 2448×3264 pixels.
[0028] S120. Perform retinal region detection on the fundus image to obtain detection results.
[0029] In this embodiment, the detection result refers to the retinal region of the fundus image. The purpose of retinal region detection is to remove black pixels outside the field of view (FOV), such as... Figure 7 As shown.
[0030] In one embodiment, please refer to Figure 3 The above step S120 may include steps S121 to S123.
[0031] S121. Extract the FOV mask image from the fundus image.
[0032] In this embodiment, the FOV mask image refers to the image formed by using 0 and 1 to represent black pixels outside the FOV area and all pixels inside the FOV area, respectively.
[0033] S122. Determine the square border from the FOV mask image.
[0034] In this embodiment, the FOV mask image is the inscribed circular region of the bounding box. Any missing arc-shaped regions are filled with black pixels.
[0035] S123. The fundus image is cropped according to the coordinates of the upper left and lower right corners of the square frame to obtain the detection result.
[0036] S130. Extract patient information characters from the fundus image to obtain the extraction result.
[0037] In this embodiment, the extraction result refers to the characters corresponding to the patient information in the fundus image. For example... Figure 8 As shown, the shooting date, left and right eye markings, and camera brand in the image have all been completely segmented out.
[0038] Specifically, patient information is extracted from fundus images, including the date of capture, name, age, and left / right eye information. This information may be sensitive and needs to be desensitized before remote image transmission and further analysis. Character extraction can be used for desensitization of sensitive information.
[0039] In one embodiment, please refer to Figure 4 The above-mentioned step S130 may include steps S131 to S133.
[0040] S131. Convert the fundus image from RGB color space to HSV color space to obtain the conversion result.
[0041] In this embodiment, the conversion result refers to the result formed after transforming the fundus image from the RGB color space to the HSV color space.
[0042] S132. The conversion result of the V channel is thresholded to obtain the segmentation result.
[0043] In this embodiment, the segmentation result refers to the result formed after threshold segmentation of the conversion result of the V channel.
[0044] Specifically, the threshold is 0.5; of course, in other embodiments, the threshold can be set to other values.
[0045] S133. Perform mathematical morphological dilation on the segmentation result to obtain the extraction result.
[0046] In this embodiment, the extraction result refers to the result formed after performing a mathematical morphological dilation operation on the segmentation result.
[0047] Preferably, the structural element is a disk with a radius of 2 pixels.
[0048] S140. Based on the detection results, the fundus image is downsampled to obtain the sampling results.
[0049] In this embodiment, the sampling result refers to the image formed by downsampling the fundus image based on the detection result. For example... Figure 9 As shown, Figure 9 This is a schematic diagram of the viewing disk diameter and the FOV diameter.
[0050] Specifically, the fundus image is scaled with reference to the optic disc diameter based on the detection results to obtain the sampling results.
[0051] Image scaling involves downsampling the cropped image output from retinal region detection, changing its size for subsequent image analysis. This embodiment uses image scaling with the optic disc diameter as a reference. First, the optic disc diameter in the image is determined manually or automatically. Then, the downsampling coefficients are determined.
[0052] S150. Perform pseudo-pixel filling on the sampling results to obtain the filling result.
[0053] In this embodiment, the filling result mentioned above refers to the result formed after pseudo-pixel filling of the image. Pseudo-pixel filling is used to eliminate the interference of strong contrast of pixels at the FOV edge on the image analysis process. Figure 10 Yes Figure 9 The result image after pseudo-pixel filling of the fundus image.
[0054] In one embodiment, please refer to Figure 5 The above-mentioned step S150 may include steps S151 to S159.
[0055] S151. Add several black pixels around the sampling result and the fundus image to obtain the first result and the second result.
[0056] In this embodiment, the first result refers to an image formed by adding a number of black pixels around the sampling result; the second result refers to an image formed by adding a number of black pixels around each side of the fundus image.
[0057] S152. Perform image expansion on the first result and the second result to obtain the fourth result and the fifth result.
[0058] In this embodiment, the fourth result refers to the image formed after image expansion of the first result; The fifth result refers to the image formed after image expansion of the second result.
[0059] S153. Determine the edge pixel set of the fifth result; S154. Perform mathematical morphological dilation on the edge pixel level to obtain the operation result.
[0060] In this embodiment, the operation result refers to the result formed by performing mathematical morphological dilation operation on the edge pixels.
[0061] S155. Extract the region of the operation result in the fourth result and assign it to the same position in the first result to update the first result; S156. Replace the sampling result with the first result, and replace the fundus image with the second result; S157. Set the iteration count to the previous iteration count plus one.
[0062] In this embodiment, before iteration, the iteration count is set to zero. After each execution of steps S151 to S156, the previous iteration count is incremented by one to update the iteration count.
[0063] S158. Determine whether the number of iterations has reached a set threshold. S159. If the number of iterations reaches a set threshold, the sampling result is determined to be a filling result.
[0064] If the number of iterations does not reach the set threshold, then step S151 is executed.
[0065] Specifically, for the cropped image The pseudo-pixel filling process is as follows: exist and Add 10 black pixels to each side of the image to obtain... and ; Using bicubic interpolation, and Image expansion is performed by increasing the length and width of the original image by 20, resulting in... and ; Sure The edge pixel set S, namely M and Regions with different pixel values; Mathematical morphological dilation is performed on image S using a disk structuring element with a radius of 5 pixels. Extract S in The region referred to in the text is assigned a value to. The same position in; use replace , replace Repeat the above steps five times to determine the final filling result.
[0066] like Figure 10 As shown, the light-colored area is the original retinal area, and the area outside the light-colored area is filled with pseudo pixels.
[0067] S160. Invert the background color of the filled result to obtain the inverted result.
[0068] In this embodiment, the inverted result refers to the result formed by inverting the background color of the filled result by black and white pixels. This can be used as the output image of a fundus image analysis report, thus saving printing costs.
[0069] Specifically, the black background pixels of the filling result are converted into white pixels to obtain the inverted result.
[0070] In this embodiment, the background color inversion operation converts the black background pixels (excluding characters and the retinal area) in the fundus image into white pixels. The mask image for the black background area is determined using the mask image output by the retinal area detection and character extraction modules. In the original color image, the pixel values of all black background pixels are replaced from 0 to 255. Figure 11 A black-to-white image is the result of inverting the background color.
[0071] S170, Output the extraction result, the sampling result, and the inversion result.
[0072] Figures 12 to 15 These are other output images from this embodiment, including black-to-white images, pseudo-pixel-filled images, and several FOV mask images. They can be used for various image analysis tasks, including image classification, image segmentation, and object detection.
[0073] The aforementioned fundus image processing method performs retinal region detection and patient information character extraction on the fundus image. It then uses the retinal region detection results to downsample the fundus image and performs pseudo-pixel filling and background color inversion on the sampled results to form an inverted result. The method outputs the extraction result, the sampled result, and the inverted result. This approach fully considers the high heterogeneity that color fundus images may have in terms of image resolution, image size, FOV shape, and compression method, and standardizes the style of the fundus image to facilitate subsequent image analysis.
[0074] Figure 16 This is a schematic block diagram of a fundus image processing device 300 provided in an embodiment of the present invention. Figure 16 As shown, corresponding to the above-described fundus image processing method, the present invention also provides a fundus image processing apparatus 300. This fundus image processing apparatus 300 includes a unit for performing the above-described fundus image processing method, and the apparatus can be configured in a server. Specifically, please refer to... Figure 16 The fundus image processing device 300 includes an image acquisition unit 301, a detection unit 302, an extraction unit 303, a downsampling unit 304, a filling unit 305, an inversion unit 306, and an output unit 307.
[0075] Image acquisition unit 301 is used to acquire fundus images; detection unit 302 is used to perform retinal region detection on the fundus images to obtain detection results; extraction unit 303 is used to extract characters of patient information from the fundus images to obtain extraction results; downsampling unit 304 is used to downsample the fundus images according to the detection results to obtain sampling results; filling unit 305 is used to perform pseudo-pixel filling on the sampling results to obtain filling results; inversion unit 306 is used to invert the background color of the filling results to obtain inversion results; output unit 307 is used to output the extraction results, the sampling results, and the inversion results.
[0076] In one embodiment, the detection unit 302 includes an image extraction subunit, a border determination subunit, and a cropping subunit.
[0077] An image extraction subunit is used to extract a field of view (FOV) mask image from the fundus image; a border determination subunit is used to determine a square border from the FOV mask image; and a cropping subunit is used to crop the fundus image according to the coordinates of the upper left and lower right corners of the square border to obtain the detection result.
[0078] In one embodiment, the extraction unit 303 includes a transformation subunit, a segmentation subunit, and a dilation operation subunit.
[0079] The transformation subunit is used to transform the fundus image from the RGB color space to the HSV color space to obtain a transformation result; the segmentation subunit is used to perform threshold segmentation on the transformation result of the V channel to obtain a segmentation result; and the dilation operation subunit is used to perform mathematical morphological dilation operation on the segmentation result to obtain an extraction result.
[0080] In one embodiment, the downsampling unit 304 is used to scale the fundus image with the optic disc diameter as a reference based on the detection result to obtain a sampling result.
[0081] In one embodiment, the filling unit 305 includes an adding sub-unit, an expanding sub-unit, a pixel-level determining sub-unit, an operating sub-unit, an extracting sub-unit, a replacing sub-unit, a setting sub-unit, a judging sub-unit, and a result determining sub-unit.
[0082] The system includes the following subunits: an adding subunit for adding a plurality of black pixels around the sampling result and the fundus image to obtain a first result and a second result; an expanding subunit for expanding the first result and the second result to obtain a fourth result and a fifth result; a pixel-level determination subunit for determining the edge pixel set of the fifth result; an operation subunit for performing a mathematical morphological dilation operation on the edge pixels to obtain an operation result; an extraction subunit for extracting the region of the operation result in the fourth result and assigning it to the same position in the first result to update the first result; a replacement subunit for replacing the sampling result with the first result and replacing the fundus image with the second result; a setting subunit for setting the iteration count to the previous iteration count plus one; a judgment subunit for judging whether the iteration count has reached a set threshold; if the iteration count has not reached the set threshold, then the process of adding a plurality of black pixels around the sampling result and the fundus image to obtain the first result and the second result is performed; and a result determination subunit for determining that the sampling result is a filling result if the iteration count has reached the set threshold.
[0083] In one embodiment, the inversion unit 306 is used to convert the black background pixels of the filling result into white pixels to obtain the inverted result.
[0084] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned fundus image processing device 300 and each unit can be referred to the corresponding description in the foregoing method embodiments. For the sake of convenience and brevity, it will not be repeated here.
[0085] The aforementioned fundus image processing device 300 can be implemented as a computer program, which can, for example... Figure 17 It runs on the computer device shown.
[0086] Please see Figure 17 , Figure 17 This is a schematic block diagram of a computer device provided in an embodiment of this application. The computer device 500 can be a server, wherein the server can be a standalone server or a server cluster composed of multiple servers.
[0087] See Figure 17 The computer device 500 includes a processor 502, a memory, and a network interface 505 connected via a system bus 501. The memory may include a non-volatile storage medium 503 and internal memory 504.
[0088] The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions that, when executed, cause the processor 502 to perform a fundus image processing method.
[0089] The processor 502 provides computing and control capabilities to support the operation of the entire computer device 500.
[0090] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can perform a fundus image processing method.
[0091] This network interface 505 is used for network communication with other devices. Those skilled in the art will understand that... Figure 17 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device 500 to which the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0092] The processor 502 is used to run a computer program 5032 stored in the memory to perform the following steps: Acquire a fundus image; perform retinal region detection on the fundus image to obtain detection results; extract characters of patient information from the fundus image to obtain extraction results; perform image downsampling on the fundus image based on the detection results to obtain sampling results; perform pseudo-pixel filling on the sampling results to obtain filling results; invert the background color of the filling results to obtain inverted results; output the extraction results, the sampling results, and the inverted results.
[0093] In one embodiment, when the processor 502 performs retinal region detection on the fundus image to obtain detection results, it specifically implements the following steps: Extract a field of view (FOV) mask image from the fundus image; determine a square border from the FOV mask image; crop the fundus image according to the coordinates of the upper left and lower right corners of the square border to obtain the detection result.
[0094] In one embodiment, when the processor 502 performs the step of extracting characters of patient information from the fundus image to obtain the extraction result, it specifically implements the following steps: The fundus image is transformed from the RGB color space to the HSV color space to obtain a transformation result; the transformation result of the V channel is thresholded to obtain a segmentation result; and the segmentation result is subjected to mathematical morphological dilation to obtain an extraction result.
[0095] In one embodiment, when the processor 502 implements the step of downsampling the fundus image based on the detection result to obtain the sampling result, the following steps are specifically implemented: Based on the detection results, the fundus image is scaled with the optic disc diameter as a reference to obtain the sampling results.
[0096] In one embodiment, when the processor 502 performs the step of pseudo-pixel filling on the sampling result to obtain the filling result, it specifically implements the following steps: Add several black pixels around the sampling result and the fundus image to obtain a first result and a second result; perform image expansion on the first result and the second result to obtain a fourth result and a fifth result; determine the edge pixel set of the fifth result; perform mathematical morphological dilation on the edge pixel level to obtain the operation result; extract the region of the operation result in the fourth result and assign it to the same position in the first result to update the first result; replace the sampling result with the first result and replace the fundus image with the second result; set the iteration number to the previous iteration number plus one; determine whether the iteration number reaches a set threshold; if the iteration number reaches the set threshold, determine that the sampling result is a filling result.
[0097] In one embodiment, after performing the step of determining whether the number of iterations has reached a set threshold, the processor 502 further performs the following steps: If the number of iterations does not reach the set threshold, then add several black pixels around the sampling result and the fundus image to obtain the first result and the second result.
[0098] In one embodiment, when the processor 502 performs the step of inverting the background color of the fill result to obtain the inverted result, it specifically implements the following steps: The black background pixels of the filling result are converted into white pixels to obtain the inverted result.
[0099] It should be understood that in the embodiments of this application, the processor 502 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0100] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program includes program instructions and can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.
[0101] Therefore, the present invention also provides a storage medium. This storage medium can be a computer-readable storage medium. The storage medium stores a computer program, wherein when executed by a processor, the computer program causes the processor to perform the following steps: Acquire a fundus image; perform retinal region detection on the fundus image to obtain detection results; extract characters of patient information from the fundus image to obtain extraction results; perform image downsampling on the fundus image based on the detection results to obtain sampling results; perform pseudo-pixel filling on the sampling results to obtain filling results; invert the background color of the filling results to obtain inverted results; output the extraction results, the sampling results, and the inverted results.
[0102] In one embodiment, when the processor executes the computer program to perform retinal region detection on the fundus image to obtain detection results, it specifically implements the following steps: Extract a field of view (FOV) mask image from the fundus image; determine a square border from the FOV mask image; crop the fundus image according to the coordinates of the upper left and lower right corners of the square border to obtain the detection result.
[0103] In one embodiment, when the processor executes the computer program to perform the step of extracting character information from the fundus image to obtain the extraction result, it specifically implements the following steps: The fundus image is transformed from the RGB color space to the HSV color space to obtain a transformation result; the transformation result of the V channel is thresholded to obtain a segmentation result; and the segmentation result is subjected to mathematical morphological dilation to obtain an extraction result.
[0104] In one embodiment, when the processor executes the computer program to implement the step of downsampling the fundus image based on the detection result to obtain a sampling result, it specifically implements the following steps: Based on the detection results, the fundus image is scaled with the optic disc diameter as a reference to obtain the sampling results.
[0105] In one embodiment, when the processor executes the computer program to perform pseudo-pixel filling on the sampling result to obtain the filling result, it specifically implements the following steps: Add several black pixels around the sampling result and the fundus image to obtain a first result and a second result; perform image expansion on the first result and the second result to obtain a fourth result and a fifth result; determine the edge pixel set of the fifth result; perform mathematical morphological dilation on the edge pixel level to obtain the operation result; extract the region of the operation result in the fourth result and assign it to the same position in the first result to update the first result; replace the sampling result with the first result and replace the fundus image with the second result; set the iteration number to the previous iteration number plus one; determine whether the iteration number reaches a set threshold; if the iteration number reaches the set threshold, determine that the sampling result is a filling result.
[0106] In one embodiment, after executing the computer program to perform the step of determining whether the number of iterations has reached a set threshold, the processor further performs the following steps: If the number of iterations does not reach the set threshold, then add several black pixels around the sampling result and the fundus image to obtain the first result and the second result.
[0107] In one embodiment, when the processor executes the computer program to perform the step of inverting the background color of the fill result to obtain the inverted result, it specifically implements the following steps: The black background pixels of the filling result are converted into white pixels to obtain the inverted result.
[0108] The storage medium can be any computer-readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.
[0109] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0110] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0111] The steps in the method of this invention can be adjusted, merged, or reduced in order according to actual needs. The units in the device of this invention can be merged, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0112] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0113] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A fundus image processing method, characterized in that, include: Acquire fundus images; The fundus image is subjected to retinal region detection to obtain detection results; The patient information characters are extracted from the fundus image to obtain the extraction results; Based on the detection results, the fundus image is downsampled to obtain the sampling result; The sampling results are then padded with pseudo-pixels to obtain the filled result; The background color of the filled result is inverted to obtain the inverted result; Output the extraction result, the sampling result, and the inversion result; The step of performing pseudo-pixel filling on the sampling result to obtain the filling result includes: Add several black pixels around the sampling result and the fundus image to obtain the first result and the second result; The first and second results are image-expanded to obtain the fourth and fifth results; Determine the edge pixel set of the fifth result; A mathematical morphological dilation operation is performed on the edge pixel set to obtain the operation result; Extract the region of the operation result in the fourth result and assign it to the same position in the first result to update the first result; Replace the sampling result with the first result and replace the fundus image with the second result; Set the iteration count to the previous iteration count plus one; Determine whether the number of iterations has reached a set threshold; If the number of iterations reaches a set threshold, the sampling result is determined to be a filling result.
2. The fundus image processing method according to claim 1, characterized in that, The step of performing retinal region detection on the fundus image to obtain detection results includes: Extract the FOV mask image from the fundus image; Determine the square border from the FOV mask image; The fundus image is cropped according to the coordinates of the upper left and lower right corners of the square border to obtain the detection result.
3. The fundus image processing method according to claim 1, characterized in that, The step of extracting patient information characters from the fundus image to obtain the extraction result includes: The fundus image is transformed from the RGB color space to the HSV color space to obtain the conversion result; The conversion result of the V channel is subjected to threshold segmentation to obtain the segmentation result; The segmentation results are subjected to mathematical morphological dilation to obtain the extraction results.
4. The fundus image processing method according to claim 1, characterized in that, The step of downsampling the fundus image based on the detection result to obtain the sampling result includes: Based on the detection results, the fundus image is scaled with the optic disc diameter as a reference to obtain the sampling results.
5. The fundus image processing method according to claim 1, characterized in that, After determining whether the number of iterations has reached a set threshold, the method further includes: If the number of iterations does not reach the set threshold, then add several black pixels around the sampling result and the fundus image to obtain the first result and the second result.
6. The fundus image processing method according to claim 1, characterized in that, The step of inverting the background color of the filled result to obtain the inverted result includes: The black background pixels of the filling result are converted into white pixels to obtain the inverted result.
7. A fundus image processing device, characterized in that, The device uses the fundus image processing method as described in any one of claims 1 to 6, comprising: Image acquisition unit, used to acquire fundus images; The detection unit is used to perform retinal region detection on the fundus image to obtain detection results; The extraction unit is used to extract characters of patient information from the fundus image to obtain the extraction result; The downsampling unit is used to downsample the fundus image based on the detection result to obtain a sampling result; A filling unit is used to perform pseudo-pixel filling on the sampling result to obtain a filling result; The inversion unit is used to invert the background color of the fill result to obtain the inverted result; The output unit is used to output the extraction result, the sampling result, and the inversion result.
8. A computer device, characterized in that, The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method as described in any one of claims 1 to 6.
9. A storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
A background segmentation method of a silkworm cocoon image
CN109389616A
Fundus image processing method, device and equipment and storage medium
CN112102174A
Method and device for processing target field, equipment and medium
CN115171090A
Eye fundus image management device and method for determining quality of eye fundus image
WO2020009292A1