Automobile camera light center positioning method and device
By establishing a camera optical center positioning method, obtaining the projection relationship of real environmental points and solving the vertical parameter s, the problem of accurate alignment of the AA process in vehicle camera installation is solved, achieving accurate positioning of the optical center and improving production efficiency.
Patent Information
- Application Number
- CN202410647492.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-23
- Publication Date
- 2024-08-30
AI Technical Summary
Existing vehicle-mounted cameras require an expensive AA process for optical center alignment during the installation process. As the pixel size of the image sensor decreases, insufficient control accuracy leads to an increase in pixel errors, an increase in the defective product rate, and the AA process time of each camera. Inconsistency, production rhythm fluctuates.
By obtaining the two-level conversion relationship of the projection of real environment points onto the lens and image sensor, the relationship between physical coordinates and digital pixel coordinates is established, the vertical parameter s is introduced, and the camera optical center positioning parameters are solved to avoid the accuracy of the AA process. Alignment to achieve reliable positioning compensation of the light center.
It realizes the accurate position calculation of the camera optical center in the sensor imaging plane, reduces data divergence, improves production efficiency, increases the throughput rate of the production line, simplifies the installation process, and reduces costs.
Smart Images

Figure CN118570289A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vehicle-mounted cameras, and in particular to a method and device for locating the optical center of a vehicle camera. Background Art
[0002] According to market research, the size of the in-vehicle camera market is expected to reach $19 billion in 2025. In the future, the technical challenges faced by in-vehicle cameras will become increasingly greater, and core companies in the industry are actively looking for new countermeasures. At present, a large number of car models have popularized intelligent assisted driving and parking systems. The system uses a large number of in-vehicle cameras to collect images of the environment around the vehicle, and achieves complete vehicle environment perception through image cropping, correction, splicing, perspective transformation, ranging and other algorithms, thereby realizing functions such as adaptive cruise control, collision warning, emergency braking, 360-degree surround view, automatic parking, etc.; it can also achieve multi-perspective 3D vehicle environment scenes by designing a framework model and using mapping algorithms; it can also complete vehicle intelligent driving BEV perception fusion through AI large models.
[0003] To realize the intelligent driving and parking functions, it is necessary to obtain the accurate value of the target in the sensor imaging position. Slight parameter deviations can also cause large errors in the target distance and lateral position, which may lead to errors in vehicle planning and control, and cause obvious errors in image stitching, which will have a great impact on driving, parking and surround view functions. Therefore, when manufacturing or installing vehicle-mounted cameras, it is necessary to ensure that some parameters are accurate and reliable.
[0004] Generally, the body installation data calibration is to obtain the relative position parameters between the installed camera and the vehicle. For the camera assembly process, the industry generally adopts the AA (full name: Active Alignment) process, that is, through the AA process, the center of light is aligned to the center of the image sensor through precise adjustment by the robot, and the uniform parallel plane must be maintained. AA in the automotive field is monopolized by foreign countries, and the expensive price is generally difficult to bear. There are also several companies in China doing it, and the effect needs to be improved. As image sensor technology improves and pixel size continues to decrease, the pixel error will continue to expand under the same AA control accuracy, increasing the defective rate. In addition, it has to face a tortuous debugging and after-sales process. Moreover, the AA process time of each camera is inconsistent, and the production rhythm fluctuates.
[0005] In view of this, overcoming the defects of the prior art is an urgent problem to be solved in the field of this technology. Summary of the invention
[0006] The technical problem to be solved by the present invention is how to complete reliable positioning compensation of the optical center without omitting the AA process.
[0007] The present invention adopts the following technical solution:
[0008] In a first aspect, the present invention provides a method for locating the optical center of a vehicle camera, the method comprising:
[0009] Obtain the two-level conversion relationship between the projection of point Pr in the real environment to point Po on the lens, and the projection of point Po to point P on the image sensor surface; take the center of the lens optical axis as the reference origin in the image sensor, so as to establish the coordinate conversion relationship between the physical coordinates of point P on the image sensor surface relative to the center of the lens optical axis and the digital pixel coordinates of point P;
[0010] According to the two-level conversion relationship and the coordinate conversion relationship, a target conversion relationship between the coordinates of point Pr and the digital pixel coordinates of point P is obtained; a vertical parameter s as a positioning parameter of the camera optical center is introduced into the target conversion relationship, and an equation with the vertical parameter s and the digital pixel coordinates of the lens optical axis center as parameters to be solved is obtained;
[0011] By adjusting the point Pr of the real environment, multiple groups of data are obtained and substituted into the equation of the parameters to be solved, and the vertical parameter s as the positioning parameter of the camera optical center and the digital pixel coordinates of the center of the lens optical axis are obtained.
[0012] Preferably, the method further comprises: obtaining a vertical parameter s as a positioning parameter of the camera optical center and a digital pixel coordinate of the center of the lens optical axis;
[0013] Use the least squares method to find the coefficient matrix and solve the parameters to be solved; or,
[0014] Use the preset value to iterate and try to get the converged extreme value as the solution; or,
[0015] Calculate the unknowns through multiple systems of equations and then find the average.
[0016] Preferably, after obtaining the vertical parameter s of the camera optical center positioning parameter and the digital pixel coordinates of the lens optical axis center, the method further comprises:
[0017] When a target object photographed by a car camera is calculated from a distance between the target object and the vehicle body by constructing a similar triangle based on its own installation height, the focal length of the lens and the imaging surface coordinates of the target object, the digital pixel coordinates of the center of the optical axis of the lens are used as compensation values to correct the similar triangle, thereby obtaining the compensated distance result between the target object and the vehicle body.
[0018] Preferably, when the point Pr is the coordinate of a point on the target object, obtaining the first-level transformation relationship of projecting the point Pr in the real environment to the point Po on the lens includes:
[0019] By rotating the matrix R around the X axis x , rotation matrix R around the Y axisy and the rotation matrix R around the Z axis z , construct the rotation matrix R of the camera relative to the point coordinates on the target object 3×3 =R x *R y *R z ;
[0020] Confirm the spatial translation T of the camera relative to the point coordinates of the target object on the three-dimensional coordinate axis 3×1 After that, the first-level conversion relationship is obtained.
[0021] Preferably, obtaining the second-level conversion relationship of point Po projected onto point P on the image sensor surface includes:
[0022] A similar triangle is constructed by using point Po on the lens and point P projected on the image sensor surface through the center of the lens, thereby establishing the second-level conversion relationship.
[0023] Preferably, the target conversion relationship between the coordinates of point Pr and the digital pixel coordinates of point P is obtained according to the two-level conversion relationship and the coordinate conversion relationship, specifically including:
[0024] The coordinate parameter value of the point Po in the second-level transformation relationship is replaced by the first-level transformation relationship. After the replacement, the original coordinate parameter value of the point Po in the second-level transformation relationship is transformed into the coordinate parameter value of the point Pr in the real environment and the rotation matrix R 3×3 and the spatial translation T 3×1 The expressions formed;
[0025] The physical coordinate parameter value of point P in the second-level transformation relationship is replaced by the coordinate transformation relationship. After the replacement, the physical coordinate of point P in the second-level transformation relationship is transformed into the digital pixel coordinate of point P, the digital pixel coordinate of the center of the lens optical axis, and the horizontal spacing d of the pixels in the image sensor. pm and longitudinal spacing d pn The constructed expression.
[0026] Preferably, the calculation process of the equation of the parameter to be solved is a matrix operation, which specifically also includes:
[0027] The target object is fixedly placed, and each camera takes a picture of the target object at a fixed angle. The allowable range of the first vector that constitutes the matrix equation is inferred through the deviation threshold, so that the first vector can be used as an intermediate value to filter out the cameras that exceed the standard in advance and end the calculation in advance.
[0028] Preferably, when the automobile camera is a surround view camera, its processing deviation is controlled within 1 / 30; when the automobile camera is a front view camera, its processing deviation is controlled within 1 / 20;
[0029] Among them, products that exceed the deviation will require rework or scrapping.
[0030] Preferably, when the resolution of the surround-view camera is 1M resolution, the deviation between the digital pixel coordinates of the center of the lens optical axis and the theoretical value is required to be within 30 pixels; when the resolution of the surround-view camera is 3M resolution, the deviation between the digital pixel coordinates of the center of the lens optical axis and the theoretical value is required to be within 50 pixels.
[0031] In a second aspect, the present invention further provides a device for locating the optical center of a car camera, the device comprising:
[0032] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor to execute the method for locating the optical center of a car camera described in the first aspect.
[0033] In a third aspect, the present invention further provides a non-volatile computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are executed by one or more processors to complete the method for locating the optical center of a car camera described in the first aspect.
[0034] In a fourth aspect, a chip is provided, comprising: a processor and an interface, for calling and running a computer program stored in a memory to execute the method for locating the optical center of a car camera as described in the first aspect.
[0035] In a fifth aspect, a computer program product comprising instructions is provided. When the instructions are executed on a computer or a processor, the computer or the processor executes the method for locating the optical center of a car camera as described in the first aspect.
[0036] The present invention calculates the exact position of the camera light center point on the imaging plane of the camera sensor and performs compensation. It is no longer necessary to accurately align the camera sensor with the lens, which can ensure the reliable implementation of the back-end algorithm. In addition, after the lens-related parameters are obtained in advance, data divergence can be avoided through calculation, iterations can be reduced, the production rhythm of the assembly line can be accelerated, and the direct pass rate of the production line can be increased. Moreover, the production line can achieve fully automatic operation, which is simple and fast. The algorithm has been adopted in the production line for mass production of cameras. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0038] Figure 1 is a schematic diagram of an exemplary vehicle structure including a car camera provided by an embodiment of the present invention;
[0039] Figure 2 is a top view of an exemplary vehicle structure including a vehicle camera provided by an embodiment of the present invention;
[0040] Figure 3 is a functional module diagram of an exemplary vehicle structure including a car camera provided by an embodiment of the present invention;
[0041] Figure 4 This is a schematic diagram of a car camera ranging method provided by an embodiment of the present invention;
[0042] Figure 5 This is a schematic diagram of a side view of a ranging imaging surface of a car camera provided by an embodiment of the present invention;
[0043] Figure 6 It is a flow chart of a method for locating the optical center of a car camera provided by an embodiment of the present invention;
[0044] Figure 7 is a flow chart of another method for locating the optical center of a car camera provided by an embodiment of the present invention;
[0045] Figure 8 is a flow chart of another method for locating the optical center of a car camera provided by an embodiment of the present invention;
[0046] Fig. 9 is a schematic diagram of imaging plane coordinate transformation provided by an embodiment of the present invention;
[0047] Fig.10 is a lens imaging transformation relationship provided by an embodiment of the present invention;
[0048] Fig.11 is a simplified lens imaging transformation relationship provided by an embodiment of the present invention;
[0049] Fig.12 It is a relationship between the coordinates of a camera point P0 and the coordinates of a real environment point Pr provided by an embodiment of the present invention;
[0050] Fig.13 It is an X-axis rotation relationship in a coordinate transformation relationship provided by an embodiment of the present invention;
[0051] Fig.14 It is a Y-axis rotation relationship in a coordinate transformation relationship provided by an embodiment of the present invention;
[0052] Fig.15 It is a Z-axis rotation relationship in a coordinate transformation relationship provided by an embodiment of the present invention;
[0053] Fig.16 An imaging chessboard grid corner point with black and white transition area effect diagram provided by an embodiment of the present invention;
[0054] Fig.17 The present invention is a schematic diagram of the structure of a device for locating the optical center of a car camera provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0056] In the description of the present invention, the terms "inside", "outside", "longitudinal", "lateral", "upper", "lower", "top", "bottom" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings. They are only for the convenience of describing the present invention and do not require that the present invention must be constructed and operated in a specific orientation. Therefore, they should not be understood as limitations on the present invention.
[0057] The terms "first", "second", etc. in the present invention are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", etc. may explicitly or implicitly include one or more of the features. In the description of this application, unless otherwise specified, "plurality" means two or more.
[0058] In this application, unless otherwise specified or limited, the term "connection" should be understood in a broad sense. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a direct connection or an indirect connection through an intermediate medium. In addition, the term "coupling" can be a way of achieving electrical connection for signal transmission.
[0059] The term "module" used in the embodiments of the present invention refers to any hardware, software, firmware, electronic control component, processing logic and / or processor device, alone or in any combination, including but not limited to: Application Specific Integrated Circuit (ASIC), Field Programmable Gate Array (FPGA), electronic circuit, processor (shared, dedicated or grouped) and memory that executes one or more software or firmware programs, combinational logic circuits and / or other suitable components that provide the functionality.
[0060] In the embodiments of the present invention, the description may be based on functional and / or logical block components and various processing steps. It should be understood that these block components may be implemented by any number of hardware, software and / or firmware components configured to perform the specified functions. For example, embodiments of the present invention may employ various integrated circuit components (e.g., memory elements, digital signal processing elements, logic elements, lookup tables, etc., which may perform multiple functions under the control of one or more microprocessors or other control devices).
[0061] For the sake of simplicity, the embodiments of the present invention may not describe in detail conventional techniques related to signal processing, digital transmission, signaling, control, machine learning models, automotive cameras, image analysis, and other functional aspects of the system (and the individual operating components of the system). In addition, the connecting lines shown in the various diagrams included in the embodiments of the present invention are intended to represent example functional relationships and / or physical connections between the various elements. It should be noted that many alternative or additional functional relationships or physical connections may exist in the embodiments of the present invention.
[0062] Figure 1 and Figure 2 An exemplary vehicle 100 including an automotive camera 102 is depicted. Figure 1 A side view of an exemplary vehicle 100 is presented, and Figure 2 A top view of an exemplary vehicle 100 is presented. An exemplary automotive camera 102 is mounted on a surface (e.g., a roof surface) of the exemplary vehicle 100, may be mounted on the top of a windshield inside the vehicle, or may be mounted on both sides of the vehicle near the front tires. The exemplary automotive camera 102 measures the distance to objects around the vehicle 100 by means of image recognition.
[0063] like Figure 1 , the vehicle 100 generally includes a chassis 12, a body 14, front wheels 16, and rear wheels 18. The body 14 is disposed on the chassis 12 and generally surrounds the components of the vehicle 100. The body 14 and the chassis 12 may together form a frame. The wheels 16 to 18 are each rotationally coupled to the chassis 12 near a respective corner of the body 14.
[0064] In various embodiments, the vehicle 100 is an autonomous vehicle. The autonomous vehicle 100 is, for example, a vehicle that is automatically controlled to transport passengers from one location to another. However, it should be understood that the vehicle 100 may also be any other means of transportation including motorcycles, trucks, sport utility vehicles (SUVs), recreational vehicles (RVs), ships, aircraft, etc.
[0065] In an exemplary embodiment, the autonomous vehicle 100 corresponds to a level 4 or level 5 automation system under the Society of Automotive Engineers (SAE) "J3016" standard classification of automated driving levels. Using this terminology, a level 4 system indicates "high automation," which refers to a driving mode in which the automated driving system performs all aspects of dynamic driving tasks, even if the human driver does not respond appropriately to intervention requests. On the other hand, a level 5 system indicates "full automation," which refers to a driving mode in which the automated driving system has comprehensive performance in all aspects of dynamic driving tasks under all road and environmental conditions that can be managed by a human driver. However, it should be understood that embodiments according to the present subject matter are not limited to any particular taxonomy or title of an automation category. In addition, a system according to the present embodiment may be used in conjunction with any vehicle in which the present subject matter may be implemented, regardless of the level of autonomy of the vehicle.
[0066] As shown, the autonomous vehicle 10 generally includes a propulsion system 20, a transmission system 702, a steering system 24, a braking system 26, a sensor system 28, an actuator system 30, at least one data storage device 32, at least one controller 34, and a communication system 36. The propulsion system 20 may include an internal combustion engine, an electric machine such as a traction motor, and / or a fuel cell propulsion system in various embodiments. The transmission system 702 is configured to transmit power from the propulsion system 20 to the wheels 16 and 18 according to a selectable speed ratio. According to various embodiments, the transmission system 702 may include a stepped ratio automatic transmission, a continuously variable transmission, or other suitable transmission.
[0067] Braking system 26 is configured to provide braking torque to wheels 16 and 18. In various embodiments, braking system 26 may include friction brakes, brake-by-wire brakes, a regenerative braking system such as an electric motor, and / or other suitable braking systems.
[0068] The steering system 24 affects the position of the wheels 16 and / or 18. Although depicted as including a steering wheel 25 for purposes of illustration, in some embodiments contemplated by the present invention, the steering system 24 may not include a steering wheel.
[0069] Sensor system 28 includes one or more sensing devices 40a to 40n that sense observable conditions of the external environment and / or the internal environment of autonomous vehicle 100 (such as the status of one or more occupants) and generate sensor data related to the conditions. Sensing devices 40a-40n may include, but are not limited to, radar (e.g., long-range, medium-range-short-range), lidar, global positioning system, optical camera (e.g., forward-looking, 360-degree, rear-looking, side-looking, stereo, etc.), thermal camera (e.g., infrared camera), ultrasonic sensor, range sensor (e.g., encoder), and / or other sensors that may be utilized in conjunction with systems and methods according to the present subject matter.
[0070] The actuator system 30 includes one or more actuator devices 42a to 42n that control one or more vehicle features, such as, but not limited to, the propulsion system 20, the transmission system 702, the steering system 24, and the braking system 26. In various embodiments, the autonomous vehicle 100 may also include Figure 1 Interior and / or exterior vehicle features not described herein, such as various doors, trunk, and cockpit features such as radio, music, lighting, touch screen display components (such as those used in conjunction with a navigation system).
[0071] The data storage device 32 stores data for automatically controlling the autonomous vehicle 100. In various embodiments, the data storage device 32 stores a defined navigable environment map. In various embodiments, the defined map can be predefined by a remote system and obtained from the remote system. For example, the defined map can be assembled by the remote system and transmitted to the autonomous vehicle 100 (wirelessly and / or by wire) and stored in the data storage device 32. Route information can also be stored in the data storage device 32, a set of road segments (geographically associated with one or more defined maps), together defining the route that a user can take from a starting location (e.g., the user's current location) to a target location. As will be appreciated, the data storage device 32 can be part of the controller 34, separate from the controller 34, or as part of the controller 34 and part of a separate system.
[0072] The controller 34 includes at least one processor 44 and a computer-readable storage device or medium 46. The processor 44 can be any customized or commercially available processor, a central processing unit (CPU), a graphics processing unit (GPU), an application-specific integrated circuit (ASIC) (e.g., a customized ASIC implementing a neural network), a field programmable gate array (FPGA), an auxiliary processor in several processors associated with the controller 34, a semiconductor-based microprocessor (in the form of a microchip or a chipset), any combination thereof, or any device generally used to execute instructions. The computer-readable storage device or medium 46 can include, for example, volatile and non-volatile storage devices in a read-only memory (ROM), a random access memory (RAM), and a keep alive memory (KAM). KAM is a persistent or non-volatile memory that can be used to store various operating variables when the processor 44 is powered off. Computer readable storage device or medium 46 may be implemented using any of a number of known memories such as a programmable read-only memory (PROM), an electrically programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), flash memory, or any other electrical, magnetic, optical, or combination memory device capable of storing data, some of which represents executable instructions used by controller 34 to control autonomous vehicle 100.
[0073] The instructions may include one or more separate programs, each of which includes an ordered list of executable instructions for implementing logical functions. The instructions, when executed by processor 44, receive and process signals (e.g., sensor data) from sensor system 28, perform logic, calculations, methods, and / or algorithms for automatically controlling components of autonomous vehicle 10, and generate control signals that are transmitted to actuator system 30 to automatically control components of autonomous vehicle 100 based on the logic, calculations, methods, and / or algorithms. Although Figure 1Only one controller 34 is shown, but embodiments of autonomous vehicle 100 may include any number of controllers 34 that communicate via any suitable communication medium or combination of communication media and cooperate to process sensor signals, execute logic, calculations, methods and / or algorithms, and generate control signals to automatically control features of autonomous vehicle 100.
[0074] The communication system 36 is configured to wirelessly transmit information to or receive information from other entities 48, such as, but not limited to, other vehicles ("V2V" communication), infrastructure ("V2I" communication), networks ("V2N" communication), pedestrians ("V2P" communication), remote transportation systems and / or user devices. In an exemplary embodiment, the communication system 36 is a wireless communication system configured to communicate via Wireless Local Area Networks (WLAN) using the IEEE802.11 standard or by using cellular data communications. However, additional or alternative communication methods such as dedicated short-range communication (DSRC) channels are also considered to be within the scope of the present disclosure. A DSRC channel refers to a one-way or two-way short-range to medium-range wireless communication channel designed specifically for automotive use and a corresponding set of protocols and standards.
[0075] According to various embodiments, the controller 34 implements Figure 3 The autonomous driving system (ADS) 70 shown in FIG. That is, the autonomous driving system 70 used in conjunction with the vehicle 100 is provided by using appropriate software and / or hardware components of the controller 34 (eg, the processor 44 and the computer-readable storage device 46 ).
[0076] In various embodiments, the instructions for the autonomous driving system 70 may be organized by function or system. Figure 3 As shown in FIG, the autonomous driving system 70 may include a perception system 74, a positioning system 76, a path planning system 78, and a vehicle control system 80. As can be appreciated, in various embodiments, instructions may be organized (e.g., combined, further divided, etc.) into any number of systems, as the present disclosure is not limited to this example.
[0077] In various embodiments, the perception system 74 synthesizes and processes the acquired sensor data and predicts the presence, location, classification, and / or path of objects and characteristics of the environment of the vehicle 100. In various embodiments, the perception system 74 may include information from multiple sensors (e.g., sensor system 28), including but not limited to automotive cameras, microwave radar, lidar, radar, and / or any number of other types of sensors.
[0078] The positioning system 76 processes the sensor data and other data to determine the position of the vehicle 100 relative to the environment (e.g., local position relative to a map, exact position relative to a road lane, vehicle heading, etc.). As can be appreciated, various techniques may be employed to achieve such positioning, including, for example, simultaneous localization and mapping (SLAM), particle filters, Kalman filters, Bayesian filters, etc.
[0079] The path planning system 78 processes the sensor data and other data to determine a path for the vehicle 10 to follow. The vehicle control system 80 generates control signals for controlling the vehicle 100 according to the determined path.
[0080] In various embodiments, the controller 34 implements machine learning techniques to assist in functions of the controller 34 , such as feature detection / classification, obstacle reduction, route traversal, mapping, sensor integration, ground truth determination, and the like.
[0081] The so-called AA process, which means active alignment in Chinese, is a technology that determines the relative position of parts during assembly. In the camera packaging process, it involves multiple assembly of parts such as image sensors, lens holders, motors, lenses, circuit boards, etc. Traditional packaging equipment such as chip scale package equipment (CSP) and chip on board packaging equipment (COB) all perform mobile assembly of parts according to the parameters adjusted by the equipment. Therefore, the stacking tolerance of parts is getting larger and larger. The final effect on the camera is that the clearest position of the picture may deviate from the center of the picture, and the clarity of the four corners is uneven.
[0082] When assembling each component, the AA process equipment will detect the semi-finished product being assembled, and actively align it according to the actual situation of the semi-finished product, and then assemble the next component in place. This active alignment technology can effectively reduce the assembly tolerance of the entire module, effectively improve the consistency of camera products, and also create possibilities for higher-level camera product packaging.
[0083] As the resolution of image sensors continues to increase and the size of single pixels continues to decrease, the relative positioning accuracy of the lens assembly to the sensor is becoming increasingly demanding, and traditional packaging equipment can no longer meet this requirement. Through the AA process active calibration technology, the lens alignment can be adjusted to 6 degrees of freedom (X, Y, Z, θ X ,θ Y and θ z ). By adjusting the relative position and lens tilt, the center of the picture can be ensured to be the clearest, and the uniformity of the resolution in the four corners of the picture can be improved, thus improving the consistency of the product.
[0084] The method of the present invention is applied to the camera production line, and compared with the currently commonly used AA process, it can improve the following problems:
[0085] 1. The alignment accuracy of the AA process is insufficient, resulting in poor image geometry calculation results;
[0086] 2. Due to the individual differences of each camera, the AA process cycle is unstable or too long, and even causes the AA process to fail and result in material loss;
[0087] 3. The UV glue used in the AA process ages and deforms over a long period of time, causing deviations in the relative displacement between the lens and the camera sensor, resulting in poor image stitching.
[0088] The method of the present invention aims to calculate the exact position of the camera light center point on the imaging plane of the camera sensor and make compensation. It is no longer necessary to accurately align the camera sensor and the lens, so as to ensure the reliable implementation of the back-end algorithm. In addition, after the relevant parameters of the lens are obtained in advance, data divergence can be avoided through calculation, iterations can be reduced, the production rhythm of the assembly line can be accelerated, and the direct pass rate of the production line can be increased.
[0089] Before describing the specific implementation scheme of the present invention, an orderly and logically clear overview of several technical concepts involved in the present invention is provided.
[0090] In the embodiment of the present invention, starting from a point Pr in reality, there is a physical coordinate (x Pr ,y Pr ,z Pr ), the coordinates are generated by taking the lens center of the camera lens as the origin of the coordinate axis, and the second-level transformation relationship in the embodiment of the present invention is also generated by this coordinate system.
[0091] In the embodiments of the present invention, the physical coordinates may also be described as real coordinates, which have the same meanings and are distinguished from the pixel coordinates in the embodiments of the present invention as a class; for the sake of uniformity, in the embodiments of the present invention, the physical coordinates are uniformly represented by (x 下标 ,y 下标 ,z 下标) method, where the specific meaning of the subscript corresponds to the coordinate expression of each point, and the identifier of the corresponding point is used as the content expression. For example, the physical coordinates of the point Pr in reality are expressed as (x Pr ,y Pr ,z Pr ), and the coordinates of the corresponding point Po on the lens are also understood as physical coordinates, expressed as (x Po ,y Po ,z Po ); on the other hand, digital pixel coordinates are uniformly (m 下标 ,m 下标 ,m 下标 ) method, where the specific meaning of the subscript is used for the coordinate expression of each point, and the identifier of the corresponding point is used as the content. For example, the center of the lens optical axis projects point o' in the image sensor, and the corresponding digital pixel coordinates of the generated image are expressed as (m o’ ,m o’ ,m o’ ); and the corresponding point P is represented in the digital pixel coordinates of the generated image as (m P ,m P ,m P ).
[0092] The point Pr in reality is projected onto the lens as point Po, and point Po is projected onto the image sensor surface as point P. The corresponding physical coordinates of point Po are (x Po ,y Po ,z Po ), the physical coordinates of point P are (x P ,y P ,z P ).
[0093] In the embodiments of the present invention, the so-called point Po on the lens cannot be simply understood as the literal meaning that Po is located on the lens; rather, the point Po on the lens should be understood as the coordinates (x Pr ,y Pr ,z Pr )The coordinate point (x) after lens perspective transformation Po ,y Po ,z Po ).
[0094] In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0095] Embodiment 1:
[0096] Compensation parameters play an important role in automotive intelligent driving products. For forward-looking advanced driving assistance system (ADAS) products, they can effectively improve the accuracy of target position measurement, and for the stitching calculation of 360-degree surround view systems, they can better realize complete bird's-eye view and 3D perspective scenes.
[0097] Monocular and binocular vision cameras need to accurately determine the target position, calculate the distance to the target and whether it is in the drivable area when implementing functions such as Adaptive Cruise Control (ACC), Automatic Emergency Braking (AEB), and Lane Departure Warning (LDW). For lane lines, due to the occlusion of the front of the vehicle, it is also necessary to accurately estimate the trend of the lane lines and whether they intersect with the wheel position. Figure 4 Case shown:
[0098] The camera is used to measure the distance between the vehicle in front and the vehicle itself, so as to control the vehicle speed and avoid collision. The monocular camera can be calculated by the following geometric measurement method, and then the network calibration can be performed. The algorithm process is roughly as follows:
[0099] Step 1: Assume that the target and the vehicle ground are on the same plane;
[0100] Step 2: Identify the target, which requires an accurate bounding box for the target, especially the border where the target touches the ground;
[0101] Step 3: Calculate the longitudinal distance between the target and the vehicle based on the triangular relationship;
[0102] Step 4: Calculate the lateral distance between the target and the vehicle based on the target imaging position.
[0103] like Figure 5 As shown, a simple description is: the height H of the camera installation point is determined, the position coordinate h of the target on the image sensor surface (as the imaging surface) is determined, and the focal length f of the camera lens is determined. Based on similar triangles, the distance d=H*f / h can be calculated.
[0104] Due to the assembly deviation of the camera, the imaging point position deviation will be caused, that is, h is inaccurate. The present invention needs to correct it through the compensation parameters obtained in the camera production process to improve the measurement accuracy. Similarly, for lane lines with lateral coordinate values, due to occlusion, it is necessary to estimate whether the front wheel is on the line, and the lateral offset should also be accurately compensated to avoid false alarms.
[0105] An embodiment of the present invention provides a method for locating the optical center of a car camera, which pre-solves the compensation value to be used in the above-mentioned scenario example, thereby ensuring the accuracy between the corresponding calculated result value and the actual distance during the use of the vehicle. It should be supplemented that although the method process of the embodiment of the present invention was originally intended for vehicle ranging application scenarios, those skilled in the art, after fully understanding the core of the method of the present invention, can apply it to calibration processes involving ranging fields such as drones, ships, and even spacecraft. Therefore, it should be understood that if the corresponding diffraction field also applies the innovative core of the method of the present invention, it should also be understood to be within the scope of protection of the present invention. Figure 6 The method comprises:
[0106] In step 201, a two-level conversion relationship is obtained, in which a point Pr in the real environment is projected onto a point Po on the lens and a point Po is projected onto a point P on the image sensor surface.
[0107] In the embodiment of the present invention, the transformation relationship between the projection of the point Pr in the real environment to the point Po on the lens is called the first-level transformation relationship, which includes: rotating the matrix R around the X-axis x , rotation matrix R around the Y axis y and the rotation matrix R around the Z axis z , construct the rotation matrix R of the camera relative to the point coordinates on the target object 3×3 =R x *R y *R z ; Confirm the spatial translation T of the camera relative to the point coordinates of the target object on the three-dimensional coordinate axis 3×1 After that, the first level conversion relationship is obtained. In the actual scene, the target object is usually a black and white chessboard. However, as an alternative, the black and white chessboard can be a long strip or a square, mainly the points on the black and white interface; in fact, only pictures with such characteristics are acceptable.
[0108] The transformation relationship from point Po projected onto point P on the image sensor surface is called a second-level transformation relationship, including: constructing a similar triangle from point Po on the lens to point P projected onto the image sensor surface through the lens center, thereby establishing the second-level transformation relationship.
[0109] Every time the light path passes through a point, a transformation occurs. When Pr is mapped to the lens Po, there is a rigid change; Po can be regarded as a point received by the lens surface, and then passes through the lens to the image plane behind, and there is a perspective transformation.
[0110] In step 202, the center of the lens optical axis is used as the reference origin in the image sensor, so as to establish a coordinate conversion relationship between the physical coordinates of point P on the image sensor surface relative to the center of the lens optical axis and the digital pixel coordinates of point P.
[0111] After the first-level conversion relationship and the second-level conversion relationship have been introduced in the above step 201, how to establish the above-mentioned coordinate conversion relationship in step 202 can be specifically completed through the following sub-steps 2021-2022:
[0112] In step 221, the coordinate parameter value of the point Po in the second-level transformation relationship is replaced by the first-level transformation relationship. After the replacement, the original coordinate parameter value of the point Po in the second-level transformation relationship is transformed into the coordinate parameter value of the point Pr in the real environment and the rotation matrix R 3×3 and the spatial translation T 3×1 The constructed expression.
[0113] In step 222, the physical coordinate parameter value of point P in the second-level transformation relationship is replaced by the coordinate transformation relationship. After the replacement, the physical coordinate of point P in the second-level transformation relationship is transformed into the digital pixel coordinate of point P, the digital pixel coordinate of the center of the lens optical axis, and the horizontal spacing d of the pixels in the image sensor. pm and longitudinal spacing d pn The constructed expression.
[0114] In the embodiment of the present invention, the Pr coordinate parameter value, the rotation matrix R 3×3 and the spatial translation T 3×1 , as well as the digital pixel coordinates of P, the lateral spacing d of the pixels in the image sensor pm and longitudinal spacing d pn All of them are known quantities and will be used in the following calculations. The reason is that the Pr coordinate parameter value and the rotation matrix R 3×3 and the spatial translation T 3×1 The three can be obtained by pre-arranging the test environment, while the digital pixel coordinates of P are directly obtained from the image generated by the camera. Furthermore, the horizontal spacing d of the pixels in the image sensor pm and longitudinal spacing d pn It is based on the parameter value that can be directly obtained from the camera manufacturer.
[0115] In step 203, the target conversion relationship between the coordinates of point Pr and the digital pixel coordinates of point P is obtained according to the two-level conversion relationship and the coordinate conversion relationship; the vertical parameter s as the camera light center positioning parameter is introduced into the target conversion relationship to obtain an equation with the vertical parameter s and the digital pixel coordinates of the lens optical axis center as the parameters to be solved. The vertical parameter s is the central axis offset angle parameter between the lens light plane and the image sensor surface.
[0116] In step 204, multiple sets of data are obtained by adjusting the point Pr of the real environment and substituted into the equation of the parameter to be solved to obtain the vertical parameter s as the camera optical center positioning parameter and the digital pixel coordinates of the lens optical axis center.
[0117] The embodiment of the present invention calculates the exact position of the center point of the camera light on the imaging plane of the camera sensor and performs compensation. It is no longer necessary to accurately align the camera sensor and the lens, which can ensure the reliable implementation of the back-end algorithm. In addition, after the relevant parameters of the lens are obtained in advance, they are calculated to avoid data divergence, reduce iterations, speed up the production rhythm of the assembly line, and increase the direct pass rate of the production line. Moreover, the production line can achieve fully automatic operation, which is simple and fast. The algorithm has been adopted in the production line for mass production of cameras.
[0118] Combined with the calibration parameters obtained in step 204 of the embodiment of the present invention, including the vertical parameter s of the camera optical center positioning parameter and the digital pixel coordinates of the lens optical axis center, which are introduced at the beginning of the embodiment of the present invention as follows Figure 4 and Figure 5 When performing the application example in the scenario shown in FIG. Figure 7 As shown, after obtaining the vertical parameter s of the camera optical center positioning parameter and the digital pixel coordinates of the lens optical axis center, the method further includes:
[0119] In step 205, when a target object photographed by a car camera is calculated from a distance between the target object and the vehicle body by constructing a similar triangle based on its own installation height, the focal length of the lens and the imaging surface coordinates of the target object, the digital pixel coordinates of the center of the optical axis of the lens are used as compensation values to correct the similar triangle, thereby obtaining a compensated distance result between the target object and the vehicle body.
[0120] In the embodiment of the present invention, the vertical parameter s is a parameter of a tool role. Without it, the coordinate m of the imaging surface of the image sensor finally calculated is o’ and n o’ The accuracy is not guaranteed. In the subsequent use of the car camera to calibrate the captured content, only the calculated coordinates m of the imaging surface of the image sensor need to be used. o’ and n o’ value, the vertical parameter s has no effect.
[0121] Compared with the AA process introduced at the beginning of the embodiment, the present invention has a difference in core concepts; among them, AA is a theoretical calibration after one round of assembly. The result of this is that if the calibration itself has deviations in the process, the accuracy of the final car camera cannot be effectively guaranteed. The core idea of the method of the present invention is that the deviations in the assembly process are not followed up and adjusted step by step, but the calibration parameters are measured after the final assembly is completed, so that the calibration parameters are introduced in the actual use of the car camera to complete the calculation of the final measurement value. For the camera completed by the AA process, it will not involve the process of using the calibration parameters to perform compensation calculations for the measurement results in the specific use process, such as the above-mentioned process of the present invention. Therefore, it can also be understood that the present invention is relatively using the later computing resources in exchange for the manufacturing cost and processing efficiency of the front-end car camera.
[0122] Theoretically, the optical center of the lens falls on the imaging surface of the sensor, and the coordinates and vertical data of the optical center of the lens on the imaging surface of the image sensor can be calculated, so as to compensate for different application algorithms later. However, in order to ensure the performance of the system, it is also necessary to limit the degree of deviation to ensure system performance. If the optical center deviates too far, the pixels imaged near this point will become sparse, and the image resolution will be low. For 360-degree surround products, the clarity of the spliced image will be inconsistent and the sensory effect will be poor. For forward-looking applications, the measurement accuracy is reduced due to sparse pixels. In addition, the controller algorithm will also crop the image according to the optical center point to extract the main information. Therefore, the accuracy of the camera production process will be controlled as much as possible to avoid excessive deviations in the assembly process.
[0123] Based on the above analysis, it is not difficult to find that the use of the method of the present invention actually implicitly plays a second role, which is to identify and screen out the corresponding calibration parameters of a batch of automotive cameras that exceed the reasonable range and are to be eliminated. Specifically, when the automotive camera is a surround-view camera, its processing deviation is controlled at 1 / 30 of the row or column resolution; when the automotive camera is a front-view camera, its processing deviation is controlled at 1 / 20 of the row or column resolution; among them, products exceeding the deviation will require rework or scrapping.
[0124] When the resolution of the surround-view camera is 1M, the deviation between the digital pixel coordinates of the center of the lens optical axis and the theoretical value is required to be within 30 pixels; when the resolution of the surround-view camera is 3M, the deviation between the digital pixel coordinates of the center of the lens optical axis and the theoretical value is required to be within 50 pixels.
[0125] So far, in the embodiment of the present invention, it is proposed that the second layer of the function described above is further improved by identifying and screening out the corresponding calibration parameters of a batch of automotive cameras that exceed the reasonable range and are to be eliminated, which provides a more optimal solution for the calculation efficiency of the automotive camera structure design link and the production yield verification stage. The method is implemented as follows:
[0126] The chessboard is fixed, and each camera takes a picture of the chessboard at a fixed angle. The allowable range of the first vector constituting the matrix equation is inferred through the deviation threshold, so that the first vector can be used as an intermediate value to filter out the cameras exceeding the standard in advance and end the calculation in advance. Here, after introducing the specific formula expression in Example 2, a more detailed description will be given (in Example 2, the first vector is specifically expressed as vector I). For those skilled in the art, after giving the technical solution description here, it is sufficient to select the key first vector in the specific formula code implementation process. Therefore, what is protected here is the physical objective reality of combining the chessboard object and the first-level conversion relationship in the calculation process of the present invention, and the above tricky means can be used to identify the cameras exceeding the standard in advance.
[0127] However, the above-mentioned solution of using the first vector as an intermediate value to filter out cameras that exceed the standard in advance and end the calculation in advance also has certain constraints in its implementation, namely, the resolution of the corresponding calibrated car camera must meet the pixel-level recognition accuracy of the chessboard outline. Only in this way can the allowable range of the first vector that constitutes the matrix equation be inferred through the deviation threshold by taking pictures of the chessboard at a limited number of fixed angles; otherwise, if the resolution accuracy of the detected car camera cannot effectively and accurately distinguish the outline of the chessboard, the acquisition of the allowable range of the corresponding first vector will be unqualified.
[0128] Embodiment 2:
[0129] The embodiment of the present invention is based on the method ideas described in Example 1, and combines the specific formula derivation to demonstrate the feasibility of the method described in Example 1 of the present invention, and how to complete the corresponding process of solving the vertical parameter s as the camera optical center positioning parameter and the digital pixel coordinates of the lens optical axis center. Figure 8 As shown, the method includes:
[0130] In step 301, a coordinate conversion relationship between the sensor pixel coordinates and the actual distance on the sensor is obtained.
[0131] The lateral spacing d of the pixels of the sensor pm The longitudinal spacing d pnYou can find it in the chip data sheet. The origin of the sensor's pixel coordinates is the first pixel in the upper left corner, which is defined as the origin of the image plane (the image plane is the generated image). The axis direction is the right m axis and the downward n axis. The software reads the pixel coordinates of the center point of the imaging lens optical axis (i.e. the center of the camera lens) o' as (m o’ ,n o’ ), then the actual distance coordinate (x o’ ,y o’ )=(d pm ×m o’ ,d pn ×n o’ ), where point o' is the center of the lens optical axis, and the coordinate plane with point o' as the origin is defined as the light plane. The real environment point Pr is projected onto point Po on the lens, and further projected onto point P on the image sensor surface. The display effect on the light plane is as follows: Fig. 9 shown.
[0132] Assume that the distance coordinates of point P read and converted on the drawing plane are (d pm ×m p ,d pn ×n p ), then P is in the light plane coordinate (x p ,y p ) is (d pm ×(m p -m o’ ),d pn ×(n p -n o’ )), converted to a matrix equation:
[0133]
[0134] That is, the coordinate transformation relationship is:
[0135]
[0136] In the specific implementation process, since the image after being transmitted through the lens of the camera is distorted, the coordinate m used in the above formula 1 is p and n p In the preferred embodiment, a round of distortion correction is performed, and the corresponding correction process is as follows:
[0137] Lens distortion is divided into barrel distortion (radial distortion) and pincushion distortion (tangential distortion). Generally, the distortion of a camera is mainly barrel distortion, which can be expressed by the following Taylor formula:
[0138] Where k1, k2, k3 are distortion coefficients, which are known quantities provided in advance by the corresponding lens product manufacturers, r is the distance from the imaging point on the imaging surface of P to the point o' on the imaging surface, and Substitute this method into the above formula 0 to complete the transformation of the distorted surface to a flat surface. In the implementation of the preferred solution, m in formula 1 p and n p will be replaced by m in formula 0 p’ and n p’ The imaging surface described here refers to the physical detection area surface of the sensor.
[0139] In step 302, the imaging transformation relationship between point Po on the lens and point P on the imaging surface of the camera is obtained.
[0140] The imaging transformation relationship here is the specific expression of the second-level conversion relationship in Example 1. The imaging principle is as follows Fig.10 As shown, let the object distance u, image distance v, focal length f, and their relationship be 1 / u+1 / v=1 / f; since the focal length f of the on-board 360-degree panoramic fisheye lens is very small, generally within a few millimeters, and the object distance u is relatively large, the formula 1 / u+1 / v=1 / f can be simplified to 1 / v=1 / f, and the simplified relationship finally shown is as follows Fig.11 shown.
[0141] Among them, the Po coordinate (x Po ,y Po ,z Po ), coordinates of point P on the imaging surface (x p ,y p ,z p ), where the z axis is distance, the horizontal axis is x, and the vertical axis (vertical to the page direction) is y; Po =u,z p =f.
[0142] like Fig.11 As shown, according to the principle of similar triangles, So the coordinate relationship between the two points is:
[0143] Here, Fig.11 The imaging surface in Fig. 9 The imaging surface in is the physical detection area surface of the same camera sensor, and, Fig.11 The lens center origin in is mapped to Fig. 9 is point o', so at the corresponding z p =f, then x in Formula 2 p ,y p With x in formula 1 p ,y pA logically direct and equivalent substitution relationship is established.
[0144] In step 303, the projection relationship between the coordinates of the point Po on the lens of the car camera and the point Pr in the real environment is obtained. The projection relationship here is the specific expression of the first-level conversion relationship in embodiment 1 in this embodiment 2.
[0145] like Fig.12 As shown in , the spatial relative position of the camera relative to a point Pr on the chessboard grid has rotation around the three coordinate axes and translation in the directions of the three coordinate axes. Fig.12 In the coordinate system shown, the origin is still the lens center, so that a common coordinate relationship can be established with the coordinate system of the imaging transformation relationship in step 302. Therefore, a direct equivalent relationship can be established between the Po coordinate in the projection relationship and the Po coordinate in the imaging transformation relationship.
[0146] Assuming that the coordinate system conforms to the right-hand rule, the rotation matrix around the axis of spatial analytic geometry is as follows:
[0147] like Fig.13 As shown, rotate α around the x-axis:
[0148]
[0149] like Fig.14 As shown, rotate β around the y-axis:
[0150]
[0151] like Fig.15 As shown, rotate φ around the z-axis:
[0152]
[0153] Then the rotation matrix of the camera relative to the coordinates of the chessboard points is R 3×3 =R x *R y *R z =(r 1 r 2 r 3 ), where R x *R y *R z The convolution operation is performed on three rotating arrays. The 3×3 matrix result is obtained according to the first column vector r 1 , the second column vector is r 2 , the third column vector is r 3 The matrix relationship is established as (r 1 r 2 r 3 ).
[0154] For the spatial translation of the three coordinate axes, let the physical distance of the chessboard point Pr relative to the camera point Po be the translation amount T on the x, y, and z axes. 3×1 , where t x ,t y and t z They are the specific physical distance values on the x, y, and z axes:
[0155]
[0156] Therefore, the coordinate transformation formula of the camera point Po relative to the chessboard point Pr is Po = R 3×3 *Pr+T 3×1 ,Right now:
[0157]
[0158] In an optional implementation scheme of the embodiment of the present invention, if the positional relationship between the corresponding point Pr and the camera lens is preset, the above matrix R 3×3 and T 3×1 Both can be known quantities.
[0159] Transform formula 3 to obtain the projection relationship:
[0160]
[0161] In step 304, the overall transformation formula is obtained according to the coordinate transformation relationship, the imaging transformation relationship and the projection relationship.
[0162] The formula 2 representing the imaging transformation relationship in the above step 202 is formatted as follows:
[0163]
[0164] Substituting Formula 1 representing the coordinate transformation relationship and Formula 3 representing the projection relationship into the above adjusted format, Formula 2 is:
[0165]
[0166] The two full-rank matrices on the left side of the equation are reversible, so the transformation is:
[0167]
[0168] Simplified to:
[0169]
[0170] Further simplified to:
[0171] Considering that after the real environment point Pr is projected onto the 2D image plane, there are only two-dimensional coordinates (m p , n p ), the z coordinate can be omitted, so the z coordinate is defined as 0, that is, z pr =0;
[0172] Then (R 3×3 T 3×1 )The third column of the matrix can also be omitted, and the equation becomes:
[0173]
[0174] The above formula is to convert the real-world point (x pr ,y pr ) is converted to the camera image pixel coordinate point (m p , n p ), and the coordinates of these two points are known.
[0175] In step 305, the coefficient matrix is obtained by the least square method.
[0176] make but:
[0177] simplify:
[0178] Divide both sides by h 33 , which is transformed into:
[0179]
[0180] make
[0181] Here, it can be identified as the equation of the parameters to be solved described in Example 1.
[0182] The above formula is used to find the eight unknown elements in vector I (i.e., the specific expression of the first vector in Example 1 in the embodiment of the present invention). pr ,y pr ) and the camera sensor imaging point coordinates (m p ,n p ) is known, so using the data of the four points we can establish 8 equations to solve the I vector. However, if Fig.16As shown in the figure, there is a black and white transition area at the corner of the chessboard, and there is no obvious dividing line. In addition, noise also produces obvious errors in the imaging results. It can be seen that the coordinates of the corner points of the chessboard in the real environment cannot achieve the accuracy of 1 pixel, and there is a certain range of pixel errors. Therefore, during the positioning process, the coordinate data of the corresponding corner points does not strictly satisfy the above equation.
[0183] Therefore, more data points are needed to form an overdetermined linear equation according to the above equation to estimate the minimum error vector I. According to the image clarity of the production line, 8 points and 16 sets of equations are used in one picture for estimation.
[0184]
[0185] The above formula is expressed by AI=M.
[0186] Solve using the least squares method: Estimate the element in I with the minimum error, construct a multivariate function as the sum of the squares of the deviations of each equation, the solution to the minimum value of the function is the stationary point of the multivariate function, and find the partial derivative of each element of I to be 0. It can be deduced that A T AI=A T M.
[0187] So through I=(A T A) -1 A T M, calculate the elements of I. Different images taken will have different vectors I.
[0188] In step 306, the vertical parameter s as the positioning parameter of the camera optical center and the digital pixel coordinates of the center of the lens optical axis are obtained through the vector I.
[0189] Going back to Formula 4 and Formula 5, we get:
[0190]
[0191] If the camera optical center line (that is, the mechanical center of the lens) is not perpendicular to the image sensor imaging surface, a parameter s needs to be introduced and J is defined as:
[0192]
[0193] For lenses from the same batch, lens manufacturers can provide more accurate focal length and pixel size of the lenses in the batch, that is, d pm d pn , f are known, that is, p m With p n Known.
[0194] but
[0195] Formula 6 is simplified using a column vector:
[0196] Right now
[0197] Since the rotation matrix R 3×3 It is an orthogonal matrix, each of whose column vectors is a unit vector, and the vectors are orthogonal to each other.
[0198] Because they are orthogonal, Because h 33 ≠0, then Because, the unit vector, Right now but Right now
[0199] Two constraint equations: That is to say, a picture is obtained by calculating the vector I to provide two constraints. The three unknowns (also called degrees of freedom) include the vertical parameter s and the coordinate m of the center of the lens on the imaging surface of the image sensor. o’ and n o’ , which provides two constraint equations That is, a graph can provide 2 constraints.
[0200] The unknowns in this equation are the vertical parameter s and the coordinate m of the center of the lens on the imaging surface of the image sensor. o’ and n o’ , a total of 3 degrees of freedom, so, by taking two pictures and obtaining two different vectors I, we can solve the 3 degrees of freedom parameters. It is required that the two pictures have rotations relative to the x and y axes.
[0201] In the embodiment of the present invention, the vertical parameter s is a parameter of a tool role. Without it, the coordinate m of the imaging surface of the image sensor finally calculated is o’ and n o’ The accuracy is not guaranteed. In the subsequent use of the car camera to calibrate the captured content, only the calculated coordinates m of the imaging surface of the image sensor need to be used. o’ and n o’ value, the vertical parameter s has no effect.
[0202] In step 307, the above calculation process is repeated to calculate multiple sets of parameters. If the variance meets the specified splicing error requirement, the product can be considered to be qualified and pass the offline inspection.
[0203] To ensure the accuracy of the internal parameter calculation, the above calculation process is repeated to calculate multiple sets of parameters. If the variance meets the specified splicing error requirements, the product can be considered qualified and pass the offline inspection. However, for each shot of the acceptance process, the placement of the chessboard image requires that there is a relative rotation angle between the x and y axes, that is, to ensure that each image corresponds to Different, thus avoiding the situation where similar equations cannot be solved.
[0204] It should be noted that the algorithm derivation process shown in the embodiment of the present invention should not be understood as the only way that can be implemented at the program code level of the solution process of Example 1. The reason is that if the origin based on which the corresponding coordinate system is established is different, then the formula system established in the entire Example 2 will be completely different. On the other hand, taking the least squares method involved in step 305 to obtain the coefficient matrix, there are at least two other alternative methods in the optional implementation scheme of the present invention, including:
[0205] Alternative method 1 uses preset values to iteratively calculate, and through trial and error, obtains the converged extreme value as the solution; alternative method 2 calculates the unknowns separately through multiple equations, and then finds the average value. However, after testing and research, both of these alternative methods may have uncertainties, the iterative calculation process may not converge, and the closest solution cannot be found; the equations are calculated separately to find the average value, and the calculation results with large errors may be averaged, and the error is still large. The least squares method for finding the coefficient matrix is still the best method promoted by the present invention, but it should not be understood as the only method.
[0206] According to different product characteristics, there will be corresponding deviation limits. Some car manufacturers will also put forward relevant requirements. Generally, the processing deviation of the surround view camera is controlled within 1 / 30 of the horizontal or vertical pixel value. Different resolutions will have different pixel deviations. Currently, there are resolutions of 1M and 3M, and the requirements are that the deviation between the digital pixel coordinates of the center of the lens optical axis and the theoretical value is 30 pixels and the deviation between the digital pixel coordinates of the center of the lens optical axis and the theoretical value is within 50 pixels. For the front view camera, the assembly error will be controlled within 1 / 20 of the horizontal or vertical pixel value. Products that exceed the deviation will be required to be reworked or scrapped.
[0207] The calculation process is basically a matrix operation, which is fast and can be used to judge the quality of the calculation results. If the chessboard is fixed, each camera takes a picture of the chessboard at a fixed angle, and the allowable range of vector I is inferred through the deviation threshold. The intermediate value can be used to filter out the over-standard parts in advance and end the calculation in advance. However, because it may not be easy to control the spatial position of the camera and the chessboard with high precision during each photo-taking process with different cameras, the position error of the shooting process may be substituted into the calculation of vector I, so it is more accurate to use the final result data for screening.
[0208] Embodiment 3:
[0209] like Fig.17 , which is a schematic diagram of the architecture of an apparatus according to an embodiment of the present invention. The apparatus according to this embodiment includes one or more processors 421 and a memory 422. Fig.17 A processor 421 is taken as an example.
[0210] The processor 421 and the memory 422 may be connected via a bus or other means. Fig.17 The example of connecting through bus is taken in the following.
[0211] The memory 422 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs and non-volatile computer executable programs, such as the methods in Embodiment 1 and Embodiment 2. The processor 421 executes the methods by running the non-volatile software programs and instructions stored in the memory 422.
[0212] The memory 422 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 422 may optionally include a memory remotely arranged relative to the processor 421, and these remote memories may be connected to the processor 421 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0213] The program instructions / modules are stored in the memory 422, and when executed by the one or more processors 421, the method in the above embodiment 1 is executed, for example, the method described above is executed. Figure 6 Alternatively, execute the method in the above embodiment 2, for example, execute the above described Figure 8 The steps shown.
[0214] It is worth noting that the information interaction, execution process, etc. between the modules and units within the above-mentioned devices and systems are based on the same concept as the processing method embodiment of the present invention. The specific contents can be found in the description of the method embodiment of the present invention and will not be repeated here.
[0215] A person skilled in the art may understand that all or part of the steps in the various methods of the embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0216] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for locating the optical center of a car camera, characterized in that the method include: Obtain the two-level conversion relationship of projecting point Pr in the real environment to point Po on the lens, and projecting point Po to point P on the image sensor surface; The center of the lens optical axis is used as the reference origin in the image sensor, so as to establish a coordinate conversion relationship between the physical coordinates of point P on the image sensor surface relative to the center of the lens optical axis and the digital pixel coordinates of point P; According to the two-level conversion relationship and the coordinate conversion relationship, a target conversion relationship between the coordinates of point Pr and the digital pixel coordinates of point P is obtained; a vertical parameter s as a positioning parameter of the camera optical center is introduced into the target conversion relationship, and an equation with the vertical parameter s and the digital pixel coordinates of the lens optical axis center as parameters to be solved is obtained; By adjusting the point Pr of the real environment, multiple groups of data are obtained and substituted into the equation of the parameters to be solved, and the vertical parameter s as the positioning parameter of the camera optical center and the digital pixel coordinates of the center of the lens optical axis are obtained.
2. The method for locating the optical center of a car camera according to claim 1, characterized in that: The method further comprises: obtaining a vertical parameter s as a positioning parameter of the camera optical center and a digital pixel coordinate of the center of the lens optical axis; Use the least squares method to find the coefficient matrix and solve the parameters to be solved; or, Use the preset value to iterate and try to get the converged extreme value as the solution; or, Calculate the unknowns through multiple systems of equations and then find the average.
3. The method for locating the optical center of a car camera according to claim 1, characterized in that: After obtaining the vertical parameter s of the camera optical center positioning parameter and the digital pixel coordinates of the lens optical axis center, the method further includes: When a target object photographed by a car camera is calculated from a distance between the target object and the vehicle body by constructing a similar triangle based on its own installation height, the focal length of the lens and the imaging surface coordinates of the target object, the digital pixel coordinates of the center of the optical axis of the lens are used as compensation values to correct the similar triangle, thereby obtaining the compensated distance result between the target object and the vehicle body.
4. The method for locating the optical center of a car camera according to any one of claims 1 to 3, characterized in that: When the point Pr is the coordinate of a point on the target object, the first-level transformation relationship of projecting the point Pr in the real environment to the point Po on the lens is obtained, including: By rotating the matrix R around the X axis x , rotation matrix R around the Y axis y and the rotation matrix R around the Z axis z , construct the rotation matrix R of the camera relative to the point coordinates on the target object 3×3 =R x *R y *R z ; Confirm the spatial translation T of the camera relative to the point coordinates of the target object on the three-dimensional coordinate axis 3×1 After that, the first-level conversion relationship is obtained.
5. The method for locating the optical center of a car camera according to claim 4, characterized in that: The second-level transformation relationship of point Po projected onto point P on the image sensor surface is obtained, including: A similar triangle is constructed by using point Po on the lens and point P projected on the image sensor surface through the center of the lens, thereby establishing the second-level conversion relationship.
6. The method for locating the optical center of a car camera according to claim 5, characterized in that: The target conversion relationship between the coordinates of point Pr and the digital pixel coordinates of point P is obtained according to the two-level conversion relationship and the coordinate conversion relationship, specifically including: The coordinate parameter value of the point Po in the second-level transformation relationship is replaced by the first-level transformation relationship. After the replacement, the original coordinate parameter value of the point Po in the second-level transformation relationship is transformed into the coordinate parameter value of the point Pr in the real environment and the rotation matrix R 3×3 and the spatial translation T 3×1 The expressions formed; The physical coordinate parameter value of point P in the second-level transformation relationship is replaced by the coordinate transformation relationship. After the replacement, the physical coordinate of point P in the second-level transformation relationship is transformed into the digital pixel coordinate of point P, the digital pixel coordinate of the center of the lens optical axis, and the horizontal spacing d of the pixels in the image sensor. pm and longitudinal spacing d pn The constructed expression.
7. The method for locating the optical center of a car camera according to claim 6, characterized in that: The calculation process of the equation of the parameter to be solved is a matrix operation, which specifically includes: The target object is fixedly placed, and each camera takes a picture of the target object at a fixed angle. The allowable range of the first vector that constitutes the matrix equation is inferred through the deviation threshold, so that the first vector can be used as an intermediate value to filter out the cameras that exceed the standard in advance and end the calculation in advance.
8. The method for locating the optical center of a car camera according to claim 7, characterized in that: When the automobile camera is a surround-view camera and the resolution of the surround-view camera is 1M, the deviation between the digital pixel coordinates of the center of the lens optical axis and the theoretical value is required to be within 30 pixels; when the resolution of the surround-view camera is 3M, the deviation between the digital pixel coordinates of the center of the lens optical axis and the theoretical value is required to be within 50 pixels.
9. A device for locating the optical center of a car camera, characterized in that: The device comprises: At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor to execute the method for locating the optical center of a car camera according to any one of claims 1-8.
10. A non-volatile computer storage medium, characterized in that: The computer storage medium stores computer executable instructions, which are executed by one or more processors to complete the method for locating the optical center of a car camera as described in any one of claims 1-8.
Citation Information
Cited By
Parking space direction detection method, device and equipment for mechanical parking space and medium
CN119445057A
