Detection method, electronic device and computer readable storage medium
By setting feature points not covered by the adapter plate on the cover plate and using multi-camera stitching technology, the problem of inaccurate detection caused by the occlusion of the cover plate edge is solved, and high-precision detection of the positional offset between the adapter plate and the cover plate is achieved.
Patent Information
- Application Number
- CN202180064672.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-14
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2041-09-14
AI Technical Summary
In the detection of positional offset between the adapter plate and the cover plate, the existing technology has low accuracy in detecting positional offset because the edge of the cover plate is easily obscured.
By setting preset feature points in non-edge areas not covered by the adapter plate on the cover plate, and combining the size of the cover plate with camera image processing technology, the position of the cover plate can be accurately obtained. Multi-camera stitching and light source optimization technology can be used to improve the coverage and clarity of the image.
This improves the accuracy of detecting the positional offset between the adapter plate and the cover plate, ensuring the precision and reliability of the detection results.
Smart Images

Figure CN116324864B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of detection technology, and in particular to a detection method, electronic device, and computer-readable storage medium. Background Technology
[0002] Adapter welding is a crucial step in the battery cell manufacturing process, serving to connect the cover plate and the cell. Offset detection between the adapter plate and the cover plate is an important post-welding inspection to confirm whether the positional offset between them meets standards.
[0003] The common method for detecting the offset between the adapter plate and the cover plate is to take an image of the adapter plate with a camera, and then capture the positions of the cover plate and the adapter plate in the image to calculate the positional offset between them. However, during the testing process, the edges of the cover plate are easily obstructed, such as by the battery cell, making it difficult to capture the accurate position of the cover plate in the image taken by the camera. This results in low accuracy of the detected positional offset between the cover plate and the adapter plate. Summary of the Invention
[0004] In view of the above problems, this application provides a detection method, electronic device and computer-readable storage medium that can improve the accuracy of the detected positional offset between the cover plate and the adapter plate.
[0005] In a first aspect, this application provides a detection method, comprising: receiving an image of a product to be tested, and detecting the position of a preset feature point on a cover plate based on the image; wherein the product to be tested includes: an adapter piece and a cover plate, the adapter piece being located on the cover plate and covering a portion of the cover plate, and the preset feature point being located on a non-edge area of the cover plate not covered by the adapter piece; obtaining the position of the cover plate in the image based on the position of the preset feature point and the size of the cover plate; obtaining the position of the adapter piece in the image based on the image; obtaining the actual position of the cover plate and the actual position of the adapter piece based on the position of the cover plate and the position of the adapter piece in the image; and detecting the positional offset between the cover plate and the adapter piece based on the actual position of the cover plate and the actual position of the adapter piece.
[0006] In the technical solution of this application embodiment, since the position of the cover plate in the image is obtained based on the detected position of preset feature points on the cover plate and the size of the cover plate, and the position of the preset feature points on the cover plate is located in the non-edge area of the cover plate not covered by the adapter piece, the position of the preset feature points on the cover plate in the image is not affected by the fact that the edge position of the cover plate is easily occluded. Therefore, the position of the cover plate in the image can be accurately obtained based on the position of the preset feature points on the cover plate and the size of the cover plate. Thus, the actual position of the cover plate can be accurately obtained based on the position of the cover plate in the image. Furthermore, based on the accurate actual position of the cover plate and the actual position of the adapter piece, the positional offset between the cover plate and the adapter piece can be accurately obtained, thereby improving the accuracy of the detected positional offset between the cover plate and the adapter piece.
[0007] In some embodiments, receiving an image of the product under test and detecting the position of a preset feature point on the cover plate based on the image includes: receiving a first image of the product under test captured by a first camera and receiving a second image of the product under test captured by a second camera; wherein the first field of view of the first camera and the second field of view of the second camera overlap, and the sum of the first field of view and the second field of view can fully cover the product under test; stitching the first image and the second image together to obtain a stitched image; and detecting the position of the preset feature point on the cover plate based on the stitched image.
[0008] In the technical solution of this application embodiment, a first camera and a second camera with overlapping fields of view are used to acquire images of the product under test. Since the sum of the first field of view of the first camera and the second field of view of the second camera can fully cover the product under test, stitching the first image acquired by the first camera and the second image acquired by the second camera is beneficial to obtaining a stitched image that can fully cover the product under test. That is, the stitched image can reflect the whole picture of the product under test. Based on the stitched image that can reflect the whole picture of the product under test, the position of the preset feature points on the cover plate can be detected more accurately, thereby obtaining the position of the cover plate in the image more accurately, so as to further improve the accuracy of the detected positional offset between the cover plate and the adapter piece.
[0009] In some embodiments, stitching the first image and the second image together to obtain a stitched image includes: transforming the pixel coordinates of the first image and the pixel coordinates of the second image to the same coordinate system to obtain the physical coordinates of the first image and the second image; determining the overlapping area of the first image and the second image based on the physical coordinates of the first image and the second image; and stitching the first image and the second image together based on the overlapping area to obtain a stitched image.
[0010] In the technical solution of this application embodiment, by converting both the first image and the second image into pixel coordinates and physical coordinates, the physical coordinates of the first image and the second image are obtained. This allows the overlapping area between the first image and the second image to be accurately obtained through the physical coordinates of the first image and the second image. This overlapping area serves as a reference for stitching the first image and the second image, which is beneficial for accurately and reasonably completing the stitching of the first image and the second image.
[0011] In some embodiments, receiving a first image of the product under test captured by a first camera and receiving a second image of the product under test captured by a second camera includes: receiving a first image of the product under test captured by the first camera under a first light source and a second light source, and receiving a second image of the product under test captured by the second camera under a first light source and a third light source; wherein the first light source is directly facing the product under test, the second light source and the third light source are respectively disposed at both ends of the first light source, the second light source is located at the upper left of the product under test, and the third light source is located at the upper right of the product under test.
[0012] In the technical solution of this application embodiment, the first light source is directly facing the product under test, which can illuminate the middle area of the product under test, making it easier to identify the features at the middle position of the product under test through the first image and the second image. The second light source and the third light source are respectively set at both ends of the first light source. The second light source is located at the upper left of the product under test, and the third light source is located at the upper right of the product under test. Thus, the second light source can illuminate the left side area of the product under test, and the third light source can illuminate the right side area of the product under test, making it easier to detect the features on both sides of the product under test through the first image and the second image, thereby improving the accuracy of the position of the adapter piece and the position of the cover plate in the obtained image.
[0013] In some embodiments, the first light source, the second light source, and the third light source are all strip light sources; the length direction of the first light source is in the same direction as the length direction of the product under test, the second light source is at a first preset angle to the first light source, and the third light source is at a second preset angle to the first light source.
[0014] In the technical solution of this application embodiment, the first, second, and third light sources are all strip light sources, suitable for large-format size inspection. Strip light sources have high illumination uniformity, high brightness, good heat dissipation, long service life, high stability, and simple installation. The angles between different strip light sources are flexibly adjustable. In this embodiment, the placement positions of the first, second, and third light sources and the angles between them allow the first, second, and third light sources to provide approximately circular illumination conditions, thereby illuminating the product under test from all directions. This helps the first and second cameras to capture clear and comprehensive images.
[0015] In some embodiments, the values of the first preset angle and the second preset angle range from 140° to 160°.
[0016] In the technical solution of this application embodiment, when the values of the first preset angle and the second preset angle are in the range of 140° to 160°, the approximately ring-shaped illumination conditions provided by the first light source, the second light source and the third light source have a better effect, which facilitates the acquisition of clear and comprehensive images of the product under test.
[0017] In some embodiments, the first light source, the second light source, and the third light source are all strobe light sources.
[0018] In the technical solution of this application embodiment, the first light source, the second light source and the third light source are all strobe light sources, which can improve the speed at which the first camera and the second camera acquire images, thereby improving the speed at which the positional offset between the cover plate and the adapter plate is detected.
[0019] In some embodiments, the preset feature point is located at the middle position on the cover plate.
[0020] In the technical solution of this application embodiment, the preset feature point is set at the middle position of the cover plate. The possibility of the middle position of the cover plate being obscured is extremely small. Therefore, the preset feature point in the middle of the cover plate is easier to detect from the image of the product under test. Moreover, compared with setting the preset feature point at other non-edge positions on the cover plate, the position of the cover plate in the image can be obtained more conveniently based on the position of the preset feature point in the middle of the cover plate and the size of the cover plate.
[0021] Secondly, this application provides an electronic device, including: 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, the instructions being executed by the at least one processor to enable the at least one processor to perform the detection method described above.
[0022] Thirdly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described detection method.
[0023] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description
[0024] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on the drawings without creative effort.
[0025] Figure 1 This is a top view of a product under test disclosed in some embodiments of this application;
[0026] Figure 2 This is a schematic flowchart of a detection method disclosed in some embodiments of this application;
[0027] Figure 3 This is a schematic diagram of simulating the position of a cover plate in an image based on the position of preset feature points in the image, as disclosed in some embodiments of this application.
[0028] Figure 4 This is a schematic diagram of another method disclosed in some embodiments of this application, which simulates the position of the cover plate in the image based on the position of preset feature points in the image.
[0029] Figure 5 This is a flowchart illustrating the implementation of step 201 disclosed in some embodiments of this application;
[0030] Figure 6 This is a schematic diagram of obtaining a stitched image by stitching together a first image and a second image, as disclosed in some embodiments of this application;
[0031] Figure 7 This is a flowchart illustrating the implementation of step 502 disclosed in some embodiments of this application;
[0032] Figure 8 This is a schematic diagram showing the positional relationship between the first camera, second camera, first light source, second light source, third light source, and the product under test disclosed in some embodiments of this application;
[0033] Figure 9 This is a schematic flowchart of another detection method disclosed in some embodiments of this application;
[0034] Figure 10 These are schematic diagrams of the structure of electronic devices disclosed in some embodiments of this application;
[0035] The accompanying drawings are not drawn to scale. Detailed Implementation
[0036] The embodiments of this application will be described in further detail below with reference to the accompanying drawings and examples. The detailed description of the following embodiments and the accompanying drawings are used to illustrate the principles of this application by way of example, but should not be used to limit the scope of this application, that is, this application is not limited to the described embodiments.
[0037] In the description of this application, it should be noted that, unless otherwise stated, "a plurality of" means two or more; the terms "upper," "lower," "left," "right," "inner," and "outer," etc., indicating orientation or positional relationships, are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation on this application. Furthermore, the terms "first," "second," and "third," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. "Vertical" is not vertical in the strict sense, but within the allowable tolerance range. "Parallel" is not parallel in the strict sense, but within the allowable tolerance range.
[0038] The directional terms used in the following description refer to the directions shown in the figures and are not intended to limit the specific structure of this application. It should also be noted in the description of this application that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "joining" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a direct connection or an indirect connection through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.
[0039] Currently, the lithium batteries used in automobiles are mainly lithium iron phosphate batteries, which feature high capacity, high output voltage, and good charge-discharge cycle performance. Adapter welding is a crucial step in the battery cell manufacturing process, serving to connect the cover plate and the cell. During lithium battery production, cameras are used to monitor certain parameters to determine if they meet preset standards; these parameters may include: adhesive coating area, and the offset between the cover plate and the adapter plate.
[0040] The inventors noted that offset detection between the adapter piece and the cover plate is a crucial test after the adapter piece is welded, to confirm whether the positional offset between them meets a preset standard, such as whether the offset is less than 1mm. A common method for offset detection is to take images of the adapter piece with a camera, and then calculate the offset by capturing the positions of the cover plate and the adapter piece in the images. However, during testing, the edges of the cover plate are easily obscured, for example, by the battery cell, making it difficult to accurately capture the cover plate position in the captured images, thus resulting in low accuracy of the detected offset between the cover plate and the adapter piece.
[0041] To address the issue of low accuracy in the positional offset between the cover plate and the adapter plate, the applicant discovered that the main reason for this low accuracy is the inaccurate detection of the top cover's position in the image. Improving the accuracy of the cover plate's position detection in the image would enhance the accuracy of the detected positional offset between the cover plate and the adapter plate.
[0042] Based on the above considerations, and to address the issue of low accuracy in determining the positional offset between the cover plate and the adapter plate, the inventors, after in-depth research, designed a detection method that improves the accuracy of cover plate position detection in images. This method uses the positions of preset feature points on the cover plate and the size of the cover plate to determine its position. The preset feature points are located in non-edge areas of the cover plate not covered by the adapter plate, thus their position is not affected by the easily occluded edges of the cover plate. Therefore, by using the positions of the preset feature points and the size of the cover plate, the position of the cover plate in the image can be accurately determined, thereby solving the problem of low accuracy in determining the positional offset between the cover plate and the adapter plate.
[0043] The detection method disclosed in this application is applied to an electronic device that can detect the positional offset between the adapter plate and the cover plate in a product under test. The electronic device can receive an image of the product under test captured by a camera, and then combine the image to detect the positional offset between the cover plate and the adapter plate.
[0044] The product under test can be understood as a semi-finished product in the battery manufacturing process, including: adapter plates and cover plates. The adapter plates are located on the cover plates and cover a portion of the cover plates. For example, a top view of the product under test can be found here. Figure 1It includes: a cover plate 101, an adapter piece 102, a blue film 103, and an adhesive application area 104. The adapter piece 102 is located on the cover plate 101 and covers a portion of the cover plate 101. The middle area 105 of the cover plate 101 is not covered by the adapter piece 102. Figure 1 In the middle, the edge areas at both ends of the cover plate 101 are not covered by the adapter piece 102. It should be noted that the diagonal shading in the blue film 103 is only for distinguishing it from other areas; there are actually no diagonal lines on the blue film 103. The grid-like area in the middle area 105 is a real product feature on the cover plate.
[0045] According to some embodiments of this application, a flowchart of the detection method can be referred to. Figure 2 ,include:
[0046] Step 201: Receive an image of the product to be tested, and detect the position of preset feature points on the cover plate based on the image;
[0047] Step 202: Based on the positions of preset feature points and the dimensions of the cover plate, obtain the position of the cover plate in the image;
[0048] Step 203: Based on the image, determine the position of the adapter piece in the image;
[0049] Step 204: Based on the position of the cover plate and the position of the adapter piece in the image, obtain the actual position of the cover plate and the actual position of the adapter piece;
[0050] Step 205: Detect the positional offset between the cover plate and the adapter plate based on their actual positions.
[0051] In step 201, the cover plate has preset feature points. These preset feature points can be pre-selected, and the selection principle is that they are located in the non-edge areas of the cover plate not covered by the adapter piece. (Reference) Figure 1 The areas on the cover plate not covered by the adapter plate include the middle area 105 and the edge areas at both ends of the cover plate. Figure 1 (The black areas at both ends). In other words, the preset feature points can be set in the middle area 105, which belongs to the non-edge area.
[0052] In one example, the preset feature points can be points on the cover plate that possess the target feature, which is easily identifiable visually. The preset feature points on the cover plate possess the target feature, while other feature points on the cover plate do not. For example... Figure 1 If the points in the grid-like region in the middle of the cover plate have target features, then the points in the grid-like region can be used as preset feature points on the cover plate.
[0053] In its implementation, the camera captures an image of the product under test and sends it to an electronic device, which then receives the image. Based on the image, the electronic device identifies the features of various points on the cover plate, designating points with target features as preset feature points on the cover plate. The position of these target feature points in the image is then used as the position of the preset feature points on the cover plate. In step 201, the position of the preset feature points on the cover plate detected from the image is defined as the position of the preset feature points on the cover plate within the image.
[0054] In step 202, the electronic device can determine the position of the cover plate in the image based on the positions of preset feature points in the image and the size of the cover plate. The size of the cover plate can be its length and width, and can be pre-stored in the electronic device or received by the electronic device from the inspector when the detection method begins.
[0055] In practical implementation, the electronic device can simulate the position of the cover plate in the image based on the positions of preset feature points and the dimensions of the cover plate, thus obtaining the position of the cover plate in the image. For example, the upper surface of the cover plate is usually rectangular, with actual length and width 'a' and 'b', and the length and width of the cover plate in the image being 'a' and 'b', respectively. It is understandable that before acquiring the image with the camera, the camera can be pre-calibrated to obtain the conversion coefficient between the object's position coordinates in the image and its actual position coordinates. In practical implementation, the length and width of the cover plate in the image can also be obtained using the actual length and width of the cover plate and the conversion coefficient obtained after calibration. (Reference) Figure 3 Assuming the preset feature point is located at point A in the image, and the preset feature point itself is in the middle of the cover plate, then the simulated position of the cover plate in the image, based on its length a' and width b', can be the position of the dashed box 301. (Reference) Figure 4 Assuming the preset feature point is located at point B in the image, and the preset feature point itself is slightly to the left of the center of the cover plate, then the simulated position of the cover plate in the image, based on its length a' and width b', can be represented by the position of the dashed box 401. Specifically, the position of the cover plate in the image can be expressed as its coordinates.
[0056] In step 203, the electronic device can determine the position of the adapter piece in the image based on the image. For example, the electronic device can perform image recognition to identify the edge contour of the adapter piece, thereby determining the position of the adapter piece in the image, i.e., determining the position of the adapter piece in the image. Specifically, the position of the adapter piece in the image can be represented by its position coordinates. The position coordinates of the adapter piece in the image and the position coordinates of the cover plate in the image are position coordinates in the same coordinate system.
[0057] In step 204, the electronic device can obtain the actual position of the cover plate and the actual position of the adapter piece based on the position of the cover plate in the image and the position of the adapter piece in the image; where the actual position can be the actual position coordinates. As described above, after calibrating the camera, the conversion coefficient between the position coordinates of the object in the image and the actual position coordinates of the object can be obtained. Therefore, the electronic device can obtain the actual position coordinates of the cover plate based on the position coordinates of the cover plate in the image and the conversion coefficient, and also obtain the actual position coordinates of the cover plate based on the position coordinates of the adapter piece in the image and the conversion coefficient.
[0058] In step 205, the electronic device can detect the positional offset between the cover plate and the adapter plate based on their actual positions. This positional offset can include vertical offset and / or horizontal offset. (Reference) Figure 1 The vertical offset can be understood as distance c, and the horizontal offset can be understood as distance d.
[0059] In some embodiments of this application, the position of the cover plate in the image is obtained based on the detected positions of preset feature points on the cover plate and the size of the cover plate. Since the positions of these preset feature points are located in non-edge areas of the cover plate not covered by the adapter piece, their positions are not affected by the occlusion of the cover plate's edges. Therefore, the position of the cover plate in the image can be accurately obtained based on the positions of the preset feature points and the size of the cover plate. This allows for the accurate determination of the actual position of the cover plate, and consequently, based on the accurate actual position of the cover plate and the actual position of the adapter piece, the positional offset between the cover plate and the adapter piece can be accurately determined, thus improving the accuracy of the detected positional offset between the cover plate and the adapter piece.
[0060] According to some embodiments of this application, the implementation of step 201 can be referred to Figure 5 ,include:
[0061] Step 501: Receive a first image of the product under test captured by the first camera, and receive a second image of the product under test captured by the second camera; wherein, the first field of view of the first camera and the second field of view of the second camera have an overlapping part, and the sum of the first field of view and the second field of view can fully cover the product under test.
[0062] Step 502: Stitch the first image and the second image together to obtain a stitched image;
[0063] Step 503: Detect the position of preset feature points on the cover plate based on the stitched image.
[0064] In step 501, those skilled in the art can pre-calibrate the first camera and the second camera. After calibrating the first camera and the second camera together, the field of view can achieve full coverage of the adapter plate, that is, the sum of the first field of view of the first camera and the second field of view of the second camera can fully cover the product under test.
[0065] The sum of the first field of view of the first camera and the second field of view of the second camera can fully cover the product under test. This can be understood as follows: the first camera can capture the first part of the product under test, and the second camera can capture the second part of the product under test. The sum of the first part and the second part covers the entire product under test.
[0066] The first and second fields of view overlap, which can be understood as: the first part of the region and the second part of the region overlap, or it can be understood as: the first camera and the second camera can capture the same area of the product under test.
[0067] In a specific implementation, a first camera can capture a first image of the product under test and send the first image to an electronic device, so that the electronic device can receive the first image captured by the first camera. A second camera can capture a second image of the product under test and send the second image to the electronic device, so that the electronic device can receive the second image captured by the second camera.
[0068] In one example, the first camera and the second camera can both be 20MP monochrome area array cameras, with an X-direction field of view of 305mm and a pixel resolution of 0.03mm / pixel.
[0069] In step 502, the electronic device can stitch the first image and the second image together to obtain a stitched image. It can be understood that the first image includes a first portion of the product under test captured by the first camera, the second image includes a second portion of the product under test captured by the second camera, and the stitched image includes both the first portion of the product under test captured by the first camera and the second portion of the product under test captured by the second camera; in other words, the stitched image includes the entire product under test.
[0070] In a practical implementation, the electronic device can stitch the first image and the second image together based on the overlapping area of the first image and the second image to obtain a stitched image that includes the entire product under test and has no duplicate content.
[0071] In one example, you can refer to Figure 6 First image 601, second image 602, the overlapping area of first image 601 and second image 602 is 603, after stitching first image 601 and second image 602, the stitched image 604 is obtained.
[0072] In step 503, the electronic device can identify the features of each point on the cover plate in the stitched image, and use the points with target features as preset feature points on the detected cover plate. Therefore, the position of the points with target features in the image is used as the position of the preset feature points on the detected cover plate. (Reference) Figure 6 The position of the preset feature point on the stitched image can be the midpoint of the grid-like area in the middle.
[0073] However, in practice, more cameras can be selected to capture images of the product under test, and these images can be stitched together to obtain a stitched image. For example, three, four, or six cameras can be set up to receive images of the product under test captured by each camera and then stitched together.
[0074] In some embodiments of this application, a first camera and a second camera with overlapping fields of view are used to acquire images of the product under test. Since the sum of the first field of view of the first camera and the second field of view of the second camera can fully cover the product under test, stitching together the first image acquired by the first camera and the second image acquired by the second camera is beneficial to obtaining a stitched image that can fully cover the product under test. That is, the stitched image can reflect the whole picture of the product under test. Based on the stitched image that can reflect the whole picture of the product under test, the position of the preset feature points on the cover plate can be detected more accurately, thereby obtaining the position of the cover plate in the image more accurately, so as to further improve the accuracy of the detected positional offset between the cover plate and the adapter piece.
[0075] Furthermore, this application also considers that the more cameras used, the greater the calibration error may be, and the more complex the calibration process becomes. If a single camera is used to acquire images that fully cover the product under test, it might require a camera with billions of pixels, which is difficult to find on the market. Although 3 billion-pixel industrial cameras exist, their cost is too high, and the lenses used to match them would also need to be changed. The reserved installation space might not be sufficient to install a 3 billion-pixel industrial camera and its compatible lens. Therefore, in this embodiment, two cameras are used to acquire images of the product under test, which can reduce calibration errors, simplify the calibration process, and also help reduce costs.
[0076] According to some embodiments of this application, the implementation of step 502 can be referred to Figure 7 ,include:
[0077] Step 701: Transform the pixel coordinates of the first image and the pixel coordinates of the second image to the same coordinate system to obtain the physical coordinates of the first image and the physical coordinates of the second image;
[0078] Step 702: Determine the overlapping area of the first image and the second image based on the physical coordinates of the first image and the second image;
[0079] Step 703: Based on the overlapping area of the first image and the second image, stitch the first image and the second image together to obtain a stitched image.
[0080] In step 701, pixel coordinates are related to image resolution. Assuming the image resolution is 1024*768, the electronic device can divide the image into 1024 rows and 768 columns. The intersections of rows and columns form small squares, each representing a pixel. The row and column of a pixel are its pixel coordinates. The unit of pixel coordinates is pixels, and the pixel coordinates of one pixel can be represented by a number of rows and columns. The unit of physical coordinates can be millimeters (mm). The origin of the physical coordinate system is usually the midpoint of the imaging plane, i.e., the midpoint of the image. There is a transformation relationship between pixel coordinates and physical coordinates, which can be, for example, how many millimeters each column of pixels and each row of pixels represent.
[0081] In a practical implementation, the electronic device can transform the pixel coordinates of the first image and the pixel coordinates of the second image to the same physical coordinate system based on the transformation relationship between pixel coordinates and physical coordinates, thereby obtaining the physical coordinates of the first image and the physical coordinates of the second image.
[0082] In step 702, the electronic device can identify image features of the first image and image features of the second image. These image features may include texture features, shape features, grayscale features, and color features. Then, the electronic device can compare the image features of the first image and the image features of the second image to obtain regions in both images that share the same image features. Next, the electronic device can determine the physical coordinates of the regions in the first and second images that share the same image features based on the physical coordinates of the first and second images, and use these physical coordinates as the physical coordinates of the overlapping region between the first and second images. The overlapping region of the first and second images is... Figure 6 The overlapping region 603 in the text.
[0083] In step 703, the electronic device can stitch the first image and the second image together based on the physical coordinates of the overlapping area of the first image and the second image to obtain a stitched image. For example, based on the physical coordinates of the overlapping area in the first image, the overlapping area in the first image can be cropped, and the cropped first image and the second image can be stitched together to obtain a stitched image that includes the entire product under test and has no duplicate content. Alternatively, based on the physical coordinates of the overlapping area in the second image, the overlapping area in the second image can be cropped, and the cropped second image and the first image can be stitched together to obtain a stitched image that includes the entire product under test and has no duplicate content. In other words, since the content of the overlapping area between the first image and the second image is duplicate content, only the content of the overlapping area in one image is retained when stitching the images.
[0084] In some embodiments of this application, by converting both the first image and the second image into pixel coordinates and physical coordinates, the physical coordinates of the first image and the second image are obtained. This allows the overlapping area between the first image and the second image to be accurately obtained using the physical coordinates of the first image and the second image. This overlapping area serves as a reference for stitching the first image and the second image, which is beneficial for accurately and reasonably completing the stitching of the first image and the second image.
[0085] According to some embodiments of this application, receiving a first image of the product under test captured by a first camera and receiving a second image of the product under test captured by a second camera in step 501 may include: receiving a first image of the product under test captured by the first camera under a first light source and a second light source, and receiving a second image of the product under test captured by the second camera under a first light source and a third light source; wherein, the first light source is directly facing the product under test, the second light source and the third light source are respectively disposed at both ends of the first light source, the second light source is located at the upper left of the product under test, and the third light source is located at the upper right of the product under test.
[0086] refer to Figure 8 , Figure 8 This diagram illustrates the positional relationship between the first camera, the second camera, the first light source, the second light source, the third light source, and the product under test. The first light source 801 facing the product under test 800 can be understood as the long side of the first light source 801 being aligned with the long side of the adapter piece in the product under test 800. The second light source 802 and the third light source 803 are respectively positioned at opposite ends of the first light source 801, with the second light source 802 located to the upper left of the product under test 800 and the third light source 803 located to the upper right of the product under test 800.
[0087] In some embodiments of this application, the first light source is directly facing the product under test, which can illuminate the middle area of the product under test, making it easier to identify the features at the middle position of the product under test through the first image and the second image. The second light source and the third light source are respectively set at both ends of the first light source. The second light source is located at the upper left of the product under test, and the third light source is located at the upper right of the product under test. Thus, the second light source can illuminate the left side area of the product under test, and the third light source can illuminate the right side area of the product under test, making it easier to detect the features on both sides of the product under test through the first image and the second image, thereby improving the accuracy of the position of the adapter piece and the position of the cover plate in the obtained image.
[0088] According to some embodiments of this application, the first light source, the second light source, and the third light source are all strip light sources; the length direction of the first light source is in the same direction as the length direction of the product to be tested, the second light source is at a first preset angle to the first light source, and the third light source is at a second preset angle to the first light source.
[0089] refer to Figure 8 The first light source 801, the second light source 802 and the third light source 803 are all strip light sources, which are suitable for large-format size inspection.
[0090] The length direction of the first light source 801 is the same as the length direction of the product under test 800. The second light source 802 is at a first preset angle to the first light source 801, and the third light source 803 is at a second preset angle to the first light source 801. The angles between the three strip light sources are flexibly adjustable so that the light emitted by the first light source 801, the second light source 802, and the third light source 803 can illuminate the product under test 800 as much as possible, thereby illuminating various areas of the product under test 800. This allows the first camera 804 and the second camera 805 to capture clear images under the illumination of the three light sources.
[0091] In one example, the first light source 801 can be a strip light source, and the second light source 802 and the third light source 803 can be ring light sources. The second light source 802 is concentric with the field of view center of the first camera 804, and the third light source 803 is concentric with the field of view center of the second camera 805.
[0092] In some embodiments of this application, the first, second, and third light sources are all strip light sources. Strip light sources offer high illumination uniformity, high brightness, good heat dissipation, long service life, high stability, and simple installation. In this embodiment, the placement of the first, second, and third light sources, as well as the angles between them, allows them to provide approximately circular illumination conditions, thereby illuminating the product under test from all directions. This facilitates the acquisition of clear and comprehensive images by the first and second cameras.
[0093] According to some embodiments of this application, the values of the first preset angle and the second preset angle range from 140° to 160°.
[0094] refer to Figure 8 The first preset angle between the second light source 802 and the first light source 801 is 140° to 160°, meaning that the angle between the second light source 802 and the horizontal direction to the right is 20° to 40° (30°±10°). The second preset angle between the third light source 803 and the first light source 801 is 140° to 160°, meaning that the angle between the third light source 803 and the horizontal direction to the left is 20° to 40° (30°±10°).
[0095] In one example, such as Figure 8 As shown, the distance between the first camera 804 and the product under test 800 can be 405±5mm, the distance between the first camera 804 and the second camera 805 can be 160±5mm, the distance between the first light source 801 and the product under test 800 can be 385±10mm, the horizontal angle between the second light source 802 and the third light source 803 can be 30°±10°, and the distance between the second light source 802 and the product under test 800 can be 270±20mm. Optionally, the lengths of the second light source 802 and the third light source 803 can be 200±5mm.
[0096] In some embodiments of this application, when the values of the first preset angle and the second preset angle are in the range of 140° to 160°, the approximately circular lighting conditions provided by the first light source, the second light source, and the third light source have a better effect, which facilitates the acquisition of clear and comprehensive images of the product under test.
[0097] According to some embodiments of this application, the first light source, the second light source, and the third light source are all strobe light sources.
[0098] The brief pulses of light from a stroboscopic light source can freeze a moving object for the duration of the pulse, similar to the shutter function of a camera. Increasing the stroboscopic frequency of the light source allows the camera to capture a series of clear images; stroboscopic light sources capture images much faster than constant light sources.
[0099] In some embodiments of this application, the first light source, the second light source, and the third light source are all strobe light sources, which can improve the speed at which the first camera and the second camera acquire images, thereby improving the speed at which the positional offset between the cover plate and the adapter plate is detected.
[0100] According to some embodiments of this application, the preset feature point is located at the middle position on the cover plate.
[0101] Considering that the cover plate (also known as the top cover) is a standard part, and the middle of the cover plate has a grid-like area, refer to... Figure 1 The points in the grid-like area in the middle of the cover plate 101 are easy to identify and distinguish, and can be considered as feature points inherent to the cover plate. Therefore, when pre-selecting preset feature points on the cover plate, the point located in the middle of the cover plate can be used as the preset feature point.
[0102] In some embodiments of this application, the preset feature point is positioned at the center of the cover plate. Since the center of the cover plate is unlikely to be obscured, the preset feature point at the center of the cover plate is easier to detect from the image of the product under test. Furthermore, compared to positioning the preset feature point at other non-edge locations on the cover plate, the position of the cover plate in the image can be more easily obtained based on the position of the preset feature point at the center of the cover plate and the size of the cover plate. For example, the position of the preset feature point detected in the image can be directly used as the midpoint of the cover plate in the image. This midpoint is the midpoint of the length and the midpoint of the width of the cover plate in the image. Therefore, based on the position of this midpoint and the size of the cover plate in the image, the position of the cover plate in the image can be easily and conveniently simulated.
[0103] According to some embodiments of this application, a flowchart of the detection method can be referred to. Figure 9 ,include:
[0104] Step 901: Receive the first image and the second image of the product under test acquired by the first camera and the second camera respectively under the stroboscopic light source;
[0105] Step 902: Stitch the first image and the second image together to obtain a stitched image;
[0106] Step 903: Detect the position of the feature points on the cover plate in the stitched image, and obtain the position of the cover plate in the stitched image based on the position of the feature points on the cover plate and the size of the cover plate;
[0107] Step 904: Obtain the position of the adapter piece in the stitched image;
[0108] Step 905: Based on the position of the cover plate and the position of the adapter piece in the stitched image, obtain the actual position of the cover plate and the actual position of the adapter piece;
[0109] Step 906: Detect the positional offset between the cover plate and the adapter plate based on their actual positions.
[0110] The first and second cameras can be 20MP monochrome area-array cameras, with a field of view compatible with a maximum of 305mm and a minimum of 120mm. During calibration, the lens hardware, working distance, field of view, and pixel resolution of both cameras are identical. The placement of the first and second cameras can be referenced... Figure 8 The first camera 804 and the second camera 805 acquire the first image and the second image respectively under the first light source 801, the second light source 802, and the third light source 803. The feature points on the cover plate are the feature points in the grid-like region in the middle of the cover plate. The electronic device can capture the feature points on the cover plate in the stitched image and, combined with the size of the cover plate, simulate the position of the cover plate in the stitched image. In specific implementation, the electronic device can capture the position of the adapter piece in the stitched image in real time.
[0111] In some embodiments of this application, the first and second cameras acquire images under a stroboscopic light source, which can improve the image acquisition speed. By stitching the first and second images, a stitched image that fully covers the product under test can be obtained, thus facilitating accurate identification of the positions of the feature points inherent in the cover plate. Based on the identified positions of the feature points and the size of the cover plate, the position of the cover plate is obtained, thereby determining the positional offset between the cover plate and the adapter plate. Since the feature points on the cover plate are located in the middle, they are less susceptible to obstruction at the edges of the cover plate, allowing for accurate determination of the cover plate's position and improving the accuracy of the detected positional offset between the cover plate and the adapter plate.
[0112] The steps of the various methods described above are only for clarity. In practice, they can be combined into one step or some steps can be split into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent. Adding insignificant modifications or introducing insignificant designs to the algorithm or process, but without changing the core design of the algorithm and process, are also within the scope of protection of this patent.
[0113] According to some embodiments of this application, an electronic device is provided, with reference to... Figure 10 The system includes: at least one processor 1001; and a memory 1002 communicatively connected to the at least one processor 1001; wherein the memory 1002 stores instructions executable by the at least one processor 1001, the instructions being executed by the at least one processor 1001 to enable the at least one processor 1001 to perform the detection method as described above.
[0114] The memory 1002 and processor 1001 are connected via a bus. This bus can include any number of interconnecting buses and bridges, connecting various circuits of one or more processors 1001 and memory 1002. The bus can also connect various other circuits, such as peripheral devices, voltage regulators, and power management circuits, which are well-known in the art and therefore will not be described further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by processor 1001 is transmitted over a wireless medium via an antenna, which further receives data and transmits it to processor 1001.
[0115] Processor 1001 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory 1002 can be used to store data used by processor 1001 during operation.
[0116] According to some embodiments of this application, a computer-readable storage medium is provided, storing a computer program. When the computer program is executed by a processor, it implements the above-described method embodiments.
[0117] That is, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0118] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and not to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application, and they should all be covered within the scope of the claims and specification of this application. In particular, as long as there is no structural conflict, the various technical features mentioned in the embodiments can be combined in any way. This application is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.
Claims
1. A detection method, comprising: The system receives an image of the product under test and detects the position of a preset feature point on the cover plate based on the image. The product under test includes an adapter plate and a cover plate, wherein the adapter plate is located on the cover plate and covers a portion of the cover plate, and the preset feature point is located on a non-edge area of the cover plate not covered by the adapter plate. The position of the cover plate in the image is obtained based on the position of the preset feature points and the size of the cover plate; Based on the image, the position of the adapter piece in the image is obtained; Based on the position of the cover plate and the position of the adapter piece in the image, the actual position of the cover plate and the actual position of the adapter piece are obtained; The positional offset between the cover plate and the adapter piece is detected based on their actual positions.
2. The detection method according to claim 1, wherein, The process of receiving an image of the product under test and detecting the position of preset feature points on the cover plate based on the image includes: The system receives a first image of the product under test captured by a first camera and a second image of the product under test captured by a second camera; wherein the first field of view of the first camera and the second field of view of the second camera overlap, and the sum of the first field of view and the second field of view can fully cover the product under test. The first image and the second image are stitched together to obtain a stitched image; Based on the stitched image, the positions of preset feature points on the cover plate are detected.
3. The detection method according to claim 2, wherein, The step of stitching the first image and the second image together to obtain a stitched image includes: The pixel coordinates of the first image and the pixel coordinates of the second image are transformed to the same coordinate system to obtain the physical coordinates of the first image and the physical coordinates of the second image. Based on the physical coordinates of the first image and the physical coordinates of the second image, determine the overlapping area of the first image and the second image; Based on the overlapping area of the first image and the second image, the first image and the second image are stitched together to obtain a stitched image.
4. The detection method according to claim 2, wherein, The step of receiving a first image of the product under test captured by a first camera and receiving a second image of the product under test captured by a second camera includes: The system receives a first image of the product under test captured by a first camera under a first light source and a second light source, and receives a second image of the product under test captured by a second camera under a first light source and a third light source. The first light source is directly facing the product under test. The second light source and the third light source are respectively located at opposite ends of the first light source. The second light source is located at the upper left of the product under test, and the third light source is located at the upper right of the product under test.
5. The detection method according to claim 4, wherein, The first light source, the second light source, and the third light source are all bar light sources; The length direction of the first light source is the same as the length direction of the product under test, the second light source is at a first preset angle to the first light source, and the third light source is at a second preset angle to the first light source.
6. The detection method according to claim 5, wherein, The range of the first preset angle and the second preset angle is 140° to 160°.
7. The detection method according to any one of claims 4 to 6, wherein, The first light source, the second light source, and the third light source are all strobe light sources.
8. The detection method according to claim 1, wherein, The preset feature point is located in the middle of the cover plate.
9. An electronic device, comprising: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the detection method as described in any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program that, when executed by a processor, implements the detection method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Gluing equipment
CN211726359U
Device for the calibration of a stereo camera
EP2642447A2