Dual-camera size measuring device and workpiece size measuring method
Through the dual camera size measurement device and various lighting schemes, the problem of measurement accuracy and cost of larger objects in the existing technology has been solved, and the precise measurement and cost of multiple workpieces have been achieved.
Patent Information
- Application Number
- CN202411593725.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-01-28
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art is difficult to measure objects with larger size spans while ensuring measurement accuracy, and the cost of using high-pixel cameras is high.
Adopt a dual -camera size measurement device. Through the combination of the first camera and the second camera, the lens with different pixels, combined with the lighting scheme of the coaxial light source and the far -hearted light source, select the appropriate camera according to the size and shape of the workpiece to be tested for the measurement of the workpiece to perform the appropriate camera for conduct Measurement.
A variety of workpieces with large span range are achieved accurately, reducing the cost of camera, while ensuring the accuracy of the measurement results.
Smart Images

Figure CN119374488A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of workpiece dimension measurement, and in particular to a dual-camera dimension measurement device and a workpiece dimension measurement method. Background Art
[0002] At present, there are two main methods for dimensional measurement: manual measurement and machine vision measurement. Manual measurement is inefficient and has high errors. The current machine vision solution for dimensional measurement is mainly completed by a single light source and a single camera. Affected by the field of view of the camera lens, it is impossible to measure objects with a large size span while ensuring measurement accuracy. If you want to measure objects with a large size span, you need to use an ultra-high pixel camera. For example, the pixel of the camera needs to reach hundreds of millions of pixels. Such a high-pixel camera is expensive to use. Summary of the invention
[0003] The object of the present invention is to provide a dual-camera dimension measuring device and a workpiece dimension measuring method, which can accurately measure a variety of workpieces with a large size span range under the premise of reducing costs.
[0004] The embodiment of the present invention is achieved as follows:
[0005] In a first aspect, the present invention provides a dual-camera size measurement device, comprising:
[0006] A base, a first camera, a second camera, a moving mechanism, a stage, a telecentric light source and a coaxial light source; the first camera, the second camera and the moving mechanism are all installed on the base, the first camera and the second camera are both installed with telecentric lenses, the pixels of the first camera are lower than the pixels of the second camera; the moving mechanism is installed on the base, the stage and the telecentric light source are both installed on the moving mechanism, the moving mechanism is used to drive the stage and the telecentric light source to move synchronously relative to the first camera or the second camera; the telecentric light source is used to emit a light beam from bottom to top; the coaxial light source is installed on the base, and the coaxial light source is used to emit a light beam from top to bottom.
[0007] In an optional embodiment, the base includes a bottom plate and a bracket, the bracket is mounted on the bottom plate, the first camera and the second camera are both mounted on the bracket and arranged at intervals in a first direction; the moving mechanism is mounted on the bracket, the moving mechanism is used to drive the carrier to slide back and forth in a first direction or a second direction, the second direction is perpendicular to the first direction; the first camera and the second camera are both used to receive a light beam propagating in the second direction.
[0008] Based on the above scheme, the first camera and the second camera are installed by the bracket, which facilitates the adjustment of the relative position relationship between the first camera and the second camera, reduces the difficulty of assembly, and improves the assembly efficiency. At the same time, by positioning the positions of the first camera and the second camera by the bracket, a space for adjusting the focal length of the first camera and the second camera relative to the workpiece to be measured can be formed between the first camera and the stage and between the second camera and the stage, thereby improving the accuracy of the measurement result.
[0009] In an optional embodiment, the coaxial light source is mounted on the bracket, and the coaxial light source is located below the first camera and fixed relative to the first camera.
[0010] Based on the above solution, the coaxial light source and the first camera are relatively fixed, and the positions of the two are not easy to change. When in use, the step of adjusting the relative position relationship between the two is omitted, thereby improving measurement efficiency.
[0011] In an optional embodiment, the carrier is configured as a light-transmitting member, and the carrier is mounted on top of the telecentric light source.
[0012] Based on the above scheme, the stage and the telecentric light source are relatively fixed, and the relative position between the two is not easy to change. There is no need to adjust the relative position between the two during use, which reduces the difficulty of operation, reduces errors, and improves measurement efficiency.
[0013] In an optional embodiment, a positioning block is installed on the carrier, and the positioning block is provided with a positioning groove for clamping the workpiece to be measured.
[0014] Based on the above solution, by providing a positioning block, the positioning stability of the shaft parts can be improved. The positioning block can be provided with a detachable matching structure with the carrier.
[0015] In an optional embodiment, the center line of the telecentric lens of the first camera cooperates with the center line of the telecentric lens of the second camera to define a first reference plane, the center line of the coaxial light source cooperates with the center line of the telecentric light source to define a second reference plane, and the first reference plane and the second reference plane coincide.
[0016] Based on the above scheme, the centers of the first camera, the second camera, the coaxial light source and the telecentric light source are located in the same plane. When adjusting the position, it is only necessary to adjust the position of the stage relative to the first camera or the second camera in the two-dimensional plane, which reduces the adjustment difficulty, shortens the operation time and improves the operation efficiency.
[0017] In a second aspect, the present invention provides a workpiece size measurement method, which is applicable to the dual-camera size measurement device described in any one of the aforementioned embodiments, and the method comprises the following steps:
[0018] Acquire feature information of the workpiece to be measured, select a first camera or a second camera for acquiring a contour image of the workpiece to be measured on the stage according to the feature information, and adjust the position of the stage relative to the first camera or the second camera by using a moving mechanism so that the workpiece to be measured on the stage is within the lens range of the first camera or the second camera;
[0019] The coaxial light source is turned on to use the first camera to capture the contour image of the workpiece to be measured; or the telecentric light source is turned on to use the second camera to obtain the contour image of the workpiece to be measured.
[0020] In an optional embodiment, in the step of obtaining characteristic information of the workpiece to be measured, when the surface of the workpiece to be measured is set as a cylindrical surface, and the cylindrical surface includes a connected annular spray-coated surface and an annular yellow zinc-plated surface, the second camera and the telecentric light source are selected to cooperate to perform dimensional measurement;
[0021] The workpiece to be measured is placed horizontally on the stage, the moving mechanism is used to drive the stage to move to the bottom of the second camera, the distance between the stage and the second camera is adjusted, the telecentric light source is turned on to illuminate the workpiece to be measured in a parallel backlighting manner, and the contour information of the workpiece to be measured is obtained by using the second camera.
[0022] Based on the above scheme, since the workpiece to be measured is a stepped shaft structure, and the surface of the workpiece to be measured includes a connected annular spray-painted surface and an annular yellow zinc-plated surface, the annular spray-painted surface, that is, the spray-painted area of the workpiece to be measured, has undergone a high-temperature baking leveling and curing process, and is uneven and reflective in the spray-painted area. At the same time, the workpiece to be measured is in the shape of a stepped shaft. In order to obtain a homogeneous image, the lens needs to have a large depth of field. In addition, since the yellow zinc-plated surface of the workpiece to be measured will have different degrees of reflectivity due to the quality of the galvanizing, it is necessary to distinguish the characteristics of the two surfaces when considering the lighting scheme. If a top-light diffuse light source or a top-light coaxial light source is used, diffuse reflection will occur, which will result in unclear boundaries when acquiring the image of the workpiece to be measured, which is not conducive to subsequent image processing and edge recognition. The use of a backlight solution can greatly suppress the diffuse reflection phenomenon of the plastic-sprayed surface, but the diffuse reflection backlight source will also cause reflection at the edge of the yellow zinc-plated area. Therefore, in this embodiment, a telecentric light source is used to illuminate the surface of the workpiece to be tested, and a parallel backlight lighting solution is used to respond to the surface features of the workpiece to be tested, which can maximize the suppression of the diffuse reflection phenomenon of the plastic-sprayed surface and the reflection phenomenon of the yellow zinc-plated surface.
[0023] In an optional embodiment, in the step of obtaining feature information of the workpiece to be measured, when the workpiece to be measured is provided with a plurality of through holes arranged at intervals and the edges are chamfered, the second camera and the telecentric light source are selected to cooperate in performing dimensional measurement.
[0024] Based on the above solution, when obtaining the outer edge contour image of the workpiece to be measured with a through hole and chamfered edges, the edge complexity is increased, and the use of top light illumination will aggravate the reflection phenomenon to produce edge blur or double edge problems, increase the difficulty of edge acquisition and reduce the accuracy of edge acquisition. Therefore, the parallel backlight lighting solution used in this embodiment can effectively suppress the edge blur and double edge problems caused by surface reflection and rounded corners.
[0025] In an optional embodiment, in the step of obtaining characteristic information of the workpiece to be measured, when the workpiece to be measured is provided with a groove and a lug is provided in the groove, the first camera and the coaxial light source are selected to cooperate to perform dimension measurement;
[0026] The workpiece to be measured is placed horizontally on the stage, the moving mechanism is used to drive the stage to move to the bottom of the first camera, the distance between the stage and the first camera is adjusted, the coaxial light source is turned on to illuminate the workpiece to be measured, and the contour information of the workpiece to be measured is obtained by using the first camera.
[0027] Based on the above scheme, since the workpiece to be measured has a groove, it can only be illuminated from the notch of the top groove when acquiring the image. Moreover, since the interior of the workpiece to be measured is cylindrical and has many smooth rounded corners, the use of top diffuse light cannot effectively detect the target area, and because diffuse reflection will have a great impact on the imaging details, therefore, using a top coaxial light source for lighting can improve the accuracy of the details.
[0028] The beneficial effects of the embodiments of the present invention are:
[0029] In summary, the dual-camera dimension measuring device provided in this embodiment, by setting the first camera and the second camera, and making the pixels of the first camera and the second camera different, the pixel of the first camera is lower than the pixel of the second camera, when the outline size of the workpiece to be measured is small, the first camera with lower pixel can be selected, and when the outline size of the workpiece to be measured is large, the second camera with higher pixel can be selected, and the coaxial light source and the telecentric light source are used for lighting, so that a high-definition image can be obtained. In this way, when measuring the size of the workpiece, cameras with different pixels can be selected according to needs, so that the image plane size and the target surface size are more adapted, avoiding the problem of increased camera cost caused by using a high-pixel camera to measure a small workpiece, that is, when using a high-pixel camera to measure a small workpiece, the image plane size and the target surface size are greatly different, and the camera pixel needs to be greatly increased. The higher the camera pixel, the higher the cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0031] Figure 1 is a schematic diagram of a dual-camera size measurement device according to an embodiment of the present invention;
[0032] Figure 2 is a schematic diagram of a base according to an embodiment of the present invention;
[0033] Figure 3 is a schematic diagram of a first embodiment of a workpiece to be tested;
[0034] Figure 4 is a schematic diagram of a second embodiment of a workpiece to be tested;
[0035] Figure 5 is a schematic diagram of a third embodiment of a workpiece to be tested;
[0036] Figure 6 For images processed using the existing RCF network;
[0037] Figure 7 An image processed by the RCF network of this embodiment;
[0038] Figure 8 This is a diagram of the improved RCF network structure of this embodiment.
[0039] icon:
[0040] 001-first direction; 002-second direction; 003-workpiece to be measured; 031-annular spray-coated surface; 032-annular yellow zinc-plated surface; 100-base; 110-bottom plate; 120-bracket; 130-mounting seat; 140-lens bracket; 200-first camera; 300-second camera; 400-moving mechanism; 500-stage; 600-telecentric light source; 700-coaxial light source; 800-telecentric lens. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0042] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0044] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inside", "outside", etc. indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, or the positions or positional relationships in which the product of the invention is usually placed when in use. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific position, be constructed and operated in a specific position, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.
[0045] In addition, the terms "horizontal", "vertical" and the like do not mean that the components are required to be absolutely horizontal or suspended, but can be slightly tilted. For example, "horizontal" only means that its direction is more horizontal than "vertical", and does not mean that the structure must be completely horizontal, but can be slightly tilted.
[0046] In the description of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0047] In the prior art, there are two main ways to measure the size of a workpiece: one is manual measurement, which is inefficient and has large errors; the other is machine measurement, which is efficient and accurate. However, when using machines to measure the size of workpieces, in order to expand the scope of use and be able to measure workpieces of different sizes, the camera's pixels need to be set higher, usually hundreds of millions, which results in high camera costs.
[0048] In view of this, the designer provides a dual-camera size measurement device, which can reduce costs and ensure the accuracy of measurement results.
[0049] Please combine Figure 1-Figure 2 In this embodiment, the dual-camera dimension measuring device includes a base 100, a first camera 200, a second camera 300, a moving mechanism 400, a stage 500, a telecentric light source 600 and a coaxial light source 700. The first camera 200, the second camera 300 and the moving mechanism 400 are all mounted on the base 100, and telecentric lenses 800 are mounted on the first camera 200 and the second camera 300. The pixel of the first camera 200 is lower than that of the second camera 300; the moving mechanism 400 is mounted on the base 100, and the stage 500 and the telecentric light source 600 are all mounted on the moving mechanism 400. The moving mechanism 400 is used to drive the stage 500 and the telecentric light source 600 to move synchronously relative to the first camera 200 or the second camera 300; the telecentric light source 600 is used to emit a light beam from bottom to top; the coaxial light source 700 is mounted on the base 100, and the coaxial light source 700 is used to emit a light beam from top to bottom.
[0050] For example, in this embodiment, the pixel of the first camera 200 is set to 2000w-3000w, and the pixel of the second camera 300 is set to 6000w-7000w. For example, the pixel of the first camera 200 is set to 2500w, and the pixel of the second camera 300 is set to 6500w.
[0051] Based on the above, the working method of the dual-camera size measurement device provided in this embodiment is as follows:
[0052] By setting the first camera 200 and the second camera 300, and making the pixels of the first camera 200 and the second camera 300 different, the pixel of the first camera 200 is lower than the pixel of the second camera 300, when the outline size of the workpiece 003 to be measured is small, the first camera 200 with a lower pixel can be selected, and when the outline size of the workpiece 003 to be measured is large, the second camera 300 with a higher pixel can be selected, and the coaxial light source 700 and the telecentric light source 600 are used for lighting, so that a high-definition image can be obtained.
[0053] In this way, when measuring the size of a workpiece, cameras with different pixels can be selected according to the needs, so that the image plane size and the target plane size are more suitable, which not only ensures the accuracy of the measurement results, but also does not increase the camera cost. In other words, it avoids the problem of increasing the camera cost when using a high-pixel camera to measure a smaller workpiece. That is, when using a high-pixel camera to measure a smaller workpiece, the difference between the image plane size and the target plane size is large, and the camera pixel needs to be greatly increased. The higher the camera pixel, the higher the cost.
[0054] The following embodiments illustrate the details of the dual-camera size measurement device by way of examples.
[0055] Please combine Figure 1 and Figure 2 In this embodiment, optionally, the base 100 includes a bottom plate 110 and a bracket 120. The bracket 120 can be installed on the bottom plate 110 by means of structural members such as screws. The bracket 120 is located on one side of the bottom plate 110. The bracket 120 is arranged vertically and the bottom plate 110 is arranged horizontally. The first camera 200 and the second camera 300 are respectively installed on the bracket 120 through corresponding mounting seats 130. The first camera 200 and the second camera 300 are arranged at intervals in the first direction 001. The moving mechanism 400 is installed on the bracket 120. The moving mechanism 400 is used to drive the stage 500 to slide back and forth in the first direction 001 or the second direction 002. The first direction 001 is perpendicular to the second direction 002. The first camera 200 and the second camera 300 are both used to receive a light beam propagating in the second direction 002, that is, the collection ports of the first camera 200 and the second camera 300 are perpendicular to the second direction 002. In this embodiment, the collection ports of the first camera 200 and the second camera 300 are both facing the bottom plate 110. In a normal operating state, the first direction 001 is a vertical direction, and the second direction 002 is a horizontal direction.
[0056] It should be understood that by installing the first camera 200 and the second camera 300 through the bracket 120, it is easy to adjust the relative position relationship between the first camera 200 and the second camera 300, reduce the difficulty of assembly, and improve assembly efficiency. At the same time, by positioning the positions of the first camera 200 and the second camera 300 through the bracket 120, it is possible to form a space between the first camera 200 and the stage 500 and between the second camera 300 and the stage 500 to adjust the focal length of the first camera 200 and the second camera 300 relative to the workpiece 003 to improve the accuracy of the measurement result.
[0057] In addition, the high-beam lens on the first camera 200 and the high-beam lens on the second camera 300 can be positioned on the bracket 120 through the corresponding lens brackets 140, respectively, to improve the stability of the high-beam lens.
[0058] In this embodiment, optionally, the coaxial light source 700 is mounted on the bracket 120, and the coaxial light source 700 is located below the first camera 200 and is relatively fixed to the first camera 200. The coaxial light source 700 and the first camera 200 are relatively fixed, and the positions of the two are not easy to change. When used, the step of adjusting the relative position relationship between the two is omitted, thereby improving measurement efficiency.
[0059] In this embodiment, the stage 500 is optionally configured as a light-transmitting member, and the stage 500 is mounted on the top of the telecentric light source 600. The stage 500 and the telecentric light source 600 are relatively fixed, and the relative position between the two is not easy to change. When in use, there is no need to adjust the relative position between the two, which reduces the difficulty of operation, reduces errors, and improves measurement efficiency.
[0060] In an optional embodiment, a positioning block is installed on the carrier 500, and the number of the positioning blocks can be multiple. Each positioning block and the carrier 500 can be set to be detachably matched, and the positioning block is provided with a positioning groove for clamping the to-be-tested workpiece 003. By providing the positioning blocks, the positioning stability of shaft parts can be improved. When positioning, the shaft workpiece can be placed flat on two positioning blocks, and the two positioning blocks can be used to cooperate to achieve support.
[0061] In this embodiment, optionally, the center line of the telecentric lens 800 of the first camera 200 cooperates with the center line of the telecentric lens 800 of the second camera 300 to define a first reference plane, and the center line of the coaxial light source 700 cooperates with the center line of the telecentric light source 600 to define a second reference plane, and the first reference plane and the second reference plane coincide. With such a design, the centers of the first camera 200, the second camera 300, the coaxial light source 700, and the telecentric light source 600 are located in the same plane. When adjusting the position, it is only necessary to adjust the position of the stage 500 relative to the first camera 200 or the second camera 300 in a two-dimensional plane, thereby reducing the difficulty of adjustment, shortening the operation time, and improving the operation efficiency.
[0062] In this embodiment, optionally, the moving mechanism 400 can be set as a two-dimensional moving platform, and the movement of the carrier 500 and the telecentric light source 600 in the first direction 001 and the second direction 002 can be controlled by a stepper motor, so that automatic control can be achieved, and the control is flexible and accurate.
[0063] The dual-camera dimension measuring device provided in this embodiment can select different cameras for image acquisition according to the size and shape of the workpiece 003 to be measured. It is flexible to use and does not need to set a high-pixel camera, thereby reducing the cost of use.
[0064] This embodiment also provides a workpiece size measurement method, which is applicable to the dual-camera size measurement device of the above embodiment, and the method comprises the following steps:
[0065] Acquire feature information of the workpiece 003 to be measured, select the first camera 200 or the second camera 300 for acquiring the contour image of the workpiece 003 to be measured on the stage 500 according to the feature information, and adjust the position of the stage 500 relative to the first camera 200 or the second camera 300 by using the moving mechanism 400, so that the workpiece 003 to be measured on the stage 500 is within the lens range of the first camera 200 or the second camera 300;
[0066] The coaxial light source 700 is turned on to use the first camera 200 to capture the contour image of the workpiece 003 to be measured; or, the telecentric light source 600 is turned on to use the second camera 300 to obtain the contour image of the workpiece 003 to be measured.
[0067] Please combine Figure 3In this embodiment, optionally, in the step of obtaining the characteristic information of the workpiece 003 to be measured, when the workpiece 003 to be measured is a stepped shaft structure, the outer peripheral surface of the workpiece 003 to be measured is set as a cylindrical surface, and the cylindrical surface includes a connected annular spray-molded surface 031 and an annular yellow zinc-plated surface 032, the second camera 300 and the telecentric light source 600 are selected to cooperate in the size measurement. For example, the workpiece 003 to be measured can be first placed horizontally on the stage 500, and then the center of the workpiece 003 to be measured is adjusted to coincide with the center of the stage 500, and the moving mechanism 400 is used to drive the stage 500 to move it to the bottom of the second camera 300, and the distance between the stage 500 and the second camera 300 is adjusted, and the telecentric light source 600 is turned on to illuminate the workpiece 003 to be measured in a parallel backlighting manner, and the contour information of the workpiece 003 to be measured is obtained by the second camera 300.
[0068] Such a design, since the workpiece 003 to be tested is a stepped shaft structure, and the surface of the workpiece 003 to be tested includes a connected annular spray-coated surface 031 and an annular yellow zinc-plated surface 032, the annular spray-coated surface 031, i.e., the spray-coated area of the workpiece 003 to be tested, undergoes a high-temperature baking leveling and curing process, and is uneven and reflective in the spray-coated area, and the workpiece 003 to be tested is in the form of a stepped shaft, and in order to obtain a homogeneous image, the lens is required to have a large depth of field. In addition, since the yellow zinc-plated surface of the workpiece 003 to be tested will cause the degree of reflection of the surface to be different due to the quality of the zinc plating, it is necessary to distinguish the characteristics of the two surfaces when considering the lighting scheme. If a top light diffuse light source or a top light coaxial light source 700 is used, diffuse reflection will occur, which results in unclear acquisition of the boundary when obtaining the image of the workpiece 003 to be tested, which is not conducive to later image processing and edge recognition. The use of a backlight solution can greatly suppress the diffuse reflection phenomenon of the plastic-sprayed surface, but the diffuse reflection backlight source will also cause reflection at the edge of the yellow zinc-plated area. Therefore, in this embodiment, a telecentric light source 600 is used for lighting, and a parallel backlight lighting solution is used to respond to the surface features of the workpiece 003 to be tested, which can maximize the suppression of the diffuse reflection phenomenon of the plastic-sprayed surface and the reflection phenomenon of the yellow zinc-plated surface.
[0069] Please combine Figure 4In other embodiments, optionally, in the step of obtaining the characteristic information of the workpiece 003 to be measured, when the workpiece 003 to be measured is provided with a plurality of through holes arranged at intervals and the edge is provided with a chamfer, the second camera 300 and the telecentric light source 600 are selected to cooperate in the dimension measurement. For example, the workpiece 003 to be measured can be first placed flat on the stage 500, the center of the workpiece 003 to be measured is adjusted to coincide with the center of the stage 500, the stage 500 is driven by the moving mechanism 400 to move in the second direction 002 to the bottom of the second camera 300, and then the carrier is driven to move in the first direction 001, the distance between the stage 500 and the second camera 300 is adjusted, the focus is completed, and then the telecentric light source 600 is turned on to illuminate the workpiece 003 to be measured in a parallel backlighting manner, and the contour information of the workpiece 003 to be measured is obtained by the second camera 300.
[0070] In this way, when obtaining the outer edge contour image of the workpiece 003 to be measured with a through hole and chamfered edges, the edge complexity is increased, and the use of top light illumination will aggravate the reflection phenomenon to produce edge blur or double edge problems, increase the difficulty of edge acquisition and reduce the accuracy of edge acquisition. Therefore, the parallel backlight lighting solution is used in this embodiment to effectively suppress the edge blur and double edge problems caused by surface reflection and rounded corners.
[0071] In addition, in order to improve the problem of inaccurate positioning or multiple edge lines caused by severe edge diffraction, the introduction of deep learning convolutional neural network can reduce the noise of the image and eliminate the subtle noise in the image; on the other hand, the rough edge of the image is located to facilitate the sub-pixel positioning and calibration solution of the subsequent image software. For example, the RCF network can be introduced. The RCF network is a fully convolutional neural network used for object edge detection, which aims to further improve the performance of edge detection. The collection of visual information is to extract low-level features first and then high-level features, and then optimize and correct details through feedback connections. In addition, compared with the HED network, the RCF network has better edge detection performance and higher efficiency.
[0072] Please combine Figure 8Furthermore, the RCF network features are combined with the characteristics of the inspected parts, and the original RCF neural network is modified accordingly to achieve the purpose of adapting to the visual inspection of detonators. The purpose of introducing RCF neural network deep learning in the detonator visual inspection platform is to locate the edge more accurately and reduce the inaccuracy and instability of the traditional operator for edge solution. Because the surface quality of parts is different during the processing and assembly process, and there is interference (such as burrs, chamfers and background overlap, etc.), interference will occur in the direct edge detection of the image. In order to cope with the limitations of the traditional edge detection algorithm, the RCF network is introduced to perform edge detection on the image, with the aim of improving the precision and accuracy of edge detection and reducing the impact of interference on edge detection.
[0073] Based on the original RCF network, the network structure is further modified. The original RCF network directly performs a 1×1-1 convolution operation to reduce the dimension after fusing the side edge output layer. The detail quality of the image depends entirely on the side edge output layers. Edge interference will still occur when the edges in the image overlap or are too close. For example, in hole diameter detection, the edge of the hole will be chamfered, resulting in two edge lines interfering with each other when solving the edge. To improve this situation, the improved network adds a convolution layer with a convolution kernel size of 5×5 after the fusion layer, and uses a deconvolution after the convolution layer to restore the image size. After obtaining the deconvolution image, the deconvolution image and the network fusion image are combined using the median fusion method to obtain the edge fusion image, and finally a 1×1-1 convolution layer is used to merge the channels.
[0074] In this embodiment, the number of data sets can be set to 500. In the training process, the training set images are directly retrieved, Sobel edge solutions are performed on them, and then network training is performed.
[0075] Please combine Figure 6 and Figure 7 , in the process of obtaining edge curves, the curve edges of parts are seriously disturbed due to processes such as part processing and surface treatment. The left side is the image processed by the RCF network, and the right side is the image processed by the improved RCF network in this embodiment. From the above edge processing results, it can be found that after the image is convoluted with a 5×5 convolution kernel, the overall feature becomes smaller and blurred, and then the deconvolution upsampling has a strong ability to handle edge interference, and can retain the main information features of the edge, which is suitable for edge feature extraction of the detonator.
[0076] Furthermore, the acquisition, processing and output of the image by the RCF neural network are all at the pixel level, and the edge obtained by the RCF neural network is a coarse edge image. In order to achieve high-precision measurement, it is necessary to achieve higher pixel accuracy for the edge. Therefore, in this embodiment, the coarse edge image is processed using a sub-pixel edge detection method to locate the edge at the sub-pixel level. Specifically, the coarse edge obtained by the RCF network is further refined using a cubic spline interpolation method to obtain a sub-pixel image, thereby improving the accuracy level of edge detection.
[0077] Please combine Figure 5 In other embodiments, optionally, in the step of obtaining characteristic information of the workpiece 003 to be measured, when the workpiece 003 to be measured is provided with a groove and two lugs are provided in the groove, in order to obtain the size between the two lugs, the first camera 200 and the coaxial light source 700 are selected to cooperate in the size measurement. For example, during operation, the workpiece 003 to be measured can be placed horizontally on the stage 500, and the stage 500 can be driven by the moving mechanism 400 to move to the bottom of the first camera 200, the distance between the stage 500 and the first camera 200 can be adjusted, the coaxial light source 700 can be turned on to illuminate the workpiece 003 to be measured, and the contour information of the workpiece 003 to be measured can be obtained by using the first camera 200.
[0078] It should be understood that since the workpiece 003 to be measured has a groove, it can only be illuminated from the notch of the top groove when acquiring an image. Moreover, since the interior of the workpiece 003 to be measured is cylindrical and has many smooth rounded corners, the use of top diffuse light cannot effectively detect the target area. Furthermore, since diffuse reflection will have a great impact on the imaging details, the use of top coaxial light source 700 for lighting can improve the accuracy of the details.
[0079] The workpiece size measurement method provided in this embodiment has a high degree of automation, high efficiency, high accuracy of measurement results, and low operating cost.
[0080] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A dual-camera dimension measuring device, characterized in that: include: A base (100), a first camera (200), a second camera (300), a moving mechanism (400), a stage (500), a telecentric light source (600) and a coaxial light source (700); the first camera (200), the second camera (300) and the moving mechanism (400) are all mounted on the base (100); a telecentric lens (800) is mounted on the first camera (200) and the second camera (300); the first camera (200) has a low pixel density; The moving mechanism (400) is installed on the base (100), the carrier (500) and the telecentric light source (600) are both installed on the moving mechanism (400), and the moving mechanism (400) is used to drive the carrier (500) and the telecentric light source (600) to move synchronously relative to the first camera (200) or the second camera (300); the telecentric light source (600) is used to emit a light beam from bottom to top; The coaxial light source (700) is installed on the base (100), and the coaxial light source (700) is used to emit a light beam from top to bottom.
2. The dual-camera dimension measuring device according to claim 1, characterized in that: The base (100) comprises a bottom plate (110) and a bracket (120), wherein the bracket (120) is mounted on the bottom plate (110), and the first camera (200) and the second camera (300) are both mounted on the bracket (120) and are arranged at intervals in a first direction (001); the moving mechanism (400) is mounted on the bracket (120), and the moving mechanism (400) is used to drive the carrier (500) to slide back and forth in a first direction (001) or a second direction (002), wherein the second direction (002) is perpendicular to the first direction (001); and the first camera (200) and the second camera (300) are both used to receive a light beam propagating in the second direction (002).
3. The dual-camera dimension measuring device according to claim 2, characterized in that: The coaxial light source (700) is mounted on the bracket (120); the coaxial light source (700) is located below the first camera (200) and is fixed relative to the first camera (200).
4. The dual-camera dimension measuring device according to claim 1, characterized in that: The carrier (500) is configured as a light-transmitting member, and the carrier (500) is mounted on the top of the telecentric light source (600).
5. The dual-camera dimension measuring device according to claim 1, characterized in that: A positioning block is installed on the carrier (500), and the positioning block is provided with a positioning groove for clamping the workpiece (003) to be measured.
6. The dual-camera dimension measuring device according to claim 1, characterized in that: The center line of the telecentric lens (800) of the first camera (200) cooperates with the center line of the telecentric lens (800) of the second camera (300) to define a first reference plane, and the center line of the coaxial light source (700) cooperates with the center line of the telecentric light source (600) to define a second reference plane, and the first reference plane and the second reference plane coincide with each other.
7. A method for measuring workpiece dimensions, characterized in that: Applicable to the dual-camera size measuring device according to any one of claims 1 to 6, the method comprising the following steps: Acquiring characteristic information of a workpiece (003) to be measured, selecting a first camera (200) or a second camera (300) for acquiring a contour image of the workpiece (003) to be measured located on the platform (500) according to the characteristic information, and adjusting the position of the platform (500) relative to the first camera (200) or the second camera (300) using a moving mechanism (400) so that the workpiece (003) to be measured located on the platform (500) is within the lens range of the first camera (200) or the second camera (300); The coaxial light source (700) is turned on to use the first camera (200) to capture the contour image of the workpiece (003) to be measured; or the telecentric light source (600) is turned on to use the second camera (300) to obtain the contour image of the workpiece (003) to be measured.
8. The workpiece size measuring method according to claim 7, characterized in that: In the step of obtaining characteristic information of the workpiece (003) to be measured, when the workpiece (003) to be measured is set as a stepped shaft, the surface of the workpiece (003) to be measured includes a plurality of coaxial cylindrical surfaces, and the cylindrical surfaces include a connected annular spray-coated surface (031) and an annular yellow zinc-plated surface (032), the second camera (300) and the telecentric light source (600) are selected to cooperate in dimensional measurement; The workpiece (003) to be measured is horizontally placed on the platform (500), the moving mechanism (400) is used to drive the platform (500) to move it to the bottom of the second camera (300), the distance between the platform (500) and the second camera (300) is adjusted, the telecentric light source (600) is turned on to illuminate the workpiece (003) to be measured in a parallel backlighting manner, and the contour information of the workpiece (003) to be measured is obtained by using the second camera (300).
9. The workpiece size measuring method according to claim 7, characterized in that: In the step of acquiring characteristic information of the workpiece (003) to be measured, when the workpiece (003) to be measured is provided with a plurality of through holes arranged at intervals and the edges are provided with chamfers, the second camera (300) and the telecentric light source (600) are selected to cooperate in dimensional measurement.
10. The workpiece size measuring method according to claim 7, characterized in that: In the step of acquiring characteristic information of the workpiece (003) to be measured, when the workpiece (003) to be measured is provided with a groove and a lug is provided in the groove, the first camera (200) and the coaxial light source (700) are selected to cooperate in dimension measurement; The workpiece (003) to be measured is horizontally placed on the carrier (500), the carrier (500) is driven by the moving mechanism (400) to move to the bottom of the first camera (200), the distance between the carrier (500) and the first camera (200) is adjusted, the coaxial light source (700) is turned on to illuminate the workpiece (003) to be measured, and the contour information of the workpiece (003) to be measured is obtained by using the first camera (200).