On-line detection method and system for appearance of plane flange on automobile oil pump
Through a multi-mode controllable lighting system and intelligent detection strategy, combined with multi-light source cross-validation and dynamic decision-making models, the problem of difficult detection of tiny defects on the flange surface is solved, efficient and accurate flange appearance inspection is achieved, and detection efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202511307701.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-15
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-09-15
AI Technical Summary
In the existing technology, due to the single fixed lighting conditions, it is difficult to comprehensively and accurately detect various complex and tiny defects on the flange surface, and the randomness of the selection of detection objects leads to a bottleneck in online detection efficiency.
By adopting a multi-mode controllable lighting system, full flange target pre-identification and multi-light source image batch acquisition, combined with an intelligent detection object selection strategy and a dynamic decision-making model, through cluster screening, reflectivity calculation, multi-light source cross-validation and a dynamic decision-making model, efficient, accurate and comprehensive online appearance inspection of flat flanges on automotive oil pumps can be achieved.
It effectively solves the problem of defects being hidden due to insufficient contrast, shadows or glare under single lighting conditions, significantly improves the recognition accuracy and detection efficiency of tiny defects, and ensures full coverage of the flange surface and optimal allocation of resources.
Smart Images

Figure CN120807520A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of flange surface defect detection, and more particularly to an online detection method and system for the appearance of a flat flange on an automobile oil pump. BACKGROUND
[0002] In modern automobile manufacturing, the strict requirements for product quality run through all aspects of component production. As a core component in the automobile fuel supply system, the performance of the oil pump directly affects the fuel economy, emission standards and even the running safety of the vehicle. Among them, the surface appearance integrity and defect-free of the flat flange on the oil pump, as a key installation and sealing interface, is particularly important. Any small scratches, pits, stains or foreign matter may cause poor assembly, sealing failure, and even serious consequences such as fuel leakage and system failure. Therefore, in the manufacturing process of the oil pump flange, efficient and accurate appearance detection of the flat flange has become an indispensable quality control checkpoint, and its importance continues to be highlighted with the increasing automation of the automobile industry and the increasingly stringent requirements for product reliability.
[0003] Currently, fixed-position industrial cameras, simple light sources and basic image processing algorithms are usually introduced to assist manual completion of some repetitive or high-precision identification tasks. For example, by placing a camera at a fixed station and cooperating with background light or ring light, the flange profile is roughly identified, or some obvious large-area defects are preliminarily screened. Such systems have improved the objectivity and efficiency of detection to some extent, and have played a positive role in replacing some repetitive labor. They try to make preliminary quality judgments on the flange surface by limiting the detection area and acquiring images under specific lighting conditions, thereby making up for the shortcomings of pure manual visual inspection and meeting the basic requirements of product quality control in a specific historical period.
[0004] However, the above detection method can only highlight some defects or not highlight defects under a fixed and single direction or uniform intensity of light conditions. It may be difficult to identify or even completely hidden due to insufficient contrast, shadow shielding or excessive reflection (glare). In addition, when there are multiple objects to be detected, random selection will cause the camera resources or image processing module computing resources to be not optimally configured, and parallel processing or sequence optimization cannot be achieved, thereby significantly reducing the overall detection efficiency. SUMMARY
[0005] In view of the deficiencies in the prior art, the present application aims to overcome the inherent limitations in the prior art that the single fixed lighting condition makes it difficult to detect various complex and small defects on the flange surface accurately and comprehensively, and the online detection efficiency bottleneck problem caused by the randomness of the selection of the detection object. Therefore, the application provides a method and system for online appearance detection of a flat flange on an automobile oil pump.
[0006] To achieve the above object, the application provides the following technical scheme. A method for online appearance detection of a flat flange on an automobile oil pump comprises the following steps. A clustering and screening step is used to acquire an initial panoramic image of a camera covering a detection area under ambient light, identify the coordinate position and orientation information of each flange according to the initial panoramic image, cluster the flanges according to the orientation information, and select the cluster with the largest number as a preferred class. A first detection object positioning step is used to select the flange with the smallest distance from a preset reference point as the first detection object in the preferred class. A detection image acquisition step is used to acquire images taken by the camera when a plurality of controllable independent light sources above the detection area are activated in sequence as an image dataset. A first detection image analysis step is used to extract the first detection object from the image dataset, determine the real defect points by calculating the reflectivity, and locate the defect sensitive light source set according to the real defect points. A subsequent detection object selection step is used to select the flange with the smallest Euclidean distance from the center point of the first detection object as a candidate detection object in the preferred class. When there are at least two candidate detection objects with the same or similar Euclidean distances, a preset double-branch dynamic decision model is triggered to select the next detection object. The next detection object is subjected to defect analysis until all flanges in the preferred class are fully detected. Then, the flanges in the non-preferred class are re-clustered according to the orientation information, and the flange with the largest number in the cluster is selected for detection based on the last detected flange in the preferred class as a new reference. This process is repeated until all flanges in the detection area are fully detected. A detection result summarizing step is used to generate a visual report of the defect points in the detected flanges.
[0007] Further, the first detection image analysis step includes a defect identification strategy, which comprises: A reflectivity calculation sub-step is used to extract the first detection object from each image acquired under different independent light sources, extract the pixel-level gray value, calculate the average gray value, and calculate the normalized reflectivity of the first detection object under each independent light source according to the intensity of the independent light source. A defect positioning sub-step is used to identify the candidate defect position in the first detection object by the reflectivity threshold method according to the normalized reflectivity. In the multi-light source cross-validation sub-step, the number of times the same pixel position is marked as a candidate defect in images under different independent light sources is greater than or equal to a preset judgment threshold, then the position is determined to be a real defect point.
[0008] Furthermore, the first inspection image analysis step also includes a positioning strategy for the defect-sensitive light source set, which includes calculating the grayscale gradient value in each image under different independent light sources based on the actual defect point, and then sorting them according to the grayscale gradient amplitude, and selecting the light sources with the highest grayscale gradient amplitude to form the defect-sensitive light source set.
[0009] Furthermore, the dual-branch dynamic model includes a defect scene sub-model and a non-defect scene sub-model. When the first inspection object has defects, the defect scene sub-model is triggered to calculate the comprehensive fitness score of each object to be inspected and the first inspection object, and the next inspection object is selected based on the comprehensive fitness score. When the first inspection object does not have defects, the non-defect scene sub-model is triggered to calculate the comprehensive stability score of each object to be inspected, and the next inspection object is selected based on the comprehensive stability score.
[0010] Furthermore, the defect scene sub-model performs light source sensitivity weight calculation, reflectance similarity calculation and comprehensive fitness score calculation. The light source sensitivity weight calculation includes calculating the weight according to the grayscale gradient value corresponding to each independent light source in the defect sensitive light source set; the reflectance similarity calculation includes calculating the reflectance of the object to be inspected under each independent light source, calculating the reflectance deviation rate of the corresponding positions of the object to be inspected and the first inspection object under the same light source, and calculating the similarity according to the reflectance deviation rate; the comprehensive fitness score calculation includes calculating the comprehensive fitness score according to the light source sensitivity weight and the reflectance similarity.
[0011] Furthermore, the defect-free scene sub-model performs coverage balance index calculation, reference light source adaptability calculation and comprehensive stability score calculation. The coverage balance index calculation includes calculating the mean reflectivity of the object to be inspected under each independent light source, calculating the reflectivity standard deviation based on the mean reflectivity, and then calculating the balance score based on the reflectivity standard deviation; the reference light source adaptability calculation includes determining a group of three reference light sources with the smallest reflectivity variation coefficient to form a reference light source set, calculating the average difference between the reflectivity of the object to be inspected under each independent light source in the reference light source set and the reflectivity of the first inspection object under the same light source, and calculating the reference adaptation score based on the average difference; the comprehensive stability score calculation includes calculating the comprehensive stability score based on the balance score and the reference adaptation score.
[0012] Further, the light source consistency verification step is further included, when the flange is placed in the detection area, the background image of the detection area is captured by the camera under the activation of each independent light source in turn, the background gray mean value is calculated by analyzing the gray value of the background image, and whether the maximum deviation rate of the background gray mean value generated by each independent light source in the detection area is less than the preset threshold is judged, if not, each independent light source is adjusted to make the maximum deviation rate less than the preset threshold.
[0013] Further, the reflectivity reference calibration step is further included, the standard flange without defects is placed in the detection area, the flange image is captured by the camera under the activation of each independent light source in turn, and the average pixel gray value of the flange image is calculated, and the initial reflectivity reference matrix of the reflectivity calibration coefficient is established according to the average pixel gray value, the reflectivity parameter of the flange known and the intensity of the independent light source.
[0014] Further, the clustering screening step, if there are multiple clustering clusters with the same maximum number of flanges, the average angle of orientation of the clusters with the same number is compared with the included angle of the camera optical axis, and the cluster with the smallest included angle is selected as the preferred class.
[0015] An online detection system for the appearance of the planar flange on the oil pump of an automobile, comprising: A clustering screening module acquires an initial panoramic image covering the detection area collected by the camera in the ambient light, identifies the coordinate position and orientation information of each flange through target detection according to the initial panoramic image, and clusters the flanges according to the orientation information of each flange, and selects the clustering cluster with the largest number as the preferred class; A first detection object positioning module selects the flange with the smallest distance from the preset reference point in the preferred class as the first detection object; A detection image acquisition module acquires images captured by the camera when a plurality of groups of controllable independent light sources above the detection area are activated in turn as an image data set; A first detection image analysis module extracts the first detection object in the image data set and determines the real defect points by reflectivity calculation, and locates the defect sensitive light source set according to the real defect points; A subsequent detection object selection module selects the flange with the smallest Euclidean distance from the center point of the first detection object in the preferred class as the candidate detection object, when there are at least two candidate detection objects with the same or similar Euclidean distance, triggers the preset double-branch dynamic decision model to select the next detection object, and performs defect analysis on the determined next detection object, until all flanges in the preferred class are fully detected, and then re-clusters the flanges in the non-preferred class according to the orientation information, selects the clustering cluster with the largest number as the preferred class, and selects the flange with the smallest Euclidean distance from the last detected flange in the preferred class as the new reference, and selects the clustering cluster with the largest number for detection, until all flanges in the detection area are fully detected; A detection result summary module generates a visual report of the defect points in the detected flange.
[0016] The beneficial effects of the present application are: 1. By activating the collected images in turn through multiple groups of controllable independent light sources, combining reflectivity calculation, multi-light source cross verification and other strategies, the hidden problems caused by insufficient contrast, shadows or glare under single fixed light are effectively solved. Real defect points need to be verified by multiple light sources, which greatly reduces the misjudgment rate. At the same time, through the positioning of the defect sensitive light source set, the light source conditions for highlighting defects are focused, which further improves the recognition accuracy of small defects. In addition, through the clustering and screening strategy, the most numerous orientation clustering cluster is detected first, reducing invalid detection paths, and the closest flange to the reference point is selected as the first detection object. The principle of minimum Euclidean distance is used for subsequent objects. When the distance is close, a double-branch dynamic decision-making model is triggered to realize intelligent sorting of detection objects, avoid resource waste caused by random selection, and significantly improve the efficiency of online detection rhythm. 2. Through light source consistency verification to ensure the uniformity of the illumination of each independent light source, and reflectivity benchmark calibration to establish a standard mapping relationship, providing a reliable benchmark for reflectivity calculation in different environments. For non-preferred flanges, the last detection object is used as a new benchmark for clustering detection again, realizing full-area flange coverage without dead angles, and adapting to complex detection scenarios of multiple orientations and quantities of flanges. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 is the overall flowchart in the present application; Figure 2 is the first image analysis step sub-flowchart in the present application; Figure 3 is the subsequent detection object selection step sub-flowchart in the present application. DETAILED DESCRIPTION
[0018] The present application will be further described in detail below in combination with the drawings and examples. Identical parts are denoted by the same reference numerals in the drawings. It should be noted that the words "front", "back", "left", "right", "up" and "down" used in the following description refer to the directions in the drawings. The words "bottom surface" and "top surface", "inner" and "outer" refer to the directions towards or away from the geometric center of a particular part.
[0019] Because the detection mode can only highlight a certain defect or not highlight the defect under the condition of a fixed and single direction or uniform intensity of light, the defect may be difficult to identify or even completely hidden due to insufficient contrast, shadow shielding or excessive reflection, in addition, when there are multiple objects to be detected, the random selection mode cannot optimize the allocation of camera resources or image processing module computing resources, and cannot realize parallel processing or sequence optimization, thereby significantly reducing the overall detection efficiency; therefore, the present application designs the online detection method for the appearance of the flat flange on the automobile oil pump, in the arrangement of the detection equipment, a detection area is arranged, a camera is fixedly arranged above the detection area, the cameras can be reasonably distributed according to the area of the detection area, the present application takes one camera as an example, in addition, a plurality of groups of independently controllable light sources are arranged above the detection area, the present application takes eight groups of independent light sources as an example, the eight groups of independent light sources are coaxially arranged, the eight groups of independent light sources are distributed around the detection area, and eight directional light beams at fixed angles are formed, which are used for subsequent image acquisition and analysis.
[0020] Based on the above equipment arrangement, the detection method is as shown in Figure 1 The detection method comprises the following steps: Step one, detection system initialization and parameter calibration, first, the positions of the camera and the independent light source are debugged, calibrated and positioned, the optical axis of the camera is perpendicular to the plane of the detection area, and each flange is manually checked without overlapping so that the plane of the flange is completely exposed.
[0021] Subsequently, the light source consistency check is performed, when there is no task to be detected flange in the detection area, the eight groups of independent light sources are controlled to light up in turn, when each independent light source lights up in turn, the camera captures a background image of the detection area, and then the collected background images under the illumination of each independent light source are analyzed in terms of gray value, the average pixel gray value of each background image is calculated, and when the maximum deviation rate between the average background gray values of the eight groups of independent light sources in the detection area is greater than a preset threshold, the current output of each independent light source is adjusted to ensure that the uniformity of the illumination intensity of all independent light sources in the initial state is highly consistent.
[0022] Finally, the reflectivity reference calibration is performed, a known and standard flawless flange is placed on the preset calibration position in the detection area, eight groups of independent light sources are activated individually in turn, and each time an independent light source is opened, the camera captures an image of the flange, and the background of the detection area exists in the captured image. At this time, the existing target detection and contour analysis can be used to segment the individual image containing the full flange, and the average pixel gray value is extracted. Before this, the standard flange has completed the pre-measurement of the reflectivity parameters, and therefore, according to the known reflectivity parameters of the standard flange and the calibration intensity parameters of the corresponding light source, an initial reflectivity reference matrix containing the reflectivity calibration coefficients of the eight groups of independent light sources is established. The matrix describes the mapping relationship between the actual reflectivity characteristics of the standard flange and the gray value captured by the camera under different independent light source conditions, and serves as the calibration reference for subsequent flange reflectivity calculation.
[0023] Step two, initial panoramic image acquisition. First, the panoramic image is captured. All independent light sources are turned off, only an ambient light is turned on, or any independent light source is randomly turned on, and an initial panoramic image covering the entire detection area is captured by the camera.
[0024] Then, image preprocessing is performed. The panoramic image is denoised by a Gaussian filtering algorithm to smooth the image and effectively suppress random noise. The denoised image is then subjected to a limited contrast adaptive histogram equalization algorithm, which divides the image into multiple non-overlapping small regions and independently performs histogram equalization in each region. This processing significantly enhances the local gray difference between the flange target and the background, especially for areas that may have uneven lighting or shadows, improving the clarity of the flange contour for subsequent accurate extraction.
[0025] Step three, full flange target identification. The flange edge is extracted from the preprocessed panoramic image by an edge detection algorithm. The geometric features of the closed contour are analyzed and selected: first, the area and perimeter of each closed contour are calculated, and the contours with similar areas are selected according to the preset actual size of the flange. Second, the circularity of each selected contour is calculated, and the contours with similar circularity are selected. The contours that meet the above two criteria are accurately determined as the flat flange target on the automobile oil pump. For each identified flange target, the precise center point coordinates of the flange center hole are calculated by the geometric moment . Then, the minimum circumscribed rectangle algorithm is performed on the flange outer contour to calculate the included angle between the long side of the rectangle and the horizontal axis . This angle is defined as the current orientation parameter of the flange. The unique identification, precise position coordinates, and orientation information of all identified flanges are recorded and stored in the memory, where the unique identification reflects the ID of the flange.
[0026] Step four, first detection object positioning screening, first, according to its orientation characteristics, the most and similar orientation flange is screened as the first detection object, according to the recorded orientation angle of all flanges , using density-based clustering algorithm, in degree range contains at least flanges to form a cluster, the orientation angle as a feature clustering, the algorithm will automatically classify the flanges with the orientation angle within the preset threshold range into the same cluster, after clustering, the number of flanges contained in each cluster is counted, and the cluster with the most flanges is selected as the preferred class, if there are multiple clusters with the same maximum number of flanges, further compare the average orientation angle of these clusters with the same number of clusters with the camera optical axis, usually defined as perpendicular to the detection plane, corresponding to 0 degrees or 90 degrees in the image coordinate system, select the cluster with the smallest angle as the preferred class, the purpose is to preferentially process the flanges with higher alignment degree with the camera optical axis, and the image distortion and reflection interference are relatively small, so as to provide a more stable image basis for subsequent defect detection.
[0027] Then, in the preferred class, determine the first detection object, the means is to set the camera view angle directly below as the reference point, calculate the Euclidean straight line distance from all flange center points in the preferred class to the reference point, select the flange with the smallest distance as the first detection object, recorded as .
[0028] Step five, detection image acquisition, after determining the first detection object , flange image acquisition, in turn, activate eight independent controllable light sources , whenever an independent light source is activated, the camera captures a corresponding image containing all flanges at high resolution, this process is repeated eight times, to obtain a set of 8 image datasets under different lighting conditions for all identified flanges in the detection area , these image datasets are stored after preliminary position calibration, the purpose is to ensure that in the subsequent flange selection and refined detection process, the basic parameters of all candidate flanges can be used for the selection of the next detection object, so as to avoid the analysis consumption caused by random selection, significantly improve the overall efficiency of online detection; this detection image acquisition is mainly for the first detection object .
[0029] Step six, first detection image analysis, as shown in Figure 2 , first, extract the first detection object in each image of the image dataset , in the first detection object Perform reflectivity calculation, specifically, extract pixel-level grayscale values and calculate their average grayscale values , light source intensity calibrated according to light source consistency Calculate the first inspection object Normalized reflectance under each independent light source , , the normalization process ensures that under different light source intensities, The reflectivity value can objectively reflect its surface characteristics and is not affected by the power fluctuation of the light source itself.
[0030] Secondly, conduct the first inspection of the object Defect recognition and cross-validation, for each image ,according to The reflectivity data is used to identify abnormal areas using the reflectivity threshold method. The determination method is based on existing technology and is achieved by: ,in, is the average reflectivity of the standard defect-free flange, is the standard deviation of the standard flange reflectivity, any pixel Reflectivity If less than The lower limit, such as showing low reflective areas such as depressions and scratches or greater than The upper limit of the defect, such as burrs, foreign matter and other high reflective areas, the pixel point is marked as a candidate defect position. In order to improve the robustness of defect recognition, multi-light source cross-validation is performed: the number of times the same pixel position or the preset pixel neighborhood is marked as a candidate defect in eight different independent light source images is counted. If the count reaches or exceeds the preset judgment threshold, the position is determined to be a real defect point, and its relative coordinates in the flange coordinate system are accurately recorded. ,This multi-light source cross-validation effectively reduces the false alarms that may ,be caused by shadows, glare, or local reflection characteristics under ,single lighting conditions.
[0031] Then, the defect sensitive light source set Determine, for each determined real defect point, calculate its grayscale gradient value under eight sets of independent light source images. Specifically, use 3x3 Sobel operator to perform convolution operation on the local image of the defect area, calculate its gradient components in the horizontal and vertical directions, and then synthesize the gradient amplitude. The larger the gradient amplitude, the higher the contrast and clearer the edge of the defect under the light source. Then sort the defects according to the size of the gradient amplitude and select the ones with the highest gradient value. Independent light sources form a defect sensitive light source set , this light source set Precisely indicates the The information about which light sources provide the best contrast for the specific defect type detected is used to inspect flanges with similar defect characteristics in the future.
[0032] Finally, the first inspection object The image data mark is eliminated with logic, by setting a The binary mask corresponding to the contour area updates its status from pending detection to detected, that is, when the next detection object is acquired for eight sets of images, the first detection object is automatically shielded in the detection area captured by the camera to avoid the detection of the first detection object in the subsequent detection cycle. Repeated processing and identification ensures that each flange is inspected only once.
[0033] Step 7: Subsequent detection object selection, such as Figure 3 As shown, first, select from the preferred class to calculate the center point of the remaining flange and the first inspection object The Euclidean distance between the center points is used to select the flange with the smallest Euclidean distance as the next candidate detection object. If there are multiple flanges with similar Euclidean distances, the dual-branch dynamic decision model will be automatically started for further screening to make the optimal decision.
[0034] Among them, the dual-branch dynamic decision model includes a defect scene branch sub-model and a non-defect scene branch sub-model. Specifically, when the first inspection object has defects, the defect scene branch sub-model is triggered, and a comprehensive adaptability score is performed according to the defect scene branch sub-model. First, the light source sensitivity weight is performed. Calculation, based on the defect sensitivity light source set determined by the first inspection object Extract the defect in Each independent light source The corresponding grayscale gradient value , calculate the weight , where the weight Accurately reflects each light source Regarding the sensitivity of this particular defect, the light source with a higher gradient value is given a greater weight, ensuring that the high-contrast light source is given more weight in subsequent evaluations; secondly, reflectivity similarity is performed Calculate, for each candidate flange with similar distance , the reflectivity under the eight independent light sources collected Calculate the reflectivity deviation rate between the corresponding position of the first inspection object and the first inspection object under the same light source , and then calculate the similarity , The value range is [0,1], and the larger the value, the more candidate flange In the light source The more similar the reflectivity pattern is to the first inspection object; finally, a comprehensive fitness score and selection are performed to calculate the The comprehensive fitness score , where the sum is for the set of defect-sensitive light sources All light sources in ,choose The highest candidate flange is selected as the next inspection object. This score quantifies the similarity of the reflectivity pattern of the candidate flange and the defective flange under key lighting conditions. For the same candidate flange, the light source with the highest weight in the defect sensitive light source set is further compared. Next, the candidate flange Value, select The largest flange is selected as the final next inspection object. The purpose is to accurately select the flanges that are most likely to share similar defects, thereby improving the efficiency and accuracy of inspection.
[0035] When the first inspection object has no defects, the defect-free scenario branch sub-model is triggered, and a comprehensive stability score is performed based on the defect-free scenario branch sub-model. First, the coverage balance index is performed. Calculate, calculate each candidate flange Average reflectivity under eight independent light sources , and then calculate the standard deviation of its reflectivity , standard deviation The smaller the value, the more balanced and stable the reflectivity distribution of the flange surface under different illumination. The calculation formula is ,in The value range is (0,1], the larger the value, the better the balance; secondly, perform the benchmark light source adaptation Calculate and determine a set of reflectivity coefficients of variation (the ratio of the standard deviation to the mean, i.e. ) The smallest three reference light sources, such as, , forming a reference light source set , these light sources usually represent the lighting conditions under which the reflectivity is most stable and predictable when the flange is defect-free. Calculate the reflectivity of each candidate flange. In the reference light source set Each light source Reflectivity under Reflectivity of the first inspection object under the corresponding light source The average deviation , benchmark adaptation score ,in the value range of is [0, 1], the larger the value, the better the adaptability of the candidate flange to the reference reflectivity mode, that is, the smaller the deviation of its surface characteristics from the normal flange; finally, the comprehensive stability score is calculated for each candidate flange where the weight of 0.5 can be dynamically adjusted according to the light stability requirements of the actual production environment, for example, when the environmental light is unstable, the weight of can be appropriately increased , and the candidate flange with the highest score is selected as the next detection object. This score quantifies the surface uniformity and reference adaptability of the candidate flange. If there are candidate flanges with the same score, further calculate the reflectivity mean deviation of each candidate flange with the first detection object , and select the flange with the smallest deviation to ensure smooth transition of the detection process and continuity of the parameters.
[0036] In the first selection class, the candidate detection object is selected for defect analysis, and the first detection object is always used as the basis, and the detection process is consistent with that of the first detection object. Until the last flange in the first selection class is detected, the detection of the flanges in the non-first selection class needs to be switched.
[0037] Step eight, non-first selection class flange detection. First, the reference switching and initial object selection are performed, and the last detected flange in the first selection class is used as the new reference to calculate the Euclidean distance between the center points of all flanges in the second selection class and the center point of , and the flange with the smallest distance is selected as the first detection object in the second selection class. The purpose is to maximize the use of the current spatial positioning of the detection system, reduce invalid image cropping, and maintain the coherence of the detection process.
[0038] Then, iterative detection is performed. The detection process of the second selection class and all other non-first selection class flanges is consistent with the above process, that is, the principle of adjacent priority selection and the double-branch dynamic decision model are continued to be followed for the selection of detection objects, accessing the pre-acquired multi-mode image data, performing reflectivity calculation, defect identification and cross-validation, until all flanges in the detection area are fully detected.
[0039] Step nine, detection result output and summary, record the unique identification information of each detected flange, such as the center point coordinates and the orientation angle, and the accurate position of all identified defects, wherein the defect matching model can be combined to accurately match the defects, and then all information is generated visual detection report, which contains original flange image, accurate labeling of defect position, identified defect type identification and defect distribution diagram on flange surface, which intuitively shows the density and type distribution of defects, at the same time, all detection data is exported in structured data format, which contains the unique identification of each flange, the accurate coordinates of all identified defects, detailed defect type, sensitive light source set causing defects and reflectivity data under each light source and other detailed information, which ensures the comprehensiveness, traceability and practicability of detection results, and provides accurate and quantifiable data support for production line quality control and process improvement.
[0040] Correspondingly, the application also provides an online appearance detection system for the upper plane flange of an automobile oil pump, comprising: A clustering screening module acquires an initial panoramic image covering the detection area collected by the camera under ambient light, identifies the coordinate position and orientation information of each flange through target detection according to the initial panoramic image, and clusters the flanges according to the orientation information of each flange, and takes the cluster with the largest number as the preferred class; A first detection object positioning module takes the flange with the smallest distance from the preset reference point as the first detection object in the preferred class; A detection image acquisition module acquires images taken by the camera when a plurality of controllable independent light sources above the detection area are activated in turn as an image data set; A first detection image analysis module extracts the first detection object from the image data set and determines the real defect points through reflectivity calculation, and locates the defect sensitive light source set according to the real defect points; A subsequent detection object selection module selects the flange with the smallest Euclidean distance between the center point of the first detection object as the candidate detection object in the preferred class, when there are at least two candidate detection objects with the same or similar Euclidean distance, triggers a preset double-branch dynamic decision model for screening to determine the next detection object, and performs defect analysis on the determined next detection object, until all flanges in the preferred class are fully detected, and then re-cluster the flanges in the non-preferred class according to the orientation information, and take the last detected flange in the preferred class as a new reference, select the cluster with the largest number for detection, until all flanges in the detection area are fully detected; A detection result summary module generates a visual report for the defect points in the detected flange.
[0041] The above are only preferred embodiments of the present application, and the protection scope of the present application is not limited to the above-mentioned embodiments. Any technical scheme falling within the concept of the present application shall fall within the protection scope of the present application. It should be noted that, for ordinary skilled persons in the art, some improvements and refinements without departing from the principles of the present application shall also be considered as falling within the protection scope of the present application.
Claims
1. A method for online appearance inspection of a flat flange on an automobile oil pump, characterized by: The following steps are involved: A cluster screening step, obtaining an initial panoramic image of the detection area captured by the camera under ambient light, identifying the coordinate position and orientation information of each flange through target detection based on the initial panoramic image, clustering the flanges based on the orientation information of each flange, and selecting the cluster with the largest number of clusters as the preferred cluster; a first inspection object positioning step, wherein the flange with the shortest distance from a preset reference point in the preferred class is selected as the first inspection object; In the detection image acquisition step, images captured by the camera when several groups of controllable independent light sources above the detection area are activated in sequence are obtained as an image data set; a first inspection image analysis step, extracting the first inspection object from the image data set, performing reflectivity calculation to determine the real defect point, and locating the defect sensitive light source set based on the real defect point; In the subsequent inspection object selection step, the flange with the smallest Euclidean distance from the center point of the first inspection object is selected in the preferred class as the object to be inspected. When there are at least two objects to be inspected with the same or similar Euclidean distance, the preset two-branch dynamic decision model is triggered to screen and determine the next inspection object, and defect analysis is performed on the determined next inspection object. After all flanges in the preferred class have been fully inspected, the flanges in the non-preferred class are clustered again according to the orientation information, and the last flange inspected in the preferred class is used as the new benchmark to select a large number of clusters for inspection until all flanges in the inspection area have been fully inspected. In the inspection result summary step, a visual report is generated for the defect points in the inspected flanges.
2. The method for online appearance inspection of a flat flange on an automobile oil pump according to claim 1, characterized in that: The first inspection image analysis step includes a defect recognition strategy, which includes: The reflectivity calculation sub-step extracts pixel-level grayscale values of the first inspection object extracted from each image acquired under different independent light sources and calculates its average grayscale value, and calculates the normalized reflectivity of the first inspection object under each independent light source according to the intensity of the independent light source; a defect location sub-step of using the normalized reflectivity to identify candidate defect locations in the first inspection object using a reflectivity threshold method; In the multi-light source cross-validation sub-step, the number of times the same pixel position is marked as a candidate defect in images under different independent light sources is greater than or equal to a preset judgment threshold, then the position is determined to be a real defect point.
3. The method for online appearance inspection of a flat flange on an automobile oil pump according to claim 2, characterized in that: The first inspection image analysis step also includes a positioning strategy for the defect-sensitive light source set. The positioning strategy includes calculating the grayscale gradient value in each image under different independent light sources based on the actual defect point, and then sorting according to the grayscale gradient amplitude, and selecting the light sources with the highest grayscale gradient amplitude ranking to form the defect-sensitive light source set.
4. The method for online appearance inspection of a flat flange on an automobile oil pump according to claim 1 or 3, characterized in that: The dual-branch dynamic decision model includes a defect scenario sub-model and a non-defect scenario sub-model. When the first inspection object has defects, the defect scenario sub-model is triggered to calculate the comprehensive fitness score of each object to be inspected and the first inspection object, and the next inspection object is selected based on the comprehensive fitness score. When the first inspection object does not have defects, the non-defect scenario sub-model is triggered to calculate the comprehensive stability score of each object to be inspected, and the next inspection object is selected based on the comprehensive stability score.
5. The method for online appearance inspection of a flat flange on an automobile oil pump according to claim 4, characterized in that: The defect scene sub-model performs light source sensitivity weight calculation, reflectance similarity calculation and comprehensive fitness score calculation. The light source sensitivity weight calculation includes calculating the weight according to the grayscale gradient value corresponding to each independent light source in the defect sensitive light source set; The reflectivity similarity calculation includes calculating the reflectivity of the object to be inspected under each independent light source, calculating the reflectivity deviation rate of the corresponding positions of the object to be inspected and the first inspection object under the same light source, and calculating the similarity based on the reflectivity deviation rate; the comprehensive fitness score calculation includes calculating the comprehensive fitness score based on the light source sensitivity weight and the reflectivity similarity.
6. The method for online appearance inspection of a flat flange on an automobile oil pump according to claim 5, characterized in that: The defect-free scene sub-model performs coverage balance index calculation, reference light source adaptability calculation, and comprehensive stability score calculation. The coverage balance index calculation includes calculating the mean reflectivity of the inspection object under each independent light source, calculating the reflectivity standard deviation based on the mean reflectivity, and then calculating the balance score based on the reflectivity standard deviation. The benchmark light source adaptation calculation includes determining a set of three benchmark light sources with the smallest reflectivity variation coefficient to form a benchmark light source set, calculating the average difference between the reflectivity of the object to be inspected under each independent light source in the benchmark light source set and the reflectivity of the first inspection object under the same light source, and calculating the benchmark adaptation score based on the average difference; The comprehensive stability score calculation includes calculating the comprehensive stability score based on the balance score and the benchmark adaptation score.
7. The method for online appearance inspection of a flat flange on an automobile oil pump according to claim 2, characterized in that: It also includes a light source consistency verification step. When there is no blue in the detection area, the background image of the detection area taken by the camera with each independent light source activated in turn is obtained, the grayscale value of the background image is analyzed to calculate the background grayscale mean, and it is determined whether the maximum deviation rate between the background grayscale means generated by each independent light source in the detection area is less than a preset threshold. If not, each independent light source is adjusted so that the maximum deviation rate is less than the preset threshold.
8. The method for online appearance inspection of a flat flange on an automobile oil pump according to claim 7, characterized in that: It also includes a reflectivity benchmark calibration step, which involves placing a standard defect-free flange in the inspection area, obtaining flange images taken by the camera with independent light sources activated in sequence, and calculating the average pixel grayscale value of the flange images. An initial reflectivity benchmark matrix of reflectivity calibration coefficients is established based on the average pixel grayscale value, the known reflectivity parameters of the flange, and the intensity of the independent light source.
9. The method for online appearance inspection of a flat flange on an automobile oil pump according to claim 8, characterized in that: In the cluster screening step, if there are multiple clusters with the same maximum number of flanges, the angles between the average orientation angles of the clusters with the same number and the camera optical axis are compared, and the cluster with the smallest angle is selected as the preferred cluster.
10. An online inspection system for the appearance of a flat flange on an automobile oil pump, characterized by: include: A clustering and screening module obtains an initial panoramic image of the detection area captured by the camera under ambient light, identifies the coordinate position and orientation information of each flange through target detection based on the initial panoramic image, and then clusters the flanges based on their orientation information, and selects the cluster with the largest number of clusters as the preferred class; A first inspection object positioning module is configured to select the flange with the shortest distance from the preset reference point as the first inspection object in the preferred class; The detection image acquisition module obtains images taken by the camera when several groups of controllable independent light sources above the detection area are activated in sequence as an image data set; The first inspection image analysis module extracts the first inspection object from the image data set, calculates the reflectivity to determine the real defect point, and locates the defect sensitive light source set based on the real defect point; The subsequent inspection object selection module selects the flange with the smallest Euclidean distance from the center point of the first inspection object in the preferred class as the object to be inspected. When there are at least two objects to be inspected with the same or similar Euclidean distance, the preset two-branch dynamic decision model is triggered to screen and determine the next inspection object, and defect analysis is performed on the determined next inspection object until all flanges in the preferred class are fully inspected. The flanges in the non-preferred class are clustered again according to the orientation information, and the last flange inspected in the preferred class is used as the new benchmark to select a large number of clusters for inspection until all flanges in the inspection area are fully inspected. The inspection result summary module generates a visual report of the defects in the inspected flanges.
Citation Information
Patent Citations
Snow pressing vehicle appearance defect detection method based on vision under complex background
CN113160192A
Visual identification method for valve surface defects
CN116030034A
Motor vehicle part automatic production online screening method and system
CN116363136A
Electronic control silicone oil clutch image analysis system based on big data
CN119205651A
Deep learning-based localization of uavs with respect to nearby pipes
US20220169381A1