CN117152151A - Motor shell quality detection method based on machine vision - Google Patents

Motor shell quality detection method based on machine vision Download PDF

Info

Publication number
CN117152151A
CN117152151A CN202311422636.0A CN202311422636A CN117152151A CN 117152151 A CN117152151 A CN 117152151A CN 202311422636 A CN202311422636 A CN 202311422636A CN 117152151 A CN117152151 A CN 117152151A
Authority
CN
China
Prior art keywords
end shell
motor
motor front
subarea
brightness
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202311422636.0A
Other languages
Chinese (zh)
Other versions
CN117152151B (en
Inventor
钱宇澄
钱卫东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xindongxin Jiangsu Machinery Technology Co ltd
Original Assignee
Xindongxin Jiangsu Machinery Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xindongxin Jiangsu Machinery Technology Co ltd filed Critical Xindongxin Jiangsu Machinery Technology Co ltd
Priority to CN202311422636.0A priority Critical patent/CN117152151B/en
Publication of CN117152151A publication Critical patent/CN117152151A/en
Application granted granted Critical
Publication of CN117152151B publication Critical patent/CN117152151B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Geometry (AREA)
  • Image Analysis (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

The invention relates to the technical field of image data processing, and provides a motor shell quality detection method based on machine vision, which comprises the following steps: acquiring a gray level diagram of a motor front end shell and a brightness diagram of the motor front end shell; acquiring the glossiness abnormal degree of each motor front end shell subarea according to the glossiness characteristics between the motor front end shell subareas on the front end shell brightness map; obtaining a structural difference value of each motor front end shell subarea according to a connected domain analysis result of the motor front end shell subarea in the front end shell brightness map; determining defect significant coefficients of the front end shell subareas of each motor based on the glossiness anomaly degree and the structure difference value of the front end shell subareas of each motor; and obtaining a quality detection result of the motor front end shell based on the significance detection result of the motor front end shell and the defect significance coefficient of the motor front end shell subregion. The invention solves the problem of false detection when the robust principal component analysis algorithm faces to the tiny defects on the motor front end shell, and improves the detection precision of the defects in the complex area of the motor front end shell.

Description

Motor shell quality detection method based on machine vision
Technical Field
The invention relates to the technical field of image processing, in particular to a motor shell quality detection method based on machine vision.
Background
The motor shell is an external protective shell arranged on motor equipment, and the materials of the motor shell are cast iron, cast aluminum alloy and the like, so that the motor shell is mainly used for protecting the motor from being influenced by rainwater, corrosion, rust and other environments, and can help the motor to dissipate heat and provide certain insulating performance. The manufacturing of the motor shell needs to be subjected to multiple working procedures, and if problems such as deviation, error or improper operation occur in the processing, quality problems such as burrs, peeling and the like can occur on the surface of the motor shell. Burrs or peelings on the motor shell can damage the flatness and smoothness of the surface of the motor shell, the attractiveness and the overall quality image of the product are reduced, the sealing performance of the shell can be possibly damaged, the performance and the service life of the motor are reduced, and the possibility of stabbing operators can occur, so that the surface quality of the motor shell is required to be detected, the quality problem in the production process is timely found, and corresponding improvement measures are further adopted.
The robust principal component analysis RPCA (Robust Principal Component Analysis) algorithm is a method of decomposing a matrix into low-rank components and sparse components, and is widely used for object recognition, video compression, defect detection, and the like. The RPCA algorithm can effectively improve the phenomenon of uneven illumination in a metal surface graph, but when the robust principal component analysis RPCA algorithm performs an industrial surface defect detection task, as the separation of defects in the graph by the algorithm depends on the difference between a defect part and a normal part, when a complex surface defect detection scene is processed, the missing detection or the false detection of tiny surface defects or surface defects similar to the normal area can be caused.
Disclosure of Invention
The invention provides a motor shell quality detection method based on machine vision, which aims to solve the problem that an RPCA algorithm is easy to misdetect when facing to a small defect on a motor front end shell, and adopts the following technical scheme:
one embodiment of the invention provides a machine vision-based motor housing quality detection method, which comprises the following steps:
acquiring a gray level diagram of a motor front end shell and a brightness diagram of the motor front end shell;
obtaining motor front end shell subareas on the motor front end shell brightness map based on the motor front end shell brightness map by adopting a map segmentation algorithm, and obtaining the glossiness abnormal degree of each motor front end shell subarea according to the glossiness characteristics between the motor front end shell subareas on the front end shell brightness map;
obtaining a structural difference value of each motor front end shell subarea according to a connected domain analysis result of the motor front end shell subarea in the front end shell brightness map;
determining defect significant coefficients of the front end shell subareas of each motor based on the glossiness anomaly degree and the structure difference value of the front end shell subareas of each motor; and obtaining a quality detection result of the motor front end shell based on the significance detection result of the motor front end shell and the defect significance coefficient of the motor front end shell subregion.
Preferably, the method for obtaining the glossiness of each motor front end housing subarea according to the glossiness characteristics between the motor front end housing subareas on the front end housing brightness map comprises the following steps:
acquiring the gloss contrast of each motor front end shell subarea based on the distribution characteristics of the pixel point brightness values in each motor front end shell subarea on the front end shell brightness map;
acquiring a flattening difference coefficient of each motor front end shell subarea based on the value difference of the brightness values of the pixel points in each motor front end shell subarea on the front end shell brightness map;
the glossiness of each motor front end shell subarea consists of a glossiness contrast ratio and a flattening difference coefficient, wherein the glossiness is in direct proportion to the glossiness contrast ratio and the flattening difference coefficient.
Preferably, the method for obtaining the gloss contrast of each motor front end shell subarea based on the distribution characteristics of the brightness values of the pixel points in each motor front end shell subarea on the front end shell brightness map comprises the following steps:
taking a histogram constructed by taking each brightness level in each front-end shell subarea as a group and taking the probability of each brightness level occurring in each front-end shell subarea as a value of a corresponding group as a brightness distribution histogram of each front-end shell subarea;
obtaining a measurement distance between the brightness distribution histograms of the front end shell subregions of all the motors and the brightness distribution histograms of the other arbitrary front end shell subregions of the motors; and taking the average value of the accumulated results of the measurement distances on all the other motor front end shell subareas as the gloss contrast of each motor front end shell subarea.
Preferably, the method for obtaining the flattening difference coefficient of each motor front end shell subarea based on the value difference of the brightness value of the pixel point in each motor front end shell subarea on the front end shell brightness map comprises the following steps:
taking the product of the standard deviation of all brightness values in each motor front end shell subarea and the number of brightness levels in each motor front end shell subarea as a first product factor;
taking the difference value of the first product factor corresponding to each motor front end housing subarea and the first product factor corresponding to any one of the rest motor front end housing subareas as a first difference value; and taking the average value of the accumulated results of the squares of the first difference values on all the other motor front end shell subareas as the flattening difference coefficient of each motor front end shell subarea.
Preferably, the method for obtaining the structural difference value of each motor front end housing subarea according to the analysis result of the connected domain of the motor front end housing subarea in the front end housing brightness map comprises the following steps:
determining a structural edge change coefficient of each motor front end housing subarea based on the change degree of the gradient direction angle of the edge point on the brightness edge in each motor front end housing subarea;
obtaining the square of the difference between the structural edge change coefficient of each motor front end shell sub-region and the structural edge change coefficient of any one of the rest motor front end shell sub-regions; and taking the average value of the accumulated results of the squares of the differences on all the other motor front end shell subareas as the structure difference value of each motor front end shell subarea.
Preferably, the method for determining the structural edge change coefficient of each motor front end housing subarea based on the change degree of the gradient direction angle of the upper edge point of the brightness edge in each motor front end housing subarea comprises the following steps:
marking the edge line of any one of the communicating areas in the front end shell subareas of each motor as a brightness edge;
forming a first-order differential sequence of a sequence according to the gradient direction angles of all pixel points on each brightness edge in an ascending order as an edge angle sequence of each brightness edge;
respectively counting the occurrence probability of each gradient direction angle on each brightness edge, and taking a sequence formed by all the probabilities as an edge distribution sequence of each brightness edge;
taking the product of the standard deviation of all elements in the edge distribution sequence of each brightness edge and the standard deviation of all elements in the edge angle sequence as a first accumulation factor;
and taking the average value of the accumulated results of the first accumulation factors on all brightness edges in each motor front end shell subarea as the structural edge change coefficient of each motor front end shell subarea.
Preferably, the method for determining the defect significant coefficient of each motor front end housing subarea based on the gloss anomaly degree and the structure difference value of each motor front end housing subarea comprises the following steps:
taking the sum of the glossiness abnormal degree of each motor front end shell subarea and a first preset parameter as a first composition factor;
taking the sum of the structural difference value of each motor front end housing subarea and a second preset parameter as a second composition factor; taking the product of the first composition factor and the second composition factor as the defect significant coefficient of each motor front end shell subarea.
Preferably, the method for obtaining the quality detection result of the motor front end shell based on the significance detection result of the motor front end shell and the defect significance coefficient of the motor front end shell subregion comprises the following steps:
inputting a gray level image of a front end shell of the motor as an algorithm, and obtaining an initial saliency image of the front end shell of the motor by adopting a saliency detection algorithm;
determining an optimized salient value of each pixel point according to the salient value of each pixel point in the initial salient map and the defect salient coefficient of each motor front end shell sub-area;
and obtaining a quality detection result of the motor front end shell according to a comparison result of the optimized salient value of each pixel point in the initial salient map and a threshold value.
Preferably, the method for determining the optimized saliency value of each pixel point according to the saliency value of each pixel point in the initial saliency map and the defect saliency coefficient of each motor front end shell sub-area includes:
taking the defect significant coefficient of each motor front end shell subarea on the front end shell brightness map as the optimization coefficient of any pixel point in the motor front end shell subarea;
taking the product of the significant value of each pixel point in the initial significant map and the optimizing coefficient of the pixel point at the same position on the front end shell brightness map as the input of the normalization function, taking the product of the output of the normalization function and the maximum value of the significant value in the initial significant map as the input of the rounding function, and taking the output of the rounding function as the optimizing significant value of each pixel point.
Preferably, the method for obtaining the quality detection result of the front end shell of the motor according to the comparison result of the optimized salient value of each pixel point in the initial salient map and the threshold value comprises the following steps:
obtaining a segmentation threshold value of the optimized significant values of all the pixel points by using a threshold segmentation algorithm, and taking the pixel points with the optimized significant values larger than the segmentation threshold value as the pixel points in the defect area of the motor front end shell; taking the pixel point with the optimized significant value smaller than the segmentation threshold value as the pixel point in the normal area of the motor front end shell;
and taking the ratio of the number of the pixels in the normal area of the front end shell of the motor in the initial saliency map to the number of the pixels in the initial saliency map as the quality inspection qualification rate of the front end shell of the motor.
The beneficial effects of the invention are as follows: according to the invention, the glossiness anomaly degree is constructed according to the influence of the surface defect of the motor front end shell on the glossiness of the motor front end shell and the distribution characteristics of the defect region and the normal region on the brightness value, so that the difference between the tiny defect region and the normal region in the surface defect of the motor front end shell can be increased; and secondly, a structural difference value is constructed according to the difference between the surface defect of the motor front end shell and the structures such as the surface holes, the bosses and the like of the motor front end shell, the influence of the surface structure of the motor front end shell on the detection of the micro defect area in the surface defect of the motor front end shell is reduced, a larger weight is given to pixel points with larger defect significant coefficients based on the gloss anomaly degree and the structural difference value, the significance of the micro defect on the surface of the motor front end shell in a Robust Principal Component Analysis (RPCA) algorithm is improved, and the detection effect of the Robust Principal Component Analysis (RPCA) algorithm on the micro defect area on the surface of the motor front end shell is enhanced.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the description below are only some embodiments of the invention, and that other drawings can be obtained according to these drawings without inventive faculty for a person skilled in the art.
Fig. 1 is a flow chart of a machine vision-based motor housing quality detection method according to an embodiment of the present invention;
fig. 2 is a schematic structural view of a front end housing of a motor according to an embodiment of the present invention;
fig. 3 is a flowchart of an implementation of a machine vision-based motor housing quality detection method according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, a flow chart of a machine vision-based motor housing quality detection method according to an embodiment of the invention is shown, the method includes the following steps:
and S001, acquiring a gray level diagram of a front end shell of the motor and a brightness diagram of the front end shell of the motor.
The motor housing generally includes a casing and a front end cover, and in the present invention, the front end cover in the aluminum servo motor housing is used as a quality detection object, and for convenience of the following description, the aluminum servo motor housing is described as a motor front end housing. Firstly, an industrial CCD camera is used for shooting right above a motor front end shell, an RGB image of the motor front end shell is obtained, and the RGB image is recorded as a motor front end shell image. Because noise exists in the acquired images in the shooting process of the camera and the transmission process of the images, the noise is removed from the motor housing images by adopting median filtering so as to reduce the influence of the noise on the subsequent image processing, wherein bilateral filtering is a known technology and is not repeated. And secondly, converting the denoised motor front end shell image into a gray image to obtain the motor front end shell gray image. And converting the denoised motor front end shell map into an HLS color space to obtain a brightness channel map in the HLS color space, and recording the brightness channel map as a motor front end shell brightness map.
And obtaining a gray level diagram of the motor front end shell and a brightness diagram of the motor front end shell, and analyzing the characteristics of the diagram on the motor front end shell subsequently.
And step S002, acquiring the glossiness abnormal degree of each motor front end shell subarea according to the glossiness characteristics between the motor front end shell subareas on the front end shell brightness map.
Since the color difference between the tiny defect areas such as burrs and bubbles on the surface of the front end shell of the motor and the normal area is small, and the structures such as holes and bosses on the surface of the front end shell of the motor can form convex or concave parts, as shown in fig. 2, the reflection or refraction of light rays can be caused, so that the outline edges of the bosses and the holes and the tiny defects nearby the boss and the holes cannot be clearly displayed, and further the tiny defects are missed or false detected. Therefore, the invention improves the contrast ratio of the micro defect area and the normal area through the distribution characteristic of the defect area on the surface of the motor front end shell in the surface diagram and the difference between the defect area and the areas such as holes, bosses and the like, so as to enhance the detection effect of the robust principal component analysis RPCA (Robust Principal Component Analysis) algorithm on the micro defect area on the surface of the motor front end shell.
Specifically, firstly, a Canny edge detection algorithm is used for processing a gray level diagram of a front end shell of a motor to obtain a binarized diagram, wherein the Canny edge detection algorithm is a known technology and is not repeated. And secondly, carrying out connected domain analysis on the obtained binarization map to obtain a plurality of connected domains, screening out the connected domain with the largest number of pixels, and taking the corresponding region of the connected domain in the motor front-end shell gray level map as the motor front-end shell region in the motor front-end shell gray level map.
Further, the motor front end shell region is segmented by adopting a simple linear iterative clustering SLIC (Simple Linear Iterative Cluster) algorithm, the motor front end shell region is used as input of an SLIC algorithm, the output of the SLIC algorithm is N sub-regions obtained by segmentation of the motor front end shell region, the SLIC algorithm is a known technology, the specific process is not repeated, each sub-region is used as a motor front end shell sub-region, the size of N is taken as an experimental value 128, and an operator can select a proper experimental value according to the actual size of the motor front end shell.
Because the surface of the front end shell of the motor has serious surface defects such as cracks, corrosion, scratches and the like, an oxide layer on the surface of the front end shell of the motor can be damaged, and tiny defect areas such as burrs, bubbles and the like can cause the surface of the front end shell of the motor to have the concave-convex or undulating phenomenon, so that the flatness of an oxide film on the surface and the glossiness of the surface of the oxide film are reduced. Therefore, the invention screens out the area suspected of the surface defect of the motor front end shell through the difference of the oxide film on the surface of the motor front end shell between different areas.
Specifically, for any motor front end housing subarea, taking the ith motor front end housing subarea as an example, calculating brightness values of all pixel points in the ith front end housing subarea, and taking each unequal brightness value as a brightness level. Secondly, counting the number of pixel points contained in each brightness level, and taking the ratio of the number of pixel points contained in each brightness level to the total number of pixel points in the ith motor front end housing subarea as the probability of each brightness level in the ith motor front end housing subarea. Taking each brightness level in the ith front-end housing subarea as a group, taking the probability of each brightness level appearing in the ith front-end housing subarea as a value of the corresponding group, taking a histogram constructed by all brightness levels and the value of each brightness level corresponding group as the brightness distribution of the ith front-end housing subareaHistogram A i . Based on the above analysis, a gloss anomaly is constructed here to characterize the likelihood of defects in each front end housing subregion, and the gloss anomaly L for the ith front end housing subregion is calculated i
Wherein S is i Is the gloss contrast of the ith front end housing subregion, N is the number of front end housing subregions, j is the jth front end housing subregion remaining except for the ith front end housing subregion, A i 、A j The luminance distribution histogram, bd (A) i ,A j ) Is a histogram A i 、A j The calculation process of the Babbitt distance between the two is a known technology, and the specific process is not repeated;
P i is the flatness difference coefficient of the i-th front end housing subregion,the standard deviation of the brightness values of the pixel points in the ith and jth front end housing subareas are respectively n i 、n j The number of brightness levels in the ith and jth front end housing sub-regions, respectively;
L i is the gloss anomaly of the i-th front end housing subregion.
When the surface of the front end shell of the motor has defects, the surface defects such as cracks, corrosion, scratches and the like on the surface of the front end shell of the motor can damage the oxide film on the surface of the front end shell of the motor, so that the reflection and refraction degree of light rays in the areas are lower, the brightness of the defective areas is darker, the glossiness is obviously reduced, and the brightness is improvedIn this way, when there is a defect in the i-th motor front end housing subregion, the greater the difference between the luminance distribution histograms corresponding to the i-th and j-th front end housing subregions, bd (a) i ,A j ) The greater the value of (2); the smaller the flatness of the i-th motor front end housing subregion is, the more uneven the brightness distribution of the i-th motor front end housing subregion is,the larger the value of (2), the first product factor +.>The greater the value of (2); i.e. L i The greater the value of (a) is, the higher the degree of abnormality of the oxide film covered on the surface of the i-th motor front end housing subregion is, and the more likely a defective region is present in the i-th motor front end housing subregion.
The glossiness anomaly of each motor front end shell subarea is obtained so as to be used for determining defect significant coefficients of each motor front end shell subarea subsequently.
Step S003, obtaining a structural difference value of each motor front end shell subarea according to a connected domain analysis result of the motor front end shell subarea in the front end shell brightness map; and determining the defect significance coefficient of each motor front end housing subarea based on the glossiness anomaly degree and the structural difference value of each motor front end housing subarea.
On the other hand, the color difference value between the holes on the surface of the motor front end shell and the nearby area is larger, namely, the color difference value is represented as larger brightness difference, and the boss on the surface of the motor front end shell forms a convex or concave part on the surface of the boss, so that the surface unevenness condition can also occur in the area where the contour edge of the boss is located, the contour shape of the holes on the surface of the motor front end shell and the boss is generally arc-shaped, and the contour shape of the surface defect is generally unfixed, therefore, the surface defect area of the motor front end shell can be distinguished according to the contour difference between the surface defect of the motor front end shell, the holes and the boss.
Specifically, an edge detection algorithm is used to obtain an edge line in a sub-area of a front end shell of each motor, for example, a luminance map corresponding to the sub-area of the front end shell of the ith motor is processed by a canny edge detection technology to obtain a binarization map corresponding to the luminance map, further, a connected domain extraction algorithm is used to obtain all connected domains on the binarization map, each connected domain corresponds to a hole, a boss outline or a defect area on the surface of the front end shell of the motor, and the edge line of any connected domain is marked as a luminance edge, wherein the canny edge detection and the connected domain are extracted as known techniques, and specific processes are not repeated.
Further, the gradient direction angles of all the upper edge points of the brightness edges in the front end shell sub-area of each motor are obtained by utilizing a sobel operator, an edge angle sequence and an edge distribution sequence are constructed according to the gradient direction angles of the upper edge points of each brightness edge in the front end shell sub-area of each motor, and the calculation of the gradient angles by the sobel operator is a known technology, and the specific process is not repeated. With the p-th brightness edge Y in the i-th motor front end housing sub-area ip For example, the luminance edge Y is obtained ip The gradient direction angles of all the edge points are formed into a sequence according to ascending order to be used as a first edge sequence, and the first differential sequence of the first edge sequence is used as a brightness edge Y ip Edge angle sequence B of (2) ip The method comprises the steps of carrying out a first treatment on the surface of the Secondly, calculating brightness edges Y by taking each unequal gradient direction angle as one gradient direction angle ip The probability of each gradient direction angle is presented, and the brightness edge Y is obtained ip The sequence consisting of the probability of occurrence of all gradient direction angles is taken as a brightness edge Y ip Edge distribution sequence C of (2) ip . Acquiring a structural difference value V of the ith motor front end housing subarea based on edge angle sequences and edge distribution sequences of all brightness edges in the ith motor front end housing subarea i
In U i Is the i-th motor front end housing subareaCoefficient of structural edge variation, N 1 Is the number of brightness edges in the i-th motor front end housing sub-area, B ip 、C ip The sequence of the edge angles and the sequence of the edge distribution of the p-th brightness edge in the sub-area of the front end shell of the ith motor,the standard deviation of the elements in the edge angle sequence are respectively;
V i is the structural difference value of the i-th motor front end housing subarea, N is the number of the motor front end housing subareas, U j Is the structural edge variation coefficient of the jth front end housing subregion remaining except for the ith front end housing subregion.
Wherein, the more uniform the change between the angles of the gradient direction corresponding to the upper edge point of the p-th brightness edge in the front end shell area of the ith motor, the more stable the distribution of elements in the edge angle sequence,the smaller the value of (2); the higher the degree of regularity of the p-th brightness edge corresponding to the connected domain in the i-th motor front end shell sub-region is, the edge distribution sequence C ip The more uniform the probability of occurrence of the elements +.>The smaller the value of (2), the first accumulation factor +.>The smaller the value of (2); the greater the probability that there is a non-motor front end housing surface hole, contour edge of the boss in the i-th motor front end housing subregion, the more likely the i-th motor front end housing subregion contains the edge of the defective region, the greater the difference between the i-th motor front end housing subregion and the remaining motor front end housing subregions>The greater the value of (2); i.e. V i The larger the value of (c) is, the greater the probability of a defective region being present in the i-th motor front end housing sub-region.
According to the steps, the gloss abnormal degree and the structure difference value of all the motor front end shell subregions are respectively obtained. And determining a defect significance coefficient of each motor front end housing subregion based on the gloss anomaly and the structural difference value of each motor front end housing subregion. The calculation formula of the defect significant coefficient w (i) of the ith motor front end housing subarea is as follows:
wherein w (i) is defect significance coefficients of i motor front end housing subregions, L i 、V i The gloss anomaly and the structure difference values of the front end shell subregions of the i motors are respectively,respectively the proportionality coefficient, for preventing L i Or V i Effect on the calculation result at 0, +.>The magnitude of (2) is respectively taken as an empirical value of 1.
Wherein, the higher the probability of defects existing in the front end housing subregion of the ith motor, L i 、V i The larger the value of (a) is, the first composition factorSecond component factor->The greater the value of w (i), and correspondingly, the greater the degree of significance of the ith motor front end housing subregion in the motor front end luminance map.
So far, the defect significant coefficient of each motor front end shell subarea in the front end shell brightness map is obtained and used for calculating the subsequent quality inspection qualification rate.
And S004, obtaining a quality detection result of the motor front end shell based on the significance detection result of the motor front end shell and the defect significance coefficient of the motor front end shell subregion.
Motor front-based on Robust Principal Component Analysis (RPCA) algorithmAnd (3) detecting the significance of the gray level diagram of the motor front end shell of the end shell. The specific process is as follows: the size of the gray scale of the motor front end shell is recorded asTaking the gray value of each pixel point on the gray map of the front end shell of the motor as one element in the matrix based on +.>The gray value gives a magnitude of +.>Taking the gray value matrix as the input of a Robust Principal Component Analysis (RPCA) algorithm to obtain a sparse matrix E corresponding to the gray value matrix, wherein the punishment parameter in the algorithm takes experience value +_>Acquiring a significant value of each pixel point in a gray level diagram of a front end shell of a motor based on a sparse matrix E, wherein the significant value h of an a pixel point is a significant value h of a pixel point a a The calculation formula of (2) is as follows:
in the formula, h a Is the salient value of the a pixel point, X (a) is the column vector of the pixel point a corresponding to the element in the sparse matrix E,is the 1 st order norm of column vector X (a).
According to the steps, the salient value of each pixel point is obtained, and an image formed by the salient values of all the pixel points according to the position sequence in the gray level image of the motor front end shell is used as an initial salient image of the motor front end shell. Secondly, determining an optimized saliency value of each pixel point according to the saliency value of each pixel point in the initial saliency map and the defect saliency coefficient of each motor front end shell sub-region, and specifically taking the defect saliency coefficient of each motor front end shell sub-region on the front end shell brightness map as each motor front end shell sub-regionThe defect significant coefficient w (i) of the i-th motor front end housing sub-region is the optimization coefficient of each pixel in the i-th motor front end housing sub-region. Calculating an optimized saliency value H of the a pixel point a
Wherein H is a Is the optimized saliency value of the a-th pixel point, round () is a rounding function, norm () is a normalization function, w a Is the defect significant coefficient of the motor front end shell subregion where the a pixel point is positioned, h a Is the salient value of the a pixel point, h max Is the maximum of the saliency values of all pixels in the initial saliency map.
According to the steps, the optimized significant value of each pixel point is calculated respectively, and the quality detection result of the front end shell of the motor is obtained based on the optimized significant value, and the implementation flow of the quality detection of the front end shell of the motor is shown in fig. 3. Secondly, obtaining a segmentation threshold value of the optimized significant value of all the pixel points by using an Ojin threshold segmentation algorithm, and taking the pixel points with the optimized significant value larger than the segmentation threshold value as the pixel points in the motor front end shell defect area; and taking the pixel points with the optimized significant value smaller than the segmentation threshold value as the pixel points in the normal area of the motor front end shell. And counting all pixel points belonging to a normal area of the motor front end shell in the initial saliency map, and taking the ratio of the number of the pixel points in the normal area of the motor front end shell in the initial saliency map to the number of the pixel points in the initial saliency map as the quality inspection qualification rate of the motor front end shell.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. The foregoing description of the preferred embodiments of the present invention is not intended to be limiting, but rather, any modifications, equivalents, improvements, etc. that fall within the principles of the present invention are intended to be included within the scope of the present invention.

Claims (10)

1. The motor shell quality detection method based on machine vision is characterized by comprising the following steps of:
acquiring a gray level diagram of a motor front end shell and a brightness diagram of the motor front end shell;
obtaining motor front end shell subareas on the motor front end shell brightness map based on the motor front end shell brightness map by adopting a map segmentation algorithm, and obtaining the glossiness abnormal degree of each motor front end shell subarea according to the glossiness characteristics between the motor front end shell subareas on the front end shell brightness map;
obtaining a structural difference value of each motor front end shell subarea according to a connected domain analysis result of the motor front end shell subarea in the front end shell brightness map;
determining defect significant coefficients of the front end shell subareas of each motor based on the glossiness anomaly degree and the structure difference value of the front end shell subareas of each motor; and obtaining a quality detection result of the motor front end shell based on the significance detection result of the motor front end shell and the defect significance coefficient of the motor front end shell subregion.
2. The machine vision based motor housing quality detection method according to claim 1, wherein the method for obtaining the gloss anomaly of each motor front end housing subarea according to the gloss characteristics between the motor front end housing subareas on the front end housing brightness map comprises the steps of:
acquiring the gloss contrast of each motor front end shell subarea based on the distribution characteristics of the pixel point brightness values in each motor front end shell subarea on the front end shell brightness map;
acquiring a flattening difference coefficient of each motor front end shell subarea based on the value difference of the brightness values of the pixel points in each motor front end shell subarea on the front end shell brightness map;
the glossiness of each motor front end shell subarea consists of a glossiness contrast ratio and a flattening difference coefficient, wherein the glossiness is in direct proportion to the glossiness contrast ratio and the flattening difference coefficient.
3. The machine vision based motor housing quality detection method according to claim 2, wherein the method for obtaining the gloss contrast of each motor front end housing subarea based on the distribution characteristics of the pixel point brightness values in each motor front end housing subarea on the front end housing brightness map is as follows:
taking a histogram constructed by taking each brightness level in each front-end shell subarea as a group and taking the probability of each brightness level occurring in each front-end shell subarea as a value of a corresponding group as a brightness distribution histogram of each front-end shell subarea;
obtaining a measurement distance between the brightness distribution histograms of the front end shell subregions of all the motors and the brightness distribution histograms of the other arbitrary front end shell subregions of the motors; and taking the average value of the accumulated results of the measurement distances on all the other motor front end shell subareas as the gloss contrast of each motor front end shell subarea.
4. The machine vision-based motor housing quality detection method according to claim 2, wherein the method for obtaining the flatness difference coefficient of each motor front end housing subarea based on the value difference of the pixel point brightness value in each motor front end housing subarea on the front end housing brightness map is as follows:
taking the product of the standard deviation of all brightness values in each motor front end shell subarea and the number of brightness levels in each motor front end shell subarea as a first product factor;
taking the difference value of the first product factor corresponding to each motor front end housing subarea and the first product factor corresponding to any one of the rest motor front end housing subareas as a first difference value; and taking the average value of the accumulated results of the squares of the first difference values on all the other motor front end shell subareas as the flattening difference coefficient of each motor front end shell subarea.
5. The machine vision-based motor housing quality detection method according to claim 1, wherein the method for obtaining the structural difference value of each motor front end housing subarea according to the connected domain analysis result of the motor front end housing subarea in the front end housing brightness map is as follows:
determining a structural edge change coefficient of each motor front end housing subarea based on the change degree of the gradient direction angle of the edge point on the brightness edge in each motor front end housing subarea;
obtaining the square of the difference between the structural edge change coefficient of each motor front end shell sub-region and the structural edge change coefficient of any one of the rest motor front end shell sub-regions; and taking the average value of the accumulated results of the squares of the differences on all the other motor front end shell subareas as the structure difference value of each motor front end shell subarea.
6. The machine vision based motor housing quality detection method according to claim 5, wherein the method for determining the structural edge change coefficient of each motor front end housing sub-area based on the degree of change of the gradient direction angle of the upper edge point of the brightness edge in each motor front end housing sub-area comprises:
marking the edge line of any one of the communicating areas in the front end shell subareas of each motor as a brightness edge;
forming a first-order differential sequence of a sequence according to the gradient direction angles of all pixel points on each brightness edge in an ascending order as an edge angle sequence of each brightness edge;
respectively counting the occurrence probability of each gradient direction angle on each brightness edge, and taking a sequence formed by all the probabilities as an edge distribution sequence of each brightness edge;
taking the product of the standard deviation of all elements in the edge distribution sequence of each brightness edge and the standard deviation of all elements in the edge angle sequence as a first accumulation factor;
and taking the average value of the accumulated results of the first accumulation factors on all brightness edges in each motor front end shell subarea as the structural edge change coefficient of each motor front end shell subarea.
7. The machine vision-based motor housing quality detection method according to claim 1, wherein the method for determining the defect significance factor of each motor front end housing subregion based on the gloss anomaly and the structure difference value of each motor front end housing subregion is as follows:
taking the sum of the glossiness abnormal degree of each motor front end shell subarea and a first preset parameter as a first composition factor;
taking the sum of the structural difference value of each motor front end housing subarea and a second preset parameter as a second composition factor; taking the product of the first composition factor and the second composition factor as the defect significant coefficient of each motor front end shell subarea.
8. The machine vision-based motor housing quality detection method according to claim 1, wherein the method for obtaining the motor front-end housing quality detection result based on the motor front-end housing saliency detection result and the motor front-end housing sub-region defect saliency coefficient is as follows:
inputting a gray level image of a front end shell of the motor as an algorithm, and obtaining an initial saliency image of the front end shell of the motor by adopting a saliency detection algorithm;
determining an optimized salient value of each pixel point according to the salient value of each pixel point in the initial salient map and the defect salient coefficient of each motor front end shell sub-area;
and obtaining a quality detection result of the motor front end shell according to a comparison result of the optimized salient value of each pixel point in the initial salient map and a threshold value.
9. The machine vision based motor housing quality detection method according to claim 8, wherein the method for determining the optimized saliency value of each pixel point according to the saliency value of each pixel point in the initial saliency map and the defect saliency coefficient of each motor front end housing sub-area comprises:
taking the defect significant coefficient of each motor front end shell subarea on the front end shell brightness map as the optimization coefficient of any pixel point in the motor front end shell subarea;
taking the product of the significant value of each pixel point in the initial significant map and the optimizing coefficient of the pixel point at the same position on the front end shell brightness map as the input of the normalization function, taking the product of the output of the normalization function and the maximum value of the significant value in the initial significant map as the input of the rounding function, and taking the output of the rounding function as the optimizing significant value of each pixel point.
10. The machine vision based motor housing quality detection method according to claim 8, wherein the method for obtaining the motor front end housing quality detection result according to the comparison result of the optimized saliency value of each pixel point in the initial saliency map and the threshold value is as follows:
obtaining a segmentation threshold value of the optimized significant values of all the pixel points by using a threshold segmentation algorithm, and taking the pixel points with the optimized significant values larger than the segmentation threshold value as the pixel points in the defect area of the motor front end shell; taking the pixel point with the optimized significant value smaller than the segmentation threshold value as the pixel point in the normal area of the motor front end shell;
and taking the ratio of the number of the pixels in the normal area of the front end shell of the motor in the initial saliency map to the number of the pixels in the initial saliency map as the quality inspection qualification rate of the front end shell of the motor.
CN202311422636.0A 2023-10-31 2023-10-31 Motor shell quality detection method based on machine vision Active CN117152151B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311422636.0A CN117152151B (en) 2023-10-31 2023-10-31 Motor shell quality detection method based on machine vision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311422636.0A CN117152151B (en) 2023-10-31 2023-10-31 Motor shell quality detection method based on machine vision

Publications (2)

Publication Number Publication Date
CN117152151A true CN117152151A (en) 2023-12-01
CN117152151B CN117152151B (en) 2024-02-02

Family

ID=88901118

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311422636.0A Active CN117152151B (en) 2023-10-31 2023-10-31 Motor shell quality detection method based on machine vision

Country Status (1)

Country Link
CN (1) CN117152151B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114842213A (en) * 2022-05-16 2022-08-02 北斗星通智联科技有限责任公司 Obstacle contour detection method and device, terminal equipment and storage medium
CN115018844A (en) * 2022-08-09 2022-09-06 南通三信塑胶装备科技股份有限公司 Plastic film quality evaluation method based on artificial intelligence
CN115345821A (en) * 2022-05-16 2022-11-15 西南石油大学 Steel coil binding belt loosening abnormity detection and quantification method based on active visual imaging
CN115641329A (en) * 2022-11-15 2023-01-24 武汉惠强新能源材料科技有限公司 Lithium battery diaphragm defect detection method and system
CN116721106A (en) * 2023-08-11 2023-09-08 山东明达圣昌铝业集团有限公司 Profile flaw visual detection method based on image processing
CN116758083A (en) * 2023-08-21 2023-09-15 浙江莫克智造有限公司 Quick detection method for metal wash basin defects based on computer vision

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114842213A (en) * 2022-05-16 2022-08-02 北斗星通智联科技有限责任公司 Obstacle contour detection method and device, terminal equipment and storage medium
CN115345821A (en) * 2022-05-16 2022-11-15 西南石油大学 Steel coil binding belt loosening abnormity detection and quantification method based on active visual imaging
CN115018844A (en) * 2022-08-09 2022-09-06 南通三信塑胶装备科技股份有限公司 Plastic film quality evaluation method based on artificial intelligence
CN115641329A (en) * 2022-11-15 2023-01-24 武汉惠强新能源材料科技有限公司 Lithium battery diaphragm defect detection method and system
CN116721106A (en) * 2023-08-11 2023-09-08 山东明达圣昌铝业集团有限公司 Profile flaw visual detection method based on image processing
CN116758083A (en) * 2023-08-21 2023-09-15 浙江莫克智造有限公司 Quick detection method for metal wash basin defects based on computer vision

Also Published As

Publication number Publication date
CN117152151B (en) 2024-02-02

Similar Documents

Publication Publication Date Title
CN115170576B (en) Aluminum pipe surface defect detection method based on machine vision
CN116721106B (en) Profile flaw visual detection method based on image processing
CN111383209B (en) Unsupervised flaw detection method based on full convolution self-encoder network
CN115100221B (en) Glass defect segmentation method
CN107490582B (en) Assembly line workpiece detection system
CN115063430B (en) Electric pipeline crack detection method based on image processing
CN115345885A (en) Method for detecting appearance quality of metal fitness equipment
CN113628189B (en) Rapid strip steel scratch defect detection method based on image recognition
CN115063423B (en) Self-adaptive identification method for cold and hot cracks of mechanical castings based on computer vision
CN114972326A (en) Defective product identification method for heat-shrinkable tube expanding process
CN116758083B (en) Quick detection method for metal wash basin defects based on computer vision
CN116758075B (en) Artificial intelligence-based blower motor operation fault detection method
CN116030060B (en) Plastic particle quality detection method
CN115063407B (en) Scratch and crack identification method for annular copper gasket
CN116883408B (en) Integrating instrument shell defect detection method based on artificial intelligence
CN114972892B (en) Automobile brake pad defect classification method based on computer vision
CN112991305A (en) Visual inspection method for surface defects of paint spraying panel
CN115272335A (en) Metallurgical metal surface defect detection method based on significance detection
CN116402810B (en) Image processing-based lubricating oil anti-abrasive particle quality detection method
CN110648330A (en) Defect detection method for camera glass
CN115272350A (en) Method for detecting production quality of computer PCB mainboard
CN117274113B (en) Broken silicon wafer cleaning effect visual detection method based on image enhancement
CN115330796A (en) Copper wire tinning defect identification method
CN114881961A (en) Glass fiber plate crack detection method and device
CN117152129B (en) Visual detection method and system for surface defects of battery cover plate

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant