Capsule endoscope dirt detection method and device
By multiplying the brightness value of the continuous images taken by the capsule endoscope, the problem of dirt on the lens affecting imaging is solved, and rapid and accurate dirt detection and image quality improvement are achieved.
Patent Information
- Application Number
- CN202210063442.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-20
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2042-01-20
AI Technical Summary
During the digestive tract detection process of capsule endoscopes, the dirty adhered to the lens will affect imaging, resulting in visual occlusion and image quality degradation.
By multiplying the brightness values of multiple consecutive original images taken by the capsule endoscope, we will judge whether there is dirt on the lens based on the multiplication results. The method includes acquiring N consecutive original images, calculating the brightness values of each pixel block, multiplying them to generate a detection image, and determining whether there is dirt based on the detection image.
This method can quickly and effectively detect dirt on the capsule endoscope lens, improve the quality of image acquisition, and ensure the accuracy of detection results.
Smart Images

Figure CN114390225B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical devices, and in particular to a capsule endoscope dirt detection method and device. Background Art
[0002] As a medical device for gastrointestinal examination, capsule endoscope is small in size, easy to operate, and can flexibly collect images. It is simple to operate, easy to use, and has accurate test results. It eliminates the pain that traditional intubation endoscopes bring to people during gastrointestinal examinations.
[0003] When the capsule endoscope is inspecting in the digestive tract (such as the stomach), it takes pictures of the inner wall of the digestive tract to obtain a large number of pictures, which are processed and transmitted to an external workstation (such as a computer), and the corresponding pictures are displayed on the workstation.
[0004] However, during the detection process, the lens of the capsule endoscope will inevitably come into contact with some colored dirt (such as saliva, bile, etc.). When these dirt adhere to the lens of the capsule endoscope, the pictures taken by the capsule endoscope will also include these dirt. These dirt will cause the imaging area to be blocked, affecting the shooting field of view, so that the final capsule endoscope image cannot truly reflect the condition of the digestive tract. Summary of the invention
[0005] In view of the above problems, the purpose of the present invention is to provide a capsule endoscope dirt detection method and device, which multiplies the brightness values of multiple consecutive original images taken by the capsule endoscope and judges whether there is dirt on the lens of the capsule endoscope based on the multiplication result. The method is simple and easy to implement, and the dirt judgment effect is obvious.
[0006] According to one aspect of the present invention, a capsule endoscope dirt detection method is provided, the method comprising: acquiring N consecutive original images taken by the capsule endoscope, wherein N≥2, each original image comprises a plurality of pixel blocks, and the plurality of pixel blocks comprises at least one pixel; calculating the brightness value of each pixel block in the N consecutive original images; multiplying the brightness values of each pixel block in the N original images and normalizing them to generate a detection image; and judging whether there is dirt on the capsule endoscope according to the detection image.
[0007] Preferably, when the pixel block includes one pixel, the brightness value of the pixel block is the brightness value of the pixel.
[0008] Preferably, when the pixel block includes a plurality of pixels, the brightness value of the pixel block is an average brightness value of the plurality of pixels.
[0009] Preferably, when the pixel block includes a plurality of pixels, the brightness value of the pixel block is the brightness value of a pixel at a corresponding position among the plurality of pixels.
[0010] Preferably, judging whether there is dirt on the capsule endoscope according to the detection image includes: comparing the brightness value of each pixel block in the detection image with a brightness threshold; when the brightness value of the pixel block is less than the brightness threshold, judging the pixel block to be a non-dirty block; when the brightness value of the pixel block is greater than the brightness threshold, judging the pixel block to be a dirty block.
[0011] Preferably, the dirt detection method further comprises: forming a non-dirty area according to the positions corresponding to the non-dirty blocks; and forming a dirty area according to the positions corresponding to the dirty blocks.
[0012] Preferably, the dirt detection method further comprises: marking the dirty area in the original image according to the dirty area in the detection image.
[0013] Preferably, the dirt detection method further comprises: assigning brightness values of corresponding colors to pixel blocks at positions corresponding to the dirt area.
[0014] Preferably, the brightness value is a brightness value in an RGB space or a brightness value in a YUV space.
[0015] Preferably, the brightness value Y=α*R+β*G+γ*B, wherein α, β, and γ are all real numbers not less than 0. .
[0016] Preferably, the dirt detection method further comprises: when dirt exists on the capsule endoscope, removing the dirt by friction movement between the capsule endoscope and a contact wall.
[0017] Preferably, the N original images are images taken continuously by a capsule endoscope.
[0018] According to another aspect of the present invention, there is provided a capsule endoscope dirt detection device, comprising: an acquisition module, used to acquire N consecutive original images taken by the capsule endoscope, wherein N≥2, each original image includes multiple pixel blocks, and each pixel block includes at least one pixel; a brightness calculation module, used to calculate the brightness value of each pixel block in the N consecutive original images; a detection image generation module, used to multiply the brightness values of each pixel block in the N original images and normalize them to generate a detection image; and a judgment module, used to judge whether there is dirt on the capsule endoscope according to the detection image.
[0019] Preferably, when the pixel block includes one pixel, the brightness value of the pixel block is the brightness value of the pixel.
[0020] Preferably, when the pixel block includes a plurality of pixels, the brightness value of the pixel block is an average brightness value of the plurality of pixels.
[0021] Preferably, when the pixel block includes a plurality of pixels, the brightness value of the pixel block is the brightness value of a pixel at a corresponding position among the plurality of pixels.
[0022] Preferably, the judgment module includes: a comparison unit, used to compare the brightness value of each pixel block in the detection image with a brightness threshold; a judgment unit, used to judge that the pixel block is a non-dirty block when the brightness value of the pixel block is less than the brightness threshold; and judge that the pixel block is a dirty block when the brightness value of the pixel block is greater than the brightness threshold.
[0023] Preferably, the dirt detection device further comprises: a dividing module, configured to form a non-dirty area according to the positions corresponding to the non-dirty blocks; and to form a dirty area according to the positions corresponding to the dirty blocks.
[0024] Preferably, the dirt detection device further comprises: an identification module, configured to identify the dirty area in the original image according to the dirty area in the detection image.
[0025] Preferably, the identification module is further used to assign brightness values of corresponding colors to pixel blocks at positions corresponding to the dirty area.
[0026] Preferably, the brightness value is a brightness value in an RGB space or a brightness value in a YUV space.
[0027] Preferably, the brightness value is the brightness value of any color channel among the red channel, the green channel and the blue channel in the RGB space.
[0028] Preferably, the dirt detection device further comprises: a dirt removal module, which is used to remove the dirt by friction movement between the capsule endoscope and the contact wall when dirt is present on the capsule endoscope.
[0029] Preferably, the N original images are images taken continuously by a capsule endoscope.
[0030] The capsule endoscope dirt detection method and device of the embodiment of the present invention multiplies the brightness values of multiple original images taken by the capsule endoscope, and determines whether there is dirt on the lens of the capsule endoscope according to the multiplication result, which is convenient and efficient.
[0031] Furthermore, the present invention can be used for dirt judgment in real-time detection to avoid dirt from going undetected, facilitate image acquisition by operators, and improve the quality of image acquisition.
[0032] Furthermore, the product of the brightness values of different image pixel blocks is used to determine the dirty area, which reduces the amount of calculation and improves the operation speed.
[0033] Furthermore, by multiplying the brightness values for judgment, the dirtiness judgment effect is obvious and the doctor can observe it clearly at a glance.
[0034] Furthermore, the dirty areas are marked to facilitate the doctor's observation.
[0035] Furthermore, dirt is removed by friction between the capsule endoscope and the contact wall, thereby improving the image quality of the capsule endoscope image. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The above and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:
[0037] Figure 1 A flow chart showing a method for detecting contamination in a capsule endoscope according to an embodiment of the present invention is shown;
[0038] Figure 2a-2e N consecutive original images taken by the capsule endoscope according to the embodiment of the present invention are respectively shown;
[0039] Figure 3 shows a detection image after the brightness values of N original images are multiplied according to an embodiment of the present invention;
[0040] Figure 4 Show Figure 1 Flowchart of step 204;
[0041] Figure 5 A schematic structural diagram of a capsule endoscope dirt detection device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0042] Various embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. In each of the accompanying drawings, the same elements are represented by the same or similar reference numerals. For the sake of clarity, the various parts in the accompanying drawings are not drawn to scale.
[0043] The specific implementation of the present invention is further described in detail below in conjunction with the drawings and examples.
[0044] The present invention provides a capsule endoscope dirt detection method. After the capsule endoscope enters the target area, it starts to take pictures. If there are foreign objects in the target area, especially colored dirt, they may be attached to the optical path of the lens to collect images and affect the shooting, and form corresponding dirt on the collected images. The target area can be a cavity or a pipe, such as the stomach, digestive tract and other parts of the human body; or the target area can also be a corresponding digestive tract model, such as a stomach model.
[0045] Figure 1 FIG. 2 is a flow chart showing a method for detecting contamination in a capsule endoscope according to an embodiment of the present invention. Figure 1 As shown, the capsule endoscope dirt detection method specifically includes the following steps.
[0046] In step 201, N consecutive original images taken by a capsule endoscope are acquired, where N≥2.
[0047] In the present embodiment, the original image obtained is an RGB image, and each original image includes a plurality of pixel blocks, and each pixel block includes at least one pixel. It should be noted that the pixel blocks of different original images are divided in the same manner. For example, each pixel block divided in one of the original images includes 4 pixels, and the 4 pixels are arranged in a 2*2 array, and the pixel blocks of the remaining original images are also divided in this manner. In some embodiments, some pixel blocks divided in one of the original images include 4 pixels, some pixel blocks include 6 pixel blocks, and the pixel blocks of 4 pixels are arranged in a 2*2 array, and the pixel blocks of 6 pixels are arranged in a 2*3 array, and the pixel blocks of the remaining original images are also divided in this manner.
[0048] In one embodiment of the present invention, each pixel block includes only one pixel, but the present invention is not limited thereto. When each pixel block includes only one pixel, the capsule endoscope dirt detection device of the present invention substantially processes the pixels of the original image one by one, thereby improving the accuracy of identifying dirty pixels (i.e., dirty pixel blocks), and can effectively identify small-sized dirt.
[0049] It is worth mentioning that, in the embodiment of the present invention, the N original images taken continuously are not limited to those taken continuously in time, but also include N original images taken continuously in space, that is, N original images located around the target area. In one embodiment, the N continuous original images are preferably N original pictures taken continuously by the capsule endoscope during the acquisition process, so as to reduce the error of the original images and accurately detect dirt. In other embodiments of the present invention, the N continuous images can also be N images taken by the same device for the target area, and the N images can be images taken discontinuously. In one embodiment, the capsule endoscope takes a plurality of (greater than N) images continuously in the target area. If the image is missing during the transmission process and N images can be obtained, the dirt identification can still be successfully performed according to the method. In another embodiment, the N images can be selected (for example, selected at intervals) from a plurality of (greater than N) images taken continuously in accordance with a predetermined method, and dirt identification is performed based on these images.
[0050] Preferably, the captured N consecutive original images are N consecutive original images captured by the capsule endoscope for the same target area; for example, they are N consecutive original images acquired by the capsule endoscope in different postures.
[0051] This embodiment can use N consecutive original images during the capsule endoscope detection process to instantly detect whether there is dirt in the image, so as to avoid the dirt not being found and affecting the detection accuracy, thereby facilitating the operator to perform high-quality image acquisition. That is, in the embodiment of the present invention, the capsule endoscope can perform dirt detection while acquiring the original image, indicating that the dirt detection is instantaneous, thereby minimizing the impact of dirt on image acquisition.
[0052] The following embodiments take N=5 as an example to illustrate the capsule endoscope dirt detection method and device of the present invention, but the number N of original images is not limited thereto. Figure 2a-2e Five original images are shown.
[0053] In step 202, the brightness value of each pixel block in N consecutive original images is calculated.
[0054] In this embodiment, the brightness value of the pixel block is the brightness value of the pixels in the pixel block.
[0055] The brightness value is a brightness value in an RGB space or a brightness value in a YUV space, but is not limited thereto.
[0056] In a preferred embodiment, the brightness value is the brightness value of any color channel among the red channel R, the green channel G, and the blue channel B in the RGB space.
[0057] The relationship between the brightness value Y of the image and each color channel of the image (i.e., red channel R, green channel G, blue channel B) is as follows:
[0058] Y=α*R+β*G+γ*B, where α, β, and γ are all real numbers not less than 0, and α≥0; β≥0; and γ≥0.
[0059] Obviously, when α=1, β=0, γ=0, Y=R, that is, Y is the brightness value of the red channel; when β=1, α=0, γ=0, Y=G, that is, Y is the brightness value of the green channel; when γ=1, α=0, β=0, Y=B, that is, Y is the brightness value of the blue channel; when α=0.2989, β=0.5870, γ=0.1140, that is, Y is the brightness value of the YUV space. The same is true for other brightness values Y.
[0060] In this embodiment, the brightness values of each pixel block in each original image form a rectangular array. N original images form N rectangular arrays according to the brightness values of each pixel block and the position of the pixel block, that is, P1 , P 2 , P 3 , P 4 ..., P N It should be noted that, since the pixel blocks of the N original images are divided in the same way, the number of rows and columns of the rectangular array corresponding to each original image is the same. Furthermore, the brightness values of the pixel blocks at the same position (for example, the mth row and the nth column in each original image) in the consecutive N original images are P and 1 (m,n),P 2 (m,n),P 3 (m,n),P 4 (m,n), ..., P N (m,n).
[0061] In step 203, the brightness values of each pixel block in the N original images are multiplied and normalized to generate a detection image.
[0062] In this embodiment, the brightness values of each pixel block in the N original images are multiplied and normalized to obtain a corresponding brightness value array P, thereby generating a detection image, see Figure 3 , where the brightness value P(m,n) of the pixel block at the corresponding position in the detection image is:
[0063] P(m,n)=P 1 (m,n)*P 2 (m,n)*P 3 (m,n)*P 4 (m,n)*……*P N (m,n).
[0064] In step 204, it is determined whether there is dirt on the capsule endoscope based on the detection image.
[0065] In this embodiment, step 204 includes the following steps: Figure 4 As shown, in step 2041, the brightness value of each pixel block in the detection image is compared with the brightness threshold T: in step 2042, when the brightness value P(m,n) of the pixel block is less than the brightness threshold T, the pixel block is determined to be a non-dirty block. In step 2043, when the brightness value P(m,n) of the pixel block is greater than the brightness threshold T, the pixel block is determined to be a dirty block.
[0066] Since colored dirt will show stable reflective characteristics during the imaging process, and after the dirt adheres to the front shell of the capsule endoscope, the relative position between the dirt and the image sensor of the capsule endoscope will no longer change, therefore, when observing several original images (N=5), the brightness of the image in the dirty area (or the intensity of a certain color channel) will remain bright, and will not change significantly (brightness disappears) with the movement of the capsule endoscope. For the non-dirty area, the observation area of the capsule endoscope changes continuously with the movement or deflection of the capsule endoscope, causing the brightness value of the non-dirty area to change with the change of the observation area.
[0067] Therefore, after the above brightness value multiplication and normalization, the dirty area still retains the brightness value; for the non-dirty area, it is difficult to maintain a consistent brightness value due to the movement of the capsule, and the result of multiplying and normalizing N images is 0. Figure 3 As shown, the black area is a non-dirty area, and the non-black area with brightness value is a dirty area. In this embodiment, when the number of images N=5, the brightness threshold T is 0-0.2, and the brightness threshold is preferably T=0.1. It should be noted that the selection of the brightness threshold T of the capsule endoscope in the present invention is related to the number of images N.
[0068] In a preferred embodiment, the capsule endoscope dirt detection method further includes step 205 .
[0069] In step 205, when dirt is found on the capsule endoscope, a removal instruction is sent to the capsule endoscope to control the movement of the capsule endoscope.
[0070] In this embodiment, after the dirty area is determined on the image, the capsule endoscope can move according to the removal instruction, such as rubbing against the contact wall, moving the capsule endoscope up and down, etc., so as to remove the dirt.
[0071] In a preferred embodiment, step 206 and step 207 are also included.
[0072] In step 206, a non-dirty area is formed according to the positions corresponding to the non-dirty blocks; and a dirty area is formed according to the positions corresponding to the dirty blocks.
[0073] In this embodiment, all pixel blocks in the original image are traversed to divide the boundaries between non-dirty blocks and dirty blocks, thereby forming non-dirty areas and dirty areas.
[0074] In step 207, the dirty area is identified in the original image according to the dirty area in the detection image.
[0075] In this embodiment, a color that is obviously contrasted with the original image can be used to mark the dirty area on the original image for the convenience of observation by the user. Specifically, during the process of real-time image acquisition by the capsule endoscope, after determining that dirt appears in the shooting field of view of the capsule endoscope based on the acquired image, the newly acquired image can be processed. For example, in the newly acquired original image, the pixel points in the dirty block of the dirty area are assigned values, so that the dirty area and the non-dirty area show a stronger contrast, thereby conveying the information that dirt appears in the field of view to the user. More specifically, during the process of digestive tract detection, since the acquired images are generally red, flesh-colored or black, etc., green or the like can be used to mark the dirty area.
[0076] In the capsule endoscope dirt detection method of this embodiment, the brightness values of corresponding pixel points in a plurality of consecutive original images taken by the capsule endoscope are multiplied, and whether there is dirt on the lens of the capsule endoscope is determined based on the multiplication result. The capsule endoscope dirt detection method of the embodiment of the present invention can quickly and efficiently detect whether there is dirt on the capsule endoscope.
[0077] The contamination detection method of the capsule endoscope of the embodiment of the present invention uses brightness value multiplication for judgment, and the contamination judgment effect is obvious. Moreover, the contamination area in the image can be marked according to the processing result, so that the approximate position of the contamination on the capsule endoscope can be intuitively obtained, so that the operator can control the capsule endoscope to perform the contamination removal operation and improve the image quality.
[0078] Figure 5 FIG. 2 is a schematic diagram showing the structure of a capsule endoscope dirt detection device according to an embodiment of the present invention. Figure 5 As shown, the capsule endoscope dirt detection device includes an acquisition module 610 , a brightness calculation module 620 , a detection image generation module 630 and a judgment module 640 .
[0079] The acquisition module 610 is used to acquire N original images taken by the capsule endoscope, where N≥2, and each original image includes a plurality of pixel blocks.
[0080] In this embodiment, after the capsule endoscope enters the target area, it starts to take pictures. If there is foreign matter or other dirt in the target area, it may adhere to the optical path of the lens to collect images and affect the shooting, and form corresponding dirt on the collected images. The target area can be a cavity or a pipe, such as the stomach, digestive tract and other parts of the human body; or the target area can also be a corresponding digestive tract model, such as a stomach model.
[0081] The original image is an RGB image, and each original image includes a plurality of pixel blocks, and each pixel block includes at least one pixel. It should be noted that the division of the pixel blocks of different original images is the same. For example, each pixel block divided in one of the original images includes 4 pixels, and the 4 pixels are arranged in a 2*2 array, and the pixel blocks of the remaining original images are also divided in this way. Or part of the pixel blocks divided in one of the original images include 4 pixels, part of the pixel blocks include 6 pixel blocks, and the pixel blocks of 4 pixels are arranged in a 2*2 array, and the pixel blocks of 6 pixels are arranged in a 2*3 array, and the pixel blocks of the remaining original images are also divided in this way.
[0082] In the case where the original image contains a large number of pixels, if each pixel block includes only one pixel, it will result in a large amount of calculation, which will greatly reduce the speed of dirt detection. In order to ensure the speed of dirt detection, in a preferred embodiment, each pixel block includes multiple pixels, taking 10*10 pixels as an example, but not limited to this. For the case where the number of pixels contained in each pixel block is greater than 1, the average brightness value of multiple pixels in the pixel block can be used as the brightness value of the pixel block. Alternatively, the brightness value of the pixel corresponding to a certain position in the pixel block is used as the brightness value of the pixel block, for example, the brightness value of the pixel of the first pixel point in each pixel block is used as the brightness value of the pixel block. It should be noted that the brightness value of the corresponding pixel blocks in different original images is the brightness value of the pixel point at the same position in the corresponding pixel block.
[0083] Since a pixel block includes a large number of pixels, the number of pixel blocks included in each original image will become smaller, thereby reducing the amount of calculation and improving the speed of dirt detection.
[0084] It is worth mentioning that in the embodiment of the present invention, the N consecutive original images are preferably N original images taken continuously by the capsule endoscope during the acquisition process, so as to reduce the error of the original images and accurately detect dirt. In other embodiments of the present invention, the N consecutive images can also be N images collected non-continuously by the same device for the target area in a short period of time.
[0085] This embodiment uses N original images taken continuously to detect dirt in the image in real time, so as to avoid undetected dirt, facilitate image acquisition by operators, and improve the quality of image acquisition. The capsule endoscope can simultaneously acquire the original image and detect dirt, so that the dirt detection is instantaneous.
[0086] In this embodiment, each pixel block includes only one pixel, but the invention is not limited thereto. When each pixel block includes only one pixel, the processing accuracy is higher and the accuracy of distinguishing dirt is higher.
[0087] In a preferred embodiment, the N original images are images taken continuously by a capsule endoscope.
[0088] The following embodiments are described by taking N=5 as an example, but the number of original images is not limited thereto. Figure 2a-2e Five original images are shown.
[0089] The brightness calculation module 620 is used to calculate the brightness value of each pixel block in N consecutive original images.
[0090] In this embodiment, the brightness value is a brightness value in an RGB space or a brightness value in a YUV space, but is not limited thereto.
[0091] In a preferred embodiment, the brightness value is the brightness value of any color channel among the red channel R, the green channel G, and the blue channel B in the RGB space.
[0092] The relationship between the brightness value Y of the image and each color channel of the image (i.e., red channel R, green channel G, blue channel B) is as follows:
[0093] Y=α*R+β*G+γ*B, where α, β, and γ are all real numbers not less than 0, and α≥0; β≥0; and γ≥0.
[0094] Obviously, when α=1, β=0, γ=0, Y=R, that is, Y is the brightness value of the red channel; when β=1, α=0, γ=0, Y=G, that is, Y is the brightness value of the green channel; when γ=1, α=0, β=0, Y=B, that is, Y is the brightness value of the blue channel; when α=0.2989, β=0.5870, γ=0.1140, that is, Y is the brightness value of the YUV space, and the same applies to other brightness values Y.
[0095] In this embodiment, the brightness values of each pixel block in each original image form a rectangular array. N original images form N rectangular arrays according to the brightness values of each pixel block and the position of the pixel block, that is, P 1 , P 2 , P 3 , P 4 ..., P N It should be noted that, since the pixel blocks of the N original images are divided in the same way, the number of rows and columns of the rectangular array corresponding to each original image is the same. Furthermore, the brightness values of the pixel blocks at the same position (for example, the mth row and the nth column in each original image) in the consecutive N original images are P and 1 (m,n),P 2 (m,n),P 3 (m,n),P 4 (m,n), ..., P N (m,n).
[0096] The detection image generation module 630 is used to multiply the brightness values of each pixel block in the N original images and perform normalization processing to generate a detection image.
[0097] In this embodiment, the brightness values of each pixel block in the N original images are multiplied and normalized to obtain a corresponding brightness value array P, thereby generating a detection image, see Figure 3 , where the brightness value P(m,n) of a pixel block at a certain position in the detected image is:
[0098] P(m,n)=P 1 (m,n)*P 2 (m,n)*P 3 (m,n)*P 4 (m,n)*……*P N (m,n).
[0099] The judgment module 640 is used to judge whether there is dirt on the capsule endoscope according to the detection image.
[0100] In this embodiment, the judgment module 640 includes a comparison unit 641 and a judgment unit 642, wherein the comparison unit 641 is used to compare the brightness value of each pixel block in the detection image with the brightness threshold T; the judgment unit 642 is used to judge that the pixel block is a non-dirty block when the brightness value of the pixel block is less than the brightness threshold T; and when the brightness value of the pixel block is greater than the brightness threshold T, judge that the pixel block is a dirty block.
[0101] Since dirt (especially colored dirt) will show stable reflective characteristics during the imaging process, when observing N consecutive original images (for example, N=5), the brightness of the dirty area (or the intensity of a certain color channel) corresponding to the dirt in the image will maintain a certain brightness value and will not change significantly with the movement of the capsule endoscope. As for the non-dirty area, as the capsule endoscope moves or deflects, the observation area of the capsule endoscope changes continuously, causing the brightness of the non-dirty area to change with the movement of the observation area.
[0102] Therefore, the dirty area still retains the brightness value during the multiplication and normalization process; in the non-dirty area, it is difficult to maintain a consistent brightness value due to the movement of the capsule, and the result after multiplying and normalizing N images is 0. Figure 3 As shown, the black area is the non-dirty area, and the non-black area with brightness value is the dirty area.
[0103] In a preferred embodiment, the capsule endoscope dirt detection device further includes a dividing module for forming a non-dirty area according to positions corresponding to non-dirty blocks; and forming a dirty area according to positions corresponding to dirty blocks.
[0104] In this embodiment, all pixel blocks in the original image are traversed to divide the boundaries between non-dirty blocks and dirty blocks, thereby forming non-dirty areas and dirty areas.
[0105] In a preferred embodiment, the capsule endoscope dirt detection device further includes a marking module, which is used to mark the dirty area in the original image according to the dirty area in the detection image.
[0106] In this embodiment, the identification module is also used to assign brightness values of corresponding colors to pixel blocks at positions corresponding to the dirty areas. Specifically, the identification module can use a color that has a significant contrast with the original image to identify the dirty areas on the original image for easy observation.
[0107] Specifically, the identification module assigns brightness values of corresponding colors to pixel blocks at positions corresponding to the dirty area.
[0108] During the process of real-time image acquisition by the capsule endoscope, after judging that dirt appears in the shooting field of view of the capsule endoscope based on the acquired images, the newly acquired images can be processed. For example, in the newly acquired original images, the pixel points in the dirty blocks in the dirty area are assigned values, so that the dirty area and the non-dirty area show a strong contrast, thereby conveying the information that dirt appears in the field of view to the user. More specifically, during the process of digestive tract detection, since the acquired images are generally red, flesh-colored or black, etc., the dirty area can be marked with green.
[0109] In a preferred embodiment, the capsule endoscope dirt detection device further includes a dirt removal module 650 for sending a removal instruction to the capsule endoscope when dirt is present on the capsule endoscope, thereby controlling the capsule endoscope to perform a dirt removal operation.
[0110] The capsule endoscope dirt detection device of the embodiment of the present invention multiplies the brightness values of multiple consecutive original images taken by the capsule endoscope in the target area and normalizes them to generate a detection image, and judges whether there is dirt on the lens of the capsule endoscope based on the detection image. The capsule endoscope dirt detection device of the embodiment of the present invention can quickly and efficiently detect whether there is dirt on the capsule endoscope. Moreover, the judgment is made by multiplying the brightness values, and the dirt judgment effect is obvious. Furthermore, the dirty area is marked to facilitate the identification of dirt.
[0111] The capsule endoscope dirt detection device of the present invention further comprises a processing unit ( Figure 5Not shown), memory ( Figure 5 ) and a program code of a capsule endoscope dirtiness detection system stored in a memory and executable on a processing unit.
[0112] The memory includes at least one type of readable storage medium, which may be a non-volatile storage medium such as a flash memory, a hard disk, a multimedia card, a card-type memory, etc.
[0113] In some embodiments, the processing unit may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run program codes stored in a memory or process data, such as executing a capsule endoscope dirt detection system program code.
[0114] The embodiment of the present invention also provides a capsule endoscope dirt detection system, which includes an acquisition module, a brightness calculation module, a detection image generation module and a judgment module.
[0115] The acquisition module is used to acquire N original images taken by the capsule endoscope, wherein N≥2, and each original image includes a plurality of pixel blocks.
[0116] The brightness calculation module is used to calculate the brightness value of each pixel block in N original images;
[0117] The detection image generation module is used to multiply the brightness values of each pixel block in N original images and perform normalization processing to generate a detection image;
[0118] The judgment module is used to judge whether there is dirt on the capsule endoscope according to the detection image.
[0119] In this embodiment, the processing module is used to detect whether there is dirt on the lens (transparent front shell) of the capsule endoscope by executing the system.
[0120] The endoscope provided by the present invention, in addition to the components mentioned above, for other specific structures of the endoscope, please refer to the prior art and will not be described here.
[0121] According to the embodiments of the present invention as described above, these embodiments do not describe all the details in detail, nor do they limit the invention to the above specific embodiments. Obviously, many modifications and changes can be made based on the above description. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can make good use of the present invention and the modified use based on the present invention. The present invention is only limited by the claims and their full scope and equivalents.
Claims
1. A capsule endoscope dirt detection method, characterized in that: The method comprises: Acquire N consecutive original images taken by a capsule endoscope, where N≥2, each original image includes a plurality of pixel blocks, and each pixel block includes at least one pixel; Calculating the brightness value of each pixel block in the N original images; Multiply the brightness values of each pixel block in N original images and normalize them to generate a detection image; Judging whether there is dirt on the capsule endoscope according to the detection image, Among them, judging whether there is dirt on the capsule endoscope according to the detection image includes: comparing the brightness value of each pixel block in the detection image with a brightness threshold; when the brightness value of the pixel block is less than the brightness threshold, judging that the pixel block is a non-dirty block; when the brightness value of the pixel block is greater than or equal to the brightness threshold, judging that the pixel block is a dirty block.
2. The dirt detection method according to claim 1, characterized in that: When the pixel block includes one pixel, the brightness value of the pixel block is the brightness value of the pixel.
3. The dirt detection method according to claim 1, characterized in that: When the pixel block includes a plurality of pixels, the brightness value of the pixel block is an average brightness value of the plurality of pixels.
4. The dirt detection method according to claim 1, characterized in that: When the pixel block includes a plurality of pixels, the brightness value of the pixel block is the brightness value of a pixel at a corresponding position among the plurality of pixels.
5. The dirt detection method according to claim 1, characterized in that: Also includes: forming a non-dirty area according to positions corresponding to the non-dirty blocks; forming a dirty area according to the positions corresponding to the dirty blocks; as well as According to the dirty area in the detection image, the dirty area is marked in the original image.
6. The dirt detection method according to claim 5, characterized in that: Also includes: The pixel blocks at the corresponding positions of the dirty area are assigned brightness values of corresponding colors.
7. The dirt detection method according to claim 1, characterized in that: The brightness value is a brightness value in an RGB space or a brightness value in a YUV space.
8. The dirt detection method according to claim 7, characterized in that: The brightness value Y=α*R+β*G+γ*B, where α, β, and γ are all real numbers not less than 0.
9. The dirt detection method according to claim 1, characterized in that: Also includes: When dirt is detected on the capsule endoscope, a removal instruction is sent to the capsule endoscope to control the movement of the capsule endoscope.
10. A capsule endoscope dirt detection device, characterized in that: include: An acquisition module, used for acquiring N consecutive original images taken by a capsule endoscope, wherein N≥2, each of the original images includes a plurality of pixel blocks, and each of the pixel blocks includes at least one pixel; A brightness calculation module, used to calculate the brightness value of each pixel block in the N consecutive original images; A detection image generation module is used to multiply the brightness values of each pixel block in N original images and perform normalization processing to generate a detection image; a judging module, configured to judge whether there is dirt on the capsule endoscope according to the detection image, Among them, judging whether there is dirt on the capsule endoscope according to the detection image includes: comparing the brightness value of each pixel block in the detection image with a brightness threshold; when the brightness value of the pixel block is less than the brightness threshold, judging that the pixel block is a non-dirty block; when the brightness value of the pixel block is greater than or equal to the brightness threshold, judging that the pixel block is a dirty block.
11. The dirt detection device according to claim 10, characterized in that: Also includes: The dirt removal module is used to send a removal instruction to the capsule endoscope when dirt exists on the capsule endoscope, so as to control the movement of the capsule endoscope.
Citation Information
Patent Citations
Image spot detecting method and system
CN104376573A
Method, device and system for detecting a camera module and machine readable storage medium
CN110800294A