Industrial visual inspection system
By combining image denoising, perspective correction, and quality inspection algorithms with traceability information, the automation and precision of the industrial vision inspection system have been achieved, solving the problems of time-consuming and misjudgment in manual inspection and improving inspection efficiency and adaptability.
Patent Information
- Application Number
- CN202511643255.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-11
- Publication Date
- 2026-01-30
AI Technical Summary
Existing industrial vision inspection systems rely on manual inspection, which results in long inspection times and a high risk of missed or misjudged inspections. This makes it difficult to adapt to the diverse and personalized needs of production lines, affecting the accuracy and adaptability of inspections.
The image denoising module performs dual denoising and perspective correction to accurately locate the visual detection area. Combined with quality detection algorithms and traceability information, it realizes automated anomaly detection and real-time correction.
It improves the accuracy and adaptability of visual inspection, reduces human intervention, enhances inspection efficiency and early warning response speed, and enables rapid location and resolution of quality problems.
Smart Images

Figure CN121437482A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of visual detection, and in particular to an industrial visual detection system. BACKGROUND
[0002] Industrial visual detection, also known as machine vision, is a technology that uses image acquisition devices (such as cameras) and image processing algorithms to automatically detect, recognize and analyze target objects, replacing the human eye to make judgments and decisions. With the increasing demand for personalization and customization in the market, production lines need to be more flexible, which may result in differences in visual detection methods, packaging materials, etc. The diversity of industrial production lines requires visual detection systems to efficiently handle various changes, which puts higher requirements on the accuracy and adaptability of industrial visual detection systems.
[0003] Currently, when performing visual detection on industrial workpieces, visual detection still relies on manual inspection. Manual detection not only takes a long time, but is also susceptible to factors such as fatigue and distraction, leading to missed detection or misjudgment. Therefore, an automated and intelligent industrial visual anomaly detection system is particularly important. Therefore, how to improve the accuracy of industrial visual detection has become a problem to be solved.
[0004] Therefore, the present application provides an industrial visual detection system to solve the above problems. SUMMARY
[0005] The main purpose of the present application is to provide an industrial visual detection system to solve the problems raised in the background.
[0006] To achieve the above purpose, the technical scheme adopted by the present application is as follows: an industrial visual detection system, comprising: An image denoising module: collecting a packaging image of a workpiece, performing double denoising on the packaging image to obtain a denoised image of the packaging image, and performing perspective correction on the denoised image to obtain a corrected image of the denoised image; A detection area positioning module: performing visual detection area positioning on the corrected image to obtain a visual detection area of the corrected image, and performing quality detection on the workpiece according to the visual detection area and a preset quality detection algorithm to obtain a detection result of the workpiece; An extraction traceability information module: establishing an association between the visual detection result and traceability information, and tracking an abnormal sample in the visual detection according to a preset warning threshold, the detection result and the association; An abnormal correction module: realizing real-time correction of the visual detection angle anomaly of the workpiece according to real-time calculation of the hierarchical detection angle deviation.
[0007] The double denoising of the packaging image to obtain the denoised image of the packaging image comprises: filtering random noise in the packaging image to obtain a primary image of the packaging image; filtering salt and pepper noise in the primary image to obtain a secondary image of the primary image; verifying a double denoising effect of the secondary image by using a preset signal-to-noise ratio index, and determining a secondary image passing the double denoising effect verification as a denoised image of the packaging image.
[0008] The filtering of the salt and pepper noise in the primary image to obtain the secondary image of the primary image comprises: filtering the salt and pepper noise in the primary image by using a preset denoising algorithm to obtain the secondary image of the primary image.
[0009] The perspective correction of the denoised image to obtain the corrected image of the denoised image comprises: extracting feature points of the denoised image; constructing a perspective transformation matrix of the denoised image according to the feature points; performing geometric transformation on the denoised image according to the perspective transformation matrix to obtain the corrected image of the denoised image.
[0010] The extraction of the feature points of the denoised image comprises: generating an autocorrelation matrix of the denoised image; classifying pixel points in the denoised image according to the autocorrelation matrix and a preset response function to obtain the feature points of the denoised image.
[0011] The visual inspection area positioning of the corrected image to obtain the visual inspection area of the corrected image comprises: preliminarily positioning the visual inspection area in the corrected image by using a preset template to obtain an initial positioning area of the corrected image; optimizing the initial positioning area to obtain an optimized area of the initial positioning area; verifying the optimized area according to a preset verification rule to determine that an optimized area passing the area verification is the visual inspection area of the corrected image.
[0012] The quality detection of the workpiece according to the visual inspection area and a preset quality detection algorithm to obtain a detection result of the workpiece comprises: performing integrity checking on the workpiece according to the visual inspection area to obtain an integrity result of the workpiece; performing uniformity checking on the workpiece according to the visual inspection area to obtain a uniformity result of the workpiece; The quality scoring function in the preset quality detection algorithm is weighted and fused based on the integrity result and the uniformity result to obtain the updated quality scoring function; The updated quality scoring function is used to score the quality of the workpiece, and the inspection result of the workpiece is obtained.
[0013] The step of performing an integrity check on the workpiece based on the visual detection area to obtain the integrity result of the workpiece includes: Optical recognition is performed on the characters within the visual detection area to obtain the regional characters of the visual detection area; Calculate the matching degree between the characters in the region and the preset standard text; The integrity result of the workpiece is generated based on the matching degree.
[0014] The correlation between the visual detection results and the source tracing information includes: Generate a unique identifier for the traceability information; The unique identifier is associated with the detection result to obtain the association between the visual detection result and the traceability information; The method enables real-time correction of abnormal visual inspection angles of workpieces by calculating the step-by-step detection angle deviation in real time.
[0015] The present invention has the following beneficial effects: This invention employs a dual denoising technique to first reduce noise in the image, resulting in more accurate positioning of the visual inspection area. Perspective correction corrects distortions or deviations in the image, making the visual inspection area more standardized and easily identifiable. Precise positioning of the visual inspection area allows for focused quality inspection without interference from other areas. Combined with a pre-set quality inspection algorithm, the visual inspection area is scored, enabling real-time assessment of quality issues. Integrating traceability information with inspection results helps track the origin and distribution of abnormal products. By establishing a correlation between inspection results and traceability information, potential problems in the production process can be located more efficiently, enabling rapid batch traceability. This not only improves early warning efficiency but also helps quickly locate and resolve quality issues, reducing overall inspection time and costs. The system sets an early warning threshold; when the detected visual inspection quality score falls below a certain standard, an early warning is automatically triggered, and the tracking process begins. This automated early warning mechanism significantly improves the response speed of anomaly handling, reduces manual intervention, and increases the overall efficiency of the monitoring system. Therefore, this invention solves the problem of low anomaly detection early warning rates in industrial visual inspection. Furthermore, by promptly performing tiered corrections after a visual inspection early warning, the accuracy of industrial visual inspection is further increased. Attached Figure Description
[0016] Figure 1 FIG. 1 is a schematic diagram of an overall flow of an industrial visual inspection system according to an embodiment of the present application. DETAILED DESCRIPTION
[0017] It should be understood that the specific embodiments described herein are merely exemplary and do not limit the application.
[0018] An industrial visual inspection system is provided according to an embodiment of the present application. The execution subject of the industrial visual inspection system includes, but is not limited to, at least one of electronic devices capable of being configured to execute the method provided by the industrial visual inspection system, such as a server and a terminal. In other words, the industrial visual inspection system can be executed by software or hardware installed in a terminal device or a server device. The server includes, but is not limited to, a single server, a server cluster, a cloud server, or a cloud server cluster, etc. The server can be a stand-alone server, or a cloud server providing basic cloud computing services such as cloud service, cloud database, cloud computing, cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, and artificial intelligence platform, etc.
[0019] Reference Figure 1 FIG. 1 is a schematic diagram of an overall flow of an industrial visual inspection system according to an embodiment of the present application. In this embodiment, the industrial visual inspection system includes: S1, collecting a packaging image of a workpiece, and performing double denoising on the packaging image to obtain a denoised image of the packaging image.
[0020] In this embodiment of the present application, the collecting of the packaging image of the workpiece includes: According to a preset collection angle and a preset time window, an image of the workpiece is collected to obtain the packaging image of the workpiece.
[0021] In detail, a high-resolution camera or an industrial camera is used for image collection to ensure that the details of the workpiece, especially the visual inspection area, can be clearly captured. The device needs to have high image resolution and stability for subsequent processing and analysis.
[0022] In detail, the preset collection angle refers to selecting a suitable shooting angle according to the shape and size of the workpiece. Generally, the shooting angle should ensure that the visual inspection area of the workpiece can be covered, and image distortion caused by the angle problem can be avoided.
[0023] In detail, the preset time window refers to the timing of collecting the packaging image should ensure that the workpiece has completed all production processes, especially the visual inspection process. Through a suitable time window, it is ensured that the collected image can accurately reflect the quality state of the visual inspection.
[0024] In detail, during production line operation, real-time or timed data acquisition can be used for continuous monitoring to ensure that images of each package are captured in a timely manner. Image acquisition of workpieces requires high-level lighting, especially in industrial environments. It is necessary to ensure uniform lighting in the image acquisition area to avoid image distortion caused by uneven lighting or reflections.
[0025] Furthermore, specialized industrial light sources, such as ring lights or linear lights, should be used to avoid shadows interfering with the identification of the visual inspection area; the resolution of the acquired images should be high enough, typically at least 720p (1280x720 pixels) or higher, to ensure that details in the image are clearly visible, especially that tiny defects at the visual inspection area can be accurately captured; to improve image quality, autofocus technology can be used to ensure image clarity, especially in the details of the visual inspection.
[0026] In detail, if the visual inspection area may have different shapes or changes due to factors such as workpiece shape and visual inspection process, images can be acquired from multiple angles or different positions to ensure that the quality of the visual inspection area can be fully checked. In automated production lines, image acquisition equipment can automatically adjust the viewing angle according to the position of the workpiece to ensure that image data from multiple angles can be acquired.
[0027] In this embodiment of the invention, the step of performing dual denoising on the packaging image to obtain a denoised image of the packaging image includes: Random noise in the packaging image is filtered out to obtain a primary image of the packaging image; The salt-and-pepper noise in the primary image is filtered out to obtain the secondary image of the primary image; The secondary image is subjected to dual denoising effect verification using a preset signal-to-noise ratio index, and the secondary image that passes the dual denoising effect verification is determined to be the denoised image of the packaging image.
[0028] Specifically, filtering the salt-and-pepper noise in the primary image to obtain the secondary image of the primary image includes: The primary image is filtered for salt-and-pepper noise using a preset denoising algorithm to obtain a secondary image of the primary image. The preset denoising algorithm is as follows:
[0029] in, It is the position in the secondary image. pixel values, This indicates the median operation. It is the position in the primary image. pixel values, Therefore neighborhood centered on the pixel.
[0030] In detail, this is achieved by performing a median operation on the neighborhood around each pixel, thus eliminating very bright (salt) or very dark (pepper) points in the image.
[0031] In detail, for an input image (primary image) that contains salt and pepper noise, a denoising algorithm is used to remove these noises. The key of the denoising algorithm is the median filter, which aims to remove the salt and pepper noise in the image while preserving the structure and edges of the image.
[0032] In detail, assuming that the input image (primary image) already contains salt and pepper noise, which is usually composed of random very bright or very dark pixels. In image processing, it is necessary to remove these noises by certain algorithms without affecting the true structure of the image.
[0033] In detail, for each pixel in the image , a neighborhood region is defined , which is usually a rectangular region (usually 3x3 or 5x5) centered on the pixel
[0034] For example, if a 3x3 window is used, then will include the 8 pixels around pixel , plus itself, forming a 3x3 matrix in total.
[0035] Specifically, for a position in the image, its neighborhood will contain the following 9 pixel values: ; Further, for each pixel point , all pixel values g(s, t) in its neighborhood are extracted, and then these pixel values are sorted, and the median is taken as the value of the pixel in the new image.
[0036] Overall, the middle value is found from all neighborhood pixel values. If the number of pixel values in the neighborhood is odd, the median is the value in the middle; if it is even, the average of the two middle values is usually taken.
[0037] In detail, each time a pixel is processed, the updated pixel value is the median of the neighborhood of that position. For example, for position , the calculated is the median of all pixel values in its neighborhood. The above steps are repeated for each pixel in the image, i.e. for each position All use median filtering to calculate their new values. Finally, after median filtering, the salt and pepper noise in the image will be effectively removed.
[0038] S2, perspective correction is performed on the denoised image to obtain a corrected image of the denoised image.
[0039] In the embodiments of the present application, the perspective correction on the denoised image to obtain a corrected image of the denoised image comprises: extracting feature points of the denoised image; constructing a perspective transformation matrix of the denoised image according to the feature points; performing geometric transformation on the denoised image according to the perspective transformation matrix to obtain a corrected image of the denoised image.
[0040] In detail, the extraction of feature points is based on the gradient information of the image, and the pixels in the image are classified by the autocorrelation matrix and the response function to identify those points with obvious features.
[0041] In detail, the perspective transformation is to map the points of the image to new positions so that the perspective distortion in the image is corrected. The construction of the perspective transformation matrix usually depends on the pairs of extracted feature points.
[0042] Further, through feature point matching, the corresponding relationship between the original position and the target position in the image is found out. According to these feature points, the perspective transformation matrix is calculated by mathematical methods (such as least squares method) so that each point in the image can get the correct position after transformation.
[0043] In detail, the denoised image is geometrically transformed by using the calculated perspective transformation matrix to eliminate the perspective distortion in the image to obtain a corrected image.
[0044] Specifically, for each pixel point in the denoised image, its new position in the target image is calculated by the perspective transformation matrix, and interpolation calculation is performed to fill the pixel value of the target image.
[0045] In detail, the extraction of the feature points of the denoised image comprises: generating an autocorrelation matrix of the denoised image, wherein the autocorrelation matrix is: ; wherein, is the autocorrelation matrix of the denoised image, is the gradient at the pixel point is the transpose identifier of the matrix. According to the autocorrelation matrix and a preset response function, the pixel points in the denoising image are classified to obtain feature points of the denoising image.
[0046] In detail, the autocorrelation matrix can capture the local change of the image around each pixel point, thereby helping to identify the feature points in the image, representing the texture information of the pixel point in the local region, and being able to reflect the change mode of the local region.
[0047] In detail, represents gradient information at the pixel point , which can be calculated by the gradient of the image, and is usually based on the horizontal and vertical gradients of the image.
[0048] In detail, the preset response function is: ; wherein, is a response function value, reflecting the feature strength of the pixel point, is an eigenvalue of the autocorrelation matrix.
[0049] In detail, when the response function is greater, it indicates that the point is a feature point in the image, with more prominent local structure. In addition, the response function can also be further screened by some threshold value, that is, if R is greater than a preset threshold T, the point is considered to be a feature point. If R>T, the pixel is a feature point.
[0050] In detail, λ1 and λ2 are two eigenvalues of the autocorrelation matrix. The eigenvalue λ1 usually represents the change intensity of the image in the direction, and λ2 represents the change intensity in the vertical direction. When the R value is greater, it means that the local change of the pixel point is strong, and therefore it is considered to be a feature point.
[0051] S3, visual detection area positioning is performed on the corrected image to obtain a visual detection area of the corrected image.
[0052] In the embodiment of the application, the visual detection area positioning on the corrected image to obtain the visual detection area of the corrected image comprises: A preset template is used to preliminarily position the visual detection area in the corrected image to obtain an initial positioning area of the corrected image. The initial positioning area is subjected to region optimization to obtain an optimized area of the initial positioning area. According to a preset verification rule, the optimized area is subjected to region verification, and the optimized area that passes the region verification is determined as the visual detection area of the corrected image.
[0053] In detail, a preliminary positioning of the visual detection region in the corrected image is performed using a preset template. The template is usually a known pattern or image used to detect a specific region (such as the visual detection region), and by matching with the corrected image, a candidate region containing the visual detection region is preliminarily positioned.
[0054] In detail, the initial region in the image that may contain the visual detection region can be quickly positioned. The preset template is designed based on the characteristics of the image (such as color, shape, texture, etc.), ensuring that the visual detection region in the image can be identified.
[0055] Further, the process finds the best matching position by sliding the template in the image and calculating the similarity, obtaining the initial positioning region.
[0056] In detail, the initial positioning region is optimized. The optimization method can include edge enhancement, morphological operation (such as dilation, erosion), etc. The purpose is to further refine the boundary of the region and improve the positioning accuracy. Common optimization algorithms can also include image segmentation techniques, deep learning convolutional neural network (CNN) methods, or region growing-based optimization methods.
[0057] In detail, through this optimization, noise or errors that may exist in the preliminary positioning process can be eliminated, ensuring that the visual detection region is closer to the actual position.
[0058] Further, the optimized region is verified according to the preset verification rules. The verification rules can be based on multiple factors such as the shape, size, color, and texture features of the visual detection region. For example, it can be verified whether the visual detection region meets the predetermined geometric shape requirements (such as rectangle, circle, etc.), whether it has a reasonable size ratio, or whether it has a clear contrast with the background region, etc. If the optimized region meets these rules, it is determined that the region is an effective visual detection region, i.e., the visual detection region in the corrected image.
[0059] In summary, through the three stages of processing (preliminary positioning, region optimization, and region verification), the visual detection region in the image is accurately positioned, ensuring that the visual detection region is accurately identified.
[0060] S4, performing quality detection on the workpiece according to the visual detection region and a preset quality detection algorithm to obtain a detection result of the workpiece.
[0061] In the embodiment of the present application, the quality detection on the workpiece according to the visual detection region and the preset quality detection algorithm to obtain the detection result of the workpiece comprises: performing integrity checking on the workpiece according to the visual detection region to obtain an integrity result of the workpiece; According to the visual detection area, the workpiece is subjected to uniformity inspection, and a uniformity result of the workpiece is obtained; According to the integrity result and the uniformity result, a quality score function in a preset quality detection algorithm is weighted and fused to obtain an updated quality score function; The workpiece is subjected to quality scoring by using the updated quality score function, and a detection result of the workpiece is obtained.
[0062] In detail, the preset quality detection algorithm is: ; Among them, is the detection result of the workpiece, is a preset result of the workpiece, is a pixel point in the quality score function in the image after perspective correction, is a pixel set of the visual detection area.
[0063] In detail, the integrity and uniformity scores can be fused as weighted items into the pixel quality score function , and the updated quality score function.
[0064] In detail, the updated quality score function is: ; Among them, is a quality score function in a preset quality detection algorithm, is an updated quality score function, is an integrity score of a visual detection area, is a uniformity score of a visual detection area, and are coefficients for adjusting the influence weight of integrity and uniformity in the final score.
[0065] In detail, the workpiece visual detection area can be inspected by a preset OCR recognition algorithm to evaluate whether the visual detection is complete and whether the content meets the standard.
[0066] In detail, the image of the visual detection area is subjected to optical character recognition, and the text information (such as production date, batch number, and expiration date) contained in the image is extracted. The recognition process needs a trained OCR model to extract the text of the visual detection area by recognizing the text of the visual detection image.
[0067] In detail, the extracted text information is compared with a preset standard text. The standard text usually contains production information, batch number, production date, etc., which need to be accurately matched and verified. If the text is consistent, it is considered that the visual detection area is not a problem; if there is misplacement, missing or blur, etc., it is considered that the visual detection of the workpiece is not complete.
[0068] In detail, the uniformity of the visual detection area is detected to ensure that the appearance and quality of the visual detection have no irregularities (such as cracks, concave-convex points, mottling, etc.).
[0069] In detail, the quality of the text information recognized by the preset OCR recognition algorithm is evaluated to check whether the visual detection area has the following abnormalities: fuzzy or unclear text; text deformation, misplacement, overlap or missing; characters inconsistent with actual packaging standards (such as inconsistent production date and batch number); whether the visual detection is complete or loose (whether the visual detection edge has a gap, crack, etc. can be determined by image processing).
[0070] In detail, the integrity of the workpiece is checked according to the visual detection area, and the integrity result of the workpiece is obtained, including: Optically recognizing the characters in the visual detection area to obtain the area characters of the visual detection area; Calculating the matching degree of the area characters and the preset standard text; Generating the integrity result of the workpiece according to the matching degree.
[0071] In detail, optically recognizing the characters in the visual detection area to obtain the area characters of the visual detection area means that the characters in the visual detection area are optically recognized according to a preset OCR recognition algorithm. The OCR (Optical Character Recognition) technology is used to recognize the text of the preprocessed image. The preset OCR algorithm can be based on a traditional method (such as Tesseract) or a deep learning method (such as Convolutional Neural Network, CNN), which recognizes the characters in the visual detection area through training.
[0072] In detail, the OCR technology judges whether the workpiece is complete by recognizing the text information (such as production date, batch number, two-dimensional code, etc.) on the visual detection area. If the text or identification of the workpiece visual detection area is damaged or blurred, the OCR algorithm will fail or give a lower recognition accuracy.
[0073] In detail, the characters in the visual detection area are optically recognized to ensure that all necessary text information can be correctly read. If the OCR algorithm fails to accurately recognize some characters or numbers, it indicates that there may be a problem in the area, which causes the integrity of the workpiece to be damaged.
[0074] In detail, according to the result of OCR recognition, it is judged whether there is missing information or damaged area. If the text or pattern of the visual detection area is missing or unclear, it is considered that the workpiece has integrity problem.
[0075] In detail, by comparing the matching degree between the recognized characters and the preset standard (such as the standard text in the database), the recognition accuracy is evaluated. If the matching degree is lower than a certain threshold, it is determined that there is a missing area.
[0076] In detail, according to the result of OCR recognition, the score or conclusion of integrity check is obtained. If all characters and information are recognized completely, it is considered that the workpiece is complete; if there is any missing or unclear information, it is determined that the workpiece is not complete.
[0077] Further, according to the production standard, packaging requirement or quality control specification of the product, a preset standard text template is set. This template usually includes production date, batch number, production serial number and other contents, and is a certified standard format.
[0078] In detail, the recognized characters of the OCR are compared with the preset standard text template one by one. Common string matching algorithms such as edit distance, Jaccard similarity, Cosine similarity, etc. can be used to calculate the similarity between the recognized text and the standard template.
[0079] Further, in some cases, character-level comparison may be performed to determine whether there is character misplacement, missing or deformation; a certain error range is allowed, and when there is a small range error in character recognition, it is still considered to be matched (for example, due to image blur during character recognition).
[0080] In detail, according to the result of matching algorithm calculation, a matching degree score is generated, usually in the range of 0 to 1, indicating the matching degree of the two. A higher matching degree (close to 1) means that the OCR recognition result and the standard text are highly consistent, otherwise there may be large deviation.
[0081] In detail, a threshold of integrity (for example: 0.9 or 90%) is set to judge whether the OCR recognition result meets the integrity requirement of workpiece visual detection. If the matching degree score is greater than or equal to the preset threshold, it is considered that the workpiece visual detection is complete and meets the quality standard; if the matching degree score is lower than the threshold, it is considered that the workpiece visual detection has abnormality and needs further processing.
[0082] In detail, the uniformity of the workpiece is checked according to the visual detection area, and the uniformity result of the workpiece is obtained, including: image analysis is performed on the visual detection area to obtain the image features of the visual detection area; generating a uniformity index of the workpiece according to the image features, wherein the uniformity index comprises a texture uniformity index, a morphological uniformity index, and a brightness uniformity index; determining a uniformity result of the workpiece according to the uniformity index.
[0083] In detail, the OCR technique not only focuses on whether the visual detection is completely closed, but also detects whether the visual detection is uniform. For example, whether the visual detection has a wavy shape or a mottling, which affects the sealing and aesthetics.
[0084] In detail, it is necessary to confirm the uniformity of the visual detection area of the workpiece, that is, whether the visual detection is complete, uniform, without any damage, folding or irregular deformation.
[0085] In detail, the visual detection area of the workpiece is extracted by the foregoing visual detection area positioning method (such as template matching, optimization algorithm, etc.), and this process is usually completed by image analysis technology to ensure accurate identification of the visual detection position.
[0086] In detail, in order to perform uniformity inspection, a standardization index of the visual detection area is set. For example, the width, thickness, shape symmetry, edge smoothness and the like of the visual detection area are set as standards.
[0087] In detail, common standards include whether the visual detection edge is flat, whether there are cracks or concave-convex points.
[0088] In detail, according to the image features of the visual detection area, a quantitative uniformity index is generated for subsequent uniformity judgment.
[0089] Further, the uniformity index includes a texture uniformity index, a morphological uniformity index, and a brightness uniformity index. Multiple indexes such as texture uniformity, morphological uniformity and brightness / color uniformity are integrated to generate a comprehensive uniformity score. The score can be calculated by using a weighted average method to reflect the importance of each index. For example, if the texture features and the brightness uniformity have a greater impact on the quality of the workpiece, higher weights can be given to these two indexes.
[0090] In detail, according to the extracted texture features, an index describing the texture uniformity of the visual detection area is generated, and statistical values such as texture correlation, uniformity and contrast can be used to represent the surface features of the visual detection area. For example, if the "uniformity" index value in the gray level co-occurrence matrix is high, it indicates that the texture of the visual detection area is consistent, indicating good uniformity.
[0091] In detail, the shape of the visual detection area is determined to be regular or not by morphological analysis. If there are obvious defects (such as cracks, folds or irregular edges), the uniformity index will be low. The smoothness of the edge of the visual detection area can be calculated, and if the edge is relatively smooth, it indicates that the visual detection area has no obvious defects.
[0092] In detail, according to the result of the brightness uniformity analysis, the uniformity index of the visual detection area is calculated. Standard deviation or mean square error (MSE) can be used to quantify the uniformity of brightness or color. If the image brightness or color distribution is more uniform, the mean square error is lower; if the distribution is not uniform, the mean square error is higher.
[0093] In detail, according to the generated uniformity index, the final uniformity result is determined, that is, whether the visual detection area of the workpiece is uniform.
[0094] Further, according to historical data or experimental results, one or more uniformity determination thresholds are set to determine the standard of uniformity score. For example, if the uniformity score is higher than a certain threshold (such as 90%), the workpiece is considered to be qualified, and if the score is lower than the threshold, the workpiece is considered to be unqualified. The threshold can be single, such as "a uniformity score of 80% or above is qualified", or multi-dimensional comprehensive judgment (for example, if the texture uniformity score is high and the brightness uniformity is low, the comprehensive judgment is unqualified). According to the comparison between the comprehensive uniformity score and the set threshold, the uniformity result of the workpiece is determined. If the score is higher than the threshold, the visual detection area of the workpiece is uniform and considered to be qualified; if the score is lower than the threshold, the visual detection area is not uniform and the workpiece is considered to be unqualified.
[0095] S5, extracting the traceability information of the workpiece, and establishing an association between the detection result and the traceability information.
[0096] In the embodiment of the present application, the extraction of traceability information is to obtain key information from the workpiece by optical character recognition (OCR) technology, which includes but is not limited to the following contents: production date, batch number and product serial number.
[0097] In detail, the production date of the workpiece can help trace the time node of production; each batch of production has a unique batch number to distinguish different production batches, ensuring that the quality status of each batch of products can be tracked; usually used to identify a single product, which can be a bar code, a two-dimensional code or other unique identifier.
[0098] In detail, the text on the workpiece is scanned and extracted by the OCR technology, and the system can convert the above information into digital text and perform subsequent processing.
[0099] In the embodiment of the present application, the establishment of the association between the detection result and the traceability information includes: generating a unique identifier for the traceability information; associating the unique identifier with the test results to obtain an association relationship between the test results and the traceability information.
[0100] In detail, according to the extracted traceability information, a unique identifier is generated, which is used to uniquely identify each bag of packaged products. The unique identifier is usually generated by a certain hash algorithm (such as SHA-256) or created according to specific rules (such as the combination of production date, batch number, and serial number). The purpose of the unique identifier is to ensure that each product (or workpiece) can be uniquely identified and traced throughout the production chain.
[0101] In detail, during the detection process, quality inspection is performed on each workpiece, resulting in test results. The test results can be multiple indicators such as visual detection uniformity, appearance quality, and physical performance. The unique identifier is associated with the test results. It can be stored in a database to establish an association table containing unique identifiers, traceability information, and test results.
[0102] For example: the record format is unique identifier | production date | batch number | product serial number | test results; whenever the test results of a workpiece are generated, the test results are automatically bound to the corresponding traceability information.
[0103] In detail, through the association of traceability information (including production date, batch number, product serial number, etc.) and test results, it can be ensured that each workpiece's production, processing, and detection can be traced. For example, if a problem is found in a batch of workpieces during production, quality management personnel can quickly locate all workpieces in that batch and view the relevant test results. Similarly, when unqualified products are found in the detection link, the relevant production batch and other production link data can be quickly found through traceability information.
[0104] In detail, by associating test results with traceability information, a complete quality traceability process can be achieved.
[0105] Further, during production, each product or workpiece is assigned a unique identifier, recording information such as production date, batch number, and product serial number. Production information is input into the production management system and is associated with subsequent quality detection data.
[0106] In detail, after the workpiece is completed, it enters the quality detection link and is tested for uniformity, appearance quality, and physical performance. The test results are bound to the unique identifier to form a detection report, recording the quality status of each workpiece.
[0107] In detail, all traceability information and test results are stored in a centralized database to ensure data security and integrity. Users or relevant personnel can query based on a unique identifier to obtain production information, quality inspection results, and even information on other related aspects (such as production equipment, operators, etc.) for a specific workpiece.
[0108] S6. Track abnormal samples in the workpiece according to the preset warning threshold, the detection results and the correlation.
[0109] In this embodiment of the invention, once a workpiece is marked as an abnormal sample, subsequent tracking and processing will be carried out based on associated data: traceability of production, traceability of testing, and batch recall and quality control.
[0110] In detail, through the associated traceability information, the system can trace the production process of this batch of workpieces to check for problems with production equipment, raw materials, or operations. If multiple abnormal samples exist in this batch, production managers can conduct a centralized investigation of all relevant samples in that batch.
[0111] In detail, the system can view the testing process and personnel information of abnormal samples, helping to determine whether the abnormality was caused by problems in the testing process (such as instrument failure, operational errors, etc.).
[0112] In detail, if a widespread problem is found in a batch of products, the system can recall the batch based on traceability information and conduct further quality control and improvements. The system can also automatically generate recall reports and handling plans to ensure that the problem is resolved in a timely manner.
[0113] Furthermore, the system monitors the production line and testing process in real time. Once an anomaly is detected, the system immediately issues an alert to the relevant personnel, notifying them to check the cause of the anomaly and take necessary measures.
[0114] Furthermore, when the system detects an anomaly, it can correct the abnormal visual inspection angle of the workpiece in real time according to the real-time calculation formula of the step-by-step detection angle deviation. The specific steps are as follows: Step 1: Calculate the coefficient of the linear term in the regression equation, using the following formula: ; in, This is the coefficient of the first-order term, representing the quadratic relationship between the inspection angle and the standard inspection angle of the workpiece during visual inspection, as detailed below: This represents the baseline value for the deviation of the detection angle during the visual inspection of the first workpiece. This represents the baseline value indicating the deviation of the first visual detection angle from the specified point. This represents the baseline value indicating the deviation of the second visual detection angle. This represents the baseline value indicating the deviation of the second visual detection angle from the specified point. This represents the baseline value of the deviation of the visual detection angle at the current moment. Here, it represents the deviation value at different time points and different visual detection angles. Step 2: Calculate the coefficient of the quadratic term in the regression equation, using the following formula: ; in, It represents the coefficient of the quadratic term and also represents the two-variable quadratic relationship between the detection angle and the standard detection angle of the workpiece during visual inspection. ; ; in, Represents the coefficient of the constant term. This represents the average value of the visual inspection angle deviation at the current moment. Here, the visual inspection angle indicates the deviation of the workpiece's visual inspection angle from the visual inspection angles of other areas. Indicates the first Deviation value of each visual detection angle, This represents the average value of the deviation angle deformation data for visual inspection of the workpiece. This represents the average deviation angle data from all visual detections in the angle dataset; Step 3: Based on the coefficients of the first term, the second term, and the constant term, establish a regression equation to obtain the deviation value of the visual inspection angle of the workpiece from that of other areas. If the deviation value of the visual inspection angle of the workpiece from that of other areas is equal to 0, it indicates that the visual inspection angle of the workpiece is normal. Otherwise, the system will issue a voice alarm to remind that the visual inspection angle of the workpiece is abnormal, and the industrial visual inspection angle will be corrected in reverse according to the deviation value. This process can realize real-time monitoring of the inspection angle during industrial visual inspection, ensure the accuracy of industrial visual inspection, and prevent deviation of the industrial visual inspection angle.
[0115] The application can reduce the noise in the image through the double denoising technology, make the positioning of the visual detection area more accurate, correct the distortion or deviation in the image through perspective correction, make the visual detection area more standardized and easy to identify, focus on the quality detection of the visual detection area through the accurate positioning of the visual detection area, and not be disturbed by other areas, combine the preset quality detection algorithm, and score the quality of the visual detection area, can real-time evaluate the quality problem of visual detection, combine the traceability information with the detection result, can help track the source and distribution of abnormal products, through establishing the association between the detection result and the traceability information, can more efficiently locate the potential problem in the production process, thereby realizing the rapid traceability of batch products, not only improve the early warning efficiency, but also help to quickly locate and solve the quality problem, reduce the time and cost of overall detection, the system sets the early warning threshold, when the visual detection quality score detected is lower than a certain standard, automatically trigger the early warning and start the tracking process, the automatic early warning mechanism greatly improves the response speed of abnormal processing, reduces the manual intervention, improves the efficiency of the overall monitoring system, therefore the application proposes an industrial visual detection system, can solve the problem of low workpiece visual detection abnormal monitoring and early warning.
[0116] It is obvious to those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and the present application can be implemented in other specific forms without departing from the spirit or essential characteristics of the present application.
[0117] The embodiments of the present application can acquire and process related data based on artificial intelligence technology. Among them, artificial intelligence (Artificial Intelligence, AI) is to use digital computers or digital computer controlled machines to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0118] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and are not limiting. Although the present application has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solutions of the present application can be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present application.
Claims
1. An industrial vision inspection system characterized by, The industrial visual inspection system comprises: An image denoising module: a packaging image of a workpiece is collected, the packaging image is double denoised to obtain a denoised image of the packaging image, and the denoised image is perspective corrected to obtain a corrected image of the denoised image; A detection area positioning module: a visual inspection area of the corrected image is positioned according to the corrected image, and a quality detection algorithm is preset according to the visual inspection area and the quality detection algorithm to detect the quality of the workpiece, and a detection result of the workpiece is obtained, wherein the preset quality detection algorithm is: ; wherein, is a detection result of the workpiece, is a preset result of the workpiece, is a pixel point a quality score function in the image after perspective correction, is a pixel set of the visual inspection area; An extraction traceability information module: an association between a visual inspection result and traceability information is established, and an abnormal sample in the visual inspection is tracked according to a preset early warning threshold, the detection result and the association; An abnormal correction module: according to real-time calculation of a hierarchical detection angle deviation, real-time correction of a visual inspection angle abnormality of the workpiece is realized.
2. The system of claim 1, wherein, The packaging image is double denoised to obtain a denoised image of the packaging image, comprising: Random noise in the packaging image is filtered to obtain a primary image of the packaging image; Salt and pepper noise in the primary image is filtered to obtain a secondary image of the primary image; The secondary image is double denoised to verify the effect of the secondary image according to a preset signal-to-noise ratio index, and the secondary image that passes the double denoising effect verification is determined as the denoised image of the packaging image.
3. The system of claim 2, wherein, The salt and pepper noise in the primary image is filtered to obtain a secondary image of the primary image, comprising: The salt and pepper noise in the primary image is filtered according to a preset denoising algorithm to obtain a secondary image of the primary image, wherein the preset denoising algorithm is: ; wherein is the pixel value of the primary image at position , denotes a median operation, is the pixel value of the primary image at position , is a neighborhood centered at .
4. The system of claim 3, wherein, The denoised image is perspective corrected to obtain a corrected image of the denoised image, comprising: Feature points of the denoised image are extracted; A perspective transformation matrix of the denoised image is constructed according to the feature points; The denoised image is geometrically transformed according to the perspective transformation matrix to obtain a corrected image of the denoised image.
5. The system of claim 4, wherein, The feature points of the denoised image are extracted, comprising: A self-correlation matrix of the denoised image is generated, wherein the self-correlation matrix is: ; wherein, is a self-correlation matrix of the denoised image, is a gradient at a pixel point , is a transpose indication of the matrix; Pixel points in the denoised image are classified according to the self-correlation matrix and a preset response function to obtain feature points of the denoised image.
6. The system of claim 5, wherein, The corrected image is positioned in a visual inspection area to obtain a visual inspection area of the corrected image, comprising: A visual inspection area in the corrected image is preliminarily positioned according to a preset template to obtain an initial positioning area of the corrected image; The initial positioning area is regionally optimized to obtain an optimized area of the initial positioning area; The optimized area is regionally verified according to a preset verification rule, and the optimized area that passes the regional verification is determined as the visual inspection area of the corrected image.
7. The system of claim 1, wherein, The quality detection algorithm is preset according to the visual inspection area and the quality detection algorithm to detect the quality of the workpiece, and a detection result of the workpiece is obtained, comprising: According to the visual detection area, integrity of the workpiece is checked to obtain an integrity result of the workpiece; According to the visual detection area, uniformity of the workpiece is checked to obtain a uniformity result of the workpiece; According to the integrity result and the uniformity result, a quality score function in a preset quality detection algorithm is weighted and fused to obtain an updated quality score function; The workpiece is scored by using the updated quality score function to obtain a detection result of the workpiece.
8. The system of claim 7, wherein, The updated quality score function is: ; wherein, is a quality score function in a pre-set quality detection algorithm, is an updated quality score function, is a completeness score of the visual inspection area, is a uniformity score of the visual inspection area, and are coefficients that adjust the influence weight of completeness and uniformity in the final score.
9. The system of claim 7, wherein, The integrity of the workpiece is checked according to the visual detection area to obtain the integrity result of the workpiece, comprising: Optical recognition is performed on the characters in the visual detection area to obtain region characters of the visual detection area; The matching degree of the region characters and preset standard characters is calculated; According to the matching degree, the integrity result of the workpiece is generated.
10. The system of claim 1, wherein, The association between the visual detection result and the traceability information comprises: A unique identifier of the traceability information is generated; The unique identifier is associated with the detection result to obtain the association between the visual detection result and the traceability information; According to the real-time calculation of the hierarchical detection angle deviation, real-time correction of the visual detection angle anomaly of the workpiece is realized.