Image processing method and device for medical endoscope, and electronic device

CN116071301BActive Publication Date: 2026-10-09ZHEJIANG HEALNOC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211606864.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-13
Publication Date
2026-10-09
Estimated Expiration
2042-12-13

AI Technical Summary

Technical Problem

[0003]在本实施例中提供了一种用于医疗内窥镜的图像处理方法、装置、电子装置,以解决相关技术中存在的误触发拍摄导致拍摄图像模糊的问题

Benefits of technology

[0036] Compared to related technologies, this method reduces the blurriness of image frames by filtering them, and obtains the final output image by calculating the spatial frequency and spatial frequency difference of the image frames, thus minimizing the difference between the original and corrected image frames. This dual processing effectively reduces the blurriness caused by camera shake during shooting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116071301B_ABST
    Figure CN116071301B_ABST
Patent Text Reader

Abstract

The application relates to an image processing method and device for a medical endoscope, and an electronic device, comprising the following steps: when a photographing instruction is received, saving image frames before and after a time corresponding to the photographing instruction; performing frame-by-frame blur correction on the image frame sequence, and calculating the spatial frequency of each corrected image frame; selecting a target image frame from the corrected image frames based on the obtained spatial frequency; selecting an image frame corresponding to the target image frame from the corrected image frames as a sample frame; and selecting a final image as an output result in combination with the spatial frequency difference between the sample frame and the target image frame. The image frame is filtered to reduce the blur defect of the image frame itself, and the image frame with the smallest difference from the corrected image frame is obtained in the form of the spatial frequency and the spatial frequency difference, and is used as the final output image. The above double processing can effectively reduce the defect that the image is blurred due to shaking at the photographing time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing, and in particular to image processing methods, apparatus, and electronic devices for medical endoscopes. Background Technology

[0002] Currently, using endoscopes to photograph tissues and organs inside a patient's body has become a mature treatment method in medical diagnosis, assisting doctors in pathological analysis. However, in actual use, when doctors are controlling the endoscope to take pictures, unexpected body tremors at the moment of triggering may cause the endoscope to be mistakenly triggered, resulting in blurry images. Summary of the Invention

[0003] This embodiment provides an image processing method, apparatus, and electronic device for medical endoscopes to solve the problem of blurred images caused by accidental triggering of shooting in related technologies.

[0004] In a first aspect, embodiments of this application propose an image processing method for medical endoscopes, comprising:

[0005] Upon receiving a photo capture command, save the sequence of image frames before and after the time corresponding to the photo capture command.

[0006] Perform frame-by-frame blur correction on the image frame sequence and calculate the spatial frequency of each image frame after correction;

[0007] Based on the obtained spatial frequency, a target image frame is selected from the corrected image frames. An image frame corresponding to the target image frame is selected from the corrected image frames as a sample frame. The final image is selected as the output result by combining the spatial frequency difference between the sample frame and the target image frame.

[0008] In one embodiment, upon receiving a photo-taking command, image frames before and after the time corresponding to the photo-taking command are saved, including:

[0009] During the use of a medical endoscope, image frames captured by the medical endoscope are continuously acquired.

[0010] The moment the photo-taking command is received is taken as the initial moment, and the time interval between the preset duration before the initial moment and the preset duration after the initial moment is taken as the initial time interval.

[0011] Construct an image frame sequence by selecting image frames from the image frames that correspond to the initial time period.

[0012] In one embodiment, frame-by-frame blur correction is performed on the image frame sequence, and the spatial frequency of each corrected image frame is calculated, including:

[0013] Motion blur correction is performed on each image frame in the image frame sequence using a filter;

[0014] Calculate the spatial frequency of each image frame after correction.

[0015] In one embodiment, calculating the spatial frequency of each corrected image frame includes:

[0016] The prewitt operator is used to perform convolution calculation on each corrected image frame to obtain the horizontal and vertical spatial frequency maps of each corrected image frame.

[0017] The spatial frequency of each image frame after correction is calculated based on the horizontal and vertical spatial frequency maps.

[0018] In one embodiment, the prewitt operator is used to perform convolution calculations on each corrected image frame to obtain the horizontal and vertical spatial frequency maps of each corrected image frame, including:

[0019] The first prewitt operator is called to perform convolution calculation on each corrected image frame to obtain the horizontal spatial frequency distribution matrix, and a horizontal spatial frequency map is constructed based on the horizontal spatial frequency distribution matrix.

[0020] The second prewitt operator is called to perform convolution calculation on each corrected image frame to obtain the vertical spatial frequency distribution matrix, and the horizontal spatial frequency map is constructed based on the vertical spatial frequency distribution matrix.

[0021] In one embodiment, the spatial frequency of each image frame after correction is calculated based on the horizontal and vertical spatial frequency maps, including:

[0022] The spatial frequency of each image frame after correction is calculated based on Formula 1.

[0023]

[0024] In the formula, F represents the spatial frequency of the image frame, fx represents the horizontal spatial frequency map, fy represents the vertical spatial frequency map, and Mean is the operation of taking the average value of all pixels in the image.

[0025] In one embodiment, a target image frame is selected from the corrected image frames based on the obtained spatial frequency; an image frame corresponding to the target image frame is selected from the corrected image frames as a sample frame; and the final image as the output result is selected by combining the spatial frequency difference between the sample frame and the target image frame. This includes:

[0026] The corrected image frames are arranged in descending order of spatial frequency, and the first N image frames are selected as the target image frames.

[0027] Select the corresponding target image frame from the corrected image frames as sample frames;

[0028] Calculate the spatial frequency difference between the target image frame and the sample frame for each image frame, and select the target image frame corresponding to the spatial frequency difference as the final image.

[0029] Where N is a positive integer.

[0030] Secondly, embodiments of this application provide an image processing apparatus for a medical endoscope, characterized in that it comprises:

[0031] The image frame acquisition module is used to save image frames before and after the corresponding moment of the photo capture command when a photo capture command is received.

[0032] The spatial frequency calculation module is used to perform frame-by-frame blur correction on the image frame sequence and calculate the spatial frequency of each image frame after correction.

[0033] The result output module is used to select the target image frame from the corrected image frames based on the obtained spatial frequency, select the image frame corresponding to the target image frame from the corrected image frames as the sample frame, and select the final image as the output result by combining the spatial frequency difference between the sample frame and the target image frame.

[0034] Thirdly, this embodiment provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the image processing method for medical endoscopes described in the first aspect.

[0035] Fourthly, this embodiment provides a storage medium storing a computer program that, when executed by a processor, implements the image processing method for medical endoscopes described in the first aspect above.

[0036] Compared to related technologies, this method reduces the blurriness of image frames by filtering them, and obtains the final output image by calculating the spatial frequency and spatial frequency difference of the image frames, thus minimizing the difference between the original and corrected image frames. This dual processing effectively reduces the blurriness caused by camera shake during shooting.

[0037] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description

[0038] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0039] Figure 1 This is a hardware structure block diagram of the terminal for the image processing method for medical endoscopes in this embodiment;

[0040] Figure 2 This is a flowchart of the image processing method for a medical endoscope according to this embodiment;

[0041] Figure 3 This is a schematic diagram of the continuous acquisition of image frames in this embodiment;

[0042] Figure 4 This is a structural block diagram of an image processing apparatus for a medical endoscope according to another embodiment. Detailed Implementation

[0043] To better understand the purpose, technical solution, and advantages of this application, the application is described and illustrated below in conjunction with the accompanying drawings and embodiments.

[0044] Unless otherwise defined, the technical or scientific terms used in this application shall have the general meaning as understood by one of ordinary skill in the art to which this application pertains. Words such as “a,” “an,” “an,” “the,” “the,” and “these,” used in this application, do not indicate quantitative limitation and may be singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or modules (units) is not limited to the listed steps or modules (units) but may include steps or modules (units) not listed, or may include other steps or modules (units) inherent to such processes, methods, products, or devices. The terms “connected,” “linked,” and “coupled,” used in this application, are not limited to physical or mechanical connections but may include electrical connections, whether direct or indirect. The term “multiple” used in this application refers to two or more. The "and / or" operator describes the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: A alone, A and B simultaneously, and B alone. Typically, the character " / " indicates that the objects before and after it are in an "or" relationship. The terms "first," "second," and "third," etc., used in this application are merely for distinguishing similar objects and do not represent a specific ordering of the objects.

[0045] The method embodiments provided in this example can be executed on a terminal, computer, or similar computing device. For example, it can run on a terminal. Figure 1 This is a hardware structure block diagram of the terminal for the image processing method for medical endoscopes in this embodiment. (See diagram for example.) Figure 1 As shown, a terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 and a memory 104 for storing data are also included. The processor 102 may be, but is not limited to, a microprocessor (MCU) or a programmable logic device (FPGA). The terminal may also include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that… Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the terminal described above. For example, the terminal may also include components that are larger than... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown are illustrated.

[0046] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the image processing method for medical endoscopes in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0047] The transmission device 106 is used to receive or send data via a network. This network includes a wireless network provided by the terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 can be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0048] This embodiment provides an image processing method for medical endoscopes. Figure 2 This is a flowchart of the image processing method for a medical endoscope according to this embodiment, such as... Figure 2 As shown, the process includes the following steps:

[0049] Step S210: When a photo-taking command is received, save the image frames before and after the time corresponding to the photo-taking command.

[0050] During the imaging process, the medical endoscope continuously captures and stores the captured image frames. When a photo capture command is received, it can directly save the image frames before and after the corresponding moment. The reason for acquiring a large number of image frames is to increase the number of ultimately usable image frames and reduce the possibility of image blurring due to shaking.

[0051] Step S220: Perform frame-by-frame blur correction on the image frame sequence and calculate the spatial frequency of each image frame after correction.

[0052] In addition to increasing the number of captured image frames to improve the likelihood of a sharp photo, motion blur correction is introduced to reduce blur in the acquired image frames. A typical approach involves using a Wiener filter to filter the image frames. The processed image frames exhibit reduced blur to some extent. Simultaneously, the spatial frequencies of the corrected image frames are calculated, facilitating the selection of the final image frames based on spatial frequency in subsequent steps.

[0053] Step S230: Select the target image frame from the corrected image frames based on the obtained spatial frequency, select the image frame corresponding to the target image frame from the corrected image frames as the sample frame, and select the final image as the output result by combining the spatial frequency difference between the sample frame and the target image frame.

[0054] The spatial frequency difference between the target image frame and the image frame is calculated. The smaller the difference, the smaller the difference between the original image and the corrected image, which means that the image frame used as the original image is more usable. Therefore, the image frame with the smallest spatial frequency difference is selected as the final image.

[0055] By performing the steps S210 to S230 above, the blurriness of the image frames is reduced by filtering them. Simultaneously, the image frame with the smallest difference from the corrected image frame is obtained by calculating the spatial frequency and spatial frequency difference of the image frames, and this image is used as the final output image. This dual processing effectively reduces the blurriness caused by camera shake during shooting.

[0056] Furthermore, in one embodiment, based on the above step S210, the specific content of the image frame is obtained as follows:

[0057] S320 continuously acquires image frames captured by the medical endoscope during the use of the medical endoscope;

[0058] S420 takes the moment when the photo-taking command is received as the initial moment and the time interval between the preset duration before the initial moment and the preset duration after the initial moment as the initial time interval.

[0059] S520: Select image frames from the image frames that correspond to the initial time period to construct an image frame sequence.

[0060] In practice, once the doctor begins using the medical endoscope, image frames captured by the endoscope are continuously acquired. The number of continuously acquired image frames is limited by the processing power and storage space of the medical endoscope itself.

[0061] For example, Figure 3 A schematic diagram of continuously acquiring image frames is provided. The image frame indicated by the arrow of the photo-taking command is the image frame corresponding to the initial time. Taking the initial time as the origin, the leftward direction represents the time period before the photo-taking command, and the rightward direction represents the time period after the photo-taking command. Dashed lines represent several image frames omitted for image readability. The lengths of the two time periods are determined based on the actual situation to construct the initial time period. Then, all image frames corresponding to the initial time period are selected from the image frames and combined to form an image frame sequence.

[0062] For example, if m image frames are saved before the photo-taking command and n image frames are saved after the photo-taking command, and the image frames corresponding to the initial moment of the photo-taking command are combined, the resulting image frame sequence contains a total of (m+n+1) image frames.

[0063] Furthermore, in one embodiment, based on the above step S220, the specific content of the image frame spatial frequency is obtained as follows:

[0064] S320 uses a filter to correct motion blur for each image frame in the image frame sequence;

[0065] S420, calculate the spatial frequency of each image frame after correction.

[0066] In practice, considering that there is no strong random noise in the shooting environment, a filter is used to filter each image frame in the image frame sequence to facilitate the subsequent calculation of spatial frequency.

[0067] The filters used are typically Wiener filters, which are linear filters that use the least squares criterion for optimality. Under certain constraints, the Wiener filter minimizes the square of the difference between its output and a given function (usually called the desired output). Through mathematical operations, this can ultimately be transformed into a problem of solving a Tobleitz equation, and is therefore also known as a least squares filter or a least squares filter.

[0068] After obtaining the filtered image frames, the following steps need to be performed to calculate the spatial frequency of each image frame:

[0069] S4201, use the prewitt operator to perform convolution calculation on each corrected image frame to obtain the horizontal spatial frequency map and vertical spatial frequency map of each corrected image frame;

[0070] S4202 calculates the corrected spatial frequency of each image frame based on the horizontal and vertical spatial frequency maps.

[0071] In implementation, the spatial frequency calculation for each image frame depends on the differential operator for edge detection. A common differential operator is the Prewitt operator, which utilizes the gray-level differences between the vertical and horizontal neighbors of a pixel within the image to detect edges at extreme values, removing some false edges and smoothing noise. The principle involves performing neighborhood convolution with the image using two directional templates in the image space. The two directional templates are responsible for detecting horizontal and vertical edges, respectively.

[0072] The details of the first prewitt operator responsible for horizontal edge detection are as follows:

[0073]

[0074] The details of the second Prewitt operator responsible for vertical edge detection are as follows:

[0075]

[0076] Based on the two prewitt operators mentioned above, the first prewitt operator is called to perform convolution calculation on each corrected image frame to obtain the horizontal spatial frequency distribution matrix. The horizontal spatial frequency map fx is constructed based on the horizontal spatial frequency distribution matrix. The second prewitt operator is called to perform convolution calculation on each corrected image frame to obtain the vertical spatial frequency distribution matrix. The horizontal spatial frequency map fy is constructed based on the vertical spatial frequency distribution matrix.

[0077] After obtaining the spatial frequency maps of each corrected frame image in both the horizontal and vertical directions, it is also necessary to calculate the spatial frequency of each corrected image frame, including:

[0078] The spatial frequency of each image frame after correction is calculated based on Formula 1.

[0079]

[0080] In the formula, F represents the spatial frequency of the image frame, fx represents the horizontal spatial frequency map, and fy represents the vertical spatial frequency map. Mean is the operation of taking the average value of all pixels in the image.

[0081] In this embodiment, the spatial frequency is calculated as the spatial frequency of discrete pixels in a digital image. As a definition of the spatial frequency of a continuous signal in optical imaging, the larger the value, the clearer the details.

[0082] Furthermore, in one embodiment, based on the above step S230, the specific content of the image frame is obtained as follows:

[0083] Based on the obtained spatial frequency, a target image frame is selected from the corrected image frames. Then, an image frame corresponding to the target image frame is selected from the corrected image frames as a sample frame. Finally, the final image is selected as the output result by combining the spatial frequency difference between the sample frame and the target image frame. This includes:

[0084] S330: Arrange the corrected image frames in descending order of spatial frequency, and select the first N image frames as the target image frames;

[0085] S430, Select the image frame corresponding to the target image frame from the corrected image frames as the sample frame;

[0086] S530, calculate the spatial frequency difference between the target image frame and the sample frame for each image frame, and select the target image frame corresponding to the spatial frequency difference as the final image; where N is a positive integer.

[0087] In practice, after obtaining the spatial frequency of the corrected image frame based on the aforementioned steps, the modified image frame is sorted in descending order of spatial frequency, and the first N are selected as target image frames. The number of target image frames can be adjusted according to the specific processing capability of the device.

[0088] After acquiring N target image frames with the highest spatial frequencies, it is necessary to further acquire the corresponding unfiltered image frames as sample frames. Since the sample frames are unfiltered, they retain their original blurry characteristics, while the target image frames have undergone filtering and have a clearer display effect compared to the sample frames.

[0089] The spatial frequency of the sample frame is obtained according to the technical solutions of steps S320 and S420 mentioned above. Then, according to the correspondence between the sample frame and the target image frame, the spatial frequency difference is calculated according to Formula 2.

[0090] D = abs(F(H) i )-(I i Formula 2;

[0091] In the formula, D represents the spatial frequency difference, and F(H) i F(I) represents the spatial frequency of the i-th target image frame. i ) represents the spatial frequency of the i-th sample frame, where i is a positive integer.

[0092] After obtaining N spatial frequency differences in sequence, the sample frame corresponding to the smallest spatial frequency difference is selected as the final output image. Since the smaller the spatial frequency difference, the less blurred the image frame itself represents, the less affected the image frame is by jitter, and therefore it can be used as the final image captured by a medical endoscope.

[0093] This embodiment also provides an image processing device for a medical endoscope, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. The terms "module," "unit," "subunit," etc., used below refer to combinations of software and / or hardware that implement a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0094] Figure 4 This is a structural block diagram of the image processing 60 for a medical endoscope in this embodiment, specifically including:

[0095] The image frame acquisition module 61 is used to save image frames before and after the corresponding moment of the photo capture command when a photo capture command is received.

[0096] The spatial frequency calculation module 62 is used to perform frame-by-frame blur correction on the image frame sequence and calculate the spatial frequency of each image frame after correction.

[0097] The result output module 63 is used to select the target image frame from the corrected image frames based on the obtained spatial frequency, select the image frame corresponding to the target image frame from the corrected image frames as the sample frame, and select the final image as the output result by combining the spatial frequency difference between the sample frame and the target image frame.

[0098] The image processing device 80 for medical endoscopes described above reduces the blurriness of image frames by filtering them, and obtains the image frame with the smallest difference from the corrected image frame by calculating the spatial frequency and spatial frequency difference of the image frames. This dual processing effectively reduces the blurriness caused by camera shake during shooting.

[0099] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can reside in the same processor; or the above modules can be located in different processors in any combination.

[0100] This embodiment also provides an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.

[0101] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0102] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0103] S1, When a photo capture command is received, save the image frames before and after the time corresponding to the photo capture command.

[0104] S2, perform frame-by-frame blur correction on the image frame sequence, and calculate the spatial frequency of each image frame after correction;

[0105] S3. Based on the obtained spatial frequency, select the target image frame from the corrected image frames, select the image frame corresponding to the target image frame from the corrected image frames as the sample frame, and select the final image as the output result by combining the spatial frequency difference between the sample frame and the target image frame.

[0106] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated in this embodiment.

[0107] Furthermore, in conjunction with the image processing method for medical endoscopes provided in the above embodiments, this embodiment can also provide a storage medium for implementation. The storage medium stores a computer program; when executed by a processor, the computer program implements any of the image processing methods for medical endoscopes described in the above embodiments.

[0108] It should be understood that the specific embodiments described herein are merely illustrative of the application and not intended to limit it. All other embodiments derived by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application.

[0109] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0110] Obviously, the accompanying drawings are merely some examples or embodiments of this application. Those skilled in the art can apply this application to other similar situations based on these drawings without any creative effort. Furthermore, it is understood that although the work done in this development process may be complex and lengthy, for those skilled in the art, certain design, manufacturing, or production modifications made based on the technical content disclosed in this application are merely conventional technical means and should not be considered as insufficient disclosure of this application.

[0111] The term "embodiment" in this application refers to a specific feature, structure, or characteristic described in connection with an embodiment that may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily imply the same embodiment, nor does it imply that it is mutually exclusive with or independent of other embodiments. It will be clearly or implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments without conflict.

[0112] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of patent protection. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the appended claims.

Claims

1. An image processing method for medical endoscopes, characterized in that, The image processing method includes: Upon receiving a photo-taking command, the image frame sequence before and after the time corresponding to the photo-taking command is saved; The image frame sequence is subjected to frame-by-frame blur correction, and the spatial frequency of each image frame after correction is calculated. Based on the obtained spatial frequency, a target image frame is selected from the corrected image frames. An image frame before correction corresponding to the target image frame is selected from the image frame sequence as a sample frame. The final image as the output result is selected by combining the spatial frequency difference between the sample frame and the target image frame. Upon receiving a photo-taking command, the system saves the sequence of image frames before and after the time corresponding to the photo-taking command, including: During the use of a medical endoscope, image frames captured by the medical endoscope are continuously acquired. The moment the photo-taking command is received is taken as the initial moment, and the time period between the preset duration before the initial moment and the preset duration after the initial moment is taken as the initial time period. An image frame sequence is constructed by selecting image frames from the image frames that correspond to the initial time period; Based on the obtained spatial frequency, a target image frame is selected from the corrected image frames. An uncorrected image frame corresponding to the target image frame is selected from the image frame sequence as a sample frame. The final image, as the output result, is selected by combining the spatial frequency difference between the sample frame and the target image frame. This includes: The corrected image frames are arranged in descending order of spatial frequency, and the first N image frames are selected as the target image frames. Select the image frame before correction corresponding to the target image frame from the image frame sequence as the sample frame; Calculate the spatial frequency difference between the target image frame and the sample frame for each image frame, and select the sample frame with the smallest spatial frequency difference as the final image. Where N is a positive integer.

2. The image processing method for medical endoscopes according to claim 1, characterized in that, The step of performing frame-by-frame blur correction on the image frame sequence and calculating the spatial frequency of each corrected image frame includes: Motion blur correction is performed on each image frame in the image frame sequence using a filter; Calculate the spatial frequency of each image frame after correction.

3. The image processing method for medical endoscopes according to claim 2, characterized in that, The calculation of the spatial frequency of each image frame after correction includes: The prewitt operator is used to perform convolution calculation on each corrected image frame to obtain the horizontal spatial frequency map and the vertical spatial frequency map of each corrected image frame; The spatial frequency of each image frame after correction is calculated based on the horizontal spatial frequency map and the vertical spatial frequency map.

4. The image processing method for medical endoscopes according to claim 3, characterized in that, The step of performing convolution calculations on each corrected image frame using the Prewitt operator to obtain the horizontal and vertical spatial frequency maps of each corrected image frame includes: The first prewitt operator is invoked to perform convolution calculation on each of the corrected image frames to obtain the horizontal spatial frequency distribution matrix, and a horizontal spatial frequency map is constructed based on the horizontal spatial frequency distribution matrix. The second prewitt operator is invoked to perform convolution calculation on each of the corrected image frames to obtain the vertical spatial frequency distribution matrix, and a vertical spatial frequency map is constructed based on the vertical spatial frequency distribution matrix.

5. The image processing method for medical endoscopes according to claim 3, characterized in that, The calculation of the spatial frequency of each corrected image frame based on the horizontal spatial frequency map and the vertical spatial frequency map includes: The spatial frequency of each image frame after correction is calculated based on Formula 1. Formula 1, In the formula, F represents the spatial frequency of the image frame. Represents the horizontal spatial frequency diagram. This represents the vertical spatial frequency map, and Mean is the operation of taking the mean of all pixels in the image.

6. An image processing device for a medical endoscope, characterized in that, include: The image frame acquisition module is used to save the image frame sequence before and after the time corresponding to the photo capture command when a photo capture command is received; The spatial frequency calculation module is used to perform frame-by-frame blur correction on the image frame sequence and calculate the spatial frequency of each image frame after correction. The result output module is used to select a target image frame from the corrected image frames based on the obtained spatial frequency, select an image frame before correction corresponding to the target image frame from the image frame sequence as a sample frame, and select the final image as the output result based on the spatial frequency difference between the sample frame and the target image frame. Upon receiving a photo-taking command, the system saves the sequence of image frames before and after the time corresponding to the photo-taking command, including: During the use of a medical endoscope, image frames captured by the medical endoscope are continuously acquired. The moment the photo-taking command is received is taken as the initial moment, and the time period between the preset duration before the initial moment and the preset duration after the initial moment is taken as the initial time period. An image frame sequence is constructed by selecting image frames from the image frames that correspond to the initial time period; Based on the obtained spatial frequency, a target image frame is selected from the corrected image frames. An image frame before correction corresponding to the target image frame is selected from the image frame sequence as a sample frame. The final image is selected as the output result based on the spatial frequency difference between the sample frame and the target image frame, including: The corrected image frames are arranged in descending order of spatial frequency, and the first N image frames are selected as the target image frames. Select the image frame before correction corresponding to the target image frame from the image frame sequence as the sample frame; Calculate the spatial frequency difference between the target image frame and the sample frame for each image frame, and select the sample frame with the smallest spatial frequency difference as the final image. Where N is a positive integer.

7. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the image processing method for a medical endoscope as described in any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the image processing method for a medical endoscope as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Endoscope image processing method, image platform, computer equipment and medium

    CN114863317A

  • Electronic camera and image processing system

    JP2002258351A