Camshaft pin hole positioning method, system, storage medium and electronic device
By setting up an image acquisition device on the camshaft and using image analysis technology to determine the deviation angle of the pin hole, the problems of low versatility and low efficiency in camshaft pin hole positioning are solved, achieving low-cost and high-efficiency positioning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JIANGXI TONGXIN MACHINERY MFG
- Filing Date
- 2025-07-31
- Publication Date
- 2026-06-26
AI Technical Summary
Existing methods for camshaft pin hole positioning suffer from poor versatility, low efficiency, and high cost. In particular, during camshaft machining, multiple specific positioning devices or complex coordinate system parameter processing are required.
By setting up an image acquisition device on the camshaft, the target image of the camshaft is obtained. The outer contour lines of the shaft and pin hole are determined using a preset algorithm, the deviation angle is calculated, and the orientation of the pin hole is adjusted to achieve positioning. This is simplified to two-dimensional image analysis, reducing the dependence on coordinate system parameters.
It achieves efficient and low-cost camshaft pin hole positioning, applicable to different camshaft models, reducing the need for specific positioning devices and robotic arms, and improving positioning efficiency and versatility.
Smart Images

Figure CN120791361B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of camshaft machining technology, and in particular to a method, system, storage medium, and electronic device for camshaft pin hole positioning. Background Technology
[0002] The camshaft is a core component of a piston engine, responsible for precisely controlling the opening and closing of the valves, directly affecting the engine's power output, fuel efficiency, and smoothness of operation. The manufacturing process of the camshaft involves locating the pin holes on the camshaft and installing the pins.
[0003] In existing technologies, mechanical positioning is typically used for camshaft pin hole positioning. This involves driving the camshaft to rotate via a rotary device and using a specific angular positioning fixture to engage with features on the camshaft to position the pin hole. However, due to differences in the external features and dimensions of camshafts of different models and sizes, mechanically assisted positioning requires designing corresponding positioning devices or structures for different camshaft models. This results in poor versatility and necessitates multiple sets of specific positioning devices in actual production.
[0004] In other assembly fields, there is a method for assembling frame pins using vision positioning. This method calculates the position of the pin holes based on parameters such as the coordinate system of the camera, the coordinate system of the pin holes, and the coordinate system of the assembly robot arm, and then controls the robot arm to assemble the pins. While this method is highly versatile, it requires processing a large number of parameters from different coordinate systems, resulting in a large data processing volume and complex positioning methods, which affects the positioning efficiency of the pin holes. Furthermore, it cannot be directly applied to current camshaft machining plants, requiring additional auxiliary equipment such as robot arms, leading to higher costs. Summary of the Invention
[0005] Based on this, the purpose of this invention is to provide a camshaft pin hole positioning method, system, storage medium, and electronic device, aiming to solve the problem of the lack of a camshaft pin hole positioning method that is versatile, efficient, and low-cost in the prior art.
[0006] A camshaft pin hole positioning method according to an embodiment of the present invention includes:
[0007] A target image of the camshaft is acquired using a preset image acquisition device. The target image includes at least the camshaft shaft and the pin hole with a complete outline. Based on the target image, two parallel outer contour lines along the length of the shaft and the outer contour line of the pin hole are determined.
[0008] Draw a first straight line parallel to the outer contour line and equidistant from the two outer contour lines, and move the first straight line to intersect the outer contour line of the pin hole until the distance between the two intersection points of the first straight line and the outer contour line of the pin hole is maximized to obtain a second straight line.
[0009] A first distance ratio is determined between the distance between the first straight line and the second straight line and the distance between the two outer contour straight lines. Based on the first distance ratio and the diameter of the shaft, the deviation angle of the pin hole is determined by a preset formula so as to adjust the shaft according to the deviation angle.
[0010] In addition, the camshaft pin hole positioning method according to the above embodiments of the present invention may also have the following additional technical features:
[0011] Furthermore, the preset formula is:
[0012]
[0013] in, The diameter of the shaft. For the deviation angle, This is the first distance ratio.
[0014] Furthermore, the target image also includes a cam disposed on the shaft, and the step of determining two mutually parallel outer contour lines along the length direction of the shaft based on the target image includes:
[0015] Select a first partial image within a first preset range of the outer contour of different regions of the shaft within the target image, wherein the different regions include at least the outer contour of the shaft on both sides of the cam;
[0016] Based on the pixel distribution within the first local image, a group of first pixels with the largest color difference from the inner side of the axis and the background pixels of the axis are determined by a preset algorithm.
[0017] Multiple third lines are determined by fitting multiple groups of first pixels respectively, and the parallelism between two corresponding third lines on both sides of the axis is verified to determine multiple pairs of third lines with parallelism less than a first threshold and the corresponding multiple target pixel groups.
[0018] The target pixel groups on both sides of the axis are respectively fitted and connected to determine the outer contour line.
[0019] Further, after the step of fitting and connecting the multiple target pixel groups on both sides of the shaft to determine the outer contour line, the following steps are included:
[0020] Select a second partial image within a second preset range at the pin hole in the target image;
[0021] Based on the pixel distribution within the first local image, a group of second pixels with the largest color difference from the pixels inside and outside the pin hole are determined by a preset algorithm.
[0022] The contour line of the hole to be checked is determined by fitting multiple groups of the second pixel points, and the maximum distance between the two intersection points of the contour line of the hole to be checked and the parallel line of the outer contour line is determined as the first distance value.
[0023] The ratio of the first distance value to the distance between the two outer contour lines is determined as the second distance ratio, and it is determined whether the ratio of the second distance ratio to the third distance ratio is less than a second threshold. The third distance ratio is the ratio of the diameter of the pin hole to the diameter of the shaft.
[0024] If so, then the outline of the hole to be checked is the outer outline of the pin hole.
[0025] Further, the step of determining the deviation angle of the pin hole based on the first distance ratio and the diameter of the shaft using a preset formula, and then adjusting the shaft according to the deviation angle, includes:
[0026] The outer contour line of the cam is determined based on the target image, and the distance between the two intersection points of the second straight line and the outer contour line of the cam is determined as the second distance value;
[0027] The distance between the midpoint between the two intersection points of the second straight line and the outer contour line of the pin hole and any intersection point of the second straight line and the outer contour line of the cam is determined as the third distance value;
[0028] Multiply the ratio of the second distance value to the third distance value by the thickness of the cam to determine the distance of the pin hole from the top or bottom of the cam.
[0029] Further, after determining whether the ratio of the second distance ratio to the third distance ratio is less than the second threshold, the process includes:
[0030] If not, adjust the angle of the auxiliary light illumination and re-acquire the target image to redetermine the outer contour line and the outer contour line of the pin hole based on the new target image.
[0031] Further, the step of determining the deviation angle of the pin hole based on the first distance ratio and the diameter of the shaft using a preset formula, and then adjusting the shaft according to the deviation angle, includes:
[0032] After the axis is adjusted, the target image of the axis is re-acquired to determine whether the first straight line and the second straight line coincide after adjustment;
[0033] If the first straight line and the second straight line coincide, then the shaft is determined to be in place.
[0034] Another object of the present invention is a camshaft pin hole positioning system, the system comprising:
[0035] The contour line determination module is used to acquire a target image of the camshaft through a preset image acquisition device. The target image includes at least the shaft body of the camshaft and the pin hole with a complete contour. Based on the target image, the module determines two parallel outer contour lines in the length direction of the shaft body and the outer contour line of the pin hole.
[0036] The straight line determination module is used to draw a first straight line that is parallel to the outer contour line and is equidistant from the two outer contour lines, and move the first straight line to intersect the outer contour line of the pin hole until the distance between the two intersection points of the first straight line and the outer contour line of the pin hole is maximized to obtain a second straight line.
[0037] The deviation angle determination module is used to determine a first distance ratio between the distance between the first straight line and the second straight line and the distance between the two outer contour straight lines, and to determine the deviation angle of the pin hole according to the first distance ratio and the diameter of the shaft body through a preset formula so as to adjust the shaft body according to the deviation angle.
[0038] This invention acquires a target image of the camshaft by setting up an image acquisition device facing the ground on an existing camshaft pin hole positioning and pin installation device. The pin hole position is then determined based on the contours of the camshaft shaft and pin hole in the target image. Specifically, after acquiring the contour lines on both sides of the shaft and the outer contour line of the pin hole, the orientation angle of the pin hole is difficult to determine directly due to the two-dimensional image. The purpose of pin hole positioning is to determine the current orientation of the pin hole so that the shaft can be rotated to make the pin hole vertically upward. When the pin hole is vertically upward, its axis must be located on a line parallel to the outer contour line and in the middle of the two outer contour lines, i.e., on the first straight line. The position of the target pin hole is determined by determining the first straight line. Furthermore, due to the effect of the two-dimensional image, the pin hole position is determined by the contour lines of the shaft. The contour lines on the left and right sides of the pin hole on the side of the body will be squeezed, causing a dimensional shift, but the position and distance of the upper and lower endpoints will remain unchanged. Then, by translating the first straight line, the second straight line is determined to be the one that intersects the outer contour line of the pin hole and has the largest intersection point. The two intersection points are determined to be the endpoints with unchanged upper and lower positions and distances. The second straight line passing through the two endpoints must intersect the axis of the current pin hole. The distance between the first straight line and the second straight line is the projection of the radius of the shaft body onto the plane of the image under the deviation angle between the current pin hole orientation and the target pin hole orientation. Since the size of the image does not correspond to the actual size, the specific deviation angle can be calculated by determining the first distance ratio between the distance between the first straight line and the second straight line and the distance between the two outer contour lines, and the diameter of the shaft body. Furthermore, by setting up an image acquisition device and performing simple analysis of the target contour line in the image on the existing camshaft positioning structure, the deviation angle of the pin hole can be determined immediately to complete the adjustment and positioning of the pin hole. This method is highly versatile and requires no additional specific positioning device, eliminating the need for coordinate system parameter analysis or transformation. It also boasts high positioning efficiency and only requires the addition of an image acquisition device and a corresponding image analysis device, without the need for enhanced robotic arms or other auxiliary devices, thus minimizing the cost of modifying existing camshaft processing plants. Therefore, this invention solves the problem of the lack of a versatile, efficient, and low-cost camshaft pin hole positioning method in the prior art. Attached Figure Description
[0039] Figure 1 This is a flowchart of the camshaft pin hole positioning method in the first embodiment of the present invention;
[0040] Figure 2 This is a schematic diagram of the camshaft pin hole positioning system in the second embodiment of the present invention;
[0041] Figure 3 This is a schematic diagram of the structure of the electronic device in the third embodiment of the present invention;
[0042] The following detailed description, in conjunction with the accompanying drawings, will further illustrate the present invention. Detailed Implementation
[0043] To facilitate understanding of the present invention, a more complete description will be given below with reference to the accompanying drawings. Several embodiments of the invention are illustrated in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
[0044] It should be noted that when a component is said to be "fixed to" another component, it can be directly on the other component or there may be an intervening component. When a component is said to be "connected to" another component, it can be directly connected to the other component or there may be an intervening component. The terms "vertical," "horizontal," "left," "right," and similar expressions used in this document are for illustrative purposes only.
[0045] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0046] Example 1
[0047] Please see Figure 1 The figure shows a camshaft pin hole positioning method in the first embodiment of the present invention, which specifically includes steps S01-S03.
[0048] S01, acquire a target image of the camshaft using a preset image acquisition device. The target image includes at least the camshaft shaft and a pin hole with a complete outline. Determine two parallel outer contour lines along the length of the shaft and the outer contour line of the pin hole based on the target image.
[0049] As an example, and not a limitation, in some optional implementations, a first partial image within a first preset range of the outer contour of different regions of the shaft within the target image is selected, wherein the different regions include at least the outer contours of the shaft on both sides of the cam; based on the pixel distribution within the first partial image, a plurality of first pixel point groups with the largest color difference from the inner side of the shaft and the background pixels of the shaft are determined by a preset algorithm; a plurality of third straight lines are determined by fitting the plurality of first pixel point groups respectively, and the parallelism between corresponding two third straight lines on both sides of the shaft is verified to determine a plurality of pairs of third straight lines with parallelism less than a first threshold and the corresponding plurality of target pixel point groups; the plurality of target pixel point groups on both sides of the shaft are respectively fitted and connected to determine the outer contour straight line. In a specific implementation, a more complete image is obtained by using light-assisted illumination to ensure image quality and clarity of the contour lines on the camshaft. Under the action of light, the shaft contour and pin hole contour differ significantly from the pixels presented on both sides in the image, and the outer contour straight line of the shaft and the outer contour line of the pin hole can be initially determined by distinguishing the color difference of the pixels. Furthermore, in practice, the outer contour of the shaft body is extracted separately in different regions of the image and then judged in turn to further enhance the accuracy of the outer contour line extraction. The pixels that meet the requirements to form the outer contour line are fitted to obtain the outer contour line of the shaft body with the smallest error and the highest accuracy.
[0050] Further, a second partial image within a second preset range of the pin hole in the target image is selected; based on the pixel distribution in the first partial image, a plurality of second pixel point groups with the largest color difference from the pixels inside and outside the pin hole are determined by a preset algorithm; the plurality of second pixel point groups are fitted to determine the outline of the hole to be checked, and the maximum distance between the two intersection points of the outline of the hole to be checked and the parallel lines of the outer contour line is determined as the first distance value; the ratio of the first distance value to the distance between the two outer contour lines is determined as the second distance ratio, and it is determined whether the ratio of the second distance ratio to the third distance ratio is less than a second threshold, wherein the third distance ratio is the ratio of the diameter of the pin hole to the diameter of the shaft; if yes, the outline of the hole to be checked is the outer contour line of the pin hole. If no, the auxiliary light illumination angle is adjusted, the target image is re-acquired, and the outer contour line and the outer contour line of the pin hole are re-determined based on the new target image. Because the outer contour line of the shaft can be determined by fitting and judging pixels from multiple regions separately, the outer contour line of the shaft has high precision and accuracy. However, due to the size factor of the pin hole, it is impossible to obtain multiple pin hole outer contour lines for mutual fitting in this way. Since the precision of the outer contour line of the shaft is sufficiently guaranteed, the accuracy and precision of the pin hole outer contour line can be judged by the dimensional relationship between the outer contour line and the pin hole outer contour line, thus determining whether the pin hole outer contour line is accurate and improving its precision. If the precision of the current pin hole outer contour line is insufficient, it is very likely due to poor image quality in the pin hole area of the image. Therefore, adjusting the illumination angle of the auxiliary light can improve the image quality in the pin hole area, thereby improving the extraction precision of the pin hole outer contour line.
[0051] S02, draw a first straight line parallel to the outer contour line and equidistant from the two outer contour lines, and move the first straight line to intersect the outer contour line of the pin hole until the distance between the two intersection points of the first straight line and the outer contour line of the pin hole is maximized to obtain the second straight line.
[0052] Specifically, the first straight line and the second straight line are determined by the outer contour line and the outer contour line of the pin hole, respectively. This determines the position of the target pin hole axis on the current image, as well as the position of the actual pin hole axis on the current image. Since the two axes start from the same point when they are rays, the distance between the two straight lines is the projection of one axis onto the vertical plane of the other axis when the length of the two axes is the radius of the shaft. Thus, through this geometric positional relationship, the included angle between the two axes can be accurately obtained by the distance between the two straight lines and the diameter of the shaft.
[0053] S03, determine a first distance ratio between the distance between the first straight line and the second straight line and the distance between the two outer contour straight lines, and determine the deviation angle of the pin hole according to the first distance ratio and the diameter of the shaft body by a preset formula so as to adjust the shaft body according to the deviation angle.
[0054] Specifically, the preset formula is:
[0055]
[0056] in, The diameter of the shaft. For the deviation angle, This is the first distance ratio. It should be noted that under different temperature conditions, thermal expansion necessitates correction of the deviation angle, and the springback of the hole after machining also affects the diameter and position of the hole. Therefore, in practical implementation, the deviation angle needs to be corrected according to the actual parameters of the shaft to further ensure the accuracy of the pin hole positioning. Specifically, existing correction methods can be used to correct for thermal expansion and hole springback.
[0057] Furthermore, step S03 includes: determining the outer contour line of the cam based on the target image, and determining the distance between the two intersection points of the second straight line and the outer contour line of the cam as a second distance value; determining the distance between the midpoint between the two intersection points of the second straight line and the outer contour line of the pin hole and any intersection point of the second straight line and the outer contour line of the cam as a third distance value; multiplying the ratio of the second distance value and the third distance value by the thickness of the cam to determine the distance of the pin hole from the top or bottom of the cam. Since different models and specifications of camshafts need to be adapted, and the pin hole positions on various camshafts have certain deviations, in addition to determining the angular deviation of the pin hole to ensure the pin hole faces vertically upwards, it is also necessary to determine the position of the pin hole on the camshaft so that it is aligned with the pin hole during subsequent pin installation. Therefore, in specific implementation, by determining the relative positional relationship between the pin hole axis and the cam on the shaft body and the actual dimensions of the shaft body, the actual distance between the pin hole and the cam can be accurately determined, thereby determining the accurate displacement for pin installation. Furthermore, since the distance relationship between the two is determined by the second straight line, even if the size changes when the three-dimensional image is converted to the two-dimensional image, the size change on the same straight line is consistent. Therefore, the distance ratio between the two remains unchanged, and the specific position of the pin hole on the shaft can be accurately determined.
[0058] Additionally, after step S03, the process further includes: after the shaft is adjusted, re-acquiring the target image of the shaft to determine whether the first straight line and the second straight line coincide after adjustment; if the first straight line and the second straight line coincide, then the shaft is determined to be in place. To ensure the accuracy of the pin hole positioning and avoid situations where the pin is not properly adjusted during installation, causing the pin to collide with the camshaft, the shaft is corrected by taking an image after adjustment. During correction, only the positional relationship between the first straight line and the second straight line needs to be determined; there is no need to determine the specific deviation angle, thus reducing the workload during correction.
[0059] It should be noted that this solution only requires setting up the image acquisition device to work with the existing camshaft rotation device. The existing camshaft rotation device can adopt a structure that clamps and fixes the rotation at both ends, making it compatible with camshafts of different sizes and more versatile.
[0060] In summary, the camshaft pin hole positioning method in the above embodiments of the present invention acquires a target image of the camshaft by setting an image acquisition device facing the ground on an existing camshaft pin hole positioning and pin installation device. The pin hole position is then determined based on the contours of the camshaft shaft and pin hole in the target image. Specifically, after acquiring the contour lines on both sides of the shaft and the outer contour line of the pin hole, the pin hole orientation angle is difficult to determine directly due to the two-dimensional nature of the image. Since the purpose of pin hole positioning is to determine the current orientation of the pin hole so that the shaft can be rotated to make the pin hole vertically upward, and when the pin hole is vertically upward, its axis must be located on a line parallel to the outer contour line and in the middle of the two outer contour lines, i.e., on the first straight line. Therefore, the position of the pin hole target is determined by determining the first straight line. Furthermore, since the two-dimensional image... The image effect causes the contour lines on both sides of the pin hole on the side of the shaft to be compressed, resulting in a dimensional shift, but the position and distance of the upper and lower endpoints remain unchanged. By translating the first straight line, the second straight line is determined to be the one that intersects the outer contour line of the pin hole and has the largest intersection point. The two intersection points are then identified as the endpoints with unchanged positions and distances. The second straight line passing through the two endpoints must intersect the axis of the current pin hole. The distance between the first and second straight lines is the projection of the shaft radius onto the plane of the image under the deviation angle between the current pin hole orientation and the target pin hole orientation. Since the size of the image does not correspond to the actual size, the specific deviation angle can be calculated by determining the first distance ratio between the distance between the first and second straight lines and the distance between the two outer contour lines, and the diameter of the shaft. Furthermore, by setting up an image acquisition device and performing simple analysis of the target contour line in the image on the existing camshaft positioning structure, the deviation angle of the pin hole can be determined immediately to complete the adjustment and positioning of the pin hole. This method is highly versatile and requires no additional specific positioning device, eliminating the need for coordinate system parameter analysis or transformation. It also boasts high positioning efficiency and only requires the addition of an image acquisition device and a corresponding image analysis device, without the need for enhanced robotic arms or other auxiliary devices, thus minimizing the cost of modifying existing camshaft processing plants. Therefore, this invention solves the problem of the lack of a versatile, efficient, and low-cost camshaft pin hole positioning method in the prior art.
[0061] Example 2
[0062] Please see Figure 2 The diagram shows a structural block diagram of the camshaft pin hole positioning system proposed in the second embodiment of the present invention. The camshaft pin hole positioning system 200 includes: a contour line determination module 21, a straight line determination module 22, and a deviation angle determination module 23, wherein:
[0063] The contour line determination module 21 is used to acquire a target image of the camshaft through a preset image acquisition device. The target image includes at least the shaft body of the camshaft and the pin hole with a complete contour. Based on the target image, it determines two parallel outer contour lines in the length direction of the shaft body and the outer contour line of the pin hole.
[0064] The straight line determination module 22 is used to draw a first straight line that is parallel to the outer contour line and is equidistant from the two outer contour lines, and move the first straight line to intersect the outer contour line of the pin hole until the distance between the two intersection points of the first straight line and the outer contour line of the pin hole is maximized to obtain a second straight line.
[0065] The deviation angle determination module 23 is used to determine a first distance ratio between the distance between the first straight line and the second straight line and the distance between the two outer contour straight lines, and to determine the deviation angle of the pin hole according to the first distance ratio and the diameter of the shaft body by a preset formula so as to adjust the shaft body according to the deviation angle.
[0066] The functions or operation steps implemented by the above modules are largely the same as those in the above method embodiments, and will not be repeated here.
[0067] Example 3
[0068] In another aspect, the present invention also proposes an electronic device, please refer to [link to relevant documentation]. Figure 3 The diagram shows an electronic device according to the third embodiment of the present invention, including a memory 20, a processor 10, and a computer program 30 stored in the memory and executable on the processor. When the processor 10 executes the computer program 30, it implements the camshaft pin hole positioning method as described above.
[0069] In some embodiments, the processor 10 may be a central processing unit (CPU), controller, microcontroller, microprocessor or other data processing chip, used to run program code stored in memory 20 or process data, such as executing access restriction programs.
[0070] The memory 20 includes at least one type of readable storage medium, such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 20 can be an internal storage unit of an electronic device, such as the hard disk of the electronic device. In other embodiments, the memory 20 can also be an external storage device of the electronic device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. Furthermore, the memory 20 can include both internal and external storage units of the electronic device. The memory 20 can be used not only to store application software and various types of data of the electronic device, but also to temporarily store data that has been output or will be output.
[0071] It should be pointed out that, Figure 3 The structure shown does not constitute a limitation on the electronic device. In other embodiments, the electronic device may include fewer or more components than shown, or combine certain components, or have different component arrangements.
[0072] This invention also proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the camshaft pin hole positioning method described above.
[0073] Those skilled in the art will understand that the logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can mean any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0074] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0075] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0076] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0077] The above embodiments merely illustrate several implementation methods of the present invention, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this patent should be determined by the appended claims.
Claims
1. A method for locating a camshaft pin hole, characterized in that, The method includes: A target image of the camshaft is acquired using a preset image acquisition device. The target image includes at least the camshaft shaft and the pin hole with a complete outline. Based on the target image, two parallel outer contour lines along the length of the shaft and the outer contour line of the pin hole are determined. Draw a first straight line parallel to the outer contour line and equidistant from the two outer contour lines, and move the first straight line to intersect the outer contour line of the pin hole until the distance between the two intersection points of the first straight line and the outer contour line of the pin hole is maximized to obtain a second straight line. A first distance ratio is determined between the distance between the first straight line and the second straight line and the distance between the two outer contour straight lines. Based on the first distance ratio and the diameter of the shaft, the deviation angle of the pin hole is determined by a preset formula so as to adjust the shaft according to the deviation angle. The target image also includes a cam disposed on the shaft. The step of determining two mutually parallel outer contour lines along the length direction of the shaft based on the target image includes: Select a first partial image within a first preset range of the outer contour of different regions of the shaft within the target image, wherein the different regions include at least the outer contour of the shaft on both sides of the cam; Based on the pixel distribution within the first local image, a group of first pixels with the largest color difference from the inner side of the axis and the background pixels of the axis are determined by a preset algorithm. Multiple third lines are determined by fitting multiple groups of first pixels respectively, and the parallelism between two corresponding third lines on both sides of the axis is verified to determine multiple pairs of third lines with parallelism less than a first threshold and the corresponding multiple target pixel groups. The target pixel groups on both sides of the shaft are respectively fitted and connected to determine the outer contour line; After the step of fitting and connecting the multiple target pixel groups on both sides of the shaft to determine the outer contour line, the following steps are included: Select a second partial image within a second preset range at the pin hole in the target image; Based on the pixel distribution within the first local image, a group of second pixels with the largest color difference from the pixels inside and outside the pin hole are determined by a preset algorithm. The contour line of the hole to be checked is determined by fitting multiple groups of the second pixel points, and the maximum distance between the two intersection points of the contour line of the hole to be checked and the parallel line of the outer contour line is determined as the first distance value. The ratio of the first distance value to the distance between the two outer contour lines is determined as the second distance ratio, and it is determined whether the ratio of the second distance ratio to the third distance ratio is less than a second threshold. The third distance ratio is the ratio of the diameter of the pin hole to the diameter of the shaft. If so, then the outline of the hole to be checked is the outer outline of the pin hole; The preset formula is: in, The diameter of the shaft. For the deviation angle, This is the first distance ratio.
2. The camshaft pin hole positioning method according to claim 1, characterized in that, The step of determining the deviation angle of the pin hole based on the first distance ratio and the diameter of the shaft using a preset formula, and then adjusting the shaft according to the deviation angle, includes the following: The outer contour line of the cam is determined based on the target image, and the distance between the two intersection points of the second straight line and the outer contour line of the cam is determined as the second distance value; The distance between the midpoint between the two intersection points of the second straight line and the outer contour line of the pin hole and any intersection point of the second straight line and the outer contour line of the cam is determined as the third distance value; Multiply the ratio of the second distance value to the third distance value by the thickness of the cam to determine the distance of the pin hole from the top or bottom of the cam.
3. The camshaft pin hole positioning method according to claim 2, characterized in that, The step of determining whether the ratio of the second distance ratio to the third distance ratio is less than the second threshold includes: If not, adjust the angle of the auxiliary light illumination and re-acquire the target image to redetermine the outer contour line and the outer contour line of the pin hole based on the new target image.
4. The camshaft pin hole positioning method according to claim 1, characterized in that, The step of determining the deviation angle of the pin hole based on the first distance ratio and the diameter of the shaft using a preset formula, and then adjusting the shaft according to the deviation angle, includes the following: After the axis is adjusted, the target image of the axis is re-acquired to determine whether the first straight line and the second straight line coincide after adjustment; If the first straight line and the second straight line coincide, then the shaft is determined to be in place.
5. A camshaft pin hole positioning system, characterized in that, For implementing the camshaft pin hole positioning method as described in any one of claims 1 to 4, the system comprises: The contour line determination module is used to acquire a target image of the camshaft through a preset image acquisition device. The target image includes at least the shaft body of the camshaft and the pin hole with a complete contour. Based on the target image, the module determines two parallel outer contour lines in the length direction of the shaft body and the outer contour line of the pin hole. The straight line determination module is used to draw a first straight line that is parallel to the outer contour line and is equidistant from the two outer contour lines, and move the first straight line to intersect the outer contour line of the pin hole until the distance between the two intersection points of the first straight line and the outer contour line of the pin hole is maximized to obtain a second straight line. The deviation angle determination module is used to determine a first distance ratio between the distance between the first straight line and the second straight line and the distance between the two outer contour straight lines, and to determine the deviation angle of the pin hole according to the first distance ratio and the diameter of the shaft body through a preset formula so as to adjust the shaft body according to the deviation angle.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the camshaft pin hole positioning method as described in any one of claims 1 to 4.
7. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the camshaft pin hole positioning method as described in any one of claims 1-4.