Apparatus and method of image analysis

A method of analyzing a captured image comprising an instance of a target object comprises the steps of: for each of a plurality of different brightness threshold levels, generating contours from the captured digital image that indicate where in the captured digital image the pixel values of the captured digital image cross the respective brightness threshold level; identifying instances of a contour corresponding to a characteristic feature of said target object, the instances being detected at substantially similar image positions in the contours derived using at least two of the respective brightness threshold levels; and estimating a homography which maps the characteristic feature of the target object to its representation in the captured image, based upon the two or more instances of that target object's corresponding contour.

CROSS REFERENCE TO RELATED APPLICATIONS

The present application is a national phase entry under 35 U.S.C. § 371 of International Application No. PCT/GB2008/003347, filed Oct. 2, 2008, published in English, which claims the benefit of EP Patent Application No. 07253962.0, filed Oct. 5, 2007. The entire disclosures of each of the above-identified applications are incorporated by reference herein.

The present invention relates to an apparatus and method of image analysis.

Conventional augmented reality systems attempt to integrate virtual objects within a video capture of a real environment. This can take the form of a so-called ‘magic window’, where a combined camera and display are moved with respect to the real world, so that as real-world features come into view, corresponding virtual elements are added (e.g. see http://studierstube.icg.tu-graz.ac.at/handheld_ar/artoolkitplus.php). Alternatively, the camera can be fixed, and the position and orientation of a real-world object within the camera's view can be ascertained, allowing appropriate augmentation of the object—e.g. see http://www.pervasive.ifi.lmu.de/workshops/w3/papers—2005/PerGames2005_TARBoard_WLee.pdf This typically takes the form of a graphical overlay or associated virtual entity depicted in a manner consistent with the orientation of the real-world object.

There a number of problems associated with this latter form of augmented reality. The first problem is to identify and consistently determine the location and orientation of the real-world object (typically a cube or card with high-contrast markings). In a normal domestic or office environment, there may be many objects that may resemble the real world target object, and the shape of the target object may make its orientation ambiguous. The second problem is that the lighting by which such a real-world object is illuminated will vary from situation to situation, further complicating its identification. The third problem is to faithfully position the virtual object or enhancement with respect to the real world object so that their movements appear to correspond. Moreover, the problems must be overcome for a real-time video feed.

Embodiments of the present invention seek to address, mitigate or alleviate the above problems.

In a first aspect of the present invention, a method of analysing a captured image comprises the steps of: for each of a plurality of different brightness threshold levels, generating contours from the captured digital image that indicate where in the captured digital image the pixel values of the captured digital image cross the respective brightness threshold level; identifying instances of a contour corresponding to a characteristic feature of said target object, the instances being detected at substantially similar image positions in the contours derived using at least two of the respective brightness threshold levels; and estimating a homography which maps the characteristic feature of the target object to its representation in the captured image, based upon the two or more instances of that target object's corresponding contour.

In another aspect of the present invention, an image analysis apparatus comprises an image processor operable to generate, for each of a plurality of different brightness threshold levels, contours from a captured digital image that indicate where in the captured digital image the pixel values of the captured digital image cross the respective brightness threshold level; a feature identifier operable to identify instances of a contour corresponding to a characteristic feature of said target object, the instances being detected at substantially similar image positions in the contours derived using at least two of the respective brightness threshold levels; and a homography transform estimator operable to estimate a homography which maps the characteristic feature of the target object to its representation in the captured image based upon the two or more instances of that target object's corresponding contour.

Advantageously, by estimating a homography based upon contours generated at different respective brightness threshold levels, successive homographies for successive images in a video sequence show less variability in response to inter-frame changes in object lighting conditions. As a result, a digital augmentation applied to the image in dependence upon such a homography appears more stably coupled over time to the underlying target object in the image. In addition, by using a plurality of respective brightness threshold levels the need to calibrate or otherwise account for the encountered lighting conditions is mitigated.

Further respective aspects and features of the invention are defined in the appended claims, including corresponding methods of operation as appropriate.

A method and apparatus of analysing images for augmented reality applications are disclosed. In the following description, a number of specific details are presented in order to provide a thorough understanding of the embodiments of the present invention. It will be apparent, however, to a person skilled in the art that these specific details need not be employed to practice the present invention. Conversely, specific details known to the person skilled in the art are omitted for the purposes of clarity where appropriate.

In a summary embodiment of the present invention, an apparatus comprising a video camera captures an image that incorporates at least one target object, the target object having some form of characteristic marking, and superposes within the image a virtual augmentation such as an graphical object or pattern with respect to that real-world target object. The placement of the virtual augmentation is thus dependent upon estimating the position and orientation of the or each target object within the captured image. This is achieved by identifying the contours of the characteristic markings in a black and white version of the captured image, and computing a transform or homography between these contours and a default position/orientation contour pattern. To mitigate variations in resolution, lighting and video noise between successive image captures that may otherwise impart random jitter to the positional estimate, contours are derived from a plurality of black and white versions of the original captured image, with each version using a different brightness threshold level for assigning black and white values so as to give a different effective light exposure. The resulting plurality of contour estimates for each respective target object are then used to generate a best-fit contour from which a homography for the or each respective target object is derived. A homography derived in such a manner is comparatively stable over time under varying lighting conditions as it is based on an average of different effective exposure levels that typically exceed the variation in light that would be experienced between successive images thresholded at a single exposure level. As a result, in a video sequence the virtual augmentation appears significantly more stable with respect to the target object than in conventional systems.

In an embodiment of the present invention, the apparatus is a Sony® Playstation 3® entertainment device, connected to an associated video camera.

FIG. 1schematically illustrates the overall system architecture of the Sony® Playstation 3® entertainment device. A system unit10is provided, with various peripheral devices connectable to the system unit.

The system unit10comprises: a Cell processor100; a Rambus® dynamic random access memory (XDRAM) unit500; a Reality Synthesiser graphics unit200with a dedicated video random access memory (VRAM) unit250; and an I/O bridge700.

The system unit10also comprises a Blu Ray® Disk BD-ROM® optical disk reader430for reading from a disk440and a removable slot-in hard disk drive (HDD)400, accessible through the I/O bridge700. Optionally the system unit also comprises a memory card reader450for reading compact flash memory cards, Memory Stick® memory cards and the like, which is similarly accessible through the I/O bridge700.

The I/O bridge700also connects to four Universal Serial Bus (USB) 2.0 ports710; a gigabit Ethernet port720; an IEEE 802.11b/g wireless network (Wi-Fi) port730; and a Bluetooth® wireless link port740capable of supporting up to seven Bluetooth connections.

In operation the I/O bridge700handles all wireless, USB and Ethernet data, including data from one or more game controllers751. For example when a user is playing a game, the I/O bridge700receives data from the game controller751via a Bluetooth link and directs it to the Cell processor100, which updates the current state of the game accordingly.

The wireless, USB and Ethernet ports also provide connectivity for other peripheral devices in addition to game controllers751, such as: a remote control752; a keyboard753; a mouse754; a portable entertainment device755such as a Sony Playstation Portable® entertainment device; a video camera such as an EyeToy® video camera756; and a microphone headset757. Such peripheral devices may therefore in principle be connected to the system unit10wirelessly; for example the portable entertainment device755may communicate via a Wi-Fi ad-hoc connection, whilst the microphone headset757may communicate via a Bluetooth link.

The provision of these interfaces means that the Playstation 3 device is also potentially compatible with other peripheral devices such as digital video recorders (DVRs), set-top boxes, digital cameras, portable media players, Voice over IP telephones, mobile telephones, printers and scanners.

In addition, a legacy memory card reader410may be connected to the system unit via a USB port710, enabling the reading of memory cards420of the kind used by the Playstation® or Playstation 2® devices.

In the present embodiment, the game controller751is operable to communicate wirelessly with the system unit10via the Bluetooth link. However, the game controller751can instead be connected to a USB port, thereby also providing power by which to charge the battery of the game controller751. In addition to one or more analogue joysticks and conventional control buttons, the game controller is sensitive to motion in 6 degrees of freedom, corresponding to translation and rotation in each axis. Consequently gestures and movements by the user of the game controller may be translated as inputs to a game in addition to or instead of conventional button or joystick commands. Optionally, other wirelessly enabled peripheral devices such as the Playstation Portable device may be used as a controller. In the case of the Playstation Portable device, additional game or control information (for example, control instructions or number of lives) may be provided on the screen of the device. Other alternative or supplementary control devices may also be used, such as a dance mat (not shown), a light gun (not shown), a steering wheel and pedals (not shown) or bespoke controllers, such as a single or several large buttons for a rapid-response quiz game (also not shown).

The remote control752is also operable to communicate wirelessly with the system unit10via a Bluetooth link. The remote control752comprises controls suitable for the operation of the Blu Ray Disk BD-ROM reader430and for the navigation of disk content.

The Blu Ray Disk BD-ROM reader430is operable to read CD-ROMs compatible with the Playstation and PlayStation 2 devices, in addition to conventional pre-recorded and recordable CDs, and so-called Super Audio CDs. The reader430is also operable to read DVD-ROMs compatible with the Playstation 2 and PlayStation 3 devices, in addition to conventional pre-recorded and recordable DVDs. The reader430is further operable to read BD-ROMs compatible with the Playstation 3 device, as well as conventional pre-recorded and recordable Blu-Ray Disks.

The system unit10is operable to supply audio and video, either generated or decoded by the Playstation 3 device via the Reality Synthesiser graphics unit200, through audio and video connectors to a display and sound output device300such as a monitor or television set having a display305and one or more loudspeakers310. The audio connectors210may include conventional analogue and digital outputs whilst the video connectors220may variously include component video, S-video, composite video and one or more High Definition Multimedia Interface (HDMI) outputs. Consequently, video output may be in formats such as PAL or NTSC, or in 720p, 1080i or 1080p high definition.

Audio processing (generation, decoding and so on) is performed by the Cell processor100. The Playstation 3 device's operating system supports Dolby® 5.1 surround sound, Dolby® Theatre Surround (DTS), and the decoding of 7.1 surround sound from Blu-Ray® disks.

In the present embodiment, the video camera756comprises a single charge coupled device (CCD), an LED indicator, and hardware-based real-time data compression and encoding apparatus so that compressed video data may be transmitted in an appropriate format such as an intra-image based MPEG (motion picture expert group) standard for decoding by the system unit10. The camera LED indicator is arranged to illuminate in response to appropriate control data from the system unit10, for example to signify adverse lighting conditions. Embodiments of the video camera756may variously connect to the system unit10via a USB, Bluetooth or Wi-Fi communication port. Embodiments of the video camera may include one or more associated microphones and also be capable of transmitting audio data. In embodiments of the video camera, the CCD may have a resolution suitable for high-definition video capture. In use, images captured by the video camera may for example be incorporated within a game or interpreted as game control inputs.

In general, in order for successful data communication to occur with a peripheral device such as a video camera or remote control via one of the communication ports of the system unit10, an appropriate piece of software such as a device driver should be provided. Device driver technology is well-known and will not be described in detail here, except to say that the skilled man will be aware that a device driver or similar software interface may be required in the present embodiment described.

Referring now toFIG. 2, the Cell processor100has an architecture comprising four basic components: external input and output structures comprising a memory controller160and a dual bus interface controller170A,B; a main processor referred to as the Power Processing Element150; eight co-processors referred to as Synergistic Processing Elements (SPEs)110A-H; and a circular data bus connecting the above components referred to as the Element Interconnect Bus180. The total floating point performance of the Cell processor is 218 GFLOPS, compared with the 6.2 GFLOPs of the Playstation 2 device's Emotion Engine.

The Power Processing Element (PPE)150is based upon a two-way simultaneous multithreading Power970compliant PowerPC core (PPU)155running with an internal clock of 3.2 GHz. It comprises a 512 kB level 2 (L2) cache and a 32 kB level 1 (L1) cache. The PPE150is capable of eight single position operations per clock cycle, translating to 25.6 GFLOPs at 3.2 GHz. The primary role of the PPE150is to act as a controller for the Synergistic Processing Elements110A-H, which handle most of the computational workload. In operation the PPE150maintains a job queue, scheduling jobs for the Synergistic Processing Elements110A-H and monitoring their progress. Consequently each Synergistic Processing Element110A-H runs a kernel whose role is to fetch a job, execute it and synchronise with the PPE150.

Each Synergistic Processing Element (SPE)110A-H comprises a respective Synergistic Processing Unit (SPU)120A-H, and a respective Memory Flow Controller (MFC)140A-H comprising in turn a respective Dynamic Memory Access Controller (DMAC)142A-H, a respective Memory Management Unit (MMU)144A-H and a bus interface (not shown). Each SPU120A-H is a RISC processor clocked at 3.2 GHz and comprising 256 kB local RAM130A-H, expandable in principle to 4 GB. Each SPE gives a theoretical 25.6 GFLOPS of single precision performance. An SPU can operate on 4 single precision floating point members, 4 32-bit numbers, 8 16-bit integers, or 16 8-bit integers in a single clock cycle. In the same clock cycle it can also perform a memory operation. The SPU120A-H does not directly access the system memory XDRAM500; the 64-bit addresses formed by the SPU120A-H are passed to the MFC140A-H which instructs its DMA controller142A-H to access memory via the Element Interconnect Bus180and the memory controller160.

The Element Interconnect Bus (EIB)180is a logically circular communication bus internal to the Cell processor100which connects the above processor elements, namely the PPE150, the memory controller160, the dual bus interface170A,B and the 8 SPEs110A-H, totalling 12 participants. Participants can simultaneously read and write to the bus at a rate of 8 bytes per clock cycle. As noted previously, each SPE110A-H comprises a DMAC142A-H for scheduling longer read or write sequences. The EIB comprises four channels, two each in clockwise and anti-clockwise directions. Consequently for twelve participants, the longest step-wise data-flow between any two participants is six steps in the appropriate direction. The theoretical peak instantaneous EIB bandwidth for 12 slots is therefore 96 B per clock, in the event of full utilisation through arbitration between participants. This equates to a theoretical peak bandwidth of 307.2 GB/s (gigabytes per second) at a clock rate of 3.2 GHz.

The memory controller160comprises an XDRAM interface162, developed by Rambus Incorporated. The memory controller interfaces with the Rambus XDRAM500with a theoretical peak bandwidth of 25.6 GB/s.

The dual bus interface170A,B comprises a Rambus FlexIO® system interface172A,B. The interface is organised into 12 channels each being 8 bits wide, with five paths being inbound and seven outbound. This provides a theoretical peak bandwidth of 62.4 GB/s (36.4 GB/s outbound, 26 GB/s inbound) between the Cell processor and the I/O Bridge700via controller170A and the Reality Simulator graphics unit200via controller170B.

Data sent by the Cell processor100to the Reality Simulator graphics unit200will typically comprise display lists, being a sequence of commands to draw vertices, apply textures to polygons, specify lighting conditions, and so on.

Referring now toFIG. 3, the Reality Simulator graphics (RSX) unit200is a video accelerator based upon the NVidia® G70/71 architecture that processes and renders lists of commands produced by the Cell processor100. The RSX unit200comprises a host interface202operable to communicate with the bus interface controller170B of the Cell processor100; a vertex pipeline204(VP) comprising eight vertex shaders205; a pixel pipeline206(PP) comprising 24 pixel shaders207; a render pipeline208(RP) comprising eight render output units (ROPs)209; a memory interface210; and a video converter212for generating a video output. The RSX200is complemented by 256 MB double data rate (DDR) video RAM (VRAM)250, clocked at 600 MHz and operable to interface with the RSX200at a theoretical peak bandwidth of 25.6 GB/s. In operation, the VRAM250maintains a frame buffer214and a texture buffer216. The texture buffer216provides textures to the pixel shaders207, whilst the frame buffer214stores results of the processing pipelines. The RSX can also access the main memory500via the EIB180, for example to load textures into the VRAM250.

The vertex pipeline204primarily processes deformations and transformations of vertices defining polygons within the image to be rendered.

The pixel pipeline206primarily processes the application of colour, textures and lighting to these polygons, including any pixel transparency, generating red, green, blue and alpha (transparency) values for each processed pixel. Texture mapping may simply apply a graphic image to a surface, or may include bump-mapping (in which the notional direction of a surface is perturbed in accordance with texture values to create highlights and shade in the lighting model) or displacement mapping (in which the applied texture additionally perturbs vertex positions to generate a deformed surface consistent with the texture).

The render pipeline208performs depth comparisons between pixels to determine which should be rendered in the final image. Optionally, if the intervening pixel process will not affect depth values (for example in the absence of transparency or displacement mapping) then the render pipeline and vertex pipeline204can communicate depth information between them, thereby enabling the removal of occluded elements prior to pixel processing, and so improving overall rendering efficiency. In addition, the render pipeline208also applies subsequent effects such as full-screen anti-aliasing over the resulting image.

Both the vertex shaders205and pixel shaders207are based on the shader model 3.0 standard. Up to 136 shader operations can be performed per clock cycle, with the combined pipeline therefore capable of 74.8 billion shader operations per second, outputting up to 840 million vertices and 10 billion pixels per second. The total floating point performance of the RSX200is 1.8 TFLOPS.

Typically, the RSX200operates in close collaboration with the Cell processor100; for example, when displaying an explosion, or weather effects such as rain or snow, a large number of particles must be tracked, updated and rendered within the scene. In this case, the PPU155of the Cell processor may schedule one or more SPEs110A-H to compute the trajectories of respective batches of particles. Meanwhile, the RSX200accesses any texture data (e.g. snowflakes) not currently held in the video RAM250from the main system memory500via the element interconnect bus180, the memory controller160and a bus interface controller170B. The or each SPE110A-H outputs its computed particle properties (typically coordinates and normals, indicating position and attitude) directly to the video RAM250; the DMA controller142A-H of the or each SPE110A-H addresses the video RAM250via the bus interface controller170B. Thus in effect the assigned SPEs become part of the video processing pipeline for the duration of the task.

In general, the PPU155can assign tasks in this fashion to six of the eight SPEs available; one SPE is reserved for the operating system, whilst one SPE is effectively disabled. The disabling of one SPE provides a greater level of tolerance during fabrication of the Cell processor, as it allows for one SPE to fail the fabrication process. Alternatively if all eight SPEs are functional, then the eighth SPE provides scope for redundancy in the event of subsequent failure by one of the other SPEs during the life of the Cell processor.

The PPU155can assign tasks to SPEs in several ways. For example, SPEs may be chained together to handle each step in a complex operation, such as accessing a DVD, video and audio decoding, and error masking, with each step being assigned to a separate SPE. Alternatively or in addition, two or more SPEs may be assigned to operate on input data in parallel, as in the particle animation example above.

Software instructions implemented by the Cell processor100and/or the RSX200may be supplied at manufacture and stored on the HDD400, and/or may be supplied on a data carrier or storage medium such as an optical disk or solid state memory, or via a transmission medium such as a wired or wireless network or internet connection, or via combinations of these.

The software supplied at manufacture comprises system firmware and the Playstation 3 device's operating system (OS). In operation, the OS provides a user interface enabling a user to select from a variety of functions, including playing a game, listening to music, viewing photographs, or viewing a video. The interface takes the form of a so-called cross media-bar (XMB), with categories of function arranged horizontally. The user navigates by moving through the function icons (representing the functions) horizontally using the game controller751, remote control752or other suitable control device so as to highlight a desired function icon, at which point options pertaining to that function appear as a vertically scrollable list of option icons centred on that function icon, which may be navigated in analogous fashion. However, if a game, audio or movie disk440is inserted into the BD-ROM optical disk reader430, the Playstation 3 device may select appropriate options automatically (for example, by commencing the game), or may provide relevant options (for example, to select between playing an audio disk or compressing its content to the HDD400).

In addition, the OS provides an on-line capability, including a web browser, an interface with an on-line store from which additional game content, demonstration games (demos) and other media may be downloaded, and a friends management capability, providing on-line communication with other Playstation3device users nominated by the user of the current device; for example, by text, audio or video depending on the peripheral devices available. The on-line capability also provides for on-line communication, content download and content purchase during play of a suitably configured game, and for updating the firmware and OS of the Playstation 3 device itself. It will be appreciated that the term “on-line” does not imply the physical presence of wires, as the term can also apply to wireless connections of various types.

Referring now toFIG. 4, in an embodiment of the present invention the process of determining the position and orientation of a real-world object to which a virtual augmentation is applied can be broken down into two basic parts. Part1comprises finding candidate objects, and is implemented by steps s1010to s1030ofFIG. 4. Part2comprises determining their orientation, and is implemented by steps s1110to s1160ofFIG. 4. In other words, the output of the process shown inFIG. 4(details of the candidate objects and their orientation) is provided at the output of the step s1160. Then, a third part (not shown) comprises applying the virtual augmentation according to the determined position and orientation.

Parts1and2are generally implemented in parallel with each other on one or more respective SPUs120A-H.

Referring now also toFIG. 5, which provides more detail as to the processing carried out by a step s1010, in the step s1010the contours of a candidate object are detected by first capturing an image in a step s1011, thresholding the captured image to generate a binary or black-and-white image in a step s1012, finding the contours of the binary image in step s1014, finding contours that appear to match a first target pattern in a step s1016, and further discriminating amongst these candidate targets by applying further pattern constraints in a step s1018. In this context, contours represent positions in the image at which the grey-scale values of the pixels cross the selected threshold level.

Referring now also toFIGS. 6A-E, in step s1011the captured image (FIG. 6A) is typically captured by the video camera756, giving a grey-scale image 640×480 pixels in size. If a colour image is captured, the colour information can be combined by conventional techniques to provide a grey-scale image for subsequent processing, or alternatively the processing to be described below could be carried out on one or more colour representations (e.g. colour differences, colour components or combinations of these), in which case the term “brightness” would be interpreted as a measure of the amount of such a colour representation.

In the step s1012, this grey-scale image is then thresholded. In other words, pixels of the grey-scale image are compared to a brightness threshold. Pixels having a brightness below the threshold are treated as black, and pixels having a brightness above the threshold are treated as white, although the labels are not important, and a more generic “first state” and “second state” could be used in place of “black” and “white”. Multiple threshold levels are used, as shown by the respective thresholded images inFIGS. 6B to 6E, which have threshold levels progressively varying between a value near to black level (FIG. 6B) through to a value close to white level (FIG. 6E).

The point within the grey-scale range at which to set the binary threshold between black and white pixels corresponds to an effective ‘exposure’ of the binary image. This is an analogy with the exposure used in an analogue or digital image capture process, in that setting the threshold close to the black end of the grey scale range results in a predominantly white image (FIG. 6B), looking over-exposed. Conversely, setting the threshold close to the white end of the grey scale range results in a predominantly black image (FIG. 6E), looking under-exposed. In either case a target object2010(FIG. 8) having black and white areas, such as a white card with a black square on it, may be either emphasised (FIGS. 6C and 6D) or adversely affected (FIGS. 6B and 6E) by the threshold chosen. This is dependent upon whether the chosen threshold falls between the captured grey-scale values for the black and white parts of the target object, which in turn depend upon the lighting conditions in the environment of the scene and the apparent size of the object with respect to the image resolution; factors which are of course beyond the control of the thresholding arrangement.

Consequently, in an embodiment of the present invention, in the step s1012the grey-scale image is thresholded at a plurality of exposure (brightness threshold) levels, and the resulting plurality of binary images, each with a different effective exposure, are each analysed over the steps s1014-s1018.

An example of the processing is illustrated inFIGS. 7A-C, based upon the binary image ofFIG. 6D. In this example, at the step s1014the contours of the binary images are found, generating a contour image as shown inFIG. 7A. This contour detection process can be achieved using conventional edge detectors, such as differentiation operators or Laplace transforms, to generate a contour image, typically with background pixels marked as black (0-value) and contour pixels marked as white (1-value). In general, the target object2010is designed so as to generate closed contours in the contour image, such as a square or circle; this is relevant to the subsequent processing, to be described further below.

In an alternative embodiment, the steps s1012and s1014can be combined to take the grey-scale image and isolate contours within the image at the selected exposure threshold level. This is achieved by applying the following process for each pixel:Define Pixelcurrent=current pixel under analysisPixelright=pixel directly to the right of current pixelPixelbelow=pixel directly below current pixelThen PC=true if Pixelcurrent>ThresholdPR=true if Pixelright>ThresholdPB=true if Pixelbelow>ThresholdFinally, Pixeloutput=(PCXOR PR) OR (PCXOR PB)
Thus the output for a pixel is set to ‘true’ if it is at the edge of a region that exceeds the threshold, as determined by the pixels to the right and below the test pixel. Put simply, the output pixel is set to ‘true’ if not all three of Pixelcurrent, Pixelrightand Pixelbeloware together either above or below the threshold. Finally, it will be appreciated that other pixels (e.g. the directly below-right pixel) could also be incorporated in an equivalent test.

At the step s1016, contours that could correspond to the target object are identified. In an embodiment of the present invention, a so-called tracer function is applied to a contour image. A tracer function traces contours to determine if they return to the same position, thereby denoting a closed contour. The tracer function can also eliminate contours that do not conform to an expected geometry; for example, a contour corresponding to a quadrangle-shaped object should result in a closed contour that involves all left- or all right-turns, whilst a contour corresponding to a circle-shaped object should not involve straight lines. A tolerance limit, such as 5% of the length of the detected contour not conforming to such constraints, may be included to account for noise, or partial occlusion (for example if the object is a playing card and so regularly has a user's thumb over part of the card in the captured image). Candidate objects identified in the step s1010as possible closed contours corresponding to the target object2010are shown inFIG. 7B.

Such tracer functions can be implemented in parallel on some of the SPUs120A-H, and also several can run on a single SPU. In this latter case, the trace processes can be interleaved to reduce the impact of memory access times and/or branch decision times for each trace.

In an embodiment of the present invention, the number of traces can be reduced by exploiting the feature that the above process is applied to a plurality of binary images with different effective exposure thresholds. A way in which this can be achieved will now be described.

For most exposure threshold values, or at least for one pair of adjacent threshold values, it can normally be assumed that the markings on a given target object will be discernable for adjacent exposure thresholds. Therefore the contours corresponding to these markings can also be expected to be discernable for adjacent exposure thresholds. Therefore contours that do not substantially correspond to one another between adjacent thresholds can be removed as a further discriminating step, i.e. before the tracer functions are applied. This usefully discriminates in favour of contours generated by high-contrast features in the original image (where the step-change in brightness within such features is greater than the step change in grey-scale threshold between adjacent thresholds), but against contours generated by surfaces with graduated grey-scales, where the step-change in grey-scale threshold translates to a spatial change in where the threshold falls within the source image.

This process is generally not carried out in a serial manner moving from threshold level to threshold level, or depending on which end of the threshold scale it starts, it could result in the deletion of all of the contours. Rather, the test is applied so that a contour survives the test if a similar contour is present in the contour image generated in respect of either adjacent threshold value. The way in which a “similar” contour may be detected will be described below.

In an embodiment of the present invention, this discrimination is implemented by generating a low-resolution ‘OR’ map of each contour image. In other words, pixels in the contour image are divided into groups, and an OR function is used so that if any one of the pixels in a group indicates the presence of a contour, a flag corresponding to that group is set to indicate the presence of a contour. For example, if square groups of four pixels are used, then if one in the four pixels of contour image A is white, set the corresponding ‘OR’ map pixel white. An AND operation is then applied between the OR maps for pairs of contour images derived using adjacent threshold values, to generate a correspondence mask. The correspondence mask will then denote where contours approximately overlap in both of the contour images under test. The correspondence mask (upscaled back to the resolution of the contour maps) can then be used to perform an AND operation with the original contour images to remove all contour pixels that do not pass this test, i.e. which do not approximately overlap between the adjacent exposure thresholds. For a greater tolerance of positional correspondence, a one-in-nine resolution OR mask, or a one-in-sixteen resolution OR mask, etc., can be used for each contour image. It will be appreciated that alternatively the OR mask can have the same resolution as the binary image, but square groups of 4, 9, 16, etc., pixels are set white or black as appropriate.

At the step s1018, the remaining candidate contours are analysed to isolate those corresponding to the target object or objects.

Referring now also toFIG. 8, the target object2010typically comprises markings that produce a bold, high-contrast border. The resulting contours2021,2022have the characteristic that they are concentric. Thus an economical analysis of candidate contours is to discard any contours that do not form part of a substantially concentric pair within a test area2020. The resulting set of contours detected to be likely to represent the target object in the ongoing example is illustrated inFIG. 7C.

Alternative arrangements of contours readily amenable to such analysis will be apparent to a person skilled in the art, such as a prescribed relative distance between two neighbouring contours, and/or a prescribed size ratio between two neighbouring contours.

In general, the target object is designed so that a detection of the target object involves the detection of two or more contours in a characteristic relationship (e.g. a concentric pair of contours). This arrangement is used because most simple geometric forms such as a rectangle could also occur by chance in general background scenes, such as rectangular computer screens, doors and windows, or circular plates and light fittings.

The result of the step s1018, in general terms, is a plurality of target object contour estimates—i.e. identifications of contours which may correspond to the target object—one (or more) for each of the plurality of differently thresholded binary images. It will be appreciated of course that some threshold values may not result in the detection of target object contour estimates.

It will also be appreciated that alternative edge detection and contour tracing algorithms may be employed in order to derive candidate contours for a plurality of binary images, each with a different effective exposure. It will also be appreciated that such an alternative contour tracing algorithm may not require an explicit edge detection step if it utilises features of the binary image directly.

Advantageously, the plurality of contour estimates, each based upon a different effective exposure level, can be used to mitigate an effect found in augmented reality systems known as ‘jitter’. In a conventional augmented reality system, a single estimate of the object position is made for each frame, and is used to determine the placement of any virtual augmentation. However, due to variations in lighting, changes in the contrast levels of the target object as it is moved, and noise and quantisation effects in the video capture, the contour estimate of the object is typically slightly inconsistent between video frames. As a result, a virtual object positioned with respect to the target object appears to move or jitter in response to these small variations. This effect has previously been reduced by adding memory to the position estimator, so that the current position estimation is combined with one or more previous estimates to smooth out the variations; however, this has the effect of making the virtual augmentation appear sluggish in responding to actual movements of the target object.

By contrast, in embodiments of the present invention, the plurality of contour estimates for different exposure thresholds of a target object in a single video frame is averaged by determining a best fit to all the different available contour estimates.

The average is performed by grouping the contours over the different thresholds for each target object in the image (e.g. by relative proximity). For each contour group, the set of lines representing each side of the (square or rectangular) objects is subjected to a best fit algorithm to determine an average line. The points of intersection of these best fit lines identify the corners of the “average” contour for the target object. Other best fit algorithms will be apparent to the person skilled in the art for other object shapes.

This best-fit, or averaged, contour is more robust to inter-frame changes in contrast and noise, because it is based upon contours from an effective range of exposures that is wider than the typical inter-frame change in lighting conditions; meanwhile contour changes caused by image noise are largely uncorrelated for different exposures as there is generally no structural correspondence between noise artefacts at different brightness levels, and so average out. As a result, inter-frame jitter is significantly reduced, making the relationship between the target object and the virtual augmentation appear more real to the viewer.

FIGS. 9A and 9Billustrate how a best-fit algorithm replaces a plurality of positional estimates with one average positional estimate. In particular,FIG. 9Aschematically illustrates a set of contours derived from the single image (ofFIG. 6A) using different respective threshold values. Each contour is represented by a set of four lines, with the intersections of these lines being indicated by dots at the corners. Each of the lines is subject to a best fit algorithm as described above, to generate the “average” contour shown as a bold white line (for the outside of the border of the object2010) and a clack line (for the inner edge of the border of the object2010) inFIG. 9B.

It will be appreciated that where conditions in the original image frame are sufficiently adverse that only one instance of a candidate contour pair is found over the plurality of contour images, then the algorithm will use that contour pair directly in place of a best fit or averaged contour.

In step s1020, for the best-fit contour of each candidate object, a homography is computed. In geometry, a homography is a transform that maps one viewpoint to another. In the illustrated case ofFIGS. 7 and 8, this corresponds to a transform that maps the contour to a face-on template of the target object. Typically the mapping is a function of rotation and translation. In conjunction with relative scale with respect to the template, this homography then enables a corresponding rotation, translation and scale of a virtual object to lie directly upon the target object.

Step s1030discards any candidate objects that cannot be made to fit the template to within an adequate level of tolerance, and returns confidence levels for the accuracy of any matches made. The objects are evaluated by using their respective homography to map a reference image of the target object onto the captured image, and then comparing the two; for example by computing a sum of pixel differences (e.g. a sum of absolute pixel differences) over the relevant region of the image. Confidence levels are then determined from this sum of differences. If the sum exceeds a threshold value, then the candidate object is discarded. It will be appreciated that any suitable comparison metric will suffice.

If the contour of the target object is rotationally symmetrical, then in an embodiment of the present invention an asymmetric pattern2031(FIG. 8) is included on the object and step s1030is applied for different orientations of the object. For the square target object illustrated as an example in the accompanying Figures, this will result in step s1030being repeated four times, with the reference image rotated another 90° each time. The rotation with the lowest difference measure (by virtue of comparing pixels of the asymmetric pattern on the object) is then chosen as indicating the most likely orientation of the object.

The final result of step s1030is a confidence measure in the computed homography for each successfully identified target object, and optionally an indication of the orientation of the target object if its contours have one or more planes of symmetry.

In some embodiments of the present invention, the orientation determining process of step s1030is not performed for every frame as it is computationally expensive, whereas it is reasonable to assume that a target object will not rotate by 90° within the 1/30thor 1/60thof a second between image frames.

Referring again toFIG. 4, in an embodiment of the present invention the augmented reality process uses the position and orientation data from the above estimation process to update an unscented Kalman filter. This non-linear version of the Kalman filter provides a continuously updated estimate of the position, orientation, velocity and angular velocity of the target object.

In a step s1110, if the filter has not already been initialised, then the homography associated with the best contour match (highest confidence level) for each target object is used to initialise the filter at a step s1120, and as a further part of the step s1120the filter is then iterated over successive video frames until the filter prediction error converges below a tolerance threshold.

Once the prediction error has reached an acceptable level, a prediction of the position, orientation, velocity and angular velocity of the or each target object is made in a step s1130.

In a step s1140, this prediction is compared with the current position and orientation estimated from the current homography (i.e the output of the step s1030), and in a step s1150the filter is updated (corrected) in accordance with the observations.

Referring now also toFIGS. 10A and 10B, the contour of a target object can often be validly interpreted as having more than one possible orientation, even if the rotation has been correctly determined. However, in general only one of these orientations will be consistent with the observed motion of the target over time. Consequently, in an embodiment of the present invention, the current model built by the unscented Kalman filter is tested at step s1160to determine if an alternative homography (and hence orientation) is more accurate.

In the step s1160, the current state of the filter is stored, along with the current filter estimation error. An estimate of the rotation of the contour derived from the current homography is also stored. The filter is then re-initialised using the new rotation estimate from the homography, whilst keeping the original translation estimate of the filter. Thus in effect the filter is made to ‘forget’ its current rotation model. The filter is then iterated until its error estimate stops changing significantly. If the new estimation error is smaller than the stored estimation error, then the filter keeps the new initialisation; otherwise, it is restored to the stored state.

Once the predicted position, rotation and velocities have been validated in this fashion, this information can be used to position virtual augmentations with respect to the target object. Typically this will take the form of a virtual object appearing to be attached to the target object (e.g. a game character standing on a target object), or can be used to inform the positioning and orientation of a separate virtual object that may or may not be attached to the target object; for example, the positioning and orientation of the target object may be used to position and orientate a virtual railway track, enabling construction of a virtual railway set by the placement of multiple target objects in a room.

In an embodiment of the present invention, in operation the image analysis system is scalable according to performance requirements by altering the number of brightness threshold levels used and hence the number of binary images to analyse. For example, if a system requires a low-latency output (e.g. analysis every 1/60thsecond), a reduced number of brightness threshold levels can be used to reduce latency. This approach can be automated by comparing a target latency with actual latency for the last one (or more) input image, and adjusting the number of brightness threshold levels accordingly. This approach assumes that the complexity of the input image (which is the likely source of variation in latency) will be generally consistent between consecutive input images.

Finally, it will be appreciated that in embodiments of the present invention, elements of the above process and implementations of the operating apparatus may be implemented by the reprogramming of one or more processors within a device such the Playstation 3 games machine. As such, the required adaptation to existing parts of a conventional equivalent device may be implemented in the form of a computer program product comprising processor implementable instructions stored on a machine-readable data carrier or storage medium such as a floppy disk, optical disk, hard disk, PROM, RAM, flash memory or any combination of these or other storage media, or transmitted via data signals on a network such as an Ethernet, a wireless network, the Internet, or any combination of these of other networks, or realised in hardware as an ASIC (application specific integrated circuit) or an FPGA (field programmable gate array) or other configurable circuit suitable to use in adapting the conventional equivalent device.