A method for positioning deep hole machining of forging spindle

By preprocessing and brightness performance analysis of the images of complex shape forgings, segmenting image blocks and enhancing them, the accuracy of the processing positioning of the deep holes of forgings is solved, and higher positioning accuracy and stability are achieved.

CN119180856BActive Publication Date: 2025-03-04SHAANXI HUAWEI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411690878.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-03-04
Estimated Expiration
2044-11-25

AI Technical Summary

Technical Problem

The prior art is difficult to achieve accurate positioning of deep hole machining in forgings of complex shapes, especially when the forging surfaces have complex textures.

Method used

By preprocessing the forging image, the local similarity of each pixel point is obtained and the image is divided into multiple image blocks. Then, image enhancement is performed based on the brightness performance of the image block, reducing the influence of light sources, and improving positioning accuracy.

Benefits of technology

It improves the accuracy of the processing positioning of the deep hole of the forging spindle, reduces the impact of the light source on image enhancement, and ensures the accuracy of the processing process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119180856B_ABST
    Figure CN119180856B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of image data processing, and more specifically, to a method for positioning deep hole machining of a forging spindle. The method comprises: determining the local similarity of a pixel point in a forging image through the grayscale deviation between the pixel point and the neighboring pixel point and the fluctuation of the neighboring pixel point, dividing the forging image into multiple image blocks, taking the horizontal coordinate mean and the vertical coordinate mean of all the pixel points in the image block as the center coordinate of the image block respectively, obtaining a cluster of angles between the center coordinate and the center coordinates of other image blocks, marking the center coordinate of the image block and the center coordinate of the image block in one of the clusters as a linear group of the image block, determining the linear performance of the linear group; calculating the brightness performance of the image block; and enhancing the forging image based on the brightness performance of each image block to assist in realizing the positioning of deep hole machining of the forging spindle, and effectively improving the accuracy of deep hole machining positioning of the forging spindle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image data processing, and more specifically, to a method for positioning a forging spindle deep hole machining. Background Art

[0002] Forging spindles are metal spindles made by forging process, mainly used to manufacture complex metal parts, such as wheels, general equipment, etc. Forging spindles usually have complex geometric shapes and large sizes. The high precision requirements of deep hole processing put forward higher requirements on the positioning accuracy of processing equipment. Although traditional mechanical positioning methods, such as mechanical fixtures and positioning blocks, can achieve positioning stability, it is difficult to achieve accurate positioning in forgings with complex shapes.

[0003] There are many applications in the prior art that achieve processing positioning through computer vision and image processing technology. For example, a patent application document with publication number CN118247338A discloses a precise positioning method for CNC machine tool processing. The method collects CNC part grayscale images of several parts on the CNC machine tool; performs edge detection on each CNC part grayscale image to obtain several part edge pixel points; obtains several part positioning edge pixel points based on the continuity of the texture distribution of several part edge pixel points in the area around the part edge pixel point; and determines several CNC processing positioning pixel points based on the CNC processing positioning degree of each part positioning edge pixel point to achieve machine tool processing positioning.

[0004] Although the existing technology can achieve precise positioning of machine tool processing to a certain extent, the surface of the forging usually has complex textures, and the accuracy of processing positioning directly based on the original collected images is low.

[0005] Based on this, how to accurately realize the deep hole processing positioning of the forging spindle is a problem that needs to be solved urgently by technical personnel in this field. Summary of the invention

[0006] In order to solve the above technical problem of how to accurately realize the deep hole machining positioning of the forging spindle, the present invention proposes a deep hole machining positioning method for the forging spindle, which comprises the following steps:

[0007] The eight neighboring pixels of each pixel in the forging image are recorded as the neighboring pixels of the pixel, and the local similarity of the pixel is determined by the grayscale deviation between the pixel and the neighboring pixels and the fluctuation of the neighboring pixels; the forging image is divided into multiple image blocks based on the local similarity of each pixel, and the mean of the horizontal coordinate and the mean of the vertical coordinate of all pixels in the image block are respectively used as the central coordinate of the image block, and the cluster of the angle between the central coordinate and the central coordinate of other image blocks is obtained, and the central coordinate of the image block and the central coordinate of the image block in one of the clusters are marked as the linear group of the image block, and the mean of the Euclidean distance between each central coordinate in the linear group and the central coordinate fitting line of the linear group is obtained, and the negative of the mean is used as the exponent of the exponential function with e as the base to obtain the linear performance of the linear group; the brightness performance of the image block is calculated: ; In the formula, Indicates The brightness of each image block is Indicates The grayscale mean of all pixels in an image block is Indicates The mean linear performance of all linear groups of image blocks, represents a linear normalization function; the forging image is enhanced based on the brightness of each image block to assist in the positioning of the forging spindle deep hole processing.

[0008] The present invention enhances the forging image through a histogram equalization algorithm to improve the accuracy of the deep hole machining positioning of the forging spindle. In this process, the present invention takes into account that the forging image is affected by the light source. If the forging image is directly enhanced based on the original collected forging image, it may cause the loss of image details, thereby affecting the accuracy of positioning. Based on this, the present invention obtains the possible degree of influence of the light source by obtaining the grayscale expression and linear expression of each image block in the forging image, and adjusts the grayscale of the image block according to the possible degree of influence of the light source on each image block, thereby reducing the influence of the light source on the forging image enhancement, and effectively improving the accuracy of the deep hole machining positioning of the forging spindle.

[0009] According to a forging spindle deep hole processing positioning method provided by the present invention, the eight neighborhood pixel points of each pixel point in the forging image are recorded as the neighborhood pixel points of the pixel point, and the method also includes: using a camera to collect an RGB image of the forging, and preprocessing the RGB image to obtain the forging image.

[0010] The present invention takes into account that noise or image distortion may exist in the original collected forging image, and therefore improves the quality of the forging image through preprocessing, thereby effectively improving the accuracy of the brightness expression of the image block obtained therefrom.

[0011] According to a forging spindle deep hole machining positioning method provided by the present invention, the local similarity of the pixel points satisfies the relationship:

[0012] ;

[0013] In the formula, Indicates the local similarity of the i-th pixel in the forging image, represents the number of neighboring pixels of the i-th pixel, represents the gray value of the i-th pixel, Represents the gray value of the jth neighboring pixel of the ith pixel, represents the grayscale mean of all neighboring pixels of the i-th pixel, represents the exponential function with base e, Represents the absolute value symbol.

[0014] The present invention provides an accurate method for calculating the local similarity of pixel points. By obtaining the deviation between a pixel point and its neighboring pixel points and the fluctuation between the neighboring pixel points, the local similarity of the pixel points can be accurately obtained.

[0015] According to a forging spindle deep hole processing positioning method provided by the present invention, the forging image is divided into multiple image blocks based on the local similarity of each pixel point, including: recording the area composed of all pixel points in the forging image as the first area, obtaining the maximum local similarity of all pixel points in the first area, calculating the difference value of the local similarity between the pixel point corresponding to the maximum local similarity and its neighboring pixel points, merging the neighboring pixel points corresponding to the difference value less than the preset similarity threshold with the pixel point to obtain the second area, obtaining the difference value of the local similarity between the pixel point in the second area and the neighboring pixel points for comparison, repeating the merging step, and finally obtaining the first image block containing the maximum local similarity; taking other areas in the first area except the first image block as the first area, continuing to merge, and finally dividing the forging image into multiple image blocks.

[0016] According to a forging spindle deep hole machining positioning method provided by the present invention, the clustering cluster for obtaining the angle between the center coordinate and the center coordinate of other image blocks includes: stipulating that the horizontal right direction of the center coordinate is the positive direction, processing the angle between the center coordinate of the image block and the center coordinate of other image blocks through a clustering algorithm, and obtaining multiple clusters.

[0017] According to a forging spindle deep hole processing positioning method provided by the present invention, the forging image enhancement based on the brightness performance of each image block includes: taking the ratio of the grayscale value of a pixel point in the image block to the brightness performance of the image block as the corrected grayscale value of the pixel point to obtain a corrected forging image; and enhancing the corrected forging image by a histogram equalization algorithm to obtain a target forging image.

[0018] The present invention adjusts the grayscale value of an image block by the brightness expression of each image block, thereby effectively reducing the influence of the light source on the forging image enhancement.

[0019] According to a method for positioning deep hole processing of a forging spindle provided by the present invention, the forging image is enhanced based on the brightness performance of each image block to assist in realizing the positioning of the deep hole processing of the forging spindle, including: obtaining the image coordinates of edge pixel points in the target forging image through an edge detection algorithm, and converting the image coordinates into mechanical coordinates; fitting the mechanical coordinates of the edge pixel points to obtain multiple closed curves, and taking the centroid of the closed curve as the geometric center of the closed curve; and using the template matching geometric center to obtain the spindle deflection angle to realize the positioning of the deep hole processing of the forging spindle.

[0020] According to a forging spindle deep hole machining positioning method provided by the present invention, the forging spindle deep hole machining positioning is achieved, and then the forging image and the target forging image are stored in a database.

[0021] The present invention stores the image data, which helps to obtain the quality analysis of the deep hole processing positioning of the forging spindle based on the image data, and prepares for the improvement analysis based on the image data.

[0022] The present invention has the following beneficial effects:

[0023] Based on the above technical scheme, when the present invention realizes the deep hole processing positioning of the forging spindle, the forging image is enhanced by the histogram equalization algorithm to improve the accuracy of the deep hole processing positioning of the forging spindle. In this process, the present invention obtains the grayscale expression and linear expression of each image block in the forging image to obtain the possible degree of influence of the light source, and adjusts the grayscale of the image block according to the possible degree of influence of the light source on each image block, thereby reducing the influence of the light source on the forging image enhancement, and effectively improving the accuracy of the deep hole processing positioning of the forging spindle. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0025] Figure 1 A schematic flow chart of a forging spindle deep hole machining positioning method provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0027] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0028] It should be noted that the surface of forgings usually has a more complex texture. The accuracy of processing positioning directly based on the original collected images is low, and the forging images need to be enhanced.

[0029] The histogram equalization algorithm is a linear enhancement method that globally adjusts the brightness distribution of the image so that the pixel value of each gray level is evenly distributed throughout the image. However, the actual forging image acquired may have uneven brightness distribution caused by the light source. When the histogram equalization algorithm is used to enhance such an image with uneven brightness distribution, the image details will be lost, thus affecting the accuracy of the deep hole machining positioning of the forging spindle.

[0030] Based on this, the embodiment of the present invention discloses a method for deep hole machining positioning of a forging spindle. The method processes the forging image by acquiring the brightness performance in the forging image, so that the processed forging image can be accurately enhanced in the histogram equalization algorithm, thereby effectively improving the accuracy of deep hole machining positioning of the forging spindle. For details, please refer to Figure 1 As shown, Figure 1 A schematic flow chart of a method for deep hole machining and positioning of a forging spindle provided in an embodiment of the present invention, the method comprising the following steps S1 to S4.

[0031] S1: The eight neighboring pixels of each pixel in the forging image are recorded as the neighboring pixels of the pixel, and the local similarity of the pixel is determined by the grayscale deviation between the pixel and the neighboring pixels and the fluctuation of the neighboring pixels.

[0032] It should be noted that forging images usually have complex textures and uneven lighting conditions. Such uneven lighting will produce areas of varying light and dark on the image. In some areas, due to shadows or excessive lighting, the pixels in the local area may show high consistency in brightness, forming locally similar pixels.

[0033] Based on this, the embodiment of the present invention obtains the similarity between each pixel point in the forging image and its neighboring pixel points, divides the areas with higher similarity into the same area, and determines the brightness performance in each area.

[0034] For example, in an embodiment of the present invention, eight neighborhood pixel points of each pixel point in the forging image are recorded as neighborhood pixel points of the pixel point, and the process also includes: using a camera to capture an RGB image of the forging, and preprocessing the RGB image to obtain the forging image.

[0035] Among them, the preprocessing of the RGB image may be image filtering and denoising, image grayscale processing, etc., which may be specifically set according to actual needs, and the embodiment of the present invention does not impose too many restrictions here.

[0036] It is understandable that the number of eight-neighborhood pixel points of some edge pixels is insufficient. For such edge pixels, the number of eight-neighborhood pixel points actually collected is used as the number of neighborhood pixel points of the pixel point.

[0037] After the neighborhood pixels of each pixel are determined based on the above steps, the local similarity of the pixel can be obtained according to the grayscale deviation between the pixel and the neighborhood pixels and the fluctuation of the neighborhood pixels.

[0038] For example, in the embodiment of the present invention, the local similarity of the pixels is determined, and the specific relationship can be as follows:

[0039] ;

[0040] In the formula, Indicates the local similarity of the i-th pixel in the forging image, represents the number of neighboring pixels of the i-th pixel, represents the gray value of the i-th pixel, Represents the gray value of the jth neighboring pixel of the ith pixel, represents the grayscale mean of all neighboring pixels of the i-th pixel, represents the exponential function with base e, Represents the absolute value symbol.

[0041] In the above formula, It represents the absolute value cumulative sum of the grayscale differences between the i-th pixel and its neighboring pixels. The larger the value, the greater the grayscale deviation between the i-th pixel and its neighboring pixels, and the smaller the local similarity of the corresponding i-th pixel. Conversely, the smaller the value, the smaller the grayscale deviation between the i-th pixel and its neighboring pixels, and the greater the local similarity of the corresponding i-th pixel.

[0042] It represents the deviation between the grayscale value of the neighborhood pixels of the ith pixel and the grayscale mean of the neighborhood pixels. The larger the value, the greater the fluctuation of the neighborhood pixels of the ith pixel, and the lower the credibility of the grayscale deviation between the ith pixel and its neighborhood pixels. Conversely, the smaller the value, the smaller the fluctuation of the neighborhood pixels of the ith pixel, and the higher the credibility of the grayscale deviation between the ith pixel and its neighborhood pixels.

[0043] After determining the local similarity of each pixel point based on the above steps, the forging image can be divided into multiple image blocks based on the local similarity of each pixel point, that is, the following steps are performed.

[0044] S2: Segment the forging image into multiple image blocks based on the local similarity of each pixel point, obtain the linear group of the image blocks, and calculate the linear performance of the linear group.

[0045] It should be noted that the uneven illumination of the forging surface will lead to uneven brightness distribution in the forging image. If the entire image is processed directly, the key features cannot be accurately identified.

[0046] Based on this, the embodiment of the present invention can identify image areas with relatively consistent grayscale performance by calculating the local similarity of pixel points, and can segment the forging image by dividing pixel points with a large local similarity into an image block, thereby better analyzing the characteristics of each image block, so that image enhancement can be performed separately for each image block later.

[0047] By way of example, in an embodiment of the present invention, a forging image is segmented into multiple image blocks based on the local similarity of each pixel point, including: recording an area composed of all pixels in the forging image as a first area, obtaining the maximum local similarity of all pixels in the first area, calculating the difference value between the local similarity of the pixel point corresponding to the maximum local similarity and its neighboring pixels, merging the neighboring pixels corresponding to the difference value less than a preset similarity threshold with the pixel point to obtain a second area, obtaining the difference value of the local similarity between the pixel point in the second area and its neighboring pixels for comparison, repeating the merging step, and finally obtaining a first image block containing the maximum local similarity; taking other areas in the first area except the first image block as the first area, continuing to merge, and finally segmenting the forging image into multiple image blocks.

[0048] The preset similarity threshold may be set according to actual needs, and the embodiment of the present invention does not impose too many limitations on this.

[0049] In this way, the embodiment of the present invention can finally segment the forging image into multiple image blocks with similar local similarities by repeating the merging steps.

[0050] It should be further explained that, since light propagates in a straight line in space, especially in a short distance, the straight line form is more obvious. Therefore, the light emitted by the light source will directly hit the metal surface in a certain direction, causing the affected area of ​​the metal surface to be linearly distributed along the direction of the light.

[0051] Based on this, the embodiment of the present invention can determine the linear representation of the image blocks based on the position angle relationship between the image blocks.

[0052] By way of example, in an embodiment of the present invention, when calculating the linear representation of a linear group, the method includes: taking the mean of the horizontal coordinate and the mean of the vertical coordinate of all pixels in an image block as the center coordinate of the image block, respectively, obtaining a cluster of angles between the center coordinate and the center coordinates of other image blocks, marking the center coordinate of the image block and the center coordinate of image blocks in one of the clusters as a linear group of the image block, obtaining the mean of the Euclidean distances between the center coordinates in the linear group and the fitting straight line of the center coordinate of the linear group, using the negative of the mean as the exponent of an exponential function with e as the base, and obtaining the linear representation of the linear group.

[0053] Among them, the smaller the mean Euclidean distance between each central coordinate in the linear group and the central coordinate fitting line of the linear group, the closer the central coordinates in the linear group are to the central coordinate fitting line, the more the central coordinates in the linear group conform to the linear distribution characteristics, and the higher the linear performance of the linear group.

[0054] Specifically, when obtaining the angle between the center coordinates of one image block and the center coordinates of another image block, the ratio of the vertical coordinate difference to the horizontal coordinate difference between the center coordinates of the image block and the center coordinates of another image block can be used as a variable of the inverse tangent function to obtain the angle between the center coordinates of the image block and the center coordinates of another image block.

[0055] By way of example, in an embodiment of the present invention, the clustering of the angle between the center coordinates of the image block and the center coordinates of other image blocks is obtained, including: stipulating that the horizontal right direction of the center coordinate is the positive direction, processing the angle between the center coordinates of the image block and the center coordinates of other image blocks through a clustering algorithm, and obtaining multiple clusters.

[0056] The clustering algorithm may be an iterative self-organizing clustering algorithm, a K-Means clustering algorithm, etc. The clustering algorithm may be specifically set according to actual needs, and the embodiment of the present invention does not impose too many restrictions on this.

[0057] For example, when obtaining the central coordinate fitting line of the linear group, the central coordinates in the linear group can be used as fitting samples, and the fitting samples are processed by the least squares method to obtain the central coordinate fitting line of the linear group.

[0058] The specific step of processing the fitting samples by the least square method to obtain the central coordinate fitting line of the linear group can be achieved by the existing technology, and the embodiment of the present invention will not be described in detail here.

[0059] After the grayscale representation and the linear representation of each image block are respectively obtained based on the above steps, the brightness representation of each image block can be obtained based on the grayscale representation and the linear representation.

[0060] S3: Calculate the brightness performance of the image block.

[0061] It should be noted that since light propagates in a straight line in space, especially in a short distance, the area on the metal surface affected by the light source will be distributed linearly along the direction of the light, and the image block that is more affected by the light source has a higher grayscale value.

[0062] Based on this, after the embodiment of the present invention obtains the grayscale expression and linear expression of each image block respectively through the above steps, the brightness expression of each image block can be accurately obtained through the grayscale expression and linear expression of the image block. The higher the brightness expression, the higher the possibility that the image block is affected by the light source.

[0063] For example, in the embodiment of the present invention, the brightness representation of the image block is calculated by the grayscale representation and linear representation of the image block, and the details can be referred to the following relationship:

[0064] ;

[0065] In the formula, Indicates The brightness of each image block is Indicates The grayscale mean of all pixels in an image block is Indicates The mean linear performance of all linear groups of image blocks, represents the linear normalization function.

[0066] After obtaining the brightness representation of each image block based on the above formula, continue to perform the following steps.

[0067] S4: Forging image enhancement is performed based on the brightness of each image block to assist in the positioning of deep hole processing of the forging spindle.

[0068] It should be noted that after obtaining the brightness performance of each image block based on the above formula, the grayscale value of the image block can be adjusted by the brightness performance of each image block in the forging image before the image enhancement algorithm is processed to adapt to the image enhancement algorithm and retain the image details.

[0069] By way of example, in an embodiment of the present invention, forging image enhancement is performed based on the brightness performance of each image block, including: taking the ratio of the grayscale value of a pixel point in the image block to the brightness performance of the image block as the corrected grayscale value of the pixel point, to obtain a corrected forging image; and enhancing the corrected forging image by a histogram equalization algorithm to obtain a target forging image.

[0070] Specifically, the corrected forging image is enhanced by a histogram equalization algorithm to obtain a target forging image, including: obtaining the number of pixels corresponding to each initial grayscale value in the forging image to obtain a grayscale histogram, and for each initial grayscale value, adding the number of pixels of all previous initial grayscale values ​​and dividing it by the total number of pixels of the forging image to obtain the cumulative distribution value of the initial grayscale value. A cumulative histogram is constructed through the cumulative distribution values ​​of all initial grayscale values ​​to obtain a mapping relationship between the initial grayscale value and the grayscale value after equalization, and grayscale transformation is performed on each pixel of the forging image according to the mapping relationship to obtain a target forging image after equalization.

[0071] Based on the above steps, the corrected forging image is processed so that the grayscale value with a smaller cumulative distribution value is obtained through equalization to obtain a smaller grayscale value, and the grayscale value with a larger cumulative distribution value is obtained through equalization to obtain a larger grayscale value, thereby enhancing the contrast of the forging image and facilitating identification and positioning.

[0072] It should be further explained that the edge detection algorithm can clearly identify the changes of objects in the forging image, thereby determining the shape and position of the object. For the main axis of the forging, the edge is usually a clear and easy-to-distinguish feature.

[0073] Based on this, the embodiment of the present invention uses the edge detection result to realize the positioning of the main axis of the forging.

[0074] By way of example, in an embodiment of the present invention, forging image enhancement is performed based on the brightness performance of each image block to assist in achieving the positioning of deep hole processing of the forging spindle, including: obtaining the image coordinates of edge pixel points in the target forging image through an edge detection algorithm, and converting the image coordinates into mechanical coordinates; fitting the mechanical coordinates of the edge pixel points to obtain multiple closed curves, and taking the centroid of the closed curve as the geometric center of the closed curve; and using the template matching geometric center to obtain the spindle deflection angle to achieve the positioning of the deep hole processing of the forging spindle.

[0075] Specifically, the external parameters and depth information of the shooting camera are obtained, the depth information is used as the Z-axis coordinate of the image coordinate, and the camera coordinate is obtained through the depth information and the image coordinate; then the camera coordinate is converted into the world coordinate, that is, the mechanical coordinate, through the external parameters of the camera.

[0076] The specific steps of converting the image coordinates into the mechanical coordinates can be implemented by the existing technology, and will not be described in detail in the embodiment of the present invention.

[0077] Among them, the edge pixel points of the linear spindle forging can be fitted by the least squares method, and the edge pixel points of the complex-shaped spindle forging can be fitted by the polynomial fitting method; the fitting algorithm can be set according to actual needs, and the embodiment of the present invention does not impose too many restrictions on this.

[0078] It can be understood that when the positioning of the forging spindle deep hole processing is realized based on the above steps, the closed curve obtained by fitting is the edge of the spindle forging. When the spindle deflection angle is obtained by using the template matching geometric center, the geometric center of the template can be rotated to obtain the rotation angle corresponding to the minimum deviation between the geometric center of the template and the geometric center of the spindle forging edge, and the rotation angle is the deflection angle of the forging spindle.

[0079] The template is a pre-set standard processing model, which can be set according to actual needs, and the embodiment of the present invention does not impose too many restrictions on this.

[0080] After the positioning of the forging spindle deep hole processing is achieved based on the above steps, the forging images before and after enhancement can also be stored as a historical record of the forging quality to facilitate subsequent optimization and analysis.

[0081] For example, in an embodiment of the present invention, positioning of deep hole processing of a forging spindle is achieved, and then the method further includes: storing the forging image and the target forging image in a database.

[0082] The implementation method of storing the forging image and the target forging image in the database can be specifically set according to actual needs, and the embodiment of the present invention does not impose too many restrictions on this.

[0083] It can be seen that in the embodiment of the present invention, when realizing the positioning of deep hole processing of forging spindle, the eight neighborhood pixels of each pixel point in the forging image can be recorded as the neighborhood pixels of the pixel point, and the local similarity of the pixel point can be determined by the grayscale deviation between the pixel point and the neighborhood pixels and the fluctuation of the neighborhood pixels; the forging image is divided into multiple image blocks based on the local similarity of each pixel point, and the horizontal coordinate mean and the vertical coordinate mean of all pixels in the image block are respectively used as the center coordinate of the image block, and the clustering cluster of the angle between the center coordinate and the center coordinate of other image blocks is obtained, and the center coordinate of the image block and the center coordinate of the image block in one of the clusters are marked as the linear group of the image block, and the mean of the Euclidean distance between each center coordinate in the linear group and the center coordinate fitting line of the linear group is obtained, and the negative of the mean is used as the exponent of the exponential function with e as the base to obtain the linear performance of the linear group; the brightness performance of the image block is calculated; and the forging image is enhanced based on the brightness performance of each image block to assist in realizing the positioning of deep hole processing of forging spindle.

[0084] In this way, the embodiment of the present invention enhances the forging image through the histogram equalization algorithm to improve the accuracy of the deep hole machining positioning of the forging spindle. In this process, the embodiment of the present invention takes into account that the forging image is affected by the light source. If the enhancement is directly based on the original collected forging image, it may cause the loss of image details, thereby affecting the accuracy of positioning. Based on this, the embodiment of the present invention obtains the possible degree of influence of the light source by obtaining the grayscale expression and linear expression of each image block in the forging image, and adjusts the grayscale of the image block according to the possible degree of influence of the light source on each image block to adapt to the enhancement of the histogram equalization algorithm, which effectively improves the accuracy of the deep hole machining positioning of the forging spindle.

[0085] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for deep hole machining and positioning of a forging spindle, characterized in that: include: The eight neighboring pixels of each pixel in the forging image are recorded as the neighboring pixels of the pixel, and the local similarity of the pixel is determined by the grayscale deviation between the pixel and the neighboring pixels and the fluctuation of the neighboring pixels; The forging image is divided into multiple image blocks based on the local similarity of each pixel point, and the mean value of the horizontal coordinate and the mean value of the vertical coordinate of all the pixels in the image block are respectively used as the central coordinate of the image block, and the cluster of the angle between the central coordinate and the central coordinate of other image blocks is obtained, and the central coordinate of the image block and the central coordinate of the image block in one of the clusters are marked as the linear group of the image block, and the mean value of the Euclidean distance between each central coordinate in the linear group and the central coordinate fitting line of the linear group is obtained, and the negative number of the mean value is used as the exponent of the exponential function with e as the base, and the linear expression of the linear group is obtained; Calculate the brightness performance of the image block: ; In the formula, Indicates The brightness of each image block is Indicates The grayscale mean of all pixels in an image block is Indicates The mean linear performance of all linear groups of image blocks, represents the linear normalization function; Forging image enhancement is performed based on the brightness of each image block to assist in positioning the deep hole machining of the forging spindle; The local similarity of the pixels satisfies the relationship: ; In the formula, Indicates the local similarity of the i-th pixel in the forging image, represents the number of neighboring pixels of the i-th pixel, represents the gray value of the i-th pixel, Represents the gray value of the jth neighboring pixel of the ith pixel, represents the grayscale mean of all neighboring pixels of the i-th pixel, represents the exponential function with base e, Indicates the absolute value symbol; Indicates the deviation between the grayscale value of the neighborhood pixel of the i-th pixel and the grayscale mean of the neighborhood pixel. The larger the value, the greater the fluctuation of the neighborhood pixel of the i-th pixel. On the contrary, the smaller the value is, the smaller the fluctuation of the neighborhood pixels of the i-th pixel is.

2. A forging spindle deep hole machining positioning method according to claim 1, characterized in that: The eight neighboring pixel points of each pixel point in the forging image are recorded as the neighboring pixel points of the pixel point, and the method further includes: The RGB image of the forging is collected by a camera, and the RGB image is preprocessed to obtain the forging image.

3. A forging spindle deep hole machining positioning method according to claim 1, characterized in that: The forging image is segmented into a plurality of image blocks based on the local similarity of each pixel point, including: The area composed of all pixels in the forging image is recorded as the first area, the maximum local similarity value of all pixels in the first area is obtained, the difference value of the local similarity between the pixel corresponding to the maximum local similarity value and its neighboring pixels is calculated, the neighboring pixels corresponding to the difference value less than the preset similarity threshold are merged with the pixel to obtain the second area, the difference value of the local similarity between the pixel in the second area and its neighboring pixels is obtained for comparison, the merging step is repeated, and finally the first image block containing the maximum local similarity value is obtained; the other areas in the first area except the first image block are taken as the first area, and the merging is continued to be performed, and finally the forging image is divided into multiple image blocks.

4. A forging spindle deep hole machining positioning method according to claim 1, characterized in that: The obtaining of the clustering of the angles between the center coordinates and the center coordinates of other image blocks comprises: It is stipulated that the horizontal rightward direction of the center coordinate is the positive direction, and the angles between the center coordinate of the image block and the center coordinates of other image blocks are processed by a clustering algorithm to obtain multiple clusters.

5. The method for deep hole machining and positioning of a forging spindle according to claim 1, characterized in that: The forging image enhancement based on the brightness performance of each image block includes: The ratio of the gray value of the pixel point in the image block to the brightness of the image block is used as the corrected gray value of the pixel point to obtain a corrected forging image; The corrected forging image is enhanced by the histogram equalization algorithm to obtain the target forging image.

6. A forging spindle deep hole machining positioning method according to claim 5, characterized in that: The forging image enhancement based on the brightness performance of each image block to assist in the positioning of the forging spindle deep hole processing includes: The image coordinates of the edge pixels in the target forging image are obtained through the edge detection algorithm, and the image coordinates are converted into mechanical coordinates; the mechanical coordinates of the edge pixels are fitted to obtain multiple closed curves, and the centroid of the closed curve is used as the geometric center of the closed curve; the spindle deflection angle is obtained by template matching the geometric center to realize the positioning of the forging spindle deep hole processing.

7. A forging spindle deep hole machining positioning method according to claim 6, characterized in that: The method for achieving positioning of the forging spindle deep hole processing further includes: The forging image and the target forging image are stored in a database.

Citation Information

Patent Citations

  • Accurate positioning method for numerical control machine tool machining

    CN118247338A

  • Metal fastener corrosion area segmentation method

    CN115294159A

  • Metal electron beam welding defect detection method and system

    CN117576086A