Screw image processing method, device, electronic device and storage medium
Through screw image processing methods, including extraction of the nut circular area, polar coordinate expansion and character recognition, the complex and time-consuming problem of bone screw model identification is solved, rapid and accurate identification and management are achieved, and medical safety is improved.
Patent Information
- Application Number
- CN202110694209.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-22
- Publication Date
- 2024-10-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The large number and small diameter of bone screws make identification of their models complicated and time-consuming, affecting patient health and safety.
The screw image processing method is used to obtain the screw image, extract the circular area of the nut, perform polar coordinate expansion processing, segment the character area, perform character recognition, and quickly and accurately identify the screw number.
It achieves fast and accurate identification of screw numbers, reduces manual identification time, improves screw management efficiency, and reduces medical risks.
Smart Images

Figure CN113486891B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a method, device, electronic equipment and storage medium for processing screw images. Background Art
[0002] Screws are used as a fixing part in many occasions. However, due to the large variety of screws and their small size, they are inconvenient to store. The numbers on some screws are difficult to see clearly, and it is also inconvenient to accurately distinguish specific types of screws when using them.
[0003] In particular, with the development of medical technology, bone screws are increasingly used as an indispensable surgical instrument in orthopedic surgery. However, the management of bone screws has always been a difficult problem, mainly reflected in the following aspects:
[0004] There are a large number of bone screws, with more than 200 screws used in a single surgery;
[0005] The diameter of bone screws is very small, usually about 1 to 5 mm, so it is usually impossible to identify the screw model with the naked eye, and usually a magnifying glass is used to look at each screw one by one. It can be seen that bone screw management is complicated and time-consuming. If used improperly, it may also affect the patient's health. Accurately identifying and confirming the screw number requires a lot of time. Summary of the invention
[0006] Based on this, it is necessary to propose a screw image processing method, device, electronic device and storage medium to address the above problems.
[0007] In a first aspect, a screw image processing method is provided, comprising:
[0008] Acquire a screw image, and extract a nut circular area in the screw image;
[0009] Determine the center and radius of the circular area of the nut;
[0010] According to the center and radius of the circular area of the nut, the circular area of the nut is subjected to polar coordinate expansion processing to obtain a first rectangular image corresponding to the circular area of the nut;
[0011] Extracting a character region of the first rectangular image and determining a segmentation position of the character region;
[0012] According to the segmentation position, the character area is segmented and reassembled to obtain a second rectangular image;
[0013] Character recognition is performed on the second rectangular image to obtain a screw detection number corresponding to the screw image.
[0014] In a second aspect, a screw image processing device is provided, comprising:
[0015] An acquisition module, used to acquire a screw image and extract a nut circular area in the screw image;
[0016] A conversion module is used to: determine the center and radius of the circular area of the nut, and perform polar coordinate expansion processing on the circular area of the nut according to the center and radius of the circular area of the nut to obtain a first rectangular image corresponding to the circular area of the nut;
[0017] Divide the modules into:
[0018] Extracting a character region of the first rectangular image, determining a segmentation position of the character region, and segmenting and reassembling the character region according to the segmentation position to obtain a second rectangular image;
[0019] A character recognition module is used to perform character recognition on the second rectangular image to obtain a screw detection number corresponding to the screw image.
[0020] According to a third aspect, an electronic device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the first aspect and any possible implementation thereof.
[0021] In a fourth aspect, a computer storage medium is provided, wherein the computer storage medium stores one or more instructions, wherein the one or more instructions are suitable for being loaded by a processor and executing the steps of the above-mentioned first aspect and any possible implementation thereof.
[0022] The present application obtains a screw image, extracts a nut circular area in the screw image; determines the center and radius of the nut circular area; performs polar coordinate expansion processing on the nut circular area according to the center and radius of the nut circular area, and obtains a first rectangular image corresponding to the nut circular area; extracts a character area of the first rectangular image, and determines a segmentation position of the character area; segments and reassembles the character area according to the segmentation position, and obtains a second rectangular image; performs character recognition on the second rectangular image, and obtains a screw detection number corresponding to the screw image. The number of each screw can be identified quickly and accurately without the need for time-consuming and laborious manual identification, and is convenient for monitoring the standardized storage and use of screws. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0024] in:
[0025] Figure 1 A schematic diagram of a process flow of a screw image processing method provided in an embodiment of the present application;
[0026] Figure 2 A schematic diagram of a screw image provided in an embodiment of the present application;
[0027] Figure 3 A schematic diagram of a path construction provided in an embodiment of the present application;
[0028] Figure 4A A schematic diagram of a rectangular image expanded in polar coordinates provided in an embodiment of the present application;
[0029] Figure 4B A schematic diagram of segmenting a character area provided in an embodiment of the present application;
[0030] Figure 5 A schematic diagram of a screw numbering process provided in an embodiment of the present application;
[0031] Figure 6 A schematic diagram of the partial structure of a screw image processing device provided in an embodiment of the present application;
[0032] Figure 7 A schematic diagram of the structure of a screw image processing device provided in an embodiment of the present application;
[0033] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0035] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0036] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0037] The neural network (NN) involved in the embodiments of the present application is a complex network system formed by a large number of simple processing units (called neurons) widely connected to each other. It reflects many basic characteristics of human brain functions and is a highly complex nonlinear dynamic learning system. Neural networks have large-scale parallel, distributed storage and processing, self-organization, self-adaptation and self-learning capabilities, and are particularly suitable for processing imprecise and fuzzy information processing problems that require simultaneous consideration of many factors and conditions.
[0038] Convolutional Neural Networks (CNN) are a type of feedforward neural network that includes convolution calculations and has a deep structure. It is one of the representative algorithms of deep learning.
[0039] The embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application.
[0040] See also Figure 1 , Figure 1 : is a flow chart of a screw image processing method provided in an embodiment of the present application. The method can be applied to a screw image processing device, the device includes a detection module, and the detection module includes a screw camera. The method may include:
[0041] 101. Obtain a screw image, and extract a circular area of a nut in the screw image.
[0042] The above-mentioned screw image may be an image including the screw head (referred to as the circular area of the nut in the embodiment of the present application), which may be collected by placing the screw vertically through a top-down perspective. The screw in the embodiment of the present application may be any screw, and in particular may be a bone screw. A bone screw is an internal fixation device used to fix a fracture site. The diameter of a bone screw is very small, so it is usually not possible to identify the model of the screw by naked eyes.
[0043] Specifically, Figure 2 A schematic diagram of a screw image provided for this application, such as Figure 2 As shown, the screw image includes a nut circular area A and a background area B, wherein the nut circular area A has a screw number. In the embodiment of the present application, a network model for identifying the nut circular area can be pre-trained, so that the nut circular area in the screw image can be identified by the trained model. The network model can be a neural network model based on deep learning, which is not limited in the embodiment of the present application.
[0044] The execution subject of the embodiment of the present application may be a screw image processing device, or may be an electronic device, wherein the electronic device includes a terminal device such as a computer.
[0045] In an optional implementation, the above method is applied to a screw image processing device, the device includes a detection module, and the detection module includes a screw camera;
[0046] The above-mentioned method of obtaining the screw image includes:
[0047] An identification path is obtained, and the detection module is controlled to move according to the identification path. At each screw position where a screw is placed, the screw image is acquired by collecting the screw camera.
[0048] The above-mentioned detection platform can be used to place the object to be detected. In the embodiment of the present application, the detection platform can be used to place a nail box, and the nail box can be provided with multiple screw positions for placing screws. The detection module is provided with a camera for collecting screw images, which is referred to as a screw camera herein. The screw nut is placed in the screw position of the nail box with the screw cap facing upward, so that the detection module can collect images and identify the screw from above.
[0049] Specifically, the detection scene image can be pre-collected by a wide-angle camera (different from the screw camera), and the recognition path of the detection module can be analyzed and determined. Then, the detection module movement can be controlled according to the generated recognition path. The detection module can move according to the coordinates in the recognition path, and an image is collected once at each detection point position to obtain the corresponding screw image. Optionally, the screw image can be collected by the screw camera at each screw position where a screw is placed, and the image processing step in the embodiment of the present application is performed.
[0050] In one embodiment, the screw positions in the detection scene image can be identified by an image processing method to determine the center position coordinates of each screw position. Figure 2 As shown, even if the screws are placed in the screw positions in the embodiment of the present application, it can be seen from above that they are still circular, and the pre-trained image detection model can be used to detect the various screw position areas in the image through edge detection, and determine the center position coordinates of each screw position. The embodiment of the present application does not limit the specific image detection model type used.
[0051] The embodiments of the present application involve edge detection, which is a technology for extracting useful structural information from different visual objects and greatly reducing the amount of data to be processed. It has been widely used in various computer vision systems.
[0052] Furthermore, the identified center coordinates of each screw position can be sorted to achieve a shortest path.
[0053] Specifically, with the given center position coordinate data, the starting screw position and the end screw position can be determined by comparing the coordinate values. In a specific implementation, two screw positions can be first determined as the starting screw position and the end screw position, and then the center position coordinates of each screw position can be determined based on the coordinates of the starting screw position and the end screw position and the distribution of other screw positions; thus, an identification path can be constructed from the starting point to the end point. For example, Figure 3 As shown, after traversing a row of detection points, it moves down one row and traverses this row again. Finally, all coordinate information is saved in an S-shaped order to determine the recognition path.
[0054] Optionally, the center position coordinates of all screw positions may not be calculated, but the movement of the detection module may be controlled according to the spacing of the screw positions, which is not limited in the present embodiment. In addition, the identification path is not necessarily S-shaped and can be set as needed, which is not limited here.
[0055] 102. Determine the center and radius of the circular area of the nut.
[0056] 103. Perform polar coordinate expansion processing on the circular area of the nut according to the center and radius of the circular area of the nut to obtain a first rectangular image corresponding to the circular area of the nut.
[0057] By identifying the circular area of the nut, the center of the circular area of the nut can be determined, and then the radius can be determined.
[0058] Polar coordinates refers to a coordinate system consisting of a pole, polar axis, and polar diameter in a plane. Take a point O on the plane, called the pole. Draw a ray Ox from O, called the polar axis. Then take a unit length, and usually stipulate that the angle is positive in the counterclockwise direction. In this way, the position of any point P on the plane can be determined by the length ρ of the line segment OP and the angle θ from Ox to OP. The ordered number pair (ρ, θ) is called the polar coordinates of point P, denoted as P(ρ, θ); ρ is called the polar diameter of point P, and θ is called the polar angle of point P.
[0059] The circular area of the nut is a circle, and the center of the circular area of the nut can be used as the pole. According to its radius, polar coordinates are expanded into a straight line form to obtain the corresponding first rectangular image, so as to recognize the characters therein.
[0060] The characters in the first rectangular image are recognized to obtain the corresponding screw detection number. In the embodiment of the present application, there is no limitation on the specific character recognition algorithm. For example, the open source tesseract algorithm can be used for symbol recognition.
[0061] 104. Extract the character area of the first rectangular image and determine the segmentation position of the character area.
[0062] Specifically, the outer ring of the screw nut is usually printed or engraved with a character area corresponding to the screw number, and the inner ring is a screw slot, such as a flat or cross slot, or no slot, corresponding to a non-character area. Therefore, the character area of the first rectangular image can be extracted first for recognition processing, reducing the processing of some non-character areas.
[0063] In order to correctly recognize characters, image adjustment is required (the first character in the expanded rectangular image is not necessarily the first digit of the screw number, and characters may be divided and incomplete during expansion).
[0064] In an optional implementation, the extracting the character region of the first rectangular image includes:
[0065] Identify a demarcation line in the first rectangular image, where the demarcation line is used to divide the character area and the non-character area in the rectangular image;
[0066] Based on the above-mentioned dividing line, the character area of the above-mentioned first rectangular image is extracted.
[0067] In the embodiment of the present application, a preset recognition algorithm can be used to recognize specific features in the image, such as lines. The recognition algorithm recognizes the rectangular image after polar coordinate expansion and preliminarily divides the character area and the non-character area. Figure 4AAs shown, it is a schematic diagram of a rectangular image obtained after polar coordinate expansion, including a character area C and a character-free area D. The character area C is the area marked with the screw number, and the character-free area D may include various screw grooves of the screw, which are not drawn here. Usually, the outer ring of the screw nut is printed or engraved with a character area corresponding to the screw number, and the inner ring is the screw groove, such as a flat or cross groove, or no groove. Through the above steps, the dividing line L in the rectangular image can be identified and determined, thereby dividing the character area C and the character-free area D in the nut.
[0068] Furthermore, in order to correctly recognize characters, image adjustment is required (the first character in the expanded rectangular image is not necessarily the first character of the screw number, and characters may be segmented and incomplete during expansion). First, the segmentation position of the character area needs to be determined, and there is no character at the segmentation position. Then, step 105 can be executed, that is, the character area is segmented and reorganized according to the segmentation position to adjust the character order so that all character information can be retained intact for subsequent recognition.
[0069] 105. According to the segmentation position, the character area is segmented and reassembled to obtain a second rectangular image.
[0070] In an optional implementation, the determining of the segmentation position of the character region includes:
[0071] Performing expansion and erosion operations on the character area to determine a character block area in the character area;
[0072] Determine the segmentation position according to the position of the above-mentioned character block area, and the above-mentioned segmentation position does not pass through the above-mentioned character block area;
[0073] The above-mentioned character area is segmented and reassembled according to the above-mentioned segmentation position to obtain a second rectangular image, including:
[0074] According to the segmentation position, the character area is segmented into two sub-rectangles, and the two sub-rectangles are spliced by exchanging their arrangement order to obtain the second rectangular image.
[0075] In the embodiment of the present application, the character block area in the character area can be selected through expansion and erosion operations. The expansion involved in the embodiment of the present application can be understood as expanding and enlarging the bright white area in the image by adding pixels to the perceived boundary of the object in the image; erosion is the opposite: it removes pixels along the boundary of the object and reduces the size of the object. Through the expansion and erosion operations on the obtained character area, the areas of continuous characters are connected into one piece, that is, the character block area in the character area is selected, and the remaining positions do not contain characters, which can be used as a basis for determining the segmentation position. The segmentation position can be determined from the area that does not contain characters, such as using the midline of an area that does not contain characters as a segmentation line for segmentation, and then connecting the segmented sub-image to the other end of another sub-image to complete the adjustment.
[0076] For example, see Figure 4B A schematic diagram of segmentation of a character region is shown in FIG. Figure 4B The image shown in Figure 4A The character area C in the image is not represented here. The segmentation position of the character area can be determined by the above method. Specifically, the segmentation line M in the character area C (no character here) can be determined, and it can be divided into two areas C1 and C2. The two areas are then reconnected, that is, the left end of C1 and the right end of C2 are connected together, and a reconstructed rectangular image can be obtained, that is, the adjusted character area. This method can solve the problem that the characters on the left end of C1 and the right end of C2 are incomplete when they are separated during polar coordinate expansion.
[0077] Optionally, the image contrast may be enhanced before character recognition to improve recognition accuracy.
[0078] 106. Perform character recognition on the second rectangular image to obtain a screw detection number corresponding to the screw image.
[0079] Any character recognition algorithm can be used in the embodiments of the present application.
[0080] In an optional implementation, useless symbols may be discarded during character recognition.
[0081] In one implementation, the above step 106 may include:
[0082] Performing character recognition on the second rectangular image to obtain a first character sequence;
[0083] Identifying a preset identification character in the first character sequence;
[0084] The order of characters in the first character sequence is adjusted according to the position of the preset identification character, the preset identification character is deleted, and the screw detection number corresponding to the screw image is obtained.
[0085] Specifically, preset identification characters that need to be removed can be pre-set, such as "ID" or the safety certification mark CE, etc. After all characters are recognized, the preset identification characters can be removed as required and then the screw detection number can be output. Since the separation position is uncertain when the polar coordinates are expanded, the character order in the image of the character area to be recognized after expansion and adjustment may not be the correct numbering order. In order to solve this problem, the number recognition rules can be set as needed to determine the first character of the recognized string, and then adjust it to obtain an accurate screw detection number starting with the first character. For example, usually after identification such as ID, CE, etc., it is a valid screw number, that is, when performing character area segmentation and adjustment, it can be segmented from the identification character position, so that the adjusted image corresponds to the correct character order of the screw number, or the identification character position can be determined as the starting point when recognizing the character, and the recognized string is adjusted to the correct character order of the screw number.
[0086] Optionally, after the above step 106, the method further includes:
[0087] Output the above nut circular area and the above screw detection number.
[0088] The screw image processing method in the present application can be used for rapid identification and detection of screw numbers. By collecting screw images for processing and character recognition, the screw detection number can be quickly determined. In one embodiment, the screw image processing method in the embodiment of the present application can be applied to bone screw detection scenarios, and can accurately and quickly identify tiny bone screw numbers, which greatly improves the efficiency and accuracy of manual identification.
[0089] The screw image processing method in the embodiment of the present application can also be applied to the screw number verification scenario. Specifically, Figure 5 A schematic diagram of a screw numbering process provided in an embodiment of the present application is shown in FIG. Figure 5 As shown in the aforementioned Figure 1 Based on the embodiment, after obtaining the screw detection number, the method may further include:
[0090] 501. Obtain a target screw position identifier corresponding to a screw detection number;
[0091] 502. Obtain a mapping relationship between a preset screw position identifier and a preset screw number, and determine the preset screw number corresponding to the target screw position identifier according to the mapping relationship;
[0092] 503. Compare the screw detection number with the screw preset number corresponding to the target screw position identifier to see whether they are the same;
[0093] 504. When the screw detection number is different from the screw preset number corresponding to the target screw position identifier, output an error prompt message, where the error prompt message is used to indicate that the screw corresponding to the target screw position identifier is incorrectly placed;
[0094] 505. When the screw detection number is the same as the screw preset number corresponding to the target screw position identification, it is determined that the screw corresponding to the target screw position identification is correctly placed.
[0095] Specifically, in an embodiment of the present application, a mapping relationship between the above-mentioned screw position identification and the screw preset number can be pre-set, which can be in the form of a screw preset number table. In the scenario of placing screws in a nail box for batch inspection, the mapping relationship specifies the screw that should be placed in each screw position (screw preset number).
[0096] Each screw position in the nail box has a unique identifier, such as a label, called a screw position identifier. The target screw position identifier corresponding to the above screw detection number can be determined by image recognition or positioning. Then, the screw preset number corresponding to the target screw position identifier is determined based on the above mapping relationship, and then the obtained screw detection number can be compared with the screw preset number corresponding to the target screw position identifier to see if they are the same. If they are the same, it means that the screw is placed correctly, and if they are not the same, it means that the screw is placed incorrectly.
[0097] When the screw detection number is different from the screw preset number corresponding to the target screw position identification, an error prompt message can be output to prompt that the screw is placed incorrectly at that position.
[0098] In the embodiment of the present application, the above steps can be used to identify whether the screws in the nail box are placed correctly, that is, the corresponding screws need to be placed in each screw position to standardize management and accurately take out the required screws for use. Bone screws can be accurately managed to avoid misplacement and misuse leading to errors during surgery, thereby reducing medical risks.
[0099] In one embodiment, see Figure 6 A partial structural diagram of a screw image processing device is shown in FIG. Figure 6 As shown, the detection module of the screw image processing device includes a camera 610 and a laser rangefinder 620. The laser rangefinder 620 can detect the relative height h of the upper surface of the bone screw box (that is, the screw nut during the detection process), and control the detection height (the distance when the image is collected) of each bone screw by monitoring the height h. That is, the movement distance in the Z direction is determined by the laser rangefinder 620. Specifically, when the laser rangefinder 620 measures that the distance from the box is the preset detection height d, it stops the movement in the Z direction, and then the corresponding screw image can be collected by the camera 610 to identify the bone screw, that is, it can be executed. Figure 1The image processing method in the illustrated embodiment.
[0100] By using the laser rangefinder 620, the camera 610 can be controlled to take images of screws at fixed intervals. The camera 610 does not need to automatically focus, and a fixed-focus camera can be used to save focusing time, thereby effectively improving the recognition efficiency of the camera 610 and the processing efficiency of the entire detection process.
[0101] Based on the description of the above screw image processing method embodiment, the present application embodiment also discloses a screw image processing device, such as Figure 7 As shown, the screw image processing device 700 includes:
[0102] An acquisition module 710 is used to acquire a screw image and extract a nut circular area in the screw image;
[0103] The conversion module 720 is used to: determine the center and radius of the circular area of the nut, and perform polar coordinate expansion processing on the circular area of the nut according to the center and radius of the circular area of the nut to obtain a first rectangular image corresponding to the circular area of the nut;
[0104] The partitioning module 730 is used to:
[0105] Extracting a character region of the first rectangular image, determining a segmentation position of the character region, and segmenting and reassembling the character region according to the segmentation position to obtain a second rectangular image;
[0106] The character recognition module 740 is used to perform character recognition on the second rectangular image to obtain a screw detection number corresponding to the screw image.
[0107] The screw image processing device 700 can perform the following steps: Figure 1 or Figure 5 Some or all of the steps of the method in the illustrated embodiment will not be repeated here.
[0108] Based on the description of the above method embodiment and device embodiment, the present application embodiment also provides an electronic device. Figure 8 The electronic device 800 at least includes a processor 801, an input device 802, an output device 803, and a computer storage medium 804. The processor 801, the input device 802, the output device 803, and the computer storage medium 804 in the electronic device may be connected via a bus or other means.
[0109] The computer storage medium 804 can be stored in the memory of the electronic device. The computer storage medium 804 is used to store a computer program. The computer program includes program instructions. The processor 801 is used to execute the program instructions stored in the computer storage medium 804. The processor 801 (or CPU (Central Processing Unit)) is the computing core and control core of the electronic device. It is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions to implement the corresponding method flow or corresponding function. In one embodiment, the processor 801 of the embodiment of the present application can be used to perform a series of processing, including such as Figure 1 or Figure 5 Any steps of the method in the illustrated embodiment and the like.
[0110] The embodiment of the present application also provides a computer storage medium (Memory), which is a memory device in an electronic device for storing programs and data. It is understandable that the computer storage medium here can include both built-in storage media in electronic devices and, of course, extended storage media supported by electronic devices. The computer storage medium provides a storage space that stores the operating system of the electronic device. In addition, one or more instructions suitable for being loaded and executed by the processor 801 are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer storage medium here can be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage; optionally, it can also be at least one computer storage medium located away from the aforementioned processor.
[0111] In one embodiment, the processor 801 may load and execute one or more instructions stored in a computer storage medium to implement the corresponding steps in the above embodiment; in a specific implementation, the processor 801 may load and execute one or more instructions stored in a computer storage medium to implement the corresponding steps in the above embodiment; Figure 1 or Figure 5 Any steps in the method will not be repeated here.
[0112] It should be noted that the above-mentioned screw image processing method, device, electronic device and storage medium belong to a general inventive concept, and the contents in the embodiments of the screw image processing method, device, electronic device and storage medium are applicable to each other.
[0113] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0114] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the division of the module is only a logical function division, and there may be other division methods in actual implementation, for example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. The mutual coupling, direct coupling, or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0115] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0116] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media integrations. The available medium may be a read-only memory (ROM), or a random access memory (RAM), or a magnetic medium, such as a floppy disk, a hard disk, a tape, a magnetic disk, or an optical medium, such as a digital versatile disc (DVD), or a semiconductor medium, such as a solid state disk (SSD), etc.
Claims
1. A screw image processing method, characterized in that: include: Acquire a screw image, and extract a nut circular area in the screw image; Determine the center and radius of the circular area of the nut; According to the center and radius of the circular area of the nut, the circular area of the nut is subjected to polar coordinate expansion processing to obtain a first rectangular image corresponding to the circular area of the nut; Extracting the character area of the first rectangular image and determining the segmentation position of the character area; the determining the segmentation position of the character area includes: performing expansion and erosion operations on the character area to determine the character block area in the character area, and determining the segmentation position according to the position of the character block area, wherein the segmentation position is a segmentation line in the character area, and the segmentation line does not pass through the character block area; According to the segmentation position, the character area is segmented and reassembled to obtain a second rectangular image, including: according to the segmentation line, the character area is segmented into two sub-rectangles, and the two sub-rectangles are swapped and spliced to obtain the second rectangular image; Character recognition is performed on the second rectangular image to obtain a screw detection number corresponding to the screw image.
2. The screw image processing method according to claim 1, characterized in that: The step of extracting the character area of the first rectangular image comprises: Identify a demarcation line in the first rectangular image, where the demarcation line is used to divide the character area and the non-character area in the rectangular image; The character area of the first rectangular image is extracted according to the dividing line.
3. The screw image processing method according to claim 1 or 2, characterized in that: After obtaining the screw detection number corresponding to the screw image, the method further includes: Output the nut circular area and the screw detection number.
4. The screw image processing method according to claim 3, characterized in that: The method comprises: Obtain a target screw position identifier corresponding to the screw detection number; Obtaining a mapping relationship between a preset screw position identifier and a screw preset number, and determining a screw preset number corresponding to the target screw position identifier according to the mapping relationship; Compare the screw detection number with the screw preset number corresponding to the target screw position identifier to see whether they are the same; When the screw detection number is different from the screw preset number corresponding to the target screw position identifier, an error prompt message is output, wherein the error prompt message is used to indicate that the screw corresponding to the target screw position identifier is incorrectly placed; In the case where the screw detection number is the same as the screw preset number corresponding to the target screw position identifier, it is determined that the screw corresponding to the target screw position identifier is correctly placed.
5. The screw image processing method according to claim 1, characterized in that: The performing character recognition on the second rectangular image to obtain a screw detection number corresponding to the screw image includes: Performing character recognition on the second rectangular image to obtain a first character sequence; identifying a preset identification character in the first character sequence; The order of characters in the first character sequence is adjusted according to the position of the preset identification character, the preset identification character is deleted, and the screw detection number corresponding to the screw image is obtained.
6. The screw image processing method according to claim 1, characterized in that: The method is applied to a screw image processing device, the device comprising a detection module, and the detection module comprising a screw camera; The step of acquiring the screw image comprises: An identification path is obtained, and the detection module is controlled to move according to the identification path. At each screw position where a screw is placed, the screw image is acquired by collecting with the screw camera.
7. A screw image processing device, characterized in that: include: An acquisition module, used to acquire a screw image and extract a nut circular area in the screw image; A conversion module is used to: determine the center and radius of the circular area of the nut, and perform polar coordinate expansion processing on the circular area of the nut according to the center and radius of the circular area of the nut to obtain a first rectangular image corresponding to the circular area of the nut; Divide the modules into: Extracting a character region of the first rectangular image, determining a segmentation position of the character region, and segmenting and reassembling the character region according to the segmentation position to obtain a second rectangular image; The division module is specifically used to: perform expansion and erosion operations on the character area to determine the character block area in the character area, determine the segmentation position according to the position of the character block area, the segmentation position is a segmentation line in the character area, and the segmentation line does not pass through the character block area; divide the character area into two sub-rectangles according to the segmentation line, and exchange the arrangement order of the two sub-rectangles for splicing to obtain the second rectangular image; A character recognition module is used to perform character recognition on the second rectangular image to obtain a screw detection number corresponding to the screw image.
8. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the screw image processing method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a processor, the processor executes the steps of the screw image processing method according to any one of claims 1 to 6.
