Visual inspection method and device for main instrument panel of new energy automobile
By calculating the noise performance and filter weight of each pixel point, combined with neural network processing, the problem of poor image enhancement effect of the surface panel of the new energy vehicle main instrument in traditional methods is solved, and the detection accuracy is improved.
Patent Information
- Application Number
- CN202411463586.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2024-11-22
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When the traditional non-local mean filtering algorithm enhances the image of the surface panel of the main instrument of the new energy vehicle, the filter weight deviation occurs due to the presence of protrusions and other parts on the surface of the panel, which affects the detection accuracy.
By obtaining the noise performance of each pixel point, filtering the pixel points to be filtered, and calculating the filter weight based on parameters such as texture intensity, texture direction, and light reduction degree, and image denoising is performed by combining the trained segmented neural network.
It effectively removes noise interference, improves the image denoising effect, enhances the accuracy of visual detection, and eliminates panel protrusion interference.
Smart Images

Figure CN119006448A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a visual inspection method and device for a main instrument panel of a new energy vehicle. Background Art
[0002] With the increasing awareness of environmental protection and the intensification of the energy crisis, new energy vehicles have gradually become the development direction of the future automobile industry. The main instrument panel is an important information interaction interface between the driver and the vehicle of a new energy vehicle. The quality of the main instrument wrapping panel directly affects the safety and aesthetics of the main instrument. The indentation produced by the wrapping panel during production directly affects its quality, so it needs to be tested. The noise in image acquisition affects the detection effect, so the image needs to be enhanced before detection.
[0003] When using the traditional non-local mean filtering algorithm to enhance the image, the filtering weight of the neighborhood block is determined according to the distance between the neighborhood block and the reference block. However, due to the presence of many protrusions on the panel surface that increase the aesthetics and tactile feel, there is a large difference in the similarity between the neighborhood blocks and the reference blocks at different positions in the image, which makes the filtering weight of the neighborhood block obtained according to the distance between the neighborhood block and the reference block have a large deviation from its actual filtering weight. As a result, when the image of the main instrument panel of the car is enhanced by the traditional non-local mean filtering algorithm, the enhancement effect is not good, that is, the obtained enhanced image cannot remove the interference of noise well, thereby reducing the accuracy of visual inspection of the main instrument panel of new energy vehicles. Summary of the invention
[0004] The present invention provides a visual inspection method and device for a main instrument panel of a new energy vehicle to solve the existing problems.
[0005] The visual inspection method and device of the main instrument panel of a new energy vehicle of the present invention adopts the following technical scheme: An embodiment of the present invention provides a method for visually inspecting a main instrument panel of a new energy vehicle, the method comprising the following steps: Obtain the image to be detected of the main instrument panel of the car, and obtain the noise performance level of each pixel according to the gradient of each pixel; According to the noise performance of each pixel, a number of pixels to be filtered are selected from all pixels; a reference block and all neighboring blocks corresponding to each pixel to be filtered in the image to be detected are obtained; According to the gradient of each pixel point, the texture intensity, texture direction and texture vertical direction of the reference block and all neighboring blocks corresponding to each pixel point to be filtered are obtained; According to the grayscale values of each pixel and the surrounding pixels, the degree and direction of illumination attenuation of each pixel are obtained; According to the illumination attenuation degree and illumination attenuation direction of each pixel point, the illumination attenuation degree and illumination attenuation direction of the reference block and all neighboring blocks corresponding to each pixel point to be filtered are obtained; According to the degree of illumination attenuation between the reference block corresponding to each pixel to be filtered and all neighboring blocks, the illumination attenuation direction and the direction perpendicular to the texture, the authenticity of the consistency of texture intensity between the reference block corresponding to each pixel to be filtered and each neighboring block under the influence of specific illumination is obtained; According to the texture intensity, texture direction and authenticity of the texture intensity consistency between the reference block corresponding to each pixel to be filtered and all neighboring blocks under the influence of specific illumination, the texture consistency between the reference block corresponding to each pixel to be filtered and each neighboring block is obtained; According to the texture consistency between the reference block corresponding to each pixel to be filtered and each neighborhood block, a filtering weight of each neighborhood block of each pixel to be filtered is obtained; According to the filtering weight of each neighborhood block of each pixel to be filtered, the image to be detected is filtered and enhanced to obtain an enhanced image to be detected; The enhanced defect area in the image to be detected is obtained through the trained segmentation neural network.
[0006] Furthermore, the step of obtaining the noise performance level of each pixel point according to the gradient of each pixel point includes the following specific steps: The gradient of each pixel in the image to be detected is obtained through the Sobel operator; Will be The pixel point is the center and expands to the surrounding area to obtain a The window is denoted as A window of pixels, is the preset window width; According to The gradient of each pixel in the window of pixels is obtained The noise performance degree of each pixel point is calculated by the following formula: In the formula, Indicates The noise level of each pixel, Indicates The gradient value of a pixel, Indicates The pixel window The gradient value of a pixel, Indicates Pixels and The pixel window The angle value of the gradient of each pixel, Indicates The number of pixels contained in a window of pixels, represents the absolute value function.
[0007] Furthermore, the step of obtaining the texture intensity, texture direction and texture vertical direction of the reference block and all neighboring blocks corresponding to each pixel to be filtered according to the gradient of each pixel includes the following specific steps: Among the reference blocks and all the neighborhood blocks corresponding to the zth pixel to be filtered, any reference block or neighborhood block is recorded as the target block; The sum of the gradients of all pixels in the target block is recorded as the vector of the target block; The direction perpendicular to the vector direction of the target block is recorded as the texture direction of the target block; The direction parallel to the vector direction of the target block is recorded as the texture vertical direction of the target block; the modulus length of the vector of the target block is recorded as the texture strength of the target block.
[0008] Furthermore, the method of obtaining the degree and direction of illumination attenuation of each pixel point according to the grayscale values of each pixel point and surrounding pixels points includes the following specific methods: Constructed with The pixel point is the center and the size is No. A local window of pixels, The width of the preset local window; The first The gray value of each pixel is recorded as the first threshold; In the In the local window of the cth pixel in the local window of the cth pixel, the number of all pixels with gray values greater than the first threshold is recorded as The number threshold of the c-th pixel in a local window of pixels; Preset several target directions. In the local window of pixels, starting from the pixel at the center, traverse pixel by pixel along the u-th target direction, and count the number threshold of each pixel traversed to form the first A quantity threshold sequence of pixels in the u-th target direction; According to The number threshold sequence of pixels in the uth target direction is obtained The pixel at The degree of light reduction in the direction of a target.
[0009] Furthermore, according to The number threshold sequence of pixels in the uth target direction is obtained The pixel at The specific steps include the following: In the The pixel at In the number threshold sequence of target directions, when the The number threshold is greater than When the quantity threshold is reached, A quantity threshold is recorded as the target quantity threshold; According to The pixel at The number of target quantity thresholds in the quantity threshold sequence in the target direction is the same as the number of target quantity thresholds in the first target direction. The value of each data threshold in the number threshold sequence of pixels in the uth target direction is obtained. The pixel at The specific calculation formula for the degree of illumination attenuation in the target direction is as follows: Where: Indicates The pixel at The degree of light attenuation in the target direction, Indicates The pixel at The number of data contained in the quantity threshold sequence in the target direction, Indicates The pixel at The first in the sequence of number thresholds in the target direction A number threshold, Indicates The pixel at The first in the sequence of number thresholds in the target direction A number threshold, Indicates The pixel at The number of target quantity thresholds in the quantity threshold sequence in the target direction; The first The target direction corresponding to the maximum illumination attenuation degree of the pixel point in all target directions is recorded as The direction in which the light attenuates at each pixel; The first The maximum illumination reduction degree of a pixel in all target directions is recorded as The degree of illumination reduction of each pixel.
[0010] Furthermore, the step of obtaining the illumination attenuation degree and illumination attenuation direction of the reference block and all neighboring blocks corresponding to each pixel to be filtered according to the illumination attenuation degree and illumination attenuation direction of each pixel includes the following specific steps: With the horizontal right as 0 degrees, rotate counterclockwise to get the angle corresponding to each direction; In the target block, the average of the illumination attenuation degrees of all pixels is recorded as the illumination attenuation degree of the target block; in the target block, the direction corresponding to the average of the angles corresponding to the illumination attenuation directions of all pixels is recorded as the illumination attenuation direction of the target block.
[0011] Furthermore, the authenticity of the consistency of texture intensity between the reference block corresponding to each pixel to be filtered and each neighboring block under the influence of specific illumination is obtained according to the illumination attenuation degree of the reference block corresponding to each pixel to be filtered and all neighboring blocks, the illumination attenuation direction and the direction perpendicular to the texture, and the specific steps include the following: In the formula, Indicates the authenticity of the consistency of texture intensity between the reference block corresponding to the zth pixel to be filtered and the tth neighborhood block under the influence of specific lighting, Indicates the absolute value of the difference in the degree of illumination reduction between the reference block corresponding to the zth pixel to be filtered and the tth neighborhood block, Indicates the minimum angle between the texture vertical direction of the reference block corresponding to the zth pixel to be filtered and the direction of light attenuation, Indicates the minimum angle between the texture vertical direction of the tth neighborhood block corresponding to the zth pixel to be filtered and the direction of light attenuation, represents the normalization function, Indicates The minimum angle between the reference block corresponding to the pixel to be filtered and the illumination attenuation direction of the tth neighborhood block, is an exponential function with a natural constant as base, represents the absolute value function.
[0012] Further, the texture consistency between the reference block corresponding to each pixel to be filtered and each neighboring block is obtained according to the texture intensity, texture direction of the reference block corresponding to each pixel to be filtered and all neighboring blocks, and the authenticity of the texture intensity consistency between the reference block corresponding to each pixel to be filtered and each neighboring block under the influence of specific illumination, including the specific formula as follows: In the formula, is the texture consistency between the reference block corresponding to the zth pixel to be filtered and the tth neighborhood block, is the authenticity of the consistency of texture intensity between the reference block corresponding to the zth pixel to be filtered and the tth neighborhood block under the influence of specific lighting, Represents the texture intensity of the reference block corresponding to the zth pixel to be filtered, Represents the texture intensity of the tth neighborhood block corresponding to the zth pixel to be filtered, represents the normalization function, It represents the minimum angle between the texture direction of the reference block corresponding to the zth pixel to be filtered and the tth neighborhood block. is an exponential function with a natural constant as base, represents the absolute value function.
[0013] Furthermore, the filtering weight of each neighborhood block of each pixel to be filtered is obtained according to the texture consistency between the reference block corresponding to each pixel to be filtered and each neighborhood block, and the specific steps include the following: The sum of the texture consistency between the reference block corresponding to the zth pixel to be filtered and all the neighboring blocks is recorded as The first parameter of the pixel to be filtered; The texture consistency between the reference block corresponding to the zth pixel to be filtered and the tth neighborhood block is compared with the texture consistency between the tth neighborhood block and the zth pixel to be filtered. The ratio of the first parameter of the pixels to be filtered is recorded as The pixel to be filtered The filter weights of the neighborhood blocks.
[0014] The present invention also proposes a visual inspection device for a main instrument panel of a new energy vehicle, the device comprising: A data acquisition module, a data processing module and a mechanical control module; wherein the camera in the data acquisition module is used to collect images of the main instrument panel of the new energy vehicle, the data processing module obtains defective areas in the main instrument panel of the new energy vehicle by calling a computer program to implement the steps of a visual inspection method for the main instrument panel of the new energy vehicle, and the mechanical control module transmits the main instrument panel of the new energy vehicle with defective areas and the main instrument panel of the new energy vehicle without defective areas on the conveyor belt to different production lines.
[0015] The beneficial effects of the technical solution of the present invention are as follows: based on the characteristic that the grayscale values of the pixels affected by noise in the image to be detected are greatly different from the grayscale values of the pixels around them, the difference in the noise performance degree of the pixels affected by noise and the noise performance degree of the pixels not affected by noise is more obvious; based on the characteristic that the grayscale values of the pixels in the same area change under different illumination, the illumination attenuation direction and the illumination attenuation degree of each pixel are determined, eliminating the interference of protrusions and other parts in the panel; when calculating the texture consistency between the reference block corresponding to each pixel to be filtered and each neighborhood block, the influence of illumination is taken into account, so that the texture consistency between the reference block corresponding to each pixel to be filtered and each neighborhood block is closer to the actual situation, so that the filtering weight of each neighborhood block of each pixel to be filtered is more accurate, and the denoising effect of the image to be detected is better. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 The present invention is a flowchart of the steps of a method for visually inspecting a main instrument panel of a new energy vehicle. DETAILED DESCRIPTION
[0018] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the visual inspection method and equipment of the main instrument panel of a new energy vehicle proposed by the present invention, its specific implementation method, structure, characteristics and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0019] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0020] The following is a detailed description of a specific scheme of a visual inspection method for a main instrument panel of a new energy vehicle provided by the present invention in conjunction with the accompanying drawings.
[0021] See also Figure 1 , which shows a flowchart of a method for visually inspecting a main instrument panel of a new energy vehicle provided by an embodiment of the present invention, the method comprising the following steps: Step S001: Obtain an image to be detected of the main instrument panel of the automobile, and obtain the noise performance level of each pixel according to the gradient of each pixel; select a number of pixels to be filtered from all pixels according to the noise performance level of each pixel; obtain a reference block and all neighboring blocks corresponding to each pixel to be filtered in the image to be detected.
[0022] It should be noted that, since the main purpose of this embodiment is to detect the main instrument panel of the automobile, an image of the main instrument panel of the automobile is obtained. Since noise may appear in the image to be detected when the image to be detected is collected, thereby affecting the detection result, it is necessary to denoise the image of the main instrument panel of the automobile.
[0023] It should be further explained that the main instrument panel of the car is mainly a plastic panel that wraps the instrument. Its general inspection process is as follows: Generally, after production is completed, it is directly transferred to the inspection platform corresponding to the inspection equipment through a conveyor belt, and then a camera is installed above the inspection platform to capture the panel image, and the captured panel image is grayed to obtain the image to be inspected. The image to be inspected is denoised by a non-local mean filtering algorithm, and the denoised image to be inspected is inspected to obtain the defect area in the image to be inspected.
[0024] Specifically, the image to be detected of the main instrument panel of the automobile is obtained through the detection platform.
[0025] It should be noted that, since the main purpose of denoising the image to be detected is to remove the noise interference in the image to be detected, that is, the pixels targeted are mainly noise points, so it is necessary to determine all the noise pixels to be filtered in the image to be detected. Because the grayscale value and grayscale change direction of the noise points in the image to be detected are greatly different from those of the surrounding pixels. Therefore, the pixel to be filtered in the image to be detected is obtained according to the gradient of each pixel in the image to be detected.
[0026] Specifically, the first For example, the pixel point in the image to be detected The specific method of obtaining the noise performance degree of each pixel is as follows: The gradient of each pixel in the image to be detected is obtained by using the Sobel operator, wherein the Sobel operator is a well-known technology and will not be described in detail in this embodiment.
[0027] First The pixel point is the center and expands to the surrounding area to obtain a , and record this window as pixel window. The number of pixels around the pixel is not enough to generate a pixel of size The window width is subject to the actual situation. In this embodiment, the preset window width is , can be set to other values in other embodiments. The gradient of each pixel in the window of pixels is obtained The noise level of each pixel. The noise level of each pixel is recorded as , the calculation formula is as follows: In the formula, Indicates The noise level of each pixel, Indicates The gradient value of a pixel, Indicates The pixel window The gradient value of a pixel, Indicates Pixels and The pixel window The angle value of the gradient of each pixel, Indicates The number of pixels contained in a window of pixels, represents the absolute value function.
[0028] Furthermore, a noise level threshold is preset ,if , explain The noise level of the pixel point is relatively large, then pixels are the pixels to be filtered; if , explain The noise level of the pixel point is small, then the The pixel points are normal pixels. In this embodiment, the noise level threshold is preset , can be set to other values in other embodiments.
[0029] The above operation is performed on all pixels in the image to be detected to obtain all pixels to be filtered in the image to be detected. The image to be detected is operated using a non-local mean filtering algorithm to obtain a reference block and all neighborhood blocks corresponding to each pixel to be filtered. Among them, obtaining a reference block and all neighborhood blocks corresponding to each pixel to be filtered according to the non-local mean filtering algorithm is a well-known technology, and the specific method is not introduced here.
[0030] Step S002: According to the gradient of each pixel point, the texture intensity, texture direction and texture vertical direction of the reference block and all neighboring blocks corresponding to each pixel point to be filtered are obtained; according to the grayscale value of each pixel point and the surrounding pixels, the degree of illumination attenuation and the direction of illumination attenuation of each pixel point are obtained; according to the degree of illumination attenuation and the direction of illumination attenuation of each pixel point, the degree of illumination attenuation and the direction of illumination attenuation of the reference block and all neighboring blocks corresponding to each pixel point to be filtered are obtained.
[0031] It should be noted that in order to enhance the touch of the main instrument panel of the car when producing the main instrument panel of the car, it is likely that there are regular protruding textures on the main instrument panel of the car, where the textures at different positions have different directions. Therefore, when performing non-local mean filtering, it is necessary to obtain the filtering weight of each neighborhood block corresponding to each pixel to be filtered based on the texture consistency between a reference block corresponding to each pixel to be filtered and each of its corresponding neighborhood blocks. In this embodiment, the texture consistency between the neighborhood block corresponding to the same pixel to be filtered and the reference block is mainly determined by the texture intensity consistency and the texture direction consistency.
[0032] It should be further explained that, because the texture direction in the reference block and the neighboring block is mainly the texture continuous direction, the vertical direction has the largest gradient performance. Therefore, the sum vector of the gradient vectors of all pixels in the reference block and the neighboring block is calculated, and the texture intensity, texture direction and texture vertical direction of each reference block and the neighboring block are obtained through the sum vector of each reference block and the neighboring block.
[0033] Specifically, among the reference block and all the neighborhood blocks corresponding to the zth pixel to be filtered, any one reference block or neighborhood block is recorded as the target block.
[0034] The sum of the gradients of all pixels in the target block is recorded as the vector of the target block. The direction perpendicular to the direction of the vector of the target block is recorded as the texture direction of the target block; the direction parallel to the vector direction of the target block is recorded as the texture vertical direction of the target block; the modulus of the vector of the target block is recorded as the texture strength of the target block. According to the above method, the texture direction, texture vertical direction and texture strength of the reference block and the neighboring block corresponding to each pixel to be filtered are obtained.
[0035] It should be noted that for the pixel points in the image to be detected, its texture intensity is mainly manifested as the contrast between the texture area and the surrounding area. At this time, due to reasons such as lighting, the textures at different positions in the image have different contrasts, resulting in different texture intensity performances, which in turn affects the texture consistency performance between the neighborhood block and the reference block. Therefore, the authenticity of the consistency of the texture intensity between the reference block corresponding to each pixel to be filtered and its corresponding neighborhood block is calculated.
[0036] It should be further explained that, because the consistency of texture intensity is affected by the change of illumination, the authenticity of the consistency of texture intensity of each neighborhood block and the reference block is obtained according to the degree of illumination attenuation and the direction of illumination attenuation of each neighborhood block and the reference block. The degree of illumination attenuation and the direction of illumination attenuation of the neighborhood block and the reference block are mainly obtained by the degree of illumination attenuation and the direction of illumination attenuation of each pixel in the neighborhood block and the reference block, so the degree of illumination attenuation and the direction of illumination attenuation of each neighborhood block and the reference block in the image to be detected are calculated.
[0037] It should be further explained that the direction of the illumination in the image to be detected mainly causes the change in the grayscale value of the pixel at the corresponding position, that is, as the illumination weakens, the grayscale value of the pixel gradually decreases. Also, because there are protrusions and other parts in the panel, the grayscale values of the pixels at adjacent positions may have obvious differences. Therefore, the illumination weakening direction of each pixel is obtained based on the grayscale value change relationship of the remaining pixels around each pixel.
[0038] Specifically, Take pixels as an example, construct The pixel point is the center and the size is No. A local window of pixels. The number of pixels around the pixel is not enough to generate a pixel of size No. The local window of each pixel point is determined according to the actual situation. According to the above method, the local window of each pixel point in the image to be detected is obtained. In this embodiment, the width of the local window is preset. , can be set to other values in other implementations.
[0039] Furthermore, The gray value of the pixel is recorded as the first threshold. For example, the cth pixel in the local window of pixels. In the local window of the cth pixel in the local window of the cth pixel, the number of all pixels with gray values greater than the first threshold is recorded as The number threshold of the c-th pixel in a local window of pixels.
[0040] According to the above method, we get The number threshold of each pixel in a local window of pixels.
[0041] Furthermore, the several target directions preset in this embodiment are based on the horizontal right as 0 degrees, and rotate counterclockwise to obtain the angle corresponding to each direction. The directions corresponding to 36 degrees, 72 degrees, 108 degrees, 144 degrees, 180 degrees, 216 degrees, 252 degrees, 288 degrees, 324 degrees and 360 degrees are recorded as target directions, and this is used as an example for description.
[0042] Furthermore, in In the local window of pixels, starting from the pixel at the center, traverse pixel by pixel along the u-th target direction, and count the number threshold of each pixel traversed to form the first A quantity threshold sequence of pixels in the u-th target direction.
[0043] In the The pixel at In the number threshold sequence of target directions, when the The number threshold is greater than When the quantity threshold is reached, The quantity threshold is recorded as the target quantity threshold. The pixel at The number of target quantity thresholds in the quantity threshold sequence in the target direction is .
[0044] According to The number threshold sequence of pixels in the uth target direction is obtained The pixel at The degree of light reduction in the target direction , the specific calculation formula is as follows: Where: Indicates The pixel at The degree of light attenuation in the target direction, Indicates The pixel at The number of data contained in the quantity threshold sequence in the target direction, Indicates The pixel at The first in the sequence of number thresholds in the target direction A number threshold, Indicates The pixel at The first in the sequence of number thresholds in the target direction A number threshold, Indicates The pixel at The first in the sequence of number thresholds in the target direction indivual The increase in value, Indicates The pixel at The number of target quantity thresholds in the quantity threshold sequence in the target direction.
[0045] According to the above method, we get The degree of illumination reduction of each pixel in each target direction. The target direction corresponding to the maximum illumination attenuation degree of the pixel point in all target directions is recorded as The direction of the illumination attenuation of the pixel point; The maximum illumination reduction degree of a pixel in all target directions is recorded as The degree of illumination reduction of each pixel.
[0046] According to the above formula, the illumination attenuation direction and illumination attenuation degree of each pixel are obtained.
[0047] In the target block, the average of the illumination attenuation degrees of all pixels is recorded as the illumination attenuation degree of the target block; in the target block, the direction corresponding to the average of the angles corresponding to the illumination attenuation directions of all pixels is recorded as the illumination attenuation direction of the target block.
[0048] According to the above method, the illumination attenuation degree and illumination attenuation direction of a reference block and all neighboring blocks corresponding to each pixel to be filtered are obtained.
[0049] Step S003: According to the degree of illumination attenuation of the reference block corresponding to each pixel to be filtered and all neighboring blocks, the illumination attenuation direction and the direction perpendicular to the texture, the authenticity of the consistency of the texture intensity of the reference block corresponding to each pixel to be filtered and each neighboring block under the influence of specific illumination is obtained.
[0050] Specifically, the authenticity of the consistency of texture intensity between the reference block corresponding to the zth pixel to be filtered and the tth neighborhood block under the influence of specific lighting is , the calculation formula is as follows: Where: Indicates the authenticity of the consistency of texture intensity between the reference block corresponding to the zth pixel to be filtered and the tth neighborhood block under the influence of specific lighting, Indicates the absolute value of the difference in the degree of illumination reduction between the reference block corresponding to the zth pixel to be filtered and the tth neighborhood block, Indicates the minimum angle between the texture vertical direction of the reference block corresponding to the zth pixel to be filtered and the direction of light attenuation, Indicates the minimum angle between the texture vertical direction of the tth neighborhood block corresponding to the zth pixel to be filtered and the direction of light attenuation, represents the normalization function, Indicates The minimum angle between the reference block corresponding to the pixel to be filtered and the illumination attenuation direction of the tth neighborhood block, is an exponential function with a natural constant as the base. To present the inverse proportional relationship and normalization processing, the implementer can set the inverse proportional function and normalization function according to the actual situation. represents the absolute value function.
[0051] It should be noted that The smaller it is, the closer the illumination attenuation of the reference block corresponding to the z-th pixel to be filtered is to that of the t-th neighborhood block. The larger the value of The smaller it is, the closer the illumination attenuation direction of the reference block corresponding to the z-th pixel to be filtered is to that of the t-th neighborhood block. The larger the value of .
[0052] The above operation is performed on each reference block and neighborhood block in the image to be detected to obtain the authenticity of the consistency of texture intensity of each neighborhood block and the reference block in the image to be detected under the influence of specific lighting.
[0053] Step S004: According to the texture intensity, texture direction and authenticity of the texture intensity consistency between the reference block corresponding to each pixel to be filtered and all the neighboring blocks under the influence of specific lighting, the texture consistency between the reference block corresponding to each pixel to be filtered and each neighboring block is obtained.
[0054] Specifically, based on the texture direction and texture intensity of the reference block and the corresponding neighboring block and the authenticity of the consistency of the texture intensity of each reference block and the corresponding neighboring block under the influence of specific illumination, the texture consistency of the two is determined.
[0055] The texture consistency between the reference block corresponding to the zth pixel to be filtered and the tth neighborhood block is recorded as , the calculation formula is as follows: In the formula, is the texture consistency between the reference block corresponding to the zth pixel to be filtered and the tth neighborhood block, is the authenticity of the consistency of texture intensity between the reference block corresponding to the zth pixel to be filtered and the tth neighborhood block under the influence of specific lighting, Represents the texture intensity of the reference block corresponding to the zth pixel to be filtered, Represents the texture intensity of the tth neighborhood block corresponding to the zth pixel to be filtered, represents the normalization function, It represents the minimum angle between the texture direction of the reference block corresponding to the zth pixel to be filtered and the tth neighborhood block. is an exponential function with a natural constant as base, represents the absolute value function.
[0056] The above operation is performed on the reference block corresponding to each pixel to be filtered in the detected image and its corresponding neighborhood block to obtain the texture consistency between the reference block corresponding to each pixel to be filtered and its corresponding neighborhood block.
[0057] Step S005: According to the texture consistency between the reference block corresponding to each pixel to be filtered and each neighborhood block, obtain the filtering weight of each neighborhood block of each pixel to be filtered; according to the filtering weight of each neighborhood block of each pixel to be filtered, filter and enhance the image to be detected to obtain an enhanced image to be detected.
[0058] Based on the consistency of the texture performance of the neighborhood block and the corresponding reference block, the filtering weight of each neighborhood block is determined, where the higher the texture performance consistency, the higher the filtering weight. The pixel to be filtered The filtering weight of the neighborhood block is recorded as , and its calculation formula is as follows: Where: Indicates The pixel to be filtered The filter weights of the neighborhood blocks, is the texture consistency between the reference block corresponding to the zth pixel to be filtered and the tth neighborhood block, Indicates the number of neighborhood blocks corresponding to the zth pixel to be filtered. For the The first parameter of the pixel to be filtered.
[0059] Furthermore, according to the obtained filtering weights, all the pixels to be filtered are filtered to obtain an enhanced image to be detected.
[0060] According to the filtering weight of each neighborhood block of each pixel to be filtered, the non-local mean filtering algorithm is used to operate the image to be detected to obtain the enhanced image to be detected. Step S006: Obtaining the enhanced defect area in the image to be detected through the trained segmentation neural network.
[0061] After filtering and enhancing the image to be inspected, the neural network is directly used to identify panel defects. Specifically, the existing DNN neural network model is directly used, and then the enhanced image to be inspected is input into the network model, and the defect area in the image is directly output.
[0062] This embodiment uses a segmentation neural network to identify defect areas and normal areas in the image to be detected after segmentation enhancement.
[0063] The relevant content of the segmentation neural network is as follows: The segmentation neural network used in this embodiment is the Mask R-CNN neural network; the data set used is the enhanced image data set to be detected. Mask R-CNN is a well-known technology, and the specific method is not introduced here. The full name of Mask R-CNN in Chinese is "Mask Region-based Convolutional Neural Network", and the full name in English is "Mask Region-based Convolutional Neural Network".
[0064] The pixels that need to be segmented are divided into two categories, that is, the labeling process of the training set is: single-channel semantic label, the corresponding position pixel belongs to the normal area is labeled as 0, and the corresponding position pixel belongs to the defect area is labeled as 1.
[0065] The task of the network is classification, so the loss function used is the cross entropy loss function.
[0066] The enhanced defective area and normal area in the image to be detected are obtained by segmenting the neural network. This process is a well-known technology and the specific method will not be introduced here.
[0067] At this point, this embodiment is completed.
[0068] To sum up, in an embodiment of the present invention, the present invention also provides a visual inspection device for the main instrument panel of a new energy vehicle, the device comprising a data acquisition module, a data processing module and a mechanical control module; wherein the camera in the data acquisition module is used to collect images of the main instrument panel of the new energy vehicle, the data processing module obtains defective areas in the main instrument panel of the new energy vehicle by calling a computer program to implement the steps of a visual inspection method for the main instrument panel of the new energy vehicle, and the mechanical control module transmits the main instrument panel of the new energy vehicle with defective areas and the main instrument panel of the new energy vehicle without defective areas on the conveyor belt to different production lines.
[0069] 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 visual inspection method for the main instrument panel of a new energy vehicle, characterized in that: The method comprises the following steps: Obtain the image to be detected of the main instrument panel of the car, and obtain the noise performance level of each pixel according to the gradient of each pixel; According to the noise performance of each pixel, a number of pixels to be filtered are selected from all pixels; a reference block and all neighboring blocks corresponding to each pixel to be filtered in the image to be detected are obtained; According to the gradient of each pixel point, the texture intensity, texture direction and texture vertical direction of the reference block and all neighboring blocks corresponding to each pixel point to be filtered are obtained; According to the grayscale values of each pixel and the surrounding pixels, the degree and direction of illumination attenuation of each pixel are obtained; According to the illumination attenuation degree and illumination attenuation direction of each pixel point, the illumination attenuation degree and illumination attenuation direction of the reference block and all neighboring blocks corresponding to each pixel point to be filtered are obtained; According to the degree of illumination attenuation between the reference block corresponding to each pixel to be filtered and all neighboring blocks, the illumination attenuation direction and the direction perpendicular to the texture, the authenticity of the consistency of texture intensity between the reference block corresponding to each pixel to be filtered and each neighboring block under the influence of specific illumination is obtained; According to the texture intensity, texture direction and authenticity of the texture intensity consistency between the reference block corresponding to each pixel to be filtered and all neighboring blocks under the influence of specific illumination, the texture consistency between the reference block corresponding to each pixel to be filtered and each neighboring block is obtained; According to the texture consistency between the reference block corresponding to each pixel to be filtered and each neighborhood block, a filtering weight of each neighborhood block of each pixel to be filtered is obtained; According to the filtering weight of each neighborhood block of each pixel to be filtered, the image to be detected is filtered and enhanced to obtain an enhanced image to be detected; The enhanced defect area in the image to be detected is obtained by using the trained segmentation neural network; The specific method of obtaining the degree and direction of illumination attenuation of each pixel point according to the grayscale values of each pixel point and the surrounding pixels points is as follows: Constructed with The pixel point is the center and the size is No. A local window of pixels, The width of the preset local window; The first The gray value of each pixel is recorded as the first threshold; In the In the local window of the cth pixel in the local window of the cth pixel, the number of all pixels with gray values greater than the first threshold is recorded as The number threshold of the c-th pixel in a local window of pixels; Preset several target directions. In the local window of pixels, starting from the pixel at the center, traverse pixel by pixel along the u-th target direction, and count the number threshold of each pixel traversed to form the first A quantity threshold sequence of pixels in the u-th target direction; According to The number threshold sequence of pixels in the uth target direction is obtained The pixel at The degree of light reduction in the direction of the target; According to the The number threshold sequence of pixels in the uth target direction is obtained The pixel at The specific steps include the following: In the The pixel at In the number threshold sequence of target directions, when the The number threshold is greater than When the quantity threshold is reached, A quantity threshold is recorded as the target quantity threshold; According to The pixel at The number of target quantity thresholds in the quantity threshold sequence in the target direction is the same as the number of target quantity thresholds in the first target direction. The value of each data threshold in the number threshold sequence of pixels in the uth target direction is obtained. The pixel at The specific calculation formula for the degree of illumination attenuation in the target direction is as follows: Where: Indicates The pixel at The degree of light attenuation in the target direction, Indicates The pixel at The number of data contained in the quantity threshold sequence in the target direction, Indicates The pixel at The first in the sequence of number thresholds in the target direction A number threshold, Indicates The pixel at The first in the sequence of number thresholds in the target direction A number threshold, Indicates The pixel at The number of target quantity thresholds in the quantity threshold sequence in the target direction; The first The target direction corresponding to the maximum illumination attenuation degree of the pixel point in all target directions is recorded as The direction in which the light attenuates at each pixel; The first The maximum illumination reduction degree of a pixel in all target directions is recorded as The degree of illumination reduction of each pixel.
2. A visual inspection method for a main instrument panel of a new energy vehicle according to claim 1, characterized in that: The step of obtaining the noise performance level of each pixel point according to the gradient of each pixel point includes the following specific steps: The gradient of each pixel in the image to be detected is obtained through the Sobel operator; Will be The pixel point is the center and expands to the surrounding area to obtain a The window is denoted as A window of pixels, is the preset window width; According to The gradient of each pixel in the window of pixels is obtained The noise performance degree of each pixel point is calculated by the following formula: In the formula, Indicates The noise level of each pixel, Indicates The gradient value of a pixel, Indicates The pixel window The gradient value of a pixel, Indicates Pixels and The pixel window The angle value of the gradient of each pixel, Indicates The number of pixels contained in a window of pixels, represents the absolute value function.
3. A visual inspection method for a main instrument panel of a new energy vehicle according to claim 1, characterized in that: The specific steps of obtaining the texture intensity, texture direction and texture vertical direction of the reference block and all neighboring blocks corresponding to each pixel to be filtered according to the gradient of each pixel are as follows: Among the reference blocks and all the neighborhood blocks corresponding to the zth pixel to be filtered, any reference block or neighborhood block is recorded as the target block; The sum of the gradients of all pixels in the target block is recorded as the vector of the target block; The direction perpendicular to the vector direction of the target block is recorded as the texture direction of the target block; The direction parallel to the vector direction of the target block is recorded as the texture vertical direction of the target block; the modulus length of the vector of the target block is recorded as the texture strength of the target block.
4. A visual inspection method for a main instrument panel of a new energy vehicle according to claim 3, characterized in that: The specific steps of obtaining the illumination attenuation degree and illumination attenuation direction of the reference block and all neighboring blocks corresponding to each pixel to be filtered according to the illumination attenuation degree and illumination attenuation direction of each pixel are as follows: With the horizontal right as 0 degrees, rotate counterclockwise to get the angle corresponding to each direction; In the target block, the average of the illumination attenuation degrees of all pixels is recorded as the illumination attenuation degree of the target block; in the target block, the direction corresponding to the average of the angles corresponding to the illumination attenuation directions of all pixels is recorded as the illumination attenuation direction of the target block.
5. The visual inspection method for the main instrument panel of a new energy vehicle according to claim 1 is characterized in that: The authenticity of the consistency of texture intensity between the reference block corresponding to each pixel to be filtered and each neighboring block under the influence of specific illumination is obtained according to the illumination attenuation degree of the reference block corresponding to each pixel to be filtered and all neighboring blocks, the illumination attenuation direction and the direction perpendicular to the texture, and the specific steps include the following: In the formula, Indicates the authenticity of the consistency of texture intensity between the reference block corresponding to the zth pixel to be filtered and the tth neighborhood block under the influence of specific lighting, Indicates the absolute value of the difference in the degree of illumination reduction between the reference block corresponding to the zth pixel to be filtered and the tth neighborhood block, Indicates the minimum angle between the texture vertical direction of the reference block corresponding to the zth pixel to be filtered and the direction of light attenuation, Indicates the minimum angle between the texture vertical direction of the tth neighborhood block corresponding to the zth pixel to be filtered and the direction of light attenuation, represents the normalization function, Indicates The minimum angle between the reference block corresponding to the pixel to be filtered and the illumination attenuation direction of the tth neighborhood block, is an exponential function with a natural constant as base, represents the absolute value function.
6. A visual inspection method for a main instrument panel of a new energy vehicle according to claim 1, characterized in that: The texture consistency between the reference block corresponding to each pixel to be filtered and each neighboring block is obtained according to the texture intensity, texture direction of the reference block corresponding to each pixel to be filtered and all neighboring blocks, and the authenticity of the texture intensity consistency between the reference block corresponding to each pixel to be filtered and each neighboring block under the influence of specific illumination, including the specific formula as follows: In the formula, is the texture consistency between the reference block corresponding to the zth pixel to be filtered and the tth neighborhood block, is the authenticity of the consistency of texture intensity between the reference block corresponding to the zth pixel to be filtered and the tth neighborhood block under the influence of specific lighting, Represents the texture intensity of the reference block corresponding to the zth pixel to be filtered, Represents the texture intensity of the tth neighborhood block corresponding to the zth pixel to be filtered, represents the normalization function, It represents the minimum angle between the texture direction of the reference block corresponding to the zth pixel to be filtered and the tth neighborhood block. is an exponential function with a natural constant as base, represents the absolute value function.
7. A visual inspection method for a main instrument panel of a new energy vehicle according to claim 1, characterized in that: The specific steps of obtaining the filtering weight of each neighborhood block of each pixel to be filtered according to the texture consistency between the reference block corresponding to each pixel to be filtered and each neighborhood block are as follows: The sum of the texture consistency between the reference block corresponding to the zth pixel to be filtered and all the neighboring blocks is recorded as The first parameter of the pixel to be filtered; The texture consistency between the reference block corresponding to the zth pixel to be filtered and the tth neighborhood block is compared with the texture consistency between the tth neighborhood block and the zth pixel to be filtered. The ratio of the first parameter of the pixels to be filtered is recorded as The pixel to be filtered The filter weights of the neighborhood blocks.
8. A visual inspection device for the main instrument panel of a new energy vehicle, characterized in that: The device comprises: A data acquisition module, a data processing module and a mechanical control module; wherein the camera in the data acquisition module is used to collect images of the main instrument panel of the new energy vehicle, and the data processing module implements the claim by calling a computer program The steps of any one of the methods for visually inspecting the main instrument panel of a new energy vehicle obtain a defective area in the main instrument panel of the new energy vehicle, and the mechanical control module transmits the main instrument panel of the new energy vehicle with the defective area and the main instrument panel of the new energy vehicle without the defective area on the conveyor belt to different production lines.
Citation Information
Patent Citations
Video image transmission quality enhancement method and system
CN117408890A
Noise reduction and enhancement method for acquired image of intrinsic safety type miner lamp
CN117455802A
Decoration quality detection method and system based on artificial intelligence
CN117764967A
Rubber and metal material bonding surface treatment quality identification method
CN118154599A
Method and system for detecting screen display defects
WO2021012735A1
Cited By
Top drive drilling anomaly detection method and system based on machine vision
CN119991674A
Automobile die production quality control method based on image enhancement
CN120807352A
