Controlled cutter automatic identification system based on artificial intelligence deep learning
Through the automatic identification system of controlled tool based on deep learning of artificial intelligence, the key features of tools are automatically identified and measured using multiple algorithms, the problems of inaccurate identification and cumbersome operation in the existing technology are solved, and fast and accurate controlled tool detection is achieved, which improves detection efficiency and applicability.
Patent Information
- Application Number
- CN202510592623.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-09
- Publication Date
- 2025-08-12
AI Technical Summary
The prior art has problems such as insufficient measurement, cumbersome operation, dependence on specific background cloth and shooting conditions, insufficient stability, and difficulty in adapting to batch rapid detection when identifying controlled tools, which limits its promotion and popularization in actual applications.
The controlled tool automatic recognition system based on deep learning of artificial intelligence is adopted, including image recognition module, image cropping module, image processing module and automatic recognition module. The key features of the tool are automatically identified and measured by algorithms such as YOLO, LSD, RANSAC, DBSCAN, Canny, Hough transformation and ResNet, and reduce manual intervention and errors.
It realizes the rapid and accurate identification and measurement of controlled tools in conventional environments, improves detection efficiency and accuracy, reduces operational complexity, is suitable for different lighting, angles and background conditions, and is versatile and practical.
Smart Images

Figure CN120472227A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of tool identification, and in particular to an automatic identification system for controlled tools based on artificial intelligence deep learning. Background Art
[0002] There are two existing methods: manual measurement with a ruler and measurement via an app, which places the tool to be inspected on a specific background cloth. The second method requires marking the background cloth with auxiliary patterns such as a standard scale, dotted dividing lines, a standard ruler, and a protractor. Using the auxiliary patterns to identify the scale, the user takes a photo using the Control Knife app, manually marking the tip, septum, and tail pixels, along with the scale, in the app to calculate the tip length, tip angle, septum length, and handle length.
[0003] Manual measurement requires specialized skills, and this method suffers from issues like inaccurate results and the inability to make timely on-site determinations. Placing a tool against a specific background and measuring its parameters via an app relies heavily on specialized backgrounds and shooting conditions, increasing the barrier to entry. It also requires users to manually mark multiple key points, a cumbersome and error-prone process. Furthermore, due to the significant influence of human factors and demanding shooting angles and lighting requirements, recognition results lack stability and are difficult to apply to rapid batch inspection scenarios. This significantly impacts overall efficiency and user experience, limiting its widespread adoption in practical applications.
[0004] Therefore, this application designs an automatic identification system for controlled tools based on artificial intelligence deep learning, which can automatically identify controlled tools. Summary of the Invention
[0005] The purpose of the present invention is to provide an automatic identification system for controlled tools based on artificial intelligence deep learning, aiming to solve the above problems and quickly and accurately determine whether a tool is a controlled tool.
[0006] The present invention provides an automatic recognition system for controlled tools based on artificial intelligence deep learning, comprising:
[0007] An image recognition module is configured to obtain an image to be recognized, detect the image to be recognized based on a pre-trained object detection model, and obtain category labels and bounding box coordinates of the tool and ruler;
[0008] an image cropping module configured to crop the image to be identified based on the identification label and the bounding box coordinates to obtain a tool image and a ruler image;
[0009] an image processing module configured to perform scale detection on the ruler image to determine the actual length per unit pixel; perform tool separation detection on the tool image to determine the actual length of the tool handle and the actual length of the tool blade; and further configured to crop the tool image to obtain a tool tip image, and analyze the tool tip image to determine the tool tip angle;
[0010] The automatic identification module is configured to automatically identify the controlled tool according to the actual length of the tool handle, the actual length of the blade and the angle of the tool tip, and output the identification result.
[0011] Preferably, the image to be identified includes a tool and a ruler, and the direction of the tool is leftward or rightward.
[0012] Preferably, the image processing module performs scale detection on the ruler image to determine the actual length per unit pixel, including:
[0013] performing binarization processing on the scale image to obtain a scale binary image;
[0014] Detecting the ruler binary image based on the LSD algorithm to obtain a number of initial scale lines;
[0015] Determine the midpoint coordinates of the initial scale line, and use the RANSAC algorithm to perform straight line fitting on the midpoint coordinates to obtain a fitted straight line;
[0016] Determine the coordinates of the intersection between the fitted straight line and the initial scale line, perform cluster analysis on the intersection coordinates using the DBSCAN algorithm, and determine the scale line that meets the scale characteristics based on the clustering results;
[0017] The actual length per unit pixel is determined according to the scale line.
[0018] Preferably, the image processing module determines the actual length of a unit pixel according to the scale line, including:
[0019] Determine the positions of the scale mark 1 and the scale mark 20 in the scale line, and determine the pixel length of the ruler according to the positions of the scale mark 1 and the scale mark 20;
[0020] Get the actual length of the ruler between scale 1 and scale 20;
[0021] Determine the actual length per unit pixel according to the actual length of the ruler and the pixel length of the ruler;
[0022] The actual length of the unit pixel is calculated according to the following formula:
[0023] M = B / L;
[0024] Among them, M represents the actual length of the unit pixel, B represents the actual length of the ruler, and L represents the pixel length of the ruler.
[0025] Preferably, the image processing module performs a tool separation detection on the tool image to determine the actual length of the tool handle and the actual length of the blade, including:
[0026] performing binarization processing on the tool image to obtain a tool binary image;
[0027] Extracting tool gap features from the tool binary image, enhancing the tool gap edge using Canny edge detection, detecting the straight line features of the tool gap using Hough transform, and obtaining the tool gap pixel length;
[0028] Determine the pixel length of the handle and the pixel length of the blade of the tool based on the pixel length of the tool spacing.
[0029] The actual length of the tool handle and the actual length of the blade of the tool are determined according to the pixel length of the tool handle and the pixel length of the blade.
[0030] Preferably, the image processing module determines the actual length of the handle and the actual length of the blade of the tool according to the pixel length of the handle and the pixel length of the blade, comprising:
[0031] Determine the actual length of the tool handle according to the actual length per unit pixel and the pixel length of the tool handle;
[0032] Determine the actual length of the blade of the tool according to the actual length per unit pixel and the blade pixel length;
[0033] The actual length of the shank is determined according to the following formula:
[0034] RL = RM × M;
[0035] The actual length of the blade is determined according to the following formula:
[0036] BL = BM × M;
[0037] Among them, RL represents the actual length of the handle, RM represents the pixel length of the handle, M represents the actual length per unit pixel, BL represents the actual length of the blade, and BM represents the pixel length of the blade.
[0038] Preferably, the image processing module crops the tool image to obtain a tool tip image, and analyzes the tool tip image to determine the tool tip angle, including:
[0039] The tool image is cropped using an RVM-RES segmentation algorithm to obtain a tool tip image, and the tool tip image is binarized to obtain a tool tip binary image;
[0040] Selecting the leftmost point of the tool tip binary image as a known point, determining the distance between each point in the tool tip binary image and the known point, comparing the distance with the target distance, and screening out close points;
[0041] Perform cluster analysis on close points and determine the mean coordinates of each cluster;
[0042] Determine tool tip coordinates, tool top coordinates, and tool bottom coordinates based on known point coordinates and mean coordinates;
[0043] The tool tip angle is determined based on the tool tip coordinates, the tool upper coordinates, and the tool lower coordinates.
[0044] Preferably, the image processing module determines the tool tip angle based on the tool tip coordinates, the tool top coordinates and the tool bottom coordinates, including:
[0045] Based on the tool tip coordinates, tool top coordinates and tool bottom coordinates, the slope k1 of the line connecting the tool tip and the tool top, and the slope k2 of the line connecting the tool tip and the tool bottom are determined.
[0046] Determine a tangent function of a tool tip angle θ according to the slope k1 and the slope k2, and determine the tool tip angle θ according to the tangent function of the tool tip angle θ;
[0047] The tangent function of the tool tip angle θ is: tanθ=|k1-k2 / 1+k1k2|;
[0048] or,
[0049] Set the tool tip coordinates to (Ax, Ay), the tool bottom coordinates to (Bx, By), and the tool top coordinates to (Cx, Cy);
[0050] Determine the vector between the tip of the knife and the bottom of the knife Knife tip and knife vector According to the vector and vector Determine the cosine function and arccosine function of the tool tip angle θ, and determine the tool tip angle θ based on the radian angle system formula;
[0051] The cosine function of the tool tip angle θ is:
[0052]
[0053] The inverse cosine function is: radians = arccos(cosθ);
[0054] The formula for converting radians to degrees is: θ = (180 × radians) / π.
[0055] Preferably, before the automatic identification module automatically identifies the controlled knife according to the actual length of the knife handle, the actual length of the blade and the angle of the knife tip, it further includes:
[0056] performing target detection on the tool image to determine whether the tool image contains a blood groove;
[0057] If the tool image contains a blood groove, the output recognition result is that the tool is a controlled tool;
[0058] If the tool image does not contain a blood groove, the controlled tool is automatically identified based on the actual length of the tool handle, the actual length of the blade, and the angle of the tool tip.
[0059] Preferably, the automatic identification module automatically identifies the controlled knife according to the actual length of the handle, the actual length of the blade and the angle of the tip, and outputs the identification result, including:
[0060] Pre-set standard handle length, blade length and tip angle;
[0061] Comparing the actual length of the knife handle with the standard length of the knife handle, comparing the actual length of the knife blade with the standard length of the knife blade, and comparing the angle of the knife tip with the standard angle of the knife tip;
[0062] If the actual length of the handle is greater than the standard length of the handle, and / or the actual length of the blade is greater than the standard length of the blade, and / or the angle of the blade tip is less than the standard angle of the blade tip, then the output recognition result is that the tool is a controlled tool;
[0063] Otherwise, the output recognition result is that the tool is an everyday tool.
[0064] Compared with the prior art, the beneficial effect of the present invention is that the technical solution proposed in the present invention realizes the automatic identification and measurement of the tool, and is simple to operate. The tool to be detected is placed in a conventional environmental background, and the scaled ruler is placed flat next to the tool. The tool is photographed through the corresponding app and the result is obtained. You can also use the program to upload pictures with the tool and ruler, and the server algorithm can quickly and automatically identify the tool parameters. The recognition algorithm of this technical solution includes a target detection algorithm, a segmentation algorithm based on the improved segmentation technology of RVM-RES_COS, and training the tool spacing recognition and tool tip angle recognition models respectively to ensure accurate segmentation of the key feature areas of the tool. The YOLO algorithm is used to train the two-classification model of the ruler and the knife to ensure that the system can accurately identify and locate the tool and the ruler. The four-classification model of the tool tip direction, ruler reconfirmation and interference items is trained based on FT_ResNet50 to further optimize the accuracy of the detection and reduce the error caused by environmental interference. This solution does not require additional auxiliary calibration equipment. Users only need to take a picture of the tool and the ruler in the same image, and the system will automatically calculate the full tool length, tool tip angle, tool standoff position, blade length, and handle length, greatly improving detection efficiency and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.
[0066] Figure 1 This is a functional block diagram of the controlled tool automatic identification system based on artificial intelligence deep learning of the present invention. DETAILED DESCRIPTION
[0067] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0068] like Figure 1 As shown, the present invention provides an automatic recognition system for controlled tools based on artificial intelligence deep learning, comprising:
[0069] The image recognition module is configured to obtain an image to be recognized, detect the image to be recognized based on a pre-trained object detection model, and obtain category labels and bounding box coordinates of the tool and ruler.
[0070] The image cropping module is configured to crop the image to be identified based on the identification label and the bounding box coordinates to obtain a tool image and a ruler image.
[0071] The image processing module is configured to perform scale detection on the ruler image to determine the actual length per unit pixel; perform tool separation detection on the tool image to determine the actual length of the tool handle and the actual length of the tool blade; and is further configured to crop the tool image to obtain a tool tip image, and analyze the tool tip image to determine the tool tip angle.
[0072] The automatic identification module is configured to automatically identify the controlled tool according to the actual length of the tool handle, the actual length of the blade and the angle of the tool tip, and output the identification result.
[0073] Deep learning algorithms improve the accuracy and efficiency of regulated tool recognition. The system automatically adapts to images under varying lighting, angles, and background conditions, reducing the possibility of manual intervention and misjudgment. Furthermore, the system can identify a wide range of regulated tool types, demonstrating its versatility and practicality. Furthermore, through image cropping and processing, the system can extract key tool features, providing strong support for subsequent automatic recognition.
[0074] In some embodiments of the present application, the image to be identified includes a tool and a ruler, and the direction of the tool is left or right.
[0075] In some embodiments of the present application, the target detection model in the image recognition module is constructed according to the YOLO algorithm.
[0076] The YOLO family of algorithms is a highly efficient object detection algorithm, and YOLOv12 is the latest version of the family. Compared to previous generations (such as YOLOv10), YOLOv12 further optimizes its model architecture, making it more lightweight and efficient while maintaining high accuracy. It is suitable for edge computing devices and real-time detection tasks. YOLOv12 adopts a more efficient network structure, introducing the RepVGG architecture. It uses more efficient convolutional computations during inference to improve detection speed, and also utilizes the Conv-BN-SiLU (CBS) block to optimize computational efficiency. Furthermore, improved loss functions such as the OTA (Optimal Transport Assignment) strategy enhance the stability of object matching and make detection results more accurate. In the knife and ruler detection task, YOLOv12 can be trained using a deep learning model to quickly identify the location of knives and rulers in images. The training process typically involves collecting a dataset of annotated knife and ruler images, training YOLOv12 for object detection, and deploying it for inference. Detected objects can be used for further analysis, such as measuring knife angles, calculating blade length, or assessing tool wear. YOLOv12's strengths lie in its efficiency and accuracy. It can run on edge devices and supports real-time detection, making it suitable for applications such as industrial quality inspection, automated manufacturing, and safety monitoring. In practical applications, it can be combined with OpenCV for image preprocessing and deployed using PyTorch or ONNX to implement efficient tool ruler detection solutions.
[0077] In some embodiments of the present application, the image processing module performs scale detection on the ruler image to determine the actual length per unit pixel, including: binarizing the ruler image to obtain a ruler binarized image; detecting the ruler binarized image based on the LSD algorithm to obtain a number of initial scale lines; determining the midpoint coordinates of the initial scale lines, and using the RANSAC algorithm to perform straight line fitting on the midpoint coordinates to obtain a fitted straight line; determining the intersection coordinates between the fitted straight line and the initial scale lines, and using the DBSCAN algorithm to perform cluster analysis on the intersection coordinates, and determining a scale line that meets the scale characteristics based on the clustering results; and determining the actual length per unit pixel based on the scale lines.
[0078] In this embodiment, the Line Segment Detector (LSD) algorithm is a highly efficient line detection method capable of extracting line segments from images with sub-pixel accuracy. Based on image gradient information, it utilizes region growing and statistical analysis to screen pixel regions that meet straight line characteristics and perform linear fitting to obtain a series of line segments. This algorithm does not require manual adjustment of complex parameters, is adaptable to diverse image environments, and is highly robust to noise. By clustering gradient directions, LSD accurately detects line segments with significant gradient variations and eliminates low-confidence detection results through error analysis. Ultimately, the detected line segments are optimized to achieve higher accuracy. For ruler scale detection, LSD can be used to extract scale lines after binarization. First, the ruler image is preprocessed to obtain a binary image of the scale, which is then input into the LSD algorithm for line detection. The detected line segments can be used for further analysis, such as distinguishing scale lines of different lengths to achieve accurate scale calculation.
[0079] During scale detection, the midpoint coordinates of all detected lines are first calculated, and line fitting is performed on these midpoints using RANSAC (Random Sample Consensus). Subsequently, the intersection points of all detected lines with the fitted lines are calculated, and DBSCAN (density-based spatial clustering algorithm) is used to cluster these intersection points and obtain all unique cluster labels. Finally, the clustering results are used to select the line that best matches the scale characteristics, ensuring the accuracy and robustness of scale detection.
[0080] RANSAC is a robust parameter estimation algorithm that is particularly suitable for situations where the data contains a large amount of noise and outliers. It fits the model by randomly sampling a minimum number of samples and evaluates the degree of conformity of all data points with the model. Points that conform to the model are considered "inliers", while points that deviate from the model are considered "outliers". As the number of iterations increases, RANSAC will select the model with the most inliers as the final result, thereby effectively eliminating abnormal data and improving the robustness of the fit. In the scale detection task, RANSAC can be used to fit the midpoint straight line of the scale line, that is, to find the points that conform to the straight line model among all the detected midpoint data, while removing outliers to make the overall fit of the scale line more accurate.
[0081] DBSCAN is a density-based clustering algorithm that does not require a preset number of clusters. It can identify clusters of different densities and effectively detect noise points. Based on the distribution of points, it classifies points that are density-reachable to each other into the same category, while isolated points are considered noise points. Compared to traditional K-Means clustering, DBSCAN is more suitable for datasets with uneven distribution and complex shapes, and is more robust to noise. In scale detection tasks, DBSCAN can be used to cluster detected intersections, grouping adjacent scale points into the same group to facilitate the subsequent calculation of scale spacing and improve the accuracy of scale recognition.
[0082] In some embodiments of the present application, the image processing module determines the actual length per pixel based on the scale line, including: determining the positions of scale mark 1 and scale mark 20 in the scale line, and determining the scale pixel length based on the positions of scale mark 1 and scale mark 20; obtaining the actual length of the scale between scale mark 1 and scale mark 20; and determining the actual length per pixel based on the actual length of the scale and the scale pixel length.
[0083] The actual length of the unit pixel is calculated according to the following formula:
[0084] M = B / L;
[0085] Among them, M represents the actual length of the unit pixel, B represents the actual length of the ruler, and L represents the pixel length of the ruler.
[0086] In this embodiment, after scale detection is complete, the positions of scale marks 1 and 20 are identified and the pixel distance between them is calculated. Knowing the actual millimeter lengths corresponding to scale marks 1 through 20, the image scale (the actual length per pixel) can be calculated. This scale can then be used to further calculate the actual length of the knife.
[0087] In some embodiments of the present application, the image processing module performs tool gap detection on the tool image to determine the actual length of the tool handle and the actual length of the blade of the tool, including: binarizing the tool image to obtain a tool binary image; extracting tool gap features from the tool binary image, and using Canny edge detection to enhance the tool gap edge, using Hough transform to detect the straight line features of the tool gap, and obtaining the tool gap pixel length; determining the tool handle pixel length and blade pixel length of the tool based on the tool gap pixel length; determining the actual length of the tool handle and the actual length of the blade of the tool according to the tool handle pixel length and blade pixel length.
[0088] In this embodiment, blade separation detection is performed by binarizing the cropped blade image to extract the characteristic region of the blade separation. Subsequently, Canny edge detection is used to enhance the blade separation edge, and Hough transform is used to detect the straight line features of the blade separation to obtain key information such as its length and angle, achieving accurate recognition.
[0089] The Hough transform is an algorithm used to detect geometric shapes (such as lines, circles, and ellipses) from images. It is most commonly used for line detection. It maps points in image space to parameter space and locates the line by finding the point with the largest cumulative value in the parameter space. A line can be represented by a parametric equation: Y = mx + b, where M is the slope and b is the intercept. However, this representation results in an infinite slope for perpendicular lines. Therefore, polar coordinates are often used: ρ = x cosθ + y sin θ, where ρ is the perpendicular distance from the origin to the line and θ is the angle between the normal and the x-axis. In this way, each point (x, y) in the image is mapped into a curve in parameter space, and the intersection of multiple curves represents the parameters of the line. In ruler scale detection, the Hough transform can be used to identify scale lines, especially long lines. By inputting the binarized scale image into the Hough transform algorithm, horizontal or vertical scale lines can be extracted, which are then used for subsequent scale spacing calculation and scale value identification.
[0090] The blade tip direction is mainly classified as left or right based on the blade tip direction. The model is trained using the ResNet50 algorithm. The confirmation of the blade tip direction can help crop the blade tip image and calculate the blade tip angle.
[0091] ResNet-50 is a deep convolutional neural network that uses residual connections to alleviate the vanishing gradient problem, enabling deeper network training. It consists of a 50-layer structure with multiple residual blocks and uses 1×1 convolution for feature compression to improve computational efficiency. ResNet-50 has powerful feature extraction capabilities and is widely used in computer vision tasks such as image classification, object detection, and semantic segmentation.
[0092] In some embodiments of the present application, the image processing module determines the actual handle length and the actual blade length of the tool according to the handle pixel length and the blade pixel length, including: determining the actual handle length of the tool according to the unit pixel actual length and the handle pixel length; determining the actual blade length of the tool according to the unit pixel actual length and the blade pixel length;
[0093] The actual length of the shank is determined according to the following formula:
[0094] RL = RM × M;
[0095] The actual length of the blade is determined according to the following formula:
[0096] BL = BM × M;
[0097] Among them, RL represents the actual length of the handle, RM represents the pixel length of the handle, M represents the actual length per unit pixel, BL represents the actual length of the blade, and BM represents the pixel length of the blade.
[0098] In some embodiments of the present application, the image processing module crops the tool image to obtain a tool tip image, and analyzes the tool tip image to determine the tool tip angle, including: using the RVM-RES segmentation algorithm to crop the tool image to obtain a tool tip image, and binarizing the tool tip image to obtain a tool tip binary image; selecting the leftmost point of the tool tip binary image as a known point, determining the distance between each point in the tool tip binary image and the known point, comparing the distance with the target distance, and screening out close points; performing cluster analysis on the close points to determine the mean coordinates of each cluster; determining the tool tip coordinates, upper tool coordinates, and lower tool coordinates based on the known point coordinates and the mean coordinates; and determining the tool tip angle based on the tool tip coordinates, upper tool coordinates, and lower tool coordinates.
[0099] In this embodiment, the RVM-Res algorithm is a highly efficient video segmentation technology that combines residual optimization with powerful feature extraction capabilities to accurately segment foreground objects from complex backgrounds. In the knife-tip segmentation task, RVM-Res effectively distinguishes the knife tip from the background, ensuring precise extraction of the knife-tip region. It is suitable for real-time processing and high-precision segmentation requirements, and performs particularly well in scenes with uneven lighting or large background variations.
[0100] Through the segmented binary image, the proximity of the non-zero coordinate point to the target is calculated, and the DBSCAN clustering method is combined to identify the position of the tool tip in the image. First, it selects the leftmost point as the known point, calculates the distance to other points, and filters out the target points with close distances. Then, the DBSCAN clustering algorithm is used to group these points, calculate the mean coordinates of each cluster, and filter the appropriate cluster based on the change in the X coordinate. Finally, the coordinates of the left point and the mean coordinates of the two closest clusters are returned for tool tip positioning or other image processing tasks. To calculate the distance between points, the Euclidean distance calculation formula is used:
[0101] Where (x1,y1) and (x2,y2) are the coordinates of two points and d is the Euclidean distance between them.
[0102] Target distance screening, by calculating the distance from each point to the known point and comparing it with the target distance target_distance, to screen out close points.
[0103] Cluster mean calculation, for each cluster after DBSCAN clustering, the mean coordinate is obtained by averaging the coordinates of all points in the cluster:
[0104]
[0105] N is the number of points in the cluster, (xi,yi) is the coordinate of each point, and μ is the mean coordinate of the cluster.
[0106] Cluster filtering and updating, the update of cluster mean has a condition: if the difference between the X coordinate of the current cluster and the X coordinate of the previous cluster is greater than a certain threshold (such as 40), the mean update of the cluster is skipped.
[0107] In some embodiments of the present application, the image processing module determines the tool tip angle based on the tool tip coordinates, the tool top coordinates, and the tool bottom coordinates, including: determining a slope k1 of a line connecting the tool tip and the tool top, and a slope k2 of a line connecting the tool tip and the tool bottom based on the tool tip coordinates, the tool top coordinates, and the tool bottom coordinates, determining a tangent function of the tool tip angle θ according to the slopes k1 and k2, and determining the tool tip angle θ according to the tangent function of the tool tip angle θ; the tangent function of the tool tip angle θ is: tanθ=|k1-k2 / 1+k1k2|;
[0108] or,
[0109] Set the tool tip coordinates to (Ax, Ay), the tool bottom coordinates to (Bx, By), and the tool top coordinates to (Cx, Cy);
[0110] Determine the vector between the tip of the knife and the bottom of the knife Knife tip and knife vector According to the vector and vector Determine the cosine function and arccosine function of the tool tip angle θ, and determine the tool tip angle θ based on the radian angle system formula;
[0111] The cosine function of the tool tip angle θ is:
[0112]
[0113] The inverse cosine function is: radians = arccos(cosθ);
[0114] The formula for converting radians to degrees is: θ = (180 × radians) / π.
[0115] In some embodiments of the present application, before the automatic identification module automatically identifies the controlled knife based on the actual length of the handle, the actual length of the blade and the angle of the tip, it also includes: performing target detection on the tool image to determine whether the tool image contains a blood groove; if the tool image contains a blood groove, outputting the identification result that the tool is a controlled knife; if the tool image does not contain a blood groove, automatically identifying the controlled knife based on the actual length of the handle, the actual length of the blade and the angle of the tip.
[0116] It is understood that this application can effectively improve the accuracy and efficiency of regulated knife identification. In practice, many regulated knives are designed with blood grooves to increase their lethality and effectiveness. By first detecting whether the tool image contains a blood groove, some regulated knives can be directly and quickly identified, avoiding complex length and angle calculations for these tools, thereby saving computing resources and time. Furthermore, for knives without a blood groove, detailed length and angle measurements are used for further identification, ensuring comprehensive and accurate identification.
[0117] In some embodiments of the present application, the automatic identification module automatically identifies the controlled knife based on the actual length of the handle, the actual length of the blade and the angle of the tip, and outputs the identification result, including: pre-setting the standard length of the handle, the standard length of the blade and the standard angle of the tip; comparing the actual length of the handle with the standard length of the handle, comparing the actual length of the blade with the standard length of the blade, and comparing the angle of the tip with the standard angle of the tip; if the actual length of the handle is greater than the standard length of the handle, and / or the actual length of the blade is greater than the standard length of the blade, and / or the angle of the tip is less than the standard angle of the tip, then the identification result is output as the knife is a controlled knife; otherwise, the identification result is output as the knife is an everyday knife.
[0118] As you can see, by setting standard length and angle thresholds and comparing them with actual measured tool characteristics, we can accurately distinguish between regulated and everyday knives, effectively avoiding false positives and missed detections. This approach not only improves identification accuracy but also provides a reliable basis for judgment, helping to reduce potential safety hazards. Furthermore, this technical solution is flexible and scalable, allowing the standard length and angle settings to be adjusted to meet different requirements, adapting to the needs of regulated tool identification in different scenarios.
[0119] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or a combination of software and hardware embodiments. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0120] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0121] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0122] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0123] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered by the scope of protection of the claims of the present invention.
Claims
1. The automatic identification system for controlled tools based on artificial intelligence deep learning is characterized by: include: An image recognition module is configured to obtain an image to be recognized, detect the image to be recognized based on a pre-trained object detection model, and obtain category labels and bounding box coordinates of the tool and ruler; an image cropping module configured to crop the image to be identified based on the identification label and the bounding box coordinates to obtain a tool image and a ruler image; an image processing module configured to perform scale detection on the ruler image to determine the actual length per unit pixel; perform tool separation detection on the tool image to determine the actual length of the tool handle and the actual length of the tool blade; and further configured to crop the tool image to obtain a tool tip image, and analyze the tool tip image to determine the tool tip angle; The automatic identification module is configured to automatically identify the controlled tool according to the actual length of the tool handle, the actual length of the blade and the angle of the tool tip, and output the identification result.
2. The controlled tool automatic identification system based on artificial intelligence deep learning according to claim 1 is characterized in that: The image to be identified includes a tool and a ruler, and the direction of the tool is leftward or rightward.
3. The controlled tool automatic identification system based on artificial intelligence deep learning according to claim 1 is characterized in that: The image processing module performs scale detection on the ruler image to determine the actual length of a unit pixel, including: performing binarization processing on the scale image to obtain a scale binary image; Detecting the ruler binary image based on the LSD algorithm to obtain a number of initial scale lines; Determine the midpoint coordinates of the initial scale line, and use the RANSAC algorithm to perform straight line fitting on the midpoint coordinates to obtain a fitted straight line; Determine the coordinates of the intersection between the fitted straight line and the initial scale line, perform cluster analysis on the intersection coordinates using the DBSCAN algorithm, and determine the scale line that meets the scale characteristics based on the clustering results; The actual length per unit pixel is determined according to the scale line.
4. The controlled tool automatic identification system based on artificial intelligence deep learning according to claim 3 is characterized in that: The image processing module determines the actual length of a unit pixel according to the scale line, including: Determine the positions of the scale mark 1 and the scale mark 20 in the scale line, and determine the pixel length of the ruler according to the positions of the scale mark 1 and the scale mark 20; Get the actual length of the ruler between scale 1 and scale 20; Determine the actual length per unit pixel according to the actual length of the ruler and the pixel length of the ruler; The actual length of the unit pixel is calculated according to the following formula: M = B / L; Among them, M represents the actual length of the unit pixel, B represents the actual length of the ruler, and L represents the pixel length of the ruler.
5. The controlled tool automatic identification system based on artificial intelligence deep learning according to claim 4 is characterized in that: The image processing module performs a tool separation detection on the tool image to determine the actual length of the tool handle and the actual length of the blade, including: performing binarization processing on the tool image to obtain a tool binary image; Extracting tool gap features from the tool binary image, enhancing the tool gap edge using Canny edge detection, detecting the straight line features of the tool gap using Hough transform, and obtaining the tool gap pixel length; Determine the pixel length of the handle and the pixel length of the blade of the tool based on the pixel length of the tool spacing. The actual length of the tool handle and the actual length of the blade of the tool are determined according to the pixel length of the tool handle and the pixel length of the blade.
6. The controlled tool automatic identification system based on artificial intelligence deep learning according to claim 5 is characterized in that: The image processing module determines the actual length of the tool handle and the actual length of the blade according to the pixel length of the tool handle and the pixel length of the blade, including: Determine the actual length of the tool handle according to the actual length per unit pixel and the pixel length of the tool handle; Determine the actual length of the blade of the tool according to the actual length per unit pixel and the blade pixel length; The actual length of the shank is determined according to the following formula: RL = RM × M; The actual length of the blade is determined according to the following formula: BL = BM × M; Among them, RL represents the actual length of the handle, RM represents the pixel length of the handle, M represents the actual length per unit pixel, BL represents the actual length of the blade, and BM represents the pixel length of the blade.
7. The controlled tool automatic identification system based on artificial intelligence deep learning according to claim 1 is characterized in that: The image processing module crops the tool image to obtain a tool tip image, and analyzes the tool tip image to determine a tool tip angle, including: The tool image is cropped using an RVM-RES segmentation algorithm to obtain a tool tip image, and the tool tip image is binarized to obtain a tool tip binary image; Selecting the leftmost point of the tool tip binary image as a known point, determining the distance between each point in the tool tip binary image and the known point, comparing the distance with the target distance, and screening out close points; Perform cluster analysis on close points and determine the mean coordinates of each cluster; Determine tool tip coordinates, tool top coordinates, and tool bottom coordinates based on known point coordinates and mean coordinates; The tool tip angle is determined based on the tool tip coordinates, the tool upper coordinates, and the tool lower coordinates.
8. The controlled tool automatic identification system based on artificial intelligence deep learning according to claim 7 is characterized in that: The image processing module determines the tool tip angle based on the tool tip coordinates, the tool upper coordinates, and the tool lower coordinates, including: Based on the tool tip coordinates, tool top coordinates and tool bottom coordinates, the slope k1 of the line connecting the tool tip and the tool top, and the slope k2 of the line connecting the tool tip and the tool bottom are determined. Determine a tangent function of a tool tip angle θ according to the slope k1 and the slope k2, and determine the tool tip angle θ according to the tangent function of the tool tip angle θ; The tangent function of the tool tip angle θ is: tanθ=|k1-k2 / 1+k1k2|; or, Set the tool tip coordinates to (Ax, Ay), the tool bottom coordinates to (Bx, By), and the tool top coordinates to (Cx, Cy); Determine the vector between the tip of the knife and the bottom of the knife Knife tip and knife vector According to the vector and vector Determine the cosine function and arccosine function of the tool tip angle θ, and determine the tool tip angle θ based on the radian angle system formula; The cosine function of the tool tip angle θ is: The inverse cosine function is: radians = arccos(cosθ); The formula for converting radians to degrees is: θ = (180 × radians) / π.
9. The controlled tool automatic identification system based on artificial intelligence deep learning according to claim 1 is characterized in that: Before the automatic identification module automatically identifies the controlled knife according to the actual length of the knife handle, the actual length of the blade and the angle of the knife tip, the automatic identification module further includes: performing target detection on the tool image to determine whether the tool image contains a blood groove; If the tool image contains a blood groove, the output recognition result is that the tool is a controlled tool; If the tool image does not contain a blood groove, the controlled tool is automatically identified based on the actual length of the tool handle, the actual length of the blade, and the angle of the tool tip.
10. The controlled tool automatic identification system based on artificial intelligence deep learning according to claim 1 is characterized in that: The automatic identification module automatically identifies the controlled tool according to the actual length of the tool handle, the actual length of the blade, and the angle of the tool tip, and outputs the identification result, including: Pre-set standard handle length, blade length and tip angle; Comparing the actual length of the knife handle with the standard length of the knife handle, comparing the actual length of the knife blade with the standard length of the knife blade, and comparing the angle of the knife tip with the standard angle of the knife tip; If the actual length of the tool handle is greater than the standard length of the tool handle, / or the actual length of the blade is greater than the standard length of the blade, and / or the angle of the tool tip is less than the standard angle of the tool tip, then the output recognition result is that the tool is a controlled tool; Otherwise, the output recognition result is that the tool is an everyday tool.
Citation Information
Cited By
Controlled cutter intelligent identification instrument and automatic judgment method
CN122049486A