A camera housing detection method and detection system based on machine vision
Through multi-angle image acquisition and FLANN algorithm grouping processing, combined with constant temperature heating and infrared image acquisition, the problems of low detection efficiency and poor reliability of traditional camera shells are solved, and full coverage of the shells are achieved and efficient quality evaluation and early warning are achieved.
Patent Information
- Application Number
- CN202510057003.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-14
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2045-01-14
AI Technical Summary
Traditional camera shell detection methods are inefficient, have low detection results, and have limited visual field range for single-angle detection, making it difficult to cover the defects of complex curved surfaces and hidden areas of the shell.
The multi-angle image acquisition device is used to combine the FLANN algorithm to group the image data link. Through feature extraction and contour overlap deduplication technology, combined with constant temperature heating and infrared image acquisition, surface and internal defect evaluation are carried out to generate overall defect values for early warning.
It improves the detection coverage and efficiency, ensures the accuracy of the detection results, and achieves full coverage of the shell and efficient quality assessment and early warning.
Smart Images

Figure CN119477911B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent detection technology, and in particular to a camera housing detection method and detection system based on machine vision. Background Art
[0002] With the rapid development of autonomous driving technology, cameras, as key perception hardware, undertake important functions such as environmental monitoring, obstacle recognition, and road marking detection. To ensure the stability and safety of autonomous driving systems, the quality of the camera housing directly affects the durability and image acquisition performance of the device, making its inspection requirements increasingly important.
[0003] However, traditional camera housing inspection methods require operators to visually inspect the housing surface and structure using simple tools. While intuitive, this method is inefficient, costly, and subject to human subjectivity, making it difficult to meet the demands of modern automated production lines. Some automated inspection systems use machine vision to capture and analyze camera housing images. However, single-angle inspection has a limited field of view and is prone to missed detections, especially when it comes to defects on complex curved surfaces and hidden areas.
[0004] Therefore, it is necessary to design a camera housing detection method and detection system based on machine vision to solve the problems existing in the current technology. Summary of the Invention
[0005] In view of this, the present invention proposes a camera housing detection method and detection system based on machine vision, aiming to solve the problems of low detection efficiency and low reliability of detection results in current camera housing detection.
[0006] In one aspect, the present invention provides a camera housing detection method based on machine vision, comprising:
[0007] Several image acquisition devices are provided to acquire image data of the shell to be inspected to form an image data chain, and feature extraction is performed on each image data in the image data chain to obtain a feature vector of each image data;
[0008] Processing the image data chain based on the FLANN (Fast Library for Approximate Nearest Neighbors) algorithm, splitting the image data chain into a plurality of sub-data chains, each of which includes image data of multiple angles at the same position of the shell to be inspected;
[0009] Perform defect recognition on each image data in each of the sub-data chains, remove duplicates by contour overlap, and determine the defect area and defect depth of each image data;
[0010] Obtaining a surface inspection evaluation of the shell to be inspected based on the defect area and defect depth;
[0011] Heating the shell to be inspected at a constant temperature, collecting an infrared image of the shell to be inspected based on an infrared image acquisition device, and determining an internal inspection evaluation of the shell to be inspected based on the infrared image;
[0012] An overall defect value of the shell to be inspected is obtained based on the surface inspection and evaluation and the internal inspection and evaluation, and an inspection warning is performed based on the overall defect value.
[0013] Furthermore, when extracting features from each image data in the image data chain to obtain a feature vector for each image data, the method includes:
[0014] Convert the image data into a grayscale image, traverse all pixels in the grayscale image, calculate the grayscale value combination between each pixel and its neighboring pixels, fill the combination statistical results into a matrix, and generate a grayscale co-occurrence matrix;
[0015] Calculating texture features according to the gray level co-occurrence matrix, wherein the texture features include energy, contrast and homogeneity;
[0016] The texture features are normalized to obtain the feature vector.
[0017] Furthermore, when calculating the texture features according to the gray level co-occurrence matrix, it includes:
[0018] The co-occurrence matrix is defined as:
[0019] ;
[0020] Where P(i, j) represents the probability of the occurrence of a pixel pair with grayscale values i and j at a given distance d and direction θ, d represents the distance between the pixel pairs, and θ represents the direction angle;
[0021] The texture features are calculated by the following formula:
[0022] ;
[0023] ;
[0024] ;
[0025] Among them, E represents energy, C represents contrast, and H represents homogeneity.
[0026] Furthermore, the image data chain is processed based on the FLANN algorithm to split the image data chain into several sub-data chains, including:
[0027] Extracting a feature vector of each image data in the image data chain to form a feature set;
[0028] Use FLANN to build a fast search index structure and select KD-Tree as the index type;
[0029] For each of the feature vectors in the set, use FLANN to find a set of feature vectors similar to it, and divide the images that meet the similar conditions into the same sub-data chain;
[0030] The similarity conditions are:
[0031] ;
[0032] Among them, Ti and Tj represent the eigenvectors of the i-th and j-th sub-graphs respectively. represents the similarity between feature vectors, k represents the kth component of the feature vector, and d represents the dimension of the feature vector.
[0033] Furthermore, deduplication by contour overlap includes:
[0034] Calculate the defect outline overlap by grouping every two image data in the sub-data chain;
[0035] ;
[0036] Among them, C1 and C2 represent the defect contours of the two images in the sub-data chain respectively;
[0037] Comparing the outline overlap with an overlap threshold;
[0038] When the contour overlap is greater than the overlap threshold, the defects of the two images are determined to be the same defect and the image data with the larger defect contour is retained; when the contour overlap is less than or equal to the overlap threshold, the defects of the two images are determined to be different defects, the two image data are merged, and the defect contours are superimposed.
[0039] Furthermore, obtaining the surface inspection evaluation of the shell to be inspected according to the defect area and the defect depth includes:
[0040] ;
[0041] Wherein, S1 represents the surface inspection evaluation, Az represents the inspection area of the shell to be inspected, Dr represents the maximum depth of the r-th defect, Ar represents the area of the r-th defect, Dmax represents the maximum thickness of the shell to be inspected, α represents the nonlinear area factor, and the value range of α is [1.1, 1.5]. Qa and Qb represent the area weight and depth weight, respectively. The value range of Qa is [30, 50], and the value range of Qb is [20, 40]. R represents the total number of surface defects.
[0042] Furthermore, when determining the internal inspection evaluation of the housing to be inspected based on the infrared image, the method includes:
[0043] Collecting infrared images from multiple angles to form three-dimensional temperature data of the shell to be inspected;
[0044] Statistically analyzing the deviation between each point in the three-dimensional temperature data and the neighboring temperature, and marking the point as an abnormal point when the deviation is greater than a deviation threshold;
[0045] The deviation value is calculated by the following formula:
[0046] ;
[0047] in, Indicates a point The temperature deviation value, express The standardized temperature value, Indicates a point The neighborhood point set of represents the total number of neighborhood points, Represents the sum of the standardized temperature values of the neighborhood points;
[0048] Starting from an abnormal point, adjacent pixels are traversed to divide abnormal areas until no new abnormal points are detected and all pixels have been traversed, and the area of each internal defect and the maximum temperature difference of each internal defect are recorded.
[0049] Furthermore, when determining the internal inspection evaluation of the housing to be inspected based on the infrared image, the method includes:
[0050] ;
[0051] Where S2 represents the internal inspection evaluation, At represents the volume of the shell to be inspected, Ae represents the volume of the e-th defect, We represents the mean of the standard temperature of the e-th defect, Wmax represents the maximum standard temperature difference, E represents the total number of internal defects, Qc represents the volume weight, and its value range is [30, 50], and Qd represents the temperature weight, and its value range is [10, 20].
[0052] Furthermore, when performing detection and early warning based on the overall defect value, it includes:
[0053] The overall defect value is calculated by the following formula:
[0054] ;
[0055] Where S represents the overall defect value, S1 represents the surface inspection evaluation, S2 represents the internal inspection evaluation, U1 and U2 represent weight coefficients, and U1+U2=1;
[0056] Comparing the overall defect value with a first preset overall defect value and a second preset overall defect value respectively, if the first preset overall defect value is smaller than the second preset overall defect value, performing a detection and early warning according to the comparison result;
[0057] When the overall defect value is less than or equal to the first preset overall defect value, a first-level defect warning is issued; when the overall defect value is greater than the first preset overall defect value and less than or equal to the second preset overall defect value, a second-level defect warning is issued; when the overall defect value is greater than the second preset overall defect value, a third-level defect warning is issued; the first-level defect warning is greater than the second-level defect warning, and the second-level defect warning is greater than the third-level defect warning.
[0058] Compared with the existing technology, the beneficial effects of the present invention are as follows: by setting up a multi-angle image acquisition device and combining the FLANN algorithm to group the image data chain, the accurate integration and redundancy removal of multi-angle images of the same position of the shell are achieved, effectively improving the detection coverage and efficiency. By using feature extraction and contour overlap deduplication technology, the defect area and depth are accurately calculated, which avoids repeated detection and ensures the accuracy of the detection results. Combining constant temperature heating and infrared image acquisition technology, a comprehensive detection system for the surface and interior of the shell is constructed. By fusing the surface detection evaluation value and the internal detection evaluation value, the overall defect value is obtained to form a quality assessment and early warning mechanism. It effectively solves the pain points of traditional single-angle detection, such as limited field of view, high missed detection rate and low efficiency of manual detection.
[0059] On the other hand, the present application also provides a camera housing detection system based on machine vision, which is used to apply the above-mentioned camera housing detection method based on machine vision, including:
[0060] An image acquisition device, used for acquiring image data of the shell to be inspected;
[0061] A constant temperature heating device, used for heating the shell to be inspected at a constant temperature;
[0062] An infrared image acquisition device, used for acquiring an infrared image of the housing to be inspected;
[0063] an acquisition unit for acquiring image data of the shell to be detected to form an image data chain, performing feature extraction on each image data in the image data chain to obtain a feature vector of each image data;
[0064] a processing unit, processing the image data chain based on a FLANN algorithm, and splitting the image data chain into a plurality of sub-data chains, each of which includes image data of multiple angles of the same position of the shell to be inspected;
[0065] an identification unit, performing defect identification on each image data in each of the sub-data chains, removing duplicates by contour overlap, and determining the defect area and defect depth;
[0066] a surface evaluation unit, configured to obtain a surface detection evaluation of the shell to be inspected based on the defect area and the defect depth;
[0067] an internal evaluation unit, configured to determine an internal detection evaluation of the housing to be detected based on the infrared image;
[0068] An early warning unit obtains an overall defect value of the shell to be inspected based on the surface inspection and evaluation and the internal inspection and evaluation, and performs inspection and early warning based on the overall defect value.
[0069] It is understandable that the above-mentioned camera housing detection method and system based on machine vision have the same beneficial effects, which will not be described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present invention. The same reference symbols are used throughout the drawings to represent the same components. In the drawings:
[0071] Figure 1 A flowchart of a camera housing detection method based on machine vision provided by an embodiment of the present invention;
[0072] Figure 2 This is a structural block diagram of a camera housing detection system based on machine vision provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0073] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art. It should be noted that, unless there is a conflict, the embodiments of the present disclosure and the features in the embodiments can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
[0074] In some embodiments of this application, see Figure 1 As shown, a camera housing detection method based on machine vision includes:
[0075] S100: setting up a number of image acquisition devices to acquire image data of the shell to be detected to form an image data chain, performing feature extraction on each image data in the image data chain to obtain a feature vector of each image data.
[0076] S200: Processing the image data chain based on the FLANN algorithm, splitting the image data chain into several sub-data chains, each sub-data chain including image data of the same position of the shell to be inspected at multiple angles.
[0077] S300: Defect identification is performed on each image data in each sub-data chain, and duplicates are removed by contour overlap to determine the defect area and defect depth.
[0078] S400: Obtaining a surface inspection evaluation of the shell to be inspected according to the defect area and the defect depth.
[0079] S500: The shell to be inspected is heated at a constant temperature, an infrared image of the shell to be inspected is collected by an infrared image collection device, and an internal inspection evaluation of the shell to be inspected is determined based on the infrared image.
[0080] S600: Obtain an overall defect value of the shell to be inspected based on the surface inspection evaluation and the internal inspection evaluation, and perform inspection warning based on the overall defect value.
[0081] Specifically, in S100, several image acquisition devices are set up to capture images of the camera housing to be inspected from multiple angles, forming an image data chain. The image acquisition devices include high-resolution industrial cameras, ensuring that detailed features of the housing surface are captured. Feature extraction is performed on each image data set, including texture features (such as gray-level co-occurrence matrix parameters), edge features (such as Canny edge detection), and shape features. Each image is converted into a feature vector for subsequent grouping and matching calculations. In S200, the FLANN algorithm is used to split the image data chain into several sub-data chains by comparing the similarity of feature vectors. Each sub-data chain contains image data captured from different angles at the same location. The FLANN algorithm's fast nearest neighbor matching efficiently processes high-dimensional feature data, reducing computational complexity while ensuring accurate grouping results. In S300, defect recognition is performed on the images in each sub-data chain. Deep learning models (such as defect classification models based on convolutional neural networks) or traditional vision algorithms (such as image segmentation and edge detection) are used to extract the outline and area of the defect. Subsequently, repeated calculations of the same defect are eliminated by calculating the contour overlap, ensuring that each defect is only counted once in the analysis. At the same time, the defect depth information is calibrated to obtain more accurate surface defect parameters. In S400, the defect area and defect depth calculated in S300 are combined to generate a surface detection evaluation value. By setting weight factors, it is ensured that the evaluation results can reflect the impact of the defect on the overall quality. In S500, the shell to be inspected is heated at a constant temperature (usually achieved by a hot plate or infrared heating device), and the temperature distribution data is collected using an infrared imaging device. The infrared image is analyzed, and internal defects are identified by the distribution and number of abnormal temperature points. The internal defect area and depth are calculated to form an internal detection evaluation value. In S600, the overall defect value of the shell is calculated by fusing the surface detection evaluation value and the internal detection evaluation value, and finally it is determined whether the quality of the shell meets the standard. If the overall defect value exceeds the preset threshold, an early warning prompt is generated.
[0082] As can be seen, the combination of multi-angle machine vision and infrared thermal imaging technology enables comprehensive and efficient surface and internal defect inspection of camera housings. The application of the FLANN algorithm improves the efficiency of multi-angle image grouping, avoiding repeated counting of the same defect; deduplication of contour overlap ensures the accuracy and precision of inspection results. Furthermore, constant temperature heating combined with infrared image analysis enables non-destructive internal defect detection, addressing the shortcomings of traditional inspection methods in identifying internal structures. By integrating surface and internal assessments, comprehensive and intelligent quality inspection is achieved.
[0083] In some embodiments of the present application, performing feature extraction on each image data in the image data chain to obtain a feature vector for each image data includes:
[0084] Convert the image data into a grayscale image, traverse all pixels in the grayscale image, calculate the grayscale value combination between each pixel and its neighboring pixels, fill the combined statistical results into the matrix, and generate a grayscale co-occurrence matrix.
[0085] The texture features are calculated based on the gray-level co-occurrence matrix, and the texture features include energy, contrast and homogeneity.
[0086] Normalize the texture features to obtain the feature vector.
[0087] In some embodiments of the present application, when calculating texture features according to the gray level co-occurrence matrix, the method includes:
[0088] The co-occurrence matrix is defined as:
[0089] ;
[0090] Among them, P(i,j) represents the probability of the occurrence of a pixel pair with grayscale values i and j at a given distance d and direction θ, d represents the distance between the pixel pairs, and θ represents the direction angle.
[0091] The texture features are calculated by the following formula:
[0092] ;
[0093] ;
[0094] ;
[0095] Among them, E represents energy, C represents contrast, and H represents homogeneity.
[0096] Specifically, in image processing, the gray-level co-occurrence matrix (GLCM) is a texture feature description method. Its core concept is to quantify the spatial distribution characteristics of texture by counting the spatial relationships between grayscale values in an image. The input image is converted to a grayscale image to reduce computational complexity. Pixel values in a grayscale image are integers between 0 and 255, representing the pixel's brightness. All pixels in the grayscale image are traversed, and the grayscale value combinations between each pixel and its neighboring pixels are calculated. For example, when the orientation angle is 0° (horizontal) and the spacing is 1, the number of occurrences of grayscale values i and j in all pairs of adjacent pixels is counted. The resulting statistics generate a two-dimensional matrix, where the matrix element P(i, j) represents the probability of the pixel pair with grayscale values i and j occurring at a given distance and orientation. The matrix size is L×L, where L is the number of grayscale levels (typically 256). Multiple texture features are calculated based on the GLCM to capture different texture properties of the image. In order to eliminate the influence of different eigenvalue magnitudes, the energy, contrast and homogeneity are normalized. The linear normalization method is used to scale the eigenvalues to the [0, 1] interval and generate eigenvectors for subsequent processing.
[0097] It can be understood that by quantifying the grayscale distribution pattern of the image through the grayscale co-occurrence matrix, and further calculating texture features such as energy, contrast, and homogeneity, the texture characteristics of the image are fully described. These feature extraction methods combine probability statistics and spatial grayscale distribution relationships to capture subtle changes in surface texture and provide powerful discrimination capabilities for defect detection. In addition, normalization processing eliminates dimensional differences between features, ensures the validity and consistency of feature vectors, and improves the performance of subsequent classification algorithms. Through texture feature extraction based on the grayscale co-occurrence matrix, the texture details of the camera housing image are effectively captured. Compared with traditional grayscale or edge features, texture features have stronger noise resistance and discrimination power, especially when detecting small scratches, bumps or irregular textures on the surface. Feature normalization processing further improves the accuracy and robustness of subsequent feature matching and classification algorithms.
[0098] In some embodiments of the present application, processing the image data chain based on the FLANN algorithm and splitting the image data chain into several sub-data chains includes:
[0099] Extract the feature vector of each image data in the image data chain to form a feature set.
[0100] Use FLANN to build a fast search index structure and select KD-Tree as the index type.
[0101] For each eigenvector in the set, FLANN is used to find a set of similar eigenvectors, and images that meet similar conditions are divided into the same sub-data chain.
[0102] Similar conditions are:
[0103] ;
[0104] Among them, Ti and Tj represent the eigenvectors of the i-th and j-th sub-graphs respectively. represents the similarity between feature vectors, k represents the kth component of the feature vector, and d represents the dimension of the feature vector.
[0105] In some embodiments of the present application, deduplication by contour overlap includes:
[0106] Every two image data in the sub-data chain are grouped together to calculate the defect outline overlap.
[0107] ;
[0108] Among them, C1 and C2 represent the defect contours of the two images in the sub-data chain respectively.
[0109] Compare the contour overlap with the overlap threshold.
[0110] When the outline overlap is greater than the overlap threshold, the defects in the two images are determined to be the same defect and the image data with the larger defect outline is retained. When the outline overlap is less than or equal to the overlap threshold, the defects in the two images are determined to be different defects, the two image data are merged, and the defect outlines are superimposed.
[0111] In some embodiments of the present application, obtaining a surface inspection evaluation of a shell to be inspected based on a defect area and a defect depth includes:
[0112] ;
[0113] Wherein, S1 represents the surface inspection evaluation, Az represents the inspection area of the shell to be inspected, Dr represents the maximum depth of the r-th defect, Ar represents the area of the r-th defect, Dmax represents the maximum thickness of the shell to be inspected, α represents the nonlinear area factor, and the value range of α is [1.1, 1.5]. Qa and Qb represent the area weight and depth weight, respectively. The value range of Qa is [30, 50], and the value range of Qb is [20, 40]. R represents the total number of surface defects.
[0114] As can be seen, the FLANN algorithm enables multi-angle image grouping, ensuring that multi-view images of the same location are grouped into the same sub-data chain, resolving the problem of missed detections caused by insufficient viewing angles in traditional methods. Combined with deduplication based on contour overlap, repeated counting of the same defect is avoided, improving the accuracy of inspection results. The surface inspection evaluation formula incorporates nonlinear factors and a weight adjustment mechanism, dynamically adapting to the impact of defect area and depth, providing a quantitative basis for automated quality assessment.
[0115] In some embodiments of the present application, determining an internal inspection assessment of a housing to be inspected based on an infrared image includes:
[0116] Collect infrared images from multiple angles to form three-dimensional temperature data of the shell to be inspected.
[0117] The deviation value between each point in the three-dimensional temperature data and the neighboring temperature is statistically analyzed. When the deviation value is greater than the deviation value threshold, the point is marked as an abnormal point.
[0118] The deviation value is calculated by the following formula:
[0119] ;
[0120] in, Indicates a point The temperature deviation value, Indicates a point The standardized temperature value, Indicates a point The neighborhood point set of represents the total number of neighborhood points, Represents the sum of the normalized temperature values of the neighborhood points.
[0121] Starting from an abnormal point, the adjacent pixels are traversed to divide the abnormal area until no new abnormal points are detected and all pixels have been traversed. The area of each internal defect and the maximum temperature difference of each internal defect are recorded.
[0122] In some embodiments of the present application, determining an internal inspection assessment of a housing to be inspected based on an infrared image includes:
[0123] ;
[0124] Where S2 represents the internal inspection evaluation, At represents the volume of the shell to be inspected, Ae represents the volume of the e-th defect, We represents the mean of the standard temperature of the e-th defect, Wmax represents the maximum standard temperature difference, E represents the total number of internal defects, Qc represents the volume weight, and its value range is [30, 50], and Qd represents the temperature weight, and its value range is [10, 20].
[0125] As can be understood, using infrared images to reconstruct three-dimensional temperature distribution data comprehensively captures thermal anomaly characteristics within the housing. By marking anomaly points and dividing regions using deviation values, internal defect areas and the degree of thermal conductivity anomaly can be precisely located. The evaluation formula accounts for the effects of defect volume and temperature anomalies. Furthermore, this embodiment achieves nondestructive testing from external temperature acquisition to internal defect location, improving detection accuracy and efficiency.
[0126] In some embodiments of the present application, when performing detection and early warning based on the overall defect value, it includes:
[0127] The overall defect value is calculated using the following formula:
[0128] ;
[0129] Among them, S represents the overall defect value, S1 represents the surface inspection evaluation, S2 represents the internal inspection evaluation, U1 and U2 represent weight coefficients, and U1+U2=1.
[0130] The overall defect value is compared with the first preset overall defect value and the second preset overall defect value respectively. If the first preset overall defect value is smaller than the second preset overall defect value, a detection warning is performed based on the comparison result.
[0131] When the overall defect value is less than or equal to the first preset overall defect value, a Level 1 defect warning is issued. When the overall defect value is greater than the first preset overall defect value and less than or equal to the second preset overall defect value, a Level 2 defect warning is issued. When the overall defect value is greater than the second preset overall defect value, a Level 3 defect warning is issued. The Level 1 defect warning is greater than the Level 2 defect warning, and the Level 2 defect warning is greater than the Level 3 defect warning.
[0132] As you can see, by combining surface and internal inspection assessments, a comprehensive shell quality test result is provided. Using weighted calculations and warning thresholds, it effectively distinguishes defects of varying severity. Compared to traditional inspection methods, this achieves quantitative defect evaluation and more detailed warning levels, improving the intelligence and reliability of the automated inspection system. Furthermore, this solution allows for flexible adjustment of weights and thresholds to accommodate diverse inspection needs.
[0133] In the above embodiment, by providing a multi-angle image acquisition device and combining the FLANN algorithm to group and process the image data chain, the precise integration and redundancy removal of multi-angle images of the same position on the shell are achieved, effectively improving the detection coverage and efficiency. By using feature extraction and contour overlap deduplication technology, the defect area and depth are accurately calculated, avoiding repeated detection and ensuring the accuracy of the detection results. Combining constant temperature heating and infrared image acquisition technology, a comprehensive detection system for the surface and interior of the shell is constructed. By fusing the surface detection evaluation value and the internal detection evaluation value, the overall defect value is obtained, forming a quality assessment and early warning mechanism. It effectively solves the pain points of traditional single-angle detection, such as limited field of view, high missed detection rate, and low efficiency of manual detection.
[0134] In another preferred embodiment based on the above embodiment, refer to Figure 2 As shown, this embodiment provides a camera housing detection system based on machine vision, which is used to apply the above-mentioned camera housing detection method based on machine vision, including:
[0135] An image acquisition device, used for acquiring image data of the shell to be inspected;
[0136] A constant temperature heating device, used for constant temperature heating of the shell to be tested;
[0137] An infrared image acquisition device, used for acquiring an infrared image of the shell to be inspected;
[0138] An acquisition unit collects image data of the shell to be detected to form an image data chain, performs feature extraction on each image data in the image data chain, and obtains a feature vector of each image data;
[0139] The processing unit processes the image data chain based on the FLANN algorithm and splits the image data chain into several sub-data chains, each of which includes image data of multiple angles at the same position of the shell to be inspected;
[0140] The recognition unit identifies defects in each image data in each sub-data chain, removes duplicates by contour overlap, and determines the defect area and depth;
[0141] A surface evaluation unit, which obtains a surface inspection evaluation of the shell to be inspected based on the defect area and defect depth;
[0142] an internal evaluation unit, which determines an internal detection evaluation of the housing to be inspected based on the infrared image;
[0143] The early warning unit obtains the overall defect value of the shell to be inspected based on the surface inspection evaluation and the internal inspection evaluation, and performs inspection and early warning based on the overall defect value.
[0144] It is understandable that by setting up a multi-angle image acquisition device and combining the FLANN algorithm to group and process the image data chain, the precise integration and redundancy removal of multi-angle images of the same position on the shell are achieved, effectively improving the detection coverage and efficiency. Utilizing feature extraction and contour overlap deduplication technology, the defect area and depth are accurately calculated, avoiding repeated detection and ensuring the accuracy of the test results. Combining constant temperature heating and infrared image acquisition technology, a comprehensive detection system for the surface and interior of the shell is constructed. By fusing the surface detection evaluation value and the internal detection evaluation value, the overall defect value is obtained, forming a quality assessment and early warning mechanism. It effectively solves the pain points of traditional single-angle detection, such as limited field of view, high missed detection rate, and low efficiency of manual detection.
[0145] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0146] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0147] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0148] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0149] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered by the scope of protection of the claims of the present invention.
Claims
1. A camera housing detection method based on machine vision, characterized in that: include: Several image acquisition devices are provided to acquire image data of the shell to be inspected to form an image data chain, and feature extraction is performed on each image data in the image data chain to obtain a feature vector of each image data; Processing the image data chain based on the FLANN algorithm, splitting the image data chain into a plurality of sub-data chains, each of which includes image data of multiple angles at the same position of the shell to be inspected; Perform defect recognition on each image data in each of the sub-data chains, remove duplicates by contour overlap, and determine the defect area and defect depth; Obtaining a surface inspection evaluation of the shell to be inspected based on the defect area and defect depth; Heating the shell to be inspected at a constant temperature, collecting an infrared image of the shell to be inspected based on an infrared image acquisition device, and determining an internal inspection evaluation of the shell to be inspected based on the infrared image; Obtaining an overall defect value of the shell to be inspected based on the surface inspection and evaluation and the internal inspection and evaluation, and performing inspection and early warning based on the overall defect value; When deduplication is performed by contour overlap, it includes: Calculate the defect outline overlap by grouping every two image data in the sub-data chain; ; Among them, C1 and C2 represent the defect contours of the two images in the sub-data chain respectively; Comparing the outline overlap with an overlap threshold; When the outline overlap is greater than the overlap threshold, the defects in the two images are determined to be the same defect and the image data with the larger defect outline is retained; when the outline overlap is less than or equal to the overlap threshold, the defects in the two images are determined to be different defects, the two image data are merged, and the defect outlines are superimposed; Obtaining a surface inspection evaluation of the shell to be inspected according to the defect area and the defect depth includes: ; Wherein, S1 represents the surface inspection evaluation, Az represents the inspection area of the shell to be inspected, Dr represents the maximum depth of the r-th defect, Ar represents the area of the r-th defect, Dmax represents the maximum thickness of the shell to be inspected, α represents the nonlinear area factor, and the value range of α is [1.1, 1.5]. Qa and Qb represent the area weight and depth weight, respectively. The value range of Qa is [30, 50], and the value range of Qb is [20, 40]. R represents the total number of surface defects.
2. The camera housing detection method based on machine vision according to claim 1, characterized in that: Performing feature extraction on each image data in the image data chain to obtain a feature vector of each image data includes: Convert the image data into a grayscale image, traverse all pixels in the grayscale image, calculate the grayscale value combination between each pixel and its neighboring pixels, fill the combination statistical results into a matrix, and generate a grayscale co-occurrence matrix; Calculating texture features according to the gray level co-occurrence matrix, wherein the texture features include energy, contrast and homogeneity; The texture features are normalized to obtain the feature vector.
3. The camera housing detection method based on machine vision according to claim 2, characterized in that: When calculating the texture features according to the gray level co-occurrence matrix, it includes: The gray-level co-occurrence matrix is defined as: ; Where P(i, j) represents the probability of the occurrence of a pixel pair with grayscale values i and j at a given distance d and direction θ, d represents the distance between the pixel pairs, and θ represents the direction angle; The texture features are calculated by the following formula: ; ; ; Among them, E represents energy, C represents contrast, and H represents homogeneity.
4. The camera housing detection method based on machine vision according to claim 1, characterized in that: Processing the image data chain based on the FLANN algorithm and splitting the image data chain into a plurality of sub-data chains includes: Extracting a feature vector of each image data in the image data chain to form a feature set; Use FLANN to build a fast search index structure and select KD-Tree as the index type; For each of the feature vectors in the set, use FLANN to find a set of feature vectors similar to it, and divide the images that meet the similar conditions into the same sub-data chain; The similarity conditions are: ; Among them, Ti and Tj represent the feature vectors of the i-th image and the j-th image respectively, d(Ti, Tj) represents the similarity between the feature vectors, k represents the k-th component of the feature vector, and d represents the dimension of the feature vector.
5. The camera housing detection method based on machine vision according to claim 1, characterized in that: Determining the internal inspection evaluation of the housing to be inspected based on the infrared image includes: Collecting infrared images from multiple angles to form three-dimensional temperature data of the shell to be inspected; Statistically analyzing the deviation between each point in the three-dimensional temperature data and the neighboring temperature, and marking the point as an abnormal point when the deviation is greater than a deviation threshold; The deviation value is calculated by the following formula: ; in, Indicates a point The temperature deviation value, express The standardized temperature value, Indicates a point The neighborhood point set of represents the total number of neighborhood points, Represents the sum of the standardized temperature values of the neighborhood points; Starting from an abnormal point, adjacent pixels are traversed to divide abnormal areas until no new abnormal points are detected and all pixels have been traversed, and the area of each internal defect and the maximum temperature difference of each internal defect are recorded.
6. The camera housing detection method based on machine vision according to claim 5, characterized in that: Determining the internal inspection evaluation of the housing to be inspected based on the infrared image includes: ; Where S2 represents the internal inspection evaluation, At represents the volume of the shell to be inspected, Ae represents the volume of the e-th defect, We represents the mean of the standard temperature of the e-th defect, Wmax represents the maximum standard temperature difference, E represents the total number of internal defects, Qc represents the volume weight, and its value range is [30, 50], and Qd represents the temperature weight, and its value range is [10, 20].
7. The camera housing detection method based on machine vision according to claim 6, characterized in that: When performing detection and early warning based on the overall defect value, it includes: The overall defect value is calculated by the following formula: ; Where S represents the overall defect value, S1 represents the surface inspection evaluation, S2 represents the internal inspection evaluation, U1 and U2 represent weight coefficients, and U1+U2=1; Comparing the overall defect value with a first preset overall defect value and a second preset overall defect value respectively, if the first preset overall defect value is smaller than the second preset overall defect value, performing a detection and early warning according to the comparison result; When the overall defect value is less than or equal to the first preset overall defect value, a first-level defect warning is issued; when the overall defect value is greater than the first preset overall defect value and less than or equal to the second preset overall defect value, a second-level defect warning is issued; when the overall defect value is greater than the second preset overall defect value, a third-level defect warning is issued; the first-level defect warning is greater than the second-level defect warning, and the second-level defect warning is greater than the third-level defect warning.
8. A camera housing detection system based on machine vision, applied to the camera housing detection method based on machine vision according to any one of claims 1 to 7, characterized in that: include: An image acquisition device, used for acquiring image data of the shell to be inspected; A constant temperature heating device, used for heating the shell to be inspected at a constant temperature; An infrared image acquisition device, used for acquiring an infrared image of the housing to be inspected; an acquisition unit for acquiring image data of the shell to be detected to form an image data chain, performing feature extraction on each image data in the image data chain to obtain a feature vector of each image data; a processing unit, processing the image data chain based on a FLANN algorithm, and splitting the image data chain into a plurality of sub-data chains, each of which includes image data of multiple angles of the same position of the shell to be inspected; an identification unit, performing defect identification on each image data in each of the sub-data chains, removing duplicates by contour overlap, and determining the defect area and defect depth; a surface evaluation unit, configured to obtain a surface detection evaluation of the shell to be inspected based on the defect area and the defect depth; an internal evaluation unit, configured to determine an internal detection evaluation of the housing to be detected based on the infrared image; An early warning unit obtains an overall defect value of the shell to be inspected based on the surface inspection and evaluation and the internal inspection and evaluation, and performs inspection and early warning based on the overall defect value.
Citation Information
Patent Citations
Image-based defect detection method and device, electronic equipment and storage medium
CN117094974A
Isolated mineral insulated flexible cable detection method and system
CN119044205A
Bridge steel structure welding quality detection device and method
CN119107572A
Prospective Search of Objects Using K-D Forest
US20140067870A1