scieee AI-readable full text Open interactive document viewer

Depth Inpainting Methods for 3DTV

Sañas Alier, Miquel

Abstract

In 3DTV applications, a large amount of data is transmitted due to the high number of different views. Moreover, to get Fee View Point Video services, usually depth maps are sent together with each view, in what is known as Multiview+Depth (MVD) data. In this project different solutions are developed with the aim of efficiently encode the depth maps and so reduce the bitrate needed.

Full text

1 Master Degree in Telecommunications Engineering Final Project Depth Inpainting Methods for 3DTV Author: Miquel Sañas Alier Directors of the research: Josep Ramon Morros Rubió and Javier Ruiz Hidalgo January 2016 2 Table of contents 1. INTRODUCTION ............................................................................................................4 1.1. Description of the research ....................................................................................5 1.2. Structure of the project..........................................................................................6 1.3. Project Timing .......................................................................................................6 2. GENERAL BACKGROUND ...............................................................................................8 2.1. Free Viewpoint Television (FTV)..............................................................................8 2.2. Stereoscopic vision ................................................................................................8 2.3. Depth maps...........................................................................................................8 2.4. Image segmentation ............................................................................................ 10 2.4.1. Flat zone segmentation ................................................................................ 11 2.4.2. SLIC segmentation ....................................................................................... 11 2.5. 3D planes coding ................................................................................................. 12 2.6. Pinhole camera model ......................................................................................... 14 2.6.1. Mathematical representation ...................................................................... 14 2.7. Camera calibration .............................................................................................. 17 3. STATE OF THE ART ...................................................................................................... 20 4. DESCRIPTION OF THE RESEARCH ................................................................................. 22 4.1. Methods used to estimate ................................................................................... 23 4.1.1. Previous Pixel ............................................................................................... 23 4.1.2. Region Average ............................................................................................ 24 4.1.3. Neighbour Average....................................................................................... 24 4.1.4. Same Region Neighbours .............................................................................. 25 4.1.5. Planes Estimate ............................................................................................ 28 5. RESULTS ..................................................................................................................... 33 5.1. Masks ................................................................................................................. 34 5.1.1. Geometric Shapes ........................................................................................ 34 5.1.2. External Depth Map With Holes ................................................................... 34 5.2. Evaluation process............................................................................................... 35 5.2.1. Peak Signal-to-noise ratio (PSNR) ................................................................. 36 5.2.2. Pixel-by-pixel error ...................................................................................... 36 5.3. Numeric results ................................................................................................... 38 5.4. Analysis of errors ................................................................................................. 46 3 6. CONCLUSIONS AND FUTURE WORK............................................................................. 50 REFERENCES....................................................................................................................... 52 4 1. INTRODUCTION 3D Television or 3DTV became popular among the general public less than 10 years ago and it has stablished as a new technology in the world of television. 3DTV devices sales boosted up in 2012, together with the number of TV channels that offered, some of them exclusively, audiovisual content in 3D [1]. Indeed, broadcasting and electronic companies have always had the necessity to work in coordination with each other through television history. Who would buy a 3DTV device if the television stations didn’t emit in 3D? As occurred at the beginning of commercial television, some electronic companies have invested a large amount of money in the generation of content to make their devices useful to the public. However, short after the boom in 2012, the sales declined and some channels had to close down. There are many reasons that justify this failure, but most studies point out the discomfort of the glasses1 and the health problems that arise2. Since then, the sales have remained stagnant. Nevertheless, new technologies like the ones present in this project suggest that 3D TV is not going to die, but is here to stay. Television technological evolution has been influenced from its beginnings by two related needs: the provision of realism and the reduction of production and emission of signal costs. The need to provide realism, an element really common in cinema too, is due to the will to eliminate the barrier between fiction and reality. The goal is clear: we have to see television as we see reality. The viewer must feel identified with the content that is being emitted, and the main evolution on television technology has been on this way. It’s not a coincidence that the main content emitted in 3DTV is sport events, where the 3D is a good tool to provide a warm atmosphere3. Quality in 3DTV is mainly proportional to the amount of information that has to be transmitted. If the bandwidth was infinite, data would be transported in its raw sequence. Transmission limitations were revealed for High Definition Television (HDTV)4 and are multiplied with 3D technology, where each view has to be transmitted twice, which nearly doubles the amount of data that initially has to be processed. Electronic replaced mechanic television, colour replaced black and white and High Definition was the major revolution in the nineties. The step we are on now is regarding 3DTV and maybe it’s more ambitious that all its predecessors, both for its projection and complexity. 2 Some studies suggest that the use of the glasses produce health problems to 20-30% of the population 3 The first live event in 3D was a football match between Manchester United and Arsenal emitted by Sky Sports in January 2010 5 1.1. Description of the research Depth maps are Greyscale images that contain the information of depth in a 3DTV surrounding. These maps identify how far an object is from the camera, data which is afterwards used to codify the third dimension used in 3DTV. As explained widely in the next chapter, different values are associated to normalized distances of the pixels in the scene. There are numerous ways to obtain the depths maps depending on many variables such as accuracy, environment or distribution of the scene. The complexity of the process to obtain the maps is high and, although the error rate in advanced techniques is low, not all the pixels get an optimal value. Some may be distorted, with a wrong representation of the real depth. Others may not even have a value, resulting in a hole in that position. When that occurs we say the depth map is incomplete or has holes. These errors are usually due to:  Technical limitations: although it has increasingly less impact due to the complexity and accuracy of current algorithms, shortcomings can still provoke errors in obtaining the depth map. Indeed, they have to be detected and corrected.  Physical limitations: occlusions are the most common phenomenon in stereo imaging. In this scene, the physical distance between the two cameras leads to different observations of the same scene. This means that a particular object can be seen from one observation but not from the other. Another important limitation when using sensors to measure depth is the excessive reflection or absorption of some surfaces (see Chapter 2.3). In order to get relevant depth information for the whole scene, these holes need to be filled with a value as faithful to reality as possible. This is done in a process called inpainting5. The goal of this project is to introduce and compare different inpainting methods in terms of efficiency. Some of these methods use the colour image and segmentationbased techniques, while others are applied directly on the incomplete depth map. When segmentation is used, different criterion for the partition are evaluated and compared. The number of regions of each partition is also taken into account for the final analysis, with the aim of determining to what extent these variables have influence on the final result of the estimate. 5 This term is also used in photography and video edition as a process to eliminate certain objects or refurbish damaged pieces. 6 1.2. Structure of the project The content of this memory is structured as explained below: Chapter 2 is dedicated to general background. This introduction includes the necessary explanation of concepts and terms used in the rest of the project that will help for the complete understanding of the research. Chapter 3 describes the state-of-the-art for 3D television and inpainting methods. Some extra information can be found on books and academic papers referred to in Chapter 7. Chapter 4 contains the description of the work done for the research. That includes the different methods that have been used in the inpainting process. Chapter 5 exposes the results after the estimates with different images and masks, with a brief particular conclusion for every group of methods, and a complete description of the evaluation process. Chapter 6 contains the global conclusions reached after the full research and proposes some directions of investigation for future projects. 1.3. Project Timing This project is scheduled to last around 30 weeks considering the work of a single person. The background information needed at the beginning of the research is considered to be the acknowledge acquired by a Telecommunication Engineer at the end of the master degree. All the tasks are described and represented in a Gantt diagram. Task number Description 1 Introduction to 3DTV state-of-the-art 2 Project definition 3 Software acknowledge (C++, Eclipse, etc.) 4 Development of the inpainting methods I 5 Testing of inpainting methods I 6 Development of the inpainting methods II 7 Testing of inpainting methods II 8 Development of the inpainting methods III 9 Testing of inpainting methods III 10 Processes automation 11 Extraction of the results 12 Analysis of the results 13 Writing of the memory 7 TASK W1 W2 W3 W4 W5 W6 W7 W8 W9 W10 W11 W12 W13 W14 W15 W16 W17 W18 W19 W20 W21 W22 W23 W24 W25 W26 W27 W28 1 2 3 4 5 6 7 8 9 10 11 12 13 8 2. GENERAL BACKGROUND 2.1. Free Viewpoint Television (FTV) The research is developed in a real 3D surrounding, what is known as Free Viewpoint Television (FTV) [2]. Realism in 3DTV depends largely on the number of views we get from the object of observation, and FTV technology allows viewing images from different positions. The main drawback is the huge amount of information that has to be transmitted or bitrate, which is impossible to be supported by the transmission systems used nowadays. The solution is to optimize both on production and emission of the signal. Many researches have been based on video processing optimization, and more recently on the usage of virtual images. With this technique, from the information supplied by two cameras and trigonometrical algorithms, a new virtual view can be generated at the midpoint of the axis that links the centre of each camera. This view would be equivalent to having a camera located at the same position. 2.2. Stereoscopic vision Colour information in 3DTV is obtained from two stereoscopic views. As in biologic human vision, two images are projected independently and interpreted as a whole by the brain. In a particular instant, each eye catches an image. These two images are similar but not the same, due to the fact that the eyes are slightly distanced from each other. In an infinitely long distance to the object of observation, the two images would be the same. The longest the distance, the more similar the images will be. In visual computing, depth information has to be coded and is usually transmitted together with each view, in what is known as Multiview+Depth (MVD) [3]. 2.3. Depth maps The depth information in 3DTV is coded in the so-called depth maps. These Greyscale images have the information of the distance between the axis of the camera and the object of observation in a scale from 0 to 255. 0-valued pixels represent points that are the furthest to the camera and 255 the points that are the closest. The depth maps must be the same size as the colour image to have a complete representation. The depth map of the image in Figure 2.2 is shown in Figure 2.1. Figure 2.1 Figure 2.2 9 There are different methods to estimate depth maps. The conventional ones are based on multiple view geometry, reproducing how human binocular system works. However, in the recent years, some novel approaches have arisen. Maybe the most popular is by using time-of-flight6 cameras. These cameras are located at the desired position and emit infrared rays to the object of observation. When the signal is back, the time of travel determines the distance to the object, after which the depth map can be created [4]. Another option is to use structured light [5]. The inexpensive method based on the Kinect [6] has become more and more popular in the recent years. Colour images and depth maps are captured together and from different views. The main drawback for depth inpainting is that depth maps can have some holes due to different optical factors, such as occlusion or reflection. These can be minimized using inpainting methods like the ones introduced in this research. Another way to generate depth maps, though it’s not the most optimal option, is by using the luminance information [7]. Regardless the method used, usually not all the pixels always get a valid value. This means that in some cases the distance between the lens of the camera and the point of observation is estimated wrongly or, in many cases, cannot be estimated. The analysis of these errors is not the case of study in this project. This research departs from incomplete depth maps or depth maps with holes and the goal is to inpaint these gaps using different methods. Once the depth map is completed, all the maps are evaluated and the results within the different methods are compared. To identify the holes, the empty pixels in this project have been set to 255. As consequence, the maximum value to represent the closest distance is 254. The following formula describes how the coding has been done: 𝐷𝑒𝑝𝑡ℎ8𝑏𝑖𝑡𝑠=254∗𝑀𝑖𝑛𝑍∗(𝑀𝑎𝑥𝑍−𝑡) 𝑡∗(𝑀𝑎𝑥𝑍−𝑀𝑖𝑛𝑍) Where: i. minz is the minimum distance to the object of observation (expressed in meters). ii. maxZ is the maximum distance to the object of observation (expressed in meters). iii. t is the current distance to the object of observation (expressed in meters). Note that the values of (2.1) will remain between the two boundaries: 𝐷𝑒𝑝𝑡ℎ8𝑏𝑖𝑡𝑠(𝑡=𝑀𝑎𝑥𝑍)=0 𝐷𝑒𝑝𝑡ℎ8𝑏𝑖𝑡𝑠(𝑡=𝑀𝑖𝑛𝑍)=254 6 Time-of-flight (TOF) describes a variety of methods that measure the time that it takes for a particular wave to travel a certain distance. (2.1) 16 The pinhole camera model is mathematically based on the relation between points Q and P or, in other words, how coordinates (y1,y2) can be represented with coordinates (x1,x2,x3). It can be found with a trigonometrical formula for similar triangles. To represent this relation, it’s useful to see the same system but looking down in the negative direction of axis X2. Both triangles marked in orange and blue have part of the projection line as the hypotenuse. The catheti are represented by sides –y1 and f, and x1 and x3, respectively. As they are similar triangles, it is valid to say that: −𝑦1 𝑓=𝑥1 𝑥3 If we now look in the negative direction of X1, we have an analogue situation and the previous relation can now be written as: −𝑦2 𝑓=𝑥2 𝑥3 X1 X3 X2 P Q (2.2) (2.3) 17 Mixing equations 2.2 and 2.3, we can get to the following formula: (𝑦1 𝑦2)=−𝑓 𝑥3(𝑥1 𝑥2) Which finally shows the relation between point Q (y1,y2) and point P (x1,x2,x3) in the same plane. In view of the results, we have a perspective projection and a 180 degrees rotation, both in the same image. This last rotation justifies what has been mentioned in the introduction of this chapter: images from a pinhole camera are projected inverted. The projected image size depends on the focal length or, in other words, on the distance between axis X1 and the image plane. However, the size of the projected objects depends on the distance they from the focal point (point O). 2.7. Camera calibration Camera calibration (or camera resectioning) is a process used to estimate the parameters of a pinhole camera model for an input image. These parameters are represented in a 3x4 matrix called camera matrix.  Camera matrix The camera matrix is used to denote a projective mapping from World coordinates to Pixel coordinates. If we set X as a 3D point in homogeneous coordinates and Y as its representation in the pinhole camera, the following relation holds: y~Cx We now have to get the relation for the pinhole camera model described above in the document: (y1 y2)=fx3(x1 x2) Where (x1, x2, x3) represent the 3D coordinates of a point, (y1, y2) the resulting image coordinates and f the camera’s focal length. If we express all the coordinates in a homogeneous system: (y1 y2 1)=fx3(x1 x2 x3 f)~(x1 x2 x3 f)→(y1 y2 1)~(1 0 0 0 010 0 001f0)(x1 x2 x3 1) This last relation can now be compared to y~Cx. As C is a projective element, the camera matrix can be expressed as: C=(1 0 0 0 0 1 0 0 0 0 1f0)~(f 0 0 0 0 f 0 0 0 0 1 0) 18 With the coordinates system chosen, this camera matrix has few non-zero elements. In practice, some of the camera matrices used are much more complex. After defining the camera matrix, with vector [𝐱𝐰𝐲𝐰𝐳𝐰𝟏]𝐓 representing a 3D point in World coordinates, the model for camera calibration is the following: zc[uv1]=A[R T][xw yw zw 1] We can distinguish between intrinsic (A) and extrinsic (R and T) parameters:  Intrinsic parameters (A) A=[αxγ u0 0 αyv0 0 0 1] Where: i. 𝛼𝑥 and 𝛼𝑦 are the focal lengths in pixels. 𝑚𝑥 and 𝑚𝑦 are called scale factors and relate pixels and distance and 𝑓 is the focal length in distance. αx=f.mx αy=f.my ii. 𝛾 is the skew coefficient between axis X and Y (it is often 0). iii. u0 and v0 represent the principal point (ideally in the centre of the image). Some other intrinsic parameters, such as lens distortion, are nonlinear and cannot be included in this camera model.  Extrinsic parameters (R and T) Extrinsic parameters are used to transform 3D World coordinates to 3D camera coordinates. They define the position of the camera centre and the camera’s heading in World coordinates: T: position of the origin of the World coordinates (expressed in coordinates of the camera-centered coordinate system). 19 C: position of the camera expressed in World coordinates. C=−R−1T=−RTT, where R is the rotation matrix7. Each shaft of light from the scene is represented by a pixel on the image plane. Camera calibration sets the correspondence between light and pixels on the resulting image. A projection matrix is enough for an ideal pinhole camera, but a more complex system is needed in non-ideal systems. In these cases, errors resulting from misaligned lenses and deformations in the structure make it difficult to define the distortion in the final image. 7 A rotation matrix is a matrix used in linear algebra to perform a rotation in Euclidean space. For example, the following matrix rotates clockwise x,y points in a Cartesian plane an angle θ: 𝑅=[𝑐𝑜𝑠θ −𝑠𝑖𝑛θ 𝑠𝑖𝑛θ 𝑐𝑜𝑠θ] The position of the initial point is represented by vector a, and the output is represented by vector b: 𝒃=(𝑏1 𝑏2)=𝑅𝒂=[𝑐𝑜𝑠θ −𝑠𝑖𝑛θ 𝑠𝑖𝑛θ 𝑐𝑜𝑠θ](𝑎1 𝑎2) Rotation matrices are used to provide a numerical representation of an arbitrary rotation of the axis without appealing to angular specification. That’s the usual way to express the orientation of a camera. The local X, Y and Z axes are expressed numerically as three direction vectors, which comprise the columns of the rotation matrix. 20 3. STATE OF THE ART Inpainting is a well-known process in digital image and has been the focus for numerous researches in the field of image processing. Although a lot of investigation has already been done during the last years, there’s still a latent need to find the best methods to give a value to a pixel and make it as reliable as possible. This research is really relevant in 3D Television, especially in a Free Viewpoint environment, where the major constrain is the amount of data that has to be transmitted. In this situation, it’s vital to have algorithms that estimate pixels in the most accurate way and prevent this information from being transmitted. Bertalmio, Sapiro, Casellas and Mallester [15] propose a method that uses information of the pixels values along isophote8 directions. Unlike other approaches, where lines to indicate the direction of propagation have to be draw, this technique does not require the user to specify where to take the information from. However, the user has to indicate the area that has to be inpainted. An improved version of this algorithm was published three years later by Bertalmio, Vese, Sapiro and Osher [16]. This technique adds synthetic texture to the infilled regions. Another algorithm without texture [17] bases his research on the Fast Marching Method9. Criminisi, Pérez, and Toyama [18] propose a novel algorithm to fill big holes left after removing large objects using an inpainting approach. The results obtained in terms of PSNR are slightly under 30dB. The novelty of this research is the combination of texture synthesis algorithms and inpainting techniques. Previously, texture synthesis algorithms were mainly used for generating large image regions from sample textures and inpainting techniques were left for filling small holes. These last are based on linear structures that can be thought as a one-dimensional pattern, such as lines and contours. The goal of this algorithm is to combine the advantages of both approaches to fill big holes. Hays and Efros [19] propose a technique to patch up holes in images by finding similar image regions in the database that are semantically valid. The limitation of this approach is that a database is needed. The authors argue that, while the space of images in effectively infinite, the space of semantically differentiable scenes is limited. Unlike the algorithm described in [15], this one does not require labelling by the user. Indeed, it generates many sets of results so that the user can chose among them. This technique computes the gist of each image [20] to find images with similar colours and composition. It then runs a graph cut algorithm that minimizes image gradient 8 Points of equal brightness 9 The fast marching method is a numerical method for solving boundary value problems of the Eikonal equation: 𝐹(𝑥)|⋁𝑇(𝑥)|=1 21 differences and composites the new replacement piece into the original image using Poisson image blending [21]. Other approaches use colour inpainting to be filled together with depth maps, what is known as stereoscopic inpainting. One example is Wangy, L., Jinz, H., Yangy, R. and Gongx, M. [22]. They use a depth-assisted texture synthesis technique that fills depth and colour at the same time. Qi,F., Han, J. [23] propose a novel fusion based inpainting method to complement depth maps by incorporating colour information. This strategy integrates conventional inpainting with the recently developed non-local filtering scheme. A different approach is the one introduced by Ming, L., Wen, C. and Wen, C. [24]. They propose a novel conformal geometry-based approach to inpaint holes on a Riemann surface [25]. The Riemann surface is represented by its conformal facture and mean curvature10, which can be easily computed through its conformal parametrization. Thus, the problem of surface inpainting can be reduced to the problem of image inpainting of the conformal factor and mean curvature on the conformal parameter domain. A lot of research has also been done to improve the quality of the segmentation by recognizing certain structures in a 3D scene. Criminisi, A., Reid, I. and Zisserman, A. [26] introduce a method that detects vanishing points from a first draw of basic structures made by the user. Hoeim, D., Efros, A. and Hebert, M. [27] propose a system that uses a variety of classifiers and statistics learned from labelled images and they classify each pixel as either ground, vertical or sky. They start by computing superpixels and they group them into regions that share similar geometric labels. Once the pixels are labelled, the boundaries between the vertical and the ground pixels can be used to infer 3D lines. These lines allow then the image, after removing the sky, to be folded into a “pop-up”. 10 According to Riemann surface theory, a Riemann surface can be uniquely determined by its conformal factor and mean curvature up to a rigid motion. 22 4. DESCRIPTION OF THE RESEARCH Depth information is the third dimension in a 3DTV environment. Indeed, it has to be obtained and coded in order to be transmitted to the receiver through a communication system. Depth maps are Greyscale images in which each pixel contains information of the distance between the 3D coordinate in the real world and the lens of the camera. Depth maps can be obtained using different techniques (see chapter 2.3) as convenient depending on the location and the tools available. The result is an image with coded values that rise from 0 to 255, where 0 represents the coordinates that are the furthest from the camera’s lens and 255 the ones that are the closest. Both technical and physical limitations of the techniques used for the coding of the depth maps can result in errors such as occlusions, reflection and absorption effects or imprecision of the algorithms. All these errors should be identified and corrected in order to be able to transmit reliable depth information. However, the detection of these incorrect pixels is not part of the research. This project proposes different techniques to estimate the depth value for a pixel that has been identified as incorrect. Figure 4.1 shows a depth map in which some of its pixels haven’t been estimated. Pixels that have not been estimated in the depth map are coded with value 255. This means that, in this research, the maximum value (representing the closest distance from a certain 3D world coordinate to the lens of the camera) is not 255 but 254. Thus, the interval of the coded values in the depth map ranges from 0 to 254. Some of the methods detailed further on in this chapter require the information of the colour image. A commonly used depth inpainting approach is to take advantage of the similarities between contours in colour image and its respective depth map. These techniques require the partition of the colour image, which is then overlaid on the depth map. Figure 4.2 shows the partition of a colour image (a) with 100 regions (b) and its projection into a depth map with holes (c). Figure 4.1 23 4.1. Methods used to estimate The five methods that have been developed (Previous Pixel, Region Average, Neighbour Average, Same Region Average and Planes Estimate) are based on different approaches to the inpainting issue. The Planes Estimate method is the most innovative approach and so the one that has been used as reference in the research. The goal is to fill all the pixels of the depth map after the estimation. Some of them use techniques that estimate the values only taking into account pixels on the same depth map, while others require the partition of the colour image as input data. 4.1.1. Previous Pixel Each hole is filled with the value of the pixel right next to it. This method is based on a full scan of the image where in each iteration the value of the pixel is saved to afterwards be inserted into the next one. Figure 4.1b shows the estimated depth map after computing this method on the incomplete depth map in Figure 4.1a. (c) (b) (a) Figure 4.1 24 This first method requires simple computation and is useful when the unfilled areas are small. However, an important drawback is that the holes next to the border of the image are not properly estimated. There is also an unlikely event that has been taken into account. As this method is memory dependent and fills the gaps with previously saved values, there is no information kept in the first iteration. If this initial pixel hasn’t been estimated, the method fills it with value 128. 4.1.2. Region Average The holes are filled with the average value of the pixels in the region. The segmentation is computed on the colour image but applied on the depth map. The calculation of the average has been done excluding the blanks. Figure 4.2b shows the estimated depth map after computing this method on the incomplete depth map in Figure 4.2a. 4.1.3. Neighbour Average The holes are filled with information from the pixels next to them. The value of every neighbour is found independently on the four directions following a 4-connectivity criterion. The distance between the 255 pixel and the first pixel with depth information on every direction is also obtained. Afterwards, each value is pondered by the Figure 4.1b Figure 4.1a Figure 4.2b Figure 4.2a 25 distance, giving more representation to the pixels which are closer to the hole. Figure 4.3b shows the estimated depth map after computing this method on the incomplete depth map in Figure 4.3a. The method described is the final approach and the one with the best results. However, some experiments had been previously done with these simpler approximations: o Calculating the arithmetic average only with the pixels located at distance one from the hole, and excluding 255 values. o Calculating the arithmetic average from distance one until a valid value (different than 255) was found. The iterations were not independent on every direction, what meant that, in some cases, the calculation was only based on the value found in a direction. 4.1.4. Same Region Neighbours This method follows a similar approach to Neighbour Average, but introduces the partition of the colour image. The algorithm follows a 4-connectivity neighbouring criteria to obtain the closest valid pixels on each direction, as long as they belong to the same region. Then, the holes are filled with the weighted average of these pixels. The algorithm is iterative until a valid pixel is found beyond the boundaries of the image. Figure 4.4b shows the estimated depth map after computing this method on the incomplete depth map in Figure 4.4a. Figure 4.3b Figure 4.3a 32 value. However, if we compare it with the original depth map with holes (Figure 4.14a), the blanks have decreased notoriously. After obtaining this new depth map, still with some holes, any of the previous methods explained in this chapter can be used as inpainting technique. Considering the fact that the segmentation has already been done, a good option is to use a simple methods in terms of computational cost. In this research, the results have been obtained with Neighbour Average. Figure 4.14c Figure 4.14b Figure 4.14a 33 5. RESULTS The depth inpainting methods developed in this research have to be applied on a depth map with holes. In the output of the system, these empty pixels will be filled with an estimated value, following a certain criterion depending on the method used. In this research, the evaluation of the methods has been done on depth maps with holes created artificially. Binary masks have been computed in order to strategically locate the holes. These masks are overlaid on the completed depth map (Figure 5.1) to create new holes in the same depth map (Figure 5.2). In the obtained depth map, the holes have been coded with value 255. Consequently, the value that represents the closest distance of the depth map is 254, while 0 represents the furthest. The original depth map is used as ground truth to evaluate the system and extract results. All the values have been obtained with two views taken from Undo dancer synthetic sequence11 (Figures 5.3 and 5.4). 11 Undo Dancer is part of the Nokia’s 3D video coding test sequences. Figure 5.3 Figure 5.4 Figure 5.2 Figure 5.1 34 Two different masks have been designed to be afterwards overlaid on the complete depth map. Each of them has different number of non-estimated pixels and the location on these holes differs from each other. The goal is to analyse to what extend these variables have effect on the final well-running and efficiency of the estimation methods. 5.1. Masks The masks used for the mentioned purpose have only two possible values: 0 and 255. Pixels with value 255 on the mask are overlaid on the depth maps. The location of these pixels on the mask hasn’t been chosen randomly, but making it relevant for the results to be compared. 5.1.1. Geometric Shapes This mask contains rectangular objects of different sizes distributed along the image: This mask has been created artificially with rectangles of different sizes along the image. This distribution allows comparing the results depending on the shapes, sizes and position of the holes. 5.1.2. External Depth Map With Holes This mask is taken from an external depth map with holes. That is, a depth map of another image from which the distance has not been estimated for every pixel: Figure 5.5 35 The distribution of the errors, which provides the shape of the blank areas, obeys to a logical pattern, as it’s taken from a real depth map. 5.2. Evaluation process The main evaluation elements that have been used are based on the comparison between the original depth map (a ground truth depth map with no holes) and the depth map after applying the methods. As an example, Figure 5.7b shows the visual result when estimating the depth map on Figure 5.7a with Region Average method. The reader can visually get an idea of how good the estimate is by having a look at both images. Some areas of the depth map are better estimated than others, a phenomenon that usually agrees to its geometrical pattern. Regarding numerical results, the PSNR (5.1) between both depth maps is the main figure that has been considered. These numerical results have been compared in function of the method used and other intrinsic parameters such as the type of segmentation, the number of regions and the number and location of the holes in the depth map. Finally, the computational cost is also taken into account for the results as a measure of efficiency of the method. Figure 5.6 Figure 5.7a Figure 5.7b 36 5.2.1. Peak Signal-to-noise ratio (PSNR) The Peak Signal-to-noise ratio (PSNR) measures the ratio between the power of a signal and the power of the noise associated to this signal. In digital coding, it is used as a measurement for loss of quality after a compression. The PSNR can be expressed as:                  MSE MAX MSE MAX PSNR I10 2 10 log20log10 Where:  MAXI is the maximum value of the pixels in the image. In 8-bits coding, this maximum is 255. In this case, typical PSNR values go from 30 to 50dB.                  MSE MSE PSNR 255 log20 255 log10 10 2 10  MSE is the Minimum Square Error and M and K are the two images, both of size AxB. The MSE is defined as the normalized summary of the quadratic distance between pixels:       1 0 1 0 2 ),(),( 1A i B j jiKjiM AB MSE If the two images were identical, the MSE would be 0. 5.2.2. Pixel-by-pixel error The Pixel-by-pixel error computes the normalized logarithm of the difference between two images and is given by: )max(255 log10 e BA Error    Where A is the estimated image, B the original image and e the array that contains the differences on values of pixels located at the same position. A and B must be images of the same size. Considering that the dimensions (in pixels) are maxX and maxY, the array can be expressed as:      X x Y yyxyx BAe max 1 max 1,, 2 (5.1) (5.3) (5.2) 37 An external image C is used to visually show the difference between images A and B and appreciate where the main errors are physically located. For each coordinate in image C, the difference of values between A and B is computed. As consequence, the brighter pixels show the coordinates where the difference of values between the two images is bigger or, in other words, where the error is greater. As an example, the difference between the original depth map without holes (Figure 5.8) and the estimated depth map (Figure 5.9) is shown in Figure 5.10: Figure 5. 8 Figure 5.9 Figure 5.10 38 5.3. Numeric results The results obtained not only depend on the inpainting method applied, but also on other factors like the segmentation criteria and the overlaying mask used. The segmentation criterion is determined with the type of segmentation (FlatZone and SLIC) and the number of regions. The number of pixels that have not been estimated, together with the size of the holes, is different for every mask. Results are detailed on a wide way, taking into account all these factors in order to reach the conclusions explained in next chapter. For simplification, from now on the naming for the different methods will be the following: Previous Pixel -> PP Region Average -> RA Neighbour Average -> NA Same Region Neighbours -> SRN Planes Estimation -> PE The most relevant PSNR results are shown below, grouped by its different methods and then analysed as a whole. The PSNR values have been calculated with the average MSE (4.2) of the two views selected from the Undo dancer sequence.  Non-segmentation methods evaluated with External depth map with holes (Mask 1) and Geometric shapes (Mask 2): MASK PP (dB) NA (dB) 1 32.1278 43.7473 2 49.66835 53.2028 39  NA is much better that PP. The difference between results is much wider with Mask 1 (around 17dB) that with Mask 1 (10dB).  Both methods have better results with Mask 2.  Segmentation methods evaluated with External depth map with holes mask: SEGMENTATION REGIONS RA (dB) SRN (dB) 1000 47,24025 48,51365 FlatZone 2000 47,2662 48,10535 5000 47,3512 47,48305 10000 48,01635 46,8215 1000 46,99655 48,9577 SLIC 2000 46,8839 56,91505 5000 45,8486 45,83655 10000 45,69765 45,32785 0 10 20 30 40 50 60 PP NA Mask1 Mask2 40  The best result obtained is with SLIC segmentation, 2000 regions and SRN method (56,91505dB).  Increasing the number of regions improves the PSNR only up to a certain number, after which it drops down again.  SNR provides slightly better results with SLIC segmentation, whereas when using RA method the results are slightly better with FlatZone.  Segmentation methods evaluated with Geometric shapes mask: SEGENTATION REGIONS RA (dB) SRN (dB) 1000 53,2143 50,35025 FlatZone 2000 52,52705 48,05355 5000 53,631 55,08095 10000 53,3077 53,6961 1000 52,13715 54,11675 SLIC 2000 53,04965 53,7351 5000 53,08715 53,59535 10000 52,74695 53,2346 0 10 20 30 40 50 60 FZ1000 FZ2000 FZ5000 FZ10000 S1000 S2000 S5000 S10000 RA SRN 41  The best result is obtained with FlatZone segmentation, 5000 regions and SRN method (55dB).  When using a large number of regions, both methods (RA and SRN) tend to a similar result (around 53dB).  Unlike other situations, there’s only a slight difference between results obtained with RA and SRN. The widest difference is only 4 dB when using FlatZone segmentation with 2000 regions.  The results for the SRN method don’t follow a defined trend in function of the number of regions.  The results with SRN are generally better than with RA. 44 46 48 50 52 54 56 FZ1000 FZ2000 FZ5000 FZ10000 S1000 S2000 S5000 S10000 RA SRN 48 The same location can be identified in the overlaid partition on the depth map (Figure 5.15). The white contour describes the edges of the regions and the black circumference surrounds the exact position of the analysed area. There is no valid value in any of the 4-connectivity neighbouring, as the closest pixel different to 255 is located in another region. In Label 2, the overlaid partition of the colour image (Figure 5.16) shows that there is a fine line of 255 pixels on the horizontal axis. This means that no valid pixel can be found on these directions. Indeed, the closest pixel in the vertical positive axis (Figure 5.17, marked with a black circle) is located in another region. The same conclusion can be reached after the analysis of Label 3. Figure 5.16 Figure 5.15 49 A second example is regarding Planes Estimate technique. Unlike other approaches, the worst results are obtained with the highest number of regions. When this technique is applied to Geometric Shapes mask and the segmentation is done with FlatZone and 10000 regions, the PSNR obtained is around 44dB. However, when the initial partition is computed with 1000 regions, the PSNR achieved is 60dB. The reason for this difference is intrinsic in the computation of the initial partition. Figure 5.18 shows the depth map after the projection of the planes into the 2D space. From the original partition of the colour image into 10000 regions, more than 10% of them (1110) have less than 20 pixels different to 255. As it has been explained in chapter 4, these regions have been excluded from the projection. This has been done by setting all the pixels to 255. Although this action is necessary to make the system work (it fails when a region has few pixels), all the information provided by these pixels is lost. That leads to a remarkably lower PSNR in comparison to other methods, or even the same method but with fewer regions. Figure 5.17 Figure 5.18 50 6. CONCLUSIONS AND FUTURE WORK The complexity of the inpainting method used has proved to be determinative on the result of the estimation. The simplest technique used in the research (Previous Pixel) leads to average results below 11dBs in comparison to other methods. However, it’s important to state that the size of the holes has also a remarkable effect. Using this same method, results are much better when using External depth map with holes rather than Geometric shapes. That’s because pixels on the border (on the edge with pixels with a value) values are easier to estimate. On the contrary, the most isolated pixels are harder to get an estimated value. The impact of the size of the holes is higher than other factors, like the total amount of pixels that have not been estimated or the shape of the holes. In other words, with the same number of blank pixels, estimates can be better if they are spread along the image. However, by the nature of the generation of the holes, these are usually distributed in bunches of pixels and distributed irregular along the image. In these cases, it’s necessary to resort to more complex methods, where texture is reconstructed taking into account the position of the pixels. In a step below methods that use the partition of the colour image, Neighbour Average is a good and simple approach when segmentation is not used. Results are a little below segmentation methods, but its computational simplicity makes it a good option. For example, when using External depth map with holes mask, we get a PSNR of 43,75dB. Using segmentation, some of the values are below this milestone (e.g. with Planes Estimate using FlatZone segmentation and 10000 regions in the original partition the PSNR is 38,7833dB). Methods that use segmentation have proved to provide the best estimations in terms of PSNR. Colour image can provide really valuable information for depth inpainting. That’s the reason why, as explained in Chapter 3, colour information is taken into account in numerous of the most recent researches. For example, with External depth map with holes mask and SLIC segmentation with 2000 regions, the best result with non-segmentation methods is 43,75dB and corresponds to Neighbour Average method. When using segmentation, the value rises to 56,91505dB with Same Region Neighbour method and SLIC segmentation with 2000 regions. Estimation based on 3D planes has been proved to be the best option in terms of PSNR. The two highest results (when using Flatzone and Slic segmentation with 1000 regions, both of them 64,54dB) have been obtained when this technique has been used. Thus, it’s only a first step of the estimate, as only some pixels are estimated after the projection of the planes. Other methods are needed to fill the missing pixels, what leads to a multistep system. This fact makes the algorithm a bit more complex in terms of computation and may not be useful when simplicity is needed. There haven’t been conclusive results to determine which of the two types of segmentation analysed, FlatZone and SLIC, leads to better results. Both techniques 51 strongly depend on the number of regions. Results show that the PSNR increases together with the number of regions, but in most cases only up to a certain value. From this peak, the PSNR decreases again. Regarding the type of mask used, the estimate is better when the holes are focused on specific point of the image (represented with Geometric Shapes mask) rather than when they are spread along the image without any pattern (represented with External Depth Map With Holes mask). The average result when using the first mask is 43,31dB, and rises to 53,97dB with the second one. This leads to an average difference of over 10dB. Consequently, this research has proved that the location of the holes largely determines the effectiveness of the methods and approaches used. Further investigation could not only be focused on inpainting methods themselves, but on finding behavioural patterns on the distribution of holes in the depth map. This information would be used to choose among the different approaches available. 52 REFERENCES [1] Yonhap News Agency (March 2013) 3D TV-sales growth, on globalpost.com [2] Tanimoto, K. FTV (Free-Viewpoint TV) in Intelligent Multimedia Communication: Techniques and Applications [3] Zhang, J. (2012) Research on Multi-View Video Plus Depth Coding Based on Network Bandwidth in Procedia Engineering [4] Iddan and Yahav (2001) Videometrics and Optical Methods for 3D Shape Measurement (Proceedings of Spie) [5] Scharstein and Szeliski (2003) Image-Based Rendering in the Gradient Domain [6] Smisek, J., Jancosek, M., Tomas Pajdla (2013) 3-D with Kinect in Consumer Depth Cameras for Computer Vision. [7] Weik, S. (1997) Registration of 3-D partial surface models using luminance and depth information in International conference on Recent Advances in 3-D Digital Imaging and Modeling, Ottawa (Canada) [8] Zhenguo, L., Xiao-Ming, W., Shih-Fu, Chang, Segmentation Using Superpixels: A Bipartite Graph Partitioning Approach [9] Crespo, J., Schafer, R.W, Serra, J., Gratin, C., Meyer, F. (1997) The flat zone approach: A general low-level region merging segmentation method in Signal Processing, pages 37-60 [10] Achanta, R., Shaji, A., Smith, K., Lucchi, A., Fellow, P.F. and Süsstrunk, S. (2012) SLIC Superpixels Compared to State-of-the-Art Superpixel Methods in Pattern Analysis and Machine Intelligence , pages 2274-2282 [11] Likas, A. (2003) The global k-means clustering algorithm in Pattern Recognition [12] Maceira, et al. (2015) Region-based Depth Map Coding Using a 3D Scene Representation in IEEE International Conference on Acoustics, Speech and Signal Processing, Brisbane (Australia) [13] Gong, H., Shi, J. (2011) Conditional Entropies as Over-Segmentation and Under- Segmentation Metrics for Multi-Part Image Segmentation [14] Salembier, P. and Garrido, L. (2000) Binary Partition Tree as an Efficient Representation for Filtering, Segmentation and Information Retrieval in Image Processing, pages 561-576 [15] Bertalmio, Sapiro, Casellas and Mallester (2000) Image Inpainting 53 [16] Bertalmio, Vese, Sapiro and Osher (2003) Image Filling-In in a Decomposition Space in Image Processing, pages 883-885 [17] Telea (2004) An Image Inpainting Technique Based on the Fast Marching Method [18] Criminisi, Pérez, and Toyama (2004) Region Filling and Object Removal by Exemplar-Based Image Inpainting [19] Hays and Efros (2007) Scene Completion Using Millions of Photographs [20] [16] Oliva, A. and Torralba, (2006) A. Building the gist of a scene: the role of global image features in recognition [21] Perez,P., Gangnet, P., Blake, A. (2003) Poisson Image Editing [22] Wangy, L., Jinz, H.,Yangy,R. and Gongx,M. (2008) Stereoscopic Inpainting: Joint Color and Depth Completion from Stereo Images in Computer Vision and Pattern Recognition, pages 1-8 [23] Qi,F., Han,J., Wang,P., Shi,G. and Li,F. (2013) Structure guided fusion for depth map inpainting in Pattern Recognition Letters, pages 70-76 [24] Ming, L., Wen, C. and Wen, C. (2013) A Conformal Approach for Surface Inpainting in Journal of Inverse Problems and Imaging, pages 867-884 [25] Donaldson, S.K. (2004) Riemann Surfaces [26] Criminisi, A., Reid, I. and Zisserman, A. (2000) Single View Metrology [27] Hoeim, D., Efros, A. and Hebert, M. (2005) Putting Objects in Perspective