Angle measurement method, apparatus, device, computer program and storage medium
By performing planar detection and iterative fitting on the point cloud map of the image acquisition device, the problems of accuracy and convenience in measuring the installation angle of the face payment camera were solved, and efficient angle calculation was achieved.
Patent Information
- Application Number
- CN202111326307.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-10
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2041-11-10
AI Technical Summary
In existing technologies, the installation angle measurement of facial payment cameras relies on human experience, resulting in low accuracy. Using orientation sensors increases cost and power consumption, reducing convenience.
By performing plane detection on the point cloud map acquired by the image acquisition device, the initial fitted plane information is obtained, the initial distance is calculated, and the location set is iteratively filtered and fitted to the plane until the preset conditions are met, the target fitted plane information and distance are obtained, thereby calculating the installation angle of the image acquisition device.
It simplifies the hardware and software configuration for angle measurement, improves the convenience and accuracy of angle measurement, and enhances the installation precision of image acquisition equipment.
Smart Images

Figure CN116109699B_ABST
Abstract
Description
Technical Field
[0001] This application relates to computer technology, and more particularly to an angle measurement method, apparatus, device, computer program, and storage medium. Background Technology
[0002] Currently, image detection applications are becoming increasingly widespread. To support related image detection functions, the correct installation of image acquisition equipment is essential. For example, for facial recognition payment applications, a camera for capturing faces needs to be installed at the correct angle to obtain standard facial images for face detection and payment services. Current facial recognition payment camera installation methods mainly include manual installation and installation using cameras with orientation sensors, such as gravity sensors (G-sensors). However, manual installation relies on the installer's experience and cannot accurately determine the installation angle, thus reducing the accuracy of angle measurements. Cameras with orientation sensors increase the cost and power consumption of sensor setup and require sensor calibration, thereby reducing the convenience of angle measurement. Summary of the Invention
[0003] This application provides an angle measurement method, apparatus, device, computer program, and storage medium, which can improve the accuracy and convenience of angle measurement.
[0004] The technical solution of this application embodiment is implemented as follows:
[0005] This application provides an angle measurement method, including:
[0006] By performing plane detection on the point cloud map acquired by the image acquisition device, initial fitting plane information is obtained. The initial fitting plane information represents the initial fitting plane corresponding to the reference plane in the point cloud map. The reference plane represents the reference object plane in the real image acquisition scene.
[0007] Based on the initial fitting plane information, calculate the initial distance between the coordinate points in the point cloud map and the initial fitting plane;
[0008] Based on the initial distance, the point cloud map is iteratively filtered for point sets and fitted to a plane until the plane fitting result meets the preset fitting conditions, at which point the target distance corresponding to the target fitting plane information is obtained; the target distance represents the distance from the imaging center of the image acquisition device to the reference plane;
[0009] The image acquisition angle of the image acquisition device is calculated based on the target distance.
[0010] This application provides an angle measuring device, including:
[0011] The detection module is used to perform plane detection on the point cloud map acquired by the image acquisition device to obtain initial fitting plane information. The initial fitting plane information represents the initial fitting plane corresponding to the reference plane in the point cloud map. The reference plane represents the reference object plane in the real image acquisition scene.
[0012] The distance calculation module is used to calculate the initial distance between the coordinate points in the point cloud map and the initial fitting plane based on the initial fitting plane information;
[0013] The iterative fitting module is used to iteratively filter the point set and fit the plane of the point cloud map based on the initial distance until the plane fitting result meets the preset fitting conditions, and then obtain the target distance corresponding to the target fitting plane information; the target distance represents the distance from the imaging center of the image acquisition device to the reference plane;
[0014] An angle calculation module is used to calculate the image acquisition angle of the image acquisition device based on the target distance.
[0015] In the above-described device, the detection module is further configured to select an initial point set from the point cloud image and calculate an initial feature vector of the initial point set; the initial feature vector represents the initial value of the normal vector of the reference plane; perform plane fitting based on the initial feature vector and a preset plane expression to obtain an initial fitted plane expression, and use the initial fitted plane expression as the initial fitted plane information; the preset plane expression is used to represent the coordinates of points located on the same plane based on the normal vector and the distance.
[0016] In the above-described device, the distance calculation module is further configured to obtain the coordinate values of each coordinate point in the point cloud image, and calculate the distance between each coordinate point and the initial fitting plane based on the coordinate values and the initial fitting plane expression, as the initial distance.
[0017] In the above apparatus, the iterative fitting module is further configured to: filter a first set of points from the point cloud image based on the initial distance; perform plane fitting based on the first set of points to obtain updated fitting plane information corresponding to the initial fitting plane information; the updated fitting plane information is used to characterize the updated fitting plane corresponding to the initial fitting plane; calculate the distance between the coordinate points in the point cloud image and the updated fitting plane based on the updated fitting plane information, as the updated distance corresponding to the initial distance; filter a second set of points from the point cloud image based on the updated distance; and iteratively perform point set filtering and plane fitting in the point cloud image based on the second set of points until the plane fitting result meets the preset fitting conditions, thereby obtaining the target distance in the target fitting plane information.
[0018] In the above apparatus, the iterative fitting module is further configured to: use the second point set as the current sub-point set for the first iteration; determine whether the number of coordinate points in the current sub-point set meets a preset fitting point quantity condition; if the number of coordinate points in the current sub-point set does not meet the preset fitting point quantity condition, perform plane fitting based on the current sub-point set, update the updated fitting plane information according to the plane fitting result of the current sub-point set; update the updated distance based on the updated fitting plane information, and filter the coordinate points of the point cloud map based on the updated distance, as the coordinate point set corresponding to the next iteration; iterate until the number of coordinate points in the current sub-point set meets the preset fitting point quantity condition, determine that the preset fitting condition is met, use the updated fitting plane information as the target fitting plane information, and obtain the target distance according to the target fitting plane information.
[0019] In the above-described apparatus, the iterative fitting module is further configured to calculate the first feature vector corresponding to the first point set, and perform plane fitting based on the first feature vector and a preset plane expression to obtain a first fitted plane expression; and use the first fitted plane expression as the updated fitted plane information.
[0020] In the above-described device, the iterative fitting module is further configured to determine the filtering conditions based on the initial distance and the preset installation parameters of the image acquisition device; and to filter out the first point set from the point cloud image based on the filtering conditions.
[0021] In the above device, the preset installation parameters include: installation height and installation tolerance; the iterative fitting module is further used to calculate the parameter difference between the installation height and the installation tolerance, and the parameter sum of the installation height and the installation tolerance; and to determine a distance filtering range based on at least one of the parameter difference and the parameter sum, and to use the distance filtering range as the filtering condition.
[0022] In the above-described device, the iterative fitting module is further configured to update the filtering conditions based on the updated distance and the preset installation parameters of the image acquisition device; and to filter out the second point set from the point cloud image based on the updated filtering conditions.
[0023] In the above-mentioned device, the angle calculation module is further used to calculate the difference between the installation height and the target distance, and to perform an inverse cosine calculation on the ratio of the target distance to the difference to obtain the image acquisition angle.
[0024] In the above-described device, the detection module is further configured to calculate the initial covariance matrix of the initial point set; and to perform singular value decomposition on the initial covariance matrix to obtain the initial eigenvector.
[0025] This application provides an electronic device, including:
[0026] Memory, used to store executable instructions;
[0027] The processor, when executing executable instructions stored in the memory, implements the angle measurement method provided in the embodiments of this application.
[0028] This application provides a computer-readable storage medium storing executable instructions for inducing a processor to execute and implement the angle measurement method provided in this application.
[0029] This application provides a computer program product, including a computer program or instructions, characterized in that, when the computer program or instructions are executed by a processor, they implement the angle measurement method provided in this application.
[0030] The embodiments of this application have the following beneficial effects:
[0031] This application embodiment performs plane detection on the point cloud map acquired by the image acquisition device to obtain the initial fitting plane information corresponding to the reference plane in the point cloud map. Based on the initial fitting plane information, the initial distance between the object coordinates in the point cloud map and the initial fitting plane is obtained. Thus, coordinate points close to the reference plane are selected from the point cloud map using the initial distance. The selected coordinate points are then used to iteratively fit the corresponding fitting plane of the reference plane in the point cloud map until a target fitting plane information that meets preset fitting conditions is obtained—that is, the target fitting plane closest to the reference plane. The corresponding target distance is then obtained based on the target fitting plane information, and the installation angle of the image acquisition device is calculated from the target distance. This application embodiment simplifies the hardware and software configuration and calculation process for installation angle measurement, improves the convenience of angle measurement, and improves the accuracy of the target distance through iterative point set selection and plane fitting, thereby improving the accuracy of angle calculation based on the target distance. Attached Figure Description
[0032] Figure 1 This is an optional structural diagram of the angle measurement system architecture provided in the embodiments of this application;
[0033] Figure 2 This is an optional structural schematic diagram of the angle measuring device provided in the embodiments of this application;
[0034] Figure 3 This is an optional flowchart illustrating the angle measurement method provided in an embodiment of this application;
[0035] Figure 4 This is an optional schematic diagram of collecting point cloud images in a real scene, provided in an embodiment of this application;
[0036] Figure 5 This is an optional schematic diagram of the image acquisition device provided in this application performing point cloud image acquisition at a pre-installation angle;
[0037] Figure 6 This is an optional effect diagram for displaying point cloud maps in the 3D rendering engine provided in this application embodiment;
[0038] Figure 7 This is an optional flowchart illustrating the angle measurement method provided in an embodiment of this application;
[0039] Figure 8 This is an optional flowchart illustrating the angle measurement method provided in an embodiment of this application;
[0040] Figure 9 This is an optional flowchart illustrating the angle measurement method provided in an embodiment of this application;
[0041] Figure 10 This is an optional flowchart illustrating the application of the angle measurement method provided in this application embodiment to a real-world scenario;
[0042] Figure 11 This is an optional flowchart illustrating the application of the angle measurement method provided in this application embodiment to a real-world scenario. Detailed Implementation
[0043] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0044] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0045] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0046] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.
[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0048] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.
[0049] 1) Point Cloud Map: A point cloud map records the 3D coordinate information of an object in the real world. It can be calculated from a depth map and camera parameters. Although the depth map also contains the depth information of the object in the image, the (x, y) coordinates of a point in the depth map are pixel coordinates, while the point cloud map records the physical coordinates of that point in the real world. Point cloud maps can be displayed in 3D rendering engines, reflecting the three-dimensional (3D) positional relationships of each point.
[0050] 2) Depth Map: A depth map is obtained by capturing infrared light from a speckle structure using an infrared sensor and then resolving the speckle using depth cells. In 3D computer graphics and computer vision, a depth map is an image or image channel containing information about the distance from the surface of a scene object to the viewpoint. Each pixel in the depth map represents the vertical distance between the depth camera plane and the plane of the object being photographed, typically represented by 16 bits in millimeters. In facial recognition payment systems, it is generally used for: liveness detection and assisting in comparative recognition.
[0051] 3) Speckle Structured Light: Speckle structured light is a grid of light projected by an infrared speckle projector, arranged according to a certain structural pattern. A speckle structured light imaging system consists of an infrared laser projector and an infrared sensor, as shown in the figure below. These speckle lights are projected onto the surface of an object, and after imaging by the infrared sensor, the 3D coordinate information of the object's surface can be reconstructed based on the principle of triangulation, thereby obtaining a depth map.
[0052] 4) Camera intrinsic parameters: Camera intrinsic parameters are parameters used to describe the transformation relationship between the 3D coordinates of a real-world object when it is imaged on the camera sensor and the resulting pixel coordinates. Depth maps and point cloud maps can be converted to each other using camera parameters.
[0053] 5) Camera Coordinate System: The camera coordinate system refers to a coordinate system with the camera's optical center as the origin, the optical axis as the z-axis, and the x and y axes parallel to the x and y axes of the pixel plane imaged by the camera. The 3D coordinates obtained through the transformation of the depth map and camera intrinsic parameters are the coordinates in the camera coordinate system.
[0054] This application provides an angle measurement method, apparatus, device, computer program, and storage medium, which can improve the accuracy and convenience of angle measurement. The following describes exemplary applications of the electronic devices provided in this application. These electronic devices can be implemented as smartphones, smartwatches, laptops, tablets, desktop computers, set-top boxes, mobile devices (e.g., mobile phones, portable music players, personal digital assistants, dedicated messaging devices, portable gaming devices), intelligent voice interaction devices, smart home appliances, and in-vehicle terminals, as well as various other types of terminals or user terminals. They can also be implemented as servers.
[0055] See Figure 1 , Figure 1 This is an optional architecture diagram of the angle measurement system 100 provided in the embodiments of this application. As one implementable method of the embodiments of this application, the image acquisition device 500 can be connected to the terminal 400 in a wired or wireless manner. As another implementable method of the embodiments of this application, the image acquisition device 500 can also be connected to the server 200 through the network 300, wherein the network 300 can be a wide area network or a local area network, or a combination of both.
[0056] The following will describe an exemplary application of an electronic device as a terminal.
[0057] Image acquisition device 500 is used to acquire point cloud images at the current installation angle and send the point cloud images to terminal 400;
[0058] Terminal 400 is used to perform plane detection on the point cloud map acquired by image acquisition device 500 to obtain initial fitting plane information in the point cloud map. The initial fitting plane information represents the initial fitting plane corresponding to the reference plane in the point cloud map. The reference plane represents the reference object plane in the real image acquisition scene. Based on the initial fitting plane information, the initial distance between the coordinate points in the point cloud map and the initial fitting plane is calculated. Based on the initial distance, the point cloud map is iteratively filtered for point sets and fitted with planes until the plane fitting result meets the preset fitting conditions, and the target distance corresponding to the target fitting plane information is obtained. The target distance represents the distance from the imaging center of the image acquisition device to the reference plane. Based on the target distance, the image acquisition angle of the image acquisition device is calculated.
[0059] When the electronic device is implemented as a server, the method and process by which the server 200 performs angle measurement based on the point cloud map are consistent with the process description corresponding to the terminal 400 above, and will not be repeated here.
[0060] In some embodiments, server 200 may be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. Server 200 may be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, smart voice interaction device, smart home appliance, or in-vehicle terminal, but is not limited thereto. Image acquisition devices and servers can be directly or indirectly connected via wired or wireless communication, which is not limited in this embodiment.
[0061] See Figure 2 , Figure 2 This is a schematic diagram of the structure of the terminal 400 provided in the embodiment of this application. Figure 2 The terminal 400 shown includes at least one processor 410, a memory 450, at least one network interface 420, and a user interface 430. The various components in the terminal 400 are coupled together via a bus system 440. It is understood that the bus system 440 is used to implement communication between these components. In addition to a data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 2 The general labeled all buses as Bus System 440.
[0062] Processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0063] User interface 430 includes one or more output devices 431 that enable the presentation of media content, including one or more speakers and / or one or more visual displays. User interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
[0064] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 450 may optionally include one or more storage devices physically located away from the processor 410.
[0065] The memory 450 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 450 described in this application embodiment is intended to include any suitable type of memory.
[0066] In some embodiments, memory 450 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.
[0067] Operating system 451 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;
[0068] The network communication module 452 is used to reach other computing devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 including: Bluetooth, WiFi, and Universal Serial Bus (USB), etc.
[0069] Presentation module 453 is configured to enable the presentation of information (e.g., a user interface for operating peripheral devices and displaying content and information) via one or more output devices 431 associated with user interface 430 (e.g., a display screen, a speaker, etc.).
[0070] The input processing module 454 is used to detect and translate one or more user inputs or interactions from one or more input devices 432.
[0071] In some embodiments, the apparatus provided in this application can be implemented in software. Figure 2 An angle measuring device 455 stored in memory 450 is shown. It can be software in the form of programs and plug-ins, including the following software modules: detection module 4551, distance calculation module 4552, iterative fitting module 4553 and angle calculation module 4554. These modules are logically connected and can therefore be arbitrarily combined or further split according to the functions they implement.
[0072] The functions of each module will be explained below.
[0073] In other embodiments, the apparatus provided in this application can be implemented in hardware. As an example, the apparatus provided in this application can be a processor in the form of a hardware decoding processor, which is programmed to execute the angle measurement method provided in this application. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0074] In some embodiments, the terminal or server can implement the angle measurement method provided in this application by running a computer program. For example, the computer program can be a native program or software module in an operating system; it can be a native application (APP), that is, a program that needs to be installed in the operating system to run, such as a social application APP or a messaging APP; it can also be a mini-program, that is, a program that only needs to be downloaded to a browser environment to run; or it can be a mini-program or web client program that can be embedded in any APP. In short, the above-mentioned computer program can be any form of application, module or plugin.
[0075] The angle measurement method provided in this application will be described in conjunction with exemplary applications and implementations of the electronic devices provided in the embodiments of this application.
[0076] See Figure 3 , Figure 3 This is an optional flowchart illustrating the angle measurement method provided in this application embodiment, which will be combined with... Figure 3 The steps shown are explained.
[0077] S101. By performing plane detection on the point cloud map acquired by the image acquisition device, initial fitting plane information is obtained. The initial fitting plane information represents the initial fitting plane corresponding to the reference plane in the point cloud map. The reference plane represents the reference object plane in the real image acquisition scene.
[0078] The angle measurement method provided in this application can be applied to scenarios where image acquisition devices are installed, specifically to measure the installation angle of such devices. For example, it can be used to measure the installation angle of cameras for facial payment or facial recognition to ensure correct camera installation. The specific method can be chosen based on actual circumstances, and this application does not limit its application.
[0079] In this embodiment, the electronic device is connected to an image acquisition device, such as a camera or video camera. This embodiment does not limit the type of image acquisition device. In some embodiments, such as... Figure 4 As shown, the image acquisition device can use a human face as the subject, acquire point cloud images of the face, and obtain 3D coordinate information of each coordinate point on the face surface. In some embodiments, such as Figure 5 As shown, the object being photographed is located on a reference plane, and a light source is projected onto the surface of the object. The image acquisition device can acquire a point cloud image of the object on the reference plane at a pre-installed angle, and the electronic device can obtain the acquired point cloud image from the image acquisition device.
[0080] In this embodiment, the point cloud map acquired by the image acquisition device records the 3D coordinate information of each object within the image acquisition range in the real scene. In some embodiments, the point cloud map can be displayed in a 3D rendering engine, reflecting the 3D positional relationship of each coordinate point, such as... Figure 6 As shown.
[0081] In this embodiment, the electronic device can perform plane detection on a point cloud map, obtain the initial coordinates of the reference plane in the point cloud map based on the known feature vector of the reference plane, that is, perform plane fitting based on the coordinates in the point cloud map to obtain initial plane fitting information. Here, the initial fitted plane information represents the initial fitted plane corresponding to the reference plane in the point cloud map. The initial fitted plane information may include direction information representing the reference plane and distance information. In some embodiments, the direction information can be represented by a normal vector, and the distance information can be represented by the distance from the imaging center of the image acquisition device's shooting coordinate system, such as the distance from the optical center of the camera coordinate system.
[0082] In this embodiment, the reference plane represents a reference plane in the actual image acquisition scene. In some embodiments, the reference plane is used to provide a reference horizontal plane to determine whether the image acquisition angle is correct. For example, the reference plane may be a wall or a ground surface.
[0083] In some embodiments, the electronic device can obtain initial fitting plane information through a plane fitting method. For example, the electronic device can estimate the initial normal vector corresponding to the reference plane by calculating the feature vector of the point cloud map, and combine it with the plane expression corresponding to the initial normal vector, such as the plane equation in three-dimensional space, to obtain the initial plane equation representing the reference plane, which serves as the initial fitting plane information. That is, the electronic device can use the initial normal vector of the reference plane obtained by plane detection of the point cloud map as the initial parameter for fitting the reference plane into the point cloud map, and use the initial normal vector to define the positional constraint relationship that the coordinate points in the point cloud map and the reference plane need to satisfy, thus serving as the initial fitting plane information.
[0084] In some embodiments, the electronic device can extract the feature vectors of the point cloud map using Principal Component Analysis (PCA), then determine the normal vector corresponding to the reference plane based on the feature vectors of the point cloud map, and then fit the plane using the least squares method based on the normal vector corresponding to the reference plane and the plane expression to obtain the initial fitted plane information.
[0085] In some embodiments, the electronic device may also calculate the feature vector of the point cloud using integral maps or point feature histograms (PFH) descriptors; or, the electronic device may also approximate the normal vector of the reference plane using depth gradients. The specific choice is made according to the actual situation, and this application embodiment does not limit the choice.
[0086] In some embodiments, the electronic device can also combine known data of the installation angle to obtain initial fitting plane information through a conditional filtering method. For example, the electronic device can select a subset of coordinate points in the point cloud map based on the actual installation height of the image acquisition device relative to the reference plane in a real-world scenario, such as the actual installation height on the ground. Then, based on the angle between the normal to each point on the preset reference plane and the z-axis direction of the image acquisition device's coordinate system (e.g., the camera's coordinate system), it can further filter out coordinate points that may belong to the reference plane from the selected coordinate points. Finally, it uses the RANSAC algorithm to fit the initial fitting plane information. The specific selection depends on the actual situation, and this application embodiment does not limit the choice.
[0087] S102. Based on the initial fitting plane information, calculate the initial distance between the coordinate points in the point cloud map and the initial fitting plane.
[0088] In this embodiment, the initial fitting plane information includes the spatial position information of the initial fitting plane in the point cloud image. The electronic device can calculate the distance between the coordinate points in the point cloud image and the initial fitting plane represented by the initial fitting plane information based on the initial fitting plane information, and use this distance as the initial distance. Here, the initial distance represents the initial value of the distance between the imaging center and the reference plane. In subsequent steps, the electronic device can continuously update the initial fitting plane information to gradually make the initial fitting plane approach the real reference plane, thereby improving the accuracy of angle calculation using the fitting plane information.
[0089] In some embodiments, the initial fitting plane information may be a planar expression that includes at least the three-dimensional coordinate values of the coordinate points and a distance coefficient as a parameter. The distance coefficient represents the distance of the initial fitting plane from the imaging center of the image acquisition device's shooting coordinate system. In this way, the electronic device can substitute the coordinate values of each coordinate point in the point cloud image into the initial fitting plane information to calculate the distance coefficient value corresponding to each coordinate point, which is then used as the initial distance.
[0090] S103. Based on the initial distance, iteratively filter the point set and fit the plane in the point cloud map until the plane fitting result meets the preset fitting conditions, and obtain the target distance corresponding to the target fitting plane information; the target distance represents the distance from the imaging center of the image acquisition device to the reference plane.
[0091] In this embodiment, the electronic device can filter the point cloud map based on an initial distance to obtain coordinate points whose distance from the imaging center is more consistent with the reference plane. Based on the filtered coordinate points, plane fitting is performed to further narrow the distance between the fitted plane and the reference plane. The electronic device iteratively updates the initial fitted plane information based on the plane fitting results, recalculates the distance between the initial fitted plane information and each coordinate point in the point cloud map, and then uses the recalculated distance to further filter the point set of coordinate points in the point cloud map, which serves as the plane fitting result. The plane fitting result represents the coordinate points within the same fitted plane that meet the filtering conditions. This iteration continues until the plane fitting result meets the preset fitting conditions, indicating that the currently obtained fitted plane information is quite close to the reference plane. The electronic device determines that the fitting standard has been met, i.e., the preset fitting conditions are satisfied, and uses the fitted plane information obtained in the current iteration as the target fitted plane information. The distance between the target fitted plane and the imaging center in the target fitted plane information is taken as the target distance, and the iteration process ends.
[0092] In some embodiments, the preset fitting condition can be a condition characterizing the degree of closeness between the plane fitted based on the selected point set and the reference plane, reaching a preset threshold. For example, the preset fitting condition may include: the number of coordinate points in the point cloud map located on the fitting plane is greater than or equal to a preset number threshold. The specific selection is made according to the actual situation, and this application embodiment does not limit it.
[0093] S104. Calculate the image acquisition angle of the image acquisition device based on the target distance.
[0094] In this embodiment, the target distance represents the distance between the imaging center and the reference plane. Furthermore, the target distance is obtained through multiple iterations of plane fitting, achieving the required accuracy for angle calculation. The electronic device can calculate the image acquisition angle of the image acquisition device based on the target distance and the known positional relationship between the image acquisition device and the reference plane.
[0095] In some embodiments, the reference plane can be the ground plane, the image acquisition device can be a 3D camera, and the electronic device can obtain the current installation height of the image acquisition device. Based on the installation height and a preset triangular positional relationship between the ground plane and the 3D camera, the actual current image acquisition angle is calculated. For example, the electronic device can calculate the difference between the installation height and the target distance, and perform an inverse cosine calculation on the ratio of the target distance to the difference to obtain the image acquisition angle, which is the actual installation angle of the 3D camera. As shown in formula (1), the following is true:
[0096] (1)
[0097] In formula (1), For image acquisition angle, For the target distance, The installation height is known.
[0098] In some embodiments, the installer can use the angle measurement method described above in the embodiments of this application to measure the image acquisition angle of the image acquisition device as the current installation angle. If the current installation angle does not match the expected installation angle, the installer can adjust the current installation angle and use the angle measurement method of the embodiments of this application again based on the adjusted installation angle until the current installation angle matches the expected installation angle. In this case, it can be determined that the image acquisition device has been correctly installed.
[0099] It is understandable that by performing plane detection on the point cloud image acquired by the image acquisition device, the initial fitting plane information corresponding to the reference plane in the point cloud image is obtained. Based on the initial fitting plane information, the initial distance between the object coordinates in the point cloud image and the initial fitting plane is obtained. Thus, coordinates close to the reference plane are selected from the point cloud image using the initial distance. The selected coordinates are then used to iteratively fit the reference plane to the corresponding fitting plane in the point cloud image until a target fitting plane information that meets preset fitting conditions is obtained—that is, the target fitting plane closest to the reference plane. The corresponding target distance is then obtained based on the target fitting plane information, and the installation angle of the image acquisition device is calculated based on the target distance. This embodiment simplifies the hardware and software configuration and calculation process for installation angle measurement, improves the convenience of angle measurement, and improves the accuracy of the target distance through iterative point set selection and plane fitting, thereby improving the accuracy of angle calculation based on the target distance.
[0100] In some embodiments, based on Figure 3 ,like Figure 7 As shown, S101 can be implemented through S1011-S1012, which will be explained in conjunction with each step.
[0101] S1011. Select an initial point set from the point cloud map and calculate the initial eigenvector of the initial point set; the initial eigenvector represents the initial value of the normal vector of the reference plane.
[0102] In S1011, the electronic device can select an initial point set from the point cloud map, calculate the feature vector of the initial point set as the initial feature vector, and use the initial feature vector as the initial value of the normal vector of the reference plane calculated from the initial point set.
[0103] In some embodiments, the electronic device may randomly select an initial set of points or use an algorithm to select them. The specific selection is made according to the actual situation, and this application embodiment does not limit it.
[0104] In some embodiments, the electronic device can obtain the initial eigenvector by calculating the initial covariance matrix of the initial point set and performing singular value decomposition on the initial covariance matrix.
[0105] In some embodiments, when the reference plane is the ground plane, the electronic device can use the minimum value of the singular value decomposition as the normal vector of the ground plane.
[0106] S1012. Perform plane fitting based on the initial feature vector and the preset plane expression to obtain the initial fitted plane expression, and use the initial fitted plane expression as the initial fitted plane information; the preset plane expression is used to represent the coordinate points located on the same plane based on the normal vector and the distance.
[0107] In this embodiment, the electronic device can update a preset plane expression based on the normal vector represented by the initial feature vector to achieve plane fitting and obtain an initial fitted plane expression. Here, the preset plane expression is used to represent the coordinates of points located on the same plane based on the normal vector and the distance. The initial fitted plane expression is used to characterize the initial fitted plane corresponding to the initial point set.
[0108] In some embodiments, when performing plane fitting, the electronic device can combine a preset plane expression as shown in formula (2) and calculate the coefficients in the plane expression to fit a plane expression representing the reference plane, as shown in formula (2) below:
[0109] (2)
[0110] in,( , , The 3D coordinates of the points in the point cloud are given. A, B, C, and D are the coefficients of the plane equation. (A, B, C) represents the normal vector of the plane, and coefficient D represents the origin of the camera coordinate system, i.e., the distance from the imaging center to the plane represented by formula (2). It can be seen that the electronic device can use the initial feature vector as the plane normal vector (A, B, C) in formula (2) to obtain the known plane expression of A, B, and C, which is used as the initial fitting plane expression. The initial fitting plane expression is used to characterize the initial fitting plane corresponding to the initial point set.
[0111] In some embodiments, based on Figure 7 ,like Figure 8 As shown, S102 can be implemented through S1021, as follows:
[0112] S1021. Obtain the coordinate values of each coordinate point in the point cloud map, and calculate the distance between each coordinate point and the initial fitting plane based on the coordinate values and the initial fitting plane expression, as the initial distance.
[0113] In this embodiment of the application, based on the initial fitting plane expression obtained by the above process, the electronic device can obtain the coordinate values of each coordinate point in the point cloud map, and set the coordinate values of each coordinate point ( , , Substituting these values into the initial fitting plane expression, we obtain the initial values of the coefficients D corresponding to each coordinate point. That is, the distance between each coordinate point and the initial fitting plane, which is used as the initial distance.
[0114] It is understood that, in the embodiments of this application, the electronic device can initially fit the reference plane in the point cloud map by using the initial point set, and calculate the initial distance based on the initial fitted plane expression. In this way, the electronic device can filter coordinate points based on the initial distance in the subsequent process, thereby achieving further iterative fitting and distance updates to improve the accuracy of angle measurement.
[0115] In some embodiments, based on Figure 3 , Figure 7 or Figure 8 Any one of them, such as Figure 9 As shown, S103 can be achieved by executing S1031-S1035, and each step will be explained in detail.
[0116] S1031. Based on the initial distance, select the first point set from the point cloud map.
[0117] In this embodiment of the application, the electronic device can select coordinate points from the point cloud map that have a high degree of fit with the initial fitting plane expression, that is, whose distance from the reference plane conforms to the distance range corresponding to the initial distance, as the first point set.
[0118] In some embodiments, the electronic device can determine the filtering conditions based on the initial distance and the preset installation parameters of the image acquisition device; and filter out the first set of points from the point cloud map according to the filtering conditions.
[0119] In some embodiments, the preset installation parameters include: installation height and installation tolerance; the electronic device can calculate the parameter difference between the installation height and the installation tolerance, as well as the parameter sum of the installation height and the installation tolerance, determine the filtering conditions based on the parameter difference and the parameter sum, determine the distance filtering range based on at least one of the parameter difference and the parameter sum, and use the distance filtering range as the filtering conditions.
[0120] For example, the electronic device can use a distance filtering range that is greater than or equal to the parameter difference and less than or equal to the parameter sum value, and use the coordinates of the initial distances that meet the distance filtering range as the first point set. As shown in formula (3), it is as follows:
[0121] (3)
[0122] In formula (3), The initial distance, For installation height, For installation tolerances, This is the first point set.
[0123] S1032. Perform plane fitting based on the first point set to obtain the updated fitting plane information corresponding to the initial fitting plane information; the updated fitting plane information is used to characterize the updated fitting plane corresponding to the initial fitting plane.
[0124] In this embodiment, the first point set is a set of coordinate points in space that are closer to the reference plane, selected based on the initial distance. The electronic device can perform plane fitting based on the first point set and update the initial fitted plane information according to the plane fitting result to obtain updated fitted plane information. That is, based on the first point set, an updated fitted plane corresponding to the initial fitted plane is fitted. It can be understood that the updated fitted plane is a fitted plane that is closer to the reference plane than the initial fitted plane.
[0125] In some embodiments, the electronic device can calculate a first feature vector corresponding to a first point set, and perform plane fitting based on the first feature vector and a preset plane expression to obtain a first fitted plane expression; the first fitted plane expression is then used as information to update the fitted plane. Here, the process of the electronic device calculating the first feature vector based on the first point set and performing plane fitting based on the first feature vector and the preset plane expression is consistent with the process of calculating the initial feature vector based on the initial point set in S1011 and obtaining the initial fitted plane expression based on the initial feature vector in S1012, and will not be repeated here.
[0126] S1033. Based on the updated fitting plane information, calculate the distance between the coordinate points in the point cloud map and the updated fitting plane, and use it as the updated distance corresponding to the initial distance.
[0127] In this embodiment of the application, the electronic device calculates the distance between each coordinate point and the updated fitting plane based on the coordinate value of each coordinate point in the point cloud map and the updated fitting plane information, such as the first fitting plane expression, and uses it as the updated distance corresponding to the initial distance. In other words, the initial distance is updated to the updated distance corresponding to the updated fitting plane information.
[0128] S1034. Based on the updated distance, select the second point set from the point cloud map.
[0129] In this embodiment of the application, the electronic device further filters the coordinate points in the point cloud map based on the updated distance, and selects the point set that is closer to the reference plane as the second point set.
[0130] In some embodiments, the electronic device can update the filtering criteria based on the update distance and the preset installation parameters of the image acquisition device; and select a second set of points from the point cloud map based on the updated filtering criteria.
[0131] For example, the electronic device can use the updated distance as a parameter in formula (3). This yields the updated filtering criteria.
[0132] S1035. Based on the second point set, iteratively perform point set filtering and plane fitting in the point cloud map until the plane fitting result meets the preset fitting conditions, and obtain the target distance in the target fitting plane information.
[0133] In this embodiment, if the number of coordinate points in the second point set does not meet the preset fitting point quantity condition, it indicates that the fit between the updated fitting plane information and the reference plane is not high enough, and the preset fitting condition cannot be met. The process by which the electronic device iteratively performs plane fitting, distance calculation, and point set selection based on the second point set can be as follows:
[0134] In the first iteration, the second point set is used as the current sub-point set. In each iteration, it is determined whether the number of coordinate points in the current sub-point set meets the preset fitting point quantity condition. If the preset fitting point quantity condition is not met, a plane fitting is performed based on the current sub-point set. The fitting plane information is updated according to the plane fitting result, such as the new fitting plane expression. The update distance between the updated fitting plane information of each coordinate point in the point cloud is recalculated, and the filtering conditions are updated using the updated fitting plane information. The point set for the next iteration is selected from the point cloud based on the update distance and the filtering conditions. The iteration stops when the number of coordinate points in the current sub-point set meets the preset fitting point quantity condition. The target fitting plane information is obtained based on the plane fitting result of the current sub-point set, and the distance between each coordinate point in the point cloud and the target fitting plane information is calculated. The target distance is obtained based on the distance between each coordinate point and the target fitting plane information.
[0135] In some embodiments, the preset number of fitting points condition can be that the number of coordinate points is greater than or equal to a preset number threshold. Other conditions can also be set according to actual needs, and the specific selection should be based on the actual situation. This application embodiment does not limit the specific conditions.
[0136] It is understood that in the embodiments of this application, by continuously filtering the point set for fitting iteration, the fitting plane and the reference plane can be gradually brought closer. Under the condition of reaching the preset fitting conditions, the target fitting plane information with the required fitting accuracy is obtained. The target distance is obtained based on the target fitting plane information, thereby improving the accuracy of angle measurement based on the target distance. Moreover, no additional sensor configuration and calibration are required, saving hardware and software resources and improving the convenience of angle measurement.
[0137] Below, we will combine Figure 10 This illustrates an exemplary application of the embodiments of this application in a real-world application scenario.
[0138] In the embodiments of this application, such as Figure 10As shown, the image acquisition device is a 3D camera installed at a predetermined location. For example, the 3D camera can be a 3D camera used for facial recognition payment. The electronic device can obtain the installation angle of the 3D camera by executing S201, as follows:
[0139] S201. Acquire 3D point cloud images using a 3D camera.
[0140] S202. Using the ground plane as a reference plane, calculate the installation angle of the 3D camera.
[0141] S203. Determine whether the installation angle is consistent with the preset angle.
[0142] In S203, if the installation angle is inconsistent with the preset angle, the process in S201 and S202 is repeated using a 3D camera with an adjusted angle until the installation angle is consistent with the preset angle, thus completing the measurement of the installation angle of the 3D camera.
[0143] In S203, if the calculated installation angle is inconsistent with the preset angle, the installer can adjust the 3D camera and then continue to use the adjusted 3D camera to collect 3D point cloud maps according to the method in this embodiment of the application. The above process is repeated until the installation angle is consistent with the preset angle, and the installation angle measurement of the 3D camera is completed, and a 3D camera that meets the preset angle is obtained.
[0144] Among them, such as Figure 11 As shown, S202 can be achieved through the processes of S2021-S2028, as follows:
[0145] S2021: Calculate the covariance matrix by arbitrarily selecting a point set from the point cloud map, and perform SVD decomposition on the covariance matrix to obtain the initial eigenvectors.
[0146] S2022. Using the initial feature vector as the initial normal vector of the ground plane, and combining it with the preset plane equation, the initial ground plane equation is obtained.
[0147] In S022, the electronic device substitutes the initial normal vector into the preset plane equation. The coefficients (A, B, C) in the equation are used to obtain the initial plane equation. Here, the preset plane equation is equivalent to the preset plane expression, and the initial plane equation is equivalent to the initial fitted plane expression.
[0148] S2023. For all points in the point cloud map, substitute them into the initial plane equation to calculate the initial distance of all points from the initial plane.
[0149] In S2023, the initial plane is the plane represented by the initial plane equation, which is equivalent to the initial fitted plane mentioned above. The initial distance is the initial value of D in the preset plane equation.
[0150] S2024. Based on the known installation height and tolerance of the 3D camera, and combined with the initial distance, select the first point set from the point cloud map.
[0151] In S024, the electronic device acquires the installation height H of the 3D camera and the installation tolerance δ. Combined with the initial distance, it filters out the points that meet the requirements from the point cloud map. The coordinates of the points are used as the first point set. .
[0152] S2025. For all points in the first point set, iterate again through S2021-S2022 to fit the updated plane equation.
[0153] In S2025, updating the plane equation is equivalent to updating the fitted plane information.
[0154] S2026. Based on the updated plane equation, iterate S2023-S2024 again to select the second point set.
[0155] S2027. Check the number of coordinate points in the second point set. If it exceeds the preset threshold, execute S2028. Otherwise, jump to S2025 to start the iteration.
[0156] In S2027, if the number of coordinate points in the second point set exceeds a preset threshold, it indicates that the plane equation has a high degree of fit and can be used as the final plane equation, i.e., the target fitted plane information. Otherwise, the electronic device iterates through plane fitting, distance calculation, and point set selection based on the second point set until the number of coordinate points in the current point set exceeds the preset threshold, at which point the iteration ends and S2028 is executed.
[0157] S2028. Obtain the target distance based on the updated plane equation, and calculate the installation angle.
[0158] In S2028, the electronic device can calculate the distance from each coordinate point in the point cloud to the current updated plane equation based on the current updated plane equation, and use it as the target distance. Based on the target distance, the installation angle can be calculated using formula (1).
[0159] It is understood that when the embodiments of this application are applied in real-world scenarios, the installation angle of the 3D camera can be calculated from the direction of the 3D point cloud on the ground by photographing the ground, thereby achieving low-cost and correct camera installation and improving the convenience and accuracy of angle measurement.
[0160] The following description continues to illustrate the exemplary structure of the angle measuring device 455 provided in the embodiments of this application as a software module. In some embodiments, such as... Figure 2 As shown, the software module stored in the angle measuring device 455 in the memory 450 may include:
[0161] Detection module 4551 is used to perform plane detection on the point cloud map acquired by the image acquisition device to obtain initial fitting plane information. The initial fitting plane information represents the initial fitting plane corresponding to the reference plane in the point cloud map. The reference plane represents the reference object plane in the real image acquisition scene.
[0162] The distance calculation module 4552 is used to calculate the initial distance between the coordinate points in the point cloud map and the initial fitting plane based on the initial fitting plane information;
[0163] The iterative fitting module 4553 is used to perform iterative point set filtering and plane fitting on the point cloud map based on the initial distance until the plane fitting result meets the preset fitting conditions, and then obtain the target distance corresponding to the target fitting plane information; the target distance represents the distance from the imaging center of the image acquisition device to the reference plane.
[0164] Angle calculation module 4554 is used to calculate the image acquisition angle of the image acquisition device based on the target distance.
[0165] In some embodiments, the detection module 4551 is further configured to select an initial point set from the point cloud map, calculate an initial feature vector of the initial point set; the initial feature vector represents the initial value of the normal vector of the reference plane; perform plane fitting based on the initial feature vector and a preset plane expression to obtain an initial fitted plane expression, and use the initial fitted plane expression as the initial fitted plane information; the preset plane expression is used to represent the coordinate points located on the same plane based on the normal vector and the distance.
[0166] In some embodiments, the distance calculation module 4552 is further configured to obtain the coordinate value of each coordinate point in the point cloud map, and calculate the distance between each coordinate point and the initial fitting plane based on the coordinate value and the initial fitting plane expression, as the initial distance.
[0167] In some embodiments, the iterative fitting module 4553 is further configured to: filter a first set of points from the point cloud image based on the initial distance; perform plane fitting based on the first set of points to obtain updated fitting plane information corresponding to the initial fitting plane information; the updated fitting plane information is used to characterize the updated fitting plane corresponding to the initial fitting plane; calculate the distance between the coordinate points in the point cloud image and the updated fitting plane based on the updated fitting plane information, as the updated distance corresponding to the initial distance; filter a second set of points from the point cloud image based on the updated distance; and iteratively perform point set filtering and plane fitting in the point cloud image based on the second set of points until the plane fitting result meets the preset fitting conditions, thereby obtaining the target distance in the target fitting plane information.
[0168] In some embodiments, the iterative fitting module 4553 is further configured to: use the second point set as the current sub-point set for the first iteration; determine whether the number of coordinate points in the current sub-point set meets a preset fitting point quantity condition; if the number of coordinate points in the current sub-point set does not meet the preset fitting point quantity condition, perform plane fitting based on the current sub-point set; update the updated fitting plane information according to the plane fitting result of the current sub-point set; update the updated distance based on the updated fitting plane information; and filter the coordinate points of the point cloud map based on the updated distance to serve as the coordinate point set corresponding to the next iteration; iterate until the number of coordinate points in the current sub-point set meets the preset fitting point quantity condition; determine that the preset fitting condition is met; use the updated fitting plane information as the target fitting plane information; and obtain the target distance based on the target fitting plane information.
[0169] In some embodiments, the iterative fitting module 4553 is further configured to calculate the first feature vector corresponding to the first point set, and perform plane fitting based on the first feature vector and a preset plane expression to obtain a first fitted plane expression; and use the first fitted plane expression as the updated fitted plane information.
[0170] In some embodiments, the iterative fitting module 4553 is further configured to determine filtering conditions based on the initial distance and the preset installation parameters of the image acquisition device; and to filter out the first point set from the point cloud map based on the filtering conditions.
[0171] In some embodiments, the preset installation parameters include: installation height and installation tolerance; the iterative fitting module 4553 is further configured to calculate the parameter difference between the installation height and the installation tolerance, and the parameter sum of the installation height and the installation tolerance; determine a distance filtering range based on at least one of the parameter difference and the parameter sum, and use the distance filtering range as the filtering condition.
[0172] In some embodiments, the iterative fitting module 4553 is further configured to update the filtering conditions according to the update distance and the preset installation parameters of the image acquisition device; and to filter out the second point set from the point cloud map according to the updated filtering conditions.
[0173] In some embodiments, the angle calculation module 4554 is further configured to calculate the difference between the installation height and the target distance, and to perform an inverse cosine calculation on the ratio of the target distance to the difference to obtain the image acquisition angle.
[0174] In some embodiments, the detection module 4551 is further configured to calculate the initial covariance matrix of the initial point set; and to perform singular value decomposition on the initial covariance matrix to obtain the initial feature vector.
[0175] It should be noted that the description of the above device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects. For technical details not disclosed in the device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
[0176] This application provides a computer-readable storage medium storing executable instructions. When these executable instructions are executed by a processor, they cause the processor to perform the method provided in this application, for example... Figure 3 , Figures 7-11 The method shown in the figure.
[0177] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.
[0178] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0179] As an example, executable instructions may, but do not necessarily, correspond to files in the file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple collaborative files (e.g., a file that stores one or more modules, subroutines, or code sections).
[0180] As an example, executable instructions can be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.
[0181] In summary, this embodiment of the application performs plane detection on the point cloud map acquired by the image acquisition device to obtain the initial fitting plane information corresponding to the reference plane in the point cloud map. Based on the initial fitting plane information, the initial distance between the object coordinates in the point cloud map and the initial fitting plane is obtained. Thus, coordinate points close to the reference plane are selected from the point cloud map using the initial distance. The selected coordinate points are then used to iteratively fit the corresponding fitting plane of the reference plane in the point cloud map until a target fitting plane information that meets preset fitting conditions is obtained—that is, the target fitting plane closest to the reference plane. The corresponding target distance is then obtained based on the target fitting plane information, and the installation angle of the image acquisition device is calculated based on the target distance. This embodiment of the application simplifies the hardware and software configuration and calculation process for installation angle measurement, improves the convenience of angle measurement, and improves the accuracy of the target distance through iterative point set selection and plane fitting, thereby improving the accuracy of angle calculation based on the target distance.
[0182] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.
Claims
1. An angle measurement method, characterized in that, include: By performing plane detection on the point cloud map acquired by the image acquisition device, initial fitting plane information is obtained. The initial fitting plane information represents the initial fitting plane corresponding to the reference plane in the point cloud map. The reference plane represents the reference object plane in the real image acquisition scene. Based on the initial fitting plane information, calculate the initial distance between the coordinate points in the point cloud map and the initial fitting plane; Based on the initial distance, the point cloud map is iteratively filtered for point sets and fitted to a plane until the plane fitting result meets the preset fitting conditions, and the target distance corresponding to the target fitting plane information is obtained. The target distance represents the distance from the imaging center of the image acquisition device to the reference plane; The image acquisition angle of the image acquisition device is calculated based on the target distance.
2. The method according to claim 1, characterized in that, The step of performing plane detection on the point cloud image acquired by the image acquisition device to obtain initial fitted plane information includes: An initial point set is selected from the point cloud map, and an initial feature vector of the initial point set is calculated; the initial feature vector represents the initial value of the normal vector of the reference plane. The initial fitted plane expression is obtained by performing plane fitting based on the initial feature vector and the preset plane expression, and the initial fitted plane expression is used as the initial fitted plane information; the preset plane expression is used to represent the coordinate points located on the same plane based on the normal vector and the distance.
3. The method according to claim 2, characterized in that, The step of calculating the initial distance between the coordinate points in the point cloud and the initial fitting plane based on the initial fitting plane information includes: Obtain the coordinate value of each coordinate point in the point cloud map, and calculate the distance between each coordinate point and the initial fitting plane based on the coordinate value and the initial fitting plane expression, which is used as the initial distance.
4. The method according to any one of claims 1-3, characterized in that, Based on the initial distance, point set filtering and plane fitting are iteratively performed in the point cloud map until the plane fitting result meets the preset fitting conditions, thereby obtaining the target distance in the target fitting plane information, including: Based on the initial distance, a first set of points is selected from the point cloud map; Based on the first point set, a plane fitting is performed to obtain the updated fitting plane information corresponding to the initial fitting plane information; the updated fitting plane information is used to characterize the updated fitting plane corresponding to the initial fitting plane. Based on the updated fitting plane information, the distance between the coordinate point in the point cloud map and the updated fitting plane is calculated, and used as the updated distance corresponding to the initial distance; Based on the updated distance, a second set of points is selected from the point cloud map; Based on the second point set, point set filtering and plane fitting are iteratively performed in the point cloud map until the plane fitting result meets the preset fitting conditions, and the target distance in the target fitting plane information is obtained.
5. The method according to claim 4, characterized in that, Based on the second point set, point set filtering and plane fitting are iteratively performed in the point cloud map until the plane fitting result meets the preset fitting conditions, thereby obtaining the target distance in the target fitting plane information, including: Using the second point set as the current sub-point set for the first iteration, determine whether the number of coordinate points in the current sub-point set meets the preset fitting point number condition; If the number of coordinate points in the current sub-point set does not meet the preset fitting point number condition, a plane fitting is performed based on the current sub-point set, and the updated fitting plane information is updated according to the plane fitting result of the current sub-point set. The update distance is updated based on the updated fitting plane information, and the coordinate points of the point cloud map are filtered based on the updated distance as the coordinate point set corresponding to the next iteration; the iteration is executed until the number of coordinate points in the current point set meets the preset fitting point number condition, then the preset fitting condition is determined to be met, the updated fitting plane information is used as the target fitting plane information, and the target distance is obtained based on the target fitting plane information.
6. The method according to claim 4, characterized in that, The step of performing plane fitting based on the first point set to obtain updated fitting plane information corresponding to the initial fitting plane information includes: Calculate the first feature vector corresponding to the first point set, and perform plane fitting based on the first feature vector and a preset plane expression to obtain the first fitted plane expression; The first fitted plane expression is used as the updated fitted plane information.
7. The method according to claim 4, characterized in that, The step of selecting a first set of points from the point cloud map based on the initial distance includes: The screening criteria are determined based on the initial distance and the preset installation parameters of the image acquisition device; The first set of points is selected from the point cloud map according to the filtering criteria.
8. The method according to claim 7, characterized in that, The preset installation parameters include: installation height and installation tolerance; determining the screening conditions based on the initial distance and the preset installation parameters of the image acquisition device includes: Calculate the parameter difference between the installation height and the installation tolerance, as well as the parameter sum of the installation height and the installation tolerance; A distance filtering range is determined based on at least one of the parameter difference and the parameter sum, and the distance filtering range is used as the filtering condition.
9. The method according to claim 7 or 8, characterized in that, The step of filtering out a second set of points from the point cloud map based on the updated distance includes: The filtering criteria are updated based on the update distance and the preset installation parameters of the image acquisition device; The second set of points is selected from the point cloud map based on the updated filtering criteria.
10. The method according to claim 1 or 2, characterized in that, The reference plane is the ground plane, and the calculation of the image acquisition angle of the image acquisition device based on the target distance includes: Calculate the difference between the installation height and the target distance, and then calculate the inverse cosine of the ratio of the target distance to the difference to obtain the image acquisition angle.
11. The method according to claim 2 or 3, characterized in that, The calculation of the initial feature vector of the initial point set includes: Calculate the initial covariance matrix of the initial point set; The initial covariance matrix is subjected to singular value decomposition to obtain the initial eigenvector.
12. An angle measuring device, characterized in that, include: The detection module is used to perform plane detection on the point cloud map acquired by the image acquisition device to obtain initial fitting plane information. The initial fitting plane information represents the initial fitting plane corresponding to the reference plane in the point cloud map. The reference plane represents the reference object plane in the real image acquisition scene. The distance calculation module is used to calculate the initial distance between the coordinate points in the point cloud map and the initial fitting plane based on the initial fitting plane information; The iterative fitting module is used to perform iterative point set filtering and plane fitting on the point cloud map based on the initial distance until the plane fitting result meets the preset fitting conditions, and then obtain the target distance corresponding to the target fitting plane information. The target distance represents the distance from the imaging center of the image acquisition device to the reference plane; An angle calculation module is used to calculate the image acquisition angle of the image acquisition device based on the target distance.
13. The apparatus as claimed in claim 12, characterized in that, The detection module is also used for: An initial point set is selected from the point cloud map, and an initial feature vector of the initial point set is calculated; the initial feature vector represents the initial value of the normal vector of the reference plane; a plane fit is performed based on the initial feature vector and a preset plane expression to obtain an initial fitted plane expression, and the initial fitted plane expression is used as the initial fitted plane information; The preset plane expression is used to represent the coordinates of points located on the same plane based on the normal vector and the distance.
14. The apparatus as claimed in claim 13, characterized in that, The distance calculation module is also used for: Obtain the coordinate value of each coordinate point in the point cloud map, and calculate the distance between each coordinate point and the initial fitting plane based on the coordinate value and the initial fitting plane expression, which is used as the initial distance.
15. The apparatus according to any one of claims 12-14, characterized in that, The iterative fitting module is also used for: Based on the initial distance, a first set of points is selected from the point cloud image; a plane fitting is performed based on the first set of points to obtain updated fitting plane information corresponding to the initial fitting plane information; the updated fitting plane information is used to characterize the updated fitting plane corresponding to the initial fitting plane; based on the updated fitting plane information, the distance between the coordinate points in the point cloud image and the updated fitting plane is calculated as the updated distance corresponding to the initial distance; based on the updated distance, a second set of points is selected from the point cloud image; based on the second set of points, point set selection and plane fitting are iteratively performed in the point cloud image until the plane fitting result meets the preset fitting conditions, and the target distance in the target fitting plane information is obtained.
16. The apparatus as claimed in claim 15, characterized in that, The iterative fitting module is also used for: Using the second point set as the current sub-point set for the first iteration, determine whether the number of coordinate points in the current sub-point set meets the preset fitting point number condition; If the number of coordinate points in the current sub-point set does not meet the preset fitting point number condition, a plane fitting is performed based on the current sub-point set, and the updated fitting plane information is updated according to the plane fitting result of the current sub-point set. The update distance is updated based on the updated fitting plane information, and the coordinate points of the point cloud map are filtered based on the updated distance as the coordinate point set corresponding to the next iteration; the iteration is executed until the number of coordinate points in the current point set meets the preset fitting point number condition, then the preset fitting condition is determined to be met, the updated fitting plane information is used as the target fitting plane information, and the target distance is obtained based on the target fitting plane information.
17. The apparatus as claimed in claim 15, characterized in that, The iterative fitting module is also used for: Calculate the first feature vector corresponding to the first point set, and perform plane fitting based on the first feature vector and a preset plane expression to obtain a first fitted plane expression; use the first fitted plane expression as the updated fitted plane information.
18. An electronic device, characterized in that, include: Memory, used to store executable instructions; A processor, when executing executable instructions stored in the memory, implements the method according to any one of claims 1 to 11.
19. A computer-readable storage medium, characterized in that, It stores executable instructions for implementing the method of any one of claims 1 to 11 when executed by a processor.
20. A computer program product comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the method described in any one of claims 1 to 11.
Citation Information
Patent Citations
External parameter calibration method and device and electronic equipment
CN111383279A
Obstacle detection method, vehicle, equipment and computer storage medium
CN113536883A