CN114184354A - Method and device for detecting optical resolution of capsule endoscope and storage medium - Google Patents

Method and device for detecting optical resolution of capsule endoscope and storage medium Download PDF

Info

Publication number
CN114184354A
CN114184354A CN202111276778.1A CN202111276778A CN114184354A CN 114184354 A CN114184354 A CN 114184354A CN 202111276778 A CN202111276778 A CN 202111276778A CN 114184354 A CN114184354 A CN 114184354A
Authority
CN
China
Prior art keywords
capsule endoscope
image
resolution
detected
current
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111276778.1A
Other languages
Chinese (zh)
Other versions
CN114184354B (en
Inventor
万慧
付维强
王川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Jifu Medical Technology Co ltd
Original Assignee
Shenzhen Jifu Medical Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Jifu Medical Technology Co ltd filed Critical Shenzhen Jifu Medical Technology Co ltd
Priority to CN202111276778.1A priority Critical patent/CN114184354B/en
Publication of CN114184354A publication Critical patent/CN114184354A/en
Application granted granted Critical
Publication of CN114184354B publication Critical patent/CN114184354B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01MTESTING STATIC OR DYNAMIC BALANCE OF MACHINES OR STRUCTURES; TESTING OF STRUCTURES OR APPARATUS, NOT OTHERWISE PROVIDED FOR
    • G01M11/00Testing of optical apparatus; Testing structures by optical methods not otherwise provided for
    • G01M11/02Testing optical properties
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B21/00Measuring arrangements or details thereof, where the measuring technique is not covered by the other groups of this subclass, unspecified or not relevant
    • G01B21/02Measuring arrangements or details thereof, where the measuring technique is not covered by the other groups of this subclass, unspecified or not relevant for measuring length, width, or thickness
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01MTESTING STATIC OR DYNAMIC BALANCE OF MACHINES OR STRUCTURES; TESTING OF STRUCTURES OR APPARATUS, NOT OTHERWISE PROVIDED FOR
    • G01M11/00Testing of optical apparatus; Testing structures by optical methods not otherwise provided for
    • G01M11/02Testing optical properties
    • G01M11/0207Details of measuring devices
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Endoscopes (AREA)

Abstract

The invention discloses a method, a device and a storage medium for detecting the optical resolution of a capsule endoscope, wherein the detection method comprises the following steps: sending a first control instruction to a gripping device so that the gripping device grips the current capsule endoscope to be measured and sends the current capsule endoscope to a first fixed position; sending a second control instruction to the length measuring device so that the length measuring device can measure the length data of the current capsule endoscope to be measured; sending a third control instruction to the gripping device so that the gripping device grips the current capsule endoscope to be tested and sends the current capsule endoscope to a second fixed position; sending a fourth control instruction to the resolution detection component to enable the resolution detection component to move the resolution pattern to the first specified position; receiving a first image of the resolution pattern shot by the current capsule endoscope to be detected; processing the first image to obtain an effective area image; and calculating the point sharpness value of the effective area image to obtain the optical resolution of the current capsule endoscope to be detected, so that the detection efficiency is improved.

Description

Method and device for detecting optical resolution of capsule endoscope and storage medium
Technical Field
The invention relates to the field of machinery, in particular to a method and a device for detecting optical resolution of a capsule endoscope and a storage medium.
Background
The existing optical resolution detection mode of the capsule endoscope is to detect by using a mechanical tool and manual cooperation, and comprises the following specific steps: an operator sits in front of the mechanical tool table, the distance between the capsule endoscope and the resolution image is controlled by manually moving the resolution pattern, the capsule endoscope shoots the image of the resolution pattern, then the image shot by the capsule endoscope is displayed through the display device, and the resolution pattern in the image is identified by human eyes to judge whether the resolution of the capsule endoscope is qualified or not, so that the efficiency is low.
When the capsule endoscope shoots in the alimentary canal, the short distance of the esophagus, the middle-long distance of the stomach and the middle-short distance of the intestinal tract all need to acquire the best clear images, so the capsule endoscope needs to perform resolution detection at different distances, but the existing mechanical tool and the manual matching detection mode have low detection efficiency under the condition of detecting one capsule endoscope for many times, and the manual operation is easy to make mistakes.
Disclosure of Invention
In order to overcome at least one technical problem in the prior art, the invention provides a method, a device and a storage medium for detecting the optical resolution of a capsule endoscope, and aims to realize automatic detection of the optical resolution of the capsule endoscope and improve the detection efficiency.
The embodiment of the invention provides a method for detecting the optical resolution of a capsule endoscope, which comprises the following steps:
s01: sending a first control instruction to a gripping device so that the gripping device grips the current capsule endoscope to be measured and sends the current capsule endoscope to a first fixed position;
s02: sending a second control instruction to a length measuring device so that the length measuring device can measure the length data of the current capsule endoscope to be measured;
s03: receiving the length data;
s04: sending a third control instruction to the gripping device so that the gripping device grips the current capsule endoscope to be detected and sends the current capsule endoscope to a second fixed position;
s05: sending a fourth control instruction to the resolution detection component to enable the resolution detection component to move the resolution pattern to the first specified position;
s06: receiving a first image of the resolution pattern shot by the current capsule endoscope to be detected;
s07: processing the first image to obtain an effective area image;
s08: and calculating the point sharpness value of the effective area image to obtain the optical resolution of the current capsule endoscope to be detected.
In some embodiments, the method further comprises the steps of:
s09: comparing the optical resolution with a first preset threshold to obtain a qualified or unqualified detection result;
s10: when the detection result is qualified, sending a fifth control instruction to the gripping device so that the gripping device grips the current capsule endoscope to be detected and sends the current capsule endoscope to the original position;
s11: and when the detection result is unqualified, sending a sixth control instruction to the gripping device so that the gripping device grips the current capsule endoscope to be detected and sends the current capsule endoscope to an unqualified area.
In some embodiments, the method further comprises the steps of:
s11-1: taking the next capsule endoscope to be tested as the current capsule endoscope to be tested;
and repeating the steps S01 to S11-1 until the optical resolution detection of all the capsule endoscopes to be detected is completed. In some embodiments, the method further comprises the steps of:
s12: sending a seventh control instruction to the resolution detection assembly so that the resolution detection assembly moves the human body environment simulation pattern to a second appointed position;
s13: receiving a second image of the human body environment simulation pattern shot by the current capsule endoscope to be detected;
s14: processing the second image to determine the number of the defect areas;
s15: and comparing the number of the defect areas with a second preset threshold value to obtain a human body environment simulation pattern judgment result.
In some embodiments, the first pointing position is that the current capsule endoscope to be measured is at any distance in the range of 0mm to 100mm from the resolution pattern.
In some embodiments, the step S05 of sending a fourth control instruction to the resolution detecting component to cause the resolution detecting component to move the resolution pattern to the first designated position includes:
and sending the fourth control instruction to the resolution detection assembly so that the resolution detection assembly sequentially moves the resolution pattern to a position 100mm away from the current capsule endoscope to be detected, a position 25mm away from the current capsule endoscope to be detected and a position 0mm away from the current capsule endoscope to be detected. In some embodiments, the step S06 of receiving the first image of the resolution pattern captured by the current capsule endoscope to be tested includes:
s0601: receiving a first sub-image of the resolution pattern shot by the current capsule endoscope to be detected, wherein the first sub-image is an image of the resolution pattern shot by the current capsule endoscope to be detected when the resolution pattern is 100mm away from the current capsule endoscope to be detected;
s0602: receiving a second sub-image of the resolution pattern shot by the current capsule endoscope to be detected, wherein the second sub-image is an image of the resolution pattern shot by the current capsule endoscope to be detected when the resolution pattern is 25mm away from the current capsule endoscope to be detected;
s0603: and receiving a third sub-image of the resolution pattern shot by the current capsule endoscope to be detected, wherein the third sub-image is an image of the resolution pattern shot by the current capsule endoscope to be detected when the resolution pattern is 0mm away from the current capsule endoscope to be detected.
In some embodiments, step S07: processing the first image to obtain an effective area image comprises:
s0701: carrying out segmentation and contour extraction processing on the first image to obtain a plurality of contours;
s0702: screening a plurality of contours according to the fixed characteristic length-width ratio of the feature points to obtain effective contours containing the feature points;
s0703: obtaining an effective test area according to the effective contour containing the characteristic points;
s0704: and determining the area of the line pair in the effective test area according to the relative position relationship between the line pair and the characteristic point to obtain an effective area image.
In some embodiments, step S14 processes the second image, and determining the number of defective regions includes:
s1401: carrying out graying processing on the second image to obtain a grayscale image;
s1402: carrying out top hat transformation on the gray level image to obtain at least one initial defect area;
s1403: performing threshold segmentation on at least one initial defect region to obtain at least one defect region;
s1404: determining the number of the defect areas according to the image pixels of at least one defect area.
In some embodiments, the method further comprises the steps of:
s16: extracting the outline of the defect area to obtain a defect outline;
s17: calculating the perimeter and the area of the defect outline;
s18: determining the circularity of the defect region according to the perimeter and the area of the defect outline;
s19: determining a minimum bounding rectangle of the defect outline;
s20: calculating the aspect ratio of the minimum bounding rectangle;
s21: and determining the category of the defect according to the circularity and the aspect ratio.
The embodiment of the invention provides a device for detecting the optical resolution of a capsule endoscope, which comprises:
the first sending unit is configured to send a first control instruction to the grabbing device so that the grabbing device can grab the current capsule endoscope to be detected and send the current capsule endoscope to a first fixed position;
the second sending unit is configured to send a second control instruction to the length measuring device so that the length measuring device can measure the length data of the current capsule endoscope to be measured;
a first receiving unit configured to receive the length data;
the third sending unit is configured to send a third control instruction to the grasping device so that the grasping device grasps the current capsule endoscope to be detected and sends the current capsule endoscope to a second fixed position;
a fourth sending unit configured to send a fourth control instruction to the resolution detecting component to cause the resolution detecting component to move the resolution pattern to the first specified position;
the second receiving unit is configured to receive a first image of the resolution pattern shot by the current capsule endoscope to be tested;
the first image processing unit is configured to process the first image to obtain an effective area image;
and the optical resolution calculating unit is configured to calculate the point sharpness value of the effective area image to obtain the optical resolution of the capsule endoscope to be measured.
In some embodiments, the detection device further comprises:
a fifth sending unit, configured to send a seventh control instruction to the resolution detection component, so that the resolution detection component moves the human environment simulation pattern to a second designated position;
the third receiving unit is configured to receive a second image of the human body environment simulation pattern shot by the current capsule endoscope to be detected;
a second image processing unit configured to process the second image and determine the number of defective areas;
a second comparison unit: and comparing the number of the defect areas with a second preset threshold value to obtain a human body environment simulation pattern judgment result.
An embodiment of the invention provides a computer-readable storage medium having stored therein at least one instruction, at least one program, set of codes, or set of instructions, which is loaded and executed by the processor to carry out the operations performed in the method of claims 1 to 10.
The invention provides a method, a device and a storage medium for detecting optical resolution of a capsule endoscope, wherein the detection method comprises the steps of sending a first control instruction to a gripping device so that the gripping device grips the capsule endoscope to be detected and sends the capsule endoscope to a first fixed position; sending a second control instruction to a length measuring device so that the length measuring device can measure the length data of the current capsule endoscope to be measured; receiving the length data; sending a third control instruction to the gripping device so that the gripping device grips the current capsule endoscope to be detected and sends the current capsule endoscope to a second fixed position; sending a fourth control instruction to the resolution detection component to enable the resolution detection component to move the resolution pattern to the first specified position; receiving a first image of the resolution pattern shot by the current capsule endoscope to be detected; processing the first image to obtain an effective area image; and calculating the point sharpness value of the effective area image to obtain the optical resolution of the capsule endoscope to be detected. The automatic detection of the optical resolution of the capsule endoscope to be detected is realized, personnel participation is not needed, and the detection efficiency is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the embodiments of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the embodiments of the invention without limiting the embodiments of the invention.
In the drawings:
FIG. 1 is a flowchart of a method for detecting optical resolution of a capsule endoscope according to an embodiment of the present invention;
FIG. 2 is a block diagram of a capsule endoscope optical resolution detection system provided in the Chinese patent application with application number 2021111768626;
FIG. 3 is a perspective view of a length measuring device of a capsule endoscope optical resolution detection system provided in the Chinese patent application with application number 2021111768626;
FIG. 4 is a sectional view of a length measuring device of a capsule endoscope optical resolution detection system provided in the Chinese patent application with application number 2021111768626;
FIG. 5 is a perspective view of a grasping device of a capsule endoscope optical resolution detection system provided in the Chinese patent application with application number 2021111768626;
FIG. 6 is a perspective view of the jaws of a grasping device of a capsule endoscope optical resolution detection system provided in the Chinese patent application with application number 2021111768626;
FIG. 7 is a perspective view of a resolution detection assembly of a capsule endoscope optical resolution detection system as provided in the Chinese patent application Ser. No. 2021111768626;
FIG. 8 is a cross-sectional view of the resolution detection assembly of a capsule endoscope optical resolution detection system provided in the Chinese patent application Ser. No. 2021111768626;
FIG. 9 is another perspective view of a resolution detection assembly of a capsule endoscope optical resolution detection system as provided in the Chinese patent application Ser. No. 2021111768626;
FIG. 10 is a partial cross-sectional view of a resolution detection assembly of a capsule endoscope optical resolution detection system as provided in the Chinese patent application Ser. No. 2021111768626;
FIG. 11 is an exemplary diagram of an initial test area obtained in a method for detecting optical resolution of a capsule endoscope according to an embodiment of the present invention;
FIG. 12 is a schematic diagram of an effective test area obtained by a method for detecting optical resolution of a capsule endoscope according to an embodiment of the present invention;
FIG. 13 is a flow chart of another method for detecting optical resolution of a capsule endoscope according to an embodiment of the present invention;
FIG. 14 is another partial cross-sectional view of a resolution sensing assembly of a capsule endoscope optical resolution sensing system as provided in the Chinese patent application Ser. No. 2021111768626;
fig. 15 is a schematic diagram of an optical resolution detection apparatus of a capsule endoscope according to an embodiment of the present invention.
Description of reference numerals:
the terminal device (01) is connected to the terminal device,
length measuring device 02, mobile platform 0201, length measuring device 0202, first base 0203, first motor 020101, calibration block 020402,
the grabbing device 03, a first shaft 0301, a second shaft 0302, a third shaft 0303, a clamping jaw 0304, a control cabinet 0306, an encoder 0307, a connecting shaft 030401, a capsule endoscope identification sensor 030403, a clamping head 030404 and an electric cylinder 030405,
a resolution detection component 04, a capsule endoscope fixing seat 040101 to be detected, a door 040105, a controller 040106, a first cylinder component 040201, a door coupler 040202, a solenoid valve 040203, a resolution pattern 04010201, a first limit sensor 04010203, a motor 04010205, a screw rod component 04010206, a human environment simulation pattern 04010301 and a second cylinder 04010303,
shelf 05, first tray 0501.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the invention provides a method for detecting the optical resolution of a capsule endoscope, which is used for detecting the optical resolution of the capsule endoscope and the qualified condition of the optical resolution of the capsule endoscope. The application scene of the detection method is the optical resolution detection system of the capsule endoscope, which is described in the Chinese invention patent application number 2021111768626 and named as the optical resolution detection system of the capsule endoscope. It is understood that the program based on the optical resolution detection method of the capsule endoscope is loaded by the terminal device 01 in the detection system and executes the detection method.
In the following embodiments, the main body of execution of the optical resolution detection method of the capsule endoscope is described by taking the terminal device 01 as an example, and the other main bodies of execution related to the detection method refer to the chinese patent application with application number 2021111768626. To facilitate an understanding of the various embodiments of the present invention, the block diagram of the optical resolution detection system of the capsule endoscope in the chinese patent application No. 2021111768626 is incorporated into the drawings of the present application.
Referring to fig. 2-10, the method for detecting optical resolution of a capsule endoscope according to an embodiment of the present invention includes the following steps:
s01: sending a first control instruction to a gripping device 03, so that the gripping device 03 grips the current capsule endoscope to be measured and sends the current capsule endoscope to a first fixed position;
s02: sending a second control instruction to the length measuring device 02 so that the length measuring device 02 measures the length data of the current capsule endoscope to be measured;
s03: receiving the length data;
s04: sending a third control instruction to the gripping device 03, so that the gripping device 03 grips the current capsule endoscope to be measured and sends the current capsule endoscope to a second fixed position;
s05: sending a fourth control instruction to the resolution detection component 04 to enable the resolution detection component to move the resolution pattern to the first specified position;
s06: receiving a first image of the resolution pattern shot by the current capsule endoscope to be detected;
s07: processing the first image to obtain an effective area image;
s08: and calculating the point sharpness value of the effective area image to obtain the optical resolution of the current capsule endoscope to be detected.
Specifically, after receiving an instruction to start detection, the terminal device 01 sends a first control instruction to the gripping device 03, where the first control instruction is an instruction instructing the gripping device 03 to perform a gripping operation, and may directly control the gripping device 03 to grip the current capsule endoscope to be detected according to a first preset motion trajectory and send the current capsule endoscope to a first fixed position; or the control cabinet 0306 in the gripping device 03 controls the gripping device 03 to grip the current capsule endoscope to be measured and send the current capsule endoscope to the first fixed position according to the first control command according to the stored command logic and the first preset motion track. Wherein, the first preset motion track means: and the motion trail of the gripping device 03 is determined according to the position coordinates of the capsule endoscope to be measured placed in the storage rack 05, the initial position coordinates of the gripping device 03 and the position coordinates of the first base 0203 of the length measuring device 02. The specific flow of the grabbing device 03 grabbing the current capsule endoscope to be detected and sending the current capsule endoscope to the first fixing position is as follows:
after receiving the instruction of starting detection, the terminal device 01 sends a first control instruction to the gripping device 03, the gripping device 03 moves the third shaft 0303 to the position above the first tray 0501 of the storage rack 05 according to a preset motion trajectory, the first shaft 0301 and the second shaft 0302 move the third shaft 0303 vertically downwards, the clamping jaw 0304 is moved to the position right above the first capsule endoscope to be detected through the connecting shaft 030401, and the electric cylinder 030405 is controlled to be opened outwards at the same time, so that the clamping jaw 030404 is driven to be opened; the terminal device 01 controls the capsule endoscope identification sensor 030403 to emit a light beam, the light beam irradiates objects with different distances and different states and then is reflected, and the capsule endoscope identification sensor 030403 identifies the objects by the difference of the reflected light beams; when the capsule endoscope to be detected exists in the first tray 0501, the light beam is reflected by the capsule endoscope to be detected, the capsule endoscope identification sensor 030403 receives the first reflected light, when the capsule endoscope to be detected does not exist, the light beam is required to irradiate the surface of the first tray 0501 and then is reflected, the capsule endoscope identification sensor 030403 receives the second reflected light, the first reflected light and the second reflected light have obvious difference, the first reflected light or the second reflected light received by the capsule endoscope identification sensor 030403 identifies whether the capsule endoscope to be detected exists or not, and the identification result is fed back to the terminal device 01. The terminal device 01 receives the identification result, and when the identification result shows that the capsule endoscope to be detected exists, the electric cylinder 030405 is controlled to drive the chuck 030404 to fold and clamp the capsule endoscope to be detected, the capsule endoscope to be detected is the first capsule endoscope to be detected, the clamped capsule endoscope to be detected serves as the current capsule endoscope to be detected, the third shaft 0303 moves vertically upwards to drive the current capsule endoscope to be detected to leave the current position, the current capsule endoscope to be detected is sent to the length measuring device 02 through the first shaft 0301 and the second shaft 0302 and is placed on the first base 0203, and at this time, the position of the current capsule endoscope to be detected is called as a first fixed position. In some embodiments, when the identification result is that there is no capsule endoscope to be tested, the third shaft 0303 is controlled to return to the original point upwards, the first shaft 0301 and the second shaft 0302 move the clamping jaws 0304 on the third shaft 0303 to be right above the next capsule endoscope to be tested, the third shaft 0303 is controlled to move downwards again, the clamping head 030404 is opened, and the capsule endoscope identification sensor 030403 determines whether there is a capsule endoscope to be tested again, and the above operations are repeated.
The terminal device 01 sends a second control command to the length measuring device 02, the first motor 020101 drives the moving platform 0201 to move leftwards according to the second control command, in the moving process, the length measuring instrument 0202 firstly measures the length of the calibration block 020402 and then measures the length of the current capsule endoscope to be measured, the length measuring instrument 0202 feeds back the length data of the calibration block 020402 and the length data of the current capsule endoscope to be measured to the terminal device 01, and the terminal device 01 receives the length data of the calibration block 020402 and the length data of the current capsule endoscope to be measured. When the mobile platform 0201 moves to the left limit position, it starts moving to the right, returns to the origin, stops and waits for the next command.
The terminal device 01 determines the actual length of the current capsule endoscope to be measured according to the length data of the calibration block 020402 and the length data of the current capsule endoscope to be measured.
The terminal device 01 sends a third control instruction to the grabbing device 03, and controls the grabbing device 03 to grab the current capsule endoscope to be detected from the first base 0203 according to a second preset motion track, and send the current capsule endoscope to be detected to the capsule endoscope fixing seat 040101 of the resolution detection assembly 04, and the grabbing manner is described above, which is not described herein again, and at this time, the current position of the capsule endoscope to be detected is referred to as a second fixed position. Wherein, the second preset motion track means: and determining the motion track of the gripping device 03 according to the coordinates of the first fixed position, the coordinates of the starting position of the gripping device 03 and the coordinates of the second fixed position.
When the grabbing device 03 is controlled to move towards the resolution detection assembly 04, a door opening command is sent to the resolution detection assembly 04, the controller 040106 of the resolution detection assembly 04 controls the solenoid valve 040203 of the door opening assembly 0402 to retract a first air cylinder in the first air cylinder assembly 040201 according to the door opening command, and when the first air cylinder retracts, the door 040105 is pulled back through the door coupling 040202, and then the door 040105 rotates and opens; meanwhile, the original point and the terminal point of the guide rail on the first cylinder are both provided with magnetic switches, the magnetic switches receive corresponding signals of opening the door and then transmit the signals to the controller 040106, and the controller 040106 converts the signals of opening the door into a first instruction and feeds the first instruction back to the terminal device 01. After the gripping device 03 places the current capsule endoscope to be measured on the capsule endoscope fixing base 040101, the gripping device 03 returns to the initial position. At this time, the terminal device 01 sends a door closing command to the controller 040106, the controller 040106 controls the solenoid valve 040203 of the door opening assembly 0402 to push out the first cylinder according to the door closing command, the door 040105 is pushed forward through the door coupler 040202 while the first cylinder is pushed out, the door 040105 is closed, the magnetic switch receives a corresponding signal of closing the door and transmits the signal to the controller 040106, and the controller 040106 converts the signal of closing the door into a second command and feeds the second command back to the terminal device 01.
After receiving the signal of closing the door, the terminal device 01 sends a fourth control instruction to the resolution detection assembly, where the fourth control instruction is an instruction to start detection, and the controller 040106 receives the fourth control instruction and controls the motor 04010205 to rotate forward so as to drive the first lead screw in the lead screw assembly 04010206 to rotate, so as to drive the resolution pattern 04010201 to move downward from the original point, and the resolution pattern 04010201 moves to the first designated position. The first designated position is any position of the resolution pattern 04010201 within a range of 0mm-100mm from the current capsule endoscope to be measured. The resolution pattern 04010201 may be a calibration board of U.S. standard USAF1951, among others. Further, the step S05 of sending a fourth control instruction to the resolution detecting component to make the resolution detecting component move the resolution pattern to the first designated position includes: and sending the fourth control instruction to the resolution detection assembly so that the resolution detection assembly sequentially moves the resolution pattern to a position 100mm away from the current capsule endoscope to be detected, a position 25mm away from the current capsule endoscope to be detected and a position 0mm away from the current capsule endoscope to be detected. The distance of the resolution pattern 04010201 from the current capsule endoscope to be measured by 100mm can be called as a long distance; the distance of the resolution pattern 04010201 from the current capsule endoscope to be tested by 25mm can be called as the middle distance; the distance of the resolution pattern 04010201 from the current capsule endoscope to be measured by 0mm may be referred to as a near distance. In the moving process, the resolution pattern 04010201 sequentially reaches the long distance, the middle distance and the short distance, the current capsule endoscope to be detected sequentially acquires the first sub-image of the long-distance time resolution pattern 04010201, the second sub-image of the middle-distance time resolution pattern 04010201 and the third sub-image of the short-distance time resolution pattern 04010201, and respectively sends the acquired first sub-image, second sub-image and third sub-image to the terminal device 01. Therefore, the long-distance, medium-distance and short-distance optical resolution of the capsule endoscope to be detected can be detected, the detection comprehensiveness is improved, and the detection accuracy is further improved.
Further, S06: receiving the first image of the resolution pattern 04010201 taken by the current capsule endoscope to be tested comprises the following steps:
s0601: receiving a first sub-image of the resolution pattern 04010201 shot by the capsule endoscope currently to be tested, wherein the first sub-image is an image of the resolution pattern 04010201 shot by the capsule endoscope currently to be tested when the resolution pattern 04010201 is 100mm away from the capsule endoscope currently to be tested;
s0602: receiving a second sub-image of the resolution pattern 04010201 shot by the capsule endoscope currently to be tested, wherein the second sub-image is an image of the resolution pattern 04010201 shot by the capsule endoscope currently to be tested when the resolution pattern 04010201 is 25mm away from the capsule endoscope currently to be tested;
s0603: receiving a third sub-image of the resolution pattern 04010201 shot by the capsule endoscope currently to be tested, wherein the third sub-image is an image of the resolution pattern 04010201 shot by the capsule endoscope currently to be tested when the resolution pattern 04010201 is 0mm away from the capsule endoscope currently to be tested.
The actual length of the current capsule endoscope to be measured is obtained by the length measuring device 02 in the moving process of the resolution pattern 04010201, the difference calculated by combining the original point position is further calculated by the screw pitch of the first screw rod, and the rotating angle of the motor 04010205 is further calculated, and the calculation process specifically includes the following steps:
recording the actual length of the current capsule endoscope to be measured as L1;
the distance from the origin of the resolution pattern 04010201 to the fixed base 040101 of the capsule endoscope to be tested is L2, and the L2 is the structural design size and is a known fixed value;
the first designated position is a position of a distance L3 from the resolution pattern 04010201 to the current capsule endoscope to be detected;
the distance L that the resolution pattern 04010201 needs to be moved can be calculated as:
L=L2-L1-L3;
the pitch of the first screw rod is marked as P, and the pitch is a known fixed parameter of the first screw rod;
the pulse of motor 04010205 is denoted as Z, which is a known fixed parameter of motor 04010205;
by angle subdivision calculation: the motor 04010205 can control the angle β to be:
Figure BDA0003329692250000111
calculating by pulse moving distance: the distance L4 that the motor 04010205 moves for one pulse resolution pattern 04010201 is:
Figure BDA0003329692250000112
the number of pulses α of the motor 04010205 required to move the resolution pattern 04010201 the distance L2 is calculated as:
Figure BDA0003329692250000113
the rotation angle Q of the motor 04010205 required to move the resolution pattern 04010201 by the distance L is calculated as:
Q=α*β;
after the motor 04010205 completes the rotation of the angle Q, the terminal device 01 receives the first image of the resolution pattern 04010201 captured by the current capsule endoscope to be tested.
And the terminal equipment 01 processes the first image to obtain an effective area image. Specifically, the step may be to recognize a feature point "back" character in the first image, for example, recognize 3 feature points A, B and C, as shown in fig. 11, determine a rectangular image from the 3 feature points, correct the rectangular image by using an image perspective transformation method to obtain a corrected rectangular image, determine an area of the line pair D in the corrected rectangular image according to a preset relative position relationship between the feature point and the line pair area, and intercept the area to obtain an effective area image F, as shown in fig. 12.
And the terminal equipment 01 calculates the point sharpness value of the effective area image to obtain the optical resolution of the capsule endoscope to be detected. The step may specifically be to digitize the sharpness of the effective region image by a point sharpness value method, and calculate a point sharpness value of the effective region image, where a higher point sharpness value indicates a sharper effective region image; conversely, the more blurred the effective area image is.
In the method for detecting the optical resolution of the capsule endoscope, provided by the embodiment of the invention, terminal equipment 01 sends a first control instruction to a gripping device so that the gripping device grips the capsule endoscope to be detected and sends the capsule endoscope to a first fixed position; the terminal equipment 01 sends a second control instruction to the length measuring device so that the length measuring device can measure the length data of the current capsule endoscope to be measured; the terminal equipment 01 receives the length data; the terminal equipment 01 sends a third control instruction to the gripping device so that the gripping device grips the current capsule endoscope to be detected and sends the current capsule endoscope to a second fixed position; the terminal device 01 sends a fourth control instruction to the resolution detection assembly so that the resolution detection assembly moves the resolution pattern to the first specified position; the terminal equipment 01 receives a first image of the resolution pattern shot by the current capsule endoscope to be detected; the terminal device 01 processes the first image to obtain an effective area image; and the terminal equipment 01 calculates the point sharpness value of the effective area image to obtain the optical resolution of the capsule endoscope to be detected. The automatic detection of the optical resolution of the capsule endoscope to be detected is realized, personnel participation is not needed, and the detection efficiency is improved.
In some embodiments, the capsule endoscope optical resolution detection method further comprises the steps of:
s09: comparing the optical resolution with a first preset threshold to obtain a qualified or unqualified detection result;
s10: when the detection result is qualified, sending a fifth control instruction to the gripping device so that the gripping device grips the current capsule endoscope to be detected and sends the current capsule endoscope to the original position;
s11: and when the detection result is unqualified, sending a sixth control instruction to the gripping device so that the gripping device grips the current capsule endoscope to be detected and sends the current capsule endoscope to an unqualified area.
Specifically, the first preset threshold may be a point sharpness value that is determined through a large number of experiments and meets the product qualification specification requirement. The terminal device 01 compares the optical resolution of the current capsule endoscope to be detected with the first preset threshold, and when the optical resolution of the current capsule endoscope to be detected is greater than or equal to the first preset threshold, the detection result is qualified; and when the optical resolution of the current capsule endoscope to be detected is smaller than the first preset threshold, the detection result is unqualified.
And when the inspection result is qualified, the terminal equipment 01 sends a fifth control instruction to the gripping device so that the gripping device grips the current capsule endoscope to be detected and sends the current capsule endoscope to the original position or sends the current capsule endoscope to a qualified area. Specifically, the terminal device 01 sends an instruction to open the door to the controller 040106 of the resolution detection module 04, and the controller 040106 controls the solenoid valve 040203 of the door opening module 0402 to retract the first cylinder in the first cylinder module 040201, thereby opening the door 040105 of the resolution detection module 04 by the door coupling 040202; after a door 040105 of the resolution detection assembly 04 is opened, a sixth control instruction is sent to a control cabinet 0306 of the grabbing device 03, the control cabinet 0306 controls the grabbing device 03 to move towards the resolution detection assembly 04, after the grabbing device reaches the position right above a fixed seat 040101 of the capsule endoscope to be detected, the third shaft 0303 is controlled to move downwards, the chuck 030404 is synchronously controlled to open and grab the current capsule endoscope to be detected, the grabbing device 03 is controlled to send the current capsule endoscope to be detected to a designated area, and if the detection result is qualified, the current capsule endoscope to be detected is sent to an original position, wherein the original position is the position of the current capsule endoscope to be detected in the storage rack 05 before the detection is started; if the detection result is not qualified, the object is sent to a non-qualified area of the object shelf 05.
According to the method for detecting the optical resolution of the capsule endoscope, provided by the embodiment of the invention, the terminal device 01 compares the optical resolution of the current capsule endoscope to be detected with a first preset threshold value, so that a qualified capsule endoscope and an unqualified capsule endoscope are distinguished, and the qualified product and the unqualified product are placed in a partitioned manner, so that the whole detection process is more complete, and the detection efficiency and the detection effectiveness are higher.
In some embodiments, for a capsule endoscope to be detected, a first sub-image of a resolution pattern at a long distance, a second sub-image of a resolution pattern at a medium distance, and a third sub-image of a resolution pattern at a short distance are acquired, and the terminal device 01 respectively processes the first sub-image, the second sub-image, and the third sub-image to obtain a first sub-effective area image, a second sub-effective area image, and a third sub-effective area image; respectively calculating the point sharpness values of the first sub-effective area image, the second sub-effective area image and the third sub-effective area image to obtain a first optical resolution, a second optical resolution and a third optical resolution of the capsule endoscope to be detected; comparing the first optical resolution with a first sub-preset threshold, comparing the second optical resolution with a second sub-preset threshold, and comparing the third optical resolution with a third sub-preset threshold; when the first optical resolution is greater than or equal to a first sub-preset threshold, the second optical resolution is greater than or equal to a second sub-preset threshold and the third optical resolution is greater than or equal to a third sub-preset threshold, the detection result is qualified; otherwise, the detection result is unqualified. Thereby improving the comprehensiveness and the accuracy of the optical resolution detection of the capsule endoscope.
In some embodiments, the capsule endoscope optical resolution detection method further comprises the steps of:
s11-1: taking the next capsule endoscope to be tested as the current capsule endoscope to be tested;
and repeating the steps S01-S11 until the optical resolution detection of all the capsule endoscopes to be detected is completed.
Specifically, as shown in fig. 13, after the current capsule endoscope to be detected completes detection and is sent to the storage rack 05 by the gripping device 03, the gripping device 03 feeds back an instruction to the terminal device 01. Step S11-1: taking the next capsule endoscope to be tested as the current capsule endoscope to be tested; and repeating the steps S01-S11 until the optical resolution detection of all the capsule endoscopes to be detected is completed. It can be understood that the motion path from the grasping device 03 to each capsule endoscope to be detected is pre-stored in the encoder 0307, the motion path from the grasping device 03 to each capsule endoscope to be detected is planned in advance according to the position coordinates of each capsule endoscope to be detected and the position coordinates of the grasping device 03, and when the detection starts, the optical resolution detection is sequentially performed on each capsule endoscope to be detected according to a preset sequence. Therefore, batch detection of optical resolution of the capsule endoscope is realized, full process automation is realized, and consistency of detection results is improved.
In some embodiments, the capsule endoscope optical resolution detection method further comprises the steps of:
s12: sending a seventh control command to the resolution detecting component 04 to make the resolution detecting component 04 move the human environment simulation pattern 04010301 to a second designated position;
s13: receiving a second image of the human environment simulation pattern 04010301 shot by the current capsule endoscope to be tested;
s14: processing the second image to determine the number of the defect areas;
s15: and comparing the number of the defect areas with a second preset threshold value to obtain a judgment result of the human environment simulation pattern 04010301.
Specifically, referring to the local cross-sectional view of the resolution detection assembly 04 shown in fig. 14, after the current capsule endoscope to be tested finishes shooting the resolution pattern 04010201, the terminal device 01 sends a seventh control command to the controller 040106, the controller 040106 controls the motor 04010205 to rotate in the reverse direction so as to drive the first lead screw in the lead screw assembly 04010206 to rotate, so as to drive the resolution pattern 04010201 to move upward, and after the current capsule endoscope to be tested moves to the first limit sensor 04010203, the controller 040106 receives a position signal and then controls the motor 04010205 to rotate in the forward direction for a fixed number of turns so as to drive the resolution pattern 04010201 to return to the original point, so that the error after multiple movements can be reduced, and the original point can be accurately reached; at the moment, the controller 040106 controls the second cylinder 04010303 to drive the human environment simulation pattern 04010301 to advance into the shooting view angle of the current capsule endoscope to be detected, after the controller 040106 receives a signal of the magnetic switch on the second cylinder 04010303, the signal is uploaded to the terminal device 01, and the terminal device 01 starts to receive a second image of the human environment simulation pattern 04010301 shot by the current capsule endoscope to be detected; the terminal device 01 sends the control command to the controller 040106 again, the controller 040106 controls the second cylinder 04010303 to return to the origin, and the second cylinder 04010303 synchronously drives the human environment simulation pattern 04010301 to return to the origin. The human environment simulation pattern 04010301 may be an orange background cloth. The terminal device 01 processes the second image and determines the number of the defect areas; and comparing the number of the defect areas with a second preset threshold value to obtain a human body environment simulation pattern judgment result. The number of defective regions, for example, how many defective regions are in the range of 0.1mm to 1.12mm, can be counted according to the size of the defective regions. Determining a plurality of size ranges in advance according to a large number of experimental results, wherein the threshold value of the number of defect areas in each size range can be set according to the control requirement of product quality, comparing the number of defect areas in the size range with the threshold value of the number of defect areas in the size range, and setting that the optical resolution of the current capsule endoscope to be detected is greater than or equal to the first preset threshold value, and the detection result is qualified when the number of defect areas in each size range is respectively smaller than the threshold value of the number of defect areas in the size range; otherwise, the detection result is unqualified. Certainly, other rules for determining whether the endoscope is qualified or not may be set according to the requirement of product quality control, for example, the endoscope is determined to be qualified without requiring that the number of the defective regions in each size range is respectively smaller than the threshold of the number of the defective regions in the size range, or the endoscope is determined to be qualified if the number of the defective regions in some size ranges is respectively smaller than the threshold of the number of the defective regions in the size range, and the optical resolution of the current capsule endoscope to be detected is greater than or equal to the first preset threshold. The detection precision of the optical resolution of the capsule endoscope is further improved by accurately detecting the defect area, and the quality of products is improved. In some embodiments, step S07: the processing of the first image to obtain the effective area image comprises the following substeps:
s0701: carrying out segmentation and contour extraction processing on the first image to obtain a plurality of contours;
s0702: screening a plurality of contours according to the fixed characteristic length-width ratio of the feature points to obtain effective contours containing the feature points;
s0703: obtaining an effective test area according to the effective contour containing the characteristic points;
s0704: and determining the area of the line pair in the effective test area according to the relative position relationship between the line pair and the characteristic point to obtain an effective area image.
Specifically, when the terminal device 01 performs automatic identification of optical resolution, first performs identification of a feature point "back" word on a first image, specifically, a gaussian filtering algorithm may be performed on the first image to remove image noise, then a self-adaptive threshold segmentation algorithm is adopted to segment the denoised first image, then profile extraction is performed on the segmented region to obtain a plurality of profiles, the plurality of profiles are further screened according to the characteristic that the fixed characteristic aspect ratio of the feature point "back" word is 1 to obtain a plurality of effective profiles including the feature point "back" word, and then the center point coordinates of each effective profile are calculated according to the outermost profile of the feature point "back" word, so as to identify the specific coordinates of each feature point "back" word; after the identification of the 3 feature point "go back" words A, B and C is completed, as shown in fig. 11, the 3 feature point "go back" words are made into rectangles to obtain an initial test area; the initial test area can be projected to a new view plane through image perspective transformation, so that image correction is realized, and an effective test area is obtained, wherein the effective test area is a matrix graph; according to the relative position relationship between the line pair D and the three feature point return characters, the area of the line pair D in the effective test area is determined, and the area is intercepted, so as to obtain an effective area image F, as shown in fig. 12.
In some embodiments, step S14 processes the second image, and determining the number of defective regions includes the sub-steps of:
s1401: carrying out graying processing on the second image to obtain a grayscale image;
s1402: carrying out top hat transformation on the gray level image to obtain at least one initial defect area;
s1403: performing threshold segmentation on at least one initial defect region to obtain at least one defect region;
s1404: determining the number of the defect areas according to the image pixels of at least one defect area.
Specifically, when the second image is automatically identified, the terminal device 01 firstly performs graying processing on the second image, converts the color image into a grayscale image, and facilitates subsequent image segmentation; then, removing the noise of the gray level image through Gaussian filtering; then, carrying out image enhancement processing on the de-noised gray-scale image to obtain an enhanced gray-scale image; then, carrying out top hat transformation on the gray level image to extract a brighter area, thereby realizing the extraction of at least one initial defect area; extracting at least one defect area by image threshold segmentation; the edge burrs of the defect area can be removed through opening operation to smooth the edge of the defect area; determining the image pixel of each defect area, and determining the actual length of the defect of each defect area according to the corresponding relation between the image pixel of the defect area and the actual length of the defect; a number of defect length ranges may be preset, such as: 0.0010mm to 0.0019mm, 0.0020mm to 0.0028mm and 0.0029mm to 0.0034mm, and counting the number of defect areas in each defect length range.
In some embodiments, the capsule endoscope optical resolution detection method further comprises the steps of:
s16: extracting the outline of the defect area to obtain a defect outline;
s17: calculating the perimeter and the area of the defect outline;
s18: determining the circularity of the defect region according to the perimeter and the area of the defect outline;
s19: determining a minimum bounding rectangle of the defect outline;
s20: calculating the aspect ratio of the minimum bounding rectangle;
s21: and determining the category of the defect according to the circularity and the aspect ratio.
Specifically, in the embodiment of the present invention, the defect of the defect area is classified according to the difference of the geometric features of the defect area and the circularity and aspect ratio of the defect area, so that it can be determined that the defect is a white spot or a scratch.
Specifically, extracting the outline of each defect area respectively to obtain each defect outline; respectively calculating the period l and the area s of each defect outline; determining the circularity C of the defect region according to the period l and the area s of the defect outline, wherein the calculation formula of the circularity C is as follows:
Figure BDA0003329692250000171
respectively determining the minimum circumscribed rectangles of the defect outlines, and respectively calculating the length-width ratios r of the minimum circumscribed rectangles, wherein the calculation formula of the length-width ratios r is as follows:
Figure BDA0003329692250000172
wherein w represents the length of the minimum bounding rectangle of the defect outline, and h represents the width of the minimum bounding rectangle of the defect outline;
comparing the circularity C of each defect area with a preset circularity C ', comparing the length-width ratio r of each defect area with a preset length-width ratio r', and judging that the defect of the defect area is a scratch when C is less than C 'and r is greater than r'; otherwise, judging the defect of the defect area as a white spot. The preset circularity C 'and the preset aspect ratio r' may be determined according to a number of experimental results, for example, the preset circularity C 'may be 0.4, and the preset aspect ratio r' may be 2. Further, whether the optical resolution of the current capsule endoscope to be detected is qualified or not can be judged according to the type of the defect, and the judgment standard can be formulated according to the product quality control requirement, for example, when the defect is a scratch, the detection result is qualified; and when the defect is a white point, the detection result is unqualified.
According to the method for detecting the optical resolution of the capsule endoscope, provided by the embodiment of the invention, the second image of the human environment simulation pattern 04010301 is acquired by the capsule endoscope to be detected, the terminal device 01 processes the second image, the defect of the capsule endoscope to be detected is identified and the type of the defect is judged through the second image, the judgment dimension of whether the optical resolution of the capsule endoscope is qualified is enriched, the comprehensiveness and completeness of the detection of the optical resolution of the capsule endoscope are further improved, and the product quality is finally improved.
As shown in fig. 15, an embodiment of the present invention provides a capsule endoscope optical resolution detection apparatus, including:
the first sending unit is configured to send a first control instruction to the grabbing device so that the grabbing device can grab the current capsule endoscope to be detected and send the current capsule endoscope to a first fixed position;
the second sending unit is configured to send a second control instruction to the length measuring device so that the length measuring device can measure the length data of the current capsule endoscope to be measured;
a first receiving unit configured to receive the length data;
the third sending unit is configured to send a third control instruction to the grasping device so that the grasping device grasps the current capsule endoscope to be detected and sends the current capsule endoscope to a second fixed position;
a fourth sending unit configured to send a fourth control instruction to the resolution detecting component to cause the resolution detecting component to move the resolution pattern to the first specified position;
the second receiving unit is configured to receive a first image of the resolution pattern shot by the current capsule endoscope to be tested;
the first image processing unit is configured to process the first image to obtain an effective area image;
and the optical resolution calculating unit is configured to calculate the point sharpness value of the effective area image to obtain the optical resolution of the capsule endoscope to be measured.
In some embodiments, the apparatus for detecting optical resolution of a capsule endoscope further comprises:
a fifth sending unit, configured to send a seventh control instruction to the resolution detection component, so that the resolution detection component moves the human environment simulation pattern to a second designated position;
the third receiving unit is configured to receive a second image of the human body environment simulation pattern shot by the current capsule endoscope to be detected;
a second image processing unit configured to process the second image and determine the number of defective areas;
a second comparison unit: and comparing the number of the defect areas with a second preset threshold value to obtain a human body environment simulation pattern judgment result.
In some embodiments, the first image processing unit comprises:
a contour extraction subunit: the first image is configured to be segmented and subjected to contour extraction processing to obtain a plurality of contours;
the effective contour determining subunit is configured to screen a plurality of contours according to the fixed characteristic aspect ratio of the feature points to obtain effective contours containing the feature points;
an effective test area determination subunit: obtaining an effective test area according to the effective contour containing the characteristic points;
the effective area image determination subunit: and determining the area of the line pair in the effective test area according to the relative position relation of the line pair and the characteristic point to obtain an effective area image.
In some embodiments, the second image processing unit comprises:
a graying processing subunit: the gray level processing is carried out on the second image to obtain a gray level image;
top-hat transform subunit: performing top-hat transformation on the gray-scale image to obtain at least one initial defect region;
threshold segmentation subunit: the threshold segmentation is carried out on at least one initial defect area to obtain at least one defect area;
defective area number determination subunit: is configured to determine the number of said defective areas based on image pixels of at least one of said defective areas.
In some embodiments, the capsule endoscope optical resolution detection apparatus further comprises:
a defect contour extraction unit: extracting the outline of the defect area to obtain a defect outline;
the first calculation unit: configured to calculate a perimeter and an area of the defect profile;
a second calculation unit: the circularity of the defect region is determined according to the perimeter and the area of the defect outline;
minimum circumscribed rectangle determination unit: a minimum bounding rectangle configured to determine the defect outline;
a third calculation unit: configured to calculate an aspect ratio of the minimum bounding rectangle;
a defect type determination unit: configured to determine a classification of the defect based on the circularity and the aspect ratio.
For the specific implementation of each apparatus item, please refer to the detailed description of the corresponding method item, which is not repeated herein.
Embodiments of the present invention provide a computer-readable storage medium having at least one instruction, at least one program, a set of codes, or a set of instructions stored therein, which are loaded and executed by the processor to implement the operations of the capsule endoscope optical resolution detection method of the above embodiments.
It will be understood by those skilled in the art that all or part of the steps of implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk, an optical disk, or the like. Although the embodiments of the present invention have been described in detail with reference to the accompanying drawings, the embodiments of the present invention are not limited to the details of the above embodiments, and various simple modifications can be made to the technical solutions of the embodiments of the present invention within the technical idea of the embodiments of the present invention, and the simple modifications all belong to the protection scope of the embodiments of the present invention.
It should be noted that the various features described in the above embodiments may be combined in any suitable manner without departing from the scope of the invention. In order to avoid unnecessary repetition, the embodiments of the present invention do not describe every possible combination.
In addition, any combination of various different implementation manners of the embodiments of the present invention is also possible, and the embodiments of the present invention should be considered as disclosed in the embodiments of the present invention as long as the combination does not depart from the spirit of the embodiments of the present invention.

Claims (13)

1. A method for detecting optical resolution of a capsule endoscope is characterized by comprising the following steps:
s01: sending a first control instruction to a gripping device so that the gripping device grips the current capsule endoscope to be measured and sends the current capsule endoscope to a first fixed position;
s02: sending a second control instruction to a length measuring device so that the length measuring device can measure the length data of the current capsule endoscope to be measured;
s03: receiving the length data;
s04: sending a third control instruction to the gripping device so that the gripping device grips the current capsule endoscope to be detected and sends the current capsule endoscope to a second fixed position;
s05: sending a fourth control instruction to the resolution detection component to enable the resolution detection component to move the resolution pattern to the first specified position;
s06: receiving a first image of the resolution pattern shot by the current capsule endoscope to be detected;
s07: processing the first image to obtain an effective area image;
s08: and calculating the point sharpness value of the effective area image to obtain the optical resolution of the current capsule endoscope to be detected.
2. The method for detecting optical resolution of a capsule endoscope according to claim 1, further comprising the steps of:
s09: comparing the optical resolution with a first preset threshold to obtain a qualified or unqualified detection result;
s10: when the detection result is qualified, sending a fifth control instruction to the gripping device so that the gripping device grips the current capsule endoscope to be detected and sends the current capsule endoscope to the original position;
s11: and when the detection result is unqualified, sending a sixth control instruction to the gripping device so that the gripping device grips the current capsule endoscope to be detected and sends the current capsule endoscope to an unqualified area.
3. The method for detecting optical resolution of a capsule endoscope according to claim 2, further comprising the steps of:
s11-1: taking the next capsule endoscope to be tested as the current capsule endoscope to be tested;
and repeating the steps S01 to S11-1 until the optical resolution detection of all the capsule endoscopes to be detected is completed.
4. The method for detecting optical resolution of a capsule endoscope according to claim 1, further comprising the steps of:
s12: sending a seventh control instruction to the resolution detection assembly so that the resolution detection assembly moves the human body environment simulation pattern to a second appointed position;
s13: receiving a second image of the human body environment simulation pattern shot by the current capsule endoscope to be detected;
s14: processing the second image to determine the number of the defect areas;
s15: and comparing the number of the defect areas with a second preset threshold value to obtain a human body environment simulation pattern judgment result.
5. The method for detecting the optical resolution of the capsule endoscope according to claim 1, wherein the first designated position is a distance from the current capsule endoscope to be detected to the resolution pattern, which is any distance within a range of 0mm to 100 mm.
6. The optical resolution detection method of the capsule endoscope according to the claim 1 or 5, wherein the step S05 sending a fourth control instruction to the resolution detection assembly to make the resolution detection assembly move the resolution pattern to the first designated position comprises:
and sending the fourth control instruction to the resolution detection assembly so that the resolution detection assembly sequentially moves the resolution pattern to a position 100mm away from the current capsule endoscope to be detected, a position 25mm away from the current capsule endoscope to be detected and a position 0mm away from the current capsule endoscope to be detected.
7. The method for detecting optical resolution of a capsule endoscope according to claim 6, wherein the step S06 of receiving the first image of the resolution pattern captured by the current capsule endoscope to be tested comprises:
s0601: receiving a first sub-image of the resolution pattern shot by the current capsule endoscope to be detected, wherein the first sub-image is an image of the resolution pattern shot by the current capsule endoscope to be detected when the resolution pattern is 100mm away from the current capsule endoscope to be detected;
s0602: receiving a second sub-image of the resolution pattern shot by the current capsule endoscope to be detected, wherein the second sub-image is an image of the resolution pattern shot by the current capsule endoscope to be detected when the resolution pattern is 25mm away from the current capsule endoscope to be detected;
s0603: and receiving a third sub-image of the resolution pattern shot by the current capsule endoscope to be detected, wherein the third sub-image is an image of the resolution pattern shot by the current capsule endoscope to be detected when the resolution pattern is 0mm away from the current capsule endoscope to be detected.
8. The method for detecting optical resolution of a capsule endoscope according to claim 1, wherein step S07: processing the first image to obtain an effective area image comprises:
s0701: carrying out segmentation and contour extraction processing on the first image to obtain a plurality of contours;
s0702: screening a plurality of contours according to the fixed characteristic length-width ratio of the feature points to obtain effective contours containing the feature points;
s0703: obtaining an effective test area according to the effective contour containing the characteristic points;
s0704: and determining the area of the line pair in the effective test area according to the relative position relationship between the line pair and the characteristic point to obtain an effective area image.
9. The method for detecting optical resolution of a capsule endoscope according to claim 4, wherein the step S14 of processing the second image and determining the number of defect regions comprises:
s1401: carrying out graying processing on the second image to obtain a grayscale image;
s1402: carrying out top hat transformation on the gray level image to obtain at least one initial defect area;
s1403: performing threshold segmentation on at least one initial defect region to obtain at least one defect region;
s1404: determining the number of the defect areas according to the image pixels of at least one defect area.
10. The method for detecting optical resolution of a capsule endoscope according to claim 4, further comprising the steps of:
s16: extracting the outline of the defect area to obtain a defect outline;
s17: calculating the perimeter and the area of the defect outline;
s18: determining the circularity of the defect region according to the perimeter and the area of the defect outline;
s19: determining a minimum bounding rectangle of the defect outline;
s20: calculating the aspect ratio of the minimum bounding rectangle;
s21: and determining the category of the defect according to the circularity and the aspect ratio.
11. A capsule endoscope optical resolution detection device, comprising:
the first sending unit is configured to send a first control instruction to the grabbing device so that the grabbing device can grab the current capsule endoscope to be detected and send the current capsule endoscope to a first fixed position;
the second sending unit is configured to send a second control instruction to the length measuring device so that the length measuring device can measure the length data of the current capsule endoscope to be measured;
a first receiving unit configured to receive the length data;
the third sending unit is configured to send a third control instruction to the grasping device so that the grasping device grasps the current capsule endoscope to be detected and sends the current capsule endoscope to a second fixed position;
a fourth sending unit configured to send a fourth control instruction to the resolution detecting component to cause the resolution detecting component to move the resolution pattern to the first specified position;
the second receiving unit is configured to receive a first image of the resolution pattern shot by the current capsule endoscope to be tested;
the first image processing unit is configured to process the first image to obtain an effective area image;
and the optical resolution calculating unit is configured to calculate the point sharpness value of the effective area image to obtain the optical resolution of the capsule endoscope to be measured.
12. The apparatus of claim 11, further comprising:
a fifth sending unit, configured to send a seventh control instruction to the resolution detection component, so that the resolution detection component moves the human environment simulation pattern to a second designated position;
the third receiving unit is configured to receive a second image of the human body environment simulation pattern shot by the current capsule endoscope to be detected;
a second image processing unit configured to process the second image and determine the number of defective areas; a second comparison unit: and comparing the number of the defect areas with a second preset threshold value to obtain a human body environment simulation pattern judgment result.
13. A computer-readable storage medium having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by a processor to carry out the operations performed in the method of claims 1 to 10.
CN202111276778.1A 2021-10-29 2021-10-29 Method, device and storage medium for detecting optical resolution of capsule endoscope Active CN114184354B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111276778.1A CN114184354B (en) 2021-10-29 2021-10-29 Method, device and storage medium for detecting optical resolution of capsule endoscope

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111276778.1A CN114184354B (en) 2021-10-29 2021-10-29 Method, device and storage medium for detecting optical resolution of capsule endoscope

Publications (2)

Publication Number Publication Date
CN114184354A true CN114184354A (en) 2022-03-15
CN114184354B CN114184354B (en) 2023-08-29

Family

ID=80540526

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111276778.1A Active CN114184354B (en) 2021-10-29 2021-10-29 Method, device and storage medium for detecting optical resolution of capsule endoscope

Country Status (1)

Country Link
CN (1) CN114184354B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115002447A (en) * 2022-05-25 2022-09-02 上海微创医疗机器人(集团)股份有限公司 Endoscope evaluation method, system and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030048436A1 (en) * 2001-09-03 2003-03-13 Seiko Epson Corporation Lens-evaluating method and lens-evaluating apparatus
CN105182678A (en) * 2015-07-10 2015-12-23 中国人民解放军装备学院 System and method for observing space target based on multiple channel cameras
CN112075914A (en) * 2020-10-14 2020-12-15 深圳市资福医疗技术有限公司 Capsule endoscopy system
CN112089392A (en) * 2020-10-14 2020-12-18 深圳市资福医疗技术有限公司 Capsule endoscope control method, device, equipment, system and storage medium
CN112333443A (en) * 2020-11-24 2021-02-05 苏州协尔智能光电有限公司 Lens performance detection system and method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030048436A1 (en) * 2001-09-03 2003-03-13 Seiko Epson Corporation Lens-evaluating method and lens-evaluating apparatus
CN105182678A (en) * 2015-07-10 2015-12-23 中国人民解放军装备学院 System and method for observing space target based on multiple channel cameras
CN112075914A (en) * 2020-10-14 2020-12-15 深圳市资福医疗技术有限公司 Capsule endoscopy system
CN112089392A (en) * 2020-10-14 2020-12-18 深圳市资福医疗技术有限公司 Capsule endoscope control method, device, equipment, system and storage medium
CN112333443A (en) * 2020-11-24 2021-02-05 苏州协尔智能光电有限公司 Lens performance detection system and method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115002447A (en) * 2022-05-25 2022-09-02 上海微创医疗机器人(集团)股份有限公司 Endoscope evaluation method, system and storage medium

Also Published As

Publication number Publication date
CN114184354B (en) 2023-08-29

Similar Documents

Publication Publication Date Title
US8045763B2 (en) Method and apparatus for recognizing and determining the position of at least one teat cup
KR890002287B1 (en) Pattern matching method and apparatus
US4613269A (en) Robotic acquisition of objects by means including histogram techniques
KR0180082B1 (en) Inspection system and process
CN114184354B (en) Method, device and storage medium for detecting optical resolution of capsule endoscope
CN110832508A (en) Method and system for learning-based image edge enhancement for sample tube top rounding
CN114049557A (en) Garbage sorting robot visual identification method based on deep learning
US20170061614A1 (en) Image measuring apparatus and non-temporary recording medium on which control program of same apparatus is recorded
CN114820475B (en) Edge identification method and system, wafer processing device and method for determining concentric state of wafer and processing table
CN110570408B (en) System and method for counting fine targets on outer surface of cylinder
CN109343303B (en) Micro-drill visual detection method and device based on inner cone mirror scanning panoramic imaging
CN110880171A (en) Detection method of display device and electronic equipment
JPH0875418A (en) Automatic recognition method and automatic recognition device for object
JPH11114860A (en) Recognition method and picking device
CN116002330B (en) Automatic test tube sorting device and automatic test tube sorting method
JP2007033236A (en) Surface defect inspection device and surface defect inspection method
JPH0410564B2 (en)
JP3177945B2 (en) Surface defect inspection equipment
KR100227421B1 (en) Insert inspection device and method of printed board
JP7493474B2 (en) Shape measurement device and method
CN114034706B (en) Device and method for detecting surface defects of carbon fiber part
JP3552419B2 (en) Object recognition method
JP2024006415A (en) Appearance inspection device and appearance inspection method
JP2022136685A (en) Shape measuring device and method
JP2006119994A (en) Method for counting identically shaped objects

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant