Complex scene laser tracker target ball center positioning method and device based on YOLOv3
The YOLOv3 model is used to detect and preprocess the target ball image in complex scenes, and the Hough transform method is used to fit the ball center coordinates, which solves the problem of low efficiency in positioning the target ball center of the laser tracker and achieves fast and accurate ball center positioning. .
Patent Information
- Application Number
- CN202210205727.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-03
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-03-03
AI Technical Summary
In complex scenarios, existing technology is difficult to quickly locate the center of the laser tracker's target ball, resulting in measurement interruptions and low work efficiency.
A method based on YOLOv3 is used to obtain the original image, detect the target ball area information, perform preprocessing and Hough transformation method to fit the center coordinates of the ball, and combine scale transformation and coordinate translation to realize the target ball in the laser tracker coordinate system. Heart positioning.
In complex scenes, the laser tracker target ball center can be quickly positioned, avoiding interference effects, the algorithm is simple, and the running speed is fast.
Smart Images

Figure CN114596336B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of target ball center positioning, and in particular to a target ball center positioning method, device, electronic device, storage medium and program product of a complex scene laser tracker based on YOLOv3. Background Art
[0002] In recent years, laser trackers have been used more and more widely in the manufacturing and assembly of high-end equipment. In the process of tracking and measuring, the target ball is often lost due to factors such as occlusion or improper operation, which seriously affects the work efficiency and even leads to the failure of continuous measurement. Therefore, it is an urgent problem to achieve rapid interruption and continuation of measurement when the measurement is interrupted, and the rapid detection and center positioning of the target ball are the primary problems faced in achieving rapid interruption and continuation.
[0003] In the prior art, the use of digital image processing and machine vision technology to identify and locate laser imaging spots or cooperative target balls is the key to achieving visual guidance of laser alignment. The related methods in the prior art can achieve the automatic identification and positioning function of cooperative targets in simple scenes, but when the scene environment is complex, there are interferences from objects of similar shapes, and the scene environment light changes, the application of the related methods is greatly restricted. Summary of the invention
[0004] In order to solve the problems existing in the prior art, the embodiments of the present invention provide a method, device, electronic device, storage medium and program product for locating the center of a target ball of a complex scene laser tracker based on YOLOv3, aiming to solve the technical problem of quickly locating the center of a target ball of a laser tracker in complex scenes.
[0005] A first aspect of the present disclosure provides a method for locating the center of a target ball of a laser tracker in a complex scene based on YOLOv3, comprising: acquiring an original image; wherein the original image includes a target ball; detecting the original image based on a YOLOv3 model to obtain regional information of the target ball in the original image pixel coordinate system; according to the regional information, cropping the original image to obtain a target area; preprocessing the target area to obtain a preprocessed target area; according to the preprocessed target area, fitting the center coordinate information of the target ball using the Hough transform method, and obtaining the center coordinates of the center coordinate information in the original image pixel coordinate system through scale transformation and coordinate translation; according to the center coordinates in the original image pixel coordinate system, solving the center coordinates of the target ball in the laser tracker coordinate system to complete the center positioning of the target ball.
[0006] Furthermore, according to the center coordinates of the target ball in the pixel coordinate system of the original image, the center coordinates of the target ball in the laser tracker coordinate system are solved to complete the center positioning of the target ball, including: according to the center coordinates of the target ball in the pixel coordinate system of the original image, the ideal center coordinates of the target ball in the normalized coordinate system are solved to obtain the center coordinates of the target ball in the camera coordinate system; according to the conversion relationship between the laser tracker and the camera coordinate system and the center coordinates of the target ball in the camera coordinate system, the center coordinates of the target ball in the laser tracker coordinate system are solved to obtain the center coordinates of the target ball in the laser tracker coordinate system to complete the center positioning of the target ball.
[0007] Furthermore, the YOLOv3 model is trained through the following steps: N historical images of the target ball in a complex scene are obtained and manually annotated; wherein N is greater than or equal to 1000; the N historical images after manual annotation are divided into a training set, a validation set and a test set according to a preset ratio; the training set is flipped, scaled and spliced and input into the YOLOv3 model for training; wherein, during the model training process, the hyperparameters of the YOLOv3 model are adjusted according to the accuracy of the validation set to obtain a trained YOLOv3 model.
[0008] Furthermore, after the training set is flipped, scaled and spliced and input into the YOLOv3 model for training, it also includes: using the test set to test the trained YOLOv3 model to obtain the tested YOLOv3 model, and performing forward propagation parameter extraction and parameter solidification on the tested YOLOv3 model to obtain a YOLOv3 model that can be embedded and deployed.
[0009] Further, preprocessing the target region to obtain the preprocessed target region includes: binarizing and morphologically processing the target region to obtain the morphologically processed target region.
[0010] Furthermore, the target area is binarized and morphologically processed to obtain the target area after morphological processing, including: using an iterative method to obtain a binarization threshold of the target area; performing morphological closing operation and Gaussian filtering on the target area after binarization processing to obtain the target area after morphological processing.
[0011] The second aspect of the present disclosure provides a target ball center positioning device for a complex scene laser tracker based on YOLOv3, comprising: an image acquisition module, used to acquire an original image; wherein the original image includes a target ball; an image detection module, used to detect the original image based on a YOLOv3 model, and obtain the area information of the target ball in the original image pixel coordinate system; a target area cropping module, used to crop the original image according to the area information to obtain the target area; an image preprocessing module, used to preprocess the target area to obtain the preprocessed target area; an image transformation module, used to fit the target ball center coordinate information according to the preprocessed target area using the Hough transform method, and obtain the center coordinates in the original image pixel coordinate system through scale transformation and coordinate translation of the center coordinate information; a center coordinate conversion module, used to solve the center coordinates of the target ball in the laser tracker coordinate system according to the center coordinates in the original image pixel coordinate system, and complete the target ball center positioning.
[0012] The third aspect of the present disclosure provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for locating the center of a target ball of a complex scene laser tracker based on YOLOv3 provided in the first aspect of the present disclosure is implemented.
[0013] The fourth aspect of the present disclosure provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for locating the center of a target ball of a complex scene laser tracker based on YOLOv3 provided in the first aspect of the present disclosure is implemented.
[0014] The fifth aspect of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the complex scene laser tracker target ball center positioning method based on YOLOv3 provided by the first aspect of the present disclosure.
[0015] The present invention provides a method, device, electronic device, storage medium and program product for locating the center of a target ball of a laser tracker in complex scenes based on YOLOv3. Compared with conventional methods, the YOLOv3 model obtained by training with strong interfering samples is no longer subject to the interference of complex scenes, and the YOLOv3 model algorithm is simple and runs fast. The original image is trained and processed based on the YOLOv3 model, which can realize the rapid positioning of the center of the target ball of the laser tracker. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] For a more complete understanding of the present disclosure and its advantages, reference will now be made to the following description taken in conjunction with the accompanying drawings, in which:
[0017] Figure 1A flowchart of a method for locating the center of a target ball of a laser tracker in a complex scene based on YOLOv3 according to an embodiment of the present disclosure is schematically shown;
[0018] Figure 2 The schematic diagram shows the structure of a target ball center positioning system according to an embodiment of the present disclosure;
[0019] Figure 3 The flowchart of YOLOv3 model training and testing according to an embodiment of the present disclosure is schematically shown;
[0020] Figure 4 A schematic diagram of target ball center detection according to an embodiment of the present disclosure is schematically shown;
[0021] Figure 5 A block diagram of a target ball center positioning device of a complex scene laser tracker based on YOLOv3 according to an embodiment of the present disclosure is schematically shown;
[0022] Figure 6 A block diagram of an electronic device suitable for implementing the method described above according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0023] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0024] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0025] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0026] In the case of using expressions such as "at least one of A, B, and C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.). In the case of using expressions such as "at least one of A, B, or C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, or C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0027] Some block diagrams and / or flow charts are shown in the accompanying drawings. It should be understood that some boxes or combinations thereof in the block diagrams and / or flow charts can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that these instructions can create a device for implementing the functions / operations described in these block diagrams and / or flow charts when executed by the processor. The technology of the present disclosure can be implemented in the form of hardware and / or software (including firmware, microcode, etc.). In addition, the technology of the present disclosure can take the form of a computer program product on a computer-readable storage medium storing instructions, which can be used by an instruction execution system or used in conjunction with an instruction execution system.
[0028] The disclosed embodiment provides a method for locating the center of a target ball of a laser tracker in a complex scene based on YOLOv3, comprising: acquiring an original image; wherein the original image includes a target ball; detecting the original image based on a YOLOv3 model to obtain regional information of the target ball in a pixel coordinate system of the original image; according to the regional information, cropping the original image to obtain a target area; preprocessing the target area to obtain a preprocessed target area; according to the preprocessed target area, fitting the center coordinate information of the target ball using a Hough transform method, and obtaining the center coordinates of the center coordinate information in the pixel coordinate system of the original image through a scale transformation and a coordinate translation; according to the center coordinates in the pixel coordinate system of the original image, solving the center coordinates of the target ball in the laser tracker coordinate system to complete the center positioning of the target ball.
[0029] The embodiments of the present disclosure provide a method for locating the center of a target ball of a laser tracker in complex scenes based on YOLOv3. Compared with conventional methods, the YOLOv3 model obtained by training with strongly interfering samples is no longer subject to the interference of complex scenes, and the YOLOv3 model algorithm is concise and runs fast. The original image is trained and processed based on the YOLOv3 model, which can realize the rapid positioning of the center of the target ball of the laser tracker.
[0030] Figure 1 The flowchart of the target ball center positioning method of the complex scene laser tracker based on YOLOv3 according to the embodiment of the present disclosure is schematically shown. Figure 1 As shown, the method includes: steps S101 to S106.
[0031] In operation S101, an original image is acquired; wherein the original image includes a target ball.
[0032] In the embodiments of the present disclosure, Figure 2 The structure diagram of the target ball center positioning system is shown, which includes: a laser tracker host 10 and a target ball 20 set on the object to be measured. The laser tracker host 10 includes: a small USB camera 101, an electric control box 102 and an embedded image processing board 103 integrated in the electric control box 102.
[0033] Specifically, the small USB camera 101 is installed inside the laser tracker host 10 and the camera field of view is not interfered by the internal components of the laser tracker host 10. It is used to image the target ball 20 and generate an image. The embedded image processing board 103 is installed in the electric control box 102 inside the laser tracker host 10. It is connected to the small USB camera 101 by a relevant data line and is used to process and analyze the image collected by the small USB camera 101.
[0034] In the embodiments of the present disclosure, the target ball 20 is in a complex scene, for example, there are a variety of interfering objects with similar shapes to the target ball 20 around the target ball 20, the ambient light is weak, etc., and then the original image including the target ball 20 is collected by the small USB camera 101. The background of the original image includes but is not limited to the target ball 20, a variety of interfering objects with similar shapes, light, lines, and a complex background with chaotic colors.
[0035] It should be noted that the target ball center positioning system in the above embodiment is only an example and does not constitute a limitation of the embodiments of the present disclosure. In actual application scenarios, it can be replaced by components of the same functional module, and the embodiments of the present disclosure do not limit this.
[0036] In operation S102, the original image is detected based on the YOLOv3 model to obtain the area information of the target ball in the original image pixel coordinate system.
[0037] In the embodiment of the present disclosure, the trained YOLOv3 model is used to detect the original image collected by the small USB camera 101 to obtain the area information of the target ball in the original image pixel coordinate system. The trained YOLOv3 model is loaded in the embedded image processing board 103.
[0038] According to the embodiments of the present disclosure, Figure 3 As shown, the trained YOLOv3 model is obtained by training through the following steps, specifically including: steps S301 to S304.
[0039] In operation S301, N historical images of the target ball in a complex scene are obtained and manually annotated; wherein N is greater than or equal to 1000.
[0040] In the embodiment of the present disclosure, N historical images of the target ball in a complex scene are obtained by a small USB camera 101, and the annotated historical images are obtained by manual annotation. It should be noted that N can be 1000, 1500, 2000, etc., and the embodiment of the present disclosure does not limit this.
[0041] In operation S302, the N manually annotated historical images are divided into a training set, a validation set, and a test set according to a preset ratio.
[0042] In an embodiment of the present disclosure, the N historical images annotated in step S301 are divided into a training set, a validation set, and a test set according to a preset ratio. The preset ratio may be, for example, 8:1:1 or 6:2:2, etc. The N historical images are divided into a training set, a validation set, and a test set according to the ratio to train, verify, and test the YOLOv3 model.
[0043] In operation S303, the training hyperparameters of the YOLOv3 model are set, and the training set is flipped, scaled, and concatenated and then input into the YOLOv3 model for training. In the model training process, the hyperparameters of the YOLOv3 model are adjusted according to the accuracy of the validation set to obtain a trained YOLOv3 model.
[0044] In the embodiment of the present disclosure, the training set obtained in step S302 is flipped, scaled and spliced, and then input into the YOLOv3 model for training. The training set is flipped, scaled and spliced to increase the complexity of the training data sample, thereby reducing the error of sample training.
[0045] During the model training process, the trained YOLOv3 model is verified through the validation set, and the hyperparameters of the trained YOLOv3 model are adjusted according to the accuracy of the validation set to obtain the trained YOLOv3 model.
[0046] In operation S304, the trained YOLOv3 model is tested using the test set to obtain a tested YOLOv3 model, and forward propagation parameter extraction and parameter solidification are performed on the tested YOLOv3 model to obtain an embedded deployable YOLOv3 model.
[0047] In the embodiment of the present disclosure, the test set obtained in step S302 is input into the trained YOLOv3 model for testing, and finally the availability of the YOLOv3 model is verified according to the test result of the test set, and a YOLOv3 model that meets the requirements after training is obtained. Finally, the forward propagation parameter extraction and parameter solidification of the tested YOLOv3 model are performed to obtain an embedded deployable YOLOv3 model, and the embedded deployable YOLOv3 model is loaded into the embedded image processing board 103 to detect and process the image collected by the small USB camera 101.
[0048] It should be noted that the YOLOv3 model shown in the embodiment of the present disclosure may adopt the DarkNet53 network structure, and the embodiment of the present disclosure does not impose any limitation on the layers in the DarkNet53 network structure.
[0049] In operation S103, the original image is cropped according to the region information to obtain a target region.
[0050] In the embodiments of the present disclosure, Figure 4 As shown, according to the region information of the target ball 20 in the original image pixel coordinate system detected by the YOLOv3 model in step S102, the original image is cropped to obtain the target region. For example, the pixels of the target region obtained by cropping the original image according to the region information in the original image pixel coordinate system can be uniformly corrected to 150×150 or other sizes, etc., to obtain the target region including the target ball 20.
[0051] In operation S104, the target region is preprocessed to obtain a preprocessed target region.
[0052] In the embodiment of the present disclosure, the target area obtained in step S103 is preprocessed to facilitate subsequent operations such as spatial resolution on the target sphere 20 .
[0053] According to an embodiment of the present disclosure, preprocessing the target region to obtain the preprocessed target region specifically includes: binarizing and morphologically processing the target region to obtain the morphologically processed target region.
[0054] Furthermore, an iterative method can be used to obtain the binarization threshold of the target area. The specific steps include:
[0055] a) Calculate the initial threshold T of the target area0 and the maximum number of iterations I, where the maximum number of iterations I can be 500, 550, 600, etc.;
[0056]
[0057] Among them, T 0 Round down, force represents the gray value of the pixel, and n is the number of pixels with the gray value of force.
[0058] b) Calculate the gray value less than the threshold T 0 The average gray value of the part t 1 and greater than the threshold T 0 The average gray value of the part t 2 :
[0059]
[0060] c) Calculate the new threshold T i :
[0061] T i =w 1 ×t 1 +w 2 ×t 2 , T i Among them, w 1 and w 2 are grayscale weights respectively, where the weight w is based on the target ball image characteristics. 1 and w 2 Can be set to 0.8, 0.2, etc.
[0062] d) Repeat steps b) and c) until the threshold T i If the value is less than a preset value (such as 1), or the number of iterations reaches the upper limit I, the iteration is stopped, and the final T is the binarization threshold obtained after the binarization process.
[0063] Furthermore, morphological closing operation and Gaussian filtering are performed on the binarized regional image to remove noise in the image.
[0064] In the embodiments of the present disclosure, the target area is preprocessed to eliminate irrelevant information in the target area, restore useful real information, enhance the detectability of relevant information and simplify data to the maximum extent, thereby improving the reliability of feature extraction, matching and recognition.
[0065] In operation S105, the sphere center coordinate information of the target sphere is fitted according to the preprocessed target area using the Hough transform method, and the sphere center coordinate information is obtained by scaling and coordinate translation in the original image pixel coordinate system.
[0066] In the embodiment of the present disclosure, the Hough transform method is used to fit the center coordinate information of the target sphere to the preprocessed target area, and the center coordinate information is obtained by scaling and coordinate translation in the original image pixel coordinate system (u, v), where u and v represent the two-dimensional center coordinates in the pixel coordinate system.
[0067] In operation S106, the coordinates of the center of the target sphere in the laser tracker coordinate system are calculated according to the coordinates of the center of the target sphere in the original image pixel coordinate system, thereby completing the positioning of the center of the target sphere.
[0068] In the embodiment of the present disclosure, the sphere center coordinates (u, v) in the original image pixel coordinate system obtained in step S105 are spatially solved to obtain the sphere center coordinates of the target sphere in the laser tracker coordinate system, thereby completing the sphere center positioning of the target sphere.
[0069] According to an embodiment of the present disclosure, step S106 specifically includes: solving the ideal center coordinates of the target sphere in the normalized coordinate system according to the center coordinates in the original image pixel coordinate system, and obtaining the center coordinates of the target sphere in the camera coordinate system; solving the center coordinates of the target sphere in the laser tracker coordinate system according to the conversion relationship between the laser tracker and the camera coordinate system and the center coordinates of the target sphere in the camera coordinate system, and obtaining the center coordinates of the target sphere in the laser tracker coordinate system, thereby completing the center positioning of the target sphere.
[0070] In the embodiment of the present disclosure, the ideal sphere center coordinates of the target sphere in the normalized coordinate system are calculated according to the sphere center coordinates in the original image pixel coordinate system, and the sphere center coordinates (x', y') of the target sphere in the normalized coordinate system are obtained, wherein the sphere center coordinates (x', y') of the target sphere in the normalized coordinate system and the sphere center coordinates (u, v) in the original image pixel coordinate system satisfy the following relationship:
[0071]
[0072] Among them, f x and f y represents the focal length of the small USB camera 101 divided by the pixel size in the x-axis and y-axis directions, respectively. 0 , v 0 ) represents the coordinates of the origin of the camera coordinate system in the pixel coordinate system.
[0073] The ideal coordinates of the center of the target ball in the normalized coordinate system of the camera model are marked as (x, y), and the distortion coefficient k of the small USB camera 101 is 1 , k 2 , k 3 , k 4 , k 5 , k 6 、p 1 、p 2 、s1 、s 2 、s 3 、s 4 , where k 1 , k 2 , k 3 , k 4 , k 5 , k 6 denote the radial distortion coefficient of the small USB camera 101, p 1 、p 2 They represent the tangential distortion coefficient, s 1 、s 2 、s 3 、s 4 They represent the thin prism distortion coefficient of the small USB camera 101. 2 =x 2 +y 2 , then the coordinates (x, y) and the actual coordinates (x', y') satisfy the following relationship:
[0074]
[0075] The inverse process of the above equation is used to solve the coordinates (x, y), and then the coordinates of the center of the target ball in the camera coordinate system are solved C P is:
[0076] C P = [x·fy·ff] T
[0077] Here, f is the focal length of the small USB camera 101 .
[0078] In the embodiment of the present disclosure, according to the conversion relationship between the laser tracker and the camera coordinate system And the coordinates of the center of the target ball in the camera coordinate system C P, solve the coordinates of the center of the target ball in the laser tracker coordinate system, and obtain the coordinates of the center of the target ball in the laser tracker coordinate system T P, complete the positioning of the target ball center. Among them, the target ball center coordinates in the laser tracker coordinate system are T P and the coordinates of the center of the target ball in the camera coordinate system C P satisfies the following relationship:
[0079]
[0080] in, is a 3×3 rotation matrix, T t C is a 3×1 translation matrix.
[0081] The embodiments of the present invention provide a method for locating the center of a target ball of a laser tracker in complex scenes based on YOLOv3. The method is based on a YOLOv3 model trained with strong interference samples and is no longer subject to the interference of complex scenes. The algorithm is simple and the operation speed is fast, so the center of the target ball of the laser tracker can be quickly located.
[0082] It should be noted that the examples in the above embodiments are merely exemplary descriptions and do not constitute limitations of the embodiments of the present disclosure.
[0083] Figure 5 The block diagram of a target ball center positioning device of a complex scene laser tracker based on YOLOv3 according to an embodiment of the present disclosure is schematically shown.
[0084] like Figure 5 As shown, the target ball center positioning 500 based on the YOLOv3 complex scene laser tracker includes: an image acquisition module 510, an image detection module 520, a target area cropping module 530, an image preprocessing module 540, an image transformation module 550 and a ball center coordinate conversion module 560. The device 500 can be used to implement reference Figure 1 The described method for locating the center of a target ball using a laser tracker in complex scenes based on YOLOv3.
[0085] The image acquisition module 510 is used to acquire an original image; wherein the original image includes the target ball. The image acquisition module 510 can be used to perform the above reference Figure 1 The described step S101 will not be repeated here.
[0086] The image detection module 520 is used to detect the original image based on the YOLOv3 model to obtain the area information of the target ball in the original image pixel coordinate system. The image detection module 520 can be used to perform the above reference Figure 1 The described step S102 will not be repeated here.
[0087] The target region cropping module 530 is used to crop the original image according to the region information to obtain the target region. The target region cropping module 530 can be used to perform the above reference Figure 1 The described step S103 will not be repeated here.
[0088] The image preprocessing module 540 is used to preprocess the target area to obtain the preprocessed target area. The image preprocessing module 540 can be used to perform the above reference Figure 1 The described step S104 will not be repeated here.
[0089] The image transformation module 550 is used to fit the target sphere center coordinate information using the Hough transform method according to the pre-processed target area, and obtain the sphere center coordinate information in the original image pixel coordinate system through scale transformation and coordinate translation. The image transformation module 550 can be used to perform the above reference Figure 1 The described step S105 will not be repeated here.
[0090] The spherical center coordinate conversion module 560 is used to calculate the spherical center coordinate of the target ball in the laser tracker coordinate system according to the spherical center coordinate in the original image pixel coordinate system, and complete the spherical center positioning of the target ball. The spherical center coordinate conversion module 560 can be used to perform the above reference Figure 1 The described step S106 will not be repeated here.
[0091] In the embodiment of the present disclosure, the spherical center coordinate conversion module 560 is used to solve the spherical center coordinate of the target ball in the laser tracker coordinate system according to the spherical center coordinate in the original image pixel coordinate system, and complete the spherical center positioning of the target ball, specifically including: solving the ideal spherical center coordinate of the target ball in the normalized coordinate system according to the spherical center coordinate in the original image pixel coordinate system, and obtaining the spherical center coordinate of the target ball in the camera coordinate system; solving the spherical center coordinate of the target ball in the laser tracker coordinate system according to the conversion relationship between the laser tracker and the camera coordinate system and the spherical center coordinate of the target ball in the camera coordinate system, obtaining the spherical center coordinate of the target ball in the laser tracker coordinate system, and completing the spherical center positioning of the target ball.
[0092] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), on-chip devices, devices on substrates, devices on packages, application-specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging circuits, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.
[0093] For example, any of the image acquisition module 510, the image detection module 520, the target area cropping module 530, the image preprocessing module 540, the image transformation module 550 and the spherical center coordinate conversion module 560 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the image acquisition module 510, the image detection module 520, the target area cropping module 530, the image preprocessing module 540, the image transformation module 550 and the spherical center coordinate conversion module 560 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), an on-chip device, a device on a substrate, a device on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware and firmware or by a suitable combination of any of them. Alternatively, at least one of the image acquisition module 510, the image detection module 520, the target area cropping module 530, the image preprocessing module 540, the image transformation module 550 and the spherical center coordinate conversion module 560 can be at least partially implemented as a computer program module, and when the computer program module is executed, the corresponding function can be executed.
[0094] Figure 6 A block diagram of an electronic device suitable for implementing the method described above according to an embodiment of the present disclosure is schematically shown. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0095] like Figure 6 As shown, the electronic device 600 described in this embodiment includes: a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 to a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include an onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0096] In RAM 603, various programs and data required for the operation of electronic device 600 are stored. Processor 601, ROM 602 and RAM 603 are connected to each other via bus 604. Processor 601 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 602 and / or RAM 603. It should be noted that the program can also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0097] According to an embodiment of the present disclosure, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to the bus 604. The electronic device 600 may further include one or more of the following components connected to the I / O interface 605: an input portion 606 including a keyboard, a mouse, etc.; an output portion 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 608 including a hard disk, etc.; and a communication portion 609 including a network interface card such as a LAN card, a modem, etc. The communication portion 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage portion 608 as needed.
[0098] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, the above-mentioned functions defined in the device of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the apparatus, equipment, device, module, unit, etc. described above can be implemented by a computer program module.
[0099] The embodiment of the present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / device described in the above embodiment; or may exist independently without being assembled into the device / apparatus / device. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the target ball center positioning method of the complex scene laser tracker based on YOLOv3 according to the embodiment of the present disclosure is implemented.
[0100] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In an embodiment of the present disclosure, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution device, device or device. For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 602 and / or RAM 603 described above and / or one or more memories other than ROM 602 and RAM 603.
[0101] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program includes a program code for executing the method shown in the flowchart. When the computer program product is run in a computer device, the program code is used to enable the computer device to implement the complex scene laser tracker target ball center positioning method based on YOLOv3 provided by the embodiment of the present disclosure.
[0102] The above functions defined in the apparatus / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 601. According to the embodiment of the present disclosure, the apparatus, means, modules, units, etc. described above can be implemented by computer program modules.
[0103] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 609, and / or installed from a removable medium 611. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0104] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, the above functions defined in the device of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the above-described devices, equipment, means, modules, units, etc. can be implemented by computer program modules.
[0105] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0106] It should be noted that the functional modules in the various embodiments of the present disclosure may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of software functional modules. If the integrated modules are implemented in the form of software functional modules and sold or used as independent products, they may be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention may essentially or in other words, the part that contributes to the prior art or all or part of the technical solution may be embodied in the form of a software product.
[0107] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the devices, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of boxes in the block diagram or flow chart, can be implemented with a dedicated hardware-based device that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0108] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0109] Although the present disclosure has been shown and described with reference to specific exemplary embodiments of the present disclosure, it should be understood by those skilled in the art that various changes in form and details may be made to the present disclosure without departing from the spirit and scope of the present disclosure as defined by the appended claims and their equivalents. Therefore, the scope of the present disclosure should not be limited to the above-mentioned embodiments, but should be determined not only by the appended claims, but also by the equivalents of the appended claims.
Claims
1. A method for locating the center of a target ball of a laser tracker in a complex scene based on YOLOv3, characterized in that: include: Acquire an original image; wherein the original image includes a target ball; Detect the original image based on the YOLOv3 model to obtain the area information of the target ball in the original image pixel coordinate system; According to the region information, the original image is cropped to obtain the target region; Preprocessing the target area to obtain a preprocessed target area, Wherein, the preprocessing of the target area to obtain the preprocessed target area includes: Binarizing and morphologically processing the target region to obtain the target region after morphological processing; According to the preprocessed target area, the sphere center coordinate information of the target sphere is fitted by using the Hough transform method, and the sphere center coordinate information is obtained in the original image pixel coordinate system by scaling transformation and coordinate translation; According to the sphere center coordinates in the original image pixel coordinate system, the sphere center coordinates of the target sphere in the laser tracker coordinate system are solved to complete the sphere center positioning of the target sphere.
2. The method for locating the center of a target ball using a YOLOv3 laser tracker in complex scenes according to claim 1, characterized in that: The method of calculating the spherical center coordinates of the target sphere in the laser tracker coordinate system according to the spherical center coordinates in the original image pixel coordinate system to complete the spherical center positioning of the target sphere includes: According to the sphere center coordinates in the original image pixel coordinate system, the ideal sphere center coordinates of the target sphere in the normalized coordinate system are calculated to obtain the sphere center coordinates of the target sphere in the camera coordinate system; According to the conversion relationship between the laser tracker and the camera coordinate system and the center coordinates of the target ball in the camera coordinate system, the center coordinates of the target ball in the laser tracker coordinate system are calculated, the center coordinates of the target ball in the laser tracker coordinate system are obtained, and the center positioning of the target ball is completed.
3. The target ball center positioning method of the complex scene laser tracker of YOLOv3 according to claim 1 is characterized in that: The YOLOv3 model is trained by the following steps: Obtain N historical images of the target ball in a complex scene, and manually annotate them; wherein N is greater than or equal to 1000; The N manually annotated historical images are divided into a training set, a validation set and a test set according to a preset ratio; The training set is flipped, scaled and concatenated and then input into the YOLOv3 model for training; wherein, during the model training process, the hyperparameters of the YOLOv3 model are adjusted according to the accuracy of the validation set to obtain a trained YOLOv3 model.
4. The method for locating the center of a target ball of a YOLOv3 laser tracker in complex scenes according to claim 3, characterized in that: After the training set is flipped, scaled and spliced and input into the YOLOv3 model for training, the method further includes: The trained YOLOv3 model is tested using the test set to obtain a tested YOLOv3 model, and forward propagation parameter extraction and parameter solidification are performed on the tested YOLOv3 model to obtain an embedded deployable YOLOv3 model.
5. The method for locating the center of a target ball of a YOLOv3 laser tracker in complex scenes according to claim 4, characterized in that: The binarization and morphological processing of the target region to obtain the target region after morphological processing includes: An iterative method is used to obtain a binarization threshold of the target area; The target area after the binarization process is subjected to morphological closing operation and Gaussian filtering process to obtain the target area after the morphological process.
6. A target ball center positioning device for a complex scene laser tracker based on YOLOv3, characterized in that: include: An image acquisition module, used to acquire an original image; wherein the original image includes a target ball; An image detection module is used to detect the original image based on the YOLOv3 model to obtain the area information of the target ball in the original image pixel coordinate system; A target region cropping module, used to crop the original image to obtain the target region according to the region information; An image preprocessing module is used to preprocess the target area to obtain the preprocessed target area, wherein the preprocessing of the target area to obtain the preprocessed target area includes: Binarizing and morphologically processing the target region to obtain the target region after morphological processing; An image transformation module is used to fit the sphere center coordinate information of the target sphere using the Hough transformation method according to the preprocessed target area, and obtain the sphere center coordinate information in the original image pixel coordinate system through scale transformation and coordinate translation; The spherical center coordinate conversion module is used to solve the spherical center coordinate of the target sphere in the laser tracker coordinate system according to the spherical center coordinate in the original image pixel coordinate system, so as to complete the spherical center positioning of the target sphere.
7. The target ball center positioning device of a complex scene laser tracker based on YOLOv3 according to claim 6, characterized in that: The spherical center coordinate conversion module is used to solve the spherical center coordinate of the target sphere in the laser tracker coordinate system according to the spherical center coordinate in the original image pixel coordinate system, and complete the spherical center positioning of the target sphere, including: According to the sphere center coordinates in the original image pixel coordinate system, the ideal sphere center coordinates of the target sphere in the normalized coordinate system are calculated to obtain the sphere center coordinates of the target sphere in the camera coordinate system; According to the conversion relationship between the laser tracker and the camera coordinate system and the center coordinates of the target ball in the camera coordinate system, the center coordinates of the target ball in the laser tracker coordinate system are calculated, the center coordinates of the target ball in the laser tracker coordinate system are obtained, and the center positioning of the target ball is completed.
8. An electronic device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for locating the center of a target ball of a complex scene laser tracker based on YOLOv3 as described in any one of claims 1 to 5 is implemented.
9. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for locating the center of a target ball of a complex scene laser tracker based on YOLOv3 as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Large field of view camera calibration method based on precision two-axis turntable and laser tracker
CN108921901A
Image detection method, device and system
CN110472623A
A method and device for detecting obstacle
CN111612760A
Object Monitoring System and Methods
US20220019810A1
