Sensing the presence of others in a work environment
Transcription
Sensing the presence of others in a work environment
Sensing the presence of others in a work environment Design and implementation of an awareness system: SIBO (Sign-In Board Online) María Luisa García Rafael August 14, 2001 2 Abstract In many workplaces it is important to know who is around at the moment. Awareness information is always required to coordinate group activities. This thesis presents a new sensor-based awareness system for providing information about presence. The new system, Sign-In Board Online (SIBO), allows users to get info rmation of a physical Sign- in board through video images. The sign- in board contains markers that are tracked by a web camera. Image processing is used to find out where the markers are (in, temporarily away, away). The results are displayed in a web application. The thesis also contains an overview of awareness systems and their potential social implications. Sammanfattning Svensk titel: Att känna närvaron av andra på en arbetsplats - Design och implementation av ett awareness-system: SIBO (Sign-In Board Online) På många arbetsplatser är det viktigt att veta vilka som är närvarande för tillfället. Sådan information ”awareness-information” är nödvändig för att koordinera aktiviteter i en arbetsgrupp. Denna rapport presenterar ett nytt, sensorbaserat system för att ge information om närvaron i en grupp. Det nya systemet, Sign- in Board Online (SIBO), ger användare tillgång till information från en fysisk närvarotavla via videobilder. Närvarotavlan innehåller markörer som identifieras av en webbkamera. Bildbehandlingsmetoder används för att ta reda på markörernas läge (Inne, Tillfälligt ute, Gått för dagen), och resultatet visas i en webbapplikation. Rapporten innehåller också en översikt av awareness-system och deras potentiella sociala implikationer. 3 4 Resumen Título en español: Sintiendo la presencia de otros en un entorno de trabajo: diseño e implementación de un sistema “awareness”. SIBO (Sign-In Board Online). En muchos lugares de trabajo es importante saber quien está o no en cada momento. Información “awareness” es siempre requerida para coordinar las actividades dentro de un grupo de trabajo. Esta tesis presenta un nuevo sistema desarrollado en IPLab que permite a los usuarios obtener información sobre la presencia o no de los distintos miembros del departamento. El nuevo sistema, llamado Sign-In Board Online (SIBO), proporciona información “awareness” de un tablón de registro mediante imágenes de video proporcionadas por una cámara web. El tablón de registro contiene un marcador para cada miembro del departamento. Resulta necesario el procesamiento de estas imágenes para averiguar en que posición se encuentran tales marcadores: dentro, temporalmente fuera, fuera. Los resultados obtenidos son visualizados en una aplicación web. Esta tesis también contiene un resumen de los sistemas “awareness” y de sus posibles implicaciones sociales. 5 6 Preface Many thanks to my examiner and supervisor professor Kerstin Severinson Eklundh for giving me the opportunity to do the Master’s project at the Interaction and Presentation Laboratory (IPLab), NADA, KTH, for her patience and support and willingness to give up precious time for our meetings. Special thanks to Staffan Romberger for his invaluable support and help. Thanks to professor Jan-Olof Eklundh at the Computational Vision and Active Perception Laboratory (CVAP), NADA, KTH, who gave me valuable advice with regard to the image processing part of the Master’s project. Also thanks to Tessy Cerrato for many helpful comments. I want to thank my family and friends who put up with me, support me and helped me to achieve this goal. Finally, I would also like to thank my workmate in this Master’s project Carlos de Frutos for everything. 7 8 Contents 1 Introduction………………………………………………………………….. 11 1.1 Background………………………………………………………………. 1.2 The focus of the thesis…………………………………………………… 1.3 Outline……………………………………………………………………. 11 11 12 2 Related work…………………………………………………………………. 13 3 Existing system: Sign-in board……………………………………………... 15 3.1 System description……………………………………………………….. 3.2 Problems with the sign- in board…………………………………………. 3.3 The @work system………………………………………………………. 15 16 16 Proposed system: Sign-in board online (SIBO)……………………………. 18 4.1 System description……………………………………………………….. 4.1.1 Characteristics……………………………………………………. 4.1.2 Objectives………………………………………………………... 4.2 Image processing………………………………………………………… 4.2.1 Thresholding……………………………………………………... 4.2.2 General problems………………………………………………… 4.3 Design and implementation……………………………………………… 4.3.1 How to add people to SIBO……………………………………… 4.3.2 How to remove people from SIBO………………………………. 4.4 System interface design………………………………………………….. 4.5 Technical requirements…………………………………………………... 4.5.1 How the web camera was installed………………………………. 4.5.2 Accessing a Unix account from Windows 98……………………. 4.6 Impact of proposed system………………………………………………. 18 18 19 19 20 26 28 28 29 29 33 34 34 34 5 Results………………………………………………………………………... 35 6 Discussion and fut ure work…………………………………………………. 36 7 Conclusions…………………………………………………………………... 37 4 Bibliography Appendix 1: SIBO system Appendix 2: SIBO Matlab code 9 10 1 Introduction 1.1 Background Awareness is defined as an understanding of activities of others, which provides a context for your own activity. This context is used to ensure that individual contributions are relevant to the group's activity as a whole, and to evaluate individual actions with respect to the whole group and its goals. Awareness information is always required to coordinate group activities. In many workplaces it is important to know who is around at the moment. This is a well-known problem for researchers in computer-supported cooperative work (CSCW). In order to carry out collaborative activities, awareness about what others are doing may be essential. In an ordinary office, people can often get this information in very simple ways, e.g. by leaning out in the corridor when hearing the footsteps of another person, or by noticing that someone's door is partly open. This is more difficult to achieve when people are distributed in different locations. However, one may consider different kinds of computer support for finding out people's whereabouts. Some of them require active participation from the users, such as calendar systems, or the web-based awareness system @work, developed at IPLab (The Interaction and Presentation Laboratory) in the 90's. Other systems collect information about users automatically without their contribution (such as a camera mounted at the entrance door) or with only a passive contribution from them (such as carrying a barcode device which registers their location). The various methods for achieving awareness have different technical aspects, and require knowledge of different fields. But they also have different implications for participants' integrity, and they are likely to meet different levels of acceptance from the potential users. 1.2 The focus of the thesis Computers are increasingly embedded in the environment of their users, to provide ubiquitous support for their activities. Moreover, these systems are more often than previously designed to use sensors, e.g. cameras, to capture information about users’ context. As a basis for an awareness system, I will consider analysing a camera image of IPLab’s sign- in board. This board is located at the entrance door. The board contains different fields for each person: In, Temporarily Away, Away. People move their marker to the corresponding field when arriving or leaving IPLab. There is also possibility to write a message in the field Away. This Master’s thesis reports on the construction of a sensor-based awareness system at IPLab. For this I will use camera images of the sign- in board in order to try to identify the whereabouts of a person. Finally, this awareness information can be seen directly from the Web. 11 I have followed these steps for the design of the system: - Install a web camera in front of the sign- in board. The camera takes photographs once every two minutes. Is it important that the camera is not moved. - Study conditions, mainly illumination, where the system works better. The bad illumination brings about mistakes in the system due to shadows and darkness. This part is very important for the image processing by thresholding. To solve this problem I have arranged the illumination with additional lamps or by simply avoiding the direct light on the board. This will be seen in the chapter 4 of this thesis. - Analyse the images of the sign- in board and compare with other photographs. - Find out where the markers are (in, temporarily away, away). - Display the results in a web application. The main goals of the whole project are: 1. To give an overview of possible awareness systems, their technical requirements and limitations, and their potential social implications. 2. To implement a sensor-based awareness system in prototype form at IPLab (SIBO). 3. To study the potential users’ attitudes towards this awareness system. This project involved two students, Carlos de Frutos and me. We divided among us the different parts of the project. To implement a sensor-based awareness system in prototype form at IPLab was my part of the project. De Frutos studied the social implications towards the existing awareness systems and also towards the proposed system SIBO. De Frutos and me worked together in the design of the SIBO interface, the installation of the web camera and bringing the SIBO system into service. 1.3 Outline Chapter 2 deals with the need for awareness systems and their social implications. Also an overview of awareness systems is given. Chapter 3 is about the Sign- in board at IPLab, how it works and problems found. This chapter also reviews the @work system developed at IPLab. Chapter 4 presents the SIBO system, including image processing and system interface. Chapter 5 contains the results of the SIBO system: technical evaluation and evaluation of SIBO with a small group of users. Chapter 6 discusses the results of the SIBO system and presents some ideas for future work. Chapter 7 concludes and summarizes the thesis. Finally, SIBO Matlab code is included in an appendix. 12 2 Related work This chapter presents previous research related to this Master’s thesis. All these studies are related with systems allowing us to know where the people are in a workplace. Many of these systems are composed of physical sign- in boards, cameras and sensors. All of the studies consider social implications and privacy. Moran and Saund (1999) define the collaborage concept as “a collaborative collage of physically represented information on a surface that is connected with electronic information, such as a physical In/Out board connected to a people- locator database”. The goal of the paper is to combine the advantages of physical and online systems. This study focuses on the importance of physical walls in the workplace in which it is a usual practice to put information on walls. The reason is that they are persistently visible and public. A collaborage consist of an In/Out board that contains items. These items are tracked by a controllable camera (Sony EVI-D30) connected to a Sun computer. The camera focuses on a barcode of each marker to know where the markers are located. A collaborage event is the change of location of an item. The system recognizes events and triggers electronic services. BOS (Board Observer Server) tracks the items and sends events to a Dispatcher, which routes them to Application program. The advantage of this system is that the information of the physical board can be available on the web, while the main disadvantage of using physical In/Out boards is that they are only visible in one place. The SIBO system also uses a camera but only to take photographs of the physical sign-in board. Subsequently the images are analysed to find out where the markers are. Like Moran and Saund (1999) I developed a WWW SIBO interface where the information obtained is displayed Tollmar, Sandor and Schömer (1996) developed several prototypes focused on an electronic version (@work system) of the physical sign- in board. The first prototype used a video-conference tool called “nv” that provides video-images of all users. The key of this system is to obtain the presence of co-workers. This version was tested in a limited group and after a couple of weeks the interest for the system dropped and the people stopped using it. The following prototype was a WWW interface and this fact implied that many people outside the lab could get information about the presence of the lab members. Lee, Schlueter and Girgensohn (1997) developed in response to user request a new video-based awareness system tool that was an alternative to video images. This technique uses low-cost iconic indicators that provide less succinct information than the information available in video images providing options to control privacy. Some users don’t want to provide specific activity information but only activity changes (e.g. presence, absence, availability, interruptibility). The authors come to the conclusion that “Users are willing to provide certain information but they want to exercise different degrees of control over the amount and form of the information disclosed”. Salber, Dey and Abowd (1999) studied and worked with the context toolkit. One of these applications deals with an In/Out board. It collects information about the 13 individuals who arrive and leave the building and displays information to the users. The context information si a user’s identity and the time at which they arrived or departed. The system required only a single instance of an identity presence widget located at the entrance door. Future extensions of the system were the use of additional identity presence widgets located in strategic areas. With this extension the In/Out board application could easily be extended and the location of the people could be displayed on a map. Want, Hopper, Falcão and Gibbons (1992) designed an active badge system which could be a solution to determinate the location of an individual. The active badge was designed as a personal card that emits a unique code. These periodic signals are picked up by a network of sensors that are placed around the building. The signals are sent to a master station which processes the data and displays the results showing the location of the people. The sensors need to be placed on walls, ceilings, on the entrances and exits of corridors and other public areas. However it could be simplified using existing computer networks. The application provides a table of names dynamically updating fields that contain the room number and the telephone extension. An additional field can also be displayed showing the time that the person has been in the room. 14 3 Existing system: Sign-in board IPLab was established in 1985 at the Department for Numerical Analysis and Computer Science (NADA), the Royal Institute of Technology (KTH), and is based on an interdisciplinary group of researchers and research students in computing science, linguistics, psychology, sociology and design, with common interest in human computer interaction. IPLab is colocated and closely cooperates with the Centre for User Oriented IT Design (CID). IPLab consists of about 13 senior researchers and about 20 research students. It is responsible for research and education at Master level in HCI, CSCW, graphics and object oriented programming, including supervision of about 20 Master's theses each year. The physical proximity of its members normally provides a natural way for spontaneous meetings, as well as for developing human relations. The research lab employs people with many different skills and cultures. The mix of cultures can be useful when studying how different persons interact with a new system and how they are involved. On certain mornings, when you arrive, the lab is full of activity and energy while on other days it is more or less empty. This could be confusing if you do not know the working habits of the staff members. Many of the persons who work at IPLab could be in classes, and researchers could be in the library or in a computer room. The lab also runs external research contracts that may keep the staff out of the lab's location. The working hours are not regulated, people work in the office or at home. Even if IPLab sometimes seems to be empty, the activity within the network seldom stops. 3.1 System description In order to find somebody at IPLab, staff members use the physical sign- in board (see Figure 1), placed at one of the two doors accessing the lab. Figure1. IPLab’s sign- in board 15 Each person has a blue marker that he moves on a board when he arrives and leaves the department. The board has three columns with these fields: In, Temporarily Away and Away, and one row for each person. People move their markers between the In, Temporarily Away and Away columns and optionally can write a message on the field Away (e.g. vacation, back 24/7, …). Many staff members enter through the other door because their room is placed in the corridor opposite to the board and they sometimes forget to move their marker. This is a reason why the IPLab sign- in board is little used compared with the physical sign- in board of the other parts of the NADA department. Many also feel unsure about the correct way to use the sign- in board. This fact makes many members staff distrust the sign-in board information. The use of the physical Sign- in Board is quite different between members of the lab. While some members always use the Sign- in Board to indicate their presence, others only use the board to write something they have to inform about, for example if they are on holidays or they are in a seminar. Some users move their marker to the field “In” when they are in the lab, but sometimes they forget to move their marker when they leave the lab and they are gone for day. It is also important to bear in mind that many of the members of the staff are teachers and they receive students in their rooms. Students can look at the board to get information about the presence of the teacher and where he/she is located (what is his/her room number and where it is). Not only the staff members use the physical Sign- in Board. Students and visitors see the sign- in board when they arrive at IPLab and it facilitates for them to locate a member. 3.2 Problems with the sign-in board The main advantages of the physical sign- in board are that it is persistent, public and easy to use. However, IPLab's sign- in board has several problems that make it little used and trusted. These problems of the physical sign- in board have been observed in the first part of the project. I summarize the different problems in the following points: - The physical Sign- in Board is only visible in one place. Not everybody passes by the board whe n they arrive at IPLab because their room is in the other corridor. People have several work places/offices. People do not have regular working hours and this fact implies that the location of the people by the rest of the lab members a little more difficult. The first problem is a key in the design of SIBO, which has been developed under this first premise. 16 3.3 The @work system The @work system is a web-based awareness system developed at IPLab in the 90’s. It is an electronic system that provides a web interface where you can find information about the presence of the people who works at IPLab. The @work system Figure 2. Maria Luisa’s home page The system adds information to the home page of the lab members showing the status of the individuals. The status can be selected using a pull-down menu (“here and available”, “busy”…), see Figure 2. At present the system is not used very much at IPLab. The @work system has two different modes, edit and normal mode. In edit mode, the users can change their status. In this mode you also can change your name, your e-mail direction and your personal URL. You must provide a password when entering the edit mode. People at IPLab mainly use this system to provide permanent information to potential visitors of their home page (e.g. You can reach me via e-mail or phone 790 68 17). The @Work system was a reference to design the new system interface. 17 4 Proposed system: Sign-in board online (SIBO) I have implemented a sensor-based awareness system at IPLab. This system tries to solve the main problem of the physical sign- in board, to be visible everywhere. I tried to offer the possibility to the users to access the sign- in board information through a World Wide Web interface. This system was carried out with image processing of camera images of the physical board in order to try to identify the whereabouts of a person. This system provides succinct information about presence ensuring privacy. This chapter begins with a system description of SIBO and then different approaches are discussed. 4.1 System description SIBO (Sign-In Board Online) is a computer system that takes the physical sign- in board as a reference providing it with the characteristic of being visible everywhere by everyone. SIBO uses video camera images in order to find the markers on the board for each lab member. I have tried to make a system that is so general that it can be configured to other signin boards and can be easy to modify. Briefly, the system description is shown in the following diagram: photos Web camera results SIBO program SIBO interface The SIBO system consists of three main modules. 1. The web camera takes photographs of the sign- in board at regular intervals. This photograph is saved using the local network in a Unix directory. 2. The photograph is analysed by SIBO program. This program is running on a Unix computer at the same time that the web camera takes photos (both of them are synchronized). 3. With the results of image processing a HTML document is generated 1 . In chapter 4.4 I will explain the SIBO interface with great detail. 1 SIBO interface can be found in the following URL: http://www.nada.kth.se/iplab/sibo/sibo.html Note that this address may change 18 4.1.1 Characteristics SIBO is a system to reach people using camera images of the physical sign- in board in order to try to identify where the people are at IPLab. I tried to design the SIBO system with the following characteristics that provide to the system similar aspects as the physical sign- in board: - 4.1.2 Friendly interface Intuitive and easy to use Easy to understand Reliable Quick showing the information Objectives The main objective of the SIBO system is to solve the problem that the sign- in board is only visible in one place. The SIBO system allows us to access the physical sign- in board info rmation through any computer connected to Internet. This fact implies that everybody could get to the information wherever they are. Many of the lab members could be away from the lab and the SIBO system provides them the possibility to locate and contact people working in the lab. 4.2 Image processing There is a web camera installed in front of the sign- in board. The camera takes photographs at regular intervals and these camera images are analysed by a program. Generally talking, this involves the fo llowing steps: - Analyse the images of the sign- in board (by thresholding). Find the regions (In, Temporarily Away, Away) for each person. Obtain the average of the intensity values of the regions. Compare with other photos. Find out where the markers are. Display results by Internet. I obtain a mapping from the positions on the board for each person and for each field (In, Temporarily Away, Away). In this way, I achieve a table showing which pixels correspond to a certain field. ? ? ? ? ? ? ? l María Luisa García ? Each field of a row is defined by four coordinates. I store these values in a matrix 8x42. This matrix stores the mapping of the positions of the board. This matrix allows us to look for the markers in the regions defined by the four coordinates. 19 To find a marker I check the proportion of a region that is covered by a marker. If the marker occupies enough image pixels of a region we can say that the marker is in that region. Firstly, the program checks the “In” field. If number of pixels covered is not higher than a reference value we can affirm that the marker is not here. Then it checks the “Temporarily Away” field and if the marker is not here, the program checks the “Away” field. If the marker is not anywhere, the marker is not displayed. 4.2.1 Thresholding This chapter contains results of image processing by global thresholding. One of the main points of this thesis has been to study the best lighting conditions to get a good binary image. Thresholding Figure 3. How to get a binary image Global thresholding is used to separate desirable foreground image objects (little blue markers) in which we are interested, from the regions of the image that correspond to background (white board) based on the difference in pixel intensities of each region. Black pixels correspond to background and white pixels correspond to foreground. In simple implementations, the segmentation is determined by a single parameter known as the intensity threshold (T). Each pixel in the image is compared with this T. If the pixel’s intensity is higher than T, the pixel is set to white in the output and if it is less than T, it is set to black. Not all images can be neatly segmented into foreground and background using global thresholding. Global thresholding uses a fixed threshold for all pixels in the image and therefore works only if the intensity histogram of the input image contains neatly separated peaks corresponding to the desired subject(s) and background(s). If the image contains a strong illumination gradient, global thresholding produces a very poor result, as can be seen in Figure 5. 20 Whether or not an image can be correctly segmented this way can be determined by looking at an intensity histogram of the image. Black is represented by a gray- level of 0, and white by a gray- level of 255. If it is possible to separate out the foreground of an image on the basis of pixel intensity, then the intensity of pixels within foreground objects must be distinctly different from the intensity of pixels within the background. In this case, I expect to see a distinct peak in the histogram corresponding to foreground objects such that thresholds can be chosen to isolate this peak accordingly. If such a peak does not exist, then it is unlikely that global thresholding will produce a good segmentation. I have decided to use a global thresholding method because it is easier to implement than an adaptive method 2 and requires less computations. Naturally, noise and bad illumination affects the original image and it makes thresholding fail. So I have tried to arrange the illumination with additional lamps to avoid reflexes, shadows and dark zones. However, I obtained the best result without lamps. In this way I could obtain a good binary image. This Matlab program shows the effect of thresholding: %Matlab code A = imread('board.jpg'); imhist(A); level = graythresh(A); BW = ~im2bw(A,level); A = double(A); % Gray-scale image A Ag = (A(:,:,1) + A(:,:,2) + A(:,:,3))/3; %Global thresholding T=110; Abw=(Ag(:,:) <= T); Matlab functions: - GRAYTHRESH computes the global image threshold used to convert an intensity image to a binary image with IM2BW. IM2BW converts image to binary image by thresholding. IMHIST displays a histogram of image data. The output of this program is a figure divided into four subfigures: - Figure (a) shows an image of the sign- in board. Figure (b) shows the corresponding gray- level histogram. Figure (c) is the result of global thresholding with Matlab functions. Figure (d) performs global thresholding with a threshold of 110 or 60. 2 Adaptive thresholding selects an individual threshold for each pixel based on the range of the intensity values in its local neighborhood. 21 Figure 4. Image processing by thresholding The first photograph (see Figure 4) of the sign- in board was taken with a digital camera and we used flash. The board reflects the light of the flash (white light on the board). The board also reflects the light of the lamp above the sign- in board. By looking at the gray- level histogram of the picture we can distinguish two peaks. The peak close to 250 is due to strong illumination of the flash. In view of this, we can think that the suitable threshold that I are looking for is close to 200, nevertheless, this is not correct as we can see in Figure 4.c. This threshold is not valid to find out where the markers are. Now, the problem is where to place the threshold. Using a threshold of 110 (see Figure 4.d), we get a binary image better than the image showed in Figure 4.c. Even so, we don’t obtain the best binary image. We can observe at the top of the picture that the markers appear diffused or even they do not appear in the picture. In this case, the picture taken is not the best for a good working of the system. The system with this kind of pictures could not work robustly. 22 Figure 5. Image processing by thresholding The photograph in Figure 5 of the sign- in board was taken with the same Fuji digital camera that last photo as in Figure 4. In this case I used high resolution. To avoid reflexes on the board we took the photo without flash. Examination of the corresponding gray- level histogram shows that this image is not suitable to get a binary image. The big peak close to 0 is due to darkness of the picture. In general, we cannot distinguish the different peaks very clearly. Therefore, the resulting binary image is not very good. Probable cause is the bad illumination of the board: too much darkness in the lower part of the board and too much light at the top of the board. We can observe at the top of the picture, in Figure 5.d, that the markers do not appear at the top of the picture and there is a lot of noise due to the bad illumination. The conclusion might be that this picture is not good to get a binary image by global thresholding. 23 Figure 6. Image processing by thresholding The photograph in Figure 6 also is taken with the Fuji digital camera with high resolution and without flash. I have used two additional lamps to arrange the illumination, in order to obtain a better result than in the last case shown (Figure 5). In the histogram that we can see in Figure 6.b we can distinguish neatly separated little peaks. In this case, we could think that the binary image resulting from global thresholding will not be very good as we did not know between what peaks to place the threshold. The homogeneous light in the central zone of the board allows us to get the best binary image, using a threshold of 60 (see Figure 6.d). In this picture all the markers appear perfectly. 24 Figure 7. Image processing by thresholding The photograph in Figure 7 was taken with a web camera (Philips Vesta Pro PCVC680K Super VGA 800x600 pixels). I have not used any lamps and no flash in this case. The resolution of the camera is lower than of the digital camera but I can still obtain good results in this way. Looking at the histogram in Figure 7.b we can observe that it has a big peak between 100 and 175. This means that we can distinct between background and foreground of the picture. The binary image resulting using a threshold of 110 is very good (see Figure 7.d). All markers are perfectly visible and none appears hidden or diffused. SIBO is working in these conditions of light and the results obtained are excellent. 25 Figure 8. Image processing by thresholding I would like to show an example of a photograph taken with people in front of the physical sign- in board. SIBO will discard photos like this. This problem is discussed in detail in the section: General problems, how to discard photographs. This photograph was taken with the same web camera as the photo in Figure 7. 4.2.2 General problems About illumination: The bad illumination of the board brings about mistakes in SIBO system. The board itself creates reflections and the illumination varies strongly across the board. This can be avoided by rigging the illumination. In the beginning I used two additional lamps to arrange the illumination but we obtained the best results disconnecting the lamp on top of the board. 26 About calibration: Calibration is not implemented which implies that the camera may not be moved. To move the camera means to obtain the coordinates for each region (In, Temporarily Away, Away) again. I used Photoshop to do this. The ruler that you can see in Figure 9 is in pixels. Figure 9. With Photoshop I can calculate a mapping from the regions on the board in pixels. About markers: Sometimes the marker may be missing. It may also be misplaced, in the Name field or overlapping two fields. Finally, it may be placed in the wrong field, e.g. in the Away field although the person is present. About how to discard photos: Sometimes when the camera takes a photograph there is a person in front of the signin board moving his marker or simply going past the camera. This photograph is not valid because probably most of the markers are hidden by the passing person and therefore the program can not analyse it. The program detects this problem in this way: - To compute the sum of the intensity levels for each binary image. This value is named sum_tot. To compare ‘sum_tot’ with a reference value previously calculated comparing successive photographs. If ‘sum_tot’ is higher than that value, the photograph is discarded. 27 4.3 Design and implementation This chapter contains pseudo code for the implementation of SIBO. • • • • Initialize IPLab’s data base (room, name, state, web) S(i), i = 1..41 (i: row number of the sign- in board) Initialize set of rows of the sign- in board without name no_name[i], i = 1..41 Initialize coordinates of each region (four coordinates for each region: In , Temporarily Away, Away) Initialize pixel intensities of each region without markers while (true) • • • • Get image from the sign- in board Get gray scale-image Get binary image by thresholding Compute the total sum of intensity level of the image for row = 1..41 for column = In, Temporarily Away, Away • Compute the sum of the intensity level for each region • Compare this value with the corresponding value without marker. result(i,j), i = 1..41; j = In, Temporarily Away, Away • • • Compare each region of a same row in order to find out where the marker is Update state: “IN”, “TEMPORARILY AWAY”, “AWAY”, “MISSING” Generate HTML files in this directory ~www/nada/iplab/sibo data.html (SIBO interface) data.log time.log register.log photo.html (Web camera image) In appendix 1 I explain in detail each file. How to add people to SIBO The SIBO program has a data base that contains the different data of each lab member on the physical sign- in board. This data base consists of 1 x 41 struct array, where each field of the struct contains four different fields: room, name, state and web. - 28 The field “room” stores the room number where the lab member is located. - - The field “name” contains the name of the lab member that is displayed in SIBO interface. The field “state” contains the state of the marker of each member: IN, TEMPORARILY AWAY, AWAY, MISSING. This field has as initial value “AWAY”. The field “web” contains the user name. It is used to complete a common URL of the lab members. http://iplab.nada.kth.se/iplab/jml.cgi/personView.jml?userName=x00_gaa When I want to add people I only have to fill in these four fields. The number between parenthesis shows the row of the board where the name and the marker have been put. The row number 1 is the first row from above on the left. S(33).room = '1648'; S(33).name = 'María Luisa García'; S(33).state = 'AWAY'; S(33).web = 'x00_gaa'; How to remove people from SIBO When I want to remove people we put all fields corresponding to that person to NULL. S(33).room = ' '; S(33).name = ' '; S(33).state = ' '; S(33).web = ' '; Then, I add the number of the row to the set of regions without name. This makes it possible for the system to avoid computing rows without name. no_name = [33] 4.4 System interface design The WWW interface of SIBO and the physical sign- in board are very similar. Both of them have the same fields for each person: room & name, In, Temporarily Away and Away. Blue balls looks like the little blue markers of the physical sign- in board. Finding the name and the blue balls are easy tasks for the users. The colours of the SIBO interface are chosen to be in harmony with the IPLab web page. Date and time on the top of the frame show when the SIBO interface was latest updated. We can find SIBO interface (Figure 10) in this web site: http://www.nada.kth.se/iplab/sibo/sibo.html 3 3 Note that this address may change 29 The frame on the left shows the different options of SIBO. These options are shown to the users like little buttons. They are the following: - - SIBO: SIBO reloads when you click here. Nevertheless, the reload process is performed automatically every 150 seconds. Web Cam: When you click here the latest image of the physical Sign- in Board is shown. This option provides to the users the possibility to read the different messages that the users write on the board. This option was demanded by the users. Gallery: SIBO system shows the IPLab gallery when you click here. The photographs of the different lab members are displayed on the screen. Map: The map of the lab will be shown when you click here. The map is useful to find where the room of a lab member is. You also can find other links to the web pages of IPLab, KTH and NADA. These links can provide more information for the users. Figure 10.a SIBO In Figure 10.a we can see a little box that shows a message with the date and time of the latest change of the marker. This information is displayed when putting the mouse over “blue marker”. 30 Figure 10.b SIBO alert In Figure 10.b we can see an alert window that appears when someone moves his marker. This window shows the name and the new state of the marker (In, Temporarily Away or Away). You can find the Web Cam interface (Figure 11) in the same web site, only click on “WebCam”. Figure 11. SIBO WebCam This option allows us to see the pictures taken with the web camera of the physical sign-in board. It gives us the possibility to read the different messages written on the 31 sign-in board. This option of SIBO had a good acceptance by the lab members, because it could be associated with the new system. Figure 12. IPLab’s map and gallery Many people commented that it would be useful to get a map of the lab, because sometimes people did not know where the room of a lab member was. They also commented that showing the picture of the lab members could facilitate to visitors to know how a person who works at the lab looks. That is why I endowed SIBO with these capabilities. 32 4.5 Technical requirements In this section I describe the technical requirements of the SIBO system. Hardware requirements: - Web camera (Philips Vesta Pro PCVC680K Super VGA 800x600) - Long USB cable (5 meters) - PC with Windows 98 - Sun computer running Solaris Software requirements: - Photoshop 6.0 - Matlab 6 - Philips Vesta Pro PCVC680K drivers version 1.2 In Figure 12 we can see the whole system and how all components are connected. Long USB cable (5 meters) Sign- in board Server room ¹ Web camera (Philips Vesta Pro) ¿À ¿À Sun Computer (running Matlab 6) PC with W98 Network Connecting to Unix machine Figure 12. How SIBO works 33 How the web camera was installed I used an electrical drill to fix the web camera on the wall situated in front of the signin board. Then I placed the PC with windows 98 in the IPLab’s Server Room that is close to the sign- in board. And finally, I connected the web camera with the PC computer with a long US B cable of five meters. Accessing a Unix account from Windows 98 I needed a way of accessing a Unix account, in which Matlab program was running, from Windows 98, in which web camera software was running taking photographs of the sign- in board every five minutes. I found the solution to this problem in Systemgruppen’s web site [11] (Nada system staff). This involved the following steps “to connect” the web camera with the Unix machine. - In Network Neighborhood you can find a machine called nt-unix-1, it is a Unix machine running Samba. If you double click on it you receive a log in dialog which allows you to mount your Unix account on the PC with Windows 98. If you have a Windows 9x or NT machine you administer yourself, you need to set a registry key to allow it to send clear text passwords. - On Windows 98 the key is: Run REGEDIT program (Registry Editor) [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\VNE TSUP] "EnablePlainTextPassword"=dword:00000001 In this way I achieved to start the SIBO system 4.6 Impact of proposed system The sign- in board was little used before I started this Master’s project. Now many people have started to use the sign- in board moving their marker and writing a message in the field Away frequently. Why this happens could be a result of many factors. Possible reasons are: - 34 SIBO was being implemented. People wanted to know what the SIBO system was. Many people moved their marker to test the SIBO system. People who saw the web camera mounted in front of the board thought that everybody could see that they didn’t move their marker. People saw others who never used the sign- in board before moving their markers. 5. Results SIBO has been achieved with good results. System improvements have given an even better performance of the SIBO system. The main system improvements after user evaluation were: - - SIBO information You can obtain information (date and time) about when a marker was last moved. SIBO alert An alert window appears when somebody moves his marker. SIBO was evaluated during two weeks and during that period of time I obtained good results. During the technical evaluation of the SIBO system I could observe that it updated the markers correctly when someone moved his marker to other fields. I could observe that SIBO Webcam reloaded automatically every 150 seconds but sometimes the browser took the picture that it had in the cache memory. This problem can be solved if you click on the reload button when you are in the Webcam option. I found through experiments that this problem depends on the operating system and the version of the browser. Testing SIBO I also have observed that it could not be running during all the day (only 10 hours more or less). That was due to problems with Kerberos (Kerberos tickets expire on the Unix Machine) and the security system at NADA. Another problem observed is that the camera sometimes cannot save the picture in the Unix computer. One possible reason could be failures on the network. When the alert window and the SIBO information were evaluated I found that SIBO information cannot be displayed on Mac computers. This problem was solved using a JavaScript alert that is shown when you click on “blue ball”. The Mac browsers do not work in the same way that Windows or Unix browsers with the ‘’alt’’ HTML attribute of the image. Considering this the system evaluation must be considered fully acceptable. 35 6. Discussion and future work A suggestion for future work could be to implement an adaptive thresholding to get a better binary image. Adaptive thresholding works quite well when there are changing lighting conditions in the images due to strong illumination gradient or shadows which occur in our case. In this way we would get a robust system. I have chosen to use a global thresholding for getting a binary image because it requires less computations than an adaptive thresholding. With the current lighting conditions I achieved good results. It would also be interesting to investigate if a matte board to avoid reflexes could be used for better results. The current physical sign- in board itself creates reflexes that disturb the global thresholding. I obtained a mapping of the regions of the physical sign- in board manually. If the camera is moved I need to recalculate the regions. Maybe an application that extracts grid corners of the board is a good idea. Considering the distortion of the image would then be necessary. Users suggested some ideas and improvements for a future version of the SIBO system. I present some suggestions for future work. - - - To recognize that someone has left or arrived and show this information on the web page with some kind of visual signal (i.e. at what time the person moved the marker). o This suggestion has already been implemented in the SIBO system (SIBO information) That the messages written in the “Away” field can be visible on the web page. There are two possible ways to do this: o To consider the idea to copy the message of the field as a picture and show it in SIBO interface. This method is easy to implement but a camera with a good resolution is needed. o To use automatic recognition of hand-written characters. This method is more elaborate than other but I think it is better. Some kind of report at the end of the month. In this way we could kno w how many persons moved their marker in order to make some kind of statistics. Some users have suggested more frequent updates. They thought that five minutes was a too long interval between updates. In response to user requests I decided to change this and now the updates take place every two minutes. 36 7. Conclusions The aim of this Master’s project has been to implement a sensor based awareness system in prototype form, Sign-In Board Online (SIBO). SIBO has been implemented using computer vision techniques that provide the system with the capability to recognize where the different markers of the physical sign- in board are. World Wide Web provides an easy and quick way to access sign- in board information. In this way the information that the SIBO system provides is available for everybody all the time. While the SIBO system was developed I observed and experimented how the different users interacted with the new tool. One of the positive influences of the SIBO system on the users is that they have get a better personal relation between them since they show their presence to the others and a have way to say if they are available or not. In my opinion, the SIBO system is a useful tool that provides the users with online information about their colleagues’ presence through WWW interface that is easy to use. 37 38 Bibliography Bogdan, C. and Sundblad, O. (1999). A cue-based, integrated system for supporting social awareness. Report number: TRITA-NA-D9904, CID-45. Fisher, R., Perkins, S., Walker, A., Wolfart, E. (2000). Image processing learning resources. http://www.dai.ed.ac.uk/HIPR2/hipr_top.htm. Last visited June 2001. González, R. C. and Wintz, P. (1992). Digital image processing, Second Edition. Addisson-Wesley Publishing Edition. Lee, A., Schlueter, K., Girgensohn, A. (1997). Sensing activity in video images. Proceedings of CHI'97, Atlanta, Georgia, USA, 22-27 March. The MatWorks, Inc. Getting started with Matlab (Online manual in PDF). file:/afs/nada.kth.se/pkg/matlab/5.3/help/pdf_doc/matlab/getstart.pdf. Last visited May 2001. The MathWorks, Inc. Image processing toolbox, user’s guide (Online manual in PDF). file:/afs/nada.kth.se/pkg/matlab/5.3/help/pdf_doc/images/images_tb.pdf. Last visited July 2001. Moran, T. P., Saund, E., van Melle, W., Gujar, A. U., Fishkin, K. P., Harrison, B. L. (1999). The ins and outs of collaborative walls: demonstrating the collaborage concept. Proceedings of CHI'99, pp.192-193. Moran, T. P., Saund, E., van Melle, W., Gujar, A. U., Fishkin, K. P., Harrison, B. L. (1999). Design and technology for collaborage: collaborative collages of information on physical walls. UIST '99 (ACM Symposium on User Interface Software and Technology). Salver, D., Dey, A. K. and Abowd, G. D. (1999). The context toolkit: Aiding the development of context-enabled applications. Proceedings of CHI´99, Pittsburgh, PA, USA, May 15-20. Sonka, M. Digital image processing. (2000). http://www.icaen.uiowa.edu/~dip/LECTURE/contents.html. Last visited May 2001. Systemgruppen’s web site. (2001). File sharing. http://www.sgr.nada.kth.se/win/docs/file_sharing.html. Last visited July 2001. Tollmar, K., Sandor, O. and Schömer, A. (1996). Supporting social awareness @work design and experience. Proceedings of ACM, CSCW’96, pp. 298-307, Cambridge MA, USA. Want, R., Hopper, A., Falcão, V. and Gibbons, J. (1992). The active badge location system. Proceedings of ACM 92, pp. 91-102. 39 40 Appendix 1: SIBO system In the following diagram you can see how the SIBO system works. sign0.jpg SIBO PROGRAM sibo.m register.log time.log data.log photo.html SIBO alert data.html SIBO information All these files are found in this directory: ~www/nada/iplab/sibo • sign0.jpg The photograph taken by the web camera is named sign0.jpg. SIBO program uses this picture to find out where the markers are. This picture is updated every 150 seconds. • sibo.m SIBO Matlab code is the core of the SIBO system. It is synchronized with the web camera in order to get the photograph before SIBO program is executed. SIBO works with the following files: In files: sign0.jpg Out files: data.log, photo.html, data.html In/Out files: register.log, time.log • time.log This file is modified by SIBO when it notices that a change in the state of the some marker has occurred. This log file shows the last update of the marker: 41 date and time. There are a date and a time stored for each lab member. You can get this information when clicking on “blue marker”. Date_time 07-Aug-2001 17:52:49 06-Aug-2001 21:55:35 06-Aug-2001 21:55:35 06-Aug-2001 21:55:35 08-Aug-2001 12:42:08 07-Aug-2001 10:54:15 06-Aug-2001 20:57:54 ………………………. • register.log In this file we can find four different states: 1 → IN 2 → TEMPORARILY AWAY 3 → AWAY 4 → ERROR / MISSING SIBO compares this log file with the results obtained with the image analysis. If a change has occurred SIBO display a little window with this advice (SIBO alert). State 3 2 3 3 1 3 4 … • data.log When a photo is discarded SIBO generates a log file that shows at what time this occurred. Sign-in board People in front of the sign- in board → discard photo 08-Aug-2001 13:52:07 42 • photo.html WebCam interface • data.html SIBO interface Appendix 2: Matlab program % SIBO working 23-July-01 % Image processing to get a binary image by thresholding (T=110) % clear; %contador = 1; while 1 clear; %%%%%%%%%%%%% % DATA BASE % %%%%%%%%%%%%% %S= 1x41 struct array with fields: room, name, state, web. % 1st column S(1).room = '4613'; S(1).name = 'Anette Arling'; S(1).state = 'AWAY'; S(1).web = 'an1'; S(2).room = '1614'; S(2).name = 'Ann Bengtson'; S(2).state = 'AWAY'; S(2).web = 'ann'; S(3).room = '1613'; S(3).name = 'Henrik Artman'; S(3).state = 'AWAY'; S(3).web = 'artman'; S(4).room = '1641'; S(4).name = 'Cristian Bogdan'; S(4).state = 'AWAY'; S(4).web = 'cristi'; S(5).room = '1648'; S(5).name = 'Rickard Buch'; S(5).state = 'AWAY'; S(5).web = 'buch'; S(6).room = '1631'; S(6).name = 'Olle Bälter'; S(6).state = 'AWAY'; S(6).web = 'balter'; S(7).room = ' '; S(7).name = ' '; S(7).state = 'AWAY'; S(7).web = ' '; S(8).room = '1631'; S(8).name = 'Tessy Cerrato'; S(8).state = 'AWAY'; 43 S(8).web = 'tessy'; S(9).room = '1627'; S(9).name = 'Hercules Dalianis'; S(9).state = 'AWAY'; S(9).web = 'hercules'; S(10).room = '1612'; S(10).name = 'Serafim Dahl'; S(10).state = 'AWAY'; S(10).web = 'serafim'; S(11).room = '1645'; S(11).name = 'Rickard Domeij'; S(11).state = 'AWAY'; S(11).web = 'domeij'; S(12).room = '1641'; S(12).name = 'Björn EiderBäck'; S(12).state = 'AWAY'; S(12).web = 'bjorne'; S(13).room = '1623'; S(13).name = 'Kerstin S Eklundh'; S(13).state = 'AWAY'; S(13).web = 'kse'; S(14).room = '1630'; S(14).name = 'Per-Anders Forstorp'; S(14).state = 'AWAY'; S(14).web = 'forstorp'; S(15).room = '1644'; S(15).name = 'Anders Green'; S(15).state = 'AWAY'; S(15).web = 'green'; S(16).room = '1643'; S(16).name = 'Kristina Groth'; S(16).state = 'AWAY'; S(16).web = 'kicki'; S(17).room = 'xxxx'; S(17).name = 'xxxx'; S(17).state = 'AWAY'; S(17).web = ' '; S(18).room = 'xxxx'; S(18).name = 'xxxx'; S(18).state = 'AWAY'; S(18).web = ' '; S(19).room = '1644'; S(19).name = 'Helge Hüttenrauch'; S(19).state = 'AWAY'; S(19).web = 'hehu'; S(20).room = '1643'; S(20).name = 'Kai-Mikael Jää-Aro'; S(20).state = 'AWAY'; S(20).web = 'kai'; 44 S(21).room = '1646'; S(21).name = 'Hee-Cheol (Ezra) Kim'; S(21).state = 'AWAY'; S(21).web = 'heeki'; S(22).room = '1632'; S(22).name = 'Lars Kjelldahl'; S(22).state = 'AWAY'; S(22).web = 'lassekj'; S(23).room = '1645'; S(23).name = 'Ola Knutsson'; S(23).state = 'AWAY'; S(23).web = 'knutsson'; S(24).room = '4617'; S(24).name = 'Ann Lantz'; S(24).state = 'AWAY'; S(24).web = 'alz'; S(25).room = 'xxxx'; S(25).name = 'xxxx'; S(25).state = 'AWAY'; S(25).web = ' '; % 2nd column S(26).room = ' '; S(26).name = ' '; S(26).state = 'AWAY'; S(26).web = ' '; S(27).room = ' '; S(27).name = ' '; S(27).state = 'AWAY'; S(27).web = ' '; S(28).room = ' '; S(28).name = ' '; S(28).state = 'AWAY'; S(28).web = ' '; S(29).room = ' '; S(29).name = ' '; S(29).state = 'AWAY'; S(29).web = ' '; S(30).room = ' '; S(30).name = ' '; S(30).state = 'AWAY'; S(30).web = ' '; S(31).room = ' '; S(31).name = ' '; S(31).state = 'AWAY'; S(31).web = ' '; S(32).room = 'torget'; S(32).name = 'Sören Lenman'; S(32).state = 'AWAY'; 45 S(32).web = 'lenman'; S(33).room = '1629'; S(33).name = 'Ulla-Britt Lindqvist'; S(33).state = 'AWAY'; S(33).web = 'ubl'; S(34).room = '1612'; S(34).name = 'Kjell Lindquist'; S(34).state = 'AWAY'; S(34).web = 'kjellq'; S(35).room = '1642'; S(35).name = 'Maria Normark'; S(35).state = 'AWAY'; S(35).web = 'marian'; S(36).room = '1628'; S(36).name = 'Lars Oestereicher'; S(36).state = 'AWAY'; S(36).web = 'larsoe'; S(37).room = '1642'; S(37).name = 'Henrry Rodríguez'; S(37).state = 'AWAY'; S(37).web = 'henrry'; S(38).room = '1615'; S(38).name = 'Staffan Romberger'; S(38).state = 'AWAY'; S(38).web = 'srom'; S(39).room = '1640'; S(39).name = 'Eva-Lotta Sallnäs'; S(39).state = 'AWAY'; S(39).web = 'evalotta'; S(40).room = ' '; S(40).name = ' '; S(40).state = 'AWAY'; S(40).web = ' '; S(41).room = '4621'; S(41).name = 'Yngve Sundblad'; S(41).state = 'AWAY'; S(41).web = 'yngve'; % Set of regions without name no_name = [7 17 18 25 26 27 28 29 30 31 40]; % values obtained %%%%%%%%%%% % REGIONS % %%%%%%%%%%% %left & right columns R = [225 50 245 50 265 50 395 45; 225 71 245 71 265 70 395 66;... 225 93 245 93 265 92 395 90; 225 115 245 115 267 112 395 110;... 227 135 247 135 267 135 395 130; 227 155 247 155 267 155 395 152;... 46 227 195;... 230 235;... 230 280;... 230 320;... 234 365;... 235 405;... 235 447;... 235 490;... 240 530;... 240 570;... 550 550 550 145;... 552 187;... 552 230;... 552 272;... 555 315;... 555 357]; 177 248 177 270 175 400 175; 229 199 250 199 270 197 400 220 250 220 270 220 400 215; 230 240 250 240 270 240 400 260 250 260 272 260 400 260; 230 282 250 282 272 282 400 305 250 305 272 305 400 300; 232 325 252 325 272 325 400 345 252 345 272 345 400 342; 235 367 252 367 275 367 400 387 252 387 275 387 400 385; 235 410 255 410 275 410 405 430 255 430 275 430 405 425; 235 450 255 450 275 450 405 470 257 470 277 470 405 470; 237 492 257 492 277 492 405 512 257 512 277 512 405 510; 240 532 257 532 280 532 405 552 260 555 280 555 405 550; 240 572 260 572 280 572 410 42 567 42 590 42 725 40; 550 62 567 62 590 62 727 60;... 85 570 85 590 85 727 82; 550 105 570 105 590 105 727 102;... 127 570 127 590 127 727 125; 550 150 570 150 590 150 727 170 570 170 590 170 730 167; 552 190 570 190 590 190 730 212 570 212 592 212 730 210; 552 232 570 232 592 232 730 255 570 255 592 255 730 250; 554 275 572 275 592 275 730 295 572 295 595 295 730 293; 555 317 572 320 595 320 730 340 572 340 595 340 732 335; 555 360 575 360 595 360 732 % 3 last rows %555 380 575 380 595 380 732 377; 555 402 575 402 595 402 732 402;... %555 422 575 422 595 422 732 420 % values of all the slots without markers Rno = [48 65 66; 72 42 106; 67 63 76; 52 40 117; 61 57 66; 83 71 143;... 119 60 135; 79 56 64; 50 39 36; 48 70 63; 50 59 48; 64 66 59;... 58 49 38; 61 69 68; 47 110 127; 35 75 43; 64 57 75; 41 40 35;... 43 43 36; 65 59 72; 69 60 68; 61 63 87;20 95 100; 85 91 102;... 63 29 62; 0 0 0; 37 89 132; 70 70 191; 61 52 63; 77 75 103;... 78 87 65; 56 55 81; 39 48 68; 55 64 174; 52 52 58; 56 34 64;... 42 34 65; 22 57 71; 17 56 131; 28 38 20; 42 48 88]; ! mv ./temp/sign0.jpg . % Original image A = imread('sign0.jpg'); A = double(A); % Gray scale image A 47 Ag = (A(:,:,1) + A(:,:,2) + A(:,:,3))/3; %Thresholding global; T=110; Abw=(Ag(:,:) <= T); sum_tot = sum(sum(Abw)); sum = 0; cont = 0; i = 1; j = 2; for fil = 1:41 for col = 1:3 for n = R(fil,j):R(fil+1,j+2) for m = R(fil,i):R(fil+1,i+2) sum = sum + Abw(n,m); cont = cont +1; %Ag(n,m) = 0; end end %res(fil,col) = sum/cont; res1(fil,col) = sum; sum = 0; cont =0; i = i+2; j = j+2; end i = 1; j = 2; end; res = res1 - Rno; for i = 1:41 % if ((res(i,1) > res(i,2)) & (res(i,1) > res(i,3)) & (res(i,1) > 80)) if ((res(i,1) > res(i,2)) & (res(i,1) > 80)) output(i) = 1; % elseif (res(i,2) > res(i,3) & (res(i,2) > 80)) elseif (res(i,2) > 80) output(i) = 2; elseif res(i,3) > 80 output(i) = 3; else output(i) = 4; end end for i = 1:41 switch output(i) case 1 S(i).state = 'IN'; case 2 S(i).state = 'TEMPORARILY AWAY'; case 3 S(i).state = 'AWAY'; %case 4 48 % S(i).state = 'MISSING'; otherwise S(i).state = 'ERROR'; end end % Find out what markers have changed recently [fstate] = textread('/afs/.nada.kth.se/public/www/iplab/sibo/register.log','%d', 'headerlines',1); [fdate,ftime] = textread('/afs/.nada.kth.se/public/www/iplab/sibo/time.log','%s %s','headerlines',1); f = {'date'}; fdate= cell2struct(fdate,f,41); f = {'time'}; ftime= cell2struct(ftime,f,41); for i = 1:41 if (output(i) == fstate(i)) change(i) = 0; else change(i) = 1; end end; %%%%%%%%%%%%%%%%%%%%%% % GENERATE data.html % %%%%%%%%%%%%%%%%%%%%%% % To discard the photo (people in front of the board) % sum_tot= 63940 only markers if sum_tot < 80000 %OK fid = fopen('/afs/.nada.kth.se/public/www/iplab/sibo/data.html','w'); date_time = datestr(now); fprintf(fid,'<html>\n'); fprintf(fid,'<head>\n'); fprintf(fid,'<META HTTP-equiv="EXPIRES" CONTENT="0">\n'); fprintf(fid,'<META HTTP-equiv="PRAGMA" CONTENT="NO-CACHE">\n'); fprintf(fid,'<META HTTP-equiv="REFRESH" CONTENT="150">\n'); fprintf(fid,'</head>\n'); fprintf(fid,'<body bgcolor=#ffffff>\n'); fprintf(fid,'<center><img SRC="iplabbut.gif" height=20 width=85 align=BOTTOM> \n'); fprintf(fid,'<b><font size=+2>Sign-in board</font></b>\n'); fprintf(fid,'<p><font size=+1>%s</font></center>\n',date_time); fprintf(fid,'<p><br>\n'); fprintf(fid,'<center><table BORDER CELLPADDING=3 COLS=5 WIDTH="80%%" BGCOLOR="#FFFFCC" NOSAVE >\n'); fprintf(fid,'<tr BGCOLOR="#3366FF">\n'); fprintf(fid,'<td WIDTH="10%%" NOSAVE><center><b><font color="#FFFFFF">Room</font></b><center></td>\n'); fprintf(fid,'<td WIDTH="20%%" NOSAVE><center><b><font color="#FFFFFF">Name</font></b><center></td>\n'); 49 fprintf(fid,'<td WIDTH="15%%" NOSAVE><center><b><font color="#FFFFFF">IN</font></b></center></td>\n'); fprintf(fid,'<td WIDTH="15%%" NOSAVE><center><b><font color="#FFFFFF">TEMPORARILY</font></b><br><b><font color="#FFFFFF">AWAY</font></b></center></td>\n'); fprintf(fid,'<td WIDTH="15%%" NOSAVE><center><b><font color="#FFFFFF">AWAY</font></b></center></td>\n'); fprintf(fid,'</tr>\n'); for i = 1:41 if ~ismember(i,no_name) fprintf(fid,'<tr>\n'); fprintf(fid,'<td>%s</td>\n',S(i).room); fprintf(fid,'<td><A HREF="http://iplab.nada.kth.se/iplab/jml.cgi/personView.jml?userName= %s" target="_top">%s</td>\n',S(i).web,S(i).name); switch output(i) case 1 if (change(i) == 0) fprintf(fid,'<td><center><a href="javascript:alert(''%s %s %s'')">',S(i).name,fdate(i).date,ftime(i).time); fprintf(fid,'<img SRC="bolablue.gif" border=0 alt="%s %s" height=10 width=10></a></center></td>\n',fdate(i).date,ftime(i).time); else fprintf(fid,'<script language="JavaScript">\n'); fprintf(fid,'var header = null\n'); fprintf(fid,'header = window.open("","","WIDTH=200,HEIGHT=50");\n'); fprintf(fid,'if (header != null){\n'); fprintf(fid,'var content="<HTML><HEAD><TITLE>SIBO alert</TITLE></HEAD>"\n'); fprintf(fid,'content += "<BODY bgcolor=''#FFFFCC''><CENTER> %s is now %s</CENTER>"\n',S(i).name,S(i).state); fprintf(fid,'content += "<FORM><CENTER><INPUT TYPE=''button''; VALUE=''OK''; onclick=''self.close()''></CENTER></FORM>"\n'); fprintf(fid,'content += "</BODY></HTML>"\n'); fprintf(fid,'header.document.write(content)\n'); fprintf(fid,'header.document.close()\n'); fprintf(fid,'}\n'); fprintf(fid,'</script>\n'); fprintf(fid,'<td><center><a href="javascript:alert(''%s %s'')">',S(i).name,date_time); fprintf(fid,'<img SRC="bolablue.gif" border=0 alt="%s" height=10 width=10></a></center></td>\n',date_time); end; fprintf(fid,'<td> </td>\n'); fprintf(fid,'<td> </td>\n'); fprintf(fid,'</tr>\n'); case 2 fprintf(fid,'<td> </td>\n'); if (change(i) == 0) fprintf(fid,'<td><center><a href="javascript:alert(''%s %s %s'')">',S(i).name,fdate(i).date,ftime(i).time); fprintf(fid,'<img SRC="bolablue.gif" border=0 alt="%s %s" height=10 width=10></a></center></td>\n',fdate(i).date,ftime(i).time); else fprintf(fid,'<script language="JavaScript">\n'); fprintf(fid,'var header = null\n'); 50 fprintf(fid,'header = window.open("","","WIDTH=200,HEIGHT=50");\n'); fprintf(fid,'if (header != null){\n'); fprintf(fid,'var content="<HTML><HEAD><TITLE>SIBO alert</TITLE></HEAD>"\n'); fprintf(fid,'content += "<BODY bgcolor=''#FFFFCC''><CENTER> %s is now %s</CENTER>"\n',S(i).name,S(i).state); fprintf(fid,'content += "<FORM><CENTER><INPUT TYPE=''button''; VALUE=''OK''; onclick=''self.close()''></CENTER></FORM>"\n'); fprintf(fid,'content += "</BODY></HTML>"\n'); fprintf(fid,'header.document.write(content)\n'); fprintf(fid,'header.document.close()\n'); fprintf(fid,'}\n'); fprintf(fid,'</script>\n'); fprintf(fid,'<td><center><a href="javascript:alert(''%s %s'')">',S(i).name,date_time); fprintf(fid,'<img SRC="bolablue.gif" border=0 alt="%s" height=10 width=10></a></center></td>\n',date_time); end; fprintf(fid,'<td> </td>\n'); fprintf(fid,'</tr>\n'); case 3 fprintf(fid,'<td> </td>\n'); fprintf(fid,'<td> </td>\n'); if (change(i) == 0) fprintf(fid,'<td><center><a href="javascript:alert(''%s %s %s'')">',S(i).name,fdate(i).date,ftime(i).time); fprintf(fid,'<img SRC="bolablue.gif" border=0 alt="%s %s" height=10 width=10></a></center></td>\n',fdate(i).date,ftime(i).time); else fprintf(fid,'<script language="JavaScript">\n'); fprintf(fid,'var header = null\n'); fprintf(fid,'header = window.open("","","WIDTH=200,HEIGHT=50");\n'); fprintf(fid,'if (header != null){\n'); fprintf(fid,'var content="<HTML><HEAD><TITLE>SIBO alert</TITLE></HEAD>"\n'); fprintf(fid,'content += "<BODY bgcolor=''#FFFFCC''><CENTER> %s is now %s</CENTER>"\n',S(i).name,S(i).state); fprintf(fid,'content += "<FORM><CENTER><INPUT TYPE=''button''; VALUE=''OK''; onclick=''self.close()''></CENTER></FORM>"\n'); fprintf(fid,'content += "</BODY></HTML>"\n'); fprintf(fid,'header.document.write(content)\n'); fprintf(fid,'header.document.close()\n'); fprintf(fid,'}\n'); fprintf(fid,'</script>\n'); fprintf(fid,'<td><center><a href="javascript:alert(''%s %s'')">',S(i).name,date_time); fprintf(fid,'<img SRC="bolablue.gif" border=0 alt="%s" height=10 width=10></a></center></td>\n',date_time); end; fprintf(fid,'</tr>\n'); otherwise fprintf(fid,'<td> </td>\n'); fprintf(fid,'<td> </td>\n'); fprintf(fid,'<td> </td>\n'); fprintf(fid,'</tr>\n'); end 51 end end fprintf(fid,'</table></center>\n'); fprintf(fid,'</body>\n'); fprintf(fid,'</html>\n'); status = fclose(fid); %Generate photo.html fid = fopen('/afs/.nada.kth.se/public/www/iplab/sibo/photo.html','w'); fprintf(fid,'<html>\n'); fprintf(fid,'<head>\n'); fprintf(fid,'<META HTTP-equiv="EXPIRES" CONTENT="0">\n'); fprintf(fid,'<META HTTP-equiv="PRAGMA" CONTENT="NO-CACHE">\n'); fprintf(fid,'<META HTTP-equiv="REFRESH" CONTENT="150">\n'); fprintf(fid,'<title>SIBO WebCam</title>\n'); fprintf(fid,'</head>\n'); fprintf(fid,'<body text="#000000" bgcolor="#FFFFFF" link="#0000EE" vlink="#551A8B" alink="#FF0000">\n'); fprintf(fid,' \n'); fprintf(fid,'<br> \n'); fprintf(fid,'<center><table BORDER=0 COLS=1 WIDTH="50%%" NOSAVE >\n'); fprintf(fid,'<tr>\n'); fprintf(fid,'<td><img SRC="sign0.jpg" height=600 width=800></td>\n'); fprintf(fid,'</tr>\n'); fprintf(fid,'<tr NOSAVE>\n'); fprintf(fid,'<td NOSAVE>\n'); fprintf(fid,'<center><b><font size=+2>SIBO WebCam</font></b>\n'); fprintf(fid,'<br><b><font size=+1>%s</font></center></b>\n',date_time); fprintf(fid,'</td>\n'); fprintf(fid,'</tr>\n'); fprintf(fid,'</table></center>\n'); fprintf(fid,'</body>\n'); fprintf(fid,'</html>\n'); fprintf(fid,'\n'); fprintf(fid,'\n'); fprintf(fid,'\n'); status = fclose(fid); %Create register.log and time.log fd = fopen('/afs/.nada.kth.se/public/www/iplab/sibo/register.log','w'); fprintf(fd,'State\n'); for i = 1:41 fprintf(fd,'%d\n',output(i)); end; status = fclose(fd); fd = fopen('/afs/.nada.kth.se/public/www/iplab/sibo/time.log','w'); fprintf(fd,'Date_time\n'); for i = 1:41 if (change(i) == 0) 52 fprintf(fd,'%s %s\n',fdate(i).date,ftime(i).time); else fprintf(fd,'%s\n',date_time); end end; status = fclose(fd); else %not valid photo date_time = datestr(now); fd = fopen('/afs/.nada.kth.se/public/www/iplab/sibo/data.log','w'); fprintf(fd,'\t\t\tSIG-IN BOARD\n\n'); fprintf(fd,'People in front of the sign-in board -> discard photo %s\n',date_time); status = fclose(fd); end; %if-else %move sign0.jpg !mv sign0.jpg ~www/nada/iplab/sibo pause(150); end; %while %%%%%%%%%end 53