A machine vision positioning method

Through the machine vision positioning method, the color scene vector and the body transition coefficient are used to solve the problems of manual subjectivity and noise influence in body inspection, and achieve precise positioning and accurate detection of car body defects.

CN118691667BActive Publication Date: 2024-10-22CHENGDU AERONAUTIC POLYTECHNIC
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411196580.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2024-10-22
Estimated Expiration
2044-08-29

AI Technical Summary

Technical Problem

The existing technology relies on manual detection or subjective evaluation in automobile body defect detection, which results in long detection time and inaccurate results. Moreover, it is difficult for machine vision technology to effectively remove the influence of background noise and specular reflection, affecting detection accuracy.

Method used

The machine vision positioning method is used to collect vehicle body images and perform preprocessing to remove the background, construct color scene vectors, calculate vehicle body transition coefficients and broad values, generate color scene vectors, screen out abnormal pixels, and locate vehicle body defects.

Benefits of technology

It achieves precise positioning of car body defects, reduces the impact of noise, improves detection accuracy and efficiency, and ensures production safety and quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118691667B_ABST
    Figure CN118691667B_ABST
Patent Text Reader

Abstract

The present invention discloses a machine vision positioning method, which relates to the field of machine vision technology, and includes the following steps: S1, collecting a current vehicle body image, and preprocessing the current vehicle body image to obtain a standard vehicle body image; S2, constructing a color scene vector for the standard vehicle body image; S3, locating the defect of the current vehicle body image according to the color scene vector. The present invention discloses a machine vision positioning method, which analyzes and processes the transition between each pixel point in the vehicle body image and the surrounding pixel points, and considers whether the connection between the pixel points of the vehicle body image is natural and reasonable; the present invention determines a color scene vector based on all pixel points, which is used to screen abnormal pixel points, i.e., defects, of the vehicle body image, and can accurately locate the defects of the vehicle body, thereby facilitating production repair and ensuring production safety and production quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of machine vision, and in particular to a machine vision positioning method. Background Art

[0002] In the automobile production process, the appearance of the assembled automobile products needs to be inspected to see if there are defects such as scratches, deformation and wear on the automobile body. In recent years, machine vision technology and image processing technology have been gradually and widely used in the surface defect detection of automobile bodies. From the current research, the technical means involved in the detection of automobile body defects are mainly manual detection or detection under established rules, which often adopts subjective evaluation and judgment. The conclusions drawn often differ greatly due to different judges, resulting in long quality inspection time and inaccurate inspection results. Summary of the invention

[0003] In order to solve the above problems, the present invention proposes a machine vision positioning method.

[0004] The technical solution of the present invention is: a machine vision positioning method comprises the following steps:

[0005] S1, collecting the current vehicle body image, and preprocessing the current vehicle body image to obtain a standard vehicle body image;

[0006] S2, constructing a color scene vector for the standard vehicle body image;

[0007] S3. Locate the defect of the current vehicle body image according to the color scene vector.

[0008] Furthermore, in S1, the preprocessing method is: removing the background area of ​​the current vehicle body image to obtain a standard vehicle body image.

[0009] The beneficial effect of the above further scheme is: in the present invention, the current vehicle body image collected includes the background of the production factory where the vehicle body is located. In order to better realize the detection of defects of the vehicle body itself, the present invention first eliminates the background factors to ensure that the noise of the standard vehicle body image is as little as possible.

[0010] Furthermore, S2 includes the following sub-steps:

[0011] S21, taking a combination of a red component, a green component, and a blue component of a pixel point in the standard vehicle body image as a color sequence of the pixel point;

[0012] S22, calculating the vehicle body transition coefficient of the pixel point according to the color sequence of the pixel point;

[0013] S23, determining a color scene vector according to a vehicle body transition coefficient of each pixel point in the standard vehicle body image.

[0014] The beneficial effect of the above further solution is that in the present invention, a qualified vehicle body should have a uniform color, and if there is a color gradient, the transition should be natural. Therefore, the present invention analyzes the transition between each pixel point in the standard vehicle body image and the surrounding pixel points, obtains the vehicle body transition coefficient, and determines the corresponding color scene vector, which is used to screen whether there are abnormal pixels in the standard vehicle body image.

[0015] In S21, the color sequence The expression is: ; In the formula, Represents the red component of the pixel. Represents the green component of the pixel. Represents the blue component of the pixel.

[0016] Furthermore, in S22, the body transition coefficient of the pixel point The calculation formula is: ; In the formula, Represents the color sequence of pixels, Represents the color sequence of the first neighboring pixel corresponding to the pixel, Represents the color sequence of the second neighboring pixel corresponding to the pixel, Indicates the color sequence of the third neighboring pixel corresponding to the pixel. Indicates the color sequence of the fourth neighboring pixel corresponding to the pixel, represents the covariance function.

[0017] The first neighboring pixel point is located above the pixel point, the second neighboring pixel point is located to the right of the pixel point, the third neighboring pixel point is located below the pixel point, and the fourth neighboring pixel point is located to the left of the pixel point.

[0018] Further, S23 includes the following sub-steps:

[0019] S231, removing pixels with abnormal brightness in the standard vehicle body image, and taking the remaining pixels as the wide area;

[0020] S232, taking the number of pixels belonging to the wide area among the four neighboring pixels of the pixel as the wide value of the pixel;

[0021] S233, generating a first color scene coefficient according to the vehicle body transition coefficients of all pixels in the standard vehicle body image;

[0022] S234, generating a second color scene coefficient according to the wide values ​​of all pixels in the standard vehicle body image;

[0023] S235 . Determine a color scene vector according to the first color scene coefficient and the second color scene coefficient.

[0024] The beneficial effect of the above further scheme is: in the present invention, the vehicle body surface (especially smooth surfaces, such as metal paint surfaces) is prone to mirror reflection, resulting in reflective areas in the image. This reflection may cause uneven distribution of image brightness, or even cause local overexposure, affecting the clarity and detail of the image. Therefore, in S231, existing algorithms (such as OpenCV) are used to determine pixels with abnormal brightness. These pixels may be reflective areas of the standard vehicle body image, which can be used as one of the factors affecting the color scene vector. The present invention fully considers the wide range of pixel values ​​of the entire standard vehicle body image and the distribution of the vehicle body transition coefficient, so that positioning is accurate.

[0025] Taking S232 as an example, if the pixel above the pixel belongs to the wide area, and the pixel below, to the left, and to the right of the pixel do not belong to the wide area, then the wide value of the pixel is 1.

[0026] In S235, color scene vector The expression is: .

[0027] Further, in S233, the first color scene coefficient The calculation formula is: ; In the formula, Indicates the first The body transition coefficient of pixels, Indicates the number of pixels of the standard vehicle body image, represents a constant, Represents an exponential function.

[0028] Further, in S235, pixels with a broad value of 4 are extracted as the first pixel point set, pixels with a broad value of 0 are extracted as the second pixel point set, and the ratio between the number of pixels in the first pixel point set and the number of pixels in the second pixel point set is used as the second color scene coefficient.

[0029] Furthermore, S3 includes the following sub-steps:

[0030] S31. As the constant change of the pixel point, Represents the red component of the pixel. Represents the green component of the pixel. Represents the blue component of the pixel;

[0031] S32, taking the ratio between the constant change amount of the pixel point and the color scene vector value as the scene constant value of the pixel point;

[0032] S33, performing a rounding operation on the scene constant value of the pixel point to generate a scene integer value of the pixel point;

[0033] S34, locating the defect of the current vehicle body image according to the scene integral value of the pixel point.

[0034] Furthermore, in S34, the average of all scene integral values ​​in the standard vehicle body image is extracted as a defect threshold, and the pixel points whose scene integral values ​​are less than the defect threshold are regarded as the locations of defects.

[0035] The beneficial effects of the present invention are as follows: the present invention discloses a machine vision positioning method, which analyzes and processes the transition between each pixel point in a vehicle body image and the surrounding pixel points, and considers whether the connection between the pixel points of the vehicle body image is natural and reasonable; the present invention determines a color scene vector based on all pixel points to screen abnormal pixel points, i.e., defects, of the vehicle body image, and can accurately locate the defects of the vehicle body, thereby facilitating production repair and ensuring production safety and quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 Flowchart of the machine vision positioning method. DETAILED DESCRIPTION

[0037] The embodiments of the present invention will be further described below in conjunction with the accompanying drawings.

[0038] like Figure 1 As shown, the present invention provides a machine vision positioning method, comprising the following steps:

[0039] S1, collecting the current vehicle body image, and preprocessing the current vehicle body image to obtain a standard vehicle body image;

[0040] S2, constructing a color scene vector for the standard vehicle body image;

[0041] S3. Locate the defect of the current vehicle body image according to the color scene vector.

[0042] In the embodiment of the present invention, in S1, the preprocessing method is: removing the background area of ​​the current vehicle body image to obtain a standard vehicle body image.

[0043] In the present invention, the current vehicle body image collected includes the background of the production factory where the vehicle body is located. In order to better detect the defects of the vehicle body itself, the present invention first eliminates the background factors to ensure that the noise of the standard vehicle body image is as small as possible.

[0044] In this embodiment of the present invention, S2 includes the following sub-steps:

[0045] S21, taking a combination of a red component, a green component, and a blue component of a pixel point in the standard vehicle body image as a color sequence of the pixel point;

[0046] S22, calculating the vehicle body transition coefficient of the pixel point according to the color sequence of the pixel point;

[0047] S23, determining a color scene vector according to a vehicle body transition coefficient of each pixel point in the standard vehicle body image.

[0048] In the present invention, a qualified vehicle body should have a uniform color. If there is a color gradient, the transition should be natural. Therefore, the present invention analyzes the transition between each pixel point in the standard vehicle body image and the surrounding pixels, obtains the vehicle body transition coefficient, and determines the corresponding color scene vector to screen whether there are abnormal pixels in the standard vehicle body image.

[0049] In S21, the color sequence The expression is: ; In the formula, Represents the red component of the pixel. Represents the green component of the pixel. Represents the blue component of the pixel.

[0050] In the embodiment of the present invention, in S22, the body transition coefficient of the pixel point The calculation formula is: ; In the formula, Represents the color sequence of pixels, Represents the color sequence of the first neighboring pixel corresponding to the pixel, Represents the color sequence of the second neighboring pixel corresponding to the pixel, Indicates the color sequence of the third neighboring pixel corresponding to the pixel. Indicates the color sequence of the fourth neighboring pixel corresponding to the pixel, represents the covariance function.

[0051] The first neighboring pixel point is located above the pixel point, the second neighboring pixel point is located to the right of the pixel point, the third neighboring pixel point is located below the pixel point, and the fourth neighboring pixel point is located to the left of the pixel point.

[0052] In this embodiment of the present invention, S23 includes the following sub-steps:

[0053] S231, removing pixels with abnormal brightness in the standard vehicle body image, and taking the remaining pixels as the wide area;

[0054] S232, taking the number of pixels belonging to the wide area among the four neighboring pixels of the pixel as the wide value of the pixel;

[0055] S233, generating a first color scene coefficient according to the vehicle body transition coefficients of all pixels in the standard vehicle body image;

[0056] S234, generating a second color scene coefficient according to the wide values ​​of all pixels in the standard vehicle body image;

[0057] S235 . Determine a color scene vector according to the first color scene coefficient and the second color scene coefficient.

[0058] In the present invention, the vehicle body surface (especially smooth surfaces, such as metal paint surfaces) is prone to specular reflection, resulting in reflective areas in the image. This reflection may cause uneven distribution of image brightness, or even cause local overexposure, affecting the clarity and detail of the image. Therefore, in S231, existing algorithms (such as OpenCV) are used to determine pixels with abnormal brightness. These pixels may be reflective areas of the standard vehicle body image, which can be used as one of the factors affecting the color scene vector. The present invention fully considers the wide range of pixel values ​​of the entire standard vehicle body image and the distribution of the vehicle body transition coefficient, so that positioning is accurate.

[0059] Taking S232 as an example, if the pixel above the pixel belongs to the wide area, and the pixel below, to the left, and to the right of the pixel do not belong to the wide area, then the wide value of the pixel is 1.

[0060] In S235, color scene vector The expression is: .

[0061] In the embodiment of the present invention, in S233, the first color scene coefficient The calculation formula is: ; In the formula, Indicates the first The body transition coefficient of pixels, Indicates the number of pixels of the standard vehicle body image, represents a constant, Represents an exponential function.

[0062] In an embodiment of the present invention, in S235, pixel points with a wide value of 4 are extracted as the first pixel point set, pixel points with a wide value of 0 are extracted as the second pixel point set, and the ratio between the number of pixels in the first pixel point set and the number of pixels in the second pixel point set is used as the second color scene coefficient.

[0063] In this embodiment of the present invention, S3 includes the following sub-steps:

[0064] S31. As the constant change of the pixel point, Represents the red component of the pixel. Represents the green component of the pixel. Represents the blue component of the pixel;

[0065] S32, taking the ratio between the constant change amount of the pixel point and the color scene vector value as the scene constant value of the pixel point;

[0066] S33, performing a rounding operation on the scene constant value of the pixel point to generate a scene integer value of the pixel point;

[0067] S34: According to the scene integral value of the pixel point, the defect of the current vehicle body image is located.

[0068] In the embodiment of the present invention, in S34, the average of all scene integral values ​​in the standard vehicle body image is extracted as the defect threshold, and the pixel points whose scene integral values ​​are less than the defect threshold are regarded as the defect locations.

[0069] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the present invention.

Claims

1. A machine vision positioning method, characterized in that: The following steps are involved: S1, collecting the current vehicle body image, and preprocessing the current vehicle body image to obtain a standard vehicle body image; S2, constructing a color scene vector for the standard vehicle body image; S3, locating the defect of the current vehicle body image according to the color scene vector; The S2 comprises the following sub-steps: S21, taking a combination of a red component, a green component, and a blue component of a pixel point in the standard vehicle body image as a color sequence of the pixel point; S22, calculating the vehicle body transition coefficient of the pixel point according to the color sequence of the pixel point; S23, determining a color scene vector according to a vehicle body transition coefficient of each pixel point in the standard vehicle body image; In S22, the body transition coefficient of the pixel point The calculation formula is: ; In the formula, Represents the color sequence of pixels, Represents the color sequence of the first neighboring pixel corresponding to the pixel, Represents the color sequence of the second neighboring pixel corresponding to the pixel, Indicates the color sequence of the third neighboring pixel corresponding to the pixel. Indicates the color sequence of the fourth neighboring pixel corresponding to the pixel, represents the covariance function; The S23 comprises the following sub-steps: S231, removing pixels with abnormal brightness in the standard vehicle body image, and taking the remaining pixels as the wide area; S232, taking the number of pixels belonging to the wide area among the four neighboring pixels of the pixel as the wide value of the pixel; S233, generating a first color scene coefficient according to the vehicle body transition coefficients of all pixels in the standard vehicle body image; S234, generating a second color scene coefficient according to the wide values ​​of all pixels in the standard vehicle body image; S235, determining a color scene vector according to the first color scene coefficient and the second color scene coefficient; In S233, the first color scene coefficient The calculation formula is: ; In the formula, Indicates the first The body transition coefficient of pixels, Indicates the number of pixels of the standard vehicle body image, represents a constant, represents the exponential function; In S235, pixels with a wide value of 4 are extracted as the first pixel point set, pixels with a wide value of 0 are extracted as the second pixel point set, and the ratio between the number of pixels in the first pixel point set and the number of pixels in the second pixel point set is used as the second color scene coefficient.

2. The machine vision positioning method according to claim 1, characterized in that: In S1, the preprocessing method is: removing the background area of ​​the current vehicle body image to obtain a standard vehicle body image.

3. The machine vision positioning method according to claim 1, characterized in that: The S3 comprises the following sub-steps: S31. As the constant change of the pixel point, Represents the red component of the pixel. Represents the green component of the pixel. Represents the blue component of the pixel; S32, taking the ratio between the constant change amount of the pixel point and the color scene vector value as the scene constant value of the pixel point; S33, performing a rounding operation on the scene constant value of the pixel point to generate a scene integer value of the pixel point; S34, locating the defect of the current vehicle body image according to the scene integral value of the pixel point.

4. The machine vision positioning method according to claim 3, characterized in that: In the above S34, the average of all scene integral values ​​in the standard vehicle body image is extracted as a defect threshold, and the pixel points whose scene integral values ​​are smaller than the defect threshold are regarded as the defect locations.

Citation Information

Cited By

  • Carrier positioning and control method and system based on machine vision

    CN121722115A