Target pattern recognition method and system based on camera image
By introducing an independent verification area and dynamically adjusting image acquisition parameters in the visual inspection system, combined with multiple visual features and polarization imaging technology, the problem of misjudgment caused by environmental factors has been solved, improving the accuracy of product quality identification and production efficiency.
Patent Information
- Application Number
- CN202610047172.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-14
- Publication Date
- 2026-02-27
AI Technical Summary
Existing visual inspection systems are susceptible to interference from environmental factors in complex industrial environments, leading to misjudging qualified products as unqualified products, which affects production efficiency and increases costs.
By introducing an independent verification area and a mechanism for dynamically adjusting image acquisition parameters, combined with multiple visual features and polarization imaging technology, multi-stage recognition and triage processing are performed to eliminate the impact of environmental factors on image quality.
It significantly improves the accuracy and reliability of product quality identification, avoids the erroneous rejection of qualified products, improves production efficiency, and reduces operating costs.
Smart Images

Figure CN121582238A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of target pattern recognition based on camera images, and in particular to a target pattern recognition method and system based on camera images. BACKGROUND
[0002] In modern industrial production, an automated vision detection system can extract visual features of products, such as shape, color, surface texture, and identification information, and then identify the product pattern to determine whether it meets the quality standards. However, the actual production line environment is not constant and may introduce some changes, posing challenges to the vision detection system. For example, on an automated production line, a machine vision-based detection system is deployed to ensure product quality and efficient sorting. When a product passes through the detection area, the system extracts visual features such as the product's geometric shape, color distribution, glossiness, surface texture, and identification information, and compares them with the preset standards. If all features are within the allowable deviation range, it is determined to be a qualified product; otherwise, it is marked as unqualified and rejected. This system performs well in terms of detection accuracy and stability when processing a single type of product.
[0003] However, over time, the industrial camera lens or light source protective cover may accumulate dust, causing subtle changes in lighting conditions and image acquisition quality. These non-uniformly distributed dust can affect light transmission, attenuate light intensity, destroy uniformity, and even cause local shadows or uneven brightness. At the same time, dust on the camera lens can also scatter and absorb incoming light, causing subtle changes in brightness, contrast, and color saturation of the final image, directly affecting the system's extraction of product visual features. These image feature shifts caused by environmental changes may be misjudged as signals of product unqualification.
[0004] More complexly, the frequency and degree of misjudgment are also indirectly affected by other factors in the workshop environment, such as the operation state of the air conditioner, the cleanliness of the external windows, and even the change in air humidity in different seasons, which can affect the speed and manner of dust attachment, further exacerbating or changing the pattern of lighting condition changes. This means that the "environmental noise" faced by the system is not single and constant, but has a certain dynamic and complexity. After discovering a large number of misjudgments, operators often need to spend a lot of time manually reviewing to confirm that these rejected products are actually qualified, and then manually adjust or clean the equipment, which seriously affects the overall efficiency and automation level of the production line. This image feature shift caused by environmental factors, which is not a product defect, has become a pain point that needs to be addressed in the current vision detection system based on fixed thresholds in actual industrial applications. SUMMARY
[0005] The application discloses a target pattern recognition method and system based on camera images, aiming at solving the problem of image feature deviation caused by environmental factors (such as changes in lighting conditions and imaging quality caused by dust accumulation), which leads to misjudgment of qualified products as unqualified products by the visual detection system, thereby reducing production efficiency and increasing costs.
[0006] The technical solution of the application is as follows: In a first aspect, the application discloses a target pattern recognition method based on camera images, comprising: extracting visual features of the product from the image of the product; calculating a preliminary recognition confidence of the product quality according to the visual features; diverting the product to different processing paths according to the preliminary recognition confidence; wherein when the preliminary recognition confidence is in a preset intermediate range, the product is guided to an independent verification area; adjusting the image acquisition parameters of the verification area; recalculating the recognition confidence of the product quality under the adjusted image acquisition parameters; determining the final processing result of the product according to the recalculated recognition confidence.
[0007] Through the technical solution, the application introduces an independent verification area and a mechanism for dynamically adjusting image acquisition parameters, effectively solving the problem of misjudgment of traditional visual detection systems under environmental changes, significantly improving the accuracy and reliability of product quality recognition, avoiding qualified products being wrongly rejected, thereby improving production efficiency and reducing operating costs.
[0008] Further, in some embodiments, the visual features include geometric shape features, color features, texture features, and identification information features.
[0009] Through the technical solution, the application extracts various visual features of the product comprehensively, providing a richer and more comprehensive data basis for subsequent quality recognition, thereby improving the accuracy and robustness of recognition.
[0010] Further, on the basis of the above, the preliminary recognition confidence of the product quality is calculated according to the visual features, comprising: for each visual feature, determining the deviation amplitude of the visual feature relative to the corresponding feature standard, to obtain the deviation amplitude of each visual feature; calculating the preliminary recognition confidence of the product quality according to the deviation amplitude of each visual feature.
[0011] By the technical solution, the application quantifies the deviation amplitude of each visual feature, and calculates the preliminary identification confidence on the basis, so that the quality evaluation is more objective and fine, and a quantitative basis is provided for subsequent shunt decision.
[0012] On the basis, the application further proposes that the preliminary identification confidence of product quality is calculated according to the deviation amplitude of each visual feature, comprising: The preliminary identification confidence of product quality is calculated according to the first confidence formula and the deviation amplitude of each visual feature. The first confidence formula is: C_pre=f(w1*S_R+w2*S_H+w3*S_Contrast+w4*S_OCR); Wherein, C_pre is the preliminary identification confidence, w1, w2, w3, w4 are preset weights of each feature, f is a Sigmoid function, S_R is the deviation amplitude of geometric shape feature, S_H is the deviation amplitude of color feature, S_Contrast is the deviation amplitude of texture feature, and S_OCR is the deviation amplitude of identification information feature.
[0013] By the technical solution, the application introduces a confidence calculation formula combining weighted summation and Sigmoid function, which can more flexibly and accurately consider the influence of different visual features on product quality, thereby improving the calculation accuracy and reliability of the preliminary identification confidence.
[0014] Preferably, in some embodiments, the image acquisition parameters of the verification area are adjusted, comprising: Deploying a controllable polarized light source and a polarization camera; Controlling the controllable polarized light source to emit light rays of different polarization directions, and collecting multiple polarization images through the polarization camera; According to the polarization images, the polarization degree and polarization angle of each pixel point are calculated; According to the polarization degree and polarization angle, the surface reflected light and product body features in the polarization image are separated; The separated product body features are analyzed for defect features, and the response mode of the potential defect area in different polarization images is analyzed; According to the defect feature analysis result and the response mode analysis result, the optical illusion and the real product defect are distinguished.
[0015] By the technical solution, the application introduces polarization imaging technology, which can effectively separate surface reflected light and product body features, thereby eliminating the interference of environmental light changes and surface reflection on defect identification, significantly improving the ability to identify real defects in complex environments, and avoiding misjudgment of optical illusion as product defects.
[0016] On the basis of the above, the application further proposes that, according to the preliminary identification confidence, the products are divided into different processing paths, including: obtaining real-time state information of the verification area, the real-time state information including the number of available workstations, the current processing queue length and the average processing time of a single product of the verification area; calculating the predicted processing delay of the verification area according to the real-time state information; when the predicted processing delay exceeds a preset threshold or the number of available workstations is lower than a safety threshold, adjusting the shunting rate, wherein, adjusting the shunting rate includes instructing the shunting device to shunt at a lower frequency than normal, or releasing part of the products with preliminary identification confidence in a preset intermediate range but biased towards qualified products to the main production line and marking them as low-risk qualified products; when the predicted processing delay does not exceed the preset threshold and the number of available workstations is not lower than the safety threshold, maintaining the shunting rate; when the processing capacity of the verification area recovers or the processing delay decreases to a safe range, the shunting rate is restored, wherein the shunting rate is restored includes gradually restoring the normal shunting rate, or preferentially processing the products marked as low-risk qualified products.
[0017] Through the technical scheme, the application can intelligently adjust the shunting rate according to the actual load of the production line by introducing a dynamic shunting strategy based on the real-time state information of the verification area, effectively avoiding the overload of the verification area, ensuring the smoothness and efficiency of the production process, and further optimizing the resource allocation by flexibly processing low-risk products.
[0018] Further, in some embodiments, the preliminary identification confidence of the product quality is calculated according to the visual features, including: dividing the product image into multiple local areas; areas that exhibit similar deviation patterns in consecutive or adjacent local areas are given higher weights, and feature points that appear in isolation and have low deviation degrees are given lower weights; based on the weighted deviation degree, the preliminary identification confidence of the product quality is calculated.
[0019] Through the technical scheme, the application can more accurately identify real defects and reduce false positives of isolated noise points by weighting the deviation patterns of local areas, thereby improving the accuracy and anti-interference ability of the preliminary identification confidence.
[0020] Further, on the basis of the above, areas that exhibit similar deviation patterns in consecutive or adjacent local areas are given higher weights, including: texture feature analysis is performed on the deviation degree of each local area to identify whether the texture features have periodicity or repeatability; marking a region with periodic or repetitive texture features as a potential normal texture region; For regions that are not marked, or regions that are marked as potential normal texture regions but the deviation degree is significantly beyond the preset normal fluctuation range, spatial continuity judgment is performed; the spatial continuity judgment includes: if the regions appear continuously or adjacently in space and the deviation degrees are consistent, the regions are identified as continuous deviation caused by real defects, and regions identified as continuous deviation caused by real defects are given a higher weight.
[0021] Through the technical solution, the present application can effectively distinguish the normal texture of the product itself and the continuous deviation caused by real defects by combining texture feature analysis and spatial continuity judgment, thereby avoiding misjudgment of normal texture as defects and further improving the accuracy of defect identification.
[0022] On the basis of the above, the present application further proposes that the deviation degree of each local region is subjected to texture feature analysis to identify whether the texture features have periodicity or repetition, including: Performing multi-direction and multi-scale filtering processing on the image of the local region to enhance the texture structure in different directions and scales; Performing local Fourier transform on the filtered image to analyze the dominant frequency and direction in the transform result and identify the first periodic texture; After identifying the first periodic texture, removing the corresponding component of the first periodic texture from the image to obtain a residual image; Performing local Fourier transform on the residual image again to analyze the dominant frequency and direction and identify the second periodic texture or repetitive texture; Quantifying the identified different types of periodic or repetitive texture to obtain respective texture feature parameters; and judging whether the deviation degree of the local region is caused by a specific type of periodic or repetitive texture according to the texture feature parameters.
[0023] Through the technical solution, the present application can comprehensively and finely analyze the texture features of the image by the method combining multi-scale and multi-direction filtering and local Fourier transform, thereby accurately identifying different types of periodic or repetitive texture and providing a more accurate basis for distinguishing normal texture and defects.
[0024] In a second aspect, the present application also discloses a target mode recognition system based on camera images, which comprises: An image acquisition module for extracting visual features of a product from an image of the product; A confidence calculation module for calculating a preliminary recognition confidence of the product quality according to the visual features; a product diversion module, configured to divert the product to different processing paths according to the preliminary recognition confidence; wherein, when the preliminary recognition confidence is in a preset intermediate range, the product is guided to an independent verification area; a parameter adjustment module, configured to adjust image acquisition parameters of the verification area; a secondary analysis module, configured to recalculate the recognition confidence of the product quality under the adjusted image acquisition parameters; a result determination module, configured to determine the final processing result of the product according to the recalculated recognition confidence.
[0025] Through the technical scheme, the application realizes effective support for the product quality recognition method through modular system design, and each module cooperates to solve the problem that the traditional visual detection system is prone to misjudgment under environmental changes, significantly improves the accuracy and reliability of product quality recognition, avoids the misremoval of qualified products, and thus improves production efficiency and reduces operating costs. Advantages
[0026] The target pattern recognition method based on camera images disclosed in the application extracts visual features from product images and calculates the preliminary recognition confidence of product quality according to these features. When the preliminary recognition confidence is in a preset intermediate range, the method guides the product to an independent verification area, adjusts the image acquisition parameters in this area, and performs further visual feature analysis. Then, the recognition confidence is recalculated according to the further analysis result, and the processing result of the product is finally determined. This method effectively solves the problem that the image feature deviates due to changes in the production line environment (such as slight changes in lighting conditions and imaging quality caused by dust accumulation), causing the traditional visual detection system to misjudge qualified products as unqualified products. By introducing an independent verification area and a mechanism for dynamically adjusting image acquisition parameters, the application can specifically eliminate the influence of environmental factors on image quality, thereby significantly improving the accuracy and reliability of product quality recognition in complex and variable environments, effectively avoiding the misremoval of qualified products, reducing the need for manual reinspection and production costs, and improving the overall efficiency and stability of the automated production line. BRIEF DESCRIPTION OF DRAWINGS
[0027] Figure 1 is a flowchart of a target pattern recognition method based on camera images provided by an embodiment of the application; Figure 2 is another flowchart of a target pattern recognition method based on camera images provided by an embodiment of the application; Figure 3 is a structural diagram of a target pattern recognition system based on camera images provided by an embodiment of the application. DETAILED DESCRIPTION
[0028] The technical solutions in the present application will be described clearly and completely below in combination with the drawings in the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. The components of the present application described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of the present application.
[0029] It should be noted that: similar reference numbers and letters represent similar items in the following drawings, therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. Meanwhile, in the description of the present application, the terms "first", "second", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.
[0030] Based on the above technical problems, the present application proposes a target pattern recognition method based on camera image, comprising: extracting visual features of a product from an image of the product; calculating a preliminary recognition confidence of the product quality according to the visual features; diverting the product to different processing paths according to the preliminary recognition confidence; wherein when the preliminary recognition confidence is in a preset intermediate range, guiding the product to an independent verification area; adjusting image acquisition parameters of the verification area; performing further visual feature analysis on the product under the adjusted image acquisition parameters; recalculating the recognition confidence of the product quality according to the further visual feature analysis result; determining the final processing result of the product according to the recalculated recognition confidence.
[0031] The present application effectively solves the problem that the traditional visual detection system is easily disturbed by environmental factors in complex and variable industrial environments, leading to misjudgment, by introducing a multi-stage recognition and dynamic adjustment mechanism. Through preliminary recognition, diversion to an independent verification area, dynamic adjustment of image acquisition parameters, and secondary analysis, the present application can more accurately distinguish between real product defects and visual illusions caused by the environment, significantly improving the accuracy of product quality detection and the automation level of the production line.
[0032] The application obtains the cleaning execution parameters of the cleaning process and the formula switching combination information of the production batch, dynamically adjusts the initial risk value based on the information to obtain a variable cleaning efficiency risk coefficient, and then evaluates the total risk of different production sequences and determines a target production sequence, thereby effectively solving the problems of incomplete cleaning, difficulty in tracing quality risks and low production efficiency caused by frequent formula switching in the prior art. By fine management of cleaning efficiency risks, the application optimizes the production plan, reduces operating costs, and improves the stability and traceability of product quality.
[0033] In order to better understand the present application, some key terms involved therein need to be explained.
[0034] "Product" can refer to any industrial product that needs to be quality tested, such as electronic components, mechanical parts, packaging materials, etc.
[0035] "Image" is usually captured by an industrial camera and can be a visible light image, an infrared image or a multispectral image, etc.
[0036] "Visual features" refer to various quantifiable information extracted from product images that describe the appearance and quality attributes of products, such as product geometry, color, texture, size, surface defects, identification information, etc.
[0037] "Recognition confidence" is a quantitative indicator that represents the degree of certainty of the system's judgment on product quality, usually a value between 0 and 1, the higher the value, the greater the likelihood of product qualification.
[0038] "Pre-set intermediate range" refers to the confidence interval set by the system when the product quality is uncertain in the preliminary identification stage, and the products in this interval need to be further verified.
[0039] "Independent verification area" is an area specially designed for fine detection of products with uncertain preliminary identification results, usually equipped with more advanced image acquisition equipment and analysis tools.
[0040] "Image acquisition parameters" include but are not limited to exposure time, gain, white balance, focal length, aperture, illumination intensity, illumination angle, polarization setting, etc. The adjustment of these parameters aims to optimize image quality to meet different detection needs.
[0041] Referring to Figure 1 , the application provides a target pattern recognition method based on camera images, comprising the following steps: S1, extracting visual features of the product from the image of the product.
[0042] Among them, the visual features include: geometric shape features, color features, texture features and identification information features.
[0043] Color features refer to color attributes of products, such as hue, saturation, brightness, and color distribution. They can be obtained by analyzing images in different color spaces, such as RGB, HSV, and Lab, aiming to detect defects such as discoloration, stains, color differences, or color unevenness. Texture features refer to the arrangement pattern, repeatability, and roughness of pixel intensity on the product surface. They can be extracted by applying texture analysis methods such as Gabor filters, Local Binary Patterns (LBP), or Gray Level Co-occurrence Matrix (GLCM), aiming to identify microscopic defects such as scratches, cracks, bubbles, uneven coating, or foreign matter attachment. Identification information features refer to identifiable information on products, such as text, barcodes, QR codes, trademarks, or specific symbols. They can be obtained by optical character recognition (OCR) technology, barcode / QR code recognition algorithms, or template matching, aiming to verify batch information, production date, expiration date, authenticity, and label correctness of products.
[0044] In actual operation, the extraction of visual features can be achieved in various ways. For example, traditional image processing algorithms such as edge detection, corner detection, and region segmentation can be used to identify the geometric shape features of products. Color features can be obtained by analyzing the RGB, HSV, and other color space distributions of images. Texture features can be extracted using methods such as Gray Level Co-occurrence Matrix (GLCM), Local Binary Patterns (LBP), or Gabor filters. For identification information features, optical character recognition (OCR) technology can be used to recognize text, barcodes, or QR codes on products. Another implementation method is to use deep learning models such as Convolutional Neural Networks (CNN) for end-to-end feature extraction of product images. Pre-trained CNN models can automatically learn and extract multi-level, abstract visual features related to product quality from images without the need for manual feature extraction algorithm design. For example, an image processing system can be configured with an image acquisition module that acquires product images through an industrial camera and transmits image data to a feature extraction unit. The feature extraction unit can run a pre-set image processing algorithm library, selectively extracting information such as geometric dimensions, surface color uniformity, texture defect density, and product batch number based on different product types and detection requirements.
[0045] S2, according to the visual features, calculating the preliminary recognition confidence of the product quality.
[0046] As a possible implementation, for each visual feature, the deviation amplitude of the visual feature relative to the corresponding feature standard can be determined to obtain the deviation amplitude of each visual feature; and the preliminary recognition confidence of the product quality is calculated according to the deviation amplitude of each visual feature.
[0047] Specifically, a preliminary identification confidence of the product quality can be calculated according to the first confidence formula and the deviation amplitude of each visual feature. The first confidence formula is: C_pre=f(w1*S_R+w2*S_H+w3*S_Contrast+w4*S_OCR); wherein C_pre is the preliminary identification confidence, w1, w2, w3, w4 are preset weights of respective features, f is a Sigmoid function, S_R is the deviation amplitude of the geometric shape feature, S_H is the deviation amplitude of the color feature, S_Contrast is the deviation amplitude of the texture feature, and S_OCR is the deviation amplitude of the identification information feature.
[0048] It should be noted that the visual feature can be understood as each quantifiable attribute extracted from the product image for representing the appearance and quality of the product, such as the geometric shape feature, the color feature, the texture feature, and the identification information feature. The corresponding feature standard refers to the preset reference value or range of each visual feature for measuring whether the product quality is qualified or not. For example, for the geometric shape feature, its standard can be the design size and tolerance range of the product; for the color feature, its standard can be a specific RGB or HSV value range; for the texture feature, its standard can be the expected surface roughness and uniformity; and for the identification information feature, its standard can be the correct character content, position, and clarity.
[0049] Specifically, determining the deviation amplitude of the visual feature relative to the corresponding feature standard refers to quantifying the deviation degree by comparing the extracted product visual feature with the preset corresponding feature standard. For example, if a certain size of the product exceeds the tolerance range, the absolute value or percentage of the exceeding range is calculated as the deviation amplitude; if the color deviates from the standard color, the distance in the color space is calculated as the deviation amplitude. The deviation amplitude of each visual feature can be a numerical value representing the degree of non-compliance between the feature and the standard. The greater the deviation amplitude, the more serious the quality problem of the feature.
[0050] The confidence score reflects the preliminary judgment of the overall quality of the product. The higher the score, the better the product quality or the lower the defect risk, and vice versa.
[0051] S3, according to the preliminary identification confidence, the product is divided into different processing paths.
[0052] When the preliminary identification confidence is in the preset intermediate range, the product is guided to an independent verification area.
[0053] For example, two thresholds can be set: a high threshold and a low threshold. When the preliminary identification confidence is higher than the high threshold, the product is judged as a qualified product and directly enters the main production line; when the confidence is lower than the low threshold, the product is judged as an unqualified product and enters the waste treatment path. When the preliminary identification confidence is in the preset intermediate range, i.e. between the low threshold and the high threshold, the system has uncertainty in judging the product quality, and the product is guided to an independent verification area. For example, on an automated production line, the shunting device can be a mechanical arm or a pneumatic push rod. When the system calculates the preliminary identification confidence of the product, if the confidence is higher than 0.95, the mechanical arm will push the product into the qualified product channel; if the confidence is lower than 0.7, the product will be pushed into the unqualified product channel. If the confidence is between 0.7 and 0.95, the mechanical arm will guide the product to a special re-inspection station, i.e. an independent verification area.
[0054] When the preliminary identification confidence is in the preset intermediate range, the product is guided to an independent verification area. The verification area is usually equipped with more precise detection equipment and more flexible image acquisition capabilities. For example, the verification area can be an independent detection station equipped with a high-resolution camera, an adjustable light source, a multi-angle imaging system, and professional detection software. When the product is shunted to this area, the system will trigger a series of fine detection processes.
[0055] S4, adjusting the image acquisition parameters of the verification area.
[0056] Specifically, after the product enters the verification area, the image acquisition parameters of the verification area need to be adjusted. The adjustment of the image acquisition parameters aims to obtain clearer and more informative images to eliminate or reduce the influence of environmental factors on image quality.
[0057] For example, the exposure time, gain, and white balance of the camera can be dynamically adjusted according to the characteristics of the preliminary identification result to compensate for insufficient or excessive light problems. If the preliminary identification result shows that there is a mirror or shadow on the surface of the product, the intensity and angle of the light source can be adjusted, or even switched to a different lighting mode (such as ring light, back light, polarized light) to highlight the product features and suppress interference. For example, if the reason for the low preliminary identification confidence is insufficient image contrast, the system can instruct the camera in the verification area to increase the exposure time or increase the gain. If it is suspected that the surface reflection caused the misjudgment, the system can adjust the light source angle to avoid the mirror reflection direction, or switch to a diffuse light source to provide more uniform illumination.
[0058] It should be noted that the specific description of this step can be referred to the description in the subsequent part, which will not be repeated here.
[0059] S5, recalculate the identification confidence of the product quality under the adjusted image acquisition parameters.
[0060] Specifically, the way of recalculating the recognition confidence of product quality is the same as the above-mentioned recognition method, which is not described here.
[0061] S6, according to the recalculated recognition confidence, determine the final processing result of the product.
[0062] Specifically, if the recalculated confidence is higher than a certain pre-set qualified threshold, the product is finally determined as a qualified product and enters the main production line; if it is lower than a certain unqualified threshold, it is determined as an unqualified product and enters the waste product processing path. For products still in the uncertain range, they can be marked as needing manual re-inspection for final manual confirmation.
[0063] For example, if the recalculated recognition confidence is higher than 0.98, the product is finally determined as a qualified product and is guided to the packaging area. If the confidence is lower than 0.75, the product is determined as an unqualified product and is sent to the scrap area. If the confidence is still between 0.75 and 0.98, the system will generate a re-inspection request and guide the product to the manual re-inspection station for final judgment by the operator.
[0064] The embodiment effectively solves the problem that the traditional visual detection system is easily interfered by environmental factors in a complex and variable industrial environment, leading to misjudgment. The traditional system often uses a single detection process and fixed parameters, and when the environmental light, camera state and other factors change slightly, the image feature offset caused by the environment is easily misjudged as a product defect, resulting in a large number of qualified products being incorrectly rejected, seriously affecting production efficiency and cost.
[0065] The core innovation of the embodiment is the closed-loop verification process of "preliminary recognition-shunting-dynamic adjustment-secondary analysis". First, through the preliminary recognition confidence, the system can quickly screen out qualified and unqualified products with clear quality, improving the overall detection efficiency. For those products that are not determined by the preliminary judgment, they are not simply judged as unqualified, but are intelligently shunted to an independent verification area. This shunting mechanism avoids high-cost fine detection of all products while ensuring in-depth analysis of difficult products.
[0066] In the verification area, the embodiment further introduces the dynamic adjustment capability of image acquisition parameters. This is in sharp contrast to the fixed parameter detection method of traditional systems. By adjusting the exposure, gain, light source, and other parameters according to the characteristics of the preliminary identification results, the system can actively adapt to environmental changes and obtain clearer and more informative images. For example, when the preliminary identification results show that the image has glare or insufficient contrast, the system can automatically adjust the light source angle or exposure time, thereby eliminating environmental interference and revealing the true characteristics of the product itself. This dynamic adjustment capability is the key to solving the misjudgment caused by environmental factors.
[0067] Compared with the closest prior art, the advantage of the embodiment is the significant improvement in environmental adaptability and misjudgment rate. Traditional systems often cannot distinguish between environmental changes such as dust accumulation and light decay and real product defects, resulting in a high misjudgment rate. By introducing an independent verification area and dynamic parameter adjustment mechanism, the embodiment provides the system with a "second confirmation" opportunity, allowing the system to actively eliminate environmental interference and significantly reducing the misjudgment rate. This not only reduces the waste of qualified products and the cost of manual re-inspection, but also improves the automation level and overall efficiency of the production line. The method of the embodiment can more intelligently and robustly cope with complex industrial production environments, providing a more reliable solution for product quality detection.
[0068] In some embodiments of the present application described above, the image acquisition parameters of the verification area are adjusted. However, in actual applications, when the product surface has complex optical properties, such as high gloss, semi-transparency, or uneven texture, traditional image acquisition parameter adjustment methods may not be able to effectively distinguish between real product defects and optical illusions caused by lighting conditions or material surface characteristics. This limitation may lead to misjudgment, reducing the accuracy and reliability of product quality detection.
[0069] To this end, in one possible design, as shown in Figure 2 To adjust the image acquisition parameters of the verification area, the present application can further include the following steps: S101, deploy a controllable polarized light source and a polarization camera.
[0070] Specifically, deploying a controllable polarized light source means setting up an illumination device in the verification area that can emit light with a specific polarization direction. The polarization direction of the light source can be precisely controlled and adjusted. The polarization camera is a camera equipped with a polarization filter or a polarization-sensitive sensor, which can capture light information of different polarization directions and obtain polarization images.
[0071] S102, control the controllable polarized light source to emit light of different polarization directions, and acquire multiple polarization images through the polarization camera.
[0072] The control of the controllable polarized light source emits light of different polarization directions, for example, the light source can emit horizontal polarized light, vertical polarized light, 45-degree polarized light and 135-degree polarized light in turn, and an image is captured in each polarization direction through the polarization camera, thereby obtaining multiple polarization images.
[0073] S103, calculating the degree of polarization and the polarization angle of each pixel point according to the polarization image.
[0074] In practical application, calculating the degree of polarization and the polarization angle of each pixel point according to the polarization image refers to calculating the polarization state of light at each pixel point, including the polarization degree (degree of polarization) and the polarization direction (polarization angle), by analyzing the intensity difference of images in different polarization directions. These parameters can reflect the reflection and scattering characteristics of the object surface to light.
[0075] S104, separating the surface reflection light and the product body features in the polarization image according to the degree of polarization and the polarization angle.
[0076] The purpose is to eliminate or weaken the interference caused by the mirror reflection of the product surface, so as to more clearly show the inherent features of the product body.
[0077] The surface reflection light usually has a high degree of polarization, and its polarization angle is related to the polarization direction of the incident light, while the polarization degree of the product body features (such as diffuse reflection light) is low and the polarization angle distribution is more random. Through polarization information, the two parts of light signals can be effectively separated.
[0078] S105, performing defect feature analysis on the separated product body features, and analyzing the response mode of the potential defect area in different polarization images.
[0079] The defect feature analysis on the separated product body features refers to using conventional image processing and analysis techniques, such as edge detection, texture analysis, color analysis, etc., to identify and quantify the possible defect features on the product body in the image from which the surface reflection light interference has been removed.
[0080] At the same time, the analysis of the response mode of the potential defect area in different polarization images refers to observing the change rule of the brightness, contrast or polarization parameters of the same area in different polarization direction images, because the real defects and optical illusions may have significant differences in polarization response.
[0081] S106, distinguishing optical illusions from real product defects according to the results of defect feature analysis and response mode analysis.
[0082] The purpose is to improve the accuracy of defect identification and avoid misjudgment of visual illusions caused by lighting conditions or material surface characteristics as real product defects.
[0083] The scheme of the present application effectively solves the problem that traditional image acquisition is difficult to distinguish real defects from optical illusions in complex surface product defect detection by introducing polarization imaging technology. Specifically, the deployment of controllable polarized light source and polarization camera enables the system to obtain multiple images containing rich polarization information. By processing these polarization images, the degree of polarization and the polarization angle of each pixel point are calculated, so that the specular reflection light on the product surface and the diffuse reflection light of the product body can be effectively separated by using the polarization characteristics of light. Since the surface reflection light often hides the real defects of the product body, and its polarization characteristics are significantly different from the diffuse reflection light of the product body, after separating the product body features, more pure and real defect information can be obtained. On this basis, combined with the analysis of the response mode of the defect area in different polarization images, the system can further distinguish which is the visual illusion caused by illumination or material surface characteristics, and which is the real defect of the product structure or material itself. For example, some scratches or depressions may exhibit unique response patterns in certain polarization directions, while simple surface stains or reflections may exhibit different polarization characteristics.
[0084] Through the above technical scheme, the present application can significantly improve the accuracy and robustness in complex surface product quality detection. By using polarization imaging technology, the system can effectively suppress or eliminate the interference of surface reflection light on defect recognition, so as to obtain clearer and more real defect images. This makes the subsequent defect feature analysis more accurate in identifying small defects of the product body. In addition, by analyzing the response mode of the potential defect area in different polarization images, the present application can effectively distinguish optical illusions from real product defects, avoiding the common misjudgment and omission in traditional methods, thereby improving the reliability and efficiency of product quality detection.
[0085] In some preferred embodiments, the present application is implemented as follows: Suppose that it is necessary to detect small scratches or depressions on the surface of an electronic product shell with high gloss. First, a controllable polarized LED light source and a polarization camera are deployed in the verification area. The LED light source can be programmed to control its polarization direction, for example, to emit 0°, 45°, 90° and 135° linearly polarized light in turn. The polarization camera then captures an image under each light source polarization direction, obtaining four polarization images.
[0086] Next, the four polarization images are processed to calculate the Stokes vector of each pixel, and then the degree of polarization and the polarization angle of each pixel are obtained. Based on this polarization information, the surface reflection component (specular reflection) and the bulk reflection component (diffuse reflection) in the image are separated using the Fresnel reflection law or a polarization difference-based method. For example, a model can be constructed to decompose the total light intensity into diffuse reflection and specular reflection, and the polarization information is used to estimate and remove the specular reflection.
[0087] After obtaining the product bulk feature image that removes surface reflection, the image is subjected to conventional defect feature analysis, such as using the Canny edge detection algorithm to identify scratch edges, or using local contrast analysis to identify depressions. At the same time, for the identified potential defect area, the change pattern of its brightness, contrast or polarization parameters in the original four polarization images is analyzed. For example, a real scratch may appear as a continuous interruption of brightness or texture in all polarization images, while a simple reflection point may exhibit significantly different intensity changes under different polarization directions, or even completely disappear under certain polarization directions.
[0088] Finally, combined with the defect feature analysis results (such as the length, width, and depth estimation of the scratch) and the polarization response pattern analysis results (such as whether it conforms to the polarization response characteristics of a real defect), the system can accurately determine whether the area is a real product scratch or just a visual illusion caused by lighting. For example, if an area is identified as a scratch in the bulk feature image and its response pattern in different polarization images is consistent with the polarization response pattern of a known real scratch, it is confirmed as a real defect; otherwise, it may be determined as an optical illusion.
[0089] In one possible design, in order to divert products to different processing paths according to the preliminary identification confidence, the method further comprises: S201, obtaining real-time state information of the verification area, the real-time state information including the number of available workstations, the current processing queue length, and the average processing time of a single product in the verification area.
[0090] Specifically, obtaining real-time state information of the verification area means that the system continuously monitors and collects the operation data of the verification area. The real-time state information can be understood as key indicators reflecting the current workload and processing efficiency of the verification area, for example, the number of available workstations refers to the number of idle workstations available for product verification in the verification area; the current processing queue length refers to the number of products waiting to enter the verification process; the average processing time of a single product refers to the average time required to complete a product verification. These information can be obtained through sensors, production management system interface or manual input, etc., and the purpose is to provide real-time and accurate data support for subsequent diversion decisions.
[0091] S202, calculating an expected processing delay of the verification area according to the real-time state information.
[0092] The calculating of the expected processing delay of the verification area according to the real-time state information refers to that the system uses a preset algorithm model to predict the waiting time of the product in the verification area in the future period of time according to the collected real-time state information. For example, the expected processing delay can be estimated by multiplying the current processing queue length by the average processing time of a single product and then dividing by the number of available stations. The purpose is to quantify the load condition of the verification area and provide a basis for dynamically adjusting the shunting strategy.
[0093] S203, adjusting the shunting rate when the expected processing delay exceeds a preset threshold or the number of available stations is lower than a safety threshold.
[0094] The adjusting of the shunting rate includes shunting at a lower frequency than normal or releasing part of the products with preliminary recognition confidence in a preset intermediate range but biased towards qualified products to the main production line and marking them as low-risk qualified products. When the expected processing delay does not exceed the preset threshold and the number of available stations is not lower than the safety threshold, the shunting rate is maintained. When the processing capacity of the verification area recovers or the processing delay decreases to a safety range, the shunting rate is restored, wherein the restoring of the shunting rate includes gradually restoring the normal shunting rate or preferentially processing the products marked as low-risk qualified products.
[0095] The scheme of the present application can identify local flow instability or thermodynamic heterogeneity that is difficult to detect by traditional global control method by deploying sensors in the key areas (including the first type area and the second type area) inside the mold to obtain real-time local melt temperature and pressure data. For example, when the temperature of the gate area of a certain mold cavity is too low or the pressure is insufficient, it may cause the melt to solidify too early or the filling to be insufficient; when local overheating or pressure fluctuation occurs in the complex structure area of the mold, it may cause the product to warp, shrink or size deviation. Through the analysis of these local data, the system can generate differentiated compensation instructions and accurately adjust the local cooling rate or local holding pressure of the corresponding area. This fine-grained local intervention mechanism makes the control of the injection molding process from the macro level to the micro level, ensuring that the filling, holding and cooling process of the melt in the mold cavity can reach the optimal state in each area.
[0096] By the technical solution, the application can effectively solve the low efficiency and potential bottleneck problem caused by not considering the real-time load of the verification area in the traditional shunting method. By dynamically adjusting the shunting rate, the processing delay caused by product accumulation in the verification area can be avoided, ensuring that high-risk products can be further verified in time, and optimizing the allocation of production resources. In addition, part of the low-risk qualified products are released to the main production line and marked, which improves the operation efficiency and flexibility of the overall production line under the premise of ensuring controllable product quality, and significantly improves the intelligence and self-adaptation ability of the production system.
[0097] In some preferred embodiments, it is assumed that a product production line is performing target pattern recognition. When the preliminary recognition confidence of product A is in the middle range (for example, between 70%-85%), the system will consider directing it to an independent verification area for secondary analysis. At this time, the system first obtains the real-time state information of the verification area, for example, it is found that the current available workstation number of the verification area is only 1, and the processing queue length has reached 20 products, and the average processing time of a single product is 5 minutes. Based on this, the system calculates that the expected processing delay is 20*5 / 1=100 minutes, which is much higher than the preset delay threshold (for example, 30 minutes). In this case, the system will instruct the shunting device to adjust the shunting rate. Specifically, the shunting device may be instructed to shunt at a lower frequency than normal (for example, every 5 products to the verification area), or if the preliminary recognition confidence of product A is in the middle range but more biased towards qualified (for example, 80%), the system may mark it as a “low-risk qualified product” and temporarily release it to the main production line to reduce the immediate pressure on the verification area. When the available workstation number of the verification area increases to 5 and the processing queue length decreases to 5 products, the expected processing delay decreases to 5*5 / 5=5 minutes, which is lower than the preset threshold. At this time, the system will restore the normal shunting rate, and preferentially process the products marked as low-risk qualified products before, to ensure that all products can be properly processed in the end.
[0098] In some embodiments of the application described above, when calculating the preliminary recognition confidence of product quality based on visual features, there may be a problem that the spatial distribution characteristics and severity differences of defects are not fully considered. Traditional methods may treat all detected features equally, resulting in excessive sensitivity to local and minor abnormalities, or insufficient recognition of continuous and severe defects, thereby affecting the accuracy of the preliminary recognition confidence, and further possibly leading to deviation in product shunting decisions.
[0099] To this end, the application further provides that the step of calculating the preliminary recognition confidence of product quality based on visual features comprises: S301, dividing the image of the product into a plurality of local areas.
[0100] Specifically, the product image is divided into multiple local regions, which means that the entire product image is divided into several smaller, independently analyzable sub-image blocks.
[0101] S302, regions exhibiting similar deviation patterns in consecutive or adjacent local regions are given higher weights; isolated and not highly deviated feature points are reduced in weight.
[0102] Among them, the regions exhibiting similar deviation patterns in consecutive or adjacent local regions are given higher weights, which means that when multiple adjacent local regions show similar deviation trends or patterns from the normal standard, these regions are considered more likely to represent real defects of a certain size, so their influence on the overall confidence is amplified when calculating the preliminary recognition confidence. For example, a continuous scratch or stain may span multiple local regions, and the visual features (such as color, texture, geometry) of these regions will deviate from the normal standard in a similar way.
[0103] In practical applications, isolated and not highly deviated feature points are reduced in weight, which means that those local abnormal points that are not spatially continuous and whose deviation does not reach a significant threshold are considered to have less negative impact on product quality, and may even be image noise or non-critical minor defects. Therefore, when calculating the preliminary recognition confidence, the weights of these points are adjusted accordingly to avoid false positives due to excessive sensitivity.
[0104] S303, based on the weighted deviation, calculate the preliminary recognition confidence of the product quality.
[0105] Based on the weighted deviation, the preliminary recognition confidence of the product quality is calculated, which means that after considering the deviation patterns (continuity, similarity, isolation) of different local regions and their corresponding weights, the deviation of all local regions is weighted and averaged or summed, thus obtaining a preliminary recognition confidence that better reflects the overall quality of the product.
[0106] S304, according to the differentiated compensation instructions, adjust the local cooling rate or local holding pressure of each cavity.
[0107] Specifically, according to the generated differentiated compensation instructions, the cooling medium flow, temperature or holding pressure of each cavity can be precisely adjusted through the independent cooling circuit control unit or local holding valve integrated inside the mold.
[0108] For example, the local cooling rate can be changed by controlling the flow rate or temperature of the cooling liquid, or the local holding pressure can be applied or released by an independent hydraulic / pneumatic system.
[0109] The scheme of the present application can make the system examine the micro details of the product surface one by one by finely dividing the product image into multiple local areas. By analyzing the spatial continuity and similarity of the deviation patterns of these local areas, the system can effectively distinguish the continuous and large-scale deviation caused by real defects from the isolated and low-level deviation caused by accidental noise or non-critical minor flaws. It is precisely because different types of deviation are given different weights that the system can more accurately reflect the real situation of product quality when calculating the preliminary identification confidence. For example, a large area of color difference or continuous crack will show similar and continuous deviation patterns in multiple local areas, so it will be given a high weight, thereby significantly reducing the preliminary identification confidence. A single and slight dust point, on the other hand, has a low deviation degree and exists in isolation, so it will be given a low weight and have less impact on the preliminary identification confidence.
[0110] Through the above technical scheme, the present application can more accurately evaluate the preliminary identification confidence of product quality, effectively avoiding misjudgment caused by simply accumulating all feature deviations. The scheme can significantly improve the identification sensitivity and robustness of real defects while reducing the false positive rate of non-critical or noise-induced abnormalities. As a result, the accuracy of product diversion is improved, reducing unnecessary secondary verification or misrelease, thereby optimizing the efficiency and quality control level of the overall production line.
[0111] In some preferred embodiments, assuming that after image acquisition of a certain product surface, the system detects two types of visual feature deviations: one is a fine but continuous scratch on the product surface, which shows similar texture and color deviation in multiple adjacent local areas; the other is an isolated and extremely small dust point on the product surface, which only causes slight color deviation in one local area. According to the above method, for the multiple local areas involved in the continuous scratch, the system will give these areas a higher weight because they show similar and continuous deviation patterns. For the isolated dust point, the system will give it a lower weight because its deviation degree is not high and it does not have spatial continuity. Finally, when calculating the preliminary identification confidence of product quality based on the weighted deviation degree, the influence of the continuous scratch on the confidence will be much greater than that of the isolated dust point, enabling the system to more accurately judge whether the product has real defects that need further processing, thereby avoiding misjudgment of the product as unqualified due to the dust point, a non-critical factor, and ensuring effective identification of real scratch defects.
[0112] In some embodiments of the above-mentioned embodiments of the present application, a higher weight is assigned to the region exhibiting similar deviation patterns in continuous occurrence or adjacent local regions. However, in the implementation process, only the weight assignment based on similar deviation patterns may not effectively distinguish the inherent normal texture of the product, the false appearance caused by environmental light or slight non-defect fluctuations, thereby leading to misjudgment of the preliminary identification confidence of the product quality. If the above problem is not solved, it may increase the false positive rate and affect the efficiency and accuracy of the production line. In view of this, the present application further proposes a more refined weight assignment mechanism, which combines texture feature analysis and spatial continuity judgment to more accurately identify real defects.
[0113] In view of this, the step of assigning a higher weight to the region exhibiting similar deviation patterns in continuous occurrence or adjacent local regions in the above-mentioned embodiments of the present application comprises: S401, performing texture feature analysis on the deviation degree of each local region to identify whether the texture feature has periodicity or repetition.
[0114] Specifically, the regularity of pixel intensity, color or geometric arrangement in the local region can be analyzed by image processing techniques such as Fourier transform, wavelet analysis or gray level co-occurrence matrix method. The purpose is to identify whether the visual pattern of the region exhibits periodicity or repetition, such as the weaving texture of textiles, the texture of metal wire drawing or the screen dot structure of printed matter, etc.
[0115] S402, marking the region with periodic or repetitive texture features as a potential normal texture region.
[0116] For example, those regions with regular visual features allowed by product design or manufacturing process can be initially identified as non-defect regions. The purpose is to preliminarily distinguish the normal structure of the product itself from the potential defect pattern, and avoid misjudging the normal texture as a defect.
[0117] S403, performing spatial continuity judgment on the region which is not marked or the region which is marked as a potential normal texture region but the deviation degree significantly exceeds the preset normal fluctuation range.
[0118] The spatial continuity judgment comprises: if the region continuously occurs or is adjacent in space and the deviation degree is consistent, the region is identified as continuous deviation caused by real defects, and a higher weight is assigned to the region identified as continuous deviation caused by real defects.
[0119] The scheme of the present application firstly performs preliminary screening on the deviation degree of local regions by introducing texture feature analysis, and identifies those regions with periodic or repetitive texture as potential normal texture regions, thereby effectively excluding the interference of product inherent texture or background pattern on defect identification. On this basis, for those regions without normal texture features or those regions with normal texture features but whose deviation degree has exceeded the normal fluctuation range, further spatial continuity judgment is performed. This judgment mechanism can effectively filter out isolated noise points or accidental measurement errors, because real defects usually exhibit certain continuity and consistency in space. Through this layered and progressive analysis method, the present application can more accurately identify continuous deviation caused by real defects, avoid misjudging normal texture or random noise as defects, and thereby provide more reliable input for subsequent preliminary identification confidence calculation.
[0120] In some preferred embodiments, the following is described by a specific example. Suppose a quality inspection is performed on an electronic product shell with fine grid texture. If only the method of assigning higher weight to regions exhibiting similar deviation patterns in continuously appearing or adjacent local regions is used, the normal grid texture on the product surface may be misidentified as continuous deviation pattern, and higher weight is incorrectly assigned, resulting in low preliminary identification confidence, and thereby causing the qualified product to be misdirected to the independent verification area.
[0121] In order to identify whether the texture feature has periodicity or repetitiveness, the following steps are included: S501, performing multi-direction and multi-scale filtering processing on the image of the local region to enhance the texture structure of different directions and scales.
[0122] Specifically, the image of the local region is subjected to multi-direction and multi-scale filtering processing, the purpose of which is to highlight the texture structure of different directions and scales in the image, and to provide clear input for subsequent texture analysis. For example, Gabor filter set or wavelet transform technology can be used to effectively capture various subtle texture features in the image by adjusting the direction and scale parameters of the filter, while suppressing noise and irrelevant information.
[0123] S502, performing local Fourier transform on the filtered image to analyze the dominant frequency and direction in the transformation result, and identifying the first periodic texture.
[0124] The local Fourier transform can reveal the frequency component and direction information of the local region of the image. By analyzing the dominant frequency and direction of energy concentration in the transformation result, the most significant periodic texture pattern in the image can be identified, such as the regular grid or stripe commonly seen on product surface.
[0125] S503. After identifying the first type of periodic texture, remove the corresponding component of the first type of periodic texture from the image to obtain the residual image.
[0126] This step aims to remove the primary periodic textures in the image, allowing secondary textures or aperiodic anomalies that are masked by them to become visible. Identified periodic texture components can be effectively separated from the image by performing appropriate filtering operations in the frequency or spatial domains.
[0127] S504. Perform a local Fourier transform on the residual image again, analyze the dominant frequency and direction, and identify the second type of periodic texture or repetitive texture.
[0128] Specifically, secondary analysis of residual images can discover and identify secondary periodic or repetitive textures that were not obvious in the first analysis or were obscured by the main texture, thereby achieving a more comprehensive understanding of the product surface texture.
[0129] S505. Perform feature quantization on the identified different types of periodic or repetitive textures to obtain their respective texture feature parameters; based on the texture feature parameters, determine whether the deviation of the local area is caused by a specific type of periodic or repetitive texture.
[0130] Feature quantization refers to extracting numerical descriptors of texture, such as spatial frequency, orientation, contrast, and energy. By comparing these quantized parameters with preset normal texture parameters, it is possible to accurately determine whether deviations in local areas stem from inherent normal texture variations in the product or from actual defects.
[0131] This application's solution employs multi-level, multi-dimensional texture analysis of local image regions to precisely identify periodic or repetitive textures within the image. First, multi-directional, multi-scale filtering enhances the visibility of different texture structures, laying the foundation for subsequent analysis. Next, local Fourier transform is used to perform frequency and direction analysis on the filtered image, accurately identifying the main periodic textures. By removing the identified texture components and performing secondary analysis on the remaining image, this solution can discover and identify more complex or minor periodic / repetitive textures, avoiding omissions that might occur with single-analysis. Finally, by quantifying the features of different texture types, precise texture feature parameters can be obtained, enabling the determination of whether deviations in local regions stem from normal texture variations within the product itself or are caused by genuine defects. This layered, refined texture analysis method effectively improves the ability to distinguish between optical artifacts and genuine product defects, preventing the misjudgment of normal texture fluctuations as defects.
[0132] like Figure 3As shown, the embodiment of the present application also provides a target pattern recognition system based on camera image. The system comprises: an image acquisition module, configured to extract visual features of the product from the image of the product; a confidence level calculation module, configured to calculate a preliminary recognition confidence level of the product quality according to the visual features; a product diversion module, configured to divert the product to different processing paths according to the preliminary recognition confidence level; wherein, when the preliminary recognition confidence level is in a preset intermediate range, the product is guided to an independent verification area; a parameter adjustment module, configured to adjust image acquisition parameters of the verification area; a secondary analysis module, configured to recalculate the recognition confidence level of the product quality under the adjusted image acquisition parameters; a result determination module, configured to determine a final processing result of the product according to the recalculated recognition confidence level.
[0133] The embodiment of the present application also provides a computer readable storage medium. All or part of the processes in the above method embodiments can be instructed by a computer program to complete related hardware, and the program can be stored in the computer readable storage medium. When the program is executed, the processes of the above method embodiments can be included. The computer readable storage medium can be an internal storage unit of the task execution device (including the data sending end and / or the data receiving end) of any of the above embodiments, such as the hard disk or the memory of the task execution device. The computer readable storage medium can also be an external storage device of the terminal device, such as the plug-in hard disk, the smart media card (SMC), the secure digital (SD) card, the flash card, etc. equipped in the terminal device. Further, the computer readable storage medium can include both the internal storage unit of the task execution device and the external storage device. The computer readable storage medium is used to store the computer program and other programs and data required by the task execution device. The computer readable storage medium can also be used to temporarily store the data that has been output or will be output.
[0134] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0135] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application essentially or say the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The software product is stored in a storage medium, includes a plurality of instructions to make a device (which can be a single-chip microcomputer, a chip, etc.) or a processor execute all or part of the steps of the embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a ROM, a RAM, a magnetic disk or an optical disk, and various storage program codes.
[0136] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any change or replacement within the technical scope disclosed in the present application should be covered within the protection scope of the present application.
Claims
1. A method for target pattern recognition based on camera images, characterized in that, The method comprises the following steps: extracting visual features of the product from the image of the product; calculating a preliminary identification confidence of the product quality according to the visual features; diverting the product to different processing paths according to the preliminary identification confidence; when the preliminary identification confidence is in a preset intermediate range, guiding the product to an independent verification area; adjusting the image acquisition parameters of the verification area; recalculating the identification confidence of the product quality under the adjusted image acquisition parameters; determining the final processing result of the product according to the recalculated identification confidence.
2. The method of claim 1, wherein, The visual features include geometric features, color features, texture features, and identification information features.
3. The method of claim 2, wherein the method further comprises: The step of calculating the preliminary identification confidence of the product quality according to the visual features comprises the following steps: for each visual feature, determining the deviation amplitude of the visual feature relative to the corresponding feature standard to obtain the deviation amplitude of each visual feature; calculating the preliminary identification confidence of the product quality according to the deviation amplitude of each visual feature.
4. The method of claim 3, wherein the method further comprises: The step of calculating the preliminary identification confidence of the product quality according to the deviation amplitude of each visual feature comprises the following steps: calculating the preliminary identification confidence of the product quality according to a first confidence formula and the deviation amplitude of each visual feature; The first confidence formula is as follows: C_pre=f(w1*S_R+w2*S_H+w3*S_Contrast+w4*S_OCR); wherein C_pre is the preliminary identification confidence, w1, w2, w3, and w4 are preset weights of the features, f is a Sigmoid function, S_R is the deviation amplitude of the geometric features, S_H is the deviation amplitude of the color features, S_Contrast is the deviation amplitude of the texture features, and S_OCR is the deviation amplitude of the identification information features.
5. The method of claim 1, wherein the method further comprises: The step of adjusting the image acquisition parameters of the verification area comprises the following steps: deploying a controllable polarized light source and a polarization camera; controlling the controllable polarized light source to emit light rays with different polarization directions and acquiring multiple polarization images through the polarization camera; calculating the degree of polarization and the polarization angle of each pixel point according to the polarization images; separating the surface reflection light and the product body features in the polarization images according to the degree of polarization and the polarization angle; performing defect feature analysis on the separated product body features and analyzing the response mode of the potential defect area in different polarization images; distinguishing optical illusions from real product defects according to the results of the defect feature analysis and the response mode analysis.
6. The method of claim 1, wherein the method further comprises: The step of diverting the product to different processing paths according to the preliminary identification confidence comprises the following steps: obtaining real-time state information of the verification area, which includes the number of available workstations, the current processing queue length, and the average processing time of a single product in the verification area; calculating the predicted processing delay of the verification area according to the real-time state information; when the predicted processing delay exceeds a preset threshold or the number of available workstations is lower than a safety threshold, adjusting the diversion rate, The adjusting the diversion rate comprises instructing the diversion device to divert at a lower frequency than normal, or releasing part of the products with preliminary identification confidence in a preset intermediate range but biased towards qualified products to the main production line, and marking the products as low-risk qualified products; When the predicted processing delay does not exceed a preset threshold and the number of available stations is not lower than a safety threshold, the diversion rate is maintained; When the processing capacity of the verification area recovers or the predicted processing delay decreases to a safety range, the diversion rate is restored, wherein the restoring the diversion rate comprises gradually restoring the normal diversion rate, or preferentially processing the products marked as low-risk qualified products.
7. The method of claim 1, wherein the method further comprises: The calculating the preliminary identification confidence of the product quality according to the visual features comprises: dividing the image of the product into a plurality of local areas; assigning a higher weight to areas exhibiting similar deviation patterns in consecutive or adjacent local areas, and reducing the weight of feature points appearing in isolation and with a low deviation degree; calculating the preliminary identification confidence of the product quality based on the weighted deviation degrees.
8. The method of claim 7, wherein the method further comprises: The assigning a higher weight to areas exhibiting similar deviation patterns in consecutive or adjacent local areas comprises: performing texture feature analysis on the deviation degree of each local area to identify whether the texture features have periodicity or repetition; marking areas with periodic or repetitive texture features as potential normal texture areas; performing spatial continuity judgment on areas not marked or areas marked as potential normal texture areas but with a deviation degree significantly exceeding a preset normal fluctuation range; the spatial continuity judgment comprises identifying the areas as continuous deviations caused by real defects if the areas appear consecutively or adjacently in space and the deviation degrees are consistent, and assigning a higher weight to the areas identified as continuous deviations caused by real defects.
9. The method of claim 8, wherein the method further comprises: The performing texture feature analysis on the deviation degree of each local area to identify whether the texture features have periodicity or repetition comprises: performing multi-direction and multi-scale filtering processing on the image of the local area to enhance texture structures in different directions and scales; performing local Fourier transform on the filtered image to analyze dominant frequencies and directions in the transform result, and identify a first periodic texture; after identifying the first periodic texture, removing corresponding components of the first periodic texture from the image to obtain a residual image; performing local Fourier transform again on the residual image to analyze dominant frequencies and directions, and identify a second periodic texture or a repetitive texture; quantifying the identified different types of periodic or repetitive textures to obtain respective texture feature parameters; and judging whether the deviation degree of the local area is caused by a specific type of periodic or repetitive texture according to the texture feature parameters.
10. A camera image based target pattern recognition system, characterized in that, The system comprises: an image acquisition module configured to extract visual features of a product from an image of the product; a confidence calculation module configured to calculate a preliminary identification confidence of a quality of the product according to the visual features; a product diversion module configured to divert the product to different processing paths according to the preliminary identification confidence. When the preliminary identification confidence is in a preset intermediate range, the product is guided to a separate verification area; a parameter adjustment module, configured to adjust image acquisition parameters of the verification area; a secondary analysis module, configured to recalculate the identification confidence of the product quality under the adjusted image acquisition parameters; a result determination module, configured to determine a final processing result of the product according to the recalculated identification confidence.