Cylinder contour positioning method and system
Through the combination of deep learning-based image segmentation model and two-dimensional homogeneous transformation matrix, accurate pixel-level positioning of the outline of the automobile engine cylinder is achieved, solving the problem of insufficient accuracy in traditional technology, and is suitable for complex image analysis of automated large-scale production lines.
Patent Information
- Application Number
- CN202510227892.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-06-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art is difficult to accurately locate the contours of automobile engine cylinders at pixel level. Traditional machine vision methods do not have enough accuracy in identifying cylinder contours, and it is impossible to accurately identify the contours of engine cylinders in automated mass production lines with complex shapes and frequent positions.
Using a deep learning-based image segmentation model, the cylinder contour reference image and real-time image are generated by obtaining the images of the standard cylinder block and the real-time cylinder block, and the solid segmentation is used using the embedding layer, the encoder layer and the decoder layer, and the rotation and translation transformation are performed by combining the two-dimensional homogeneous transformation matrix to obtain the transformation matrix with the smallest difference for positioning.
It realizes pixel-level accurate recognition of cylinder block profiles, solves the problem of insufficient accuracy of traditional machine vision methods, and is suitable for complex and fine image analysis tasks in automated large-scale production lines.
Smart Images

Figure CN120125664A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of visual inspection of engine blocks, and particularly to a method and system for locating the contour of an engine block. Background Art
[0002] In the production of the automotive industry, intelligence and automation have been widely applied. In the production process of automotive engine blocks, target recognition and defect detection through computer vision technology are conventional production solutions, which can greatly improve production efficiency and reduce production costs. In this process, it is necessary to locate the contour of the automotive engine block in order to accurately know the position of the target and thus perform corresponding operations.
[0003] When locating the contour of an automotive engine block, the contour of the engine block may be very subtle, and in an automated mass production line, the relative positions of each engine block may change significantly. Therefore, it is necessary to accurately locate the contour of the engine block.
[0004] However, it is very difficult to accurately locate the contour image of the engine block at the pixel level. CN118967790A discloses a method for quickly locating the machining surface contour of an engine block cylinder head based on a local area, which uses the Canny algorithm and the Hough transform for contour feature extraction and contour matching. However, this method uses traditional machine vision methods, resulting in insufficient accuracy in contour recognition and being unable to accurately identify the contours of engine blocks with complex shapes and frequent position changes in an automated mass production line. Summary of the Invention
[0005] The object of the present invention is to provide a method and system for locating the contour of an engine block, aiming to solve the problems that it is very difficult to accurately locate the contour image of the engine block at the pixel level, the accuracy of traditional machine vision methods in identifying the contour of the engine block is insufficient, and the contours of engine blocks with complex shapes and frequent position changes in an automated mass production line cannot be accurately identified.
[0006] In view of the above problems, the present application provides a method and system for locating the contour of an engine block.
[0007] In the first aspect disclosed in the present application, a method for locating the contour of an engine block is provided. The method includes the following steps: Step 1: Obtain an image containing a standard engine block and generate a reference image of the engine block contour; Step 2: Obtain an image containing a real-time engine block and generate a real-time image of the engine block contour; Step 3: Input the reference image of the engine block contour and the real-time image of the engine block contour into the engine block image segmentation model in sequence to generate a reference image of the entity segmentation of the engine block contour and a real-time image of the entity segmentation of the engine block contour respectively; Among them, the cylinder block image segmentation model includes an embedding layer, an encoder layer, and a decoder layer, and is used to output a binary image that segments the cylinder block contour entity; Step 4: Define a sequence composed of two-dimensional homogeneous transformation matrices, and the two-dimensional homogeneous transformation matrices in this sequence can perform a combined transformation of rotation and translation of corresponding angles and distances on the cylinder block contour entity in the real-time image of the cylinder block contour entity segmentation; Step 5: Traverse the sequence of two-dimensional homogeneous transformation matrices, sequentially perform transformations on the cylinder block contour entity in the real-time image of the cylinder block contour entity segmentation, and respectively calculate the difference degree between the transformed real-time image of the cylinder block contour entity segmentation and the reference image of the cylinder block contour entity segmentation, and obtain the two-dimensional homogeneous transformation matrix corresponding to the transformation with the smallest difference degree as the positioning matrix; Step 6: Use the positioning matrix to perform a transformation on the reference image of the cylinder block contour entity to achieve positioning in the real-time image of the cylinder block contour.
[0008] Preferably, step 3 specifically includes the following steps: Step 3.1: Gray-scale process the reference image of the cylinder block contour and the real-time image of the cylinder block contour to generate a gray-scale reference image of the cylinder block contour and a gray-scale real-time image of the cylinder block contour; Step 3.2: Input the gray-scale reference image of the cylinder block contour into the embedding layer of the cylinder block image segmentation model. This layer first evenly and non-overlappingly divides the gray-scale reference image of the cylinder block contour to generate a sequence of image patches, and then sequentially projects all the image patches in the sequence of image patches into a low-dimensional vector space through linear projection to generate a sequence of image feature representations; Step 3.3: Input the sequence of image feature representations into the encoder layer of the cylinder block image segmentation model. This layer consists of 4 ordered Transformer blocks. The output of each Transformer block is the input of the next Transformer block. Each Transformer block includes a multi-head self-attention network and a feed-forward neural network; Among them, the Transformer block also includes a residual connection and a layer normalization operation; Step 3.4: Input the output of each Transformer block and the output of the last Transformer block into the decoder layer of the cylinder block image segmentation model. This layer first unifies the dimensions of all the inputs through a multi-layer perceptron module and an upsampling module, and then performs a splicing operation to generate a reference image of the cylinder block contour entity segmentation; Step 3.5: Perform the methods of steps 3.2 to 3.4 on the gray-scale real-time image of the cylinder block contour to generate a real-time image of the cylinder block contour entity segmentation.
[0009] Preferably, the definition of the sequence composed of two-dimensional homogeneous transformation matrices in step 4 specifically includes: Adopt the form of formula (1) as a two-dimensional homogeneous transformation matrix, and The value range of is defined as an integer between -45° and 45°, and The value range of is defined as an integer between -100 and 100. Combine all the values of , and to generate a two-dimensional homogeneous transformation matrix sequence. Among them, represents the rotation angle, represents the number of pixels translated to the right, represents the number of pixels translated downward: Formula (1).
[0010] Preferably, step 5 specifically includes the following steps: Step 5.1: Represent the pixel position of each pixel point that makes up the cylinder block contour entity in the real-time image of the cylinder block contour entity segmentation as , where x and y are the horizontal pixel position and vertical pixel position of each pixel point of the cylinder block contour entity in the real-time image of the cylinder block contour entity segmentation, respectively; Step 5.2: Traverse the two-dimensional homogeneous transformation matrix sequence, and multiply each two-dimensional homogeneous transformation matrix by the pixel position of each pixel point of the cylinder block contour entity in the real-time image of the cylinder block contour entity segmentation, and sequentially perform rotation and translation combined transformations of corresponding angles and distances on the cylinder block contour entity in the real-time image of the cylinder block contour entity segmentation; Step 5.3: Represent the transformed real-time image of the cylinder block contour entity segmentation and the reference image of the cylinder block contour entity segmentation in matrix form, and calculate the sum of the absolute values of the elements of the matrix difference between the two as the difference degree. Obtain the transformation with the smallest difference degree among all the transformations corresponding to the two-dimensional homogeneous transformation matrix sequence, and use the two-dimensional homogeneous transformation matrix corresponding to this transformation as the positioning matrix.
[0011] Preferably, step 6 specifically includes the following steps: Step 6.1: Take the opposite numbers of the rotation angle, the number of pixels translated to the right, and the number of pixels translated downward in the positioning matrix, and multiply them by the pixel position of each pixel point of the cylinder block contour entity in the reference image of the cylinder block contour entity segmentation to transform the cylinder block contour entity in the reference image of the cylinder block contour entity segmentation, where are the horizontal pixel position and vertical pixel position of each pixel point of the cylinder block contour entity in the reference image of the cylinder block contour entity segmentation, respectively; Step 6.2: The cylinder block in the real-time image of the cylinder block contour corresponds one-to-one in position with the cylinder block contour entity in the transformed cylinder block contour entity segmentation reference image, achieving positioning in the real-time image of the cylinder block contour.
[0012] The second aspect disclosed in this application provides a cylinder block contour positioning system for the above-mentioned cylinder block contour positioning method. The system includes: A first image module for acquiring an image containing a standard cylinder block and generating a cylinder block contour reference image; A second image module for acquiring an image containing a real-time cylinder block and generating a cylinder block contour real-time image; An image segmentation module for sequentially inputting the cylinder block contour reference image and the cylinder block contour real-time image into a cylinder block image segmentation model to respectively generate a cylinder block contour entity segmentation reference image and a cylinder block contour entity segmentation real-time image; A matrix generation module for defining a sequence composed of two-dimensional homogeneous transformation matrices, and the two-dimensional homogeneous transformation matrices in this sequence can perform a combined transformation of rotation and translation of corresponding angles and distances on the cylinder block contour entity in the cylinder block contour entity segmentation real-time image; A homogeneous transformation module for traversing the two-dimensional homogeneous transformation matrix sequence, sequentially performing transformations on the cylinder block contour entity in the cylinder block contour entity segmentation real-time image, and respectively calculating the difference degree between the transformed cylinder block contour entity segmentation real-time image and the cylinder block contour entity segmentation reference image, and obtaining the two-dimensional homogeneous transformation matrix corresponding to the transformation with the smallest difference degree as the positioning matrix; A positioning module for using the positioning matrix to transform the cylinder block contour reference image to achieve positioning in the cylinder block contour real-time image.
[0013] The third aspect disclosed in this application provides a computer device including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps of the above-mentioned cylinder block contour positioning method are implemented.
[0014] The fourth aspect disclosed in this application provides a computer-readable storage medium with a computer program stored thereon. When the computer program is executed by a processor, the steps of the above-mentioned cylinder block contour positioning method are implemented.
[0015] The fifth aspect disclosed in this application provides a computer program product including a computer program or instruction. When the computer program or instruction is executed by a processor, the steps of the above-mentioned cylinder block contour positioning method are implemented.
[0016] The beneficial effects of the present invention are as follows: (1) The detection and recognition of the cylinder block contour is carried out by an image segmentation model based on deep learning, realizing the pixel-level accurate recognition of the cylinder block contour and solving the problem of insufficient accuracy in the recognition of the cylinder block contour by traditional machine vision methods.
[0017] (2) The entity segmentation of the cylinder block contour entity in the image is carried out by an image segmentation model based on deep learning, which can accurately recognize the cylinder block contour with complex shapes and frequently changing positions in the automated mass production line, has strong robustness, and is suitable for complex and fine image analysis tasks in the field of engine cylinder block detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0019] Figure 1 It is the overall flowchart of a cylinder block contour positioning method.
[0020] Figure 2 It is the overall structure diagram of a cylinder block contour positioning system. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0021] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0022] Embodiment 1: As Figure 1 shown, the embodiment of the present application provides a cylinder block contour positioning method, and the method includes the following steps: Step 1: Obtain an image containing a standard cylinder block and generate a cylinder block contour reference image; Step 2: Obtain an image containing a real-time cylinder block and generate a cylinder block contour real-time image; Step 3: Input the cylinder block contour reference image and the cylinder block contour real-time image into the cylinder block image segmentation model in sequence to generate a cylinder block contour entity segmentation reference image and a cylinder block contour entity segmentation real-time image respectively; Among them, the cylinder block image segmentation model includes an embedding layer, an encoder layer and a decoder layer, and is used to output a binary image of the segmented cylinder block contour entity; Step 3 specifically includes the following steps: Step 3.1: Grayscale the cylinder block contour reference image and the cylinder block contour real-time image to generate a grayscale cylinder block contour reference image and a grayscale cylinder block contour real-time image; Step 3.2: Input the grayscale cylinder block contour reference image into the embedding layer of the cylinder block image segmentation model. This layer first evenly and non-overlappingly divides the grayscale cylinder block contour reference image to generate a sequence of image patches, and then sequentially projects all the image patches in the sequence of image patches into a low-dimensional vector space through a linear projection to generate a sequence of image feature representations; Step 3.3: Input the sequence of image feature representations into the encoder layer of the cylinder block image segmentation model. This layer consists of 4 ordered Transformer blocks. The output of each Transformer block is the input of the next Transformer block. Each Transformer block includes a multi-head self-attention network and a feed-forward neural network; Among them, the Transformer block also includes a residual connection and a layer normalization operation; Step 3.4: Input the output of each Transformer block and the output of the last Transformer block together into the decoder layer of the cylinder block image segmentation model. This layer first unifies the dimensions of all the inputs through a multi-layer perceptron module and an upsampling module, and then performs a concatenation operation to generate a grayscale cylinder block contour entity segmentation reference image; Step 3.5: Execute the methods of Steps 3.2 to 3.4 on the grayscale cylinder block contour real-time image to generate a cylinder block contour entity segmentation real-time image.
[0023] Specifically, the cylinder block image segmentation model needs to be trained before performing the entity segmentation task. First, establish a dataset, collect cylinder block contour reference images containing various scenarios, and perform instance segmentation image annotation on the cylinder block contour reference images. Convert the images and their corresponding annotation data into a tensor format acceptable to the model; then divide the dataset into a training set, a validation set, and a test set according to a ratio of 8:1:1, and initialize the parameters of the cylinder block image segmentation model. Use pre-trained weights or random initialization methods to initialize the model parameters; finally, determine the learning rate, batch size, and number of training epochs. The learning rate determines the step size of model parameter updates, the batch size affects the training speed and convergence effect of the model, and the number of training epochs determines the number of iterations of model training. The loss function uses the Dice loss function, which is used to measure the difference between the model prediction result and the true annotation, as the optimization target of model training. Select Adam as the optimizer, which is used to update the model parameters according to the gradient of the loss function, and start iterative training within the number of training epochs until the loss function converges.
[0024] Step 4: Define a sequence consisting of two-dimensional homogeneous transformation matrices, and the two-dimensional homogeneous transformation matrices in this sequence can perform combined rotation and translation transformations of corresponding angles and distances on the cylinder block contour entity in the real-time image of the cylinder block contour entity segmentation; Specifically, adopt the form of Equation (1) as the two-dimensional homogeneous transformation matrix, and define to range from an integer between -45° and 45°, and to range from an integer between -100 and 100. Arrange and combine all the values of , and to generate a sequence of two-dimensional homogeneous transformation matrices, where represents the rotation angle, represents the number of pixels translated to the right, represents the number of pixels translated downwards: Equation (1).
[0025] Step 5: Traverse the sequence of two-dimensional homogeneous transformation matrices, sequentially perform transformations on the cylinder block contour entity in the real-time image of the cylinder block contour entity segmentation, and calculate the difference degree between the transformed real-time image of the cylinder block contour entity segmentation and the reference image of the cylinder block contour entity segmentation respectively. Obtain the two-dimensional homogeneous transformation matrix corresponding to the transformation with the smallest difference degree as the positioning matrix; Step 5 specifically includes the following steps: Step 5.1: Represent the pixel position of each pixel point constituting the cylinder block contour entity in the real-time image of the cylinder block contour entity segmentation as , where x and y are respectively the horizontal pixel position and the vertical pixel position of each pixel point of the cylinder block contour entity in the real-time image of the cylinder block contour entity segmentation; Step 5.2: Traverse the sequence of two-dimensional homogeneous transformation matrices, and multiply each two-dimensional homogeneous transformation matrix by the pixel position of each pixel point of the cylinder block contour entity in the real-time image of the cylinder block contour entity segmentation, and sequentially perform combined rotation and translation transformations of corresponding angles and distances on the cylinder block contour entity in the real-time image of the cylinder block contour entity segmentation; Step 5.3: Represent the transformed real-time image of the cylinder block contour entity segmentation and the reference image of the cylinder block contour entity segmentation in the form of matrices, and calculate the sum of the absolute values of the elements of the matrix difference between the two as the difference degree. Obtain the transformation with the smallest difference degree among all the transformations corresponding to the sequence of two-dimensional homogeneous transformation matrices, and use the two-dimensional homogeneous transformation matrix corresponding to this transformation as the positioning matrix.
[0026] Step 6: Use the positioning matrix to perform a transformation on the reference image of the cylinder block contour entity segmentation to achieve positioning in the real-time image of the cylinder block contour.
[0027] Step 6 specifically includes the following steps: Step 6.1: Take the opposite numbers of the rotation angle, the number of pixels translated to the right, and the number of pixels translated down in the positioning matrix, and multiply them with the pixel positions of each pixel of the cylinder block contour entity in the cylinder block contour entity segmentation reference image, so as to transform the cylinder block contour entity in the cylinder block contour entity segmentation reference image, where, are respectively the horizontal pixel position and the vertical pixel position of each pixel of the cylinder block contour entity in the cylinder block contour entity segmentation reference image; Step 6.2: The cylinder block in the real-time cylinder block image corresponds one by one in position to the cylinder block contour entity in the transformed cylinder block contour entity segmentation reference image, realizing the positioning in the real-time cylinder block image.
[0028] In summary, a cylinder block contour positioning method provided by an embodiment of the present application has the following technical effects: (1) Detecting and identifying the cylinder block contour based on the image segmentation model of deep learning realizes the pixel-level accurate identification of the cylinder block contour, and solves the problem that the traditional machine vision method has insufficient accuracy in identifying the cylinder block contour.
[0029] (2) Based on the image segmentation model of deep learning, entity segmentation is performed on the cylinder block contour entity in the image, and the engine cylinder block contour with complex shape and frequent position changes in the automated large-scale production line can be accurately identified, with strong robustness, and is suitable for complex and fine image analysis tasks in the field of engine cylinder block detection.
[0030] Embodiment 2: Based on the same inventive concept as a cylinder block contour positioning method in the foregoing embodiment, as Figure 2 shown, the present application provides a cylinder block contour positioning system, and the system includes: A first image module, which is used to acquire an image containing a standard cylinder block and generate a cylinder block contour reference image; A second image module, which is used to acquire an image containing a real-time cylinder block and generate a cylinder block contour real-time image; An image segmentation module, which is used to input the cylinder block contour reference image and the cylinder block contour real-time image into the cylinder block image segmentation model in sequence, and respectively generate a cylinder block contour entity segmentation reference image and a cylinder block contour entity segmentation real-time image; A matrix generation module, which is used to define a sequence composed of two-dimensional homogeneous transformation matrices, and the two-dimensional homogeneous transformation matrices in the sequence can perform a combined transformation of rotation and translation of corresponding angles and distances on the cylinder block contour entity in the cylinder block contour entity segmentation real-time image; A homogeneous transformation module, which is used to traverse a sequence of two-dimensional homogeneous transformation matrices, sequentially transform the cylinder block contour entities in the real-time image of the cylinder block contour entity segmentation, and respectively calculate the difference degree between the real-time image of the cylinder block contour entity segmentation after transformation and the reference image of the cylinder block contour entity segmentation, and obtain the two-dimensional homogeneous transformation matrix corresponding to the transformation with the smallest difference degree as the positioning matrix; A positioning module, which is used to use the positioning matrix to transform the reference image of the cylinder block contour to achieve positioning in the real-time image of the cylinder block contour.
[0031] Through the foregoing detailed description of a cylinder block contour positioning method in this specification, those skilled in the art can clearly know a cylinder block contour positioning system in this embodiment. Since it corresponds to the method disclosed in the embodiment, the description is relatively simple. For related parts, refer to the description in the method part.
[0032] Embodiment Three: In Embodiment Three, a computer device is provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps of the above-mentioned cylinder block contour positioning method are implemented.
[0033] Embodiment Four: In Embodiment Four, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned cylinder block contour positioning method are implemented.
[0034] Embodiment Five: In Embodiment Five, a computer program product is provided, including a computer program or instruction. When the computer program or instruction is executed by a processor, the steps of the above-mentioned cylinder block contour positioning method are implemented.
[0035] The technical features of the above embodiments can be combined arbitrarily. For the sake of brief description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0036] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to these embodiments shown herein, but will be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A cylinder contour positioning method, characterized in that: The method comprises: Step 1: Acquire an image containing a standard cylinder body and generate a cylinder body contour reference image; Step 2: Acquire an image containing a real-time cylinder body and generate a real-time image of the cylinder body contour; Step 3: Input the cylinder body contour reference image and the cylinder body contour real-time image into the cylinder body image segmentation model in sequence, and generate the cylinder body contour entity segmentation reference image and the cylinder body contour entity segmentation real-time image respectively; Step 4: define a sequence composed of two-dimensional homogeneous transformation matrices, wherein the two-dimensional homogeneous transformation matrices in the sequence can make the cylinder body contour entity in the cylinder body contour entity segmentation real-time image undergo a combined transformation of rotation and translation corresponding to the angle and distance; Step 5: Traverse the two-dimensional homogeneous transformation matrix sequence, transform the cylinder body contour entities in the cylinder body contour entity segmentation real-time image in turn, and calculate the difference between the transformed cylinder body contour entity segmentation real-time image and the cylinder body contour entity segmentation reference image respectively, and obtain the two-dimensional homogeneous transformation matrix corresponding to the transformation with the smallest difference as the positioning matrix; Step 6: Use the positioning matrix to transform the cylinder body contour entity segmentation reference image to achieve positioning in the cylinder body contour real-time image.
2. A cylinder contour positioning method as claimed in claim 1, characterized in that: The step 3 specifically comprises the following steps: Step 3.1: grayscale the cylinder body contour reference image and the cylinder body contour real-time image to generate a cylinder body contour grayscale reference image and a cylinder body contour grayscale real-time image; Step 3.2: Input the cylinder body contour grayscale reference image into the embedding layer of the cylinder body image segmentation model. The layer first divides the cylinder body contour grayscale reference image evenly and without overlapping to generate an image block sequence. Then, all image blocks in the image block sequence are sequentially mapped to a low-dimensional vector space through linear projection to generate an image feature representation sequence. Step 3.3: Input the image feature representation sequence into the encoder layer of the cylinder image segmentation model, which consists of 4 ordered Transformer blocks. The output of each Transformer block is the input of the next Transformer block. Each Transformer block includes a multi-head self-attention network and a feed-forward neural network. Step 3.4: The output of each Transformer block and the output of the last Transformer block are input into the decoder layer of the cylinder image segmentation model. This layer first unifies the dimensions of all inputs through the multi-layer perceptron module and the upsampling module, and then performs a splicing operation to generate a cylinder contour entity segmentation benchmark image; Step 3.5: Execute the methods from step 3.2 to step 3.4 on the cylinder body contour grayscale real-time image to generate a cylinder body contour entity segmentation real-time image.
3. A cylinder contour positioning method as claimed in claim 2, characterized in that: The definition in step 4 is a sequence of two-dimensional homogeneous transformation matrices, specifically including: Use the form of formula (1) as the two-dimensional homogeneous transformation matrix, The value range of is defined as integers from -45° to 45°. and The value range of is defined as integers from -100 to 100. , and All the permutations and combinations of the values of generate a two-dimensional homogeneous transformation matrix sequence, where represents the rotation angle, Indicates the number of pixels to shift to the right, Indicates the number of pixels to translate downward: Formula (1).
4. A cylinder contour positioning method as claimed in claim 3, characterized in that: The step 5 specifically comprises the following steps: Step 5.1: The pixel position of each pixel point that constitutes the cylinder body contour entity in the real-time image of the cylinder body contour entity segmentation is expressed as , where x and y are the horizontal pixel position and vertical pixel position of each pixel point of the cylinder body contour entity in the cylinder body contour entity segmentation real-time image, respectively; Step 5.2: Traverse the two-dimensional homogeneous transformation matrix sequence, multiply each two-dimensional homogeneous transformation matrix by the pixel position of each pixel point of the cylinder contour entity in the cylinder contour entity segmentation real-time image, and perform a combined rotation and translation transformation of the cylinder contour entity in the cylinder contour entity segmentation real-time image in turn corresponding to the angle and distance; Step 5.3: Represent the transformed cylinder body contour entity segmentation real-time image and the cylinder body contour entity segmentation reference image in the form of a matrix, and calculate the absolute value and element sum of the matrix difference between the two as the difference, obtain the transformation with the smallest difference among all the transformations corresponding to the two-dimensional homogeneous transformation matrix sequence, and use the two-dimensional homogeneous transformation matrix corresponding to this transformation as the positioning matrix.
5. A cylinder contour positioning method as claimed in claim 4, characterized in that: The step 6 specifically comprises the following steps: Step 6.1: Take the inverse of the rotation angle, the number of pixels shifted to the right, and the number of pixels shifted downward in the positioning matrix, and compare them with the pixel position of each pixel point of the cylinder body contour entity in the cylinder body contour entity segmentation reference image. Multiply, transform the cylinder body contour entity in the cylinder body contour entity segmentation reference image, where: are respectively the horizontal pixel position and the vertical pixel position of each pixel point of the cylinder body contour entity in the cylinder body contour entity segmentation reference image; Step 6.2: The cylinder in the cylinder contour real-time image and the cylinder contour entity in the transformed cylinder contour entity segmentation reference image correspond one to one in position, thereby achieving positioning in the cylinder contour real-time image.
6. A cylinder profile positioning system, the system comprising: A first image module, the first image module is used to acquire an image containing a standard cylinder body and generate a cylinder body contour reference image; A second image module, the second image module is used to obtain an image containing a real-time cylinder body and generate a real-time image of the cylinder body contour; An image segmentation module, wherein the image segmentation module is used to sequentially input a cylinder body contour reference image and a cylinder body contour real-time image into a cylinder body image segmentation model to generate a cylinder body contour entity segmentation reference image and a cylinder body contour entity segmentation real-time image respectively; A matrix generation module, wherein the matrix generation module is used to define a sequence composed of two-dimensional homogeneous transformation matrices, wherein the two-dimensional homogeneous transformation matrix in the sequence can make the cylinder contour entity in the cylinder contour entity segmentation real-time image undergo a combined transformation of rotation and translation corresponding to an angle and a distance; A homogeneous transformation module, which is used to traverse a two-dimensional homogeneous transformation matrix sequence, transform the cylinder contour entities in the cylinder contour entity segmentation real-time image in turn, and respectively calculate the difference between the transformed cylinder contour entity segmentation real-time image and the cylinder contour entity segmentation reference image, and obtain the two-dimensional homogeneous transformation matrix corresponding to the transformation with the smallest difference as a positioning matrix; The positioning module is used to transform the cylinder body contour reference image by using the positioning matrix to achieve positioning in the cylinder body contour real-time image.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of a cylinder profile positioning method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of a cylinder profile positioning method according to any one of claims 1 to 5 are implemented.
9. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of a cylinder profile positioning method according to any one of claims 1 to 5 are implemented.