A method for detecting straightness of a lead screw, a computing device and a readable storage medium

By stitching together the lead screw images and fitting the central axis, the problem of low accuracy and efficiency in lead screw straightness detection in existing technologies has been solved, achieving higher precision and more efficient detection.

CN115760718BActive Publication Date: 2026-03-03ADVANCED SEMICON MFG INNOVATION CENT WUXI XISHAN DISTRICT
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202211367307.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-02
Publication Date
2026-03-03
Estimated Expiration
2042-11-02

AI Technical Summary

Technical Problem

Existing methods for detecting the straightness of lead screws are susceptible to problems in lead screw processing and the skill level of manual operators, resulting in low accuracy and low efficiency.

Method used

By acquiring multiple original images of the lead screw, image processing technology is used to stitch them together into a composite image. The coordinates of the thread center point are extracted, the lead screw axis is fitted, and the straightness is determined based on the axis. This avoids directly measuring surface values ​​and uses image reconstruction of the center axis.

Benefits of technology

This improves the accuracy and efficiency of lead screw straightness detection, reduces the impact of machining and manual operation, and ensures the precision of the detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115760718B_ABST
    Figure CN115760718B_ABST
Patent Text Reader

Abstract

The application discloses a detection method for straightness of a lead screw, a computing device and a readable storage medium, and relates to the technical field of lead screw straightness measurement. The detection method comprises the following steps: firstly, a plurality of first original images of a lead screw to be processed are acquired, each first original image corresponds to a part of the lead screw to be processed, and adjacent two first original images have an overlapping area. Then, according to the overlapping area, the plurality of first original images are spliced into a first spliced image, and first center point coordinates of each thread in the first spliced image are acquired. Then, according to the obtained plurality of first center point coordinates, a first axis of the lead screw to be processed is fitted, and the sum of distances from the plurality of first center point coordinates to the first axis is minimum. Finally, at least according to the first axis, straightness of the lead screw to be processed is determined. The detection method can improve the accuracy and efficiency of the detection of the straightness of the lead screw.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of lead screw straightness measurement technology, and in particular to a method for detecting lead screw straightness, a computing device, and a readable storage medium. Background Technology

[0002] Lead screws are crucial components widely used in industrial production, enabling the transmission of motion and power within mechanisms. To meet specific transmission requirements and ensure sufficient transmission accuracy, each type of lead screw is designed with specific dimensions and shape parameters. Among these, the straightness of the lead screw is a critical parameter affecting transmission; a lead screw that does not meet straightness requirements will cause equipment to malfunction.

[0003] Currently, the straightness of lead screws is mostly tested using dial indicators. Specifically, it relies mainly on the displacement of the probe on the surface of the lead screw. However, the test results are easily affected by issues in the lead screw manufacturing process (such as surface burrs and particles) and subjective factors such as the operator's skill level (e.g., reading the data), resulting in low accuracy. Furthermore, manual inspection is also inefficient.

[0004] Therefore, a new method for detecting the straightness of lead screws is urgently needed to solve the above-mentioned technical problems. Summary of the Invention

[0005] Therefore, the present invention provides a method, computing device and readable storage medium for detecting the straightness of a lead screw, in an attempt to solve or at least alleviate the problems mentioned above.

[0006] According to one aspect of the present invention, a method for detecting the straightness of a lead screw is provided, comprising: acquiring multiple first original images of a lead screw to be processed, each first original image corresponding to a portion of the lead screw to be processed, and adjacent first original images having an overlapping area; stitching the multiple first original images into a first stitched image based on the overlapping area; acquiring the coordinates of a first center point of each thread in the first stitched image; fitting a first axis of the lead screw to be processed based on the acquired coordinates of the multiple first center points, wherein the sum of the distances from the multiple first center point coordinates to the first axis is minimized; and determining the straightness of the lead screw to be processed based at least on the first axis.

[0007] Optionally, in the method for detecting the straightness of the lead screw according to the present invention, stitching multiple first original images into a first stitched image based on the overlapping area includes: detecting feature points in the overlapping area for each pair of adjacent first original images; matching the detected feature points; and stitching multiple first original images into a first stitched image based on the matched feature points.

[0008] Optionally, in the method for detecting the straightness of the lead screw according to the present invention, obtaining the coordinates of the first center point of each thread in the first spliced ​​image includes: performing binarization and morphological preprocessing on the first spliced ​​image to obtain a processed binary image; segmenting the image of each thread in the binary image; extracting the contour of each thread based on the image of each thread; and determining the coordinates of the first center point of each thread based on the contour of each thread.

[0009] Optionally, in the method for detecting the straightness of the lead screw according to the present invention, segmenting the image of each thread in the binary image includes: determining the pitch of the lead screw in the binary image; taking the starting position of the first thread in the binary image as the starting point, and taking an image segment at every pitch as a thread image.

[0010] Optionally, in the method for detecting the straightness of the lead screw according to the present invention, determining the straightness of the lead screw to be processed based at least on the first axis includes: obtaining the distance from the coordinates of each first center point to the first axis, and taking the maximum distance as the straightness of the lead screw to be processed.

[0011] Optionally, in the method for detecting the straightness of the lead screw according to the present invention, before determining the straightness of the lead screw to be processed based at least on the first axis, the method further includes: acquiring multiple second original images of the lead screw to be processed after rotating by a preset angle; stitching the multiple second original images together to obtain a second stitched image; acquiring the coordinates of the second center point of each thread in the second stitched image; and fitting the second axis of the lead screw to be processed after rotating by a preset angle based on the obtained coordinates of the multiple second center points.

[0012] Optionally, in the method for detecting the straightness of a lead screw according to the present invention, determining the straightness of the lead screw to be processed based at least on a first axis includes: determining the straightness of the lead screw to be processed based on a first axis and a second axis.

[0013] Optionally, in the method for detecting the straightness of a lead screw according to the present invention, determining the straightness of the lead screw to be processed based on the first axis and the second axis includes: reconstructing the spatial axis in a preset spatial coordinate system based on the first axis and the second axis; transforming the coordinates of the first center point and the second center point into the spatial coordinate system respectively to obtain the transformed coordinates of the first center point and the transformed coordinates of the second center point; determining the distances from the transformed coordinates of the first center point and the transformed coordinates of the second center point to the aforementioned spatial axis to obtain multiple distances; and determining the diameter of the smallest circle enclosing the multiple distances as the straightness of the lead screw.

[0014] Optionally, in the method for detecting the straightness of the lead screw according to the present invention, the preset angle is 90 degrees.

[0015] Optionally, in the method for detecting the straightness of the lead screw according to the present invention, after matching the detected feature points and before stitching multiple first original images into a first stitched image based on the matched feature points, the method further includes: obtaining a preset standard pitch value; deleting feature points whose distance between matched feature points is greater than or less than a preset distance, wherein the preset distance is a preset multiple of the standard pitch value.

[0016] According to another aspect of the present invention, a computing device is provided, comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, the program instructions including instructions for performing a method for detecting the straightness of a lead screw according to the present invention.

[0017] According to another aspect of the present invention, a readable storage medium storing program instructions is provided, which, when read and executed by a computing device, causes the computing device to perform the lead screw straightness detection method according to the present invention.

[0018] According to the method for detecting the straightness of a lead screw according to the present invention, firstly, multiple first original images of the lead screw to be processed are acquired. Then, the first original images are stitched together, and the axis of the lead screw is fitted using the coordinates of the center point of each thread in the stitched image. Finally, the straightness of the lead screw is determined based on the axis. It can be seen that the present invention determines the straightness by processing the lead screw image and fitting the lead screw axis, thus avoiding the influence of lead screw processing problems and human operation level in the prior art. Furthermore, the present invention does not directly calculate from the measured values ​​of the lead screw surface, but reconstructs the center axis using surface information; that is, it does not simply use surface results to replace internal results, thereby ensuring the accuracy of the lead screw straightness detection.

[0019] In addition, the present invention automatically detects the straightness of the lead screw through image processing, which can significantly improve the detection efficiency of the lead screw straightness compared with manual processing.

[0020] Therefore, this invention can improve both the accuracy and efficiency of lead screw straightness detection. Attached Figure Description

[0021] To achieve the foregoing and related objectives, certain illustrative aspects are described herein in conjunction with the following description and accompanying drawings. These aspects indicate various ways in which the principles disclosed herein may be practiced, and all aspects and their equivalents are intended to fall within the scope of the claimed subject matter. The foregoing and other objectives, features, and advantages of this disclosure will become more apparent from the following detailed description, taken in conjunction with the accompanying drawings. Throughout this disclosure, the same reference numerals generally refer to the same parts or elements.

[0022] Figure 1A structural block diagram of a computing device 100 according to an embodiment of the present invention is shown;

[0023] Figure 2 A flowchart of a method 200 for detecting the straightness of a lead screw according to an embodiment of the present invention is shown;

[0024] Figure 3 A schematic diagram of two types of lead screws according to an embodiment of the present invention is shown;

[0025] Figure 4 A first stitched image and a schematic diagram of a stitching point are shown according to an embodiment of the present invention.

[0026] Figure 5 A flowchart of a method 500 for detecting the straightness of a lead screw according to yet another embodiment of the present invention is shown;

[0027] Figure 6(a) shows a schematic diagram of the lead screw to be processed in spatial coordinates according to an embodiment of the present invention;

[0028] Figure 6(b) shows a schematic diagram of a first axis according to an embodiment of the present invention;

[0029] Figure 6(c) shows a schematic diagram of the second axis according to an embodiment of the present invention;

[0030] Figure 7 A schematic flowchart of a method for detecting the straightness of a lead screw according to yet another embodiment of the present invention is shown. Detailed Implementation

[0031] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0032] Figure 1A block diagram of the physical components (i.e., hardware) of a computing device 100 is shown. In a basic configuration, the computing device 100 includes at least one processing unit 102 and a system memory 104. According to one aspect, depending on the configuration and type of the computing device, the processing unit 102 may be implemented as a processor. The system memory 104 includes, but is not limited to, volatile memory (e.g., random access memory), non-volatile memory (e.g., read-only memory), flash memory, or any combination of such memories. According to one aspect, the system memory 104 includes an operating system 105 and a program module 106, the program module 106 including a straightness detection module 120 configured to perform the lead screw straightness detection method 200 of the present invention.

[0033] According to one aspect, operating system 105 is, for example, suitable for controlling the operation of computing device 100. Furthermore, examples are practiced in conjunction with graphics libraries, other operating systems, or any other applications, and are not limited to any particular application or system. Figure 1 The basic configuration is illustrated by the components within the dashed lines 108. According to one aspect, the computing device 100 has additional features or functions. For example, according to one aspect, the computing device 100 includes additional data storage devices (removable and / or non-removable), such as disks, optical discs, or magnetic tapes. This additional storage... Figure 1 The image is shown by removable storage 109 and non-removable storage 110.

[0034] As stated above, according to one aspect, a program module is stored in system memory 104. According to one aspect, the program module may include one or more applications. The present invention does not limit the type of application; for example, applications may include: email and contact applications, word processing applications, spreadsheet applications, database applications, slideshow applications, drawing or computer-aided applications, web browser applications, etc.

[0035] According to one aspect, examples can be practiced on circuits including discrete electronic components, packaged or integrated electronic chips containing logic gates, circuits utilizing microprocessors, or on a single chip containing electronic components or a microprocessor. For example, it can be practiced via wherein... Figure 1Each or many of the components shown can be implemented as an example by integrating a System-on-a-Chip (SOC) on a single integrated circuit. According to one aspect, such an SOC device may include one or more processing units, graphics units, communication units, system virtualization units, and various application functions, all integrated (or “burned in”) as a single integrated circuit onto a chip substrate. When operating via the SOC, the functions described herein can be operated via dedicated logic integrated on a single integrated circuit (chip) with other components of the computing device 100. Embodiments of the invention can also be implemented using other techniques capable of performing logical operations (e.g., AND, OR, and NOT), including but not limited to mechanical, optical, fluid, and quantum technologies. Additionally, embodiments of the invention can be implemented within a general-purpose computer or in any other circuit or system.

[0036] According to one aspect, computing device 100 may also have one or more input devices 112, such as a keyboard, mouse, pen, voice input device, touch input device, etc. It may also include output devices 114, such as a display, speaker, printer, etc. The foregoing devices are examples and other devices may also be used. Computing device 100 may include one or more communication connections 116 that allow communication with other computing devices 118. Examples of suitable communication connections 116 include, but are not limited to: RF transmitter, receiver and / or transceiver circuitry; Universal Serial Bus (USB), parallel and / or serial ports.

[0037] As used herein, the term computer-readable medium includes computer storage medium. Computer storage medium can include volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information (e.g., computer-readable instructions, data structures, or program modules). System memory 104, removable storage device 109, and non-removable storage 110 are examples of computer storage media (i.e., memory storage). Computer storage media can include random access memory (RAM), read-only memory (ROM), electrically erasable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical storage, magnetic tape, magnetic tape, disk storage or other magnetic storage devices, or any other article of manufacture that can be used to store information and is accessible by computer device 100. According to one aspect, any such computer storage medium can be part of computing device 100. Computer storage media does not include carrier waves or other transmitted data signals.

[0038] According to one aspect, a communication medium is implemented by computer-readable instructions, data structures, program modules, or other data in a modulated data signal (e.g., a carrier wave or other transmission mechanism), and includes any information transmission medium. According to one aspect, the term "modulated data signal" describes a signal having one or more sets of characteristics or altered in a manner that encodes information in the signal. By way of example and not limitation, a communication medium includes wired media such as wired networks or direct wired connections, and wireless media such as acoustic, radio frequency (RF), infrared, and other wireless media.

[0039] Figure 2 A flowchart of a method 200 for detecting the straightness of a lead screw according to an embodiment of the present invention is shown. Method 200 is adapted to be used on a computing device (e.g., Figure 1 Executed in the computing device 100 shown. Figure 2 As shown, the method 200 begins at 201. In 201, multiple first original images of the lead screw to be processed are acquired, each first original image corresponding to a portion of the lead screw to be processed, and adjacent first original images have overlapping areas.

[0040] In this embodiment, the lead screw whose straightness is to be tested is referred to as the lead screw to be processed, such as... Figure 3 Both types of lead screws shown can be used as the lead screw to be processed. Specifically, a camera can be moved by a slide table to take multiple pictures of different parts of the lead screw to be processed, thereby obtaining multiple first original images of the lead screw. When taking pictures of different parts of the lead screw, a portion of the image can be retained for repeated shooting. Therefore, the travel distance of the slide table each time can be slightly less than the length of the lead screw that can be captured in a single image. For example, a slide table travel distance of 25mm translates to approximately 4600 pixels, and a camera image width of approximately 30mm per shot, or approximately 5500 pixels, results in an overlap of approximately 900 pixels between two adjacent images. The rightmost 900 pixels of the first original image overlaps with the leftmost 900 pixels of the second original image.

[0041] In this step, for ease of description, the images captured of different parts of the lead screw to be processed are referred to as the first original images. Each first original image corresponds to a part of the lead screw to be processed, and adjacent first original images have overlapping areas.

[0042] Then, proceeding to step 202, multiple first original images are stitched together into a first stitched image based on the overlapping area. In some embodiments, multiple first original images can be stitched together into a single image in a spiral order based on the overlapping area. For ease of description, the stitched image is referred to as the first stitched image. According to one embodiment of the present invention, the specific implementation process of stitching may include the following steps A1 to A3.

[0043] A1. For each pair of adjacent first original images, detect the feature points in the overlapping region.

[0044] Since two adjacent first original images have overlapping areas, and the overlapping areas display the same thread information, image stitching can be performed using only the feature points of the overlapping areas. This avoids detecting all pixels of each first original image, which greatly reduces the algorithm's time consumption and improves the image stitching efficiency. Furthermore, it also avoids most erroneous feature point matching, thereby improving the accuracy of stitching.

[0045] In this invention, when detecting feature points in the overlapping region of two adjacent first original images, the SIFT algorithm can be used to extract the feature points. This is merely an example, and the invention does not limit its scope.

[0046] A2. Match the detected feature points.

[0047] After detecting feature points in the overlapping areas of two adjacent first original images, it is necessary to match feature points representing the same thread information from the detected feature points; this step involves matching the detected feature points. Specifically, the FLANN algorithm can be used to quickly match the detected feature points. Of course, other methods can also be used to match the detected feature points, and this invention is not limited thereto. In specific embodiments, those skilled in the art can make settings according to actual needs.

[0048] After feature point matching is completed, a preset standard pitch value can be obtained. Feature points whose distances are greater than or less than a preset distance (a multiple of the standard pitch value) are then deleted. This removes obviously mismatched feature points, improving splicing accuracy. Additionally, after feature point matching, the slide travel value can be obtained. Feature points whose distances are greater than or less than a preset multiple of the slide travel value are then deleted. This also improves the accuracy of the feature point pairs used in splicing, thereby enhancing overall splicing accuracy.

[0049] A3. Based on the matched feature points, multiple original images are stitched together to form a first stitched image.

[0050] After feature point matching is completed, the matched feature points are used to spatially stitch the two adjacent first original images together. Specifically, image stitching can be accomplished through coordinate transformation and operations such as expansion and cropping.

[0051] To visually demonstrate the first stitched image obtained, this embodiment provides... Figure 4The diagram shows the first stitched image, and a schematic diagram of the stitching point is also provided.

[0052] At this point, the first stitched image is obtained. Then, step 203 is taken to obtain the coordinates of the first center point of each thread in the first stitched image. Specifically, this may include the following steps B1 to B4.

[0053] B1. The first stitched image is binarized and morphologically preprocessed to obtain a processed binary image. For ease of description, this embodiment refers to the image obtained after binarizing and morphologically preprocessing the first stitched image as the processed binary image.

[0054] B2. Segment the image of each thread in the binary image. Specifically, the image of each thread can be segmented from the binary image as follows.

[0055] Determine the pitch of the lead screw in the binary image. First, it should be noted that pitch refers to the width of a single thread in the lead screw. Considering the possibility of the lead screw tilting on the actual fixture, a slope is first determined to ensure the straight line passes through each tooth. This slope can be determined based on the highest points of the first and last teeth in the binary image. Then, draw a straight line passing through the highest points of the first and last teeth and the determined slope. Next, shift this line downwards by several pixels, ensuring the line remains between the highest and lowest points of each tooth and passes through every tooth. This yields multiple intersection points between the line and the processed binary image. The distance between any two valid intersection points (intersections at the same position on adjacent teeth) is one pitch. Finally, the average of these pitches is determined as the final true pitch value, i.e., the pitch of the lead screw in the binary image.

[0056] After obtaining the pitch of the lead screw in the binary image, the image segment at every pitch is taken as the starting position of the first thread in the binary image. That is, starting from the starting position of the first thread in the binary image, every pitch of image segment is a thread image, thus obtaining multiple thread images. It should be noted that segmenting the image of each thread by pitch can reduce the algorithm's time consumption.

[0057] B3. Based on the image of each thread, extract the contour of each thread.

[0058] B4. Based on the profile of each thread, determine the coordinates of the first center point of each thread. Specifically, determine the coordinates of the center point of the profile of each thread. For ease of description, the coordinates of the center point of the profile of the thread are referred to as the coordinates of the first center point of the thread. Therefore, through this step, the coordinates of the center point of the profile of each thread are obtained, that is, the coordinates of the first center point of each thread are obtained.

[0059] After obtaining the coordinates of the first center point of each thread in the first stitched image, step 204 is executed. Based on the obtained coordinates of multiple first center points, the first axis of the lead screw to be processed is fitted. For ease of description, the axis of the lead screw to be processed is referred to as the first axis. Specifically, the fitted axis of the lead screw can be determined by minimizing the sum of the distances from all the first center point coordinates to the axis; that is, the fitted first axis is obtained by minimizing the sum of the distances from the first center point coordinates to the axis.

[0060] Then, proceed to step 205, where the straightness of the lead screw to be processed is determined based at least on the first axis. Specifically, the distance from the coordinates of each first center point to the first axis can be obtained first, and the maximum distance among them can be used as the straightness of the lead screw to be processed. That is, the maximum distance from all contour centers to the fitted axis is used as the straightness.

[0061] Several points need clarification. First, this embodiment stitches together multiple first original images to obtain a first stitched image. Then, it segments the image of each thread from the first stitched image and determines the coordinates of the first center point of the thread. This is then used to fit the first axis of the lead screw. Finally, the maximum distance from the first center point coordinates to the first axis is determined as the straightness of the lead screw. It is evident that this embodiment processes a stitched image of multiple first original images, only fitting it to obtain the first axis of the lead screw, and then taking the maximum distance from the first center point coordinates to the first axis as the straightness of the lead screw. It should be noted that if stitching is not performed, and instead a straight line is fitted to each first original image separately to obtain the maximum distance, the maximum distance of each first original image will not exceed the maximum distance of the first stitched image, and the final calculated straightness will often be too small.

[0062] Secondly, this embodiment detects feature points in overlapping areas of multiple first original images, then matches the feature points in the overlapping areas of adjacent first original images, and then stitches the multiple first original images together. It is evident that this embodiment only detects feature points in the overlapping areas of adjacent first original images, rather than detecting them on the entire first original image. This significantly reduces the time spent finding and matching feature points. Furthermore, the matched feature points are more accurate, almost eliminating the possibility of matching feature points in non-repeated image areas, thus effectively preventing stitching failures.

[0063] Finally, this invention can be applied to various types of lead screws, and is not limited to those mentioned in this embodiment. Figure 3 The two methods are shown. Specifically, the methods for determining the pitch and detecting feature points of the lead screw to be processed are applicable to different models of lead screws. Furthermore, this invention can not only be used to determine the straightness of the lead screw, but also to calculate the major diameter, total runout, etc., after obtaining the complete profile of the lead screw, thus realizing more other detection functions.

[0064] As can be seen, this embodiment processes multiple first original images of the lead screw taken from one angle, and the resulting first axis is the axis determined from the original image at one angle. To further improve the accuracy of straightness detection, the spatial axis (i.e., the axis of the lead screw in three-dimensional space) can be reconstructed, and then the straightness of the lead screw can be determined using the spatial axis. For ease of description, two angles are used as examples, and the specific implementation method is as follows: Figure 5 The diagram illustrates a flowchart of a method 500 for detecting the straightness of a lead screw according to yet another embodiment of the present invention. Method 500 is adapted to be used on a computing device (e.g., Figure 1 Executed in the computing device 100 shown. Figure 5 As shown, this method 500 begins at 501.

[0065] 501. Obtain multiple first original images of the lead screw to be processed. Each first original image corresponds to a part of the lead screw to be processed, and adjacent first original images have overlapping areas.

[0066] To more clearly illustrate the imaging scenario of the lead screw to be processed in this step, a schematic diagram as shown in Figure 6(a) is provided. The center point of the left end face of the lead screw to be processed is taken as the origin of the spatial coordinate system. The lead screw to be processed is located on the Z-axis. Multiple first original images are obtained by imaging the lead screw to be processed in the XOZ plane. As can be seen from Figure 6(a), the first original images are equivalent to imaging the lead screw to be processed in the XOZ plane; that is, the multiple first original images obtained in this step are equivalent to multiple images obtained by imaging the lead screw to be processed in the XOZ plane.

[0067] 502. Based on the overlapping area, multiple first original images are stitched together to form a first stitched image.

[0068] 503. Obtain the coordinates of the first center point of each thread in the first stitched image.

[0069] 504. Based on the obtained coordinates of multiple first center points, fit the first axis of the lead screw to be processed.

[0070] For the specific implementation of steps 501 to 504 above, please refer to... Figure 2 The specific implementation methods of steps 201 to 204 in the corresponding embodiments will not be described in detail here.

[0071] Taking Figure 6(a) as an example, a schematic diagram of the fitted first axis is shown in Figure 6(b). Since the slope of the fitted axis is not necessarily 0 in practice, in this embodiment, the first axis is an inclined straight line passing through the origin. Furthermore, the expression for the first axis can be expressed as z = mx.

[0072] 505. Obtain multiple second original images after the lead screw to be processed has rotated by a preset angle.

[0073] In this step, the preset angle can be 90 degrees. Of course, in practice, the preset angle can also be other values. This invention does not limit the specific value of the preset angle.

[0074] In this embodiment, the multiple first original images obtained in step 501 are equivalent to photographing a projection surface of the lead screw. After obtaining the first original images, the lead screw is rotated 90 degrees and photographed again to obtain multiple original images. For ease of description, the images obtained in this step are referred to as the second original images.

[0075] In this embodiment, it is the lead screw that rotates. Therefore, the second imaging is equivalent to turning the top of the lead screw from the first imaging to the front (the shooting surface). So, the second original image obtained by the second imaging is actually the top of the lead screw from the first imaging.

[0076] To more clearly demonstrate this step of rotating the lead screw to be processed by 90 degrees, we will take Figure 6(a) as an example. After rotating the lead screw by 90 degrees in the direction of rotation shown in the figure, we can take a picture of the lead screw to obtain a second original image. The second original image is equivalent to the projection in the YOZ plane after rotating by 90 degrees.

[0077] 506. Stitch together multiple original second images to obtain a second stitched image.

[0078] The specific implementation method for this step can be found in step 220, and will not be repeated here. For ease of description, the image obtained by stitching in this step will be referred to as the second stitched image.

[0079] 507. Obtain the coordinates of the second center point of each thread in the second stitched image.

[0080] The specific implementation method for this step can be found in step 230, and will not be repeated here. For ease of description, the coordinates of the center point of each thread determined in this step will be referred to as the second center point coordinates.

[0081] 508. Based on the obtained coordinates of multiple second center points, fit the second axis of the lead screw to be processed after rotating by a preset angle.

[0082] The specific implementation method for this step can be found in step 240, and will not be repeated here. For ease of description, the axis fitted in this step will be referred to as the second axis.

[0083] To illustrate the second axis more clearly, let's take Figure 6(a) as an example again. The second axis fitted in this step is shown in Figure 6(c). As can be seen from Figure 6(c), the second axis is an inclined straight line passing through the origin, which is a straight line in a two-dimensional plane. Furthermore, the expression for the second axis can be expressed as z = ny.

[0084] 509. Based on the first axis and the second axis, reconstruct the spatial axes in the preset spatial coordinate system.

[0085] In this embodiment, the preset spatial coordinate system is a three-dimensional coordinate system. The origin of the spatial coordinate system can be the center point of one end face of the lead screw to be processed, for example, the center point of the left end face of the lead screw to be processed.

[0086] If the expression for the first axis is z = mx and the expression for the second axis is z = ny, then the expression for the spatial axis can be expressed as z = mx = ny, that is, the expression for the spatial axis is as shown in the following formula (1):

[0087]

[0088] Where a has the value of n, b has the value of m, and c has the value of mn.

[0089] 510. Transform the coordinates of the first center point and the second center point into a spatial coordinate system respectively to obtain the transformed coordinates of the first center point and the transformed coordinates of the second center point.

[0090] In this embodiment, since the coordinates of the first center point are calculated using the first stitched image and the coordinates of the second center point are calculated using the second stitched image, both the coordinates of the first center point and the coordinates of the second center point are coordinates in a two-dimensional plane, that is, both are two-dimensional coordinates.

[0091] In this embodiment, the reconstructed spatial axis is in a three-dimensional spatial coordinate system. Therefore, to calculate the distance from the first center point coordinates and the second center point coordinates to the spatial axis, it is necessary to unify the first center point coordinates, the second center point coordinates, and the spatial axis to the spatial coordinate system in which the spatial axis is located.

[0092] Taking Figure 6(a) as an example again, if the coordinates of the i-th first center point are (x... i , z i If ), then the coordinates of the i-th first center point after transformation are (x i +Δx1, 0, z i +Δz1), that is, Δx1 and Δz1 are the correction values ​​for transforming the coordinates of the i-th first center point from the two-dimensional coordinate system to the three-dimensional spatial coordinate system. If the coordinates of the i-th second center point are (y i , z iIf the coordinates of the i-th second center point after transformation are (0, y), then the coordinates of the i-th second center point after transformation are (0, y). i +Δy2,z i +Δz2), that is, Δy2 and Δz2 are the correction values ​​for the coordinates of the i-th second center point when transforming from the two-dimensional coordinate system to the three-dimensional spatial coordinate system.

[0093] 511. Determine the distances from the transformed first center point coordinates and the transformed second center point coordinates to the spatial axis, and obtain multiple distances.

[0094] In this step, taking Figure 6(a) as an example, the expression for the distance from the transformed i-th first center point coordinate to the spatial axis is shown in the following formula (2):

[0095]

[0096] The expression for the distance from the transformed i-th second center point to the spatial axis is shown in the following formula (3):

[0097]

[0098] Using formulas (2) and (3), the distance from the first center point after each transformation to the spatial axis can be determined, and the distance from the second center point after each transformation to the spatial axis can also be determined.

[0099] 512. The diameter of the smallest circle enclosing multiple distances is determined as the straightness of the lead screw.

[0100] In this step, the diameter of the smallest circle that can encompass the distance obtained in step 511 is determined as the straightness of the lead screw.

[0101] It should be noted that in this embodiment, the images taken at two different angles are fitted with axes, and the spatial axis is reconstructed using the two axes. In practice, the lead screw to be processed can be photographed from more angles to obtain axes corresponding to multiple angles, and the spatial axis can be reconstructed based on the axes of multiple angles. Then, the straightness of the lead screw to be processed can be determined based on the reconstructed spatial axis. Moreover, the more angles there are, the higher the accuracy of the straightness of the lead screw.

[0102] To better understand the present invention, another embodiment is given below. Figure 7 A schematic flowchart of a method for detecting the straightness of a lead screw according to another embodiment of the present invention is shown, which specifically includes the following steps.

[0103] Load the original image from at least one angle.

[0104] The number of original images (n) for a given angle is counted. Two original images are read sequentially. By extracting and matching feature points, these two original images are stitched together. If the number of stitching attempts is less than n-1, the next original image is read sequentially. By extracting and matching feature points in this original image and the latest stitched image, the two images are stitched together. This process continues until the number of stitching attempts reaches n-1. The latest stitched image obtained at this point is the complete stitched image corresponding to the original image for that angle, and is called the first stitched image. The first stitched image is then binarized, undergoes morphological preprocessing adjustments, segments each thread image, extracts the thread contour, determines the center point coordinates of each thread contour, fits a straight line using the center point coordinates as the first axis of the lead screw, and calculates the distance from the center point coordinates of each thread to the first axis.

[0105] If there are unprocessed original images at that angle, repeat the above steps according to the number n of original images at that angle until the axis of the lead screw is obtained at each angle.

[0106] Reconstruct the spatial axis based on the axis corresponding to each angle, and calculate the straightness of the lead screw using the reconstructed spatial axis.

[0107] According to the method for detecting the straightness of a lead screw according to the present invention, firstly, multiple first original images of the lead screw to be processed are acquired. Then, the first original images are stitched together, and the axis of the lead screw is fitted using the coordinates of the center point of each thread in the stitched image. Finally, the straightness of the lead screw is determined based on the axis. It can be seen that the present invention determines the straightness by processing the lead screw image and fitting the lead screw axis, thus avoiding the influence of lead screw processing problems and manual operation levels in the prior art. Furthermore, the present invention does not directly calculate from the measured values ​​of the lead screw surface, but reconstructs the center axis using surface information; that is, it does not simply use surface results to replace internal results, thereby ensuring the accuracy of lead screw straightness detection. In addition, the present invention automatically detects the straightness of the lead screw through image processing, which can significantly improve the detection efficiency compared to manual processing. Therefore, the present invention can improve detection efficiency while ensuring the accuracy of lead screw straightness detection.

[0108] A9. The method as described in any one of A6-A8, wherein the preset angle is 90 degrees. A10. The method as described in A2, wherein after the matched and detected feature points, and before stitching multiple first original images into a first stitched image based on the matched feature points, the method further includes: obtaining a preset standard pitch value; deleting feature points whose distance between matched feature points is greater than or less than a preset distance, wherein the preset distance is a preset multiple of the standard pitch value.

[0109] The various techniques described herein can be implemented in combination with hardware or software, or a combination thereof. Thus, the methods and apparatus of the present invention, or certain aspects or portions thereof, can take the form of program code (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, USB flash drive, floppy disk, CD-ROM, or any other machine-readable storage medium, wherein when the program is loaded into and executed by a machine such as a computer, the machine becomes an apparatus for practicing the present invention.

[0110] When the program code is executed on a programmable computer, the computing device generally includes a processor, a processor-readable storage medium (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. The memory is configured to store program code; the processor is configured to execute the lead screw straightness detection method of the present invention according to instructions in the program code stored in the memory.

[0111] By way of example, and not limitation, readable media include readable storage media and communication media. Readable storage media stores information such as computer-readable instructions, data structures, program modules, or other data. Communication media generally embodies computer-readable instructions, data structures, program modules, or other data in the form of modulated data signals such as carrier waves or other transmission mechanisms, and includes any information delivery medium. Any combination of the above is also included within the scope of readable media.

[0112] In the specification provided herein, the algorithms and displays are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used with the examples of this invention. The required structure for constructing such systems is apparent from the above description. Furthermore, this invention is not directed to any particular programming language. It should be understood that the contents of the invention described herein can be implemented using various programming languages, and the above description of specific languages ​​is for the purpose of disclosing the best mode of implementation of the invention.

[0113] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.

[0114] It should be understood that, in order to simplify this disclosure and aid in understanding one or more aspects of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof in the above description of exemplary embodiments of the invention. However, this method of disclosure should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim.

[0115] Those skilled in the art will understand that modules, units, or components of the devices disclosed in the examples herein can be arranged in the devices described in this embodiment, or alternatively, can be located in one or more devices different from the devices in this example. The modules in the foregoing examples can be combined into a single module or, in addition, can be divided into multiple sub-modules.

[0116] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.

[0117] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention and form different embodiments.

[0118] Furthermore, some of the embodiments described herein are methods or combinations of method elements that can be implemented by a processor of a computer system or by other means of performing the functions. Therefore, a processor having the necessary instructions for implementing the methods or method elements forms means for implementing the methods or method elements. Furthermore, the elements described herein in the apparatus embodiments are examples of means for implementing the functions performed by elements for the purposes of carrying out the invention.

[0119] As used herein, unless otherwise specified, the use of ordinal numbers such as “first,” “second,” “third,” etc., to describe ordinary objects merely indicates different instances of similar objects and is not intended to imply that the objects being described must have a given order in time, space, ordering, or any other manner.

[0120] Although the invention has been described with reference to a limited number of embodiments, those skilled in the art will understand from the foregoing description that other embodiments are conceivable within the scope of the invention described herein. Furthermore, it should be noted that the language used in this specification has been chosen primarily for readability and instructional purposes, and not for the purpose of interpreting or limiting the subject matter of the invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the invention is illustrative and not restrictive, and the scope of the invention is defined by the appended claims.

Claims

1. A method for detecting the straightness of a lead screw, comprising: Multiple first original images of the lead screw to be processed are obtained, each first original image corresponding to a part of the lead screw to be processed, and adjacent first original images have overlapping areas; Based on the overlapping area, the multiple first original images are stitched together to form a first stitched image; Obtaining the coordinates of the first center point of each thread in the first stitched image includes: performing binarization and morphological preprocessing on the first stitched image to obtain a processed binary image; segmenting the image of each thread in the binary image; extracting the contour of each thread based on the image of each thread; and determining the coordinates of the first center point of each thread based on the contour of each thread. Based on the obtained coordinates of multiple first center points, the first axis of the lead screw to be processed is fitted, wherein the sum of the distances from the multiple first center point coordinates to the first axis is minimized; The straightness of the lead screw to be processed is determined based at least on the first axis. The step of segmenting each thread in the binary image includes: determining the pitch of the lead screw in the binary image, and taking the starting position of the first thread in the binary image as the starting point, dividing an image segment at every pitch as a thread image; Determining the pitch of the lead screw in the binary image includes: determining a straight line based on the highest point of the first tooth and the highest point of the last tooth in the binary image of the lead screw to be processed; shifting the straight line downwards so that the straight line always remains between the highest and lowest points of the teeth, passing through each tooth, and obtaining multiple intersection points between the straight line and the binary image; determining the distance between the intersection points at the same position on two adjacent teeth as a pitch, and obtaining multiple measured pitches; and determining the average of the multiple measured pitches as the final pitch.

2. The method as described in claim 1, wherein, The step of stitching the multiple first original images into a first stitched image based on the overlapping region includes: For each pair of adjacent first original images, feature points in the overlapping region are detected; Match the detected feature points; Based on the matched feature points, the multiple first original images are stitched together to form the first stitched image.

3. The method as described in claim 1, wherein, Determining the straightness of the lead screw to be processed, at least based on the first axis, includes: Obtain the distance from the coordinates of each first center point to the first axis, and take the maximum distance as the straightness of the lead screw to be processed.

4. The method of claim 1, wherein, Before determining the straightness of the lead screw to be processed based at least on the first axis, the method further includes: Obtain multiple second original images after the lead screw to be processed has been rotated by a preset angle; The multiple second original images are stitched together to obtain a second stitched image; Obtain the coordinates of the second center point of each thread in the second stitched image; Based on the obtained coordinates of multiple second center points, the second axis of the lead screw to be processed after rotating by a preset angle is fitted.

5. The method of claim 4, wherein, Determining the straightness of the lead screw to be processed, at least based on the first axis, includes: The straightness of the lead screw to be processed is determined based on the first axis and the second axis.

6. The method of claim 5, wherein, Determining the straightness of the lead screw to be processed based on the first axis and the second axis includes: Based on the first axis and the second axis, reconstruct the spatial axis in the preset spatial coordinate system; The coordinates of the first center point and the second center point are transformed into spatial coordinates to obtain the transformed coordinates of the first center point and the transformed coordinates of the second center point. The distances from the transformed first center point coordinates and the transformed second center point coordinates to the aforementioned spatial axis are determined, resulting in multiple distances; The diameter of the smallest circle enclosing the plurality of distances is determined as the straightness of the lead screw.

7. The method according to any one of claims 4-6, wherein, The preset angle is 90 degrees.

8. The method of claim 2, wherein, After the detected feature points are matched, and before stitching multiple first original images into a first stitched image based on the matched feature points, the method further includes: Obtain the preset standard pitch value; Feature points whose distance is greater than or less than a preset distance are deleted. The preset distance is a preset multiple of the standard pitch value.

9. A computing device, comprising: At least one processor; as well as A memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, the program instructions including instructions for performing the method as described in any one of claims 1-8.

10. A readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform the method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Welding seam image identification method, computer device and computer readable storage medium

    CN108280829A

  • Cavity straightness detection method based on point cloud modeling

    CN112950765A

  • Method for integrally splicing images in flood overflow tower monitoring video

    CN114596206A

  • Method and equipment for measuring straightness of scraper conveyor on fully mechanized coal mining face

    CN115077429A