Patent Description:
The invention applies, for instance, to the field of Augmented Reality (AR), where 3D computer-generated images representing virtual objects are superposed on top of images captured by a video camera. To merge the virtual and the real images in the most realistic way, an accurate calibration of the video camera is required. Indeed, AR needs defining a virtual camera, which is used for rendering virtual 3D objects. This virtual camera must match as closely as possible the real camera used to capture the real world which is rendered in the background. Data provided by the manufacturer of the camera are usually insufficiently accurate to give satisfactory results, making it necessary to resort to calibration.

Camera calibration is all about accuracy. Without a well-calibrated camera, the rendered objects will not look as if they were real and the User Experience will be ruined.

Augmented Reality is a particular demanding application, but not the only one requiring accurate camera calibration. Other applications include, for instance, 3D volume reconstructions, in which case the camera is often a depth camera.

The invention is not limited to one or several specific applications; it may be useful whenever accurate calibration of a video camera is required.

The most widespread technique used to perform camera calibration is known as Zhang's algorithm and is described in the paper by <NPL>).

To calibrate a camera using this technique, a user must:.

The processing step, by itself, can be easily carried out using existing software but the previous steps are cumbersome, which make the whole process unpractical.

First of all, it is tedious to perform steps <NUM>, <NUM> and <NUM> properly, and the user has to be very careful during the creation of the calibration pattern to maximize the accuracy of the whole calibration process. To overcome this difficulty, it has been suggested to use a calibration pattern displayed on a LCD (Liquid Crystal Display); see e.g. <NPL>.

Most importantly, steps <NUM> and <NUM> are often time-consuming and frustrating because the calibration program performing step <NUM> typically rejects a large share of the acquired images, whose quality turns out to be insufficient. This may be due to an ill-chosen positioning of the pattern with respect to the camera. For instance:.

The problem of partial visibility can be solved using special patterns, wherein at least some elements have unique features allowing their identification - e.g. the so-called "ChArUco" patterns, see http://docs. <NUM>/da/d13/tutorial_aruco_calibration.

However, there is no known method to deal with the other inconveniences associated with an inappropriate positioning of the pattern - except taking additional images to replace the discarded ones, which is both time-consuming and frustrating.

The invention aims at overcoming the aforementioned drawbacks of the prior art. More particularly, it aims at reducing the share of calibration images which are discarded due to an inappropriate positioning of the calibration pattern in the field of view of the camera to be calibrated, and preferably also at maximizing the amount of useful information extracted by each valid calibration image.

According to the invention, this aim is achieved by performing the calibration using a dynamical, adaptive calibration pattern displayed on a screen. "Dynamical" means that the pattern changes during the calibration process, unlike a "static" pattern printed on a sheet of paper. "Adaptive" means that a computer system analyzes the images of the calibration pattern taken by the camera to be calibrated and, if necessary, drives the screen so as to modify the pattern. For instance, the computer system may determine that the screen is too far from the camera and, as a response, modify the pattern to make it more easily detected (e.g. using larger and more widely spaced pattern elements). Or, on the opposite, it may determine that the screen is very near to the camera and change the pattern by making it finer and denser, so as to maximize the amount of usable information provided to the calibration algorithm. If the pattern is only partially visible, the appearance of some element may change so as to allow them to be identified unambiguously. The use of an adaptive pattern reduces the share of images that have to be discarded, therefore speeding-up calibration and making the process less tedious and frustrating for the user.

An object of the present invention is then a computer-implemented method of calibrating a camera, comprising the steps of:.

According to particular embodiments of such a method:.

Another object of the invention is a computer program product, stored on a computer-readable data-storage medium, comprising computer-executable instructions to cause a computer system to carry out such a method.

Another object of the invention is a computer-readable data-storage medium containing computer-executable instructions to cause a computer system to carry out such a method.

Yet another object of the invention is a computer system comprising a processor coupled to a memory and a graphical user interface, the memory storing computer-executable instructions to cause the computer system to carry out such a method.

Additional features and advantages of the present invention will become apparent from the subsequent description, taken in conjunction with the accompanying drawings, which show:.

<FIG> shows a calibration pattern <NUM> formed by a regular array of black disks on a white background. Other patterns may be used for carrying out the invention, for instance chessboards or grids, but this one turns out to be particularly advantageous as it provides the best accuracy with a minimal number of poses, see <NPL>. This pattern is displayed by a screen <NUM>, such as a liquid crystal display.

<FIG> shows a camera <NUM> to be calibrated, connected to a computer <NUM>, programmed to carry out the inventive calibration method. Camera <NUM> is typically a standard RGB (Red-Green-Blue) camera, but it may also be e.g. a RGB-Depth camera. Camera <NUM> acquires a series of images, and converts them to a digital video stream. Then, computer <NUM> acquires the video stream from the camera.

Computer <NUM> is provided with a monitor, or auxiliary screen <NUM>, which displays the video flow generated by the camera; this is not absolutely necessary to carry out the inventive method, but is strongly preferred. The screen <NUM> used to display the dynamic and adaptive calibration pattern is part of a hand-held device <NUM>, such as a tablet computer. A user carries this hand-held device and moves it within the visual field of camera <NUM>, helped by the visual feedback provided by monitor <NUM>. Computer <NUM> extracts a series of images from the video stream generated by the camera <NUM> and feeds them to the calibration algorithm. This extraction may be performed automatically by the computer, e.g. at fixed times, or may be triggered by a user e.g. by pressing a key of a keyboard connected to the computer <NUM>. Moreover, computer <NUM> controls the displaying of pattern <NUM> by the screen <NUM> of the hand-held device <NUM>. In other words, computer <NUM> acts as a "master" and device <NUM> as a "slave".

Alternatively, the screen <NUM> displaying the calibration pattern may be fixed, and the camera being moved around while remaining connected to the computer through a wireless communication link. Also, the device <NUM> carrying the screen <NUM> could be the master and computer <NUM> the slave, or both devices may be slaved to another computer. It is also possible to use a screen <NUM> which is directly driven by computer <NUM>.

In the following description of the invention, only the case of a screen <NUM> carried by a hand-held slave device <NUM> and a fixed camera <NUM> will be considered, but generalization to alternative embodiments is straightforward.

<FIG> represents an image acquired by camera <NUM> and displayed on monitor <NUM>, showing the user holding the slave device <NUM>, whose screen <NUM> displays the calibration pattern <NUM> of <FIG>. Screen <NUM> is held at a distance which may be qualified as "intermediate": the pattern is fully visible and occupies a significant portion of the field of view, and its elements are clearly distinguishable. The image is suitable to be used by the calibration algorithm. Which distances may be considered to be "intermediate" depends on the specific camera considered.

<FIG> shows a similar scene, wherein the screen <NUM> has been moved nearer to the camera. The pattern <NUM> is not fully visible (some elements positioned at its corners are outside the field of view of the camera), and its elements are unnecessary large and widely spaced, which results in a waste of computation time by the calibration algorithm. The master computer <NUM> detects this sub-optimal situation and, as a response, it sends commands to the slave device to make it modify the calibration pattern to adapt to the short screen - camera distance. The result is illustrated on <FIG>. The modified pattern <NUM> comprises a much greater number of much smaller elements (dots) with a shorter spatial period (i.e. spacing). Despite being smaller, the elements remain easily detectable; their larger number provides additional information to the calibration algorithm and makes the loss of some of them at the corners of the pattern much less detrimental.

When the pattern is very close to the camera and a large number of elements is outside the field of view, the calibration algorithm becomes unable to identify its origin (the point of the pattern with respect to which the positions of all its elements are defined). The image is then unusable. In this case, the pattern may be modified by introducing a plurality of pattern elements having a unique appearance and a known position with respect to the origin. If these elements are visible on the image, they allow localizing the pattern origin and therefore using the image for calibration. <FIG> shows a modified pattern <NUM> comprising three of these "unique" elements, which are identified by references <NUM>, <NUM>, <NUM> and <NUM>. In the example, these elements are marked by a frame having a triangle, square, pentagon and star shape, but other alternatives exist. For instance, these elements may have a dynamic appearance - e.g. a changing color or size, or they may blink.

<FIG> illustrates the opposite situation, wherein the screen <NUM> has been moved far away from the camera. The elements of pattern <NUM> appear too small and too close to each other; as a consequence the pattern is not easily detected and the acquired images may be unusable for calibration. The computer <NUM> detects this sub-optimal situation and, as a response, sends commands to the slave device to make it modify the calibration pattern to adapt to the short screen - camera distance. The result is illustrated on <FIG>. The modified pattern <NUM> comprises a smaller number of larger elements (dots) with a longer spatial period (i.e. spacing). Being larger, the elements are more easily detectable, making the image usable for calibration - even if providing a somehow reduced amount of information.

A method according to an exemplary embodiment of the invention comprises the following steps:.

It may happen that the master computer is unable to detect the pattern in the video stream, e.g. because it is too far or too close to the camera, or simply out of the camera view. To make the detection easier, it is possible to proceed as follows:.

The "high detectability" pattern may simply consists in turning the whole screen white, or blinking between black and white, to ease detection by the calibration program (simple difference between two successive frames), or a simple geometrical pattern comprising e.g. three squares at the corners of the screen, blinking or not.

In a particular embodiment, the slave device <NUM> may be provided with sensors such as gyroscopes, accelerometers, magnetic compasses, allowing a measurement of the orientation of the device. The measurement results may be communicated to the master computer to improve the accuracy of the calibration, as only the position of the pattern would need to be computed.

The slave device could have a camera of its own, and, if it has already been calibrated, could use image processing (e.g. tracking of Augmented Reality markers) to enrich the calibration data with its position and orientation.

Quite often the camera is required to remain unchanged during the entire calibration process (no autofocus, no automatic brightness adjustment). The master computer can then send to the slave device commands to make the pattern brighter or dimmer to adapt to the current lighting conditions and ease its detection.

As it has been mentioned above, a same computer may serve as both the "master" and the "slave", in which case screens <NUM> and <NUM> and camera <NUM> are simply peripheral devices of this computer. The advantage of such an approach is that no handshaking is necessary.

The internal structure of a master computer <NUM> suitable for carrying out a method according to an exemplary embodiment of the present invention is described with reference to <FIG>. In <FIG>, the computer <NUM> includes a Central Processing Unit (CPU) P which performs the processes described above. The process can be stored as an executable program, i.e. a set of computer-readable instructions in memory, such as RAM M1 or ROM M2, or on hard disk drive (HDD) M3, DVD/CD drive M4, or can be stored remotely. Data defining a plurality of calibration patterns (<NUM>, <NUM>, <NUM>, <NUM> on <FIG>), or a single "master" pattern from which different calibration patterns - e.g. of different spatial resolutions - may be obtained, are stored on one or more of memory devices M1 to M4, or remotely.

The claimed invention is not limited by the form of the computer-readable media on which the computer-readable instructions and/or the calibration pattern(s) are stored. For example, they can be stored on CDs, DVDs, in FLASH memory, RAM, ROM, PROM, EPROM, EEPROM, hard disk or any other information processing device with which the computer aided design station communicates, such as a server or computer. The program and the calibration pattern(s) can be stored on a same memory device or on different memory devices.

Further, a computer program suitable for carrying out the inventive method can be provided as a utility application, background daemon, or component of an operating system, or combination thereof, executing in conjunction with CPU <NUM> and an operating system such as Microsoft VISTA, Microsoft Windows <NUM>, UNIX, Solaris, LINUX, Apple MAC-OS and other systems known to those skilled in the art.

CPU P can be a Xenon processor from Intel of America or an Opteron processor from AMD of America, or can be other processor types, such as a Freescale ColdFire, IMX, or ARM processor from Freescale Corporation of America. Alternatively, the CPU can be a processor such as a Core2 Duo from Intel Corporation of America, or can be implemented on an FPGA, ASIC, PLD or using discrete logic circuits, as one of ordinary skill in the art would recognize. Further, the CPU can be implemented as multiple processors cooperatively working to perform the computer-readable instructions of the inventive processes described above.

The computer aided design station in <FIG> also includes a network interface Nl, such as an Intel Ethernet PRO network interface card from Intel Corporation of America, for interfacing with a network, such as a local area network (LAN), wide area network (WAN), the Internet and the like. In the specific embodiment considered here, communication with the screen <NUM> used to display the calibration patterns is performed through the network.

The computer aided design station further includes a display controller DC, such as a NVIDIA GeForce GTX graphics adaptor from NVIDIA Corporation of America for interfacing with the auxiliary screen or display <NUM>, such as a Hewlett Packard HPL2445w LCD monitor. A general purpose I/O interface IF interfaces with a keyboard KB and pointing device PD, such as a roller ball, mouse, touchpad and the like. The display, the keyboard and the pointing device, together with the display controller and the I/O interfaces, form a graphical user interface. All these components are connected to each other through communication bus CBS, which can be an ISA, EISA, VESA, PCI, or similar. Moreover, the camera CAM to be calibrated is also connected to the bus CBS, in order to provide a video stream to the CPU P, which processes it as explained above.

Claim 1:
A computer-implemented method of calibrating a camera, comprising the steps of:
a. making a video screen (<NUM>) display a calibration pattern (<NUM>);
b. acquiring from the camera (<NUM>) a video stream of a scene comprising said calibration pattern displayed on the video screen;
c. modifying the calibration pattern (<NUM>, <NUM>, <NUM>), depending on the acquired video stream, and making the screen display the modified calibration pattern;
said steps a. to c. being iterated a plurality of times; and then
d. when enough data has been collected, estimating intrinsic calibration parameters of the camera by processing the acquired video streams.