WO2018227580A1 - 摄像头标定方法和终端 - Google Patents
摄像头标定方法和终端 Download PDFInfo
- Publication number
- WO2018227580A1 WO2018227580A1 PCT/CN2017/088714 CN2017088714W WO2018227580A1 WO 2018227580 A1 WO2018227580 A1 WO 2018227580A1 CN 2017088714 W CN2017088714 W CN 2017088714W WO 2018227580 A1 WO2018227580 A1 WO 2018227580A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image
- camera
- calibration
- images
- target feature
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
Definitions
- the present application relates to the field of augmented reality technologies, and in particular, to a camera calibration method and a terminal.
- AR Augmented Reality
- the current Augmented Reality (AR) technology is a new technology developed on the basis of virtual reality. It is a technology that increases the user's perception of the real world through the information provided by the computer system, applies the virtual information to the real world, and superimposes the computer-generated virtual object, scene or system prompt information into the real scene, thereby realizing the enhancement of reality. .
- the calibration of the camera refers to the process of determining the geometric relationship between the three-dimensional geometric position of a point on the surface of the space object in the real scene and its corresponding point in the image. It is necessary to establish a geometric model of the imaging of the camera and establish a geometric model of the imaging of the camera, ie It is to calibrate the camera. Calibrate the camera to get the camera parameters.
- Camera parameters can include internal parameters, distortion parameters, and external parameters.
- the accuracy of the camera parameters directly affects the superimposed display of virtual information. If the accuracy of the calibration result is low, the display of the virtual information superimposed to the real scene is poor.
- the embodiment of the present application provides a camera calibration method and a terminal. Can improve the accuracy of the obtained camera parameters.
- an embodiment of the present application provides a camera calibration method, where the method may include: acquiring, by a camera, at least two calibration images including a marker, the identifier including a plurality of target features; Determining camera parameters for each target feature in the first calibration image and the template image, and determining the at least one target according to the camera parameter and coordinate information of the at least one target feature in the template image Mapping coordinate information of the feature in the second calibration image; if there is a distance between the actual coordinate information of the first target feature in the second calibration image and the mapping coordinate information, the distance between the at least one target feature is greater than the first
- the threshold is updated according to other target features of the at least one target feature other than the first target feature.
- the embodiment of the present application provides a terminal, where the terminal has a function of realizing the behavior of the user terminal in the actual method, and the function may be implemented by using hardware or by executing corresponding software through hardware.
- the hardware or software includes one or more units corresponding to the functions described above.
- an embodiment of the present application provides a terminal, where the terminal includes a processor and a memory, and a computer program stored on the memory for the processor to call and execute, the processor being capable of calling the A computer program to perform any of the methods of the first aspect.
- an embodiment of the present application provides a computer readable storage medium, wherein the computer readable storage medium stores instructions that, when run on a computer, cause the computer to perform the methods described in the above aspects.
- At least two calibration images including the identifier are acquired by the camera, and the camera is determined according to the coordinate information of each of the plurality of target features included in the first calibration image and the template image. parameter. Further, according to the determined camera parameter and the coordinate information of the at least one target feature in the template image, mapping coordinate information of the at least one target feature in the second calibration image may be determined, by determining that the at least one target feature is in the second calibration image The distance between the mapped coordinate information and the actual coordinate information can determine the target feature with a large mapping error. If it is determined that the distance between the mapping coordinate information of the first target feature in the second calibration image and the actual coordinate information is greater than the first threshold, the target feature may be updated according to other target features than the first target feature. The camera parameters improve the accuracy of the camera parameters obtained after the camera is calibrated.
- FIG. 1 is a schematic flow chart of a camera calibration method according to an embodiment of the present application.
- FIG. 2 is a schematic diagram of a template image provided by an embodiment of the present application.
- FIG. 3 is a schematic diagram of another template image provided by an embodiment of the present application.
- FIG. 4 is a schematic flow chart of another camera calibration method according to an embodiment of the present application.
- FIG. 5 is a schematic flowchart diagram of still another camera calibration method according to an embodiment of the present application.
- FIG. 6 is a schematic structural diagram of a terminal according to an embodiment of the present disclosure.
- FIG. 7 is a schematic diagram of functions of a terminal according to an embodiment of the present application.
- the method embodiment is applicable to a terminal configured with a camera and a display.
- the terminal includes a mobile phone, a computer with a mobile terminal, a portable, pocket-sized, hand-held, mobile device built in the computer, a smart wearable device, and the like.
- PDA personal digital assistant
- tablet computer netbook computer
- portable computer media viewer, smart watch, smart helmet, smart glasses, smart bracelet and other smart wearable devices.
- at least other devices that compute processors and data storage devices are examples of a mobile phone, a computer with a mobile terminal, a portable, pocket-sized, hand-held, mobile device built in the computer, a smart wearable device, and the like.
- PDA personal digital assistant
- tablet computer netbook computer
- portable computer media viewer
- smart watch smart helmet
- smart glasses smart bracelet
- other smart wearable devices At least other devices that compute processors and data storage devices.
- FIG. 1 is a schematic flowchart diagram of a camera calibration method according to an embodiment of the present application. As shown in FIG. 1, the method includes at least the following steps.
- Step S101 The terminal acquires at least two calibration images including the identifier by using a camera, where the identifier includes a plurality of target features.
- the terminal acquires at least two calibration images including the identifier through the camera, the identifier including a plurality of target features.
- the calibration image is used for camera calibration to obtain camera parameters.
- the mapping relationship between the identifier and the calibration image may be determined by determining a mapping relationship between the coordinate information of the target image in the identifier and the coordinate information of the target image in the calibration image.
- the template image can be understood as an image that best embodies the marker.
- the virtual information is superimposed on a certain angle of the identifier, and the identifier image acquired at the angle is a template image.
- the template image may be acquired by camera shooting or pre-stored in the terminal.
- the template image for calibration described in the embodiments of the present application is not necessarily a calibration plate image. That is to say, the calibration plate image is not necessary for the camera calibration method provided by the present application.
- the user can select a template image according to the current environment, thereby enabling more flexible calibration of the camera.
- the template image 30 can be obtained by photographing the marker 10.
- the user is allowed to select the marker using the current environment, and the template image of the marker can be captured by the camera.
- the calibration image may be acquired, and further, the mapping relationship between the calibration image and the template image is obtained. , get the camera parameters.
- a plurality of target features in the calibration may be determined.
- the target feature of the calibration object may be determined by the terminal according to a preset rule, or It is determined by the user.
- the calibrator 10 in FIG. 1 includes a plurality of target features 101, and the target feature may be a target feature point, a target feature line, or a target feature block, etc., which is not specifically limited in this embodiment.
- the calibration image is obtained in a preset time period, which is not specifically limited in this embodiment.
- the image shown in FIG. 3 has been pre-stored in the terminal as a template image, the template image including the marker 20, and the marker 20 includes the target feature 201.
- the calibration image can be acquired by the camera.
- the target feature of the identifier may be pre-configured or determined by the user.
- At least two calibration images need to be acquired by the camera.
- the embodiment of the present application does not specifically limit the acquisition of the calibration image.
- Step S102 Determine camera parameters according to coordinate information of each of the plurality of target features in the first calibration image and the template image.
- the camera after acquiring at least two calibration images, the camera may be determined according to coordinate information of each of the plurality of target features included in the identifier in the first calibration image and the template image. parameter. Specifically, after determining the target feature of the identifier, the camera parameter may be determined according to the mapping relationship between the coordinate information of the first calibration image and the coordinate information of the target feature in the template image.
- the camera parameters determined herein may include at least one of an internal parameter matrix of the camera, an external parameter matrix, or a distortion parameter. Among them, first need to be the first calibration The image is matched with the target feature in the template image, that is, the coordinate information of the matched target feature in the first calibration image and the template image is determined.
- the target feature is an elephant ear in the image 2
- Coordinate information The manner of matching the above target features can be implemented by an algorithm such as sift or surf.
- the mapping relationship between the coordinate information can be determined by a calibration algorithm, for example, by a Zhang Zhengyou calibration algorithm. Thereby the camera parameters can be obtained.
- the coordinate information of the target feature may refer to coordinate information of each target feature point included in the target feature, or may refer to one or more target features included in the target feature.
- the coordinate information of the point may also refer to coordinate information of the target feature determined according to coordinate information of at least one target feature point included in the target feature.
- the coordinate information of the elephant's ear may be coordinate information of each point of the outline of the elephant's ear, or may be coordinate information of the center point of the elephant's ear.
- Step S103 Determine mapping coordinate information of the at least one target feature in the second calibration image according to the camera parameter and coordinate information of the at least one target feature in the template image.
- the mapping coordinate information of the at least one target feature in the second calibration image may be determined according to the camera parameter and the coordinate information of the at least one target feature in the template image.
- the mapping coordinate information of the target feature in the second calibration image is determined according to the mapping relationship (or camera parameter) in the above step, and is not the actual coordinate information of the target feature in the second calibration image.
- one or more target features of the identifier may be selected to determine mapping coordinate information of the selected one or more target features in the second calibration image; and each target feature in the identifier may also be determined in the second calibration image Mapping coordinate information in .
- one or more target features in the identifier may be selected based on the importance of the target feature in the marker.
- the importance of the target feature may be determined by the terminal or determined by the user. For example, the importance degree of the target feature may be determined according to the location of the target feature, or the importance degree of the target feature may be determined according to the recognition degree of the target feature. In the embodiment of the present application, the target feature with high degree of importance can be selected to detect the accuracy of the camera parameters.
- Step S104 if there is a distance between the actual coordinate information of the first target feature in the second calibration image and the mapping coordinate information in the at least one target feature is greater than a first threshold, according to the at least one target The camera parameters are updated in the feature other than the first target feature.
- the actual coordinate information of each of the at least one target feature in the second calibration image may be further determined. Specifically, at least one target feature is first searched in the second calibration image. For example, at least one target feature may be found by using the foregoing matching algorithm, thereby determining actual coordinate information of each of the at least one target feature in the second calibration image.
- the mapping error of each target feature in the at least one target feature may be sequentially determined, that is, the distance between the mapping coordinate information of each target feature in the second calibration image and the actual coordinate information is greater than a first threshold, when it is determined that the mapping error of a target feature is greater than the first threshold, excluding the target feature, updating the camera parameter by using other target features of the at least one target feature other than the target feature, and continuing after updating the camera parameter Determine the next target feature.
- the other target features of the at least one target feature are used to update the camera parameters.
- Other target features are target features whose mapping error is not greater than the first threshold.
- the camera parameters may be updated according to actual target positions of the other target features on the template image and the first calibration image respectively; or may be respectively performed on the template image and the second calibration image according to other target features.
- the target feature with a large mapping error is continuously filtered to further accurately optimize the camera parameters. For example, based on the coordinate information of the updated camera parameter and the other target features after the screening on the template image, the mapping coordinate information of the selected other target features on the third calibration image is determined, and then the other targets after the screening are determined.
- the number of loops may be determined based on the number of acquired calibration images, or the number of loops is pre-configured. Alternatively, when there is no target feature with a large mapping error within a certain cycle, the loop can be ended.
- the thresholds may be the same or different in each of the above-mentioned cycles, and are not specifically limited herein.
- the first threshold may be pre-configured, or may be determined based on a distance between actual coordinate information and mapping coordinate information on the second calibration image of each of the at least one target feature. For example, the number of the selected at least one target feature is three, and the distance between the actual coordinate information of each of the three target features on the second calibration image and the mapped coordinate information is determined, so that three can be acquired.
- the distance may be determined based on the average of the three distances, or the distance weight corresponding to the three distances may be determined according to the importance degree of the target features corresponding to the three distances, and the first threshold is determined according to the distance weight.
- the size of For example, if the importance of the first target feature is high, the corresponding weight coefficient is large, and the distance weight corresponding to the three target features is determined according to the distance and the weight coefficient corresponding to each target feature, and the distance weight may be determined according to the distance weight.
- the size of a threshold For other thresholds of the cycle, it can be determined based on the above manner, and details are not described herein again.
- At least two calibration images including the identifier are acquired by the camera, and the camera is determined according to the coordinate information of each of the plurality of target features included in the first calibration image and the template image. parameter. Further, according to the determined camera parameter and the coordinate information of the at least one target feature in the template image, mapping coordinate information of the at least one target feature in the second calibration image may be determined, by determining that the at least one target feature is in the second calibration image The distance between the mapped coordinate information and the actual coordinate information can determine the target feature with a large mapping error.
- the camera parameters may be updated according to other target features than the first target feature, thereby improving the accuracy of the camera parameters obtained after the camera calibration.
- FIG. 4 is a schematic flowchart diagram of another camera calibration method according to an embodiment of the present application. As shown in FIG. 4, the method includes at least the following steps.
- Step S401 When the terminal acquires an image including the identifier by using the camera, it is determined whether the state of the terminal meets the preset condition.
- Step S402 if yes, the image is added to the image sequence.
- Step S403 extracting at least two calibration images from the image sequence.
- Step S404 determining camera parameters according to coordinate information of each of the plurality of target features in the first calibration image and the template image.
- Step S405 determining mapping coordinate information of the at least one target feature in the second calibration image according to the camera parameter and coordinate information of the at least one target feature in the template image.
- Step S406 if there is a distance between the actual coordinate information of the first target feature in the second calibration image and the mapping coordinate information in the at least one target feature is greater than a first threshold, according to the at least one target The camera parameters are updated in the feature other than the first target feature.
- the camera can detect whether the camera captures the identifier in real time by using a camera. Specifically, it can detect whether there is a marker image in the image captured by the camera, or whether there are one or more target features included in the identifier. If it is detected in the above manner that the camera captures the marker, it may be determined that the image containing the marker is acquired by the camera. Further, it can be further determined whether the state in which the terminal is located meets the preset condition when the terminal acquires the image. Optionally, the state of the terminal can be determined by a gyroscope, accelerometer or other sensor configured by the terminal.
- Whether the state of the terminal meets the preset condition is used to detect whether the current state of the terminal is stable, that is, whether the terminal camera can stably and clearly capture the identifier in the state where the current terminal is located. For example, if the gyro configured by the terminal detects that the angular velocity of the terminal is greater than or equal to the second threshold, or detects that the acceleration of the terminal is greater than or equal to the third year threshold by the accelerometer configured by the terminal, it indicates that the current motion of the terminal is large, In an unstable state, if the terminal cannot obtain a high-quality image containing the marker in this state, it is necessary to exclude the images to obtain a high-quality image.
- the terminal When the terminal obtains the image containing the identifier, it is further determined whether the state of the terminal meets the preset condition. For example, when the terminal acquires an image including the identifier, the terminal detects that the angular velocity of the terminal is smaller than the second by the gyroscope. After the threshold is detected by the accelerometer and the acceleration of the terminal is less than the third threshold, it can be determined that the state of the terminal satisfies the preset condition, and the image can be added to the image sequence.
- the image sequence containing the marker is generated by the above manner, at least two images may be extracted from the image sequence as the calibration image.
- a high quality image may be further selected from the image sequence as the calibration image.
- the specific implementation manner may also be determined based on the manner in which the template image is acquired in the terminal. The following describes several methods for extracting, and of course, other methods may be included, and the embodiments of the present application are not enumerated herein.
- the image sequence can be divided into a plurality of image sequence groups according to the acquired time period.
- the length of the time period can be set to 1 s or 2 s, etc.
- the sequence of images acquired within 1 s or 2 s can be divided into one image sequence group.
- the images in each image sequence group can be sorted.
- the basis for the ranking is at least one of the factors according to the number of target features included in the image, the sharpness of the target feature, the number of target features having a high degree of importance, the sharpness of the target feature having a high degree of importance, and the like.
- at least one image may be extracted from each image sequence as a calibration image according to the sorting result.
- the number of images extracted by the terminal from each time period may be determined based on a time range in which the time period is located. For example, the image sequence is acquired before the terminal acquires the template image by the camera, and the image acquisition time in the image sequence group is closer to the shooting time of the template image, and the image is acquired from the image.
- the number of images extracted by the sequence group as the number of calibration images is larger. That is to say, in this case, the number of extracted images is positively correlated with the time period in which the image sequence group is located.
- the number of extracted images may be positively correlated with the start time or end time of the time period in which the image sequence group is located.
- the following describes a method for the terminal to determine the calibration image in the case where the terminal acquires the template image by the camera.
- FIG. 5 is a schematic flowchart diagram of still another camera calibration method according to an embodiment of the present application. As shown in FIG. 5, the method includes the following steps.
- Step S501 When the terminal acquires an image including the identifier by using the camera, it is determined whether the state of the terminal meets the preset condition.
- Step S502 if yes, the image is added to the image sequence.
- Step S503 the marker is photographed by a camera to obtain the template image.
- Step S504 determining an acquisition time of each image in the image sequence and a shooting time of the template image.
- Step S505 selecting at least two images from the image sequence as a calibration image according to the distance relationship between the acquisition time of each image and the shooting time of the template image, wherein the frequency of the selected image and the near-far relationship are selected.
- Step S506 determining camera parameters according to coordinate information of each of the plurality of target features in the first calibration image and the template image.
- Step S507 Determine mapping coordinate information of the at least one target feature in the second calibration image according to the camera parameter and coordinate information of the at least one target feature in the template image.
- Step S508 if there is a distance between the actual coordinate information of the first target feature in the second calibration image and the mapping coordinate information in the at least one target feature is greater than a first threshold, according to the at least one target The camera parameters are updated in the feature other than the first target feature.
- the image sequence including the identifier may be acquired before or after the shooting, and then extracted from the image sequence. At least two images are taken out as template images.
- the image sequence including the identifier is acquired by the terminal before the camera captures the template image for example.
- the terminal can capture the identifier when the camera is turned on, that is, the camera captures the identifier, and after capturing at least one target feature of the identifier, the image containing the identifier can be acquired.
- the terminal acquires the image including the identifier through the camera, It is also possible to further determine whether to add the image to the image sequence based on the state in which the terminal acquires the image.
- the user terminal acquires a sequence of images until the terminal detects a user's shooting operation.
- the terminal performs a photographing operation through the camera to obtain an image as a template image.
- After the terminal acquires the image sequence and the template image at least two images may be further extracted from the image sequence as a calibration image for performing the following calibration steps.
- the acquisition time of the image can be simultaneously recorded, and the shooting time of the template image obtained under the shooting instruction is recorded, and further, the time point on the time axis and the acquired image can be formed.
- the time axis can determine the distance relationship between each image in the image sequence and the template image.
- the calibration image is selected from the image sequence according to the near-far relationship.
- the user usually keeps the terminal in a stable state, and may also adjust shooting parameters such as focus and brightness. It can be understood that the image quality is higher as the image of the photographing time of the template image is acquired in time. Further, these images can be selected as the calibration image.
- determining a distance relationship between the image in the image sequence and the template image may be obtained by setting a time threshold, that is, a near-close relationship between the image acquired in the time threshold and the shooting time and the template image, and being acquired before the time threshold.
- the distance between the image and the template image is far.
- the near-far rating can be further determined, and a corresponding number of images are selected as the calibration image according to the near-far rating. For example, the number of images with a near-high level is higher than the number of images with a near-low level, that is, the higher the near-earth level of an image, indicating that the acquisition time of the image is closer to the shooting time of the template image.
- FIG. 6 is a schematic structural diagram of a terminal according to an embodiment of the present application.
- the terminal includes an input and output device 601, a processor 602, a memory 603, and a communication interface 604.
- Input output device 601, processor 602, memory 603, and communication interface 604 can be coupled via a communication bus.
- the input/output device 601 may include a device having an input function, such as a camera, a recording device, etc., a touch screen and various sensors for sensing the environment, such as a gyroscope, an acceleration sensor, an infrared sensor, etc., and may also include an output.
- Functional devices such as display screens, audio devices, and the like.
- Processor 602 can be a general purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the above program.
- the processor 602 is capable of receiving data input by the input device 601 and processing it.
- the memory 603 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, and random access memory (random access memory) Memory, RAM) or other types of dynamic storage devices that can store information and instructions, or electrically erasable Programmable Read-Only Memory (EEPROM), CD-ROM (Compact Disc Read-Only) Memory, CD-ROM) or other disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), disk storage media or other magnetic storage devices, or capable of carrying or storing instructions
- ROM read-only memory
- RAM random access memory
- EEPROM electrically erasable Programmable Read-Only Memory
- CD-ROM Compact Disc Read-Only Memory
- CD-ROM Compact Disc Read-Only Memory
- optical disc storage including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.
- disk storage media or other magnetic storage devices or capable of carrying or
- the memory 603 can exist independently and be coupled to the processor 602 via a bus. Memory 603 can also be integrated with processor 602.
- the memory 603 can store executable instructions, or pre-configured data, and the like. For example, the thresholds applied in the method of the embodiments of the present application may be pre-stored in the memory, and the executable instructions for executing the method of the embodiment of the present application may also be stored in the memory 603 for the processor 602 to invoke execution.
- Communication interface 604 can include a wired communication interface, such as a USB communication interface; it can also include a wireless communication interface.
- processor 602 is configured to invoke the computer instruction to perform the following steps:
- the distance between the actual coordinate information of the first target feature in the second calibration image and the mapping coordinate information is greater than a first threshold in the at least one target feature, according to the at least one target feature
- the other target features outside the first target feature update the camera parameters.
- the processor 602 is configured to:
- At least two calibration images are extracted from the sequence of images.
- the processor 602 is configured to:
- the image is added to the sequence of images.
- the preset conditions include:
- the angular velocity acquired by the gyroscope of the terminal is less than a second threshold, and the acceleration obtained by the accelerometer of the terminal is less than a third threshold.
- the processor 602 is configured to:
- At least one image is selected from each of the image sequence groups as a calibration image.
- processor 602 is further configured to:
- the marker is photographed by a camera to obtain the template image
- Extracting at least two calibration images from the sequence of images including:
- processor 602 is further configured to:
- the at least one target feature is selected from the plurality of target features according to an importance degree of the target feature.
- the first threshold is pre-configured, or the first threshold is based on actual coordinate information and mapping coordinates of each target feature of the at least one target feature on the second calibration image. The distance between the information is determined.
- FIG. 7 is a functional block diagram of a terminal according to an embodiment of the present application. As shown in FIG. 7, the terminal includes an input unit 701 and a processing unit 702.
- the input unit 701 is configured to acquire, by using a camera, at least two calibration images including the identifier, where the identifier includes multiple target features;
- the processing unit 702 is configured to determine camera parameters according to coordinate information of each of the plurality of target features in the first calibration image and the template image.
- the processing unit 702 is further configured to determine mapping coordinate information of the at least one target feature in the second calibration image according to the camera parameter and coordinate information of the at least one target feature in the template image;
- the processing unit 702 is further configured to: if there is a distance between the actual coordinate information of the first target feature in the second calibration image and the mapping coordinate information in the at least one target feature is greater than a first threshold, Updating the camera parameters based on other target features of the at least one target feature other than the first target feature.
- the input unit 701 is further configured to:
- At least two calibration images are extracted from the sequence of images.
- the input unit 701 is further configured to:
- the image is added to the sequence of images.
- the preset conditions include:
- the angular velocity acquired by the gyroscope of the terminal is less than a second threshold, and the acceleration obtained by the accelerometer of the terminal is less than a third threshold.
- processing unit 702 is further configured to:
- At least one image is selected from each of the image sequence groups as a calibration image.
- processing unit 702 is further configured to:
- the marker is photographed by a camera to obtain the template image
- Extracting at least two calibration images from the sequence of images including:
- processing unit 702 is further configured to:
- the at least one target feature is selected from the plurality of target features according to an importance degree of the target feature.
- the first threshold is pre-configured, or the first threshold is based on actual coordinate information and mapping coordinates of each target feature of the at least one target feature on the second calibration image. The distance between the information is determined.
- the present invention may be implemented in whole or in part by software, hardware, firmware, or any combination thereof.
- software it may be implemented in whole or in part in the form of a computer program product.
- the computer program product includes one or more computer instructions.
- the computer program instructions When the computer program instructions are loaded and executed on a computer, the processes or functions described in accordance with embodiments of the present invention are generated in whole or in part.
- the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
- the computer instructions can be stored in a computer readable storage medium or transferred from one computer readable medium to another computer readable medium, for example, the computer instructions can be wired from a website site, computer, server or data center (for example, coaxial cable, fiber, Digital Subscriber Line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) to another website, computer, server or data center.
- the computer readable storage medium can be any available media that can be accessed by a computer or a data storage device such as a server, data center, or the like that includes one or more available media.
- the usable medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a Solid State Disk (SSD)) or the like.
- a magnetic medium eg, a floppy disk, a hard disk, a magnetic tape
- an optical medium eg, a DVD
- a semiconductor medium eg, a Solid State Disk (SSD)
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Studio Devices (AREA)
- Image Analysis (AREA)
Abstract
本文公开一种摄像头标定方法和终端。方法包括:通过摄像头获取包含标识物的至少两个标定图像,所述标识物包括多个目标特征;根据所述多个目标特征中每个目标特征分别在第一标定图像与模板图像中的坐标信息,确定摄像头参数;根据所述摄像头参数和至少一个目标特征在所述模板图像中的坐标信息,确定所述至少一个目标特征在第二标定图像中的映射坐标信息;如果所述至少一个目标特征中存在第一目标特征在所述第二标定图像中的实际坐标信息与所述映射坐标信息之间的距离大于第一阈值,则根据所述至少一个目标特征中除所述第一目标特征外的其他目标特征,更新所述摄像头参数。通过上述方式,能够提升所得到的摄像头参数的精确度。
Description
本申请涉及增强现实技术领域,尤其涉及一种摄像头标定方法和终端。
当前增强现实(Augmented Reality,AR)技术是在虚拟现实的基础上发展起来的新技术。是通过计算机系统提供的信息增加用户对现实世界感知的技术,将虚拟的信息应用到真实世界,并将计算机生成的虚拟物体、场景或系统提示信息叠加到真实场景中,从而实现对现实的增强。
在应用AR技术时,由于每个终端的摄像头的参数不同,为了获得更好的叠加效果,需要对终端的摄像头进行标定。对摄像头进行标定是指为确定真实场景中空间物体表面某点的三维几何位置与其在图像中对应点之间的相互关系,需要建立摄像头成像的几何模型,建立摄像头成像的几何模型的过程,即是对摄像头进行标定。对摄像头进行标定能够得到摄像头参数。摄像头参数可以包括内参、畸变参数和外参。摄像头参数的精度直接影响了虚拟信息的叠加显示效果。如果标定结果的精度较低,则虚拟信息叠加至真实场景的显示效果较差。
由此,如何提升摄像头参数的精确度成为本领域技术人员积极研究的课题。
发明内容
本申请实施例提供了一种摄像头标定方法和终端。能够提升所得到的摄像头参数的精确度。
第一方面,本申请实施例提供了一种摄像头标定方法,该方法可以包括:通过摄像头获取包含标识物的至少两个标定图像,所述标识物包括多个目标特征;根据所述多个目标特征中每个目标特征分别在第一标定图像与模板图像中的坐标信息,确定摄像头参数;根据所述摄像头参数和至少一个目标特征在所述模板图像中的坐标信息,确定所述至少一个目标特征在第二标定图像中的映射坐标信息;如果所述至少一个目标特征中存在第一目标特征在所述第二标定图像中的实际坐标信息与所述映射坐标信息之间的距离大于第一阈值,则根据所述至少一个目标特征中除所述第一目标特征外的其他目标特征,更新所述摄像头参数。
第二方面,本申请实施例提供了一种终端,该终端具有实现上述方法实际中用户终端行为的功能,所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的单元。
第三方面,本申请实施例提供了一种终端,该终端包括处理器和存储器,以及存储在所述存储器上可供所述处理器调用并执行的计算机程序,所述处理器能够调用所述计算机程序以执行第一方面的任意一个方法。
第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述各方面所述的方法。
本申请实施例中,通过摄像头获取包含标识物的至少两个标定图像,并根据标识物包括的多个目标特征中每个目标特征分别在第一标定图像与模板图像中的坐标信息,确定摄像头参数。进一步的,可以根据确定的摄像头参数和至少一个目标特征在模板图像中的坐标信息,可以确定至少一个目标特征在第二标定图像中的映射坐标信息,通过判断至少一个目标特征在第二标定图像中的映射坐标信息与实际坐标信息之间的距离,可以确定出映射误差较大的目标特征。如果确定出至少一个目标特征中第一目标特征在第二标定图像中的映射坐标信息与实际坐标信息之间的距离大于第一阈值,则可以根据除第一目标特征外的其他目标特征来更新摄像头参数,从而提升了摄像头标定后得到的摄像头参数的准确度。
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍。
图1是本申请实施例提供的一种摄像头标定方法的流程示意图;
图2是本申请实施例提供的一种模板图像的示意图;
图3是本申请实施例提供的另一种模板图像的示意图;
图4是本申请实施例提供的另一种摄像头标定方法的流程示意图;
图5是本申请实施例提供的又一种摄像头标定方法的流程示意图;
图6是本申请实施例提供的一种终端的结构示意图;
图7是本申请实施例提供的一种终端的功能示意图。
本申请的实施方式部分使用的术语仅用于对本申请的具体实施例进行解释,而非旨在限定本申请。
首先介绍本申请实施例提供的方法实施例。该方法实施例适用于配置有摄像头以及显示屏的终端。其中,终端包括移动电话,具有移动终端的计算机,便携式、袖珍式、手持式、计算机内置的移动装置,智能穿戴式设备等。例如,个人数字助理(personal digital assistant,PDA)、平板计算机、上网本计算机、便携式计算机、媒体观看器、智能手表、智能头盔、智能眼镜、智能手环等智能穿戴式设备。或至少包括计算处理器和数据存储装置的其他设备。
请参阅图1,图1是本申请实施例提供的一种摄像头标定方法的流程示意图。如图1所示,该方法至少包括以下步骤。
步骤S101,终端通过摄像头获取包含标识物的至少两个标定图像,所述标识物包括多个目标特征。
在一些可能的实现方式中,终端通过摄像头获取包含标识物的至少两个标定图像,该标识物包括多个目标特征。其中,标定图像用于进行摄像头标定,以得到摄像头参数。具体的,标识物与标定图像之间的映射关系,可以通过确定标识物中的目标特征在模板图像的坐标信息与该目标特征在标定图像的坐标信息的映射关系来确定。在此,模板图像可以理解为最能够体现标识物的图像。例如,虚拟信息会叠加在标识物的某一个角度上,再在该角度上获取的标识物图像则为模板图像。模板图像可以是通过摄像头拍摄获取的,或者是预存储在终端中的。本申请实施例中所描述的用于标定的模板图像不一定是标定板图像。也就是说,标定板图像对于本申请所提供的摄像头标定方法来说是非必要的。用户能够根据当前环境选取模板图像,进而能够更加灵活的实现对摄像头进行标定。
举例说明,如图2所示,当前环境下可以确定标识物10时,则可以通过拍摄该标识物10得到模板图像30。这种情况下,允许用户利用当前环境选取标识物,并能够通过摄像头拍摄标识物的模板图像。可选的,在摄像头拍摄该标识物的模板图像之前,当终端检测到摄像头获取的画面中包含了部分或全部标识物,则可以开始获取标定图像,进而,通过标定图像和模板图像的映射关系,得到摄像头参数。其中,为了确定标定图像和模板图像的映射关系,可以确定标定物中的多个目标特征,由于选取的标定物的随机性,标定物的目标特征可以是由终端根据预设规则确定的,或者是由用户确定的。如图1中标定物10包括多个目标特征101,目标特征可以是指目标特征点、目标特征线或目标特征块等,在此本申请实施例不做具体限定。可选的,还可以在摄像头拍摄该标识物的模板图像之后,在预设的时间段内获取标定图像,在此本申请实施例不作具体限定。
又举例说明,如图3所示,图3所示的图像作为模板图像已经预存储在终端中,该模板图像包括标识物20,标识物20包括目标特征201。当摄像头捕捉到当前环境中存在部分或全部标识物20时,可以通过摄像头获取标定图像。其中,标识物的目标特征可以是预配置的,也可以是由用户确定的。
本申请实施例中,需要通过摄像头获取至少两个标定图像。标定图像的获取方式可参见下述方法实施例,在此,本申请实施例对标定图像的获取不作具体限定。
步骤S102,根据所述多个目标特征中每个目标特征分别在第一标定图像与模板图像中的坐标信息,确定摄像头参数。
在一些可能的实现方式中,当获取至少两个标定图像后,可以根据标识物包括的多个目标特征中的每个目标特征分别在第一标定图像与模板图像中的坐标信息,来确定摄像头参数。具体的,在确定标识物的目标特征后,可以根据目标特征在第一标定图像的坐标信息与该目标特征在模板图像中的坐标信息的映射关系,来确定摄像头参数。这里所确定的摄像头参数可以包括摄像头的内参矩阵、外参矩阵或畸变参数中的至少一种。其中,首先需要将第一标定
图像和模板图像中的目标特征匹配,即进而确定匹配的目标特征分别在第一标定图像与模板图像中的坐标信息。例如,当目标特征为图像2中的大象耳朵时,需要首先找到第一标定图像中的大象耳朵以及模板图像中的大象耳朵,进而确定大象耳朵分别在第一标定图像和模板图像的坐标信息。上述目标特征匹配的方式可以通过sift、surf等算法实现。当确定坐标信息后,对于坐标信息之间的映射关系,可以通过标定算法确定,例如,通过张正友标定算法确定。从而能够得到摄像头参数。对于目标特征为目标特征线或目标特征块时,目标特征的坐标信息可以是指目标特征所包括的每个目标特征点的坐标信息,也可以是指目标特征所包括的一个或多个目标特征点的坐标信息,还可以是指根据目标特征所包括的至少一个目标特征点的坐标信息来确定的目标特征的坐标信息。例如,当目标特征为大象耳朵时,大象耳朵的坐标信息可以是大象耳朵的轮廓的每个点的坐标信息,也可以是大象耳朵的中心点的坐标信息。
步骤S103,根据所述摄像头参数和至少一个目标特征在所述模板图像中的坐标信息,确定所述至少一个目标特征在第二标定图像中的映射坐标信息。
在一些可能的实现方式中,可以根据摄像头参数和至少一个目标特征在模板图像中的坐标信息,确定该至少一个目标特征在第二标定图像中的映射坐标信息。这里,该目标特征在第二标定图像中的映射坐标信息是根据上述步骤中的映射关系(或摄像头参数)确定得来的,并不是该目标特征在第二标定图像中的实际坐标信息。其中,可以选取标识物的一个或多个目标特征,确定所选取的一个或多个目标特征在第二标定图像中的映射坐标信息;也可以确定标识物中每个目标特征在第二标定图像中的映射坐标信息。可选的,可以根据标识物中目标特征的重要程度,来选取标识物中的一个或多个目标特征。目标特征的重要程度可以是终端确定的,也可以是用户确定的。例如,可以根据目标特征所在位置确定目标特征的重要程度,或者,根据目标特征的辨识度来确定目标特征的重要程度。本申请实施例中,可以选取重要程度高的目标特征来检测摄像头参数的准确度。
步骤S104,如果所述至少一个目标特征中存在第一目标特征在所述第二标定图像中的实际坐标信息与所述映射坐标信息之间的距离大于第一阈值,则根据所述至少一个目标特征中除所述第一目标特征外的其他目标特征,更新所述摄像头参数。
在一些可能的实现方式中,如果确定了上述至少一个目标特征各自在第二标定图像中的映射坐标信息,还可进一步确定上述至少一个目标特征各自在第二标定图像中的实际坐标信息。具体的,首先在第二标定图像中查找到至少一个目标特征,例如,可以通过上述匹配算法查找到至少一个目标特征,进而确定该至少一个目标特征各自在第二标定图像中的实际坐标信息。判断至少一个目标特征中每个目标特征的映射坐标信息和实际坐标信息之间的距离是否大于第一阈值,如果存在第一目标特征的映射坐标信息和实际坐标信息之间的距离大于第一阈值,则表明该第一目标特征的映射误差较大,则需要去除映射
误差较大的目标特征,以更新摄像头参数。
在一些可能的实现方式中,可以依次判断至少一个目标特征中每个目标特征的映射误差,即每个目标特征在第二标定图像中的映射坐标信息与实际坐标信息之间的距离,是否大于第一阈值,当判断出一个目标特征的映射误差大于第一阈值,则排除该目标特征,利用至少一个目标特征中除该目标特征外的其他目标特征来更新摄像头参数,在更新摄像头参数后继续判断下一个目标特征。或者,排除至少一个目标特征中所有映射误差大于第一阈值的目标特征后,利用至少一个目标特征中的其他目标特征来更新摄像头参数。其他目标特征是指映射误差不大于第一阈值的目标特征。
在一些可能的实现方式中,可以根据其他目标特征分别在模板图像和第一标定图像上的实际坐标位置,来更新摄像头参数;或者,可以根据其他目标特征分别在模板图像和第二标定图像上的实际坐标位置,来更新摄像头参数。可选的,可基于更新的摄像头参数,继续筛选出映射误差较大的目标特征,进而进一步精确摄像头参数。例如,基于更新的摄像头参数和筛选后的其他目标特征各自在模板图像上的坐标信息,确定该筛选后的其他目标特征在第三标定图像上的映射坐标信息,进而判断该筛选后的其他目标特征在第三标定图像上的映射坐标信息与实际坐标信息。根据上述方式依次循环,循环次数可以基于获取的标定图像的数量确定,或者,循环次数是预配置的。或者,当在某一循环周期内,不存在映射误差大的目标特征时,即可结束循环。
在一些可能的实现方式中,上述每次循环周期内,基于的阈值大小可以相同,也可以不同,在此不作具体限定。其中,第一阈值可以是预配置的,也可以是基于所述至少一个目标特征中的每个目标特征在所述第二标定图像上的实际坐标信息与映射坐标信息之间的距离确定的。例如,选取出的至少一个目标特征的数量为三个,确定这三个目标特征中每个目标特征在第二标定图像上的实际坐标信息与映射坐标信息之间的距离,从而能够获取三个距离,可以基于这三个距离的平均值确定第一阈值的大小,或者,结合这三个距离对应的目标特征的重要程度,确定三个距离对应的距离权重,根据该距离权重确定第一阈值的大小。例如,第一目标特征的重要程度高,则对应的权重系数较大,根据每个目标特征对应的距离和权重系数,确定三个目标特征整体对应的距离权重,并可以根据该距离权重确定第一阈值的大小。对于其他循环周期的阈值,可基于上述方式确定,在此不再赘述。
本申请实施例中,通过摄像头获取包含标识物的至少两个标定图像,并根据标识物包括的多个目标特征中每个目标特征分别在第一标定图像与模板图像中的坐标信息,确定摄像头参数。进一步的,可以根据确定的摄像头参数和至少一个目标特征在模板图像中的坐标信息,可以确定至少一个目标特征在第二标定图像中的映射坐标信息,通过判断至少一个目标特征在第二标定图像中的映射坐标信息与实际坐标信息之间的距离,可以确定出映射误差较大的目标特征。如果确定出至少一个目标特征中第一目标特征在第二标定图像中的映
射坐标信息与实际坐标信息之间的距离大于第一阈值,则可以根据除第一目标特征外的其他目标特征来更新摄像头参数,从而提升了摄像头标定后得到的摄像头参数的准确度。
请参阅图4,图4是本申请实施例提供的另一种摄像头标定方法的流程示意图。如图4所示,该方法至少包括以下步骤。
步骤S401,当终端通过摄像头获取到包含标识物的图像时,判断所述终端所处状态是否满足预设条件。
步骤S402,若为是,将所述图像添加至图像序列。
步骤S403,从所述图像序列中提取至少两个标定图像。
步骤S404,根据所述多个目标特征中每个目标特征分别在第一标定图像与模板图像中的坐标信息,确定摄像头参数。
步骤S405,根据所述摄像头参数和至少一个目标特征在所述模板图像中的坐标信息,确定所述至少一个目标特征在第二标定图像中的映射坐标信息。
步骤S406,如果所述至少一个目标特征中存在第一目标特征在所述第二标定图像中的实际坐标信息与所述映射坐标信息之间的距离大于第一阈值,则根据所述至少一个目标特征中除所述第一目标特征外的其他目标特征,更新所述摄像头参数。
在一些可能的实现方式中,可以通过摄像头实时检测摄像头是否捕捉到标识物,具体的,可以检测摄像头捕捉的画面中是否存在标识物图像,或者是否存在标识物包括的一个或多各目标特征,如果通过上述方式检测到摄像头捕捉到标识物,则可确定通过摄像头获取到包含标识物的图像。进而,可进一步判断在终端获取该图像时,终端所处的状态是否满足预设条件。可选的,终端所处的状态可以通过终端配置的陀螺仪、加速度计或其他传感器确定。终端所处的状态是否满足预设条件,用来检测终端当前的状态是否稳定,即终端摄像头在当前终端所处的状态下是否能够稳定清晰地捕捉标识物。例如,通过终端配置的陀螺仪检测到终端的角速度大于或等于第二阈值,或者通过终端配置的加速度计检测到终端的加速度大于或等于第三年阈值,则表明终端当前运动幅度较大,处于不稳定状态,则终端在此状态下无法获取质量高的包含标识物的图像,则需要排除这些图像,以获取质量高的图像。则需要在终端获取到包含标识物的图像时,进一步判断终端所处状态是否满足预设条件,例如,终端在获取到一个包含标识物的图像时,通过陀螺仪检测到终端的角速度小于第二阈值并且通过加速度计检测到终端的加速度小于第三阈值,则可以确定终端所处状态满足预设条件,则可将该图像添加至图像序列中。
当通过上述方式生成包含标识物的图像序列后,可以从图像序列中提取出至少两个图像作为标定图像。在此,可进一步的从图像序列中选取质量高的图像作为标定图像。具体实现方式还可基于终端中模板图像的获取方式确定。下面介绍几种提取方式,当然还可以包括其他方式,在此本申请实施例不一一列举。
一种提取方式为可以将图像序列按照获取的时间段划分为多个图像序列组。例如,时间段的长度可以设置为1s或2s等,在1s或2s内获取的图像序列可以分至一个图像序列组中。当划分出多个图像序列组后,可以为每个图像序列组中的图像进行排序。排序的依据因素为根据图像中标识物包括的目标特征的数量、目标特征的清晰度、重要程度高的目标特征的数量、重要程度高的目标特征的清晰度等中的至少一个依据因素。进而可以根据排序结果从每个图像序列中提取至少一个图像作为标定图像。具体的,终端从每个时间段提取的图像的数量可以基于该时间段所处的时间范围确定。例如,该图像序列是在终端通过摄像头拍摄获取模板图像之前获取的,则基于图像序列划分的多个图像序列组中,图像序列组中图像的获取时间越靠近模板图像的拍摄时间,从该图像序列组提取的图像作为标定图像的数量越多。也就是说,在该种情况下,提取图像的数量与图像序列组所处的时间段成正相关关系。提取图像的数量可以与图像序列组所处的时间段的起始时间或终止时间成正相关关系。
其中,步骤S404~S406的执行方式可以参见上述方法实施例中相关描述,在此不再赘述。
下面介绍一种在终端通过摄像头拍摄获取模板图像的情况下,终端确定标定图像的方法。
请参阅图5,图5是本申请实施例提供的又一种摄像头标定方法的流程示意图。如图5所示,该方法包括以下步骤。
步骤S501,当终端通过摄像头获取到包含标识物的图像时,判断所述终端所处状态是否满足预设条件。
步骤S502,若为是,将所述图像添加至图像序列。
步骤S503,通过摄像头对所述标识物进行拍摄,以得到所述模板图像。
步骤S504,确定所述图像序列中每个图像的获取时间以及所述模板图像的拍摄时间。
步骤S505,根据所述每个图像的获取时间与所述模板图像的拍摄时间的远近关系,从所述图像序列中选取至少两个图像作为标定图像,其中,选取图像的频次与所述远近关系相关。
步骤S506,根据所述多个目标特征中每个目标特征分别在第一标定图像与模板图像中的坐标信息,确定摄像头参数。
步骤S507,根据所述摄像头参数和至少一个目标特征在所述模板图像中的坐标信息,确定所述至少一个目标特征在第二标定图像中的映射坐标信息。
步骤S508,如果所述至少一个目标特征中存在第一目标特征在所述第二标定图像中的实际坐标信息与所述映射坐标信息之间的距离大于第一阈值,则根据所述至少一个目标特征中除所述第一目标特征外的其他目标特征,更新所述摄像头参数。
在一些可能的实现方式中,当终端通过摄像头拍摄获取模板图像时,可以在拍摄之前或拍摄之后获取包含标识物的图像序列,进而从图像序列中提取
出至少两个图像作为模板图像。本申请实施例中,以终端在摄像头拍摄获取模板图像之前,获取包含标识物的图像序列为例进行说明。其中,终端可以在开启摄像头时,即通过摄像头捕捉标识物,在捕捉到标识物的至少一个目标特征后,即可获取包含标识物的图像,当终端通过摄像头获取到包含标识物的图像时,还可以进一步根据终端获取图像时所处的状态判断是否将该图像添加至图像序列中。用户终端获取图像序列直至终端检测到用户的拍摄操作。终端通过摄像头执行拍摄操作以得到的图像作为模板图像。在终端获取到上述图像序列以及模板图像后,可以进一步从图像序列中提取出至少两个图像作为标定图像,以供执行以下标定步骤。
具体的,终端在将图像添加至图像序列中时,可以同时记录该图像的获取时间,并记录在拍摄指令下获得的模板图像的拍摄时间,进而,可以形成时间轴上时间点与获取图像的对应关系。其中,可以通过时间轴确定图像序列中每个图像与模板图像的远近关系。并根据远近关系来从图像序列中选取标定图像。用户为了拍摄出质量高的模板图像,通常会使终端处于稳定状态,还可能会调整聚焦、光亮强度等拍摄参数。那么可以理解的,在获取时间上越靠近模板图像的拍摄时间的图像,它的图像质量越高。进而,可以选取这些图像作为标定图像。其中,确定图像序列中的图像与模板图像的远近关系,可以通过设置时间阈值,即在该时间阈值与拍摄时间之内获取的图像与模板图像的远近关系为近,在该时间阈值之前获取的图像与模板图像的远近关系为远。还可进一步的确定远近等级,并根据远近等级选取对应数量的图像作为标定图像。例如,选取远近等级为高的图像的数量大于远近等级为低的图像的数量,即一个图像的远近等级越高,表明该图像的获取时间与模板图像的拍摄时间越近。
其中,步骤S506~S508的执行方式可参见上述实施例,在此不再赘述。
下面介绍用于执行上述方法实施例的装置实施例。
请参阅图6,图6是本申请实施例提供的一种终端的结构示意图。
该终端包括输入输出装置601,处理器602、存储器603和通信接口604。输入输出装置601、处理器602、存储器603和通信接口604可以通过通信总线进行耦合。
其中,输入输出装置601中可以包括具备输入功能的装置,例如,摄像头、录音装置等,触控屏及各种感知环境的传感器,例如陀螺仪、加速度传感器、红外传感器等;也可以包括具备输出功能的装置,例如显示屏、音响装置等。
处理器602可以是通用中央处理器(CPU),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制以上方案程序执行的集成电路。处理器602能够接收输入装置601输入的数据,并对其进行处理。
存储器603可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access
memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、只读光盘(Compact Disc Read-Only Memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器603可以是独立存在,通过总线与处理器602相连接。存储器603也可以和处理器602集成在一起。存储器603可以存储有可执行指令,或者预配置数据等。例如,执行本申请实施例的方法中所应用的阈值可以预先存储在存储器中,用于执行本申请实施例方法的可执行指令也可存储在存储器603中,以供处理器602调用执行。
通信接口604可以包括有线通信接口,如USB通信接口;也可以包括无线通信接口。
具体的,处理器602用于调用所述计算机指令以执行以下步骤:
通过摄像头获取包含标识物的至少两个标定图像,所述标识物包括多个目标特征;
根据所述多个目标特征中每个目标特征分别在第一标定图像与模板图像中的坐标信息,确定摄像头参数;
根据所述摄像头参数和至少一个目标特征在所述模板图像中的坐标信息,确定所述至少一个目标特征在第二标定图像中的映射坐标信息;
如果所述至少一个目标特征中存在第一目标特征在所述第二标定图像中的实际坐标信息与所述映射坐标信息之间的距离大于第一阈值,则根据所述至少一个目标特征中除所述第一目标特征外的其他目标特征,更新所述摄像头参数。
可选的,在所述通过摄像头获取包含标识物的至少两个标定图像的方面,所述处理器602用于:
通过摄像头获取包含标识物的图像序列;
从所述图像序列中提取至少两个标定图像。
可选的,在所述通过摄像头获取包含标识物的图像序列的方面,所述处理器602用于:
当通过摄像头获取到包含标识物的图像时,判断配置有所述摄像头的终端所处状态是否满足预设条件;
若为是,将所述图像添加至所述图像序列。
可选的,所述预设条件包括:
通过所述终端的陀螺仪获取的角速度小于第二阈值,并且通过所述终端的加速度计获取的加速度小于第三阈值。
可选的,在所述从所述图像序列中提取至少两个标定图像的方面,所述处理器602用于:
将所述图像序列按照时间段划分为多个图像序列组;
根据每个图像序列组中每个图像包含的标识物中的目标特征的数量,对所述每个图像序列组中的图像进行排序,以得到排序结果;
根据所述排序结果,从所述每个图像序列组中选取至少一个图像作为标定图像。
可选的,所述处理器602还用于:
通过摄像头对所述标识物进行拍摄,以得到所述模板图像;
所述从所述图像序列中提取至少两个标定图像,包括:
确定所述图像序列中每个图像的获取时间以及所述模板图像的拍摄时间;
根据所述每个图像的获取时间与所述模板图像的拍摄时间的远近关系,从所述图像序列中选取至少两个图像作为标定图像,其中,选取的频次与所述远近关系相关。
可选的,所述处理器602还用于:
根据目标特征的重要程度,从所述多个目标特征中选取出所述至少一个目标特征。
可选的,所述第一阈值是预配置的,或者,所述第一阈值是基于所述至少一个目标特征中的每个目标特征在所述第二标定图像上的实际坐标信息与映射坐标信息之间的距离确定的。
请参阅图7,图7是本申请实施例提供的一种终端的功能框图。如图7所示,终端包括输入单元701和处理单元702。
其中,输入单元701,用于通过摄像头获取包含标识物的至少两个标定图像,所述标识物包括多个目标特征;
处理单元702,用于根据所述多个目标特征中每个目标特征分别在第一标定图像与模板图像中的坐标信息,确定摄像头参数;
所述处理单元702,还用于根据所述摄像头参数和至少一个目标特征在所述模板图像中的坐标信息,确定所述至少一个目标特征在第二标定图像中的映射坐标信息;
所述处理单元702,还用于如果所述至少一个目标特征中存在第一目标特征在所述第二标定图像中的实际坐标信息与所述映射坐标信息之间的距离大于第一阈值,则根据所述至少一个目标特征中除所述第一目标特征外的其他目标特征,更新所述摄像头参数。
可选的,所述输入单元701还用于:
通过摄像头获取包含标识物的图像序列;
从所述图像序列中提取至少两个标定图像。
可选的,所述输入单元701还用于:
当通过摄像头获取到包含标识物的图像时,判断配置有所述摄像头的终端所处状态是否满足预设条件;
若为是,将所述图像添加至所述图像序列。
可选的,所述预设条件包括:
通过所述终端的陀螺仪获取的角速度小于第二阈值,并且通过所述终端的加速度计获取的加速度小于第三阈值。
可选的,所述处理单元702还用于:
将所述图像序列按照时间段划分为多个图像序列组;
根据每个图像序列组中每个图像包含的标识物中的目标特征的数量,对所述每个图像序列组中的图像进行排序,以得到排序结果;
根据所述排序结果,从所述每个图像序列组中选取至少一个图像作为标定图像。
可选的,所述处理单元702还用于:
通过摄像头对所述标识物进行拍摄,以得到所述模板图像;
所述从所述图像序列中提取至少两个标定图像,包括:
确定所述图像序列中每个图像的获取时间以及所述模板图像的拍摄时间;
根据所述每个图像的获取时间与所述模板图像的拍摄时间的远近关系,从所述图像序列中选取至少两个图像作为标定图像,其中,选取的频次与所述远近关系相关。
可选的,所述处理单元702还用于:
根据目标特征的重要程度,从所述多个目标特征中选取出所述至少一个目标特征。
可选的,所述第一阈值是预配置的,或者,所述第一阈值是基于所述至少一个目标特征中的每个目标特征在所述第二标定图像上的实际坐标信息与映射坐标信息之间的距离确定的。
在上述各个本发明实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读介质向另一个计算机可读介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(Digital Subscriber Line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如,固态硬盘(Solid State Disk,SSD))等。
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申
请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。
Claims (25)
- 一种摄像头标定方法,其特征在于,包括:通过摄像头获取包含标识物的至少两个标定图像,所述标识物包括多个目标特征;根据所述多个目标特征中每个目标特征分别在第一标定图像与模板图像中的坐标信息,确定摄像头参数;根据所述摄像头参数和至少一个目标特征在所述模板图像中的坐标信息,确定所述至少一个目标特征在第二标定图像中的映射坐标信息;如果所述至少一个目标特征中存在第一目标特征在所述第二标定图像中的实际坐标信息与所述映射坐标信息之间的距离大于第一阈值,则根据所述至少一个目标特征中除所述第一目标特征外的其他目标特征,更新所述摄像头参数。
- 如权利要求1所述方法,其特征在于,所述通过摄像头获取包含标识物的至少两个标定图像,包括:通过摄像头获取包含标识物的图像序列;从所述图像序列中提取至少两个标定图像。
- 如权利要求2所述方法,其特征在于,所述通过摄像头获取包含标识物的图像序列,包括:当通过摄像头获取到包含标识物的图像时,判断配置有所述摄像头的终端所处状态是否满足预设条件;若为是,将所述图像添加至所述图像序列。
- 如权利要求3所述方法,其特征在于,所述预设条件包括:通过所述终端的陀螺仪获取的角速度小于第二阈值,或者通过所述终端的加速度计获取的加速度小于第三阈值中的至少一个。
- 如权利要求2-4任一项所述方法,其特征在于,所述从所述图像序列中提取至少两个标定图像,包括:将所述图像序列按照时间段划分为多个图像序列组;根据每个图像序列组中每个图像包含的标识物中的目标特征的数量,对所述每个图像序列组中的图像进行排序,以得到排序结果;根据所述排序结果,从所述每个图像序列组中选取至少一个图像作为标定图像。
- 如权利要求2-4任一项所述方法,其特征在于,所述通过摄像头获取包含标识物的图像序列之后,所述方法还包括:通过摄像头对所述标识物进行拍摄,以得到所述模板图像;所述从所述图像序列中提取至少两个标定图像,包括:确定所述图像序列中每个图像的获取时间以及所述模板图像的拍摄时间;根据所述每个图像的获取时间与所述模板图像的拍摄时间的远近关系,从 所述图像序列中选取至少两个图像作为标定图像,其中,选取的频次与所述远近关系相关。
- 如权利要求1所述方法,其特征在于,还包括:根据目标特征的重要程度,从所述多个目标特征中选取出所述至少一个目标特征。
- 如权利要求1所述方法,其特征在于,所述第一阈值是预配置的,或者,所述第一阈值是基于所述至少一个目标特征中的每个目标特征在所述第二标定图像上的实际坐标信息与映射坐标信息之间的距离确定的。
- 一种终端,其特征在于,包括处理器和存储器;所述存储器用于存储计算机指令;所述处理器用于调用所述计算机指令以执行以下步骤:通过摄像头获取包含标识物的至少两个标定图像,所述标识物包括多个目标特征;根据所述多个目标特征中每个目标特征分别在第一标定图像与模板图像中的坐标信息,确定摄像头参数;根据所述摄像头参数和至少一个目标特征在所述模板图像中的坐标信息,确定所述至少一个目标特征在第二标定图像中的映射坐标信息;如果所述至少一个目标特征中存在第一目标特征在所述第二标定图像中的实际坐标信息与所述映射坐标信息之间的距离大于第一阈值,则根据所述至少一个目标特征中除所述第一目标特征外的其他目标特征,更新所述摄像头参数。
- 如权利要求9所述终端,其特征在于,在所述通过摄像头获取包含标识物的至少两个标定图像的方面,所述处理器用于:通过摄像头获取包含标识物的图像序列;从所述图像序列中提取至少两个标定图像。
- 如权利要求10所述终端,其特征在于,在所述通过摄像头获取包含标识物的图像序列的方面,所述处理器用于:当通过摄像头获取到包含标识物的图像时,判断配置有所述摄像头的终端所处状态是否满足预设条件;若为是,将所述图像添加至所述图像序列。
- 如权利要求11所述终端,其特征在于,所述预设条件包括:通过所述终端的陀螺仪获取的角速度小于第二阈值,或者通过所述终端的加速度计获取的加速度小于第三阈值中的至少一个。
- 如权利要求10-12任一项所述终端,其特征在于,在所述从所述图像序列中提取至少两个标定图像的方面,所述处理器用于:将所述图像序列按照时间段划分为多个图像序列组;根据每个图像序列组中每个图像包含的标识物中的目标特征的数量,对所 述每个图像序列组中的图像进行排序,以得到排序结果;根据所述排序结果,从所述每个图像序列组中选取至少一个图像作为标定图像。
- 如权利要求10-12任一项所述终端,其特征在于,所述处理器还用于:通过摄像头对所述标识物进行拍摄,以得到所述模板图像;所述从所述图像序列中提取至少两个标定图像,包括:确定所述图像序列中每个图像的获取时间以及所述模板图像的拍摄时间;根据所述每个图像的获取时间与所述模板图像的拍摄时间的远近关系,从所述图像序列中选取至少两个图像作为标定图像,其中,选取的频次与所述远近关系相关。
- 如权利要求9所述终端,其特征在于,所述处理器还用于:根据目标特征的重要程度,从所述多个目标特征中选取出所述至少一个目标特征。
- 如权利要求9所述终端,其特征在于,所述第一阈值是预配置的,或者,所述第一阈值是基于所述至少一个目标特征中的每个目标特征在所述第二标定图像上的实际坐标信息与映射坐标信息之间的距离确定的。
- 一种终端,其特征在于,包括:输入单元,用于通过摄像头获取包含标识物的至少两个标定图像,所述标识物包括多个目标特征;处理单元,用于根据所述多个目标特征中每个目标特征分别在第一标定图像与模板图像中的坐标信息,确定摄像头参数;所述处理单元,还用于根据所述摄像头参数和至少一个目标特征在所述模板图像中的坐标信息,确定所述至少一个目标特征在第二标定图像中的映射坐标信息;所述处理单元,还用于如果所述至少一个目标特征中存在第一目标特征在所述第二标定图像中的实际坐标信息与所述映射坐标信息之间的距离大于第一阈值,则根据所述至少一个目标特征中除所述第一目标特征外的其他目标特征,更新所述摄像头参数。
- 如权利要求17所述终端,其特征在于,所述输入单元还用于:通过摄像头获取包含标识物的图像序列;从所述图像序列中提取至少两个标定图像。
- 如权利要求18所述终端,其特征在于,所述输入单元还用于:当通过摄像头获取到包含标识物的图像时,判断配置有所述摄像头的终端所处状态是否满足预设条件;若为是,将所述图像添加至所述图像序列。
- 如权利要求19所述终端,其特征在于,所述预设条件包括:通过所述终端的陀螺仪获取的角速度小于第二阈值,或者通过所述终端的 加速度计获取的加速度小于第三阈值中的至少一个。
- 如权利要求18-20任一项所述终端,其特征在于,所述处理单元还用于:将所述图像序列按照时间段划分为多个图像序列组;根据每个图像序列组中每个图像包含的标识物中的目标特征的数量,对所述每个图像序列组中的图像进行排序,以得到排序结果;根据所述排序结果,从所述每个图像序列组中选取至少一个图像作为标定图像。
- 如权利要求18-20任一项所述终端,其特征在于,所述处理单元还用于:通过摄像头对所述标识物进行拍摄,以得到所述模板图像;所述从所述图像序列中提取至少两个标定图像,包括:确定所述图像序列中每个图像的获取时间以及所述模板图像的拍摄时间;根据所述每个图像的获取时间与所述模板图像的拍摄时间的远近关系,从所述图像序列中选取至少两个图像作为标定图像,其中,选取的频次与所述远近关系相关。
- 如权利要求17所述终端,其特征在于,所述处理单元还用于:根据目标特征的重要程度,从所述多个目标特征中选取出所述至少一个目标特征。
- 如权利要求17所述终端,其特征在于,所述第一阈值是预配置的,或者,所述第一阈值是基于所述至少一个目标特征中的每个目标特征在所述第二标定图像上的实际坐标信息与映射坐标信息之间的距离确定的。
- 一种存储计算机指令的可读非易失性存储介质,所述计算机指令被用户终端执行以实现权利要求1-8中任意一个方法。
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2017/088714 WO2018227580A1 (zh) | 2017-06-16 | 2017-06-16 | 摄像头标定方法和终端 |
| CN201780053568.1A CN109643455B (zh) | 2017-06-16 | 2017-06-16 | 摄像头标定方法和终端 |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2017/088714 WO2018227580A1 (zh) | 2017-06-16 | 2017-06-16 | 摄像头标定方法和终端 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2018227580A1 true WO2018227580A1 (zh) | 2018-12-20 |
Family
ID=64658849
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2017/088714 Ceased WO2018227580A1 (zh) | 2017-06-16 | 2017-06-16 | 摄像头标定方法和终端 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN109643455B (zh) |
| WO (1) | WO2018227580A1 (zh) |
Families Citing this family (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112132902B (zh) * | 2019-06-24 | 2024-01-16 | 上海安亭地平线智能交通技术有限公司 | 车载摄像头外参调整方法、装置、电子设备以及介质 |
| CN110717061B (zh) * | 2019-09-09 | 2021-07-06 | 国网浙江省电力有限公司电力科学研究院 | 基于摄像头和关联映射的变电站设备定位方法和系统 |
| CN113129386B (zh) * | 2020-12-23 | 2022-07-29 | 合肥工业大学 | 基于编码平面靶标的双目摄像机内外参数的智能标定方法 |
| CN118429336B (zh) * | 2024-07-02 | 2025-02-14 | 广东欧谱曼迪科技股份有限公司 | 一种图像清晰度排序方法、装置、电子设备及存储介质 |
| CN119936795B (zh) * | 2025-04-09 | 2025-09-23 | 天津清润博智能科技有限公司 | 一种水下航行器的定位方法、装置、设备及存储介质 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101520849A (zh) * | 2009-03-24 | 2009-09-02 | 上海水晶石信息技术有限公司 | 基于图像特征点提取与随机树分类的增强现实方法及系统 |
| CN102163331A (zh) * | 2010-02-12 | 2011-08-24 | 王炳立 | 采用标定方法的图像辅助系统 |
| CN103353941A (zh) * | 2013-06-13 | 2013-10-16 | 西安电子科技大学 | 基于视角分类的自然标志物注册方法 |
| CN103500471A (zh) * | 2013-09-27 | 2014-01-08 | 深圳市中视典数字科技有限公司 | 实现高分辨率增强现实系统的方法 |
| US20160180510A1 (en) * | 2014-12-23 | 2016-06-23 | Oliver Grau | Method and system of geometric camera self-calibration quality assessment |
-
2017
- 2017-06-16 CN CN201780053568.1A patent/CN109643455B/zh not_active Expired - Fee Related
- 2017-06-16 WO PCT/CN2017/088714 patent/WO2018227580A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101520849A (zh) * | 2009-03-24 | 2009-09-02 | 上海水晶石信息技术有限公司 | 基于图像特征点提取与随机树分类的增强现实方法及系统 |
| CN102163331A (zh) * | 2010-02-12 | 2011-08-24 | 王炳立 | 采用标定方法的图像辅助系统 |
| CN103353941A (zh) * | 2013-06-13 | 2013-10-16 | 西安电子科技大学 | 基于视角分类的自然标志物注册方法 |
| CN103500471A (zh) * | 2013-09-27 | 2014-01-08 | 深圳市中视典数字科技有限公司 | 实现高分辨率增强现实系统的方法 |
| US20160180510A1 (en) * | 2014-12-23 | 2016-06-23 | Oliver Grau | Method and system of geometric camera self-calibration quality assessment |
Also Published As
| Publication number | Publication date |
|---|---|
| CN109643455B (zh) | 2021-05-04 |
| CN109643455A (zh) | 2019-04-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN108876854B (zh) | 相机姿态追踪过程的重定位方法、装置、设备及存储介质 | |
| EP3486872B1 (en) | Image processing apparatus, image processing method, and program | |
| CN110378994B (zh) | 人脸建模方法及相关产品 | |
| JP6405891B2 (ja) | 位置・姿勢推定装置、位置・姿勢推定方法、及び、プログラム | |
| WO2018227580A1 (zh) | 摄像头标定方法和终端 | |
| CN110850961B (zh) | 一种头戴式显示设备的校准方法及头戴式显示设备 | |
| WO2019205853A1 (zh) | 相机姿态追踪过程的重定位方法、装置、设备及存储介质 | |
| US20180131869A1 (en) | Method for processing image and electronic device supporting the same | |
| WO2019042419A1 (zh) | 图像跟踪点获取方法、设备及存储介质 | |
| JP2019215622A5 (zh) | ||
| CN105635588B (zh) | 一种稳像方法及装置 | |
| CN108702457B (zh) | 用于自动图像校正的方法、装置和计算机可读存储媒体 | |
| CN112019768A (zh) | 一种视频生成方法、装置及电子设备 | |
| WO2018210318A1 (zh) | 图像虚化处理方法、装置、存储介质及电子设备 | |
| CN110049246A (zh) | 电子设备的视频防抖方法、装置和电子设备 | |
| US9921054B2 (en) | Shooting method for three dimensional modeling and electronic device supporting the same | |
| CN110738078A (zh) | 一种人脸识别方法及终端设备 | |
| JP5968379B2 (ja) | 画像処理装置およびその制御方法 | |
| CN113920502A (zh) | 一种云台调整方法、装置、设备及介质 | |
| KR102864117B1 (ko) | 전자 장치 및 전자 장치의 영상 처리 방법 | |
| CN111178234A (zh) | 一种图像识别方法、电子设备及存储介质 | |
| CN108401460A (zh) | 生成视差图的方法、系统、存储介质和计算机程序产品 | |
| US11166005B2 (en) | Three-dimensional information acquisition system using pitching practice, and method for calculating camera parameters | |
| JP5769248B2 (ja) | ステレオマッチング処理装置、ステレオマッチング処理方法、及び、プログラム | |
| CN111368675B (zh) | 手势深度信息的处理方法、装置、设备及存储介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17913579 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 17913579 Country of ref document: EP Kind code of ref document: A1 |