Method and system for power calibration of laser medical devices

By using machine vision and image processing technology to automatically identify the digital display screen of laser medical equipment, the problem of low efficiency and low accuracy of traditional manual calibration is solved, achieving efficient and accurate power calibration of laser medical equipment, and improving production efficiency and product quality.

CN116999719BActive Publication Date: 2025-12-26CHANGSHA UNIVERSITY OF SCIENCE AND TECHNOLOGY
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310973441.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-03
Publication Date
2025-12-26
Estimated Expiration
2043-08-03

AI Technical Summary

Technical Problem

Traditional laser medical equipment power calibration relies on manual operation, which results in a cumbersome, inefficient, and inaccurate process, and is subject to human error.

Method used

Using machine vision technology and image processing methods, the image of the laser power meter display screen is acquired through the image acquisition unit. The image is preprocessed and segmented using OpenCV library functions. Recognition lines are defined to identify the position of each segment of the digital tube. The improved threading method is combined to identify the numbers. The calibration results are sent through the Socket communication protocol.

Benefits of technology

It has automated the power calibration of laser medical equipment, improved calibration efficiency and accuracy, reduced the degree of human intervention, achieved an accuracy rate of 99%, and significantly improved production efficiency and product quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116999719B_ABST
    Figure CN116999719B_ABST
Patent Text Reader

Abstract

The application discloses a kind of laser medical equipment power calibration method and system, the method includes obtaining the image on laser power meter display screen;Target area is intercepted from image, and target area is pretreated;After the image is segmented, digital image is obtained;According to the width and height of the rectangle circumscribed to each digital image definition identification line;According to the position of each segment of nixie tube, whether corresponding segment exists is determined according to the pixel value of each segment of nixie tube, and then the number of corresponding digital image is identified;According to the number of all digital images, the identification result of laser power meter is determined;The identification result is sent to the laser medical equipment, and the laser medical equipment is calibrated according to the identification result.The present application can complete the power calibration of laser medical equipment in automatic mode by introducing machine vision and image processing technology, greatly reduces the degree of manual participation, and improves the calibration efficiency of equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of laser medical equipment calibration technology, and particularly relates to a laser medical equipment power calibration method and system based on machine vision. Background Technology

[0002] Laser medicine refers to the use of laser technology to research, diagnose, and treat diseases. It primarily utilizes different wavelengths of laser light to create biological effects on human organs and tissues to achieve therapeutic goals. Laser medical equipment is the foundation of laser medicine. Due to intense market competition, reducing production costs and improving the production efficiency of laser medical equipment are paramount for manufacturers to increase profits and seize market share. Because medical products have high reliability requirements, the accuracy of the laser power output of laser medical equipment is a crucial parameter for evaluating its quality. Each laser medical device needs to have its output laser power calibrated before leaving the factory so that users can match the corresponding current value when setting each power parameter.

[0003] Domestically and internationally, there are increasingly higher requirements for the accuracy of laser equipment power output, leading to continuous improvements in the accuracy of laser power measurement systems for calibrating laser medical equipment. Currently, most companies perform laser power calibration on laser medical equipment manually, such as... Figure 1 As shown in the diagram, workers on the production line open the calibration interface of the laser medical equipment, gradually increase the power of the equipment, and use a laser power meter to display the output laser power. They then visually read and record the meter readings, calculate the error, and record it in the equipment's production manual. If a mismatch occurs between the drive current and the output laser power, the corresponding laser power value needs to be written into the equipment. Manually calibrating the laser power of a laser medical equipment has the following limitations:

[0004] The operation process is cumbersome, time-consuming, and inefficient. Furthermore, it cannot rule out the possibility of large calibration errors caused by inaccurate data writing due to factors such as human fatigue. Summary of the Invention

[0005] The purpose of this invention is to provide a method and system for power calibration of laser medical devices, so as to solve the problems that traditional calibration methods require manual intervention, resulting in cumbersome operation, low accuracy, low efficiency and high labor costs.

[0006] This invention solves the above-mentioned technical problems through the following technical solution: a laser medical device power calibration method, wherein the output end of the laser medical device is connected to a laser power meter, and the calibration method includes:

[0007] acquire an image on a display screen of a laser power meter, wherein the image is a nixie tube image;

[0008] cut out a target region from the nixie tube image, and pre-process the target region to obtain a morphological operation graph;

[0009] segment the morphological operation graph to obtain a segmented digital image;

[0010] acquire the width and height of the circumscribed rectangle of each digital image, and define a recognition line according to the width and height of the circumscribed rectangle of each digital image;

[0011] determine the position of each segment of the nixie tube in each digital image according to the recognition line, and determine whether the corresponding segment exists according to the pixel value of each segment of the nixie tube, thereby identifying the number of the corresponding digital image;

[0012] determine the recognition result of the laser power meter according to the numbers of all digital images;

[0013] send the recognition result to the laser medical device, and calibrate the laser medical device according to the recognition result.

[0014] Further, the target region is cut out from the nixie tube image, specifically including:

[0015] convert the nixie tube image from RGB color space to HSV color space to obtain a converted image;

[0016] find the contour from the converted image by using the OpenCV library function cv.findContours();

[0017] acquire the area of the largest contour by using the python library function sorted(), and obtain the center point coordinates, length and width of the largest contour by using the function cv.minArearect();

[0018] obtain the vertex coordinates of the largest contour by using the function cv.boxPoints(), and cut out the target region according to the vertex coordinates.

[0019] Further, the target region is pre-processed, specifically including:

[0020] gray-scale process the target region;

[0021] binary process the image after gray-scale processing;

[0022] perform morphological operation erosion and expansion processing on the image after binary processing to obtain the morphological operation graph.

[0023] Further, the morphological operation graph is segmented, specifically comprising:

[0024] The white pixel points of the morphological operation graph are counted by projection;

[0025] The starting point and the ending point of the segmentation are determined according to the counting result;

[0026] Each digital image is segmented according to the starting point and the ending point.

[0027] Further, the identification line is defined according to the width and the height of the circumscribed rectangle of each digital image, specifically comprising:

[0028] A coordinate system is established with the lower left corner of the circumscribed rectangle of the digital image as the origin, the width direction as the X-axis, and the height direction as the Y-axis;

[0029] A straight line passing through the origin and parallel to the X-axis is defined as the first identification line l1, a straight line passing through the point (0, h / 3) and parallel to the X-axis is defined as the second identification line l2, a straight line passing through the point (0, 2h / 3) and parallel to the X-axis is defined as the third identification line l3, a straight line passing through the point (0, h) and parallel to the X-axis is defined as the fourth identification line l4, a straight line passing through the origin and parallel to the Y-axis is defined as the fifth identification line l5, a straight line passing through the point (2w / 5, 0) and parallel to the Y-axis is defined as the sixth identification line l6, a straight line passing through the point (w, 0) and parallel to the Y-axis is defined as the seventh identification line l7, a straight line passing through the point (20w / 21, h / 21) and parallel to the X-axis is defined as the eighth identification line l8, and a straight line passing through the point (20w / 21, h / 21) and parallel to the Y-axis is defined as the ninth identification line l9; wherein w is the width of the circumscribed rectangle of the digital image, and h is the height of the circumscribed rectangle of the digital image.

[0030] Further, the positions of each segment of the nixie tube in each digital image are determined according to the identification line, specifically comprising:

[0031] The position of the a segment of the nixie tube in the digital image is determined according to the intersection of the third identification line l3, the fourth identification line l4, and the sixth identification line l6;

[0032] The position of the b segment of the nixie tube in the digital image is determined according to the intersection of the sixth identification line l6, the seventh identification line l7, and the third identification line l3;

[0033] The position of the c segment of the nixie tube in the digital image is determined according to the intersection of the sixth identification line l6, the seventh identification line l7, and the second identification line l2;

[0034] The position of the d segment of the nixie tube in the digital image is determined according to the intersection of the first identification line l1, the second identification line l2, and the sixth identification line l6;

[0035] The position of the segment e of the nixie tube in the digital image is determined according to the intersection of the fifth identification line l5, the sixth identification line l6 and the second identification line l2;

[0036] The position of the segment f of the nixie tube in the digital image is determined according to the intersection of the fifth identification line l5, the sixth identification line l6 and the third identification line l3;

[0037] The position of the segment g of the nixie tube in the digital image is determined according to the intersection of the second identification line l2, the third identification line l3 and the sixth identification line l6;

[0038] The position of the segment dp of the nixie tube in the digital image is determined according to the intersection of the eighth identification line l8 and the ninth identification line l9.

[0039] Further, the number of each digital image is identified, and specifically comprising:

[0040] If the aspect ratio of the digital image is greater than 3 and the pixel value of the segment dp of the nixie tube is greater than 200, the number of the digital image is 1; if the aspect ratio of the digital image is greater than 3 and the pixel value of the segment dp of the nixie tube is less than 200, the number of the digital image is 1;

[0041] If the number of the digital image is not 1 or 1, the number of the digital image is determined according to whether each segment of the nixie tube in the digital image exists, and specifically comprising:

[0042] When the segments a, b, c, d, e and f all exist, the number of the digital image is 0; when the segments a, b, c, d, e, f and dp all exist, the number of the digital image is 0.

[0043] When the segments a, b, g, d and e all exist, the number of the digital image is 2; when the segments a, b, g, d, e and dp all exist, the number of the digital image is 2.

[0044] When the segments a, b, c, d and g all exist, the number of the digital image is 3; when the segments a, b, c, d, g and dp all exist, the number of the digital image is 3.

[0045] When the segments b, c, g and f all exist, the number of the digital image is 4; when the segments b, c, g, f and dp all exist, the number of the digital image is 4.

[0046] When the segments a, c, d, f and g all exist, the number of the digital image is 5; when the segments a, c, d, f, g and dp all exist, the number of the digital image is 5.

[0047] When the a section, the g section, the c section, the d section, the e section, and the f section all exist, the number of the digital image is 6; when the a section, the g section, the c section, the d section, the e section, the f section, and the dp section all exist, the number of the digital image is 6.

[0048] When the a section, the b section, and the c section all exist, the number of the digital image is 7; when the a section, the b section, the c section, and the dp section all exist, the number of the digital image is 7; or, when the a section, the b section, the c section, and the d section all exist, the number of the digital image is 7; when the a section, the b section, the c section, the d section, and the dp section all exist, the number of the digital image is 7.

[0049] When the a section, the b section, the c section, the d section, the e section, the f section, and the g section all exist, the number of the digital image is 8; when the a section, the b section, the c section, the d section, the e section, the f section, the g section, and the dp section all exist, the number of the digital image is 8.

[0050] When the a section, the b section, the c section, the d section, the f section, and the g section all exist, the number of the digital image is 9; when the a section, the b section, the c section, the d section, the f section, the g section, and the dp section all exist, the number of the digital image is 9.

[0051] Further, before acquiring the image on the display screen of the laser power meter, the calibration method further comprises:

[0052] establishing a Socket connection with the laser medical device;

[0053] acquiring an opening calibration request initiated by the laser medical device, and acquiring an image on the display screen of the laser power meter corresponding to the laser medical device according to the opening calibration request;

[0054] after sending the recognition result to the laser medical device, when an ending communication request sent by the laser medical device is acquired, the Socket connection between the laser medical device is disconnected.

[0055] Further, before sending the recognition result to the laser medical device, the calibration method further comprises a step of filtering the recognition result, specifically comprising:

[0056] determining whether the recognition result is a floating point number, if it is a floating point number, using the python library function str.split() to determine whether the recognition result is a decimal number; if it is a decimal number, using the function len() to determine whether it is two significant digits after the decimal point, if it is two significant digits after the decimal point, the function len() returns the decimal number with two significant digits after the decimal point, and the decimal number with two significant digits after the decimal point is taken as the recognition result.

[0057] Based on the same concept, the application also provides a laser medical equipment power calibration system, comprising a laser power meter, an image acquisition unit and an upper computer; the output end of the laser medical equipment is connected with the laser power meter, the image acquisition unit is connected with the upper computer, and the upper computer is connected with the laser medical equipment through Socket communication; each laser medical equipment is configured with a laser power meter and an image acquisition unit; the upper computer comprises:

[0058] an image acquisition unit configured to acquire an image on a display screen of the laser power meter, wherein the image is a digital tube image;

[0059] a preprocessing unit configured to intercept a target region from the digital tube image and perform preprocessing on the target region to obtain a morphological operation graph;

[0060] a segmentation unit configured to segment the morphological operation graph to obtain a segmented digital image;

[0061] a recognition line defining unit configured to acquire the width and height of a circumscribed rectangle of each digital image and define a recognition line according to the width and height of the circumscribed rectangle of each digital image;

[0062] a recognition unit configured to determine the position of each segment of the digital tube in each digital image according to the recognition line, determine whether the corresponding segment exists according to the pixel value of each segment of the digital tube, and further recognize the number of the corresponding digital image;

[0063] a determination unit configured to determine the recognition result of the laser power meter according to the numbers of all digital images;

[0064] a feedback unit configured to send the obtained recognition result to the laser medical equipment.

[0065] Advantages

[0066] Compared with the prior art, the application has the following advantages:

[0067] The improved threading method is used to recognize the image on the display screen of the laser power meter, and the recognition result is sent to the laser medical equipment through the Socket communication protocol, the power calibration of the laser medical equipment can be completed in an automatic mode by introducing the machine vision technology and the image processing technology, the degree of human participation is greatly reduced, the equipment calibration efficiency is improved, and the calibration cost is reduced;

[0068] The improved threading method can quickly and accurately recognize each number displayed by the laser power meter, the recognition accuracy reaches 99%, the equipment calibration precision is greatly improved, the output power precision of the laser medical equipment can be improved before the laser medical equipment is shipped, and the quality and the pass rate of products in industrial production are very important.

[0069] The host computer of the present application is connected with the laser medical device through a Socket communication protocol, and the simultaneous calibration of multiple laser medical devices is realized by using a multi-thread mode, and the identification result issued to the laser medical device can reach 4 data per second, which can meet the real-time identification and transmission of the output power of the laser medical device; at the same time, the simultaneous calibration of multiple laser medical devices can greatly increase the calibration efficiency of the laser medical device, compared with the traditional manual calibration, the production efficiency can be greatly improved, the cost can be saved to a greater extent, and the present application has very high practical value. BRIEF DESCRIPTION OF DRAWINGS

[0070] In order to more clearly illustrate the technical solutions of the present application, the drawings needed in the following embodiment description will be briefly introduced, and obviously, the drawings in the following description are only one embodiment of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0071] Figure 1 is a traditional manual calibration flowchart in the background art of the present application;

[0072] Figure 2 is a laser medical device power calibration system framework diagram in the embodiment of the present application;

[0073] Figure 3 is a laser medical device power calibration method flowchart in the embodiment of the present application;

[0074] Figure 4 is a main program flowchart in the embodiment of the present application;

[0075] Figure 5 is a multi-laser medical device operation diagram in the embodiment of the present application;

[0076] Fig. 6(a) is a figure of the number 0.48 in the embodiment of the present application;

[0077] Fig. 6(b) is a figure of the number 0.95 in the embodiment of the present application;

[0078] Fig. 6(c) is an HSV diagram of the number 0.48 in the embodiment of the present application;

[0079] Fig. 6(d) is an HSV diagram of the number 0.95 in the embodiment of the present application;

[0080] Fig. 6(e) is a cut-off diagram of the number 0.48 in the embodiment of the present application;

[0081] Fig. 6(f) is a cut-off diagram of the number 0.95 in the embodiment of the present application;

[0082] Figure 7(a) is a morphological operation diagram of the number 0.48 in the embodiment of the present application;

[0083] Figure 7(b) is a morphological operation diagram of the number 0.95 in the embodiment of the present application;

[0084] Figure 8(a) is a segmentation diagram of the number 0.48 in the embodiment of the present application;

[0085] Figure 8(b) is a segmentation diagram of the number 0.95 in the embodiment of the present application;

[0086] Figure 9 Figure 9 is a principle diagram of the improved threading method in the embodiment of the present application;

[0087] Figure 10(a) is a diagram of the number 1 in the embodiment of the present application;

[0088] Figure 10(b) is a diagram of the number 1. in the embodiment of the present application;

[0089] Figure 11(a) is a diagram of the number 7 in the embodiment of the present application;

[0090] Figure 11(b) is a diagram of the number 7. in the embodiment of the present application;

[0091] Figure 12 Figure 12 is a GUI interface of the host computer software in the embodiment of the present application. DETAILED DESCRIPTION

[0092] The technical solutions in the present application will be described clearly and completely below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without any creative work fall within the protection scope of the present application.

[0093] The technical solutions of the present application will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes can not be described in some embodiments.

[0094] As Figure 2As shown, the output end of the laser medical device is connected with the laser power meter, an image acquisition unit is used to acquire the image on the display screen of the laser power meter, the image acquisition unit is connected with the host computer, and the host computer is connected with the laser medical device through Socket communication. Each laser medical device corresponds to a laser power meter, each laser power meter corresponds to an image acquisition unit, all the image acquisition units are connected with the host computer, and the host computer is connected with each laser medical device through Socket communication. In the embodiment, the image acquisition unit is a Logitech C270i camera, and the laser power meter is of LP-3C50 type. The laser medical device displays the output laser power on the digital tube display screen of the laser power meter in real time, the camera acquires the image on the digital display screen of the laser power meter, and transmits the image to the host computer through the USB interface, the host computer processes and identifies the image, and then sends the identification result to the laser medical device in real time through Socket communication.

[0095] OpenCV is a cross-platform computer vision library based on BSD license (open source), OpenCV provides interfaces of languages such as Python and MATLAB, and realizes general algorithms of image processing and computer vision. The present application realizes the development of source code based on python language and OpenCV library.

[0096] As Figure 3 shown, the laser medical device power calibration method provided by the embodiment of the present application comprises the following steps:

[0097] Step 1: acquiring the image on the display screen of the laser power meter acquired by the camera, the image being a digital tube image;

[0098] Step 2: cutting out a target region from the digital tube image, and pre-processing the target region to obtain a morphological operation graph;

[0099] Step 3: segmenting the morphological operation graph to obtain a segmented digital image;

[0100] Step 4: acquiring the width and height of the circumscribed rectangle of each digital image, and defining a recognition line according to the width and height of the circumscribed rectangle of each digital image;

[0101] Step 5: determining the position of each segment of the digital tube in each digital image according to the recognition line, and determining whether the corresponding segment exists according to the pixel value of each segment of the digital tube, and then identifying the number of the corresponding digital image;

[0102] Step 6: determining the identification result of the laser power meter according to the numbers of all the digital images;

[0103] Step 7: sending the obtained identification result to the laser medical device, and calibrating the laser medical device according to the identification result.

[0104] As Figure 4 and 5 As shown in step 1, the host computer is connected to the same IP address of the local area network of the laser medical device, and a Socket communication connection is established; the host computer waits for the laser medical device to connect, and after the laser medical device is connected, the host computer waits for the laser medical device to initiate an opening calibration request, decodes the opening calibration request and judges whether the request content is "START-camera serial number-device serial number", if yes, the camera corresponding to the laser medical device is opened, and the image on the display screen of the laser power meter is collected by the camera. After the image is processed and recognized, the recognition result (i.e. the output power of the laser medical device) is obtained, and the host computer continuously issues the recognized real-time result to the laser medical device through Socket communication until the end communication request sent by the laser medical device is received, the communication is ended, the resources are released, and the next laser medical device is connected. Corresponding to the opening calibration request, the content of the end communication request is "STOP-camera serial number-device serial number".

[0105] In step 2, the target region is intercepted from the nixie tube image, specifically including:

[0106] Step 2.11: convert the nixie tube image from RGB color space to HSV color space to obtain the converted image. As shown in FIG. 6(a) and FIG. 6(b), the image collected by the camera is converted from RGB color space to HSV color space, and the obtained image is as shown in FIG. 6(c) and FIG. 6(d).

[0107] Step 2.12: in the HSV color space, find the contour from the converted image by using the OpenCV library function cv.findContours();

[0108] Step 2.13: use the python library function sorted() to obtain the area of the largest contour, and use the function cv.minArearect() to obtain the center point coordinates, length and width of the largest contour;

[0109] Step 2.14: use the function cv.boxPoints() to obtain the vertex coordinates of the largest contour, and intercept the target region according to the vertex coordinates, as shown in FIG. 6(e) and FIG. 6(f).

[0110] The present application locates the target region by finding the circumscribed rectangle of the red nixie tube region of the laser power meter, so as to facilitate the subsequent identification of the numbers of the target region.

[0111] After capturing the target region, it is necessary to remove interference from the image, highlight the target region, and obtain a clear binary image of the digital tube region without noise points. This is of great significance for subsequent digital segmentation and recognition. In this embodiment, the target region is mainly processed by grayscale conversion, binarization, morphological operations such as erosion and dilation to complete the accurate digital segmentation and recognition work, resulting in the morphological operation images shown in Figure 7(a) and Figure 7(b).

[0112] In step 3, the present invention uses the vertical and horizontal projection commonly used in OpenCV in the field of computer vision to accurately segment the morphological operation map. The specific implementation method is as follows: the white pixels of the morphological operation map are counted by projection, a threshold is set according to the statistical results and the starting point and ending point of segmentation are determined, and then each digital image is segmented according to the position coordinates of the starting point and ending point, as shown in Figure 8(a) and Figure 8(b).

[0113] This invention employs an improved threading method to recognize each digital image, thereby identifying the digits within each image. It achieves the recognition of tilted digital tube characters with decimal points without requiring image correction, solving the problem of recognizing digits and decimal points on tilted digital tubes. The improved threading method includes steps 4 to 6.

[0114] like Figure 9 As shown, in step 4, the recognition line is defined based on the width and height of the bounding rectangle of each digital image, specifically including:

[0115] Establish a coordinate system with the lower left corner of the bounding rectangle of the digital image as the origin, the width direction as the X-axis, and the height direction as the Y-axis;

[0116] Define the following lines as follows: the first recognition line l1 is the line passing through the origin and parallel to the X-axis; the second recognition line l2 is the line passing through the point (0, h / 3) and parallel to the X-axis; the third recognition line l3 is the line passing through the point (0, 2h / 3) and parallel to the X-axis; the fourth recognition line l4 is the line passing through the point (0, h) and parallel to the X-axis; the fifth recognition line l5 is the line passing through the origin and parallel to the Y-axis; the sixth recognition line l6 is the line passing through the point (2w / 5, 0) and parallel to the Y-axis; the seventh recognition line l7 is the line passing through the point (w, 0) and parallel to the Y-axis; the eighth recognition line l8 is the line passing through the point (20w / 21, h / 21) and parallel to the X-axis; and the ninth recognition line l9 is the line passing through the point (20w / 21, h / 21) and parallel to the Y-axis. Here, w is the width of the bounding rectangle of the digital image, and h is the height of the bounding rectangle of the digital image.

[0117] In step 5, the positions of each segment of the digital tube in each digital image are determined based on the 9 recognition lines, specifically including:

[0118] The position of the a segment of the digital tube in the digital image is determined according to the intersection of the third identification line l3, the fourth identification line l4 and the sixth identification line l6; the position of the b segment of the digital tube in the digital image is determined according to the intersection of the sixth identification line l6, the seventh identification line l7 and the third identification line l3; the position of the c segment of the digital tube in the digital image is determined according to the intersection of the sixth identification line l6, the seventh identification line l7 and the second identification line l2; the position of the d segment of the digital tube in the digital image is determined according to the intersection of the first identification line l1, the second identification line l2 and the sixth identification line l6; the position of the e segment of the digital tube in the digital image is determined according to the intersection of the fifth identification line l5, the sixth identification line l6 and the second identification line l2; the position of the f segment of the digital tube in the digital image is determined according to the intersection of the fifth identification line l5, the sixth identification line l6 and the third identification line l3; the position of the g segment of the digital tube in the digital image is determined according to the intersection of the second identification line l2, the third identification line l3 and the sixth identification line l6; and the position of the dp segment of the digital tube in the digital image is determined according to the intersection of the eighth identification line l8 and the ninth identification line l9. The identification lines required for determining the positions of the segments (a, b, c, d, e, f, g, dp segments) of the digital tube are shown in Table 1.

[0119] Table 1 Identification lines required for determining the positions of the segments of the digital tube

[0120] ​ [l2] [l3] ​ [l5] [l6] [l7] [l9] [l8] a √ √ √ b √ √ √ c √ √ √ d √ √ √ e √ √ √ f √ √ √ g √ √ √ p √ √

[0121] For example, the determination of the position of the a segment is a straight line segment of two intersection points of the straight lines h, h2 and w1. The determination methods of the positions of the b, c, d, e, f and g segments are consistent with that of the a segment. For the identification of the decimal point, the intersection dp of the special straight lines pw and ph is defined.

[0122] In the RGB color space, the pixel value of the white color is 255 and the pixel value of the black color is 0. The pixel values of the segments of the digital tube are scanned vertically and horizontally. When the pixel value of the a, b, c, d, e, f, g or dp segment is greater than 200, the corresponding segment exists; otherwise, the corresponding segment does not exist. Then, the number in the digital image is further identified according to whether the segments of the digital tube exist or not, as shown in Table 2. In Table 2, if the segment exists, a "√" is drawn; if the segment does not exist, it is left blank. For example, as shown in Table 2, the pixel values of the a, b, c, d, e, f and p segments are all greater than 200, while the pixel value of the g segment of the digital tube is less than 200, and then the character is identified as 0. Figure 9

[0123] Table 2 Different segments correspond to different numbers

[0124]

[0125]

[0126] ​As shown in FIG. 10(a) and FIG. 10(b), the number 1 and 1. have obvious features that are different from other numbers, i.e. the aspect ratio is greater than 3, and then it is judged according to whether the dp segment pixel value is greater than 200, if the aspect ratio is greater than 3 and the dp segment pixel value is greater than 200, it is identified as 1.; if the aspect ratio is greater than 3 and the dp segment pixel value is less than 200, it is identified as 1. If the aspect ratio is less than 3, it is judged according to Table 2 which specific number it is.

[0127] As shown in FIG. 11(a) and FIG. 11(b), since the number 7 and 7. may be ambiguous in the d segment, Table 2 adds a way to determine, making the identification more accurate.

[0128] At present, the calibration number required by the laser medical equipment is a decimal number with two significant digits, and the decimal number obtained by the host computer recognition belongs to a floating point number in the Python program language. In order to ensure that the number sent to the laser medical equipment through Socket communication is accurate and is a decimal number with two significant digits, the non-floating point number (for example, 048) or the decimal number with more than two significant digits (for example, 0.488) is filtered, so that the number sent to the laser medical equipment is accurate and is a decimal number with two significant digits. The specific implementation is: judging whether the recognition result is a floating point number, if it is a floating point number, using the python library function str.split() to judge whether the recognition result is a decimal number; if it is a decimal number, using the function len() to judge whether it is a decimal number with two significant digits after the decimal point, if it is a decimal number with two significant digits after the decimal point, the function len() returns a decimal number with two significant digits after the decimal point, and the decimal number with two significant digits after the decimal point is taken as the recognition result. Through the digital filtering, the problem of inaccurate recognition caused by frame taking of the camera real-time recognition is excluded, and the interference number is filtered. After the recognition result is sent to the laser medical equipment, the drive current matching the recognition result (i.e. the output power) is written into the laser medical equipment and stored, and then the calibration of the next output power point is carried out, until all the output power points are calibrated. Then, it is verified whether the theoretical output power of the laser medical equipment matches the actual output power.

[0129] In the recognition process, some interference factors may cause inaccurate recognition results, therefore, the recognition results are filtered, and finally a floating point number containing two decimal places is output, and other interference data will not appear.

[0130] The present application uses multi-threading to realize the calibration of multiple laser medical equipment at the same time, and the recognition result sent by the host computer software to the laser medical equipment can reach 4 data per second, which can meet the real-time recognition and transmission of the output power of the laser medical equipment. At the same time, the simultaneous calibration of multiple laser medical equipment can greatly increase the calibration efficiency, greatly improve the production efficiency compared with the traditional manual calibration, and save the cost to a greater extent.

[0131] The laser medical equipment power calibration is based on a machine vision mode, and a projection method and an improved threading method are used for image processing on a digital tube number on a digital tube display screen of a laser power meter. The projection method can quickly and accurately separate each number in the digital tube image, and then the improved threading method is used to accurately identify each number according to the characteristics of the digital tube display number. After a data filtering algorithm, the data accuracy rate of the laser medical equipment is as high as 99%, which meets the data requirements of the laser medical equipment calibration.

[0132] As shown in Figure 2 The embodiment of the present application also provides a laser medical equipment power calibration system, which comprises a laser power meter, an image acquisition unit and a host computer. The output end of the laser medical equipment is connected with the laser power meter, the image acquisition unit is used for acquiring the image on the display screen of the laser power meter, the image acquisition unit is connected with the host computer, and the host computer is connected with the laser medical equipment through Socket communication. Each laser medical equipment corresponds to a laser power meter, each laser power meter corresponds to an image acquisition unit, all the image acquisition units are connected with the host computer, and the host computer is connected with each laser medical equipment through Socket communication. In the embodiment, the image acquisition unit is a Logitech C270i camera, and the laser power meter is an LP-3C50 type. The laser medical equipment displays the output laser power on the digital tube display screen of the laser power meter in real time, the camera acquires the image on the digital tube display screen of the laser power meter and transmits the image to the host computer through a USB interface, the host computer processes and identifies the image, and then transmits the identification result to the laser medical equipment in real time through Socket communication.

[0133] The host computer comprises:

[0134] an image acquisition unit, which is used for acquiring the image on the display screen of the laser power meter, wherein the image is a digital tube image;

[0135] a preprocessing unit, which is used for intercepting a target region from the digital tube image and pre-processing the target region to obtain a morphological operation graph;

[0136] a segmentation unit, which is used for segmenting the morphological operation graph to obtain a segmented digital image;

[0137] an identification line definition unit, which is used for acquiring the width and height of the circumscribed rectangle of each digital image and defining an identification line according to the width and height of the circumscribed rectangle of each digital image;

[0138] an identification unit, which is used for determining the positions of the segments of the digital tube in each digital image according to the identification line, determining whether the corresponding segment exists according to the pixel value of the segment of the digital tube, and then identifying the number of the corresponding digital image.

[0139] a determining unit configured to determine the identification result of the laser power meter according to the numbers of all the digital images;

[0140] a feedback unit configured to send the obtained identification result to the laser medical device.

[0141] As shown in Figure 12 The software built in the host computer is designed with an operation interface, so that the user can complete the quick operation of the calibration method of the application through the operation interface. The IPv4 address of the wireless local area network is input and bound in the operation interface, and the log column will prompt "server IP address: the device has been started, waiting for the client to connect!". Then, the laser medical instrument device is connected to the same IPv4 address, connected to the host computer, and sends "START-camera serial number-product serial number" to the host computer, so that the digital tube number identified by the host computer can be received, and after waiting for the calibration to be completed, "STOP-camera serial number-product serial number" is input, so that this connection is ended.

[0142] The above only discloses specific embodiments of the application, but the protection scope of the application is not limited thereto, and any person skilled in the art can easily think of changes or modifications within the technical range disclosed by the application, which should be covered within the protection scope of the application.

Claims

1. A method for calibrating the power of a laser medical device, the output of which is connected to a laser power meter, characterized in that, The calibration method comprises: establishing a Socket communication connection with the laser medical device and receiving an opening calibration request sent by the laser medical device; in response to the opening calibration request, acquiring a digital tube image on a display screen of a laser power meter corresponding to the laser medical device; cutting out a target region from the digital tube image and pre-processing the target region to obtain a morphological operation graph; segmenting the morphological operation graph to obtain a segmented digital image; acquiring the width and height of the circumscribed rectangle of each digital image, and defining a recognition line according to the width and height of the circumscribed rectangle of each digital image; determining the position of each segment of the digital tube in each digital image according to the recognition line, and determining whether the corresponding segment exists according to the pixel value of each segment of the digital tube, and further identifying the number of the corresponding digital image; determining the recognition result of the laser power meter according to the numbers of all digital images; filtering the recognition result to obtain a decimal number with two significant digits after the decimal point; sending the filtered recognition result to the laser medical device through Socket communication, so that the laser medical device performs power calibration according to the recognition result; after receiving an end communication request sent by the laser medical device, disconnecting the Socket connection.

2. The method of claim 1, wherein, cutting out a target region from the digital tube image, specifically comprising: converting the digital tube image from an RGB color space to an HSV color space to obtain a converted image; finding contours from the converted image by using an OpenCV library function cv.findContours(); acquiring the area of the largest contour by using a python library function sorted(), and obtaining the center point coordinates, length and width of the largest contour by using a function cv.minArearect(); obtaining the vertex coordinates of the largest contour by using a function cv.boxPoints(), and cutting out the target region according to the vertex coordinates.

3. The method of claim 1, wherein, pre-processing the target region, specifically comprising: gray-scale processing the target region; binaryzation processing the image after gray-scale processing; morphological operation erosion and expansion processing the image after binaryzation processing to obtain the morphological operation graph.

4. The method of claim 1, wherein, segmenting the morphological operation graph, specifically comprising: statistically counting the white pixel points of the morphological operation graph by projection; determining the starting point and ending point of segmentation according to the statistical result; segmenting each digital image according to the starting point and ending point.

5. The method of claim 1-4, wherein, defining a recognition line according to the width and height of the circumscribed rectangle of each digital image, specifically comprising: establishing a coordinate system with the lower left corner of the circumscribed rectangle of the digital image as the origin, the width direction as the X axis, and the height direction as the Y axis; The first identification line l1 is defined as a straight line passing through the origin and parallel to the X axis, the second identification line l2 is defined as a straight line passing through the point (0, h / 3) and parallel to the X axis, the third identification line l3 is defined as a straight line passing through the point (0, 2h / 3) and parallel to the X axis, the fourth identification line l4 is defined as a straight line passing through the point (0, h) and parallel to the X axis, the fifth identification line l5 is defined as a straight line passing through the origin and parallel to the Y axis, the sixth identification line l6 is defined as a straight line passing through the point (2w / 5, 0) and parallel to the Y axis, the seventh identification line l7 is defined as a straight line passing through the point (w, 0) and parallel to the Y axis, the eighth identification line l8 is defined as a straight line passing through the point (20w / 21, h / 21) and parallel to the X axis, and the ninth identification line l9 is defined as a straight line passing through the point (20w / 21, h / 21) and parallel to the Y axis; wherein w is the width of the outer rectangle of the digital image, and h is the height of the outer rectangle of the digital image.

6. The method of claim 5, wherein, The positions of the segments of the Nixie tube in each digital image are determined according to the identification lines, and specifically include the following steps. The position of the a segment of the Nixie tube in the digital image is determined according to the intersection of the third identification line l3, the fourth identification line l4 and the sixth identification line l6. The position of the b segment of the Nixie tube in the digital image is determined according to the intersection of the sixth identification line l6, the seventh identification line l7 and the third identification line l3. The position of the c segment of the Nixie tube in the digital image is determined according to the intersection of the sixth identification line l6, the seventh identification line l7 and the second identification line l2. The position of the d segment of the Nixie tube in the digital image is determined according to the intersection of the first identification line l1, the second identification line l2 and the sixth identification line l6. The position of the e segment of the Nixie tube in the digital image is determined according to the intersection of the fifth identification line l5, the sixth identification line l6 and the second identification line l2. The position of the f segment of the Nixie tube in the digital image is determined according to the intersection of the fifth identification line l5, the sixth identification line l6 and the third identification line l3. The position of the g segment of the Nixie tube in the digital image is determined according to the intersection of the second identification line l2, the third identification line l3 and the sixth identification line l6. The position of the dp segment of the Nixie tube in the digital image is determined according to the intersection of the eighth identification line l8 and the ninth identification line l9.

7. The method of claim 6, wherein, The number of each digital image is identified, and specifically includes the following steps. If the aspect ratio of the digital image is greater than 3 and the pixel value of the dp segment of the Nixie tube is greater than 200, the number of the digital image is 1; if the aspect ratio of the digital image is greater than 3 and the pixel value of the dp segment of the Nixie tube is less than 200, the number of the digital image is 1. If the number of the digital image is not 1 or 1, the number of the digital image is determined according to whether each segment of the Nixie tube exists in the digital image, and specifically includes the following steps. When the a segment, the b segment, the c segment, the d segment, the e segment and the f segment all exist, the number of the digital image is 0; when the a segment, the b segment, the c segment, the d segment, the e segment, the f segment and the dp segment all exist, the number of the digital image is 0. When the a segment, the b segment, the g segment, the d segment and the e segment all exist, the number of the digital image is 2; when the a segment, the b segment, the g segment, the d segment, the e segment and the dp segment all exist, the number of the digital image is 2. When the a section, the b section, the c section, the d section and the g section all exist, the number of the digital image is 3; when the a section, the b section, the c section, the d section, the g section and the dp section all exist, the number of the digital image is 3. When the b section, the c section, the g section and the f section all exist, the number of the digital image is 4; when the b section, the c section, the g section, the f section and the dp section all exist, the number of the digital image is 4. When the a section, the c section, the d section, the f section and the g section all exist, the number of the digital image is 5; when the a section, the c section, the d section, the f section, the g section and the dp section all exist, the number of the digital image is 5. When the a section, the g section, the c section, the d section, the e section and the f section all exist, the number of the digital image is 6; when the a section, the g section, the c section, the d section, the e section, the f section and the dp section all exist, the number of the digital image is 6. When the a section, the b section and the c section all exist, the number of the digital image is 7; when the a section, the b section, the c section and the dp section all exist, the number of the digital image is 7; or, when the a section, the b section, the c section and the d section all exist, the number of the digital image is 7; when the a section, the b section, the c section, the d section and the dp section all exist, the number of the digital image is 7. When the a section, the b section, the c section, the d section, the e section, the f section and the g section all exist, the number of the digital image is 8; when the a section, the b section, the c section, the d section, the e section, the f section, the g section and the dp section all exist, the number of the digital image is 8. When the a section, the b section, the c section, the d section, the f section and the g section all exist, the number of the digital image is 9; when the a section, the b section, the c section, the d section, the f section, the g section and the dp section all exist, the number of the digital image is 9.

8. The method of claim 1, wherein, Before sending the identification result to the laser medical device, the calibration method further comprises a step of filtering the identification result, specifically comprising: determining whether the identification result is a floating point number, if yes, using the python library function str.split() to determine whether the identification result is a decimal number; if it is a decimal number, using the function len() to determine whether it is two significant digits after the decimal point, if it is two significant digits after the decimal point, the function len() returns the decimal number with two significant digits after the decimal point, and the decimal number with two significant digits after the decimal point is taken as the identification result.

9. A laser medical device power calibration system, characterized by, The system comprises a laser power meter, an image acquisition unit and a host computer; the output end of the laser medical device is connected with the laser power meter, the image acquisition unit is connected with the host computer, and the host computer is connected with the laser medical device through Socket communication; each laser medical device is configured with a laser power meter and an image acquisition unit; the host computer comprises: an image acquisition unit, configured to receive an opening calibration request sent by the laser medical device; in response to the opening calibration request, acquire a nixie tube image on a display screen of a laser power meter corresponding to the laser medical device; a preprocessing unit, configured to cut out a target region from the nixie tube image and pre-process the target region to obtain a morphological operation image; The segmentation unit is configured to segment the morphological operation graph to obtain a segmented digital image; The identification line definition unit is configured to obtain the width and height of the bounding rectangle of each digital image, and define an identification line according to the width and height of the bounding rectangle of each digital image; The identification unit is configured to determine the position of each segment of the nixie tube in each digital image according to the identification line, determine whether the corresponding segment exists according to the pixel value of each segment of the nixie tube, and further identify the number of the corresponding digital image; The determination unit is configured to determine the identification result of the laser power meter according to the numbers of all digital images; The filtering unit is configured to filter the identification result to obtain a decimal number with two significant digits after the decimal point; The feedback unit is configured to send the filtered identification result to the laser medical device through Socket communication, so that the laser medical device performs power calibration according to the identification result; and after receiving an end communication request sent by the laser medical device, the Socket connection is disconnected.

Citation Information

Patent Citations

  • Seven-section type digital display instrument recognition method based on minimum enclosing rectangle variant

    CN113159027A

  • Seven-segment nixie tube liquid crystal display screen identification method and system based on deep learning

    CN114519694A

  • Digital instrument reading identification method based on improved threading method

    CN116246277A