Visual guidance positioning system for pencil automatic assembly and method thereof

CN122948765APending Publication Date: 2026-10-20QINGYUAN COUNTY VOCATIONAL SENIOR HIGH SCHOOL
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202610999119.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-07
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

[0018]鉴于现有技术存在无法感知来料位姿偏差、特征提取抗干扰能力差、单目深度信息获取成本高、多工位坐标系缺乏实时统一的问题,从而提出了一种面向铅笔自动装配的视觉引导定位系统及其方法

Benefits of technology

1.本发明通过视觉感知每根铅笔杆的实际空间位姿,采用特征分离-分层求解策略分别解算各自由度分量,结合V型装配定位机构的接触约束关系推导深度信息,能够针对每根铅笔杆的实际几何状态生成个性化的运动补偿指令,有助于提高装配成功率和产品一致性,有利于降低废品率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

This invention relates to the fields of machine vision and automated assembly technology, and discloses a vision-guided positioning system and method for automated pencil assembly. The invention includes capturing images of a slender, rod-shaped workpiece (like a pencil) within a V-shaped assembly positioning mechanism; separating visual features into three categories based on physical function: longitudinal edge, end face contour, and surface texture; and calculating the pitch angle, horizontal deflection angle, and planar translation component of the end face center for each category. Utilizing the two-point contact constraint relationship between the workpiece cross-section and the V-shaped mechanism, and combining known cross-sectional dimension parameters, the depth translation component is derived, and spatial pose parameters are generated to guide the actuator to complete the assembly. This invention requires only a single low-cost industrial camera to achieve six-degree-of-freedom pose calculation, effectively improving the robustness of feature extraction and assembly results, adapting to the high-rate-of-production needs of pencil production lines, while reducing equipment costs and maintenance difficulty.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of machine vision and automated assembly technology, and in particular to a vision-guided positioning system and method for automated pencil assembly. Background Technology

[0002] Automatic pencil assembly is a crucial process in pencil manufacturing. Taking a traditional wooden pencil as an example, the assembly process involves inserting the end of the pencil shaft through an aluminum clamp and into the pre-drilled hole for the eraser tip. For a mechanical pencil, the assembly process involves threading the pencil shaft and the lead mechanism assembly together.

[0003] Pencil barrels are typical slender rod-shaped workpieces, approximately 175 to 180 millimeters in length, with a cross-sectional diameter of about 7 millimeters and a length-to-diameter ratio of about 25:1. Pencil barrels are mostly made of wood, and their cross-sectional dimensions are affected by the wear of planing tools, differences in wood density and moisture content, resulting in unavoidable tolerance fluctuations. Some pencil barrels also have gripping grooves on their surface, further increasing the uncertainty in positioning.

[0004] Currently, the pencil assembly process mainly relies on purely mechanical positioning solutions, such as: Publication number: CN204526504U discloses a positioning and clamping structure for an automatic assembly machine of triangular eraser pencils. It uses a vibratory feeder to mechanically align the aluminum hoop and eraser tip, achieves mechanical positioning of the parts through a falling channel and a three-lobed chuck, and then pushes the pencil shaft to complete the assembly by a motion mechanism. All pencil shafts are clamped and pushed with uniform parameters, which belongs to open-loop mechanical positioning.

[0005] Publication number CN214189049U discloses a pencil eraser tip attaching machine. This machine includes a housing with two fixing holes. Limiting mechanisms are provided on both sides of each fixing hole. The upper end of the housing is connected to an operating box via a support plate. A pressing mechanism is located inside the operating box. A rotating plate is installed between the two support plates, and a vibrating plate is fixedly connected to the front end of the rotating plate. The limiting mechanism uses movable plates slidably connected within grooves on the side walls of the fixing holes. Springs are fixedly connected between the movable plates and the bottom of the grooves. The other end of the movable plates is connected to a limiting block via a fixing block. The pressing mechanism uses a motor to drive a threaded rod, which, in conjunction with a transmission component, achieves the pressing action. This solution focuses on solving the problem of compacting the eraser tip after assembly; the positioning method remains purely mechanical.

[0006] In the application of visual technology, the pencil manufacturing industry has already used vision for quality inspection, for example: Publication number CN222805617U discloses a vision-based sorting and unloading mechanism for producing pencils. This unloading mechanism includes a conveyor table with a storage bin, a stabilizing block, and a stabilizing frame fixedly mounted on its upper surface. The stabilizing frame has a sorting structure. Through the rotation of a motor, rollers, a conveyor belt, and a conveyor trough, pencils are placed horizontally into the storage bin and then fall one by one from the outlet onto the conveyor trough. The conveyor belt transports the pencils forward through the conveyor trough, ensuring that each conveyor trough containing a pencil passes the outlet of the storage bin. The vision function of this solution focuses on product inspection, outputting a pass / fail switch signal. It does not involve precise calculation of assembly space positions, nor does it participate in guiding the movement of the assembly actuator.

[0007] Publication number CN223491447U discloses a pencil surface defect detection mechanism, which adds the function of detecting pencil surface defects on the basis of pencil visual sorting and transmission. Its vision system is also limited to quality inspection purposes and does not involve assembly positioning guidance.

[0008] In the field of vision-guided precision assembly, there are already various pose estimation and assembly alignment schemes, such as: Publication No. CN118617091A discloses a method for guiding coaxial assembly in the later stages based on machine vision. The method includes: installing a camera at the front of the active assembly end to acquire work images; attaching a target to the passive assembly end for endpoint marking, thus forming an assembly vision-based end-of-line navigation system; preprocessing the acquired images to obtain a binary image containing the target image region; constructing a multi-level filter to filter the binary image to obtain a binary image containing only target information; calculating the pixel position coordinates of the target binary image with sub-pixel precision; calibrating the camera to obtain the relationship between pixels and physical movement distance; calculating the offset distance for assembly navigation; after navigation is completed, acquiring scene images again for error analysis; if the requirements are met, the assembly navigation ends; otherwise, compensation is performed through step-by-step movement until the error tolerance is met. This solution relies on manual attachment of targets to the passive assembly end for endpoint marking and is geared towards small-batch precision assembly scenarios. Pencil assembly lines require the assembly of dozens to hundreds of pencils per minute, making it impossible to attach targets to each pencil individually, thus lacking economic feasibility for application in pencil production lines.

[0009] Publication No. CN114952832A discloses a robotic arm assembly method and device based on monocular six-degree-of-freedom object pose estimation. The method includes: acquiring an actual image of the target object; inputting the actual image into a pre-trained six-degree-of-freedom object pose regression network to obtain the actual six-degree-of-freedom pose of the target object; determining the target grasping and placement actions based on the actual six-degree-of-freedom pose, and determining the target object's target six-degree-of-freedom rotation and translation actions based on the target object's initial pose and target pose; simultaneously performing the grasping and placement actions or the target six-degree-of-freedom rotation and translation actions while performing three-axis correction operations with other target objects on the plane, so as to perform assembly actions on the target object and other target objects according to the target pose. Before acquiring the actual image, a three-dimensional object model of the target object needs to be established, and the object surface is resampled to obtain a point cloud model. Multiple training and verification images are acquired based on the point cloud model to train a 2D object detection network and a six-degree-of-freedom object pose regression network. This solution uses a deep learning network to regress the 6DoF pose of the target object end-to-end. However, it is designed for general objects in robotic arm assembly scenarios, requiring the pre-establishment of a 3D model of the target object and training of a dedicated network. It is not suitable for slender rods like pencils, where the dimensions of the incoming material vary with tolerances and the surface texture and groove distribution of each rod have random differences. Furthermore, it does not involve using the geometric reference parameters preset by the assembly positioning mechanism and the known cross-sectional dimensions of the pencil rod to derive depth information.

[0010] Publication No. CN114463425B discloses a workpiece positioning method based on binocular vision without manual markers. This method extracts surface line segments from workpiece images using probabilistic Hough line detection, removes interference, fits lines using the least squares method to find the intersection points as positioning points, and then obtains workpiece depth information using a binocular stereo vision system. This method directly acquires depth using a binocular vision system, avoiding the derivation of depth information using known cross-sectional dimensions of the workpiece and geometric reference parameters of the positioning mechanism under monocular conditions. It also avoids the strategy of classifying workpiece visual features according to physical function and independently solving for their corresponding degrees of freedom. However, the surface of a pencil barrel simultaneously contains the edges of the positioning groove for the lead core, the grip groove, and the wood grain texture. Hough line detection would extract all three types of edges mixed together, making effective differentiation impossible.

[0011] Publication number CN105913417B discloses a monocular vision positioning method based on perspective projection lines and geometric constraints. This method utilizes spatial geometric constraints between four non-coplanar feature points to establish an optimal objective function for solving coordinates, and completes pose calculation through perspective projection lines. This method leverages general spatial geometric constraints between non-coplanar feature points, and does not involve mechanical contact constraints formed by the workpiece cross-section and the side walls of the positioning mechanism, nor does it involve deriving depth information by substituting the known cross-sectional radius of the workpiece and the included angle between the side walls of the positioning mechanism into specific geometric relationships, nor does it involve a combined lighting scheme designed for the specific optical characteristics of the workpiece surface.

[0012] Publication No. CN118682459A discloses an automated control method for assembling slender cylindrical segments based on a linear guide rail-type attitude adjustment mechanism and vision measurement assistance. The method includes: constructing a global coordinate system for the docking of slender cylindrical segments; establishing a base coordinate system based on the guide rail and a cylindrical segment coordinate system based on the docking end face of the segments; importing the established coordinate system results into automated control software and starting automated assembly; solving the pose transformation of the cylindrical segment coordinate system in real time; determining the current assembly state based on a state recognition method; solving for attitude adjustment parameters based on the pose data; and sending the data to the lower-level controller to initiate docking. The vision measurement assistance equipment consists of a camera, a measuring light pen, and marker points, and uses machine vision technology to obtain the spatial coordinate positions of the measurement points. In specific implementation, the cylindrical segment to be assembled needs to be placed on the attitude adjustment platform, multiple tracking marker points are pasted on the side of the segment, the initial data of the marker points is collected, and then the pose data of the marker points is captured in real time by the tracking measurement equipment, and the pose transformation of the cylindrical segment coordinate system is solved. This solution is designed for docking slender cylindrical sections in the aerospace field. It requires manual application of tracking markers to the side of the cylindrical section and is not suitable for products like pencils, which require positioning for each pencil and are produced in large quantities.

[0013] In the engineering practice of automatic pencil assembly equipment, the V-shaped positioning groove structure has long been used as a mechanical self-centering mechanism for pencil barrels. Its geometric parameters are only used for mechanical positioning in the existing technology and have not yet been used as known constraints for visual pose calculation.

[0014] In summary, the aforementioned existing technologies share the following common problems: First, purely mechanical positioning solutions cannot detect deviations in the orientation of incoming materials. The cross-sectional dimensions and straightness of pencil rods have inherent tolerances, and the surface coating thickness also fluctuates. Purely mechanical solutions use uniform clamping and pushing parameters for all pencil rods, making it impossible to adaptively compensate for the actual geometric state of each individual rod.

[0015] Second, the imaging and feature extraction strategies of existing visual alignment schemes are not applicable to pencil barrels. The surface of a pencil barrel simultaneously contains the edges of the positioning groove for the lead core, the grip groove, and the wood grain edge. General edge detection algorithms extract these three types of edges in a mixed manner, making it impossible to effectively distinguish them. Precision assembly visual guidance schemes rely on the pasting of targets or markers, which cannot meet the cycle time and cost requirements of pencil production lines.

[0016] Third, existing visual pose estimation schemes do not utilize the geometric reference parameters preset by the assembly positioning mechanism and the known cross-sectional dimensions of the pencil rod to derive depth information. Under monocular camera conditions, obtaining the translational component in the depth direction is an inherent challenge in pose estimation. General solutions either rely on depth cameras, end-to-end regression through deep learning networks, or measurement aided by manual markers, none of which are suitable for the cost constraints and cycle time requirements of pencil production lines.

[0017] Fourth, in multi-station assembly scenarios, there is a lack of a real-time unified coordinate system mechanism. Pencil assembly involves multiple consecutive stations, and the vision system at each station is only statically calibrated once during equipment installation. Wear and thermal deformation during long-term operation cause coordinate system drift, and small errors at the previous station are amplified step by step by subsequent stations. Summary of the Invention

[0018] Given the problems of existing technologies such as inability to detect material pose deviation, poor feature extraction anti-interference ability, high cost of monocular depth information acquisition, and lack of real-time unified coordinate system for multi-stations, a vision-guided positioning system and method for automatic pencil assembly are proposed.

[0019] Its purpose is to solve the core problems of pure mechanical positioning being unable to detect incoming material pose deviations, the poor anti-surface interference capability of general vision algorithms, the high cost of monocular depth information acquisition, and the accumulation of assembly errors over time in multi-station assembly. It aims to achieve rapid and accurate calculation of the six-DOF spatial pose of pencil rods using only a single low-cost industrial camera, guiding the actuator to complete high-precision alignment and assembly. At the same time, it has the capabilities of adaptive compensation for incoming material size, anti-interference of surface grooves, real-time unification of multi-station coordinate systems, and online confirmation of assembly quality. Under the premise of meeting the requirements of high cycle time and low-cost mass production of pencil production lines, it significantly improves the assembly success rate and product consistency, reduces equipment maintenance costs, and enhances the flexibility of the production line.

[0020] The technical solution of this invention is a visual guidance and positioning method for automatic pencil assembly, comprising: Take images of a pencil-like slender rod-shaped workpiece in a V-shaped assembly positioning mechanism, and read the position of the pre-calibrated reference line in the spatial coordinate system and the included angle between the two positioning side walls of the V-shaped assembly positioning mechanism. The reference line extends along the axial direction of the pencil-like slender rod-shaped workpiece and is a geometric reference axis formed by the intersection of the theoretically extended surfaces of the two side walls.

[0021] The longitudinal edge information representing the axial direction, the end face contour information representing the end face position, and the surface texture information representing the angle around the axis are extracted respectively.

[0022] Extract the vertical edge line segments on both sides of the pencil-like slender rod-shaped workpiece from the vertical edge information, determine the projection direction of the axis of the pencil-like slender rod-shaped workpiece in the image plane, and combine the position of the reference line in the spatial coordinate system to determine the pitch and horizontal deflection angles of the axis of the pencil-like slender rod-shaped workpiece in the spatial coordinate system.

[0023] Extract the contour curve of the end face of the pencil-like slender rod-shaped workpiece from the end face contour information, determine the coordinates of the end face center in the image plane, and combine the included angle between the two positioning sidewalls and the spatial position of the reference line to determine the first translation component and the second translation component of the end face center in the spatial coordinate system along the width and height directions of the V-shaped assembly positioning mechanism.

[0024] Based on the cross-sectional dimensions of the pencil-like slender rod-shaped workpiece and the included angle between the two positioning sidewalls, a contact constraint relationship is established between the cross-section of the pencil-like slender rod-shaped workpiece and the two sidewalls of the V-shaped assembly positioning mechanism. Based on the contact constraint relationship, the distance from the center of the cross-section of the pencil-like slender rod-shaped workpiece to the reference line is determined. Then, combined with the pitch angle, horizontal deflection angle, first translation component, and second translation component, the depth translation component along the axial direction of the end face center of the pencil-like slender rod-shaped workpiece is determined based on the geometric position constraint relationship corresponding to the contact constraint relationship.

[0025] The pitch angle, horizontal yaw angle, first translation component, second translation component, and depth translation component are combined to generate spatial pose parameters for driving the motion compensation of the actuator.

[0026] Furthermore, when generating spatial pose parameters by combining pitch angle, horizontal yaw angle, first translation component, second translation component, and depth translation component, the rotation angle value around the axis calculated from the pencil shaft surface texture features extracted from the surface texture information is also combined to generate six-degree-of-freedom spatial pose parameters for driving the motion compensation of the actuator.

[0027] Furthermore, when extracting the longitudinal edge straight segments, the lead core positioning groove area is determined based on the directional continuity and spatial extension characteristics of the continuous bright lines formed by the mirror reflection of the sidewall of the lead core positioning groove; edge segments are formed by connecting edge points with the same direction within the lead core positioning groove area; wood texture edges and grip groove edges are filtered based on the continuous length of the edges; edge segments with a continuous length exceeding a preset threshold are taken as longitudinal edge straight segments, while wood texture edge segments and grip groove edge segments with a continuous length shorter than the preset threshold are filtered out.

[0028] Furthermore, for the slender, rod-shaped workpiece resembling a pencil, when photographing the pencil shaft, the light source at the bottom of the V-shaped assembly positioning mechanism is illuminated, projecting parallel light upwards to form backlit enhanced edge feature areas on both sides of the pencil shaft; an obliquely incident ring light source is illuminated, illuminating the pencil shaft from above the side at an angle of 25 to 35 degrees relative to the horizontal plane containing the pencil shaft axis, causing the lead core positioning groove sidewall on the surface of the pencil shaft to form a continuous bright line of specular reflection, while the wood grain and grip groove form diffuse reflection.

[0029] Furthermore, after capturing the pencil shaft image, the end face contour is fitted with a circle and the fitting residual is calculated. The cross-sectional shape is determined based on the fitting residual: if the fitting residual is lower than the first threshold, it is determined to be a circular cross-section, and a circular cross-section template is called; if the fitting residual is higher than the first threshold, it is determined to be a hexagonal cross-section, and a polygonal cross-section template is called. A parameter template matching the cross-sectional specifications is called from the parameter template library. The parameter template library pre-stores the cross-sectional shape parameters, cross-sectional size parameters, end face geometric model parameters, and texture feature templates for pencil shafts of different specifications.

[0030] Furthermore, the distance from the center of the pencil shaft cross-section to the reference line is determined based on the geometric relationship between the pencil shaft cross-section dimensions and the angle between the two positioning sidewalls of the V-shaped assembly positioning mechanism.

[0031] Furthermore, on a rotary assembly line with multiple stations, before calculating the spatial pose of a pencil-like slender rod-shaped workpiece, each station takes a picture of the reference marker block in the non-working area of ​​the rotary table after the rotary table rotates to its position, and obtains an image of the reference marker block; using the known dimensions of the crosshairs on the reference marker block and the camera calibration parameters, the translational and rotational deviations between the camera coordinate system and the reference marker block coordinate system of each station are calculated; the pose calculation results of each station are transformed from the camera coordinate system to the reference marker block coordinate system through translation and rotation transformations; the pose calculation results after transformation of the previous station are transferred to the next station; the next station compensates for the deviations of the previous station by superimposing them on its own coordinate system after transformation.

[0032] Furthermore, the spatial pose parameters of the motion compensation of the driving actuator are compared with the pre-calibrated and stored spatial pose data of the target assembly; the spatial coordinates of the center of the end face of the pencil-like slender rod-shaped workpiece and the spatial coordinates of the center hole of the target assembly are calculated in the width direction, height direction and along the axis of the pencil-like slender rod-shaped workpiece of the V-shaped assembly positioning mechanism to obtain the spatial offset; the spatial offset is converted into the motion compensation amount of the actuator in the corresponding direction and output.

[0033] The present invention also provides a vision-guided positioning system for automatic pencil assembly, comprising: The V-shaped assembly positioning mechanism has a preset side wall angle and a reference line. The reference line is a geometric reference axis formed by the intersection of the theoretically extended surfaces of the two side walls, and a light-transmitting structure is provided at the bottom.

[0034] The bottom light source is located below the light-transmitting structure of the V-shaped assembly positioning mechanism, projecting parallel light upwards.

[0035] An obliquely incident light source is positioned above the V-shaped assembly positioning mechanism, illuminating the pencil-like slender rod-shaped workpiece at an incident angle of 25 to 35 degrees relative to the horizontal plane containing the axis of the pencil-like slender rod-shaped workpiece.

[0036] The image acquisition module captures images of a pencil-like slender rod-shaped workpiece in a V-shaped assembly positioning mechanism. It reads the position of the pre-calibrated reference line in the spatial coordinate system and the included angle between the two positioning sidewalls of the V-shaped assembly positioning mechanism. The reference line extends along the axial direction of the pencil-like slender rod-shaped workpiece. The image data and reference line position parameters are output to the information separation module, the axial direction solving module, and the end face position solving module.

[0037] The information separation module receives image data output by the image acquisition module, extracts longitudinal edge information representing the axis direction, end face contour information representing the end face position, and surface texture information representing the angle around the axis, respectively, outputs the longitudinal edge information to the axis direction solving module, and outputs the end face contour information to the end face position solving module.

[0038] The axis direction solving module receives the longitudinal edge information output by the information separation module, extracts the longitudinal edge line segments on both sides of the pencil-like slender rod-shaped workpiece from the image, determines the projection direction of the axis of the pencil-like slender rod-shaped workpiece in the image plane, and, combined with the position of the reference line in the spatial coordinate system, determines the pitch and horizontal deflection angles of the axis of the pencil-like slender rod-shaped workpiece in the spatial coordinate system. The pitch and horizontal deflection angles are then output to the depth derivation module.

[0039] The end face position solving module receives the end face contour information output by the information separation module, extracts the contour curve of the end face of the pencil-like slender rod-shaped workpiece from the image, determines the coordinates of the end face center in the image plane, and, combined with the included angle between the two positioning sidewalls and the spatial position of the reference line, determines the first and second translation components of the end face center in the spatial coordinate system along the width and height directions of the V-shaped assembly positioning mechanism. The first and second translation components are then output to the depth derivation module.

[0040] The depth derivation module receives the pitch and horizontal deflection angles output by the axis direction solution module, and the first and second translation components output by the end face position solution module. Based on the cross-sectional dimensions of the pencil-like slender rod-shaped workpiece and the included angle between the two positioning sidewalls, it establishes the contact constraint relationship between the cross-section of the pencil-like slender rod-shaped workpiece and the two sidewalls of the V-shaped assembly positioning mechanism. Based on the contact constraint relationship, it determines the distance from the center of the cross-section of the pencil-like slender rod-shaped workpiece to the reference line. Then, combining the pitch and horizontal deflection angles, the first and second translation components, it determines the depth translation component along the axis direction of the end face center of the pencil-like slender rod-shaped workpiece based on the geometric position constraint relationship corresponding to the contact constraint relationship. Finally, it outputs the pitch and horizontal deflection angles, the first translation component, the second translation component, and the depth translation component to the pose parameter generation module.

[0041] The pose parameter generation module receives the components output by the depth derivation module and combines the pitch angle, horizontal angle, first translation component, second translation component, and depth translation component to generate spatial pose parameters. When combining the pitch angle, horizontal angle, first translation component, second translation component, and depth translation component to generate spatial pose parameters, the rotation angle value around the axis calculated from the pencil shaft surface texture features extracted from the surface texture information is combined to generate six-degree-of-freedom spatial pose parameters.

[0042] Compared with the prior art, the present invention has the following beneficial effects: 1. This invention uses visual perception to perceive the actual spatial pose of each pencil stick, employs a feature separation-layer solution strategy to calculate each degree of freedom component separately, and derives depth information by combining the contact constraint relationship of the V-shaped assembly positioning mechanism. This enables the generation of personalized motion compensation commands for the actual geometric state of each pencil stick, which helps improve assembly success rate and product consistency, and helps reduce scrap rate.

[0043] 2. This invention categorizes the visual features of the pencil shaft into three types based on their physical function. Utilizing the spatial separation of the end-face contour information and the grip groove, as well as the continuous length differences of the longitudinal edge information, interference is filtered at the algorithmic level through edge continuity constraints. Simultaneously, a combined illumination scheme enhances effective features and suppresses background noise at the imaging level. This dual anti-interference mechanism enables the invention to reliably extract effective features in environments commonly encountered in pencil production lines, such as dust, vibration, and uneven lighting, significantly improving the robustness and effectiveness of pose calculation.

[0044] 3. This invention transforms the mechanical contact constraints of the V-shaped assembly positioning mechanism into geometric constraints for visual pose calculation. Using the known cross-sectional dimensions of the pencil rod and the included angle of the side wall of the positioning mechanism, the depth translation component can be derived through explicit geometric relationships. Six-degree-of-freedom pose calculation can be completed using only a single low-cost industrial camera without the need for additional depth sensing hardware investment. The geometric calculation process has good real-time performance and can be adapted to the assembly cycle requirements of pencil production lines.

[0045] 4. This invention sets up reference marker blocks in the non-working area of ​​the turntable. Each workstation takes a real-time picture of the reference marker blocks after each turntable rotation, calculates the deviation between the current workstation coordinate system and the global reference coordinate system, and forms a compensation chain through a cross-workstation deviation transmission mechanism. This significantly reduces the cumulative effect of errors, helps to extend the equipment calibration cycle, and reduces maintenance costs.

[0046] 5. This invention stores cross-sectional shape parameters, size parameters, geometric model parameters, and texture feature templates for pencil shafts of different specifications through a preset parameter template library. It can automatically call the matching parameter template according to the image processing results. The line changing process only requires switching software parameters, without replacing hardware components such as assembly positioning mechanism, camera, or light source, which can significantly shorten the line changing time and help reduce line changing costs. Attached Figure Description

[0047] Figure 1 This is an overall flowchart of the vision-guided positioning method for automatic pencil assembly according to the present invention. Figure 2 This is a flowchart of the feature separation-layered solution algorithm of the present invention; Figure 3 This is a flowchart of the combined lighting optical path determination process of the present invention; Figure 4 This is a flowchart of the edge extraction and filtering process of the present invention; Figure 5 This is a flowchart of the depth derivation geometric relationship calculation of the present invention; Figure 6 This is a flowchart of the cross-sectional shape determination and parameter calling process of the present invention; Figure 7 This is a flowchart of the real-time unified multi-station coordinate system of the present invention; Figure 8 This is a flowchart illustrating the assembly guidance and quality verification process of the present invention. Detailed Implementation

[0048] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0049] Example 1, referring to Figure 1 - Figure 8This is the first embodiment of the present invention. Taking the assembly of a traditional wooden pencil barrel and eraser tip as an example, this embodiment provides a visual guidance positioning method for automatic pencil assembly.

[0050] This invention uses a pencil shaft as an example workpiece for illustration, but it is also applicable to movable pencil shafts, colored pencil shafts, and other slender rod-shaped workpieces such as pencils that have an axially extending structure and can form a contact constraint relationship in a V-shaped assembly and positioning mechanism.

[0051] The pencil shaft is the main slender rod-shaped component of a pencil. In this invention, "pencil" is used in a broad sense, encompassing both traditional wooden pencils and mechanical pencils.

[0052] In this embodiment, the pencil shaft is made of wood with a circular or hexagonal cross-section. The target assembly is a rubber tip with an aluminum clamp. The rubber tip has a pre-drilled hole in the center. The assembly method is that the end of the pencil shaft passes through the aluminum clamp and is inserted into the pre-drilled hole of the rubber tip to form an interference fit.

[0053] The length of a pencil shaft is typically 175 mm to 180 mm; in this embodiment, it is 180 mm.

[0054] The pencil shaft has a circular cross-section, with common diameter specifications of 6.9 mm or 7.2 mm. The allowable tolerance for the pencil shaft diameter is ±0.2 mm. The pencil shaft is approximately 180 mm long and 7 mm in diameter, with a length-to-diameter ratio of approximately 25:1.

[0055] The surface of the pencil shaft is covered with a paint coating. In the pencil shaft manufacturing process, the paint is usually applied by dip coating or spray coating. After a single coat of paint, the thickness of the paint film will fluctuate within a certain range during the drying and curing process due to the influence of paint viscosity, ambient temperature, and wood absorption rate.

[0056] Pencil barrels typically require multiple coats of paint to achieve the desired finished appearance. The cumulative effect of these coats amplifies the variation in thickness between individual coats. Different manufacturers use different paint formulations and process parameters, resulting in variations in coating thickness. Common total coating thickness ranges, for example, from 20 micrometers to 100 micrometers.

[0057] Some pencil shafts have grip grooves on their surface. Taking commonly available perforated pencils as an example, the depth of these grip grooves is typically 0.8 mm to 1.1 mm, and their diameter is approximately 10 mm. These grip grooves are distributed in the middle section of the pencil shaft, ranging from 30 mm to 120 mm from the end face. The specific location of the grooves on the pencil shaft surface varies depending on the product design.

[0058] Specifically, the method of this embodiment includes the following steps: S1: Take an image of the pencil shaft in the V-shaped assembly positioning mechanism, read the position of the pre-calibrated reference line in the spatial coordinate system and the included angle between the two positioning side walls of the V-shaped assembly positioning mechanism. The reference line is the geometric reference axis formed by the intersection of the theoretically extended surfaces of the two side walls.

[0059] Specifically, the V-shaped assembly positioning mechanism is a mechanism used to receive and initially position the pencil shaft, and it has preset geometric parameters.

[0060] The V-shaped assembly positioning mechanism has a V-shaped or similar self-centering groove cross-section. The pencil rod is stably placed in the V-shaped assembly positioning mechanism under the action of gravity and forms a stable contact constraint relationship with the two side walls. The self-centering characteristic makes the axis of the pencil rod approximately parallel to the extension direction of the V-shaped assembly positioning mechanism.

[0061] The specific structural form of the V-shaped assembly positioning mechanism does not affect the implementation of this method.

[0062] The two side walls of the V-shaped assembly positioning mechanism intersect in space to form a straight line, which extends along the axis of the pencil shaft and is referred to as the reference line below.

[0063] The spatial position of the reference line is determined through offline calibration. The calibration process is as follows: A standard cylindrical calibration part with known cross-sectional dimensions is placed in a V-shaped assembly positioning mechanism. The cross-sectional radius accuracy of the calibration part is higher than the cross-sectional dimension tolerance of the pencil rod. An image of the calibration part in the V-shaped assembly positioning mechanism is taken, and the longitudinal edge straight line segments on both sides of the calibration part are extracted. Combining the known cross-sectional radius of the calibration part and the included angle between the two side walls, the position parameters of the reference line in the spatial coordinate system are calculated and stored through geometric relationships.

[0064] Once calibration is complete, the spatial position of the baseline is stored as a fixed parameter and can be directly accessed during production.

[0065] Under its own weight, the pencil shaft forms two-point contact with the two side walls of the assembly positioning mechanism. The self-centering characteristic of the V-shaped assembly positioning mechanism makes the axis of the pencil shaft approximately parallel to the reference line.

[0066] During image acquisition, a combination of two light sources is used for illumination: The first type of light source: The light source at the bottom of the V-shaped assembly positioning mechanism projects parallel light upwards through the light-transmitting slit at the bottom of the slot, forming backlit enhanced edge feature areas on both sides of the pencil shaft. The edge feature areas have high contrast, which is beneficial for extracting the straight segments of the longitudinal edge. The bottom light source is not limited to LED parallel light; a laser collimated light source or a strip light source with a focusing lens can also be used, as long as it can form parallel or nearly parallel transmitted light to produce a high-contrast edge contour on both sides of the pencil shaft.

[0067] Second type of light source: Reference Figure 3 An obliquely incident ring-shaped LED light source illuminates the pencil shaft from above and to the side. The angle between the incident light and the bottom plane of the V-shaped assembly positioning mechanism groove is 25 to 35 degrees, for example, 30 degrees. The obliquely incident light source is not limited to a ring-shaped LED; strip-shaped LED light sources or fiber optic light sources distributed on both sides of the pencil shaft can also be used. The installation position and emission angle of the light source should meet the requirement that the incident light is within the range of 25 to 35 degrees.

[0068] According to the geometric optics law of reflection, the intensity of the reflected light from the sidewall is greatest when the angle between the incident ray and the sidewall of the lead core positioning groove is close to the mirror reflection angle.

[0069] When the incident angle is less than 25 degrees, the direction of the specular reflection light on the side wall of the lead core positioning groove is close to the direction of the background stray light, making it difficult to distinguish; when the incident angle is greater than 35 degrees, the angle between the incident light and the surface of the pencil shaft increases, and the intensity of diffuse reflection light generated by wood grain and surface defects increases significantly.

[0070] An angle range of 25 to 35 degrees can ensure the intensity of mirror reflection from the sidewall of the lead core positioning groove while suppressing diffuse reflection interference from the wood grain.

[0071] Within this angular range, the two sidewalls of the lead core positioning groove on the pencil shaft surface produce specular reflection, forming two continuous high-brightness feature lines in the image. The wood grain and the grip groove on the shaft surface produce diffuse reflection, forming randomly distributed, discontinuous bright spots or dark areas in the image. The combined use of these two light sources creates contrast differences between the edge of the lead core positioning groove and the wood grain and grip groove at the imaging level, reducing the difficulty of subsequent feature extraction.

[0072] S2: Reference Figure 2 The longitudinal edge information used to characterize the axis direction, the end face contour information used to characterize the end face position, and the surface texture information used to characterize the angle around the axis are extracted respectively. The longitudinal edge line segments on both sides of the pencil shaft are extracted from the longitudinal edge information to determine the projection direction of the pencil shaft axis in the image plane. Combined with the position of the reference line in the spatial coordinate system, the pitch and horizontal deflection angles of the pencil shaft axis in the spatial coordinate system are determined.

[0073] Specifically, the visual features of the pencil shaft are divided into vertical edge features, end face contour features, and surface texture features according to their physical functions. Only the corresponding degree of freedom components are solved for each type of feature.

[0074] The longitudinal edge feature is only used to determine the direction of the pencil shaft axis, the end face contour feature is only used to determine the position of the center of the pencil shaft end face in the plane, and the surface texture feature is only used to determine the angle of rotation of the pencil shaft around its own axis.

[0075] The strategy of first separating features according to physical function and then solving each degree of freedom component layer by layer is called feature separation-layer solution.

[0076] The feature separation-layer solution strategy reduces interference from wood grain and grip grooves, which stems from the geometric properties of the pencil shaft itself.

[0077] The longitudinal edge information extends continuously along the axis of the pencil shaft, with an effective length of about half the length of the pencil shaft. The grip groove only causes local loss in the longitudinal edge information, and has a limited impact on the overall straight line fitting.

[0078] The end face profile information is located at the end of the pencil shaft, while the grip groove is located in the middle section of the pencil shaft. The two are completely separated in space, and the end face profile information is not affected by the groove on the shaft surface.

[0079] Regardless of the configuration of the imaging light source, even under imaging conditions without using a combined illumination scheme, the feature separation-layer solution strategy can still reduce the interference of wood texture and grip groove on pose calculation.

[0080] Reference Figure 4 Based on the directional continuity and spatial extension characteristics of the continuous bright lines formed by the specular reflection of the sidewalls of the lead core positioning groove on the pencil shaft surface, the approximate area of ​​the lead core positioning groove can be quickly located. The high-brightness characteristic lines presented by the two sidewalls of the lead core positioning groove under oblique incident light have directional continuity and spatial extension. The directions of the two bright lines are concentrated within a specific angle range and are approximately symmetrical about the center of the lead core positioning groove.

[0081] The edge direction of the wood grain is random, and the gradient direction of the edge of the grip groove is local and divergent.

[0082] Within a general area, adjacent edge points with the same direction are connected to form edge segments. Only continuous edge segments with a length exceeding a preset threshold are retained as valid feature edges, while edge segments shorter than the preset threshold are filtered out. This filtering rule is referred to as edge continuity constraint. The preset threshold can be, for example, 20 mm. The bright line formed by the two side walls of the lead core positioning groove is a continuous long line segment. The pencil shaft is about 180 mm long. The lead core positioning groove usually extends from the middle section of the pencil shaft to the end. After removing the non-groove areas at both ends, the effective length of the bright line of the lead core positioning groove can reach about half the length of the pencil shaft, that is, about 90 mm.

[0083] The wood grain consists of irregular short lines, typically only a few millimeters long. The grip groove has a closed circular or elliptical short curve at the edge, with a groove diameter of about 10 millimeters and an edge circumference of about 30 millimeters, much shorter than the effective length of the bright line in the lead core positioning groove.

[0084] In terms of line segment length, the three types of edges show significant differences, and edge continuity constraints can effectively filter wood grain and groove edges.

[0085] Continuous edge segments with lengths exceeding a preset threshold are taken as vertical edge straight line segments, and the projection direction of the pencil shaft axis in the image plane is determined by least-squares straight line fitting.

[0086] Determine the pitch and horizontal deflection angles of the pencil shaft axis in the spatial coordinate system by combining the position of the baseline reference line in the spatial coordinate system.

[0087] S3: Determine the first and second translation components of the end face center in the spatial coordinate system.

[0088] Specifically, after extracting the vertical edge features, the approximate location range of the end face is determined by the endpoint positions of the vertical edges, and the end face contour is extracted within this range.

[0089] For a pencil shaft with a circular cross-section, the end face contour is an arc or a circle. A circle fitting algorithm based on minimizing the sum of squared distances is used to determine the sub-pixel coordinates of the end face center.

[0090] For a pencil rod with a hexagonal cross-section, the end face outline is part of a regular hexagon. Assuming the end face is a regular hexagon, extract the visible side line segments, extend adjacent sides to find the intersection points to restore the vertices of the complete hexagon, and then calculate its geometric center.

[0091] By combining the included angle between the two side walls of the assembly positioning mechanism and the spatial position of the reference line, the first translation component and the second translation component of the end face center in the spatial coordinate system along the width and height directions of the assembly positioning mechanism are determined.

[0092] The end face of the pencil shaft is located at the end of the pencil shaft, and the grip groove on the shaft surface is opened in the middle section of the pencil shaft (ranging from 30 mm to 120 mm from the end face). The end face area retains the complete original cross-sectional profile, and the end face profile features are not affected by the groove on the shaft surface.

[0093] S4: Establish contact constraint relationship based on the cross-sectional dimension parameters of the pencil rod and the included angle between the two positioning sidewalls, determine the distance from the center of the pencil rod cross-section to the reference line, and then determine the depth translation component by combining the pitch angle, horizontal angle, first translation component, second translation component and the geometric position constraint relationship corresponding to the contact constraint relationship.

[0094] Specifically, the pencil shaft has a circular cross-section, and the cross-sectional radius is... The parameters are known. The above geometric relationship is used to characterize the actual mechanical contact state of the pencil shaft in the V-shaped assembly positioning mechanism. When the pencil shaft is placed in the V-shaped assembly positioning mechanism, the circular cross-section forms two-point contact with the two side walls of the V-shaped assembly positioning mechanism. This contact constraint will be referred to as the contact constraint relationship below.

[0095] The included angle between the two side walls of the V-shaped assembly positioning mechanism For known parameters, such as 90 degrees or 120 degrees.

[0096] The position of the reference line in the spatial coordinate system is known.

[0097] Reference Figure 5 The distance from the center of the pencil shaft cross-section to the baseline reference line With the radius of the pencil shaft cross section The included angle between the two side walls of the V-shaped assembly positioning mechanism There are definite geometric relationships between them.

[0098] The center of the circular cross-section and the two contact points form an isosceles triangle, with the vertex angle of the isosceles triangle being... The angle bisector of the vertex angle passes through the center of the cross section and is perpendicular to the reference line, and the two base angles are equal.

[0099] Distance from the center of the cross section to the reference line Let R be the height of the isosceles triangle, and let R be the vertical component of the legs of the isosceles triangle. Using trigonometric relations: in, The radius of the pencil shaft cross-section is retrieved from the parameter template library. It is the included angle between the two sidewalls.

[0100] by It measures 3.45 mm (6.9 mm in diameter). Taking 90 degrees as an example: Approximately 0.707 It is approximately 4.88 millimeters.

[0101] by It measures 3.6 mm (7.2 mm in diameter). Taking 90 degrees as an example, It is approximately 5.09 millimeters.

[0102] This distance In a spatial coordinate system, corresponding to a specific depth constraint, the position of the center of the pencil shaft cross-section in space is restricted to a distance of [distance from the reference line]. On the constraint surface.

[0103] Because the center of the pencil shaft cross-section and the center of the end face have a fixed geometric relationship along the axial direction (both are located on the pencil shaft axis, and the center of the end face is an extension of the center of the cross-section along the axial direction), Substituting the geometric constraints into the camera imaging relationship, and combining the calculated pitch angle, horizontal angle, and the first and second translation components of the end face center, the depth translation component of the end face center can be obtained based on the geometric position constraints corresponding to the contact constraint relationship, thus completing the determination of the spatial coordinates.

[0104] Establish a spatial coordinate system and use the baseline as... axis, The positive direction of the axis is along the axis of the pencil shaft, pointing towards the end face. The width direction of the assembly positioning mechanism is used as... The Z-axis is defined by its height. The origin of the coordinate system is located on the reference line.

[0105] Pencil shaft end face center It is the geometric center point of the end face of the pencil, and its coordinates in the spatial coordinate system are ( ). , , ).in It is along the center of the end face The coordinate values ​​of the axis, i.e., the depth translation component; It is along the center of the end face The coordinate values ​​of the axis, i.e. the first translation component, have been calculated in step S3 by combining the included angle between the two side walls and the spatial position of the reference line; It is along the center of the end face The coordinate values ​​of the axis, i.e. the second translation component, have also been calculated in step S3.

[0106] The direction of the pencil shaft axis in space is determined by two angles: pitch and yaw angles. The pencil shaft axis and The angle between the planes, i.e., the angle between the axis and the plane. Projection on a plane and Angle between axes; horizontal deflection angle The pencil shaft axis and The angle between the planes, i.e., the angle between the axis and the plane. Projection on a plane and The included angle of the axis. and The position of the reference line has been calculated in step S2.

[0107] exist Take the cross section where the reference line is located, and record the intersection of this cross section and the pencil rod as the center of the cross section. Its coordinates are ( , , Because this section is located There is .

[0108] Cross-section center With end face center Both are located on the axis of the pencil shaft, and their coordinate relationship in space is determined by the direction and angle of the axis.

[0109] Based on spatial geometric relationships, the center of the cross section of coordinates and Coordinates and end face center The coordinates of the coordinates have the following relationship: Cross-section center To the baseline, i.e. The distance between the axes is denoted as... Based on the two-point contact geometric relationship established in step S4, trigonometric geometric relationships are used to calculate... .

[0110] Cross-section center arrive Distance of axis equal of coordinates and The square root of the sum of the squares of the coordinates.

[0111] According to the formula for the distance from a point in space to a line, this geometric relationship can be expressed as: Will and Substitute the expression into the left side of the above equation: In this equation, and It has already been solved in step S3. and It has already been solved in step S2. The quantities have been calculated in step S4 and are all known quantities.

[0112] The equation contains only one unknown. Expanding the equation gives a... The standard form of the quadratic equation in one variable is: Solving this quadratic equation, we get The two roots, because the end face of the pencil shaft is located in the assembly positioning mechanism and in front of the camera's field of view, Take the positive value, that is, take the positive root of the two roots, to obtain the depth translation component. The value.

[0113] The above derivation is an exemplary solution method, illustrating the depth translation component. It is possible The solution is obtained by combining the geometric constraints with the already solved angle and translation components. In practical implementation, numerical optimization methods can also be used, utilizing... As a geometric constraint, the depth translation component can be determined based on the geometric position constraint relationship corresponding to the contact constraint relationship, combined with the solved angle and translation components.

[0114] In existing technologies, conventional methods for acquiring depth information in monocular vision-guided assembly include using depth cameras, binocular stereo vision, manual marker-assisted measurement, or deep learning network regression. This method utilizes the contact constraint relationship formed by the pencil rod cross-section and the two side walls of the V-shaped assembly positioning mechanism. The known cross-sectional dimensions of the pencil rod and the included angle parameters of the positioning side walls of the V-shaped assembly positioning mechanism are substituted into geometric relationships to determine the distance from the cross-section center to the reference line. Then, based on the geometric positional constraint relationship corresponding to the contact constraint relationship, the depth translation component is determined.

[0115] The permissible tolerance for the diameter of the pencil shaft is ±0.2 mm. This tolerance range already includes the combined effects of the dimensional tolerance of the wood matrix and the variation in the thickness of the surface coating. The actual cross-sectional radius of the same specification pencil shaft fluctuates between 3.35 mm and 3.55 mm (6.9 mm diameter) or 3.5 mm and 3.7 mm (7.2 mm diameter).

[0116] Cross-sectional radius The tolerance will cause the distance The derived values ​​have a corresponding proportional error.

[0117] With a diameter of 6.9 mm, Taking 90 degrees as an example: when When it is 3.35 mm, Approximately 4.74 millimeters; when When it is 3.55 mm, It is approximately 5.02 mm, with a deviation of approximately ±0.14 mm.

[0118] This is the actual cross-sectional radius of the pencil shaft, encompassing the combined dimensions of the wood matrix and surface coating. This value can be retrieved from the parameter template library as a nominal value as initial input, or it can be corrected using a diameter measurement obtained by fitting the end face profile circle to more accurately reflect the actual cross-sectional dimensions of the current pencil shaft.

[0119] To reduce the impact of cross-sectional size tolerances on the accuracy of depth derivation, the cross-sectional diameter of the pencil shaft is identified after the image of the pencil shaft is captured. The diameter value obtained by fitting the end face contour circle determines whether the current pencil shaft belongs to the 6.9 mm or 7.2 mm specification.

[0120] Specifically, refer to Figure 6 After performing a circular fit on the end face profile, the fitting residual is calculated, and the cross-sectional shape is determined based on the fitting residual. If the fitting residual is lower than the first threshold, it is determined to be a circular cross section, and the circular cross section template is called; if the fitting residual is higher than the first threshold, it is determined to be a hexagonal cross section, and the polygonal cross section template is called.

[0121] The first threshold is pre-calibrated based on the difference in average fitting residuals between a standard circle and a hexagon under the same imaging conditions; for example, it can be set to 0.5 pixels. The element that matches the recognition result is then selected. Substitute the values ​​into the formula to calculate.

[0122] For a pencil rod with a hexagonal cross-section, the distance from the center of the cross-section to the reference line can be determined by the distance between the opposite sides of the hexagon. The included angle between the two side walls of the assembly positioning mechanism Establish equivalent geometric relationships to determine the relationship.

[0123] The contact method of a hexagonal cross-section in an assembly positioning mechanism is similar to that of a circular cross-section. The cross-section forms two-point contact with the two side walls, and the distance from the center of the cross-section to the reference line is... And opposite margin The relationship can be represented as: The calculation principle is the same as for a circular cross-section, with the cross-sectional radius... Replace with half the margin ( That's all.

[0124] In this embodiment, the side spacing is used as the basis for the measurement. 7.0 mm Taking 90 degrees as an example, It is approximately 4.95 millimeters.

[0125] The end face profile is fitted with polygons instead of circles. During fitting, the end face is assumed to be a regular hexagon. After extracting the visible side line segments, the intersection points are obtained by extending adjacent sides to restore the vertices of the complete hexagon, and then its geometric center is calculated.

[0126] S5: Combine the pitch angle, horizontal angle, first translation component, second translation component, and depth translation component to generate spatial pose parameters for driving the actuator motion compensation.

[0127] Each degree of freedom component is obtained in the same spatial coordinate system, with a reference line as the reference datum. The five components are combined into a pose vector, which is output as the current spatial pose data of the pencil rod.

[0128] Determining the axis direction is the basis for calculating the end face center position and deriving the depth. The derivation of the depth translation component depends on the known pitch angle, horizontal angle, first translation component, and second translation component.

[0129] S6: Reference Figure 8 The spatial pose parameters are compared with the spatial pose data of the target assembly to calculate the spatial offset between the center of the pencil barrel end face and the center hole of the eraser head. The spatial offset is then converted into motion compensation data output of the actuator to guide the actuator to complete the alignment and assembly of the pencil barrel and the eraser head.

[0130] The spatial pose data of the target assembly is pre-determined through calibration and stored as fixed parameters. The spatial coordinates of the center of the pencil barrel end face are compared with the spatial coordinates of the center hole of the eraser tip. The coordinate differences in the width direction, height direction, and along the axis of the pencil barrel of the V-shaped assembly positioning mechanism are calculated to obtain the spatial offset.

[0131] The spatial offset is converted into the motion compensation amount of the actuator in the corresponding direction. The actuator is driven by motion control commands to complete the alignment and insertion assembly of the pencil barrel end and the center hole of the eraser head.

[0132] In the lead core pressing process, the pressing execution component begins to descend from its initial position. When the pressing execution component descends to a preset distance from the lead core positioning groove of the pencil barrel, it triggers the camera to simultaneously capture a frame of image, thereby obtaining the relative position of the lead core positioning groove and the lead core in the image.

[0133] The deviation between the center of the lead core positioning groove and the center of the lead core in the plane is calculated. Before the pressing actuator contacts the lead core, the deviation is converted into a compensation displacement command for the micro-motion platform, which then aligns the lead core with the lead core positioning groove. During the pressing process, a pressure sensor installed inside the pressing head monitors the pressing force in real time. When the pressing force exceeds a preset threshold, a stop command is immediately issued to prevent the lead core from breaking.

[0134] The preset threshold is set according to the lead core diameter and material strength. For a lead core with a diameter of 0.5 mm, the preset threshold can be set, for example, in the range of 1.5 N to 2.0 N. The specific value is adjusted according to the lead core material strength and actual process requirements.

[0135] The standard insertion depth is a known assembly process parameter, and its value is determined based on the diameter of the pencil end and the depth of the center hole of the eraser tip. For example, for a pencil with a diameter of 6.9 mm, the standard insertion depth can be set in the range of 8 mm to 12 mm.

[0136] S7: Obtain the displacement of the assembly actuator and determine whether the assembly is qualified.

[0137] The assembly actuator is equipped with high-contrast visual markers, which are white circles that contrast sharply with the surrounding components. Before the assembly operation is performed, an image is captured to record the initial position of the visual markers.

[0138] After the assembly process is completed, another frame is captured to record the real-time position of the visual markers.

[0139] The spatial displacement is calculated by combining the pixel displacement of visual markers in two frames with camera calibration parameters.

[0140] The displacement of the visual marker point is equal to the actual movement distance of the actuator from the gripping position to the insertion position. Subtracting the known theoretical insertion depth of the pencil end from this distance gives the deviation between the actual insertion depth and the theoretical insertion depth.

[0141] Compare the actual insertion depth with the standard insertion depth to determine whether the assembly is qualified.

[0142] If the deviation exceeds the allowable range, an alarm signal will be generated.

[0143] Example 2, refer to Figure 1 , Figure 2 and Figure 8 This is the second embodiment of the present invention, taking the threaded assembly of the movable pencil barrel and the lead mechanism as an example. This embodiment differs from the first embodiment in that: surface texture features are extracted and the rotation angle around the axis is calculated in step S3; six-degree-of-freedom spatial pose data is output in step S5; and the assembly guidance method in step S6 is threaded connection.

[0144] Specifically, the mechanical pencil barrel is made of plastic or metal, has a circular cross-section, and has internal threads at the end. The lead mechanism assembly has corresponding external threads.

[0145] The assembly method is threaded connection. Before screwing, the starting position of the internal thread of the pen barrel must be aligned with the starting position of the external thread of the pen refill mechanism component. Misaligned threads will lead to assembly failure.

[0146] In step S3, the surface texture features of the pencil shaft are extracted from the image. The surface texture features are only used to solve the rotation angle of the pencil shaft around its own axis.

[0147] The surface of a mechanical pencil is printed with trademarks, specifications, or decorative stripes. These surface texture features are positioned in a fixed position on the circumference of the pencil and have a fixed angular relationship with the starting position of the internal thread of the pencil.

[0148] The position of surface texture features in the image is extracted by template matching or feature point detection algorithms, and the rotation angle of the texture feature center relative to the axis of the pencil is calculated to obtain the rotation angle value around the axis.

[0149] In step S5, the rotation angle value around the axis is fused with the pitch angle, horizontal yaw angle, first translation component, second translation component and depth translation component to output six-degree-of-freedom spatial pose data.

[0150] In step S6, the assembly guidance instructions include: moving the center of the pencil barrel end face to directly above the center hole of the pencil lead mechanism assembly, adjusting the rotation angle of the pencil barrel around the axis to align the starting tooth position of the internal thread with the starting tooth position of the external thread, and controlling the screwing actuator to complete the thread screwing according to the preset torque and screwing depth.

[0151] After the screwing is completed, the screwing depth is confirmed to meet the standard by using the visual marker displacement method in step S7.

[0152] The remaining structure is the same as that in Example 1.

[0153] Example 3, referring to Figure 1 and Figure 7 This is the third embodiment of the present invention. This embodiment takes a rotary assembly line with multiple workstations as an example. The difference between this embodiment and the first embodiment is that a real-time unified correction step of the coordinate system is added before calculating the spatial pose of the pencil rod.

[0154] Specifically, a reference marker block is installed in the non-working area of ​​the turntable. The reference marker block is located between two adjacent workstations and rotates with the turntable. The reference marker block is equipped with a high-precision crosshair, and the center coordinates and direction of the crosshair are known in the reference marker block coordinate system.

[0155] After the turntable has rotated into position and before the assembly action is performed, each workstation takes an image of the reference mark block.

[0156] Based on the position of the crosshair in the image, and using the known actual size of the crosshair and the camera calibration parameters, calculate the translational and rotational deviations between the current station camera coordinate system and the reference marker block coordinate system.

[0157] The pose calculation results of each station are transformed from the camera coordinate system to the reference marker block coordinate system through translation and rotation transformations.

[0158] The pose calculation result corrected by the previous station is transmitted to the next station via the data bus. After completing its own coordinate system correction, the next station then superimposes the deviation data transmitted by the previous station into its positioning calculation, forming a cross-station deviation compensation chain, so that the pose calculation results of each station are unified under the same reference coordinate system. The rest of the structure is the same as that in Embodiment 1.

[0159] Example 4, refer to Figure 1 and Figure 6 This is the fourth embodiment of the present invention, taking the switching of pencil barrel specifications on a pencil production line as an example. This embodiment differs from the first embodiment in that it adds a parameter template library call and cross-sectional shape matching step before step S4.

[0160] Specifically, when the production line needs to switch the specifications of the pencil barrel, for example, from a circular cross-section with a diameter of 6.9 mm to a hexagonal cross-section with a side-to-side distance of 7.2 mm, or from a traditional wooden pencil barrel to a mechanical pencil barrel, the matching parameter template is automatically called from the preset parameter template library based on the current cross-sectional shape and size of the pencil barrel identified by the image processing module.

[0161] The templates stored in the parameter template library include: cross-sectional shape parameters (circle, hexagon), cross-sectional size parameters (diameter, distance between sides), end face geometric model parameters (circle fitting model, polygon fitting model), and texture feature templates (trademark shape template, color band color distribution template).

[0162] The cross-sectional shape parameters determine whether the end face profile curve uses circle fitting or polygon fitting, while the cross-sectional dimension parameters determine the geometric relationships used in the derivation. The values ​​or offset values, the end face geometric model parameters determine the initial parameters and fitting parameter conditions of the fitting algorithm, and the texture feature template determines the matching template used when extracting surface texture features.

[0163] The line replacement process only requires switching software parameters, without replacing hardware components such as the assembly positioning mechanism, camera, or light source.

[0164] The remaining steps are the same as those in Example 1.

[0165] In summary, according to embodiments 1-4, this invention categorizes the visual information of the pencil rod into three types based on its industrial function: longitudinal edge information, end face contour information, and surface texture information. Each type of information is used only to solve for the degree of freedom components corresponding to its physical function. An obliquely incident ring light source is used to create a continuous bright line of mirror reflection on the sidewall of the lead core positioning groove. Based on the directional continuity and spatial extension characteristics of the bright line, the longitudinal edge straight line segment is separated from the image to solve for the axial direction. The end face contour information is used to solve for the position of the end face center plane. Utilizing the contact constraint relationship formed by the pencil rod cross-section and the two side walls of the V-shaped assembly positioning mechanism, the cross-sectional dimension parameters and the included angle of the positioning side walls are substituted into the geometric relationship to derive the depth translation component. In multi-station scenarios, the coordinate systems of each station are unified in real time through a reference marker block. The degree of freedom components are combined to generate spatial pose parameters, guiding the actuator to complete the alignment and assembly of the pencil rod with the target assembly.

[0166] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A vision-guided positioning method for automatic pencil assembly, characterized in that, include: Take an image of a pencil-like slender rod-shaped workpiece in a V-shaped assembly positioning mechanism, read the position of the pre-calibrated reference line in the spatial coordinate system and the included angle between the two positioning side walls of the V-shaped assembly positioning mechanism. The reference line extends along the axial direction of the pencil-like slender rod-shaped workpiece and is a geometric reference axis formed by the intersection of the theoretically extended surfaces of the two side walls. The longitudinal edge information representing the axial direction, the end face contour information representing the end face position, and the surface texture information representing the angle around the axis are extracted respectively. Extract the vertical edge line segments on both sides of the pencil-like slender rod-shaped workpiece from the vertical edge information, determine the projection direction of the axis of the pencil-like slender rod-shaped workpiece in the image plane, and combine the position of the reference line in the spatial coordinate system to determine the pitch and horizontal deflection angles of the axis of the pencil-like slender rod-shaped workpiece in the spatial coordinate system. Extract the contour curve of the end face of the pencil-like slender rod-shaped workpiece from the end face contour information, determine the coordinates of the end face center in the image plane, and combine the included angle between the two positioning sidewalls and the spatial position of the reference line to determine the first translation component and the second translation component of the end face center in the spatial coordinate system along the width and height directions of the V-shaped assembly positioning mechanism. Based on the cross-sectional dimensions of the pencil-like slender rod-shaped workpiece and the included angle between the two positioning sidewalls, establish the contact constraint relationship between the cross-section of the pencil-like slender rod-shaped workpiece and the two sidewalls of the V-shaped assembly positioning mechanism. Based on the contact constraint relationship, determine the distance from the center of the cross-section of the pencil-like slender rod-shaped workpiece to the reference line. Then, combine the pitch angle, horizontal angle, first translation component, and second translation component, and based on the geometric position constraint relationship corresponding to the contact constraint relationship, determine the depth translation component of the end face center of the pencil-like slender rod-shaped workpiece along the axial direction. The pitch angle, horizontal yaw angle, first translation component, second translation component, and depth translation component are combined to generate spatial pose parameters for driving the motion compensation of the actuator.

2. The visual guidance and positioning method for automatic pencil assembly according to claim 1, characterized in that, When generating spatial pose parameters by combining pitch angle, horizontal yaw angle, first translation component, second translation component, and depth translation component, the rotation angle around the axis is calculated from the surface texture features of the pencil shaft extracted from the surface texture information, and then combined to generate six-degree-of-freedom spatial pose parameters for driving the motion compensation of the actuator.

3. The visual guidance and positioning method for automatic pencil assembly according to claim 1, characterized in that, When extracting the longitudinal edge straight line segment, the lead core positioning groove area is determined based on the directional continuity and spatial extension characteristics of the continuous bright line formed by the mirror reflection of the side wall of the lead core positioning groove. Edge segments are formed by connecting edge points with the same direction within the lead core positioning groove area. Wood texture edges and grip groove edges are filtered based on the continuous length of the edges. Edge segments with a continuous length exceeding a preset threshold are treated as longitudinal edge straight segments, while wood texture edge segments and grip groove edge segments with a continuous length shorter than the preset threshold are filtered.

4. The visual guidance and positioning method for automatic pencil assembly according to claim 1, characterized in that, The pencil-like slender rod-shaped workpiece is a pencil rod. When taking an image of the pencil rod, the light source at the bottom of the V-shaped assembly positioning mechanism is lit. The light source projects parallel light upwards, forming backlit enhanced edge feature areas on both sides of the pencil rod. Illuminate the pencil shaft with an obliquely incident ring light source. The light source illuminates the pencil shaft from above the side at an angle of 25 to 35 degrees relative to the horizontal plane where the pencil shaft axis is located. This causes the lead core positioning groove sidewall on the surface of the pencil shaft to form a continuous bright line of mirror reflection, while the wood grain and grip groove form diffuse reflection.

5. The vision-guided positioning method for automatic pencil assembly according to claim 1, characterized in that: After capturing an image of the pencil shaft, a circle is fitted to the end face contour, and the fitting residual is calculated. The cross-sectional shape is then determined based on the fitting residual. If the fitting residual is lower than the first threshold, it is determined to be a circular cross section, and the circular cross section template is called. If the fitting residual is higher than the first threshold, it is determined to be a hexagonal cross section. The polygonal cross section template is called, and the parameter template matching the cross section specification is called from the parameter template library. The parameter template library pre-stores the cross section shape parameters, cross section size parameters, end face geometric model parameters and texture feature templates of different specifications of pencil barrels.

6. A vision-guided positioning method for automatic pencil assembly according to claim 5, characterized in that, The distance from the center of the pencil shaft cross-section to the reference line is determined based on the geometric relationship between the pencil shaft cross-section dimensions and the angle between the two positioning sidewalls of the V-shaped assembly positioning mechanism.

7. The vision-guided positioning method for automatic pencil assembly according to claim 1, characterized in that, On a rotary assembly line with multiple stations, before calculating the spatial pose of a pencil-like slender rod-shaped workpiece, each station takes a picture of the reference mark block in the non-working area of ​​the rotary table after the rotary table rotates into position, and obtains the image of the reference mark block. Using the known dimensions of the crosshairs on the reference marker block and the camera calibration parameters, calculate the translational and rotational deviations between the camera coordinate system and the reference marker block coordinate system at each station; transform the pose calculation results of each station from the camera coordinate system to the reference marker block coordinate system through translation and rotation transformations. Transmit the pose calculation results from the previous workstation to the next workstation; The next workstation compensates for the deviation of the previous workstation by superimposing it on its own coordinate system after the coordinate system transformation.

8. The vision-guided positioning method for automatic pencil assembly according to claim 1, characterized in that, The spatial pose parameters for motion compensation of the drive actuator are compared with the pre-calibrated and stored spatial pose data of the target assembly. The spatial offset is obtained by calculating the spatial coordinate difference between the center of the end face of the pencil-like slender rod-shaped workpiece and the center hole of the target assembly in the width direction, height direction and along the axis of the pencil-like slender rod-shaped workpiece of the V-shaped assembly positioning mechanism. The spatial offset is converted into the motion compensation of the actuator in the corresponding direction.

9. A vision-guided positioning system for automatic pencil assembly, used to implement the vision-guided positioning method for automatic pencil assembly according to claims 1-8, characterized in that, include: The V-shaped assembly positioning mechanism has a preset side wall angle and a reference line. The reference line is a geometric reference axis formed by the intersection of the theoretically extended surfaces of the two side walls, and a light-transmitting structure is provided at the bottom. The bottom light source is located below the light-transmitting structure of the V-shaped assembly positioning mechanism, projecting parallel light upwards; An obliquely incident light source is positioned above the V-shaped assembly positioning mechanism to illuminate the pencil-like slender rod-shaped workpiece at an incident angle of 25 to 35 degrees relative to the horizontal plane containing the axis of the pencil-like slender rod-shaped workpiece. The image acquisition module captures images of a pencil-like slender rod-shaped workpiece in a V-shaped assembly positioning mechanism, reads the position of a pre-calibrated reference line in the spatial coordinate system and the included angle between the two positioning sidewalls of the V-shaped assembly positioning mechanism. The reference line extends along the axial direction of the pencil-like slender rod-shaped workpiece, and outputs the image data and reference line position parameters to the information separation module, the axial direction solving module and the end face position solving module. The information separation module receives image data output by the image acquisition module, extracts longitudinal edge information representing the axis direction, end face contour information representing the end face position, and surface texture information representing the angle around the axis, and outputs the longitudinal edge information to the axis direction solving module and the end face contour information to the end face position solving module. The axis direction solving module receives the longitudinal edge information output by the information separation module, extracts the longitudinal edge straight line segments on both sides of the pencil-like slender rod-shaped workpiece from the image, determines the projection direction of the axis of the pencil-like slender rod-shaped workpiece in the image plane, and, combined with the position of the reference line in the spatial coordinate system, determines the pitch and horizontal deflection angles of the axis of the pencil-like slender rod-shaped workpiece in the spatial coordinate system, and outputs the pitch and horizontal deflection angles to the depth derivation module. The end face position solving module receives the end face contour information output by the information separation module, extracts the contour curve of the end face of the pencil-like slender rod-shaped workpiece from the image, determines the coordinates of the end face center in the image plane, and, combined with the included angle between the two positioning sidewalls and the spatial position of the reference line, determines the first translation component and the second translation component of the end face center in the spatial coordinate system along the width and height directions of the V-shaped assembly positioning mechanism, and outputs the first translation component and the second translation component to the depth derivation module. The depth derivation module receives the pitch and horizontal deflection angles output by the axis direction solution module, and the first and second translation components output by the end face position solution module. Based on the cross-sectional dimensions of the pencil-like slender rod-shaped workpiece and the included angle between the two positioning sidewalls, it establishes the contact constraint relationship between the cross-section of the pencil-like slender rod-shaped workpiece and the two sidewalls of the V-shaped assembly positioning mechanism. Based on the contact constraint relationship, it determines the distance from the center of the cross-section of the pencil-like slender rod-shaped workpiece to the reference line. Then, combining the pitch and horizontal deflection angles, the first and second translation components, it determines the depth translation component along the axis direction of the end face center of the pencil-like slender rod-shaped workpiece based on the geometric position constraint relationship corresponding to the contact constraint relationship. Finally, it outputs the pitch and horizontal deflection angles, the first translation component, the second translation component, and the depth translation component to the pose parameter generation module. The pose parameter generation module receives the components output by the depth derivation module and combines the pitch angle, horizontal angle, first translation component, second translation component and depth translation component to generate spatial pose parameters.

10. A vision-guided positioning system for automatic pencil assembly according to claim 9, characterized in that, When the pose parameter generation module combines pitch yaw angle, horizontal yaw angle, first translation component, second translation component and depth translation component to generate spatial pose parameters, it combines the rotation angle value around the axis calculated from the pencil shaft surface texture features extracted from the surface texture information to generate six-degree-of-freedom spatial pose parameters.

Citation Information

Patent Citations

  • Geometric Constraint Pose Method Based on Perspective Projection Line

    CN105913417B

  • A method for locating workpiece surfaces without feature points based on probabilistic Hough line detection

    CN114463425B

  • Mechanical arm assembling method and device based on monocular six-degree-of-freedom object attitude estimation

    CN114952832A

  • Method for guiding in later stage of coaxial assembly based on machine vision

    CN118617091A

  • Long and thin barrel section assembly automatic control method based on linear guide rail type posture adjusting mechanism and vision measurement assistance

    CN118682459A