A batch image data processing method and system for intelligent manufacturing production line
By performing template matching recognition of sliding windows and moving steps on batch images on the intelligent manufacturing production line and dynamically adjusting processing parameters, the problem of low image processing efficiency is solved and efficient batch image processing is achieved.
Patent Information
- Application Number
- CN202510672593.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-05-23
AI Technical Summary
The image processing efficiency in existing technologies is low and lacks the ability to dynamically optimize batch image processing tasks.
By performing template matching recognition based on sliding windows and moving steps on batch images, the image processing parameters are dynamically adjusted, including using larger windows and steps for high-precision recognition in defective areas, and using smaller windows and steps for efficient recognition in non-defective areas.
The image processing efficiency and effect are improved, and dynamic optimization of batch image processing tasks is achieved.
Smart Images

Figure CN120198858B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of data processing, and in particular to a batch image data processing method and system for an intelligent manufacturing production line. Background Art
[0002] With the development of the digital economy and artificial intelligence, intelligent visual inspection systems have gradually become a key supporting technology in the field of industrial quality inspection. Through automated, high-precision image data processing, defect detection can be performed on individual product images collected on the production line, rapidly identifying defect information such as surface defect type, defect outline, defect location, and defect size, thereby ensuring consistent product quality. Compared to traditional manual quality inspection, this technology significantly addresses inherent flaws in manual inspection, such as subjective judgment bias, fluctuations in missed detection rates due to visual fatigue, and decreased inspection efficiency during nighttime production, thereby improving production efficiency.
[0003] In related technologies, most image data processing methods use pre-set image recognition processing methods to process single images or batches of images. This method has low image processing efficiency and lacks the ability to dynamically optimize batch image processing tasks. Summary of the Invention
[0004] The embodiments of the present application provide a batch image data processing method and system for an intelligent manufacturing production line, which solves the problems of low image processing efficiency and lack of dynamic optimization capabilities for batch image processing tasks in the prior art. It can adaptively adjust the image processing parameters of batch images to improve image processing efficiency and effects.
[0005] In a first aspect, an embodiment of the present application provides a method for batch image data processing for an intelligent manufacturing production line, the method comprising:
[0006] Obtaining a first image to be identified from a plurality of images to be identified included in a current detection batch;
[0007] Performing template matching recognition based on a first sliding window and a first moving step on the first image to be recognized, to obtain a defect detection result of the first image to be recognized;
[0008] If the defect detection result indicates that a defect exists, determining a location area of the defect, and performing a corresponding area range calibration based on the location area;
[0009] For the remaining images to be identified in the current inspection batch, the first sliding window in the area where the area range is calibrated and the first template matching and identification of the first moving step are performed, and the second sliding window in the area outside the area range calibration and the second template matching and identification of the second moving step are performed to obtain corresponding defect detection results, wherein the size of the second sliding window is larger than the size of the first sliding window, and the second moving step is larger than the first moving step.
[0010] Optionally, after obtaining the defect detection result of the first image to be identified, the method further includes:
[0011] When the defect detection result of the first image to be identified is that there is no defect, the remaining images to be identified in the current inspection batch are subjected to third template matching and recognition based on a third sliding window and a third moving step to obtain defect detection results corresponding to each image to be identified. The size of the third sliding window is larger than the size of the first sliding window, and the third moving step is larger than the first moving step.
[0012] Optionally, determining the location area of the defect and performing corresponding area range calibration based on the location area includes:
[0013] Determining the location area and defect type of the defect;
[0014] A preset expansion range template is obtained according to the defect type, and the area range of the location area is calibrated based on the location area and the expansion range template.
[0015] Optionally, before obtaining a preset expansion range template according to the defect type, the method further includes:
[0016] Different expansion range templates are set according to different defect types of assembly line products, wherein the expansion range sizes of different expansion range templates are different.
[0017] Optionally, before the second sliding window in the area outside the calibrated area is matched with the second template of the second moving step for identification, the method further includes:
[0018] Determining a corresponding defect level according to the defect detection result, and obtaining image attribute parameters of the image to be identified;
[0019] A second sliding window and a second moving step are determined according to the defect level and the image attribute parameter.
[0020] Optionally, after obtaining the corresponding defect detection result, the method further includes:
[0021] The number of batch images, as well as the corresponding initial sliding window and initial moving step are determined based on the defect detection results, so as to perform defect identification on the images to be identified based on the initial sliding window and the initial moving step when the number of images stored in the next batch reaches the number of batch images.
[0022] Optionally, before performing template matching recognition based on the first sliding window and the first moving step on the first image to be recognized, the method further includes:
[0023] Determining a target object area in the first image to be identified;
[0024] Accordingly, performing template matching recognition on the first image to be recognized based on a first sliding window and a first moving step size includes:
[0025] The target object area is subjected to template matching recognition based on a first sliding window and a first moving step, and the area outside the target object area is subjected to template matching recognition based on a fourth sliding window and a fourth moving step, wherein the size of the fourth sliding window is larger than the size of the first sliding window, and the fourth moving step is larger than the first moving step.
[0026] In a second aspect, an embodiment of the present application further provides a batch image data processing system for an intelligent manufacturing production line, the system comprising:
[0027] An acquisition module, configured to acquire a first image to be identified from a plurality of images to be identified contained in a current detection batch;
[0028] a recognition module, configured to perform template matching recognition on the first image to be recognized based on a first sliding window and a first moving step length, to obtain a defect detection result of the first image to be recognized;
[0029] a calibration module, configured to determine a location area of the defect when the defect detection result indicates that a defect exists, and perform a corresponding area range calibration based on the location area;
[0030] The recognition module is further used to perform first template matching and recognition between the first sliding window in the area where the area range is calibrated and the first moving step, and to perform second template matching and recognition between the second sliding window in the area outside the area range calibration and the second moving step, for the remaining images to be recognized in the current inspection batch, to obtain corresponding defect detection results, wherein the size of the second sliding window is larger than the size of the first sliding window, and the second moving step is larger than the first moving step.
[0031] In a third aspect, an embodiment of the present application further provides a batch image data processing device for an intelligent manufacturing production line, the device comprising:
[0032] one or more processors;
[0033] a storage device configured to store one or more programs,
[0034] When the one or more programs are executed by the one or more processors, the one or more processors implement the batch image data processing method for an intelligent manufacturing production line described in an embodiment of the present application.
[0035] In a fourth aspect, an embodiment of the present application further provides a non-volatile storage medium storing computer-executable instructions, which, when executed by a computer processor, are configured to execute the batch image data processing method for an intelligent manufacturing production line described in an embodiment of the present application.
[0036] In a fifth aspect, an embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor of the device reads and executes the computer program from the computer-readable storage medium, so that the device executes the batch image data processing method for an intelligent manufacturing production line described in an embodiment of the present application.
[0037] In an embodiment of the present application, a first image to be identified from multiple images to be identified included in a current inspection batch is obtained; template matching recognition based on a first sliding window and a first moving step is performed on the first image to be identified to obtain a defect detection result of the first image to be identified; when the defect detection result is that a defect exists, the location area of the defect is determined, and a corresponding area range calibration is performed based on the location area; for the remaining images to be identified in the current inspection batch, first template matching recognition between the first sliding window and the first moving step in the area where the area range calibration is located, and second template matching recognition between the second sliding window and the second moving step in the area outside the area range calibration are performed to obtain a corresponding defect detection result, wherein the size of the second sliding window is larger than the size of the first sliding window, and the second moving step is larger than the first moving step. This solves the problems of low image processing efficiency and lack of dynamic optimization capability for batch image processing tasks in the prior art, can adaptively adjust the image processing parameters of batch images, and improve image processing efficiency and effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A flowchart of a batch image data processing method for an intelligent manufacturing production line provided in an embodiment of the present application;
[0039] Figure 2 A flowchart of a method for calibrating the area range of a defect location area provided in an embodiment of the present application;
[0040] Figure 3 A flowchart of another method for batch image data processing for an intelligent manufacturing production line provided in an embodiment of the present application;
[0041] Figure 4 This is a structural block diagram of a batch image data processing system for an intelligent manufacturing production line provided in an embodiment of the present application;
[0042] Figure 5 A schematic structural diagram of a batch image data processing device for an intelligent manufacturing production line provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] The following is a further detailed description of the embodiments of the present application in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the embodiments of the present application, and are not intended to limit the embodiments of the present application. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions of the embodiments of the present application, rather than all structures.
[0044] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims refers to at least one of the connected objects, and the character " / " generally indicates that the objects connected are in an "or" relationship.
[0045] The batch image data processing method for an intelligent manufacturing production line provided in the embodiments of the present application can be used for product defect detection in an intelligent manufacturing production line. In the batch image data processing method for an intelligent manufacturing production line provided in the embodiments of the present application, the execution subject of each step can be a computer device, which refers to any electronic device with data calculation, processing, and storage capabilities, such as a PC (Personal Computer), a tablet computer, and other terminal devices, which are not limited in the embodiments of the present application.
[0046] Figure 1 This is a flow chart of a method for processing batch image data for an intelligent manufacturing production line provided in an embodiment of the present application. Figure 1As shown, the following steps are included:
[0047] Step S101: Acquire a first image to be identified from a plurality of images to be identified contained in a current detection batch.
[0048] For products on the production line, batch image data processing is performed on each batch as the target of image data processing. Optionally, each batch can be divided into a fixed number of images, for example, 50 images each as a batch. The current batch is the batch currently requiring batch image data processing. The images to be identified are all images in the current batch requiring image data processing, and the first image to be identified is one of them. Optionally, the first image to be identified can be the first image in the current batch.
[0049] To acquire images of the current inspection batch, a fixed camera can be used to capture images of the products on the production line. These images are then transmitted to the platform center for storage and retrieved from the storage location. For example, if a batch consists of 20 images, the camera sequentially captures the products on each production line at the same location to obtain the corresponding images, which are also the images to be recognized. After these images are stored, when the current batch begins inspection, the 20 images are retrieved from the storage unit. The first image to be recognized is obtained from these images, and subsequent recognition processing begins.
[0050] Step S102 : performing template matching recognition based on a first sliding window and a first moving step on the first image to be recognized, to obtain a defect detection result of the first image to be recognized.
[0051] When performing image processing-based defect detection on the first image to be identified, template matching recognition is employed. The principle of template matching recognition is to use a standard product image as a template and perform pixel-level comparison with the image to be identified. For this application, a standard product image that meets the requirements and is defect-free can be pre-photographed as a template. For example, a standard product image without defects such as missing labels, missing production dates, missing parts, or dimensional issues can be used as a template for defect detection of the image to be identified.
[0052] Among them, when performing defect detection by template matching recognition, a standard product image is prepared in advance. Optionally, it can be a high-definition image of a defect-free product, and the template image is obtained after denoising, edge enhancement and other processing. For the image to be identified, the lighting conditions, viewing angle, and resolution of the image taken with the standard product are consistent. During specific recognition, a set sliding window is used to move on the image to be identified according to the set step size. The standard product image at the corresponding position of the window is intercepted, and the similarity between the two is compared. Finally, it is identified whether it has defects based on the comparison results. For example, the standard product image has a production date printed in the middle of the product or a label affixed. Through template recognition, it is identified that the first image to be identified does not have the production date or label, and the corresponding defect detection result is that there is a defect. Optionally, a defect detection result including the defect type and defect location can also be generated according to the specific defect detection situation.
[0053] In one embodiment, the sliding window and the moving step used in performing template matching recognition are recorded as a first sliding window and a first moving step.
[0054] Step S103: When the defect detection result indicates that a defect exists, determine the location area of the defect, and perform corresponding area range calibration based on the location area.
[0055] In one embodiment, when the defect detection result of the first image to be identified is that a defect exists through template recognition, the location area of the defect is correspondingly determined, and the corresponding area range is calibrated based on the location area.
[0056] Figure 2 A flowchart of a method for calibrating the area range of a defect location area provided in an embodiment of the present application is shown as follows: Figure 2 As shown in Figure 1, a specific area range calibration method is given, including:
[0057] Step S1031: Determine the location area and defect type of the defect.
[0058] In one embodiment, when performing defect detection using a template matching recognition algorithm, the defect location region determined can be the difference between the first image to be identified and the standard product image. Accordingly, when determining the defect type, the corresponding defect type can be identified based on the specific difference. For example, if the product in the first image to be identified is missing a label, the defect type is determined to be missing; if the product size in the first image to be identified is inconsistent, the defect type is determined to be size. In other words, template matching is used to determine the specific defect location region and identify the corresponding defect type. Optionally, defect type determination can be performed using a pre-set defect detection template, where different defect detection templates correspond to different defect types. The defect detection template can be a recorded pixel difference. When matching the standard product image and the first image to be identified, the result obtained is the similarity between the corresponding locations of the standard product image and the first image to be identified, determined based on each sliding window. For example, the result is normalized to the range [-1, 1], where values closer to 1 between -1 and 1 indicate a higher degree of match, i.e., similarity, and vice versa. Correspondingly, for the above calculation method, a similarity score is generated for each window position, and finally a response image with the same size as the first image to be identified is obtained. The corresponding defect detection template is a pre-set image template with the same size as the first image to be identified and contains the scores of each window position. Each template corresponds to a defect type. The response image of the first image to be identified obtained by the above-mentioned recognition and comparison is matched with each defect detection template, and the defect type corresponding to the defect detection template with the consistent or closest match is determined as the defect type identified in the current first image to be identified.
[0059] Step S1032: Acquire a preset expansion range template according to the defect type, and perform area range calibration of the location area based on the location area and the expansion range template.
[0060] In one embodiment, different defect types are pre-assigned corresponding expansion range templates, each with a different expansion range. The expansion range refers to a new range that is expanded from the detected defect location area to cover the defect location area. Specifically, the range expansion is performed based on the defect location area and the corresponding expansion range template to calibrate the area of the location area.
[0061] Optionally, the expansion range template may include a specific number of expanded pixels. The process for performing region range calibration for the location region based on the location region and the expansion range template may include: expanding outward from each contour pixel in the location region by the number of expanded pixels recorded in the expansion range template to obtain a new contour boundary. The resulting range is then determined as the region range calibration. For example, if the defect type is missing, the corresponding number of expanded pixels may be 200 pixels; if the defect type is size, the corresponding number of expanded pixels may be 500 pixels.
[0062] Step S104: For the remaining images to be identified in the current inspection batch, perform first template matching and identification between the first sliding window in the area where the area range is calibrated and the first moving step, and perform second template matching and identification between the second sliding window in the area outside the area range calibration and the second moving step, to obtain corresponding defect detection results, wherein the size of the second sliding window is larger than the size of the first sliding window, and the second moving step is larger than the first moving step.
[0063] In one embodiment, after the defect location of the first image to be identified is calibrated, template matching recognition can be performed using different sliding windows and moving steps for the remaining images to be identified. Specifically, a first template matching recognition using a first sliding window and a first moving step is performed for the area within the calibrated area. That is, the sliding window size and moving step size for this area are the same as those used for template matching recognition of the first image to be identified. A second template matching recognition using a second sliding window and a second moving step is performed for areas outside the calibrated area. The size of the second sliding window is larger than that of the first sliding window, and the second moving step size is larger than the first moving step size. This allows for continued relatively high-precision identification of potential defect areas, while areas with a high probability of being defect-free are identified using a relatively lower-precision method, significantly improving recognition efficiency and reducing data computation complexity. For example, the size of the first sliding window can be 30*30 pixels, and the first moving step size can be 1; the size of the second sliding window can be 60*60 pixels, and the first moving step size can be 2.
[0064] From the above, it can be seen that by obtaining the first image to be identified from the multiple images to be identified contained in the current detection batch; performing template matching recognition based on the first sliding window and the first moving step on the first image to be identified, a defect detection result of the first image to be identified is obtained; when the defect detection result is that there is a defect, the location area of the defect is determined, and the corresponding area range calibration is performed based on the location area; for the remaining images to be identified in the current detection batch, the first template matching recognition of the first sliding window and the first moving step in the area where the area range calibration is located, and the second template matching recognition of the second sliding window and the second moving step in the area outside the area range calibration are performed to obtain the corresponding defect detection result, wherein the size of the second sliding window is larger than the size of the first sliding window, and the second moving step is larger than the first moving step, which solves the problems of low image processing efficiency and lack of dynamic optimization capability for batch image processing tasks in the prior art, and can adaptively adjust the image processing parameters of batch images to improve image processing efficiency and effect.
[0065] In one embodiment, after obtaining the defect detection result of the first image to be identified, the method further includes: if the defect detection result of the first image to be identified is that there is no defect, performing a third template matching and recognition based on a third sliding window and a third moving step on the remaining images to be identified in the current detection batch to obtain the defect detection results corresponding to each image to be identified, wherein the size of the third sliding window is larger than the size of the first sliding window, and the third moving step is larger than the first moving step. If no defect is detected for the first image to be identified, a third template matching and recognition based on a third sliding window and a third moving step is performed on the remaining images of the batch, and the specific size of the third sliding window and the third moving step can be the same as the specific size of the second sliding window and the second moving step. In this way, efficient and computationally efficient defect detection can be achieved.
[0066] In one embodiment, the second sliding window and second moving step size can also be determined dynamically, i.e., not using pre-set fixed values. Alternatively, the second sliding window and second moving step size can be determined by determining a corresponding defect level based on the defect detection results, obtaining image attribute parameters of the image to be identified, and then determining the second sliding window and second moving step size based on the defect level and image attribute parameters. Different defect detection results correspond to different defect levels. One exemplary method for determining the defect level is to query a preset table based on the size of the defect area in the defect detection results to obtain the corresponding defect level. Accordingly, the specific sizes of the second sliding window and second moving step size are determined in conjunction with the determined defect level and the obtained image attribute parameters of the image to be identified. An exemplary image attribute parameter is image resolution. Alternatively, the second sliding window and second moving step size can be determined based on the defect level and image attribute parameters using a pre-established mapping table of defect level, image attribute parameters, second sliding window, and second moving step size, and then the second sliding window and second moving step size corresponding to the corresponding defect level and image attribute parameters are used as the final dynamically determined values.
[0067] Figure 3 A flowchart of another method for batch image data processing for an intelligent manufacturing production line provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, including:
[0068] Step S301: Acquire a first image to be identified from a plurality of images to be identified contained in a current detection batch.
[0069] Step S302: Perform template matching recognition based on a first sliding window and a first moving step on the first image to be recognized to obtain a defect detection result of the first image to be recognized.
[0070] Step S303: When the defect detection result indicates that a defect exists, determine the location area of the defect, and perform corresponding area range calibration based on the location area.
[0071] Step S304: For the remaining images to be identified in the current inspection batch, perform first template matching and identification between the first sliding window in the area where the area range is calibrated and the first moving step, and perform second template matching and identification between the second sliding window in the area outside the area range calibration and the second moving step, to obtain corresponding defect detection results, wherein the size of the second sliding window is larger than the size of the first sliding window, and the second moving step is larger than the first moving step.
[0072] Step S305: Determine the number of batch images, as well as the corresponding initial sliding window and initial moving step size based on the defect detection result, so as to perform defect identification on the image to be identified based on the initial sliding window and the initial moving step size when the number of images stored in the next batch reaches the number of batch images.
[0073] In one embodiment, after obtaining defect detection results for the current batch of products, the number of batch images is determined based on these defect detection results. This number of batch images is used to determine the number of images to be processed simultaneously during subsequent batch processing. Alternatively, the number of batch images can be determined based on the ratio of the number of defective products in the current batch detected to the total number of products inspected in the batch. For example, if this ratio is less than 5%, the corresponding number of batch images is a; if it is not less than 5%, the corresponding number of batch images is b, where a is greater than b and the specific value can be set as needed.
[0074] Accordingly, the defect detection results for that batch of products can also be used to determine the initial sliding window and initial moving step size, which are then used for template matching recognition of the first image to be identified in the next batch. An optional determination method can be to use the defect detection result as the ratio of the aforementioned defective products to the total number of products inspected in that batch as an example. When this ratio is less than 5%, the corresponding initial sliding window and initial moving step size are 60*60 pixels and 2; when it is not less than 5%, the corresponding initial sliding window and initial moving step size are 30*30 pixels and 1.
[0075] From the above, it can be seen that by obtaining the first image to be identified from the multiple images to be identified contained in the current detection batch; performing template matching recognition based on the first sliding window and the first moving step on the first image to be identified, a defect detection result of the first image to be identified is obtained; when the defect detection result is that there is a defect, the location area of the defect is determined, and the corresponding area range calibration is performed based on the location area; for the remaining images to be identified in the current detection batch, the first template matching recognition of the first sliding window and the first moving step in the area where the area range calibration is located, and the second template matching recognition of the second sliding window and the second moving step in the area outside the area range calibration are performed to obtain the corresponding defect detection result, wherein the size of the second sliding window is larger than the size of the first sliding window, and the second moving step is larger than the first moving step, which solves the problems of low image processing efficiency and lack of dynamic optimization capability for batch image processing tasks in the prior art, and can adaptively adjust the image processing parameters of batch images to improve image processing efficiency and effect.
[0076] In one embodiment, before performing template matching recognition based on a first sliding window and a first moving step on a first image to be recognized, the method further includes: determining a target object area in the first image to be recognized; accordingly, performing template matching recognition based on the first sliding window and the first moving step on the first image to be recognized includes: performing template matching recognition based on the first sliding window and the first moving step on the target object area, and performing template matching recognition based on a fourth sliding window and a fourth moving step on an area outside the target object area, wherein the size of the fourth sliding window is larger than the size of the first sliding window, and the fourth moving step is larger than the first moving step. Exemplarily, the size of the fourth sliding window can be 60*60 pixels, and the fourth moving step can be 2. The target object area can be the area where the recognized product object is located, and the area outside the target area is the area of the image that does not contain the product object.
[0077] Figure 4 This is a structural block diagram of a batch image data processing system for an intelligent manufacturing production line provided by an embodiment of the present application. The system is configured to execute the batch image data processing method for an intelligent manufacturing production line provided by the above embodiment, and has the corresponding functional modules and beneficial effects of the execution method. Figure 4 As shown, the system includes:
[0078] An acquisition module 101 is configured to acquire a first image to be identified from a plurality of images to be identified in a current detection batch;
[0079] The recognition module 102 is configured to perform template matching recognition based on a first sliding window and a first moving step on the first image to be recognized, to obtain a defect detection result of the first image to be recognized;
[0080] The calibration module 103 is configured to determine a location area of the defect when the defect detection result indicates that a defect exists, and perform a corresponding area range calibration based on the location area;
[0081] The recognition module 102 is further used to perform first template matching and recognition between the first sliding window in the area where the area range is calibrated and the first moving step, and to perform second template matching and recognition between the second sliding window in the area outside the area range calibration and the second moving step, for the remaining images to be recognized in the current inspection batch, to obtain corresponding defect detection results, wherein the size of the second sliding window is larger than the size of the first sliding window, and the second moving step is larger than the first moving step.
[0082] In the above, the first image to be identified from the multiple images to be identified contained in the current detection batch is obtained; the first image to be identified is subjected to template matching recognition based on the first sliding window and the first moving step to obtain the defect detection result of the first image to be identified; when the defect detection result is that there is a defect, the location area of the defect is determined, and the corresponding area range calibration is performed based on the location area; for the remaining images to be identified in the current detection batch, the first template matching recognition of the first sliding window and the first moving step in the area where the area range calibration is located is performed, and the second template matching recognition of the second sliding window and the second moving step in the area outside the area range calibration is performed to obtain the corresponding defect detection result, wherein the size of the second sliding window is larger than the size of the first sliding window, and the second moving step is larger than the first moving step. This solves the problems of low image processing efficiency and lack of dynamic optimization capability for batch image processing tasks in the prior art, and can adaptively adjust the image processing parameters of batch images to improve image processing efficiency and effect.
[0083] In a possible embodiment, the identification module is further configured to:
[0084] After obtaining the defect detection result of the first image to be identified, if the defect detection result of the first image to be identified is that there is no defect, the remaining images to be identified in the current inspection batch are subjected to third template matching and recognition based on a third sliding window and a third moving step to obtain defect detection results corresponding to each image to be identified, where the size of the third sliding window is larger than the size of the first sliding window, and the third moving step is larger than the first moving step.
[0085] In a possible embodiment, the calibration module is specifically configured to:
[0086] Determining the location area and defect type of the defect;
[0087] A preset expansion range template is obtained according to the defect type, and the area range of the location area is calibrated based on the location area and the expansion range template.
[0088] In a possible embodiment, the calibration module is further configured to:
[0089] Before obtaining the preset expansion range template according to the defect type, different expansion range templates are set according to different defect types of the assembly line products, wherein the expansion range sizes of different expansion range templates are different.
[0090] In a possible embodiment, the identification module is further configured to:
[0091] Before matching and identifying the second template with the second moving step length and the second sliding window in the area outside the calibrated area range, determining the corresponding defect level according to the defect detection result, and obtaining the image attribute parameters of the image to be identified;
[0092] A second sliding window and a second moving step are determined according to the defect level and the image attribute parameter.
[0093] In a possible embodiment, the identification module is further configured to:
[0094] After obtaining the corresponding defect detection results, the number of batch images, as well as the corresponding initial sliding window and initial moving step are determined according to the defect detection results, so as to perform defect recognition of the images to be recognized based on the initial sliding window and the initial moving step when the number of images stored in the next batch reaches the number of batch images.
[0095] In a possible embodiment, the calibration module is further configured to:
[0096] Before performing template matching recognition based on the first sliding window and the first moving step on the first image to be recognized, determining a target object area in the first image to be recognized;
[0097] The identification module is specifically used to:
[0098] The target object area is subjected to template matching recognition based on a first sliding window and a first moving step, and the area outside the target object area is subjected to template matching recognition based on a fourth sliding window and a fourth moving step, wherein the size of the fourth sliding window is larger than the size of the first sliding window, and the fourth moving step is larger than the first moving step.
[0099] Figure 5 A schematic diagram of the structure of a batch image data processing device for an intelligent manufacturing production line provided in an embodiment of the present application is shown as follows: Figure 5 As shown, the device includes a processor 201, a memory 202, an input device 203 and an output device 204; the number of processors 201 in the device can be one or more. Figure 5 In the embodiment, a processor 201 is used as an example; the processor 201, the memory 202, the input device 203 and the output device 204 in the device can be connected by a bus or other means. Figure 5The example of the connection via bus is taken as an example. The memory 202, as a computer-readable storage medium, can be configured to store software programs, computer executable programs and modules, such as the program instructions / modules corresponding to the batch image data processing method for an intelligent manufacturing production line in the embodiment of the present application. The processor 201 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 202, that is, realizes the above-mentioned batch image data processing method for an intelligent manufacturing production line. The input device 203 can be configured to receive input digital or character information, and generate key signal input related to user settings and function control of the device. The output device 204 may include a display device such as a display screen.
[0100] An embodiment of the present application further provides a non-volatile storage medium containing computer-executable instructions. When executed by a computer processor, the computer-executable instructions are configured to perform a batch image data processing method for an intelligent manufacturing production line described in the above embodiment, which includes:
[0101] Obtaining a first image to be identified from a plurality of images to be identified included in a current detection batch;
[0102] Performing template matching recognition based on a first sliding window and a first moving step on the first image to be recognized, to obtain a defect detection result of the first image to be recognized;
[0103] If the defect detection result indicates that a defect exists, determining a location area of the defect, and performing a corresponding area range calibration based on the location area;
[0104] For the remaining images to be identified in the current inspection batch, the first sliding window in the area where the area range is calibrated and the first template matching and identification of the first moving step are performed, and the second sliding window in the area outside the area range calibration and the second template matching and identification of the second moving step are performed to obtain corresponding defect detection results, wherein the size of the second sliding window is larger than the size of the first sliding window, and the second moving step is larger than the first moving step.
[0105] It is worth noting that in the above-mentioned embodiment of the batch image data processing system for an intelligent manufacturing production line, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not configured to limit the scope of protection of the embodiments of this application.
[0106] In some possible implementations, various aspects of the methods provided herein may also be implemented in the form of a program product, which includes program code. When the program product is executed on a computer device, the program code is configured to cause the computer device to execute the steps of the methods according to the various exemplary embodiments of the present application described above in this specification. For example, the computer device may execute the batch image data processing method for an intelligent manufacturing production line described in the embodiments of the present application. The program product may be implemented using any combination of one or more readable media.
Claims
1. A batch image data processing method for an intelligent manufacturing production line, characterized in that: include: Obtaining a first image to be identified from a plurality of images to be identified included in a current detection batch; Performing template matching recognition based on a first sliding window and a first moving step on the first image to be recognized, to obtain a defect detection result of the first image to be recognized; If the defect detection result of the first image to be identified is that there is no defect, performing third template matching and recognition based on a third sliding window and a third moving step size on the remaining images to be identified in the current inspection batch to obtain defect detection results corresponding to the respective images to be identified, where the size of the third sliding window is larger than the size of the first sliding window, and the third moving step size is larger than the first moving step size; If the defect detection result indicates that a defect exists, determining a location area of the defect, and performing a corresponding area range calibration based on the location area; For the remaining images to be identified in the current inspection batch, the first sliding window in the area where the area range is calibrated and the first template matching and identification of the first moving step are performed, and the second sliding window in the area outside the area range calibration and the second template matching and identification of the second moving step are performed to obtain corresponding defect detection results, wherein the size of the second sliding window is larger than the size of the first sliding window, and the second moving step is larger than the first moving step.
2. The batch image data processing method for intelligent manufacturing production line according to claim 1, characterized in that: The determining of the location area of the defect and performing corresponding area range calibration based on the location area includes: Determining the location area and defect type of the defect; A preset expansion range template is obtained according to the defect type, and the area range of the location area is calibrated based on the location area and the expansion range template.
3. The batch image data processing method for intelligent manufacturing production line according to claim 2, characterized in that: Before obtaining a preset expansion range template according to the defect type, the method further includes: Different expansion range templates are set according to different defect types of assembly line products, wherein the expansion range sizes of different expansion range templates are different.
4. The batch image data processing method for an intelligent manufacturing production line according to any one of claims 1 to 3, characterized in that: Before the second sliding window in the area outside the calibrated area is matched and identified with the second template of the second moving step, the method further includes: Determining a corresponding defect level according to the defect detection result, and obtaining image attribute parameters of the image to be identified; A second sliding window and a second moving step are determined according to the defect level and the image attribute parameter.
5. The batch image data processing method for an intelligent manufacturing production line according to any one of claims 1 to 3, characterized in that: After obtaining the corresponding defect detection result, the method further includes: The number of batch images, as well as the corresponding initial sliding window and initial moving step are determined based on the defect detection results, so as to perform defect identification on the images to be identified based on the initial sliding window and the initial moving step when the number of images stored in the next batch reaches the number of batch images.
6. The batch image data processing method for an intelligent manufacturing production line according to any one of claims 1 to 3, characterized in that: Before performing template matching recognition based on the first sliding window and the first moving step on the first image to be recognized, the method further includes: Determining a target object area in the first image to be identified; Accordingly, performing template matching recognition on the first image to be recognized based on a first sliding window and a first moving step size includes: The target object area is subjected to template matching recognition based on a first sliding window and a first moving step, and the area outside the target object area is subjected to template matching recognition based on a fourth sliding window and a fourth moving step, wherein the size of the fourth sliding window is larger than the size of the first sliding window, and the fourth moving step is larger than the first moving step.
7. A batch image data processing system for intelligent manufacturing production line, characterized in that: include: An acquisition module, configured to acquire a first image to be identified from a plurality of images to be identified contained in a current detection batch; a recognition module configured to perform template matching recognition based on a first sliding window and a first moving step on the first image to be recognized to obtain a defect detection result for the first image to be recognized; the recognition module further configured to, if the defect detection result of the first image to be recognized is that no defects are present, perform third template matching recognition based on a third sliding window and a third moving step on the remaining images to be recognized in the current inspection batch to obtain defect detection results corresponding to the respective images to be recognized, wherein the size of the third sliding window is larger than the size of the first sliding window, and the third moving step is larger than the first moving step; a calibration module, configured to determine a location area of the defect when the defect detection result indicates that a defect exists, and perform a corresponding area range calibration based on the location area; The recognition module is further used to perform first template matching and recognition between the first sliding window in the area where the area range is calibrated and the first moving step, and to perform second template matching and recognition between the second sliding window in the area outside the area range calibration and the second moving step, for the remaining images to be recognized in the current inspection batch, to obtain corresponding defect detection results, wherein the size of the second sliding window is larger than the size of the first sliding window, and the second moving step is larger than the first moving step.
8. A batch image data processing device for intelligent manufacturing production line, characterized in that: The device includes: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the batch image data processing method for an intelligent manufacturing production line as described in any one of claims 1-6.
9. A storage medium storing computer executable instructions, characterized in that: When executed by a computer processor, the computer executable instructions are used to execute the batch image data processing method for an intelligent manufacturing production line according to any one of claims 1 to 6.
Citation Information
Patent Citations
Surface defect detection method and system, electronic equipment and storage medium
CN115063357A
Product surface defect detection method and device, storage medium and electronic equipment
CN117078665A