Project 4Abstract
|
|
|||||||||
Links
|
||||||||||
Method / Pseudo-Code In this project I focused on the sections that deals with the scene with one projector and one camera which I am going to discuss here. In the original paper, the authors also discussed how this scheme could be extended to the scenes with multiple camera/projectors and then could be use in scene relighting. |
|
|||||||||
| The idea here is to exploit Helmholtz reciprocity – the symmetry of BRDF’s. In the simplest form, a photon travels from a light source, say a pixel of a projector, bouncing one or several times and reaches a senor among the array of sensor of a camera. There is a number describes this relationship between the source and the destination. Now the project has pxq pixels, and the size of sensor array of the camera is mxn, for each pair of one from a first group and the other from another, there is such number. All these pxqxmxn numbers together form a big array T. All above can be described as c’ = T p’, as shown in the figure above, where c’ is an array of size mn X 1, T is an array of size mn x pq, and p’ is an array of size pq x 1. |
||||||||||
Brute force method Helmholtz reciprocity tells us p’’ = TT C’’. Intuitively, it means, once we have T we can get P’’, (i.e. the picture) seen by the projector by c’’, (i.e. the camera.) I personally understand it this way. To simulate the picture seen by the projector, we can do the following: set up a black room. Lit only one pixel of the projector. This ray then bounce in the scene full of objects and may defuse reflect…etc. The camera captures part of this ray. When the ray bounce at some place reddish, the energy other than red would be absorbed and thus the array of sensor in the camera gets red light. For the same reason, catching blue light means the surface is blue. Hence, the follow cool demo provided by the authors becomes very intuitive. The camera can not see the face of the playing card. When the ray projected on to the red region of the card the page of the book will be illuminated red, and then be caught by the camera. Projecting many rays in raster order, and the image of king of heart will be generated pixel by pixel in this manner.
|
||||||||||
Adaptive Multiplexed Illumination The problem of the above scheme (brute force) is that it is very time consuming. The reason is T is a huge matrix (say 1024x768x320x240 = 60397977600 entries). The paper proposed a much more efficient method. The idea is that if projecting two rays at the same time and they end not affecting each other, then we can save our time by doing so. “Affecting” means when projecting these two rays separately, the region been illuminated in the camera images do not overlap. This is called “Adaptive Multiplexed Illumination”. The method recursively divide a region of projection into 4 sub-regions. In an illuminating level (divide regions once), all the sub-regions have same figure. And in each lit within a level, all the sub-regions lit do not affect each other. This is achieved by considering two constraints: 1. If two regions don’t affect each other, nor do their children. 2. Any pair the children come from the same region can not be lit together. This is done until the sub-region is 1x1 pixel. |
||||||||||
Here is an example: Example - The numbers indicate the order of the regions to be lit. In the image captured in lit 2 and lit 4 more than one pixel are lit in both rounds, so 2 & 4 are considered to affected each other. Thus, their children could affect. On the other hand children of 2, 3, 5, won’t affect. So, in lit 6, 7, 8, 9 we lit the children of 2, 3, 5, and followed by 10, 11, 12, and 13 which are the children of 4. And when a region lit and contribute nothing, that region no longer need to be lit (no need to sub-divide it into four children) and is culled, as the lower left 9 illustrated in level 3. |
|
![]() |
||||||||
The pseudo-code of this algorithm is: (Provided in the paper, modified and annotated (part) by me) Main Flow: 1.Initialization(); Repeat{
} until lowest level is reached.
Sub-functions 1. Initialization() {
C = empty; // initialize set of conflicts to empty } 2. ConstructConflictFreeLists(){
} 3. AcquireImages(){
} 4. ProcessResults(){
} What I have done I started with adaptive multiplexed illumination, and then switch to brute force method, both failed to get decent result. The reason is also provided below in the next section. The tool I used is C++ / OpenGL and OpenCV APIs. OpenGL was used to show the project pattern and OpenCV takes the camera control part. Adaptive Multiplexed Illumination This is harder than I expected. To figure out the meaning of pseudo-code took me some time. I used arrays of link lists as the data structure for both C and B to have the storage consumption dynamical. However, using link lists makes the search, delete and append to be harder. Most importantly, as in many other image processing applications, the process time and storage amount used need to be take carefully. The memory consumption is big here. A pixel could be affect by several blocks together, and each pixel has a link list recording this. To find conflict pairs we need to go through each of these for several time (finding pairs) the pixel number is on the order of 80000, In extreme cases, when the block size gets smaller and smaller, the length of each list Bk of a pixel could be on the order of (800000) That is 800000*800000 = 64 * 1010integers!!
Here I select some most challenging parts and describe my methods: 1. To do ‘Union’ of link lists Bk,
2. Create lit lists, base on C
3. Number the blocks.
4. Generate Project Pattern
5. Collect conflicts and add to C for next iteration
Brute force method Realizing adaptive multiplexed illumination method failed, I try the Brute force method as well. Using the brute force method, I simply light the blocks of 3x3 in raster order, it takes 5 hours to generate 1/3 of the result, however, the result is too dark, I change to 6x6, and it took 4 hours to generate 1/3 of the result but still failed to get good result. Finally I tried 30x30, which makes the final result only has the size 35x26, can finally get something but it is still very bad. Device Set Up and preprocessing I set up the experiment in a room at TSRB. The project resolution was set to 1024x768 and the camera I used was Logitech Notebook Pro the resolution was set to 320x240. The capture time was very late mid night with all the light near turned off. However, there are still some light pass through the window and from rooms in the distance. The bottle neck of time consumption was the response time of camera. As a result, as describe above it take several hours to get results to be judged. As the paper suggests, before starting I took a floodlit image and subtract it from all the images captured later.
Result
This is the only “ok” result I have gotten so far, with block size 30x30 used the image size is 35x26 pixel2. All the others are too dark. With 3x3 block size or 6x6 block size, the difference between the maximum and minimum pixel value gotten is one or two which is too bad to be shown. This result took about 1 hour. Note this image has been adjusted using photoshop. Discussion (Why failed) In this section, I discuss the general reasons for why the result is not good for both Adaptive Multiplexed Illumination method and brute force method. And this is followed this by some issues applied to Adaptive Multiplexed Illumination only. Camera automatically compensate the light The camera I used like many automatic digital cameras, it adjusts and balances the image automatically which is not desirable in this project. I have change and optimize all the adjustable parameters. But the camera still automatically compensates the light change. For example when the scene change from very dark to mid-level light, the image captured changed from all black to very bright, then back to mid-level. Not totally dark environment As described above, the environment is not totally dark, light permeate through the shutter. And other lights came from room in the distance also make the room not totally dark. Focus of projector The focal length of the project is limited. The object can’t be move too close to the projector. This makes the neighboring pixels affect each other a lot. This is like to applied a blur filter upon the result image. This is one of the main reasons to make Adaptive Multiplexed Illumination didn’t work. Low-resolution camera The camera I used has only 320x240 resolution. However, this should not be a big issue. Since the resolution of the image I tried to generate is decided by the block size and the resolution of projector mainly. Issues about Adaptive Multiplexed Illumination The problem is that the memory consumption is too big to use the code. Only in level 5, the block number is already 16x12 = 192. In the worst case, if all of then affect each other. The C list is already 192 select 2 = 18336 pairs, in level 6, this number is 294528, and there are totally 10 levels to finish. Multiply this number by the pixel number of camera 76800 (this could happened when processing result from Bk to C) the memory consumption explode after only a few level. It is important to discuss how can the worst case happened. The worst case happens if the scene is full of diffusive material such as paper of book cover I was using. The reason is if the scene is diffusive when a ray hit the diffusive surface, it is scattered in to rays along many direction by the surface. These rays later will be caught by many camera sensors. The Adaptive Multiplexed Illumination method save time because it can process the source rays which do not affect each other in the camera image at the same time. When there are lots of diffusion, there are more chances that two light source will affect, i.e. illuminate the same pixel in the camera image. As a result, the worst case happens and memory consumption exploded very quickly. So in my case, I don’t have camera with high resolution, and what even worse it the issue of the focal length of the projector as discussed. Hence, Adaptive Multiplexed method is not practical. Another tricky thing is that: when using Adaptive Multiplexed Illumination, we don’t want diffusive materials to apper in the scene; on the other hand, when using brute force method, diffusive materials is desirable since it makes more light (energy) go to the camera sensor and result in better contrast of the final image.
|
||||||||||
Last update: 2005-12-2
|
||||||||||