Positional degree detection method, device and system
By using an image acquisition device and an edge detection algorithm, the position of the stud can be calculated quickly and accurately, solving the problem of low detection efficiency of coordinate measuring machines and realizing efficient and low-cost position detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN LINGYUN VISION TECH CO LTD
- Filing Date
- 2022-12-27
- Publication Date
- 2026-06-30
AI Technical Summary
In existing technologies, coordinate measuring machines (CMMs) are inefficient and costly in detecting the position of studs, making it difficult to meet the requirements of high precision and high efficiency.
The image acquisition device acquires images of the workpiece boundary and the area of the stud to be tested. The edge detection algorithm is used to determine the coordinate information, a second coordinate system is established, and the position of the stud relative to the center point is calculated to achieve fast and accurate detection.
While ensuring detection accuracy, it significantly improves the efficiency of stud position detection and reduces detection costs.
Smart Images

Figure CN116164639B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of visual inspection technology, and in particular relates to a positional detection method, device and system. Background Technology
[0002] Position tolerance is an indicator that limits the variation of the actual position of a measured element from its ideal position. Position tolerance testing is a routine inspection frequently performed on assembled parts, as it determines the assembly accuracy and product yield. For example, the assembly of studs and other fasteners has high requirements for position tolerance, thus necessitating precise testing of the position tolerance of the measured element.
[0003] Currently, coordinate measuring machines (CMMs) are commonly used for inspection. The CMM's probe automatically moves along a preset path to probe the surface of the part. Each probe yields a three-dimensional coordinate, and each position requires three probes to obtain three coordinates, from which the positional accuracy is calculated. However, CMMs are slow in probing parts, taking approximately ten minutes to complete the inspection of a single part or product, resulting in extremely low efficiency in positional accuracy detection. Summary of the Invention
[0004] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a positional accuracy detection method, apparatus, and system to improve the efficiency of positional accuracy detection.
[0005] Firstly, this application provides a positional detection method, the method comprising:
[0006] The image acquisition device acquires first region images at multiple boundaries of the workpiece and second region images at the stud to be tested in the workpiece, with each boundary corresponding to at least one first region image;
[0007] Based on the first region image and the second region image, the first coordinate information corresponding to the multiple boundaries and the second coordinate information corresponding to the stud to be measured are determined. The first coordinate information and the second coordinate information are coordinate information in a first coordinate system, which is the coordinate system corresponding to the image acquisition device.
[0008] Based on the first coordinate information, a second coordinate system corresponding to the workpiece is established, and the center point of the second coordinate system is determined.
[0009] Based on the second coordinate information, the coordinate information of the stud to be tested in the second coordinate system is calculated, and the position of the stud to be tested relative to the center point of the coordinate system is determined.
[0010] According to the position measurement method of this application, an image acquisition device is used to acquire regional images of the workpiece boundary and the stud to be measured, and the position measurement of the stud to be measured is calculated. While ensuring the detection accuracy, the detection efficiency of the stud position measurement is effectively improved and the detection cost is reduced.
[0011] According to one embodiment of this application, the first coordinate information is determined through the following steps:
[0012] Each first region image is divided into multiple first sub-regions, and edge detection is performed on each of the multiple first sub-regions to obtain multiple first edge points corresponding to each boundary.
[0013] The first coordinate information is determined based on the plurality of first edge points.
[0014] According to one embodiment of this application, establishing a second coordinate system corresponding to the workpiece based on the first coordinate information and determining the center point of the second coordinate system includes:
[0015] Based on the plurality of first edge points of each boundary, the first boundary line corresponding to each boundary is fitted to obtain the first boundary line.
[0016] At least two first center lines corresponding to the first boundary lines of the plurality of boundaries are determined, wherein two first boundary lines located in relative positions are used to determine one first center line.
[0017] A second coordinate system is established based on the intersection of the at least two first center lines, and the intersection of the at least two first center lines is determined as the center point of the coordinate system.
[0018] According to one embodiment of this application, the second coordinate information is determined through the following steps:
[0019] The second region image is divided into multiple second sub-regions, and edge detection is performed on each of the multiple second sub-regions to obtain multiple second edge points of the workpiece boundary;
[0020] Based on the multiple second edge points, the center of the stud corresponding to the stud under test is obtained by fitting.
[0021] The second coordinate information is determined based on the center of the stud.
[0022] According to one embodiment of this application, the step of calculating the coordinate information of the stud under test in the second coordinate system based on the second coordinate information, and determining the position degree of the stud under test relative to the center point of the coordinate system, includes:
[0023] Based on the second coordinate information, determine the stud coordinate information of the stud center in the second coordinate system;
[0024] The positional degree is determined based on the stud coordinate information and the standard coordinate information corresponding to the stud to be measured.
[0025] According to one embodiment of this application, the workpiece includes a first boundary, a second boundary, a third boundary, and a fourth boundary. The first boundary and the third boundary are disposed opposite to each other, and the second boundary and the fourth boundary are disposed opposite to each other. The first boundary, the second boundary, the third boundary, and the fourth boundary define a closed region. The stud to be tested is located within the closed region. Acquiring an image of the first region at the boundary using an image acquisition device includes:
[0026] The image acquisition device acquires images of the first region, including the first boundary, the second boundary, the third boundary, and the fourth boundary, wherein each boundary corresponds to two images of the first region.
[0027] Secondly, this application provides a positional detection device, which includes:
[0028] The acquisition module is used to acquire first region images at multiple boundaries of the workpiece and second region images at the stud to be tested in the workpiece through an image acquisition device, wherein each boundary corresponds to at least one first region image;
[0029] The first processing module is used to determine, based on the first region image and the second region image, the first coordinate information corresponding to the multiple boundaries and the second coordinate information corresponding to the stud to be measured, wherein the first coordinate information and the second coordinate information are coordinate information in a first coordinate system, and the first coordinate system is the coordinate system corresponding to the image acquisition device;
[0030] The second processing module is used to establish a second coordinate system corresponding to the workpiece based on the first coordinate information, and to determine the center point of the second coordinate system.
[0031] The third processing module is used to calculate the coordinate information of the stud under test in the second coordinate system based on the second coordinate information, and to determine the position degree of the stud under test relative to the center point of the coordinate system.
[0032] According to the position measurement device of this application, the region image of the workpiece boundary and the stud to be measured is acquired by the image acquisition device, and the position measurement of the stud to be measured is calculated. While ensuring the detection accuracy, the detection efficiency of the stud position measurement is effectively improved and the detection cost is reduced.
[0033] Thirdly, this application provides a position detection system, characterized in that it includes:
[0034] A base for placing the workpiece;
[0035] The bracket is mounted on the base;
[0036] An image acquisition device is mounted on the bracket and is used to acquire image data of the workpiece.
[0037] A controller, electrically connected to the image acquisition device, is used to determine the position of the stud to be tested on the workpiece based on the position detection method described in the first aspect above.
[0038] According to one embodiment of this application, it also includes:
[0039] A drive mechanism is electrically connected to a controller, which controls the drive mechanism to drive the image acquisition device to move along a first direction on the support. At least two workpieces are placed on the base along the first direction. The image acquisition device is used to acquire image data of the at least two workpieces.
[0040] Fourthly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the position detection method as described in the first aspect above.
[0041] Fifthly, this application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the position detection method as described in the first aspect above.
[0042] In a sixth aspect, this application provides a computer program product, including a computer program that, when executed by a processor, implements the position detection method as described in the first aspect above.
[0043] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0044] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:
[0045] Figure 1 This is one of the flowcharts illustrating the position detection method provided in the embodiments of this application;
[0046] Figure 2 This is one of the planar schematic diagrams of the workpiece provided in the embodiments of this application;
[0047] Figure 3This is a second planar schematic diagram of the workpiece provided in the embodiments of this application;
[0048] Figure 4 This is the third planar schematic diagram of the workpiece provided in the embodiments of this application;
[0049] Figure 5 This is the fourth planar schematic diagram of the workpiece provided in the embodiments of this application;
[0050] Figure 6 This is the fifth planar schematic diagram of the workpiece provided in the embodiments of this application;
[0051] Figure 7 This is the sixth planar schematic diagram of the workpiece provided in the embodiments of this application;
[0052] Figure 8 This is the seventh planar schematic diagram of the workpiece provided in the embodiments of this application;
[0053] Figure 9 This is a schematic diagram of the position detection system provided in the embodiments of this application;
[0054] Figure 10 This is a second schematic flowchart of the position detection method provided in the embodiments of this application;
[0055] Figure 11 This is a schematic diagram of the position detection device provided in the embodiments of this application;
[0056] Figure 12 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application;
[0057] Figure 13 This is a hardware schematic diagram of the electronic device provided in the embodiments of this application.
[0058] Figure label:
[0059] Base 510, bracket 520, image acquisition device 530, workpiece 610. Detailed Implementation
[0060] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0061] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0062] The position detection method, position detection device, electronic device, and readable storage medium provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.
[0063] The position detection method can be applied to the terminal, and can be executed by the hardware or software in the terminal.
[0064] The terminal includes, but is not limited to, portable communication devices such as mobile phones or tablets with touch-sensitive surfaces (e.g., touchscreen displays and / or touchpads). It should also be understood that, in some embodiments, the terminal may not be a portable communication device, but rather a desktop computer with touch-sensitive surfaces (e.g., touchscreen displays and / or touchpads).
[0065] The following embodiments describe a terminal including a display and a touch-sensitive surface. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, mouse, and joystick.
[0066] The position detection method provided in this application embodiment can be executed by an electronic device or a functional module or entity in an electronic device that can implement the position detection method. The electronic devices mentioned in this application embodiment include, but are not limited to, mobile phones, tablets, computers, cameras, and wearable devices. The position detection method provided in this application embodiment is described below using an electronic device as the execution subject as an example.
[0067] like Figure 1 As shown, the position detection method includes steps 110 to 130.
[0068] Step 110: Acquire images of the first region at multiple boundaries of workpiece 610 and the second region at the stud to be tested in workpiece 610 using image acquisition device 530.
[0069] Each boundary corresponds to at least one first region image.
[0070] It is understandable that the first region image and the second region image are region images of a preset size, and the size of the first region image and the second region image is smaller than the size of the overall image of the workpiece 610.
[0071] For example, such as Figure 2 As shown, the area enclosed by the multiple sides of workpiece 610 includes multiple studs to be tested.
[0072] like Figure 3 As shown, the workpiece 610 includes an upper boundary, a right boundary, a lower boundary, and a left boundary. The image acquisition device 530 acquires first region images at multiple boundaries of the workpiece 610. Two first region images corresponding to box 1 and box 2 are acquired at the upper boundary, and so on, for a total of 8 first region images.
[0073] like Figure 6 As shown, the image acquisition device 530 acquires the second region image of the stud to be tested in the workpiece 610. Boxes 9 to 15, each box corresponds to one second region image.
[0074] Step 120: Based on the first region image and the second region image, determine the first coordinate information corresponding to multiple boundaries and the second coordinate information corresponding to the stud to be measured.
[0075] The first coordinate information and the second coordinate information are coordinate information under the first coordinate system, which is the coordinate system corresponding to the image acquisition device 530.
[0076] In this embodiment, the first coordinate information is the coordinate information of the feature point at the boundary position of the workpiece 610, and the second coordinate information is the coordinate information of the feature point at the position of the stud to be measured.
[0077] Step 130: Based on the first coordinate information, establish the second coordinate system corresponding to the workpiece 610, and determine the center point of the second coordinate system.
[0078] like Figure 7 As shown, based on the first coordinate information corresponding to each boundary, the positional distance relationship between the boundaries of workpiece 610 can be determined, thereby determining the center point of workpiece 610. Then, based on the center point of workpiece 610, a second coordinate system corresponding to workpiece 610 is established, and the center point of the second coordinate system (the center point of workpiece 610) is determined.
[0079] The center point of the coordinate system is the reference point for measuring the positional accuracy of the stud.
[0080] Step 140: Based on the second coordinate information, calculate the coordinate information of the stud to be tested in the second coordinate system, and determine the position of the stud to be tested relative to the center point of the coordinate system.
[0081] Both the first and second coordinate information are coordinate information in the first coordinate system. Based on the second coordinate information, the coordinate information of the stud to be tested in the second coordinate system can be calculated, the positional distance relationship between the stud to be tested and the center point of the workpiece 610 can be determined, and then the positional degree of the stud to be tested relative to the center point of the coordinate system can be determined.
[0082] In related technologies, position accuracy is detected by a coordinate measuring machine (CMM). The CMM's probe moves automatically along a preset path to detect the surface of the part. Each detection yields a three-dimensional coordinate. Each position requires three detections to obtain three coordinates, and the position accuracy is then calculated. This method is slow and has extremely low detection efficiency. Furthermore, the use of a CMM increases the detection cost.
[0083] In this embodiment, the image acquisition device 530 acquires the area image of the workpiece 610 boundary and the stud to be tested, determines the reference point for measuring the position of the stud, and determines the position of the stud to be tested by combining the coordinate information. While ensuring the detection accuracy, the detection efficiency of the stud position is effectively improved, and the use of the image acquisition device 530 can effectively reduce the detection cost.
[0084] According to the position measurement method provided in the embodiments of this application, the image acquisition device 530 acquires the area image of the workpiece 610 boundary and the stud to be measured, and calculates the position measurement of the stud to be measured. While ensuring the detection accuracy, it effectively improves the detection efficiency of the stud position measurement and reduces the detection cost.
[0085] In some embodiments, the first coordinate information is determined through the following steps:
[0086] Each first region image is divided into multiple first sub-regions, and edge detection is performed on each of the multiple first sub-regions to obtain multiple first edge points corresponding to each boundary.
[0087] First coordinate information is determined based on multiple first edge points.
[0088] The first region image is divided into multiple first sub-regions. The first edge points corresponding to the boundary of each first sub-region are extracted by the edge detection algorithm. The determined multiple first edge points represent the edge of the boundary.
[0089] For example, such as Figure 4 As shown, within a specific rectangular detection region of the first region image, multiple first sub-regions are subdivided, and the first edge points of the boundaries are extracted using an edge detection algorithm. Figure 4 The cross shown represents multiple first edge points.
[0090] It should be noted that the first coordinate information includes the coordinate information corresponding to multiple first edge points, for example, such as Figure 4As shown, six first edge points are extracted from a specific rectangular detection region within the first region image of box 1, and the first coordinate information corresponding to the first region image of box 1 includes the coordinate information of these six first edge points.
[0091] In practice, the first region image can be processed into grayscale, then subdivided into multiple first sub-regions, and the first edge point of the black-and-white boundary can be extracted using an edge detection algorithm.
[0092] In some embodiments, step 130, establishing a second coordinate system corresponding to the workpiece 610 based on the first coordinate information, and determining the center point of the second coordinate system, may include:
[0093] Based on multiple first edge points of each boundary, the first boundary line corresponding to each boundary is obtained by fitting.
[0094] Determine at least two first center lines corresponding to the first boundary lines of multiple boundaries, wherein two first boundary lines located in relative positions are used to determine a first center line;
[0095] A second coordinate system is established based on the intersection of at least two first center lines, and the intersection of at least two first center lines is determined as the center point of the coordinate system.
[0096] In this embodiment, based on the multiple first edge points obtained from the boundary, the first boundary line corresponding to the boundary can be fitted by the least squares method.
[0097] After fitting the first boundary line of each boundary, a first center line is determined based on the two first boundary lines located in relative positions, thus obtaining at least two first center lines for more than 610 boundaries of the workpiece.
[0098] For example, such as Figure 5 As shown, the first edge points of boxes 1 and 2 can be fitted to obtain the corresponding first boundary line above. Similarly, boxes 3 and 4, boxes 5 and 6, and boxes 7 and 8 are obtained, resulting in a total of four first boundary lines: top, right, bottom, and left.
[0099] According to the angle bisector principle, the corresponding first center line is obtained from the left and right sides and set as the V-axis. The corresponding first center line is obtained from the upper and lower sides and set as the H-axis. The intersection of the two axes is point O.
[0100] In this embodiment, point O is the reference point for measuring the stud position of workpiece 610. A second coordinate system is established with point O as the center point of the coordinate system.
[0101] In some embodiments, the second coordinate information is determined through the following steps:
[0102] The second region image is divided into multiple second sub-regions, and edge detection is performed on each of the multiple second sub-regions to obtain multiple second edge points of the workpiece 610 boundary;
[0103] Based on multiple second edge points, the center of the stud corresponding to the stud under test is obtained by fitting.
[0104] The second coordinate information is determined based on the center of the stud.
[0105] In this embodiment, the second region image is divided into multiple second sub-regions. By using an edge detection algorithm, the second edge points corresponding to the boundary of each second sub-region are extracted. The determined multiple second edge points represent the edge of the stud to be tested.
[0106] For example, such as Figure 6 As shown, within a specific annular detection region of the second region image, multiple second sub-regions are subdivided, and the second edge points of the boundaries are extracted using an edge detection algorithm. Figure 6 The cross shown represents multiple second edge points.
[0107] Based on multiple second edge points of the stud to be tested, a circle is fitted using the least squares method, and the center of the fitted circle is determined, which is the center of the stud. The second coordinate information includes the coordinate information corresponding to the center of the stud.
[0108] In practice, the second region image can be processed into grayscale, then subdivided into multiple second sub-regions, and the second edge points of the black-and-white boundary can be extracted using an edge detection algorithm.
[0109] In some embodiments, step 140, calculating the coordinate information of the stud to be tested in the second coordinate system based on the second coordinate information, and determining the positional degree of the stud to be tested relative to the center point of the coordinate system, may include:
[0110] Based on the second coordinate information, determine the stud coordinate information of the stud center in the second coordinate system;
[0111] The positional accuracy is determined based on the stud coordinate information and the standard coordinate information corresponding to the stud to be measured.
[0112] It is understandable that the second coordinate system is a coordinate system established based on the first coordinate information. The first and second coordinate information both belong to the coordinate information of the first coordinate system. Based on the second coordinate information, according to the principle of perpendicularity from a point to a line, the distance from the center of the stud to the two coordinate axes of the second coordinate system is calculated, and the stud coordinate information is determined.
[0113] For example, such as Figure 7 As shown, for the bolt to be measured at position 9, the distances to the two coordinate axes of the second coordinate system are 24.03 and 64.47, respectively, that is, the stud coordinate information is (-24.03, 64.47).
[0114] Calculate the difference between the standard coordinate information and the stud coordinate information of the bolt to be tested at position 9, and determine the positional accuracy of the bolt to be tested at position 9.
[0115] like Figure 8 As shown, for the seven bolts to be tested at positions 9 to 15, the distances from the center of the stud to the V-axis and H-axis are calculated according to the principle of perpendicularity from a point to a line, and the coordinate information of the stud is obtained as (H1, V1), (H2, V2), (H3, V3), (H4, V4), (H5, V5), (H6, V6) and (H7, V7).
[0116] In some embodiments, the workpiece 610 includes a first boundary, a second boundary, a third boundary, and a fourth boundary. The first boundary and the third boundary are arranged opposite to each other, and the second boundary and the fourth boundary are arranged opposite to each other. The first boundary, the second boundary, the third boundary, and the fourth boundary define a closed region. The stud to be tested is located within the closed region. The image acquisition device 530 acquires an image of the first region at the boundary, including:
[0117] The image acquisition device 530 acquires first region images of the first boundary, the second boundary, the third boundary, and the fourth boundary, wherein each boundary corresponds to two first region images.
[0118] In this embodiment, the workpiece 610 is quadrilateral in shape, with the first and third boundaries being oppositely arranged, and the second and fourth boundaries being oppositely arranged.
[0119] In practice, two images of the first region are acquired for each boundary. Edge detection and line fitting are performed based on the two images of the first region to obtain the first boundary line corresponding to that boundary.
[0120] A first center line is determined by the two first boundary lines relative to the first and third boundaries. Similarly, a first center line is determined by the two first boundary lines relative to the second and fourth boundaries. The intersection of the two first center lines is the center point of the second coordinate system.
[0121] The following is a specific example.
[0122] The first boundary, the second boundary, the third boundary, and the fourth boundary correspond to the left, top, right, and bottom edges of workpiece 610, respectively.
[0123] like Figure 4 As shown, eight images of the first region are acquired at positions 1 to 8. Each region is further subdivided into multiple smaller regions within a specific rectangular detection area. An edge detection algorithm is used to extract the points where white and black areas meet, as shown below. Figure 4 The cross shown represents some of the first edge points obtained.
[0124] The first edge points of boxes 1 and 2 can be combined to form a first boundary line. The same applies to boxes 3 and 4, 5 and 6, 7 and 8, and boxes 3 and 4, 5 and 6, and 7 and 8. In total, four first boundary lines are obtained: top, right, bottom, and left.
[0125] like Figure 5 As shown, according to the angle bisector principle, the center line is obtained from the left and right sides and set as the V-axis, and the center line is obtained from the upper and lower sides and set as the H-axis. The intersection of the two axes is O.
[0126] like Figure 6 As shown, the outer circle of the stud to be tested is subdivided into multiple small regions within a specific annular detection area. An edge detection algorithm is used to extract the points where white and black areas separate, as shown below. Figure 6 The cross intersection shown represents some of the second edge points. A circle is fitted using the least squares method, and the center of the stud is obtained.
[0127] like Figure 8 As shown, calculate the coordinates of the center of each stud in the H&V coordinate system. Based on the principle of perpendicularity from a point to a line, obtain the coordinate values and calculate the difference between them and their standard coordinate values to obtain the positional degree.
[0128] The position detection method provided in this application can be executed by a position detection device. This application uses a position detection device executing the position detection method as an example to illustrate the position detection device provided in this application.
[0129] This application also provides a position detection device.
[0130] like Figure 11 As shown, the position detection device includes:
[0131] The acquisition module 1110 is used to acquire first region images at multiple boundaries of workpiece 610 and second region images at the stud to be tested in workpiece 610 through image acquisition device 530, with each boundary corresponding to at least one first region image;
[0132] The first processing module 1120 is used to determine the first coordinate information corresponding to multiple boundaries and the second coordinate information corresponding to the stud to be measured based on the first region image and the second region image. The first coordinate information and the second coordinate information are coordinate information under the first coordinate system, which is the coordinate system corresponding to the image acquisition device 530.
[0133] The second processing module 1130 is used to establish a second coordinate system corresponding to the workpiece 610 based on the first coordinate information, and to determine the center point of the second coordinate system.
[0134] The third processing module 1140 is used to calculate the coordinate information of the stud under test in the second coordinate system based on the second coordinate information, and to determine the position of the stud under test relative to the center point of the coordinate system.
[0135] According to the position measurement device provided in the embodiments of this application, the image acquisition device 530 acquires the area image of the workpiece 610 boundary and the stud to be measured, and calculates the position measurement of the stud to be measured. While ensuring the detection accuracy, it effectively improves the detection efficiency of the stud position measurement and reduces the detection cost.
[0136] In some embodiments, the first processing module 1120 is configured to divide each first region image into multiple first sub-regions, perform edge detection on each of the multiple first sub-regions, and obtain multiple first edge points corresponding to each boundary.
[0137] First coordinate information is determined based on multiple first edge points.
[0138] In some embodiments, the second processing module 1130 is used to fit a first boundary line corresponding to each boundary based on a plurality of first edge points of each boundary;
[0139] Determine at least two first center lines corresponding to the first boundary lines of multiple boundaries, wherein two first boundary lines located in relative positions are used to determine a first center line;
[0140] A second coordinate system is established based on the intersection of at least two first center lines, and the intersection of at least two first center lines is determined as the center point of the coordinate system.
[0141] In some embodiments, the first processing module 1120 is used to divide the second region image into multiple second sub-regions, perform edge detection on the multiple second sub-regions respectively, and obtain multiple second edge points of the workpiece 610 boundary;
[0142] Based on multiple second edge points, the center of the stud corresponding to the stud under test is obtained by fitting.
[0143] The second coordinate information is determined based on the center of the stud.
[0144] In some embodiments, the third processing module 1140 is used to determine the stud coordinate information of the stud center in the second coordinate system based on the second coordinate information;
[0145] The positional accuracy is determined based on the stud coordinate information and the standard coordinate information corresponding to the stud to be measured.
[0146] In some embodiments, the workpiece 610 includes a first boundary, a second boundary, a third boundary, and a fourth boundary. The first boundary and the third boundary are arranged opposite to each other, and the second boundary and the fourth boundary are arranged opposite to each other. The first boundary, the second boundary, the third boundary, and the fourth boundary define a closed region. The stud to be tested is located within the closed region. The acquisition module 1110 is used to acquire first region images of the first boundary, the second boundary, the third boundary, and the fourth boundary through the image acquisition device 530, wherein each boundary corresponds to two first region images.
[0147] The position detection device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.
[0148] The position detection device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit it.
[0149] The position detection device provided in this application embodiment can achieve... Figures 1 to 10 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.
[0150] This application provides a positional detection system, including:
[0151] Base 510, bracket 520, image acquisition device 530 and controller.
[0152] The base 510 is used to place the workpiece 610, the bracket 520 is installed on the base 510, and the image acquisition device 530 is set on the bracket 520. The image acquisition device 530 is used to acquire image data of the workpiece 610.
[0153] The controller is electrically connected to the image acquisition device 530. The controller is used to determine the position of the stud to be tested on the workpiece 610 based on the above-mentioned position detection method.
[0154] According to the position measurement system provided in this application embodiment, the image acquisition device 530 acquires the area image of the workpiece 610 boundary and the stud to be measured, and calculates the position measurement of the stud to be measured. While ensuring the detection accuracy, it effectively improves the detection efficiency of the stud position measurement and reduces the detection cost.
[0155] In some embodiments, the position detection system may further include a drive mechanism.
[0156] The drive mechanism is electrically connected to the controller, which controls the drive mechanism to drive the image acquisition device 530 to move along the first direction on the support 520. At least two workpieces 610 are placed on the base 510 along the first direction. The image acquisition device 530 is used to acquire image data of at least two workpieces 610.
[0157] In this embodiment, the image acquisition device 530 can move along a first direction to continuously acquire first region images and second region images of multiple workpieces 610 arranged along the first direction, determine the position of multiple workpieces 610, and effectively improve the efficiency of position detection.
[0158] For example, such as Figure 9 As shown, two workpieces 610 are placed on the base 510 along the first direction. The image acquisition device 530 first acquires the image data of one of the workpieces 610, and then moves along the first direction to acquire the image data of the other workpiece 610.
[0159] The following is a specific example.
[0160] like Figure 10 As shown, firstly, the platform and camera where the base 510 is located are calibrated, and the transformation relationship between the image coordinate system and the platform coordinate system is obtained. In this way, the different workpieces 610 photographed each time can be converted into a unified platform coordinate system.
[0161] In actual operation, the platform and camera at the location of the calibration base 510 can be calibrated by nine-point translation.
[0162] During testing, such as Figure 9 As shown, the camera quickly captures images of the first workpiece 610. Figure 4 Positions 1-15 as shown are used to move the camera and photograph the second workpiece 610. Figure 4 The image data of workpiece 610 is output at positions 1 to 15 as shown.
[0163] For any workpiece 610, such as Figure 4 As shown, a specific rectangular detection area is subdivided into multiple smaller regions. An edge detection algorithm is used to extract the points where white and black areas meet. Figure 4 The cross shown represents some of the first edge points obtained.
[0164] The first edge points of boxes 1 and 2 can be combined to form a first boundary line. The same applies to boxes 3 and 4, 5 and 6, 7 and 8, and boxes 3 and 4, 5 and 6, and 7 and 8. In total, four first boundary lines are obtained: left, right, top, and bottom.
[0165] like Figure 5 As shown, according to the angle bisector principle, the center line is obtained from the left and right sides and set as the V-axis, and the center line is obtained from the upper and lower sides and set as the H-axis. The intersection of the two axes is O.
[0166] like Figure 6 As shown, the outer circle of the stud to be tested is subdivided into multiple small regions within a specific annular detection area. An edge detection algorithm is used to extract the points where white and black areas separate, as shown below. Figure 6 The cross shown represents some of the second edge bands. A circle is fitted using the least squares method, and the center of the stud is obtained.
[0167] like Figure 8 As shown, calculate the coordinates of the center of each stud in the H&V coordinate system. Based on the principle of perpendicularity from a point to a line, obtain the coordinate values and calculate the difference between them and their standard coordinate values to obtain the positional degree.
[0168] In some embodiments, such as Figure 12 As shown, this application embodiment also provides an electronic device 1200, including a processor 1201, a memory 1202, and a computer program stored in the memory 1202 and executable on the processor 1201. When the program is executed by the processor 1201, it implements the various processes of the above-described position detection method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0169] It should be noted that the electronic devices in the embodiments of this application include the aforementioned mobile electronic devices and non-mobile electronic devices.
[0170] Figure 13 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.
[0171] The electronic device 1300 includes, but is not limited to, components such as: radio frequency unit 1301, network module 1302, audio output unit 1303, input unit 1304, sensor 1305, display unit 1306, user input unit 1307, interface unit 1308, memory 1309, and processor 1310.
[0172] Those skilled in the art will understand that the electronic device 1300 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 1310 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 13 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0173] The input unit 1304, in this embodiment of the application, is a camera, used to acquire first region images at multiple boundaries of the workpiece 610 and second region images at the stud to be tested in the workpiece 610, with each boundary corresponding to at least one first region image;
[0174] The processor 1310 is used to determine, based on the first region image and the second region image, the first coordinate information corresponding to multiple boundaries and the second coordinate information corresponding to the stud to be measured. The first coordinate information and the second coordinate information are coordinate information in a first coordinate system, which is the coordinate system corresponding to the image acquisition device 530.
[0175] Based on the first coordinate information, a second coordinate system corresponding to workpiece 610 is established, and the center point of the second coordinate system is determined.
[0176] Based on the second coordinate information, the coordinate information of the stud under test in the second coordinate system is calculated, and the position of the stud under test relative to the center point of the coordinate system is determined.
[0177] According to the electronic device provided in the embodiments of this application, the image acquisition device 530 acquires the area image of the workpiece 610 boundary and the stud to be tested, calculates the position degree of the stud to be tested, and effectively improves the detection efficiency of the stud position degree while ensuring detection accuracy and reducing detection cost.
[0178] In some embodiments, the processor 1310 is further configured to:
[0179] Each first region image is divided into multiple first sub-regions, and edge detection is performed on each of the multiple first sub-regions to obtain multiple first edge points corresponding to each boundary.
[0180] First coordinate information is determined based on multiple first edge points.
[0181] In some embodiments, the processor 1310 is further configured to:
[0182] Based on multiple first edge points of each boundary, the first boundary line corresponding to each boundary is obtained by fitting.
[0183] Determine at least two first center lines corresponding to the first boundary lines of multiple boundaries, wherein two first boundary lines located in relative positions are used to determine a first center line;
[0184] A second coordinate system is established based on the intersection of at least two first center lines, and the intersection of at least two first center lines is determined as the center point of the coordinate system.
[0185] In some embodiments, the processor 1310 is further configured to:
[0186] The second region image is divided into multiple second sub-regions, and edge detection is performed on each of the multiple second sub-regions to obtain multiple second edge points of the workpiece 610 boundary;
[0187] Based on multiple second edge points, the center of the stud corresponding to the stud under test is obtained by fitting.
[0188] The second coordinate information is determined based on the center of the stud.
[0189] In some embodiments, the processor 1310 is further configured to:
[0190] Based on the second coordinate information, determine the stud coordinate information of the stud center in the second coordinate system;
[0191] The positional accuracy is determined based on the stud coordinate information and the standard coordinate information corresponding to the stud to be measured.
[0192] In some embodiments, the workpiece 610 includes a first boundary, a second boundary, a third boundary, and a fourth boundary. The first boundary and the third boundary are arranged opposite to each other, and the second boundary and the fourth boundary are arranged opposite to each other. The first boundary, the second boundary, the third boundary, and the fourth boundary define a closed region. The stud to be tested is located within the closed region. The input unit 1304 is also used to acquire first region images of the first boundary, the second boundary, the third boundary, and the fourth boundary, wherein each boundary corresponds to two first region images.
[0193] It should be understood that, in this embodiment, the input unit 1304 may include a graphics processing unit (GPU) 13041 and a microphone 13042. The GPU 13041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 1306 may include a display panel 13061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 1307 includes a touch panel 13071 and at least one of other input devices 13072. The touch panel 13071 is also called a touch screen. The touch panel 13071 may include a touch detection device and a touch controller. Other input devices 13072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.
[0194] The memory 1309 can be used to store software programs and various data. The memory 1309 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 1309 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 1309 in this embodiment includes, but is not limited to, these and any other suitable types of memory.
[0195] Processor 1310 may include one or more processing units; processor 1310 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 1310.
[0196] This application also provides a non-transitory computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described position detection method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0197] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0198] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described position detection method.
[0199] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0200] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described position detection method embodiments and achieve the same technical effect. To avoid repetition, it will not be described again here.
[0201] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0202] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0203] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0204] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
[0205] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0206] Although embodiments of this application have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of this application, the scope of which is defined by the claims and their equivalents.
Claims
1. A method of position detection, characterized by, include: The image acquisition device acquires first region images at multiple boundaries of the workpiece and second region images at the stud to be tested in the workpiece, with each boundary corresponding to at least one first region image; Based on the first region image and the second region image, the first coordinate information corresponding to the multiple boundaries and the second coordinate information corresponding to the stud to be measured are determined. The first coordinate information and the second coordinate information are coordinate information in a first coordinate system, which is the coordinate system corresponding to the image acquisition device. Based on the first coordinate information, a second coordinate system corresponding to the workpiece is established, and the center point of the second coordinate system is determined. Based on the second coordinate information, the coordinate information of the stud under test in the second coordinate system is calculated, and the position degree of the stud under test relative to the center point of the coordinate system is determined. The first coordinate information is determined through the following steps: Each first region image is divided into multiple first sub-regions, and edge detection is performed on each of the multiple first sub-regions to obtain multiple first edge points corresponding to each boundary. Based on the plurality of first edge points, the first coordinate information is determined; The step of establishing a second coordinate system corresponding to the workpiece based on the first coordinate information and determining the center point of the second coordinate system includes: Based on the plurality of first edge points of each boundary, the first boundary line corresponding to each boundary is fitted to obtain the first boundary line; At least two first center lines corresponding to the first boundary lines of the plurality of boundaries are determined, wherein two first boundary lines located in relative positions are used to determine one first center line. A second coordinate system is established based on the intersection of the at least two first center lines, and the intersection of the at least two first center lines is determined as the center point of the coordinate system.
2. The position detecting method according to claim 1, wherein The second coordinate information is determined through the following steps: The second region image is divided into multiple second sub-regions, and edge detection is performed on each of the multiple second sub-regions to obtain multiple second edge points of the workpiece boundary; Based on the multiple second edge points, the center of the stud corresponding to the stud under test is obtained by fitting. The second coordinate information is determined based on the center of the stud.
3. The method of claim 2, wherein The step of calculating the coordinate information of the stud under test in the second coordinate system based on the second coordinate information, and determining the positional degree of the stud under test relative to the center point of the coordinate system, includes: Based on the second coordinate information, determine the stud coordinate information of the stud center in the second coordinate system; The positional accuracy is determined based on the stud coordinate information and the standard coordinate information corresponding to the stud to be measured.
4. The method of detecting the position degree according to any one of claims 1 to 3, characterized by, The workpiece includes a first boundary, a second boundary, a third boundary, and a fourth boundary. The first boundary and the third boundary are arranged opposite to each other, and the second boundary and the fourth boundary are arranged opposite to each other. The first boundary, the second boundary, the third boundary, and the fourth boundary define a closed region. The stud to be tested is located within the closed region. Acquiring an image of the first region at the boundary using an image acquisition device includes: The image acquisition device acquires images of the first region, including the first boundary, the second boundary, the third boundary, and the fourth boundary, wherein each boundary corresponds to two images of the first region.
5. A position detecting device characterized by comprising: To implement the positional detection method as described in any one of claims 1-4, comprising: The acquisition module is used to acquire first region images at multiple boundaries of the workpiece and second region images at the stud to be tested in the workpiece through an image acquisition device, wherein each boundary corresponds to at least one first region image; The first processing module is used to determine, based on the first region image and the second region image, the first coordinate information corresponding to the multiple boundaries and the second coordinate information corresponding to the stud to be measured, wherein the first coordinate information and the second coordinate information are coordinate information in a first coordinate system, and the first coordinate system is the coordinate system corresponding to the image acquisition device; The second processing module is used to establish a second coordinate system corresponding to the workpiece based on the first coordinate information, and to determine the center point of the second coordinate system. The third processing module is used to calculate the coordinate information of the stud under test in the second coordinate system based on the second coordinate information, and to determine the position degree of the stud under test relative to the center point of the coordinate system.
6. A position detecting system characterized by comprising: include: A base for placing the workpiece; The bracket is mounted on the base; An image acquisition device is mounted on the bracket and is used to acquire image data of the workpiece. A controller, electrically connected to the image acquisition device, is used to determine the position of the stud to be tested on the workpiece based on the position detection method according to any one of claims 1-4.
7. The position detecting system of claim 6, wherein Also includes: A drive mechanism is electrically connected to a controller, which controls the drive mechanism to drive the image acquisition device to move along a first direction on the support. At least two workpieces are placed on the base along the first direction. The image acquisition device is used to acquire image data of the at least two workpieces.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the positional detection method as described in any one of claims 1-4.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the positional detection method as described in any one of claims 1-4.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the positional detection method as described in any one of claims 1-4.