Detection method, detection device, electronic device and computer-readable storage medium
By acquiring the projection image of the workpiece and fitting the target features in a step-by-step manner, the problem of inaccurate detection in the existing technology is solved, and high-precision measurement of the workpiece surface features is achieved. It is suitable for the detection of irregular-shaped workpieces such as mobile phone casings.
Patent Information
- Application Number
- CN202211585847.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-09
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2042-12-09
AI Technical Summary
Existing technologies are unable to accurately measure the depth of grooves and holes, or the height of protrusions on the surface of workpieces, resulting in inaccurate detection results that cannot meet the requirements of the precision industry.
The projection image of the workpiece in the first direction is obtained by the first imaging unit, and the preset position and basic feature parameters of the target feature of the workpiece are obtained in the second direction perpendicular to the first direction by the communication unit or the second imaging unit. The driving unit drives the workpiece and the second imaging unit to move relative to each other, and the advanced feature parameters are obtained step by step, and finally the contour features of the workpiece are fitted.
It improves the detection accuracy and forms a clear workpiece target feature image. It is suitable for the detection of irregular-shaped workpieces such as mobile phone casings, and increases the detection range and accuracy.
Smart Images

Figure CN116105622B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of detection technology, and in particular to a detection method, a detection device, an electronic device, and a computer-readable storage medium. Background Art
[0002] When detecting features on a workpiece surface (including the overall surface, the depth of grooves and holes on the side of the workpiece, or the height of protrusions), a stereoscopic image of the workpiece is generally first directly obtained through a visual component, and then the stereoscopic image is processed to obtain the contour features of the workpiece. However, the above-mentioned detection method can only roughly measure parameters such as the depth of grooves and holes, the height of protrusions, etc. of the features on the workpiece surface, and cannot accurately measure the depth of grooves and holes, or the height of protrusions. This is because when obtaining an image of the contour features, the focal length of the general visual component corresponds to the surface of the workpiece. Therefore, when obtaining an image of the grooves, holes, or protrusions on the workpiece surface, a clear image of these features on the workpiece surface cannot be formed, resulting in inaccurate measurement results. Therefore, this method cannot meet the requirements of some precision industries. Summary of the Invention
[0003] In view of the above, it is necessary to provide a detection method, a detection device, an electronic device and a computer-readable storage medium to improve the accuracy of detection.
[0004] The present invention provides a detection method, including:
[0005] Acquire a projection image of the workpiece in a first direction by a first imaging unit;
[0006] Acquire a preset position of a target feature of the workpiece and basic feature parameters of the target feature at the preset position by a communication unit or a second imaging unit in a second direction perpendicular to the first direction;
[0007] Based on the acquired projection image, the workpiece and the second imaging unit are driven by a driving unit to move relative to each other, so that the second imaging unit moves along the contour of the workpiece, and the advanced characteristic parameters of the target feature at the preset position are obtained by the second imaging unit with reference to the basic characteristic parameters of the target feature at the preset position in the second direction;
[0008] Fitting the projection image and advanced parameters of target features at preset positions to obtain contour features of the workpiece;
[0009] Whether the target feature of the workpiece is qualified is determined based on the fitted contour feature.
[0010] In the above detection method, the image used to obtain the basic feature parameters of the target feature at the preset position is the initial image formed by the target feature of the workpiece; the image used to obtain the advanced feature parameters of the target feature at the preset position is the advanced image formed by the target feature of the workpiece obtained after adjusting the initial image formed by the target feature of the workpiece; the image used to obtain the contour feature corresponding to the workpiece is obtained after adjusting the advanced image formed by the target feature of the workpiece, thereby forming a step-by-step acquisition method, and finally forming a clear image of the target feature of the workpiece, thereby improving the accuracy of detection.
[0011] In some embodiments, the step of acquiring the preset position of the target feature of the workpiece and the basic feature parameters of the target feature at the preset position by the communication unit or the second imaging unit in a second direction perpendicular to the first direction includes:
[0012] matching the projected image with a preset detection database;
[0013] If the projection image exists in the detection data storage, obtaining the preset position of the target feature of the workpiece corresponding to the projection image in the detection database and the basic feature parameters of the target feature at the preset position;
[0014] If the projection image does not exist in the detection database, the workpiece and the second imaging unit are driven to move relative to each other based on the projection image, so that the second imaging unit moves along the contour of the workpiece, and the preset position of the target feature of the workpiece and the basic feature parameters of the target feature at the preset position are obtained in the second direction through the second imaging unit.
[0015] In some embodiments, the step of driving the workpiece and the second imaging unit to move relative to each other based on the projected image so that the second imaging unit moves along the contour of the workpiece and the second imaging unit acquires the preset position of the target feature of the workpiece and the basic feature parameters of the target feature at the preset position includes:
[0016] Dividing the projection image based on a preset reference to obtain a plurality of branch images;
[0017] Acquire a preset position of a target feature on each of the branch images and a branch feature parameter of the target feature at the preset position;
[0018] The preset positions of the target features on the plurality of branch images and the plurality of branch feature parameters are fitted to respectively obtain the preset positions of the target features of the workpiece and the basic feature parameters of the target features at the preset positions.
[0019] In some embodiments, the preset reference is at least one of the curvature and the length of the projection image frame.
[0020] In some embodiments, the driving of the workpiece and the second imaging unit to move relative to each other based on the projected image so that the second imaging unit moves along the contour of the workpiece and the second imaging unit acquires the preset position of the target feature of the workpiece and the basic feature parameters of the target feature at the preset position in the second direction includes:
[0021] Based on the projected image, the workpiece and the second imaging unit are driven to move relative to each other, so that the second imaging unit moves along the contour of the workpiece, and the distance between the second imaging unit and the workpiece is kept unchanged to obtain an image of the workpiece in the second direction, and the preset position of the target feature of the workpiece and the basic feature parameters of the target feature at the preset position are obtained based on the image.
[0022] In some embodiments, the target feature of the workpiece includes at least one of a groove, a hole, or a protrusion, the basic feature parameter of the target feature includes the basic depth or basic height of the target feature, and the advanced feature parameter of the target feature includes the actual depth or actual height of the target feature.
[0023] In some embodiments, the step of obtaining the advanced feature parameters of the target feature at the preset position by the second imaging unit in the second direction with reference to the basic feature parameters of the target feature at the preset position includes:
[0024] In the second direction, the focal length of the second imaging unit is adjusted according to the basic characteristic parameters of the target feature at the preset position, thereby obtaining the advanced characteristic parameters of the target feature at the preset position.
[0025] In some embodiments, the step of obtaining the advanced feature parameters of the target feature at the preset position by referring to the basic feature parameters of the target feature at the preset position in the second direction by the second imaging unit includes:
[0026] In the second direction, the distance between the second imaging unit and the side surface of the workpiece is adjusted according to the basic characteristic parameters of the target feature at the preset position, thereby obtaining the advanced characteristic parameters of the target feature at the preset position.
[0027] In some embodiments, the step of adjusting the distance between the second imaging unit and the workpiece according to the basic characteristic parameters of the target characteristic at the preset position includes:
[0028] According to the basic depth or basic height of the target feature of the workpiece, the distance between the second imaging unit and the target feature of the workpiece is kept unchanged, thereby achieving adjustment of the distance between the second imaging unit and the workpiece.
[0029] In some embodiments, the step of acquiring a projection image of the workpiece in the first direction by the first imaging unit includes:
[0030] Acquiring a surface profile of the workpiece in the first direction;
[0031] The surface profile is adjusted based on a standard profile of the workpiece to acquire the projection image.
[0032] The present application also provides a detection device, including:
[0033] A first imaging unit, configured to acquire a projection image of the workpiece in a first direction;
[0034] a driving unit, configured to drive the workpiece and the second imaging unit to move relative to each other based on the projection image, so that the second imaging unit moves along the contour of the workpiece;
[0035] a communication unit, configured to obtain a preset position of a target feature of the workpiece and basic feature parameters of the target feature at the preset position in a second direction perpendicular to the first direction;
[0036] a second imaging unit, communicatively connected to the communication unit, to obtain a preset position of the target feature of the workpiece and basic characteristic parameters of the target feature at the preset position, or the second imaging unit directly obtains the preset position of the target feature of the workpiece in a second direction perpendicular to the first direction and the basic characteristic parameters of the target feature at the preset position, and the second imaging unit is further used to obtain advanced characteristic parameters of the target feature at the preset position in the second direction with reference to the basic characteristic parameters of the target feature at the preset position;
[0037] a processing unit, communicating with the first imaging unit and the second imaging unit to obtain the projection image and advanced feature parameters of the target feature at the preset position, the processing unit being configured to fit the projection image and the advanced parameters of the target feature at the preset position to obtain the contour feature of the workpiece;
[0038] An analysis unit is connected to the processing unit for analyzing whether the target feature of the workpiece is qualified according to the fitted contour feature.
[0039] In some embodiments, the detection device further comprises:
[0040] The storage unit stores a preset detection database; wherein,
[0041] The communication unit is communicatively connected with the storage unit, the first imaging unit and the driving unit. The communication unit is also used to match the projection image with a preset detection database, and when the projection image exists in the detection data storage, obtain the preset position of the target feature on the side of the workpiece corresponding to the projection image in the detection database and the basic characteristic parameters of the target feature at the preset position; the communication unit is also used to start the second imaging unit and the driving unit when the projection image does not exist in the detection database, and drive the workpiece and the second imaging unit to move relative to each other according to the projection image, so that the second imaging unit moves along the contour of the workpiece, and the second imaging unit obtains the preset position of the target feature of the workpiece and the basic characteristic parameters of the target feature at the preset position in the second direction.
[0042] An embodiment of the present application further provides an electronic device, including:
[0043] Memory, for storing computer instructions;
[0044] A processor is coupled to the memory and is used to call computer instructions in the memory so that the electronic device executes the detection method described in any one of the above embodiments.
[0045] An embodiment of the present application further provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the detection method described in any one of the above embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 This is a flow chart of the detection method according to an embodiment of the present application.
[0047] Figure 2 This is a projection image of the workpiece in the first direction of the embodiment of the present application.
[0048] Figure 3 This is a flowchart of step S10 in an embodiment of the present application.
[0049] Figure 4 This is a flowchart of step S20 in an embodiment of the present application.
[0050] Figure 5 This is a flowchart of step S23 in the embodiment of the present application.
[0051] Figure 6 for Figure 2 The state diagram of the projection image after being divided in step S231.
[0052] Figure 7 for Figure 2 The projection of the contour of the workpiece in the first direction.
[0053] Figure 8 Schematic diagram of the composition of the detection device according to an embodiment of the present application.
[0054] Figure 9A and Figure 9B Schematic diagram of the composition of the electronic device in the embodiment of the present application.
[0055] Description of main component symbols
[0056] Detection device 10
[0057] First imaging unit 11
[0058] Drive unit 12
[0059] Communication Unit 13
[0060] Second imaging unit 14
[0061] Processing unit 15
[0062] Analysis Unit 16
[0063] Storage unit 17
[0064] First branch image 001
[0065] Second branch image 002 DETAILED DESCRIPTION
[0066] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and should not be understood as limiting the present application.
[0067] In the description of the present application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present application. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the said features. In the description of the present application, "multiple" means two or more, unless otherwise clearly and specifically defined.
[0068] In the description of this application, it should be noted that, unless otherwise expressly specified or limited, the terms "installed," "connected," and "connected" should be understood in a broad sense. For example, they can refer to fixed connections, detachable connections, or integral connections; they can refer to mechanical connections, electrical connections, or mutual communication; they can refer to direct connections or indirect connections through an intermediate medium; they can refer to internal communication between two components or the interaction between two components. Those skilled in the art will understand the specific meanings of the above terms in this application based on specific circumstances.
[0069] The present application provides an inspection method for determining whether a target feature of a workpiece is qualified. The inspection method includes: obtaining a projection image of the workpiece in a first direction via a first imaging unit; obtaining a preset position of the target feature of the workpiece and basic characteristic parameters of the target feature at the preset position via a communication unit or a second imaging unit in a second direction perpendicular to the first direction; driving the workpiece and the second imaging unit to move relative to each other based on the obtained projection image via a driving unit, so that the second imaging unit moves along the contour of the workpiece, and obtaining advanced characteristic parameters of the target feature at the preset position in the second direction by reference to the basic characteristic parameters of the target feature at the preset position via the second imaging unit; fitting the projection image and the advanced parameters of the target feature at the preset position to obtain the contour features of the workpiece; and determining whether the target feature of the workpiece is qualified based on the fitted contour features. The workpiece may be a mobile phone housing, a tablet housing, or the like.
[0070] In the above detection method, the image used to obtain the basic feature parameters of the target feature at the preset position is the initial image formed by the target feature of the workpiece; the image used to obtain the advanced feature parameters of the target feature at the preset position is the advanced image formed by the target feature of the workpiece obtained after adjusting the initial image formed by the target feature of the workpiece; the image used to obtain the contour feature corresponding to the workpiece is obtained after adjusting the advanced image formed by the target feature of the workpiece. A step-by-step acquisition method is adopted to finally form a clear image of the target feature of the workpiece, thereby improving the accuracy of detection.
[0071] See Figure 1 , Figure 1 This is a flow chart of the detection method of the embodiment of the present application, which includes:
[0072] S10: Acquire a projection image of the workpiece in a first direction by a first imaging unit.
[0073] Specifically, the projection image is the outline of the workpiece, such as a triangle, a rectangle, etc. The first imaging unit may be a camera, or may further include a light source capable of irradiating the workpiece to form a projection image in the first direction.
[0074] See Figure 2 , Figure 2 This is the projection image of the workpiece in the embodiment of the present application. In this embodiment, the projection image of the workpiece is rectangular, but not limited to this.
[0075] See Figure 3 In some embodiments, acquiring a projection image of the workpiece in the first direction by the first imaging unit in step S10 includes:
[0076] S11, obtaining a surface profile of the workpiece in a first direction.
[0077] S12, adjusting the surface profile based on a standard profile of the workpiece to obtain a projection image.
[0078] Specifically, the surface profile of the workpiece obtained in step S11 is compared with the standard profile of the workpiece. The two will have proportional differences due to the acquisition method. Step S12 can be used to adjust the size ratio between the obtained surface profile and the standard profile to improve the accuracy of the parameters in the obtained target features.
[0079] Furthermore, the adjustment in step S12 can be performed manually, or calculations and instructions for executing the adjustment can be generated and stored in the first imaging unit, causing the first imaging unit to sequentially execute steps S11 and S12. Preferably, in step S12, the adjustment ratio between the standard profile and the surface profile of the workpiece is 1:1.
[0080] S20 , acquiring a preset position of a target feature of the workpiece and basic feature parameters of the target feature at the preset position on a second plane perpendicular to the first direction through a communication unit or a second imaging unit.
[0081] Specifically, the target feature of the workpiece includes at least one of a groove, a hole or a protrusion, and the basic feature parameter of the target feature includes a basic depth or a basic height of the target feature, that is, the basic depth of the groove or hole, and the basic height of the protrusion.
[0082] It should be noted that the second direction is a general direction in which the external acquisition component is used to acquire the preset position of the target feature of the workpiece and the basic characteristic parameters of the target feature at the preset position. Specifically, the second direction can be a fixed direction, for example, the external acquisition component is stationary and the workpiece rotates relative to the external acquisition component, or a dynamic direction, for example, the workpiece is stationary and the external acquisition component rotates relative to the workpiece.
[0083] It should be noted that the basic height refers to a range of protrusion height values, that is, the blur value that can be obtained by using an external component (hereinafter referred to as the second imaging unit) at a certain focal length during initial acquisition. This means that an accurate height value cannot be obtained using this focal length, but the obtained basic height can be used to adjust the focal length to obtain an accurate height value. Similarly, the basic depth refers to a range of groove or hole depth values.
[0084] See Figure 4 In some embodiments, in step S20, obtaining the preset position of the target feature of the workpiece and the basic feature parameters of the target feature at the preset position on the second plane perpendicular to the first direction by the communication unit or the second imaging unit includes:
[0085] S21, matching the projected image with a preset detection database.
[0086] Specifically, the preset detection database is used to record the projection image of the first workpiece in different batches of workpieces in the first direction and the basic feature parameters of the target features corresponding to the projection image, and the preset detection database can be updated in real time.
[0087] S22: If the projection image exists in the detection data storage, the preset position of the target feature of the workpiece corresponding to the projection image and the basic feature parameters of the target feature at the preset position are obtained in the detection database.
[0088] Specifically, the preset position of the target feature of the workpiece in step S22 refers to the position of the target feature on the workpiece, such as the position relative to a preset point or a specific point.
[0089] At step S23, if the projected image does not exist in the inspection database, the workpiece and the second imaging unit are driven to move relative to each other based on the projected image, such that the second imaging unit moves along the contour of the workpiece. The second imaging unit then obtains the preset position of the target feature on the side of the workpiece and basic characteristic parameters of the target feature at the preset position. In this manner, by causing the workpiece and the second imaging unit to move relative to each other, the second imaging unit can scan along the contour of the workpiece. Since the second imaging unit only scans along the contour of the workpiece, it can only obtain the preset position of the target feature and corresponding basic characteristic parameters, such as basic depth or basic height.
[0090] In some embodiments, in step S23, based on the projection image, the workpiece and the second imaging unit are driven to move relative to each other, so that the second imaging unit moves along the contour of the workpiece, and the second imaging unit obtains the preset position of the target feature of the workpiece and the basic characteristic parameters of the target feature at the preset position in the second direction. The method includes: based on the projection image, the workpiece and the second imaging unit are driven to move relative to each other, so that the second imaging unit moves along the contour of the workpiece, and the distance between the second imaging unit and the workpiece is kept unchanged to obtain an image of the workpiece in the second direction, and obtain the preset position of the target feature of the workpiece and the basic characteristic parameters of the target feature at the preset position based on the image.
[0091] Specifically, the contour of the workpiece can be determined by projecting an image. The workpiece and the second imaging unit can then be moved relative to each other. Alternatively, the workpiece can be moved while the second imaging unit remains stationary, or the workpiece remains stationary while the second imaging unit moves. The motion trajectory of the workpiece and the second imaging unit follows the contour of the workpiece. Since the corresponding parameters of the target feature on the workpiece are not yet known, it is necessary to maintain a constant distance between the second imaging unit and the workpiece during the relative motion to obtain an image of the workpiece in the second direction. The obtained image is then analyzed to determine the preset position of the target feature on the workpiece and the basic characteristic parameters of the target feature at the preset position.
[0092] Therefore, by matching the projection image with the preset inspection database, different operation modes can be performed for different batches of workpieces, avoiding repeated execution of step S23 for the same batch of workpieces, thereby improving inspection efficiency.
[0093] See Figure 5 In some embodiments, in step S23, the workpiece and the second imaging unit are driven to move relative to each other based on the projected image, so that the second imaging unit moves along the contour of the workpiece, so that the second imaging unit obtains the preset position of the target feature on the side surface of the workpiece and the basic characteristic parameters of the target feature at the preset position, including:
[0094] S231 , dividing the projection image based on a preset reference to obtain a plurality of branch images.
[0095] In actual operations, an imaging device is typically used to obtain the preset position of a target feature on a workpiece and the underlying characteristics of the target feature at the preset position based on a projected image. Because the range of a typical imaging device is limited in a single image, particularly when a workpiece has large corners or a single target feature formed on two adjacent sides, the projected image can be divided to facilitate image capture by the imaging device. In some embodiments, if the workpiece is rectangular, the workpiece can be divided along its circumference.
[0096] In some embodiments, the preset benchmark is at least one of the curvature and length of the projected image frame. For example, for a projected image with multiple frames, adjacent frames can be divided based on their curvature. For a projected image with a single, excessively long frame, the division can be based on the image capture length of the image capture device, or a combination of the two.
[0097] See Figure 6 In this embodiment, the portion with a curvature of 0 in the projection frame is taken as a separate branch image and positioned as the first branch image 001 , and the portion with a curvature not equal to 0 is taken as a separate branch image and defined as the second branch image 002 .
[0098] S232: Obtain a preset position of a target feature on each branch image and a branch feature parameter of the target feature at the preset position.
[0099] S233 , fitting the preset positions of the target features on the multiple branch images and the multiple branch feature parameters to respectively obtain the preset positions of the target features of the workpiece and the basic feature parameters of the target features at the preset positions.
[0100] Therefore, by dividing the projection pattern, the cost of detection can be reduced.
[0101] S30, based on the acquired projection image, the workpiece and the second imaging unit are driven to move relative to each other by the driving unit, so that the second imaging unit moves along the contour of the workpiece, and the advanced feature parameters of the target feature at the preset position are obtained by the second imaging unit with reference to the basic feature parameters of the target feature at the preset position in the second direction.
[0102] Specifically, the advanced feature parameter of the target feature includes the actual depth or actual height of the target feature.
[0103] In some embodiments, obtaining the advanced feature parameters of the target feature at the preset position by the second imaging unit in step S30 with reference to the basic feature parameters of the target feature at the preset position in the second direction includes: adjusting the focal length of the second imaging unit in the second direction based on the basic feature parameters of the target feature at the preset position, thereby obtaining the advanced feature parameters of the target feature at the preset position. In this way, by referencing the basic feature parameters of the target feature at the preset position, such as the basic depth of a groove at a certain position, the focal length of the second imaging unit can be adjusted when the second imaging unit is scanning the groove at that position, so that the second imaging unit can still form a relatively clear image when scanning the groove, and then the actual depth of the groove at that position can be determined based on the clear image.
[0104] In other embodiments, step S30 of obtaining the advanced characteristic parameters of the target feature at the preset position by the second imaging unit with reference to the basic characteristic parameters of the target feature at the preset position in the second direction includes: adjusting the distance between the second imaging unit and the workpiece in the second direction according to the basic characteristic parameters of the target feature at the preset position, thereby obtaining the advanced characteristic parameters of the target feature at the preset position. In this way, by referring to the basic characteristic parameters of the target feature at the preset position, such as the basic depth of the groove at a certain position, the distance between the second imaging unit and the workpiece can be adjusted when the second imaging unit is scanning the groove at that position, so that when the second imaging unit is scanning the groove, even if the focal length of the second imaging unit is not adjusted, a clear image of the groove can still be formed, and then the actual depth of the groove at that position can be obtained based on the clear image. In this embodiment, the distance between the second imaging unit and the workpiece refers to the distance between the second imaging unit and the contour of the workpiece.
[0105] Specifically, for example Figure 2 If the rectangular workpiece shown has a groove on its side, its outline remains rectangular when viewed from the first direction, i.e., perpendicular to the paper, and the groove on its side is formed by a recessed groove. Therefore, when using the second imaging unit to obtain advanced feature parameters, if there are no target features, the distance between the second imaging unit and the workpiece is maintained at the focal length of the second imaging unit. When scanning the target feature, such as a groove, the second imaging unit is translated toward the workpiece by the depth of the groove, that is, the distance between the second imaging unit and the workpiece is reduced so that the distance between the second imaging unit and the groove bottom is equal to the focal length of the second imaging unit, thereby forming a clear image of the groove.
[0106] In some embodiments, the above-mentioned adjustment of the distance between the second imaging unit and the workpiece based on the basic characteristic parameters of the target feature at the preset position includes: keeping the distance between the second imaging unit and the target feature of the workpiece unchanged based on the basic depth or basic height of the target feature of the workpiece, thereby adjusting the distance between the second imaging unit and the workpiece.
[0107] S40 , fitting the projection image and the advanced parameters of the target feature at the preset position to obtain the contour feature of the workpiece.
[0108] Specifically, the preset position of the target feature in the projection image can be obtained by step S20. In this step, the advanced parameters of the target feature at the projection image and the preset position are fitted to obtain the contour features of the workpiece, that is, the three-dimensional features of the workpiece, including the preset position and actual size of the target feature on the workpiece (including the actual depth of the groove or hole, and the actual height of the protrusion).
[0109] For example, Figure 7 The figure illustrates a projection of the outline of a workpiece in a first direction in an embodiment. In this figure, the groove, hole, etc. on the workpiece penetrates the first workpiece along the first direction.
[0110] S50: judging whether the target feature of the workpiece is qualified according to the fitted contour feature.
[0111] Specifically, the contour features of the workpiece obtained in step S40 can be compared with the standard contour features of the workpiece. If the error is within the preset range, the target features of the detected workpiece are qualified; if the error is outside the preset range, the target features of the detected workpiece are unqualified.
[0112] Please also see Figure 8 The embodiment of the present application further provides a detection device 10, comprising a first imaging unit 11, a driving unit 12, a communication unit 13, a second imaging unit 14, a processing unit 15 and an analysis unit 16. The first imaging unit 11 is used to obtain a projection image of a workpiece in a first direction; the driving unit 12 is used to drive the workpiece and the second imaging unit 14 to move relative to each other based on the projection image, so that the second imaging unit 14 moves along the contour of the workpiece; the communication unit 13 is used to obtain a preset position of a target feature of the workpiece and basic characteristic parameters of the target feature at the preset position in a second direction perpendicular to the first direction; the second imaging unit 14 is connected to the communication unit 13 in communication to obtain the preset position of the target feature of the workpiece and basic characteristic parameters of the target feature at the preset position, or the second imaging unit 14 directly obtains the target feature of the workpiece in the second direction perpendicular to the first direction. The preset position of the target feature and the basic feature parameters of the target feature at the preset position, the second imaging unit 14 is also used to obtain the advanced feature parameters of the target feature at the preset position with reference to the basic feature parameters of the target feature at the preset position in the second direction; the processing unit 15 is communicated with the first imaging unit 11 and the second imaging unit 14 to obtain the projection image and the advanced feature parameters of the target feature at the preset position, the processing unit 15 is used to fit the projection image and the advanced parameters of the target feature at the preset position to obtain the contour feature of the workpiece; the analysis unit 16 is communicated with the processing unit 15, and is used to analyze whether the target feature of the workpiece is qualified according to the fitted contour feature.
[0113] The detection device 10 can execute the above-mentioned detection method. In the above-mentioned detection method, the image used to obtain the basic characteristic parameters of the target feature of the preset position is the initial image formed by the target feature of the workpiece. The image used to obtain the advanced characteristic parameters of the target feature of the preset position is the advanced image formed by the target feature of the workpiece obtained after adjustment based on the initial image formed by the target feature of the workpiece. The image used to obtain the contour feature of the workpiece is obtained after adjustment based on the advanced image formed by the target feature of the workpiece. In this way, a step-by-step acquisition method is formed, and finally a clear image of the target feature of the workpiece is formed, thereby improving the accuracy of detection. Therefore, using the detection device 10 to execute the above-mentioned detection method can improve the accuracy of detection.
[0114] See Figure 8 In some embodiments, the detection device 10 further includes a storage unit 17, which stores a preset detection database. The communication unit 13 is communicatively connected to the first imaging unit 11, the storage unit 17, and the drive unit 12. The communication unit 13 is configured to match the projection image with the preset detection database, and when a projection image exists in the detection database, obtain the preset position of the target feature on the side of the workpiece corresponding to the projection image and the basic characteristic parameters of the target feature at the preset position in the detection database. The communication unit 13 is also configured to activate the second imaging unit 14 and the drive unit 12 when the projection image does not exist in the detection database, and drive the workpiece and the second imaging unit 14 to move relative to each other based on the projection image, so that the second imaging unit 14 moves along the contour of the workpiece, and the second imaging unit 14 obtains the advanced characteristic parameters of the target feature at the preset position in the second direction with reference to the basic characteristic parameters of the target feature at the preset position.
[0115] The present application embodiment also provides an electronic device 20. In one embodiment, see Figure 9A The electronic device 20 includes a memory 21 and a processor 22. The memory 21 is used to store computer instructions 211. The processor 22 is coupled to the memory 21 and is used to call the computer instructions 211 in the memory 21 so that the electronic device 20 executes the detection method of any of the above embodiments. In this embodiment, the processor 22 is a component of the electronic device 20, and the memory 21 is located outside the electronic device 20. The processor 22 and the memory 21 are transmitted using a cloud-coupled method.
[0116] See Figure 9BIn another embodiment, electronic device 20 includes a memory 21 and a processor 22. Memory 21 is configured to store computer instructions 211. Processor 22 is coupled to memory 21 and configured to invoke computer instructions 211 in memory 21, causing electronic device 20 to execute the detection method of any of the above embodiments. In this embodiment, processor 22 and memory 21 are both components of electronic device 20.
[0117] The electronic device 20 can perform the above-mentioned detection method. In the above-mentioned detection method, the projected image, the preset position of the side of the workpiece, the basic characteristic parameters of the target feature, and the advanced characteristic parameters of the target feature are all two-dimensional features. By fitting the projected image and the advanced characteristic parameters of the target feature, the contour characteristics of the workpiece, i.e., the three-dimensional characteristics of the workpiece, are obtained. This method is applicable to the detection of irregularly shaped workpieces and increases the detection range. In addition, the target characteristic parameters of the workpiece are obtained by referring to the basic parameters of the target feature, which increases the accuracy of the corresponding parameters of the target feature, thereby improving the accuracy of the detection. Therefore, using an electronic device to perform the above-mentioned detection method can improve the accuracy and range of detection.
[0118] In some embodiments, the memory 21 may include a high-speed random access memory and may also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage device.
[0119] In some embodiments, the electronic device 20 may be a microcomputer including a processor 22, which is configured to load the above instructions to execute the above detection method. The processor 22 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU).
[0120] If the module / unit integrated in the electronic device 20 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware devices through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory and other memories, etc.
[0121] An embodiment of the present application further provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on the electronic device 20, the electronic device 20 executes the detection method of any of the above embodiments.
[0122] In the embodiments provided herein, it should be understood that the disclosed devices and methods may be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units described is merely a logical function division, and actual implementation may employ other division methods.
[0123] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed across multiple network elements. Some or all of the modules may be selected to achieve the purpose of the solution of this embodiment according to actual needs.
[0124] It will be apparent to those skilled in the art that the present application is not limited to the details of the exemplary embodiments described above, and that the present application can be implemented in other specific forms without departing from the spirit or essential characteristics of the present application. Therefore, the embodiments should be considered in all respects as illustrative and non-restrictive, and the scope of the present application is defined by the appended claims rather than the foregoing description, and all variations that come within the meaning and range of equivalents of the claims are intended to be embraced herein.
[0125] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and are not intended to limit the present application. Although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present application.
Claims
1. A detection method, characterized in that: include: Acquire a projection image of the workpiece in a first direction by a first imaging unit; Acquire a preset position of a target feature of the workpiece and basic feature parameters of the target feature at the preset position by a communication unit or a second imaging unit in a second direction perpendicular to the first direction; Based on the acquired projection image, the workpiece and the second imaging unit are driven by a driving unit to move relative to each other, so that the second imaging unit moves along the contour of the workpiece, and the advanced feature parameters of the target feature at the preset position are obtained by the second imaging unit with reference to the basic feature parameters of the target feature at the preset position in the second direction, wherein the basic feature parameters of the target feature include a basic depth or a basic height of the target feature, and the advanced feature parameters of the target feature include an actual depth or an actual height of the target feature. The obtaining of the advanced feature parameters of the target feature at the preset position by the second imaging unit with reference to the basic feature parameters of the target feature at the preset position in the second direction includes: adjusting the focal length of the second imaging unit in the second direction according to the basic feature parameters of the target feature at the preset position, thereby obtaining the advanced feature parameters of the target feature at the preset position, or adjusting the distance between the second imaging unit and the side surface of the workpiece in the second direction according to the basic feature parameters of the target feature at the preset position, thereby obtaining the advanced feature parameters of the target feature at the preset position; Fitting the projection image and advanced parameters of target features at preset positions to obtain contour features of the workpiece; Whether the target feature of the workpiece is qualified is determined based on the fitted contour feature.
2. The detection method according to claim 1, wherein The step of acquiring the preset position of the target feature of the workpiece and the basic feature parameters of the target feature at the preset position by the communication unit or the second imaging unit in a second direction perpendicular to the first direction includes: matching the projected image with a preset detection database; If the projection image exists in the detection data storage, obtaining the preset position of the target feature of the workpiece corresponding to the projection image in the detection database and the basic feature parameters of the target feature at the preset position; If the projection image does not exist in the detection database, the workpiece and the second imaging unit are driven to move relative to each other based on the projection image, so that the second imaging unit moves along the contour of the workpiece, and the preset position of the target feature of the workpiece and the basic feature parameters of the target feature at the preset position are obtained in the second direction through the second imaging unit.
3. The detection method according to claim 2, wherein The step of driving the workpiece and the second imaging unit to move relative to each other based on the projected image so that the second imaging unit moves along the contour of the workpiece and the second imaging unit acquires the preset position of the target feature of the workpiece and the basic feature parameters of the target feature at the preset position includes: Dividing the projection image based on a preset reference to obtain a plurality of branch images; Acquire a preset position of a target feature on each of the branch images and a branch feature parameter of the target feature at the preset position; The preset positions of the target features on the plurality of branch images and the plurality of branch feature parameters are fitted to respectively obtain the preset positions of the target features of the workpiece and the basic feature parameters of the target features at the preset positions.
4. The detection method according to claim 3, wherein The preset reference is at least one of the curvature and the length of the projection image frame.
5. The detection method according to claim 2, wherein The step of driving the workpiece and the second imaging unit to move relative to each other based on the projection image so that the second imaging unit moves along the contour of the workpiece and the second imaging unit acquires the preset position of the target feature of the workpiece and the basic feature parameters of the target feature at the preset position in the second direction includes: Based on the projected image, the workpiece and the second imaging unit are driven to move relative to each other, so that the second imaging unit moves along the contour of the workpiece, and the distance between the second imaging unit and the workpiece is kept unchanged to obtain an image of the workpiece in the second direction, and the preset position of the target feature of the workpiece and the basic feature parameters of the target feature at the preset position are obtained based on the image.
6. The detection method according to claim 1, wherein The target feature of the workpiece includes at least one of a groove, a hole, or a protrusion.
7. The detection method according to claim 1, wherein The step of adjusting the distance between the second imaging unit and the workpiece according to the basic characteristic parameters of the target characteristic at the preset position includes: According to the basic depth or basic height of the target feature of the workpiece, the distance between the second imaging unit and the target feature of the workpiece is kept unchanged, thereby achieving adjustment of the distance between the second imaging unit and the workpiece.
8. The detection method according to claim 1, wherein The step of acquiring a projection image of the workpiece in the first direction by the first imaging unit includes: Acquiring a surface profile of the workpiece in the first direction; The surface profile is adjusted based on a standard profile of the workpiece to acquire the projection image.
9. A detection device, characterized in that: include: A first imaging unit, configured to acquire a projection image of the workpiece in a first direction; a driving unit, configured to drive the workpiece and the second imaging unit to move relative to each other based on the projection image, so that the second imaging unit moves along the contour of the workpiece; a communication unit, configured to obtain a preset position of a target feature of the workpiece and basic feature parameters of the target feature at the preset position in a second direction perpendicular to the first direction; a second imaging unit, communicatively connected to the communication unit to obtain the preset position of the target feature of the workpiece and basic feature parameters of the target feature at the preset position, or the second imaging unit directly obtains the preset position of the target feature of the workpiece in a second direction perpendicular to the first direction and the basic feature parameters of the target feature at the preset position, the second imaging unit is further used to obtain advanced feature parameters of the target feature at the preset position with reference to the basic feature parameters of the target feature at the preset position in the second direction, wherein the basic feature parameters of the target feature include a basic depth or a basic height of the target feature, and the advanced feature parameters of the target feature include an actual depth or an actual height of the target feature, and obtaining the advanced feature parameters of the target feature at the preset position by referring to the basic feature parameters of the target feature at the preset position in the second direction by the second imaging unit includes: adjusting the focal length of the second imaging unit in the second direction according to the basic feature parameters of the target feature at the preset position, thereby obtaining the advanced feature parameters of the target feature at the preset position, or adjusting the distance between the second imaging unit and the side surface of the workpiece in the second direction according to the basic feature parameters of the target feature at the preset position, thereby obtaining the advanced feature parameters of the target feature at the preset position; a processing unit, communicating with the first imaging unit and the second imaging unit to obtain the projected image and the advanced feature parameters of the target feature at the preset position, wherein the processing unit is used to fit the projected image and the advanced parameters of the target feature at the preset position to obtain the contour feature of the workpiece; An analysis unit is connected to the processing unit for analyzing whether the target feature of the workpiece is qualified according to the fitted contour feature.
10. The detection device according to claim 9, wherein: The detection device also includes: The storage unit stores a preset detection database; wherein, The communication unit is communicatively connected with the storage unit, the first imaging unit and the driving unit. The communication unit is also used to match the projection image with a preset detection database, and when the projection image exists in the detection data storage, obtain the preset position of the target feature on the side of the workpiece corresponding to the projection image in the detection database and the basic characteristic parameters of the target feature at the preset position; the communication unit is also used to start the driving unit and the second imaging unit when the projection image does not exist in the detection database, and drive the workpiece and the second imaging unit to move relative to each other based on the projection image, so that the second imaging unit moves along the contour of the workpiece, and the second imaging unit obtains the preset position of the target feature of the workpiece and the basic characteristic parameters of the target feature at the preset position in the second direction.
11. An electronic device, characterized in that: include: Memory, for storing computer instructions; A processor, coupled to the memory, is configured to call computer instructions in the memory so that the electronic device executes the detection method according to any one of claims 1 to 8.
12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the detection method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Automatic measurement equipment for profile and position of logo mounting hole
CN104482883A
Device for measuring form and position parameters of leaf-shaped holes of aeroengine
CN107084683A