A rotating hook mounting positioning system and a rotating hook mounting positioning method
By combining vision equipment and positioning control modules, automatic positioning and precise measurement of the rotary hook and needle of industrial flatbed sewing machines are achieved, solving the consistency and accuracy problems in rotary hook installation and improving the assembly efficiency and quality of sewing machines.
Patent Information
- Application Number
- CN202211630855.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-19
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2042-12-19
AI Technical Summary
Existing industrial flatbed sewing machines have difficulties in adjusting the position of the rotary hook and needle during installation, resulting in poor sewing machine consistency and problems such as skipped stitches, broken threads, and needle collisions. Moreover, relying on manual experience makes it difficult to guarantee high-precision installation.
Using vision equipment and positioning control modules, images are acquired through front and side cameras. Combined with light source equipment and fixing devices, automatic positioning and precise measurement of the needle and rotary hook are achieved. Image analysis and adjustment are performed using feature matching algorithms.
It improves the precision and consistency of rotary hook installation, reduces the difficulty of manual operation, avoids damage to the sewing machine casing, and enhances the convenience and accuracy of the assembly process.
Smart Images

Figure CN115976749B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of sewing machine technology, and relates to a rotary hook installation and positioning system and a rotary hook installation and positioning method. Background Technology
[0002] Industrial flatbed sewing machines are among the most frequently used and most important types of sewing equipment in the industry, widely applied in garment design and manufacturing. Because industrial flatbed sewing machines require the joining of the top and bottom threads, their mechanisms and parts are numerous, and the coordinated movement of these key components further complicates their structure. This complexity and numerous parts necessitate more installation parts and higher installation precision during production. The precise positioning of the rotary hook and needle during installation is crucial; adjusting their position and spacing is a critical step that affects the quality of the flatbed sewing. Improperly adjusted flatbed sewing machines may experience skipped stitches, thread breaks, needle collisions, abnormal wear of the rotary hook tip, or even needle breakage. In actual production, the rotary hook installation position is determined by experienced technicians based on their judgment of the needle-rotary hook spacing. This results in inconsistent quality among sewing machines produced at different times within the same batch, severely impacting overall quality. Summary of the Invention
[0003] In order to overcome the shortcomings of the prior art, the present invention provides a rotary hook installation and positioning system and a rotary hook installation and positioning method.
[0004] To achieve the above objectives, the present invention adopts the following technical solution: a rotary hook installation and positioning system, comprising...
[0005] Vision equipment, including a front camera and a side camera, which acquire images of the needle and the rotary hook;
[0006] Light source equipment provides illumination for image acquisition by vision devices;
[0007] A fixing device for securing the vision device to the sewing machine;
[0008] The positioning control module includes a configuration module, an enumeration module, a front camera module, a side camera module, a display module, and a control module. The configuration module is used to configure the parameters of the rotary hook installation positioning system. The enumeration module reads the parameters from the configuration module and enumerates the front and side cameras. The front camera module is connected to the front camera and has a built-in front camera detection thread. The side camera module is connected to the side camera and has a built-in side camera detection thread to identify the needle. The display module serves as the image display interface and the operation interface of the control module. The control module is connected to the configuration module, enumeration module, front camera module, side camera module, display module, vision device 3, and light source device. The control module is used for user instruction operations or input of setting information operations. The configuration module, enumeration module, front camera module, side camera module, display module, vision device 3, and light source device execute corresponding programs according to the operation instructions of the control module.
[0009] Furthermore, the sewing machine includes a fixed platform, and a fixing device fixes the vision device to the fixed platform. The fixing device includes a limiting mechanism, an adsorption fixing mechanism, a vision fixing mechanism, and a light source fixing mechanism. The limiting mechanism is fixed to the fixed platform through the adsorption fixing mechanism, and the vision fixing mechanism and the light source fixing mechanism are fixed to the limiting mechanism.
[0010] Furthermore, the limiting mechanism is provided with a limiting groove, which is a concave structure. The edge of the fixed platform is set in the limiting groove. The installation of the limiting mechanism and the fixed platform is positioned by assembling the limiting groove with the fixed platform.
[0011] Furthermore, a rotary hook installation and positioning method includes the following steps:
[0012] Step 1: Preprocessing of the rotary hook installation and positioning system, reading the configuration file of the rotary hook installation and positioning system; the preprocessing includes confirming the operating status of the fixing device, vision device, light source, and positioning control module. The configuration file includes at least the PID of the front camera and the side camera, the magnification of the front camera and the side camera, USB port information, effective image ROI, initial position of the indicator line, needle template parameters, rotary hook template parameters, working status template parameters, and pinhole image template parameters.
[0013] Step 2: The enumeration module enumerates the front camera and the side camera based on the read PID and USB port information of the front camera and the side camera.
[0014] Step 3: Create a front camera detection thread to manage the acquisition data of front camera images, analyze and judge the data, output results and execute corresponding actions;
[0015] Step 4: Create a side camera detection thread to manage the acquisition data of side camera images, analyze and judge the data, output results, and perform corresponding actions.
[0016] 11. A rotary hook installation and positioning method according to claim 4, characterized in that: the initial position of the indicator line is the position of the rotary hook indicator line and the position of the needle indicator line.
[0017] Furthermore, by analyzing the content, features, and structure of the images captured by the front camera and the side camera when the rotary hook installation and positioning system is working, corresponding feature matching needle templates and rotary hook templates are created. By analyzing the content, features, and structure of the images captured by the side camera when the rotary hook installation and positioning system is working, corresponding feature matching working status templates and pinhole image templates are created.
[0018] Furthermore, the rotary hook mounting and positioning system includes a vision device, a light source device, a fixing device, and a positioning control module. The vision device includes a front camera and a side camera. The fixing device fixes the vision device to the sewing machine. The positioning control module includes a configuration module, an enumeration module, a front camera module, a side camera module, a display module, and a control module. The front camera module is connected to the front camera and has a built-in front camera detection thread that identifies the needle and the rotary hook and measures the distance between them. The side camera module is connected to the side camera and has a built-in side camera detection thread that identifies the needle and determines its position.
[0019] Furthermore, the frontal camera detection thread in step 3 includes the following steps:
[0020] Step 3.0: Configure the resolution parameters of the front camera;
[0021] Step 3.1: The front camera acquires images in high-resolution mode, and crops, displays, and saves the images according to the set ROI area;
[0022] Step 3.2: Perform a rotary hook match on the image cropped in Step 3.1 based on the rotary hook template. If a rotary hook is matched, proceed to Step 3.3. If no rotary hook is matched, exit the current frontal camera detection thread and proceed to Step 3.1.
[0023] Step 3.3: Perform needle matching on the image of the rotary hook matched in Step 3.2 according to the needle template. If a needle is matched, proceed to Step 3.4. If no needle is matched, exit the current front camera detection thread and proceed to Step 3.1.
[0024] Step 3.4: Position the rotary hook and needle, calculate the distance between the rotary hook and needle positions, and transmit the rotary hook position, needle position, and distance value to the display module interface for display. Reset and adjust the position of the indicator line.
[0025] Step 3.5: Determine whether to terminate the front camera detection thread. If the front camera module receives the termination command from the control module, then shut down the front camera and terminate the front camera detection thread; if the front camera module does not receive the termination command, execute step 3.1 and continue the detection process.
[0026] Furthermore, in step 3.2, when the rotary template performs rotary matching on the image cropped in step 3.1, the rotary template performs template matching with the image cropped in step 3.1, i.e., the image to be detected. Each position of the rotary template is compared with the corresponding sub-region of the image cropped in step 3.1, i.e., the image to be detected, to obtain a grayscale image. Each pixel value in the grayscale image represents the degree of matching between the sub-region and the rotary template. The matching result is set as R0(x,y).
[0027]
[0028] In the above formula, T0() is the pixel value at the corresponding coordinate position of the rotary template, I0() is the pixel value at the corresponding coordinate position of the image to be detected, and R0(x,y) is the matching result. The smaller the value of R0(x,y), the higher the matching degree.
[0029] Set the shuttle matching threshold to R′0. Compare R0(x,y) with R′0. If R0(x,y) is not greater than R′0, it is determined that the image to be detected matches the shuttle, and step 3.3 is executed. If R0(x,y) is greater than R′0, it is determined that the image to be detected does not have a shuttle, and the current front camera detection thread is exited, and step 3.1 is executed.
[0030] Furthermore, in step 3.3, when performing needle matching on the image of the rotary hook matched in step 3.2 based on the needle template, the needle template and the image of the rotary hook matched in step 3.2 are matched using a template. Each position of the needle template is compared with the corresponding sub-region of the image of the rotary hook matched in step 3.2, resulting in a grayscale image. Each pixel value in the grayscale image represents the degree of matching between the sub-region and the needle template. The matching result is set as R1(x,y).
[0031]
[0032] In the above formula, T1() is the pixel value at the corresponding coordinate position of the needle template, I1() is the pixel value at the corresponding coordinate position of the image to be detected, and R1(x,y) is the matching result. The smaller the value of R1(x,y), the higher the matching degree.
[0033] The needle matching threshold is set to R′1. R1(x,y) is compared with R′1. If R1(x,y) is not greater than R′1, it is determined that the image to be detected has matched a needle, and step 3.4 is executed. If R1(x,y) is greater than R′1, it is determined that the image to be detected has no needle, and the current front camera detection thread is exited, and step 3.1 is executed.
[0034] In summary, the advantages of this invention are:
[0035] The rotary hook installation and positioning system of the present invention uses a convenient and readily available fixing device to assist in the installation of the vision device during the assembly of a sewing machine. At the same time, the vision device and the positioning control module are combined with image processing to enable visual magnification and measurement of the position of the rotary hook needle tip during the assembly of the sewing machine rotary hook, reducing the difficulty of manual assembly and improving the assembly accuracy.
[0036] This invention widens the limiting groove of the fixing device to be compatible with sewing machine fixing platforms with different sandblasting thicknesses; increases the imaging depth of the front camera, so that a clear image can still be obtained even if the position of the rotary hook and the needle is slightly offset; and increases the imaging field of view of the front camera to ensure that the position of the rotary hook and the needle is still within the field of view of the front camera after offset. Subsequently, the position is set and saved to the ROI attribute of the configuration file, and the corresponding area of the image is cropped according to the position to achieve a magnified effect. Attached Figure Description
[0037] Figure 1 This is an assembly diagram of the sewing machine, fixing device, and vision device of the present invention.
[0038] Figure 2 Schematic diagram of the fixing device and vision equipment of the present invention Figure 1 .
[0039] Figure 3 Schematic diagram of the fixing device and vision equipment of the present invention Figure 2 .
[0040] Figure 4 This is a schematic diagram of the functional modules of the rotary hook installation and positioning system of the present invention.
[0041] Figure 5 This is a schematic diagram of the rotary hook installation and positioning method of the present invention.
[0042] Figure 6 This is a schematic diagram of the needle and shuttle distance measurement process of the present invention.
[0043] Figure 7 This is a schematic diagram illustrating the recursive relationship between the magnification correction coefficient and the system error compensation value of the present invention. Detailed Implementation
[0044] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, unless otherwise specified, the following embodiments and features described therein can be combined with each other.
[0045] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0046] In this embodiment of the invention, all directional indicators (such as up, down, left, right, front, back, lateral, longitudinal, etc.) are only used to explain the relative positional relationship and movement of each component in a specific posture. If the specific posture changes, the directional indicator will also change accordingly.
[0047] Due to installation errors and other reasons, the parallel relationship referred to in the embodiments of the present invention may actually be an approximate parallel relationship, and the perpendicular relationship may actually be an approximate perpendicular relationship.
[0048] Example 1:
[0049] like Figure 1-4 As shown, a rotary hook mounting and positioning system includes...
[0050] The vision device 3 includes a front camera 31 and a side camera 32, which acquire images of the needle and the rotary hook.
[0051] The light source device provides a light source for image acquisition by the vision device 3;
[0052] Fixing device 2 is used to fix the vision device 3 to the sewing machine;
[0053] The positioning control module includes a configuration module, an enumeration module, a front camera module, a side camera module, a display module, and a control module. The configuration module is used to configure the parameters of the rotary hook installation positioning system. The enumeration module reads parameters from the configuration module and enumerates the front camera 31 and the side camera 32. The front camera module is connected to the front camera 31 and has a built-in front camera detection thread that identifies the needle and the rotary hook and measures the distance between them. The side camera module is connected to the side camera 32 and has a built-in side camera detection thread that identifies the needle and determines its position. The display module serves as both the image display interface and the operation interface for the control module. The control module is connected to the configuration module, enumeration module, front camera module, side camera module, display module, vision device 3, and light source device. The control module allows the user to perform various instruction operations or input setting information. The configuration module, enumeration module, front camera module, side camera module, display module, vision device 3, and light source device execute corresponding programs according to the operation instructions of the control module.
[0054] The vision device 3 has communication and camera functions. In this embodiment, the vision device 3 is not limited to a camera, but can also be a mobile phone, tablet computer, or other devices. Various applications that use camera functions can run on the vision device 3, such as image capture applications and live video streaming applications. When the vision device 3 is running these applications and using the camera function, it connects to and communicates with the positioning control module through a network. In this embodiment, the front camera 31 and the side camera 32 are 800W camera modules.
[0055] The sewing machine 1 includes a fixed platform 11, and a fixing device 2 fixes the vision device 3 to the fixed platform 11.
[0056] The fixing device 2 includes a limiting mechanism 21, an adsorption fixing mechanism 24, a vision fixing mechanism 20, and a light source fixing mechanism 26. The limiting mechanism 21 is fixed to the fixing platform 11 through the adsorption fixing mechanism 24, and the vision fixing mechanism 20 and the light source fixing mechanism 26 are fixed to the limiting mechanism 21.
[0057] The limiting mechanism 21 is provided with a limiting groove 212, which is a concave structure with a height direction of [missing information]. Figure 1 In the direction of arrow A, the edge of the fixed platform 11 is set in the limiting groove 212. The assembly of the limiting groove 212 with the fixed platform 11 positions the limiting mechanism 21 for installation, thereby improving the installation efficiency and accuracy of the limiting mechanism 21.
[0058] The upper and side surfaces of the limiting groove 21 are in contact with the corresponding end surfaces of the fixed platform 11, ensuring the stability of the limiting mechanism 21 during installation.
[0059] To ensure that the fixing device 2 is compatible with fixing platforms 11 of different sandblasting thicknesses or fixing platforms 11 that exceed the processing form and position tolerances, the height of the limiting groove 21 is greater than the height of the fixing platform 11.
[0060] The adsorption fixing mechanism 24 is used for the fixed connection between the limiting mechanism 21 and the fixed platform 11. The fixed platform 11 is a metal platform. The limiting mechanism 21 is fixed with a number of mounting slots 211. The adsorption fixing mechanism 24 is set as a magnetic block. The magnetic block is set in the mounting slot 211 to fix the limiting mechanism 21 on the fixed platform 11.
[0061] The visual fixing mechanism 20 is used to fix the visual device 3. In this embodiment, the visual fixing mechanism 20 includes a front fixing frame 23 and a side fixing frame 22. The front fixing frame 23 and the side fixing frame 22 are respectively fixed above the limiting mechanism 21. The front camera 31 is fixed to the front fixing frame 23, and the side camera 32 is fixed to the side fixing frame 22.
[0062] The light source fixing mechanism 26 is fixed below the limiting mechanism 21. The light source fixing mechanism 26 has an inner groove 261, and the light source equipment is installed in the inner groove 261.
[0063] The image area captured by the front camera 31 highlights the needle and the rotary hook by reflecting light from the metal parts of the rotary hook. The front camera 31 captures the image and sends the image to the positioning control module. The front camera detection thread identifies the needle and the rotary hook and measures the distance between the needle and the rotary hook.
[0064] The light source is located on the bottom of the sewing machine. The light source can directly illuminate the image area captured by the side camera. The side camera detects the thread, identifies the needle, and determines the position of the needle.
[0065] The rotary hook installation and positioning system of this application uses a convenient and readily available fixing device 2 that will not cause bumps or scratches to the sewing machine casing during the sewing machine assembly process to assist in the installation of the vision device 3. At the same time, through the image processing of the vision device 3 and the positioning control module, the position of the rotary hook needle tip can be visually magnified and measured during the assembly of the sewing machine rotary hook, reducing the difficulty of manual assembly and improving the assembly accuracy.
[0066] like Figure 4-7 As shown, a rotary hook installation and positioning method includes the following steps:
[0067] Step 1: Preprocessing of the rotary hook installation and positioning system, reading the configuration file of the rotary hook installation and positioning system; the preprocessing includes confirming the operating status of the fixing device 2, vision device 3, light source, and positioning control module. The configuration file includes at least the PID of the front camera 31 and the side camera 32, the magnification of the front camera 31 and the side camera 32, USB port information, effective image ROI, initial position of the indicator line, needle template parameters, rotary hook template parameters, working status template parameters, and pinhole image template parameters.
[0068] The magnification of the front camera 31 and the side camera 32 is set to the magnification when the focal length is adjusted to the point where the needle-hook distance image is clear when the lens positions of the front camera 31 and the side camera 32 are fixed; based on the input needle diameter, the software counts the number of pixels contained in the needle in the image, calculates the magnification, and writes it to the configuration file.
[0069] The initial position of the indicator lines is the position of the rotary hook indicator line and the needle indicator line.
[0070] By analyzing the content, features, and structure of the images captured by the front camera 31 and the side camera 32 when the rotary hook installation and positioning system is working, corresponding feature matching needle templates and rotary hook templates are created.
[0071] By analyzing the content, features, and structure of the images captured by the side camera 32 when the rotary hook installation and positioning system is in operation, corresponding feature matching working state templates and pinhole image templates are created.
[0072] Step 2: The enumeration module enumerates the front camera 31 and the side camera 32 based on the read information of the front camera 31, the side camera 32, and the USB port.
[0073] Step 3: Create a front camera detection thread to manage the acquisition data of front camera images, analyze and judge the data, output results and execute corresponding actions;
[0074] In the front camera inspection thread, the front camera can magnify and display the needle and rotary hook, assisting the assembly personnel in installation, and can measure the distance between the needle and rotary hook to determine whether the installation is qualified.
[0075] To avoid the impact of the rotary hook installation positioning system on image quality when installed on different flat sewing machines, this application widens the limiting groove 212 of the fixing device 2 to be compatible with the fixing platform 11 of the sewing machine 1 with different sandblasting thicknesses; increases the imaging depth of the front camera, so that a clear image can still be obtained even if the rotary hook and needle positions are slightly offset; increases the imaging field of view of the front camera to ensure that the rotary hook and needle positions are still within the field of view of the front camera after offset. Subsequently, the position setting is saved to the ROI attribute of the configuration file, and the corresponding area image is cropped according to the position to achieve a magnified effect.
[0076] Step 4: Create a side camera detection thread to manage the acquisition data of side camera images, analyze and judge the data, output results, and perform corresponding actions.
[0077] Step 3, the frontal camera detection thread, includes the following steps:
[0078] Step 3.0: Configure the resolution parameters of the front camera;
[0079] Step 3.1: The front camera acquires images in high-resolution mode, and crops, displays, and saves the images according to the set ROI area;
[0080] Step 3.2: Perform a rotary hook match on the image cropped in Step 3.1 based on the rotary hook template. If a rotary hook is matched, proceed to Step 3.3. If no rotary hook is matched, exit the current frontal camera detection thread and proceed to Step 3.1.
[0081] When the rotary template performs rotary matching on the image cropped in step 3.1, the rotary template performs template matching with the image cropped in step 3.1, i.e., the image to be detected. Each position of the rotary template is compared with the corresponding sub-region of the image cropped in step 3.1, i.e., the image to be detected, to obtain a grayscale image. Each pixel value in the grayscale image represents the degree of matching between the sub-region and the rotary template. In this embodiment, the matching result is set as R0(x,y), and the formula for R0(x,y) is as follows:
[0082]
[0083] In the above formula, T0() is the pixel value at the corresponding coordinate position of the rotary template, I0() is the pixel value at the corresponding coordinate position of the image to be detected, and R0(x,y) is the matching result. The smaller the value of R0(x,y), the higher the matching degree.
[0084] Set the shuttle matching threshold to R′0. Compare R0(x,y) with R′0. If R0(x,y) is not greater than R′0, it is determined that the image to be detected matches the shuttle, and step 3.3 is executed. If R0(x,y) is greater than R′0, it is determined that the image to be detected does not have a shuttle, and the current front camera detection thread is exited, and step 3.1 is executed.
[0085] Step 3.3: Perform needle matching on the image of the rotary hook matched in Step 3.2 according to the needle template. If a needle is matched, proceed to Step 3.4. If no needle is matched, exit the current front camera detection thread and proceed to Step 3.1.
[0086] When performing needle matching on the image of the rotary hook matched in step 3.2 based on the needle template, the needle template and the image of the rotary hook matched in step 3.2 are matched using a template. Each position of the needle template is compared with the corresponding sub-region of the image of the rotary hook matched in step 3.2, resulting in a grayscale image. Each pixel value in the grayscale image represents the degree of matching between the sub-region and the needle template. In this embodiment, the matching result is set as R1(x,y), and the formula for R1(x,y) is as follows:
[0087]
[0088] In the above formula, T1() is the pixel value at the corresponding coordinate position of the needle template, I1() is the pixel value at the corresponding coordinate position of the image to be detected, and R1(x,y) is the matching result. The smaller the value of R1(x,y), the higher the matching degree.
[0089] The needle matching threshold is set to R′1. R1(x,y) is compared with R′1. If R1(x,y) is not greater than R′1, it is determined that the image to be detected has matched a needle, and step 3.4 is executed. If R1(x,y) is greater than R′1, it is determined that the image to be detected has no needle, the current front camera detection thread is exited, and step 3.1 is executed.
[0090] Step 3.4: Position the rotary hook and needle, calculate the distance between the rotary hook and needle positions, and transmit the rotary hook position, needle position, and distance value to the display module interface for display. Reset and adjust the position of the indicator line.
[0091] The inner hook of the rotary hook has a small flat surface, and the image is displayed as a straight line along the edge of the rotary hook. This straight line is set as the rotary hook indicator line, and the position of the rotary hook indicator line is known after the rotary hook is positioned. The hook position of the needle has a recessed flat surface, and the image is displayed as a straight line. This straight line is set as the needle indicator line, and the position of the needle indicator line is known after the needle is positioned. The spacing value is the distance between the shuttle indicator line and the needle indicator line. The positions of the rotary hook indicator line, the needle indicator line, and the spacing value are displayed. The positions of the rotary hook indicator line and the needle indicator line are used to update the initial position of the indicator line in the configuration file.
[0092] Step 3.5: Should the front camera detection thread be terminated? If the front camera module receives the termination command from the control module, the front camera will be turned off, and the front camera detection thread will be terminated. If the front camera module does not receive the termination command, proceed to step 3.1 and continue the detection process.
[0093] Step 3.4, the steps for confirming the position of the rotary hook indicator line, include:
[0094] Step 3.4.1: Rotary shuttle image preprocessing;
[0095] The image of the matched shuttle is cropped, the shuttle image is converted to grayscale, and the grayscale image is binarized.
[0096] Step 3.4.2: Coarsely position the rotary hook profile straight line;
[0097] Extract the image contour data from the binarized image in step 3.4.1. Each contour data forms a contour point set. Perform Hough transform on the extracted image contours to obtain the shuttle contour line data.
[0098] Set the standard slope and standard position of the standard rotary hook indicator line, and use the standard slope and standard position as filtering conditions to obtain the rotary hook profile line of the rotary hook edge from the rotary hook profile line data;
[0099] Step 3.4.3: Precisely position the rotary hook indicator line;
[0100] Set the threshold for the rotary shuttle dot line;
[0101] Calculate the distance between all points in the contour point set and the shuttle contour line in step 3.4.2, and compare it with the shuttle point line threshold. Extract the target shuttle line points whose distance from the point to the shuttle contour line is not greater than the shuttle point line threshold, perform data filtering, and form a target shuttle line point set from several target line points. Fit the line using the least squares method based on the target shuttle line point set to obtain the shuttle indicator line.
[0102] Step 3.4, the steps for confirming the position of the needle indicator line, include:
[0103] Step 3.4.4: Preprocessing of needle image;
[0104] The image of the matched needle is cropped, the needle image is converted to grayscale, and the grayscale image is binarized.
[0105] Step 3.4.5: Roughly position the needle outline straight line;
[0106] Extract the image contour data from the binarized image in step 3.4.4. The contour data form a contour point set. Perform Hough transform on the extracted image contours to obtain the needle contour line data.
[0107] Set the standard slope and standard position of the standard needle indicator line, and use the standard slope and standard position as filtering conditions to obtain the needle outline line of the needle edge from the needle outline line data;
[0108] Step 3.4.6: Precisely position the needle indicator line;
[0109] Set the needle dot / line threshold;
[0110] Calculate the distance between all points in the contour point set and the needle contour line in step 3.4.5, and compare it with the needle point line threshold. Extract the target needle line points whose distance from the point to the needle contour line is not greater than the needle point line threshold, perform data filtering, and form a target needle line point set from several target needle line points. Fit a straight line using the least squares method based on the target needle line point set to obtain the needle indicator line.
[0111] Step 4, the side camera detection thread, includes the following steps:
[0112] Step 4.1: The side camera acquires images;
[0113] Step 4.2: Perform image matching of the images acquired in Step 4.1 according to the working status template. If several consecutive images fail to match, the side camera enters standby mode, clears the needle height data list, exits the current side camera detection thread, and executes Step 4.1. If the image matching is successful, the side camera enters working mode and executes Step 4.3.
[0114] Step 4.3: Perform needle matching and positioning on the acquired images and obtain a list of needle height data;
[0115] Compared to the method of matching needle tip images when the needle tip is not in the field of view at its lowest position, the method of matching the acquired images using a pinhole image template in this application is more comprehensive in its detection.
[0116] During needle matching and positioning, the acquired image is matched according to the needle hole image template to determine the needle position, the needle image is captured, and the captured needle image is preprocessed, including grayscale and binarization. The preprocessed image is then subjected to blob analysis.
[0117] Each image captured by the side camera is used for needle matching and positioning. After preprocessing, the image is analyzed by blob, and the needle hole coordinates A are obtained using the conventional formula for calculating the centroid based on the central moment. n (x, y), where the positions of the needle hole and needle tip are fixed values, the needle tip position is determined once the needle hole coordinates are determined. The needle hole coordinates are then written into the needle height data list A′.
[0118] A'={A1(x,y),A2(x,y),A3(x,y)...A n (x,y)};
[0119] In the formula, n represents the number of times the side camera captures images;
[0120] Step 4.4: Obtain the lowest position of the needle;
[0121] The lowest position of the needle is set to A. min Amin =(A') min ,
[0122] In this embodiment, to complete the positioning of the lowest point of the needle, the assembler needs to rotate the needle and move it through the lowest point of the needle. Each time the position of the needle is adjusted, the side camera captures an image.
[0123] Step 4.5: Obtain and display the needle's return position;
[0124] The return position of the needle is set to A0, A0 = A min +h0,
[0125] In the formula, h0 is the set needle movement height, preferably h0 = 2mm;
[0126] The return position serves as an auxiliary installation indicator line for needle limit. The return position of the needle is displayed on the interface of the display module to prompt the return of the needle. When the needle is rotated and rises to the return position displayed on the interface, the side camera detection thread assists in completing the work of the needle returning from the lowest point to the set height, optimizing the assembly steps and eliminating the need to install and remove the limit plate.
[0127] Step 4.6: Should the side camera detection thread be terminated? If the side camera module receives the termination command from the control module, the side camera will be turned off, and the side camera detection thread will be terminated. If the side camera module does not receive the termination command, proceed to step 4.1 and continue the detection process.
[0128] In step 4, the image coordinate system has been calibrated. The image coordinate system calibration steps include:
[0129] Step 4.0.1: Pre-treatment for flatbed sewing machine calibration;
[0130] The pretreatment for flatbed sewing machine calibration includes both without a rotary hook and with a side camera installed;
[0131] Step 4.0.2: Move the tip of the needle to the bottom of the image captured by the side camera;
[0132] Step 4.0.3: Calculate and record the needle height position based on the image acquired in Step 4.0.2. Set the actual needle height position to 0 when the needle tip is at the bottom of the image.
[0133] Step 4.0.4: Install a 1mm shim above the needle for limiting movement, raise the needle by 1mm, and acquire an image;
[0134] Step 4.0.5: Calculate and record the needle height position based on the image acquired in Step 4.0.4;
[0135] Step 4.0.6: Repeat steps 4.0.4 and 4.0.5 until the needle tip rises to the top of the image captured by the side camera. Each execution captures an image, and the needle height position is calculated and recorded based on the image.
[0136] Step 4.0.8: Calculate the compensation matrix;
[0137] Based on the above steps, a set H0 of needle height data H is formed, H0 = {0, H1, H2... HN}; N is the number of 1mm pads. When N = 0, the needle tip is located at the bottom of the image captured by the side camera, and H0 = {0}. When N = 1, H1 = 1, H0 = {0, 1}. The unit of needle height is mm.
[0138] Set the needle height pixel coordinate data to P.
[0139] P = {(x0,y0),(x1,y1),(x2,y2),...(xN,yN)}, in pixels; when N = 0, the needle tip is at the bottom of the image captured by the side camera, and P = (x0,y0); when N = 1, P = (x1,y1), and the coordinate data of the needle height image along the y-axis is P'.
[0140] P' = {y0, y1, y2, y3...y} N When N=1, P'=y1.
[0141] H = R × P′ + SE,
[0142] In the formula, H represents the needle height data, R represents the image y-axis magnification correction coefficient, and SE represents the system error compensation value.
[0143] According to the above formula, we can obtain:
[0144]
[0145] Based on equation (1), the residual equation (2) can be obtained:
[0146]
[0147] Where f N (x N )=H N =R N ×P′ N +SE N , P′ N R is a variable. N and SE N For the parameters to be estimated,
[0148] In measurements of equal precision, the least squares condition must be satisfied:
[0149]
[0150] By differentiating the above equation and setting it to zero, the second-order partial derivative is always positive, i.e., the extreme value is the minimum value, thus obtaining equation (4):
[0151]
[0152] Based on equations (1) and (4), the error equation, equation (5), is obtained:
[0153]
[0154] Comparing equations (1) and (5), aN1 refers to RN, aN2 refers to the constant 1, b1 refers to P'N, and b2 refers to SE. N lN refers to HN.
[0155] Based on equation (5), we can transform it into a normal equation and obtain equation (6):
[0156]
[0157] In equation (6), H and P' are known values, and [R, SE] is the set of parameters to be estimated. Based on the set H0 of needle height data H, H0 = {0, H1, H2... HN}, the needle height in the y-axis direction of the image is divided into several segments. Equation (6) is executed for each segment, resulting in equations (7) and (8):
[0158] R = [R1, R2, ..., R] N ] T ...(7);
[0159] SE = [SE1, SE2, ... SE N ] T ...(8);
[0160] The amplification correction coefficient and the system error compensation value are obtained from (7) and (8);
[0161] like Figure 7 As shown, a new segment is inserted into the [R,SE] region of two adjacent domains according to the averaging principle. Equation (9) is obtained.
[0162]
[0163] Recursively insert again until the area width meets the set value.
[0164] In step 4, image matching uses both rotary hook matching and needle matching methods, which will not be elaborated here.
[0165] In the sewing machine assembly process, this application uses a vision device 3 combined with image processing to enable visual magnification and measurement of the needle tip position of the rotary hook during assembly, thereby reducing the difficulty of manual assembly and improving assembly accuracy.
[0166] Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort should fall within the scope of protection of the present invention.
Claims
1. A rotary shuttle installation and positioning method, the method being implemented based on a rotary shuttle installation and positioning system, characterized in that: The rotary hook installation and positioning system includes Vision equipment, including a front camera and a side camera, which acquire images of the needle and the rotary hook; Light source equipment provides illumination for image acquisition by vision devices; A fixing device for securing the vision device to the sewing machine; The positioning control module includes a configuration module, an enumeration module, a front camera module, a side camera module, a display module, and a control module. The configuration module is used to configure the parameters of the rotary hook installation positioning system. The enumeration module reads the parameters from the configuration module and enumerates the front and side cameras. The front camera module is connected to the front camera and has a built-in front camera detection thread. The side camera module is connected to the side camera and has a built-in side camera detection thread to identify the needle. The display module serves as the image display interface and the operation interface of the control module. The control module is connected to the configuration module, enumeration module, front camera module, side camera module, display module, vision device, and light source device. The control module is used for user instructions or input of setting information. The configuration module, enumeration module, front camera module, side camera module, display module, vision device, and light source device execute corresponding programs according to the operation instructions of the control module. The rotary hook installation and positioning method includes the following steps: Step 1: Preprocessing of the rotary hook installation and positioning system, reading the configuration file of the rotary hook installation and positioning system; the preprocessing includes confirming the operating status of the fixing device, vision device, light source, and positioning control module. The configuration file includes at least the PID of the front camera and the side camera, the magnification of the front camera and the side camera, USB port information, effective image ROI, initial position of the indicator line, needle template parameters, rotary hook template parameters, working status template parameters, and pinhole image template parameters. Step 2: The enumeration module enumerates the front camera and the side camera based on the read PID and USB port information of the front camera and the side camera. Step 3: Create a front camera detection thread to manage the acquisition data of front camera images, analyze and judge the data, output results and execute corresponding actions; Step 4: Create a side camera detection thread to manage the acquisition data of side camera images, analyze and judge the data, output results and execute corresponding actions; Step 4, the side camera detection thread, includes the following steps: Step 4.1: The side camera acquires images; Step 4.2: Perform image matching of the images acquired in Step 4.1 according to the working status template. If several consecutive images fail to match, the side camera enters standby mode, clears the needle height data list, exits the current side camera detection thread, and executes Step 4.
1. If the image matching is successful, the side camera enters working mode and executes Step 4.
3. Step 4.3: Perform needle matching and positioning on the acquired images and obtain a list of needle height data; During needle matching and positioning, the acquired image is matched according to the needle hole image template to determine the needle position, the needle image is captured, and the captured needle image is preprocessed, including grayscale and binarization. The preprocessed image is then subjected to blob analysis. Each image captured by the side camera is used for needle matching and positioning. After preprocessing, the images are analyzed by blob analysis, and the coordinates of the needle hole are obtained using a conventional formula for calculating the centroid based on the central moment. The positions of the needle hole and needle tip are fixed values. Once the needle hole coordinates are determined, the needle tip position is also fixed. The needle hole coordinates are used as the needle height and written into the needle height data list. , ; In the formula The number of times images are captured by the side camera; Step 4.4: Obtain the lowest position of the needle; The lowest position of the needle is set to , , To complete the positioning of the lowest point of the needle, the assembly personnel need to rotate the needle and move it through the lowest point of the needle. Each time the needle position is adjusted, the side camera captures an image. Step 4.5: Obtain and display the needle's return position; The needle return position is set to , , The set needle movement height; The return position serves as an auxiliary installation indicator line for needle limit. The return position of the needle is displayed on the interface of the display module to prompt the return of the needle. When the needle is rotated and rises to the return position displayed on the interface, the side camera detection thread assists in completing the work of the needle returning from the lowest point to the set height. Step 4.6: Should the side camera detection thread be terminated? If the side camera module receives the termination command from the control module, the side camera will be turned off, and the side camera detection thread will be terminated. If the side camera module does not receive the termination command, proceed to step 4.1 and continue the detection process.
2. The rotary hook installation and positioning method according to claim 1, characterized in that: The initial position of the indicator line is the position of the rotary hook indicator line and the position of the needle indicator line.
3. The rotary hook installation and positioning method according to claim 1, characterized in that: By analyzing the content, features, and structure of the images captured by the front and side cameras when the rotary hook installation and positioning system is in operation, corresponding feature matching needle templates and rotary hook templates are created. By analyzing the content, features, and structure of the images captured by the side camera when the rotary hook installation and positioning system is in operation, corresponding feature matching working status templates and pinhole image templates are created.
4. The rotary hook installation and positioning method according to claim 1, characterized in that: The frontal camera detection thread in step 3 includes the following steps: Step 3.0: Configure the resolution parameters of the front camera; Step 3.1: The front camera acquires images in high-resolution mode, and crops, displays, and saves the images according to the set ROI area; Step 3.2: Perform a rotary hook match on the image cropped in Step 3.1 based on the rotary hook template. If a rotary hook is matched, proceed to Step 3.
3. If no rotary hook is matched, exit the current frontal camera detection thread and proceed to Step 3.
1. Step 3.3: Perform needle matching on the image of the rotary hook matched in Step 3.2 according to the needle template. If a needle is matched, proceed to Step 3.
4. If no needle is matched, exit the current front camera detection thread and proceed to Step 3.
1. Step 3.4: Position the rotary hook and needle, calculate the distance between the rotary hook and needle positions, and transmit the rotary hook position, needle position, and distance value to the display module interface for display. Reset and adjust the position of the indicator line. Step 3.5: Determine whether to terminate the front camera detection thread. If the front camera module receives the termination command from the control module, then shut down the front camera and terminate the front camera detection thread; if the front camera module does not receive the termination command, execute step 3.1 and continue the detection process.
5. A rotary hook installation and positioning method according to claim 4, characterized in that: In step 3.2, when the rotary template performs rotary matching on the image cropped in step 3.1, the rotary template performs template matching with the image cropped in step 3.1, i.e., the image to be detected. Each position of the rotary template is compared with the corresponding sub-region of the image cropped in step 3.1, i.e., the image to be detected, resulting in a grayscale image. Each pixel value in the grayscale image represents the degree of matching between the sub-region and the rotary template. The matching result is set as... , ; In the above formula, This represents the pixel value at the corresponding coordinate position of the rotary template. The pixel value at the corresponding coordinate position in the image to be detected. For the matching results, The smaller the value, the higher the match. The shuttle matching threshold is set to ,Compare and ,like Not greater than If the image to be detected matches the rotary hook, then proceed to step 3.
3. Greater than If the image to be detected does not have a rotary shuttle, exit the current frontal camera detection thread and proceed to step 3.
1.
6. The rotary hook installation and positioning method according to claim 4, characterized in that: In step 3.3, when performing needle matching on the image of the rotary hook matched in step 3.2 based on the needle template, the needle template and the image of the rotary hook matched in step 3.2 are matched. Each position of the needle template is compared with the corresponding sub-region of the image of the rotary hook matched in step 3.2, resulting in a grayscale image. Each pixel value in the grayscale image represents the degree of matching between the sub-region and the needle template. The matching result is set as... , ; In the above formula, This represents the pixel value at the corresponding coordinate position of the needle template. The pixel value at the corresponding coordinate position in the image to be detected. For the matching results, The smaller the value, the higher the match. Needle matching threshold set to ,Compare and ,like Not greater than If the image to be detected matches the needle, proceed to step 3.
4. Greater than If the image to be detected is found to be without inorganic needles, exit the current frontal camera detection thread and proceed to step 3.
1.
7. The rotary hook installation and positioning method according to claim 1, characterized in that: The sewing machine includes a fixed platform. A fixing device is used to fix the vision device to the fixed platform. The fixing device includes a limiting mechanism, an adsorption fixing mechanism, a vision fixing mechanism, and a light source fixing mechanism. The limiting mechanism is fixed to the fixed platform through the adsorption fixing mechanism, and the vision fixing mechanism and the light source fixing mechanism are fixed to the limiting mechanism.
8. A rotary hook installation and positioning method according to claim 7, characterized in that: The limiting mechanism is provided with a limiting groove, which is a concave structure. The edge of the fixed platform is set in the limiting groove. The installation of the limiting mechanism and the fixed platform is positioned by assembling the limiting groove with the fixed platform.
Citation Information
Patent Citations
Device and method for correcting positions of needle and hook
CN109722804A
Full-automatic template sewing numerical control method and system
CN113215732A