Endoscope hose scale identification method and device, electronic equipment and hose
By identifying and optimizing the scale image on the endoscope hose, the problem of not being able to accurately identify the hose scale in the prior art is solved, and high-precision scale recognition and reading are achieved.
Patent Information
- Application Number
- CN202411459846.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-03-11
AI Technical Summary
The inability to identify the scale on the endoscope hose at multiple angles and accurately in the prior art, resulting in the problem of accurate estimation of detection coverage.
By acquiring the scale image, the ring scale type recognition is performed, the reference mark and identification mark are divided, the initial identification scale is generated, and the identification mark and mark relationship are used for optimization identification to obtain the target scale.
It realizes accurate identification of hose scales from multiple angles, improves the accuracy of scale generation, and realizes efficient reading of scale marks through binary representation rules.
Smart Images

Figure CN119600579A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of scale recognition, and in particular to a scale recognition method, device, electronic equipment and hose for an endoscope hose. Background Art
[0002] With the continuous development of computer video technology, the application of gastroscopes, endoscopes and other detection equipment is becoming more and more extensive and the performance is getting better and better. For example, in terms of video resolution, it has reached 720p, 1080p and even 4k. However, in the process of endoscopic detection, the accurate estimation of detection coverage has always been a difficult problem.
[0003] Everyone's intestines are different. Some people have longer intestines, some have shorter intestines, and some have undergone gastrointestinal resection. In addition, the intestinal videos of different people vary greatly, and it is also difficult to determine the detection site through the video images of the intestines.
[0004] Therefore, the existing technology can also read the scale on the surface of the endoscope hose and locate the depth of the endoscope into the patient's intestine according to the scale to further estimate the detection area and mark the lesion site. The hose used in the current endoscope also has simple scales, but most of them are marked with Arabic numerals with large spacing, usually at intervals of 10 cm. The scale cannot be seen from any angle and can only be read manually. The accuracy of the reading is also relatively low. In addition, the doctor will only read and record the abnormal parts or reach the target part, and the whole process reading cannot be achieved.
[0005] In summary, the prior art has the problem of being unable to accurately identify the hose scale at multiple angles. Summary of the invention
[0006] The present invention provides an endoscope hose scale recognition method, device, electronic equipment, computer-readable storage medium and hose, the main purpose of which is to solve the problem that the hose scale cannot be recognized accurately from multiple angles.
[0007] To achieve the above object, the present invention provides a method for identifying the scale of an endoscope hose, comprising:
[0008] Acquire a scale image, and perform circular scale line type recognition on the scale image to obtain multiple types of scale line marks;
[0009] Divide the scale mark into a reference mark and an identification mark, and determine the mark relationship corresponding to the identification mark and the target mark according to the reference mark;
[0010] An initial recognition scale is generated according to the target mark and the corresponding binary representation rule, and the initial recognition scale is optimized and recognized using the recognition mark and the corresponding mark relationship to obtain a target scale.
[0011] Optionally, the ring scale line type recognition is performed on the scale image to obtain multiple types of scale line marks, including:
[0012] Generate a pre-selection frame according to the scale image, and segment the scale image according to the pre-selection frame to obtain an image to be recognized;
[0013] Feature recognition is performed on the image to be recognized, and multiple types of scale mark marks are determined according to the result of the feature recognition.
[0014] Optionally, generating a pre-selection box according to the scale image includes:
[0015] Pre-positioning the scale image using a pre-trained anchor frame detection model to obtain multiple positioning frames;
[0016] Cutting the positioning frame to obtain a standard positioning frame;
[0017] A similarity calculation is performed between a preset image feature library and the standard positioning frame, and a pre-selected frame is determined from the standard positioning frame according to the result of the similarity calculation.
[0018] Optionally, the performing feature recognition on the image to be recognized includes:
[0019] Performing line recognition on the image to be recognized to obtain a plurality of line features;
[0020] The line features are screened to obtain target line features.
[0021] Optionally, determining multiple types of scale mark marks according to the result of feature recognition includes:
[0022] Using the preset marking category rules to match the target line features respectively, to obtain type A marking, type B marking and type C marking;
[0023] The A-type mark, the B-type mark, and the C-type mark are used as scale mark marks.
[0024] Optionally, determining the marking relationship corresponding to the identification mark and the target mark according to the reference mark includes:
[0025] generating a positional relationship of the scale mark, and determining whether the number of the reference marks is greater than or equal to two;
[0026] If there are two or more of the reference marks, extracting an identification mark between the two reference marks as a target mark according to the positional relationship;
[0027] If the number of the reference marks is less than two, extracting the target marks according to the number of the identification marks;
[0028] An identification mark other than the target mark is used as a reference mark, and a mark relationship is generated based on the positional relationship, the target mark, and the reference mark.
[0029] Optionally, the optimizing and identifying the initial identification scale by using the identification mark and the corresponding marking relationship to obtain a target scale includes:
[0030] Determining an optimization direction of the initial recognition scale according to the marking relationship;
[0031] An identification mark smaller than the reference mark among the identification marks is obtained as a mark to be processed, and a calculation is performed according to the mark to be processed and the optimization direction to obtain a target scale.
[0032] In order to solve the above problems, the present invention also provides an endoscope hose scale identification device, the device comprising:
[0033] An image acquisition module, used for acquiring a scale image;
[0034] A scale mark recognition module is used to identify the type of circular scale marks on the scale image to obtain multiple types of scale mark marks;
[0035] A marking division module, used for dividing the scale mark into a reference mark and an identification mark, and determining a marking relationship corresponding to the identification mark and a target mark according to the reference mark;
[0036] The scale recognition module is used to generate an initial recognition scale according to the target mark and the corresponding binary representation rule, and optimize the initial recognition scale by using the recognition mark and the corresponding mark relationship to obtain the target scale.
[0037] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:
[0038] at least one processor; and,
[0039] a memory communicatively connected to the at least one processor; wherein,
[0040] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the above-mentioned endoscope hose scale recognition method.
[0041] In order to solve the above problems, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned endoscope hose scale recognition method.
[0042] In order to solve the above problems, the present invention also provides a hose, which is configured to be cylindrical or tubular; a plurality of types of scale line marks distributed at equal intervals are provided on the surface of the hose; the scale line marks are annular lines surrounding the surface of the hose; the line segment types and line segment lengths of the plurality of types of scale line marks are different.
[0043] The present invention ensures that the scale mark can be photographed from multiple angles and the scale mark can be recognized by using the annular scale mark type based on the scale image; the accuracy of scale generation is improved by dividing the reference mark and the recognition mark for initial generation and optimized recognition; and the efficient reading of the scale mark can be achieved through the binary representation rule. Therefore, the endoscope hose scale recognition method, device, electronic device, computer-readable storage medium and hose proposed by the present invention can accurately recognize the hose scale from multiple angles. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 A schematic diagram of a flow chart of a method for recognizing the scale of an endoscope hose provided in one embodiment of the present invention;
[0045] Figure 2 A schematic diagram of the structure of multiple types of scale mark marks provided by an embodiment of the present invention;
[0046] Figure 3 A partial structural schematic diagram of a hose provided by an embodiment of the present invention;
[0047] Figure 4 A functional module diagram of an endoscope hose scale recognition device provided by an embodiment of the present invention;
[0048] Figure 5 A schematic diagram of the structure of an electronic device for implementing the endoscope hose scale recognition method provided in one embodiment of the present invention.
[0049] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0050] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0051] The embodiment of the present application provides a method for identifying the scale of an endoscope hose. The execution subject of the method for identifying the scale of an endoscope hose includes but is not limited to at least one of the electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the present application. In other words, the method for identifying the scale of an endoscope hose can be executed by software or hardware installed on a terminal device or a server device. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0052] Reference Figure 1 FIG. 1 is a flow chart of a method for identifying the scale of an endoscope hose provided by an embodiment of the present invention. In this embodiment, the method for identifying the scale of an endoscope hose includes:
[0053] S1. Acquire a scale image, and perform circular scale line type recognition on the scale image to obtain multiple types of scale line marks.
[0054] In an embodiment of the present invention, the scale image may be an image captured by a camera. After the endoscope enters the body through the mouth, nostrils and other parts of the human body, a camera device may be provided at the mouth, nostrils and other parts to capture images or images of the parts where the endoscope enters the human body.
[0055] Furthermore, in an embodiment of the present invention, the scale image captured by the camera device may include the part of the human body where the endoscope enters, the shooting environment, the personnel performing the examination and treatment, etc. In order to better identify the annular scale on the endoscope hose, the scale image can first be subjected to image enhancement, target recognition and other processing to obtain a clear scale line image; then, the scale line image can be subjected to annular scale line type recognition to obtain multiple types of scale line markings.
[0056] In the embodiment of the present invention, before the type recognition is performed on the scale image, pre-processing operations such as Gaussian filtering denoising, background removal and thresholding may be performed on the scale image to improve the accuracy of subsequent scale line recognition.
[0057] In the embodiment of the present invention, the ring scale line type recognition is performed on the scale image to obtain multiple types of scale line marks, including:
[0058] Generate a pre-selection frame according to the scale image, and segment the scale image according to the pre-selection frame to obtain an image to be recognized;
[0059] Feature recognition is performed on the image to be recognized, and multiple types of scale mark marks are determined according to the result of the feature recognition.
[0060] In an embodiment of the present invention, generating a pre-selection box according to the scale image includes:
[0061] Pre-positioning the scale image using a pre-trained anchor frame detection model to obtain multiple positioning frames;
[0062] Cutting the positioning frame to obtain a standard positioning frame;
[0063] A similarity calculation is performed between a preset image feature library and the standard positioning frame, and a pre-selected frame is determined from the standard positioning frame according to the result of the similarity calculation.
[0064] In an embodiment of the present invention, the anchor box detection model can be a network model based on strong correlation learning. By inputting the scale image into the anchor box detection model, several regions in the scale image can be obtained; the anchor box detection model uses 1×3 and 3×1 convolution kernels as basic components (defined as separable convolution, Sep Convolution), that is, the separable convolution includes 1×3 and 3×1 convolution kernels, adopts the idea of separation, replaces N×N convolution with N×1+1×N convolution operation, and can reduce the number of parameters; the basic skeleton network constructed based on the separable convolution includes: separable convolution block, skeleton convolution layer, separable convolution, and fusion layer.
[0065] In an embodiment of the present invention, the positioning frame can be cropped using the constructed cropping model. The cropping model can be a regional feature cropping model based on bilinear interpolation, which can adaptively obtain the feature area corresponding to the positioning frame from the deep feature map, and use bilinear interpolation to solve the quantization error problem in the cropping of the deep feature map; the bilinear interpolation method is also called bilinear interpolation. This method uses the pixel values of four adjacent reference points in image processing, assigns different weights and performs linear interpolation according to the different distances from the reference points in the X and Y directions.
[0066] In an embodiment of the present invention, the image feature library contains different feature images, for example, images of facial features, images of hoses with scales, etc. A feature map to be compared is selected from the image feature library according to the required image type, and feature similarity is calculated between the image corresponding to the standard positioning box and the feature map to be compared. A pre-selected box can be selected from the standard positioning box according to the size of the similarity calculation result; specifically, the similarity can be calculated using methods such as cosine similarity.
[0067] In the embodiment of the present invention, the step of performing feature recognition on the image to be recognized includes:
[0068] Performing line recognition on the image to be recognized to obtain a plurality of line features;
[0069] The line features are screened to obtain target line features.
[0070] In an embodiment of the present invention, the image to be identified may be subjected to operations such as grayscale conversion, and then the lines in the image to be identified may be partitioned and identified through a target detection model to obtain a plurality of line features; the lines of the hose in the image may include scale line lines, hose contour lines, etc. Therefore, in order to obtain scale line lines, it is necessary to filter the identified line features; specifically, the lines may be filtered according to the direction or positional relationship of the line features.
[0071] In the embodiment of the present invention, the step of determining multiple types of scale mark marks according to the result of feature recognition includes:
[0072] Using the preset marking category rules to match the target line features respectively, to obtain type A marking, type B marking and type C marking;
[0073] The A-type mark, the B-type mark, and the C-type mark are used as scale mark marks.
[0074] In the embodiment of the present invention, Figure 2 As shown, there are multiple types of scale line marks corresponding to the marking category rules. The scale line marks are annular lines surrounding the surface of the hose and are circumferentially arranged along the axial direction of the hose. The midpoints of the scale line marks are located on the same plane, and the plane is perpendicular to the axis of the hose. The scale line marks can be divided into type A marks, type B marks and type C marks. Type A marks, type B marks and type C marks surround the surface of the hose respectively, wherein the type A mark is composed of a solid line to form a complete ring on the surface of the hose; the type B mark is composed of a dotted line and consists of 6 segments, and the length of each segment is 1 / 12 of the circumference of the cross-section of the hose; the type C mark is composed of a dotted line and consists of 12 segments, and the length of each segment is 1 / 24 of the circumference of the cross-section of the hose. The line width of the scale line mark can be 1 mm, and the scale line mark can have a large display difference from the hose, for example, a color difference.
[0075] S2. Divide the scale mark into a reference mark and an identification mark, and determine the mark relationship corresponding to the identification mark and the target mark according to the reference mark.
[0076] In the embodiment of the present invention, before dividing the scale mark into reference marks and identification marks, the method further includes:
[0077] Acquire a preset measuring range and a preset first interval length, and generate a reference mark and a reference mark measuring range according to the measuring range and the first interval length;
[0078] The identification mark is generated according to the reference mark range and the preset second interval length.
[0079] In the embodiment of the present invention, for a certain length of measuring range, a reference mark can be set according to different first mark intervals; or for a certain length of measuring range, the first mark interval can be fixed, and multiple reference marks can be determined by calculation based on the measuring range and the fixed first mark interval. For example, if the measuring range is 30cm, and a reference mark is set to appear every 10cm, there are 3 reference marks, and each time a reference mark appears, 10cm is added to the previous reference mark.
[0080] In the embodiment of the present invention, the identification mark is located between two adjacent reference marks, and the identification marks are evenly distributed in the reference marks. The number of identification marks can be determined according to the range between the two reference marks and the intervals between different second marks, or according to the range between the two reference marks and the fixed interval between the second marks. For example, if the range between two adjacent reference marks is 10 cm, and the fixed interval between the second marks is set to 10 mm, then one identification mark appears every 10 mm, and there are a total of 9 identification marks between the two adjacent reference marks.
[0081] In the embodiment of the present invention, the A-type mark can be used as a reference mark, and the B-type mark and the C-type mark can be used as identification marks; the A-type mark, the B-type mark and the C-type mark are evenly spaced on the surface of the hose; between the nth A-type mark and the n+1th A-type mark, n can be represented by a five-bit binary number, and each bit of the five-bit binary number is recorded as n0, n1, n2, n3, and n4 from low to high, and further, the B-type mark can be recorded as 0, and the C-type mark can be recorded as 1; if there are 5 identification marks between two adjacent reference marks, the reference marks can be read by binary representation of the 5 identification marks; if two adjacent reference marks are If there are 9 identification marks between adjacent reference marks, the fifth mark can be used as a symmetry mark. The 9 identification marks can be expressed as n0, n1, n2, n3, n4, n3, n2, n1, n0. Five identification marks are extracted from the head or tail end of the 9 identification marks, and the reference marks are read according to the 5 identification marks. By symmetrically reading the identification marks, it can be ensured that the scale line marks in the scale images taken from different sides are the same, and there is no need to calibrate from left to right or from right to left. Through this method, most of the type B and type C marks between two type A marks will appear twice, which can be referenced to each other to improve the reliability of the reading.
[0082] In the embodiment of the present invention, the step of determining the marking relationship and the target marking corresponding to the identification marking according to the reference marking includes:
[0083] generating a positional relationship of the scale mark, and determining whether the number of the reference marks is greater than or equal to two;
[0084] If there are two or more of the reference marks, extracting an identification mark between the two reference marks as a target mark according to the positional relationship;
[0085] If the number of the reference marks is less than two, extracting the target marks according to the number of the identification marks;
[0086] An identification mark other than the target mark is used as a reference mark, and a mark relationship is generated based on the positional relationship, the target mark, and the reference mark.
[0087] In an embodiment of the present invention, if the target mark identified between two reference marks is 9 identification marks, after determining the beginning and the end of the target mark, the identification mark can be extracted with the beginning or the end as the starting point. For example, the 9 identification marks can be obtained in the order of BCBBBBBCB. At this time, the corresponding marking relationship can be that the scale corresponding to the identification mark is between the scales corresponding to the two reference marks; if there is only one reference mark, the identification mark on the side with more than 5 identification marks between the two sides of the reference mark is obtained as the target mark. At this time, the corresponding marking relationship can be that the scale corresponding to the identification mark is greater than or less than the scale corresponding to the reference mark.
[0088] S3. Generate an initial recognition scale according to the target mark and the corresponding binary representation rule, and optimize and recognize the initial recognition scale using the recognition mark and the corresponding mark relationship to obtain a target scale.
[0089] In the embodiment of the present invention, the 9 identification marks obtained according to the type and positional relationship of the target mark are BCBBBBBCB in sequence, and 5 target marks can be selected in sequence from the head end or the tail end of the target mark. The B-type mark can be recorded as 0, and the C-type mark can be recorded as 1, corresponding to n0=0, n1=1, n2=0, n3=0, n4=0, and the constructed binary number is 00010, which is equal to 2, indicating that it is located between the second A-type mark and the third A-type mark. If the range is 30 cm and the first interval length is 10 cm, the reading corresponding to the initial identification scale is 20 cm; in addition, the camera device needs to ensure that the length of the hose captured is greater than a certain range threshold, and the range threshold can be the first interval length or a fixed length.
[0090] In the embodiment of the present invention, after the initial recognition scale is obtained, it can be determined whether the target scale is greater than or less than the initial recognition scale according to the marking relationship.
[0091] In the embodiment of the present invention, the optimizing and identifying the initial identification scale by using the identification mark and the corresponding marking relationship to obtain the target scale includes:
[0092] Determining an optimization direction of the initial recognition scale according to the marking relationship;
[0093] An identification mark smaller than the reference mark among the identification marks is obtained as a mark to be processed, and a calculation is performed according to the mark to be processed and the optimization direction to obtain a target scale.
[0094] In an embodiment of the present invention, the optimization direction includes positive and negative directions. When the optimization direction is positive, an addition operation is performed on the basis of the initial recognition scale; when the optimization direction is negative, a subtraction operation is performed on the basis of the initial recognition scale; the mark to be processed is an recognition mark that is smaller than the reference mark.
[0095] For example, if the measuring range is 30cm and the length of the first interval is 10cm, and there are 9 identification marks between two adjacent reference marks, the reference mark measuring range is 10mm. When each identification mark appears, 10mm is added to the previous identification mark. If two marks to be processed are identified, the measuring range corresponding to the marks to be processed is 20mm. If the optimization direction is negative, 20mm can be subtracted from the initial identification scale reading of 20cm to obtain a target scale of 18cm.
[0096] The present invention ensures that the scale mark can be photographed and recognized from multiple angles by using the annular scale mark type based on the scale image; the accuracy of scale generation is improved by dividing the reference mark and the recognition mark for initial scale generation and optimized recognition; and the efficient reading of scale mark can be achieved through the binary representation rule. Therefore, the endoscope hose scale recognition method proposed by the present invention can accurately recognize the hose scale from multiple angles.
[0097] like Figure 3 The figure is a schematic diagram of the structure of a part of a hose provided by an embodiment of the present invention. The following is a description of each component of the hose in conjunction with a specific embodiment:
[0098] In an embodiment of the present invention, an annular line is arranged around the surface of the hose, and the annular line is a scale line mark. The scale line mark is circumferentially arranged along the axial direction of the hose, and the midpoints of the scale line marks are located on the same plane, and the plane is perpendicular to the axis of the hose. The scale line marks can be divided into type A marks, type B marks and type C marks, and the type A marks, type B marks and type C marks are respectively surrounded on the surface of the hose, wherein the type A mark is composed of a solid line to form a complete ring on the surface of the hose; the type B mark is composed of a dotted line and consists of 6 segments, and the length of each segment is 1 / 12 of the circumference of the cross-section of the hose; the type C mark is composed of a dotted line and consists of 12 segments, and the length of each segment is 1 / 24 of the circumference of the cross-section of the hose. The line width of the scale line mark can be 1 mm, and the scale line mark can have a large display difference from the hose, for example, a color difference.
[0099] In the embodiment of the present invention, for a certain length of measuring range, a reference mark can be set according to different first mark intervals; or for a certain length of measuring range, the first mark interval can be fixed, and multiple reference marks can be determined by calculation based on the measuring range and the fixed first mark interval. For example, if the measuring range is 30cm, and a reference mark is set to appear every 10cm, there are 3 reference marks, and each time a reference mark appears, 10cm is added to the previous reference mark.
[0100] In the embodiment of the present invention, the A-type mark can be used as a reference mark, and the B-type mark and the C-type mark can be used as identification marks; the A-type mark, the B-type mark and the C-type mark are evenly spaced on the surface of the hose; between the nth A-type mark and the n+1th A-type mark, n can be represented by a five-bit binary number, and each bit of the five-bit binary number is recorded as n0, n1, n2, n3, and n4 from low to high, and further, the B-type mark can be recorded as 0, and the C-type mark can be recorded as 1; if there are 5 identification marks between two adjacent reference marks, the reference marks can be read by binary representation of the 5 identification marks; if two adjacent reference marks are If there are 9 identification marks between adjacent reference marks, the fifth mark can be used as a symmetry mark. The 9 identification marks can be expressed as n0, n1, n2, n3, n4, n3, n2, n1, n0. Five identification marks are extracted from the head or tail end of the 9 identification marks, and the reference marks are read according to the 5 identification marks. By symmetrically reading the identification marks, it can be ensured that the scale line marks in the scale images taken from different sides are the same, and there is no need to calibrate from left to right or from right to left. Through this method, most of the type B and type C marks between two type A marks will appear twice, which can be referenced to each other to improve the reliability of the reading.
[0101] In the embodiment of the present invention, the identification mark is located between two adjacent reference marks, and the identification marks are evenly distributed in the reference marks. The number of identification marks can be determined according to the range between the two reference marks and the intervals between different second marks, or according to the range between the two reference marks and the fixed interval between the second marks. For example, if the range between two adjacent reference marks is 10 cm, and the fixed interval between the second marks is set to 10 mm, then one identification mark appears every 10 mm, and there are a total of 9 identification marks between the two adjacent reference marks.
[0102] like Figure 4 , is a functional module diagram of an endoscope hose scale recognition device 100 provided by an embodiment of the present invention. According to the functions to be implemented, the endoscope hose scale recognition device may include an image acquisition module 101, a scale mark recognition module 102, a mark division module 103 and a scale recognition module 104. The module described in the present invention may also be referred to as a unit, which refers to a series of computer program segments that can be executed by a processor of the endoscope hose scale recognition device and can complete fixed functions, and is stored in the memory of the endoscope hose scale recognition device.
[0103] In this embodiment, the functions of each module / unit are as follows:
[0104] The image acquisition module 101 is used to acquire a scale image;
[0105] The scale mark recognition module 102 is used to identify the type of circular scale marks on the scale image to obtain multiple types of scale mark marks;
[0106] The mark division module 103 is used to divide the scale mark into a reference mark and an identification mark, and determine the mark relationship corresponding to the identification mark and the target mark according to the reference mark;
[0107] The scale recognition module 104 is used to generate an initial recognition scale according to the target mark and the corresponding binary representation rule, and optimize the initial recognition scale by using the recognition mark and the corresponding mark relationship to obtain the target scale.
[0108] In detail, each module described in the endoscope hose scale identification device 100 described in the embodiment of the present invention adopts the same technical means as the endoscope hose scale identification method described in the accompanying drawings when used, and can produce the same technical effects, which will not be repeated here.
[0109] like Figure 5 FIG. 1 is a schematic diagram of the structure of an electronic device for implementing an endoscope hose scale recognition method provided by an embodiment of the present invention.
[0110] The electronic device 200 may include a processor 201 , a memory 202 , a communication bus 203 , and a communication interface 204 , and may also include a computer program stored in the memory 202 and executable on the processor 201 , such as an endoscope hose scale recognition program.
[0111] In some embodiments, the processor 201 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 201 is the control core (ControlUnit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules stored in the memory 202 (for example, executing an endoscope hose scale recognition program, etc.), and calls data stored in the memory 202 to execute various functions of the electronic device and process data.
[0112] The memory 202 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. The memory 202 may be an internal storage unit of an electronic device in some embodiments, such as a mobile hard disk of the electronic device. The memory 202 may also be an external storage device of an electronic device in other embodiments, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card, etc. equipped on the electronic device. Further, the memory 202 may also include both an internal storage unit of the electronic device and an external storage device. The memory 202 may not only be used to store application software and various types of data installed in the electronic device, such as the code of the endoscope hose scale recognition program, etc., but may also be used to temporarily store data that has been output or is to be output.
[0113] The communication bus 203 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 202 and at least one processor 201, etc.
[0114] The communication interface 204 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.
[0115] Figure 5 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 5 The structure shown does not constitute a limitation on the electronic device 200 , and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0116] For example, although not shown, the electronic device may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 201 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, etc. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0117] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.
[0118] The endoscope hose scale recognition program stored in the memory 202 in the electronic device 200 is a combination of multiple instructions. When running in the processor 201, it can achieve:
[0119] Acquire a scale image, and perform circular scale line type recognition on the scale image to obtain multiple types of scale line marks;
[0120] Divide the scale mark into a reference mark and an identification mark, and determine the mark relationship corresponding to the identification mark and the target mark according to the reference mark;
[0121] An initial recognition scale is generated according to the target mark and the corresponding binary representation rule, and the initial recognition scale is optimized and recognized using the recognition mark and the corresponding mark relationship to obtain a target scale.
[0122] Specifically, the specific implementation method of the processor 201 for the above instructions can refer to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, which will not be repeated here.
[0123] Furthermore, if the module / unit integrated in the electronic device 200 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).
[0124] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:
[0125] Acquire a scale image, and perform circular scale line type recognition on the scale image to obtain multiple types of scale line marks;
[0126] Divide the scale mark into a reference mark and an identification mark, and determine the mark relationship corresponding to the identification mark and the target mark according to the reference mark;
[0127] An initial recognition scale is generated according to the target mark and the corresponding binary representation rule, and the initial recognition scale is optimized and recognized using the recognition mark and the corresponding mark relationship to obtain a target scale.
[0128] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0129] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0130] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0131] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0132] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
[0133] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
[0134] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A method for identifying the scale of an endoscope hose, characterized in that: The method comprises: Acquire a scale image, and perform circular scale line type recognition on the scale image to obtain multiple types of scale line marks; Divide the scale mark into a reference mark and an identification mark, and determine the mark relationship corresponding to the identification mark and the target mark according to the reference mark; An initial recognition scale is generated according to the target mark and the corresponding binary representation rule, and the initial recognition scale is optimized and recognized using the recognition mark and the corresponding mark relationship to obtain a target scale.
2. The method for recognizing the scale of an endoscope hose according to claim 1, characterized in that: The circular scale line type recognition is performed on the scale image to obtain multiple types of scale line marks, including: Generate a pre-selection frame according to the scale image, and segment the scale image according to the pre-selection frame to obtain an image to be recognized; Feature recognition is performed on the image to be recognized, and multiple types of scale mark marks are determined according to the result of the feature recognition.
3. The method for recognizing the scale of an endoscope hose according to claim 2, characterized in that: The step of generating a pre-selection frame according to the scale image comprises: Pre-positioning the scale image using a pre-trained anchor frame detection model to obtain multiple positioning frames; Cutting the positioning frame to obtain a standard positioning frame; A similarity calculation is performed between a preset image feature library and the standard positioning frame, and a pre-selected frame is determined from the standard positioning frame according to the result of the similarity calculation.
4. The method for recognizing the scale of an endoscope hose according to claim 2, characterized in that: The performing feature recognition on the image to be recognized includes: Performing line recognition on the image to be recognized to obtain a plurality of line features; The line features are screened to obtain target line features.
5. The method for recognizing the scale of an endoscope hose according to claim 4, characterized in that: The step of determining multiple types of scale mark marks according to the result of feature recognition includes: Using the preset marking category rules to match the target line features respectively, to obtain type A marking, type B marking and type C marking; The A-type mark, the B-type mark, and the C-type mark are used as scale mark marks.
6. The method for recognizing the scale of an endoscope hose according to claim 1, characterized in that: The step of determining the marking relationship corresponding to the identification mark and the target mark according to the reference mark comprises: generating a positional relationship of the scale mark, and determining whether the number of the reference marks is greater than or equal to two; If there are two or more of the reference marks, extracting an identification mark between the two reference marks as a target mark according to the positional relationship; If the number of the reference marks is less than two, extracting the target marks according to the number of the identification marks; An identification mark other than the target mark is used as a reference mark, and a mark relationship is generated based on the positional relationship, the target mark, and the reference mark.
7. The method for recognizing the scale of an endoscope hose according to claim 1, characterized in that: The optimizing and identifying the initial identification scale by using the identification mark and the corresponding marking relationship to obtain the target scale includes: Determining an optimization direction of the initial recognition scale according to the marking relationship; An identification mark smaller than the reference mark among the identification marks is obtained as a mark to be processed, and a calculation is performed according to the mark to be processed and the optimization direction to obtain a target scale.
8. An endoscope hose scale identification device, characterized in that: The device comprises: An image acquisition module, used for acquiring a scale image; A scale mark recognition module is used to identify the type of circular scale marks on the scale image to obtain multiple types of scale mark marks; A marking division module, used for dividing the scale mark into a reference mark and an identification mark, and determining a marking relationship corresponding to the identification mark and a target mark according to the reference mark; The scale recognition module is used to generate an initial recognition scale according to the target mark and the corresponding binary representation rule, and optimize the initial recognition scale by using the recognition mark and the corresponding mark relationship to obtain the target scale.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the steps in the endoscope hose scale recognition method according to any one of claims 1 to 7.
10. A hose, characterized in that: Applicable to the endoscope hose scale identification method according to any one of claims 1 to 7, wherein the hose is configured to be cylindrical or tubular; The surface of the hose is provided with multiple types of scale marks distributed at equal intervals, and the scale marks are annular lines surrounding the surface of the hose; The line segment types and line segment lengths of the multiple types of scale mark marks are different.