Automobile part size detection system and method based on machine vision
By acquiring the geometric model data and standard plane data of automobile parts, adjusting the image acquisition range, and using the feature point distance relationship to make dimension judgments, the problem of high error rate for automotive parts in the prior art is solved, and higher detection accuracy and reliability are achieved.
Patent Information
- Application Number
- CN202510014278.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-06
- Publication Date
- 2025-03-28
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art only improves image quality in automotive parts size detection, but fails to effectively judge the correctness of the image, resulting in possible errors. Especially for larger parts, the error rate is high, resulting in the simulation calculated dimension data inconsistent with the actual data.
By acquiring geometric model data of automobile parts, extracting feature points, determining standard plane data, and adjusting the image acquisition range based on error data, ensuring that the image acquisition device can collect accurate dimensional data. For large parts, the distance relationship between feature points is used to make dimension judgments, and the acquisition area is adjusted by step displacement.
It improves the accuracy of automotive parts size detection, reduces the error rate, and ensures the matching of the detection results with actual data. Especially for large parts, through multiple acquisitions and error adjustments, the accuracy of dimensional measurement can be effectively solved.
Smart Images

Figure CN119714084A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of visual inspection technology, and in particular to a system and method for inspecting automobile parts dimensions based on machine vision. Background Art
[0002] With the advent of the industrial age, the manufacturing industry has continuously increased its requirements for production efficiency and product quality. As a key component of automobile manufacturing, the dimensional accuracy of automobile parts directly affects the overall performance and safety of the car. Therefore, efficient and accurate dimensional detection of automobile parts has become extremely important.
[0003] In related technologies, a high-resolution camera is used to capture images of automotive parts to be tested, and the image quality is ensured by adjusting the capture angle and light. The captured images are then grayscaled, denoised, and repaired to further improve image clarity and signal-to-noise ratio. The features of the parts are then extracted from the processed images, and the extracted feature information is analyzed and calculated based on the built-in algorithm model to determine the simulated size of the parts.
[0004] Regarding the above-mentioned related technologies, when processing the captured images, only the image quality is improved, but the correctness of the image itself is not judged, which may lead to errors. At the same time, since the sizes of automobile parts vary, for larger automobile parts, a single image capture will increase the error rate of the image, which in turn causes the size data obtained by simulation calculation to be inconsistent with the actual size data, resulting in large errors and room for improvement. Summary of the invention
[0005] In order to improve the accuracy of size detection, the present application provides a system and method for detecting the size of automobile parts based on machine vision.
[0006] In the first aspect, the present application provides a method for detecting the size of automobile parts based on machine vision, which adopts the following technical solutions:
[0007] The method of detecting the size of automobile parts based on machine vision includes:
[0008] Acquire geometric model data of the automobile part to be inspected, and extract feature points from the geometric model data to obtain feature point data;
[0009] Capturing images of the test platform based on the initial acquisition range to obtain initial static image data; wherein the initial static image data includes an initial reference scale;
[0010] Acquire the information to be detected, and match the geometric model data according to the information to be detected to determine the standard plane data;
[0011] Compare the standard plane data with the initial acquisition range of the image acquisition device, and if the standard plane data is less than or equal to the initial acquisition range, use the initial acquisition range as the image acquisition range of the image acquisition device for the automobile part to be inspected;
[0012] If the standard plane data is larger than the initial acquisition range, the error data of the automobile part to be inspected is obtained, and the initial acquisition range of the image acquisition device is adjusted according to the error data to obtain the image acquisition range;
[0013] Based on the image acquisition range, an image of the part to be inspected on the inspection table is acquired to obtain first image data;
[0014] Compare the first image data with the standard plane data to determine the size category of the part to be detected; the size category includes large parts and small parts; mark the part to be detected whose first image data is larger than the standard plane data as a large part, and mark the part to be detected whose second image data is less than or equal to the standard plane data as a small part;
[0015] If the size category of the part to be inspected is a small part, the standard plane data is compared with the first image data based on the initial static image data to determine the size data of the part to be inspected;
[0016] If the size category of the part to be inspected is a large part, the position distance data between each feature point data is determined based on the geometric model data and the feature point data;
[0017] Compare the position distance data with the image acquisition range, mark the feature point data whose position distance data is less than or equal to the image acquisition range as feature data to be detected; mark the feature point data whose position distance is greater than the image acquisition range as feature data to be determined;
[0018] The part to be inspected is collected based on the feature data to be inspected to obtain second image data, and the size of the second image data is judged based on the standard plane data to obtain the size data of the feature data to be inspected on the part to be inspected;
[0019] Adjusting the acquisition area of the part to be inspected based on the position distance data of the feature data to be determined and the image acquisition range to obtain third image data, and performing size determination on the third image data based on the standard plane data to obtain size data of the feature data to be determined on the part to be inspected;
[0020] The size data of the feature data to be detected and the size data of the feature data to be judged are counted to obtain the size data of the part to be detected.
[0021] Preferably, based on the geometric model data of the automobile part to be inspected, the surface data of the geometric model is determined;
[0022] Based on the surface data of the geometric model data, determine the integrity of the surface data;
[0023] If there is a hole in the surface corresponding to the surface data in the geometric model data, it is determined that the surface data is not complete;
[0024] If there is no hole in the surface corresponding to the surface data in the geometric model data, then it is determined that the surface data is complete;
[0025] If the surface data is complete, the intersection points between the boundaries on each surface data are determined based on the surface data, and recorded as the first feature point, and the position information of the first feature point is marked as the first feature point data;
[0026] If the surface data is not complete, the distance data between the center point position of the hole on the corresponding surface and each boundary is determined based on the surface data, and the hole is marked as a second feature point, and the distance data between the center point position of the hole and each boundary is marked as second feature point data;
[0027] The first feature point, the first feature point data, the second feature point and the second feature point data are uniformly marked as feature point data.
[0028] Preferably, the detection platform is subjected to image acquisition in different acquisition ranges to obtain comparative image data;
[0029] Performing pixel measurement on the initial static image data to obtain first pixel measurement data;
[0030] Performing pixel measurement on the comparison image data to obtain second pixel measurement data;
[0031] Judging the first pixel measurement data based on the acquisition range to obtain theoretical pixel data;
[0032] Performing difference calculation on the second pixel measurement data and the theoretical pixel data to obtain difference data;
[0033] Based on the difference data, theoretical pixel data and initial reference scale, the error rate under the corresponding acquisition range is determined, and the error rates under different acquisition ranges are statistically analyzed to obtain an error rate table;
[0034] The error data of the automobile parts to be inspected are matched with the error rate table to determine the optimal acquisition range of the automobile parts to be inspected and marked as the image acquisition range.
[0035] Preferably, based on the initial static image data and the image acquisition range, image scale processing is performed on the standard plane data to obtain standard image data;
[0036] Comparing the standard image data with the first image data to determine the difference points;
[0037] If there is no difference point between the first image data and the standard image data, the dimension data corresponding to the standard plane data is used as the dimension data of the corresponding surface of the part to be inspected;
[0038] If there are difference points between the first image data and the standard image data, pixel statistics are performed on the standard image data and the first image data to obtain standard pixel data and first image pixel data;
[0039] Performing difference calculation on the standard pixel data and the first image pixel data to obtain pixel difference data;
[0040] Determining an error rate based on the image acquisition range, and determining an error value based on the pixel difference data and the error rate;
[0041] Determine the size data corresponding to the first image data based on the standard pixel data and the error value;
[0042] The size data of each detected surface of the part to be detected are counted to obtain the size data of the part to be detected.
[0043] Preferably, based on the standard image data, the positional relationship between the feature data to be detected and the feature data to be judged on the standard image data is determined, and the area to be detected is determined according to the positional relationship between the feature data to be detected and the feature data to be judged on the standard image;
[0044] Determine the detection distance of the detection area based on the standard image data, and adjust the area position of the acquisition area based on the detection distance to obtain the starting acquisition position and the end acquisition position;
[0045] Based on the starting acquisition position and the end acquisition position, the part to be inspected is acquired to obtain the starting acquisition image and the end acquisition image;
[0046] Based on the initial acquisition image, standard image data and the distance to be detected, a simulated end point image is generated;
[0047] Compare the endpoint simulation image with the endpoint acquisition image to determine the image difference points;
[0048] If there is no image difference point between the endpoint simulation image and the endpoint acquisition image, it is determined that the size data of the inspection area on the part to be inspected is the same as the size data of the inspection area on the standard image data, and the size data of the inspection area on the standard image data is used as the size data of the inspection area on the part to be inspected;
[0049] If there is an image difference point between the endpoint simulation image and the endpoint acquisition image, the image acquisition range is used, and the image acquisition position of the endpoint is acquired under different acquisition ranges, and the error value of the acquired image is judged to obtain the still image error;
[0050] Based on the starting acquisition position and the end acquisition position, the end acquisition position is moved and acquired in different acquisition ranges, and the error value of the image acquired by the movement is judged to obtain the dynamic error;
[0051] The static image error and dynamic error under the same acquisition range are summed to obtain the total error value;
[0052] The total error values under different acquisition ranges are compared, and the dimension data with the smallest total error value is used as the dimension data of the inspection area of the part to be inspected.
[0053] Preferably, when the first image data, the second image data and the third image data acquired are uniformly marked as acquired image data;
[0054] Based on the acquisition area corresponding to the acquisition range, the acquired image data is compared with the standard image data to determine whether one end of the acquired image data is deformed;
[0055] If it is determined that one end of the collected image data is deformed, the end of the collected image data that is deformed is marked as the deformed end, and the end that is not deformed is marked as the undeformed end;
[0056] One end of the standard image data corresponding to the undeformed end in the collected image data is used as reference data, and the deformed end of the standard image data is deformed to obtain standard deformed image data;
[0057] Comparing the standard deformed image data with the collected image data, if the collected image data is the same as the standard deformed image data, then determining that the collected image data is accurate;
[0058] If the collected image data is different from the standard deformed image data, it is determined that the collected image data is not accurate;
[0059] If the collected image data is accurate, an acquisition failure alarm is output;
[0060] If the collected image data is not accurate, a device failure alarm will be output.
[0061] In the second aspect, the present application provides an automobile parts size detection system based on machine vision, which adopts the following technical solutions:
[0062] The automobile parts size detection system based on machine vision includes: information initialization module, image acquisition module and size judgment module;
[0063] An information initialization module is used to obtain geometric model data of an automobile part to be inspected, and extract feature points from the geometric model data to obtain feature point data; perform image acquisition on the inspection platform based on an initial acquisition range to obtain initial static image data; wherein the initial static image data includes an initial reference scale; obtain information to be inspected, and match the geometric model data according to the information to be inspected to determine standard plane data; compare the standard plane data with an initial acquisition range of an image acquisition device, and if the standard plane data is less than or equal to the initial acquisition range, use the initial acquisition range as the image acquisition range of the image acquisition device for the automobile part to be inspected; if the standard plane data is greater than the initial acquisition range, obtain error data of the automobile part to be inspected, and adjust the initial acquisition range of the image acquisition device according to the error data to obtain an image acquisition range;
[0064] An image acquisition module acquires images of the parts to be inspected on the inspection platform based on the image acquisition range to obtain first image data; compares the first image data with the standard plane data to determine the scale category of the parts to be inspected; the scale category includes large parts and small parts; marks the parts to be inspected whose first image data is larger than the standard plane data as large parts, and marks the parts to be inspected whose second image data is less than or equal to the standard plane data as small parts;
[0065] The size judgment module, if the scale category of the part to be detected is a small part, compares the standard plane data with the first image data according to the initial static image data to determine the size data of the part to be detected; if the scale category of the part to be detected is a large part, determines the position distance data between each feature point data based on the geometric model data and the feature point data; compares the position distance data with the image acquisition range, and marks the feature point data whose position distance data is less than or equal to the image acquisition range as the feature data to be detected; marks the feature point data whose position distance is greater than the image acquisition range as the feature data to be determined; based on the feature data to be detected, the part to be detected is collected to obtain the second image data, and the size of the second image data is judged based on the standard plane data to obtain the size data of the feature data to be detected on the part to be detected; based on the position distance data of the feature data to be determined and the image acquisition range, the collection area of the part to be detected is adjusted to obtain the third image data, and the size of the third image data is judged based on the standard plane data to obtain the size data of the feature data to be determined on the part to be detected; the size data of the feature data to be detected and the size data of the feature data to be determined are counted to obtain the size data of the part to be detected.
[0066] In summary, the present application includes at least one of the following beneficial technical effects:
[0067] 1. By acquiring the geometric model data of the automobile parts to be inspected, the size data of the automobile parts on each surface is clarified. By performing initial image acquisition on the inspection platform, the image acquisition device is calibrated to make the judgment result more accurate. By determining the information to be inspected, the plane information that the image acquisition device needs to collect next is determined. Then, the acquisition range of the image acquisition device is adjusted by using the standard plane data so that the image acquisition device can achieve the best acquisition result. Then, according to the error data of the automobile parts to be inspected, the influence of the adjusted acquisition range on the acquisition effect and size data judgment result of the automobile parts is minimized, thereby improving the accuracy of the judgment. When the part to be inspected is judged to be a small part, the size data of the part to be inspected is directly compared with the standard plane data to quickly and effectively determine the size data of the part to be inspected. When the part to be inspected is judged to be a large part, the size judgment is performed on the feature points that can be directly judged by using the distance relationship between the feature points, and the step displacement judgment is performed on the feature points that cannot be directly judged, thereby solving the problem that the automobile parts cannot be effectively measured due to being too large, making the judgment result more accurate and effective;
[0068] 2. By using different acquisition ranges, the pixel measurement data actually acquired is compared with the pixel data theoretically acquired, so as to determine the pixel error presented when the same object is acquired in different acquisition ranges, and then the error rate of an actual pixel corresponding to the pixel error is determined according to the initial reference scale in the initial static image data, and then the error rate of different acquisition ranges is determined, and the final acquisition range is determined according to the allowable error of the actual automobile parts to be inspected, so that when the acquired acquisition range is used to judge the automobile parts, the judgment error is within the allowable error, thereby improving the accuracy of the judgment result;
[0069] 3. Comprehensively utilize different acquisition ranges to obtain different acquisition results for the same position. On the basis of the same starting acquisition image, compare the end point acquisition image with the end point simulation image, and then judge the distance data between the starting acquisition image and the end point acquisition image to clarify the size data between the corresponding feature points. When it is determined that the end point simulation image is different from the end point acquisition image, use different acquisition ranges to perform multiple acquisitions on the parts to be inspected at the same position to determine the acquisition error caused by different acquisition ranges. Then, use the same acquisition range and the same starting acquisition image to step the image acquisition device and perform image acquisition on the result after the movement to determine the movement error caused by the same acquisition range. By statistically analyzing the acquisition errors and movement errors of multiple acquisition ranges and taking the error data of the area to be inspected with the smallest total error value, the judgment result of the area to be inspected is more effective and reliable. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] Figure 1This is a flowchart of the steps of the image recognition method based on artificial intelligence in this embodiment;
[0071] Figure 2 Module block diagram of the artificial intelligence-based image recognition system of this embodiment.
[0072] Figure numerals: 1. Information initialization module; 2. Image acquisition module; 3. Size judgment module. DETAILED DESCRIPTION
[0073] The following is combined with Figure 1-Figure 2 This application is described in further detail.
[0074] The embodiments of the present application disclose a system and method for detecting the size of automobile parts based on machine vision.
[0075] Example: Figure 1 As shown, the automobile parts size detection method based on machine vision of the present invention comprises:
[0076] S100, obtaining geometric model data of the automobile part to be inspected, and extracting feature points from the geometric model data to obtain feature point data; wherein the feature point data is structural information for each surface that needs to be size-determined.
[0077] S200, performing image acquisition on the detection platform based on the initial acquisition range to obtain initial static image data; wherein the initial static image data includes an initial reference scale; by setting the initial reference scale for the detection platform, the scale length corresponding to the number of pixels in the image is clarified.
[0078] S300, obtaining information to be detected, and matching geometric model data according to the information to be detected to determine standard plane data; wherein the information to be detected is used to clarify the specific surface of the automobile part to be detected.
[0079] S400, comparing the standard plane data with the initial acquisition range of the image acquisition device. If the standard plane data is less than or equal to the initial acquisition range, the initial acquisition range is used as the image acquisition range of the image acquisition device for the automobile parts to be inspected; wherein the image acquisition device can be a high-definition camera.
[0080] S500, if the standard plane data is larger than the initial acquisition range, the error data of the automobile part to be inspected is obtained, and the initial acquisition range of the image acquisition device is adjusted according to the error data to obtain the image acquisition range; by judging the standard plane data, it is determined whether the acquisition range of the image acquisition device needs to be adjusted, so that the adjusted acquisition range can capture the image of the automobile part to be inspected to the greatest extent, and at the same time, according to the allowable error data of the automobile part to be inspected, the image collected after adjustment has the lowest impact on the size judgment of the automobile part, thereby reducing the occurrence of misjudgment. Since the error after adjustment is within the allowable error range of the automobile part, the usability of the automobile part can be ensured even if the final judgment result does not match the actual data.
[0081] S600, based on the image acquisition range, the image of the part to be inspected on the inspection table is acquired to obtain first image data; wherein, when acquiring the part to be inspected on the inspection table, the quality of the acquired image is optimized at the hardware level by using a high-definition camera, effective lighting, etc. wherein multiple light sources can be used to form parallel light, so that the sampling result is more accurate.
[0082] S700, compare the first image data with the standard plane data to determine the size category of the part to be detected; the size category includes large parts and small parts; mark the part to be detected whose first image data is larger than the standard plane data as a large part, and mark the part to be detected whose second image data is less than or equal to the standard plane data as a small part; wherein, a small part is an automobile part that can be directly captured as a whole by an image acquisition device, and a large part is an automobile part that requires at least two image acquisitions to complete the acquisition of the automobile part as a whole.
[0083] S800, if the size category of the part to be inspected is a small part, comparing the standard plane data with the first image data according to the initial static image data to determine the size data of the part to be inspected;
[0084] S900, if the size category of the part to be inspected is a large part, determining the position distance data between each feature point data based on the geometric model data and the feature point data;
[0085] S1000, comparing the position distance data with the image acquisition range, marking the feature point data whose position distance data is less than or equal to the image acquisition range as feature data to be detected; marking the feature point data whose position distance data is greater than the image acquisition range as feature data to be determined;
[0086] S1100, collecting the part to be inspected based on the feature data to be inspected to obtain second image data, and performing size judgment on the second image data based on the standard plane data to obtain size data of the feature data to be inspected on the part to be inspected;
[0087] S1200, adjusting the acquisition area of the part to be inspected based on the position distance data of the feature data to be determined and the image acquisition range to obtain third image data, and performing size determination on the third image data based on the standard plane data to obtain size data of the feature data to be determined on the part to be inspected;
[0088] S1300, collecting statistics on the size data of the feature data to be detected and the size data of the feature data to be judged, to obtain the size data of the part to be detected.
[0089] In this embodiment, by acquiring the geometric model data of the automobile part to be detected, the size data of the automobile part on each surface is clarified, and by performing initial image acquisition on the detection platform to calibrate the image acquisition device, the judgment result is more accurate. By determining the information to be detected, the plane information that the image acquisition device needs to collect next is determined, and then the acquisition range of the image acquisition device is adjusted by using the standard plane data so that the image acquisition device can achieve the best acquisition result. Then, according to the error data of the automobile part to be detected, the influence of the adjusted acquisition range on the acquisition effect and the size data judgment result of the automobile part is minimized, thereby improving the accuracy of the judgment. By acquiring and judging the image of the part to be detected, different measures are taken according to different situations, so that the judgment result is more accurate. When the part to be detected is judged to be a small part, the size data of the part to be detected is directly compared with the standard plane data, and the size data of the part to be detected is quickly and effectively determined. When the part to be detected is judged to be a large part, the size judgment is performed on the feature points that can be directly judged by using the distance relationship between the feature points, and the step displacement judgment is performed on the feature points that cannot be directly judged, thereby solving the problem that the automobile part cannot be effectively measured due to being too large, and making the judgment result more accurate and effective.
[0090] In step S100, the geometric model data of the automobile part to be inspected is obtained, and feature points are extracted from the geometric model data to obtain feature point data, which includes the following steps:
[0091] S110, determining surface data of the geometric model based on the geometric model data of the automobile part to be inspected;
[0092] S120, determining the integrity of the surface data based on the surface data of the geometric model data;
[0093] S130, if a hole exists in the surface corresponding to the surface data in the geometric model data, determining that the surface data is not complete;
[0094] S140, if there is no hole in the surface corresponding to the surface data in the geometric model data, then determining that the surface data is complete;
[0095] S150, if the surface data is complete, determine the intersection points between the boundaries on each surface data based on the surface data, record them as first feature points, and mark the position information of the first feature points as first feature point data;
[0096] S160, if the surface data is not complete, determining the distance data between the center point position of the hole existing on the corresponding surface and each boundary based on the surface data, marking the hole as a second feature point, and marking the distance data between the center point position of the hole and each boundary as second feature point data;
[0097] S170: Mark the first feature point, the first feature point data, the second feature point, and the second feature point data as feature point data.
[0098] In this embodiment, the geometric model of the automotive parts to be inspected is judged to determine the integrity of each surface that needs to be inspected, and then the dimensional data that needs to be measured is determined based on the integrity of the surface, thereby clarifying the inspection target of the dimensional inspection system, making subsequent inspection results more comprehensive and effective. At the same time, by using the geometric model for judgment, the amount of human input is reduced, thereby improving efficiency, reducing the human error rate, and making the inspection results more accurate.
[0099] For example, if the detected surface is a rectangle, you only need to determine the length and width of the rectangle. If the detected surface is a rectangle and there is a circle inside the rectangle, in addition to determining the length and width of the rectangle, you also need to determine the position of the center of the circle in the rectangle and the diameter of the circle. Therefore, by determining the target to be detected, the subsequent judgment results are more comprehensive and effective.
[0100] In step S500, if the standard plane data is larger than the initial acquisition range, the error data of the automobile part to be inspected is obtained, and the initial acquisition range of the image acquisition device is adjusted according to the error data to obtain the image acquisition range, including the following steps:
[0101] S510, performing image acquisition in different acquisition ranges on the detection platform to obtain comparative image data;
[0102] S520, performing pixel measurement on the initial static image data to obtain first pixel measurement data;
[0103] S530, performing pixel measurement on the comparison image data to obtain second pixel measurement data;
[0104] S540, judging the first pixel measurement data based on the acquisition range to obtain theoretical pixel data;
[0105] S550, performing difference calculation between the second pixel measurement data and the theoretical pixel data to obtain difference data;
[0106] S560, determining the error rate in the corresponding acquisition range based on the difference data, the theoretical pixel data and the initial reference scale, and performing statistics on the error rates in different acquisition ranges to obtain an error rate table;
[0107] S570, matching the error data of the automobile part to be inspected with the error rate table, determining the best acquisition range of the automobile part to be inspected, and marking it as the image acquisition range.
[0108] In this embodiment, by using different acquisition ranges, the pixel measurement data actually acquired is compared with the pixel data theoretically acquired, so as to determine the pixel error presented when the same object is acquired in different acquisition ranges, and then the error rate of an actual pixel corresponding to the pixel error is determined based on the initial reference scale in the initial static image data, and then the error rate of different acquisition ranges is determined, and the final acquisition range is determined based on the allowable error of the actual automobile parts to be inspected, so that when the acquired acquisition range is used to judge the automobile parts, the judgment error is within the allowable error, thereby improving the accuracy of the judgment result.
[0109] For example, there are 10 pixels in the initial static image data, and 10 pixels correspond to 1 cm. When the acquisition range is doubled, there are 6 pixels in the comparison image data, while theoretically there are 5 pixels (px) in the comparison image data. The error of 1 pixel is the acquisition error, and the error value of 1 pixel is If the allowable error of automobile parts is The maximum image acquisition range is 2 times the acquisition range.
[0110] In step S800, if the size category of the part to be inspected is a small part, the standard plane data is compared with the first image data according to the initial static image data to determine the size data of the part to be inspected, including the following steps:
[0111] S810, based on the initial static image data and the image acquisition range, perform image scale processing on the standard plane data to obtain standard image data; adjust the size of the initial static image data through the image acquisition range to determine the actual acquisition area, and then scale the standard plane data to the actual acquisition area so that the standard plane data is displayed normally on the actual acquisition area.
[0112] S820, comparing the standard image data with the first image data to determine the difference; by comparing the two images, it is possible to quickly determine whether the two images are the same, and further to quickly determine whether there is a difference in the size data in the first image data.
[0113] S830, if there is no difference point between the first image data and the standard image data, the dimension data corresponding to the standard plane data is used as the dimension data of the corresponding surface of the part to be inspected;
[0114] S840, if there are difference points between the first image data and the standard image data, perform pixel point statistics on the standard image data and the first image data to obtain standard pixel data and first image pixel data;
[0115] S850, performing difference calculation on the standard pixel data and the first image pixel data to obtain pixel difference data;
[0116] S860, determining an error rate based on the image acquisition range, and determining an error value based on the pixel difference data and the error rate;
[0117] S870, determining size data corresponding to the first image data based on the standard pixel data and the error value;
[0118] S880, collecting statistics on the size data of each detected surface of the part to be detected to obtain the size data of the part to be detected.
[0119] In this embodiment, the size template of the standard plane data is determined by using the image acquisition range and the initial static image data, and the standard plane data is adjusted in a corresponding proportion according to the size template, so that the standard image data and the first image data are at the same comparison level, making the judgment result more credible. Then, by performing image comparison between the standard image data and the first image data, the judgment result is faster and simpler. When there is a difference between the first image data and the standard image data, the pixels in the difference area are counted, so as to determine the error value of the size data between the first image data and the standard image data according to the error rate corresponding to the image acquisition range, and then determine the size data of the first image data, so that the judgment result can be effectively output.
[0120] For example, the initial static image data is 10px×10px, corresponding to 1cm×1cm, and the image acquisition range is 2 times. Then the size of the initial static image data in the image acquisition range is 5px×5px, corresponding to 1cm×1cm. Therefore, by scaling the standard plane data in proportion, assuming that the standard plane data is the same as the initial static image data, the original standard plane data is 10cm×10cm, and the corresponding pixel points are 100px×100px. After scaling, the size data is 50px×50px. Then, by directly comparing the actually collected first image data with the standard image data, for example, the actually collected first image data is 60px×50px, then it is determined that there is a difference. For example, the measurement item corresponding to 60px is length, and the error value of the length is Then the size data of the first image data is 12cm×10cm.
[0121] In step S1200, the acquisition area of the part to be detected is adjusted based on the position distance data of the feature data to be determined and the image acquisition range to obtain third image data, and the size of the third image data is determined based on the standard plane data to obtain the size data of the feature data to be determined on the part to be detected, including the following steps:
[0122] S1210, based on the standard image data, determining the positional relationship between the feature data to be detected and the feature data to be judged on the standard image data, and determining the area to be detected according to the positional relationship between the feature data to be detected and the feature data to be judged on the standard image;
[0123] S1220, determining a distance to be detected of the area to be detected based on the standard image data, and adjusting the area position of the acquisition area based on the distance to be detected to obtain a starting acquisition position and an end acquisition position;
[0124] S1230, based on the starting acquisition position and the ending acquisition position, the part to be inspected is acquired to obtain a starting acquisition image and an ending acquisition image; wherein the starting acquisition image and the ending acquisition image are uniformly marked as third image data.
[0125] S1240, simulating and generating an endpoint simulation image based on the starting acquisition image, the standard image data and the distance to be detected;
[0126] S1250, comparing the endpoint simulation image with the endpoint acquisition image to determine image difference points;
[0127] S1260, if there is no image difference point between the endpoint simulation image and the endpoint acquisition image, determine that the size data of the inspection area on the part to be inspected is the same as the size data of the inspection area on the standard image data, and use the size data of the inspection area on the standard image data as the size data of the inspection area on the part to be inspected;
[0128] S1270, if there is an image difference point between the endpoint simulation image and the endpoint acquisition image, then perform image acquisition at the endpoint acquisition position in different acquisition ranges through the image acquisition range, and perform error value judgment on the acquired images to obtain a still image error;
[0129] S1280, based on the starting acquisition position and the end acquisition position, performing mobile acquisition on the end acquisition position in different acquisition ranges, and performing error value judgment on the images acquired through mobile acquisition to obtain a dynamic error;
[0130] S1290, summing up the static image error and the dynamic error in the same acquisition range to obtain a total error value;
[0131] S12100, comparing the total error values under different acquisition ranges, and taking the dimension data with the smallest total error value as the dimension data of the inspection area of the part to be inspected.
[0132] In this embodiment, when it is determined that the scale of the part to be inspected is large, the distance between the feature points is determined to determine the inspection area that can be referenced by the feature points and the inspection area that cannot be referenced by the feature points. The inspection area that can be referenced by the feature points can be directly compared with the standard image data to determine the corresponding size data. For the inspection area that cannot be referenced by the feature points, the inspection distance of the inspection area is measured by using the standard image data to determine the starting acquisition image and the end point acquisition image actually collected in the inspection area. At the same time, the image at the end point position of the standard image data is selected according to the distance to be detected and the starting acquisition image to determine the image data under the ideal state. By comparing the actually collected end point acquisition image with the simulated end point simulation image, it is determined whether the end point acquisition image is the same as the end point simulation image. If they are the same, it indicates that the size data presented by the end point acquisition image is the same as the end point simulation image. Otherwise, it indicates that There are errors when acquiring the end point acquisition image, and the error phenomenon includes step distance errors when adjusting the position of the image acquisition device and / or acquisition errors during acquisition. Therefore, it is necessary to judge the cause of the error. By using different image acquisition ranges, images of the same area are acquired to clarify the acquisition errors caused by different image acquisition ranges themselves. Then, by acquiring and judging the images during stepping movement under different image acquisition ranges, the error caused by the step distance error is determined. By statistically analyzing the errors of the two methods, the size data of the area to be detected is determined, and then the size data of the part to be detected is determined.
[0133] By determining the position of the feature data to be determined on the standard image data, the area to be detected corresponding to the feature data to be determined is determined. The image acquisition device is moved stepwise and acquired according to the distance to be detected of the area to be detected, so as to determine the image data corresponding to the feature data to be determined. Then, the end point simulation image under the ideal result is determined by using the standard image data. On the basis of the same starting acquisition image, the end point acquisition image and the end point simulation image are compared, and then the distance data between the starting acquisition image and the end point acquisition image is determined to clarify the size data between the corresponding feature points. When it is determined that the end point simulation image is different from the end point acquisition image, the part to be detected at the same position is acquired multiple times by using different acquisition ranges, so as to determine the acquisition error caused by different acquisition ranges. Then, the image acquisition device is moved stepwise by the same acquisition range and the same starting acquisition image, and the image acquisition result after the movement is acquired, so as to determine the movement error caused by the same acquisition range. By statistically analyzing the acquisition errors and movement errors of multiple acquisition ranges, and taking the error data of the area to be detected with the smallest total error value, the judgment result of the area to be detected is more effective and reliable.
[0134] For example, at point A, acquisition is performed within the acquisition range of a, b, and c to obtain images Aa, Ab, and Ac. By comparing images Aa, Ab, and Ac with the standard image X, corresponding acquisition errors Ma, Mb, and Mc are obtained. Then, the positions of the acquisition ranges a, b, and c are calibrated using images Aa, Ab, and Ac. The corresponding image is acquired at point B using a mobile image acquisition device to obtain images Ba, Bb, and Bc. Then, images Ba, Bb, and Bc are compared with the standard image Y to obtain corresponding movement errors Na, Nb, and Nc. According to the acquisition ranges a, b, and c, the acquisition errors Ma, Mb, and Mc and the movement errors Na, Nb, and Nc are added accordingly to obtain the corresponding total error values: Wa, Wb, and Wc.
[0135] The image recognition method based on artificial intelligence also includes the following steps:
[0136] S1, when the first image data, the second image data and the third image data obtained by acquisition are uniformly marked as acquired image data;
[0137] S2, based on the acquisition area corresponding to the acquisition range, compare the acquired image data with the standard image data to determine whether one end of the acquired image data is deformed; wherein the deformation is the appearance of perspective and other photographic phenomena in the acquired image.
[0138] S3, if it is determined that one end of the collected image data is deformed, the end of the collected image data that is deformed is marked as a deformed end, and the end that is not deformed is marked as a non-deformed end;
[0139] S4, using one end of the standard image data corresponding to the undeformed end in the collected image data as reference data, deforming the deformed end of the standard image data to obtain standard deformed image data;
[0140] S5, comparing the standard deformed image data with the collected image data, and if the collected image data is the same as the standard deformed image data, determining that the collected image data is accurate;
[0141] S6, if the collected image data is different from the standard deformation image data, then determining that the collected image data is not accurate;
[0142] S7, if the collected image data is accurate, output a collection fault alarm; wherein the collection fault alarm is used to remind the user that the image collection device has an image collection fault.
[0143] S8, if the collected image data is not accurate, then output a device failure alarm. The device failure alarm is used to remind the user that the image detection system has a failure and needs to be repaired.
[0144] In this embodiment, image deformation judgment is performed on the collected image data to determine whether the collected image is deformed. When it is determined that the collected image is deformed, the standard image data is correspondingly deformed, and the deformed standard deformed image data is compared with the collected image data to determine whether the deformation is caused by the position tilt of the image acquisition device. When the collected image data is the same as the standard deformed image data, it is determined that the deformation is caused by the position tilt of the image acquisition device, and a corresponding alarm signal is output to remind relevant personnel to repair the image acquisition device. When the collected image data is different from the standard deformed image data, it is determined that the size detection system has a fault, and the relevant staff are reminded to repair the equipment.
[0145] By performing image deformation judgment on the collected image data, the accuracy of the collected image is ensured, and the data obtained by analyzing the collected image data is more accurate and reliable. At the same time, by comparing the collected image data with the standard deformation image data, the image acquisition device is self-checked to ensure the normality of the image acquisition device, thereby further improving the accuracy of judging the size data of automobile parts based on the collected image data.
[0146] Exemplarily, the captured image is a rectangle determined by four vertices, namely A, B, C, and D, wherein the AB line is parallel to the CD line, and the AC line is parallel to the BD line. When the captured image undergoes perspective, for example, the AC end data is normal and has not been deformed, but the BD end data is abnormally deformed, then the BD end in the standard image data is deformed accordingly to obtain the corresponding deformed image data, and the captured image data is compared with the standard deformed image data to determine whether the image capture device is faulty, and then a corresponding alarm signal is output to remind the staff to adjust the equipment.
[0147] Based on the description of the above-mentioned embodiment of the image recognition method based on artificial intelligence, the embodiment of the present invention also discloses an automobile part size detection system based on machine vision:
[0148] like Figure 2 As shown, the automobile parts size detection system based on machine vision, by applying the above-mentioned artificial intelligence-based image recognition method, includes: an information initialization module 1, an image acquisition module 2 and a size judgment module 3;
[0149] Information initialization module 1, obtains geometric model data of the automobile part to be detected, and extracts feature points of the geometric model data to obtain feature point data; performs image acquisition on the detection platform based on the initial acquisition range to obtain initial static image data; wherein the initial static image data includes an initial reference scale; obtains information to be detected, and matches the geometric model data according to the information to be detected to determine standard plane data; compares the standard plane data with the initial acquisition range of the image acquisition device, and if the standard plane data is less than or equal to the initial acquisition range, the initial acquisition range is used as the image acquisition range of the image acquisition device for the automobile part to be detected; if the standard plane data is greater than the initial acquisition range, the error data of the automobile part to be detected is obtained, and the initial acquisition range of the image acquisition device is adjusted according to the error data to obtain the image acquisition range;
[0150] Image acquisition module 2, based on the image acquisition range, performs image acquisition on the part to be inspected on the inspection table to obtain first image data; compares the first image data with the standard plane data to determine the scale category of the part to be inspected; the scale category includes large parts and small parts; marks the part to be inspected whose first image data is larger than the standard plane data as a large part, and marks the part to be inspected whose second image data is less than or equal to the standard plane data as a small part;
[0151] Size judgment module 3, if the scale category of the part to be detected is small, then according to the initial static image data, the standard plane data is compared with the first image data to determine the size data of the part to be detected; if the scale category of the part to be detected is large, then based on the geometric model data and the feature point data, the position distance data between each feature point data is determined; the position distance data is compared with the image acquisition range, and the feature point data whose position distance data is less than or equal to the image acquisition range is marked as the feature data to be detected; the feature point data whose position distance is greater than the image acquisition range is marked as the feature data to be determined; based on the feature data to be detected, the part to be detected is collected to obtain the second image data, and the size of the second image data is judged based on the standard plane data to obtain the size data of the feature data to be detected on the part to be detected; based on the position distance data of the feature data to be determined and the image acquisition range, the collection area of the part to be detected is adjusted to obtain the third image data, and the size of the third image data is judged based on the standard plane data to obtain the size data of the feature data to be determined on the part to be detected; the size data of the feature data to be detected and the size data of the feature data to be determined are counted to obtain the size data of the part to be detected.
[0152] Compared with the existing automobile part size detection system and method based on machine vision, the present invention improves the accuracy of size detection.
[0153] The above are all preferred embodiments of the present application, and the protection scope of the present application is not limited thereto. Therefore, any equivalent changes made according to the structure, shape, and principle of the present application should be included in the protection scope of the present application.
Claims
1. A method for detecting the size of automobile parts based on machine vision, characterized in that: include: Acquire geometric model data of the automobile part to be inspected, and extract feature points from the geometric model data to obtain feature point data; Capturing images of the test platform based on the initial acquisition range to obtain initial static image data; wherein the initial static image data includes an initial reference scale; Acquire the information to be detected, and match the geometric model data according to the information to be detected to determine the standard plane data; Compare the standard plane data with the initial acquisition range of the image acquisition device, and if the standard plane data is less than or equal to the initial acquisition range, use the initial acquisition range as the image acquisition range of the image acquisition device for the automobile part to be inspected; If the standard plane data is larger than the initial acquisition range, the error data of the automobile part to be inspected is obtained, and the initial acquisition range of the image acquisition device is adjusted according to the error data to obtain the image acquisition range; Based on the image acquisition range, an image of the part to be inspected on the inspection table is acquired to obtain first image data; Compare the first image data with the standard plane data to determine the size category of the part to be detected; the size category includes large parts and small parts; mark the part to be detected whose first image data is larger than the standard plane data as a large part, and mark the part to be detected whose second image data is less than or equal to the standard plane data as a small part; If the size category of the part to be inspected is a small part, the standard plane data is compared with the first image data based on the initial static image data to determine the size data of the part to be inspected; If the size category of the part to be inspected is a large part, the position distance data between each feature point data is determined based on the geometric model data and the feature point data; Compare the position distance data with the image acquisition range, mark the feature point data whose position distance data is less than or equal to the image acquisition range as feature data to be detected; mark the feature point data whose position distance is greater than the image acquisition range as feature data to be determined; The part to be inspected is collected based on the feature data to be inspected to obtain second image data, and the size of the second image data is judged based on the standard plane data to obtain the size data of the feature data to be inspected on the part to be inspected; Adjusting the acquisition area of the part to be inspected based on the position distance data of the feature data to be determined and the image acquisition range to obtain third image data, and performing size determination on the third image data based on the standard plane data to obtain size data of the feature data to be determined on the part to be inspected; The size data of the feature data to be detected and the size data of the feature data to be judged are counted to obtain the size data of the part to be detected.
2. The method for detecting automobile parts size based on machine vision according to claim 1, characterized in that: The step of obtaining the geometric model data of the automobile part to be inspected and extracting feature points from the geometric model data to obtain feature point data is as follows: Determine surface data of the geometric model based on the geometric model data of the automobile part to be inspected; Based on the surface data of the geometric model data, determine the integrity of the surface data; If there is a hole in the surface corresponding to the surface data in the geometric model data, it is determined that the surface data is not complete; If there is no hole in the surface corresponding to the surface data in the geometric model data, then it is determined that the surface data is complete; If the surface data is complete, the intersection points between the boundaries on each surface data are determined based on the surface data, and recorded as the first feature point, and the position information of the first feature point is marked as the first feature point data; If the surface data is not complete, the distance data between the center point position of the hole on the corresponding surface and each boundary is determined based on the surface data, and the hole is marked as a second feature point, and the distance data between the center point position of the hole and each boundary is marked as second feature point data; The first feature point, the first feature point data, the second feature point and the second feature point data are uniformly marked as feature point data.
3. The method for detecting automobile parts size based on machine vision according to claim 2, characterized in that: If the standard plane data is larger than the initial acquisition range, the error data of the automobile part to be inspected is obtained, and the initial acquisition range of the image acquisition device is adjusted according to the error data to obtain the image acquisition range, specifically: Capture images in different acquisition ranges on the detection platform to obtain comparative image data; Performing pixel measurement on the initial static image data to obtain first pixel measurement data; Performing pixel measurement on the comparison image data to obtain second pixel measurement data; Judging the first pixel measurement data based on the acquisition range to obtain theoretical pixel data; Performing difference calculation on the second pixel measurement data and the theoretical pixel data to obtain difference data; Based on the difference data, theoretical pixel data and initial reference scale, the error rate under the corresponding acquisition range is determined, and the error rates under different acquisition ranges are statistically analyzed to obtain an error rate table; The error data of the automobile parts to be inspected are matched with the error rate table to determine the optimal acquisition range of the automobile parts to be inspected and marked as the image acquisition range.
4. The method for detecting automobile parts size based on machine vision according to claim 3, characterized in that: If the size category of the part to be detected is a small part, the standard plane data is compared with the first image data according to the initial static image data to determine the size data of the part to be detected, specifically: Based on the initial static image data and the image acquisition range, image scale processing is performed on the standard plane data to obtain standard image data; Comparing the standard image data with the first image data to determine the difference points; If there is no difference point between the first image data and the standard image data, the dimension data corresponding to the standard plane data is used as the dimension data of the corresponding surface of the part to be inspected; If there are difference points between the first image data and the standard image data, pixel statistics are performed on the standard image data and the first image data to obtain standard pixel data and first image pixel data; Performing difference calculation on the standard pixel data and the first image pixel data to obtain pixel difference data; Determining an error rate based on the image acquisition range, and determining an error value based on the pixel difference data and the error rate; Determine the size data corresponding to the first image data based on the standard pixel data and the error value; The size data of each detected surface of the part to be detected are counted to obtain the size data of the part to be detected.
5. The method for detecting automobile parts size based on machine vision according to claim 4, characterized in that: The acquisition area of the part to be detected is adjusted based on the position distance data of the feature data to be determined and the image acquisition range to obtain the third image data, and the size of the third image data is determined based on the standard plane data to obtain the size data of the feature data to be determined on the part to be detected, specifically: Based on the standard image data, determine the positional relationship between the feature data to be detected and the feature data to be judged on the standard image data, and determine the area to be detected according to the positional relationship between the feature data to be detected and the feature data to be judged on the standard image; Determine the detection distance of the detection area based on the standard image data, and adjust the area position of the acquisition area based on the detection distance to obtain the starting acquisition position and the end acquisition position; Based on the starting acquisition position and the end acquisition position, the part to be inspected is acquired to obtain the starting acquisition image and the end acquisition image; Based on the initial acquisition image, standard image data and the distance to be detected, a simulated end point image is generated; Compare the endpoint simulation image with the endpoint acquisition image to determine the image difference points; If there is no image difference point between the endpoint simulation image and the endpoint acquisition image, it is determined that the size data of the inspection area on the part to be inspected is the same as the size data of the inspection area on the standard image data, and the size data of the inspection area on the standard image data is used as the size data of the inspection area on the part to be inspected; If there is an image difference point between the endpoint simulation image and the endpoint acquisition image, the image acquisition range is used, and the image acquisition position of the endpoint is acquired under different acquisition ranges, and the error value of the acquired image is judged to obtain the still image error; Based on the starting acquisition position and the end acquisition position, the end acquisition position is moved and acquired in different acquisition ranges, and the error value of the image acquired by the movement is judged to obtain the dynamic error; The static image error and dynamic error under the same acquisition range are summed to obtain the total error value; The total error values under different acquisition ranges are compared, and the dimension data with the smallest total error value is used as the dimension data of the inspection area of the part to be inspected.
6. The method for detecting automobile parts size based on machine vision according to claim 5, characterized in that: Also includes: When the acquired first image data, second image data and third image data are uniformly marked as acquired image data; Based on the acquisition area corresponding to the acquisition range, the acquired image data is compared with the standard image data to determine whether one end of the acquired image data is deformed; If it is determined that one end of the collected image data is deformed, the end of the collected image data that is deformed is marked as the deformed end, and the end that is not deformed is marked as the undeformed end; One end of the standard image data corresponding to the undeformed end in the collected image data is used as reference data, and the deformed end of the standard image data is deformed to obtain standard deformed image data; Comparing the standard deformed image data with the collected image data, if the collected image data is the same as the standard deformed image data, then determining that the collected image data is accurate; If the collected image data is different from the standard deformed image data, it is determined that the collected image data is not accurate; If the collected image data is accurate, an acquisition failure alarm is output; If the collected image data is not accurate, a device failure alarm will be output.
7. The automobile parts size detection system based on machine vision is characterized by: The system is used to implement the method for detecting automobile parts size based on machine vision as described in any one of claims 1 to 6: comprising: an information initialization module, an image acquisition module and a size judgment module; The information initialization module obtains the geometric model data of the automobile part to be detected, and extracts feature points from the geometric model data to obtain feature point data; performs image acquisition on the detection platform based on the initial acquisition range to obtain initial static image data; wherein the initial static image data includes an initial reference scale; obtains the information to be detected, and matches the geometric model data according to the information to be detected to determine the standard plane data; compares the standard plane data with the initial acquisition range of the image acquisition device, and if the standard plane data is less than or equal to the initial acquisition range, uses the initial acquisition range as the image acquisition range of the automobile part to be detected by the image acquisition device; if the standard plane data is greater than the initial acquisition range, obtains the error data of the automobile part to be detected, and adjusts the initial acquisition range of the image acquisition device according to the error data to obtain the image acquisition range; The image acquisition module acquires images of the parts to be inspected on the inspection table based on the image acquisition range to obtain first image data; compares the first image data with the standard plane data to determine the scale category of the parts to be inspected; the scale category includes large parts and small parts; marks the parts to be inspected whose first image data is larger than the standard plane data as large parts, and marks the parts to be inspected whose second image data is less than or equal to the standard plane data as small parts; The size judgment module, if the scale category of the part to be detected is a small part, compares the standard plane data with the first image data according to the initial static image data to determine the size data of the part to be detected; if the scale category of the part to be detected is a large part, determines the position distance data between each feature point data based on the geometric model data and the feature point data; compares the position distance data with the image acquisition range, and marks the feature point data whose position distance data is less than or equal to the image acquisition range as the feature data to be detected; marks the feature point data whose position distance is greater than the image acquisition range as the feature data to be determined; based on the feature data to be detected, the part to be detected is collected to obtain the second image data, and the size of the second image data is judged based on the standard plane data to obtain the size data of the feature data to be detected on the part to be detected; based on the position distance data of the feature data to be determined and the image acquisition range, the collection area of the part to be detected is adjusted to obtain the third image data, and the size of the third image data is judged based on the standard plane data to obtain the size data of the feature data to be determined on the part to be detected; the size data of the feature data to be detected and the size data of the feature data to be determined are counted to obtain the size data of the part to be detected.
Citation Information
Cited By
Part size detection method based on machine vision
CN120747194A