Endoscopic image processing method, device, endoscope and storage medium
Through the definition evaluation and multi-frame weighted fusion processing of endoscopic images, the problem of low image quality in endoscopic technology is solved and high-quality image output is achieved.
Patent Information
- Application Number
- CN202110861542.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-29
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-07-29
AI Technical Summary
The image quality output by existing endoscopic technology is not high, resulting in jitter and unclear images captured during the operation. There is no effective solution yet.
By obtaining the frame image of the target area from the original image encoding data, the clarity is evaluated, a number of frame images that meet the preset frame number threshold are screened out, and multi-frame weighted fusion processing is performed to obtain a high-quality target image.
It achieves the output of high-quality target images, improves the clarity and stability of the image, and solves the problem of low image quality.
Smart Images

Figure CN113763298B
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing, and in particular to an endoscopic image processing method, device, endoscope and storage medium. Background Art
[0002] An endoscope is an optical device that enters the human body through a natural orifice or a small incision made during surgery to observe relevant areas. Endoscopes of different lengths and diameters can be used to detect different areas of the human body. According to the different detection areas, endoscopes can be divided into laparoscopes, neuroendoscopes, arthroscopy, esophagoscopes and other types. Endoscopes are widely used in the detection and treatment of various parts of the human body and are an extremely important medical device in modern medicine.
[0003] Endoscope technology has been developed for decades. The main structure of medical endoscopes is a long hose. Medical workers use the control knob to control the cable inside the hose to control the internal annular parts of the curved part of the endoscope to move up and down, so that its front end can bend. During the operation, the capture button on the handle is used to save the image. There is a problem of jitter causing the captured image to have a ghosting and unclear image. To solve this problem, the current image processing solution is to process the captured image based on block-based gradient calculation, edge detection and other algorithms; however, the image quality output by such algorithms is not high.
[0004] Currently, no effective solution has been proposed for the problem of low output image quality in related technologies. Summary of the invention
[0005] The embodiments of the present application provide an endoscopic image processing method, device, endoscope and storage medium to at least solve the problem of low output image quality in the related art.
[0006] In a first aspect, an embodiment of the present application provides an endoscopic image processing method, comprising:
[0007] Obtaining a target area frame image from the original image encoding data;
[0008] Performing clarity evaluation on the target area frame image to obtain a corresponding clarity value;
[0009] Based on the clarity value, a plurality of target frame images satisfying a preset frame number threshold are screened out from the target area frame images, and a multi-frame weighted fusion process is performed on the plurality of target frame images to obtain a target image.
[0010] In some embodiments, obtaining a target area frame image from the original image encoding data includes:
[0011] Acquire image encoding data of a preset region of interest from original image encoding data;
[0012] Digital image processing is performed on the image coding data of the region of interest to obtain the target region frame image.
[0013] In some embodiments, obtaining the region of interest from the original image encoding data includes:
[0014] Obtaining photosensitive row information from raw image encoding data;
[0015] The original image encoding data is extracted based on the photosensitive row information using a preset image region of interest extraction formula to obtain the region of interest.
[0016] In some embodiments, the step of performing digital image processing on the image encoding data of the region of interest to obtain the target region frame image includes:
[0017] Performing basic digital image processing on the image coding data of the region of interest to obtain an image of the region of interest;
[0018] The region of interest image and the preprocessed region of non-interest image are center-aligned and fused to obtain the target region frame image.
[0019] In some embodiments, before evaluating the clarity of the target area frame image, the method further includes:
[0020] Determine the data type of the target area frame image;
[0021] If the data type of the target area frame image is an RGB data type, the target area frame image of the RGB data type is converted into the target area frame image of the YUV data type by using a first conversion formula.
[0022] In some embodiments, the step of evaluating the clarity of the target area frame image to obtain a corresponding clarity value includes:
[0023] Determine the brightness sum of the target area frame image of the YUV data type based on a preset sampling value by using an accumulation formula;
[0024] Determine the brightness average value of the target area frame image according to the preset sampling value and the brightness sum;
[0025] The definition value of the target area frame image is determined based on the brightness average value by using a standardized formula.
[0026] In some embodiments, the step of selecting a plurality of target frame images that meet a preset frame number threshold from the target area frame images based on the clarity value includes:
[0027] Based on the clarity value, the frame images in the target area are sorted by clarity, and target frame images of several frames that meet a preset frame number threshold in the clarity sorting result are screened out.
[0028] In some embodiments, performing multi-frame weighted fusion processing on the target frame images of several frames to obtain the target image includes:
[0029] Performing multi-frame weighted fusion processing on a plurality of target frame images using a weighted fusion formula to obtain a fused image;
[0030] The fused image is filled to obtain the target image.
[0031] In some embodiments, the endoscopic image processing method provided by the present application further includes:
[0032] After the fused image is obtained, the fused image is converted into a fused image of RGB data type using a second conversion formula.
[0033] In some embodiments, the endoscopic image processing method provided by the present application further includes:
[0034] After the target area frame image is obtained, a video stream is output in real time based on the target area frame image.
[0035] In a second aspect, an embodiment of the present application provides an endoscopic image processing device, including an acquisition module, an evaluation module, and a fusion module;
[0036] The acquisition module is used to acquire the target area frame image from the original image encoding data;
[0037] The evaluation module is used to evaluate the clarity of the target area frame image using a clarity algorithm to obtain a clarity value of the target area frame image;
[0038] The fusion module is used to screen out several frames of target frame images that meet a preset frame number threshold from the target area frame images based on the clarity value, and perform multi-frame weighted fusion processing on the several frames of the target frame images to obtain a target image.
[0039] In a third aspect, an embodiment of the present application provides an endoscope, whose image display system includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the endoscope image processing method as described in the first aspect above is implemented.
[0040] In a fourth aspect, an embodiment of the present application provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the endoscopic image processing method as described in the first aspect above.
[0041] Compared with the related art, the endoscopic image processing method, device, endoscope and storage medium provided in the embodiments of the present application obtain a target area frame image from the original image encoding data; perform a clarity evaluation on the target area frame image to obtain a corresponding clarity value; based on the clarity value, select a number of target frame images that meet a preset frame number threshold from the target area frame image, and perform multi-frame weighted fusion processing on the target frame images of the several frames to obtain a target image. The present application solves the problem of low output image quality in the related art, and uses clarity values combined with multi-frame weighted fusion processing to achieve the output of high-quality target images.
[0042] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0044] Figure 1 This is a block diagram of part of the hardware structure of an endoscope image display system provided in one embodiment of the present application;
[0045] Figure 2 is a flow chart of an endoscopic image processing method provided by an embodiment of the present application;
[0046] Figure 3 yes Figure 2 Flow chart of step S210;
[0047] Figure 4 is a schematic diagram showing that all regions of interest provided by an embodiment of the present application are within the valid region;
[0048] Figure 5 is a schematic diagram of a portion of a region of interest provided by an embodiment of the present application within a valid region;
[0049] Figure 6 yes Figure 2 Flow chart of step S230;
[0050] Figure 7 It is a structural block diagram of an endoscopic image processing device provided in one embodiment of the present application.
[0051] In the figure: 210, acquisition module; 220, evaluation module; 230, fusion module. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application. In addition, it can also be understood that although the efforts made in this development process may be complex and lengthy, for ordinary technicians in the field related to the contents disclosed in the present application, some changes such as design, manufacturing or production based on the technical contents disclosed in the present application are only conventional technical means, and should not be understood as insufficient contents disclosed in the present application.
[0053] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0054] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantitative limitation, and may represent the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to greater than or equal to two. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships, for example, "A and / or B" can represent: A exists alone, A and B exist at the same time, and B exists alone. The terms "first", "second", "third" and the like involved in the present application are merely used to distinguish similar objects and do not represent a specific ordering of the objects.
[0055] The method embodiment provided in this embodiment can be executed in an endoscope image display system. Taking running on the image display system as an example, Figure 1 FIG. 1 is a hardware structure block diagram of the image display system of the endoscope image processing method according to an embodiment of the present invention. Figure 1 As shown, the image display system may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the image display system may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned image display system. Figure 1 More or fewer components as shown, or with Figure 1 In other embodiments, the method embodiment provided in this embodiment may be executed in a terminal, a computer or a similar computing device.
[0056] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the endoscopic image processing method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the image display system via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0057] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the image display system. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0058] This embodiment provides an endoscope image processing method. Figure 2 is a flowchart of an endoscopic image processing method according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0059] Step S210, obtaining a target area frame image from the original image encoding data;
[0060] Step S220, evaluating the clarity of the target area frame image to obtain a corresponding clarity value;
[0061] Step S230 , based on the clarity value, select a plurality of target frame images that meet a preset frame number threshold from the target area frame images, perform multi-frame weighted fusion processing on the plurality of target frame images, and obtain a target image.
[0062] It should be noted that the raw image coded data (RAW) can be obtained from the medical endoscope image sensor, and the raw image coded data contains the image sensor data information necessary to create a visible image. The target area frame image is the image of each frame in an area, and each frame of the target area frame image is connected and output as the video of the current area. It can be obtained by performing digital image processing (ISP) on the raw image coded data through the built-in software and hardware of the endoscope to reduce the resource requirements of subsequent algorithms. During the use of the medical endoscope, the user often needs to save the current image they see.
[0063] In this embodiment, in order to improve the quality of the saved image and achieve a 4K high-definition image, the clarity of each frame of the target area frame image is evaluated to obtain a clarity value corresponding to each frame. Based on the clarity value, several frames of target frame images that meet the preset frame number threshold are screened out from the target area frame images, and unclear or low-quality target area frame images in the target area frame images are removed, and high-definition target frame images are retained. Then, a multi-frame weighted fusion process is performed on the target frame images of several frames to obtain a high-quality target image. In this embodiment, the multi-frame weighted fusion process can use a weighted average fusion algorithm, a machine learning fusion model, etc., and there is no limitation on this.
[0064] Through the above steps, the problem of low output image quality in the related art is solved, and the output of high-quality target images is achieved by combining the clarity value with multi-frame weighted fusion processing.
[0065] The above steps are described in detail below:
[0066] In one embodiment, if Figure 3 As shown, step S210 includes the following steps:
[0067] Step S211, obtaining image encoding data of a preset region of interest from the original image encoding data;
[0068] Specifically, it includes: obtaining photosensitive line information from the original image coding data; using a preset image region of interest extraction formula, extracting the original image coding data based on the photosensitive line information to obtain the region of interest.
[0069] The photosensitive line information is the maximum number of photosensitive line lengths in each frame of original image encoding data. The photosensitive line information in each frame of original image encoding data is obtained, and the image interest extraction formula is used to determine the radius of the region of interest based on the photosensitive line information. The image interest region extraction formula is expressed as:
[0070]
[0071] Wherein, x is the length of the maximum photosensitive line; y represents the maximum line spacing between the maximum photosensitive lines; and a represents the maximum number of photosensitive line lengths.
[0072] like Figure 4 As shown in the figure, it is a schematic diagram that the region of interest is completely within the effective area. The center of the region of interest is the center of the circle, and the maximum number of photosensitive line lengths is 1; then the radius of the region of interest is half of the maximum photosensitive line length. Figure 5 As shown, it is a schematic diagram of the region of interest in the effective area. The maximum number of photosensitive lines is greater than or equal to 2. The maximum line spacing y between the maximum photosensitive lines is calculated, and the length x of the maximum photosensitive line is calculated. The center of the region of interest is also the center of the circle. The radius of the region of interest can be calculated according to the Pythagorean theorem. Then, the original image encoding data is extracted according to the radius of the region of interest to obtain the region of interest.
[0073] Step S212, performing digital image processing on the image coding data of the region of interest to obtain a frame image of the target region.
[0074] Specifically, the method includes: performing basic digital image processing on the image coding data of the region of interest to obtain the image of the region of interest; performing center alignment fusion on the image of the region of interest and the preprocessed image of the region of non-interest to obtain the frame image of the target region.
[0075] Basic digital image processing refers to the process of converting the RAW format to the RGB format or the YUV format. Since basic digital image processing involves a large amount of data and strict real-time requirements, it can be implemented by software and hardware solutions. In this embodiment, the process of basic digital image processing is: AWB white balance is performed on the image encoding data of the region of interest; the image encoding data of the region of interest after white balance is converted into an RGB image using the demosaic algorithm; the color interpolation is performed using the RAW2RGB algorithm, and then the Gamma is used for correction; finally, CCM, CSC color correction and color gamut conversion are performed to obtain the image of the region of interest. In other embodiments, a series of processing modules can be used, which are connected end to end and run at high speed at the same time under the clock drive of several hundred MHz. Data is continuously transferred from one module to the next module until all algorithm processing is completed, and finally the image in YUV or RGB format flows out from the final stage of the pipeline. The difference between digital image processing and basic digital image processing is that basic digital image processing does not involve the center alignment fusion of the image of the region of interest and the image of the non-region of interest.
[0076] The preprocessed image of the non-interest region refers to, after obtaining the image coding data of the area of interest, using the image coding data of the minimum circumscribed rectangular area of the area of interest to remove the image coding data of the area of interest from the image coding data of the minimum circumscribed rectangular area, the image coding data of the area of interest is retained, and the basic digital image processing is performed on the part to obtain the image of the non-interest region. In order to further improve the processing efficiency, the non-interest region can be obtained by preprocessing such as directly filling the pixels of the non-interest region with 0 instead of using basic digital image processing. Then, the image of the area of interest and the image of the non-interest region are fused by center alignment to obtain the frame image of the target region. The center alignment fusion here can be achieved by using the existing image splicing technology, which is not described in detail here.
[0077] Before evaluating the clarity of the target area frame image, if there is no snapshot that needs to output high-quality images, repeat the above steps to output the video stream in real time. If a snapshot occurs, save T consecutive frames of the target area frame image to the cache area for subsequent processing.
[0078] Since there are two types of data types of the target area frame image obtained after digital image processing, one is the RGB data type and the other is the YUV data type. In order to facilitate the processing of target area frame images of different data types, the data type of the target area frame image is determined; if the data type of the target area frame image is the RGB data type, the target area frame image of the RGB data type is converted into the target area frame image of the YUV data type using the first conversion formula. Then, subsequent processing is performed according to step S220 and step S230. If the data type of the target area frame image is the YUV data type, subsequent processing is performed directly according to step S220 and step S230.
[0079] The first conversion formula is expressed as follows:
[0080]
[0081] In the formula, R represents the red channel, G represents the green channel, B represents the blue channel, Y represents brightness, U represents chromaticity, and V represents concentration.
[0082] In this embodiment, step S220 includes the following steps:
[0083] Step S221, using an accumulation formula, based on a preset sampling value, determining the brightness sum of the target area frame image of the YUV data type;
[0084] Step S222, determining the average brightness of the frame image of the target area according to the preset sampling value and brightness sum;
[0085] Step S223, using a standardized formula, the clarity value of the frame image of the target area is determined based on the brightness average value.
[0086] Specifically, the above accumulation formula is:
[0087]
[0088] Where: Y represents brightness; Y sum + indicates the cumulative sum of Y values of all window areas; threshold indicates the brightness threshold; number indicates the number of accumulations; the sampling value is an area of size N*N;
[0089] In this embodiment, for each frame of the target area frame image, the Y value accumulation and Y value of all window areas are calculated from left to right and from top to bottom in a sliding window manner. sum +, and record the cumulative number of times (as in the above cumulative formula). If the cumulative sum of the Y value of the current window is greater than or equal to the brightness threshold (threshold), the current window will not be accumulated and the next window will be continued until the current frame ends. Calculate the average brightness of the current frame Average brightness
[0090] Taking the average brightness as a reference, calculate the sum of the squares of the average brightness differences of all windows participating in calculating the average brightness in the current frame, and then normalize it with the accumulated number of windows number. The standardized clarity value S represents the average degree of image brightness change. The greater the average degree of brightness change, the clearer the image, and the smaller the average degree of brightness change, the blurrier the image, so as to quickly determine the clarity of the frame image in the target area.
[0091] The clarity value S is expressed as follows:
[0092]
[0093] In this embodiment, step S230, as Figure 6 As shown, the following steps are included:
[0094] Step S231 : sorting the frame images of the target area by definition based on the definition values, and selecting target frame images of several frames that meet a preset frame number threshold in the definition sorting results.
[0095] Specifically, there are two forms of clarity sorting, which can be sequential sorting or reverse sorting. If it is sequential sorting, the target frame images that are ranked in front by the frame number threshold M are selected; if it is reverse sorting, the target frame images that are ranked in the back by the frame number threshold M are selected.
[0096] Step S232, performing multi-frame weighted fusion processing on a plurality of target frame images using a weighted fusion formula to obtain a fused image;
[0097] Step S233, filling the fused image to obtain a target image.
[0098] Specifically, the weighted value of each target frame image is first determined using the following formula.
[0099]
[0100] Where W n Represents the weighted value of the nth target frame image; s n It represents the clarity value of the nth target frame image; M represents the frame number threshold, and the target frame image of the Mth frame is selected.
[0101] Then use the weighted fusion formula to perform multi-frame weighted fusion processing on several target frame images. The weighted fusion formula is as follows:
[0102]
[0103]
[0104]
[0105] Where, width represents the width of the M-frame target frame image; height represents the height of the M-frame target frame image; i represents the width of the current frame target frame image; j represents the height of the current frame target frame image; Y i,j Represents the brightness after weighted fusion in the area of width i and height j of M frames; represents the brightness after weighted fusion in the area of width i and height j of the nth frame; U i,j Represents the weighted fusion chrominance in the M frame width i and height j area; V represents the weighted fusion chrominance in the area of width i and height j of the nth frame; i,j represents the concentration after weighted fusion in the area of width i and height j of M frames; It represents the concentration after weighted fusion in the area of width i and height j in the nth frame.
[0106] The above three formulas are used to perform multi-frame weighted fusion processing on the three channels of several target frame images to obtain a fused image. Then the fused image is padded to the current resolution size and filled with 0 on both sides to obtain the target image.
[0107] Since the frame number threshold M is taken from the continuous T-frame target frame images, the content difference between the target frame images is not large, so the corresponding pixel weighted fusion is directly used. If the frame is skipped or the T value is large, there may be a large content difference. Then the SIFT algorithm should be used before the weighted fusion formula to match the corresponding window features, and then the corresponding window weighted fusion can be used, so as to optimize the content difference between the target frame images.
[0108] In order to make the output target image more applicable to a wider range and convenient for users to directly view it, after obtaining the fused image, the following steps are also included:
[0109] The fused image is converted into a fused image of RGB data type using the second conversion formula.
[0110] The second conversion formula is expressed as follows:
[0111]
[0112] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0113] This embodiment also provides an endoscopic image processing device, which is used to implement the above-mentioned embodiments and preferred implementations, and the descriptions that have been made will not be repeated. As used below, the terms "module", "unit", "subunit", etc. can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0114] Figure 7 is a structural block diagram of an endoscope image processing device according to an embodiment of the present application, such as Figure 7 As shown, the device includes: an acquisition module 210, an evaluation module 220 and a fusion module 230;
[0115] The acquisition module 210 is used to acquire the target area frame image from the original image encoding data;
[0116] An evaluation module 220 is used to evaluate the clarity of the target area frame image using a clarity algorithm to obtain a clarity value of the target area frame image;
[0117] The fusion module 230 is used to select a plurality of target frame images that meet a preset frame number threshold from the target area frame images based on the clarity value, and perform multi-frame weighted fusion processing on the plurality of target frame images to obtain the target image.
[0118] By using the above device, the problem of low output image quality in the related art is solved, and the output of high-quality target images is achieved by combining the clarity value with multi-frame weighted fusion processing.
[0119] In one embodiment, the acquisition module 210 is further used to acquire the image encoding data of the preset region of interest from the original image encoding data;
[0120] Digital image processing is performed on the image coding data of the region of interest to obtain a frame image of the target region.
[0121] In one of the embodiments, the endoscope image processing device provided by the present application further includes a judgment module, the judgment module being used to judge the data type of the frame image of the target area;
[0122] If the data type of the target area frame image is an RGB data type, the target area frame image of the RGB data type is converted into a target area frame image of the YUV data type using a first conversion formula.
[0123] In one embodiment, the evaluation module 220 is further used to determine the brightness and the frame image of the target area of the YUV data type based on the preset sampling value by using an accumulation formula;
[0124] Determine the average brightness of the frame image in the target area according to the preset sampling value and brightness sum;
[0125] The clarity value of the frame image in the target area is determined based on the average brightness value using a standardized formula.
[0126] In one embodiment, the fusion module 230 is further used to perform multi-frame weighted fusion processing on a plurality of target frame images using a weighted fusion formula to obtain a fused image;
[0127] The fused image is converted into a fused image of RGB data type using the second conversion formula.
[0128] The fused image is filled to obtain the target image.
[0129] In one of the embodiments, the endoscopic image processing device provided by the present application also includes a video output module, which is used to output a video stream in real time based on the target area frame image after obtaining the target area frame image.
[0130] This embodiment further provides an endoscope, whose image display system includes a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0131] Optionally, the endoscope 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.
[0132] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0133] S1, obtaining a target area frame image from the original image encoding data;
[0134] S2, using a clarity algorithm to evaluate the clarity of the target area frame image, and obtain a clarity value of the target area frame image;
[0135] S3, based on the clarity value, select a plurality of target frame images that meet a preset frame number threshold from the target area frame images, perform multi-frame weighted fusion processing on the plurality of target frame images, and obtain a target image.
[0136] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0137] In addition, in combination with the endoscopic image processing method in the above embodiment, the embodiment of the present application can provide a storage medium for implementation. The storage medium stores a computer program; when the computer program is executed by a processor, any one of the endoscopic image processing methods in the above embodiment is implemented.
[0138] Those skilled in the art should understand that the various technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the various technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0139] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. An endoscopic image processing method, characterized in that: include: Obtaining a target area frame image from the original image encoding data; Performing clarity evaluation on the target area frame image to obtain a corresponding clarity value; Based on the clarity value, a plurality of target frame images satisfying a preset frame number threshold are screened out from the target area frame images, and a multi-frame weighted fusion process is performed on the plurality of target frame images to obtain a target image; The step of performing multi-frame weighted fusion processing on the target frame images of several frames to obtain the target image includes: Performing multi-frame weighted fusion processing on a plurality of target frame images using a weighted fusion formula to obtain a fused image; Filling the fused image to obtain the target image; Among them, the weighted fusion formula is: Where, width represents the width of the M-frame target frame image; height represents the height of the M-frame target frame image; i represents the width of the current frame target frame image; j represents the height of the current frame target frame image; Y i,j Represents the brightness after weighted fusion in the area of width i and height j of M frames; represents the brightness after weighted fusion in the area of width i and height j of the nth frame; U i,j Represents the weighted fusion chrominance in the M frame width i and height j area; V represents the weighted fusion chrominance in the area of width i and height j of the nth frame; i,j represents the concentration after weighted fusion in the area of width i and height j of M frames; represents the concentration after weighted fusion in the area of width i and height j of the nth frame; the weighted value W of the target frame image of the nth frame n The expression is: s n It represents the clarity value of the nth target frame image; M represents the frame number threshold, and the target frame image of the Mth frame is selected.
2. The endoscopic image processing method according to claim 1, characterized in that: The step of obtaining a target area frame image from the original image encoding data comprises: Acquire image encoding data of a preset region of interest from original image encoding data; Digital image processing is performed on the image coding data of the region of interest to obtain the target region frame image.
3. The endoscopic image processing method according to claim 2, characterized in that: The step of obtaining the region of interest from the original image encoding data comprises: Obtaining photosensitive row information from raw image encoding data; The original image encoding data is extracted based on the photosensitive row information using a preset image region of interest extraction formula to obtain the region of interest.
4. The endoscopic image processing method according to claim 2, characterized in that: The step of performing digital image processing on the image coding data of the region of interest to obtain the frame image of the target region includes: Performing basic digital image processing on the image coding data of the region of interest to obtain an image of the region of interest; The region of interest image and the preprocessed region of non-interest image are center-aligned and fused to obtain the target region frame image.
5. The endoscopic image processing method according to claim 1, characterized in that: Before evaluating the clarity of the target area frame image, the method further includes: Determine the data type of the target area frame image; If the data type of the target area frame image is an RGB data type, the target area frame image of the RGB data type is converted into the target area frame image of the YUV data type by using a first conversion formula.
6. The endoscopic image processing method according to claim 5, characterized in that: The step of evaluating the clarity of the target area frame image to obtain a corresponding clarity value includes: Determine the brightness sum of the target area frame image of the YUV data type based on a preset sampling value by using an accumulation formula; The cumulative formula is: Where: Y represents brightness; Y sum + indicates the cumulative sum of Y values of all window areas; threshold indicates the brightness threshold; number indicates the number of accumulations; the sampling value is an area of size N*N; Determine the brightness average value of the target area frame image according to the preset sampling value and the brightness sum; Determine the clarity value of the frame image of the target area based on the brightness average value by using a standardized formula; The normalization formula is: In the formula, S represents the standardized clarity; Indicates the average brightness of the current frame.
7. The endoscopic image processing method according to claim 1, characterized in that: The step of selecting a plurality of target frame images that meet a preset frame number threshold from the target area frame images based on the clarity value includes: Based on the clarity value, the frame images in the target area are sorted by clarity, and target frame images of several frames that meet a preset frame number threshold in the clarity sorting result are screened out.
8. The endoscopic image processing method according to claim 1, characterized in that: Also includes: After the fused image is obtained, the fused image is converted into a fused image of RGB data type using a second conversion formula.
9. The endoscopic image processing method according to claim 1, characterized in that: Also includes: After the target area frame image is obtained, a video stream is output in real time based on the target area frame image.
10. An endoscope image processing device, characterized in that: It includes acquisition module, evaluation module and fusion module; The acquisition module is used to acquire the target area frame image from the original image encoding data; The evaluation module is used to evaluate the clarity of the target area frame image using a clarity algorithm to obtain a clarity value of the target area frame image; The fusion module is used to screen out a plurality of target frame images that meet a preset frame number threshold from the target area frame images based on the clarity value, and perform multi-frame weighted fusion processing on the plurality of target frame images to obtain a target image; The fusion module is further used to perform multi-frame weighted fusion processing on the target frame images using a weighted fusion formula to obtain a fused image; Filling the fused image to obtain the target image; Among them, the weighted fusion formula is: Where, width represents the width of the M-frame target frame image; height represents the height of the M-frame target frame image; i represents the width of the current frame target frame image; j represents the height of the current frame target frame image; Y i,j Represents the brightness after weighted fusion in the area of width i and height j of M frames; represents the brightness after weighted fusion in the area of width i and height j of the nth frame; U i,j Represents the weighted fusion chrominance in the M frame width i and height j area; V represents the weighted fusion chrominance in the area of width i and height j of the nth frame; i,j represents the concentration after weighted fusion in the area of width i and height j of M frames; represents the concentration after weighted fusion in the area of width i and height j of the nth frame; the weighted value W of the target frame image of the nth frame n The expression is: s n It represents the clarity value of the nth target frame image; M represents the frame number threshold, and the target frame image of the Mth frame is selected.
11. An endoscope, wherein the image display system comprises a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the endoscopic image processing method according to any one of claims 1 to 9.
12. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the endoscopic image processing method according to any one of claims 1 to 9 when executed.
