Feeding and discharging and workpiece reinspection cooperative control method and device and storage medium
By acquiring workpiece images using industrial cameras and performing binarization and region extraction, combined with dual-rectangle positioning and weighted fitting, the inefficiency and error problems caused by the traditional independent handling of loading and unloading and workpiece re-inspection are solved. This achieves efficient collaborative control of automated production lines, improving production efficiency and product quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN FAROAD INTELLIGENT EQUIP CO LTD
- Filing Date
- 2026-01-29
- Publication Date
- 2026-05-08
AI Technical Summary
Traditionally, loading and unloading and workpiece re-inspection are carried out independently on automated production lines, which limits production efficiency and easily introduces errors. It is difficult to adapt to different sizes and packaging types of boxes, the changeover time is long, and the reliance on manual inspection is inefficient and prone to missed or false inspections.
Workpiece images are acquired by industrial cameras, binarized and region extracted, and combined with double rectangle positioning and weighted fitting to calculate the workpiece deflection angle deviation. This enables coordinated control of loading and unloading and workpiece re-inspection, dynamic identification of material box size and real-time recording of workpiece information, and reduced manual intervention.
It improves production efficiency and product quality, reduces errors and rework rates, ensures that workpieces are properly processed before mounting, and significantly enhances the stability and reliability of the production line.
Smart Images

Figure CN121998960A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of workpiece processing technology, and in particular to a method, device and storage medium for coordinated control of loading / unloading and workpiece re-inspection. Background Technology
[0002] In SMT (Surface Mount Technology), a field of automated production involving workpiece handling, especially on automated production lines, material loading / unloading and workpiece inspection are two crucial steps. In traditional production processes, these are often performed as independent steps, which limits production efficiency and can introduce errors due to manual operation or coordination issues between equipment. With the development of intelligent manufacturing and industrial automation, achieving efficient and coordinated control of material loading / unloading and workpiece inspection has become a key issue for improving production efficiency and product quality. Summary of the Invention
[0003] The main objective of this application is to provide a method, device, and storage medium for coordinated control of loading / unloading and workpiece re-inspection, aiming to solve the technical problems of limited production efficiency and error introduction caused by the independent operation of loading / unloading and workpiece re-inspection in the prior art.
[0004] To achieve the above objectives, this application proposes a method for coordinated control of loading / unloading and workpiece re-inspection, the method comprising: Remove the workpiece to be mounted from the current effective layer of the target hopper and record the source information of the workpiece to be mounted, including the hopper name, layer number and position number in that layer; After the workpiece to be mounted is transferred to the mounting station, an image of the workpiece is captured by an industrial camera. The workpiece image is preprocessed to obtain a binarized image containing rectangular features; The region of interest is obtained by extracting the recognition region from the binarized image; The region of interest is located using a double rectangle to obtain a first local rectangle and a second local rectangle. A target rectangle representing the overall contour of the workpiece to be patched is obtained by performing a weighted fitting based on the first local rectangle and the second local rectangle. Calculate the deflection angle deviation of the target rectangle relative to the standard pose rectangle; The re-inspection result of the workpiece to be patched is determined based on the deflection angle deviation; The workpiece to be patched is processed based on the re-inspection results.
[0005] In one embodiment, the step of performing dual-rectangle localization on the region of interest to obtain a first local rectangle and a second local rectangle includes: Obtain the feature parameters of a preset local rectangle, wherein the feature parameters of the preset local rectangle include the aspect ratio range, area range, and edge gradient threshold of the preset local rectangle; Within the region of interest, candidate local rectangles are obtained by double-rectangle filtering using the feature parameters of the preset local rectangles; Determine whether the center line of the candidate local rectangles is parallel to the length direction of the workpiece to be patched; When the center line of the candidate local rectangles is parallel to the length direction of the workpiece to be patched, a first local rectangle and a second local rectangle are obtained through the candidate local rectangles.
[0006] In one embodiment, the step of obtaining a target rectangle characterizing the overall contour of the workpiece to be patched by performing a weighted fitting based on the first local rectangle and the second local rectangle includes: Obtain the center coordinates, length and width parameters, and rectangle type of the first and second local rectangles; Determine the first weight of the first local rectangle and the second weight of the second local rectangle according to the rectangle type; A target rectangle representing the overall contour of the workpiece to be patched is obtained by performing a weighted fitting based on the center coordinates of the local rectangle, the length and width parameters of the local rectangle, the first weight, and the second weight.
[0007] In one embodiment, the step of obtaining a target rectangle representing the overall contour of the workpiece to be patched by performing a weighted fitting based on the center coordinates of the local rectangle, the length and width parameters of the local rectangle, the first weight, and the second weight includes: Calculate the center coordinates of the target rectangle based on the center coordinates of the local rectangle, the first weight, and the second weight; Obtain the preset correction coefficient based on the workpiece specification settings; Calculate the Euclidean distance between the centers of the first local rectangle and the second local rectangle based on the center coordinates of the local rectangle; The length and width parameters of the target rectangle are calculated based on the length and width parameters of the local rectangle, the Euclidean distance, and the preset correction coefficient. Using the center coordinates as the origin and the line connecting the centers of the first local rectangle and the second local rectangle as the length direction, and combining the length and width parameters, a target rectangle representing the overall contour of the workpiece to be patched is obtained by fitting.
[0008] In one embodiment, the step of preprocessing the workpiece image to obtain a binarized image containing rectangular features includes: The workpiece image is converted to grayscale and white balance corrected to obtain a corrected grayscale image of the workpiece. Multi-scale filtering is performed on the grayscale image of the corrected workpiece to obtain a filtered grayscale image of the workpiece. A first threshold and a second threshold are obtained according to a preset edge detection algorithm, wherein the second threshold is greater than the first threshold; Edge detection and morphological closing operations are performed on the filtered workpiece grayscale image using the first threshold and the second threshold to obtain an edge detection image; The edge detection image is binarized to obtain a binarized image containing rectangular features.
[0009] In one embodiment, the step of calculating the deflection angle deviation of the target rectangle relative to the standard pose rectangle includes: Obtain the standard angle of the standard pose rectangle; The direction vector of the length direction of the target rectangle is obtained based on the target rectangle; Calculate the angle between the direction vector and the horizontal axis of the image coordinate system to obtain the deflection angle of the target rectangle; The deflection angle deviation of the target rectangle relative to the standard posture rectangle is calculated based on the standard angle and the deflection angle.
[0010] In one embodiment, the step of determining the re-inspection result of the workpiece to be patched based on the deflection angle deviation includes: The deflection angle deviation is compared with a preset deviation angle threshold. When the deflection angle deviation is less than or equal to the preset deviation angle threshold, the re-inspection result of the workpiece to be patched is determined to be that the posture of the workpiece to be patched is qualified. When the deflection angle deviation is greater than the preset deviation angle threshold, the re-inspection result of the workpiece to be patched is determined to be that the posture of the workpiece to be patched is unqualified.
[0011] In one embodiment, the step of processing the workpiece to be patched based on the re-inspection result includes: When the re-inspection result indicates that the orientation of the workpiece to be patched is unqualified, determine the cumulative number of re-inspection failures for the current layer of the current material box: When the cumulative number of failed re-inspections is less than a preset threshold, the loading and unloading mechanism is controlled to return or move the workpiece to be mounted to the buffer area for re-inspection. When the re-inspection result indicates that the orientation of the workpiece to be patched is qualified, the patching operation is performed on the workpiece to be patched.
[0012] Furthermore, to achieve the above objectives, this application also proposes a collaborative control device for loading / unloading and workpiece re-inspection, the collaborative control device comprising: The recording module is used to remove the workpiece to be mounted from the current effective layer of the target hopper and record the source information of the workpiece to be mounted, including the hopper name, layer number and position number in the layer; The acquisition module is used to acquire workpiece images of the workpiece to be mounted by an industrial camera after the workpiece is transported to the mounting station. The preprocessing module is used to preprocess the workpiece image to obtain a binarized image containing rectangular features; The extraction module is used to extract the recognition region from the binarized image to obtain the region of interest; The positioning module is used to perform dual-rectangle positioning on the region of interest to obtain a first local rectangle and a second local rectangle. The weighted fitting module is used to perform weighted fitting based on the first local rectangle and the second local rectangle to obtain a target rectangle that characterizes the overall contour of the workpiece to be patched. The calculation module is used to calculate the deflection angle deviation of the target rectangle relative to the standard posture rectangle; The determination module is used to determine the re-inspection result of the workpiece to be patched based on the deflection angle deviation; The processing module is used to process the workpiece to be patched based on the re-inspection results.
[0013] In addition, to achieve the above objectives, this application also proposes a collaborative control device for loading / unloading and workpiece re-inspection, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the collaborative control method for loading / unloading and workpiece re-inspection as described above.
[0014] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the above-described collaborative control method for loading / unloading and workpiece re-inspection.
[0015] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the above-described collaborative control method for loading / unloading and workpiece re-inspection.
[0016] One or more technical solutions proposed in this application have at least the following technical effects: 1) By using an industrial camera to acquire workpiece images and performing binarization and region extraction, the actual shape and position of the workpiece can be accurately identified. This significantly reduces errors that may be caused by manual inspection and improves the overall inspection accuracy and consistency. Through region extraction and dual-rectangle positioning of the binarized image, key feature points of the workpiece can be located more accurately, providing a reliable data foundation for subsequent weighted fitting and posture re-inspection. This precise positioning method effectively avoids the re-inspection failure problem caused by inaccurate positioning in traditional methods, improving the stability and reliability of the production line. By calculating the deviation angle between the target rectangle and the standard posture rectangle, the conformity of the workpiece can be evaluated in real time, ensuring that the workpiece receives appropriate processing before patching, thereby reducing rework and scrap rates.
[0017] 2) Through meticulous feature parameter selection, the chosen local rectangles accurately reflect the key features of the workpiece, providing a solid foundation for subsequent double-rectangle positioning and weighted fitting. By ensuring the parallelism between the center line of the candidate local rectangles and the length direction of the workpiece, the positioning accuracy is further improved, avoiding re-inspection errors caused by directional deviations. Thus, two local rectangles with significant features are extracted within the region of interest, achieving interference-resistant and precise positioning.
[0018] 3) When obtaining the target rectangle representing the overall contour of the workpiece to be patched by performing a weighted fitting based on the first and second local rectangles, the center coordinates, length and width parameters, and rectangle type of the local rectangles are comprehensively considered and different weights are assigned, making the fitting result closer to the actual contour of the workpiece. This weighted fitting method effectively overcomes the deviation that may be caused by single rectangle positioning and improves the accuracy and stability of overall contour recognition. Attached Figure Description
[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 A flowchart illustrating an embodiment of the collaborative control method for loading / unloading and workpiece re-inspection in this application; Figure 2 This is a flowchart illustrating Embodiment 2 of the collaborative control method for loading / unloading and workpiece re-inspection in this application. Figure 3A simplified flowchart illustrating the collaborative control method for loading / unloading and workpiece re-inspection provided in Embodiment 2 of this application; Figure 4 This is a schematic diagram of the module structure of the collaborative control device for loading / unloading and workpiece re-inspection in an embodiment of this application; Figure 5 This is a schematic diagram of the equipment structure of the hardware operating environment involved in the collaborative control method for loading / unloading and workpiece re-inspection in the embodiments of this application.
[0022] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0023] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0024] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0025] Because existing chip mounters require coordination with other material feeding equipment, delays or idle periods can easily occur. Traditional loading and unloading methods use fixed parameters, making it difficult to adapt to different sizes and packaging types of containers. When production orders change, manual readjustment of container parameters is required, resulting in long changeover times. Furthermore, traditional methods lack effective coordination between loading / unloading and workpiece inspection. Workpiece inspection relies mainly on manual visual inspection or simple mechanical checks, which is not only inefficient but also prone to missed or incorrect inspections.
[0026] This application provides a solution that tightly integrates the loading / unloading and workpiece re-inspection processes, achieving highly efficient collaborative operation on an automated production line. By introducing advanced image processing technology and intelligent algorithms, it achieves close collaboration between the loading / unloading and workpiece re-inspection processes, significantly improving production efficiency and product quality. First, a dynamic parameter configuration module automatically identifies the material box size and packaging type, enabling rapid line changeover without manual intervention and significantly shortening production preparation time. During loading / unloading, the system records the source information of each workpiece to be bonded in real time, ensuring accurate traceability in subsequent re-inspection stages. After acquiring workpiece images using an industrial camera, advanced image processing algorithms are used for binarization and region extraction to accurately identify the actual shape and position of the workpiece. Subsequently, the system performs dual-rectangle positioning on the region of interest, ensuring that the selected local rectangle accurately reflects the key features of the workpiece through refined feature parameter selection. In the weighted fitting stage, the center coordinates, length and width parameters, and rectangle type of the local rectangle are comprehensively considered and assigned different weights, making the fitting result closer to the actual contour of the workpiece. Finally, by calculating the deflection angle deviation between the target rectangle and the standard posture rectangle, the workpiece conformity is evaluated in real time, ensuring that the workpiece receives appropriate processing before bonding. This series of automated processes not only improves production efficiency, but also significantly enhances product quality and consistency.
[0027] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device capable of realizing the above functions, a material handling and workpiece re-inspection collaborative control device, etc. The following description uses a material handling and workpiece re-inspection collaborative control device as an example to illustrate this embodiment and the subsequent embodiments.
[0028] Based on this, embodiments of this application provide a method for coordinated control of loading / unloading and workpiece re-inspection, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the collaborative control method for loading / unloading and workpiece re-inspection of this application.
[0029] In this embodiment, the collaborative control method for loading / unloading and workpiece re-inspection includes steps S10 to S40: Step S10: Take the workpiece to be mounted from the current effective layer of the target material box and record the source information of the workpiece to be mounted. The source information includes the material box name, layer number and position number in the layer.
[0030] It should be noted that the target box is the box with the specified name determined by the current production work order, and the box is determined based on the specified box name.
[0031] In this embodiment, the name of the material box is used as a unique identifier to maintain information of different material boxes in a targeted manner. The sensor collects signals to determine whether the current layer is empty. If so, it automatically switches to the next layer or the next material box.
[0032] In specific implementation, the steps for determining the target material box include: establishing an electronic file for each type of material box, wherein the electronic file uses the material box name as a unique identifier and stores the size of the material box, the number of layers it can accommodate, and the number of workpieces that each layer can accommodate; in response to the current production work order, retrieving the target material box from the electronic file according to the specified material box name.
[0033] Understandably, establishing electronic files and storing relevant information about the material boxes enables quick and accurate location of the target material box, providing a foundation for subsequent loading and unloading operations. When removing the workpiece to be mounted, sensors monitor in real time whether the current layer is empty. If it is empty, the system automatically switches to the next layer or the next material box, ensuring the continuity and efficiency of the loading and unloading process. Simultaneously, the system records the source information of the workpiece to be mounted, including the material box name, layer number, and its position number within that layer, facilitating subsequent workpiece re-inspection and traceability.
[0034] The workpieces to be mounted can be various electronic components, precision parts, and other workpieces requiring mounting operations. In actual production scenarios, these workpieces are usually stored in material boxes of different specifications. Due to differences in workpiece size, shape, and packaging methods, traditional loading, unloading, and re-inspection methods are difficult to handle efficiently and accurately. In industrial re-inspection scenarios, rectangular features are the core identification identifier of the workpiece, and their position and orientation parameters directly determine the validity of the re-inspection results. Existing rectangle recognition algorithms are mostly based on traditional edge detection and contour fitting techniques, which have significant limitations in complex industrial environments. When the background has complex textures, uneven lighting, or the workpiece surface has stains or reflections, traditional edge detection algorithms easily extract a large number of interfering edges, leading to contour screening failure and a significant decrease in rectangle positioning accuracy. Therefore, this embodiment proposes an anti-interference fitting rectangle re-inspection and recognition algorithm. It replaces overall contour recognition with local dual-rectangle feature positioning, combines a weighted fitting algorithm to generate a precise large rectangle, and achieves accurate calculation of the deflection angle through edge line fitting, thereby accurately identifying the rectangular features of the workpiece and effectively solving the problem of difficult rectangle positioning in complex backgrounds.
[0035] Step S20: After the workpiece to be mounted is transferred to the mounting station, the workpiece image is captured by an industrial camera.
[0036] It should be noted that after the workpiece to be mounted is removed from the target hopper, it is precisely transported to the mounting station via a conveyor. By capturing images of the workpiece using an industrial camera, the actual shape and position information of the workpiece can be obtained, providing basic data for subsequent image processing and analysis. Specifically, a 5-megapixel industrial camera with a resolution of 2448×2042 and a frame rate ≥30fps can be used. The lens should be a 30mm industrial fixed-focus lens with a focal length of 8~25mm. The working distance can also be adjusted according to the size of the workpiece to be mounted to ensure complete imaging of rectangular features.
[0037] Step S30: Preprocess the workpiece image to obtain a binarized image containing rectangular features.
[0038] It should be noted that the preprocessing steps include grayscale conversion, white balance correction, multi-scale filtering, edge detection, and morphological closing operations, which aim to eliminate noise and interference in the image, enhance the contrast between the rectangular features of the workpiece and the background, and improve the image clarity and contrast.
[0039] In one feasible implementation, step S30 may include steps A11 to A15: Step A11: Perform grayscale conversion and white balance correction on the workpiece image to obtain a corrected grayscale image of the workpiece; It should be noted that the workpiece image can be converted to grayscale and white balance corrected first. Grayscale conversion involves converting the color image of the workpiece into a grayscale image. The specific conversion formula is as follows: In the above formula, Igray ( x , y ) represents the grayscale image at coordinates ( x , y The grayscale value at ) R ( x , y ), G ( x , y ), B ( x , y ) respectively represent the color image at coordinates ( x , y The component values of the red, green, and blue channels at point ).
[0040] White balance correction aims to eliminate color casts in images caused by variations in light source color temperature, ensuring consistency of grayscale values across different areas and thus improving image quality. By converting the workpiece image to grayscale and performing white balance correction, a corrected grayscale image of the workpiece is ultimately obtained.
[0041] Step A12: Perform multi-scale filtering on the grayscale image of the corrected workpiece to obtain a filtered grayscale image of the workpiece; It should be noted that multi-scale filtering uses filters of different scales to filter the image in order to remove noise. Specifically, a combination strategy of Gaussian filtering and median filtering can be used. First, a 5×5 kernel Gaussian filter is used to eliminate high-frequency noise in the grayscale image of the workpiece. Then, a 3×3 kernel median filter is used to eliminate salt and pepper noise and background texture interference, while preserving the sharpness of the rectangular edges, and finally obtaining the filtered grayscale image of the workpiece.
[0042] Step A13: Obtain a first threshold and a second threshold according to a preset edge detection algorithm, wherein the second threshold is greater than the first threshold; In specific implementation, the preset edge detection algorithm is the improved Canny edge detection algorithm. In this embodiment, the improved Canny edge detection algorithm uses two thresholds for edge detection. For example, the first threshold is a low threshold, set to 40, and the second threshold is a high threshold, set to 120.
[0043] Step A14: Perform edge detection and morphological closing operation on the filtered workpiece grayscale image using the first threshold and the second threshold to obtain an edge detection image; Understandably, the gradient magnitude of the filtered workpiece grayscale image can be calculated first, for each pixel ( x , y ), calculate the gradient in the X direction Gx gradient in the Y direction Gy The gradient magnitude is calculated as follows: In the above formula, This represents the gradient magnitude.
[0044] In practice, pixels with a gradient magnitude ≥ 120 can be marked as strong edges and directly retained as edge candidate points. Pixels with a gradient magnitude between 40 and 120 are marked as weak edges, and further verification is needed to determine whether they are connected to strong edges. For weak edge pixels, 8-neighborhood connectivity analysis is used. If a weak edge pixel has a connected path with a strong edge pixel, it is upgraded to a strong edge; otherwise, it is judged as a noise edge and removed. Finally, connected regions are obtained, and then morphological closing operations are performed on the connected regions, i.e., dilation followed by erosion, to connect the broken rectangular edges, thereby obtaining the edge detection image.
[0045] Step A15: Binarize the edge detection image to obtain a binarized image containing rectangular features.
[0046] It is understandable that the edge detection image can be binarized. Specifically, an adaptive threshold segmentation algorithm, namely the Otsu algorithm, can be used to achieve preliminary segmentation of the workpiece area and the background. Gray-level statistics are performed on the edge detection image to generate a gray-level histogram of 0 to 255 levels. Then, a threshold of t is set to divide the gray-level histogram into foreground and background categories. The proportion of foreground pixels, the proportion of background pixels, the mean gray level of the foreground, and the mean gray level of the background are calculated. Based on the proportion of foreground pixels, the proportion of background pixels, the mean gray level of the foreground, and the mean gray level of the background, the total mean gray level and the inter-class variance are calculated. Iterating through t∈[0, 255], the value of t that maximizes the inter-class variance is found as the optimal segmentation threshold. Then, pixels with gray levels greater than or equal to the optimal segmentation threshold are set to 255, i.e., white, representing the rectangular area of the workpiece, and pixels with gray levels less than the optimal segmentation threshold are set to 0, i.e., black, representing the background area, thus obtaining a binarized image containing rectangular features.
[0047] Step S40: Extract the region of interest from the binarized image.
[0048] It should be noted that region of interest (ROI) extraction can be performed on a binarized image to narrow down the recognition range, reduce background interference, and obtain the ROI.
[0049] In one feasible implementation, the binarized image can first be coarsely located for the Region of Interest (ROI) based on prior knowledge. The initial coordinate range of the ROI is then determined by the preset placement area of the workpiece to be patched on the re-inspection platform. x roi1 , y roi1 , x roi2 , y roi2 The process involves processing only the binarized image within the specified region to remove a large amount of background interference, resulting in a coarse positioning image. Then, the coarse positioning image is used for ROI fine positioning based on contour area. Contours are extracted from the coarse positioning image, and the area of all contours is calculated. Contours with areas within a preset threshold range are selected. This threshold is set based on the minimum and maximum area of the rectangle of the workpiece to be patched. The minimum bounding rectangle of the selected contours is used as the final ROI region to ensure that the ROI region accurately covers the rectangular features of the workpiece to be patched.
[0050] Step S50: Perform double rectangle positioning on the region of interest to obtain a first local rectangle and a second local rectangle.
[0051] It should be noted that dual-rectangle positioning involves extracting two local rectangles with significant features within the region of interest, namely the first local rectangle and the second local rectangle, such as the positioning hole edge rectangle, the marking frame rectangle, and the corner reinforcement rectangle of the workpiece to be patched, thereby achieving anti-interference and precise positioning.
[0052] Step S60: Perform a weighted fitting based on the first local rectangle and the second local rectangle to obtain a target rectangle that characterizes the overall contour of the workpiece to be patched.
[0053] In practical implementation, a weighted fitting algorithm can be used to generate the overall large rectangle of the workpiece from the first and second local rectangles. This target rectangle represents the overall contour of the workpiece to be patched, thus solving the fitting deviation problem caused by local deformation or damage. For example, weights can be set for the two local rectangles, and the feature parameters of the two local rectangles can be calculated using these weights to finally fit the target rectangle.
[0054] Step S70: Calculate the deflection angle deviation of the target rectangle relative to the standard posture rectangle.
[0055] It should be noted that the standard posture rectangle is a preset standard rectangle of the workpiece to be patched. The standard parameters of the standard posture rectangle can be obtained, thereby calculating the deflection angle deviation of the identified target rectangle relative to the standard posture rectangle, thus achieving accurate posture determination.
[0056] In one feasible implementation, step S70 may include steps A21 to A24: Step A21: Obtain the standard angle of the standard pose rectangle; It should be noted that the standard parameters of the standard pose rectangle include the standard center coordinates O0(x0, y0), standard length L0, standard width W0, standard angle θ0, and standard direction. The standard direction is parallel to the horizontal axis X of the image coordinate system, and the standard angle θ0 is usually 0°.
[0057] Step A22: Obtain the direction vector of the length direction of the target rectangle based on the target rectangle; In practical implementation, the direction vector along the length of the target rectangle can be obtained, denoted as: v =( x 2 x 1, y 2 y 1).
[0058] Step A23: Calculate the angle between the direction vector and the horizontal axis of the image coordinate system to obtain the deflection angle of the target rectangle; Understandably, the angle between the direction vector and the x-axis of the image coordinate system can be calculated and used as the deflection angle of the target rectangle, as follows: In the above formula, The deflection angle of the target rectangle, ( ) are the center coordinates of the first local rectangle, ( () represents the center coordinates of the second local rectangle.
[0059] Step A24: Calculate the deflection angle deviation of the target rectangle relative to the standard posture rectangle based on the standard angle and the deflection angle.
[0060] In practical implementation, the deflection angle deviation of the target rectangle relative to the standard posture rectangle can be calculated based on the standard angle and the deflection angle, as shown in the following formula: In the above formula, This refers to the deviation in deflection angle.
[0061] Step S80: Determine the re-inspection result of the workpiece to be patched based on the deflection angle deviation.
[0062] In practice, the deviation angle can be compared with the preset maximum allowable deviation angle to obtain the re-inspection result of the workpiece to be mounted. The re-inspection result can be that the posture of the workpiece to be mounted is qualified or unqualified.
[0063] In one feasible implementation, step S80 may include steps A31 to A33: Step A31: Compare the deflection angle deviation with a preset deviation angle threshold; It should be noted that the preset deviation angle threshold is the maximum allowable deviation angle set in advance. The deflection angle deviation can be compared with the preset deviation angle threshold to determine the re-inspection result of the workpiece to be patched.
[0064] Step A32: When the deflection angle deviation is less than or equal to the preset deviation angle threshold, the re-inspection result of the workpiece to be patched is determined to be that the posture of the workpiece to be patched is qualified; In practice, if the deflection angle deviation is less than or equal to the preset deviation angle threshold, it indicates that the posture of the workpiece to be patched is qualified.
[0065] Step A33: When the deflection angle deviation is greater than the preset deviation angle threshold, the re-inspection result of the workpiece to be patched is determined to be that the posture of the workpiece to be patched is unqualified.
[0066] It should be noted that if the deflection angle deviation is greater than the preset deviation angle threshold, it indicates that the posture of the workpiece to be patched is qualified.
[0067] Step S90: Process the workpiece to be patched according to the re-inspection results.
[0068] In practice, information such as the center coordinates, length and width parameters, deflection angle, and deflection angle deviation of the target rectangle can be output, and the re-inspection results can be output to the production line PLC. Based on different re-inspection results, corresponding processing is performed on the workpiece to be mounted. For example, if the re-inspection result indicates that the posture of the workpiece to be mounted is unqualified, the standard deviation angle value is calculated, and the re-inspection image and data are stored, determining whether to re-inspect.
[0069] In one feasible implementation, step S90 may include steps A41-A43: Step A41: When the re-inspection result indicates that the orientation of the workpiece to be mounted is unqualified, determine the cumulative number of re-inspection failures for the current layer of the current material box: It should be noted that when the re-inspection results show that the orientation of the workpiece to be mounted is unqualified, the cumulative number of re-inspection failures for the current layer of the current material box must be immediately calculated. This data is collected in real time by the production line PLC and synchronized to the control system database, providing a basis for subsequent quality traceability. The system will retrieve the historical re-inspection records of the material box, add the current failure count to the existing records, and generate a complete data chain containing timestamps, workpiece numbers, and reasons for failure.
[0070] Step A42: When the cumulative number of failed re-inspections is less than a preset threshold, control the loading and unloading mechanism to return or move the workpiece to be mounted to the buffer area for re-inspection. If the cumulative number of failed re-inspections does not reach the preset threshold, the specific deviation angle is recorded, such as... θ=2.3° and the workpiece position coordinates provide precise data support for production line adjustments. The loading and unloading mechanisms control the workpiece to return or move it to the buffer area, and attempt to retrieve it again from the same layer or fine-tune the retrieval position before sending it back for re-inspection. If the cumulative number of failures reaches a preset threshold, such as 3 times, an early warning mechanism is triggered, automatically marking the material box as abnormal and pushing the information to the quality control terminal.
[0071] Step A43: When the re-inspection result shows that the posture of the workpiece to be patched is qualified, perform the patching operation on the workpiece to be patched.
[0072] It should be noted that when the re-inspection results show that the orientation of the workpiece to be placed is qualified, the system immediately generates an electronic tag containing the target rectangle parameters and synchronizes the data to the pick-and-place machine control system via industrial Ethernet. The pick-and-place machine adjusts the movement trajectory of the robotic arm according to the received coordinate information, and automatically rotates the placement head according to the deflection angle parameters to make the component pins completely aligned with the PCB pads, and performs the placement operation on the workpiece to be placed.
[0073] This embodiment provides a collaborative control method for loading / unloading and workpiece re-inspection. By using an industrial camera to acquire workpiece images and performing binarization processing and region extraction, the actual shape and position of the workpiece can be accurately identified. This significantly reduces errors that may be caused by manual inspection and improves the overall inspection accuracy and consistency. By performing region extraction and dual-rectangle positioning on the binarized image, key feature points of the workpiece can be located more accurately, providing a reliable data foundation for subsequent weighted fitting and posture re-inspection. This precise positioning method effectively avoids the re-inspection failure problem caused by inaccurate positioning in traditional methods, improving the stability and reliability of the production line. By calculating the deviation angle between the target rectangle and the standard posture rectangle, the conformity of the workpiece can be evaluated in real time, ensuring that the workpiece is properly processed before patching, thereby reducing rework and scrap rates.
[0074] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 2 Step S50 includes steps S501 to S504: Step S501: Obtain the feature parameters of a preset local rectangle, wherein the feature parameters of the preset local rectangle include the aspect ratio range, area range, and edge gradient threshold of the preset local rectangle.
[0075] It should be noted that local rectangle feature filtering rules can be defined in advance, such as setting preset feature parameters for local rectangles, specifically including the preset aspect ratio range of local rectangles. m 1, m 2] Area range S 1, S 2] Edge gradient threshold T g wait.
[0076] Step S502: Within the region of interest, perform double rectangle filtering using the feature parameters of the preset local rectangle to obtain candidate local rectangles.
[0077] Understandably, within the region of interest, rectangular outlines that meet the preset feature parameters of local rectangles can be selected, thereby eliminating false rectangles formed by background interference and obtaining candidate local rectangles.
[0078] Step S503: Determine whether the center line of the candidate local rectangle is parallel to the length direction of the workpiece to be patched.
[0079] In practice, the candidate local rectangles can be verified to ensure that the line connecting the centers of the two local rectangles is parallel to the length direction of the workpiece to be patched. Therefore, the centers of the candidate local rectangles can be connected to determine whether the line connecting the centers is parallel to the length direction of the workpiece to be patched.
[0080] Step S504: When the center line of the candidate local rectangles is parallel to the length direction of the workpiece to be patched, a first local rectangle and a second local rectangle are obtained through the candidate local rectangles.
[0081] It should be noted that if the center line of the candidate local rectangles is parallel to the length direction of the workpiece to be mounted, the candidate local rectangle can be retained to obtain the first local rectangle and the second local rectangle. If the center line of the candidate local rectangles is not parallel to the length direction of the workpiece to be mounted, the selection process can be repeated until the center line of the candidate local rectangles is parallel to the length direction of the workpiece to be mounted.
[0082] This embodiment, through meticulous feature parameter selection, ensures that the selected local rectangles accurately reflect the key features of the workpiece, providing a solid foundation for subsequent double-rectangle positioning and weighted fitting. By determining the parallelism between the center line of the candidate local rectangles and the length direction of the workpiece, the positioning accuracy is further improved, avoiding re-inspection errors caused by directional deviations. Thus, two local rectangles with significant features are extracted within the region of interest, achieving interference-resistant and precise positioning.
[0083] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 3 Step S60 includes steps S601 to S603: Step S601: Obtain the center coordinates of the local rectangles of the first local rectangle and the second local rectangle, the length and width parameters of the local rectangles, and the rectangle type.
[0084] It should be noted that after obtaining two local rectangles with significant features, the coordinates O1 of the center of the first and second local rectangles can be extracted. x 1, y 1) O2 ( x 2, y 2) and the length and width parameters of the two local rectangles. l 1× w 1 and l 2× w2. Rectangular types can include positioning hole edge rectangles, label frame rectangles, and corner reinforced rectangles, etc.
[0085] Step S602: Determine the first weight of the first local rectangle and the second weight of the second local rectangle according to the rectangle type.
[0086] In practical implementation, the feature stability of local rectangles can be determined according to the rectangle type, and corresponding weights can be assigned based on the feature stability of local rectangles. The sum of the first weight and the second weight satisfies the following condition. a 1+ a 2 = 1.
[0087] Specifically, if the first local rectangle is the rectangle of the positioning hole edge, and has high feature stability, then the first weight can be assigned. a 1 = 0.6. If the second local rectangle is the marker rectangle, and the feature stability is second best, then a second weight can be assigned. a 2 = 0.4.
[0088] Step S603: Based on the center coordinates of the local rectangle, the length and width parameters of the local rectangle, the first weight, and the second weight, a weighted fitting is performed to obtain a target rectangle that represents the overall contour of the workpiece to be patched.
[0089] It should be noted that a large rectangle representing the overall contour of the workpiece to be patched can be obtained by weighted fitting based on the center coordinates of the local rectangle, the length and width parameters of the local rectangle, the first weight, and the second weight.
[0090] In one feasible implementation, step S603 may include steps B11 to B15: Step B11: Calculate the center coordinates of the target rectangle based on the center coordinates of the local rectangle, the first weight, and the second weight; It is understandable that the coordinates of the center of the local rectangle O( x c , y c The center coordinates of the target rectangle are calculated using the weights set, as shown in the following formula: In the above formula, As the first weight, Second weight, O1( x 1, y 1) and O2 ( x 2, y 2) These are the coordinates of the center of the local rectangle.
[0091] Step B12: Obtain the preset correction coefficient based on the workpiece specification settings; In practice, the preset correction coefficients are pre-set based on the workpiece rules, and the preset correction coefficients include... k 1 and k 2.
[0092] Step B13: Calculate the Euclidean distance between the centers of the first local rectangle and the second local rectangle based on the center coordinates of the local rectangles; It is understandable that the Euclidean distance between the centers of the first and second local rectangles can be calculated based on the coordinates of their respective centers, and expressed as: D 12 .
[0093] Step B14: Calculate the length and width parameters of the target rectangle based on the length and width parameters of the local rectangle, the Euclidean distance, and the preset correction coefficient; In practical implementation, the length and width parameters of the target rectangle can be calculated based on the length and width parameters of the local rectangle, the Euclidean distance, and the preset correction coefficient, as shown in the following formula: The length and width parameters of the target rectangle can be calculated using the above formula. L and W .
[0094] Step B15: Using the center coordinates as the origin and the line connecting the centers of the first local rectangle and the second local rectangle as the length direction, and combining the length and width parameters, a target rectangle representing the overall contour of the workpiece to be patched is obtained.
[0095] In practical implementation, the center coordinates O of the target rectangle can be used. x c , y c Using the origin as the origin and the line connecting the centers of the two rectangles as the length direction, combined with the calculated length and width parameters... L and W The overall rectangular outline of the workpiece to be patched is fitted, and the edges of the rectangle are smoothed by a morphological optimization algorithm to obtain the final fitted rectangle, i.e., the target rectangle.
[0096] This embodiment uses a weighted fitting method based on a first local rectangle and a second local rectangle to obtain a target rectangle representing the overall contour of the workpiece to be patched. By comprehensively considering the center coordinates, length and width parameters, and rectangle type of the local rectangles and assigning different weights, the fitting result is made closer to the actual contour of the workpiece. This weighted fitting method effectively overcomes the deviation that may be caused by single rectangle positioning and improves the accuracy and stability of overall contour recognition.
[0097] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the collaborative control method for loading / unloading and workpiece re-inspection of this application. Any simple modifications based on this technical concept are within the protection scope of this application.
[0098] This application also provides a coordinated control device for loading / unloading and workpiece re-inspection. Please refer to [reference needed]. Figure 4 The loading / unloading and workpiece re-inspection coordinated control device includes: The recording module 10 is used to take out the workpiece to be mounted from the current effective layer of the target material box and record the source information of the workpiece to be mounted, including the material box name, layer number and position number in the layer; The acquisition module 20 is used to acquire workpiece images of the workpiece to be mounted by an industrial camera after the workpiece to be mounted is transferred to the mounting station. The preprocessing module 30 is used to preprocess the workpiece image to obtain a binarized image containing rectangular features; Extraction module 40 is used to extract the recognition region from the binarized image to obtain the region of interest; The positioning module 50 is used to perform dual-rectangle positioning on the region of interest to obtain a first local rectangle and a second local rectangle; The weighted fitting module 60 is used to perform weighted fitting based on the first local rectangle and the second local rectangle to obtain a target rectangle that characterizes the overall contour of the workpiece to be patched. The calculation module 70 is used to calculate the deflection angle deviation of the target rectangle relative to the standard posture rectangle; The determination module 80 is used to determine the re-inspection result of the workpiece to be patched based on the deflection angle deviation; The processing module 90 is used to process the workpiece to be patched based on the re-inspection results.
[0099] The material handling and workpiece re-inspection coordinated control device provided in this application, employing the material handling and workpiece re-inspection coordinated control method in the above embodiments, can solve the technical problems of limited production efficiency and error introduction caused by the independent operation of material handling and workpiece re-inspection in the prior art. Compared with the prior art, the beneficial effects of the material handling and workpiece re-inspection coordinated control device provided in this application are the same as those of the material handling and workpiece re-inspection coordinated control method provided in the above embodiments, and other technical features in the material handling and workpiece re-inspection coordinated control device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0100] This application provides a collaborative control device for loading / unloading and workpiece re-inspection. The collaborative control device for loading / unloading and workpiece re-inspection includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the collaborative control method for loading / unloading and workpiece re-inspection in the above embodiment 1.
[0101] The following is for reference. Figure 5 The diagram illustrates a structural schematic suitable for implementing a collaborative control device for loading / unloading and workpiece re-inspection in the embodiments of this application. The collaborative control device for loading / unloading and workpiece re-inspection in the embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), and vehicle terminals (e.g., vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 5 The illustrated material loading / unloading and workpiece re-inspection coordinated control device is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0102] like Figure 5As shown, the collaborative control device for loading / unloading and workpiece re-inspection may include a processing unit 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to the program stored in ROM (Read Only Memory) 1002 or the program loaded from storage device 1003 into RAM (Random Access Memory) 1004. RAM 1004 also stores various programs and data required for the operation of the collaborative control device for loading / unloading and workpiece re-inspection. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via bus 1005. Input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, LCDs (Liquid Crystal Displays), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the loading / unloading and workpiece inspection collaborative control equipment to exchange data wirelessly or via wired communication with other devices. Although the figure shows a loading / unloading and workpiece inspection collaborative control equipment with various systems, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems can be implemented alternatively.
[0103] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0104] The material handling and workpiece re-inspection coordinated control equipment provided in this application, employing the material handling and workpiece re-inspection coordinated control method described in the above embodiments, can solve the technical problems of limited production efficiency and error introduction caused by the independent operation of material handling and workpiece re-inspection in the prior art. Compared with the prior art, the beneficial effects of the material handling and workpiece re-inspection coordinated control equipment provided in this application are the same as those of the material handling and workpiece re-inspection coordinated control method provided in the above embodiments, and other technical features of this material handling and workpiece re-inspection coordinated control equipment are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0105] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0106] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0107] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, which are used to execute the material loading / unloading and workpiece re-inspection collaborative control method in the above embodiments.
[0108] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, RAM (Random Access Memory), ROM (Read Only Memory), EPROM (Erasable Programmable Read Only Memory or Flash Memory), optical fibers, CD-ROM (CD-Read Only Memory), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0109] The aforementioned computer-readable storage medium may be included in the collaborative control equipment for loading / unloading and workpiece re-inspection; or it may exist independently and not be assembled into the collaborative control equipment for loading / unloading and workpiece re-inspection.
[0110] The aforementioned computer-readable storage medium carries one or more programs. When these programs are executed by the material handling and workpiece re-inspection collaborative control equipment, the equipment performs the following actions: It retrieves the workpiece to be mounted from the current effective layer of the target material box and records the source information of the workpiece, including the material box name, layer number, and position number within that layer; after transferring the workpiece to be mounted to the mounting station, it acquires a workpiece image of the workpiece using an industrial camera; it preprocesses the workpiece image to obtain a binarized image containing rectangular features; it extracts the region of interest from the binarized image; it performs dual-rectangle positioning on the region of interest to obtain a first local rectangle and a second local rectangle; it performs weighted fitting based on the first local rectangle and the second local rectangle to obtain a target rectangle representing the overall contour of the workpiece to be mounted; it calculates the deflection angle deviation of the target rectangle relative to a standard posture rectangle; it determines the re-inspection result of the workpiece to be mounted based on the deflection angle deviation; and it processes the workpiece to be mounted based on the re-inspection result.
[0111] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including LAN (Local Area Network) or WAN (Wide Area Network)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0112] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0113] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0114] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described coordinated control method for loading / unloading and workpiece re-inspection. This solves the technical problems of limited production efficiency and error introduction caused by the independent execution of loading / unloading and workpiece re-inspection in the prior art. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the coordinated control method for loading / unloading and workpiece re-inspection provided in the above embodiments, and will not be repeated here.
[0115] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described collaborative control method for loading / unloading and workpiece re-inspection.
[0116] The computer program product provided in this application can solve the technical problems of limited production efficiency and error introduction caused by the independent operation of loading / unloading and workpiece re-inspection in the prior art. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as the beneficial effects of the collaborative control method for loading / unloading and workpiece re-inspection provided in the above embodiments, and will not be repeated here.
[0117] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A method for coordinated control of loading / unloading and workpiece re-inspection, characterized in that, The method for coordinated control of loading / unloading and workpiece re-inspection includes: Remove the workpiece to be mounted from the current effective layer of the target hopper and record the source information of the workpiece to be mounted, including the hopper name, layer number and position number in that layer; After the workpiece to be mounted is transferred to the mounting station, an image of the workpiece is captured by an industrial camera. The workpiece image is preprocessed to obtain a binarized image containing rectangular features; The region of interest is obtained by extracting the recognition region from the binarized image; The region of interest is located using a double rectangle to obtain a first local rectangle and a second local rectangle. A target rectangle representing the overall contour of the workpiece to be patched is obtained by performing a weighted fitting based on the first local rectangle and the second local rectangle. Calculate the deflection angle deviation of the target rectangle relative to the standard pose rectangle; The re-inspection result of the workpiece to be patched is determined based on the deflection angle deviation; The workpiece to be patched is processed based on the re-inspection results.
2. The method as described in claim 1, characterized in that, The step of performing dual-rectangle localization on the region of interest to obtain a first local rectangle and a second local rectangle includes: Obtain the feature parameters of a preset local rectangle, wherein the feature parameters of the preset local rectangle include the aspect ratio range, area range, and edge gradient threshold of the preset local rectangle; Within the region of interest, candidate local rectangles are obtained by double-rectangle filtering using the feature parameters of the preset local rectangles; Determine whether the center line of the candidate local rectangles is parallel to the length direction of the workpiece to be patched; When the center line of the candidate local rectangles is parallel to the length direction of the workpiece to be patched, a first local rectangle and a second local rectangle are obtained through the candidate local rectangles.
3. The method as described in claim 1, characterized in that, The step of obtaining a target rectangle representing the overall contour of the workpiece to be patched by performing a weighted fitting based on the first local rectangle and the second local rectangle includes: Obtain the center coordinates, length and width parameters, and rectangle type of the first and second local rectangles; Determine the first weight of the first local rectangle and the second weight of the second local rectangle according to the rectangle type; Based on the center coordinates of the local rectangle, the length and width parameters of the local rectangle, the first weight, and the second weight, a weighted fitting is performed to obtain a target rectangle that represents the overall contour of the workpiece to be patched.
4. The method as described in claim 3, characterized in that, The step of obtaining a target rectangle representing the overall contour of the workpiece to be patched by performing a weighted fitting based on the center coordinates of the local rectangle, the length and width parameters of the local rectangle, the first weight, and the second weight includes: Calculate the center coordinates of the target rectangle based on the center coordinates of the local rectangle, the first weight, and the second weight; Obtain the preset correction coefficient based on the workpiece specification settings; Calculate the Euclidean distance between the centers of the first local rectangle and the second local rectangle based on the center coordinates of the local rectangle; The length and width parameters of the target rectangle are calculated based on the length and width parameters of the local rectangle, the Euclidean distance, and the preset correction coefficient. Using the center coordinates as the origin and the line connecting the centers of the first local rectangle and the second local rectangle as the length direction, and combining the length and width parameters, a target rectangle representing the overall contour of the workpiece to be patched is obtained by fitting.
5. The method as described in claim 1, characterized in that, The step of preprocessing the workpiece image to obtain a binarized image containing rectangular features includes: The workpiece image is converted to grayscale and white balance corrected to obtain a corrected grayscale image of the workpiece. Multi-scale filtering is performed on the grayscale image of the corrected workpiece to obtain a filtered grayscale image of the workpiece. A first threshold and a second threshold are obtained according to a preset edge detection algorithm, wherein the second threshold is greater than the first threshold; Edge detection and morphological closing operations are performed on the filtered workpiece grayscale image using the first threshold and the second threshold to obtain an edge detection image; The edge detection image is binarized to obtain a binarized image containing rectangular features.
6. The method as described in claim 1, characterized in that, The step of calculating the deflection angle deviation of the target rectangle relative to the standard pose rectangle includes: Obtain the standard angle of the standard pose rectangle; The direction vector of the length direction of the target rectangle is obtained based on the target rectangle; Calculate the angle between the direction vector and the horizontal axis of the image coordinate system to obtain the deflection angle of the target rectangle; The deflection angle deviation of the target rectangle relative to the standard posture rectangle is calculated based on the standard angle and the deflection angle.
7. The method as described in claim 1, characterized in that, The step of determining the re-inspection result of the workpiece to be patched based on the deflection angle deviation includes: The deflection angle deviation is compared with a preset deviation angle threshold. When the deflection angle deviation is less than or equal to the preset deviation angle threshold, the re-inspection result of the workpiece to be patched is determined to be that the posture of the workpiece to be patched is qualified. When the deflection angle deviation is greater than the preset deviation angle threshold, the re-inspection result of the workpiece to be patched is determined to be that the posture of the workpiece to be patched is unqualified.
8. The method as described in claim 1, characterized in that, The step of processing the workpiece to be patched based on the re-inspection results includes: When the re-inspection result indicates that the orientation of the workpiece to be patched is unqualified, determine the cumulative number of re-inspection failures for the current layer of the current material box: When the cumulative number of failed re-inspections is less than a preset threshold, the loading and unloading mechanism is controlled to return or move the workpiece to be mounted to the buffer area for re-inspection. When the re-inspection result indicates that the orientation of the workpiece to be patched is qualified, the patching operation is performed on the workpiece to be patched.
9. A collaborative control device for loading / unloading and workpiece re-inspection, characterized in that, The device includes: The recording module is used to remove the workpiece to be mounted from the current effective layer of the target hopper and record the source information of the workpiece to be mounted, including the hopper name, layer number and position number in the layer; The acquisition module is used to acquire workpiece images of the workpiece to be mounted by an industrial camera after the workpiece is transported to the mounting station. The preprocessing module is used to preprocess the workpiece image to obtain a binarized image containing rectangular features; The extraction module is used to extract the recognition region from the binarized image to obtain the region of interest; The positioning module is used to perform dual-rectangle positioning on the region of interest to obtain a first local rectangle and a second local rectangle. The weighted fitting module is used to perform weighted fitting based on the first local rectangle and the second local rectangle to obtain a target rectangle that characterizes the overall contour of the workpiece to be patched. The calculation module is used to calculate the deflection angle deviation of the target rectangle relative to the standard posture rectangle; The determination module is used to determine the re-inspection result of the workpiece to be patched based on the deflection angle deviation; The processing module is used to process the workpiece to be patched based on the re-inspection results.
10. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the collaborative control method for loading / unloading and workpiece re-inspection as described in any one of claims 1 to 8.