Spring head and tail detection method and system
By using automated detection systems and image recognition technology, the problems of manual identification errors and low efficiency in spring start and end detection have been solved, achieving efficient and accurate spring start and end identification, and adapting to the detection of multiple types of springs.
Patent Information
- Application Number
- CN202511637209.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-10
- Publication Date
- 2026-02-10
AI Technical Summary
Existing spring start and end detection methods suffer from high error rates due to manual identification, high manpower requirements, low detection efficiency, and difficulty in adapting to various types of springs.
An automated detection system is adopted, which controls the spring load transmission component to transmit the spring through the electrical control box, and uses the image acquisition unit to adjust the position and focus in real time. Combined with image recognition technology, the beginning and end of the spring are determined to achieve automatic identification and positioning.
It effectively avoids errors caused by manual operation, improves testing efficiency and consistency, adapts to springs of different specifications, ensures the objectivity and accuracy of test results, and provides reliable data for subsequent processes.
Smart Images

Figure CN121498567A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of automobile parts processing, in particular to a spring head-tail detection method and system. BACKGROUND
[0002] At present, in the field of spring production and quality detection in automobile parts, the detection of key dimensions such as the head-tail identification and the tail end inner diameter of the spring is an important link to ensure product quality.
[0003] At present, the detection of the tail end inner diameter of the spring mainly adopts the GO / NO GO jig manual detection method, and the operation process is as follows: the operator picks up the spring, puts the tail end of the spring into the GO / NO GO jig to confirm whether it is qualified, and if it is qualified, pushes the spring horizontally into the conveying belt of the load testing machine. This manual detection method has many defects: first, the similar head and tail of the spring can easily lead to reverse installation of the head and tail, and further derive a series of quality problems such as color mark, label and code position error; second, one person needs to be equipped on each production line to conduct GO / NO GO inspection, which requires a lot of manpower and limits production efficiency; third, the manual detection method is difficult to efficiently adapt to the detection needs of multiple types of springs, and is prone to insufficient detection consistency due to human operation differences. Therefore, the existing manual detection method of the head-tail end inner diameter of the spring has obvious deficiencies in quality reliability, cost control and production efficiency.
[0004] Therefore, it is necessary to provide a new spring head-tail detection method and system. SUMMARY
[0005] Based on the above problems existing in the prior art, the purpose of the embodiments of the present application is to provide a spring head-tail detection method and system which can automatically identify the head and tail of the spring to be detected to avoid errors, reduce labor costs, and adapt to multiple specifications of the spring to be detected.
[0006] To achieve the above purpose, the technical solution adopted by the present application is: a spring head-tail detection method, comprising: The first control instruction generated according to the user input information is transmitted to the spring load transmission assembly through the electric control box of the detection device, so that the spring is transmitted to the detection area at a transmission rate corresponding to the first control instruction; The coarse radius and coarse length of the spring to be detected entering the detection area are obtained; The position information, unit shooting time and lens focal length of the first image acquisition unit and the second image acquisition unit are adjusted according to the coarse radius and the coarse length, and the target first image and the target second image of the spring to be detected entering the core area of the detection area are acquired by the first image acquisition unit and the second image acquisition unit after adjustment; The inner diameter and the axis of the target first image or the target second image are determined; The head end and tail end of the spring to be tested are determined according to whether the matching score reaches a matching threshold, and the head end coordinate and tail end coordinate are identified through image recognition.
[0007] Further, the electric control box of the detection device transmits the first control instruction generated according to the user input information to the spring load transmission assembly, so that the spring is transmitted to the detection area at a transmission rate corresponding to the first control instruction, including: The electric control box generates the first control instruction according to the user input information, and transmits the first control instruction to the spring load transmission assembly; The spring load transmission assembly drives the spring transmission belt to move to the detection area according to the first control instruction, drives the spring fixing frame located on the spring transmission belt to move, changes the position of the spring to be tested located on the spring fixing frame, and makes the spring to be tested move to the detection area; The electric control box sends the second control instruction to the spring head and tail detection assembly to control the lens to work and collect the images of the two ends of the target to be tested at the core area in the detection area.
[0008] Further, the coarse radius and coarse length of the spring to be tested when entering the detection area are obtained, including: The first sensor sends a detection signal, calculates the endpoints of the front and rear ends of the spring through the time difference between signal sending and reflection receiving, and further obtains the coarse radius; The coarse length is calculated according to the coarse length calculation formula combined with the detection data of the first sensors on both sides and the distance between the components.
[0009] Further, the coarse radius and coarse length of the spring to be tested when entering the detection area are obtained, including: According to the detection signal sent by the first sensor in the first image acquisition unit, the shortest time difference between the sending time and the receiving time of the detection signal is calculated first, and the first length L1 is calculated by multiplying the shortest time difference and the detection signal rate; according to the detection signal sent by the first sensor in the second image acquisition unit, the shortest time difference between the sending time and the receiving time of the detection signal is calculated first, and the second length L2 is calculated by multiplying the shortest time difference and the detection signal rate; the distance between the first image acquisition unit and the second image acquisition unit along the direction perpendicular to the transmission direction is defined as the auxiliary length Lmax, and the coarse length L is calculated according to the auxiliary length Lmax, the first length L1 and the second length L2, and the coarse length calculation formula is L=Lmax-L1-L2.
[0010] Further, the position information, unit shooting time and lens focal length of the first image acquisition unit and the second image acquisition unit are adjusted according to the coarse radius and the coarse length, the target first image and the target second image of the spring to be tested entering the core area in the detection area are collected through the first image acquisition unit and the second image acquisition unit after adjustment, including: According to the coarse radius and the coarse length, the position information of the first image acquisition unit and the second image acquisition unit is adjusted to adjust the distance of the assembly from the conveying belt in the longitudinal direction according to the coarse length, and to adjust the assembly coordinates in the transverse direction according to the coarse radius; The unit shooting time is calculated in combination with the coarse radius and the conveying belt conveying rate; The focal length adjustment is to drive the lens by a servo motor, and adjust the focal length according to a preset rule to ensure that the image definition meets the standard; After the second sensor detects the spring, a trigger signal is generated to control the acquisition unit to shoot multiple intermediate images, and the target first image and the target second image are generated through pixel merging.
[0011] Further, the inner diameter and the axis of the target first image or the target second image are determined, and after rotation processing, similarity operation is performed between the target first image or the target second image and the corresponding standard first image and the standard end image to obtain a matching score, including: Determine the inner diameter and the axis of the target first image or the target second image; Align the axis of the target image with the standard first image and the standard end image, and select the scaled image according to the requirement Perform pixel-level comparison between the target image after rotation alignment and the standard image to generate a matching score.
[0012] Further, the first end and the end of the spring to be measured are determined according to whether the matching score reaches a matching threshold, and the first end coordinate and the end coordinate are identified by image recognition, including: Set a matching threshold, and if the matching score reaches the threshold, it is determined that it is the corresponding end; If the matching standard first end image threshold is reached, it is determined that the first end of the spring to be measured is reached; if the matching standard end image threshold is reached, it is determined that the end is reached; Through image mapping, the target first end coordinate and the target end coordinate corresponding to the standard image first end coordinate and the standard image end coordinate in the target image are obtained.
[0013] A spring first end and end detection system is applied to the spring first end and end detection method described above, and the system comprises: A spring transmission module is used to transmit a first control instruction generated according to user input information to a spring load transmission assembly through an electric control box of a detection device, so that the spring is transmitted to the detection area at a conveying rate corresponding to the first control instruction; A spring parameter acquisition module is used to obtain the coarse radius and the coarse length of the spring to be measured when entering the detection area; An image adjustment and acquisition module is used to adjust the position information, the unit shooting time, and the lens focal length of the first image acquisition unit and the second image acquisition unit according to the coarse radius and the coarse length, and to acquire the target first image and the target second image of the spring to be measured in the core area of the detection area through the first image acquisition unit and the second image acquisition unit after adjustment; A target parameter extraction module is configured to determine the inner diameter and the axis of the target first image or the target second image. A spring head-tail determination module is configured to determine the head end and the tail end of the spring under test according to whether the matching score reaches the matching threshold, and to identify the head end coordinate and the tail end coordinate through image recognition.
[0014] The application further provides a computer readable storage medium, which stores one or more instructions, and the one or more instructions implement the spring head-tail detection method.
[0015] The application further provides an electronic device, which comprises a memory and a processor, wherein the memory stores at least one program instruction, and the processor loads and executes the at least one program instruction to implement the spring head-tail detection method.
[0016] The spring head-tail detection method of the application realizes automatic conveying and positioning of the spring, and automatically captures the images of the two ends of the spring through the image acquisition unit, effectively avoids quality problems such as reverse installation of the head and tail of the spring and label errors caused by manual operation, and greatly improves the detection efficiency and consistency. BRIEF DESCRIPTION OF DRAWINGS
[0017] The application will be further described below in combination with the drawings and examples.
[0018] In the drawings: Figure 1 A flowchart of the spring head-tail detection method provided for the first embodiment of the application; Figure 2 A module schematic diagram of the test device provided for the first embodiment of the application; Figure 3 A top view of the spring load conveying assembly and the spring head-tail detection assembly provided for the first embodiment of the application; Figure 4 A front view of the spring load conveying assembly provided for the first embodiment of the application; Figure 5A side view of the spring load transmission assembly provided for the first embodiment of the present application; Figure 6 A schematic view of the head-end determination of the current image to be detected using the Ford spring head-end template and the Ford spring tail-end template provided for the first embodiment of the present application; Figure 7 A matching score table obtained by measuring the dimensions of the small spring (16# spring large end face) and the large spring (17# spring large end face) in the two angle ranges of 0-180° and 90-270°, respectively, provided for the first embodiment of the present application. Figure 8 A matching score table obtained by measuring the dimensions of the spring inner diameter in the 0-180° angle range through 45° inner dynamic rotation for 4 times, provided for the first embodiment of the present application.
[0019] Figure 9 A module schematic view of the spring head-tail detection system provided for the second embodiment of the present application. Figure 10 A structure schematic view of the network side server provided for the third embodiment of the present application.
[0020] The names and numbers of the components in the figure are as follows: The detection device 100; The electric control box 10; The spring load transmission assembly 20, the spring conveying belt 21, the spring fixing frame 22, the fixing table 221, and the bearing groove 222; The spring head-tail detection assembly 30, the first image acquisition unit 31, the first sensor 311, the image acquisition piece 312, the second sensor 313, the second image acquisition unit 32, and the image processing unit 33. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the present application will be described clearly and completely below with reference to the drawings. Obviously, the described embodiments are some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0022] First embodiment: The first embodiment of the present application provides a spring head and tail detection method, comprising: transmitting, by an electric control box of a detection device, a first control instruction generated according to user input information to a spring load transmission assembly, so that the spring is transmitted to a detection area at a transmission rate corresponding to the first control instruction; obtaining a coarse radius and a coarse length of the spring to be detected when entering the detection area; adjusting position information, unit shooting time and lens focal length of a first image acquisition unit and a second image acquisition unit according to the coarse radius and the coarse length, acquiring a target first image and a target second image of the spring to be detected entering a core area of the detection area through the first image acquisition unit and the second image acquisition unit after adjustment; determining an inner diameter and an axis of the target first image or the target second image; determining a head end and a tail end of the spring to be detected according to whether a matching score reaches a matching threshold, and identifying a head end coordinate and a tail end coordinate through image recognition. The spring head and tail detection method of the present application realizes automatic transmission and positioning of the spring, and automatically captures images of both ends of the spring through the image acquisition unit, effectively avoiding quality problems such as reverse installation of the head end and the tail end of the spring and label errors caused by manual operation, while greatly improving detection efficiency and consistency; by obtaining the coarse radius and the coarse length of the spring to be detected in real time and dynamically adjusting the position, shooting time and lens focal length of the image acquisition unit according to the coarse radius and the coarse length, the system can automatically adapt to springs of different specifications and sizes, solving the problem of frequent adjustment or replacement of jigs due to replacement of spring categories in the prior art, greatly enhancing the flexibility and application range of the detection system; by accurately determining the inner diameter and the axis of the spring image and performing high-precision similarity matching with a standard head end and tail end image, the head end and the tail end coordinates of the spring can be accurately identified and positioned, ensuring the objectivity and accuracy of the detection result and providing a reliable data basis for subsequent automatic sorting, labeling or assembly processes.
[0023] The implementation details of the spring head and tail detection method of the present embodiment will be described in detail below. The following content is only provided for the purpose of understanding the implementation details, and is not essential for implementing the present solution. The specific process of the present embodiment is shown in Figure 1 .
[0024] Step S1, transmitting, by an electric control box of a detection device, a first control instruction generated according to user input information to a spring load transmission assembly, so that the spring is transmitted to a detection area at a transmission rate corresponding to the first control instruction.
[0025] Specifically, as shown in Figure 2 , the detection device 100 comprises an electric control box 10, a spring load transmission assembly 20 and a spring head and tail detection assembly 30. The electric control box 10 is electrically connected with the spring load transmission assembly 20 and the spring head and tail detection assembly 30, and is used for sending a first control instruction to the spring load transmission assembly 20 and sending a second control instruction to the spring head and tail detection assembly 30.
[0026] The spring load transmission assembly 20 comprises a spring conveying belt 21 and a spring fixing frame 22 mounted on the spring conveying belt 21. The spring conveying belt 21 conveys the to-be-tested spring positioned by the spring fixing frame 22 to the direction of the corresponding detection area of the spring head-tail detection assembly 30 according to the first control instruction. The spring fixing frame 22 can limit the to-be-tested spring and does not block the shooting of the two ends of the to-be-tested spring by the spring head-tail detection assembly 30 on both sides of the spring conveying belt 21. The spring fixing frame 22 can adopt a frame structure or a table structure. The first control instruction can be input by the user through the electric control box 10 or generated by controlling the electric control box 10 through a third-party software or hardware device. After receiving the first control instruction, the built-in driving motor of the spring conveying belt 10 starts to drive the spring fixing frame 22 to move to the detection area.
[0027] As shown in Figure 3 , the spring fixing frame 22 comprises a fixed table 221. The top of the fixed table 221 is provided with a bearing groove 222 for bearing the to-be-tested spring which is axially perpendicular to the conveying direction of the spring conveying belt 21 and exposing at least half of the to-be-tested spring. Figure 3 As shown in Figure 3 , the two ends of the bearing groove 222 have protrusions for lifting the to-be-tested spring. The curvature of the bearing groove is less than 180°, which ensures that the to-be-tested spring is exposed and does not hinder the shooting of the target first image and the target second image of the two ends of the to-be-tested spring by the spring head-tail detection assembly 30 on both sides of the spring conveying belt 21. The target first image and the target second image can fully display the end of the to-be-tested spring and avoid blocking. The spring conveying belt 21 comprises a plurality of conveying chain blocks. The conveying chain blocks have clamping grooves. The bottom of the fixed table 221 is provided with protrusions clamped with the clamping grooves. The fixed table 221 is clamped with the conveying chain blocks, and the conveying chain blocks move to the detection area direction under the driving, Figure 2 , the conveying direction is from right to left.
[0028] As shown in Figures 2-5 , the spring head-tail detection assembly 30 comprises a first image acquisition unit 31, a second image acquisition unit 32 and an image processing unit 33. Figure 3 As shown in Figure 3 , the first image acquisition unit 31 and the second image acquisition unit 32 are located on both sides of the detection area along the conveying direction of the spring load transmission assembly 20. One first image acquisition unit 31 and one second image acquisition unit 32 form a group of image acquisition units. The spring head-tail detection assembly 30 can have one group of image acquisition units or multiple groups of image acquisition units, as shown in Figure 2 , one spring head-tail detection assembly 30 has three groups of image acquisition units.
[0029] The first image acquisition unit 31 and the second image acquisition unit 32 are opposite to each other, and the first image acquisition unit 31 and the second image acquisition unit 32 are arranged to be opposite to each other. Each image acquisition unit includes a first sensor 311, an image acquisition part 312 and a second sensor 313 which are distributed along the conveying direction.
[0030] The first sensor 311 is used to detect the arrival of the to-be-tested spring in the detection area to generate a first signal a, and the first signal a is used by the image processing unit 33 to coarsely analyze the coarse radius and the coarse length of the to-be-tested spring, and then generate a second control instruction to control the first image acquisition unit 31 and the second image acquisition unit 32 to adjust the position information of the image acquisition part 312, the unit shooting time length and the lens focal length of the image acquisition part 312 for single shooting of the to-be-tested spring. The position information includes the distance from the spring conveying belt 21 and the mapping position in the conveying direction relative to the spring conveying belt 21, the unit shooting time length and the mapping position are related to the coarse radius, and the distance is related to the coarse length; the second sensor 313 is used to detect the arrival of the to-be-tested spring in the core area of the detection area to generate a second signal b, and the second signal b is used by the image processing unit 33 to generate a collection trigger signal to control the image acquisition part 312 to obtain the intermediate image of the to-be-tested spring. The image processing unit 33 is also used to perform pixel merging on all frames of intermediate images within the unit shooting time length to generate a target image, and the target image is a target first image or a target second image. The detection area here corresponds to the group of image acquisition units, and the detection areas of different groups of image acquisition units can intersect but not coincide, or can not intersect.
[0031] In some examples, the spring head-tail detection assembly 30 includes a plurality of image acquisition units, and the first sensors of adjacent image acquisition units on the same side are shared to reduce the dependence on the first sensors. For example, the image acquisition units of group A and the image acquisition units of group B are adjacent, the first sensor originally arranged in the image acquisition units of group B is deleted, and the information acquired by the first sensor originally arranged in the image acquisition units of group A is shared to the image acquisition units of group B. When the to-be-detected spring reaches the detection area, the first sensor generates the first signal a(A) corresponding to the image acquisition units of group A and the first signal a(B) corresponding to the image acquisition units of group B. The difference between the first signal a(A) and the first signal a(B) is only the time sequence, and the difference in the time sequence is determined according to the distance between the image acquisition units of group A and the image acquisition units of group B and is positively correlated.
[0032] Specifically, the electric control box of the detection device transmits the first control instruction generated according to the user input information to the spring load transmission assembly, so that the spring is transmitted to the detection area at a transmission rate corresponding to the first control instruction, including the following steps: Step S11, the electric control box 10 generates a first control instruction according to the user input information, and transmits the first control instruction to the spring load transmission assembly 20.
[0033] Step S12, the spring load transmission assembly 20 drives the spring transmission belt 21 to move to the detection area according to the first control instruction, drives the spring fixing frame 22 on the spring transmission belt 21 to move, changes the position of the to-be-detected spring on the spring fixing frame 22, and makes the to-be-detected spring move to the detection area.
[0034] Step S13, the electric control box 10 sends a second control instruction to the spring head-tail detection assembly 30 to control the lens to work and acquire the images of the two ends of the to-be-detected target at the core area in the detection area.
[0035] Specifically, the position of the image acquisition unit 312 in the spring head-tail detection assembly 30 is unmovable, and then the focal length of the lens in the image acquisition unit 312 can be manually adjusted by the staff, or the focal length of the lens can be adjusted by the staff through the electric control box 10, or the focal length of the lens can be adjusted by the electric control box 10 when the electric control box 10 is running. The electric control box 10 is connected with the spring head-tail detection assembly 30, sends a second control instruction to the spring head-tail detection assembly 30, so as to control the lens to work and acquire the images of the two ends of the to-be-detected target at the core area in the detection area.
[0036] Step S2, the coarse radius and the coarse length of the to-be-detected spring entering the detection area are acquired.
[0037] Specifically, the coarse radius and the coarse length of the to-be-detected spring entering the detection area are acquired, including the following steps: Step S21: The first sensor sends a detection signal. By calculating the time difference between signal transmission and reflected reception, the front and rear end points of the spring are calculated, and the coarse radius is obtained.
[0038] Specifically, the coarse radius refers to the approximate inner and outer diameters of the spring under test, and the coarse length refers to the approximate length of the spring under test. The coarse radius and coarse length can be obtained from the approximate radius and length range of springs of the same model and batch during production. The coarse radius and coarse length can be obtained by direct input or by reading / retrieving data directly from the manufacturer.
[0039] In one example, reference Figure 3 As shown, first sensors 311 are installed on both sides of the entrance to the detection area. In one example, the first sensor 311 sends a detection signal to the opposite side. When there is no obstruction, the first sensor 311 will not receive any signal. When there is an obstruction (i.e., the spring to be tested is present), the first sensor 311 receives the detection signal reflected from the outer surface of the spring to be tested. When the first sensor 311 receives the reflected detection signal, it generates a first feedback signal and sends it to the image processing unit in the spring end detection assembly.
[0040] The image processing unit 33 determines that the first instance of obstruction after exceeding a preset time is considered as the front end of the spring under test arriving at the detection area. At this point, it calculates one endpoint of the front end of the spring under test based on the transmission time of the detection signal and the reception time obtained from reflection off the surface of the spring. It determines that the last instance of obstruction before exceeding the preset time is considered as the rear end of the spring under test arriving at the detection area. Based on the transmission time of the last detection signal and the reception time obtained from reflection off the surface of the spring, it calculates one endpoint of the rear end of the spring. The coarse radius is obtained by dividing the distance between the front endpoint and the rear endpoint by two.
[0041] Step S22: Combining the detection data from the first sensors on both sides and the component spacing, the coarse length is calculated according to the coarse length calculation formula.
[0042] In one case, refer to Figure 3 As shown, the upper end of the spring to be tested has two of the aforementioned endpoints, and the lower end of the spring to be tested also has two of the aforementioned endpoints. In other words, the coarse length can be calculated based on the four endpoints of the spring to be tested.
[0043] Specifically, based on the detection signal sent by the first sensor 311 in the first image acquisition unit 31, the shortest time difference between the transmission time and the reception time of the detection signal is first calculated, and the first length L1 is calculated by multiplying the shortest time difference with the detection signal rate meter. Based on the detection signal sent by the first sensor 311 in the second image acquisition unit 32, the shortest time difference between the transmission time and the reception time of the detection signal is first calculated, and the second length L2 is calculated by multiplying the shortest time difference with the detection signal rate meter. The distance between the first image acquisition unit 31 and the second image acquisition unit 32 along the direction perpendicular to the transmission direction is defined as the auxiliary length Lmax. Based on the auxiliary length Lmax, the first length L1, and the second length L2, the coarse length L is calculated. The formula for calculating the coarse length is L=Lmax-L1-L2.
[0044] Specifically, in the first image acquisition unit 31, the first sensor 311 is aligned with the first sensor 311 in the second image acquisition unit 32. The first sensor 311 on one side sends a detection signal to the first sensor 311 on the other side for reception. Each first sensor 311 can receive the signal reflected back from the surface of the spring under test by its own detection signal. In another example, the first sensor 311 in the first image acquisition unit 31 and the first sensor 311 in the second image acquisition unit 32 are spaced apart and not aligned. Each first sensor 311 can receive the signal reflected back from the surface of the spring under test by its own detection signal.
[0045] Step S3: Adjust the position information, unit shooting time, and lens focal length of the first and second image acquisition units according to the coarse radius and coarse length. Then, acquire the first and second target images of the spring to be tested that have entered the core area of the detection area through the adjusted first and second image acquisition units.
[0046] Specifically, the steps of adjusting the position information, unit shooting time, and lens focal length of the first and second image acquisition units according to the coarse radius and coarse length, and acquiring the target first image and target second image of the spring to be tested entering the core area of the detection region through the adjusted first and second image acquisition units include the following steps: Step S31: Adjust the position information of the first image acquisition unit and the second image acquisition unit according to the coarse radius and coarse length. Adjust the distance between the component and the conveyor belt longitudinally according to the coarse length, and adjust the component coordinates laterally according to the coarse radius.
[0047] Specifically, the image processing unit 33 generates a feedback signal based on the coarse radius and coarse length obtained in S3, and sends this feedback signal to the control box 10. The control box 10 is connected to the first image acquisition unit 31 and the second image acquisition unit 32. Upon receiving the feedback signal, it generates a second control command and sends it to the first and second image acquisition units 31 and 32, driving them to adjust the position of the image acquisition element 312 within each unit (including lateral position adjustment along the conveying direction and longitudinal position adjustment perpendicular to the conveying direction). The image acquisition element 312 is also connected to the control box 10, which sends a second control command to the image acquisition element 312 to activate the motor controlling the lens focal length, thereby adjusting the lens focal length of the image acquisition element 312. The adjusted image acquisition element 312 then acquires an image of the spring under test.
[0048] In one example, adjusting the position information, unit shooting duration, and lens focal length of the first image acquisition unit 31 and the second image acquisition unit 32 based on the coarse radius and coarse length includes: Based on the coarse length of the spring to be tested, the position of the first image acquisition unit 31 is adjusted longitudinally to change the distance h1 between the first image acquisition unit 31 and the spring conveyor belt 21, and the position of the second image acquisition unit 32 is adjusted longitudinally to change the distance h between the second image acquisition unit 32 and the spring conveyor belt 21. The larger the coarse length, the larger the values of h1 and h2 need to be. Furthermore, to ensure accuracy, the value of h1 is equal to the value of h2.
[0049] Based on the radius of the spring under test, the position of the first image acquisition unit 31 is adjusted laterally to change its lateral coordinate x1, and the position of the second image acquisition unit 32 is adjusted laterally to change its lateral coordinate x2. The adjustments of x1 and x2 are synchronized. The adjustment of the positions of x1 and x2 is to accommodate the gaps between the springs under test. For example, if the spring under test is wider than the previous one, then the position of the image acquisition element 312 in the first image acquisition unit 31 needs to be adjusted to ensure that the image acquisition element 312 captures the end of the spring under test from the front, so that the captured image of the spring end is closer to the spring body (ensuring).
[0050] Step S32: Calculate the unit shooting time by combining the coarse radius and the conveyor belt speed.
[0051] Specifically, the unit shooting time of the spring under test is calculated based on the radius of curvature and the conveying speed. The conveying speed is the running speed of the spring conveyor belt 21. This value can be obtained directly from the first control command of the electrical control box 10, or it can be obtained by directly reading the spring conveyor belt 21, or it can be manually input / imported by the operator.
[0052] Step S33: The focal length is adjusted by driving the lens with a servo motor and adjusting the focal length according to preset rules to ensure that the image clarity meets the standard.
[0053] Based on the positions of the first image acquisition unit 31 and the second image acquisition unit 32, and combined with the coarse radius and coarse length of the spring under test, the lens focal length is determined according to a preset lens adjustment rule to ensure that the clarity of the first and second target images reaches a preset standard. After the positions of the first image acquisition unit 31 and the second image acquisition unit 32 are adjusted, the camera lens is continuously adjusted according to the camera lens adjustment precision corresponding to the coarse length and coarse radius until the clarity reaches the standard. The image acquisition unit 312 is equipped with servo motors M, N, and Z. Servo motor M is used to further fine-tune its lateral position according to the coarse radius to change the lateral x1 / x2, with a fine-tuning range of -150 to 50 mm. Servo motor N is used to further fine-tune its longitudinal position according to the coarse radius to change the longitudinal h1 / h2, with a fine-tuning range of 0 to +50 mm. Servo motor Z rotates the camera lens through gears to change the focal length of the camera lens. Here, all servo motors in the image acquisition unit 312 are connected to and controlled by the electrical control box 10.
[0054] In step S34, the second sensor detects the spring and generates a trigger signal to control the acquisition device to capture multiple intermediate images, which are then merged to generate the first image and the second image of the target.
[0055] Specifically, the adjusted first image acquisition unit 31 and second image acquisition unit 32 acquire target first image and target second image of the spring to be tested entering the core area of the detection region, including: Second sensors 313 are installed on both sides of the entrance to the core area. The structure and working principle of the second sensors 313 are the same as those of the first sensor 311. The two opposing second sensors 313 can be aligned, for example, in a spatial coordinate system (x-axis along the conveying direction, y-axis horizontal plane perpendicular to the conveying direction, z-axis vertical direction), the x-axis values of the two opposing second sensors 313 are the same. Alternatively, they can be misaligned, and there can be a certain gap between the lateral mapping points of the two second sensors 313. For example, in a spatial coordinate system, the x-axis values of the two opposing sensors are not the same and have a very small difference. This difference is a controllable gap value.
[0056] When the second sensor 313 on one side first receives the verification signal reflected from the surface of the spring under test after at least a preset time, a trigger signal is generated to indicate that the spring under test has reached the core area. This trigger signal is sent to the control box 10, which controls the camera lens of the image acquisition unit 312 in the first image acquisition unit 31 to operate. Based on the trigger signal, the first image acquisition unit 31 is controlled to capture a first image of the target at one end of the spring under test, and the second image acquisition unit 32 is controlled to capture a second image of the target at the other end of the spring under test.
[0057] Step S4: Determine the inner diameter and axis of the target first image or the target second image, and after rotation processing, perform similarity calculation between it and the corresponding standard first and last images to obtain a matching score.
[0058] Specifically, determining the inner diameter and axis of the target first image or the target second image, and then performing a similarity calculation between them and the corresponding standard first and last images after rotation to obtain a matching score includes the following steps: Step S41: Determine the inner diameter and axis of the first or second image of the target.
[0059] Specifically, such as Figure 6 As shown, the image acquisition unit in the first image acquisition unit transmits the first target image to the image processing unit, and the image acquisition unit in the second image acquisition unit transmits the second target image to the image processing unit. The image processing unit executes S5, defining the first target image and the second target image as the current image to be detected.
[0060] Methods for determining the inner diameter and axis of the target first image or target second image (i.e., the current image to be detected) include: First, preprocessing the current image to be detected, extracting the edge contour of the inner circle of the spring in the preprocessed image, and applying the Hough circle transform (such as the HoughCircles function in OpenCV) to map the edge points in the image space to the parameter space (center coordinates a, b and radius r). By using an accumulator to statistically analyze the parameter combination with the highest support, the center (i.e., axis) and radius of the inner circle are determined, thus obtaining the inner diameter and axis of the spring. Preprocessing includes grayscale conversion, Gaussian filtering for noise reduction, and Canny edge detection. Second, referencing... Figure 7 As shown, spring samples from Ford and Mazda brands are selected to generate standard first and last images corresponding to each brand. CogPMAlignTool is used for template matching to locate the position of the spring under test in the current image to be tested. CogFindCircleTool is called to identify the circular outline of the inner ring of the spring and directly output the coordinates of the axis of the spring under test and the shape of the inner diameter in the image.
[0061] Step S42: Align the target image with the axis of the standard first and last images, and select the scaling image as needed.
[0062] Specifically, the standard first and last images include a standard first-end image and a standard last-end image. After rotation processing, a similarity calculation is performed between the image and the corresponding standard first and last images to obtain a matching score. This includes: aligning the axis of the standard first and last images with the axis of the current image to be tested; rotating the target first image or target second image according to the standard first and last images so that the axes coincide and the inner diameters are on the same straight line; calculating the similarity between the rotated target first image or target second image (i.e., the current image to be tested) and the standard first and last images to obtain a matching score. The similarity calculation between the current image to be tested and the standard first and last images can be performed by using complete 3D data of the end face, comparing each pixel to obtain the similarity between the two, thus ensuring a more reliable overall result.
[0063] As an example, if the ratio between the inner diameter of the current image under test and the inner diameter of the standard first and last images is too large (the judgment criterion is that the ratio of the inner diameter is less than 0.6 or greater than 1.5), the current image under test is enlarged or reduced based on the size of the standard first and last images until the ratio between the inner diameters meets the requirements.
[0064] Step S43: Perform pixel-level comparison between the rotated and aligned target image and the standard image to generate a matching score.
[0065] As an example, spring samples from Ford and Mazda brands are selected to generate standard first and last images corresponding to each brand. CogPMAlignTool is used for template matching (e.g., template matching of the first and last images of the Ford spring) to locate the position of the spring under test in the current image to be tested. CogFindCircleTool is called to identify the circular outline of the inner ring of the spring, and the coordinates of the axis of the spring under test and the shape of the inner diameter are directly output in the image. Then, the similarity between the current image under test and the standard first and last images is calculated at the pixel level to obtain the matching score.
[0066] As an example, such as Figure 7 As shown, the springs were divided into two groups: small springs (16# spring, large end face) and large springs (17# spring, large end face). The dimensions of each group were measured in two angle ranges: 0-180° and 90-270°. After determining the standard beginning and end images, 15 repeated measurements were performed for each angle range, and the maximum value (MAX), minimum value (MIN), and the difference between them (MAX-MIN) were recorded. The matching scores obtained after performing the aforementioned case operation on the springs in group "16#" and group "17#" are shown. Figure 7The data in the two tables show that the maximum fluctuation is 0.1 and the minimum is 0.023. Under static testing conditions, the spring under test is fixed, and the camera lens remains stable under repeated effects and software / hardware algorithm processing.
[0067] refer to Figure 8 As shown, the inner diameter of the spring was measured four times with dynamic rotation within 45°, covering an angle range of 0-180°, to evaluate the consistency of the inner diameter under different placement angles. For Ford and Mazda brand springs, the inner diameter values of the beginning and end were measured at 0°, 15°, 30°, and 45° deviations, and the maximum value (MAX), minimum value (MIN), and the difference between the two (MAX-MIN) were recorded. Ford spring: the inner diameter of the beginning was between 55.51152 and 55.55214, with a difference of 0.040622; the inner diameter of the end was between 55.00571 and 55.02811, with a difference of 0.022401. Mazda springs: The inner diameter of the first end ranges from 101.5046 to 101.5229 mm, with a difference of 0.018361 mm; the inner diameter of the last end ranges from 103.2124 to 103.2832 mm, with a difference of 0.070834 mm. Therefore, the repeatability difference between the two end faces within a 45° range is a maximum of 0.07 mm and a minimum of 0.022 mm. Even with inconsistent spring end face shapes at different placement angles, a certain level of accuracy can be guaranteed, meaning that "it is not necessary to rotate the current image to be detected before recognition" is also acceptable.
[0068] Step S5: Determine the beginning and end of the spring to be tested based on whether the matching score reaches the matching threshold, and identify the coordinates of the beginning and end from the image.
[0069] Specifically, the process of determining the start and end points of the spring under test based on whether the matching score reaches the matching threshold, and identifying the coordinates of the start and end points from the image, includes the following steps: Step S51: Set a matching threshold. When the matching score reaches the threshold, it is determined to be the corresponding end.
[0070] Step S52: If the standard first-end image threshold is matched, it is determined to be the first end of the spring to be tested; if the standard last-end image threshold is matched, it is determined to be the last end.
[0071] Specifically, a matching threshold is set, usually 0.7. When the matching threshold is 0.7, it is considered passed, that is, the matching score of the current image under test calculated by the spring head template reaches the matching threshold, and the current image under test is determined to be the Ford spring head. When the matching score of the current image under test calculated by the spring tail template reaches the matching threshold, the current image under test is determined to be the Ford spring tail.
[0072] Step S53: Obtain the target's head coordinates and tail coordinates in the target image that correspond to the head and tail coordinates of the standard image through image mapping.
[0073] Specifically, when the matching score reaches the matching threshold corresponding to the standard first-end image, the first end of the spring to be tested is determined, and the target first-end coordinates in the standard first-end coordinates in the target first image or the target second image are obtained by mapping; when the matching score reaches the matching threshold corresponding to the standard last-end image, the last end of the spring to be tested is determined, and the target last-end coordinates in the standard last-end coordinates in the standard first image or the target second image are obtained by mapping.
[0074] This invention provides a method for detecting the beginning and end of a spring, enabling automatic spring transport and positioning. Combined with an image acquisition unit, it automatically captures images of both ends of the spring, effectively avoiding quality problems such as incorrect spring assembly and labeling caused by manual operation. This significantly improves detection efficiency and consistency. By acquiring the coarse radius and coarse length of the spring under test in real time and dynamically adjusting the position of the image acquisition unit, the shooting time, and the lens focal length accordingly, the system can automatically adapt to springs of different sizes. This solves the problem of frequent fixture adjustments or replacements required when changing spring types in existing technologies, greatly enhancing the flexibility and applicability of the detection system. By accurately determining the inner diameter and axis of the spring image and performing high-precision similarity matching with standard beginning and end images, the system can accurately identify and locate the coordinates of the beginning and end of the spring, ensuring the objectivity and accuracy of the detection results and providing a reliable data foundation for subsequent automatic sorting, labeling, or assembly processes.
[0075] like Figure 9 As shown, the second embodiment of the present invention provides a spring start and end detection system, the system including: a spring transmission module 201, a spring parameter acquisition module 202, an image adjustment acquisition module 203, a target parameter extraction module 204, and a spring start and end determination module 205.
[0076] Specifically, the spring transmission module 201 transmits a first control command generated based on user input information to the spring load transmission component via the electrical control box of the detection device, causing the spring to be transmitted towards the detection area at the transmission rate corresponding to the first control command; the spring parameter acquisition module 202 acquires the coarse radius and coarse length of the spring to be tested when it enters the detection area; the image adjustment acquisition module 203 adjusts the position information, unit shooting time, and lens focal length of the first and second image acquisition units based on the coarse radius and coarse length, and acquires the target first image and target second image of the spring to be tested entering the core area of the detection area through the adjusted first and second image acquisition units; the target parameter extraction module 204 determines the inner diameter and axis of the target first image or target second image; and the spring head and tail determination module 205 determines the head and tail ends of the spring to be tested based on whether the matching score reaches the matching threshold, and identifies the head and tail coordinates from the image.
[0077] It is not difficult to see that this embodiment is a system implementation corresponding to the first embodiment, and this embodiment can be implemented in conjunction with the first embodiment. The relevant technical details mentioned in the first embodiment are still valid in this embodiment, and will not be repeated here to reduce repetition. Accordingly, the relevant technical details mentioned in this embodiment can also be applied to the first embodiment.
[0078] It is worth mentioning that all modules involved in this embodiment are logical modules. In practical applications, a logical unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. Furthermore, to highlight the innovative aspects of this invention, this embodiment does not introduce units that are not closely related to solving the technical problem proposed by this invention; however, this does not mean that other units are absent from this embodiment.
[0079] The third embodiment of the present invention relates to a network-side server, such as... Figure 10 As shown, it includes at least one processor 302; and a memory 301 communicatively connected to at least one processor 302; wherein the memory 301 stores instructions executable by at least one processor 302, the instructions being executed by at least one processor 302 to enable at least one processor 302 to perform the above-described data processing method.
[0080] The memory 301 and processor 302 are connected via a bus, which may include any number of interconnecting buses and bridges. The bus connects various circuits of one or more processors 302 and memory 301 together. The bus can also connect various other circuits, such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by processor 302 is transmitted over a wireless medium via an antenna, which further receives data and transmits it to processor 302.
[0081] Processor 302 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory 301 can be used to store data used by processor 302 during operation.
[0082] The fourth embodiment of the present invention relates to a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the spring start-end detection method of the first embodiment.
[0083] That is, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0084] The above descriptions are merely embodiments of the present invention. Commonly known structures and characteristics are not described in detail here. Those skilled in the art are aware of all common technical knowledge in the field prior to the application date or priority date, are aware of all existing technologies in that field, and have the ability to apply conventional experimental methods prior to that date. Those skilled in the art can, under the guidance of this application, improve and implement this solution in combination with their own capabilities. Some typical known structures or methods should not be obstacles for those skilled in the art to implement this application. It should be noted that those skilled in the art can make several modifications and improvements without departing from the structure of the present invention. These should also be considered within the scope of protection of the present invention, and will not affect the effectiveness of the implementation of the present invention or the practicality of the patent. The scope of protection claimed in this application should be determined by the content of its claims, and the specific embodiments described in the specification can be used to interpret the content of the claims.
[0085] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for detecting the beginning and end of a spring, characterized in that, include: The electrical control box of the detection device transmits the first control command generated based on the user input information to the spring load transmission component, so that the spring is transmitted towards the detection area at the transmission rate corresponding to the first control command. Obtain the coarse radius and coarse length of the spring under test when it enters the detection area; The position information, unit shooting time, and lens focal length of the first and second image acquisition units are adjusted according to the coarse radius and coarse length. The adjusted first and second image acquisition units then acquire the first and second images of the target spring that has entered the core area of the detection area. Determine the inner diameter and axis of the first or second image of the target; The start and end points of the spring under test are determined based on whether the matching score reaches the matching threshold, and the coordinates of the start and end points are identified by image recognition.
2. The method for detecting the beginning and end of a spring according to claim 1, characterized in that, The electrical control box of the detection device transmits a first control command generated based on user input information to the spring load transmission component, causing the spring to be transmitted towards the detection area at the transmission rate corresponding to the first control command, including: The electrical control box generates a first control command based on the user input information and transmits the first control command to the spring load transmission component; The spring load transmission assembly drives the spring transmission belt to move toward the detection area according to the first control command, which in turn drives the spring fixing frame located on the spring transmission belt to move, changing the position of the spring to be tested located on the spring fixing frame, so that the spring to be tested moves toward the detection area. The control box sends a second control command to the spring end detection assembly to control the lens to work and acquire images of both ends of the target in the core area of the detection zone.
3. The method for detecting the beginning and end of a spring according to claim 1, characterized in that, The acquisition of the coarse radius and coarse length of the spring under test when it enters the detection area includes: The first sensor sends a detection signal, and the front and rear ends of the spring are calculated by the time difference between the signal transmission and the reflected reception, thus obtaining the coarse radius; The coarse length is calculated by combining the detection data from the first sensors on both sides and the component spacing, according to the coarse length calculation formula.
4. The method for detecting the beginning and end of a spring according to claim 3, characterized in that, The acquisition of the coarse semi-length of the spring under test when entering the detection area includes: Based on the detection signal sent by the first sensor in the first image acquisition unit, the shortest time difference between the transmission time and the reception time of the detection signal is first calculated. The first length L1 is calculated by multiplying the shortest time difference by the detection signal rate meter. Based on the detection signal sent by the first sensor in the second image acquisition unit, the shortest time difference between the transmission time and the reception time of the detection signal is first calculated. The second length L2 is calculated by multiplying the shortest time difference by the detection signal rate meter. The distance between the first image acquisition unit and the second image acquisition unit along the direction perpendicular to the transmission direction is defined as the auxiliary length Lmax. Based on the auxiliary length Lmax, the first length L1, and the second length L2, the coarse length L is calculated. The formula for calculating the coarse length is L = Lmax - L1 - L2.
5. The method for detecting the beginning and end of a spring according to claim 1, characterized in that, The process involves adjusting the position information, unit shooting time, and lens focal length of the first and second image acquisition units based on their coarse radius and coarse length. The adjusted first and second image acquisition units then acquire the target first image and target second image of the spring entering the core area of the detection region. This includes: The position information of the first and second image acquisition units is adjusted according to the coarse radius and coarse length. The distance between the component and the conveyor belt is adjusted longitudinally according to the coarse length, and the component coordinates are adjusted laterally according to the coarse radius. Calculate the unit shooting time by combining the radius of the radius and the conveyor belt speed; The focus is adjusted by a servo motor driving the lens, adjusting the focus according to preset rules to ensure that the image clarity meets the standard. After the second sensor detects the spring, it generates a trigger signal, which controls the acquisition device to capture multiple intermediate images. The images are then merged to generate the first image and the second image of the target.
6. The method for detecting the beginning and end of a spring according to claim 4, characterized in that, The process of determining the inner diameter and axis of the target first image or target second image, rotating it, and then performing a similarity calculation between it and the corresponding standard first and last images to obtain a matching score includes: Determine the inner diameter and axis of the first or second image of the target; Align the target image with the axis of the standard first and last images, and then select the image scaling method as needed. The target image after rotation and alignment is compared with the standard image at the pixel level to generate a matching score.
7. The method for detecting the beginning and end of a spring according to claim 1, characterized in that, The step of determining the beginning and end of the spring under test based on whether the matching score reaches the matching threshold, and identifying the coordinates of the beginning and end of the spring from the image, includes: Set a matching threshold; once the matching score reaches the threshold, the device is identified as the corresponding end. If the image matches the standard first-end image threshold, it is determined to be the first end of the spring to be tested; if it matches the standard last-end image threshold, it is determined to be the last end. By image mapping, the target's head coordinates and tail coordinates, corresponding to the head and tail coordinates of the standard image, are obtained.
8. A spring start-end detection system, characterized in that, The system, applied to the spring start and end detection method according to any one of claims 1-7, comprises: The spring transmission module is used to transmit the first control command generated based on the user input information to the spring load transmission component through the electrical control box of the detection device, so that the spring is transmitted towards the detection area at the transmission rate corresponding to the first control command. The spring parameter acquisition module is used to obtain the coarse radius and coarse length of the spring under test when it enters the detection area; The image adjustment and acquisition module is used to adjust the position information, unit shooting time and lens focal length of the first image acquisition unit and the second image acquisition unit according to the coarse radius and coarse length. The adjusted first image acquisition unit and second image acquisition unit acquire the target first image and target second image of the spring to be tested entering the core area of the detection area. The target parameter extraction module is used to determine the inner diameter and axis of the first or second image of the target. The spring start and end determination module is used to determine the start and end of the spring under test based on whether the matching score reaches the matching threshold, and to identify the coordinates of the start and end of the spring from the image.
9. A computer-readable storage medium storing one or more instructions, characterized in that, When one or more instructions are executed, the spring start and end detection method according to any one of claims 1 to 7 is implemented.
10. An electronic device, characterized in that, include: Memory and processor; the memory stores at least one program instruction; The processor implements the spring start and end detection method according to any one of claims 1-7 by loading and executing the at least one program instruction.